Documentation ¶
Index ¶
- Constants
- Variables
- func ParamKeyTable() params.KeyTable
- func RegisterCodec(cdc *codec.Codec)
- func ValidateMinter(minter Minter) error
- func ValidateParams(params Params) error
- type MintPlan
- type Minter
- func (m Minter) BlockProvision(params Params, totalMintedSupply sdk.Int) sdk.Coin
- func (m Minter) CurrentDayProvisions(totalSupply sdk.Int) sdk.Dec
- func (m Minter) NextPeriodDayProvisions(totalMintedSupply sdk.Int) sdk.Dec
- func (m Minter) NextPeroidStartTime(params Params, totalMintedSupply sdk.Int) int64
- func (m Minter) String() string
- type MsgBurn
- type MsgIssue
- type Params
- type StakingKeeper
- type Status
- type SupplyKeeper
Constants ¶
const ( EventTypeMint = ModuleName AttributeKeyCurrentDayProvisions = "current_day_provisions" AttributeKeyNextPeriodDayProvisions = "next_period_day_provisions" EventTypeTransfer = "burn" AttributeKeyRecipient = "recipient" AttributeKeySender = "burner" AttributeValueCategory = ModuleName )
Minting module event types
const ( // module name ModuleName = "mint" // default paramspace for params keeper DefaultParamspace = ModuleName // StoreKey is the default store key for mint StoreKey = ModuleName // QuerierRoute is the querier route for the minting store. QuerierRoute = StoreKey // Query endpoints supported by the minting querier QueryParameters = "parameters" QueryStatus = "status" QueryBonus = "bonus" )
nolint
const RouterKey = ModuleName
RouterKey is they name of the mint module
Variables ¶
var ( KeyMintDenom = []byte("MintDenom") KeyBlocksPerDay = []byte("BlocksPerDay") KeyMintStartTime = []byte("MintStartTime") )
Parameter store keys
var MinterKey = []byte{0x00}
the one key to use for the keeper store
var ModuleCdc *codec.Codec
module codec
Functions ¶
Types ¶
type MintPlan ¶
type MintPlan struct { Period int `json:"period" yaml:"period"` TotalPerPeriod sdk.Int `json:"total_per_period" yaml:"total_per_period"` TotalPerDay sdk.Int `json:"total_per_day" yaml:"total_per_day"` }
MintPlan output plan
type Minter ¶
type Minter struct { MintPlans []MintPlan `json:"mint_plans" yaml:"mint_plans"` // mint plan Status Status `json:"status" yaml:"status"` // mint status }
Minter represents the minting state.
func DefaultInitialMinter ¶
func DefaultInitialMinter() Minter
DefaultInitialMinter returns a default initial Minter object for a new chain
func InitialMinter ¶
InitialMinter returns an initial Minter object with a given inflation value.
func NewMinter ¶
NewMinter returns a new Minter object with the given inflation and annual provisions values.
func (Minter) BlockProvision ¶
BlockProvision returns the provisions for a block based on the MintPlans.
func (Minter) CurrentDayProvisions ¶
当日产量
func (Minter) NextPeriodDayProvisions ¶
NextPeriodProvisions returns the period provisions based on current total supply and mintplans. 下一次减产日产量
func (Minter) NextPeroidStartTime ¶
下一次减产时间多少秒之后
type MsgBurn ¶
type MsgBurn struct { FromAddress sdk.AccAddress `json:"from_address" yaml:"from_address"` Amount sdk.Coins `json:"amount" yaml:"amount"` }
MsgBurn - high level transaction of the coin module
func NewMsgBurn ¶
func NewMsgBurn(fromAddr sdk.AccAddress, amount sdk.Coins) MsgBurn
NewMsgSend - construct arbitrary multi-in, multi-out send msg.
func (MsgBurn) GetSigners ¶
func (msg MsgBurn) GetSigners() []sdk.AccAddress
GetSigners Implements Msg.
func (MsgBurn) ValidateBasic ¶
ValidateBasic Implements Msg.
type MsgIssue ¶
type MsgIssue struct { Sender sdk.AccAddress `json:"sender" yaml:"sender"` ToAddress sdk.AccAddress `json:"to_address" yaml:"to_address"` Amount sdk.Coins `json:"amount" yaml:"amount"` }
MsgIssue - high level transaction of the coin module
func NewMsgIssue ¶
func NewMsgIssue(sender sdk.AccAddress, toAddr sdk.AccAddress, amount sdk.Coins) MsgIssue
NewMsgIssue - construct arbitrary multi-in, multi-out issue msg.
func (MsgIssue) GetSignBytes ¶
GetSignBytes Implements Msg.
func (MsgIssue) GetSigners ¶
func (msg MsgIssue) GetSigners() []sdk.AccAddress
GetSigners Implements Msg.
func (MsgIssue) ValidateBasic ¶
ValidateBasic Implements Msg.
type Params ¶
type Params struct { MintDenom string `json:"mint_denom" yaml:"mint_denom"` // type of coin to mint BlocksPerDay uint64 `json:"blocks_per_day" yaml:"blocks_per_day""` // expected blocks per day MintStartTime int64 `json:"mint_start_time" yaml:"mint_start_time""` //mint proces start time }
mint parameters
func (*Params) ParamSetPairs ¶
func (p *Params) ParamSetPairs() params.ParamSetPairs
Implements params.ParamSet
type StakingKeeper ¶
StakingKeeper expected staking keeper (Validator and Delegator sets)
type Status ¶
type Status struct { TotalMintedSupply sdk.Int `json:"total_minted_supply" yaml:"total_minted_supply"` TotalMintingSupply sdk.Int `json:"total_minting_supply" yaml:"total_minting_supply"` TotalDistrSupply sdk.Int `json:"total_distr_supply" yaml:"total_distr_supply"` StatBurnCoins sdk.Coins `json:"stat_burn_coins" yaml:"stat_burn_coins"` CurrentDayProvisions sdk.Dec `json:"current_day_provisions" yaml:"current_day_provisions"` NextPeriodDayProvisions sdk.Dec `json:"next_period_day_provisions" yaml:"next_period_day_provisions"` NextPeroidStartTime int64 `json:"next_peroid_startTime" yaml:"next_peroid_startTime"` BlockProvision sdk.Coin `json:"block_provision" yaml:"block_provision"` }
type SupplyKeeper ¶
type SupplyKeeper interface { GetModuleAddress(name string) sdk.AccAddress GetSupply(sdk.Context) exported.SupplyI GetBalance(sdk.Context, sdk.AccAddress) sdk.Coins SetModuleAccount(sdk.Context, exported.ModuleAccountI) GetModuleAccount(sdk.Context, string) exported.ModuleAccountI SendCoinsFromAccountToModule(sdk.Context, sdk.AccAddress, string, sdk.Coins) sdk.Error SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) sdk.Error SendCoinsFromModuleToModule(ctx sdk.Context, senderModule, recipientModule string, amt sdk.Coins) sdk.Error MintCoins(ctx sdk.Context, name string, amt sdk.Coins) sdk.Error }
SupplyKeeper defines the expected supply keeper