keeper

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: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) types.MsgServer

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 (h Hooks) AfterProposalDeposit(_ sdk.Context, _ uint64, _ sdk.AccAddress)

func (Hooks) AfterProposalFailedMinDeposit

func (h Hooks) AfterProposalFailedMinDeposit(_ sdk.Context, _ uint64)

func (Hooks) AfterProposalSubmission

func (h Hooks) AfterProposalSubmission(_ sdk.Context, _ uint64)

func (Hooks) AfterProposalVote

func (h Hooks) AfterProposalVote(_ sdk.Context, _ uint64, _ sdk.AccAddress)

func (Hooks) AfterProposalVotingPeriodEnded

func (h Hooks) AfterProposalVotingPeriodEnded(_ sdk.Context, _ uint64)

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 (k Keeper) CheckRewardsAndLiquidPower(ctx sdk.Context, proxyAcc sdk.AccAddress) (sdk.Dec, sdk.Dec)

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

func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)

GetParams gets the parameters for the liquidstaking module.

func (Keeper) GetProxyAccBalance

func (k Keeper) GetProxyAccBalance(ctx sdk.Context, proxyAcc sdk.AccAddress) (balance sdk.Int)

func (Keeper) GetValidatorsMap

func (k Keeper) GetValidatorsMap(ctx sdk.Context) map[string]stakingtypes.Validator

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

func (k Keeper) Hooks() Hooks

Create new distribution hooks

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

func (k Keeper) LiquidBondDenom(ctx sdk.Context) (res string)

func (Keeper) LiquidDelegate

func (k Keeper) LiquidDelegate(ctx sdk.Context, proxyAcc sdk.AccAddress, activeVals types.LiquidValidators, stakingAmt sdk.Int) (newShares sdk.Dec, err error)

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

func (k Keeper) Logger(ctx sdk.Context) log.Logger

Logger returns a module-specific logger.

func (Keeper) NetAmount

func (k Keeper) NetAmount(ctx sdk.Context) sdk.Dec

func (Keeper) SetLiquidValidator

func (k Keeper) SetLiquidValidator(ctx sdk.Context, val types.LiquidValidator)

SetLiquidValidator set the main record holding liquid validator details

func (Keeper) SetParams

func (k Keeper) SetParams(ctx sdk.Context, params types.Params)

SetParams sets the parameters for the liquidstaking module.

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

func (k Keeper) WithdrawLiquidRewards(ctx sdk.Context, proxyAcc sdk.AccAddress) (totalRewards sdk.Int)

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

LiquidValidators queries all liquid validators.

func (Querier) Params

Params queries the parameters of the liquidstaking module.

Jump to

Keyboard shortcuts

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