Documentation ¶
Index ¶
- Constants
- Variables
- func ErrAccInBlackList(addr sdk.AccAddress) sdk.Error
- func ErrAddressForbiddenNotSupported(symbol string) sdk.Error
- func ErrCodeTokenInfoSealed(field string) sdk.Error
- func ErrDuplicateTokenSymbol(symbol string) sdk.Error
- func ErrInvalidForbiddenAddress() sdk.Error
- func ErrInvalidIssueOwner() sdk.Error
- func ErrInvalidSendLockAmt(amt string) sdk.Error
- func ErrInvalidTokenBurnAmt(amt string) sdk.Error
- func ErrInvalidTokenDescription(description string) sdk.Error
- func ErrInvalidTokenForbidden(symbol string) sdk.Error
- func ErrInvalidTokenIdentity(identity string) sdk.Error
- func ErrInvalidTokenInfo(field, val string) sdk.Error
- func ErrInvalidTokenMintAmt(amt string) sdk.Error
- func ErrInvalidTokenName(name string) sdk.Error
- func ErrInvalidTokenOwner(addr sdk.Address) sdk.Error
- func ErrInvalidTokenSupply(amt string) sdk.Error
- func ErrInvalidTokenSymbol(symbol string) sdk.Error
- func ErrInvalidTokenURL(url string) sdk.Error
- func ErrInvalidTokenUnForbidden(symbol string) sdk.Error
- func ErrInvalidTokenWhitelist() sdk.Error
- func ErrNeedTokenOwner(addr sdk.Address) sdk.Error
- func ErrNilForbiddenAddress() sdk.Error
- func ErrNilTokenIdentity() sdk.Error
- func ErrNilTokenOwner() sdk.Error
- func ErrNilTokenWhitelist() sdk.Error
- func ErrTokenBurnNotSupported(symbol string) sdk.Error
- func ErrTokenForbiddenNotSupported(symbol string) sdk.Error
- func ErrTokenMintNotSupported(symbol string) sdk.Error
- func ErrTokenNotFound(symbol string) sdk.Error
- func ErrTokenOwnerSelfForbidden() sdk.Error
- func ErrTransferSelfTokenOwner() sdk.Error
- func GetForbiddenAddrKeyPrefix(symbol string) []byte
- func GetForbiddenAddrKeyPrefixLength(symbol string) int
- func GetForbiddenAddrStoreKey(symbol string, addr sdk.AccAddress) []byte
- func GetReservedSymbols() []string
- func GetTokenStoreKey(symbol string) []byte
- func GetWhitelistKeyPrefix(symbol string) []byte
- func GetWhitelistKeyPrefixLength(symbol string) int
- func GetWhitelistStoreKey(symbol string, addr sdk.AccAddress) []byte
- func IsReservedSymbol(symbol string) bool
- func IsSuffixSymbol(symbol string) bool
- func NewTokenCoins(denom string, amount sdk.Int) sdk.Coins
- func RegisterCodec(cdc *codec.Codec)
- func ValidateTokenSymbol(symbol string) sdk.Error
- type BaseToken
- func (t BaseToken) GetAddrForbiddable() bool
- func (t BaseToken) GetBurnable() bool
- func (t BaseToken) GetDescription() string
- func (t BaseToken) GetIdentity() string
- func (t BaseToken) GetIsForbidden() bool
- func (t BaseToken) GetMintable() bool
- func (t *BaseToken) GetName() string
- func (t BaseToken) GetOwner() sdk.AccAddress
- func (t BaseToken) GetSendLock() sdk.Int
- func (t BaseToken) GetSymbol() string
- func (t BaseToken) GetTokenForbiddable() bool
- func (t BaseToken) GetTotalBurn() sdk.Int
- func (t BaseToken) GetTotalMint() sdk.Int
- func (t BaseToken) GetTotalSupply() sdk.Int
- func (t BaseToken) GetURL() string
- func (t *BaseToken) SetAddrForbiddable(enable bool)
- func (t *BaseToken) SetBurnable(enable bool)
- func (t *BaseToken) SetDescription(description string) sdk.Error
- func (t *BaseToken) SetIdentity(identity string) sdk.Error
- func (t *BaseToken) SetIsForbidden(enable bool)
- func (t *BaseToken) SetMintable(enable bool)
- func (t *BaseToken) SetName(name string) sdk.Error
- func (t *BaseToken) SetOwner(addr sdk.AccAddress) sdk.Error
- func (t *BaseToken) SetSendLock(amt sdk.Int) sdk.Error
- func (t *BaseToken) SetSymbol(symbol string) sdk.Error
- func (t *BaseToken) SetTokenForbiddable(enable bool)
- func (t *BaseToken) SetTotalBurn(amt sdk.Int) sdk.Error
- func (t *BaseToken) SetTotalMint(amt sdk.Int) sdk.Error
- func (t *BaseToken) SetTotalSupply(amt sdk.Int) sdk.Error
- func (t *BaseToken) SetURL(url string) sdk.Error
- func (t BaseToken) String() string
- func (t *BaseToken) Validate() sdk.Error
- type ExpectedBankxKeeper
- type ExpectedSupplyKeeper
- type GenesisState
- type MsgAddTokenWhitelist
- func (msg MsgAddTokenWhitelist) GetSignBytes() []byte
- func (msg MsgAddTokenWhitelist) GetSigners() []sdk.AccAddress
- func (msg MsgAddTokenWhitelist) Route() string
- func (msg *MsgAddTokenWhitelist) SetAccAddress(addr sdk.AccAddress)
- func (msg MsgAddTokenWhitelist) Type() string
- func (msg MsgAddTokenWhitelist) ValidateBasic() sdk.Error
- type MsgBurnToken
- type MsgForbidAddr
- type MsgForbidToken
- type MsgIssueToken
- type MsgMintToken
- type MsgModifyTokenInfo
- func (msg MsgModifyTokenInfo) GetSignBytes() []byte
- func (msg MsgModifyTokenInfo) GetSigners() []sdk.AccAddress
- func (msg MsgModifyTokenInfo) Route() string
- func (msg *MsgModifyTokenInfo) SetAccAddress(addr sdk.AccAddress)
- func (msg MsgModifyTokenInfo) Type() string
- func (msg MsgModifyTokenInfo) ValidateBasic() sdk.Error
- type MsgRemoveTokenWhitelist
- func (msg MsgRemoveTokenWhitelist) GetSignBytes() []byte
- func (msg MsgRemoveTokenWhitelist) GetSigners() []sdk.AccAddress
- func (msg MsgRemoveTokenWhitelist) Route() string
- func (msg *MsgRemoveTokenWhitelist) SetAccAddress(addr sdk.AccAddress)
- func (msg MsgRemoveTokenWhitelist) Type() string
- func (msg MsgRemoveTokenWhitelist) ValidateBasic() sdk.Error
- type MsgTransferOwnership
- func (msg MsgTransferOwnership) GetSignBytes() []byte
- func (msg MsgTransferOwnership) GetSigners() []sdk.AccAddress
- func (msg MsgTransferOwnership) Route() string
- func (msg *MsgTransferOwnership) SetAccAddress(addr sdk.AccAddress)
- func (msg MsgTransferOwnership) Type() string
- func (msg MsgTransferOwnership) ValidateBasic() sdk.Error
- type MsgUnForbidAddr
- func (msg MsgUnForbidAddr) GetSignBytes() []byte
- func (msg MsgUnForbidAddr) GetSigners() []sdk.AccAddress
- func (msg MsgUnForbidAddr) Route() string
- func (msg *MsgUnForbidAddr) SetAccAddress(addr sdk.AccAddress)
- func (msg MsgUnForbidAddr) Type() string
- func (msg MsgUnForbidAddr) ValidateBasic() sdk.Error
- type MsgUnForbidToken
- func (msg MsgUnForbidToken) GetSignBytes() []byte
- func (msg MsgUnForbidToken) GetSigners() []sdk.AccAddress
- func (msg MsgUnForbidToken) Route() string
- func (msg *MsgUnForbidToken) SetAccAddress(addr sdk.AccAddress)
- func (msg MsgUnForbidToken) Type() string
- func (msg MsgUnForbidToken) ValidateBasic() sdk.Error
- type Params
- type QueryForbiddenAddrParams
- type QueryTokenParams
- type QueryWhitelistParams
- type Token
Constants ¶
const ( CodeSpaceAsset sdk.CodespaceType = ModuleName // 501 ~ 599 CodeInvalidTokenName sdk.CodeType = 501 CodeInvalidTokenSymbol sdk.CodeType = 502 CodeInvalidTokenSupply sdk.CodeType = 503 CodeInvalidTokenOwner sdk.CodeType = 504 CodeInvalidTokenMintAmt sdk.CodeType = 505 CodeInvalidTokenBurnAmt sdk.CodeType = 506 CodeInvalidTokenForbidden sdk.CodeType = 507 CodeInvalidTokenUnForbidden sdk.CodeType = 508 CodeInvalidTokenWhitelist sdk.CodeType = 509 CodeInvalidForbiddenAddress sdk.CodeType = 510 CodeInvalidTokenURL sdk.CodeType = 511 CodeInvalidTokenDescription sdk.CodeType = 512 CodeTokenNotFound sdk.CodeType = 513 CodeDuplicateTokenSymbol sdk.CodeType = 514 CodeTransferSelfTokenOwner sdk.CodeType = 515 CodeNilTokenOwner sdk.CodeType = 516 CodeNeedTokenOwner sdk.CodeType = 517 CodeInvalidIssueOwner sdk.CodeType = 518 CodeTokenMintNotSupported sdk.CodeType = 519 CodeTokenBurnNotSupported sdk.CodeType = 520 CodeTokenForbiddenNotSupported sdk.CodeType = 521 CodeAddressForbiddenNotSupported sdk.CodeType = 522 CodeNilTokenWhitelist sdk.CodeType = 523 CodeNilForbiddenAddress sdk.CodeType = 524 CodeInvalidTokenIdentity sdk.CodeType = 526 CodeInvalidSendLockAmt sdk.CodeType = 527 CodeAddrInBlackList sdk.CodeType = 528 CodeNilTokenIdentity sdk.CodeType = 529 CodeTokenOwnerSelfForbidden sdk.CodeType = 530 CodeInvalidTokenInfo sdk.CodeType = 531 CodeTokenInfoSealed sdk.CodeType = 532 )
const ( AttributeValueCategory = ModuleName EventTypeIssueToken = "issue_token" EventTypeTransferOwnership = "transfer_ownership" EventTypeMintToken = "mint_token" EventTypeBurnToken = "burn_token" EventTypeForbidToken = "forbid_token" EventTypeUnForbidToken = "unforbid_token" EventTypeAddTokenWhitelist = "add_token_whitelist" EventTypeRemoveTokenWhitelist = "remove_token_whitelist" EventTypeForbidAddr = "forbid_addr" EventTypeUnForbidAddr = "unforbid_addr" EventTypeModifyTokenInfo = "modify_token_info" AttributeKeySymbol = "symbol" AttributeKeyTokenOwner = "owner" AttributeKeyOriginalOwner = "original_owner" AttributeKeyAmount = "amount" AttributeKeyAddrList = "address_list" AttributeKeyURL = "url" AttributeKeyDescription = "description" AttributeKeyIdentity = "identity" )
const ( // ModuleName is the name of the module ModuleName = "asset" // StoreKey is string representation of the store key for asset StoreKey = ModuleName // RouterKey is the message route for asset RouterKey = ModuleName // QuerierRoute is the querier route for asset QuerierRoute = ModuleName DefaultParamspace = ModuleName )
const ( MaxTokenAmount = 5e76 // 57896044618658097711785492504343953926634992332820282019728792003956564819967 DefaultIssue2CharTokenFee = 10000e8 // 10000 * 10^8 DefaultIssue3CharTokenFee = 1000e8 // 1000 * 10^8 DefaultIssue4CharTokenFee = 500e8 // 500 * 10^8 DefaultIssue5CharTokenFee = 200e8 // 200 * 10^8 DefaultIssue6CharTokenFee = 100e8 // 100 * 10^8 DefaultIssueLongTokenFee = 50e8 // 50 * 10^8 )
DefaultParamspace defines the default asset module parameter subspace
const ( QueryToken = "token-info" QueryTokenList = "token-list" QueryWhitelist = "token-whitelist" QueryForbiddenAddr = "addr-forbidden" QueryReservedSymbols = "reserved-symbols" QueryParameters = "parameters" )
query endpoints supported by the asset Querier
const ( MaxTokenIdentityLength = 3000 MaxTokenURLLength = 100 MaxTokenDescriptionLength = 1024 // constant used in flags to indicate that token info field should not be updated DoNotModifyTokenInfo = "[do-not-modify]" )
Variables ¶
var ( SeparateKey = []byte{0x3A} TokenKey = []byte{0x01} WhitelistKey = []byte{0x02} ForbiddenAddrKey = []byte{0x03} )
var ( KeyIssueTokenFee = []byte("IssueTokenFee") KeyIssueRareTokenFee = []byte("IssueRareTokenFee") KeyIssue3CharTokenFee = []byte("Issue3CharTokenFee") // DEX2 KeyIssue4CharTokenFee = []byte("Issue4CharTokenFee") // DEX2 KeyIssue5CharTokenFee = []byte("Issue5CharTokenFee") // DEX2 KeyIssue6CharTokenFee = []byte("Issue6CharTokenFee") // DEX2 )
Parameter keys
var ModuleCdc *codec.Codec
ModuleCdc wide codec
var TestIdentityString = "552A83BA62F9B1F8"
Functions ¶
func ErrAccInBlackList ¶
func ErrAccInBlackList(addr sdk.AccAddress) sdk.Error
func ErrCodeTokenInfoSealed ¶
func ErrDuplicateTokenSymbol ¶
func ErrInvalidIssueOwner ¶
func ErrInvalidSendLockAmt ¶
func ErrInvalidTokenBurnAmt ¶
func ErrInvalidTokenIdentity ¶
func ErrInvalidTokenInfo ¶
func ErrInvalidTokenMintAmt ¶
func ErrInvalidTokenName ¶
func ErrInvalidTokenSupply ¶
func ErrInvalidTokenSymbol ¶
func ErrInvalidTokenURL ¶
func ErrNilForbiddenAddress ¶
func ErrNilTokenIdentity ¶
func ErrNilTokenOwner ¶
func ErrNilTokenWhitelist ¶
func ErrTokenNotFound ¶
-----------------------------------------------------------------------------
func GetForbiddenAddrKeyPrefix ¶
GetForbiddenAddrKeyPrefix - ForbiddenAddrKey | Symbol | :
func GetForbiddenAddrKeyPrefixLength ¶
GetForbiddenAddrKeyPrefixLength - ForbiddenAddrKey length
func GetForbiddenAddrStoreKey ¶
func GetForbiddenAddrStoreKey(symbol string, addr sdk.AccAddress) []byte
GetForbiddenAddrStoreKey - ForbiddenAddrKey | Symbol | : | AccAddress
func GetReservedSymbols ¶
func GetReservedSymbols() []string
func GetTokenStoreKey ¶
GetTokenStoreKey - TokenKey | symbol
func GetWhitelistKeyPrefix ¶
GetWhitelistKeyPrefix - Prefix WhitelistKey | Symbol | :
func GetWhitelistKeyPrefixLength ¶
GetWhitelistKeyPrefixLength - WhitelistKey length
func GetWhitelistStoreKey ¶
func GetWhitelistStoreKey(symbol string, addr sdk.AccAddress) []byte
GetWhitelistStoreKey - WhitelistKey | Symbol | : | AccAddress
func IsReservedSymbol ¶
func IsSuffixSymbol ¶
func ValidateTokenSymbol ¶
Types ¶
type BaseToken ¶
type BaseToken struct { Name string `json:"name" yaml:"name"` // Name of the newly issued asset, limited to 32 unicode characters. Symbol string `json:"symbol" yaml:"symbol"` // token symbol, [a-z][a-z0-9]{1,7} TotalSupply sdk.Int `json:"total_supply" yaml:"total_supply"` // The total supply for this token [0] SendLock sdk.Int `json:"send_lock" yaml:"send_lock"` // The send lock amount Owner sdk.AccAddress `json:"owner" yaml:"owner"` // The initial issuer of this token Mintable bool `json:"mintable" yaml:"mintable"` // Whether this token could be minted after the issuing Burnable bool `json:"burnable" yaml:"burnable"` // Whether this token could be burned AddrForbiddable bool `json:"addr_forbiddable" yaml:"addr_forbiddable"` // whether could forbid some addresses to forbid transaction TokenForbiddable bool `json:"token_forbiddable" yaml:"token_forbiddable"` // whether token could be global forbid TotalBurn sdk.Int `json:"total_burn" yaml:"total_burn"` // Total amount of burn TotalMint sdk.Int `json:"total_mint" yaml:"total_mint"` // Total amount of mint IsForbidden bool `json:"is_forbidden" yaml:"is_forbidden"` // Whether token being forbidden currently URL string `json:"url" yaml:"url"` //URL of token website Description string `json:"description" yaml:"description"` //Description of token info Identity string `json:"identity" yaml:"identity"` //Identity of token }
BaseToken - a base Token structure.
func NewToken ¶
func NewToken(name string, symbol string, totalSupply sdk.Int, owner sdk.AccAddress, mintable bool, burnable bool, addrForbiddable bool, tokenForbiddable bool, url string, description string, identity string) (*BaseToken, sdk.Error)
NewToken - new base token
func (BaseToken) GetAddrForbiddable ¶
func (BaseToken) GetBurnable ¶
func (BaseToken) GetDescription ¶
func (BaseToken) GetIdentity ¶
func (BaseToken) GetIsForbidden ¶
func (BaseToken) GetMintable ¶
func (BaseToken) GetOwner ¶
func (t BaseToken) GetOwner() sdk.AccAddress
func (BaseToken) GetSendLock ¶
func (BaseToken) GetTokenForbiddable ¶
func (BaseToken) GetTotalBurn ¶
func (BaseToken) GetTotalMint ¶
func (BaseToken) GetTotalSupply ¶
func (*BaseToken) SetAddrForbiddable ¶
func (*BaseToken) SetBurnable ¶
func (*BaseToken) SetIsForbidden ¶
func (*BaseToken) SetMintable ¶
func (*BaseToken) SetTokenForbiddable ¶
type ExpectedBankxKeeper ¶
type ExpectedBankxKeeper interface { //DeductFee(ctx sdk.Context, addr sdk.AccAddress, amt sdk.Coins) sdk.Error DeductInt64CetFee(ctx sdk.Context, addr sdk.AccAddress, amt int64) sdk.Error AddCoins(ctx sdk.Context, addr sdk.AccAddress, amt sdk.Coins) sdk.Error SubtractCoins(ctx sdk.Context, addr sdk.AccAddress, amt sdk.Coins) sdk.Error GetTotalCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins BlacklistedAddr(addr sdk.AccAddress) bool }
Bankx Keeper will implement the interface
type ExpectedSupplyKeeper ¶
type ExpectedSupplyKeeper interface { MintCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) sdk.Error BurnCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) sdk.Error 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 }
Supply Keeper will implement the interface
type GenesisState ¶
type GenesisState struct { Params Params `json:"params" yaml:"params"` Tokens []Token `json:"tokens" yaml:"tokens"` Whitelist []string `json:"whitelist" yaml:"whitelist"` ForbiddenAddresses []string `json:"forbidden_addresses" yaml:"forbidden_addresses"` }
GenesisState - all asset state that must be provided at genesis
func DefaultGenesisState ¶
func DefaultGenesisState() GenesisState
DefaultGenesisState - Return a default genesis state
func NewGenesisState ¶
func NewGenesisState(params Params, tokens []Token, whitelist []string, forbiddenAddresses []string) GenesisState
NewGenesisState - Create a new genesis state
type MsgAddTokenWhitelist ¶
type MsgAddTokenWhitelist struct { Symbol string `json:"symbol" yaml:"symbol"` OwnerAddress sdk.AccAddress `json:"owner_address" yaml:"owner_address"` Whitelist []sdk.AccAddress `json:"whitelist" yaml:"whitelist"` }
MsgAddWhitelist
func NewMsgAddTokenWhitelist ¶
func NewMsgAddTokenWhitelist(symbol string, owner sdk.AccAddress, whitelist []sdk.AccAddress) MsgAddTokenWhitelist
func (MsgAddTokenWhitelist) GetSignBytes ¶
func (msg MsgAddTokenWhitelist) GetSignBytes() []byte
GetSignBytes Implements Msg.
func (MsgAddTokenWhitelist) GetSigners ¶
func (msg MsgAddTokenWhitelist) GetSigners() []sdk.AccAddress
GetSigners Implements Msg.
func (MsgAddTokenWhitelist) Route ¶
func (msg MsgAddTokenWhitelist) Route() string
Route Implements Msg.
func (*MsgAddTokenWhitelist) SetAccAddress ¶
func (msg *MsgAddTokenWhitelist) SetAccAddress(addr sdk.AccAddress)
func (MsgAddTokenWhitelist) Type ¶
func (msg MsgAddTokenWhitelist) Type() string
Type Implements Msg.
func (MsgAddTokenWhitelist) ValidateBasic ¶
func (msg MsgAddTokenWhitelist) ValidateBasic() sdk.Error
ValidateBasic Implements Msg.
type MsgBurnToken ¶
type MsgBurnToken struct { Symbol string `json:"symbol" yaml:"symbol"` Amount sdk.Int `json:"amount" yaml:"amount"` OwnerAddress sdk.AccAddress `json:"owner_address" yaml:"owner_address"` //token owner address }
MsgBurnToken
func NewMsgBurnToken ¶
func NewMsgBurnToken(symbol string, amt sdk.Int, owner sdk.AccAddress) MsgBurnToken
func (MsgBurnToken) GetSignBytes ¶
func (msg MsgBurnToken) GetSignBytes() []byte
GetSignBytes Implements Msg.
func (MsgBurnToken) GetSigners ¶
func (msg MsgBurnToken) GetSigners() []sdk.AccAddress
GetSigners Implements Msg.
func (*MsgBurnToken) SetAccAddress ¶
func (msg *MsgBurnToken) SetAccAddress(addr sdk.AccAddress)
func (MsgBurnToken) ValidateBasic ¶
func (msg MsgBurnToken) ValidateBasic() sdk.Error
ValidateBasic Implements Msg.
type MsgForbidAddr ¶
type MsgForbidAddr struct { Symbol string `json:"symbol" yaml:"symbol"` OwnerAddr sdk.AccAddress `json:"owner_address" yaml:"owner_address"` Addresses []sdk.AccAddress `json:"addresses" yaml:"addresses"` }
MsgForbidAddr
func NewMsgForbidAddr ¶
func NewMsgForbidAddr(symbol string, owner sdk.AccAddress, addresses []sdk.AccAddress) MsgForbidAddr
func (MsgForbidAddr) GetSignBytes ¶
func (msg MsgForbidAddr) GetSignBytes() []byte
GetSignBytes Implements Msg.
func (MsgForbidAddr) GetSigners ¶
func (msg MsgForbidAddr) GetSigners() []sdk.AccAddress
GetSigners Implements Msg.
func (*MsgForbidAddr) SetAccAddress ¶
func (msg *MsgForbidAddr) SetAccAddress(addr sdk.AccAddress)
func (MsgForbidAddr) ValidateBasic ¶
func (msg MsgForbidAddr) ValidateBasic() sdk.Error
ValidateBasic Implements Msg.
type MsgForbidToken ¶
type MsgForbidToken struct { Symbol string `json:"symbol" yaml:"symbol"` OwnerAddress sdk.AccAddress `json:"owner_address" yaml:"owner_address"` }
MsgForbidToken
func NewMsgForbidToken ¶
func NewMsgForbidToken(symbol string, owner sdk.AccAddress) MsgForbidToken
func (MsgForbidToken) GetSignBytes ¶
func (msg MsgForbidToken) GetSignBytes() []byte
GetSignBytes Implements Msg.
func (MsgForbidToken) GetSigners ¶
func (msg MsgForbidToken) GetSigners() []sdk.AccAddress
GetSigners Implements Msg.
func (*MsgForbidToken) SetAccAddress ¶
func (msg *MsgForbidToken) SetAccAddress(addr sdk.AccAddress)
func (MsgForbidToken) ValidateBasic ¶
func (msg MsgForbidToken) ValidateBasic() sdk.Error
ValidateBasic Implements Msg.
type MsgIssueToken ¶
type MsgIssueToken struct { Name string `json:"name" yaml:"name"` // Name of the newly issued asset, limited to 32 unicode characters Symbol string `json:"symbol" yaml:"symbol"` // token symbol, [a-z][a-z0-9]{1,7} TotalSupply sdk.Int `json:"total_supply" yaml:"total_supply"` // The total supply for this token [0] Owner sdk.AccAddress `json:"owner" yaml:"owner"` // The initial issuer of this token [1] Mintable bool `json:"mintable" yaml:"mintable"` // Whether this token could be minted after the issuing Burnable bool `json:"burnable" yaml:"burnable"` // Whether this token could be burned AddrForbiddable bool `json:"addr_forbiddable" yaml:"addr_forbiddable"` // whether could forbid some addresses to forbid transaction TokenForbiddable bool `json:"token_forbiddable" yaml:"token_forbiddable"` // whether token could be global forbid URL string `json:"url" yaml:"url"` //URL of token website Description string `json:"description" yaml:"description"` //Description of token info Identity string `json:"identity" yaml:"identity"` //Identity of token }
MsgIssueToken
func NewMsgIssueToken ¶
func NewMsgIssueToken(name string, symbol string, amt sdk.Int, owner sdk.AccAddress, mintable bool, burnable bool, addrForbiddable bool, tokenForbiddable bool, url string, description string, identity string) MsgIssueToken
NewMsgIssueToken
func (MsgIssueToken) GetSignBytes ¶
func (msg MsgIssueToken) GetSignBytes() []byte
GetSignBytes Implements Msg.
func (MsgIssueToken) GetSigners ¶
func (msg MsgIssueToken) GetSigners() []sdk.AccAddress
GetSigners Implements Msg.
func (*MsgIssueToken) SetAccAddress ¶
func (msg *MsgIssueToken) SetAccAddress(addr sdk.AccAddress)
func (MsgIssueToken) ValidateBasic ¶
func (msg MsgIssueToken) ValidateBasic() sdk.Error
ValidateBasic Implements Msg.
type MsgMintToken ¶
type MsgMintToken struct { Symbol string `json:"symbol" yaml:"symbol"` Amount sdk.Int `json:"amount" yaml:"amount"` OwnerAddress sdk.AccAddress `json:"owner_address" yaml:"owner_address"` }
MsgMintToken
func NewMsgMintToken ¶
func NewMsgMintToken(symbol string, amt sdk.Int, owner sdk.AccAddress) MsgMintToken
func (MsgMintToken) GetSignBytes ¶
func (msg MsgMintToken) GetSignBytes() []byte
GetSignBytes Implements Msg.
func (MsgMintToken) GetSigners ¶
func (msg MsgMintToken) GetSigners() []sdk.AccAddress
GetSigners Implements Msg.
func (*MsgMintToken) SetAccAddress ¶
func (msg *MsgMintToken) SetAccAddress(addr sdk.AccAddress)
func (MsgMintToken) ValidateBasic ¶
func (msg MsgMintToken) ValidateBasic() sdk.Error
ValidateBasic Implements Msg.
type MsgModifyTokenInfo ¶
type MsgModifyTokenInfo struct { Symbol string `json:"symbol" yaml:"symbol"` OwnerAddress sdk.AccAddress `json:"owner_address" yaml:"owner_address"` URL string `json:"url" yaml:"url"` Description string `json:"description" yaml:"description"` Identity string `json:"identity" yaml:"identity"` Name string `json:"name" yaml:"name"` TotalSupply string `json:"total_supply" yaml:"total_supply"` Mintable string `json:"mintable" yaml:"mintable"` Burnable string `json:"burnable" yaml:"burnable"` AddrForbiddable string `json:"addr_forbiddable" yaml:"addr_forbiddable"` TokenForbiddable string `json:"token_forbiddable" yaml:"token_forbiddable"` }
MsgModifyTokenInfo
func NewMsgModifyTokenInfo ¶
func NewMsgModifyTokenInfo(symbol, url, description, identity string, owner sdk.AccAddress, name, totalSupply, mintable, burnable, addrForbiddable, tokenForbiddable string) MsgModifyTokenInfo
func (MsgModifyTokenInfo) GetSignBytes ¶
func (msg MsgModifyTokenInfo) GetSignBytes() []byte
GetSignBytes Implements Msg.
func (MsgModifyTokenInfo) GetSigners ¶
func (msg MsgModifyTokenInfo) GetSigners() []sdk.AccAddress
GetSigners Implements Msg.
func (MsgModifyTokenInfo) Route ¶
func (msg MsgModifyTokenInfo) Route() string
Route Implements Msg.
func (*MsgModifyTokenInfo) SetAccAddress ¶
func (msg *MsgModifyTokenInfo) SetAccAddress(addr sdk.AccAddress)
func (MsgModifyTokenInfo) ValidateBasic ¶
func (msg MsgModifyTokenInfo) ValidateBasic() sdk.Error
ValidateBasic Implements Msg.
type MsgRemoveTokenWhitelist ¶
type MsgRemoveTokenWhitelist struct { Symbol string `json:"symbol" yaml:"symbol"` OwnerAddress sdk.AccAddress `json:"owner_address" yaml:"owner_address"` Whitelist []sdk.AccAddress `json:"whitelist" yaml:"whitelist"` }
MsgRemoveWhitelist
func NewMsgRemoveTokenWhitelist ¶
func NewMsgRemoveTokenWhitelist(symbol string, owner sdk.AccAddress, whitelist []sdk.AccAddress) MsgRemoveTokenWhitelist
func (MsgRemoveTokenWhitelist) GetSignBytes ¶
func (msg MsgRemoveTokenWhitelist) GetSignBytes() []byte
GetSignBytes Implements Msg.
func (MsgRemoveTokenWhitelist) GetSigners ¶
func (msg MsgRemoveTokenWhitelist) GetSigners() []sdk.AccAddress
GetSigners Implements Msg.
func (MsgRemoveTokenWhitelist) Route ¶
func (msg MsgRemoveTokenWhitelist) Route() string
Route Implements Msg.
func (*MsgRemoveTokenWhitelist) SetAccAddress ¶
func (msg *MsgRemoveTokenWhitelist) SetAccAddress(addr sdk.AccAddress)
func (MsgRemoveTokenWhitelist) Type ¶
func (msg MsgRemoveTokenWhitelist) Type() string
Type Implements Msg.
func (MsgRemoveTokenWhitelist) ValidateBasic ¶
func (msg MsgRemoveTokenWhitelist) ValidateBasic() sdk.Error
ValidateBasic Implements Msg.
type MsgTransferOwnership ¶
type MsgTransferOwnership struct { Symbol string `json:"symbol" yaml:"symbol"` OriginalOwner sdk.AccAddress `json:"original_owner" yaml:"original_owner"` NewOwner sdk.AccAddress `json:"new_owner" yaml:"new_owner"` }
MsgTransferOwnership
func NewMsgTransferOwnership ¶
func NewMsgTransferOwnership(symbol string, originalOwner sdk.AccAddress, newOwner sdk.AccAddress) MsgTransferOwnership
func (MsgTransferOwnership) GetSignBytes ¶
func (msg MsgTransferOwnership) GetSignBytes() []byte
GetSignBytes Implements Msg.
func (MsgTransferOwnership) GetSigners ¶
func (msg MsgTransferOwnership) GetSigners() []sdk.AccAddress
GetSigners Implements Msg.
func (MsgTransferOwnership) Route ¶
func (msg MsgTransferOwnership) Route() string
Route Implements Msg.
func (*MsgTransferOwnership) SetAccAddress ¶
func (msg *MsgTransferOwnership) SetAccAddress(addr sdk.AccAddress)
func (MsgTransferOwnership) Type ¶
func (msg MsgTransferOwnership) Type() string
Type Implements Msg.
func (MsgTransferOwnership) ValidateBasic ¶
func (msg MsgTransferOwnership) ValidateBasic() sdk.Error
ValidateBasic Implements Msg.
type MsgUnForbidAddr ¶
type MsgUnForbidAddr struct { Symbol string `json:"symbol" yaml:"symbol"` OwnerAddr sdk.AccAddress `json:"owner_address" yaml:"owner_address"` Addresses []sdk.AccAddress `json:"addresses" yaml:"addresses"` }
MsgUnForbidAddr
func NewMsgUnForbidAddr ¶
func NewMsgUnForbidAddr(symbol string, owner sdk.AccAddress, addresses []sdk.AccAddress) MsgUnForbidAddr
func (MsgUnForbidAddr) GetSignBytes ¶
func (msg MsgUnForbidAddr) GetSignBytes() []byte
GetSignBytes Implements Msg.
func (MsgUnForbidAddr) GetSigners ¶
func (msg MsgUnForbidAddr) GetSigners() []sdk.AccAddress
GetSigners Implements Msg.
func (*MsgUnForbidAddr) SetAccAddress ¶
func (msg *MsgUnForbidAddr) SetAccAddress(addr sdk.AccAddress)
func (MsgUnForbidAddr) ValidateBasic ¶
func (msg MsgUnForbidAddr) ValidateBasic() sdk.Error
ValidateBasic Implements Msg.
type MsgUnForbidToken ¶
type MsgUnForbidToken struct { Symbol string `json:"symbol" yaml:"symbol"` OwnerAddress sdk.AccAddress `json:"owner_address" yaml:"owner_address"` }
MsgUnForbidToken
func NewMsgUnForbidToken ¶
func NewMsgUnForbidToken(symbol string, owner sdk.AccAddress) MsgUnForbidToken
func (MsgUnForbidToken) GetSignBytes ¶
func (msg MsgUnForbidToken) GetSignBytes() []byte
GetSignBytes Implements Msg.
func (MsgUnForbidToken) GetSigners ¶
func (msg MsgUnForbidToken) GetSigners() []sdk.AccAddress
GetSigners Implements Msg.
func (*MsgUnForbidToken) SetAccAddress ¶
func (msg *MsgUnForbidToken) SetAccAddress(addr sdk.AccAddress)
func (MsgUnForbidToken) ValidateBasic ¶
func (msg MsgUnForbidToken) ValidateBasic() sdk.Error
ValidateBasic Implements Msg.
type Params ¶
type Params struct { // FeeParams define the rules according to which fee are charged. IssueTokenFee int64 `json:"issue_token_fee" yaml:"issue_token_fee"` // 7+ char IssueRareTokenFee int64 `json:"issue_rare_token_fee" yaml:"issue_rare_token_fee"` // 2 char Issue3CharTokenFee int64 `json:"issue_3char_token_fee" yaml:"issue_3char_token_fee"` // 3 char Issue4CharTokenFee int64 `json:"issue_4char_token_fee" yaml:"issue_4char_token_fee"` // 4 char Issue5CharTokenFee int64 `json:"issue_5char_token_fee" yaml:"issue_5char_token_fee"` // 5 char Issue6CharTokenFee int64 `json:"issue_6char_token_fee" yaml:"issue_6char_token_fee"` // 6 char }
Params defines the parameters for the asset module.
func (Params) GetIssueTokenFee ¶
func (*Params) ParamSetPairs ¶
func (p *Params) ParamSetPairs() params.ParamSetPairs
ParamSetPairs implements the ParamSet interface and returns all the key/value pairs pairs of asset module's parameters.
func (*Params) ValidateGenesis ¶
type QueryForbiddenAddrParams ¶
type QueryForbiddenAddrParams struct {
Symbol string
}
QueryForbiddenAddrParams defines the params for query: "custom/asset/addr-forbidden"
func NewQueryForbiddenAddrParams ¶
func NewQueryForbiddenAddrParams(s string) QueryForbiddenAddrParams
type QueryTokenParams ¶
type QueryTokenParams struct {
Symbol string
}
QueryTokenParams defines the params for query: "custom/asset/token-info"
func NewQueryAssetParams ¶
func NewQueryAssetParams(s string) QueryTokenParams
type QueryWhitelistParams ¶
type QueryWhitelistParams struct {
Symbol string
}
QueryWhitelistParams defines the params for query: "custom/asset/token-whitelist"
func NewQueryWhitelistParams ¶
func NewQueryWhitelistParams(s string) QueryWhitelistParams
type Token ¶
type Token interface { GetName() string SetName(string) sdk.Error GetSymbol() string SetSymbol(string) sdk.Error GetTotalSupply() sdk.Int SetTotalSupply(sdk.Int) sdk.Error GetSendLock() sdk.Int SetSendLock(sdk.Int) sdk.Error GetOwner() sdk.AccAddress SetOwner(sdk.AccAddress) sdk.Error GetMintable() bool SetMintable(bool) GetBurnable() bool SetBurnable(bool) GetAddrForbiddable() bool SetAddrForbiddable(bool) GetTokenForbiddable() bool SetTokenForbiddable(bool) GetTotalBurn() sdk.Int SetTotalBurn(sdk.Int) sdk.Error GetTotalMint() sdk.Int SetTotalMint(sdk.Int) sdk.Error GetIsForbidden() bool SetIsForbidden(bool) GetURL() string SetURL(string) sdk.Error GetDescription() string SetDescription(string) sdk.Error GetIdentity() string SetIdentity(string) sdk.Error Validate() sdk.Error // Ensure that token implements stringer String() string }
Token is an interface used to store asset at a given token within state. Many complex conditions can be used in the concrete struct which implements Token.