github.com/cosmos/cosmos-sdk@v0.50.10/x/staking/types/exported.go (about) 1 package types 2 3 import ( 4 cmtprotocrypto "github.com/cometbft/cometbft/proto/tendermint/crypto" 5 6 "cosmossdk.io/math" 7 8 cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" 9 ) 10 11 // DelegationI delegation bond for a delegated proof of stake system 12 type DelegationI interface { 13 GetDelegatorAddr() string // delegator string for the bond 14 GetValidatorAddr() string // validator operator address 15 GetShares() math.LegacyDec // amount of validator's shares held in this delegation 16 } 17 18 // ValidatorI expected validator functions 19 type ValidatorI interface { 20 IsJailed() bool // whether the validator is jailed 21 GetMoniker() string // moniker of the validator 22 GetStatus() BondStatus // status of the validator 23 IsBonded() bool // check if has a bonded status 24 IsUnbonded() bool // check if has status unbonded 25 IsUnbonding() bool // check if has status unbonding 26 GetOperator() string // operator address to receive/return validators coins 27 ConsPubKey() (cryptotypes.PubKey, error) // validation consensus pubkey (cryptotypes.PubKey) 28 TmConsPublicKey() (cmtprotocrypto.PublicKey, error) // validation consensus pubkey (CometBFT) 29 GetConsAddr() ([]byte, error) // validation consensus address 30 GetTokens() math.Int // validation tokens 31 GetBondedTokens() math.Int // validator bonded tokens 32 GetConsensusPower(math.Int) int64 // validation power in CometBFT 33 GetCommission() math.LegacyDec // validator commission rate 34 GetMinSelfDelegation() math.Int // validator minimum self delegation 35 GetDelegatorShares() math.LegacyDec // total outstanding delegator shares 36 TokensFromShares(math.LegacyDec) math.LegacyDec // token worth of provided delegator shares 37 TokensFromSharesTruncated(math.LegacyDec) math.LegacyDec // token worth of provided delegator shares, truncated 38 TokensFromSharesRoundUp(math.LegacyDec) math.LegacyDec // token worth of provided delegator shares, rounded up 39 SharesFromTokens(amt math.Int) (math.LegacyDec, error) // shares worth of delegator's bond 40 SharesFromTokensTruncated(amt math.Int) (math.LegacyDec, error) // truncated shares worth of delegator's bond 41 }