Documentation ¶
Index ¶
- func FilterLocksByMinDuration(locks []lockuptypes.PeriodLock, minDuration time.Duration) []lockuptypes.PeriodLock
- func NewMsgServerImpl(keeper *Keeper) types.MsgServer
- type Hooks
- type Keeper
- func (k Keeper) ActiveGaugesIterator(ctx sdk.Context) sdk.Iterator
- func (k Keeper) AddToGaugeRewards(ctx sdk.Context, owner sdk.AccAddress, coins sdk.Coins, gaugeID uint64) error
- func (k Keeper) AfterEpochEnd(ctx sdk.Context, epochIdentifier string, epochNumber int64)
- func (k Keeper) BeforeEpochStart(ctx sdk.Context, epochIdentifier string, epochNumber int64)
- func (k Keeper) CreateGauge(ctx sdk.Context, isPerpetual bool, owner sdk.AccAddress, coins sdk.Coins, ...) (uint64, error)
- func (k Keeper) CreateGaugeRefKeys(ctx sdk.Context, gauge *types.Gauge, combinedKeys []byte, ...) error
- func (k Keeper) Distribute(ctx sdk.Context, gauges []types.Gauge) (sdk.Coins, error)
- func (k Keeper) FilteredLocksDistributionEst(ctx sdk.Context, gauge types.Gauge, filteredLocks []lockuptypes.PeriodLock) (types.Gauge, sdk.Coins, error)
- func (k Keeper) FinishedGaugesIterator(ctx sdk.Context) sdk.Iterator
- func (k Keeper) GaugesIterator(ctx sdk.Context) sdk.Iterator
- func (k Keeper) GetActiveGauges(ctx sdk.Context) []types.Gauge
- func (k Keeper) GetEpochInfo(ctx sdk.Context) epochtypes.EpochInfo
- func (k Keeper) GetFinishedGauges(ctx sdk.Context) []types.Gauge
- func (k Keeper) GetGaugeByID(ctx sdk.Context, gaugeID uint64) (*types.Gauge, error)
- func (k Keeper) GetGaugeFromIDs(ctx sdk.Context, gaugeIDs []uint64) ([]types.Gauge, error)
- func (k Keeper) GetGauges(ctx sdk.Context) []types.Gauge
- func (k Keeper) GetLastGaugeID(ctx sdk.Context) uint64
- func (k Keeper) GetLockableDurations(ctx sdk.Context) []time.Duration
- func (k Keeper) GetLocksToDistribution(ctx sdk.Context, distrTo lockuptypes.QueryCondition) []lockuptypes.PeriodLock
- func (k Keeper) GetModuleDistributedCoins(ctx sdk.Context) sdk.Coins
- func (k Keeper) GetModuleToDistributeCoins(ctx sdk.Context) sdk.Coins
- func (k Keeper) GetNotFinishedGauges(ctx sdk.Context) []types.Gauge
- func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)
- func (k Keeper) GetRewardsEst(ctx sdk.Context, addr sdk.AccAddress, locks []lockuptypes.PeriodLock, ...) sdk.Coins
- func (k Keeper) GetUpcomingGauges(ctx sdk.Context) []types.Gauge
- func (k Keeper) Hooks() Hooks
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) SendCoinsFromModuleToManyAccounts(ctx sdk.Context, senderModule string, recipientAddrs []sdk.AccAddress, ...) error
- func (k Keeper) SetGaugeWithRefKey(ctx sdk.Context, gauge *types.Gauge) error
- func (k *Keeper) SetHooks(ih types.IncentiveHooks) *Keeper
- func (k Keeper) SetLastGaugeID(ctx sdk.Context, id uint64)
- func (k Keeper) SetLockableDurations(ctx sdk.Context, lockableDurations []time.Duration)
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) UpcomingGaugesIterator(ctx sdk.Context) sdk.Iterator
- func (k Keeper) UpcomingGaugesIteratorAfterTime(ctx sdk.Context, time time.Time) sdk.Iterator
- func (k Keeper) UpcomingGaugesIteratorBeforeTime(ctx sdk.Context, time time.Time) sdk.Iterator
- type Querier
- func (q Querier) ActiveGauges(goCtx context.Context, req *types.ActiveGaugesRequest) (*types.ActiveGaugesResponse, error)
- func (q Querier) ActiveGaugesPerDenom(goCtx context.Context, req *types.ActiveGaugesPerDenomRequest) (*types.ActiveGaugesPerDenomResponse, error)
- func (q Querier) GaugeByID(goCtx context.Context, req *types.GaugeByIDRequest) (*types.GaugeByIDResponse, error)
- func (q Querier) Gauges(goCtx context.Context, req *types.GaugesRequest) (*types.GaugesResponse, error)
- func (q Querier) LockableDurations(ctx context.Context, _ *types.QueryLockableDurationsRequest) (*types.QueryLockableDurationsResponse, error)
- func (q Querier) ModuleDistributedCoins(goCtx context.Context, _ *types.ModuleDistributedCoinsRequest) (*types.ModuleDistributedCoinsResponse, error)
- func (q Querier) ModuleToDistributeCoins(goCtx context.Context, _ *types.ModuleToDistributeCoinsRequest) (*types.ModuleToDistributeCoinsResponse, error)
- func (q Querier) RewardsEst(goCtx context.Context, req *types.RewardsEstRequest) (*types.RewardsEstResponse, error)
- func (q Querier) UpcomingGauges(goCtx context.Context, req *types.UpcomingGaugesRequest) (*types.UpcomingGaugesResponse, error)
- func (q Querier) UpcomingGaugesPerDenom(goCtx context.Context, req *types.UpcomingGaugesPerDenomRequest) (*types.UpcomingGaugesPerDenomResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FilterLocksByMinDuration ¶
func FilterLocksByMinDuration(locks []lockuptypes.PeriodLock, minDuration time.Duration) []lockuptypes.PeriodLock
func NewMsgServerImpl ¶
NewMsgServerImpl returns an instance of MsgServer.
Types ¶
type Hooks ¶
type Hooks struct {
// contains filtered or unexported fields
}
Hooks wrapper struct for incentives keeper.
func (Hooks) AfterEpochEnd ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
func NewKeeper ¶
func NewKeeper(cdc codec.Codec, storeKey sdk.StoreKey, paramSpace paramtypes.Subspace, bk types.BankKeeper, lk types.LockupKeeper, ek types.EpochKeeper, ak types.AccountKeeper) *Keeper
func (Keeper) ActiveGaugesIterator ¶
ActiveGaugesIterator returns iterator for active gauges.
func (Keeper) AddToGaugeRewards ¶
func (k Keeper) AddToGaugeRewards(ctx sdk.Context, owner sdk.AccAddress, coins sdk.Coins, gaugeID uint64) error
AddToGauge add coins to gauge.
func (Keeper) AfterEpochEnd ¶
func (Keeper) BeforeEpochStart ¶
func (Keeper) CreateGauge ¶
func (k Keeper) CreateGauge(ctx sdk.Context, isPerpetual bool, owner sdk.AccAddress, coins sdk.Coins, distrTo lockuptypes.QueryCondition, startTime time.Time, numEpochsPaidOver uint64) (uint64, error)
CreateGauge create a gauge and send coins to the gauge.
func (Keeper) CreateGaugeRefKeys ¶
func (k Keeper) CreateGaugeRefKeys(ctx sdk.Context, gauge *types.Gauge, combinedKeys []byte, activeOrUpcomingGauge bool) error
CreateGaugeRefKeys adds gauge references as needed. Used to consolidate codepaths for InitGenesis and CreateGauge.
func (Keeper) Distribute ¶
Distribute coins from gauge according to its conditions.
func (Keeper) FilteredLocksDistributionEst ¶
func (k Keeper) FilteredLocksDistributionEst(ctx sdk.Context, gauge types.Gauge, filteredLocks []lockuptypes.PeriodLock) (types.Gauge, sdk.Coins, error)
FilteredLocksDistributionEst estimate distribution amount coins from gauge for fitting conditions Expectation: gauge is a valid gauge filteredLocks are all locks that are valid for gauge It also applies an update for the gauge, handling the sending of the rewards. (Note this update is in-memory, it does not change state.)
func (Keeper) FinishedGaugesIterator ¶
FinishedGaugesIterator returns iterator for finished gauges.
func (Keeper) GaugesIterator ¶
GaugesIterator returns iterator for all gauges.
func (Keeper) GetActiveGauges ¶
GetActiveGauges returns active gauges.
func (Keeper) GetEpochInfo ¶
func (k Keeper) GetEpochInfo(ctx sdk.Context) epochtypes.EpochInfo
func (Keeper) GetFinishedGauges ¶
GetFinishedGauges returns finished gauges.
func (Keeper) GetGaugeByID ¶
GetGaugeByID Returns gauge from gauge ID.
func (Keeper) GetGaugeFromIDs ¶
GetGaugeFromIDs returns gauges from gauge ids reference.
func (Keeper) GetLastGaugeID ¶
GetLastGaugeID returns ID used last time.
func (Keeper) GetLockableDurations ¶
func (Keeper) GetLocksToDistribution ¶
func (k Keeper) GetLocksToDistribution(ctx sdk.Context, distrTo lockuptypes.QueryCondition) []lockuptypes.PeriodLock
GetLocksToDistribution get locks that are associated to a condition.
func (Keeper) GetModuleDistributedCoins ¶
GetModuleDistributedCoins returns sum of distributed coins so far.
func (Keeper) GetModuleToDistributeCoins ¶
GetModuleToDistributeCoins returns sum of to distribute coins for all of the module.
func (Keeper) GetNotFinishedGauges ¶
func (Keeper) GetRewardsEst ¶
func (k Keeper) GetRewardsEst(ctx sdk.Context, addr sdk.AccAddress, locks []lockuptypes.PeriodLock, endEpoch int64) sdk.Coins
GetRewardsEst returns rewards estimation at a future specific time If locks are nil, it returns the rewards between now and the end epoch associated with address. If locks are not nil, it returns all the rewards for the given locks between now and end epoch.
func (Keeper) GetUpcomingGauges ¶
GetUpcomingGauges returns scheduled gauges.
func (Keeper) SendCoinsFromModuleToManyAccounts ¶
func (Keeper) SetGaugeWithRefKey ¶
func (*Keeper) SetHooks ¶
func (k *Keeper) SetHooks(ih types.IncentiveHooks) *Keeper
Set the incentives hooks
func (Keeper) SetLastGaugeID ¶
SetLastGaugeID save ID used by last gauge.
func (Keeper) SetLockableDurations ¶
func (Keeper) UpcomingGaugesIterator ¶
UpcomingGaugesIterator returns iterator for upcoming gauges.
func (Keeper) UpcomingGaugesIteratorAfterTime ¶
UpcomingGaugesIteratorAfterTime returns the iterator to get upcoming gauges that start distribution after specific time.
type Querier ¶ added in v1.1.0
type Querier struct {
Keeper
}
Querier defines a wrapper around the x/incentives keeper providing gRPC method handlers.
func NewQuerier ¶
func (Querier) ActiveGauges ¶ added in v1.1.0
func (q Querier) ActiveGauges(goCtx context.Context, req *types.ActiveGaugesRequest) (*types.ActiveGaugesResponse, error)
ActiveGauges returns active gauges.
func (Querier) ActiveGaugesPerDenom ¶ added in v1.1.0
func (q Querier) ActiveGaugesPerDenom(goCtx context.Context, req *types.ActiveGaugesPerDenomRequest) (*types.ActiveGaugesPerDenomResponse, error)
ActiveGaugesPerDenom returns active gauges for the specified denom.
func (Querier) GaugeByID ¶ added in v1.1.0
func (q Querier) GaugeByID(goCtx context.Context, req *types.GaugeByIDRequest) (*types.GaugeByIDResponse, error)
GaugeByID returns Gauge by id.
func (Querier) Gauges ¶ added in v1.1.0
func (q Querier) Gauges(goCtx context.Context, req *types.GaugesRequest) (*types.GaugesResponse, error)
Gauges returns gauges both upcoming and active.
func (Querier) LockableDurations ¶ added in v1.1.0
func (q Querier) LockableDurations(ctx context.Context, _ *types.QueryLockableDurationsRequest) (*types.QueryLockableDurationsResponse, error)
func (Querier) ModuleDistributedCoins ¶ added in v1.1.0
func (q Querier) ModuleDistributedCoins(goCtx context.Context, _ *types.ModuleDistributedCoinsRequest) (*types.ModuleDistributedCoinsResponse, error)
ModuleDistributedCoins returns coins that are distributed by module so far.
func (Querier) ModuleToDistributeCoins ¶ added in v1.1.0
func (q Querier) ModuleToDistributeCoins(goCtx context.Context, _ *types.ModuleToDistributeCoinsRequest) (*types.ModuleToDistributeCoinsResponse, error)
ModuleToDistributeCoins returns coins that is going to be distributed.
func (Querier) RewardsEst ¶ added in v1.1.0
func (q Querier) RewardsEst(goCtx context.Context, req *types.RewardsEstRequest) (*types.RewardsEstResponse, error)
RewardsEst returns rewards estimation at a future specific time.
func (Querier) UpcomingGauges ¶ added in v1.1.0
func (q Querier) UpcomingGauges(goCtx context.Context, req *types.UpcomingGaugesRequest) (*types.UpcomingGaugesResponse, error)
UpcomingGauges returns scheduled gauges.
func (Querier) UpcomingGaugesPerDenom ¶ added in v1.1.0
func (q Querier) UpcomingGaugesPerDenom(goCtx context.Context, req *types.UpcomingGaugesPerDenomRequest) (*types.UpcomingGaugesPerDenomResponse, error)