Skip to main content

token-voting

Classes

TokenVotingClient

Provider a generic client with high level methods to manage and interact a Token Voting plugin installed in a DAO

TokenVotingClientDecoding

Decoding module the SDK TokenVoting Client

TokenVotingClientEncoding

Encoding module the SDK TokenVoting Client

TokenVotingClientEstimation

Estimation module the SDK TokenVoting Client

TokenVotingClientMethods

Methods module the SDK TokenVoting Client

TokenVotingClient

Provider a generic client with high level methods to manage and interact a Token Voting plugin installed in a DAO

Kind: global class

TokenVotingClient.getPluginInstallItem(params, [network]) ⇒ PluginInstallItem

Computes the parameters to be given when creating the DAO, so that the plugin is configured

Kind: static method of TokenVotingClient
Returns: PluginInstallItem

ParamTypeDefault
paramsTokenVotingPluginInstall
[network]Networkish"mainnet"

TokenVotingClient.TokenVotingClientMethods#createProposal(params) ⇒ AsyncGenerator.<ProposalCreationStepValue>

Creates a new proposal on the given TokenVoting plugin contract

Kind: static method of TokenVotingClient
Returns: AsyncGenerator.<ProposalCreationStepValue>

ParamType
paramsCreateMajorityVotingProposalParams

TokenVotingClient.TokenVotingClientMethods#voteProposal(params, vote) ⇒ AsyncGenerator.<VoteProposalStepValue>

Cast a vote on the given proposal using the client's wallet. Depending on the proposal settings, an affirmative vote may execute the proposal's actions on the DAO.

Kind: static method of TokenVotingClient
Returns: AsyncGenerator.<VoteProposalStepValue>

ParamType
paramsVoteProposalParams
voteVoteValues

TokenVotingClient.TokenVotingClientMethods#executeProposal(proposalId) ⇒ AsyncGenerator.<ExecuteProposalStepValue>

Executes the given proposal, provided that it has already passed

Kind: static method of TokenVotingClient
Returns: AsyncGenerator.<ExecuteProposalStepValue>

ParamType
proposalIdstring

TokenVotingClient.TokenVotingClientMethods#getProposal(proposalId) ⇒ Promise.<TokenVotingProposal>

Returns the details of the given proposal

Kind: static method of TokenVotingClient
Returns: Promise.<TokenVotingProposal>

ParamType
proposalIdstring

TokenVotingClient.TokenVotingClientMethods#getProposals(params) ⇒ Promise.<Array.<TokenVotingProposalListItem>>

Returns a list of proposals on the Plugin, filtered by the given criteria

Kind: static method of TokenVotingClient
Returns: Promise.<Array.<TokenVotingProposalListItem>>

ParamType
paramsProposalQueryParams

TokenVotingClient.TokenVotingClientMethods#getVotingSettings(pluginAddress, blockNumber) ⇒ Promise.<VotingSettings>

Returns the settings of a plugin given the address of the plugin instance

Kind: static method of TokenVotingClient
Returns: Promise.<VotingSettings>

ParamType
pluginAddressstring
blockNumbernumber

TokenVotingClient.TokenVotingClientMethods#getToken(pluginAddress) ⇒ Promise.<(Erc20TokenDetails|null)>

Returns the details of the token used in a specific plugin instance

Kind: static method of TokenVotingClient
Returns: Promise.<(Erc20TokenDetails|null)>

ParamType
pluginAddressstring

TokenVotingClientDecoding

Decoding module the SDK TokenVoting Client

Kind: global class

tokenVotingClientDecoding.updatePluginSettingsAction(data) ⇒ VotingSettings

Decodes a dao metadata from an encoded update metadata action

Kind: instance method of TokenVotingClientDecoding
Returns: VotingSettings

ParamType
dataUint8Array

tokenVotingClientDecoding.mintTokenAction(data) ⇒ MintTokenParams

Decodes the mint token params from an encoded mint token action

Kind: instance method of TokenVotingClientDecoding
Returns: MintTokenParams

ParamType
dataUint8Array

tokenVotingClientDecoding.findInterface(data) ⇒ InterfaceParams | null

Returns the decoded function info given the encoded data of an action

Kind: instance method of TokenVotingClientDecoding
Returns: InterfaceParams | null

ParamType
dataUint8Array

TokenVotingClientEncoding

Encoding module the SDK TokenVoting Client

Kind: global class

tokenVotingClientEncoding.updatePluginSettingsAction(pluginAddress, params) ⇒ DaoAction

Computes the parameters to be given when creating a proposal that updates the governance configuration

Kind: instance method of TokenVotingClientEncoding
Returns: DaoAction

ParamType
pluginAddressstring
paramsVotingSettings

tokenVotingClientEncoding.mintTokenAction(minterAddress, params) ⇒ DaoAction

Computes the parameters to be given when creating a proposal that mints an amount of ERC-20 tokens to an address

Kind: instance method of TokenVotingClientEncoding
Returns: DaoAction

ParamType
minterAddressstring
paramsMintTokenParams

TokenVotingClientEncoding.getPluginInstallItem(params, network) ⇒ PluginInstallItem

Computes the parameters to be given when creating the DAO, so that the plugin is configured

Kind: static method of TokenVotingClientEncoding
Returns: PluginInstallItem

ParamType
paramsTokenVotingPluginInstall
networkNetworkish

TokenVotingClientEstimation

Estimation module the SDK TokenVoting Client

Kind: global class

