Documentation ¶
Index ¶
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- type Distributor
- type Emitter
- func (e Emitter) AddTotalEmission(ctx sdk.Context, emission sdk.Int)
- func (e Emitter) CirculationRate(ctx sdk.Context) sdk.Dec
- func (e Emitter) CirculationSupply(ctx sdk.Context) sdk.Int
- func (e Emitter) Emission(ctx sdk.Context) sdk.Int
- func (e Emitter) EmissionCompensation(ctx sdk.Context, emission sdk.Int) sdk.Int
- func (e Emitter) Emit(ctx sdk.Context) sdk.Int
- type Keeper
- func (k Keeper) AddTotalEmission(ctx sdk.Context, emission sdk.Int)
- func (k Keeper) CheckVeAttached(ctx sdk.Context, veID uint64) error
- func (k Keeper) DecVeAttached(ctx sdk.Context, veID uint64)
- func (k Keeper) DeleteLockedAmountByUser(ctx sdk.Context, veID uint64)
- func (k Keeper) DepositFor(ctx sdk.Context, sender sdk.AccAddress, veID uint64, amount sdk.Int, ...) error
- func (k Keeper) GetCheckpoint(ctx sdk.Context, epoch uint64) types.Checkpoint
- func (k Keeper) GetDistributionAccruedLastTimestamp(ctx sdk.Context) uint64
- func (k Keeper) GetDistributionClaimLastTimestampByUser(ctx sdk.Context, veID uint64) uint64
- func (k Keeper) GetDistributionPerPeriod(ctx sdk.Context, timestamp uint64) sdk.Int
- func (k Keeper) GetDistributionTotalAmount(ctx sdk.Context) sdk.Int
- func (k Keeper) GetEmissionAtLastPeriod(ctx sdk.Context) sdk.Int
- func (k Keeper) GetEmissionLastTimestamp(ctx sdk.Context) uint64
- func (k Keeper) GetEpoch(ctx sdk.Context) uint64
- func (k Keeper) GetLockedAmountByUser(ctx sdk.Context, veID uint64) types.LockedBalance
- func (k Keeper) GetNextVeID(ctx sdk.Context) uint64
- func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)
- func (k Keeper) GetSlopeChange(ctx sdk.Context, timestamp uint64) sdk.Int
- func (k Keeper) GetTotalEmission(ctx sdk.Context) sdk.Int
- func (k Keeper) GetTotalLockedAmount(ctx sdk.Context) sdk.Int
- func (k Keeper) GetTotalVotingPower(ctx sdk.Context, atTime uint64, atBlock int64) sdk.Int
- func (k Keeper) GetUserCheckpoint(ctx sdk.Context, veID uint64, epoch uint64) types.Checkpoint
- func (k Keeper) GetUserEpoch(ctx sdk.Context, veID uint64) uint64
- func (k Keeper) GetVeAttached(ctx sdk.Context, veID uint64) uint64
- func (k Keeper) GetVeVoted(ctx sdk.Context, veID uint64) bool
- func (k Keeper) GetVotingPower(ctx sdk.Context, veID uint64, atTime uint64, atBlock int64) sdk.Int
- func (k Keeper) HasNftClass(ctx sdk.Context) bool
- func (k Keeper) IncVeAttached(ctx sdk.Context, veID uint64)
- func (k Keeper) LockDenom(ctx sdk.Context) (res string)
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) Params(c context.Context, msg *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k Keeper) RegulateCheckpoint(ctx sdk.Context)
- func (k Keeper) RegulateUserCheckpoint(ctx sdk.Context, veID uint64, lockedOld types.LockedBalance, ...)
- func (k Keeper) SaveNftClass(ctx sdk.Context) error
- func (k Keeper) SetCheckpoint(ctx sdk.Context, epoch uint64, point types.Checkpoint)
- func (k Keeper) SetDistributionAccruedLastTimestamp(ctx sdk.Context, timestamp uint64)
- func (k Keeper) SetDistributionClaimLastTimestampByUser(ctx sdk.Context, veID uint64, timestamp uint64)
- func (k Keeper) SetDistributionPerPeriod(ctx sdk.Context, timestamp uint64, amount sdk.Int)
- func (k Keeper) SetDistributionTotalAmount(ctx sdk.Context, total sdk.Int)
- func (k Keeper) SetEmissionAtLastPeriod(ctx sdk.Context, emission sdk.Int)
- func (k Keeper) SetEmissionLastTimestamp(ctx sdk.Context, timestamp uint64)
- func (k Keeper) SetEpoch(ctx sdk.Context, epoch uint64)
- func (k Keeper) SetGetDelegatedAmountByUser(getDelegatedAmount func(ctx sdk.Context, veID uint64) sdk.Int)
- func (k Keeper) SetLockedAmountByUser(ctx sdk.Context, veID uint64, amount types.LockedBalance)
- func (k Keeper) SetNextVeID(ctx sdk.Context, nextVeID uint64)
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) SetSlopeChange(ctx sdk.Context, timestamp uint64, slopeChange sdk.Int)
- func (k Keeper) SetTotalEmission(ctx sdk.Context, total sdk.Int)
- func (k Keeper) SetTotalLockedAmount(ctx sdk.Context, amount sdk.Int)
- func (k Keeper) SetUserCheckpoint(ctx sdk.Context, veID uint64, epoch uint64, point types.Checkpoint)
- func (k Keeper) SetUserEpoch(ctx sdk.Context, veID uint64, epoch uint64)
- func (k Keeper) SetVeAttached(ctx sdk.Context, veID uint64, attached uint64)
- func (k Keeper) SetVeVoted(ctx sdk.Context, veID uint64, voted bool)
- func (k Keeper) SlashLockedAmountByUser(ctx sdk.Context, veID uint64, amount sdk.Int)
- func (k Keeper) TotalVotingPower(c context.Context, msg *types.QueryTotalVotingPowerRequest) (*types.QueryTotalVotingPowerResponse, error)
- func (k Keeper) VeNft(c context.Context, msg *types.QueryVeNftRequest) (*types.QueryVeNftResponse, error)
- func (k Keeper) VeNfts(c context.Context, msg *types.QueryVeNftsRequest) (*types.QueryVeNftsResponse, error)
- func (k Keeper) VotingPower(c context.Context, msg *types.QueryVotingPowerRequest) (*types.QueryVotingPowerResponse, error)
- type NftAppModule
- type NftKeeper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMsgServerImpl ¶
NewMsgServerImpl returns an implementation of the MsgServer interface for the provided Keeper.
Types ¶
type Distributor ¶
type Distributor struct {
// contains filtered or unexported fields
}
func NewDistributor ¶
func NewDistributor(keeper Keeper) Distributor
func (Distributor) DistributePerPeriod ¶
func (d Distributor) DistributePerPeriod(ctx sdk.Context)
type Emitter ¶
type Emitter struct {
// contains filtered or unexported fields
}
func NewEmitter ¶
func (Emitter) AddTotalEmission ¶
func (Emitter) EmissionCompensation ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper defines the ve module interface
func NewKeeper ¶
func NewKeeper( cdc codec.BinaryCodec, storeKey, memKey sdk.StoreKey, ps paramtypes.Subspace, accountKeeper types.AccountKeeper, bankKeeper types.BankKeeper, nftKeeper types.NftKeeper, ) *Keeper
NewKeeper creates a new ve Keeper instance
func (Keeper) AddTotalEmission ¶
func (Keeper) CheckVeAttached ¶
CheckVeAttached checks whether the ve has attached/voted
func (Keeper) DecVeAttached ¶
DecVeAttached decreases one for attached times of ve
func (Keeper) DeleteLockedAmountByUser ¶
DeleteLockedAmountByUser deletes locked amount of the specified ve
func (Keeper) DepositFor ¶
func (k Keeper) DepositFor(ctx sdk.Context, sender sdk.AccAddress, veID uint64, amount sdk.Int, unlockTime uint64, locked types.LockedBalance, sendCoins bool) error
DepositFor deposits some more amount and/or update locking end time for a veNFT.
veID: must be valid ve id amount: locked amount to add; can be zero if no more amount to deposit unlockTime: when unlocking; can be zero if no need to update locked: existing locked; may be zero if no existing locked sendCoins: false when extend time or merge
func (Keeper) GetCheckpoint ¶
func (Keeper) GetDistributionAccruedLastTimestamp ¶
func (Keeper) GetDistributionClaimLastTimestampByUser ¶
func (Keeper) GetDistributionPerPeriod ¶
func (Keeper) GetDistributionTotalAmount ¶
func (Keeper) GetEmissionAtLastPeriod ¶
func (Keeper) GetEmissionLastTimestamp ¶
func (Keeper) GetLockedAmountByUser ¶
GetLockedAmountByUser Gets locked amount of the specified ve
func (Keeper) GetNextVeID ¶
GetNextVeID gets the next ID for creating new ve
func (Keeper) GetSlopeChange ¶
func (Keeper) GetTotalLockedAmount ¶
GetTotalLockedAmount gets total locked amount
func (Keeper) GetTotalVotingPower ¶
func (Keeper) GetUserCheckpoint ¶
func (Keeper) GetVeAttached ¶
GetVeAttached gets the attached times of ve
func (Keeper) GetVeVoted ¶
GetVeVoted gets whether the ve has voted
func (Keeper) GetVotingPower ¶
func (Keeper) HasNftClass ¶
HasNftClass determines whether the NFT class of ve exist
func (Keeper) IncVeAttached ¶
IncVeAttached increases one for attached times of ve
func (Keeper) Params ¶
func (k Keeper) Params(c context.Context, msg *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
func (Keeper) RegulateCheckpoint ¶
func (Keeper) RegulateUserCheckpoint ¶
func (k Keeper) RegulateUserCheckpoint(ctx sdk.Context, veID uint64, lockedOld types.LockedBalance, lockedNew types.LockedBalance)
RegulateUserCheckpoint regulates user checkpoint. veID: must be valid ve id lockedOld:
Amount: can be zero End: can be expired or zero
lockedNew:
Amount: can be zero End: must be in the future or be zero
func (Keeper) SaveNftClass ¶
SaveNftClass saves the NFT class of ve into the nft module
func (Keeper) SetCheckpoint ¶
func (Keeper) SetDistributionAccruedLastTimestamp ¶
func (Keeper) SetDistributionClaimLastTimestampByUser ¶
func (Keeper) SetDistributionPerPeriod ¶
func (Keeper) SetDistributionTotalAmount ¶
func (Keeper) SetEmissionAtLastPeriod ¶
func (Keeper) SetEmissionLastTimestamp ¶
func (Keeper) SetGetDelegatedAmountByUser ¶
func (Keeper) SetLockedAmountByUser ¶
SetLockedAmountByUser sets locked amount of the specified ve
func (Keeper) SetNextVeID ¶
SetNextVeID sets the next ID for creating new ve
func (Keeper) SetSlopeChange ¶
func (Keeper) SetTotalLockedAmount ¶
SetTotalLockedAmount sets total locked amount
func (Keeper) SetUserCheckpoint ¶
func (Keeper) SetUserEpoch ¶
func (Keeper) SetVeAttached ¶
SetVeAttached sets the attached times of ve
func (Keeper) SetVeVoted ¶
SetVeVoted sets whether the ve has voted
func (Keeper) SlashLockedAmountByUser ¶
func (Keeper) TotalVotingPower ¶
func (k Keeper) TotalVotingPower(c context.Context, msg *types.QueryTotalVotingPowerRequest) (*types.QueryTotalVotingPowerResponse, error)
func (Keeper) VeNft ¶
func (k Keeper) VeNft(c context.Context, msg *types.QueryVeNftRequest) (*types.QueryVeNftResponse, error)
func (Keeper) VeNfts ¶
func (k Keeper) VeNfts(c context.Context, msg *types.QueryVeNftsRequest) (*types.QueryVeNftsResponse, error)
func (Keeper) VotingPower ¶
func (k Keeper) VotingPower(c context.Context, msg *types.QueryVotingPowerRequest) (*types.QueryVotingPowerResponse, error)
type NftAppModule ¶
func NewNftAppModule ¶
func NewNftAppModule(module nft.AppModule, keeper NftKeeper) NftAppModule
func (NftAppModule) RegisterServices ¶
func (am NftAppModule) RegisterServices(cfg module.Configurator)