Documentation ¶
Index ¶
- func NewAccountHistory(account string, coins sdk.Coins) *types.AccountHistory
- func NewMsgServerImpl(keeper *Keeper) types.MsgServer
- func UnmarshalRefArray(bz []byte) []uint64
- type Distributor
- type DistributorKeeper
- type Hooks
- type Keeper
- 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) error
- func (k Keeper) BeforeEpochStart(ctx sdk.Context, epochIdentifier string, epochNumber int64) error
- func (k Keeper) CreateGauge(ctx sdk.Context, isPerpetual bool, owner sdk.AccAddress, coins sdk.Coins, ...) (*types.Gauge, error)
- func (k Keeper) CreateStake(ctx sdk.Context, owner sdk.AccAddress, coins sdk.Coins, startTime time.Time, ...) (*types.Stake, error)
- func (k Keeper) Distribute(ctx sdk.Context, gauges types.Gauges) (types.DistributionSpec, error)
- func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
- func (k Keeper) GetAccountHistory(ctx sdk.Context, account string) (val *types.AccountHistory, found bool)
- func (k Keeper) GetActiveGauges(ctx sdk.Context) types.Gauges
- func (k Keeper) GetAllAccountHistory(ctx sdk.Context) (list []*types.AccountHistory)
- func (k Keeper) GetEpochInfo(ctx sdk.Context) epochtypes.EpochInfo
- func (k Keeper) GetFinishedGauges(ctx sdk.Context) types.Gauges
- func (k Keeper) GetGaugeByID(ctx sdk.Context, gaugeID uint64) (*types.Gauge, error)
- func (k Keeper) GetGaugeQualifyingValue(ctx sdk.Context, gaugeID uint64) (uint64, error)
- func (k Keeper) GetGauges(ctx sdk.Context) types.Gauges
- func (k Keeper) GetGaugesByPair(ctx sdk.Context, pair *dextypes.PairID) []*types.Gauge
- func (k Keeper) GetLastGaugeID(ctx sdk.Context) uint64
- func (k Keeper) GetLastStakeID(ctx sdk.Context) uint64
- func (k Keeper) GetModuleBalance(ctx sdk.Context) sdk.Coins
- func (k Keeper) GetModuleCoinsToBeDistributed(ctx sdk.Context) sdk.Coins
- func (k Keeper) GetModuleDistributedCoins(ctx sdk.Context) sdk.Coins
- func (k Keeper) GetModuleStakedCoins(ctx sdk.Context) sdk.Coins
- func (k Keeper) GetNotFinishedGauges(ctx sdk.Context) types.Gauges
- func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)
- func (k Keeper) GetRewardsEstimate(ctx sdk.Context, addr sdk.AccAddress, filterStakes types.Stakes, ...) (sdk.Coins, error)
- func (k Keeper) GetStakeByID(ctx sdk.Context, stakeID uint64) (*types.Stake, error)
- func (k Keeper) GetStakes(ctx sdk.Context) types.Stakes
- func (k Keeper) GetStakesByAccount(ctx sdk.Context, addr sdk.AccAddress) types.Stakes
- func (k Keeper) GetStakesByQueryCondition(ctx sdk.Context, distrTo *types.QueryCondition) types.Stakes
- func (k Keeper) GetUpcomingGauges(ctx sdk.Context) types.Gauges
- func (k Keeper) Hooks() Hooks
- func (k Keeper) InitGenesis(ctx sdk.Context, genState types.GenesisState)
- func (k Keeper) InitializeAllGauges(ctx sdk.Context, gauges types.Gauges) error
- func (k Keeper) InitializeAllStakes(ctx sdk.Context, stakes types.Stakes) error
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) RemoveAccountHistory(ctx sdk.Context, account string)
- func (k Keeper) SetAccountHistory(ctx sdk.Context, accountHistory *types.AccountHistory) error
- func (k *Keeper) SetHooks(ih types.IncentiveHooks) *Keeper
- func (k Keeper) SetLastGaugeID(ctx sdk.Context, id uint64)
- func (k Keeper) SetLastStakeID(ctx sdk.Context, id uint64)
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) Unstake(ctx sdk.Context, stake *types.Stake, coins sdk.Coins) (uint64, error)
- func (k Keeper) ValueForShares(ctx sdk.Context, coin sdk.Coin, tick int64) (sdk.Int, error)
- type QueryServer
- func (q QueryServer) GetAccountHistory(goCtx context.Context, req *types.GetAccountHistoryRequest) (*types.GetAccountHistoryResponse, error)
- func (q QueryServer) GetFutureRewardEstimate(goCtx context.Context, req *types.GetFutureRewardEstimateRequest) (*types.GetFutureRewardEstimateResponse, error)
- func (q QueryServer) GetGaugeByID(goCtx context.Context, req *types.GetGaugeByIDRequest) (*types.GetGaugeByIDResponse, error)
- func (q QueryServer) GetGaugeQualifyingValue(goCtx context.Context, req *types.GetGaugeQualifyingValueRequest) (*types.GetGaugeQualifyingValueResponse, error)
- func (q QueryServer) GetGauges(goCtx context.Context, req *types.GetGaugesRequest) (*types.GetGaugesResponse, error)
- func (q QueryServer) GetModuleStatus(goCtx context.Context, req *types.GetModuleStatusRequest) (*types.GetModuleStatusResponse, error)
- func (q QueryServer) GetStakeByID(goCtx context.Context, req *types.GetStakeByIDRequest) (*types.GetStakeByIDResponse, error)
- func (q QueryServer) GetStakes(goCtx context.Context, req *types.GetStakesRequest) (*types.GetStakesResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAccountHistory ¶ added in v0.3.4
func NewAccountHistory(account string, coins sdk.Coins) *types.AccountHistory
func NewMsgServerImpl ¶
NewMsgServerImpl returns an instance of MsgServer for the provided keeper.
func UnmarshalRefArray ¶
Types ¶
type Distributor ¶
type Distributor struct {
// contains filtered or unexported fields
}
func NewDistributor ¶
func NewDistributor(keeper DistributorKeeper) Distributor
func (Distributor) Distribute ¶
func (d Distributor) Distribute( ctx sdk.Context, gauge *types.Gauge, filterStakes types.Stakes, ) (types.DistributionSpec, error)
type DistributorKeeper ¶
type Hooks ¶
type Hooks struct {
// contains filtered or unexported fields
}
Hooks is the wrapper struct for the incentives keeper.
func (Hooks) AfterEpochEnd ¶
AfterEpochEnd is the epoch end hook.
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper provides a way to manage incentives module storage.
func NewKeeper ¶
func NewKeeper( storeKey storetypes.StoreKey, paramSpace paramtypes.Subspace, ak types.AccountKeeper, bk types.BankKeeper, ek types.EpochKeeper, dk types.DexKeeper, authority string, ) *Keeper
NewKeeper returns a new instance of the incentive module keeper struct.
func (Keeper) AddToGaugeRewards ¶
func (k Keeper) AddToGaugeRewards( ctx sdk.Context, owner sdk.AccAddress, coins sdk.Coins, gaugeID uint64, ) error
AddToGaugeRewards adds coins to gauge.
func (Keeper) AfterEpochEnd ¶
AfterEpochEnd is the epoch end hook.
func (Keeper) BeforeEpochStart ¶
BeforeEpochStart is the epoch start hook.
func (Keeper) CreateGauge ¶
func (k Keeper) CreateGauge( ctx sdk.Context, isPerpetual bool, owner sdk.AccAddress, coins sdk.Coins, distrTo types.QueryCondition, startTime time.Time, numEpochsPaidOver uint64, pricingTick int64, ) (*types.Gauge, error)
CreateGauge creates a gauge and sends coins to the gauge.
func (Keeper) CreateStake ¶
func (Keeper) Distribute ¶
Distribute distributes coins from an array of gauges to all eligible stakes.
func (Keeper) ExportGenesis ¶
func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
ExportGenesis returns the x/incentives module's exported genesis.
func (Keeper) GetAccountHistory ¶ added in v0.3.4
func (k Keeper) GetAccountHistory( ctx sdk.Context, account string, ) (val *types.AccountHistory, found bool)
GetAccountHistory returns a goodTilRecord from its index
func (Keeper) GetActiveGauges ¶
GetActiveGauges returns active gauges.
func (Keeper) GetAllAccountHistory ¶ added in v0.3.4
func (k Keeper) GetAllAccountHistory(ctx sdk.Context) (list []*types.AccountHistory)
GetAllAccountHistory returns all goodTilRecord
func (Keeper) GetEpochInfo ¶
func (k Keeper) GetEpochInfo(ctx sdk.Context) epochtypes.EpochInfo
GetEpochInfo returns EpochInfo struct given context.
func (Keeper) GetFinishedGauges ¶
GetFinishedGauges returns finished gauges.
func (Keeper) GetGaugeByID ¶
GetGaugeByID returns gauge from gauge ID.
func (Keeper) GetGaugeQualifyingValue ¶ added in v0.3.4
GetGaugeQualifyingValue returns gauge qualifying value from gauge ID.
func (Keeper) GetGaugesByPair ¶
func (Keeper) GetLastGaugeID ¶
GetLastGaugeID returns the last used gauge ID.
func (Keeper) GetLastStakeID ¶
GetLastStakeID returns ID used last time.
func (Keeper) GetModuleBalance ¶
GetModuleBalance returns full balance of the module.
func (Keeper) GetModuleCoinsToBeDistributed ¶
GetModuleCoinsToBeDistributed returns sum of coins yet to be distributed for all of the module.
func (Keeper) GetModuleDistributedCoins ¶
GetModuleDistributedCoins returns sum of coins that have been distributed so far for all of the module.
func (Keeper) GetModuleStakedCoins ¶
GetModuleStakedCoins Returns staked balance of the module.
func (Keeper) GetNotFinishedGauges ¶
GetNotFinishedGauges returns both upcoming and active gauges.
func (Keeper) GetRewardsEstimate ¶
func (k Keeper) GetRewardsEstimate( ctx sdk.Context, addr sdk.AccAddress, filterStakes types.Stakes, numEpochs int64, ) (sdk.Coins, error)
GetRewardsEstimate returns rewards estimation at a future specific time (by epoch) If stakes are nil, it returns the rewards between now and the end epoch associated with address. If stakes are not nil, it returns all the rewards for the given stakes between now and end epoch.
func (Keeper) GetStakeByID ¶
GetStakeByID Returns stake from stakeID.
func (Keeper) GetStakesByAccount ¶
GetAccountStakes Returns the period locks associated to an account.
func (Keeper) GetStakesByQueryCondition ¶
func (k Keeper) GetStakesByQueryCondition( ctx sdk.Context, distrTo *types.QueryCondition, ) types.Stakes
GetAccountStakes Returns the period locks associated to an account.
func (Keeper) GetUpcomingGauges ¶
GetUpcomingGauges returns upcoming gauges.
func (Keeper) InitGenesis ¶
func (k Keeper) InitGenesis(ctx sdk.Context, genState types.GenesisState)
InitGenesis initializes the incentives module's state from a provided genesis state.
func (Keeper) InitializeAllGauges ¶
InitializeAllGauges takes a set of gauges, and initializes state to be storing them all correctly.
func (Keeper) InitializeAllStakes ¶
InitializeAllStakes takes a set of stakes, and initializes state to be storing them all correctly.
func (Keeper) RemoveAccountHistory ¶ added in v0.3.4
RemoveAccountHistory removes a goodTilRecord from the store
func (Keeper) SetAccountHistory ¶ added in v0.3.4
SetAccountHistory set a specific goodTilRecord in the store from its index
func (*Keeper) SetHooks ¶
func (k *Keeper) SetHooks(ih types.IncentiveHooks) *Keeper
SetHooks sets the incentives hooks.
func (Keeper) SetLastGaugeID ¶
SetLastGaugeID sets the last used gauge ID to the provided ID.
func (Keeper) SetLastStakeID ¶
SetLastStakeID save ID used by last stake.
type QueryServer ¶
type QueryServer struct {
*Keeper
}
QueryServer defines a wrapper around the incentives module keeper providing gRPC method handlers.
func NewQueryServer ¶
func NewQueryServer(k *Keeper) QueryServer
NewQueryServer creates a new QueryServer struct.
func (QueryServer) GetAccountHistory ¶ added in v0.3.4
func (q QueryServer) GetAccountHistory( goCtx context.Context, req *types.GetAccountHistoryRequest, ) (*types.GetAccountHistoryResponse, error)
func (QueryServer) GetFutureRewardEstimate ¶
func (q QueryServer) GetFutureRewardEstimate( goCtx context.Context, req *types.GetFutureRewardEstimateRequest, ) (*types.GetFutureRewardEstimateResponse, error)
func (QueryServer) GetGaugeByID ¶
func (q QueryServer) GetGaugeByID( goCtx context.Context, req *types.GetGaugeByIDRequest, ) (*types.GetGaugeByIDResponse, error)
func (QueryServer) GetGaugeQualifyingValue ¶ added in v0.3.4
func (q QueryServer) GetGaugeQualifyingValue( goCtx context.Context, req *types.GetGaugeQualifyingValueRequest, ) (*types.GetGaugeQualifyingValueResponse, error)
func (QueryServer) GetGauges ¶
func (q QueryServer) GetGauges( goCtx context.Context, req *types.GetGaugesRequest, ) (*types.GetGaugesResponse, error)
func (QueryServer) GetModuleStatus ¶
func (q QueryServer) GetModuleStatus( goCtx context.Context, req *types.GetModuleStatusRequest, ) (*types.GetModuleStatusResponse, error)
func (QueryServer) GetStakeByID ¶
func (q QueryServer) GetStakeByID( goCtx context.Context, req *types.GetStakeByIDRequest, ) (*types.GetStakeByIDResponse, error)
func (QueryServer) GetStakes ¶
func (q QueryServer) GetStakes( goCtx context.Context, req *types.GetStakesRequest, ) (*types.GetStakesResponse, error)