cosmos/staking

Table of Contents

cosmos/staking/v1beta1/staking.proto

Top

Commission

Commission defines commission parameters for a given validator.

FieldTypeLabelDescription
commission_rates CommissionRates

commission_rates defines the initial commission rates to be used for creating a validator.

update_time google.protobuf.Timestamp

update_time is the last time the commission rate was changed.

CommissionRates

CommissionRates defines the initial commission rates to be used for creating

a validator.

FieldTypeLabelDescription
rate string

rate is the commission rate charged to delegators, as a fraction.

max_rate string

max_rate defines the maximum commission rate which validator can ever charge, as a fraction.

max_change_rate string

max_change_rate defines the maximum daily increase of the validator commission, as a fraction.

DVPair

DVPair is struct that just has a delegator-validator pair with no other data.

It is intended to be used as a marshalable pointer. For example, a DVPair can

be used to construct the key to getting an UnbondingDelegation from state.

FieldTypeLabelDescription
delegator_address string

validator_address string

DVPairs

DVPairs defines an array of DVPair objects.

FieldTypeLabelDescription
pairs DVPair repeated

DVVTriplet

DVVTriplet is struct that just has a delegator-validator-validator triplet

with no other data. It is intended to be used as a marshalable pointer. For

example, a DVVTriplet can be used to construct the key to getting a

Redelegation from state.

FieldTypeLabelDescription
delegator_address string

validator_src_address string

validator_dst_address string

DVVTriplets

DVVTriplets defines an array of DVVTriplet objects.

FieldTypeLabelDescription
triplets DVVTriplet repeated

Delegation

Delegation represents the bond with tokens held by an account. It is

owned by one delegator, and is associated with the voting power of one

validator.

FieldTypeLabelDescription
delegator_address string

delegator_address is the bech32-encoded address of the delegator.

validator_address string

validator_address is the bech32-encoded address of the validator.

shares string

shares define the delegation shares received.

DelegationResponse

DelegationResponse is equivalent to Delegation except that it contains a

balance in addition to shares which is more suitable for client responses.

FieldTypeLabelDescription
delegation Delegation

balance cosmos.base.v1beta1.Coin

Description

Description defines a validator description.

FieldTypeLabelDescription
moniker string

moniker defines a human-readable name for the validator.

identity string

identity defines an optional identity signature (ex. UPort or Keybase).

website string

website defines an optional website link.

security_contact string

security_contact defines an optional email for security contact.

details string

details define other optional details.

HistoricalInfo

HistoricalInfo contains header and validator information for a given block.

It is stored as part of staking module's state, which persists the `n` most

recent HistoricalInfo

(`n` is set by the staking module's `historical_entries` parameter).

FieldTypeLabelDescription
header tendermint.types.Header

valset Validator repeated

Params

Params defines the parameters for the staking module.

FieldTypeLabelDescription
unbonding_time google.protobuf.Duration

unbonding_time is the time duration of unbonding.

max_validators uint32

max_validators is the maximum number of validators.

max_entries uint32

max_entries is the max entries for either unbonding delegation or redelegation (per pair/trio).

historical_entries uint32

historical_entries is the number of historical entries to persist.

bond_denom string

bond_denom defines the bondable coin denomination.

Pool

Pool is used for tracking bonded and not-bonded token supply of the bond

denomination.

FieldTypeLabelDescription
not_bonded_tokens string

bonded_tokens string

Redelegation

Redelegation contains the list of a particular delegator's redelegating bonds

from a particular source validator to a particular destination validator.

FieldTypeLabelDescription
delegator_address string

delegator_address is the bech32-encoded address of the delegator.

validator_src_address string

validator_src_address is the validator redelegation source operator address.

validator_dst_address string

validator_dst_address is the validator redelegation destination operator address.

entries RedelegationEntry repeated

entries are the redelegation entries. redelegation entries

RedelegationEntry

RedelegationEntry defines a redelegation object with relevant metadata.

FieldTypeLabelDescription
creation_height int64

creation_height defines the height which the redelegation took place.

completion_time google.protobuf.Timestamp

completion_time defines the unix time for redelegation completion.

initial_balance string

initial_balance defines the initial balance when redelegation started.

shares_dst string

shares_dst is the amount of destination-validator shares created by redelegation.

RedelegationEntryResponse

RedelegationEntryResponse is equivalent to a RedelegationEntry except that it

contains a balance in addition to shares which is more suitable for client

responses.

FieldTypeLabelDescription
redelegation_entry RedelegationEntry

balance string

RedelegationResponse

RedelegationResponse is equivalent to a Redelegation except that its entries

contain a balance in addition to shares which is more suitable for client

responses.

FieldTypeLabelDescription
redelegation Redelegation

entries RedelegationEntryResponse repeated

UnbondingDelegation

UnbondingDelegation stores all of a single delegator's unbonding bonds

for a single validator in an time-ordered list.

FieldTypeLabelDescription
delegator_address string

delegator_address is the bech32-encoded address of the delegator.

validator_address string

validator_address is the bech32-encoded address of the validator.

entries UnbondingDelegationEntry repeated

entries are the unbonding delegation entries. unbonding delegation entries

UnbondingDelegationEntry

UnbondingDelegationEntry defines an unbonding object with relevant metadata.

FieldTypeLabelDescription
creation_height int64

creation_height is the height which the unbonding took place.

completion_time google.protobuf.Timestamp

completion_time is the unix time for unbonding completion.

initial_balance string

initial_balance defines the tokens initially scheduled to receive at completion.

balance string

balance defines the tokens to receive at completion.

ValAddresses

ValAddresses defines a repeated set of validator addresses.

FieldTypeLabelDescription
addresses string repeated

Validator

Validator defines a validator, together with the total amount of the

Validator's bond shares and their exchange rate to coins. Slashing results in

a decrease in the exchange rate, allowing correct calculation of future

undelegations without iterating over delegators. When coins are delegated to

this validator, the validator is credited with a delegation whose number of

bond shares is based on the amount of coins delegated divided by the current

exchange rate. Voting power can be calculated as total bonded shares

multiplied by exchange rate.

FieldTypeLabelDescription
operator_address string

operator_address defines the address of the validator's operator; bech encoded in JSON.

consensus_pubkey google.protobuf.Any

consensus_pubkey is the consensus public key of the validator, as a Protobuf Any.

jailed bool

jailed defined whether the validator has been jailed from bonded status or not.

status BondStatus

status is the validator status (bonded/unbonding/unbonded).

tokens string

tokens define the delegated tokens (incl. self-delegation).

delegator_shares string

delegator_shares defines total shares issued to a validator's delegators.

description Description

description defines the description terms for the validator.

unbonding_height int64

unbonding_height defines, if unbonding, the height at which this validator has begun unbonding.

unbonding_time google.protobuf.Timestamp

unbonding_time defines, if unbonding, the min time for the validator to complete unbonding.

commission Commission

commission defines the commission parameters.

min_self_delegation string

min_self_delegation is the validator's self declared minimum self delegation.

BondStatus

BondStatus is the status of a validator.

NameNumberDescription
BOND_STATUS_UNSPECIFIED 0

UNSPECIFIED defines an invalid validator status.

BOND_STATUS_UNBONDED 1

UNBONDED defines a validator that is not bonded.

BOND_STATUS_UNBONDING 2

UNBONDING defines a validator that is unbonding.

BOND_STATUS_BONDED 3

BONDED defines a validator that is bonded.

cosmos/staking/v1beta1/query.proto

Top

QueryDelegationRequest

QueryDelegationRequest is request type for the Query/Delegation RPC method.

FieldTypeLabelDescription
delegator_addr string

delegator_addr defines the delegator address to query for.

validator_addr string

validator_addr defines the validator address to query for.

QueryDelegationResponse

QueryDelegationResponse is response type for the Query/Delegation RPC method.

FieldTypeLabelDescription
delegation_response DelegationResponse

delegation_responses defines the delegation info of a delegation.

QueryDelegatorDelegationsRequest

QueryDelegatorDelegationsRequest is request type for the

Query/DelegatorDelegations RPC method.

FieldTypeLabelDescription
delegator_addr string

delegator_addr defines the delegator address to query for.

pagination cosmos.base.query.v1beta1.PageRequest

pagination defines an optional pagination for the request.

QueryDelegatorDelegationsResponse

QueryDelegatorDelegationsResponse is response type for the

Query/DelegatorDelegations RPC method.

FieldTypeLabelDescription
delegation_responses DelegationResponse repeated

delegation_responses defines all the delegations' info of a delegator.

pagination cosmos.base.query.v1beta1.PageResponse

pagination defines the pagination in the response.

QueryDelegatorUnbondingDelegationsRequest

QueryDelegatorUnbondingDelegationsRequest is request type for the

Query/DelegatorUnbondingDelegations RPC method.

FieldTypeLabelDescription
delegator_addr string

delegator_addr defines the delegator address to query for.

pagination cosmos.base.query.v1beta1.PageRequest

pagination defines an optional pagination for the request.

QueryDelegatorUnbondingDelegationsResponse

QueryUnbondingDelegatorDelegationsResponse is response type for the

Query/UnbondingDelegatorDelegations RPC method.

FieldTypeLabelDescription
unbonding_responses UnbondingDelegation repeated

pagination cosmos.base.query.v1beta1.PageResponse

pagination defines the pagination in the response.

QueryDelegatorValidatorRequest

QueryDelegatorValidatorRequest is request type for the

Query/DelegatorValidator RPC method.

FieldTypeLabelDescription
delegator_addr string

delegator_addr defines the delegator address to query for.

validator_addr string

validator_addr defines the validator address to query for.

QueryDelegatorValidatorResponse

QueryDelegatorValidatorResponse response type for the

Query/DelegatorValidator RPC method.

FieldTypeLabelDescription
validator Validator

validator defines the the validator info.

QueryDelegatorValidatorsRequest

QueryDelegatorValidatorsRequest is request type for the

Query/DelegatorValidators RPC method.

FieldTypeLabelDescription
delegator_addr string

delegator_addr defines the delegator address to query for.

pagination cosmos.base.query.v1beta1.PageRequest

pagination defines an optional pagination for the request.

QueryDelegatorValidatorsResponse

QueryDelegatorValidatorsResponse is response type for the

Query/DelegatorValidators RPC method.

FieldTypeLabelDescription
validators Validator repeated

validators defines the the validators' info of a delegator.

pagination cosmos.base.query.v1beta1.PageResponse

pagination defines the pagination in the response.

QueryHistoricalInfoRequest

QueryHistoricalInfoRequest is request type for the Query/HistoricalInfo RPC

method.

FieldTypeLabelDescription
height int64

height defines at which height to query the historical info.

QueryHistoricalInfoResponse

QueryHistoricalInfoResponse is response type for the Query/HistoricalInfo RPC

method.

FieldTypeLabelDescription
hist HistoricalInfo

hist defines the historical info at the given height.

QueryParamsRequest

QueryParamsRequest is request type for the Query/Params RPC method.

QueryParamsResponse

QueryParamsResponse is response type for the Query/Params RPC method.

FieldTypeLabelDescription
params Params

params holds all the parameters of this module.

QueryPoolRequest

QueryPoolRequest is request type for the Query/Pool RPC method.

QueryPoolResponse

QueryPoolResponse is response type for the Query/Pool RPC method.

FieldTypeLabelDescription
pool Pool

pool defines the pool info.

QueryRedelegationsRequest

QueryRedelegationsRequest is request type for the Query/Redelegations RPC

method.

FieldTypeLabelDescription
delegator_addr string

delegator_addr defines the delegator address to query for.

src_validator_addr string

src_validator_addr defines the validator address to redelegate from.

dst_validator_addr string

dst_validator_addr defines the validator address to redelegate to.

pagination cosmos.base.query.v1beta1.PageRequest

pagination defines an optional pagination for the request.

QueryRedelegationsResponse

QueryRedelegationsResponse is response type for the Query/Redelegations RPC

method.

FieldTypeLabelDescription
redelegation_responses RedelegationResponse repeated

pagination cosmos.base.query.v1beta1.PageResponse

pagination defines the pagination in the response.

QueryUnbondingDelegationRequest

QueryUnbondingDelegationRequest is request type for the

Query/UnbondingDelegation RPC method.

FieldTypeLabelDescription
delegator_addr string

delegator_addr defines the delegator address to query for.

validator_addr string

validator_addr defines the validator address to query for.

QueryUnbondingDelegationResponse

QueryDelegationResponse is response type for the Query/UnbondingDelegation

RPC method.

FieldTypeLabelDescription
unbond UnbondingDelegation

unbond defines the unbonding information of a delegation.

QueryValidatorDelegationsRequest

QueryValidatorDelegationsRequest is request type for the

Query/ValidatorDelegations RPC method

FieldTypeLabelDescription
validator_addr string

validator_addr defines the validator address to query for.

pagination cosmos.base.query.v1beta1.PageRequest

pagination defines an optional pagination for the request.

QueryValidatorDelegationsResponse

QueryValidatorDelegationsResponse is response type for the

Query/ValidatorDelegations RPC method

FieldTypeLabelDescription
delegation_responses DelegationResponse repeated

pagination cosmos.base.query.v1beta1.PageResponse

pagination defines the pagination in the response.

QueryValidatorRequest

QueryValidatorRequest is response type for the Query/Validator RPC method

FieldTypeLabelDescription
validator_addr string

validator_addr defines the validator address to query for.

QueryValidatorResponse

QueryValidatorResponse is response type for the Query/Validator RPC method

FieldTypeLabelDescription
validator Validator

validator defines the the validator info.

QueryValidatorUnbondingDelegationsRequest

QueryValidatorUnbondingDelegationsRequest is required type for the

Query/ValidatorUnbondingDelegations RPC method

FieldTypeLabelDescription
validator_addr string

validator_addr defines the validator address to query for.

pagination cosmos.base.query.v1beta1.PageRequest

pagination defines an optional pagination for the request.

QueryValidatorUnbondingDelegationsResponse

QueryValidatorUnbondingDelegationsResponse is response type for the

Query/ValidatorUnbondingDelegations RPC method.

FieldTypeLabelDescription
unbonding_responses UnbondingDelegation repeated

pagination cosmos.base.query.v1beta1.PageResponse

pagination defines the pagination in the response.

QueryValidatorsRequest

QueryValidatorsRequest is request type for Query/Validators RPC method.

FieldTypeLabelDescription
status string

status enables to query for validators matching a given status.

pagination cosmos.base.query.v1beta1.PageRequest

pagination defines an optional pagination for the request.

QueryValidatorsResponse

QueryValidatorsResponse is response type for the Query/Validators RPC method

FieldTypeLabelDescription
validators Validator repeated

validators contains all the queried validators.

pagination cosmos.base.query.v1beta1.PageResponse

pagination defines the pagination in the response.

Query

Query defines the gRPC querier service.

Method NameRequest TypeResponse TypeDescription
Validators QueryValidatorsRequest QueryValidatorsResponse

Validators queries all validators that match the given status.

Validator QueryValidatorRequest QueryValidatorResponse

Validator queries validator info for given validator address.

ValidatorDelegations QueryValidatorDelegationsRequest QueryValidatorDelegationsResponse

ValidatorDelegations queries delegate info for given validator.

ValidatorUnbondingDelegations QueryValidatorUnbondingDelegationsRequest QueryValidatorUnbondingDelegationsResponse

ValidatorUnbondingDelegations queries unbonding delegations of a validator.

Delegation QueryDelegationRequest QueryDelegationResponse

Delegation queries delegate info for given validator delegator pair.

UnbondingDelegation QueryUnbondingDelegationRequest QueryUnbondingDelegationResponse

UnbondingDelegation queries unbonding info for given validator delegator pair.

DelegatorDelegations QueryDelegatorDelegationsRequest QueryDelegatorDelegationsResponse

DelegatorDelegations queries all delegations of a given delegator address.

DelegatorUnbondingDelegations QueryDelegatorUnbondingDelegationsRequest QueryDelegatorUnbondingDelegationsResponse

DelegatorUnbondingDelegations queries all unbonding delegations of a given delegator address.

Redelegations QueryRedelegationsRequest QueryRedelegationsResponse

Redelegations queries redelegations of given address.

DelegatorValidators QueryDelegatorValidatorsRequest QueryDelegatorValidatorsResponse

DelegatorValidators queries all validators info for given delegator address.

DelegatorValidator QueryDelegatorValidatorRequest QueryDelegatorValidatorResponse

DelegatorValidator queries validator info for given delegator validator pair.

HistoricalInfo QueryHistoricalInfoRequest QueryHistoricalInfoResponse

HistoricalInfo queries the historical info for given height.

Pool QueryPoolRequest QueryPoolResponse

Pool queries the pool info.

Params QueryParamsRequest QueryParamsResponse

Parameters queries the staking parameters.

Methods with HTTP bindings

Method Name Method Pattern Body
Validators GET /cosmos/staking/v1beta1/validators
Validator GET /cosmos/staking/v1beta1/validators/{validator_addr}
ValidatorDelegations GET /cosmos/staking/v1beta1/validators/{validator_addr}/delegations
ValidatorUnbondingDelegations GET /cosmos/staking/v1beta1/validators/{validator_addr}/unbonding_delegations
Delegation GET /cosmos/staking/v1beta1/validators/{validator_addr}/delegations/{delegator_addr}
UnbondingDelegation GET /cosmos/staking/v1beta1/validators/{validator_addr}/delegations/{delegator_addr}/unbonding_delegation
DelegatorDelegations GET /cosmos/staking/v1beta1/delegations/{delegator_addr}
DelegatorUnbondingDelegations GET /cosmos/staking/v1beta1/delegators/{delegator_addr}/unbonding_delegations
Redelegations GET /cosmos/staking/v1beta1/delegators/{delegator_addr}/redelegations
DelegatorValidators GET /cosmos/staking/v1beta1/delegators/{delegator_addr}/validators
DelegatorValidator GET /cosmos/staking/v1beta1/delegators/{delegator_addr}/validators/{validator_addr}
HistoricalInfo GET /cosmos/staking/v1beta1/historical_info/{height}
Pool GET /cosmos/staking/v1beta1/pool
Params GET /cosmos/staking/v1beta1/params

cosmos/staking/v1beta1/genesis.proto

Top

GenesisState

GenesisState defines the staking module's genesis state.

FieldTypeLabelDescription
params Params

params defines all the paramaters of related to deposit.

last_total_power bytes

last_total_power tracks the total amounts of bonded tokens recorded during the previous end block.

last_validator_powers LastValidatorPower repeated

last_validator_powers is a special index that provides a historical list of the last-block's bonded validators.

validators Validator repeated

delegations defines the validator set at genesis.

delegations Delegation repeated

delegations defines the delegations active at genesis.

unbonding_delegations UnbondingDelegation repeated

unbonding_delegations defines the unbonding delegations active at genesis.

redelegations Redelegation repeated

redelegations defines the redelegations active at genesis.

exported bool

LastValidatorPower

LastValidatorPower required for validator set update logic.

FieldTypeLabelDescription
address string

address is the address of the validator.

power int64

power defines the power of the validator.

cosmos/staking/v1beta1/authz.proto

Top

StakeAuthorization

StakeAuthorization defines authorization for delegate/undelegate/redelegate.

Since: cosmos-sdk 0.43

FieldTypeLabelDescription
max_tokens cosmos.base.v1beta1.Coin

max_tokens specifies the maximum amount of tokens can be delegate to a validator. If it is empty, there is no spend limit and any amount of coins can be delegated.

allow_list StakeAuthorization.Validators

allow_list specifies list of validator addresses to whom grantee can delegate tokens on behalf of granter's account.

deny_list StakeAuthorization.Validators

deny_list specifies list of validator addresses to whom grantee can not delegate tokens.

authorization_type AuthorizationType

authorization_type defines one of AuthorizationType.

StakeAuthorization.Validators

Validators defines list of validator addresses.

FieldTypeLabelDescription
address string repeated

AuthorizationType

AuthorizationType defines the type of staking module authorization type

Since: cosmos-sdk 0.43

NameNumberDescription
AUTHORIZATION_TYPE_UNSPECIFIED 0

AUTHORIZATION_TYPE_UNSPECIFIED specifies an unknown authorization type

AUTHORIZATION_TYPE_DELEGATE 1

AUTHORIZATION_TYPE_DELEGATE defines an authorization type for Msg/Delegate

AUTHORIZATION_TYPE_UNDELEGATE 2

AUTHORIZATION_TYPE_UNDELEGATE defines an authorization type for Msg/Undelegate

AUTHORIZATION_TYPE_REDELEGATE 3

AUTHORIZATION_TYPE_REDELEGATE defines an authorization type for Msg/BeginRedelegate

cosmos/staking/v1beta1/tx.proto

Top

MsgBeginRedelegate

MsgBeginRedelegate defines a SDK message for performing a redelegation

of coins from a delegator and source validator to a destination validator.

FieldTypeLabelDescription
delegator_address string

validator_src_address string

validator_dst_address string

amount cosmos.base.v1beta1.Coin

MsgBeginRedelegateResponse

MsgBeginRedelegateResponse defines the Msg/BeginRedelegate response type.

FieldTypeLabelDescription
completion_time google.protobuf.Timestamp

MsgCreateValidator

MsgCreateValidator defines a SDK message for creating a new validator.

FieldTypeLabelDescription
description Description

commission CommissionRates

min_self_delegation string

delegator_address string

validator_address string

pubkey google.protobuf.Any

value cosmos.base.v1beta1.Coin

MsgCreateValidatorResponse

MsgCreateValidatorResponse defines the Msg/CreateValidator response type.

MsgDelegate

MsgDelegate defines a SDK message for performing a delegation of coins

from a delegator to a validator.

FieldTypeLabelDescription
delegator_address string

validator_address string

amount cosmos.base.v1beta1.Coin

MsgDelegateResponse

MsgDelegateResponse defines the Msg/Delegate response type.

MsgEditValidator

MsgEditValidator defines a SDK message for editing an existing validator.

FieldTypeLabelDescription
description Description

validator_address string

commission_rate string

We pass a reference to the new commission rate and min self delegation as it's not mandatory to update. If not updated, the deserialized rate will be zero with no way to distinguish if an update was intended. REF: #2373

min_self_delegation string

MsgEditValidatorResponse

MsgEditValidatorResponse defines the Msg/EditValidator response type.

MsgUndelegate

MsgUndelegate defines a SDK message for performing an undelegation from a

delegate and a validator.

FieldTypeLabelDescription
delegator_address string

validator_address string

amount cosmos.base.v1beta1.Coin

MsgUndelegateResponse

MsgUndelegateResponse defines the Msg/Undelegate response type.

FieldTypeLabelDescription
completion_time google.protobuf.Timestamp

Msg

Msg defines the staking Msg service.

Method NameRequest TypeResponse TypeDescription
CreateValidator MsgCreateValidator MsgCreateValidatorResponse

CreateValidator defines a method for creating a new validator.

EditValidator MsgEditValidator MsgEditValidatorResponse

EditValidator defines a method for editing an existing validator.

Delegate MsgDelegate MsgDelegateResponse

Delegate defines a method for performing a delegation of coins from a delegator to a validator.

BeginRedelegate MsgBeginRedelegate MsgBeginRedelegateResponse

BeginRedelegate defines a method for performing a redelegation of coins from a delegator and source validator to a destination validator.

Undelegate MsgUndelegate MsgUndelegateResponse

Undelegate defines a method for performing an undelegation from a delegate and a validator.

Scalar Value Types

.proto Type Notes Python Type
double float
float float
int32 Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. int
int64 Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. int/long
uint32 Uses variable-length encoding. int/long
uint64 Uses variable-length encoding. int/long
sint32 Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. int
sint64 Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. int/long
fixed32 Always four bytes. More efficient than uint32 if values are often greater than 2^28. int
fixed64 Always eight bytes. More efficient than uint64 if values are often greater than 2^56. int/long
sfixed32 Always four bytes. int
sfixed64 Always eight bytes. int/long
bool boolean
string A string must always contain UTF-8 encoded or 7-bit ASCII text. str/unicode
bytes May contain any arbitrary sequence of bytes. str