Documentation
¶
Index ¶
- Constants
- Variables
- func FormatConsensusPubkey(consensusPubkey *codectypes.Any) string
- func NewDelegationRequest(args []interface{}, addrCdc address.Codec) (*stakingtypes.QueryDelegationRequest, error)
- func NewMsgCancelUnbondingDelegation(args []interface{}, denom string, addrCdc address.Codec) (*stakingtypes.MsgCancelUnbondingDelegation, common.Address, error)
- func NewMsgCreateValidator(args []interface{}, denom string, addrCdc address.Codec) (*stakingtypes.MsgCreateValidator, common.Address, error)
- func NewMsgDelegate(args []interface{}, denom string, addrCdc address.Codec) (*stakingtypes.MsgDelegate, common.Address, error)
- func NewMsgEditValidator(args []interface{}) (*stakingtypes.MsgEditValidator, common.Address, error)
- func NewMsgRedelegate(args []interface{}, denom string, addrCdc address.Codec) (*stakingtypes.MsgBeginRedelegate, common.Address, error)
- func NewMsgUndelegate(args []interface{}, denom string, addrCdc address.Codec) (*stakingtypes.MsgUndelegate, common.Address, error)
- func NewRedelegationsRequest(method *abi.Method, args []interface{}, addrCdc address.Codec) (*stakingtypes.QueryRedelegationsRequest, error)
- func NewUnbondingDelegationRequest(args []interface{}, addrCdc address.Codec) (*stakingtypes.QueryUnbondingDelegationRequest, error)
- func NewValidatorRequest(args []interface{}) (*stakingtypes.QueryValidatorRequest, error)
- func NewValidatorsRequest(method *abi.Method, args []interface{}) (*stakingtypes.QueryValidatorsRequest, error)
- type Commission
- type DelegationOutput
- type Description
- type EventCancelUnbonding
- type EventCreateValidator
- type EventDelegate
- type EventEditValidator
- type EventRedelegate
- type EventUnbond
- type Precompile
- func (p Precompile) CancelUnbondingDelegation(ctx sdk.Context, contract *vm.Contract, stateDB vm.StateDB, method *abi.Method, ...) ([]byte, error)
- func (p Precompile) CreateValidator(ctx sdk.Context, contract *vm.Contract, stateDB vm.StateDB, method *abi.Method, ...) ([]byte, error)
- func (p *Precompile) Delegate(ctx sdk.Context, contract *vm.Contract, stateDB vm.StateDB, method *abi.Method, ...) ([]byte, error)
- func (p Precompile) Delegation(ctx sdk.Context, _ *vm.Contract, method *abi.Method, args []interface{}) ([]byte, error)
- func (p Precompile) EditValidator(ctx sdk.Context, contract *vm.Contract, stateDB vm.StateDB, method *abi.Method, ...) ([]byte, error)
- func (p Precompile) EmitCancelUnbondingDelegationEvent(ctx sdk.Context, stateDB vm.StateDB, ...) error
- func (p Precompile) EmitCreateValidatorEvent(ctx sdk.Context, stateDB vm.StateDB, msg *stakingtypes.MsgCreateValidator, ...) error
- func (p Precompile) EmitDelegateEvent(ctx sdk.Context, stateDB vm.StateDB, msg *stakingtypes.MsgDelegate, ...) error
- func (p Precompile) EmitEditValidatorEvent(ctx sdk.Context, stateDB vm.StateDB, msg *stakingtypes.MsgEditValidator, ...) error
- func (p Precompile) EmitRedelegateEvent(ctx sdk.Context, stateDB vm.StateDB, msg *stakingtypes.MsgBeginRedelegate, ...) error
- func (p Precompile) EmitUnbondEvent(ctx sdk.Context, stateDB vm.StateDB, msg *stakingtypes.MsgUndelegate, ...) error
- func (p Precompile) Execute(ctx sdk.Context, stateDB vm.StateDB, contract *vm.Contract, readOnly bool) ([]byte, error)
- func (Precompile) IsTransaction(method *abi.Method) bool
- func (p Precompile) Logger(ctx sdk.Context) log.Logger
- func (Precompile) Name() string
- func (p Precompile) Redelegate(ctx sdk.Context, contract *vm.Contract, stateDB vm.StateDB, method *abi.Method, ...) ([]byte, error)
- func (p Precompile) Redelegation(ctx sdk.Context, method *abi.Method, _ *vm.Contract, args []interface{}) ([]byte, error)
- func (p Precompile) Redelegations(ctx sdk.Context, method *abi.Method, _ *vm.Contract, args []interface{}) ([]byte, error)
- func (p Precompile) RequiredGas(input []byte) uint64
- func (p Precompile) Run(evm *vm.EVM, contract *vm.Contract, readonly bool) ([]byte, error)
- func (p Precompile) UnbondingDelegation(ctx sdk.Context, _ *vm.Contract, method *abi.Method, args []interface{}) ([]byte, error)
- func (p Precompile) Undelegate(ctx sdk.Context, contract *vm.Contract, stateDB vm.StateDB, method *abi.Method, ...) ([]byte, error)
- func (p Precompile) Validator(ctx sdk.Context, method *abi.Method, _ *vm.Contract, args []interface{}) ([]byte, error)
- func (p Precompile) Validators(ctx sdk.Context, method *abi.Method, _ *vm.Contract, args []interface{}) ([]byte, error)
- type Redelegation
- type RedelegationEntry
- type RedelegationEntryResponse
- type RedelegationOutput
- type RedelegationRequest
- type RedelegationResponse
- type RedelegationValues
- type RedelegationsInput
- type RedelegationsOutput
- type RedelegationsRequest
- type UnbondingDelegationEntry
- type UnbondingDelegationOutput
- type UnbondingDelegationResponse
- type ValidatorInfo
- type ValidatorOutput
- type ValidatorsInput
- type ValidatorsOutput
- func (vo *ValidatorsOutput) FromResponse(res *stakingtypes.QueryValidatorsResponse) *ValidatorsOutput
- func (vo *ValidatorsOutput) FromResponseWithCodec(res *stakingtypes.QueryValidatorsResponse, addrCdc address.Codec) *ValidatorsOutput
- func (vo *ValidatorsOutput) Pack(args abi.Arguments) ([]byte, error)
Constants ¶
const ( // ErrNoDelegationFound is raised when no delegation is found for the given delegator and validator addresses. ErrNoDelegationFound = "delegation with delegator %s not found for validator %s" // ErrDifferentOriginFromValidator is raised when the origin address is not the same as the validator address. ErrDifferentOriginFromValidator = "origin address %s is not the same as validator operator address %s" // ErrCannotCallFromContract is raised when a function cannot be called from a smart contract. ErrCannotCallFromContract = "this method can only be called directly to the precompile, not from a smart contract" )
const ( // EventTypeCreateValidator defines the event type for the staking CreateValidator transaction. EventTypeCreateValidator = "CreateValidator" // EventTypeEditValidator defines the event type for the staking EditValidator transaction. EventTypeEditValidator = "EditValidator" // EventTypeDelegate defines the event type for the staking Delegate transaction. EventTypeDelegate = "Delegate" // EventTypeUnbond defines the event type for the staking Undelegate transaction. EventTypeUnbond = "Unbond" // EventTypeRedelegate defines the event type for the staking Redelegate transaction. EventTypeRedelegate = "Redelegate" // EventTypeCancelUnbondingDelegation defines the event type for the staking CancelUnbondingDelegation transaction. EventTypeCancelUnbondingDelegation = "CancelUnbondingDelegation" )
const ( // DelegationMethod defines the ABI method name for the staking Delegation // query. DelegationMethod = "delegation" // UnbondingDelegationMethod defines the ABI method name for the staking // UnbondingDelegationMethod query. UnbondingDelegationMethod = "unbondingDelegation" // ValidatorMethod defines the ABI method name for the staking // Validator query. ValidatorMethod = "validator" // ValidatorsMethod defines the ABI method name for the staking // Validators query. ValidatorsMethod = "validators" // RedelegationMethod defines the ABI method name for the staking // Redelegation query. RedelegationMethod = "redelegation" // RedelegationsMethod defines the ABI method name for the staking // Redelegations query. RedelegationsMethod = "redelegations" )
const ( // CreateValidatorMethod defines the ABI method name for the staking create validator transaction CreateValidatorMethod = "createValidator" // EditValidatorMethod defines the ABI method name for the staking edit validator transaction EditValidatorMethod = "editValidator" // DelegateMethod defines the ABI method name for the staking Delegate // transaction. DelegateMethod = "delegate" // UndelegateMethod defines the ABI method name for the staking Undelegate // transaction. UndelegateMethod = "undelegate" // RedelegateMethod defines the ABI method name for the staking Redelegate // transaction. RedelegateMethod = "redelegate" // CancelUnbondingDelegationMethod defines the ABI method name for the staking // CancelUnbondingDelegation transaction. CancelUnbondingDelegationMethod = "cancelUnbondingDelegation" )
const ( // DoNotModifyCommissionRate constant used in flags to indicate that commission rate field should not be updated DoNotModifyCommissionRate = -1 // DoNotModifyMinSelfDelegation constant used in flags to indicate that min self delegation field should not be updated DoNotModifyMinSelfDelegation = -1 )
Variables ¶
var (
ABI abi.ABI
)
Functions ¶
func FormatConsensusPubkey ¶
func FormatConsensusPubkey(consensusPubkey *codectypes.Any) string
FormatConsensusPubkey format ConsensusPubkey into a base64 string
func NewDelegationRequest ¶
func NewDelegationRequest(args []interface{}, addrCdc address.Codec) (*stakingtypes.QueryDelegationRequest, error)
NewDelegationRequest creates a new QueryDelegationRequest instance and does sanity checks on the given arguments before populating the request.
func NewMsgCancelUnbondingDelegation ¶
func NewMsgCancelUnbondingDelegation(args []interface{}, denom string, addrCdc address.Codec) (*stakingtypes.MsgCancelUnbondingDelegation, common.Address, error)
NewMsgCancelUnbondingDelegation creates a new MsgCancelUnbondingDelegation instance and does sanity checks on the given arguments before populating the message.
func NewMsgCreateValidator ¶
func NewMsgCreateValidator(args []interface{}, denom string, addrCdc address.Codec) (*stakingtypes.MsgCreateValidator, common.Address, error)
NewMsgCreateValidator creates a new MsgCreateValidator instance and does sanity checks on the given arguments before populating the message.
func NewMsgDelegate ¶
func NewMsgDelegate(args []interface{}, denom string, addrCdc address.Codec) (*stakingtypes.MsgDelegate, common.Address, error)
NewMsgDelegate creates a new MsgDelegate instance and does sanity checks on the given arguments before populating the message.
func NewMsgEditValidator ¶
func NewMsgEditValidator(args []interface{}) (*stakingtypes.MsgEditValidator, common.Address, error)
NewMsgEditValidator creates a new MsgEditValidator instance and does sanity checks on the given arguments before populating the message.
func NewMsgRedelegate ¶
func NewMsgRedelegate(args []interface{}, denom string, addrCdc address.Codec) (*stakingtypes.MsgBeginRedelegate, common.Address, error)
NewMsgRedelegate creates a new MsgRedelegate instance and does sanity checks on the given arguments before populating the message.
func NewMsgUndelegate ¶
func NewMsgUndelegate(args []interface{}, denom string, addrCdc address.Codec) (*stakingtypes.MsgUndelegate, common.Address, error)
NewMsgUndelegate creates a new MsgUndelegate instance and does sanity checks on the given arguments before populating the message.
func NewRedelegationsRequest ¶
func NewRedelegationsRequest(method *abi.Method, args []interface{}, addrCdc address.Codec) (*stakingtypes.QueryRedelegationsRequest, error)
NewRedelegationsRequest create a new QueryRedelegationsRequest instance and does sanity checks on the given arguments before populating the request.
func NewUnbondingDelegationRequest ¶
func NewUnbondingDelegationRequest(args []interface{}, addrCdc address.Codec) (*stakingtypes.QueryUnbondingDelegationRequest, error)
NewUnbondingDelegationRequest creates a new QueryUnbondingDelegationRequest instance and does sanity checks on the given arguments before populating the request.
func NewValidatorRequest ¶
func NewValidatorRequest(args []interface{}) (*stakingtypes.QueryValidatorRequest, error)
NewValidatorRequest create a new QueryValidatorRequest instance and does sanity checks on the given arguments before populating the request.
func NewValidatorsRequest ¶
func NewValidatorsRequest(method *abi.Method, args []interface{}) (*stakingtypes.QueryValidatorsRequest, error)
NewValidatorsRequest create a new QueryValidatorsRequest instance and does sanity checks on the given arguments before populating the request.
Types ¶
type Commission ¶
type Commission = struct {
Rate *big.Int "json:\"rate\""
MaxRate *big.Int "json:\"maxRate\""
MaxChangeRate *big.Int "json:\"maxChangeRate\""
}
Commission use golang type alias defines a validator commission. since solidity does not support decimals, after passing in the big int, convert the big int into a decimal with a precision of 18
type DelegationOutput ¶
DelegationOutput is a struct to represent the key information from a delegation response.
func (*DelegationOutput) FromResponse ¶
func (do *DelegationOutput) FromResponse(res *stakingtypes.QueryDelegationResponse) *DelegationOutput
FromResponse populates the DelegationOutput from a QueryDelegationResponse.
type Description ¶
type Description = struct {
Moniker string `json:"moniker"`
Identity string `json:"identity"`
Website string `json:"website"`
SecurityContact string `json:"securityContact"`
Details string `json:"details"`
}
Description defines a validator description.
func NewDescriptionFromResponse ¶ added in v0.5.0
func NewDescriptionFromResponse(d stakingtypes.Description) Description
type EventCancelUnbonding ¶
type EventCancelUnbonding struct {
DelegatorAddress common.Address
ValidatorAddress common.Address
Amount *big.Int
CreationHeight *big.Int
}
EventCancelUnbonding defines the event data for the staking CancelUnbond transaction.
type EventCreateValidator ¶
EventCreateValidator defines the event data for the staking CreateValidator transaction.
type EventDelegate ¶
type EventDelegate struct {
DelegatorAddress common.Address
ValidatorAddress common.Address
Amount *big.Int
}
EventDelegate defines the event data for the staking Delegate transaction.
type EventEditValidator ¶
type EventEditValidator struct {
ValidatorAddress common.Address
CommissionRate *big.Int
MinSelfDelegation *big.Int
}
EventEditValidator defines the event data for the staking EditValidator transaction.
type EventRedelegate ¶
type EventRedelegate struct {
DelegatorAddress common.Address
ValidatorSrcAddress common.Address
ValidatorDstAddress common.Address
Amount *big.Int
CompletionTime *big.Int
}
EventRedelegate defines the event data for the staking Redelegate transaction.
type EventUnbond ¶
type EventUnbond struct {
DelegatorAddress common.Address
ValidatorAddress common.Address
Amount *big.Int
CompletionTime *big.Int
}
EventUnbond defines the event data for the staking Undelegate transaction.
type Precompile ¶
type Precompile struct {
cmn.Precompile
abi.ABI
// contains filtered or unexported fields
}
Precompile defines the precompiled contract for staking.
func NewPrecompile ¶
func NewPrecompile( stakingKeeper cmn.StakingKeeper, stakingMsgServer stakingtypes.MsgServer, stakingQuerier stakingtypes.QueryServer, bankKeeper cmn.BankKeeper, addrCdc address.Codec, ) *Precompile
NewPrecompile creates a new staking Precompile instance as a PrecompiledContract interface.
func (Precompile) CancelUnbondingDelegation ¶
func (p Precompile) CancelUnbondingDelegation( ctx sdk.Context, contract *vm.Contract, stateDB vm.StateDB, method *abi.Method, args []interface{}, ) ([]byte, error)
CancelUnbondingDelegation will cancel the unbonding of a delegation and delegate back to the validator being unbonded from. The provided amount cannot be negative. This is validated in the msg.ValidateBasic() function.
func (Precompile) CreateValidator ¶
func (p Precompile) CreateValidator( ctx sdk.Context, contract *vm.Contract, stateDB vm.StateDB, method *abi.Method, args []interface{}, ) ([]byte, error)
CreateValidator performs create validator.
func (*Precompile) Delegate ¶
func (p *Precompile) Delegate( ctx sdk.Context, contract *vm.Contract, stateDB vm.StateDB, method *abi.Method, args []interface{}, ) ([]byte, error)
Delegate performs a delegation of coins from a delegator to a validator.
func (Precompile) Delegation ¶
func (p Precompile) Delegation( ctx sdk.Context, _ *vm.Contract, method *abi.Method, args []interface{}, ) ([]byte, error)
Delegation returns the delegation that a delegator has with a specific validator.
func (Precompile) EditValidator ¶
func (p Precompile) EditValidator( ctx sdk.Context, contract *vm.Contract, stateDB vm.StateDB, method *abi.Method, args []interface{}, ) ([]byte, error)
EditValidator performs edit validator.
func (Precompile) EmitCancelUnbondingDelegationEvent ¶
func (p Precompile) EmitCancelUnbondingDelegationEvent(ctx sdk.Context, stateDB vm.StateDB, msg *stakingtypes.MsgCancelUnbondingDelegation, delegatorAddr common.Address) error
EmitCancelUnbondingDelegationEvent creates a new cancel unbonding delegation event emitted on a CancelUnbondingDelegation transaction.
func (Precompile) EmitCreateValidatorEvent ¶
func (p Precompile) EmitCreateValidatorEvent(ctx sdk.Context, stateDB vm.StateDB, msg *stakingtypes.MsgCreateValidator, validatorAddr common.Address) error
EmitCreateValidatorEvent creates a new create validator event emitted on a CreateValidator transaction.
func (Precompile) EmitDelegateEvent ¶
func (p Precompile) EmitDelegateEvent(ctx sdk.Context, stateDB vm.StateDB, msg *stakingtypes.MsgDelegate, delegatorAddr common.Address) error
EmitDelegateEvent creates a new delegate event emitted on a Delegate transaction.
func (Precompile) EmitEditValidatorEvent ¶
func (p Precompile) EmitEditValidatorEvent(ctx sdk.Context, stateDB vm.StateDB, msg *stakingtypes.MsgEditValidator, validatorAddr common.Address) error
EmitEditValidatorEvent creates a new edit validator event emitted on a EditValidator transaction.
func (Precompile) EmitRedelegateEvent ¶
func (p Precompile) EmitRedelegateEvent(ctx sdk.Context, stateDB vm.StateDB, msg *stakingtypes.MsgBeginRedelegate, delegatorAddr common.Address, completionTime int64) error
EmitRedelegateEvent creates a new redelegate event emitted on a Redelegate transaction.
func (Precompile) EmitUnbondEvent ¶
func (p Precompile) EmitUnbondEvent(ctx sdk.Context, stateDB vm.StateDB, msg *stakingtypes.MsgUndelegate, delegatorAddr common.Address, completionTime int64) error
EmitUnbondEvent creates a new unbond event emitted on an Undelegate transaction.
func (Precompile) IsTransaction ¶
func (Precompile) IsTransaction(method *abi.Method) bool
IsTransaction checks if the given method name corresponds to a transaction or query.
Available staking transactions are:
- CreateValidator
- EditValidator
- Delegate
- Undelegate
- Redelegate
- CancelUnbondingDelegation
func (Precompile) Logger ¶
func (p Precompile) Logger(ctx sdk.Context) log.Logger
Logger returns a precompile-specific logger.
func (Precompile) Name ¶ added in v0.7.0
func (Precompile) Name() string
func (Precompile) Redelegate ¶
func (p Precompile) Redelegate( ctx sdk.Context, contract *vm.Contract, stateDB vm.StateDB, method *abi.Method, args []interface{}, ) ([]byte, error)
Redelegate performs a redelegation of coins for a delegate from a source validator to a destination validator. The provided amount cannot be negative. This is validated in the msg.ValidateBasic() function.
func (Precompile) Redelegation ¶
func (p Precompile) Redelegation( ctx sdk.Context, method *abi.Method, _ *vm.Contract, args []interface{}, ) ([]byte, error)
Redelegation returns the redelegation between two validators for a delegator.
func (Precompile) Redelegations ¶
func (p Precompile) Redelegations( ctx sdk.Context, method *abi.Method, _ *vm.Contract, args []interface{}, ) ([]byte, error)
Redelegations returns the redelegations according to the specified criteria (delegator address and/or validator source address and/or validator destination address or all existing redelegations) with pagination. Pagination is only supported for querying redelegations from a source validator or to query all redelegations.
func (Precompile) RequiredGas ¶
func (p Precompile) RequiredGas(input []byte) uint64
RequiredGas returns the required bare minimum gas to execute the precompile.
func (Precompile) UnbondingDelegation ¶
func (p Precompile) UnbondingDelegation( ctx sdk.Context, _ *vm.Contract, method *abi.Method, args []interface{}, ) ([]byte, error)
UnbondingDelegation returns the delegation currently being unbonded for a delegator from a specific validator.
func (Precompile) Undelegate ¶
func (p Precompile) Undelegate( ctx sdk.Context, contract *vm.Contract, stateDB vm.StateDB, method *abi.Method, args []interface{}, ) ([]byte, error)
Undelegate performs the undelegation of coins from a validator for a delegate. The provided amount cannot be negative. This is validated in the msg.ValidateBasic() function.
type Redelegation ¶
type Redelegation struct {
DelegatorAddress string
ValidatorSrcAddress string
ValidatorDstAddress string
Entries []RedelegationEntry
}
Redelegation contains the list of a particular delegator's redelegating bonds from a particular source validator to a particular destination validator.
type RedelegationEntry ¶
RedelegationEntry is a struct to represent the key information from a redelegation entry response.
type RedelegationEntryResponse ¶
type RedelegationEntryResponse struct {
RedelegationEntry RedelegationEntry
Balance *big.Int
}
RedelegationEntryResponse is equivalent to a RedelegationEntry except that it contains a balance in addition to shares which is more suitable for client responses.
type RedelegationOutput ¶
type RedelegationOutput struct {
Redelegation RedelegationValues
}
RedelegationOutput returns the output for a redelegation query.
func (*RedelegationOutput) FromResponse ¶
func (ro *RedelegationOutput) FromResponse(res stakingtypes.Redelegation) *RedelegationOutput
FromResponse populates the RedelegationOutput from a QueryRedelegationsResponse.
type RedelegationRequest ¶
type RedelegationRequest struct {
DelegatorAddress sdk.AccAddress
ValidatorSrcAddress sdk.ValAddress
ValidatorDstAddress sdk.ValAddress
}
RedelegationRequest is a struct that contains the information to pass into a redelegation query.
func NewRedelegationRequest ¶
func NewRedelegationRequest(args []interface{}) (*RedelegationRequest, error)
NewRedelegationRequest create a new QueryRedelegationRequest instance and does sanity checks on the given arguments before populating the request.
type RedelegationResponse ¶
type RedelegationResponse struct {
Redelegation Redelegation
Entries []RedelegationEntryResponse
}
RedelegationResponse is equivalent to a Redelegation except that its entries contain a balance in addition to shares which is more suitable for client responses.
type RedelegationValues ¶
type RedelegationValues struct {
DelegatorAddress string
ValidatorSrcAddress string
ValidatorDstAddress string
Entries []RedelegationEntry
}
RedelegationValues is a struct to represent the key information from a redelegation response.
type RedelegationsInput ¶
type RedelegationsInput struct {
DelegatorAddress common.Address
SrcValidatorAddress string
DstValidatorAddress string
PageRequest query.PageRequest
}
RedelegationsInput is a struct to represent the input information for the redelegations query. Needed to unpack arguments into the PageRequest struct.
type RedelegationsOutput ¶
type RedelegationsOutput struct {
Response []RedelegationResponse
PageResponse query.PageResponse
}
RedelegationsOutput is a struct to represent the key information from a redelegations response.
func (*RedelegationsOutput) FromResponse ¶
func (ro *RedelegationsOutput) FromResponse(res *stakingtypes.QueryRedelegationsResponse) *RedelegationsOutput
FromResponse populates the RedelgationsOutput from a QueryRedelegationsResponse.
type RedelegationsRequest ¶
type RedelegationsRequest struct {
DelegatorAddress sdk.AccAddress
MaxRetrieve int64
}
RedelegationsRequest is a struct that contains the information to pass into a redelegations query.
type UnbondingDelegationEntry ¶
type UnbondingDelegationEntry struct {
CreationHeight int64
CompletionTime int64
InitialBalance *big.Int
Balance *big.Int
UnbondingId uint64
UnbondingOnHoldRefCount int64
}
UnbondingDelegationEntry is a struct that contains the information about an unbonding delegation entry.
type UnbondingDelegationOutput ¶
type UnbondingDelegationOutput struct {
UnbondingDelegation UnbondingDelegationResponse
}
UnbondingDelegationOutput is the output response returned by the query method.
func (*UnbondingDelegationOutput) FromResponse ¶
func (do *UnbondingDelegationOutput) FromResponse(res *stakingtypes.QueryUnbondingDelegationResponse) *UnbondingDelegationOutput
FromResponse populates the DelegationOutput from a QueryDelegationResponse.
type UnbondingDelegationResponse ¶
type UnbondingDelegationResponse struct {
DelegatorAddress string
ValidatorAddress string
Entries []UnbondingDelegationEntry
}
UnbondingDelegationResponse is a struct that contains the information about an unbonding delegation.
type ValidatorInfo ¶
type ValidatorInfo struct {
OperatorAddress string `abi:"operatorAddress"`
ConsensusPubkey string `abi:"consensusPubkey"`
Jailed bool `abi:"jailed"`
Status uint8 `abi:"status"`
Tokens *big.Int `abi:"tokens"`
Description Description `abi:"description"`
UnbondingHeight int64 `abi:"unbondingHeight"`
UnbondingTime int64 `abi:"unbondingTime"`
Commission *big.Int `abi:"commission"`
MinSelfDelegation *big.Int `abi:"minSelfDelegation"`
}
ValidatorInfo is a struct to represent the key information from a validator response.
func DefaultValidatorInfo ¶ added in v0.5.0
func DefaultValidatorInfo() ValidatorInfo
func NewValidatorInfoFromResponse ¶ added in v0.5.0
func NewValidatorInfoFromResponse(v stakingtypes.Validator) ValidatorInfo
func NewValidatorInfoFromResponseWithCodec ¶ added in v0.7.5
func NewValidatorInfoFromResponseWithCodec(v stakingtypes.Validator, addrCdc address.Codec) ValidatorInfo
NewValidatorInfoFromResponseWithCodec is like NewValidatorInfoFromResponse but decodes the validator operator address with the given address codec, which is required when the application uses a custom validator address type.
type ValidatorOutput ¶
type ValidatorOutput struct {
Validator ValidatorInfo
}
type ValidatorsInput ¶
type ValidatorsInput struct {
Status string
PageRequest query.PageRequest
}
ValidatorsInput is a struct to represent the input information for the validators query. Needed to unpack arguments into the PageRequest struct.
type ValidatorsOutput ¶
type ValidatorsOutput struct {
Validators []ValidatorInfo
PageResponse query.PageResponse
}
ValidatorsOutput is a struct to represent the key information from a validators response.
func (*ValidatorsOutput) FromResponse ¶
func (vo *ValidatorsOutput) FromResponse(res *stakingtypes.QueryValidatorsResponse) *ValidatorsOutput
FromResponse populates the ValidatorsOutput from a QueryValidatorsResponse.
func (*ValidatorsOutput) FromResponseWithCodec ¶ added in v0.7.5
func (vo *ValidatorsOutput) FromResponseWithCodec(res *stakingtypes.QueryValidatorsResponse, addrCdc address.Codec) *ValidatorsOutput
FromResponseWithCodec populates the ValidatorsOutput from a QueryValidatorsResponse, decoding the validator operator addresses with the given address codec.