types

package
v0.0.5-alpha Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 28, 2022 License: Apache-2.0 Imports: 38 Imported by: 0

Documentation

Overview

Package types is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	EventTypeMsgLiquidStake   = TypeMsgLiquidStake
	EventTypeMsgLiquidUnstake = TypeMsgLiquidUnstake

	// TODO: check conventions AttributeValue or AttributeKey
	AttributeKeyNewShares          = "new_shares"
	AttributeKeyBTokenMintedAmount = "btoken_minted_amount"
	AttributeKeyCompletionTime     = "completion_time"
	AttributeKeyUnbondingAmount    = "unbonding_amount"

	AttributeValueCategory = ModuleName
)

Event types for the liquidstaking module.

View Source
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
)
View Source
const (
	TypeMsgLiquidStake   = "liquid_stake"
	TypeMsgLiquidUnstake = "liquid_unstake"
)

Message types for the liquidstaking module

Variables

View Source
var (
	ErrLiquidValidatorsNotExists      = sdkerrors.Register(ModuleName, 1, "active liquid validators not exists")
	ErrInvalidDenom                   = sdkerrors.Register(ModuleName, 2, "invalid denom")
	ErrInvalidBondDenom               = sdkerrors.Register(ModuleName, 3, "invalid bond denom")
	ErrInvalidLiquidBondDenom         = sdkerrors.Register(ModuleName, 4, "invalid liquid bond denom")
	ErrNotImplementedYet              = sdkerrors.Register(ModuleName, 5, "not implemented yet")
	ErrLessThanMinLiquidStakingAmount = sdkerrors.Register(ModuleName, 6, "staking amount should be over params.min_liquid_staking_amount")
)

Sentinel errors for the liquidstaking module.

View Source
var (
	ErrInvalidLengthGenesis        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowGenesis          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthLiquidstaking        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowLiquidstaking          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupLiquidstaking = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	KeyLiquidBondDenom        = []byte("LiquidBondDenom")
	KeyWhitelistedValidators  = []byte("WhitelistedValidators")
	KeyUnstakeFeeRate         = []byte("UnstakeFeeRate")
	KeyCommissionRate         = []byte("CommissionRate")
	KeyMinLiquidStakingAmount = []byte("MinLiquidStakingAmount")

	DefaultLiquidBondDenom = "bstake"

	// DefaultUnstakeFeeRate is the default Unstake Fee Rate.
	DefaultUnstakeFeeRate = sdk.NewDecWithPrec(1, 3) // "0.001000000000000000"

	// DefaultCommissionRate is the default Commission Rate.
	DefaultCommissionRate = sdk.NewDecWithPrec(5, 2) // "0.050000000000000000"

	// MinLiquidStakingAmount is the default minimum liquid staking amount.
	DefaultMinLiquidStakingAmount = sdk.NewInt(1000000)

	// Const variables
	RebalancingTrigger = sdk.NewDecWithPrec(1, 3) // "0.001000000000000000"
	RewardTrigger      = sdk.NewDecWithPrec(1, 3) // "0.001000000000000000"

	//LiquidStakingProxyAcc = farmingtypes.DeriveAddress(farmingtypes.AddressType20Bytes, ModuleName, "LiquidStakingProxyAcc")
	LiquidStakingProxyAcc = farmingtypes.DeriveAddress(farmingtypes.AddressType32Bytes, ModuleName, "LiquidStakingProxyAcc")
)

Parameter store keys

View Source
var (
	ErrInvalidLengthQuery        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowQuery          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthTx        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowTx          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	// Keys for store prefixes
	LiquidValidatorsKey = []byte{0xc0} // prefix for each key to a liquid validator
)
View Source
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)
)
View Source
var ValidatorStatus_name = map[int32]string{
	0: "VALIDATOR_STATUS_UNSPECIFIED",
	1: "VALIDATOR_STATUS_ACTIVE",
	2: "VALIDATOR_STATUS_DELISTING",
	3: "VALIDATOR_STATUS_DELISTED",
}
View Source
var ValidatorStatus_value = map[string]int32{
	"VALIDATOR_STATUS_UNSPECIFIED": 0,
	"VALIDATOR_STATUS_ACTIVE":      1,
	"VALIDATOR_STATUS_DELISTING":   2,
	"VALIDATOR_STATUS_DELISTED":    3,
}

Functions

func AddStakingTargetMap

func AddStakingTargetMap(activeVals LiquidValidators, addStakingAmt sdk.Int) map[string]sdk.Int

