0.0.34 • Published 4 months ago

nounsjs v0.0.34

Weekly downloads
-
License
ISC
Repository
github
Last release
4 months ago

Nouns.js

NPM Version

Nouns.js is a JavaScript/TypeScript wrapper for Nouns projects like the Nouns DAO, LilNouns DAO, Propdates, and more. Our goal is to create an intuitive toolkit to interact with these contracts, lowering the barrier of entry to this community, and enabling developer creativity.

If there's a Nouns project you think should be a part of Nouns.js, feel free to open an issue so we can add support.

Installation

Ensure you have npm installed and are in a node project.

npm install --save nounsjs

Examples

To use Nouns.js, you will need a JSON_RPC_URL from a blockchain development platform like Alchemy.

To listen to an on-chain vote event for Nouns DAO, write the following:

import { Nouns, EventData } from "nounsjs";

const nouns = new Nouns("<JSON_RPC_URL>");

nouns.on("VoteCast", (vote: EventData.VoteCast) => {
	console.log(
		"NounsDAO | VoteCast | id:" +
			vote.proposalId +
			",  voter: " +
			vote.voter.id +
			", votes: " +
			vote.votes +
			" , supportDetailed: " +
			vote.supportDetailed +
			", reason: " +
			vote.reason
	);
});

For more details on events, see: Event Types.

For more details on contract wrappers, see: Contracts.

License

Nouns.js is distributed under an MIT license.

Contribution

Nouns.js is currently not open to contribution.

If you have any suggestions or experience any bugs, please feel free to open a Github issue. We are always eager to better support the Nouns community.

0.0.34

4 months ago

0.0.1

1 year ago