Documentation ¶
Index ¶
- Constants
- func NewQuerier(k Keeper) sdk.Querier
- type Keeper
- func (k Keeper) AddToClaim(ctx sdk.Context, owner sdk.AccAddress, depositDenom string, ...)
- func (k Keeper) ApplyDelegationRewards(ctx sdk.Context, denom string)
- func (k Keeper) ApplyDepositRewards(ctx sdk.Context)
- func (k Keeper) BondDenom(ctx sdk.Context) string
- func (k Keeper) ClaimReward(ctx sdk.Context, claimHolder sdk.AccAddress, receiver sdk.AccAddress, ...) error
- func (k Keeper) DeleteClaim(ctx sdk.Context, claim types.Claim)
- func (k Keeper) DeleteDeposit(ctx sdk.Context, deposit types.Deposit)
- func (k Keeper) Deposit(ctx sdk.Context, depositor sdk.AccAddress, amount sdk.Coin, ...) error
- func (k Keeper) GetClaim(ctx sdk.Context, owner sdk.AccAddress, depositDenom string, ...) (types.Claim, bool)
- func (k Keeper) GetDelegatorSchedule(ctx sdk.Context, denom string) (types.DelegatorDistributionSchedule, bool)
- func (k Keeper) GetDeposit(ctx sdk.Context, depositor sdk.AccAddress, denom string, ...) (types.Deposit, bool)
- func (k Keeper) GetLPSchedule(ctx sdk.Context, denom string) (types.DistributionSchedule, bool)
- func (k Keeper) GetParams(ctx sdk.Context) types.Params
- func (k Keeper) GetPeriodLength(ctx sdk.Context, multiplier types.Multiplier) (int64, error)
- func (k Keeper) GetPreviousBlockTime(ctx sdk.Context) (blockTime time.Time, found bool)
- func (k Keeper) GetPreviousDelegatorDistribution(ctx sdk.Context, denom string) (distTime time.Time, found bool)
- func (k Keeper) GetTotalDeposited(ctx sdk.Context, depositType types.DepositType, depositDenom string) (total sdk.Int)
- func (k Keeper) IterateClaims(ctx sdk.Context, cb func(claim types.Claim) (stop bool))
- func (k Keeper) IterateClaimsByTypeAndDenom(ctx sdk.Context, depositType types.DepositType, depositDenom string, ...)
- func (k Keeper) IterateDeposits(ctx sdk.Context, cb func(deposit types.Deposit) (stop bool))
- func (k Keeper) IterateDepositsByTypeAndDenom(ctx sdk.Context, depositType types.DepositType, depositDenom string, ...)
- 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, claim types.Claim)
- func (k Keeper) SetDeposit(ctx sdk.Context, deposit types.Deposit)
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) SetPreviousBlockTime(ctx sdk.Context, blockTime time.Time)
- func (k Keeper) SetPreviousDelegationDistribution(ctx sdk.Context, distTime time.Time, denom string)
- func (k Keeper) ShouldDistributeValidatorRewards(ctx sdk.Context, denom string) bool
- func (k Keeper) ValidateDeposit(ctx sdk.Context, amount sdk.Coin, depositType types.DepositType) error
- func (k Keeper) ValidateLPDeposit(ctx sdk.Context, amount sdk.Coin, depositType types.DepositType) error
- func (k Keeper) Withdraw(ctx sdk.Context, depositor sdk.AccAddress, amount sdk.Coin, ...) error
Constants ¶
const ( // BeginningOfMonth harvest rewards that are claimed after the 15th at 14:00UTC of the month always vest on the first of the month BeginningOfMonth = 1 // MidMonth harvest rewards that are claimed before the 15th at 14:00UTC of the month always vest on the 15 of the month MidMonth = 15 // PaymentHour harvest rewards always vest at 14:00UTC PaymentHour = 14 )
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 harvest module
func NewKeeper ¶
func NewKeeper(cdc *codec.Codec, key sdk.StoreKey, paramstore subspace.Subspace, ak types.AccountKeeper, sk types.SupplyKeeper, stk types.StakingKeeper) Keeper
NewKeeper creates a new keeper
func (Keeper) AddToClaim ¶
func (k Keeper) AddToClaim(ctx sdk.Context, owner sdk.AccAddress, depositDenom string, depositType types.DepositType, amountToAdd sdk.Coin)
AddToClaim adds the input amount to an existing claim or creates a new one
func (Keeper) ApplyDelegationRewards ¶
ApplyDelegationRewards iterates over each delegation object in the staking store and applies rewards according to the input delegation distribution schedule
func (Keeper) ApplyDepositRewards ¶
ApplyDepositRewards iterates over lp and gov deposits and updates the amount of rewards for each depositor
func (Keeper) ClaimReward ¶
func (k Keeper) ClaimReward(ctx sdk.Context, claimHolder sdk.AccAddress, receiver sdk.AccAddress, depositDenom string, depositType types.DepositType, multiplier types.MultiplierName) error
ClaimReward sends the reward amount to the reward owner and deletes the claim from the store
func (Keeper) DeleteClaim ¶
DeleteClaim deletes a claim from the store
func (Keeper) DeleteDeposit ¶
DeleteDeposit deletes a deposit from the store
func (Keeper) Deposit ¶
func (k Keeper) Deposit(ctx sdk.Context, depositor sdk.AccAddress, amount sdk.Coin, depositType types.DepositType) error
Deposit deposit
func (Keeper) GetClaim ¶
func (k Keeper) GetClaim(ctx sdk.Context, owner sdk.AccAddress, depositDenom string, depositType types.DepositType) (types.Claim, bool)
GetClaim returns a claim from the store for a particular claim owner, deposit denom, and deposit type
func (Keeper) GetDelegatorSchedule ¶
func (Keeper) GetDeposit ¶
func (k Keeper) GetDeposit(ctx sdk.Context, depositor sdk.AccAddress, denom string, depositType types.DepositType) (types.Deposit, bool)
GetDeposit returns a deposit from the store for a particular depositor address, deposit denom, and deposit type
func (Keeper) GetLPSchedule ¶
func (Keeper) GetPeriodLength ¶
GetPeriodLength returns the length of the period based on the input blocktime and multiplier note that pay dates are always the 1st or 15th of the month at 14:00UTC.
func (Keeper) GetPreviousBlockTime ¶
GetPreviousBlockTime get the blocktime for the previous block
func (Keeper) GetPreviousDelegatorDistribution ¶
func (k Keeper) GetPreviousDelegatorDistribution(ctx sdk.Context, denom string) (distTime time.Time, found bool)
GetPreviousDelegatorDistribution get the time of the previous delegator distribution
func (Keeper) GetTotalDeposited ¶
func (k Keeper) GetTotalDeposited(ctx sdk.Context, depositType types.DepositType, depositDenom string) (total sdk.Int)
GetTotalDeposited returns the total amount deposited for the input deposit type and deposit denom
func (Keeper) IterateClaims ¶
IterateClaims iterates over all claim objects in the store and performs a callback function
func (Keeper) IterateClaimsByTypeAndDenom ¶
func (k Keeper) IterateClaimsByTypeAndDenom(ctx sdk.Context, depositType types.DepositType, depositDenom string, cb func(claim types.Claim) (stop bool))
IterateClaimsByTypeAndDenom iterates over all claim objects in the store with the matching deposit type and deposit denom and performs a callback function
func (Keeper) IterateDeposits ¶
IterateDeposits iterates over all deposit objects in the store and performs a callback function
func (Keeper) IterateDepositsByTypeAndDenom ¶
func (k Keeper) IterateDepositsByTypeAndDenom(ctx sdk.Context, depositType types.DepositType, depositDenom string, cb func(deposit types.Deposit) (stop bool))
IterateDepositsByTypeAndDenom iterates over all deposit objects in the store with the matching deposit type and deposit denom and performs a callback function
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 stores the input claim in the store, prefixed by the deposit type, deposit denom, and owner address, in that order
func (Keeper) SetDeposit ¶
SetDeposit sets the input deposit in the store, prefixed by the deposit type, deposit denom, and depositor address, in that order
func (Keeper) SetPreviousBlockTime ¶
SetPreviousBlockTime set the time of the previous block
func (Keeper) SetPreviousDelegationDistribution ¶
func (k Keeper) SetPreviousDelegationDistribution(ctx sdk.Context, distTime time.Time, denom string)
SetPreviousDelegationDistribution set the time of the previous delegator distribution
func (Keeper) ShouldDistributeValidatorRewards ¶
ShouldDistributeValidatorRewards returns true if enough time has elapsed such that rewards should be distributed to delegators
func (Keeper) ValidateDeposit ¶
func (k Keeper) ValidateDeposit(ctx sdk.Context, amount sdk.Coin, depositType types.DepositType) error
ValidateDeposit validates a deposit
func (Keeper) ValidateLPDeposit ¶
func (k Keeper) ValidateLPDeposit(ctx sdk.Context, amount sdk.Coin, depositType types.DepositType) error
ValidateLPDeposit validates that a liquidity provider deposit