Documentation
¶
Index ¶
- func NewMsgServerImpl(keeper Keeper) incentive.MsgServer
- type Keeper
- func (k Keeper) GetBonded(ctx sdk.Context, addr sdk.AccAddress, denom string, tier incentive.BondTier) sdk.Coin
- func (k Keeper) GetCommunityFundAddress(ctx sdk.Context) sdk.AccAddress
- func (k Keeper) GetIncentiveProgram(ctx sdk.Context, id uint32) (incentive.IncentiveProgram, incentive.ProgramStatus, error)
- func (k Keeper) GetLastRewardsTime(ctx sdk.Context) uint64
- func (k Keeper) GetMaxUnbondings(ctx sdk.Context) uint32
- func (k Keeper) GetNextProgramID(ctx sdk.Context) uint32
- func (k Keeper) GetParams(ctx sdk.Context) incentive.Params
- func (k Keeper) GetRewardAccumulator(ctx sdk.Context, bondDenom, rewardDenom string, tier incentive.BondTier) sdk.DecCoin
- func (k Keeper) GetRewardTracker(ctx sdk.Context, addr sdk.AccAddress, bondDenom, rewardDenom string, ...) sdk.DecCoin
- func (k Keeper) GetTierWeightMiddle(ctx sdk.Context) sdk.Dec
- func (k Keeper) GetTierWeightShort(ctx sdk.Context) sdk.Dec
- func (k Keeper) GetTotalBonded(ctx sdk.Context, denom string, tier incentive.BondTier) sdk.Coin
- func (k Keeper) GetUnbondingDurationLong(ctx sdk.Context) uint64
- func (k Keeper) GetUnbondingDurationMiddle(ctx sdk.Context) uint64
- func (k Keeper) GetUnbondingDurationShort(ctx sdk.Context) uint64
- func (k Keeper) GetUnbondings(ctx sdk.Context, addr sdk.AccAddress) []incentive.Unbonding
- func (k Keeper) KVStore(ctx sdk.Context) sdk.KVStore
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) ModuleBalance(ctx sdk.Context, denom string) sdk.Coin
- func (k Keeper) SetBonded(ctx sdk.Context, addr sdk.AccAddress, uToken sdk.Coin, tier incentive.BondTier) error
- func (k Keeper) SetIncentiveProgram(ctx sdk.Context, program incentive.IncentiveProgram, ...) error
- func (k Keeper) SetLastRewardsTime(ctx sdk.Context, time uint64) error
- func (k Keeper) SetNextProgramID(ctx sdk.Context, id uint32) error
- func (k Keeper) SetParams(ctx sdk.Context, params incentive.Params) error
- func (k Keeper) SetRewardAccumulator(ctx sdk.Context, bondDenom string, reward sdk.DecCoin, tier incentive.BondTier) error
- func (k Keeper) SetRewardTracker(ctx sdk.Context, addr sdk.AccAddress, bondDenom string, reward sdk.DecCoin, ...) error
- func (k Keeper) SetTotalBonded(ctx sdk.Context, uTokens sdk.Coin, tier incentive.BondTier) error
- func (k Keeper) SetUnbondings(ctx sdk.Context, unbondings incentive.AccountUnbondings) error
- type Querier
- func (q Querier) Bonded(_ context.Context, req *incentive.QueryBonded) (*incentive.QueryBondedResponse, error)
- func (q Querier) CompletedIncentivePrograms(_ context.Context, req *incentive.QueryCompletedIncentivePrograms) (*incentive.QueryCompletedIncentiveProgramsResponse, error)
- func (q Querier) IncentiveProgram(_ context.Context, req *incentive.QueryIncentiveProgram) (*incentive.QueryIncentiveProgramResponse, error)
- func (q Querier) OngoingIncentivePrograms(_ context.Context, req *incentive.QueryOngoingIncentivePrograms) (*incentive.QueryOngoingIncentiveProgramsResponse, error)
- func (q Querier) Params(goCtx context.Context, req *incentive.QueryParams) (*incentive.QueryParamsResponse, error)
- func (q Querier) PendingRewards(_ context.Context, req *incentive.QueryPendingRewards) (*incentive.QueryPendingRewardsResponse, error)
- func (q Querier) TotalBonded(_ context.Context, req *incentive.QueryTotalBonded) (*incentive.QueryTotalBondedResponse, error)
- func (q Querier) Unbondings(_ context.Context, req *incentive.QueryUnbondings) (*incentive.QueryUnbondingsResponse, error)
- func (q Querier) UpcomingIncentivePrograms(_ context.Context, req *incentive.QueryUpcomingIncentivePrograms) (*incentive.QueryUpcomingIncentiveProgramsResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMsgServerImpl ¶
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) GetBonded ¶
func (k Keeper) GetBonded(ctx sdk.Context, addr sdk.AccAddress, denom string, tier incentive.BondTier) sdk.Coin
GetBonded retrieves the amount of uTokens of a given denom which are bonded to a single tier by an account
func (Keeper) GetCommunityFundAddress ¶
func (k Keeper) GetCommunityFundAddress(ctx sdk.Context) sdk.AccAddress
GetCommunityFundAddress retrieves the community fund address parameter. It is guaranteed to be either valid (by sdk.ValidateAddressFormat) or empty.
func (Keeper) GetIncentiveProgram ¶
func (k Keeper) GetIncentiveProgram(ctx sdk.Context, id uint32) ( incentive.IncentiveProgram, incentive.ProgramStatus, error, )
GetIncentiveProgram gets an incentive program by ID, regardless of the program's status. Returns the program's status if found, or an error if it does not exist.
func (Keeper) GetLastRewardsTime ¶
GetLastRewardsTime gets the last unix time incentive rewards were computed globally by EndBlocker.
func (Keeper) GetMaxUnbondings ¶
GetMaxUnbondings gets the maximum number of unbondings an account is allowed to have at one time.
func (Keeper) GetNextProgramID ¶
GetNextProgramID gets the ID that will be assigned to the next incentive program passed by governance.
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) GetTierWeightMiddle ¶
GetTierWeightShort gets the ratio of rewards received by the short tier of bonded assets. Ranges 0 - 1.
func (Keeper) GetTierWeightShort ¶
GetTierWeightShort gets the ratio of rewards received by the middle tier of bonded assets. Ranges 0 - 1.
func (Keeper) GetTotalBonded ¶
GetTotalBonded retrieves the total amount of uTokens of a given denom which are bonded to the incentive module
func (Keeper) GetUnbondingDurationLong ¶
GetUnbondingDurationLong gets the duration in seconds of the long bonding tier.
func (Keeper) GetUnbondingDurationMiddle ¶
GetUnbondingDurationMiddle gets the duration in seconds of the middle bonding tier.
func (Keeper) GetUnbondingDurationShort ¶
GetUnbondingDurationShort gets the duration in seconds of the short bonding tier.
func (Keeper) GetUnbondings ¶
GetUnbondings gets all unbondings currently associated with an account.
func (Keeper) ModuleBalance ¶
ModuleBalance returns the amount of a given token held in the x/incentive module account
func (Keeper) SetBonded ¶
func (k Keeper) SetBonded(ctx sdk.Context, addr sdk.AccAddress, uToken sdk.Coin, tier incentive.BondTier, ) error
SetBonded sets the amount of uTokens of a given denom which are bonded to a single tier by an account
func (Keeper) SetIncentiveProgram ¶
func (k Keeper) SetIncentiveProgram(ctx sdk.Context, program incentive.IncentiveProgram, status incentive.ProgramStatus, ) error
SetIncentiveProgram stores an incentive program in either the upcoming, ongoing, or completed program lists. does not validate the incentive program struct or the validity of its status change (e.g. upcoming -> complete)
func (Keeper) SetLastRewardsTime ¶
SetLastRewardsTime sets the last unix time incentive rewards were computed globally by EndBlocker.
func (Keeper) SetNextProgramID ¶
SetNextProgramID sets the ID that will be assigned to the next incentive program passed by governance.
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) SetRewardTracker ¶
func (k Keeper) SetRewardTracker(ctx sdk.Context, addr sdk.AccAddress, bondDenom string, reward sdk.DecCoin, tier incentive.BondTier, ) error
SetRewardTracker sets the reward tracker of a reward token for a single bonded uToken and tier for an address.
func (Keeper) SetTotalBonded ¶
SetTotalBonded records the total amount of uTokens of a given denom which are bonded to the incentive module
func (Keeper) SetUnbondings ¶
SetUnbondings stores the full list of unbondings currently associated with an account.
type Querier ¶
type Querier struct {
Keeper
}
Querier implements a QueryServer for the x/incentive module.
func NewQuerier ¶
func (Querier) Bonded ¶
func (q Querier) Bonded( _ context.Context, req *incentive.QueryBonded, ) (*incentive.QueryBondedResponse, error)
func (Querier) CompletedIncentivePrograms ¶
func (q Querier) CompletedIncentivePrograms( _ context.Context, req *incentive.QueryCompletedIncentivePrograms, ) (*incentive.QueryCompletedIncentiveProgramsResponse, error)
func (Querier) IncentiveProgram ¶
func (q Querier) IncentiveProgram( _ context.Context, req *incentive.QueryIncentiveProgram, ) (*incentive.QueryIncentiveProgramResponse, error)
func (Querier) OngoingIncentivePrograms ¶
func (q Querier) OngoingIncentivePrograms( _ context.Context, req *incentive.QueryOngoingIncentivePrograms, ) (*incentive.QueryOngoingIncentiveProgramsResponse, error)
func (Querier) Params ¶
func (q Querier) Params( goCtx context.Context, req *incentive.QueryParams, ) (*incentive.QueryParamsResponse, error)
func (Querier) PendingRewards ¶
func (q Querier) PendingRewards( _ context.Context, req *incentive.QueryPendingRewards, ) (*incentive.QueryPendingRewardsResponse, error)
func (Querier) TotalBonded ¶
func (q Querier) TotalBonded( _ context.Context, req *incentive.QueryTotalBonded, ) (*incentive.QueryTotalBondedResponse, error)
func (Querier) Unbondings ¶
func (q Querier) Unbondings( _ context.Context, req *incentive.QueryUnbondings, ) (*incentive.QueryUnbondingsResponse, error)
func (Querier) UpcomingIncentivePrograms ¶
func (q Querier) UpcomingIncentivePrograms( _ context.Context, req *incentive.QueryUpcomingIncentivePrograms, ) (*incentive.QueryUpcomingIncentiveProgramsResponse, error)