keeper

package
v4.4.2 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) incentive.MsgServer

NewMsgServerImpl returns an implementation of MsgServer for the x/incentive module.

Types

type Keeper

type Keeper struct {
	// contains filtered or unexported fields
}

func NewKeeper

func NewKeeper(
	cdc codec.Codec,
	storeKey storetypes.StoreKey,
	bk incentive.BankKeeper,
	lk incentive.LeverageKeeper,
) Keeper

func (Keeper) ClaimReward added in v4.3.0

func (k Keeper) ClaimReward(_ sdk.Context, _ sdk.AccAddress, _ incentive.BondTier, _ sdk.Coin,
) (sdk.Coins, error)

ClaimReward claims a single account's bonded uToken tier's reward, then updates its reward tracker. Returns rewards claimed.

func (Keeper) GetRewardAccumulator

func (k Keeper) GetRewardAccumulator(ctx sdk.Context, bondDenom, rewardDenom string, tier incentive.BondTier,
) sdk.DecCoin

GetRewardAccumulator retrieves the reward accumulator of a reward token for a single bonded uToken and tier - for example, how much UMEE (reward) would have been earned by 1 ATOM bonded to the middle tier since genesis.

func (Keeper) GetRewardTracker

func (k Keeper) GetRewardTracker(ctx sdk.Context,
	addr sdk.AccAddress, bondDenom, rewardDenom string, tier incentive.BondTier,
) sdk.DecCoin

GetRewardTracker retrieves the reward tracker of a reward token for a single bonded uToken and tier on one account - this is the value of the reward accumulator for those specific denoms and tier the last time this account performed and action that requires a reward tracker update (i.e. Bond, Claim, BeginUnbonding, or being Liquidated).

func (Keeper) IterateAccountBonds added in v4.3.0

func (k Keeper) IterateAccountBonds(ctx sdk.Context, addr sdk.AccAddress,
	_ func(ctx sdk.Context, addr sdk.AccAddress, _ incentive.BondTier, _ sdk.Coin) error,
) error

IterateAccountBonds iterates over all bonded uTokens for an address by each individual uToken denom and tier

func (Keeper) KVStore

func (k Keeper) KVStore(ctx sdk.Context) sdk.KVStore

KVStore returns the module's KVStore

func (Keeper) Logger

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

func (Keeper) ModuleBalance

func (k Keeper) ModuleBalance(ctx sdk.Context, denom string) sdk.Coin

ModuleBalance returns the amount of a given token held in the x/incentive module account

func (Keeper) SetRewardAccumulator

func (k Keeper) SetRewardAccumulator(ctx sdk.Context,
	bondDenom string, reward sdk.DecCoin, tier incentive.BondTier,
) error

SetRewardAccumulator sets the reward accumulator of a reward token for a single bonded uToken and tier.

func (Keeper) UpdateRewardTracker added in v4.3.0

func (k Keeper) UpdateRewardTracker(ctx sdk.Context, addr sdk.AccAddress, tier incentive.BondTier, bondDenom string,
) error

UpdateRewardTracker updates all reward trackers matching a specific account + tier + bonded uToken denom by setting them to the current values of that tier + uToken denom's reward accumulators

func (Keeper) UpdateRewards added in v4.3.0

func (k Keeper) UpdateRewards(ctx sdk.Context) error

UpdateRewards increases the module's LastInterestTime and any rewardAccumulators associated with ongoing incentive programs.

type Querier

type Querier struct {
	Keeper
}

Querier implements a QueryServer for the x/incentive module.

func NewQuerier

func NewQuerier(k Keeper) Querier

func (Querier) Bonded

func (Querier) Params

func (Querier) TotalUnbonding added in v4.3.0

func (Querier) Unbondings

Jump to

Keyboard shortcuts

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