types

package
v0.6.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 3, 2020 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventTypeMint = ModuleName

	AttributeKeyCurrentDayProvisions    = "current_day_provisions"
	AttributeKeyNextPeriodDayProvisions = "next_period_day_provisions"

	EventTypeTransfer = "burn"

	AttributeKeyRecipient = "recipient"
	AttributeKeySender    = "burner"

	AttributeValueCategory = ModuleName
)

Minting module event types

View Source
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

View Source
const RouterKey = ModuleName

RouterKey is they name of the mint module

Variables

View Source
var (
	KeyMintDenom     = []byte("MintDenom")
	KeyBlocksPerDay  = []byte("BlocksPerDay")
	KeyMintStartTime = []byte("MintStartTime")
)

Parameter store keys

View Source
var MinterKey = []byte{0x00}

the one key to use for the keeper store

View Source
var ModuleCdc *codec.Codec

module codecd

Functions

func ParamKeyTable

func ParamKeyTable() params.KeyTable

ParamTable for minting module.

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

Register concrete types on codec codec

func ValidateMinter

func ValidateMinter(minter Minter) error

validate minter

func ValidateParams

func ValidateParams(params Params) error

validate params

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

func DefaultMintPlans

func DefaultMintPlans() []MintPlan

DefaultMintPlans create

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

func InitialMinter(mintPlans []MintPlan) Minter

InitialMinter returns an initial Minter object with a given inflation value.

func NewMinter

func NewMinter(mintPlans []MintPlan) Minter

NewMinter returns a new Minter object with the given inflation and annual provisions values.

func (Minter) BlockProvision

func (m Minter) BlockProvision(params Params, totalMintedSupply sdk.Int) sdk.Coin

BlockProvision returns the provisions for a block based on the MintPlans.

func (Minter) CurrentDayProvisions

func (m Minter) CurrentDayProvisions(totalSupply sdk.Int) sdk.Dec

当日产量

func (Minter) NextPeriodDayProvisions

func (m Minter) NextPeriodDayProvisions(totalMintedSupply sdk.Int) sdk.Dec

NextPeriodProvisions returns the period provisions based on current total supply and mintplans. 下一次减产日产量

func (Minter) NextPeroidStartTime

func (m Minter) NextPeroidStartTime(params Params, totalMintedSupply sdk.Int) int64

下一次减产时间多少秒之后

func (Minter) String

func (m Minter) String() string

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) GetSignBytes

func (msg MsgBurn) GetSignBytes() []byte

GetSignBytes Implements Msg.

func (MsgBurn) GetSigners

func (msg MsgBurn) GetSigners() []sdk.AccAddress

GetSigners Implements Msg.

func (MsgBurn) Route

func (msg MsgBurn) Route() string

Route Implements Msg.

func (MsgBurn) Type

func (msg MsgBurn) Type() string

Type Implements Msg.

func (MsgBurn) ValidateBasic

func (msg MsgBurn) ValidateBasic() sdk.Error

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) Route

func (msg MsgConversionRate) Route() string

Route Implements Msg.

func (MsgConversionRate) Type

func (msg MsgConversionRate) Type() string

Type 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) Route

func (msg MsgDestory) Route() string

Route Implements Msg.

func (MsgDestory) Type

func (msg MsgDestory) Type() string

Type 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

func (msg MsgIssue) GetSignBytes() []byte

GetSignBytes Implements Msg.

func (MsgIssue) GetSigners

func (msg MsgIssue) GetSigners() []sdk.AccAddress

GetSigners Implements Msg.

func (MsgIssue) Route

func (msg MsgIssue) Route() string

Route Implements Msg.

func (MsgIssue) Type

func (msg MsgIssue) Type() string

Type Implements Msg.

func (MsgIssue) ValidateBasic

func (msg MsgIssue) ValidateBasic() sdk.Error

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 DefaultParams

func DefaultParams() Params

default minting module parameters

func NewParams

func NewParams(mintDenom string, blocksPerDay uint64, mintStartTime int64) Params

func (*Params) ParamSetPairs

func (p *Params) ParamSetPairs() params.ParamSetPairs

Implements params.ParamSet

func (Params) String

func (p Params) String() string

type StakingKeeper

type StakingKeeper interface {
	BondDenom(sdk.Context) string
}

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL