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_commission(validator)[source]

Fetches the commission reward data for a validator.

Parameters

validator (ValAddress) – validator operator address

Returns

validator rewards

Return type

ValidatorCommission

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.

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

to_data()[source]

Converts the object to its JSON-serializable Python data representation.

Return type

dict

type_amino = 'distribution/MsgFundCommunityPool'
type_url: str = '/cosmos.distribution.v1beta1.MsgFundCommunityPool'
class terra_sdk.core.distribution.msgs.MsgSetWithdrawAddress(delegator_address, withdraw_address)[source]

Modify the Withdraw Address of a delegator.

Parameters
  • delegator_address (NewType()(AccAddress, str)) – delegator

  • withdraw_address (NewType()(AccAddress, str)) – new withdraw address

action = 'set_withdraw_address'
to_data()[source]

Converts the object to its JSON-serializable Python data representation.

Return type

dict

type_amino = 'distribution/MsgSetWithdrawAddress'
type_url: str = '/cosmos.distribution.v1beta1.MsgSetWithdrawAddress'
class terra_sdk.core.distribution.msgs.MsgWithdrawDelegationReward(delegator_address, validator_address)[source]

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

Parameters
  • delegator_address (NewType()(AccAddress, str)) – delegator

  • validator_address (NewType()(ValAddress, str)) – validator

action = 'withdraw_delegation_reward'
to_data()[source]

Converts the object to its JSON-serializable Python data representation.

Return type

dict

type_amino = 'distribution/MsgWithdrawDelegationReward'
type_url: str = '/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward'
class terra_sdk.core.distribution.msgs.MsgWithdrawValidatorCommission(validator_address)[source]

Withdraw rewards accrued for a validator gained through commissions.

Parameters

validator_address (NewType()(ValAddress, str)) – validator operator address

action = 'withdraw_validator_commission'
to_data()[source]

Converts the object to its JSON-serializable Python data representation.

Return type

dict

type_amino = 'distribution/MsgWithdrawValidatorCommission'
type_url: str = '/cosmos.distribution.v1beta1.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

to_data()[source]

Converts the object to its JSON-serializable Python data representation.

Return type

dict

type_amino = 'distribution/CommunityPoolSpendProposal'
type_url = '/cosmos.distribution.v1beta1.CommunityPoolSpendProposal'