Documentation ¶
Index ¶
- Constants
- func CalculateStakingAnnualPercentage(totalSupply, totalBonded sdkmath.Int, ...) sdkmath.LegacyDec
- func HandleCommunityCDPRepayDebtProposal(ctx sdk.Context, k Keeper, p *types.CommunityCDPRepayDebtProposal) error
- func HandleCommunityCDPWithdrawCollateralProposal(ctx sdk.Context, k Keeper, p *types.CommunityCDPWithdrawCollateralProposal) error
- func HandleCommunityPoolLendDepositProposal(ctx sdk.Context, k Keeper, p *types.CommunityPoolLendDepositProposal) error
- func HandleCommunityPoolLendWithdrawProposal(ctx sdk.Context, k Keeper, p *types.CommunityPoolLendWithdrawProposal) error
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- func NewQueryServerImpl(k Keeper) types.QueryServer
- type Keeper
- func (k Keeper) CheckAndDisableMintAndKavaDistInflation(ctx sdk.Context)
- func (k Keeper) DistributeFromCommunityPool(ctx sdk.Context, recipient sdk.AccAddress, amount sdk.Coins) error
- func (k Keeper) FundCommunityPool(ctx sdk.Context, sender sdk.AccAddress, amount sdk.Coins) error
- func (k Keeper) GetAuthority() sdk.AccAddress
- func (k Keeper) GetModuleAccountBalance(ctx sdk.Context) sdk.Coins
- func (k Keeper) GetParams(ctx sdk.Context) (types.Params, bool)
- func (k Keeper) GetStakingRewardsState(ctx sdk.Context) types.StakingRewardsState
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) PayoutAccumulatedStakingRewards(ctx sdk.Context)
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) SetStakingRewardsState(ctx sdk.Context, state types.StakingRewardsState)
- func (k Keeper) StartCommunityFundConsolidation(ctx sdk.Context) error
- type Migrator
Constants ¶
const SecondsPerYear = 365 * 24 * 3600
Variables ¶
This section is empty.
Functions ¶
func CalculateStakingAnnualPercentage ¶ added in v0.24.1
func CalculateStakingAnnualPercentage(totalSupply, totalBonded sdkmath.Int, inflationRate, communityTax, rewardsPerSecond sdkmath.LegacyDec) sdkmath.LegacyDec
CalculateStakingAnnualPercentage returns the annualized staking reward rate. It assumes that staking comes from one of two sources depending on if inflation is enabled or not.
func HandleCommunityCDPRepayDebtProposal ¶ added in v0.23.0
func HandleCommunityCDPRepayDebtProposal(ctx sdk.Context, k Keeper, p *types.CommunityCDPRepayDebtProposal) error
HandleCommunityCDPRepayDebtProposal is a handler for executing a passed community pool cdp repay debt proposal.
func HandleCommunityCDPWithdrawCollateralProposal ¶ added in v0.23.0
func HandleCommunityCDPWithdrawCollateralProposal( ctx sdk.Context, k Keeper, p *types.CommunityCDPWithdrawCollateralProposal, ) error
HandleCommunityCDPWithdrawCollateralProposal is a handler for executing a passed community pool cdp withdraw collateral proposal.
func HandleCommunityPoolLendDepositProposal ¶
func HandleCommunityPoolLendDepositProposal(ctx sdk.Context, k Keeper, p *types.CommunityPoolLendDepositProposal) error
HandleCommunityPoolLendDepositProposal is a handler for executing a passed community pool lend deposit proposal.
func HandleCommunityPoolLendWithdrawProposal ¶
func HandleCommunityPoolLendWithdrawProposal(ctx sdk.Context, k Keeper, p *types.CommunityPoolLendWithdrawProposal) error
HandleCommunityPoolLendWithdrawProposal is a handler for executing a passed community pool lend withdraw proposal.
func NewMsgServerImpl ¶
NewMsgServerImpl returns an implementation of the community MsgServer interface for the provided Keeper.
func NewQueryServerImpl ¶
func NewQueryServerImpl(k Keeper) types.QueryServer
NewQueryServerImpl creates a new server for handling gRPC queries.
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper of the community store
func NewKeeper ¶
func NewKeeper( cdc codec.Codec, key storetypes.StoreKey, ak types.AccountKeeper, bk types.BankKeeper, ck types.CdpKeeper, dk types.DistributionKeeper, hk types.HardKeeper, mk types.MintKeeper, kk types.KavadistKeeper, sk types.StakingKeeper, authority sdk.AccAddress, ) Keeper
NewKeeper creates a new community Keeper instance
func (Keeper) CheckAndDisableMintAndKavaDistInflation ¶ added in v0.25.0
CheckAndDisableMintAndKavaDistInflation compares the disable inflation time and block time, and disables inflation if time is set and before block time. Inflation time is reset, so this method is safe to call more than once.
func (Keeper) DistributeFromCommunityPool ¶
func (k Keeper) DistributeFromCommunityPool(ctx sdk.Context, recipient sdk.AccAddress, amount sdk.Coins) error
DistributeFromCommunityPool transfers coins from the community pool to recipient.
func (Keeper) FundCommunityPool ¶
FundCommunityPool transfers coins from the sender to the community module account.
func (Keeper) GetAuthority ¶ added in v0.25.0
func (k Keeper) GetAuthority() sdk.AccAddress
GetAuthority returns the x/community module's authority.
func (Keeper) GetModuleAccountBalance ¶
GetModuleAccountBalance returns all the coins held by the community module account
func (Keeper) GetStakingRewardsState ¶ added in v0.25.0
func (k Keeper) GetStakingRewardsState(ctx sdk.Context) types.StakingRewardsState
GetStakingRewardsState returns the staking reward state or the default state if not set
func (Keeper) PayoutAccumulatedStakingRewards ¶ added in v0.25.0
PayoutAccumulatedStakingRewards calculates and transfers taking rewards to the fee collector address
func (Keeper) SetStakingRewardsState ¶ added in v0.25.0
func (k Keeper) SetStakingRewardsState(ctx sdk.Context, state types.StakingRewardsState)
SetStakingRewardsState validates and sets the staking rewards state in the store
type Migrator ¶ added in v0.25.0
type Migrator struct {
// contains filtered or unexported fields
}
Migrator is a struct for handling in-place store migrations.
func NewMigrator ¶ added in v0.25.0
NewMigrator returns a new Migrator.