types

package
v0.0.0-...-962cb54 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2020 License: BSD-2-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

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

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

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

View Source
var (
	SeparateKey      = []byte{0x3A}
	TokenKey         = []byte{0x01}
	WhitelistKey     = []byte{0x02}
	ForbiddenAddrKey = []byte{0x03}
)
View Source
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

View Source
var ModuleCdc *codec.Codec

ModuleCdc wide codec

View Source
var TestIdentityString = "552A83BA62F9B1F8"

Functions

func ErrAccInBlackList

func ErrAccInBlackList(addr sdk.AccAddress) sdk.Error

func ErrAddressForbiddenNotSupported

func ErrAddressForbiddenNotSupported(symbol string) sdk.Error

func ErrCodeTokenInfoSealed

func ErrCodeTokenInfoSealed(field string) sdk.Error

func ErrDuplicateTokenSymbol

func ErrDuplicateTokenSymbol(symbol string) sdk.Error

func ErrInvalidForbiddenAddress

func ErrInvalidForbiddenAddress() sdk.Error

func ErrInvalidIssueOwner

func ErrInvalidIssueOwner() sdk.Error

func ErrInvalidSendLockAmt

func ErrInvalidSendLockAmt(amt string) sdk.Error

func ErrInvalidTokenBurnAmt

func ErrInvalidTokenBurnAmt(amt string) sdk.Error

func ErrInvalidTokenDescription

func ErrInvalidTokenDescription(description string) sdk.Error

func ErrInvalidTokenForbidden

func ErrInvalidTokenForbidden(symbol string) sdk.Error

func ErrInvalidTokenIdentity

func ErrInvalidTokenIdentity(identity string) sdk.Error

func ErrInvalidTokenInfo

func ErrInvalidTokenInfo(field, val string) sdk.Error

func ErrInvalidTokenMintAmt

func ErrInvalidTokenMintAmt(amt string) sdk.Error

func ErrInvalidTokenName

func ErrInvalidTokenName(name string) sdk.Error

func ErrInvalidTokenOwner

func ErrInvalidTokenOwner(addr sdk.Address) sdk.Error

func ErrInvalidTokenSupply

func ErrInvalidTokenSupply(amt string) sdk.Error

func ErrInvalidTokenSymbol

func ErrInvalidTokenSymbol(symbol string) sdk.Error

func ErrInvalidTokenURL

func ErrInvalidTokenURL(url string) sdk.Error

func ErrInvalidTokenUnForbidden

func ErrInvalidTokenUnForbidden(symbol string) sdk.Error

func ErrInvalidTokenWhitelist

func ErrInvalidTokenWhitelist() sdk.Error

func ErrNeedTokenOwner

func ErrNeedTokenOwner(addr sdk.Address) sdk.Error

func ErrNilForbiddenAddress

func ErrNilForbiddenAddress() sdk.Error

func ErrNilTokenIdentity

func ErrNilTokenIdentity() sdk.Error

func ErrNilTokenOwner

func ErrNilTokenOwner() sdk.Error

func ErrNilTokenWhitelist

func ErrNilTokenWhitelist() sdk.Error

func ErrTokenBurnNotSupported

func ErrTokenBurnNotSupported(symbol string) sdk.Error

func ErrTokenForbiddenNotSupported

func ErrTokenForbiddenNotSupported(symbol string) sdk.Error

func ErrTokenMintNotSupported

func ErrTokenMintNotSupported(symbol string) sdk.Error

func ErrTokenNotFound

func ErrTokenNotFound(symbol string) sdk.Error

-----------------------------------------------------------------------------

func ErrTokenOwnerSelfForbidden

func ErrTokenOwnerSelfForbidden() sdk.Error

func ErrTransferSelfTokenOwner

func ErrTransferSelfTokenOwner() sdk.Error

func GetForbiddenAddrKeyPrefix

func GetForbiddenAddrKeyPrefix(symbol string) []byte

