Documentation
¶
Index ¶
- Constants
- Variables
- func ErrorDuplicateTokenSymbol(fmt string) sdk.Error
- func ErrorInvalidAddress(fmt string) sdk.Error
- func ErrorInvalidTokenBurn(fmt string) sdk.Error
- func ErrorInvalidTokenDescription(fmt string) sdk.Error
- func ErrorInvalidTokenForbidden(fmt string) sdk.Error
- func ErrorInvalidTokenMint(fmt string) sdk.Error
- func ErrorInvalidTokenName(fmt string) sdk.Error
- func ErrorInvalidTokenOwner(fmt string) sdk.Error
- func ErrorInvalidTokenSupply(fmt string) sdk.Error
- func ErrorInvalidTokenSymbol(fmt string) sdk.Error
- func ErrorInvalidTokenURL(fmt string) sdk.Error
- func ErrorInvalidTokenWhitelist(fmt string) sdk.Error
- func ErrorTokenNotFound(fmt string) sdk.Error
- func InitGenesis(ctx sdk.Context, keeper BaseKeeper, data GenesisState)
- func NewHandler(keeper Keeper) sdk.Handler
- func NewQuerier(keeper ViewKeeper, cdc *codec.Codec) sdk.Querier
- func ParamKeyTable() params.KeyTable
- func PrefixAddrStoreKey(prefix []byte, symbol string, addr sdk.AccAddress) []byte
- func RegisterCodec(cdc *codec.Codec)
- func TokenStoreKey(symbol string) []byte
- func ValidateTokenSymbol(symbol string) error
- type BaseKeeper
- func (keeper BaseKeeper) AddToken(ctx sdk.Context, addr sdk.AccAddress, amt sdk.Coins) sdk.Error
- func (keeper BaseKeeper) AddTokenWhitelist(ctx sdk.Context, symbol string, owner sdk.AccAddress, ...) sdk.Error
- func (keeper BaseKeeper) BurnToken(ctx sdk.Context, symbol string, owner sdk.AccAddress, amount int64) sdk.Error
- func (keeper BaseKeeper) DeductFee(ctx sdk.Context, addr sdk.AccAddress, amt sdk.Coins) sdk.Error
- func (keeper BaseKeeper) ForbidAddress(ctx sdk.Context, symbol string, owner sdk.AccAddress, ...) sdk.Error
- func (keeper BaseKeeper) ForbidToken(ctx sdk.Context, symbol string, owner sdk.AccAddress) sdk.Error
- func (keeper BaseKeeper) GetParams(ctx sdk.Context) (params Params)
- func (keeper BaseKeeper) IssueToken(ctx sdk.Context, name string, symbol string, totalSupply int64, ...) sdk.Error
- func (keeper BaseKeeper) MintToken(ctx sdk.Context, symbol string, owner sdk.AccAddress, amount int64) sdk.Error
- func (keeper BaseKeeper) ModifyTokenDescription(ctx sdk.Context, symbol string, owner sdk.AccAddress, description string) sdk.Error
- func (keeper BaseKeeper) ModifyTokenURL(ctx sdk.Context, symbol string, owner sdk.AccAddress, url string) sdk.Error
- func (keeper BaseKeeper) RemoveTokenWhitelist(ctx sdk.Context, symbol string, owner sdk.AccAddress, ...) sdk.Error
- func (keeper BaseKeeper) SetParams(ctx sdk.Context, params Params)
- func (keeper BaseKeeper) SubtractToken(ctx sdk.Context, addr sdk.AccAddress, amt sdk.Coins) sdk.Error
- func (keeper BaseKeeper) TransferOwnership(ctx sdk.Context, symbol string, originalOwner sdk.AccAddress, ...) sdk.Error
- func (keeper BaseKeeper) UnForbidAddress(ctx sdk.Context, symbol string, owner sdk.AccAddress, ...) sdk.Error
- func (keeper BaseKeeper) UnForbidToken(ctx sdk.Context, symbol string, owner sdk.AccAddress) sdk.Error
- type BaseToken
- func (t BaseToken) GetAddrForbiddable() bool
- func (t BaseToken) GetBurnable() bool
- func (t BaseToken) GetDescription() string
- func (t BaseToken) GetIsForbidden() bool
- func (t BaseToken) GetMintable() bool
- func (t BaseToken) GetOwner() sdk.AccAddress
- func (t BaseToken) GetSymbol() string
- func (t BaseToken) GetTokenForbiddable() bool
- func (t BaseToken) GetTotalBurn() int64
- func (t BaseToken) GetTotalMint() int64
- func (t BaseToken) GetTotalSupply() int64
- func (t BaseToken) GetURL() string
- func (t *BaseToken) SetAddrForbiddable(enable bool)
- func (t *BaseToken) SetBurnable(enable bool)
- func (t *BaseToken) SetDescription(description string) error
- func (t *BaseToken) SetIsForbidden(enable bool)
- func (t *BaseToken) SetMintable(enable bool)
- func (t *BaseToken) SetName(name string) error
- func (t *BaseToken) SetOwner(addr sdk.AccAddress) error
- func (t *BaseToken) SetSymbol(symbol string) error
- func (t *BaseToken) SetTokenForbiddable(enable bool)
- func (t *BaseToken) SetTotalBurn(amt int64) error
- func (t *BaseToken) SetTotalMint(amt int64) error
- func (t *BaseToken) SetTotalSupply(amt int64) error
- func (t *BaseToken) SetURL(url string) error
- func (t BaseToken) String() string
- func (t *BaseToken) Validate() error
- type BaseTokenKeeper
- func (keeper BaseTokenKeeper) IsForbiddenByTokenIssuer(ctx sdk.Context, symbol string, addr sdk.AccAddress) bool
- func (keeper BaseTokenKeeper) IsTokenExists(ctx sdk.Context, symbol string) bool
- func (keeper BaseTokenKeeper) IsTokenForbidden(ctx sdk.Context, symbol string) bool
- func (keeper BaseTokenKeeper) IsTokenIssuer(ctx sdk.Context, symbol string, addr sdk.AccAddress) bool
- type BaseViewKeeper
- func (keeper BaseViewKeeper) ExportAddrKeys(ctx sdk.Context, prefix []byte) []string
- func (keeper BaseViewKeeper) GetAllTokens(ctx sdk.Context) []Token
- func (keeper BaseViewKeeper) GetForbiddenAddresses(ctx sdk.Context, symbol string) []sdk.AccAddress
- func (keeper BaseViewKeeper) GetReservedSymbols() []string
- func (keeper BaseViewKeeper) GetToken(ctx sdk.Context, symbol string) Token
- func (keeper BaseViewKeeper) GetWhitelist(ctx sdk.Context, symbol string) []sdk.AccAddress
- type ExpectedBankxKeeper
- type GenesisState
- type Keeper
- type MsgAddTokenWhitelist
- type MsgBurnToken
- type MsgForbidAddr
- type MsgForbidToken
- type MsgIssueToken
- type MsgMintToken
- type MsgModifyTokenDescription
- type MsgModifyTokenURL
- type MsgRemoveTokenWhitelist
- type MsgTransferOwnership
- type MsgUnForbidAddr
- type MsgUnForbidToken
- type Params
- type QueryForbiddenAddrParams
- type QueryTokenParams
- type QueryWhitelistParams
- type Token
- type TokenKeeper
- type ViewKeeper
Constants ¶
const ( CodeSpaceAsset sdk.CodespaceType = ModuleName // 501 ~ 599 CodeInvalidTokenName sdk.CodeType = 501 CodeInvalidTokenSymbol sdk.CodeType = 502 CodeInvalidTokenSupply sdk.CodeType = 503 CodeInvalidTokenOwner sdk.CodeType = 504 CodeTokenNotFound sdk.CodeType = 505 CodeInvalidTotalMint sdk.CodeType = 506 CodeInvalidTotalBurn sdk.CodeType = 507 CodeDuplicateTokenSymbol sdk.CodeType = 508 CodeInvalidTokenForbidden sdk.CodeType = 509 CodeInvalidTokenWhitelist sdk.CodeType = 510 CodeInvalidAddress sdk.CodeType = 511 CodeInvalidTokenURL sdk.CodeType = 512 CodeInvalidTokenDescription sdk.CodeType = 513 )
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 MaxTokenAmount = 9E18 // 90 billion * 10 ^ 8 RareSymbolLength = 2 IssueTokenFee = 1E12 // 10000 * 10 ^8 IssueRareTokenFee = 1E13 // 100000 * 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" )
query endpoints supported by the asset Querier
Variables ¶
var ( SeparateKeyPrefix = []byte{0x3A} TokenStoreKeyPrefix = []byte{0x01} WhitelistKeyPrefix = []byte{0x02} ForbiddenAddrKeyPrefix = []byte{0x03} )
var ( KeyIssueTokenFee = []byte("IssueTokenFee") KeyIssueRareTokenFee = []byte("IssueRareTokenFee") )
Parameter keys
var ( // TokenSymbolRegex : Token symbol can be 2 ~ 8 characters long. TokenSymbolRegex = regexp.MustCompile("^[a-z][a-z0-9]{1,7}$") )
Functions ¶
func ErrorInvalidAddress ¶
func ErrorInvalidTokenBurn ¶
func ErrorInvalidTokenMint ¶
func ErrorInvalidTokenName ¶
func ErrorInvalidTokenOwner ¶
func ErrorInvalidTokenSupply ¶
func ErrorInvalidTokenSymbol ¶
func ErrorInvalidTokenURL ¶
func ErrorTokenNotFound ¶
func InitGenesis ¶
func InitGenesis(ctx sdk.Context, keeper BaseKeeper, data GenesisState)
InitGenesis - Init store state from genesis data
func NewHandler ¶
NewHandler returns a handler for "asset" type messages.
func NewQuerier ¶
func NewQuerier(keeper ViewKeeper, cdc *codec.Codec) sdk.Querier
NewQuerier - creates a querier for asset REST endpoints
func PrefixAddrStoreKey ¶
func PrefixAddrStoreKey(prefix []byte, symbol string, addr sdk.AccAddress) []byte
PrefixAddrStoreKey - new KEY prefix | Symbol: | AccAddress
func TokenStoreKey ¶
TokenStoreKey turn token symbol to KEY prefix | symbol .
func ValidateTokenSymbol ¶
Types ¶
type BaseKeeper ¶
type BaseKeeper struct { BaseTokenKeeper // contains filtered or unexported fields }
BaseKeeper encodes/decodes tokens using the go-amino (binary) encoding/decoding library.
func NewBaseKeeper ¶
func NewBaseKeeper(cdc *codec.Codec, key sdk.StoreKey, paramStore params.Subspace, bkx ExpectedBankxKeeper, sk *staking.Keeper) BaseKeeper
NewBaseKeeper returns a new BaseKeeper that uses go-amino to (binary) encode and decode concrete Token.
func (BaseKeeper) AddToken ¶
func (keeper BaseKeeper) AddToken(ctx sdk.Context, addr sdk.AccAddress, amt sdk.Coins) sdk.Error
AddToken - add token to addr when issue token and mint token etc.
func (BaseKeeper) AddTokenWhitelist ¶
func (keeper BaseKeeper) AddTokenWhitelist(ctx sdk.Context, symbol string, owner sdk.AccAddress, whitelist []sdk.AccAddress) sdk.Error
AddTokenWhitelist - add token forbidden whitelist
func (BaseKeeper) BurnToken ¶
func (keeper BaseKeeper) BurnToken(ctx sdk.Context, symbol string, owner sdk.AccAddress, amount int64) sdk.Error
BurnToken - burn token
func (BaseKeeper) DeductFee ¶
func (keeper BaseKeeper) DeductFee(ctx sdk.Context, addr sdk.AccAddress, amt sdk.Coins) sdk.Error
DeductFee - deduct asset func fee like issueFee
func (BaseKeeper) ForbidAddress ¶
func (keeper BaseKeeper) ForbidAddress(ctx sdk.Context, symbol string, owner sdk.AccAddress, addresses []sdk.AccAddress) sdk.Error
ForbidAddress - add forbidden addresses
func (BaseKeeper) ForbidToken ¶
func (keeper BaseKeeper) ForbidToken(ctx sdk.Context, symbol string, owner sdk.AccAddress) sdk.Error
ForbidToken - forbid token
func (BaseKeeper) GetParams ¶
func (keeper BaseKeeper) GetParams(ctx sdk.Context) (params Params)
GetParams gets the asset module's parameters.
func (BaseKeeper) IssueToken ¶
func (keeper BaseKeeper) IssueToken(ctx sdk.Context, name string, symbol string, totalSupply int64, owner sdk.AccAddress, mintable bool, burnable bool, addrForbiddable bool, tokenForbiddable bool, url string, description string) sdk.Error
IssueToken - new token and store it
func (BaseKeeper) MintToken ¶
func (keeper BaseKeeper) MintToken(ctx sdk.Context, symbol string, owner sdk.AccAddress, amount int64) sdk.Error
MintToken - mint token
func (BaseKeeper) ModifyTokenDescription ¶
func (keeper BaseKeeper) ModifyTokenDescription(ctx sdk.Context, symbol string, owner sdk.AccAddress, description string) sdk.Error
ModifyTokenURL - modify token url property
func (BaseKeeper) ModifyTokenURL ¶
func (keeper BaseKeeper) ModifyTokenURL(ctx sdk.Context, symbol string, owner sdk.AccAddress, url string) sdk.Error
ModifyTokenURL - modify token url property
func (BaseKeeper) RemoveTokenWhitelist ¶
func (keeper BaseKeeper) RemoveTokenWhitelist(ctx sdk.Context, symbol string, owner sdk.AccAddress, whitelist []sdk.AccAddress) sdk.Error
RemoveTokenWhitelist - remove token forbidden whitelist
func (BaseKeeper) SetParams ¶
func (keeper BaseKeeper) SetParams(ctx sdk.Context, params Params)
SetParams sets the asset module's parameters.
func (BaseKeeper) SubtractToken ¶ added in v0.0.2
func (keeper BaseKeeper) SubtractToken(ctx sdk.Context, addr sdk.AccAddress, amt sdk.Coins) sdk.Error
SubtractToken - sub token to addr when burn token etc.
func (BaseKeeper) TransferOwnership ¶
func (keeper BaseKeeper) TransferOwnership(ctx sdk.Context, symbol string, originalOwner sdk.AccAddress, newOwner sdk.AccAddress) sdk.Error
TransferOwnership - transfer token owner
func (BaseKeeper) UnForbidAddress ¶
func (keeper BaseKeeper) UnForbidAddress(ctx sdk.Context, symbol string, owner sdk.AccAddress, addresses []sdk.AccAddress) sdk.Error
UnForbidAddress - remove forbidden addresses
func (BaseKeeper) UnForbidToken ¶
func (keeper BaseKeeper) UnForbidToken(ctx sdk.Context, symbol string, owner sdk.AccAddress) sdk.Error
UnForbidToken - unforbid token
type BaseToken ¶
type BaseToken struct { Name string `json:"name"` // Name of the newly issued asset, limited to 32 unicode characters. Symbol string `json:"symbol"` // token symbol, [a-z][a-z0-9]{1,7} TotalSupply int64 `json:"total_supply"` // The total supply for this token [0] Owner sdk.AccAddress `json:"owner"` // The initial issuer of this token Mintable bool `json:"mintable"` // Whether this token could be minted after the issuing Burnable bool `json:"burnable"` // Whether this token could be burned AddrForbiddable bool `json:"addr_forbiddable"` // whether could forbid some addresses to forbid transaction TokenForbiddable bool `json:"token_forbiddable"` // whether token could be global forbid TotalBurn int64 `json:"total_burn"` // Total amount of burn TotalMint int64 `json:"total_mint"` // Total amount of mint IsForbidden bool `json:"is_forbidden"` // Whether token being forbidden currently URL string `json:"url"` //URL of token website Description string `json:"description"` //Description of token info }
BaseToken - a base Token structure.
func NewToken ¶
func NewToken(name string, symbol string, totalSupply int64, owner sdk.AccAddress, mintable bool, burnable bool, addrForbiddable bool, tokenForbiddable bool, url string, description string) (*BaseToken, sdk.Error)
NewToken - new base token
func (BaseToken) GetAddrForbiddable ¶
func (BaseToken) GetBurnable ¶
func (BaseToken) GetDescription ¶
func (BaseToken) GetIsForbidden ¶
func (BaseToken) GetMintable ¶
func (BaseToken) GetOwner ¶
func (t BaseToken) GetOwner() sdk.AccAddress
func (BaseToken) GetTokenForbiddable ¶
func (BaseToken) GetTotalBurn ¶
func (BaseToken) GetTotalMint ¶
func (BaseToken) GetTotalSupply ¶
func (*BaseToken) SetAddrForbiddable ¶
func (*BaseToken) SetBurnable ¶
func (*BaseToken) SetDescription ¶
func (*BaseToken) SetIsForbidden ¶
func (*BaseToken) SetMintable ¶
func (*BaseToken) SetTokenForbiddable ¶
func (*BaseToken) SetTotalBurn ¶
func (*BaseToken) SetTotalMint ¶
func (*BaseToken) SetTotalSupply ¶
type BaseTokenKeeper ¶
type BaseTokenKeeper struct { BaseViewKeeper // contains filtered or unexported fields }
BaseTokenKeeper implements a read only keeper implementation of TokenKeeper.
func NewBaseTokenKeeper ¶
func NewBaseTokenKeeper(cdc *codec.Codec, key sdk.StoreKey) BaseTokenKeeper
NewBaseTokenKeeper returns a new NewBaseTokenKeeper that uses go-amino to (binary) encode and decode concrete Token.
func (BaseTokenKeeper) IsForbiddenByTokenIssuer ¶
func (keeper BaseTokenKeeper) IsForbiddenByTokenIssuer(ctx sdk.Context, symbol string, addr sdk.AccAddress) bool
IsForbiddenByTokenIssuer - check whether addr is forbid by token issuer
func (BaseTokenKeeper) IsTokenExists ¶
func (keeper BaseTokenKeeper) IsTokenExists(ctx sdk.Context, symbol string) bool
IsTokenExists - check whether there is a coin named "symbol"
func (BaseTokenKeeper) IsTokenForbidden ¶
func (keeper BaseTokenKeeper) IsTokenForbidden(ctx sdk.Context, symbol string) bool
IsTokenForbidden - check whether coin issuer has forbidden "denom"
func (BaseTokenKeeper) IsTokenIssuer ¶
func (keeper BaseTokenKeeper) IsTokenIssuer(ctx sdk.Context, symbol string, addr sdk.AccAddress) bool
IsTokenIssuer - check whether addr is a token issuer
type BaseViewKeeper ¶
type BaseViewKeeper struct {
// contains filtered or unexported fields
}
BaseViewKeeper implements a read only keeper implementation of ViewKeeper.
func NewBaseViewKeeper ¶
func NewBaseViewKeeper(cdc *codec.Codec, key sdk.StoreKey) BaseViewKeeper
BaseViewKeeper returns a new BaseViewKeeper that uses go-amino to (binary) encode and decode concrete Token.
func (BaseViewKeeper) ExportAddrKeys ¶ added in v0.0.2
func (keeper BaseViewKeeper) ExportAddrKeys(ctx sdk.Context, prefix []byte) []string
ExportAddrKeys return []KEY symbol: | addr . get all whitelists or forbidden addresses string to genesis.json
func (BaseViewKeeper) GetAllTokens ¶
func (keeper BaseViewKeeper) GetAllTokens(ctx sdk.Context) []Token
GetAllTokens - returns all tokens.
func (BaseViewKeeper) GetForbiddenAddresses ¶ added in v0.0.2
func (keeper BaseViewKeeper) GetForbiddenAddresses(ctx sdk.Context, symbol string) []sdk.AccAddress
GetForbiddenAddresses - returns all forbidden addr list.
func (BaseViewKeeper) GetReservedSymbols ¶
func (keeper BaseViewKeeper) GetReservedSymbols() []string
GetReservedSymbols - get all reserved symbols
func (BaseViewKeeper) GetToken ¶
func (keeper BaseViewKeeper) GetToken(ctx sdk.Context, symbol string) Token
GetToken - return token by symbol
func (BaseViewKeeper) GetWhitelist ¶
func (keeper BaseViewKeeper) GetWhitelist(ctx sdk.Context, symbol string) []sdk.AccAddress
GetWhitelist - returns whitelist.
type ExpectedBankxKeeper ¶
type ExpectedBankxKeeper interface { DeductFee(ctx sdk.Context, addr sdk.AccAddress, amt sdk.Coins) 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 }
Bankx Keeper will implement the interface
type GenesisState ¶
type GenesisState struct { Params Params `json:"params"` Tokens []Token `json:"tokens"` Whitelist []string `json:"whitelist"` ForbiddenAddresses []string `json:"forbidden_addresses"` }
GenesisState - all asset state that must be provided at genesis
func DefaultGenesisState ¶
func DefaultGenesisState() GenesisState
DefaultGenesisState - Return a default genesis state
func ExportGenesis ¶
func ExportGenesis(ctx sdk.Context, keeper BaseKeeper) GenesisState
ExportGenesis returns a GenesisState for a given context and keeper
func NewGenesisState ¶
func NewGenesisState(params Params, tokens []Token, whitelist []string, forbiddenAddresses []string) GenesisState
NewGenesisState - Create a new genesis state
func (GenesisState) Validate ¶
func (data GenesisState) Validate() error
ValidateGenesis performs basic validation of asset genesis data returning an error for any failed validation criteria.
type Keeper ¶
type Keeper interface { TokenKeeper IssueToken(ctx sdk.Context, name string, symbol string, totalSupply int64, owner sdk.AccAddress, mintable bool, burnable bool, addrForbiddable bool, tokenForbiddable bool, url string, description string) sdk.Error TransferOwnership(ctx sdk.Context, symbol string, originalOwner sdk.AccAddress, newOwner sdk.AccAddress) sdk.Error MintToken(ctx sdk.Context, symbol string, owner sdk.AccAddress, amount int64) sdk.Error BurnToken(ctx sdk.Context, symbol string, owner sdk.AccAddress, amount int64) sdk.Error ForbidToken(ctx sdk.Context, symbol string, owner sdk.AccAddress) sdk.Error UnForbidToken(ctx sdk.Context, symbol string, owner sdk.AccAddress) sdk.Error AddTokenWhitelist(ctx sdk.Context, symbol string, owner sdk.AccAddress, whitelist []sdk.AccAddress) sdk.Error RemoveTokenWhitelist(ctx sdk.Context, symbol string, owner sdk.AccAddress, whitelist []sdk.AccAddress) sdk.Error ForbidAddress(ctx sdk.Context, symbol string, owner sdk.AccAddress, addresses []sdk.AccAddress) sdk.Error UnForbidAddress(ctx sdk.Context, symbol string, owner sdk.AccAddress, addresses []sdk.AccAddress) sdk.Error ModifyTokenURL(ctx sdk.Context, symbol string, owner sdk.AccAddress, url string) sdk.Error ModifyTokenDescription(ctx sdk.Context, symbol string, owner sdk.AccAddress, description string) sdk.Error DeductFee(ctx sdk.Context, addr sdk.AccAddress, amt sdk.Coins) sdk.Error AddToken(ctx sdk.Context, addr sdk.AccAddress, amt sdk.Coins) sdk.Error SubtractToken(ctx sdk.Context, addr sdk.AccAddress, amt sdk.Coins) sdk.Error SetParams(ctx sdk.Context, params Params) GetParams(ctx sdk.Context) (params Params) }
Keeper defines a module interface that keep token info.
type MsgAddTokenWhitelist ¶
type MsgAddTokenWhitelist struct { Symbol string `json:"symbol"` OwnerAddress sdk.AccAddress `json:"owner_address"` Whitelist []sdk.AccAddress `json:"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) 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"` Amount int64 `json:"amount"` OwnerAddress sdk.AccAddress `json:"owner_address"` //token owner address }
MsgBurnToken
func NewMsgBurnToken ¶
func NewMsgBurnToken(symbol string, amt int64, 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) ValidateBasic ¶
func (msg MsgBurnToken) ValidateBasic() sdk.Error
ValidateBasic Implements Msg.
type MsgForbidAddr ¶
type MsgForbidAddr struct { Symbol string `json:"symbol"` OwnerAddr sdk.AccAddress `json:"owner_address"` Addresses []sdk.AccAddress `json:"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) ValidateBasic ¶
func (msg MsgForbidAddr) ValidateBasic() sdk.Error
ValidateBasic Implements Msg.
type MsgForbidToken ¶
type MsgForbidToken struct { Symbol string `json:"symbol"` OwnerAddress sdk.AccAddress `json:"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) ValidateBasic ¶
func (msg MsgForbidToken) ValidateBasic() sdk.Error
ValidateBasic Implements Msg.
type MsgIssueToken ¶
type MsgIssueToken struct { Name string `json:"name"` // Name of the newly issued asset, limited to 32 unicode characters Symbol string `json:"symbol"` // token symbol, [a-z][a-z0-9]{1,7} TotalSupply int64 `json:"total_supply"` // The total supply for this token [0] Owner sdk.AccAddress `json:"owner"` // The initial issuer of this token [1] Mintable bool `json:"mintable"` // Whether this token could be minted after the issuing Burnable bool `json:"burnable"` // Whether this token could be burned AddrForbiddable bool `json:"addr_forbiddable"` // whether could forbid some addresses to forbid transaction TokenForbiddable bool `json:"token_forbiddable"` // whether token could be global forbid URL string `json:"url"` //URL of token website Description string `json:"description"` //Description of token info }
MsgIssueToken
func NewMsgIssueToken ¶
func NewMsgIssueToken(name string, symbol string, amt int64, owner sdk.AccAddress, mintable bool, burnable bool, addrForbiddable bool, tokenForbiddable bool, url string, description 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) ValidateBasic ¶
func (msg MsgIssueToken) ValidateBasic() sdk.Error
ValidateBasic Implements Msg.
type MsgMintToken ¶
type MsgMintToken struct { Symbol string `json:"symbol"` Amount int64 `json:"amount"` OwnerAddress sdk.AccAddress `json:"owner_address"` }
MsgMintToken
func NewMsgMintToken ¶
func NewMsgMintToken(symbol string, amt int64, 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) ValidateBasic ¶
func (msg MsgMintToken) ValidateBasic() sdk.Error
ValidateBasic Implements Msg.
type MsgModifyTokenDescription ¶
type MsgModifyTokenDescription struct { Symbol string `json:"symbol"` Description string `json:"description"` OwnerAddress sdk.AccAddress `json:"owner_address"` //token owner address }
MsgModifyTokenDescription
func NewMsgModifyTokenDescription ¶
func NewMsgModifyTokenDescription(symbol string, description string, owner sdk.AccAddress) MsgModifyTokenDescription
func (MsgModifyTokenDescription) GetSignBytes ¶
func (msg MsgModifyTokenDescription) GetSignBytes() []byte
GetSignBytes Implements Msg.
func (MsgModifyTokenDescription) GetSigners ¶
func (msg MsgModifyTokenDescription) GetSigners() []sdk.AccAddress
GetSigners Implements Msg.
func (MsgModifyTokenDescription) Route ¶
func (msg MsgModifyTokenDescription) Route() string
Route Implements Msg.
func (MsgModifyTokenDescription) Type ¶
func (msg MsgModifyTokenDescription) Type() string
Type Implements Msg.
func (MsgModifyTokenDescription) ValidateBasic ¶
func (msg MsgModifyTokenDescription) ValidateBasic() sdk.Error
ValidateBasic Implements Msg.
type MsgModifyTokenURL ¶
type MsgModifyTokenURL struct { Symbol string `json:"symbol"` URL string `json:"url"` OwnerAddress sdk.AccAddress `json:"owner_address"` //token owner address }
MsgModifyURL
func NewMsgModifyTokenURL ¶
func NewMsgModifyTokenURL(symbol string, url string, owner sdk.AccAddress) MsgModifyTokenURL
func (MsgModifyTokenURL) GetSignBytes ¶
func (msg MsgModifyTokenURL) GetSignBytes() []byte
GetSignBytes Implements Msg.
func (MsgModifyTokenURL) GetSigners ¶
func (msg MsgModifyTokenURL) GetSigners() []sdk.AccAddress
GetSigners Implements Msg.
func (MsgModifyTokenURL) ValidateBasic ¶
func (msg MsgModifyTokenURL) ValidateBasic() sdk.Error
ValidateBasic Implements Msg.
type MsgRemoveTokenWhitelist ¶
type MsgRemoveTokenWhitelist struct { Symbol string `json:"symbol"` OwnerAddress sdk.AccAddress `json:"owner_address"` Whitelist []sdk.AccAddress `json:"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) 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"` OriginalOwner sdk.AccAddress `json:"original_owner"` NewOwner sdk.AccAddress `json:"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) 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"` OwnerAddr sdk.AccAddress `json:"owner_address"` Addresses []sdk.AccAddress `json:"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) ValidateBasic ¶
func (msg MsgUnForbidAddr) ValidateBasic() sdk.Error
ValidateBasic Implements Msg.
type MsgUnForbidToken ¶
type MsgUnForbidToken struct { Symbol string `json:"symbol"` OwnerAddress sdk.AccAddress `json:"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) 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 sdk.Coins `json:"issue_token_fee"` IssueRareTokenFee sdk.Coins `json:"issue_rare_token_fee"` }
Params defines the parameters for the asset module.
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 { SetName(string) error GetSymbol() string SetSymbol(string) error GetTotalSupply() int64 SetTotalSupply(int64) error GetOwner() sdk.AccAddress SetOwner(sdk.AccAddress) error GetMintable() bool SetMintable(bool) GetBurnable() bool SetBurnable(bool) GetAddrForbiddable() bool SetAddrForbiddable(bool) GetTokenForbiddable() bool SetTokenForbiddable(bool) GetTotalBurn() int64 SetTotalBurn(int64) error GetTotalMint() int64 SetTotalMint(int64) error GetIsForbidden() bool SetIsForbidden(bool) GetURL() string SetURL(string) error GetDescription() string SetDescription(string) error Validate() 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.
type TokenKeeper ¶
type TokenKeeper interface { ViewKeeper IsTokenForbidden(ctx sdk.Context, symbol string) bool IsTokenExists(ctx sdk.Context, symbol string) bool IsTokenIssuer(ctx sdk.Context, symbol string, addr sdk.AccAddress) bool IsForbiddenByTokenIssuer(ctx sdk.Context, symbol string, addr sdk.AccAddress) bool }
TokenKeeper defines a module interface that facilitates read only access to token info.
type ViewKeeper ¶
type ViewKeeper interface { GetToken(ctx sdk.Context, symbol string) Token GetAllTokens(ctx sdk.Context) []Token GetWhitelist(ctx sdk.Context, symbol string) []sdk.AccAddress GetForbiddenAddresses(ctx sdk.Context, symbol string) []sdk.AccAddress ExportAddrKeys(ctx sdk.Context, prefix []byte) []string GetReservedSymbols() []string }
ViewKeeper defines a module interface that facilitates read only access to token store info.