AddStakingTargetMap is make add staking target map for one-way rebalancing, it can be called recursively. TODO: not using on this version for simplify

func BTokenToNativeToken

func BTokenToNativeToken(btokenAmount, bTokenTotalSupplyAmount sdk.Int, netAmount, feeRate sdk.Dec) (nativeTokenAmount sdk.Dec)

TODO: add testcodes with consider netAmount.TruncateDec() or not BTokenToNativeToken returns UnstakeAmount, NetAmount * BTokenAmount/TotalSupply * (1-UnstakeFeeRate)

func DateRangesOverlap

func DateRangesOverlap(startTimeA, endTimeA, startTimeB, endTimeB time.Time) bool

DateRangesOverlap returns true if two date ranges overlap each other. End time is exclusive and start time is inclusive.

func DivideByCurrentWeight

func DivideByCurrentWeight(vs LiquidValidators, input sdk.Int) (outputs []sdk.Int, crumb sdk.Int)

DivideByCurrentWeight divide the input value by the ratio of the weight of the liquid validator's liquid token and return it with crumb TODO: consider deprecate DivideByCurrentWeight and use DivideByCurrentWeightDec

func DivideByCurrentWeightDec

func DivideByCurrentWeightDec(vs LiquidValidators, input sdk.Dec) (outputs []sdk.Dec, crumb sdk.Dec)

DivideByCurrentWeightDec divide the input value by the ratio of the weight of the liquid validator's liquid token and return it with crumb as decimal

func DivideByWeight

func DivideByWeight(vs LiquidValidators, input sdk.Int) (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

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 MustParseRFC3339

func MustParseRFC3339(s string) time.Time

MustParseRFC3339 parses string time to time in RFC3339 format.

func NativeTokenToBToken

func NativeTokenToBToken(nativeTokenAmount, bTokenTotalSupplyAmount sdk.Int, netAmount sdk.Dec) (bTokenAmount sdk.Int)

mint btoken, MintAmount = TotalSupply * StakeAmount/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 RegisterMsgServer(s grpc1.Server, srv MsgServer)

func RegisterQueryHandler

func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

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 ValidateGenesis

func ValidateGenesis(data GenesisState) error

ValidateGenesis validates GenesisState.

func ValidateLiquidBondDenom

func ValidateLiquidBondDenom(i interface{}) error

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 BankKeeper

type BankKeeper interface {
	InputOutputCoins(ctx sdk.Context, inputs []banktypes.Input, outputs []banktypes.Output) error
	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
	SpendableCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins

	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 {
	//DelegationTotalRewards(c sdk.Context, req *types.QueryDelegationTotalRewardsRequest) (*distrtypes.QueryDelegationTotalRewardsResponse, error)
	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)
}

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) MarshalTo

