github.com/Finschia/finschia-sdk@v0.49.1/proto/cosmos/staking/v1beta1/staking.proto (about)

     1  syntax = "proto3";
     2  package cosmos.staking.v1beta1;
     3  
     4  import "gogoproto/gogo.proto";
     5  import "google/protobuf/any.proto";
     6  import "google/protobuf/duration.proto";
     7  import "google/protobuf/timestamp.proto";
     8  
     9  import "cosmos_proto/cosmos.proto";
    10  import "cosmos/base/v1beta1/coin.proto";
    11  import "tendermint/types/types.proto";
    12  
    13  option go_package = "github.com/Finschia/finschia-sdk/x/staking/types";
    14  
    15  // HistoricalInfo contains header and validator, voter information for a given block.
    16  // It is stored as part of staking module's state, which persists the `n` most
    17  // recent HistoricalInfo
    18  // (`n` is set by the staking module's `historical_entries` parameter).
    19  message HistoricalInfo {
    20    tendermint.types.Header header = 1 [(gogoproto.nullable) = false];
    21    repeated Validator      valset = 2 [(gogoproto.nullable) = false];
    22  }
    23  
    24  // CommissionRates defines the initial commission rates to be used for creating
    25  // a validator.
    26  message CommissionRates {
    27    option (gogoproto.equal)            = true;
    28    option (gogoproto.goproto_stringer) = false;
    29  
    30    // rate is the commission rate charged to delegators, as a fraction.
    31    string rate = 1 [(gogoproto.customtype) = "github.com/Finschia/finschia-sdk/types.Dec", (gogoproto.nullable) = false];
    32    // max_rate defines the maximum commission rate which validator can ever charge, as a fraction.
    33    string max_rate = 2 [
    34      (gogoproto.moretags)   = "yaml:\"max_rate\"",
    35      (gogoproto.customtype) = "github.com/Finschia/finschia-sdk/types.Dec",
    36      (gogoproto.nullable)   = false
    37    ];
    38    // max_change_rate defines the maximum daily increase of the validator commission, as a fraction.
    39    string max_change_rate = 3 [
    40      (gogoproto.moretags)   = "yaml:\"max_change_rate\"",
    41      (gogoproto.customtype) = "github.com/Finschia/finschia-sdk/types.Dec",
    42      (gogoproto.nullable)   = false
    43    ];
    44  }
    45  
    46  // Commission defines commission parameters for a given validator.
    47  message Commission {
    48    option (gogoproto.equal)            = true;
    49    option (gogoproto.goproto_stringer) = false;
    50  
    51    // commission_rates defines the initial commission rates to be used for creating a validator.
    52    CommissionRates commission_rates = 1 [(gogoproto.embed) = true, (gogoproto.nullable) = false];
    53    // update_time is the last time the commission rate was changed.
    54    google.protobuf.Timestamp update_time = 2
    55        [(gogoproto.nullable) = false, (gogoproto.stdtime) = true, (gogoproto.moretags) = "yaml:\"update_time\""];
    56  }
    57  
    58  // Description defines a validator description.
    59  message Description {
    60    option (gogoproto.equal)            = true;
    61    option (gogoproto.goproto_stringer) = false;
    62  
    63    // moniker defines a human-readable name for the validator.
    64    string moniker = 1;
    65    // identity defines an optional identity signature (ex. UPort or Keybase).
    66    string identity = 2;
    67    // website defines an optional website link.
    68    string website = 3;
    69    // security_contact defines an optional email for security contact.
    70    string security_contact = 4 [(gogoproto.moretags) = "yaml:\"security_contact\""];
    71    // details define other optional details.
    72    string details = 5;
    73  }
    74  
    75  // Validator defines a validator, together with the total amount of the
    76  // Validator's bond shares and their exchange rate to coins. Slashing results in
    77  // a decrease in the exchange rate, allowing correct calculation of future
    78  // undelegations without iterating over delegators. When coins are delegated to
    79  // this validator, the validator is credited with a delegation whose number of
    80  // bond shares is based on the amount of coins delegated divided by the current
    81  // exchange rate. Voting power can be calculated as total bonded shares
    82  // multiplied by exchange rate.
    83  message Validator {
    84    option (gogoproto.equal)            = false;
    85    option (gogoproto.goproto_stringer) = false;
    86    option (gogoproto.goproto_getters)  = false;
    87  
    88    // operator_address defines the address of the validator's operator; bech encoded in JSON.
    89    string operator_address = 1 [(gogoproto.moretags) = "yaml:\"operator_address\""];
    90    // consensus_pubkey is the consensus public key of the validator, as a Protobuf Any.
    91    google.protobuf.Any consensus_pubkey = 2
    92        [(cosmos_proto.accepts_interface) = "cosmos.crypto.PubKey", (gogoproto.moretags) = "yaml:\"consensus_pubkey\""];
    93    // jailed defined whether the validator has been jailed from bonded status or not.
    94    bool jailed = 3;
    95    // status is the validator status (bonded/unbonding/unbonded).
    96    BondStatus status = 4;
    97    // tokens define the delegated tokens (incl. self-delegation).
    98    string tokens = 5 [(gogoproto.customtype) = "github.com/Finschia/finschia-sdk/types.Int", (gogoproto.nullable) = false];
    99    // delegator_shares defines total shares issued to a validator's delegators.
   100    string delegator_shares = 6 [
   101      (gogoproto.moretags)   = "yaml:\"delegator_shares\"",
   102      (gogoproto.customtype) = "github.com/Finschia/finschia-sdk/types.Dec",
   103      (gogoproto.nullable)   = false
   104    ];
   105    // description defines the description terms for the validator.
   106    Description description = 7 [(gogoproto.nullable) = false];
   107    // unbonding_height defines, if unbonding, the height at which this validator has begun unbonding.
   108    int64 unbonding_height = 8 [(gogoproto.moretags) = "yaml:\"unbonding_height\""];
   109    // unbonding_time defines, if unbonding, the min time for the validator to complete unbonding.
   110    google.protobuf.Timestamp unbonding_time = 9
   111        [(gogoproto.nullable) = false, (gogoproto.stdtime) = true, (gogoproto.moretags) = "yaml:\"unbonding_time\""];
   112    // commission defines the commission parameters.
   113    Commission commission = 10 [(gogoproto.nullable) = false];
   114    // min_self_delegation is the validator's self declared minimum self delegation.
   115    string min_self_delegation = 11 [
   116      (gogoproto.moretags)   = "yaml:\"min_self_delegation\"",
   117      (gogoproto.customtype) = "github.com/Finschia/finschia-sdk/types.Int",
   118      (gogoproto.nullable)   = false
   119    ];
   120  }
   121  
   122  // BondStatus is the status of a validator.
   123  enum BondStatus {
   124    option (gogoproto.goproto_enum_prefix) = false;
   125  
   126    // UNSPECIFIED defines an invalid validator status.
   127    BOND_STATUS_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "Unspecified"];
   128    // UNBONDED defines a validator that is not bonded.
   129    BOND_STATUS_UNBONDED = 1 [(gogoproto.enumvalue_customname) = "Unbonded"];
   130    // UNBONDING defines a validator that is unbonding.
   131    BOND_STATUS_UNBONDING = 2 [(gogoproto.enumvalue_customname) = "Unbonding"];
   132    // BONDED defines a validator that is bonded.
   133    BOND_STATUS_BONDED = 3 [(gogoproto.enumvalue_customname) = "Bonded"];
   134  }
   135  
   136  // ValAddresses defines a repeated set of validator addresses.
   137  message ValAddresses {
   138    option (gogoproto.goproto_stringer) = false;
   139    option (gogoproto.stringer)         = true;
   140  
   141    repeated string addresses = 1;
   142  }
   143  
   144  // DVPair is struct that just has a delegator-validator pair with no other data.
   145  // It is intended to be used as a marshalable pointer. For example, a DVPair can
   146  // be used to construct the key to getting an UnbondingDelegation from state.
   147  message DVPair {
   148    option (gogoproto.equal)            = false;
   149    option (gogoproto.goproto_getters)  = false;
   150    option (gogoproto.goproto_stringer) = false;
   151  
   152    string delegator_address = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""];
   153    string validator_address = 2 [(gogoproto.moretags) = "yaml:\"validator_address\""];
   154  }
   155  
   156  // DVPairs defines an array of DVPair objects.
   157  message DVPairs {
   158    repeated DVPair pairs = 1 [(gogoproto.nullable) = false];
   159  }
   160  
   161  // DVVTriplet is struct that just has a delegator-validator-validator triplet
   162  // with no other data. It is intended to be used as a marshalable pointer. For
   163  // example, a DVVTriplet can be used to construct the key to getting a
   164  // Redelegation from state.
   165  message DVVTriplet {
   166    option (gogoproto.equal)            = false;
   167    option (gogoproto.goproto_getters)  = false;
   168    option (gogoproto.goproto_stringer) = false;
   169  
   170    string delegator_address     = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""];
   171    string validator_src_address = 2 [(gogoproto.moretags) = "yaml:\"validator_src_address\""];
   172    string validator_dst_address = 3 [(gogoproto.moretags) = "yaml:\"validator_dst_address\""];
   173  }
   174  
   175  // DVVTriplets defines an array of DVVTriplet objects.
   176  message DVVTriplets {
   177    repeated DVVTriplet triplets = 1 [(gogoproto.nullable) = false];
   178  }
   179  
   180  // Delegation represents the bond with tokens held by an account. It is
   181  // owned by one delegator, and is associated with the voting power of one
   182  // validator.
   183  message Delegation {
   184    option (gogoproto.equal)            = false;
   185    option (gogoproto.goproto_getters)  = false;
   186    option (gogoproto.goproto_stringer) = false;
   187  
   188    // delegator_address is the bech32-encoded address of the delegator.
   189    string delegator_address = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""];
   190    // validator_address is the bech32-encoded address of the validator.
   191    string validator_address = 2 [(gogoproto.moretags) = "yaml:\"validator_address\""];
   192    // shares define the delegation shares received.
   193    string shares = 3 [(gogoproto.customtype) = "github.com/Finschia/finschia-sdk/types.Dec", (gogoproto.nullable) = false];
   194  }
   195  
   196  // UnbondingDelegation stores all of a single delegator's unbonding bonds
   197  // for a single validator in an time-ordered list.
   198  message UnbondingDelegation {
   199    option (gogoproto.equal)            = false;
   200    option (gogoproto.goproto_getters)  = false;
   201    option (gogoproto.goproto_stringer) = false;
   202  
   203    // delegator_address is the bech32-encoded address of the delegator.
   204    string delegator_address = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""];
   205    // validator_address is the bech32-encoded address of the validator.
   206    string validator_address = 2 [(gogoproto.moretags) = "yaml:\"validator_address\""];
   207    // entries are the unbonding delegation entries.
   208    repeated UnbondingDelegationEntry entries = 3 [(gogoproto.nullable) = false]; // unbonding delegation entries
   209  }
   210  
   211  // UnbondingDelegationEntry defines an unbonding object with relevant metadata.
   212  message UnbondingDelegationEntry {
   213    option (gogoproto.equal)            = true;
   214    option (gogoproto.goproto_stringer) = false;
   215  
   216    // creation_height is the height which the unbonding took place.
   217    int64 creation_height = 1 [(gogoproto.moretags) = "yaml:\"creation_height\""];
   218    // completion_time is the unix time for unbonding completion.
   219    google.protobuf.Timestamp completion_time = 2
   220        [(gogoproto.nullable) = false, (gogoproto.stdtime) = true, (gogoproto.moretags) = "yaml:\"completion_time\""];
   221    // initial_balance defines the tokens initially scheduled to receive at completion.
   222    string initial_balance = 3 [
   223      (gogoproto.customtype) = "github.com/Finschia/finschia-sdk/types.Int",
   224      (gogoproto.nullable)   = false,
   225      (gogoproto.moretags)   = "yaml:\"initial_balance\""
   226    ];
   227    // balance defines the tokens to receive at completion.
   228    string balance = 4 [(gogoproto.customtype) = "github.com/Finschia/finschia-sdk/types.Int", (gogoproto.nullable) = false];
   229  }
   230  
   231  // RedelegationEntry defines a redelegation object with relevant metadata.
   232  message RedelegationEntry {
   233    option (gogoproto.equal)            = true;
   234    option (gogoproto.goproto_stringer) = false;
   235  
   236    // creation_height  defines the height which the redelegation took place.
   237    int64 creation_height = 1 [(gogoproto.moretags) = "yaml:\"creation_height\""];
   238    // completion_time defines the unix time for redelegation completion.
   239    google.protobuf.Timestamp completion_time = 2
   240        [(gogoproto.nullable) = false, (gogoproto.stdtime) = true, (gogoproto.moretags) = "yaml:\"completion_time\""];
   241    // initial_balance defines the initial balance when redelegation started.
   242    string initial_balance = 3 [
   243      (gogoproto.customtype) = "github.com/Finschia/finschia-sdk/types.Int",
   244      (gogoproto.nullable)   = false,
   245      (gogoproto.moretags)   = "yaml:\"initial_balance\""
   246    ];
   247    // shares_dst is the amount of destination-validator shares created by redelegation.
   248    string shares_dst = 4 [(gogoproto.customtype) = "github.com/Finschia/finschia-sdk/types.Dec", (gogoproto.nullable) = false];
   249  }
   250  
   251  // Redelegation contains the list of a particular delegator's redelegating bonds
   252  // from a particular source validator to a particular destination validator.
   253  message Redelegation {
   254    option (gogoproto.equal)            = false;
   255    option (gogoproto.goproto_getters)  = false;
   256    option (gogoproto.goproto_stringer) = false;
   257  
   258    // delegator_address is the bech32-encoded address of the delegator.
   259    string delegator_address = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""];
   260    // validator_src_address is the validator redelegation source operator address.
   261    string validator_src_address = 2 [(gogoproto.moretags) = "yaml:\"validator_src_address\""];
   262    // validator_dst_address is the validator redelegation destination operator address.
   263    string validator_dst_address = 3 [(gogoproto.moretags) = "yaml:\"validator_dst_address\""];
   264    // entries are the redelegation entries.
   265    repeated RedelegationEntry entries = 4 [(gogoproto.nullable) = false]; // redelegation entries
   266  }
   267  
   268  // Params defines the parameters for the staking module.
   269  message Params {
   270    option (gogoproto.equal)            = true;
   271    option (gogoproto.goproto_stringer) = false;
   272  
   273    // unbonding_time is the time duration of unbonding.
   274    google.protobuf.Duration unbonding_time = 1
   275        [(gogoproto.nullable) = false, (gogoproto.stdduration) = true, (gogoproto.moretags) = "yaml:\"unbonding_time\""];
   276    // max_validators is the maximum number of validators.
   277    uint32 max_validators = 2 [(gogoproto.moretags) = "yaml:\"max_validators\""];
   278    // max_entries is the max entries for either unbonding delegation or redelegation (per pair/trio).
   279    uint32 max_entries = 3 [(gogoproto.moretags) = "yaml:\"max_entries\""];
   280    // historical_entries is the number of historical entries to persist.
   281    uint32 historical_entries = 4 [(gogoproto.moretags) = "yaml:\"historical_entries\""];
   282    // bond_denom defines the bondable coin denomination.
   283    string bond_denom = 5 [(gogoproto.moretags) = "yaml:\"bond_denom\""];
   284  }
   285  
   286  // DelegationResponse is equivalent to Delegation except that it contains a
   287  // balance in addition to shares which is more suitable for client responses.
   288  message DelegationResponse {
   289    option (gogoproto.equal)            = false;
   290    option (gogoproto.goproto_stringer) = false;
   291  
   292    Delegation delegation = 1 [(gogoproto.nullable) = false];
   293  
   294    cosmos.base.v1beta1.Coin balance = 2 [(gogoproto.nullable) = false];
   295  }
   296  
   297  // RedelegationEntryResponse is equivalent to a RedelegationEntry except that it
   298  // contains a balance in addition to shares which is more suitable for client
   299  // responses.
   300  message RedelegationEntryResponse {
   301    option (gogoproto.equal) = true;
   302  
   303    RedelegationEntry redelegation_entry = 1 [(gogoproto.nullable) = false];
   304    string balance = 4 [(gogoproto.customtype) = "github.com/Finschia/finschia-sdk/types.Int", (gogoproto.nullable) = false];
   305  }
   306  
   307  // RedelegationResponse is equivalent to a Redelegation except that its entries
   308  // contain a balance in addition to shares which is more suitable for client
   309  // responses.
   310  message RedelegationResponse {
   311    option (gogoproto.equal) = false;
   312  
   313    Redelegation                       redelegation = 1 [(gogoproto.nullable) = false];
   314    repeated RedelegationEntryResponse entries      = 2 [(gogoproto.nullable) = false];
   315  }
   316  
   317  // Pool is used for tracking bonded and not-bonded token supply of the bond
   318  // denomination.
   319  message Pool {
   320    option (gogoproto.description) = true;
   321    option (gogoproto.equal)       = true;
   322    string not_bonded_tokens       = 1 [
   323      (gogoproto.customtype) = "github.com/Finschia/finschia-sdk/types.Int",
   324      (gogoproto.jsontag)    = "not_bonded_tokens",
   325      (gogoproto.nullable)   = false
   326    ];
   327    string bonded_tokens = 2 [
   328      (gogoproto.jsontag)    = "bonded_tokens",
   329      (gogoproto.customtype) = "github.com/Finschia/finschia-sdk/types.Int",
   330      (gogoproto.nullable)   = false,
   331      (gogoproto.moretags)   = "yaml:\"bonded_tokens\""
   332    ];
   333  }