Documentation ¶
Index ¶
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- type Hooks
- func (h Hooks) AfterProposalDeposit(_ sdk.Context, _ uint64, _ sdk.AccAddress)
- func (h Hooks) AfterProposalFailedMinDeposit(_ sdk.Context, _ uint64)
- func (h Hooks) AfterProposalSubmission(_ sdk.Context, _ uint64)
- func (h Hooks) AfterProposalVote(_ sdk.Context, _ uint64, _ sdk.AccAddress)
- func (h Hooks) AfterProposalVotingPeriodEnded(_ sdk.Context, _ uint64)
- func (h Hooks) GetOtherVotes(ctx sdk.Context, votes *govtypes.Votes, otherVotes *govtypes.OtherVotes)
- type Keeper
- func (k Keeper) CheckRewardsAndLiquidPower(ctx sdk.Context, proxyAcc sdk.AccAddress) (sdk.Dec, sdk.Dec)
- func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
- func (k Keeper) GetActiveLiquidValidators(ctx sdk.Context) (vals types.LiquidValidators)
- func (k Keeper) GetAllLiquidValidators(ctx sdk.Context) (vals types.LiquidValidators)
- func (k Keeper) GetCodec() codec.BinaryCodec
- func (k Keeper) GetLiquidValidator(ctx sdk.Context, addr sdk.ValAddress) (val types.LiquidValidator, found bool)
- func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)
- func (k Keeper) GetProxyAccBalance(ctx sdk.Context, proxyAcc sdk.AccAddress) (balance sdk.Int)
- func (k Keeper) GetValidatorsMap(ctx sdk.Context) map[string]stakingtypes.Validator
- func (k Keeper) Hooks() Hooks
- func (k Keeper) InitGenesis(ctx sdk.Context, genState types.GenesisState)
- func (k Keeper) LiquidBondDenom(ctx sdk.Context) (res string)
- func (k Keeper) LiquidDelegate(ctx sdk.Context, proxyAcc sdk.AccAddress, activeVals types.LiquidValidators, ...) (newShares sdk.Dec, err error)
- func (k Keeper) LiquidStaking(ctx sdk.Context, proxyAcc, liquidStaker sdk.AccAddress, stakingCoin sdk.Coin) (newShares sdk.Dec, btokenMintAmount sdk.Int, err error)
- func (k Keeper) LiquidStakingWithBalancing(ctx sdk.Context, proxyAcc sdk.AccAddress, activeVals types.LiquidValidators, ...) (newShares sdk.Dec, err error)
- func (k Keeper) LiquidUnbond(ctx sdk.Context, proxyAcc, liquidStaker sdk.AccAddress, valAddr sdk.ValAddress, ...) (time.Time, sdk.Int, stakingtypes.UnbondingDelegation, error)
- func (k Keeper) LiquidUnstaking(ctx sdk.Context, proxyAcc, liquidStaker sdk.AccAddress, amount sdk.Coin) (time.Time, sdk.Dec, []stakingtypes.UnbondingDelegation, error)
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) NetAmount(ctx sdk.Context) sdk.Dec
- func (k Keeper) SetLiquidValidator(ctx sdk.Context, val types.LiquidValidator)
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) TryRedelegations(ctx sdk.Context, proxyAcc sdk.AccAddress, redelegations []types.Redelegation) (completionTime time.Time, err error)
- func (k Keeper) UpdateLiquidTokens(ctx sdk.Context, proxyAcc sdk.AccAddress)
- func (k Keeper) WithdrawLiquidRewards(ctx sdk.Context, proxyAcc sdk.AccAddress) (totalRewards sdk.Int)
- type Querier
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMsgServerImpl ¶
NewMsgServerImpl returns an implementation of the liquidstaking MsgServer interface for the provided Keeper.
Types ¶
type Hooks ¶
type Hooks struct {
// contains filtered or unexported fields
}
Wrapper struct
func (Hooks) AfterProposalDeposit ¶
func (Hooks) AfterProposalFailedMinDeposit ¶
func (Hooks) AfterProposalSubmission ¶
func (Hooks) AfterProposalVote ¶
func (Hooks) AfterProposalVotingPeriodEnded ¶
func (Hooks) GetOtherVotes ¶
func (h Hooks) GetOtherVotes(ctx sdk.Context, votes *govtypes.Votes, otherVotes *govtypes.OtherVotes)
GetOtherVotes calculate the voting power of the person who participated in liquid staking.
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper of the liquidstaking store
func NewKeeper ¶
func NewKeeper(cdc codec.BinaryCodec, key sdk.StoreKey, paramSpace paramtypes.Subspace, accountKeeper types.AccountKeeper, bankKeeper types.BankKeeper, stakingKeeper types.StakingKeeper, distrKeeper types.Distrkeeper, govKeeper types.GovKeeper, ) Keeper
NewKeeper returns a liquidstaking keeper. It handles: - creating new ModuleAccounts for each pool ReserveAccount - sending to and from ModuleAccounts - minting, burning PoolCoins
func (Keeper) CheckRewardsAndLiquidPower ¶
func (Keeper) ExportGenesis ¶
func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
ExportGenesis returns the liquidstaking module's genesis state.
func (Keeper) GetActiveLiquidValidators ¶
func (k Keeper) GetActiveLiquidValidators(ctx sdk.Context) (vals types.LiquidValidators)
GetActiveLiquidValidators get the set of active liquid validators.
func (Keeper) GetAllLiquidValidators ¶
func (k Keeper) GetAllLiquidValidators(ctx sdk.Context) (vals types.LiquidValidators)
GetAllLiquidValidators get the set of all liquid validators with no limits, used during genesis dump
func (Keeper) GetCodec ¶
func (k Keeper) GetCodec() codec.BinaryCodec
GetCodec return codec.Codec object used by the keeper
func (Keeper) GetLiquidValidator ¶
func (k Keeper) GetLiquidValidator(ctx sdk.Context, addr sdk.ValAddress) (val types.LiquidValidator, found bool)
GetLiquidValidator get a single liquid validator
func (Keeper) GetProxyAccBalance ¶
func (Keeper) GetValidatorsMap ¶
GetValidatorsMap get the set of all validators as map with no limits TODO: it could optimize to containing only to be used validators
func (Keeper) InitGenesis ¶
func (k Keeper) InitGenesis(ctx sdk.Context, genState types.GenesisState)
InitGenesis initializes the liquidstaking module's state from a given genesis state.
func (Keeper) LiquidDelegate ¶
func (Keeper) LiquidStaking ¶
func (k Keeper) LiquidStaking( ctx sdk.Context, proxyAcc, liquidStaker sdk.AccAddress, stakingCoin sdk.Coin) (newShares sdk.Dec, btokenMintAmount sdk.Int, err error)
LiquidStaking ...
func (Keeper) LiquidStakingWithBalancing ¶
func (k Keeper) LiquidStakingWithBalancing(ctx sdk.Context, proxyAcc sdk.AccAddress, activeVals types.LiquidValidators, stakingAmt sdk.Int) (newShares sdk.Dec, err error)
TODO: for using simple weight distribution, not rebalancing
func (Keeper) LiquidUnbond ¶
func (k Keeper) LiquidUnbond( ctx sdk.Context, proxyAcc, liquidStaker sdk.AccAddress, valAddr sdk.ValAddress, sharesAmount sdk.Dec, ) (time.Time, sdk.Int, stakingtypes.UnbondingDelegation, error)
LiquidUnbond ...
func (Keeper) LiquidUnstaking ¶
func (k Keeper) LiquidUnstaking( ctx sdk.Context, proxyAcc, liquidStaker sdk.AccAddress, amount sdk.Coin, ) (time.Time, sdk.Dec, []stakingtypes.UnbondingDelegation, error)
LiquidUnstaking ...
func (Keeper) SetLiquidValidator ¶
func (k Keeper) SetLiquidValidator(ctx sdk.Context, val types.LiquidValidator)
SetLiquidValidator set the main record holding liquid validator details
func (Keeper) TryRedelegations ¶
func (k Keeper) TryRedelegations(ctx sdk.Context, proxyAcc sdk.AccAddress, redelegations []types.Redelegation) (completionTime time.Time, err error)
func (Keeper) UpdateLiquidTokens ¶
func (k Keeper) UpdateLiquidTokens(ctx sdk.Context, proxyAcc sdk.AccAddress)
func (Keeper) WithdrawLiquidRewards ¶
type Querier ¶
type Querier struct {
Keeper
}
Querier is used as Keeper will have duplicate methods if used directly, and gRPC names take precedence over keeper.
func (Querier) LiquidValidators ¶
func (k Querier) LiquidValidators(c context.Context, req *types.QueryLiquidValidatorsRequest) (*types.QueryLiquidValidatorsResponse, error)
LiquidValidators queries all liquid validators.
func (Querier) Params ¶
func (k Querier) Params(c context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
Params queries the parameters of the liquidstaking module.