Documentation ¶
Overview ¶
Package types is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func ActiveCondition(validator stakingtypes.Validator, whitelisted bool, tombstoned bool) bool
- func BTokenToNativeToken(bTokenAmount, bTokenTotalSupplyAmount sdk.Int, netAmount, feeRate sdk.Dec) (nativeTokenAmount sdk.Dec)
- func DivideByWeight(activeVals ActiveLiquidValidators, input sdk.Int, ...) (outputs []sdk.Int, crumb sdk.Int)
- func GetLiquidValidatorKey(operatorAddr sdk.ValAddress) []byte
- func MustMarshalLiquidValidator(cdc codec.BinaryCodec, val *LiquidValidator) []byte
- func NativeTokenToBToken(nativeTokenAmount, bTokenTotalSupplyAmount sdk.Int, netAmount sdk.Dec) (bTokenAmount sdk.Int)
- func ParamKeyTable() paramstypes.KeyTable
- func RegisterInterfaces(registry types.InterfaceRegistry)
- func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)
- func RegisterMsgServer(s grpc1.Server, srv MsgServer)
- func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error
- func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error
- func RegisterQueryServer(s grpc1.Server, srv QueryServer)
- func ValidateBondedBondDenom(i interface{}) error
- func ValidateGenesis(data GenesisState) error
- func ValidateWhitelistedValidators(i interface{}) error
- type AccountKeeper
- type ActiveLiquidValidators
- type BankKeeper
- type DistrKeeper
- type FarmingKeeper
- type GenesisState
- func (*GenesisState) Descriptor() ([]byte, []int)
- func (m *GenesisState) Marshal() (dAtA []byte, err error)
- func (m *GenesisState) MarshalTo(dAtA []byte) (int, error)
- func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*GenesisState) ProtoMessage()
- func (m *GenesisState) Reset()
- func (m *GenesisState) Size() (n int)
- func (m *GenesisState) String() string
- func (m *GenesisState) Unmarshal(dAtA []byte) error
- func (m *GenesisState) XXX_DiscardUnknown()
- func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *GenesisState) XXX_Merge(src proto.Message)
- func (m *GenesisState) XXX_Size() int
- func (m *GenesisState) XXX_Unmarshal(b []byte) error
- type GovKeeper
- type LiquidValidator
- func (*LiquidValidator) Descriptor() ([]byte, []int)
- func (v LiquidValidator) GetDelShares(ctx sdk.Context, sk StakingKeeper) sdk.Dec
- func (v LiquidValidator) GetLiquidTokens(ctx sdk.Context, sk StakingKeeper) sdk.Dec
- func (v LiquidValidator) GetOperator() sdk.ValAddress
- func (v LiquidValidator) GetStatus(activeCondition bool) ValidatorStatus
- func (v LiquidValidator) GetWeight(whitelistedValMap WhitelistedValMap, active bool) sdk.Int
- func (v LiquidValidator) IsTombstoned(ctx sdk.Context, stakingKeeper StakingKeeper, slashingKeeper SlashingKeeper) bool
- func (m *LiquidValidator) Marshal() (dAtA []byte, err error)
- func (m *LiquidValidator) MarshalTo(dAtA []byte) (int, error)
- func (m *LiquidValidator) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*LiquidValidator) ProtoMessage()
- func (m *LiquidValidator) Reset()
- func (m *LiquidValidator) Size() (n int)
- func (m *LiquidValidator) String() string
- func (m *LiquidValidator) Unmarshal(dAtA []byte) error
- func (v LiquidValidator) Validate() error
- func (m *LiquidValidator) XXX_DiscardUnknown()
- func (m *LiquidValidator) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *LiquidValidator) XXX_Merge(src proto.Message)
- func (m *LiquidValidator) XXX_Size() int
- func (m *LiquidValidator) XXX_Unmarshal(b []byte) error
- type LiquidValidatorState
- func (*LiquidValidatorState) Descriptor() ([]byte, []int)
- func (m *LiquidValidatorState) Marshal() (dAtA []byte, err error)
- func (m *LiquidValidatorState) MarshalTo(dAtA []byte) (int, error)
- func (m *LiquidValidatorState) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*LiquidValidatorState) ProtoMessage()
- func (m *LiquidValidatorState) Reset()
- func (m *LiquidValidatorState) Size() (n int)
- func (m *LiquidValidatorState) String() string
- func (m *LiquidValidatorState) Unmarshal(dAtA []byte) error
- func (m *LiquidValidatorState) XXX_DiscardUnknown()
- func (m *LiquidValidatorState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *LiquidValidatorState) XXX_Merge(src proto.Message)
- func (m *LiquidValidatorState) XXX_Size() int
- func (m *LiquidValidatorState) XXX_Unmarshal(b []byte) error
- type LiquidValidators
- func (vs LiquidValidators) Len() int
- func (vs LiquidValidators) Map() map[string]bool
- func (vs LiquidValidators) MinMaxGap(ctx sdk.Context, sk StakingKeeper, targetMap map[string]sdk.Int, ...) (minGapVal LiquidValidator, maxGapVal LiquidValidator, amountNeeded sdk.Int)
- func (vs LiquidValidators) TotalLiquidTokens(ctx sdk.Context, sk StakingKeeper) sdk.Dec
- type LiquidityKeeper
- type MsgClient
- type MsgLiquidStake
- func (*MsgLiquidStake) Descriptor() ([]byte, []int)
- func (msg MsgLiquidStake) GetDelegator() sdk.AccAddress
- func (msg MsgLiquidStake) GetSignBytes() []byte
- func (msg MsgLiquidStake) GetSigners() []sdk.AccAddress
- func (m *MsgLiquidStake) Marshal() (dAtA []byte, err error)
- func (m *MsgLiquidStake) MarshalTo(dAtA []byte) (int, error)
- func (m *MsgLiquidStake) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*MsgLiquidStake) ProtoMessage()
- func (m *MsgLiquidStake) Reset()
- func (msg MsgLiquidStake) Route() string
- func (m *MsgLiquidStake) Size() (n int)
- func (m *MsgLiquidStake) String() string
- func (msg MsgLiquidStake) Type() string
- func (m *MsgLiquidStake) Unmarshal(dAtA []byte) error
- func (msg MsgLiquidStake) ValidateBasic() error
- func (m *MsgLiquidStake) XXX_DiscardUnknown()
- func (m *MsgLiquidStake) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MsgLiquidStake) XXX_Merge(src proto.Message)
- func (m *MsgLiquidStake) XXX_Size() int
- func (m *MsgLiquidStake) XXX_Unmarshal(b []byte) error
- type MsgLiquidStakeResponse
- func (*MsgLiquidStakeResponse) Descriptor() ([]byte, []int)
- func (m *MsgLiquidStakeResponse) Marshal() (dAtA []byte, err error)
- func (m *MsgLiquidStakeResponse) MarshalTo(dAtA []byte) (int, error)
- func (m *MsgLiquidStakeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*MsgLiquidStakeResponse) ProtoMessage()
- func (m *MsgLiquidStakeResponse) Reset()
- func (m *MsgLiquidStakeResponse) Size() (n int)
- func (m *MsgLiquidStakeResponse) String() string
- func (m *MsgLiquidStakeResponse) Unmarshal(dAtA []byte) error
- func (m *MsgLiquidStakeResponse) XXX_DiscardUnknown()
- func (m *MsgLiquidStakeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MsgLiquidStakeResponse) XXX_Merge(src proto.Message)
- func (m *MsgLiquidStakeResponse) XXX_Size() int
- func (m *MsgLiquidStakeResponse) XXX_Unmarshal(b []byte) error
- type MsgLiquidUnstake
- func (*MsgLiquidUnstake) Descriptor() ([]byte, []int)
- func (msg MsgLiquidUnstake) GetDelegator() sdk.AccAddress
- func (msg MsgLiquidUnstake) GetSignBytes() []byte
- func (msg MsgLiquidUnstake) GetSigners() []sdk.AccAddress
- func (m *MsgLiquidUnstake) Marshal() (dAtA []byte, err error)
- func (m *MsgLiquidUnstake) MarshalTo(dAtA []byte) (int, error)
- func (m *MsgLiquidUnstake) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*MsgLiquidUnstake) ProtoMessage()
- func (m *MsgLiquidUnstake) Reset()
- func (msg MsgLiquidUnstake) Route() string
- func (m *MsgLiquidUnstake) Size() (n int)
- func (m *MsgLiquidUnstake) String() string
- func (msg MsgLiquidUnstake) Type() string
- func (m *MsgLiquidUnstake) Unmarshal(dAtA []byte) error
- func (msg MsgLiquidUnstake) ValidateBasic() error
- func (m *MsgLiquidUnstake) XXX_DiscardUnknown()
- func (m *MsgLiquidUnstake) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MsgLiquidUnstake) XXX_Merge(src proto.Message)
- func (m *MsgLiquidUnstake) XXX_Size() int
- func (m *MsgLiquidUnstake) XXX_Unmarshal(b []byte) error
- type MsgLiquidUnstakeResponse
- func (*MsgLiquidUnstakeResponse) Descriptor() ([]byte, []int)
- func (m *MsgLiquidUnstakeResponse) GetCompletionTime() time.Time
- func (m *MsgLiquidUnstakeResponse) Marshal() (dAtA []byte, err error)
- func (m *MsgLiquidUnstakeResponse) MarshalTo(dAtA []byte) (int, error)
- func (m *MsgLiquidUnstakeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*MsgLiquidUnstakeResponse) ProtoMessage()
- func (m *MsgLiquidUnstakeResponse) Reset()
- func (m *MsgLiquidUnstakeResponse) Size() (n int)
- func (m *MsgLiquidUnstakeResponse) String() string
- func (m *MsgLiquidUnstakeResponse) Unmarshal(dAtA []byte) error
- func (m *MsgLiquidUnstakeResponse) XXX_DiscardUnknown()
- func (m *MsgLiquidUnstakeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MsgLiquidUnstakeResponse) XXX_Merge(src proto.Message)
- func (m *MsgLiquidUnstakeResponse) XXX_Size() int
- func (m *MsgLiquidUnstakeResponse) XXX_Unmarshal(b []byte) error
- type MsgServer
- type Params
- func (*Params) Descriptor() ([]byte, []int)
- func (m *Params) Marshal() (dAtA []byte, err error)
- func (m *Params) MarshalTo(dAtA []byte) (int, error)
- func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (p *Params) ParamSetPairs() paramstypes.ParamSetPairs
- func (*Params) ProtoMessage()
- func (m *Params) Reset()
- func (m *Params) Size() (n int)
- func (p Params) String() string
- func (m *Params) Unmarshal(dAtA []byte) error
- func (p Params) Validate() error
- func (p Params) WhitelistedValMap() WhitelistedValMap
- func (m *Params) XXX_DiscardUnknown()
- func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Params) XXX_Merge(src proto.Message)
- func (m *Params) XXX_Size() int
- func (m *Params) XXX_Unmarshal(b []byte) error
- type QueryClient
- type QueryLiquidValidatorsRequest
- func (*QueryLiquidValidatorsRequest) Descriptor() ([]byte, []int)
- func (m *QueryLiquidValidatorsRequest) GetPagination() *query.PageRequest
- func (m *QueryLiquidValidatorsRequest) Marshal() (dAtA []byte, err error)
- func (m *QueryLiquidValidatorsRequest) MarshalTo(dAtA []byte) (int, error)
- func (m *QueryLiquidValidatorsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*QueryLiquidValidatorsRequest) ProtoMessage()
- func (m *QueryLiquidValidatorsRequest) Reset()
- func (m *QueryLiquidValidatorsRequest) Size() (n int)
- func (m *QueryLiquidValidatorsRequest) String() string
- func (m *QueryLiquidValidatorsRequest) Unmarshal(dAtA []byte) error
- func (m *QueryLiquidValidatorsRequest) XXX_DiscardUnknown()
- func (m *QueryLiquidValidatorsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *QueryLiquidValidatorsRequest) XXX_Merge(src proto.Message)
- func (m *QueryLiquidValidatorsRequest) XXX_Size() int
- func (m *QueryLiquidValidatorsRequest) XXX_Unmarshal(b []byte) error
- type QueryLiquidValidatorsResponse
- func (*QueryLiquidValidatorsResponse) Descriptor() ([]byte, []int)
- func (m *QueryLiquidValidatorsResponse) GetLiquidValidators() []LiquidValidatorState
- func (m *QueryLiquidValidatorsResponse) GetPagination() *query.PageResponse
- func (m *QueryLiquidValidatorsResponse) Marshal() (dAtA []byte, err error)
- func (m *QueryLiquidValidatorsResponse) MarshalTo(dAtA []byte) (int, error)
- func (m *QueryLiquidValidatorsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*QueryLiquidValidatorsResponse) ProtoMessage()
- func (m *QueryLiquidValidatorsResponse) Reset()
- func (m *QueryLiquidValidatorsResponse) Size() (n int)
- func (m *QueryLiquidValidatorsResponse) String() string
- func (m *QueryLiquidValidatorsResponse) Unmarshal(dAtA []byte) error
- func (m *QueryLiquidValidatorsResponse) XXX_DiscardUnknown()
- func (m *QueryLiquidValidatorsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *QueryLiquidValidatorsResponse) XXX_Merge(src proto.Message)
- func (m *QueryLiquidValidatorsResponse) XXX_Size() int
- func (m *QueryLiquidValidatorsResponse) XXX_Unmarshal(b []byte) error
- type QueryParamsRequest
- func (*QueryParamsRequest) Descriptor() ([]byte, []int)
- func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error)
- func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error)
- func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*QueryParamsRequest) ProtoMessage()
- func (m *QueryParamsRequest) Reset()
- func (m *QueryParamsRequest) Size() (n int)
- func (m *QueryParamsRequest) String() string
- func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error
- func (m *QueryParamsRequest) XXX_DiscardUnknown()
- func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *QueryParamsRequest) XXX_Merge(src proto.Message)
- func (m *QueryParamsRequest) XXX_Size() int
- func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error
- type QueryParamsResponse
- func (*QueryParamsResponse) Descriptor() ([]byte, []int)
- func (m *QueryParamsResponse) GetParams() Params
- func (m *QueryParamsResponse) Marshal() (dAtA []byte, err error)
- func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error)
- func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*QueryParamsResponse) ProtoMessage()
- func (m *QueryParamsResponse) Reset()
- func (m *QueryParamsResponse) Size() (n int)
- func (m *QueryParamsResponse) String() string
- func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error
- func (m *QueryParamsResponse) XXX_DiscardUnknown()
- func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *QueryParamsResponse) XXX_Merge(src proto.Message)
- func (m *QueryParamsResponse) XXX_Size() int
- func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error
- type QueryServer
- type Redelegation
- type SlashingKeeper
- type StakingHooks
- type StakingKeeper
- type UnimplementedMsgServer
- type UnimplementedQueryServer
- type ValidatorStatus
- type WhitelistedValMap
- type WhitelistedValidator
- func (*WhitelistedValidator) Descriptor() ([]byte, []int)
- func (m *WhitelistedValidator) Marshal() (dAtA []byte, err error)
- func (m *WhitelistedValidator) MarshalTo(dAtA []byte) (int, error)
- func (m *WhitelistedValidator) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*WhitelistedValidator) ProtoMessage()
- func (m *WhitelistedValidator) Reset()
- func (m *WhitelistedValidator) Size() (n int)
- func (m *WhitelistedValidator) String() string
- func (m *WhitelistedValidator) Unmarshal(dAtA []byte) error
- func (m *WhitelistedValidator) XXX_DiscardUnknown()
- func (m *WhitelistedValidator) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *WhitelistedValidator) XXX_Merge(src proto.Message)
- func (m *WhitelistedValidator) XXX_Size() int
- func (m *WhitelistedValidator) XXX_Unmarshal(b []byte) error
Constants ¶
const ( EventTypeMsgLiquidStake = TypeMsgLiquidStake EventTypeMsgLiquidUnstake = TypeMsgLiquidUnstake AttributeKeyBTokenMintedAmount = "btoken_minted_amount" AttributeKeyCompletionTime = "completion_time" AttributeKeyUnbondingAmount = "unbonding_amount" AttributeValueCategory = ModuleName )
Event types for the liquidstaking module.
const ( // ModuleName is the name of the liquidstaking module ModuleName = "liquidstaking" // RouterKey is the message router key for the liquidstaking module RouterKey = ModuleName // StoreKey is the default store key for the liquidstaking module StoreKey = ModuleName // QuerierRoute is the querier route for the liquidstaking module QuerierRoute = ModuleName )
const ( TypeMsgLiquidStake = "liquid_stake" TypeMsgLiquidUnstake = "liquid_unstake" )
Message types for the liquidstaking module
Variables ¶
var ( ErrActiveLiquidValidatorsNotExists = sdkerrors.Register(ModuleName, 2, "active liquid validators not exists") ErrInvalidDenom = sdkerrors.Register(ModuleName, 3, "invalid denom") ErrInvalidBondDenom = sdkerrors.Register(ModuleName, 4, "invalid bond denom") ErrInvalidBondedBondDenom = sdkerrors.Register(ModuleName, 5, "invalid liquid bonded bond denom") ErrNotImplementedYet = sdkerrors.Register(ModuleName, 6, "not implemented yet") ErrLessThanMinLiquidStakingAmount = sdkerrors.Register(ModuleName, 7, "staking amount should be over params.min_liquid_staking_amount") ErrInvalidBTokenSupply = sdkerrors.Register(ModuleName, 8, "invalid bonded bon denom supply") )
Sentinel errors for the liquidstaking module.
var ( ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") )
var ( ErrInvalidLengthLiquidstaking = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowLiquidstaking = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupLiquidstaking = fmt.Errorf("proto: unexpected end of group") )
var ( KeyBondedBondDenom = []byte("BondedBondDenom") KeyWhitelistedValidators = []byte("WhitelistedValidators") KeyUnstakeFeeRate = []byte("UnstakeFeeRate") KeyCommissionRate = []byte("CommissionRate") KeyMinLiquidStakingAmount = []byte("MinLiquidStakingAmount") DefaultBondedBondDenom = "bstake" // DefaultUnstakeFeeRate is the default Unstake Fee Rate. DefaultUnstakeFeeRate = sdk.NewDecWithPrec(1, 3) // "0.001000000000000000" // MinLiquidStakingAmount is the default minimum liquid staking amount. DefaultMinLiquidStakingAmount = sdk.NewInt(1000000) // RebalancingTrigger if the maximum difference and needed each redelegation amount exceeds it, asset rebalacing will be executed. RebalancingTrigger = sdk.NewDecWithPrec(1, 3) // "0.001000000000000000" // RewardTrigger If the sum of balance and the upcoming rewards of LiquidStakingProxyAcc exceeds it, the reward is automatically withdrawn and re-stake according to the weights. RewardTrigger = sdk.NewDecWithPrec(1, 3) // "0.001000000000000000" // LiquidStakingProxyAcc is a proxy reserve account for delegation and undelegation. LiquidStakingProxyAcc = farmingtypes.DeriveAddress(farmingtypes.AddressType32Bytes, ModuleName, "LiquidStakingProxyAcc") )
Parameter store keys
var ( ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") )
var ( ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") )
var ( // Keys for store prefixes LiquidValidatorsKey = []byte{0xc0} // prefix for each key to a liquid validator )
var ( // ModuleCdc references the global x/liquidstaking module codec. Note, the codec // should ONLY be used in certain instances of tests and for JSON encoding as Amino // is still used for that purpose. // // The actual codec used for serialization should be provided to x/liquidstaking and // defined at the application level. ModuleCdc = codec.NewAminoCodec(amino) )
var ValidatorStatus_name = map[int32]string{
0: "VALIDATOR_STATUS_UNSPECIFIED",
1: "VALIDATOR_STATUS_ACTIVE",
2: "VALIDATOR_STATUS_INACTIVE",
}
var ValidatorStatus_value = map[string]int32{
"VALIDATOR_STATUS_UNSPECIFIED": 0,
"VALIDATOR_STATUS_ACTIVE": 1,
"VALIDATOR_STATUS_INACTIVE": 2,
}
Functions ¶
func ActiveCondition ¶
func ActiveCondition(validator stakingtypes.Validator, whitelisted bool, tombstoned bool) bool
ActiveCondition checks the liquid validator could be active by below cases - included on whitelist - existed valid validator on staking module ( existed, not nil del shares and tokens, valid exchange rate) - not tombstoned
func BTokenToNativeToken ¶
func BTokenToNativeToken(bTokenAmount, bTokenTotalSupplyAmount sdk.Int, netAmount, feeRate sdk.Dec) (nativeTokenAmount sdk.Dec)
BTokenToNativeToken returns bTokenAmount * netAmount / bTokenTotalSupply * (1-UnstakeFeeRate) with truncations
func DivideByWeight ¶
func DivideByWeight(activeVals ActiveLiquidValidators, input sdk.Int, whitelistedValMap WhitelistedValMap) (outputs []sdk.Int, crumb sdk.Int)
DivideByWeight divide the input value by the ratio of the param weight of the liquid validator and return it with crumb which is may occur while dividing according to the weight of active liquid validators by decimal error.
func GetLiquidValidatorKey ¶
func GetLiquidValidatorKey(operatorAddr sdk.ValAddress) []byte
GetLiquidValidatorKey creates the key for the liquid validator with address VALUE: liquidstaking/LiquidValidator
func MustMarshalLiquidValidator ¶
func MustMarshalLiquidValidator(cdc codec.BinaryCodec, val *LiquidValidator) []byte
func NativeTokenToBToken ¶
func NativeTokenToBToken(nativeTokenAmount, bTokenTotalSupplyAmount sdk.Int, netAmount sdk.Dec) (bTokenAmount sdk.Int)
NativeTokenToBToken returns nativeTokenAmount * bTokenTotalSupply / netAmount
func ParamKeyTable ¶
func ParamKeyTable() paramstypes.KeyTable
ParamKeyTable returns the parameter key table.
func RegisterInterfaces ¶
func RegisterInterfaces(registry types.InterfaceRegistry)
RegisterInterfaces registers the x/liquidstaking interfaces types with the interface registry.
func RegisterLegacyAminoCodec ¶
func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)
RegisterLegacyAminoCodec registers the necessary x/liquidstaking interfaces and concrete types on the provided LegacyAmino codec. These types are used for Amino JSON serialization.
func RegisterMsgServer ¶
func RegisterQueryHandler ¶
RegisterQueryHandler registers the http handlers for service Query to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterQueryHandlerClient ¶
func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error
RegisterQueryHandlerClient registers the http handlers for service Query to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "QueryClient" to call the correct interceptors.
func RegisterQueryHandlerFromEndpoint ¶
func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterQueryHandlerServer ¶
func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error
RegisterQueryHandlerServer registers the http handlers for service Query to "mux". UnaryRPC :call QueryServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead.
func RegisterQueryServer ¶
func RegisterQueryServer(s grpc1.Server, srv QueryServer)
func ValidateBondedBondDenom ¶
func ValidateBondedBondDenom(i interface{}) error
func ValidateGenesis ¶
func ValidateGenesis(data GenesisState) error
ValidateGenesis validates GenesisState.
func ValidateWhitelistedValidators ¶
func ValidateWhitelistedValidators(i interface{}) error
ValidateWhitelistedValidators validates liquidstaking validator and total weight.
Types ¶
type AccountKeeper ¶
type AccountKeeper interface { GetModuleAddress(name string) sdk.AccAddress GetModuleAccount(ctx sdk.Context, moduleName string) authtypes.ModuleAccountI }
AccountKeeper defines the expected account keeper
type ActiveLiquidValidators ¶
type ActiveLiquidValidators LiquidValidators
func (ActiveLiquidValidators) Len ¶
func (avs ActiveLiquidValidators) Len() int
func (ActiveLiquidValidators) TotalLiquidTokens ¶
func (avs ActiveLiquidValidators) TotalLiquidTokens(ctx sdk.Context, sk StakingKeeper) sdk.Dec
func (ActiveLiquidValidators) TotalWeight ¶
func (avs ActiveLiquidValidators) TotalWeight(whitelistedValMap WhitelistedValMap) sdk.Int
TotalWeight for active liquid validator
type BankKeeper ¶
type BankKeeper interface { SendCoins(ctx sdk.Context, fromAddr sdk.AccAddress, toAddr sdk.AccAddress, amt sdk.Coins) error GetAllBalances(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin GetSupply(ctx sdk.Context, denom string) sdk.Coin SendCoinsFromModuleToModule(ctx sdk.Context, senderPool, recipientPool string, amt sdk.Coins) error SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error BurnCoins(ctx sdk.Context, name string, amt sdk.Coins) error MintCoins(ctx sdk.Context, name string, amt sdk.Coins) error }
BankKeeper defines the expected bank send keeper
type DistrKeeper ¶
type DistrKeeper interface { IncrementValidatorPeriod(ctx sdk.Context, val stakingtypes.ValidatorI) uint64 CalculateDelegationRewards(ctx sdk.Context, val stakingtypes.ValidatorI, del stakingtypes.DelegationI, endingPeriod uint64) (rewards sdk.DecCoins) WithdrawDelegationRewards(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) (sdk.Coins, error) }
DistrKeeper expected distribution keeper (noalias)
type FarmingKeeper ¶
type FarmingKeeper interface { IterateStakingsByFarmer(ctx sdk.Context, farmerAcc sdk.AccAddress, cb func(stakingCoinDenom string, staking farmintypes.Staking) (stop bool)) IterateQueuedStakingsByFarmer(ctx sdk.Context, farmerAcc sdk.AccAddress, cb func(stakingCoinDenom string, queuedStaking farmintypes.QueuedStaking) (stop bool)) }
FarmingKeeper expected farming keeper (noalias)
type GenesisState ¶
type GenesisState struct { // params defines all the parameters for the liquidstaking module Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` LiquidValidators []LiquidValidator `protobuf:"bytes,2,rep,name=liquid_validators,json=liquidValidators,proto3" json:"liquid_validators" yaml:"liquid_validators"` }
GenesisState defines the liquidstaking module's genesis state.
func DefaultGenesisState ¶
func DefaultGenesisState() *GenesisState
DefaultGenesisState returns the default genesis state.
func NewGenesisState ¶
func NewGenesisState(params Params, liquidValidators []LiquidValidator) *GenesisState
NewGenesisState returns new GenesisState instance.
func (*GenesisState) Descriptor ¶
func (*GenesisState) Descriptor() ([]byte, []int)
func (*GenesisState) Marshal ¶
func (m *GenesisState) Marshal() (dAtA []byte, err error)
func (*GenesisState) MarshalToSizedBuffer ¶
func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*GenesisState) ProtoMessage ¶
func (*GenesisState) ProtoMessage()
func (*GenesisState) Reset ¶
func (m *GenesisState) Reset()
func (*GenesisState) Size ¶
func (m *GenesisState) Size() (n int)
func (*GenesisState) String ¶
func (m *GenesisState) String() string
func (*GenesisState) Unmarshal ¶
func (m *GenesisState) Unmarshal(dAtA []byte) error
func (*GenesisState) XXX_DiscardUnknown ¶
func (m *GenesisState) XXX_DiscardUnknown()
func (*GenesisState) XXX_Marshal ¶
func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*GenesisState) XXX_Merge ¶
func (m *GenesisState) XXX_Merge(src proto.Message)
func (*GenesisState) XXX_Size ¶
func (m *GenesisState) XXX_Size() int
func (*GenesisState) XXX_Unmarshal ¶
func (m *GenesisState) XXX_Unmarshal(b []byte) error
type GovKeeper ¶
type GovKeeper interface { Tally(ctx sdk.Context, proposal govtypes.Proposal) (passes bool, burnDeposits bool, tallyResults govtypes.TallyResult) GetVotes(ctx sdk.Context, proposalID uint64) (votes govtypes.Votes) GetVote(ctx sdk.Context, proposalID uint64, voterAddr sdk.AccAddress) (vote govtypes.Vote, found bool) }
GovKeeper expected gov keeper (noalias)
type LiquidValidator ¶
type LiquidValidator struct { // operator_address defines the address of the validator's operator; bech encoded in JSON. OperatorAddress string `` /* 130-byte string literal not displayed */ }
LiquidValidator defines a Validator that can be the target of LiquidStaking and LiquidUnstaking, Active, Weight, etc. fields are derived as functions to deal with by maintaining consistency with the state of the staking module.
func MustUnmarshalLiquidValidator ¶
func MustUnmarshalLiquidValidator(cdc codec.BinaryCodec, value []byte) LiquidValidator
must unmarshal a liquid validator from a store value
func UnmarshalLiquidValidator ¶
func UnmarshalLiquidValidator(cdc codec.BinaryCodec, value []byte) (val LiquidValidator, err error)
unmarshal a liquid validator from a store value
func (*LiquidValidator) Descriptor ¶
func (*LiquidValidator) Descriptor() ([]byte, []int)
func (LiquidValidator) GetDelShares ¶
func (v LiquidValidator) GetDelShares(ctx sdk.Context, sk StakingKeeper) sdk.Dec
func (LiquidValidator) GetLiquidTokens ¶
func (v LiquidValidator) GetLiquidTokens(ctx sdk.Context, sk StakingKeeper) sdk.Dec
func (LiquidValidator) GetOperator ¶
func (v LiquidValidator) GetOperator() sdk.ValAddress
func (LiquidValidator) GetStatus ¶
func (v LiquidValidator) GetStatus(activeCondition bool) ValidatorStatus
TODO: refactor unused receiver
func (LiquidValidator) GetWeight ¶
func (v LiquidValidator) GetWeight(whitelistedValMap WhitelistedValMap, active bool) sdk.Int
func (LiquidValidator) IsTombstoned ¶
func (v LiquidValidator) IsTombstoned(ctx sdk.Context, stakingKeeper StakingKeeper, slashingKeeper SlashingKeeper) bool
func (*LiquidValidator) Marshal ¶
func (m *LiquidValidator) Marshal() (dAtA []byte, err error)
func (*LiquidValidator) MarshalToSizedBuffer ¶
func (m *LiquidValidator) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*LiquidValidator) ProtoMessage ¶
func (*LiquidValidator) ProtoMessage()
func (*LiquidValidator) Reset ¶
func (m *LiquidValidator) Reset()
func (*LiquidValidator) Size ¶
func (m *LiquidValidator) Size() (n int)
func (*LiquidValidator) String ¶
func (m *LiquidValidator) String() string
func (*LiquidValidator) Unmarshal ¶
func (m *LiquidValidator) Unmarshal(dAtA []byte) error
func (LiquidValidator) Validate ¶
func (v LiquidValidator) Validate() error
Validate validates LiquidValidator.
func (*LiquidValidator) XXX_DiscardUnknown ¶
func (m *LiquidValidator) XXX_DiscardUnknown()
func (*LiquidValidator) XXX_Marshal ¶
func (m *LiquidValidator) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*LiquidValidator) XXX_Merge ¶
func (m *LiquidValidator) XXX_Merge(src proto.Message)
func (*LiquidValidator) XXX_Size ¶
func (m *LiquidValidator) XXX_Size() int
func (*LiquidValidator) XXX_Unmarshal ¶
func (m *LiquidValidator) XXX_Unmarshal(b []byte) error
type LiquidValidatorState ¶
type LiquidValidatorState struct { // operator_address defines the address of the validator's operator; bech encoded in JSON. OperatorAddress string `` /* 130-byte string literal not displayed */ // weight specifies the weight for liquid staking, unstaking amount Weight github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=weight,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"weight" yaml:"weight"` // status is the liquid validator status Status ValidatorStatus `protobuf:"varint,3,opt,name=status,proto3,enum=squad.liquidstaking.v1beta1.ValidatorStatus" json:"status,omitempty"` DelShares github_com_cosmos_cosmos_sdk_types.Dec `` /* 128-byte string literal not displayed */ // liquid_tokens define the token amount worth of delegation shares of the validator (slashing applied amount) LiquidTokens github_com_cosmos_cosmos_sdk_types.Dec `` /* 137-byte string literal not displayed */ }
LiquidValidatorState is type LiquidValidator with state added to return to query results.
func (*LiquidValidatorState) Descriptor ¶
func (*LiquidValidatorState) Descriptor() ([]byte, []int)
func (*LiquidValidatorState) Marshal ¶
func (m *LiquidValidatorState) Marshal() (dAtA []byte, err error)
func (*LiquidValidatorState) MarshalTo ¶
func (m *LiquidValidatorState) MarshalTo(dAtA []byte) (int, error)
func (*LiquidValidatorState) MarshalToSizedBuffer ¶
func (m *LiquidValidatorState) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*LiquidValidatorState) ProtoMessage ¶
func (*LiquidValidatorState) ProtoMessage()
func (*LiquidValidatorState) Reset ¶
func (m *LiquidValidatorState) Reset()
func (*LiquidValidatorState) Size ¶
func (m *LiquidValidatorState) Size() (n int)
func (*LiquidValidatorState) String ¶
func (m *LiquidValidatorState) String() string
func (*LiquidValidatorState) Unmarshal ¶
func (m *LiquidValidatorState) Unmarshal(dAtA []byte) error
func (*LiquidValidatorState) XXX_DiscardUnknown ¶
func (m *LiquidValidatorState) XXX_DiscardUnknown()
func (*LiquidValidatorState) XXX_Marshal ¶
func (m *LiquidValidatorState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*LiquidValidatorState) XXX_Merge ¶
func (m *LiquidValidatorState) XXX_Merge(src proto.Message)
func (*LiquidValidatorState) XXX_Size ¶
func (m *LiquidValidatorState) XXX_Size() int
func (*LiquidValidatorState) XXX_Unmarshal ¶
func (m *LiquidValidatorState) XXX_Unmarshal(b []byte) error
type LiquidValidators ¶
type LiquidValidators []LiquidValidator
LiquidValidators is a collection of LiquidValidator
func (LiquidValidators) Len ¶
func (vs LiquidValidators) Len() int
func (LiquidValidators) Map ¶
func (vs LiquidValidators) Map() map[string]bool
func (LiquidValidators) MinMaxGap ¶
func (vs LiquidValidators) MinMaxGap(ctx sdk.Context, sk StakingKeeper, targetMap map[string]sdk.Int, threshold sdk.Int) (minGapVal LiquidValidator, maxGapVal LiquidValidator, amountNeeded sdk.Int)
MinMaxGap Return the list of LiquidValidator with the maximum gap and minimum gap from the target weight of LiquidValidators, respectively.
func (LiquidValidators) TotalLiquidTokens ¶
func (vs LiquidValidators) TotalLiquidTokens(ctx sdk.Context, sk StakingKeeper) sdk.Dec
type LiquidityKeeper ¶
type LiquidityKeeper interface { GetPair(ctx sdk.Context, id uint64) (pair liquiditytypes.Pair, found bool) GetPool(ctx sdk.Context, id uint64) (pool liquiditytypes.Pool, found bool) GetPoolBalance(ctx sdk.Context, pool liquiditytypes.Pool, pair liquiditytypes.Pair) (rx sdk.Int, ry sdk.Int) GetPoolCoinSupply(ctx sdk.Context, pool liquiditytypes.Pool) sdk.Int }
Liquidity expected liquidity keeper (noalias)
type MsgClient ¶
type MsgClient interface { // LiquidStake defines a method for performing a delegation of coins // from a delegator to whitelisted validators. LiquidStake(ctx context.Context, in *MsgLiquidStake, opts ...grpc.CallOption) (*MsgLiquidStakeResponse, error) // LiquidUnstake defines a method for performing an undelegation of liquid staking from a // delegate. LiquidUnstake(ctx context.Context, in *MsgLiquidUnstake, opts ...grpc.CallOption) (*MsgLiquidUnstakeResponse, error) }
MsgClient is the client API for Msg service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewMsgClient ¶
func NewMsgClient(cc grpc1.ClientConn) MsgClient
type MsgLiquidStake ¶
type MsgLiquidStake struct { DelegatorAddress string `` /* 134-byte string literal not displayed */ Amount types.Coin `protobuf:"bytes,2,opt,name=amount,proto3" json:"amount"` }
MsgLiquidStake defines a SDK message for performing a liquid stake of coins from a delegator to whitelisted validators.
func NewMsgLiquidStake ¶
func NewMsgLiquidStake( liquidStaker sdk.AccAddress, amount sdk.Coin, ) *MsgLiquidStake
NewMsgLiquidStake creates a new MsgLiquidStake.
func (*MsgLiquidStake) Descriptor ¶
func (*MsgLiquidStake) Descriptor() ([]byte, []int)
func (MsgLiquidStake) GetDelegator ¶
func (msg MsgLiquidStake) GetDelegator() sdk.AccAddress
func (MsgLiquidStake) GetSignBytes ¶
func (msg MsgLiquidStake) GetSignBytes() []byte
func (MsgLiquidStake) GetSigners ¶
func (msg MsgLiquidStake) GetSigners() []sdk.AccAddress
func (*MsgLiquidStake) Marshal ¶
func (m *MsgLiquidStake) Marshal() (dAtA []byte, err error)
func (*MsgLiquidStake) MarshalToSizedBuffer ¶
func (m *MsgLiquidStake) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*MsgLiquidStake) ProtoMessage ¶
func (*MsgLiquidStake) ProtoMessage()
func (*MsgLiquidStake) Reset ¶
func (m *MsgLiquidStake) Reset()
func (MsgLiquidStake) Route ¶
func (msg MsgLiquidStake) Route() string
func (*MsgLiquidStake) Size ¶
func (m *MsgLiquidStake) Size() (n int)
func (*MsgLiquidStake) String ¶
func (m *MsgLiquidStake) String() string
func (MsgLiquidStake) Type ¶
func (msg MsgLiquidStake) Type() string
func (*MsgLiquidStake) Unmarshal ¶
func (m *MsgLiquidStake) Unmarshal(dAtA []byte) error
func (MsgLiquidStake) ValidateBasic ¶
func (msg MsgLiquidStake) ValidateBasic() error
func (*MsgLiquidStake) XXX_DiscardUnknown ¶
func (m *MsgLiquidStake) XXX_DiscardUnknown()
func (*MsgLiquidStake) XXX_Marshal ¶
func (m *MsgLiquidStake) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*MsgLiquidStake) XXX_Merge ¶
func (m *MsgLiquidStake) XXX_Merge(src proto.Message)
func (*MsgLiquidStake) XXX_Size ¶
func (m *MsgLiquidStake) XXX_Size() int
func (*MsgLiquidStake) XXX_Unmarshal ¶
func (m *MsgLiquidStake) XXX_Unmarshal(b []byte) error
type MsgLiquidStakeResponse ¶
type MsgLiquidStakeResponse struct { }
MsgLiquidStakeResponse defines the Msg/LiquidStake response type.
func (*MsgLiquidStakeResponse) Descriptor ¶
func (*MsgLiquidStakeResponse) Descriptor() ([]byte, []int)
func (*MsgLiquidStakeResponse) Marshal ¶
func (m *MsgLiquidStakeResponse) Marshal() (dAtA []byte, err error)
func (*MsgLiquidStakeResponse) MarshalTo ¶
func (m *MsgLiquidStakeResponse) MarshalTo(dAtA []byte) (int, error)
func (*MsgLiquidStakeResponse) MarshalToSizedBuffer ¶
func (m *MsgLiquidStakeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*MsgLiquidStakeResponse) ProtoMessage ¶
func (*MsgLiquidStakeResponse) ProtoMessage()
func (*MsgLiquidStakeResponse) Reset ¶
func (m *MsgLiquidStakeResponse) Reset()
func (*MsgLiquidStakeResponse) Size ¶
func (m *MsgLiquidStakeResponse) Size() (n int)
func (*MsgLiquidStakeResponse) String ¶
func (m *MsgLiquidStakeResponse) String() string
func (*MsgLiquidStakeResponse) Unmarshal ¶
func (m *MsgLiquidStakeResponse) Unmarshal(dAtA []byte) error
func (*MsgLiquidStakeResponse) XXX_DiscardUnknown ¶
func (m *MsgLiquidStakeResponse) XXX_DiscardUnknown()
func (*MsgLiquidStakeResponse) XXX_Marshal ¶
func (m *MsgLiquidStakeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*MsgLiquidStakeResponse) XXX_Merge ¶
func (m *MsgLiquidStakeResponse) XXX_Merge(src proto.Message)
func (*MsgLiquidStakeResponse) XXX_Size ¶
func (m *MsgLiquidStakeResponse) XXX_Size() int
func (*MsgLiquidStakeResponse) XXX_Unmarshal ¶
func (m *MsgLiquidStakeResponse) XXX_Unmarshal(b []byte) error
type MsgLiquidUnstake ¶
type MsgLiquidUnstake struct { DelegatorAddress string `` /* 134-byte string literal not displayed */ Amount types.Coin `protobuf:"bytes,2,opt,name=amount,proto3" json:"amount"` }
MsgLiquidUnstake defines a SDK message for performing an undelegation of liquid staking from a delegate.
func NewMsgLiquidUnstake ¶
func NewMsgLiquidUnstake( liquidStaker sdk.AccAddress, amount sdk.Coin, ) *MsgLiquidUnstake
NewMsgLiquidUnstake creates a new MsgLiquidUnstake.
func (*MsgLiquidUnstake) Descriptor ¶
func (*MsgLiquidUnstake) Descriptor() ([]byte, []int)
func (MsgLiquidUnstake) GetDelegator ¶
func (msg MsgLiquidUnstake) GetDelegator() sdk.AccAddress
func (MsgLiquidUnstake) GetSignBytes ¶
func (msg MsgLiquidUnstake) GetSignBytes() []byte
func (MsgLiquidUnstake) GetSigners ¶
func (msg MsgLiquidUnstake) GetSigners() []sdk.AccAddress
func (*MsgLiquidUnstake) Marshal ¶
func (m *MsgLiquidUnstake) Marshal() (dAtA []byte, err error)
func (*MsgLiquidUnstake) MarshalToSizedBuffer ¶
func (m *MsgLiquidUnstake) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*MsgLiquidUnstake) ProtoMessage ¶
func (*MsgLiquidUnstake) ProtoMessage()
func (*MsgLiquidUnstake) Reset ¶
func (m *MsgLiquidUnstake) Reset()
func (MsgLiquidUnstake) Route ¶
func (msg MsgLiquidUnstake) Route() string
func (*MsgLiquidUnstake) Size ¶
func (m *MsgLiquidUnstake) Size() (n int)
func (*MsgLiquidUnstake) String ¶
func (m *MsgLiquidUnstake) String() string
func (MsgLiquidUnstake) Type ¶
func (msg MsgLiquidUnstake) Type() string
func (*MsgLiquidUnstake) Unmarshal ¶
func (m *MsgLiquidUnstake) Unmarshal(dAtA []byte) error
func (MsgLiquidUnstake) ValidateBasic ¶
func (msg MsgLiquidUnstake) ValidateBasic() error
func (*MsgLiquidUnstake) XXX_DiscardUnknown ¶
func (m *MsgLiquidUnstake) XXX_DiscardUnknown()
func (*MsgLiquidUnstake) XXX_Marshal ¶
func (m *MsgLiquidUnstake) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*MsgLiquidUnstake) XXX_Merge ¶
func (m *MsgLiquidUnstake) XXX_Merge(src proto.Message)
func (*MsgLiquidUnstake) XXX_Size ¶
func (m *MsgLiquidUnstake) XXX_Size() int
func (*MsgLiquidUnstake) XXX_Unmarshal ¶
func (m *MsgLiquidUnstake) XXX_Unmarshal(b []byte) error
type MsgLiquidUnstakeResponse ¶
type MsgLiquidUnstakeResponse struct {
CompletionTime time.Time `protobuf:"bytes,1,opt,name=completion_time,json=completionTime,proto3,stdtime" json:"completion_time"`
}
MsgLiquidUnstakeResponse defines the Msg/LiquidUnstake response type.
func (*MsgLiquidUnstakeResponse) Descriptor ¶
func (*MsgLiquidUnstakeResponse) Descriptor() ([]byte, []int)
func (*MsgLiquidUnstakeResponse) GetCompletionTime ¶
func (m *MsgLiquidUnstakeResponse) GetCompletionTime() time.Time
func (*MsgLiquidUnstakeResponse) Marshal ¶
func (m *MsgLiquidUnstakeResponse) Marshal() (dAtA []byte, err error)
func (*MsgLiquidUnstakeResponse) MarshalTo ¶
func (m *MsgLiquidUnstakeResponse) MarshalTo(dAtA []byte) (int, error)
func (*MsgLiquidUnstakeResponse) MarshalToSizedBuffer ¶
func (m *MsgLiquidUnstakeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*MsgLiquidUnstakeResponse) ProtoMessage ¶
func (*MsgLiquidUnstakeResponse) ProtoMessage()
func (*MsgLiquidUnstakeResponse) Reset ¶
func (m *MsgLiquidUnstakeResponse) Reset()
func (*MsgLiquidUnstakeResponse) Size ¶
func (m *MsgLiquidUnstakeResponse) Size() (n int)
func (*MsgLiquidUnstakeResponse) String ¶
func (m *MsgLiquidUnstakeResponse) String() string
func (*MsgLiquidUnstakeResponse) Unmarshal ¶
func (m *MsgLiquidUnstakeResponse) Unmarshal(dAtA []byte) error
func (*MsgLiquidUnstakeResponse) XXX_DiscardUnknown ¶
func (m *MsgLiquidUnstakeResponse) XXX_DiscardUnknown()
func (*MsgLiquidUnstakeResponse) XXX_Marshal ¶
func (m *MsgLiquidUnstakeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*MsgLiquidUnstakeResponse) XXX_Merge ¶
func (m *MsgLiquidUnstakeResponse) XXX_Merge(src proto.Message)
func (*MsgLiquidUnstakeResponse) XXX_Size ¶
func (m *MsgLiquidUnstakeResponse) XXX_Size() int
func (*MsgLiquidUnstakeResponse) XXX_Unmarshal ¶
func (m *MsgLiquidUnstakeResponse) XXX_Unmarshal(b []byte) error
type MsgServer ¶
type MsgServer interface { // LiquidStake defines a method for performing a delegation of coins // from a delegator to whitelisted validators. LiquidStake(context.Context, *MsgLiquidStake) (*MsgLiquidStakeResponse, error) // LiquidUnstake defines a method for performing an undelegation of liquid staking from a // delegate. LiquidUnstake(context.Context, *MsgLiquidUnstake) (*MsgLiquidUnstakeResponse, error) }
MsgServer is the server API for Msg service.
type Params ¶
type Params struct { // BondedBondDenom specifies the denomination of the token receiving after LiquidStaking, The value is calculated // through NetAmount. BondedBondDenom string `` /* 133-byte string literal not displayed */ // WhitelistedValidators specifies the validators elected to become Active Liquid Validators. WhitelistedValidators []WhitelistedValidator `` /* 144-byte string literal not displayed */ // UnstakeFeeRate specifies the fee rate when liquid unstake is requested, unbonded by subtracting it from // unbondingAmount UnstakeFeeRate github_com_cosmos_cosmos_sdk_types.Dec `` /* 169-byte string literal not displayed */ // MinLiquidStakingAmount specifies the minimum number of coins to be staked to the active liquid validators on liquid // staking to minimize decimal loss and consider gas efficiency. MinLiquidStakingAmount github_com_cosmos_cosmos_sdk_types.Int `` /* 204-byte string literal not displayed */ }
Params defines the set of params for the liquidstaking module.
func DefaultParams ¶
func DefaultParams() Params
DefaultParams returns the default liquidstaking module parameters.
func (*Params) Descriptor ¶
func (*Params) MarshalToSizedBuffer ¶
func (*Params) ParamSetPairs ¶
func (p *Params) ParamSetPairs() paramstypes.ParamSetPairs
ParamSetPairs implements paramstypes.ParamSet.
func (*Params) ProtoMessage ¶
func (*Params) ProtoMessage()
func (Params) WhitelistedValMap ¶
func (p Params) WhitelistedValMap() WhitelistedValMap
func (*Params) XXX_DiscardUnknown ¶
func (m *Params) XXX_DiscardUnknown()
func (*Params) XXX_Marshal ¶
func (*Params) XXX_Unmarshal ¶
type QueryClient ¶
type QueryClient interface { // Params returns parameters of the liquidstaking module. Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) // LiquidValidators returns liquid validators with states of the liquidstaking module. LiquidValidators(ctx context.Context, in *QueryLiquidValidatorsRequest, opts ...grpc.CallOption) (*QueryLiquidValidatorsResponse, error) }
QueryClient is the client API for Query service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewQueryClient ¶
func NewQueryClient(cc grpc1.ClientConn) QueryClient
type QueryLiquidValidatorsRequest ¶
type QueryLiquidValidatorsRequest struct { // pagination defines the pagination in the response. Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` }
QueryLiquidValidatorsRequest is the request type for the Query/LiquidValidators RPC method.
func (*QueryLiquidValidatorsRequest) Descriptor ¶
func (*QueryLiquidValidatorsRequest) Descriptor() ([]byte, []int)
func (*QueryLiquidValidatorsRequest) GetPagination ¶
func (m *QueryLiquidValidatorsRequest) GetPagination() *query.PageRequest
func (*QueryLiquidValidatorsRequest) Marshal ¶
func (m *QueryLiquidValidatorsRequest) Marshal() (dAtA []byte, err error)
func (*QueryLiquidValidatorsRequest) MarshalTo ¶
func (m *QueryLiquidValidatorsRequest) MarshalTo(dAtA []byte) (int, error)
func (*QueryLiquidValidatorsRequest) MarshalToSizedBuffer ¶
func (m *QueryLiquidValidatorsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*QueryLiquidValidatorsRequest) ProtoMessage ¶
func (*QueryLiquidValidatorsRequest) ProtoMessage()
func (*QueryLiquidValidatorsRequest) Reset ¶
func (m *QueryLiquidValidatorsRequest) Reset()
func (*QueryLiquidValidatorsRequest) Size ¶
func (m *QueryLiquidValidatorsRequest) Size() (n int)
func (*QueryLiquidValidatorsRequest) String ¶
func (m *QueryLiquidValidatorsRequest) String() string
func (*QueryLiquidValidatorsRequest) Unmarshal ¶
func (m *QueryLiquidValidatorsRequest) Unmarshal(dAtA []byte) error
func (*QueryLiquidValidatorsRequest) XXX_DiscardUnknown ¶
func (m *QueryLiquidValidatorsRequest) XXX_DiscardUnknown()
func (*QueryLiquidValidatorsRequest) XXX_Marshal ¶
func (m *QueryLiquidValidatorsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*QueryLiquidValidatorsRequest) XXX_Merge ¶
func (m *QueryLiquidValidatorsRequest) XXX_Merge(src proto.Message)
func (*QueryLiquidValidatorsRequest) XXX_Size ¶
func (m *QueryLiquidValidatorsRequest) XXX_Size() int
func (*QueryLiquidValidatorsRequest) XXX_Unmarshal ¶
func (m *QueryLiquidValidatorsRequest) XXX_Unmarshal(b []byte) error
type QueryLiquidValidatorsResponse ¶
type QueryLiquidValidatorsResponse struct { LiquidValidators []LiquidValidatorState `protobuf:"bytes,1,rep,name=liquid_validators,json=liquidValidators,proto3" json:"liquid_validators"` // pagination defines the pagination in the response. Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` }
QueryLiquidValidatorsResponse is the response type for the Query/LiquidValidators RPC method.
func (*QueryLiquidValidatorsResponse) Descriptor ¶
func (*QueryLiquidValidatorsResponse) Descriptor() ([]byte, []int)
func (*QueryLiquidValidatorsResponse) GetLiquidValidators ¶
func (m *QueryLiquidValidatorsResponse) GetLiquidValidators() []LiquidValidatorState
func (*QueryLiquidValidatorsResponse) GetPagination ¶
func (m *QueryLiquidValidatorsResponse) GetPagination() *query.PageResponse
func (*QueryLiquidValidatorsResponse) Marshal ¶
func (m *QueryLiquidValidatorsResponse) Marshal() (dAtA []byte, err error)
func (*QueryLiquidValidatorsResponse) MarshalTo ¶
func (m *QueryLiquidValidatorsResponse) MarshalTo(dAtA []byte) (int, error)
func (*QueryLiquidValidatorsResponse) MarshalToSizedBuffer ¶
func (m *QueryLiquidValidatorsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*QueryLiquidValidatorsResponse) ProtoMessage ¶
func (*QueryLiquidValidatorsResponse) ProtoMessage()
func (*QueryLiquidValidatorsResponse) Reset ¶
func (m *QueryLiquidValidatorsResponse) Reset()
func (*QueryLiquidValidatorsResponse) Size ¶
func (m *QueryLiquidValidatorsResponse) Size() (n int)
func (*QueryLiquidValidatorsResponse) String ¶
func (m *QueryLiquidValidatorsResponse) String() string
func (*QueryLiquidValidatorsResponse) Unmarshal ¶
func (m *QueryLiquidValidatorsResponse) Unmarshal(dAtA []byte) error
func (*QueryLiquidValidatorsResponse) XXX_DiscardUnknown ¶
func (m *QueryLiquidValidatorsResponse) XXX_DiscardUnknown()
func (*QueryLiquidValidatorsResponse) XXX_Marshal ¶
func (m *QueryLiquidValidatorsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*QueryLiquidValidatorsResponse) XXX_Merge ¶
func (m *QueryLiquidValidatorsResponse) XXX_Merge(src proto.Message)
func (*QueryLiquidValidatorsResponse) XXX_Size ¶
func (m *QueryLiquidValidatorsResponse) XXX_Size() int
func (*QueryLiquidValidatorsResponse) XXX_Unmarshal ¶
func (m *QueryLiquidValidatorsResponse) XXX_Unmarshal(b []byte) error
type QueryParamsRequest ¶
type QueryParamsRequest struct { }
QueryParamsRequest is the request type for the Query/Params RPC method.
func (*QueryParamsRequest) Descriptor ¶
func (*QueryParamsRequest) Descriptor() ([]byte, []int)
func (*QueryParamsRequest) Marshal ¶
func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error)
func (*QueryParamsRequest) MarshalTo ¶
func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error)
func (*QueryParamsRequest) MarshalToSizedBuffer ¶
func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*QueryParamsRequest) ProtoMessage ¶
func (*QueryParamsRequest) ProtoMessage()
func (*QueryParamsRequest) Reset ¶
func (m *QueryParamsRequest) Reset()
func (*QueryParamsRequest) Size ¶
func (m *QueryParamsRequest) Size() (n int)
func (*QueryParamsRequest) String ¶
func (m *QueryParamsRequest) String() string
func (*QueryParamsRequest) Unmarshal ¶
func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error
func (*QueryParamsRequest) XXX_DiscardUnknown ¶
func (m *QueryParamsRequest) XXX_DiscardUnknown()
func (*QueryParamsRequest) XXX_Marshal ¶
func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*QueryParamsRequest) XXX_Merge ¶
func (m *QueryParamsRequest) XXX_Merge(src proto.Message)
func (*QueryParamsRequest) XXX_Size ¶
func (m *QueryParamsRequest) XXX_Size() int
func (*QueryParamsRequest) XXX_Unmarshal ¶
func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error
type QueryParamsResponse ¶
type QueryParamsResponse struct {
Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"`
}
QueryParamsResponse is the response type for the Query/Params RPC method.
func (*QueryParamsResponse) Descriptor ¶
func (*QueryParamsResponse) Descriptor() ([]byte, []int)
func (*QueryParamsResponse) GetParams ¶
func (m *QueryParamsResponse) GetParams() Params
func (*QueryParamsResponse) Marshal ¶
func (m *QueryParamsResponse) Marshal() (dAtA []byte, err error)
func (*QueryParamsResponse) MarshalTo ¶
func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error)
func (*QueryParamsResponse) MarshalToSizedBuffer ¶
func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*QueryParamsResponse) ProtoMessage ¶
func (*QueryParamsResponse) ProtoMessage()
func (*QueryParamsResponse) Reset ¶
func (m *QueryParamsResponse) Reset()
func (*QueryParamsResponse) Size ¶
func (m *QueryParamsResponse) Size() (n int)
func (*QueryParamsResponse) String ¶
func (m *QueryParamsResponse) String() string
func (*QueryParamsResponse) Unmarshal ¶
func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error
func (*QueryParamsResponse) XXX_DiscardUnknown ¶
func (m *QueryParamsResponse) XXX_DiscardUnknown()
func (*QueryParamsResponse) XXX_Marshal ¶
func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*QueryParamsResponse) XXX_Merge ¶
func (m *QueryParamsResponse) XXX_Merge(src proto.Message)
func (*QueryParamsResponse) XXX_Size ¶
func (m *QueryParamsResponse) XXX_Size() int
func (*QueryParamsResponse) XXX_Unmarshal ¶
func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error
type QueryServer ¶
type QueryServer interface { // Params returns parameters of the liquidstaking module. Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) // LiquidValidators returns liquid validators with states of the liquidstaking module. LiquidValidators(context.Context, *QueryLiquidValidatorsRequest) (*QueryLiquidValidatorsResponse, error) }
QueryServer is the server API for Query service.
type Redelegation ¶
type Redelegation struct { Delegator sdk.AccAddress SrcValidator sdk.ValAddress DstValidator sdk.ValAddress Amount sdk.Int }
type SlashingKeeper ¶
type SlashingKeeper interface {
IsTombstoned(ctx sdk.Context, consAddr sdk.ConsAddress) bool
}
SlashingKeeper expected slashing keeper (noalias)
type StakingHooks ¶
type StakingHooks interface { AfterValidatorCreated(ctx sdk.Context, valAddr sdk.ValAddress) // Must be called when a validator is created AfterValidatorRemoved(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) // Must be called when a validator is deleted BeforeDelegationCreated(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) // Must be called when a delegation is created AfterDelegationModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) BeforeValidatorSlashed(ctx sdk.Context, valAddr sdk.ValAddress, fraction sdk.Dec) }
StakingHooks event hooks for staking validator object (noalias)
type StakingKeeper ¶
type StakingKeeper interface { Validator(sdk.Context, sdk.ValAddress) stakingtypes.ValidatorI ValidatorByConsAddr(sdk.Context, sdk.ConsAddress) stakingtypes.ValidatorI GetValidator(ctx sdk.Context, addr sdk.ValAddress) (validator stakingtypes.Validator, found bool) GetLastTotalPower(ctx sdk.Context) sdk.Int GetLastValidatorPower(ctx sdk.Context, valAddr sdk.ValAddress) int64 Delegation(sdk.Context, sdk.AccAddress, sdk.ValAddress) stakingtypes.DelegationI GetDelegation(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) (delegation stakingtypes.Delegation, found bool) IterateDelegations(ctx sdk.Context, delegator sdk.AccAddress, fn func(index int64, delegation stakingtypes.DelegationI) (stop bool)) Delegate( ctx sdk.Context, delAddr sdk.AccAddress, bondAmt sdk.Int, tokenSrc stakingtypes.BondStatus, validator stakingtypes.Validator, subtractAccount bool, ) (newShares sdk.Dec, err error) BondDenom(ctx sdk.Context) (res string) Unbond(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress, shares sdk.Dec) (amount sdk.Int, err error) UnbondingTime(ctx sdk.Context) (res time.Duration) SetUnbondingDelegationEntry( ctx sdk.Context, delegatorAddr sdk.AccAddress, validatorAddr sdk.ValAddress, creationHeight int64, minTime time.Time, balance sdk.Int, ) stakingtypes.UnbondingDelegation InsertUBDQueue(ctx sdk.Context, ubd stakingtypes.UnbondingDelegation, completionTime time.Time) ValidateUnbondAmount( ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress, amt sdk.Int, ) (shares sdk.Dec, err error) BeginRedelegation( ctx sdk.Context, delAddr sdk.AccAddress, valSrcAddr, valDstAddr sdk.ValAddress, sharesAmount sdk.Dec, ) (completionTime time.Time, err error) }
StakingKeeper expected staking keeper (noalias)
type UnimplementedMsgServer ¶
type UnimplementedMsgServer struct { }
UnimplementedMsgServer can be embedded to have forward compatible implementations.
func (*UnimplementedMsgServer) LiquidStake ¶
func (*UnimplementedMsgServer) LiquidStake(ctx context.Context, req *MsgLiquidStake) (*MsgLiquidStakeResponse, error)
func (*UnimplementedMsgServer) LiquidUnstake ¶
func (*UnimplementedMsgServer) LiquidUnstake(ctx context.Context, req *MsgLiquidUnstake) (*MsgLiquidUnstakeResponse, error)
type UnimplementedQueryServer ¶
type UnimplementedQueryServer struct { }
UnimplementedQueryServer can be embedded to have forward compatible implementations.
func (*UnimplementedQueryServer) LiquidValidators ¶
func (*UnimplementedQueryServer) LiquidValidators(ctx context.Context, req *QueryLiquidValidatorsRequest) (*QueryLiquidValidatorsResponse, error)
func (*UnimplementedQueryServer) Params ¶
func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error)
type ValidatorStatus ¶
type ValidatorStatus int32
ValidatorStatus enumerates the status of a liquid validator.
const ( // VALIDATOR_STATUS_UNSPECIFIED defines the unspecified invalid status. ValidatorStatusUnspecified ValidatorStatus = 0 // VALIDATOR_STATUS_ACTIVE defines the active, valid status ValidatorStatusActive ValidatorStatus = 1 // VALIDATOR_STATUS_INACTIVE defines the inactive, invalid status ValidatorStatusInActive ValidatorStatus = 2 )
func (ValidatorStatus) EnumDescriptor ¶
func (ValidatorStatus) EnumDescriptor() ([]byte, []int)
func (ValidatorStatus) String ¶
func (x ValidatorStatus) String() string
type WhitelistedValMap ¶
type WhitelistedValMap map[string]WhitelistedValidator
func GetWhitelistedValMap ¶
func GetWhitelistedValMap(whitelistedValidators []WhitelistedValidator) WhitelistedValMap
func (WhitelistedValMap) IsListed ¶
func (whitelistedValMap WhitelistedValMap) IsListed(operatorAddr string) bool
type WhitelistedValidator ¶
type WhitelistedValidator struct { // validator_address defines the bech32-encoded address that whitelisted validator ValidatorAddress string `` /* 134-byte string literal not displayed */ // target_weight specifies the target weight for liquid staking, unstaking amount, which is a value for calculating // the real weight to be derived according to the active status TargetWeight github_com_cosmos_cosmos_sdk_types.Int `` /* 158-byte string literal not displayed */ }
WhitelistedValidator consists of the validator operator address and the target weight, which is a value for calculating the real weight to be derived according to the active status. In the case of inactive, it is calculated as zero.
func (*WhitelistedValidator) Descriptor ¶
func (*WhitelistedValidator) Descriptor() ([]byte, []int)
func (*WhitelistedValidator) Marshal ¶
func (m *WhitelistedValidator) Marshal() (dAtA []byte, err error)
func (*WhitelistedValidator) MarshalTo ¶
func (m *WhitelistedValidator) MarshalTo(dAtA []byte) (int, error)
func (*WhitelistedValidator) MarshalToSizedBuffer ¶
func (m *WhitelistedValidator) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*WhitelistedValidator) ProtoMessage ¶
func (*WhitelistedValidator) ProtoMessage()
func (*WhitelistedValidator) Reset ¶
func (m *WhitelistedValidator) Reset()
func (*WhitelistedValidator) Size ¶
func (m *WhitelistedValidator) Size() (n int)
func (*WhitelistedValidator) String ¶
func (m *WhitelistedValidator) String() string
func (*WhitelistedValidator) Unmarshal ¶
func (m *WhitelistedValidator) Unmarshal(dAtA []byte) error
func (*WhitelistedValidator) XXX_DiscardUnknown ¶
func (m *WhitelistedValidator) XXX_DiscardUnknown()
func (*WhitelistedValidator) XXX_Marshal ¶
func (m *WhitelistedValidator) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*WhitelistedValidator) XXX_Merge ¶
func (m *WhitelistedValidator) XXX_Merge(src proto.Message)
func (*WhitelistedValidator) XXX_Size ¶
func (m *WhitelistedValidator) XXX_Size() int
func (*WhitelistedValidator) XXX_Unmarshal ¶
func (m *WhitelistedValidator) XXX_Unmarshal(b []byte) error