Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Gov

This module provides governance functionalities

More Details

since

v0.17

Hierarchy

  • Gov

Index

Methods

deposit

  • deposit(proposalID: number, amount: Coin[], baseTx: BaseTx): Promise<TxResult>
  • Deposit tokens for an active proposal.

    When the total deposit amount exceeds the MinDeposit, the proposal will enter the voting procedure.

    since

    v0.17

    Parameters

    • proposalID: number

      Identity of a proposal

    • amount: Coin[]

      Amount to be deposited

    • baseTx: BaseTx

    Returns Promise<TxResult>

queryDeposit

  • queryDeposit(proposalID: number, depositor: string): Promise<VoteResult>
  • Query a deposit of a proposal

    since

    v0.17

    Parameters

    • proposalID: number

      Identity of a proposal

    • depositor: string

      Bech32 depositor address

    Returns Promise<VoteResult>

queryDeposits

  • queryDeposits(proposalID: number): Promise<VoteResult>
  • Query all deposits of a proposal

    since

    v0.17

    Parameters

    • proposalID: number

      Identity of a proposal

    Returns Promise<VoteResult>

queryProposal

  • Query details of a single proposal

    since

    v0.17

    Parameters

    • proposalID: number

      Identity of a proposal

    Returns Promise<ProposalResult>

queryProposals

  • queryProposals(params?: types.QueryProposalsParams): Promise<ProposalResult[]>
  • Query proposals by conditions

    since

    v0.17

    Parameters

    • Optional params: types.QueryProposalsParams

    Returns Promise<ProposalResult[]>

queryTally

  • Query the statistics of a proposal

    since

    v0.17

    Parameters

    • proposalID: number

      Identity of a proposal

    Returns Promise<TallyResult>

queryVote

  • queryVote(proposalID: number, voter: string): Promise<VoteResult>
  • Query a vote

    since

    v0.17

    Parameters

    • proposalID: number

      Identity of a proposal

    • voter: string

      Bech32 voter address

    Returns Promise<VoteResult>

queryVotes

  • queryVotes(proposalID: number): Promise<VoteResult[]>
  • Query all votes of a proposal

    since

    v0.17

    Parameters

    • proposalID: number

      Identity of a proposal

    Returns Promise<VoteResult[]>

submitCommunityTaxUsageProposal

  • submitCommunityTaxUsageProposal(title: string, description: string, initialDeposit: Coin[], usage: CommunityTaxUsageType, destAddress: string, percent: number, baseTx: BaseTx): Promise<TxResult>
  • Submit a CommunityTaxUsageProposal along with an initial deposit

    There are three usages, Burn, Distribute and Grant. Burn means burning tokens from community funds. Distribute and Grant will transfer tokens to the destination trustee's account from community funds.

    The proposer must deposit at least 30% of the MinDeposit to submit a proposal.

    since

    v0.17

    Parameters

    • title: string

      Title of the proposal

    • description: string

      Description of the proposal

    • initialDeposit: Coin[]

      Initial deposit of the proposal(at least 30% of minDeposit)

    • usage: CommunityTaxUsageType

      Type of the CommunityTaxUsage

    • destAddress: string
    • percent: number

      Percentage of the current community pool to be used

    • baseTx: BaseTx

    Returns Promise<TxResult>

submitParameterChangeProposal

  • submitParameterChangeProposal(title: string, description: string, initialDeposit: Coin[], params: ChangeParameter[], baseTx: BaseTx): Promise<TxResult>
  • Submit a ParameterChangeProposal along with an initial deposit

    The proposer must deposit at least 30% of the MinDeposit to submit a proposal.

    Read about which parameters can be changed online

    since

    v0.17

    Parameters

    • title: string

      Title of the proposal

    • description: string

      Description of the proposal

    • initialDeposit: Coin[]

      Initial deposit of the proposal(at least 30% of minDeposit)

    • params: ChangeParameter[]

      On-chain Parameter to be changed, eg. [{"subspace":"mint","key":"Inflation","value":"0.05"}]

    • baseTx: BaseTx

    Returns Promise<TxResult>

submitPlainTextProposal

  • submitPlainTextProposal(title: string, description: string, initialDeposit: Coin[], baseTx: BaseTx): Promise<TxResult>
  • Submit a PlainTextProposal along with an initial deposit

    The proposer must deposit at least 30% of the MinDeposit to submit a proposal.

    since

    v0.17

    Parameters

    • title: string

      Title of the proposal

    • description: string

      Description of the proposal

    • initialDeposit: Coin[]

      Initial deposit of the proposal(at least 30% of minDeposit)

    • baseTx: BaseTx

    Returns Promise<TxResult>

vote

  • Vote for an active proposal, options: Yes/No/NoWithVeto/Abstain. Only validators and delegators can vote for proposals in the voting period.

    since

    v0.17

    Parameters

    • proposalID: number

      Identity of a proposal

    • option: VoteOption

      Vote option

    • baseTx: BaseTx

    Returns Promise<TxResult>

Generated using TypeDoc