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 MsgAddSysAddress
- type MsgAddressPermissions
- type MsgBurn
- type MsgConversionRate
- type MsgDestory
- type MsgIssue
- type MsgPermissions
- type MsgSupplement
- 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" // Power Denom PowerDenom = "ut" // Denom Begin DenomBegin = "u" // 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" QueryPermissions = "permissions" QuerySysAddress = "system-address" )
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 codecd
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 MsgAddSysAddress ¶ added in v0.6.2
type MsgAddSysAddress struct { FromAddress sdk.AccAddress `json:"from_address" yaml:"from_address"` Address sdk.AccAddress `json:"address" yaml:"address"` Command string `json:"command" yaml:"command"` }
MsgIssue - high level transaction of the coin module
func NewMsgAddSysAddress ¶ added in v0.6.2
func NewMsgAddSysAddress(FromAddress sdk.AccAddress, Address sdk.AccAddress, Command string) MsgAddSysAddress
NewMsgIssue - construct arbitrary multi-in, multi-out issue msg.
func (MsgAddSysAddress) GetSignBytes ¶ added in v0.6.2
func (msg MsgAddSysAddress) GetSignBytes() []byte
GetSignBytes Implements Msg.
func (MsgAddSysAddress) GetSigners ¶ added in v0.6.2
func (msg MsgAddSysAddress) GetSigners() []sdk.AccAddress
GetSigners Implements Msg.
func (MsgAddSysAddress) Route ¶ added in v0.6.2
func (msg MsgAddSysAddress) Route() string
Route Implements Msg.
func (MsgAddSysAddress) Type ¶ added in v0.6.2
func (msg MsgAddSysAddress) Type() string
Type Implements Msg.
func (MsgAddSysAddress) ValidateBasic ¶ added in v0.6.2
func (msg MsgAddSysAddress) ValidateBasic() sdk.Error
ValidateBasic Implements Msg.
type MsgAddressPermissions ¶ added in v0.6.2
type MsgAddressPermissions struct { Address sdk.AccAddress `json:"to_address" yaml:"to_address"` Command string `json:"command" yaml:"command"` Status int `json:"status" yaml:"status"` }
func (MsgAddressPermissions) String ¶ added in v0.6.2
func (Permissions MsgAddressPermissions) String() string
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 MsgConversionRate ¶
type MsgConversionRate struct { Fromaddress sdk.AccAddress `json:"from_address" yaml:"from_address"` Rate sdk.Coins `json:"amount" yaml:"amount"` }
func NewMsgConversionRate ¶
func NewMsgConversionRate(Fromaddress sdk.AccAddress, Rate sdk.Coins) MsgConversionRate
NewMsgSend - construct arbitrary multi-in, multi-out send msg.
func (MsgConversionRate) GetSignBytes ¶
func (msg MsgConversionRate) GetSignBytes() []byte
GetSignBytes Implements Msg.
func (MsgConversionRate) GetSigners ¶
func (msg MsgConversionRate) GetSigners() []sdk.AccAddress
GetSigners Implements Msg.
func (MsgConversionRate) ValidateBasic ¶
func (msg MsgConversionRate) ValidateBasic() sdk.Error
ValidateBasic Implements Msg.
type MsgDestory ¶
type MsgDestory struct { FromAddress sdk.AccAddress `json:"from_address" yaml:"from_address"` Amount sdk.Coins `json:"amount" yaml:"amount"` }
MsgDistory - high level transaction of the coin module
func NewMsgDestory ¶
func NewMsgDestory(fromAddr sdk.AccAddress, amount sdk.Coins) MsgDestory
NewMsgSend - construct arbitrary multi-in, multi-out send msg.
func (MsgDestory) GetSignBytes ¶
func (msg MsgDestory) GetSignBytes() []byte
GetSignBytes Implements Msg.
func (MsgDestory) GetSigners ¶
func (msg MsgDestory) GetSigners() []sdk.AccAddress
GetSigners Implements Msg.
func (MsgDestory) ValidateBasic ¶
func (msg MsgDestory) ValidateBasic() sdk.Error
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 MsgPermissions ¶ added in v0.6.2
type MsgPermissions struct { FromAddress sdk.AccAddress `json:"from_address" yaml:"from_address"` Permissions MsgAddressPermissions `json:"address_permissions" yaml:"address_permissions"` }
func NewMsgPermissions ¶ added in v0.6.2
func NewMsgPermissions(FromAddress sdk.AccAddress, ToAddress sdk.AccAddress, Command string, Status int) MsgPermissions
NewMsgSend - construct arbitrary multi-in, multi-out send msg.
func (MsgPermissions) GetSignBytes ¶ added in v0.6.2
func (msg MsgPermissions) GetSignBytes() []byte
GetSignBytes Implements Msg.
func (MsgPermissions) GetSigners ¶ added in v0.6.2
func (msg MsgPermissions) GetSigners() []sdk.AccAddress
GetSigners Implements Msg.
func (MsgPermissions) Route ¶ added in v0.6.2
func (msg MsgPermissions) Route() string
Route Implements Msg.
func (MsgPermissions) Type ¶ added in v0.6.2
func (msg MsgPermissions) Type() string
Type Implements Msg.
func (MsgPermissions) ValidateBasic ¶ added in v0.6.2
func (msg MsgPermissions) ValidateBasic() sdk.Error
ValidateBasic Implements Msg.
type MsgSupplement ¶ added in v0.6.3
type MsgSupplement struct { Sender sdk.AccAddress `json:"sender" yaml:"sender"` Amount sdk.Coins `json:"amount" yaml:"amount"` }
MsgIssue - high level transaction of the coin module
func NewMsgSupplement ¶ added in v0.6.3
func NewMsgSupplement(sender sdk.AccAddress, amount sdk.Coins) MsgSupplement
NewMsgIssue - construct arbitrary multi-in, multi-out issue msg.
func (MsgSupplement) GetSignBytes ¶ added in v0.6.3
func (msg MsgSupplement) GetSignBytes() []byte
GetSignBytes Implements Msg.
func (MsgSupplement) GetSigners ¶ added in v0.6.3
func (msg MsgSupplement) GetSigners() []sdk.AccAddress
GetSigners Implements Msg.
func (MsgSupplement) Route ¶ added in v0.6.3
func (msg MsgSupplement) Route() string
Route Implements Msg.
func (MsgSupplement) Type ¶ added in v0.6.3
func (msg MsgSupplement) Type() string
Type Implements Msg.
func (MsgSupplement) ValidateBasic ¶ added in v0.6.3
func (msg MsgSupplement) ValidateBasic() sdk.Error
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"` TotalCirculationSupply sdk.Int `json:"total_circulation_supply" yaml:"total_circulation_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"` BurnAmount sdk.Coins `json:"burn_amount" yaml:"burn_amount"` DestoryAmount sdk.Coins `json:"destory_amount" yaml:"destory_amount"` ConversionRates sdk.Coins `json:"conversion_rates" yaml:"conversion_rates"` }
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