Home > @3rdweb/sdk > VoteModule > vote
Vote
Signature:
vote(proposalId: string, voteType: VoteType, reason?: string): Promise<void>;
Parameter | Type | Description |
---|---|---|
proposalId | string | The proposal to cast a vote on. |
voteType | VoteType | The position the voter is taking on their vote. |
reason | string | (optional) The reason for the vote. |
Returns:
Promise<void>
Vote on an active proposal
// The proposal ID of the proposal you want to vote on
const proposalId = "0";
// The vote type you want to cast, can be VoteType.Against, VoteType.For, or VoteType.Abstain
const voteType = VoteType.For;
// The (optional) reason for the vote
const reason = "I like this proposal!";
await module.vote(proposalId, voteType, reason);