func (m *GenesisState) MarshalTo(dAtA []byte) (int, 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 */
	// status is the liquid validator status
	Status ValidatorStatus `protobuf:"varint,2,opt,name=status,proto3,enum=squad.liquidstaking.v1beta1.ValidatorStatus" json:"status,omitempty"`
	// liquid tokens define the liquid staked tokens
	LiquidTokens github_com_cosmos_cosmos_sdk_types.Int `` /* 137-byte string literal not displayed */
	// weight specifies the weight for liquid staking, unstaking amount
	Weight github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,4,opt,name=weight,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"weight" yaml:"weight"`
}

LiquidValidator defines a ... TBD

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) ActiveCondition

func (lv LiquidValidator) ActiveCondition(validator stakingtypes.Validator, whitelisted bool, commissionRate sdk.Dec) bool

ActiveCondition checks the liquid validator could be active by below cases active conditions - included on whitelist - commission rate matched - included on the Top MaxValidators list. - not jailed(unbonding, unbonded) - not downtime slashing - not double signing slashing ( tombstoned, infinite jail ) - not self-delegation condition failed (SelfDelegationBelowMinSelfDelegation)

func (*LiquidValidator) Descriptor

func (*LiquidValidator) Descriptor() ([]byte, []int)

func (LiquidValidator) GetOperator

func (v LiquidValidator) GetOperator() sdk.ValAddress

func (*LiquidValidator) Marshal

func (m *LiquidValidator) Marshal() (dAtA []byte, err error)

func (*LiquidValidator) MarshalTo

func (m *LiquidValidator) MarshalTo(dAtA []byte) (int, 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) UpdateStatus

func (v LiquidValidator) UpdateStatus(newStatus ValidatorStatus) LiquidValidator

UpdateStatus updates the location of the shares within a liquid validator to reflect the new status

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 LiquidValidators

type LiquidValidators []LiquidValidator

LiquidValidators is a collection of LiquidValidator

func (LiquidValidators) ActiveToDelisting

func (activeLiquidValidators LiquidValidators) ActiveToDelisting(valsMap map[string]stakingtypes.Validator, whitelistedValMap map[string]WhitelistedValidator, commissionRate sdk.Dec)

ActiveToDelisting change active liquid validator status to delisting on below cases active -> delisting conditions - excluded from the whitelist - commission rate unmatched - with low power, kicked out of the Top MaxValidators list. - jailed(unbonding, unbonded) - downtime slashing - double signing slashing ( tombstoned, infinite jail ) - self-delegation condition failed (SelfDelegationBelowMinSelfDelegation)

func (LiquidValidators) DelistingToDelisted

func (vs LiquidValidators) DelistingToDelisted(valsMap map[string]stakingtypes.Validator)

TODO: check delisting -> delisted for mature redelegation queue

func (LiquidValidators) Len

func (vs LiquidValidators) Len() int

func (LiquidValidators) Map

func (vs LiquidValidators) Map() map[string]*LiquidValidator

TODO: pointer map looks uncertainty, need to fix

func (LiquidValidators) MinMaxGap

func (vs LiquidValidators) MinMaxGap(targetMap map[string]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() sdk.Int

func (LiquidValidators) TotalWeight

func (vs LiquidValidators) TotalWeight() sdk.Int

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) MarshalTo

func (m *MsgLiquidStake) MarshalTo(dAtA []byte) (int, 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) MarshalTo

func (m *MsgLiquidUnstake) MarshalTo(dAtA []byte) (int, 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 {
	LiquidBondDenom       string                 `` /* 133-byte string literal not displayed */
	WhitelistedValidators []WhitelistedValidator `` /* 144-byte string literal not displayed */
	// unstake_fee_rate specifies the ...
	UnstakeFeeRate github_com_cosmos_cosmos_sdk_types.Dec `` /* 169-byte string literal not displayed */
	// commission_rate specifies the ...
	CommissionRate github_com_cosmos_cosmos_sdk_types.Dec `` /* 166-byte string literal not displayed */
	// Minimum number of coins to be staked to the active liquid validators on liquid staking.
	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) Descriptor() ([]byte, []int)

func (*Params) Marshal

func (m *Params) Marshal() (dAtA []byte, err error)

func (*Params) MarshalTo

func (m *Params) MarshalTo(dAtA []byte) (int, error)

func (*Params) MarshalToSizedBuffer

func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Params) ParamSetPairs

func (p *Params) ParamSetPairs() paramstypes.ParamSetPairs

ParamSetPairs implements paramstypes.ParamSet.

func (*Params) ProtoMessage

func (*Params) ProtoMessage()

func (*Params) Reset

func (m *Params) Reset()

func (*Params) Size

func (m *Params) Size() (n int)

func (Params) String

func (p Params) String() string

String returns a human-readable string representation of the parameters.

func (*Params) Unmarshal

func (m *Params) Unmarshal(dAtA []byte) error

func (Params) Validate

func (p Params) Validate() error

Validate validates parameters.

func (*Params) XXX_DiscardUnknown

func (m *Params) XXX_DiscardUnknown()

func (*Params) XXX_Marshal

func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Params) XXX_Merge

func (m *Params) XXX_Merge(src proto.Message)

func (*Params) XXX_Size

func (m *Params) XXX_Size() int

func (*Params) XXX_Unmarshal

func (m *Params) XXX_Unmarshal(b []byte) error

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 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 {
	// TODO: status, etc query strings
	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 (*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 []LiquidValidator `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() []LiquidValidator

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 (*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 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
}

func Rebalancing

func Rebalancing(proxyAcc sdk.AccAddress, liquidVals LiquidValidators, rebalancingTrigger sdk.Dec) (redelegations []Redelegation)

activeVals containing ValidatorStatusActive which is containing just added on whitelist(power 0) and ValidatorStatusDelisting TODO: check minimum top vali power for prevent unbonded

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
	BeforeDelegationSharesModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) // Must be called when a delegation's shares are modified
	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 {
	// iterate through validators by operator address, execute func for each validator
	IterateValidators(sdk.Context,
		func(index int64, validator stakingtypes.ValidatorI) (stop bool))

	GetAllValidators(ctx sdk.Context) (validators []stakingtypes.Validator)

	// iterate through bonded validators by operator address, execute func for each validator
	IterateBondedValidatorsByPower(sdk.Context,
		func(index int64, validator stakingtypes.ValidatorI) (stop bool))

	// iterate through the consensus validator set of the last block by operator address, execute func for each validator
	IterateLastValidators(sdk.Context,
		func(index int64, validator stakingtypes.ValidatorI) (stop bool))

	Validator(sdk.Context, sdk.ValAddress) stakingtypes.ValidatorI            // get a particular validator by operator address
	ValidatorByConsAddr(sdk.Context, sdk.ConsAddress) stakingtypes.ValidatorI // get a particular validator by consensus address

	// slash the validator and delegators of the validator, specifying offence height, offence power, and slash fraction
	Slash(sdk.Context, sdk.ConsAddress, int64, int64, sdk.Dec)
	Jail(sdk.Context, sdk.ConsAddress)   // jail a validator
	Unjail(sdk.Context, sdk.ConsAddress) // unjail a validator

	// Delegation allows for getting a particular delegation for a given validator
	// and delegator outside the scope of the staking module.
	Delegation(sdk.Context, sdk.AccAddress, sdk.ValAddress) stakingtypes.DelegationI

	// MaxValidators returns the maximum amount of bonded validators
	MaxValidators(sdk.Context) uint32

	IterateDelegations(ctx sdk.Context, delegator sdk.AccAddress,
		fn func(index int64, delegation stakingtypes.DelegationI) (stop bool))

	GetAllUnbondingDelegations(ctx sdk.Context, delegator sdk.AccAddress) []stakingtypes.UnbondingDelegation

	GetLastTotalPower(ctx sdk.Context) sdk.Int
	GetLastValidatorPower(ctx sdk.Context, valAddr sdk.ValAddress) int64

	GetAllSDKDelegations(ctx sdk.Context) []stakingtypes.Delegation

	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)
	BondDenom(ctx sdk.Context) (res string)
	Delegate(
		ctx sdk.Context, delAddr sdk.AccAddress, bondAmt sdk.Int, tokenSrc stakingtypes.BondStatus,
		validator stakingtypes.Validator, subtractAccount bool,
	) (newShares sdk.Dec, err error)
	GetDelegation(ctx sdk.Context,
		delAddr sdk.AccAddress, valAddr sdk.ValAddress) (delegation stakingtypes.Delegation, found bool)
	GetValidator(ctx sdk.Context, addr sdk.ValAddress) (validator stakingtypes.Validator, found bool)
	HasMaxUnbondingDelegationEntries(ctx sdk.Context, delegatorAddr sdk.AccAddress, validatorAddr sdk.ValAddress) bool
	BeginRedelegation(
		ctx sdk.Context, delAddr sdk.AccAddress, valSrcAddr, valDstAddr sdk.ValAddress, sharesAmount sdk.Dec,
	) (completionTime time.Time, err error)
	ValidateUnbondAmount(
		ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress, amt sdk.Int,
	) (shares sdk.Dec, 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) LiquidUnstake

