Documentation ¶
Index ¶
- Constants
- Variables
- func FormatConsensusPubkey(consensusPubkey *codectypes.Any) string
- func LoadABI() (abi.ABI, error)
- func NewDelegationRequest(args []interface{}) (*stakingtypes.QueryDelegationRequest, error)
- func NewMsgCancelUnbondingDelegation(args []interface{}, denom string) (*stakingtypes.MsgCancelUnbondingDelegation, common.Address, error)
- func NewMsgCreateValidator(args []interface{}, denom string) (*stakingtypes.MsgCreateValidator, common.Address, error)
- func NewMsgDelegate(args []interface{}, denom string) (*stakingtypes.MsgDelegate, common.Address, error)
- func NewMsgRedelegate(args []interface{}, denom string) (*stakingtypes.MsgBeginRedelegate, common.Address, error)
- func NewMsgUndelegate(args []interface{}, denom string) (*stakingtypes.MsgUndelegate, common.Address, error)
- func NewRedelegationsRequest(method *abi.Method, args []interface{}) (*stakingtypes.QueryRedelegationsRequest, error)
- func NewUnbondingDelegationRequest(args []interface{}) (*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 EventRedelegate
- type EventUnbond
- type Precompile
- func (Precompile) Address() common.Address
- func (p Precompile) Allowance(ctx sdk.Context, method *abi.Method, _ *vm.Contract, args []interface{}) ([]byte, error)
- func (p Precompile) Approve(ctx sdk.Context, origin common.Address, stateDB vm.StateDB, method *abi.Method, ...) ([]byte, error)
- func (p Precompile) CancelUnbondingDelegation(ctx sdk.Context, origin common.Address, contract *vm.Contract, ...) ([]byte, error)
- func (p Precompile) CreateValidator(ctx sdk.Context, origin common.Address, _ *vm.Contract, stateDB vm.StateDB, ...) ([]byte, error)
- func (p Precompile) DecreaseAllowance(ctx sdk.Context, origin common.Address, stateDB vm.StateDB, method *abi.Method, ...) ([]byte, error)
- func (p Precompile) Delegate(ctx sdk.Context, origin common.Address, contract *vm.Contract, ...) ([]byte, error)
- func (p Precompile) Delegation(ctx sdk.Context, _ *vm.Contract, method *abi.Method, args []interface{}) ([]byte, error)
- func (p Precompile) EmitAllowanceChangeEvent(ctx sdk.Context, stateDB vm.StateDB, grantee, granter common.Address, ...) error
- func (p Precompile) EmitApprovalEvent(ctx sdk.Context, stateDB vm.StateDB, grantee, granter common.Address, ...) 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) 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) IncreaseAllowance(ctx sdk.Context, origin common.Address, stateDB vm.StateDB, method *abi.Method, ...) ([]byte, error)
- func (Precompile) IsTransaction(method string) bool
- func (p Precompile) Logger(ctx sdk.Context) log.Logger
- func (p Precompile) Redelegate(ctx sdk.Context, origin common.Address, contract *vm.Contract, ...) ([]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) Revoke(ctx sdk.Context, origin common.Address, stateDB vm.StateDB, method *abi.Method, ...) ([]byte, error)
- func (p Precompile) Run(evm *vm.EVM, contract *vm.Contract, readOnly bool) (bz []byte, err error)
- func (p Precompile) UnbondingDelegation(ctx sdk.Context, _ *vm.Contract, method *abi.Method, args []interface{}) ([]byte, error)
- func (p Precompile) Undelegate(ctx sdk.Context, origin common.Address, contract *vm.Contract, ...) ([]byte, error)
- func (p Precompile) UpdateStakingAuthorization(ctx sdk.Context, grantee, granter common.Address, ...) 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
Constants ¶
const ( // ErrDecreaseAmountTooBig is raised when the amount by which the allowance should be decreased is greater // than the authorization limit. ErrDecreaseAmountTooBig = "amount by which the allowance should be decreased is greater than the authorization limit: %s > %s" // ErrDifferentOriginFromDelegator is raised when the origin address is not the same as the delegator address. ErrDifferentOriginFromDelegator = "origin address %s is not the same as delegator address %s" // 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" )
const ( // EventTypeCreateValidator defines the event type for the staking CreateValidator transaction. EventTypeCreateValidator = "CreateValidator" // 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" // 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 ( // DelegateAuthz defines the authorization type for the staking Delegate DelegateAuthz = stakingtypes.AuthorizationType_AUTHORIZATION_TYPE_DELEGATE // UndelegateAuthz defines the authorization type for the staking Undelegate UndelegateAuthz = stakingtypes.AuthorizationType_AUTHORIZATION_TYPE_UNDELEGATE // RedelegateAuthz defines the authorization type for the staking Redelegate RedelegateAuthz = stakingtypes.AuthorizationType_AUTHORIZATION_TYPE_REDELEGATE // CancelUnbondingDelegationAuthz defines the authorization type for the staking CancelUnbondingDelegationAuthz = stakingtypes.AuthorizationType_AUTHORIZATION_TYPE_CANCEL_UNBONDING_DELEGATION )
const PrecompileAddress = "0x0000000000000000000000000000000000000800"
PrecompileAddress defines the contract address of the staking precompile.
Variables ¶
var ( // DelegateMsg defines the authorization type for MsgDelegate DelegateMsg = sdk.MsgTypeURL(&stakingtypes.MsgDelegate{}) // UndelegateMsg defines the authorization type for MsgUndelegate UndelegateMsg = sdk.MsgTypeURL(&stakingtypes.MsgUndelegate{}) // RedelegateMsg defines the authorization type for MsgRedelegate RedelegateMsg = sdk.MsgTypeURL(&stakingtypes.MsgBeginRedelegate{}) // CancelUnbondingDelegationMsg defines the authorization type for MsgCancelUnbondingDelegation CancelUnbondingDelegationMsg = sdk.MsgTypeURL(&stakingtypes.MsgCancelUnbondingDelegation{}) )
Functions ¶
func FormatConsensusPubkey ¶
func FormatConsensusPubkey(consensusPubkey *codectypes.Any) string
FormatConsensusPubkey format ConsensusPubkey into a base64 string
func LoadABI ¶
LoadABI loads the staking ABI from the embedded abi.json file for the staking precompile.
func NewDelegationRequest ¶
func NewDelegationRequest(args []interface{}) (*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) (*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) (*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) (*stakingtypes.MsgDelegate, common.Address, error)
NewMsgDelegate creates a new MsgDelegate instance and does sanity checks on the given arguments before populating the message.
func NewMsgRedelegate ¶
func NewMsgRedelegate(args []interface{}, denom string) (*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) (*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{}) (*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{}) (*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 use golang type alias defines a validator 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 ¶
type EventCreateValidator struct { DelegatorAddress common.Address ValidatorAddress common.Address Value *big.Int }
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 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 // contains filtered or unexported fields }
Precompile defines the precompiled contract for staking.
func NewPrecompile ¶
func NewPrecompile( stakingKeeper stakingkeeper.Keeper, authzKeeper authzkeeper.Keeper, ) (*Precompile, error)
NewPrecompile creates a new staking Precompile instance as a PrecompiledContract interface.
func (Precompile) Address ¶
func (Precompile) Address() common.Address
Address defines the address of the staking compile contract. address: 0x0000000000000000000000000000000000000800
func (Precompile) Allowance ¶
func (p Precompile) Allowance( ctx sdk.Context, method *abi.Method, _ *vm.Contract, args []interface{}, ) ([]byte, error)
Allowance returns the remaining allowance of a grantee to the contract.
func (Precompile) Approve ¶
func (p Precompile) Approve( ctx sdk.Context, origin common.Address, stateDB vm.StateDB, method *abi.Method, args []interface{}, ) ([]byte, error)
Approve sets amount as the allowance of a grantee over the caller’s tokens. Returns a boolean value indicating whether the operation succeeded.
func (Precompile) CancelUnbondingDelegation ¶
func (p Precompile) CancelUnbondingDelegation( ctx sdk.Context, origin common.Address, 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, origin common.Address, _ *vm.Contract, stateDB vm.StateDB, method *abi.Method, args []interface{}, ) ([]byte, error)
CreateValidator performs create validator.
func (Precompile) DecreaseAllowance ¶
func (p Precompile) DecreaseAllowance( ctx sdk.Context, origin common.Address, stateDB vm.StateDB, method *abi.Method, args []interface{}, ) ([]byte, error)
DecreaseAllowance decreases the allowance of grantee over the caller’s tokens by the amount.
func (Precompile) Delegate ¶
func (p Precompile) Delegate( ctx sdk.Context, origin common.Address, 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) EmitAllowanceChangeEvent ¶
func (p Precompile) EmitAllowanceChangeEvent(ctx sdk.Context, stateDB vm.StateDB, grantee, granter common.Address, typeUrls []string) error
EmitAllowanceChangeEvent creates a new allowance change event emitted on an IncreaseAllowance and DecreaseAllowance transactions.
func (Precompile) EmitApprovalEvent ¶
func (p Precompile) EmitApprovalEvent(ctx sdk.Context, stateDB vm.StateDB, grantee, granter common.Address, coin *sdk.Coin, typeUrls []string) error
EmitApprovalEvent creates a new approval event emitted on an Approve, IncreaseAllowance and DecreaseAllowance transactions.
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, delegatorAddr 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) 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) IncreaseAllowance ¶
func (p Precompile) IncreaseAllowance( ctx sdk.Context, origin common.Address, stateDB vm.StateDB, method *abi.Method, args []interface{}, ) ([]byte, error)
IncreaseAllowance increases the allowance of grantee over the caller’s tokens by the amount.
func (Precompile) IsTransaction ¶
func (Precompile) IsTransaction(method string) bool
IsTransaction checks if the given method name corresponds to a transaction or query.
Available staking transactions are:
- CreateValidator
- Delegate
- Undelegate
- Redelegate
- CancelUnbondingDelegation
Available authorization transactions are:
- Approve
- Revoke
- IncreaseAllowance
- DecreaseAllowance
func (Precompile) Logger ¶
func (p Precompile) Logger(ctx sdk.Context) log.Logger
Logger returns a precompile-specific logger.
func (Precompile) Redelegate ¶
func (p Precompile) Redelegate( ctx sdk.Context, origin common.Address, 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) Revoke ¶
func (p Precompile) Revoke( ctx sdk.Context, origin common.Address, stateDB vm.StateDB, method *abi.Method, args []interface{}, ) ([]byte, error)
Revoke removes the authorization grants given in the typeUrls for a given granter to a given grantee. It only works if the origin matches the spender to avoid unauthorized revocations. Works only for staking messages.
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, origin common.Address, 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.
func (Precompile) UpdateStakingAuthorization ¶
func (p Precompile) UpdateStakingAuthorization( ctx sdk.Context, grantee, granter common.Address, stakeAuthz *stakingtypes.StakeAuthorization, expiration *time.Time, messageType string, msg sdk.Msg, ) error
UpdateStakingAuthorization updates the staking grant based on the authz AcceptResponse for the given granter and grantee.
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 //nolint 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 string `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.
type ValidatorOutput ¶
type ValidatorOutput struct {
Validator ValidatorInfo
}
func DefaultValidatorOutput ¶
func DefaultValidatorOutput() ValidatorOutput
DefaultValidatorOutput returns a ValidatorOutput with default values.
func (*ValidatorOutput) FromResponse ¶
func (vo *ValidatorOutput) FromResponse(res *stakingtypes.QueryValidatorResponse) ValidatorOutput
FromResponse populates the ValidatorOutput from a QueryValidatorResponse.
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.