tokenVotingClientEstimation.createProposal(params) ⇒ Promise.<GasFeeEstimation>

Estimates the gas fee of creating a proposal on the plugin

Kind: instance method of TokenVotingClientEstimation
Returns: Promise.<GasFeeEstimation>

ParamType
paramsCreateMajorityVotingProposalParams

tokenVotingClientEstimation.voteProposal(params) ⇒ Promise.<GasFeeEstimation>

Estimates the gas fee of casting a vote on a proposal

Kind: instance method of TokenVotingClientEstimation
Returns: Promise.<GasFeeEstimation>

ParamType
paramsVoteProposalParams

tokenVotingClientEstimation.executeProposal(proposalId) ⇒ Promise.<GasFeeEstimation>

Estimates the gas fee of executing a TokenVoting proposal

Kind: instance method of TokenVotingClientEstimation
Returns: Promise.<GasFeeEstimation>

ParamType
proposalIdstring

tokenVotingClientEstimation.delegateTokens(params) ⇒ Promise.<GasFeeEstimation>

Estimates the gas fee of delegating voting power to a delegatee

Kind: instance method of TokenVotingClientEstimation
Returns: Promise.<GasFeeEstimation>

ParamType
paramsDelegateTokensParams

tokenVotingClientEstimation.undelegateTokens(tokenAddress) ⇒ Promise.<GasFeeEstimation>

Estimates the gas fee of undelegating voting power

Kind: instance method of TokenVotingClientEstimation
Returns: Promise.<GasFeeEstimation>

ParamType
tokenAddressstring

tokenVotingClientEstimation.prepareUpdate(params) ⇒ Promise.<GasFeeEstimation>

Estimates the gas fee of preparing an update

Kind: instance method of TokenVotingClientEstimation
Returns: Promise.<GasFeeEstimation>

ParamType
paramsTokenVotingPluginPrepareUpdateParams

TokenVotingClientMethods

Methods module the SDK TokenVoting Client

Kind: global class

tokenVotingClientMethods.prepareInstallation(params) ⇒ AsyncGenerator.<PrepareInstallationStepValue>

Prepares the installation of a token voting plugin in a given dao

Kind: instance method of TokenVotingClientMethods
Returns: AsyncGenerator.<PrepareInstallationStepValue>

ParamType
paramsTokenVotingPluginPrepareInstallationParams

tokenVotingClientMethods.prepareUpdate(params) ⇒ AsyncGenerator.<PrepareUpdateStepValue>

Prepares the update of a token voting plugin in a given dao

Kind: instance method of TokenVotingClientMethods
Returns: AsyncGenerator.<PrepareUpdateStepValue>

ParamType
paramsTokenVotingPluginPrepareUpdateParams

tokenVotingClientMethods.delegateTokens(params) ⇒ AsyncGenerator.<DelegateTokensStepValue>

Delegates all the signer's voting power to a delegatee

Kind: instance method of TokenVotingClientMethods
Returns: AsyncGenerator.<DelegateTokensStepValue>

ParamType
paramsDelegateTokensParams

tokenVotingClientMethods.undelegateTokens(tokenAddress) ⇒ AsyncGenerator.<UndelegateTokensStepValue>

Delegates all the signer's tokens back to itself

Kind: instance method of TokenVotingClientMethods
Returns: AsyncGenerator.<UndelegateTokensStepValue>

ParamType
tokenAddressstring

tokenVotingClientMethods.getDelegatee(tokenAddress) ⇒ Promise.<(string|null)>

Retrieves the current signer's delegatee for the given token

Kind: instance method of TokenVotingClientMethods
Returns: Promise.<(string|null)>

ParamType
tokenAddressstring

tokenVotingClientMethods.canVote(params) ⇒ Promise.<boolean>

Checks if an user can vote in a proposal

Kind: instance method of TokenVotingClientMethods
Returns: Promise.<boolean>

ParamType
paramsCanVoteParams

tokenVotingClientMethods.canExecute(proposalId) ⇒ Promise.<boolean>

Checks whether the current proposal can be executed

Kind: instance method of TokenVotingClientMethods
Returns: Promise.<boolean>

ParamType
proposalIdstring

tokenVotingClientMethods.getMembers(params) ⇒ Promise.<Array.<string>>

Returns the list of wallet addresses holding tokens from the underlying Token contract used by the plugin

Kind: instance method of TokenVotingClientMethods
Returns: Promise.<Array.<string>>

ParamTypeDescription
paramsMembersQueryParams
  • pluginAddress
    • blockNumber
    • limit = 10
    • skip = 0
    • direction = SortDirection.ASC
    • sortBy = MembersSortBy.ADDRESS

tokenVotingClientMethods.isTokenVotingCompatibleToken(tokenAddress) ⇒ Promise.<TokenVotingTokenCompatibility>

Checks if the given token is compatible with the TokenVoting plugin

Kind: instance method of TokenVotingClientMethods
Returns: Promise.<TokenVotingTokenCompatibility>

ParamType
tokenAddressstring

tokenVotingClientMethods.isMember(params) ⇒ boolean

Checks if a given address is a member of the tokenVoting contract.

Kind: instance method of TokenVotingClientMethods
Returns: boolean - A boolean indicating whether the address is a member or not.

ParamDescription
params

The parameters for the isMember method.

params.pluginAddress

The address of the plugin.

params.address

The address to check.

params.blockNumber

The block number for specifying a specific block.

© 2024