typescript-sdk

Home > @3rdweb/sdk > VoteModule

VoteModule class

Create a decentralized organization for token holders to vote on proposals.

Signature:

export declare class VoteModule extends Module<VotingGovernor> 

Extends: Module<VotingGovernor>

Example

import { ThirdwebSDK } from "@3rdweb/sdk";

// You can switch out this provider with any wallet or provider setup you like.
const provider = ethers.Wallet.createRandom();
const sdk = new ThirdwebSDK(provider);
const module = sdk.getVoteModule("");

Properties

Property Modifiers Type Description
moduleType static ModuleType  

Methods

Method Modifiers Description
balance()   Check the balance of the project wallet in the native token of the chain
balanceOfToken(tokenAddress)   Check the balance of the project wallet in a particular ERC20 token contract
canExecute(proposalId)   Can Execute
execute(proposalId)   Execute Proposal
get(proposalId)   Get a proposal by id.
getAll()   Get All Proposals
hasVoted(proposalId, account)   Check If Wallet Voted
propose(description, executions)   Create Proposal
setModuleMetadata(metadata)    
settings()    
vote(proposalId, voteType, reason)   Vote