Documentation ¶
Index ¶
- func NewQuerier(k Keeper) sdk.Querier
- type Keeper
- func (k Keeper) AddToClaim(ctx sdk.Context, addr sdk.AccAddress, collateralType string, id uint64, ...)
- func (k Keeper) ApplyRewardsToCdps(ctx sdk.Context)
- func (k Keeper) CreateAndDeleteRewardPeriods(ctx sdk.Context)
- func (k Keeper) CreateNewRewardPeriod(ctx sdk.Context, reward types.Reward)
- func (k Keeper) CreateUniqueClaimPeriod(ctx sdk.Context, collateralType string, end time.Time, ...)
- func (k Keeper) DeleteClaim(ctx sdk.Context, owner sdk.AccAddress, collateralType string, id uint64)
- func (k Keeper) DeleteClaimPeriod(ctx sdk.Context, id uint64, collateralType string)
- func (k Keeper) DeleteExpiredClaimsAndClaimPeriods(ctx sdk.Context)
- func (k Keeper) DeleteRewardPeriod(ctx sdk.Context, collateralType string)
- func (k Keeper) GetActiveClaimsByAddressAndCollateralType(ctx sdk.Context, addr sdk.AccAddress, collateralType string) (claims types.Claims, found bool)
- func (k Keeper) GetAllClaimPeriodIDPairs(ctx sdk.Context) types.GenesisClaimPeriodIDs
- func (k Keeper) GetAllClaimPeriods(ctx sdk.Context) types.ClaimPeriods
- func (k Keeper) GetAllClaims(ctx sdk.Context) types.Claims
- func (k Keeper) GetAllClaimsByAddressAndCollateralType(ctx sdk.Context, addr sdk.AccAddress, collateralType string) (claims types.AugmentedClaims, found bool)
- func (k Keeper) GetAllRewardPeriods(ctx sdk.Context) types.RewardPeriods
- func (k Keeper) GetClaim(ctx sdk.Context, addr sdk.AccAddress, collateralType string, id uint64) (types.Claim, bool)
- func (k Keeper) GetClaimPeriod(ctx sdk.Context, id uint64, collateralType string) (types.ClaimPeriod, bool)
- func (k Keeper) GetNextClaimPeriodID(ctx sdk.Context, collateralType string) uint64
- func (k Keeper) GetParams(ctx sdk.Context) types.Params
- func (k Keeper) GetPreviousBlockTime(ctx sdk.Context) (blockTime time.Time, found bool)
- func (k Keeper) GetRewardPeriod(ctx sdk.Context, collateralType string) (types.RewardPeriod, bool)
- func (k Keeper) HandleRewardPeriodExpiry(ctx sdk.Context, rp types.RewardPeriod)
- func (k Keeper) IterateClaimPeriodIDKeysAndValues(ctx sdk.Context, cb func(collateralType string, id uint64) (stop bool))
- func (k Keeper) IterateClaimPeriods(ctx sdk.Context, cb func(cp types.ClaimPeriod) (stop bool))
- func (k Keeper) IterateClaims(ctx sdk.Context, cb func(c types.Claim) (stop bool))
- func (k Keeper) IterateRewardPeriods(ctx sdk.Context, cb func(rp types.RewardPeriod) (stop bool))
- func (k Keeper) PayoutClaim(ctx sdk.Context, addr sdk.AccAddress, collateralType string, id uint64, ...) error
- func (k Keeper) SendTimeLockedCoinsToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, ...) error
- func (k Keeper) SendTimeLockedCoinsToBaseAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, ...) error
- func (k Keeper) SendTimeLockedCoinsToPeriodicVestingAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, ...) error
- func (k Keeper) SetClaim(ctx sdk.Context, c types.Claim)
- func (k Keeper) SetClaimPeriod(ctx sdk.Context, cp types.ClaimPeriod)
- func (k Keeper) SetNextClaimPeriodID(ctx sdk.Context, collateralType string, id uint64)
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) SetPreviousBlockTime(ctx sdk.Context, blockTime time.Time)
- func (k Keeper) SetRewardPeriod(ctx sdk.Context, rp types.RewardPeriod)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewQuerier ¶
NewQuerier is the module level router for state queries
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper keeper for the incentive module
func NewKeeper ¶
func NewKeeper( cdc *codec.Codec, key sdk.StoreKey, paramstore subspace.Subspace, sk types.SupplyKeeper, cdpk types.CdpKeeper, ak types.AccountKeeper, ) Keeper
NewKeeper creates a new keeper
func (Keeper) AddToClaim ¶
func (k Keeper) AddToClaim(ctx sdk.Context, addr sdk.AccAddress, collateralType string, id uint64, amount sdk.Coin)
AddToClaim adds the amount to an existing claim or creates a new one for that amount
func (Keeper) ApplyRewardsToCdps ¶
ApplyRewardsToCdps iterates over the reward periods and creates a claim for each cdp owner that created usdx with the collateral specified in the reward period.
func (Keeper) CreateAndDeleteRewardPeriods ¶
CreateAndDeleteRewardPeriods creates reward periods for active rewards that don't already have a reward period and deletes reward periods for inactive rewards that currently have a reward period
func (Keeper) CreateNewRewardPeriod ¶
CreateNewRewardPeriod creates a new reward period from the input reward
func (Keeper) CreateUniqueClaimPeriod ¶
func (k Keeper) CreateUniqueClaimPeriod(ctx sdk.Context, collateralType string, end time.Time, multipliers types.Multipliers)
CreateUniqueClaimPeriod creates a new claim period in the store and updates the highest claim period id
func (Keeper) DeleteClaim ¶
func (k Keeper) DeleteClaim(ctx sdk.Context, owner sdk.AccAddress, collateralType string, id uint64)
DeleteClaim deletes the claim in the store corresponding to the input address, collateral type, and id
func (Keeper) DeleteClaimPeriod ¶
DeleteClaimPeriod deletes the claim period in the store for the input ID and collateral type
func (Keeper) DeleteExpiredClaimsAndClaimPeriods ¶
DeleteExpiredClaimsAndClaimPeriods deletes expired claim periods and their associated claims
func (Keeper) DeleteRewardPeriod ¶
DeleteRewardPeriod deletes the reward period in the store for the input collateral type,
func (Keeper) GetActiveClaimsByAddressAndCollateralType ¶ added in v0.11.0
func (k Keeper) GetActiveClaimsByAddressAndCollateralType(ctx sdk.Context, addr sdk.AccAddress, collateralType string) (claims types.Claims, found bool)
GetActiveClaimsByAddressAndCollateralType returns all claims for a specific user and address and a bool for if any were found
func (Keeper) GetAllClaimPeriodIDPairs ¶
func (k Keeper) GetAllClaimPeriodIDPairs(ctx sdk.Context) types.GenesisClaimPeriodIDs
GetAllClaimPeriodIDPairs returns all collateralType:nextClaimPeriodID pairs in the store
func (Keeper) GetAllClaimPeriods ¶
func (k Keeper) GetAllClaimPeriods(ctx sdk.Context) types.ClaimPeriods
GetAllClaimPeriods returns all ClaimPeriod objects in the store
func (Keeper) GetAllClaims ¶
GetAllClaims returns all Claim objects in the store
func (Keeper) GetAllClaimsByAddressAndCollateralType ¶ added in v0.11.0
func (k Keeper) GetAllClaimsByAddressAndCollateralType(ctx sdk.Context, addr sdk.AccAddress, collateralType string) (claims types.AugmentedClaims, found bool)
GetAllClaimsByAddressAndCollateralType returns all claims for a specific user and address and a bool for if any were found
func (Keeper) GetAllRewardPeriods ¶
func (k Keeper) GetAllRewardPeriods(ctx sdk.Context) types.RewardPeriods
GetAllRewardPeriods returns all reward periods in the store
func (Keeper) GetClaim ¶
func (k Keeper) GetClaim(ctx sdk.Context, addr sdk.AccAddress, collateralType string, id uint64) (types.Claim, bool)
GetClaim returns the claim in the store corresponding the the input address collateral type and id and a boolean for if the claim was found
func (Keeper) GetClaimPeriod ¶
func (k Keeper) GetClaimPeriod(ctx sdk.Context, id uint64, collateralType string) (types.ClaimPeriod, bool)
GetClaimPeriod returns claim period in the store for the input ID and collateral type and a boolean for if it was found
func (Keeper) GetNextClaimPeriodID ¶
GetNextClaimPeriodID returns the highest claim period id in the store for the input collateral type
func (Keeper) GetPreviousBlockTime ¶
GetPreviousBlockTime get the blocktime for the previous block
func (Keeper) GetRewardPeriod ¶
GetRewardPeriod returns the reward period from the store for the input collateral type and a boolean for if it was found
func (Keeper) HandleRewardPeriodExpiry ¶
func (k Keeper) HandleRewardPeriodExpiry(ctx sdk.Context, rp types.RewardPeriod)
HandleRewardPeriodExpiry deletes expired RewardPeriods from the store and creates a ClaimPeriod in the store for each expired RewardPeriod
func (Keeper) IterateClaimPeriodIDKeysAndValues ¶
func (k Keeper) IterateClaimPeriodIDKeysAndValues(ctx sdk.Context, cb func(collateralType string, id uint64) (stop bool))
IterateClaimPeriodIDKeysAndValues iterates over the claim period id (value) and collateral type (key) of each claim period id in the store and performs a callback function
func (Keeper) IterateClaimPeriods ¶
IterateClaimPeriods iterates over all claim period objects in the store and preforms a callback function
func (Keeper) IterateClaims ¶
IterateClaims iterates over all claim objects in the store and preforms a callback function
func (Keeper) IterateRewardPeriods ¶
IterateRewardPeriods iterates over all reward period objects in the store and preforms a callback function
func (Keeper) PayoutClaim ¶
func (k Keeper) PayoutClaim(ctx sdk.Context, addr sdk.AccAddress, collateralType string, id uint64, multiplierName types.MultiplierName) error
PayoutClaim sends the timelocked claim coins to the input address
func (Keeper) SendTimeLockedCoinsToAccount ¶
func (k Keeper) SendTimeLockedCoinsToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins, length int64) error
SendTimeLockedCoinsToAccount sends time-locked coins from the input module account to the recipient. If the recipients account is not a vesting account and the input length is greater than zero, the recipient account is converted to a periodic vesting account and the coins are added to the vesting balance as a vesting period with the input length.
func (Keeper) SendTimeLockedCoinsToBaseAccount ¶
func (k Keeper) SendTimeLockedCoinsToBaseAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins, length int64) error
SendTimeLockedCoinsToBaseAccount sends time-locked coins from the input module account to the recipient, converting the recipient account to a vesting account
func (Keeper) SendTimeLockedCoinsToPeriodicVestingAccount ¶
func (k Keeper) SendTimeLockedCoinsToPeriodicVestingAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins, length int64) error
SendTimeLockedCoinsToPeriodicVestingAccount sends time-locked coins from the input module account to the recipient
func (Keeper) SetClaim ¶
SetClaim sets the claim in the store corresponding to the input address, collateral type, and id
func (Keeper) SetClaimPeriod ¶
func (k Keeper) SetClaimPeriod(ctx sdk.Context, cp types.ClaimPeriod)
SetClaimPeriod sets the claim period in the store for the input ID and collateral type
func (Keeper) SetNextClaimPeriodID ¶
SetNextClaimPeriodID sets the highest claim period id in the store for the input collateral type
func (Keeper) SetPreviousBlockTime ¶
SetPreviousBlockTime set the time of the previous block
func (Keeper) SetRewardPeriod ¶
func (k Keeper) SetRewardPeriod(ctx sdk.Context, rp types.RewardPeriod)
SetRewardPeriod sets the reward period in the store for the input deno,