types

package
v5.0.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2023 License: Apache-2.0 Imports: 39 Imported by: 7

Documentation

Overview

Package types is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	EventTypeMsgLiquidStake             = TypeMsgLiquidStake
	EventTypeMsgLiquidUnstake           = TypeMsgLiquidUnstake
	EventTypeAddLiquidValidator         = "add_liquid_validator"
	EventTypeRemoveLiquidValidator      = "remove_liquid_validator"
	EventTypeBeginRebalancing           = "begin_rebalancing"
	EventTypeReStake                    = "re_stake"
	EventTypeUnbondInactiveLiquidTokens = "unbond_inactive_liquid_tokens"

	AttributeKeyDelegator             = "delegator"
	AttributeKeyNewShares             = "new_shares"
	AttributeKeyBTokenMintedAmount    = "btoken_minted_amount"
	AttributeKeyCompletionTime        = "completion_time"
	AttributeKeyUnbondingAmount       = "unbonding_amount"
	AttributeKeyUnbondedAmount        = "unbonded_amount"
	AttributeKeyLiquidValidator       = "liquid_validator"
	AttributeKeyRedelegationCount     = "redelegation_count"
	AttributeKeyRedelegationFailCount = "redelegation_fail_count"

	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 (
	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")
	ErrInvalidLiquidBondDenom          = sdkerrors.Register(ModuleName, 5, "invalid liquid 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 liquid bond denom supply")
	ErrInvalidActiveLiquidValidators   = sdkerrors.Register(ModuleName, 9, "invalid active liquid validators")
	ErrLiquidValidatorsNotExists       = sdkerrors.Register(ModuleName, 10, "liquid validators not exists")
	ErrInsufficientProxyAccBalance     = sdkerrors.Register(ModuleName, 11, "insufficient liquid tokens or balance of proxy account, need to wait for new liquid validator to be added or unbonding of proxy account to be completed")
	ErrTooSmallLiquidStakingAmount     = sdkerrors.Register(ModuleName, 12, "liquid staking amount is too small, the result becomes zero")
	ErrTooSmallLiquidUnstakingAmount   = sdkerrors.Register(ModuleName, 13, "liquid unstaking amount is too small, the result becomes zero")
)

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")
	KeyMinLiquidStakingAmount = []byte("MinLiquidStakingAmount")

	DefaultLiquidBondDenom = "bstake"

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

	// DefaultMinLiquidStakingAmount 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

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_INACTIVE",
}
View Source
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 sdk.Dec) (nativeTokenAmount sdk.Dec)

BTokenToNativeToken returns bTokenAmount * netAmount / bTokenTotalSupply with truncations

func DeductFeeRate

func DeductFeeRate(input sdk.Dec, feeRate sdk.Dec) (feeDeductedOutput sdk.Dec)

DeductFeeRate returns Input * (1-FeeRate) with truncations

func DivideByCurrentWeight

func DivideByCurrentWeight(lvs LiquidValidators, input sdk.Dec, totalLiquidTokens sdk.Int, liquidTokenMap map[string]sdk.Int) (outputs []sdk.Dec, crumb sdk.Dec)

DivideByCurrentWeight divide the input value by the ratio of the weight of the liquid validator's liquid token and return it with crumb which is may occur while dividing according to the weight of liquid validators by decimal error, outputs is truncated decimal.

func DivideByWeight

func DivideByWeight(avs ActiveLiquidValidators, input sdk.Int, whitelistedValsMap WhitelistedValsMap) (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 bTokenTotalSupply * nativeTokenAmount / 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.

Types

type AccountKeeper

type AccountKeeper interface {
	GetModuleAddress(name string) sdk.AccAddress
	GetModuleAccount(ctx sdk.Context, moduleName string) authtypes.ModuleAccountI
	GetAccount(ctx sdk.Context, addr sdk.AccAddress) authtypes.AccountI
}

AccountKeeper defines the expected account keeper

type ActiveLiquidValidators

type ActiveLiquidValidators LiquidValidators

func (ActiveLiquidValidators) Len

func (avs ActiveLiquidValidators) Len() int

func (ActiveLiquidValidators) TotalActiveLiquidTokens

func (avs ActiveLiquidValidators) TotalActiveLiquidTokens(ctx sdk.Context, sk StakingKeeper, onlyBonded bool) (sdk.Int, map[string]sdk.Int)

func (ActiveLiquidValidators) TotalWeight

func (avs ActiveLiquidValidators) TotalWeight(whitelistedValsMap WhitelistedValsMap) 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

	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
	SpendableCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins
}

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 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)
	GetProposal(ctx sdk.Context, proposalID uint64) (govtypes.Proposal, bool)
	SetProposal(ctx sdk.Context, proposal govtypes.Proposal)
	GetProposals(ctx sdk.Context) (proposals govtypes.Proposals)
	AddVote(ctx sdk.Context, proposalID uint64, voterAddr sdk.AccAddress, options govtypes.WeightedVoteOptions) error
}

