Distribution

API

class terra_sdk.client.lcd.api.distribution.DistributionAPI(c)[source]
community_pool()[source]

Fetches the community pool.

Returns

community pool

Return type

Coins

parameters()[source]

Fetches the Distribution module parameters.

Returns

Distribution module parameters

Return type

dict

rewards(delegator)[source]

Fetches the staking reward data for a delegator.

Parameters

delegator (AccAddress) – delegator account address

Returns

delegator rewards

Return type

Rewards

validator_rewards(validator)[source]

Fetches the commission reward data for a validator.

Parameters

validator (ValAddress) – validator operator address

Returns

validator rewards

Return type

ValidatorRewards

withdraw_address(delegator)[source]

Fetches the withdraw address associated with a delegator.

Parameters

delegator (AccAddress) – delegator account address

Returns

withdraw address

Return type

AccAddress

Data

class terra_sdk.client.lcd.api.distribution.Rewards(rewards, total)[source]
rewards: Dict[ValAddress, terra_sdk.core.coins.Coins]

Delegator rewards, indexed by validator operator address.

total: terra_sdk.core.coins.Coins

Total sum of rewards.

class terra_sdk.client.lcd.api.distribution.ValidatorRewards(self_bond_rewards, val_commission)[source]
self_bond_rewards: terra_sdk.core.coins.Coins

Rewards for validator accrued from self-delegation.

val_commission: terra_sdk.core.coins.Coins

Rewards for validator accrued from delegation commissions.

Messages

Distribution module message types.

class terra_sdk.core.distribution.msgs.MsgFundCommunityPool(depositor, amount)[source]

Deposit assets to the Community Pool.

Parameters
  • depositor (AccAddress) – sender

  • amount (Coins) – amount to fund community pool with

type: str = 'distribution/MsgFundCommunityPool'
class terra_sdk.core.distribution.msgs.MsgModifyWithdrawAddress(delegator_address, withdraw_address)[source]

Modify the Withdraw Address of a delegator.

Parameters
  • delegator_address (AccAddress) – delegator

  • withdraw_address (AccAddress) – new withdraw address

action = 'set_withdraw_address'
type: str = 'distribution/MsgModifyWithdrawAddress'
class terra_sdk.core.distribution.msgs.MsgWithdrawDelegationReward(delegator_address, validator_address)[source]

Withdraw rewards for a delegation specified by a (delegator, validator) pair.

Parameters
action = 'withdraw_delegation_reward'
type: str = 'distribution/MsgWithdrawDelegationReward'
class terra_sdk.core.distribution.msgs.MsgWithdrawValidatorCommission(validator_address)[source]

Withdraw rewards accrued for a validator gained through commissions.

Parameters

validator_address (ValAddress) – validator operator address

action = 'withdraw_validator_commission'
type: str = 'distribution/MsgWithdrawValidatorCommission'

Proposals

Distribution module governance proposal types.

class terra_sdk.core.distribution.proposals.CommunityPoolSpendProposal(title, description, recipient, amount)[source]

Proposal for allocating funds from the community pool to an address.

Parameters
  • title (str) – proposal title

  • description (str) – proposal description

  • recipient (AccAddress) – designated recipient of funds if proposal passes

  • amount (Coins) – amount to spend from community pool

type: str = 'distribution/CommunityPoolSpendProposal'