Documentation ¶
Overview ¶
nolint
Index ¶
- Constants
- Variables
- func BuildTokenKey(symbol string) []byte
- func ErrInvalidDecimal(codespace sdk.CodespaceType, msg string) sdk.Error
- func ErrInvalidMintAmount(codespace sdk.CodespaceType, msg string) sdk.Error
- func ErrInvalidTokenDescription(codespace sdk.CodespaceType, msg string) sdk.Error
- func ErrInvalidTokenSymbol(codespace sdk.CodespaceType, msg string) sdk.Error
- func ErrInvalidTotalSupply(codespace sdk.CodespaceType, msg string) sdk.Error
- func ErrNoInvalidTokenName(codespace sdk.CodespaceType, msg string) sdk.Error
- func ErrNotMintableToken(codespace sdk.CodespaceType, msg string) sdk.Error
- func ErrUnauthorizedMint(codespace sdk.CodespaceType, msg string) sdk.Error
- func RegisterCodec(cdc *codec.Codec)
- func ValidateToken(token *Token) error
- type CodeType
- type IssueMsg
- type MintMsg
- type Params
- type QueryTokensParams
- type SupplyKeeper
- type Token
- type TokenList
Constants ¶
View Source
const ( // module name ModuleName = "asset" // StoreKey is the store key string for asset StoreKey = ModuleName // RouterKey is the message route for asset RouterKey = ModuleName // QuerierRoute is the querier route for asset QuerierRoute = ModuleName )
View Source
const ( //todo refactor name IssueMsgType = "issueMsg" MintMsgType = "mintMsg" MaxTokenNameLength = 32 MaxTokenSymbolLength = 12 MinTokenSymbolLength = 3 MaxTokenDesLenLimit = 128 NewMaxTokenDesLenLimit = 1024 MaxTotalSupply int64 = 9000000000000000000 // int64 max value: 9,223,372,036,854,775,807 )
View Source
const ( DefaultQueryLimit = 100 QueryParams = "params" GetToken = "get" ListToken = "list" )
querier keys
Variables ¶
View Source
var ( EventTypeIssueToken = "issue_token" EventTypeMintToken = "mint_token" AttributeValueCategory = ModuleName )
Asset module event types
View Source
var ( TokenKeyPrefix = []byte{0x01} ParamStoreKeyMaxDecimal = []byte("MaxDecimal") )
View Source
var ( ParamKeyMaxDecimal = []byte("paramMaxDecimal") ParamKeyIssueFee = []byte("paramIssueFee") ParamKeyMintFee = []byte("paramMintFee") )
View Source
var ModuleCdc *codec.Codec
module codec
Functions ¶
func BuildTokenKey ¶
func ErrInvalidDecimal ¶
func ErrInvalidDecimal(codespace sdk.CodespaceType, msg string) sdk.Error
func ErrInvalidMintAmount ¶
func ErrInvalidMintAmount(codespace sdk.CodespaceType, msg string) sdk.Error
func ErrInvalidTokenDescription ¶
func ErrInvalidTokenDescription(codespace sdk.CodespaceType, msg string) sdk.Error
func ErrInvalidTokenSymbol ¶
func ErrInvalidTokenSymbol(codespace sdk.CodespaceType, msg string) sdk.Error
func ErrInvalidTotalSupply ¶
func ErrInvalidTotalSupply(codespace sdk.CodespaceType, msg string) sdk.Error
func ErrNoInvalidTokenName ¶
func ErrNoInvalidTokenName(codespace sdk.CodespaceType, msg string) sdk.Error
func ErrNotMintableToken ¶
func ErrNotMintableToken(codespace sdk.CodespaceType, msg string) sdk.Error
func ErrUnauthorizedMint ¶
func ErrUnauthorizedMint(codespace sdk.CodespaceType, msg string) sdk.Error
func ValidateToken ¶
Types ¶
type CodeType ¶
Local code type
const ( // Default asset codespace DefaultCodespace sdk.CodespaceType = ModuleName CodeInvalidTokenName CodeType = 101 CodeInvalidTokenSymbol CodeType = 102 CodeInvalidTotalSupply CodeType = 103 CodeInvalidDecimal CodeType = 104 CodeInvalidMintAmount CodeType = 105 CodeInvalidTokenDescription CodeType = 106 CodeNotMintableToken CodeType = 107 )
type IssueMsg ¶
type IssueMsg struct { From sdk.AccAddress `json:"from"` Name string `json:"name"` Symbol string `json:"symbol"` TotalSupply int64 `json:"total_supply"` Mintable bool `json:"mintable"` Decimal int8 `json:"decimal"` Description string `json:"description"` }
func NewIssueMsg ¶
func (IssueMsg) GetSignBytes ¶
func (IssueMsg) GetSigners ¶
func (msg IssueMsg) GetSigners() []sdk.AccAddress
func (IssueMsg) ValidateBasic ¶
type MintMsg ¶
type MintMsg struct { From sdk.AccAddress `json:"from"` Symbol string `json:"symbol"` Amount int64 `json:"amount"` }
func NewMintMsg ¶
func NewMintMsg(from sdk.AccAddress, symbol string, amount int64) MintMsg
func (MintMsg) GetSignBytes ¶
func (MintMsg) GetSigners ¶
func (msg MintMsg) GetSigners() []sdk.AccAddress
func (MintMsg) ValidateBasic ¶
type Params ¶
type Params struct { MaxDecimal int8 `json:"param_max_decimal"` IssueFee sdk.Coins `json:"param_issue_fee"` MintFee sdk.Coins `json:"param_mint_fee"` }
issue new assets parameters
func DefaultParams ¶
func DefaultParams() *Params
func (*Params) ParamSetPairs ¶
func (p *Params) ParamSetPairs() params.ParamSetPairs
Implements params.ParamSet
type QueryTokensParams ¶
type QueryTokensParams struct {
Page, Limit int
}
QueryTokensParams defines the params for the following queries: - 'custom/asset/list'
type SupplyKeeper ¶
type SupplyKeeper interface { GetModuleAddress(moduleName string) sdk.AccAddress GetModuleAccountAndPermissions(ctx sdk.Context, moduleName string) (supplyexported.ModuleAccountI, []string) GetModuleAccount(ctx sdk.Context, name string) supplyexported.ModuleAccountI SetModuleAccount(sdk.Context, supplyexported.ModuleAccountI) SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) sdk.Error SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) sdk.Error MintCoins(ctx sdk.Context, name string, amt sdk.Coins) sdk.Error }
SupplyKeeper defines the expected supply keeper
Click to show internal directories.
Click to hide internal directories.