GovKeeper expected gov keeper (noalias)

type LPFarmKeeper

type LPFarmKeeper interface {
	GetPosition(ctx sdk.Context, farmerAddr sdk.AccAddress, denom string) (lpfarmtypes.Position, bool)
	IteratePositionsByFarmer(ctx sdk.Context, farmerAddr sdk.AccAddress, cb func(position lpfarmtypes.Position) bool)
}

LPFarmKeeper defines expected lpfarm keeper

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, onlyBonded bool) sdk.Int

func (LiquidValidator) GetOperator

func (v LiquidValidator) GetOperator() sdk.ValAddress

func (LiquidValidator) GetStatus

func (v LiquidValidator) GetStatus(activeCondition bool) ValidatorStatus

func (LiquidValidator) GetWeight

func (v LiquidValidator) GetWeight(whitelistedValsMap WhitelistedValsMap, active bool) sdk.Int

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) 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=crescent.liquidstaking.v1beta1.ValidatorStatus" json:"status,omitempty"`
	// del_shares define the delegation shares of the validator
	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.Int `` /* 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 LiquidValidatorStates

type LiquidValidatorStates []LiquidValidatorState

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]struct{}

func (LiquidValidators) MinMaxGap

func (vs LiquidValidators) MinMaxGap(targetMap, liquidTokenMap map[string]sdk.Int) (minGapVal LiquidValidator, maxGapVal LiquidValidator, amountNeeded sdk.Int, lastRedelegation bool)

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, onlyBonded bool) (sdk.Int, map[string]sdk.Int)

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)
	GetPoolBalances(ctx sdk.Context, pool liquiditytypes.Pool) (rx sdk.Coin, ry sdk.Coin)
	GetPoolCoinSupply(ctx sdk.Context, pool liquiditytypes.Pool) sdk.Int
	IterateAllPools(ctx sdk.Context, cb func(pool liquiditytypes.Pool) (stop bool, err error)) error
}

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

type NetAmountState struct {
	// mint_rate is bTokenTotalSupply / NetAmount
	MintRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=mint_rate,json=mintRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"mint_rate"`
	// btoken_total_supply returns the total supply of btoken(liquid_bond_denom)
	BtokenTotalSupply github_com_cosmos_cosmos_sdk_types.Int `` /* 154-byte string literal not displayed */
	// net_amount is proxy account's native token balance + total liquid tokens + total remaining rewards + total
	// unbonding balance
	NetAmount github_com_cosmos_cosmos_sdk_types.Dec `` /* 128-byte string literal not displayed */
	// total_del_shares define the delegation shares of all liquid validators
	TotalDelShares github_com_cosmos_cosmos_sdk_types.Dec `` /* 145-byte string literal not displayed */
	// total_liquid_tokens define the token amount worth of delegation shares of all liquid validator (slashing applied
	// amount)
	TotalLiquidTokens github_com_cosmos_cosmos_sdk_types.Int `` /* 154-byte string literal not displayed */
	// total_remaining_rewards define the sum of remaining rewards of proxy account by all liquid validators
	TotalRemainingRewards github_com_cosmos_cosmos_sdk_types.Dec `` /* 166-byte string literal not displayed */
	// total_unbonding_balance define the unbonding balance of proxy account by all liquid validator (slashing applied
	// amount)
	TotalUnbondingBalance github_com_cosmos_cosmos_sdk_types.Int `` /* 166-byte string literal not displayed */
	// proxy_acc_balance define the balance of proxy account for the native token
	ProxyAccBalance github_com_cosmos_cosmos_sdk_types.Int `` /* 148-byte string literal not displayed */
}

NetAmountState is type for net amount raw data and mint rate, This is a value that depends on the several module state every time, so it is used only for calculation and query and is not stored in kv.

func (NetAmountState) CalcMintRate

func (nas NetAmountState) CalcMintRate() sdk.Dec

func (NetAmountState) CalcNetAmount

func (nas NetAmountState) CalcNetAmount() sdk.Dec

func (*NetAmountState) Descriptor

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

func (*NetAmountState) Marshal

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

func (*NetAmountState) MarshalTo

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

func (*NetAmountState) MarshalToSizedBuffer

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

func (*NetAmountState) ProtoMessage

func (*NetAmountState) ProtoMessage()

func (*NetAmountState) Reset

func (m *NetAmountState) Reset()

func (*NetAmountState) Size

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

func (*NetAmountState) String

func (m *NetAmountState) String() string

func (*NetAmountState) Unmarshal

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

func (*NetAmountState) XXX_DiscardUnknown

func (m *NetAmountState) XXX_DiscardUnknown()

func (*NetAmountState) XXX_Marshal

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

func (*NetAmountState) XXX_Merge

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

func (*NetAmountState) XXX_Size

func (m *NetAmountState) XXX_Size() int

func (*NetAmountState) XXX_Unmarshal

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

type Params

type Params struct {
	// LiquidBondDenom specifies the denomination of the token receiving after LiquidStaking, The value is calculated
	// through NetAmount.
	LiquidBondDenom 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) 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) WhitelistedValsMap

func (p Params) WhitelistedValsMap() WhitelistedValsMap

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 with states of the liquidstaking module.
	LiquidValidators(ctx context.Context, in *QueryLiquidValidatorsRequest, opts ...grpc.CallOption) (*QueryLiquidValidatorsResponse, error)
	// VotingPower returns voting power of staking and liquid staking module's of the voter that can be exercised.
	VotingPower(ctx context.Context, in *QueryVotingPowerRequest, opts ...grpc.CallOption) (*QueryVotingPowerResponse, error)
	// States returns states of the liquidstaking module.
	States(ctx context.Context, in *QueryStatesRequest, opts ...grpc.CallOption) (*QueryStatesResponse, 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 {
}

QueryLiquidValidatorsRequest is the request type for the Query/LiquidValidators RPC method.

func (*QueryLiquidValidatorsRequest) Descriptor

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

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 []LiquidValidatorState `protobuf:"bytes,1,rep,name=liquid_validators,json=liquidValidators,proto3" json:"liquid_validators"`
}

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) 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 with states of the liquidstaking module.
	LiquidValidators(context.Context, *QueryLiquidValidatorsRequest) (*QueryLiquidValidatorsResponse, error)
	// VotingPower returns voting power of staking and liquid staking module's of the voter that can be exercised.
	VotingPower(context.Context, *QueryVotingPowerRequest) (*QueryVotingPowerResponse, error)
	// States returns states of the liquidstaking module.
	States(context.Context, *QueryStatesRequest) (*QueryStatesResponse, error)
}

QueryServer is the server API for Query service.

type QueryStatesRequest

type QueryStatesRequest struct {
}

QueryStatesRequest is the request type for the Query/States RPC method.

func (*QueryStatesRequest) Descriptor

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

func (*QueryStatesRequest) Marshal

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

func (*QueryStatesRequest) MarshalTo

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

func (*QueryStatesRequest) MarshalToSizedBuffer

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

func (*QueryStatesRequest) ProtoMessage

func (*QueryStatesRequest) ProtoMessage()

func (*QueryStatesRequest) Reset

func (m *QueryStatesRequest) Reset()

func (*QueryStatesRequest) Size

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

func (*QueryStatesRequest) String

func (m *QueryStatesRequest) String() string

func (*QueryStatesRequest) Unmarshal

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

func (*QueryStatesRequest) XXX_DiscardUnknown

func (m *QueryStatesRequest) XXX_DiscardUnknown()

func (*QueryStatesRequest) XXX_Marshal

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

func (*QueryStatesRequest) XXX_Merge

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

func (*QueryStatesRequest) XXX_Size

func (m *QueryStatesRequest) XXX_Size() int

func (*QueryStatesRequest) XXX_Unmarshal

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

type QueryStatesResponse

type QueryStatesResponse struct {
	NetAmountState NetAmountState `protobuf:"bytes,1,opt,name=net_amount_state,json=netAmountState,proto3" json:"net_amount_state"`
}

QueryStatesResponse is the response type for the Query/States RPC method.

func (*QueryStatesResponse) Descriptor

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

func (*QueryStatesResponse) GetNetAmountState

func (m *QueryStatesResponse) GetNetAmountState() NetAmountState

func (*QueryStatesResponse) Marshal

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

func (*QueryStatesResponse) MarshalTo

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

func (*QueryStatesResponse) MarshalToSizedBuffer

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

func (*QueryStatesResponse) ProtoMessage

func (*QueryStatesResponse) ProtoMessage()

func (*QueryStatesResponse) Reset

func (m *QueryStatesResponse) Reset()

func (*QueryStatesResponse) Size

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

func (*QueryStatesResponse) String

func (m *QueryStatesResponse) String() string

func (*QueryStatesResponse) Unmarshal

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

func (*QueryStatesResponse) XXX_DiscardUnknown

func (m *QueryStatesResponse) XXX_DiscardUnknown()

func (*QueryStatesResponse) XXX_Marshal

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

func (*QueryStatesResponse) XXX_Merge

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

func (*QueryStatesResponse) XXX_Size

func (m *QueryStatesResponse) XXX_Size() int

func (*QueryStatesResponse) XXX_Unmarshal

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

type QueryVotingPowerRequest

type QueryVotingPowerRequest struct {
	Voter string `protobuf:"bytes,1,opt,name=voter,proto3" json:"voter,omitempty"`
}

QueryVotingPowerRequest is the request type for the Query/States RPC method.

func (*QueryVotingPowerRequest) Descriptor

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

func (*QueryVotingPowerRequest) GetVoter

func (m *QueryVotingPowerRequest) GetVoter() string

func (*QueryVotingPowerRequest) Marshal

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

func (*QueryVotingPowerRequest) MarshalTo

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

func (*QueryVotingPowerRequest) MarshalToSizedBuffer

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

func (*QueryVotingPowerRequest) ProtoMessage

func (*QueryVotingPowerRequest) ProtoMessage()

func (*QueryVotingPowerRequest) Reset

func (m *QueryVotingPowerRequest) Reset()

func (*QueryVotingPowerRequest) Size

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

func (*QueryVotingPowerRequest) String

func (m *QueryVotingPowerRequest) String() string

func (*QueryVotingPowerRequest) Unmarshal

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

func (*QueryVotingPowerRequest) XXX_DiscardUnknown

func (m *QueryVotingPowerRequest) XXX_DiscardUnknown()

func (*QueryVotingPowerRequest) XXX_Marshal

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

func (*QueryVotingPowerRequest) XXX_Merge

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

func (*QueryVotingPowerRequest) XXX_Size

func (m *QueryVotingPowerRequest) XXX_Size() int

func (*QueryVotingPowerRequest) XXX_Unmarshal

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

type QueryVotingPowerResponse

type QueryVotingPowerResponse struct {
	VotingPower VotingPower `protobuf:"bytes,1,opt,name=voting_power,json=votingPower,proto3" json:"voting_power"`
}

QueryVotingPowerResponse is the response type for the Query/States RPC method.

func (*QueryVotingPowerResponse) Descriptor

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

func (*QueryVotingPowerResponse) GetVotingPower

func (m *QueryVotingPowerResponse) GetVotingPower() VotingPower

func (*QueryVotingPowerResponse) Marshal

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

func (*QueryVotingPowerResponse) MarshalTo

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

func (*QueryVotingPowerResponse) MarshalToSizedBuffer

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

func (*QueryVotingPowerResponse) ProtoMessage

func (*QueryVotingPowerResponse) ProtoMessage()

func (*QueryVotingPowerResponse) Reset

func (m *QueryVotingPowerResponse) Reset()

func (*QueryVotingPowerResponse) Size

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

func (*QueryVotingPowerResponse) String

func (m *QueryVotingPowerResponse) String() string

func (*QueryVotingPowerResponse) Unmarshal

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

func (*QueryVotingPowerResponse) XXX_DiscardUnknown

func (m *QueryVotingPowerResponse) XXX_DiscardUnknown()

func (*QueryVotingPowerResponse) XXX_Marshal

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

func (*QueryVotingPowerResponse) XXX_Merge

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

func (*QueryVotingPowerResponse) XXX_Size

func (m *QueryVotingPowerResponse) XXX_Size() int

func (*QueryVotingPowerResponse) XXX_Unmarshal

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

type Redelegation

type Redelegation struct {
	Delegator    sdk.AccAddress
	SrcValidator LiquidValidator
	DstValidator LiquidValidator
	Amount       sdk.Int
	Last         bool
	Error        error
}

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

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

	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)
	GetAllUnbondingDelegations(ctx sdk.Context, delegator sdk.AccAddress) []stakingtypes.UnbondingDelegation
	BeginRedelegation(
		ctx sdk.Context, delAddr sdk.AccAddress, valSrcAddr, valDstAddr sdk.ValAddress, sharesAmount sdk.Dec,
	) (completionTime time.Time, err error)
	GetAllRedelegations(
		ctx sdk.Context, delegator sdk.AccAddress, srcValAddress, dstValAddress sdk.ValAddress,
	) []stakingtypes.Redelegation
	HasReceivingRedelegation(ctx sdk.Context, delAddr sdk.AccAddress, valDstAddr sdk.ValAddress) bool
	BlockValidatorUpdates(ctx sdk.Context) []abci.ValidatorUpdate
	HasMaxUnbondingDelegationEntries(ctx sdk.Context,
		delegatorAddr sdk.AccAddress, validatorAddr sdk.ValAddress) bool
}

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

func (*UnimplementedQueryServer) States

func (*UnimplementedQueryServer) VotingPower

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 VotingPower

type VotingPower struct {
	// voter defines the address of the voter; bech encoded in JSON.
	Voter string `protobuf:"bytes,1,opt,name=voter,proto3" json:"voter,omitempty"`
	// staking_voting_power return the voting power of staking that can be exercised.
	StakingVotingPower github_com_cosmos_cosmos_sdk_types.Int `` /* 157-byte string literal not displayed */
	// liquid_staking_voting_power return the voting power of liquid staking that can be exercised.
	LiquidStakingVotingPower github_com_cosmos_cosmos_sdk_types.Int `` /* 177-byte string literal not displayed */
	// validator_voting_power return the voting power of the validator if the voter is the validator operator that can be
	// exercised.
	ValidatorVotingPower github_com_cosmos_cosmos_sdk_types.Int `` /* 163-byte string literal not displayed */
}

VotingPower is type for current voting power of the voter including staking module's voting power and liquid staking module's voting power, It depends on the amount of delegation of staking module, the bonded state of the delegated validator, the value of btoken(liquid_bond_denom), and the pool coin and farming position containing btoken..

func (*VotingPower) Descriptor

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

func (*VotingPower) Marshal

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

func (*VotingPower) MarshalTo

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

func (*VotingPower) MarshalToSizedBuffer

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

func (*VotingPower) ProtoMessage

func (*VotingPower) ProtoMessage()

func (*VotingPower) Reset

func (m *VotingPower) Reset()

func (*VotingPower) Size

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

func (*VotingPower) String

func (m *VotingPower) String() string

func (*VotingPower) Unmarshal

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

func (*VotingPower) XXX_DiscardUnknown

func (m *VotingPower) XXX_DiscardUnknown()

func (*VotingPower) XXX_Marshal

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

func (*VotingPower) XXX_Merge

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

func (*VotingPower) XXX_Size

func (m *VotingPower) XXX_Size() int

func (*VotingPower) XXX_Unmarshal

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

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

type WhitelistedValsMap

type WhitelistedValsMap map[string]WhitelistedValidator

func GetWhitelistedValsMap

func GetWhitelistedValsMap(whitelistedValidators []WhitelistedValidator) WhitelistedValsMap

func (WhitelistedValsMap) IsListed

func (whitelistedValsMap WhitelistedValsMap) IsListed(operatorAddr string) bool

Jump to

Keyboard shortcuts

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