GetForbiddenAddrKeyPrefix - ForbiddenAddrKey | Symbol | :

func GetForbiddenAddrKeyPrefixLength

func GetForbiddenAddrKeyPrefixLength(symbol string) int

GetForbiddenAddrKeyPrefixLength - ForbiddenAddrKey length

func GetForbiddenAddrStoreKey

func GetForbiddenAddrStoreKey(symbol string, addr sdk.AccAddress) []byte

GetForbiddenAddrStoreKey - ForbiddenAddrKey | Symbol | : | AccAddress

func GetReservedSymbols

func GetReservedSymbols() []string

func GetTokenStoreKey

func GetTokenStoreKey(symbol string) []byte

GetTokenStoreKey - TokenKey | symbol

func GetWhitelistKeyPrefix

func GetWhitelistKeyPrefix(symbol string) []byte

GetWhitelistKeyPrefix - Prefix WhitelistKey | Symbol | :

func GetWhitelistKeyPrefixLength

func GetWhitelistKeyPrefixLength(symbol string) int

GetWhitelistKeyPrefixLength - WhitelistKey length

func GetWhitelistStoreKey

func GetWhitelistStoreKey(symbol string, addr sdk.AccAddress) []byte

GetWhitelistStoreKey - WhitelistKey | Symbol | : | AccAddress

func IsReservedSymbol

func IsReservedSymbol(symbol string) bool

func IsSuffixSymbol

func IsSuffixSymbol(symbol string) bool

func NewTokenCoins

func NewTokenCoins(denom string, amount sdk.Int) sdk.Coins

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

Register concrete types on codec codec

func ValidateTokenSymbol

func ValidateTokenSymbol(symbol string) sdk.Error

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 (t BaseToken) GetAddrForbiddable() bool

func (BaseToken) GetBurnable

func (t BaseToken) GetBurnable() bool

func (BaseToken) GetDescription

func (t BaseToken) GetDescription() string

func (BaseToken) GetIdentity

func (t BaseToken) GetIdentity() string

func (BaseToken) GetIsForbidden

func (t BaseToken) GetIsForbidden() bool

func (BaseToken) GetMintable

func (t BaseToken) GetMintable() bool

func (*BaseToken) GetName

func (t *BaseToken) GetName() string

func (BaseToken) GetOwner

func (t BaseToken) GetOwner() sdk.AccAddress

func (BaseToken) GetSendLock

func (t BaseToken) GetSendLock() sdk.Int

func (BaseToken) GetSymbol

func (t BaseToken) GetSymbol() string

func (BaseToken) GetTokenForbiddable

func (t BaseToken) GetTokenForbiddable() bool

func (BaseToken) GetTotalBurn

func (t BaseToken) GetTotalBurn() sdk.Int

func (BaseToken) GetTotalMint

func (t BaseToken) GetTotalMint() sdk.Int

func (BaseToken) GetTotalSupply

func (t BaseToken) GetTotalSupply() sdk.Int

func (BaseToken) GetURL

func (t BaseToken) GetURL() string

func (*BaseToken) SetAddrForbiddable

func (t *BaseToken) SetAddrForbiddable(enable bool)

func (*BaseToken) SetBurnable

func (t *BaseToken) SetBurnable(enable bool)

func (*BaseToken) SetDescription

func (t *BaseToken) SetDescription(description string) sdk.Error

func (*BaseToken) SetIdentity

func (t *BaseToken) SetIdentity(identity string) sdk.Error

func (*BaseToken) SetIsForbidden

func (t *BaseToken) SetIsForbidden(enable bool)

func (*BaseToken) SetMintable

func (t *BaseToken) SetMintable(enable bool)

func (*BaseToken) SetName

func (t *BaseToken) SetName(name string) sdk.Error

func (*BaseToken) SetOwner

func (t *BaseToken) SetOwner(addr sdk.AccAddress) sdk.Error

func (*BaseToken) SetSendLock

func (t *BaseToken) SetSendLock(amt sdk.Int) sdk.Error

func (*BaseToken) SetSymbol

func (t *BaseToken) SetSymbol(symbol string) sdk.Error

func (*BaseToken) SetTokenForbiddable

func (t *BaseToken) SetTokenForbiddable(enable bool)

func (*BaseToken) SetTotalBurn

func (t *BaseToken) SetTotalBurn(amt sdk.Int) sdk.Error

func (*BaseToken) SetTotalMint

func (t *BaseToken) SetTotalMint(amt sdk.Int) sdk.Error

func (*BaseToken) SetTotalSupply

func (t *BaseToken) SetTotalSupply(amt sdk.Int) sdk.Error

func (*BaseToken) SetURL

func (t *BaseToken) SetURL(url string) sdk.Error

func (BaseToken) String

func (t BaseToken) String() string

func (*BaseToken) Validate

func (t *BaseToken) Validate() sdk.Error

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

func (msg MsgBurnToken) Route() string

Route Implements Msg.

func (*MsgBurnToken) SetAccAddress

func (msg *MsgBurnToken) SetAccAddress(addr sdk.AccAddress)

func (MsgBurnToken) Type

func (msg MsgBurnToken) Type() string

Type Implements Msg.

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

func (msg MsgForbidAddr) Route() string

Route Implements Msg.

func (*MsgForbidAddr) SetAccAddress

func (msg *MsgForbidAddr) SetAccAddress(addr sdk.AccAddress)

func (MsgForbidAddr) Type

func (msg MsgForbidAddr) Type() string

Type Implements Msg.

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

func (msg MsgForbidToken) Route() string

Route Implements Msg.

func (*MsgForbidToken) SetAccAddress

func (msg *MsgForbidToken) SetAccAddress(addr sdk.AccAddress)

func (MsgForbidToken) Type

func (msg MsgForbidToken) Type() string

Type Implements Msg.

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

func (msg MsgIssueToken) Route() string

Route Implements Msg.

func (*MsgIssueToken) SetAccAddress

func (msg *MsgIssueToken) SetAccAddress(addr sdk.AccAddress)

func (MsgIssueToken) Type

func (msg MsgIssueToken) Type() string

Type Implements Msg.

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

func (msg MsgMintToken) Route() string

Route Implements Msg.

func (*MsgMintToken) SetAccAddress

func (msg *MsgMintToken) SetAccAddress(addr sdk.AccAddress)

func (MsgMintToken) Type

func (msg MsgMintToken) Type() string

Type Implements Msg.

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

func (msg MsgModifyTokenInfo) Type() string

Type Implements Msg.

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

func (msg MsgUnForbidAddr) Route() string

Route Implements Msg.

func (*MsgUnForbidAddr) SetAccAddress

func (msg *MsgUnForbidAddr) SetAccAddress(addr sdk.AccAddress)

func (MsgUnForbidAddr) Type

func (msg MsgUnForbidAddr) Type() string

Type Implements Msg.

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

func (msg MsgUnForbidToken) Route() string

Route Implements Msg.

func (*MsgUnForbidToken) SetAccAddress

func (msg *MsgUnForbidToken) SetAccAddress(addr sdk.AccAddress)

func (MsgUnForbidToken) Type

func (msg MsgUnForbidToken) Type() string

Type 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      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 DefaultParams

func DefaultParams() Params

DefaultParams returns a default set of parameters.

func (Params) Equal

func (p Params) Equal(p2 Params) bool

Equal returns a boolean determining if two Params types are identical.

func (Params) GetIssueTokenFee

func (p Params) GetIssueTokenFee(symbol string) int64

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

func (p Params) String() string

func (*Params) ValidateGenesis

func (p *Params) ValidateGenesis() error

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.

func MustUnmarshalToken

func MustUnmarshalToken(cdc *codec.Codec, value []byte) Token

func UnmarshalToken

func UnmarshalToken(cdc *codec.Codec, value []byte) (token Token, err error)

Jump to

Keyboard shortcuts

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