type UnimplementedQueryServer

type UnimplementedQueryServer struct {
}

UnimplementedQueryServer can be embedded to have forward compatible implementations.

func (*UnimplementedQueryServer) LiquidValidators

func (*UnimplementedQueryServer) Params

type ValidatorStatus

type ValidatorStatus int32

ValidatorStatus enumerates the status of a liquid validator.

const (
	// VALIDATOR_STATUS_UNSPECIFIED defines the default status.
	ValidatorStatusUnspecified ValidatorStatus = 0
	// VALIDATOR_STATUS_ACTIVE defines the ...
	ValidatorStatusActive ValidatorStatus = 1
	// VALIDATOR_STATUS_DELISTING defines the ...
	ValidatorStatusDelisting ValidatorStatus = 2
	// VALIDATOR_STATUS_DELISTED defines the ...
	ValidatorStatusDelisted ValidatorStatus = 3
)

func (ValidatorStatus) EnumDescriptor

func (ValidatorStatus) EnumDescriptor() ([]byte, []int)

func (ValidatorStatus) String

func (x ValidatorStatus) String() string

type WhitelistedValidator

type WhitelistedValidator struct {
	// validator_address defines the bech32-encoded address that whitelisted validator
	ValidatorAddress string `` /* 134-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"`
}

WhitelistedValidator defines a ... TBD

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL