staking
The staking
module is responsible for supporting an advanced Proof-of-Stake (PoS) system. In this system, holders of the native staking token of the chain can become validators and can delegate tokens to validators, ultimately determining the effective validator set for the system.
For more information, visit https://docs.cosmos.network/main/modules/staking/
Message Types
Msg
defines the staking Msg service.
_23 // CreateValidator defines a method for creating a new validator.
_23 rpc CreateValidator(MsgCreateValidator) returns (MsgCreateValidatorResponse);
_23 // EditValidator defines a method for editing an existing validator.
_23 rpc EditValidator(MsgEditValidator) returns (MsgEditValidatorResponse);
_23 // Delegate defines a method for performing a delegation of coins
_23 // from a delegator to a validator.
_23 rpc Delegate(MsgDelegate) returns (MsgDelegateResponse);
_23 // BeginRedelegate defines a method for performing a redelegation
_23 // of coins from a delegator and source validator to a destination validator.
_23 rpc BeginRedelegate(MsgBeginRedelegate) returns (MsgBeginRedelegateResponse);
_23 // Undelegate defines a method for performing an undelegation from a
_23 // delegate and a validator.
_23 rpc Undelegate(MsgUndelegate) returns (MsgUndelegateResponse);
_23 // CancelUnbondingDelegation defines a method for performing canceling the unbonding delegation
_23 // and delegate back to previous validator.
_23 rpc CancelUnbondingDelegation(MsgCancelUnbondingDelegation) returns (MsgCancelUnbondingDelegationResponse);
MsgCreateValidator
MsgCreateValidator
defines an SDK message for creating a new validator.
_22message MsgCreateValidator {
_22 // NOTE(fdymylja): this is a particular case in which
_22 // if validator_address == delegator_address then only one
_22 // is expected to sign, otherwise both are.
_22 option (cosmos.msg.v1.signer) = "delegator_address";
_22 option (cosmos.msg.v1.signer) = "validator_address";
_22 option (gogoproto.equal) = false;
_22 option (gogoproto.goproto_getters) = false;
_22 Description description = 1 [(gogoproto.nullable) = false];
_22 CommissionRates commission = 2 [(gogoproto.nullable) = false];
_22 string min_self_delegation = 3 [
_22 (cosmos_proto.scalar) = "cosmos.Int",
_22 (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
_22 (gogoproto.nullable) = false
_22 string delegator_address = 4 [(cosmos_proto.scalar) = "cosmos.AddressString"];
_22 string validator_address = 5 [(cosmos_proto.scalar) = "cosmos.AddressString"];
_22 google.protobuf.Any pubkey = 6 [(cosmos_proto.accepts_interface) = "cosmos.crypto.PubKey"];
_22 cosmos.base.v1beta1.Coin value = 7 [(gogoproto.nullable) = false];
MsgCreateValidatorResponse
MsgCreateValidatorResponse
defines the Msg/CreateValidator
response type.
_1message MsgCreateValidatorResponse {}
MsgEditValidator
MsgEditValidator
defines an SDK message for editing an existing validator.
_18message MsgEditValidator {
_18 option (cosmos.msg.v1.signer) = "validator_address";
_18 option (gogoproto.equal) = false;
_18 option (gogoproto.goproto_getters) = false;
_18 Description description = 1 [(gogoproto.nullable) = false];
_18 string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
_18 // We pass a reference to the new commission rate and min self delegation as
_18 // it's not mandatory to update. If not updated, the deserialized rate will be
_18 // zero with no way to distinguish if an update was intended.
_18 string commission_rate = 3
_18 [(cosmos_proto.scalar) = "cosmos.Dec", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec"];
_18 string min_self_delegation = 4
_18 [(cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int"];
MsgEditValidatorResponse
MsgEditValidatorResponse
defines the Msg/EditValidator
response type.
_1message MsgEditValidatorResponse {}
MsgDelegate
MsgDelegate
defines an SDK message for performing a delegation of coins from a delegator to a validator.
_10 option (cosmos.msg.v1.signer) = "delegator_address";
_10 option (gogoproto.equal) = false;
_10 option (gogoproto.goproto_getters) = false;
_10 string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
_10 string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
_10 cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false];
MsgDelegateResponse
MsgDelegateResponse
defines the Msg/Delegate
response type.
_1message MsgDelegateResponse {}
MsgBeginRedelegate
MsgBeginRedelegate
defines an SDK message for performing a redelegation of coins from a delegator and source validator to a destination validator.
_11message MsgBeginRedelegate {
_11 option (cosmos.msg.v1.signer) = "delegator_address";
_11 option (gogoproto.equal) = false;
_11 option (gogoproto.goproto_getters) = false;
_11 string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
_11 string validator_src_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
_11 string validator_dst_address = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"];
_11 cosmos.base.v1beta1.Coin amount = 4 [(gogoproto.nullable) = false];
MsgBeginRedelegateResponse
MsgBeginRedelegateResponse
defines the Msg/BeginRedelegate
response type.
_3message MsgBeginRedelegateResponse {
_3 google.protobuf.Timestamp completion_time = 1 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
MsgUndelegate
MsgUndelegate
defines a SDK message for performing an undelegation from a delegate and a validator.
_10message MsgUndelegate {
_10 option (cosmos.msg.v1.signer) = "delegator_address";
_10 option (gogoproto.equal) = false;
_10 option (gogoproto.goproto_getters) = false;
_10 string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
_10 string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
_10 cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false];
MsgUndelegateResponse
MsgUndelegateResponse
defines the Msg/Undelegate
response type.
_3message MsgUndelegateResponse {
_3 google.protobuf.Timestamp completion_time = 1 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
MsgCancelUnbondingDelegation
MsgCancelUnbondingDelegation
defines the SDK message for performing a cancel unbonding delegation for delegator.
_12message MsgCancelUnbondingDelegation{
_12 option (cosmos.msg.v1.signer) = "delegator_address";
_12 option (gogoproto.equal) = false;
_12 option (gogoproto.goproto_getters) = false;
_12 string delegator_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
_12 string validator_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
_12 // amount is always less than or equal to unbonding delegation entry balance
_12 cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false];
_12 // creation_height is the height which the unbonding took place.
_12 int64 creation_height = 4;
MsgCancelUnbondingDelegationResponse
MsgCancelUnbondingDelegationResponse
defines the Msg/CancelUnbondingDelegation
response type.
_1message MsgCancelUnbondingDelegationResponse{}
Queries
Query
defines the gRPC querier service.
_82 // Validators queries all validators that match the given status.
_82 rpc Validators(QueryValidatorsRequest) returns (QueryValidatorsResponse) {
_82 option (google.api.http).get = "/cosmos/staking/v1beta1/validators";
_82 // Validator queries validator info for given validator address.
_82 rpc Validator(QueryValidatorRequest) returns (QueryValidatorResponse) {
_82 option (google.api.http).get = "/cosmos/staking/v1beta1/validators/{validator_addr}";
_82 // ValidatorDelegations queries delegate info for given validator.
_82 rpc ValidatorDelegations(QueryValidatorDelegationsRequest) returns (QueryValidatorDelegationsResponse) {
_82 option (google.api.http).get = "/cosmos/staking/v1beta1/validators/{validator_addr}/delegations";
_82 // ValidatorUnbondingDelegations queries unbonding delegations of a validator.
_82 rpc ValidatorUnbondingDelegations(QueryValidatorUnbondingDelegationsRequest)
_82 returns (QueryValidatorUnbondingDelegationsResponse) {
_82 option (google.api.http).get = "/cosmos/staking/v1beta1/validators/"
_82 "{validator_addr}/unbonding_delegations";
_82 // Delegation queries delegate info for given validator delegator pair.
_82 rpc Delegation(QueryDelegationRequest) returns (QueryDelegationResponse) {
_82 option (google.api.http).get = "/cosmos/staking/v1beta1/validators/{validator_addr}/delegations/"
_82 // UnbondingDelegation queries unbonding info for given validator delegator
_82 rpc UnbondingDelegation(QueryUnbondingDelegationRequest) returns (QueryUnbondingDelegationResponse) {
_82 option (google.api.http).get = "/cosmos/staking/v1beta1/validators/{validator_addr}/delegations/"
_82 "{delegator_addr}/unbonding_delegation";
_82 // DelegatorDelegations queries all delegations of a given delegator address.
_82 rpc DelegatorDelegations(QueryDelegatorDelegationsRequest) returns (QueryDelegatorDelegationsResponse) {
_82 option (google.api.http).get = "/cosmos/staking/v1beta1/delegations/{delegator_addr}";
_82 // DelegatorUnbondingDelegations queries all unbonding delegations of a given
_82 // delegator address.
_82 rpc DelegatorUnbondingDelegations(QueryDelegatorUnbondingDelegationsRequest)
_82 returns (QueryDelegatorUnbondingDelegationsResponse) {
_82 option (google.api.http).get = "/cosmos/staking/v1beta1/delegators/"
_82 "{delegator_addr}/unbonding_delegations";
_82 // Redelegations queries redelegations of given address.
_82 rpc Redelegations(QueryRedelegationsRequest) returns (QueryRedelegationsResponse) {
_82 option (google.api.http).get = "/cosmos/staking/v1beta1/delegators/{delegator_addr}/redelegations";
_82 // DelegatorValidators queries all validators info for given delegator
_82 rpc DelegatorValidators(QueryDelegatorValidatorsRequest) returns (QueryDelegatorValidatorsResponse) {
_82 option (google.api.http).get = "/cosmos/staking/v1beta1/delegators/{delegator_addr}/validators";
_82 // DelegatorValidator queries validator info for given delegator validator
_82 rpc DelegatorValidator(QueryDelegatorValidatorRequest) returns (QueryDelegatorValidatorResponse) {
_82 option (google.api.http).get = "/cosmos/staking/v1beta1/delegators/{delegator_addr}/validators/"
_82 // HistoricalInfo queries the historical info for given height.
_82 rpc HistoricalInfo(QueryHistoricalInfoRequest) returns (QueryHistoricalInfoResponse) {
_82 option (google.api.http).get = "/cosmos/staking/v1beta1/historical_info/{height}";
_82 // Pool queries the pool info.
_82 rpc Pool(QueryPoolRequest) returns (QueryPoolResponse) {
_82 option (google.api.http).get = "/cosmos/staking/v1beta1/pool";
_82 // Parameters queries the staking parameters.
_82 rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
_82 option (google.api.http).get = "/cosmos/staking/v1beta1/params";
QueryValidatorsRequest
QueryValidatorsRequest
is request type for Query/Validators
RPC method.
_7message QueryValidatorsRequest {
_7 // status enables to query for validators matching a given status.
_7 // pagination defines an optional pagination for the request.
_7 cosmos.base.query.v1beta1.PageRequest pagination = 2;
QueryValidatorsResponse
QueryValidatorsResponse
is response type for the Query/Validators
RPC method.
_7message QueryValidatorsResponse {
_7 // validators contains all the queried validators.
_7 repeated Validator validators = 1 [(gogoproto.nullable) = false];
_7 // pagination defines the pagination in the response.
_7 cosmos.base.query.v1beta1.PageResponse pagination = 2;
QueryValidatorRequest
QueryValidatorRequest
is response type for the Query/Validator
RPC method.
_4message QueryValidatorRequest {
_4 // validator_addr defines the validator address to query for.
_4 string validator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
QueryValidatorResponse
QueryValidatorResponse
is response type for the Query/Validator
RPC method.
_4message QueryValidatorResponse {
_4 // validator defines the the validator info.
_4 Validator validator = 1 [(gogoproto.nullable) = false];
QueryValidatorDelegationsRequest
QueryValidatorDelegationsRequest
is request type for the Query/ValidatorDelegations
RPC method.
_7message QueryValidatorDelegationsRequest {
_7 // validator_addr defines the validator address to query for.
_7 string validator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
_7 // pagination defines an optional pagination for the request.
_7 cosmos.base.query.v1beta1.PageRequest pagination = 2;
QueryValidatorDelegationsResponse
QueryValidatorDelegationsResponse
is response type for the Query/ValidatorDelegations
RPC method.
_7message QueryValidatorDelegationsResponse {
_7 repeated DelegationResponse delegation_responses = 1
_7 [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "DelegationResponses"];
_7 // pagination defines the pagination in the response.
_7 cosmos.base.query.v1beta1.PageResponse pagination = 2;
QueryValidatorUnbondingDelegationsRequest
QueryValidatorUnbondingDelegationsRequest
is required type for the Query/ValidatorUnbondingDelegations
RPC method.
_7message QueryValidatorUnbondingDelegationsRequest {
_7 // validator_addr defines the validator address to query for.
_7 string validator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
_7 // pagination defines an optional pagination for the request.
_7 cosmos.base.query.v1beta1.PageRequest pagination = 2;
QueryValidatorUnbondingDelegationsResponse
QueryValidatorUnbondingDelegationsResponse
is response type for the Query/ValidatorUnbondingDelegations
RPC method.
_6message QueryValidatorUnbondingDelegationsResponse {
_6 repeated UnbondingDelegation unbonding_responses = 1 [(gogoproto.nullable) = false];
_6 // pagination defines the pagination in the response.
_6 cosmos.base.query.v1beta1.PageResponse pagination = 2;
QueryDelegationRequest
QueryDelegationRequest
is request type for the Query/Delegation
RPC method.
_10message QueryDelegationRequest {
_10 option (gogoproto.equal) = false;
_10 option (gogoproto.goproto_getters) = false;
_10 // delegator_addr defines the delegator address to query for.
_10 string delegator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
_10 // validator_addr defines the validator address to query for.
_10 string validator_addr = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
QueryDelegationResponse
QueryDelegationResponse
is response type for the Query/Delegation
RPC method.
_4message QueryDelegationResponse {
_4 // delegation_responses defines the delegation info of a delegation.
_4 DelegationResponse delegation_response = 1;
QueryUnbondingDelegationRequest
QueryUnbondingDelegationRequest
is request type for the Query/UnbondingDelegation
RPC method.
_10message QueryUnbondingDelegationRequest {
_10 option (gogoproto.equal) = false;
_10 option (gogoproto.goproto_getters) = false;
_10 // delegator_addr defines the delegator address to query for.
_10 string delegator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
_10 // validator_addr defines the validator address to query for.
_10 string validator_addr = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
QueryUnbondingDelegationResponse
QueryUnbondingDelegationResponse
is response type for the Query/UnbondingDelegation
RPC method.
_4message QueryUnbondingDelegationResponse {
_4 // unbond defines the unbonding information of a delegation.
_4 UnbondingDelegation unbond = 1 [(gogoproto.nullable) = false];
QueryDelegatorDelegationsRequest
QueryDelegatorDelegationsRequest
is request type for the Query/DelegatorDelegations
RPC method.
_10message QueryDelegatorDelegationsRequest {
_10 option (gogoproto.equal) = false;
_10 option (gogoproto.goproto_getters) = false;
_10 // delegator_addr defines the delegator address to query for.
_10 string delegator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
_10 // pagination defines an optional pagination for the request.
_10 cosmos.base.query.v1beta1.PageRequest pagination = 2;
QueryDelegatorDelegationsResponse
QueryDelegatorDelegationsResponse
is response type for the Query/DelegatorDelegations
RPC method.
_7message QueryDelegatorDelegationsResponse {
_7 // delegation_responses defines all the delegations' info of a delegator.
_7 repeated DelegationResponse delegation_responses = 1 [(gogoproto.nullable) = false];
_7 // pagination defines the pagination in the response.
_7 cosmos.base.query.v1beta1.PageResponse pagination = 2;
QueryDelegatorUnbondingDelegationsRequest
QueryDelegatorUnbondingDelegationsRequest
is request type for the Query/DelegatorUnbondingDelegations
RPC method.
_10message QueryDelegatorUnbondingDelegationsRequest {
_10 option (gogoproto.equal) = false;
_10 option (gogoproto.goproto_getters) = false;
_10 // delegator_addr defines the delegator address to query for.
_10 string delegator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
_10 // pagination defines an optional pagination for the request.
_10 cosmos.base.query.v1beta1.PageRequest pagination = 2;
QueryDelegatorUnbondingDelegationsResponse
QueryDelegatorUnbondingDelegationsResponse
is response type for the Query/DelegatorUnbondingDelegations
RPC method.
_6message QueryDelegatorUnbondingDelegationsResponse {
_6 repeated UnbondingDelegation unbonding_responses = 1 [(gogoproto.nullable) = false];
_6 // pagination defines the pagination in the response.
_6 cosmos.base.query.v1beta1.PageResponse pagination = 2;
QueryRedelegationsRequest
QueryRedelegationsRequest
is request type for the Query/Redelegations
RPC method.
_16message QueryRedelegationsRequest {
_16 option (gogoproto.equal) = false;
_16 option (gogoproto.goproto_getters) = false;
_16 // delegator_addr defines the delegator address to query for.
_16 string delegator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
_16 // src_validator_addr defines the validator address to redelegate from.
_16 string src_validator_addr = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
_16 // dst_validator_addr defines the validator address to redelegate to.
_16 string dst_validator_addr = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"];
_16 // pagination defines an optional pagination for the request.
_16 cosmos.base.query.v1beta1.PageRequest pagination = 4;
QueryRedelegationsResponse
QueryRedelegationsResponse
is response type for the Query/Redelegations
RPC method.
_6message QueryRedelegationsResponse {
_6 repeated RedelegationResponse redelegation_responses = 1 [(gogoproto.nullable) = false];
_6 // pagination defines the pagination in the response.
_6 cosmos.base.query.v1beta1.PageResponse pagination = 2;
QueryDelegatorValidatorsRequest
QueryDelegatorValidatorsRequest
is request type for the Query/DelegatorValidators
RPC method.
_10message QueryDelegatorValidatorsRequest {
_10 option (gogoproto.equal) = false;
_10 option (gogoproto.goproto_getters) = false;
_10 // delegator_addr defines the delegator address to query for.
_10 string delegator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
_10 // pagination defines an optional pagination for the request.
_10 cosmos.base.query.v1beta1.PageRequest pagination = 2;
QueryDelegatorValidatorsResponse
QueryDelegatorValidatorsResponse
is response type for the Query/DelegatorValidators
RPC method.
_7message QueryDelegatorValidatorsResponse {
_7 // validators defines the the validators' info of a delegator.
_7 repeated Validator validators = 1 [(gogoproto.nullable) = false];
_7 // pagination defines the pagination in the response.
_7 cosmos.base.query.v1beta1.PageResponse pagination = 2;
QueryDelegatorValidatorRequest
QueryDelegatorValidatorRequest
is request type for the Query/DelegatorValidator
RPC method.
_10message QueryDelegatorValidatorRequest {
_10 option (gogoproto.equal) = false;
_10 option (gogoproto.goproto_getters) = false;
_10 // delegator_addr defines the delegator address to query for.
_10 string delegator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
_10 // validator_addr defines the validator address to query for.
_10 string validator_addr = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
QueryDelegatorValidatorResponse
QueryDelegatorValidatorResponse
response type for the Query/DelegatorValidator
RPC method.
_4message QueryDelegatorValidatorResponse {
_4 // validator defines the the validator info.
_4 Validator validator = 1 [(gogoproto.nullable) = false];
QueryHistoricalInfoRequest
QueryHistoricalInfoRequest
is request type for the Query/HistoricalInfo
RPC method.
_4message QueryHistoricalInfoRequest {
_4 // height defines at which height to query the historical info.
QueryHistoricalInfoResponse
QueryHistoricalInfoResponse
is response type for the Query/HistoricalInfo
RPC method.
_4message QueryHistoricalInfoResponse {
_4 // hist defines the historical info at the given height.
_4 HistoricalInfo hist = 1;
QueryPoolRequest
QueryPoolRequest
is request type for the Query/Pool
RPC method.
_1message QueryPoolRequest {}
QueryPoolResponse
QueryPoolResponse
is response type for the Query/Pool
RPC method.
_4message QueryPoolResponse {
_4 // pool defines the pool info.
_4 Pool pool = 1 [(gogoproto.nullable) = false];
QueryParamsRequest
QueryParamsRequest
is request type for the Query/Params
RPC method.
_1message QueryParamsRequest {}
QueryParamsResponse
QueryParamsResponse
is response type for the Query/Params
RPC method.
_4message QueryParamsResponse {
_4 // params holds all the parameters of this module.
_4 Params params = 1 [(gogoproto.nullable) = false];