typescript-sdk

Home > @3rdweb/sdk > VoteModule > hasVoted

VoteModule.hasVoted() method

Check If Wallet Voted

Signature:

hasVoted(proposalId: string, account?: string): Promise<boolean>;

Parameters

Parameter Type Description
proposalId string The unique identifier of a proposal .
account string (optional) wallet account address. Defaults to connected signer.

Returns:

Promise<boolean>

Remarks

Check if a specified wallet has voted a specific proposal

Example

// The proposal ID of the proposal you want to check
const proposalId = "0";
// The address of the wallet you want to check to see if they voted
const address = "";

await module.hasVoted(proposalId, address);