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
- .TokenVotingClientMethods#createProposal(params) ⇒
AsyncGenerator.<ProposalCreationStepValue>
- .TokenVotingClientMethods#voteProposal(params, vote) ⇒
AsyncGenerator.<VoteProposalStepValue>
- .TokenVotingClientMethods#executeProposal(proposalId) ⇒
AsyncGenerator.<ExecuteProposalStepValue>
- .TokenVotingClientMethods#getProposal(proposalId) ⇒
Promise.<TokenVotingProposal>
- .TokenVotingClientMethods#getProposals(params) ⇒
Promise.<Array.<TokenVotingProposalListItem>>
- .TokenVotingClientMethods#getVotingSettings(pluginAddress, blockNumber) ⇒
Promise.<VotingSettings>
- .TokenVotingClientMethods#getToken(pluginAddress) ⇒
Promise.<(Erc20TokenDetails|null)>
- .getPluginInstallItem(params, [network]) ⇒
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
Param | Type | Default |
---|---|---|
params | TokenVotingPluginInstall | |
[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>
Param | Type |
---|---|
params | CreateMajorityVotingProposalParams |
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>
Param | Type |
---|---|
params | VoteProposalParams |
vote | VoteValues |
TokenVotingClient.TokenVotingClientMethods#executeProposal(proposalId) ⇒ AsyncGenerator.<ExecuteProposalStepValue>
Executes the given proposal, provided that it has already passed
Kind: static method of TokenVotingClient
Returns: AsyncGenerator.<ExecuteProposalStepValue>
Param | Type |
---|---|
proposalId | string |
TokenVotingClient.TokenVotingClientMethods#getProposal(proposalId) ⇒ Promise.<TokenVotingProposal>
Returns the details of the given proposal
Kind: static method of TokenVotingClient
Returns: Promise.<TokenVotingProposal>
Param | Type |
---|---|
proposalId | string |
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>>
Param | Type |
---|---|
params | ProposalQueryParams |
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>
Param | Type |
---|---|
pluginAddress | string |
blockNumber | number |
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)>
Param | Type |
---|---|
pluginAddress | string |
TokenVotingClientDecoding
Decoding module the SDK TokenVoting Client
Kind: global class
- TokenVotingClientDecoding
- .updatePluginSettingsAction(data) ⇒
VotingSettings
- .mintTokenAction(data) ⇒
MintTokenParams
- .findInterface(data) ⇒
InterfaceParams
|null
- .updatePluginSettingsAction(data) ⇒
tokenVotingClientDecoding.updatePluginSettingsAction(data) ⇒ VotingSettings
Decodes a dao metadata from an encoded update metadata action
Kind: instance method of TokenVotingClientDecoding
Returns: VotingSettings
Param | Type |
---|---|
data | Uint8Array |
tokenVotingClientDecoding.mintTokenAction(data) ⇒ MintTokenParams
Decodes the mint token params from an encoded mint token action
Kind: instance method of TokenVotingClientDecoding
Returns: MintTokenParams
Param | Type |
---|---|
data | Uint8Array |
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
Param | Type |
---|---|
data | Uint8Array |
TokenVotingClientEncoding
Encoding module the SDK TokenVoting Client
Kind: global class
- TokenVotingClientEncoding
- instance
- .updatePluginSettingsAction(pluginAddress, params) ⇒
DaoAction
- .mintTokenAction(minterAddress, params) ⇒
DaoAction
- .updatePluginSettingsAction(pluginAddress, params) ⇒
- static
- .getPluginInstallItem(params, network) ⇒
PluginInstallItem
- .getPluginInstallItem(params, network) ⇒
- instance
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
Param | Type |
---|---|
pluginAddress | string |
params | VotingSettings |
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
Param | Type |
---|---|
minterAddress | string |
params | MintTokenParams |
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
Param | Type |
---|---|
params | TokenVotingPluginInstall |
network | Networkish |
TokenVotingClientEstimation
Estimation module the SDK TokenVoting Client
Kind: global class
- TokenVotingClientEstimation
- .createProposal(params) ⇒
Promise.<GasFeeEstimation>
- .voteProposal(params) ⇒
Promise.<GasFeeEstimation>
- .executeProposal(proposalId) ⇒
Promise.<GasFeeEstimation>
- .delegateTokens(params) ⇒
Promise.<GasFeeEstimation>
- .undelegateTokens(tokenAddress) ⇒
Promise.<GasFeeEstimation>
- .prepareUpdate(params) ⇒
Promise.<GasFeeEstimation>
- .createProposal(params) ⇒
tokenVotingClientEstimation.createProposal(params) ⇒ Promise.<GasFeeEstimation>
Estimates the gas fee of creating a proposal on the plugin
Kind: instance method of TokenVotingClientEstimation
Returns: Promise.<GasFeeEstimation>
Param | Type |
---|---|
params | CreateMajorityVotingProposalParams |
tokenVotingClientEstimation.voteProposal(params) ⇒ Promise.<GasFeeEstimation>
Estimates the gas fee of casting a vote on a proposal
Kind: instance method of TokenVotingClientEstimation
Returns: Promise.<GasFeeEstimation>
Param | Type |
---|---|
params | VoteProposalParams |
tokenVotingClientEstimation.executeProposal(proposalId) ⇒ Promise.<GasFeeEstimation>
Estimates the gas fee of executing a TokenVoting proposal
Kind: instance method of TokenVotingClientEstimation
Returns: Promise.<GasFeeEstimation>
Param | Type |
---|---|
proposalId | string |
tokenVotingClientEstimation.delegateTokens(params) ⇒ Promise.<GasFeeEstimation>
Estimates the gas fee of delegating voting power to a delegatee
Kind: instance method of TokenVotingClientEstimation
Returns: Promise.<GasFeeEstimation>
Param | Type |
---|---|
params | DelegateTokensParams |
tokenVotingClientEstimation.undelegateTokens(tokenAddress) ⇒ Promise.<GasFeeEstimation>
Estimates the gas fee of undelegating voting power
Kind: instance method of TokenVotingClientEstimation
Returns: Promise.<GasFeeEstimation>
Param | Type |
---|---|
tokenAddress | string |
tokenVotingClientEstimation.prepareUpdate(params) ⇒ Promise.<GasFeeEstimation>
Estimates the gas fee of preparing an update
Kind: instance method of TokenVotingClientEstimation
Returns: Promise.<GasFeeEstimation>
Param | Type |
---|---|
params | TokenVotingPluginPrepareUpdateParams |
TokenVotingClientMethods
Methods module the SDK TokenVoting Client
Kind: global class
- TokenVotingClientMethods
- .prepareInstallation(params) ⇒
AsyncGenerator.<PrepareInstallationStepValue>
- .prepareUpdate(params) ⇒
AsyncGenerator.<PrepareUpdateStepValue>
- .delegateTokens(params) ⇒
AsyncGenerator.<DelegateTokensStepValue>
- .undelegateTokens(tokenAddress) ⇒
AsyncGenerator.<UndelegateTokensStepValue>
- .getDelegatee(tokenAddress) ⇒
Promise.<(string|null)>
- .canVote(params) ⇒
Promise.<boolean>
- .canExecute(proposalId) ⇒
Promise.<boolean>
- .getMembers(params) ⇒
Promise.<Array.<string>>
- .isTokenVotingCompatibleToken(tokenAddress) ⇒
Promise.<TokenVotingTokenCompatibility>
- .isMember(params) ⇒
boolean
- .prepareInstallation(params) ⇒
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>
Param | Type |
---|---|
params | TokenVotingPluginPrepareInstallationParams |
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>
Param | Type |
---|---|
params | TokenVotingPluginPrepareUpdateParams |
tokenVotingClientMethods.delegateTokens(params) ⇒ AsyncGenerator.<DelegateTokensStepValue>
Delegates all the signer's voting power to a delegatee
Kind: instance method of TokenVotingClientMethods
Returns: AsyncGenerator.<DelegateTokensStepValue>
Param | Type |
---|---|
params | DelegateTokensParams |
tokenVotingClientMethods.undelegateTokens(tokenAddress) ⇒ AsyncGenerator.<UndelegateTokensStepValue>
Delegates all the signer's tokens back to itself
Kind: instance method of TokenVotingClientMethods
Returns: AsyncGenerator.<UndelegateTokensStepValue>
Param | Type |
---|---|
tokenAddress | string |
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)>
Param | Type |
---|---|
tokenAddress | string |
tokenVotingClientMethods.canVote(params) ⇒ Promise.<boolean>
Checks if an user can vote in a proposal
Kind: instance method of TokenVotingClientMethods
Returns: Promise.<boolean>
Param | Type |
---|---|
params | CanVoteParams |
tokenVotingClientMethods.canExecute(proposalId) ⇒ Promise.<boolean>
Checks whether the current proposal can be executed
Kind: instance method of TokenVotingClientMethods
Returns: Promise.<boolean>
Param | Type |
---|---|
proposalId | string |
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>>
Param | Type | Description |
---|---|---|
params | MembersQueryParams |
|
tokenVotingClientMethods.isTokenVotingCompatibleToken(tokenAddress) ⇒ Promise.<TokenVotingTokenCompatibility>
Checks if the given token is compatible with the TokenVoting plugin
Kind: instance method of TokenVotingClientMethods
Returns: Promise.<TokenVotingTokenCompatibility>
Param | Type |
---|---|
tokenAddress | string |
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.
Param | Description |
---|---|
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. |