Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Distribution

This module is in charge of distributing collected transaction fee and inflated token to all validators and delegators. To reduce computation stress, a lazy distribution strategy is brought in. lazy means that the benefit won't be paid directly to contributors automatically. The contributors are required to explicitly send transactions to withdraw their benefit, otherwise, their benefit will be kept in the global pool.

More Details

since

v0.17

Hierarchy

  • Distribution

Index

Methods

fundCommunityPool

  • fundCommunityPool(amount: Coin[], baseTx: BaseTx): Promise<TxResult>
  • fundCommunityPool allows an account to directly fund the community pool

    since

    v0.17

    Parameters

    • amount: Coin[]

      Coins to be fund

    • baseTx: BaseTx

    Returns Promise<TxResult>

queryCommunityPool

  • queryCommunityPool(): Promise<object>
  • CommunityPool queries the community pool coins.

    Returns Promise<object>

queryDelegationRewards

  • queryDelegationRewards(validator_address: string, delegator_address: string): Promise<object>
  • DelegationRewards queries the total rewards accrued by a delegation.

    Parameters

    • validator_address: string

      defines the validator address to query for

    • delegator_address: string

      defines the delegator address to query for

    Returns Promise<object>

queryDelegationTotalRewards

  • queryDelegationTotalRewards(delegator_address: string): Promise<object>
  • DelegationTotalRewards queries the total rewards accrued by a each validator.

    Parameters

    • delegator_address: string

      defines the delegator address to query for

    Returns Promise<object>

queryDelegatorValidators

  • queryDelegatorValidators(delegator_address: string): Promise<object>
  • DelegatorValidators queries the validators of a delegator.

    Parameters

    • delegator_address: string

      defines the delegator address to query for

    Returns Promise<object>

queryDelegatorWithdrawAddress

  • queryDelegatorWithdrawAddress(delegator_address: string): Promise<object>
  • DelegatorWithdrawAddress queries withdraw address of a delegator.

    Parameters

    • delegator_address: string

      defines the delegator address to query for

    Returns Promise<object>

queryParams

  • queryParams(): Promise<object>
  • Params queries params of the distribution module.

    Returns Promise<object>

queryValidatorCommission

  • queryValidatorCommission(validator_address: string): Promise<object>
  • ValidatorCommission queries accumulated commission for a validator.

    Parameters

    • validator_address: string

      Bech32 address

    Returns Promise<object>

queryValidatorOutstandingRewards

  • queryValidatorOutstandingRewards(validator_address: string): Promise<object>
  • ValidatorOutstandingRewards queries rewards of a validator address.

    Parameters

    • validator_address: string

      Bech32 address

    Returns Promise<object>

queryValidatorSlashes

  • queryValidatorSlashes(validator_address: string, starting_height?: number, ending_height?: number, page_number?: number, page_size?: number): Promise<object>
  • ValidatorSlashes queries slash events of a validator.

    Parameters

    • validator_address: string

      defines the validator address to query for.

    • Default value starting_height: number = 0

      defines the optional starting height to query the slashes.

    • Default value ending_height: number = 0

      defines the optional ending height to query the slashes.

    • Default value page_number: number = 1
    • Default value page_size: number = 10

    Returns Promise<object>

setWithdrawAddr

  • setWithdrawAddr(withdrawAddress: string, baseTx: BaseTx): Promise<TxResult>
  • Set another address to receive the rewards instead of using the delegator address

    since

    v0.17

    Parameters

    • withdrawAddress: string

      Bech32 account address

    • baseTx: BaseTx

    Returns Promise<TxResult>

withdrawRewards

  • withdrawRewards(validatorAddr: string, baseTx: BaseTx): Promise<TxResult>
  • Withdraw rewards to the withdraw-address(default to the delegator address, you can set to another address via setWithdrawAddr)

    since

    v0.17

    Parameters

    • validatorAddr: string

      withdraw from this validator address

    • baseTx: BaseTx

    Returns Promise<TxResult>

withdrawValidatorCommission

  • withdrawValidatorCommission(validator_address: string, baseTx: BaseTx): Promise<TxResult>
  • withdraws the full commission to the validator

    since

    v0.17

    Parameters

    • validator_address: string
    • baseTx: BaseTx

    Returns Promise<TxResult>

Generated using TypeDoc