Documentation ¶
Overview ¶
nolint
nolint
Index ¶
- Constants
- Variables
- func CheckSymbol(symbol string) error
- func KeyMinUint(minUnit string) []byte
- func KeySymbol(symbol string) []byte
- func KeyTokens(owner sdk.AccAddress, symbol string) []byte
- func ParamKeyTable() paramtypes.KeyTable
- func RegisterCodec(cdc *codec.Codec)
- func SetNativeToken(symbol, name, minUnit string, decimal uint32, initialSupply, maxSupply uint64, ...)
- func ValidateParams(p Params) error
- func ValidateToken(token Token) error
- type AccountKeeper
- type BankKeeper
- type Bool
- type Codec
- type GenesisState
- type MsgEditToken
- func (*MsgEditToken) Descriptor() ([]byte, []int)
- func (msg MsgEditToken) GetSignBytes() []byte
- func (msg MsgEditToken) GetSigners() []sdk.AccAddress
- func (m *MsgEditToken) Marshal() (dAtA []byte, err error)
- func (m *MsgEditToken) MarshalTo(dAtA []byte) (int, error)
- func (m *MsgEditToken) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*MsgEditToken) ProtoMessage()
- func (m *MsgEditToken) Reset()
- func (msg MsgEditToken) Route() string
- func (m *MsgEditToken) Size() (n int)
- func (m *MsgEditToken) String() string
- func (msg MsgEditToken) Type() string
- func (m *MsgEditToken) Unmarshal(dAtA []byte) error
- func (msg MsgEditToken) ValidateBasic() error
- func (m *MsgEditToken) XXX_DiscardUnknown()
- func (m *MsgEditToken) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MsgEditToken) XXX_Merge(src proto.Message)
- func (m *MsgEditToken) XXX_Size() int
- func (m *MsgEditToken) XXX_Unmarshal(b []byte) error
- type MsgIssueToken
- func (*MsgIssueToken) Descriptor() ([]byte, []int)
- func (msg MsgIssueToken) GetSignBytes() []byte
- func (msg MsgIssueToken) GetSigners() []sdk.AccAddress
- func (m *MsgIssueToken) Marshal() (dAtA []byte, err error)
- func (m *MsgIssueToken) MarshalTo(dAtA []byte) (int, error)
- func (m *MsgIssueToken) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*MsgIssueToken) ProtoMessage()
- func (m *MsgIssueToken) Reset()
- func (msg MsgIssueToken) Route() string
- func (m *MsgIssueToken) Size() (n int)
- func (m *MsgIssueToken) String() string
- func (msg MsgIssueToken) Type() string
- func (m *MsgIssueToken) Unmarshal(dAtA []byte) error
- func (msg MsgIssueToken) ValidateBasic() error
- func (m *MsgIssueToken) XXX_DiscardUnknown()
- func (m *MsgIssueToken) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MsgIssueToken) XXX_Merge(src proto.Message)
- func (m *MsgIssueToken) XXX_Size() int
- func (m *MsgIssueToken) XXX_Unmarshal(b []byte) error
- type MsgMintToken
- func (*MsgMintToken) Descriptor() ([]byte, []int)
- func (msg MsgMintToken) GetSignBytes() []byte
- func (msg MsgMintToken) GetSigners() []sdk.AccAddress
- func (m *MsgMintToken) Marshal() (dAtA []byte, err error)
- func (m *MsgMintToken) MarshalTo(dAtA []byte) (int, error)
- func (m *MsgMintToken) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*MsgMintToken) ProtoMessage()
- func (m *MsgMintToken) Reset()
- func (msg MsgMintToken) Route() string
- func (m *MsgMintToken) Size() (n int)
- func (m *MsgMintToken) String() string
- func (msg MsgMintToken) Type() string
- func (m *MsgMintToken) Unmarshal(dAtA []byte) error
- func (msg MsgMintToken) ValidateBasic() error
- func (m *MsgMintToken) XXX_DiscardUnknown()
- func (m *MsgMintToken) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MsgMintToken) XXX_Merge(src proto.Message)
- func (m *MsgMintToken) XXX_Size() int
- func (m *MsgMintToken) XXX_Unmarshal(b []byte) error
- type MsgTransferTokenOwner
- func (*MsgTransferTokenOwner) Descriptor() ([]byte, []int)
- func (msg MsgTransferTokenOwner) GetSignBytes() []byte
- func (msg MsgTransferTokenOwner) GetSigners() []sdk.AccAddress
- func (m *MsgTransferTokenOwner) Marshal() (dAtA []byte, err error)
- func (m *MsgTransferTokenOwner) MarshalTo(dAtA []byte) (int, error)
- func (m *MsgTransferTokenOwner) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*MsgTransferTokenOwner) ProtoMessage()
- func (m *MsgTransferTokenOwner) Reset()
- func (msg MsgTransferTokenOwner) Route() string
- func (m *MsgTransferTokenOwner) Size() (n int)
- func (m *MsgTransferTokenOwner) String() string
- func (msg MsgTransferTokenOwner) Type() string
- func (m *MsgTransferTokenOwner) Unmarshal(dAtA []byte) error
- func (msg MsgTransferTokenOwner) ValidateBasic() error
- func (m *MsgTransferTokenOwner) XXX_DiscardUnknown()
- func (m *MsgTransferTokenOwner) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MsgTransferTokenOwner) XXX_Merge(src proto.Message)
- func (m *MsgTransferTokenOwner) XXX_Size() int
- func (m *MsgTransferTokenOwner) XXX_Unmarshal(b []byte) error
- type Params
- func (*Params) Descriptor() ([]byte, []int)
- func (this *Params) Equal(that interface{}) bool
- func (m *Params) Marshal() (dAtA []byte, err error)
- func (m *Params) MarshalTo(dAtA []byte) (int, error)
- func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs
- func (*Params) ProtoMessage()
- func (m *Params) Reset()
- func (m *Params) Size() (n int)
- func (p Params) String() string
- func (m *Params) Unmarshal(dAtA []byte) error
- func (m *Params) XXX_DiscardUnknown()
- func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Params) XXX_Merge(src proto.Message)
- func (m *Params) XXX_Size() int
- func (m *Params) XXX_Unmarshal(b []byte) error
- type QueryTokenFeesParams
- type QueryTokenParams
- type QueryTokensParams
- type Token
- func (*Token) Descriptor() ([]byte, []int)
- func (this *Token) Equal(that interface{}) bool
- func (t Token) GetInitialSupply() uint64
- func (t Token) GetMaxSupply() uint64
- func (t Token) GetMinUnit() string
- func (t Token) GetMintable() bool
- func (t Token) GetName() string
- func (t Token) GetOwner() sdk.AccAddress
- func (t Token) GetScale() uint32
- func (t Token) GetSymbol() string
- func (m *Token) Marshal() (dAtA []byte, err error)
- func (m *Token) MarshalTo(dAtA []byte) (int, error)
- func (m *Token) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Token) ProtoMessage()
- func (m *Token) Reset()
- func (m *Token) Size() (n int)
- func (m *Token) String() string
- func (t Token) ToMainCoin(coin sdk.Coin) (sdk.DecCoin, error)
- func (t Token) ToMinCoin(coin sdk.DecCoin) (newCoin sdk.Coin, err error)
- func (m *Token) Unmarshal(dAtA []byte) error
- func (m *Token) XXX_DiscardUnknown()
- func (m *Token) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Token) XXX_Merge(src proto.Message)
- func (m *Token) XXX_Size() int
- func (m *Token) XXX_Unmarshal(b []byte) error
- type TokenFees
- type Tokens
Constants ¶
const ( AttributeValueCategory = ModuleName EventTypeIssueToken = "issue_token" EventTypeEditToken = "edit_token" EventTypeMintToken = "mint_token" EventTypeTransferTokenOwner = "transfer_token_owner" AttributeKeySymbol = "symbol" AttributeKeyAmount = "amount" )
const ( // ModuleName is the name of the Token module ModuleName = "token" // StoreKey is the string store representation StoreKey string = ModuleName // QuerierRoute is the querier route for the Asset module QuerierRoute string = ModuleName // RouterKey is the msg router key for the Asset module RouterKey string = ModuleName // DefaultParamspace default name for parameter store DefaultParamspace = ModuleName )
const ( // MsgRoute identifies transaction types MsgRoute = "token" TypeMsgIssueToken = "issue_token" TypeMsgEditToken = "edit_token" TypeMsgMintToken = "mint_token" TypeMsgTransferTokenOwner = "transfer_token_owner" // constant used to indicate that some field should not be updated DoNotModify = "[do-not-modify]" MaximumMaxSupply = uint64(1000000000000) // maximal limitation for token max supply,1000 billion MaximumInitSupply = uint64(100000000000) // maximal limitation for token initial supply,100 billion MaximumScale = uint32(18) // maximal limitation for token decimal MinimumSymbolLen = 3 // minimal limitation for the length of the token's symbol / canonical_symbol MaximumSymbolLen = 8 // maximal limitation for the length of the token's symbol / canonical_symbol MaximumNameLen = 32 // maximal limitation for the length of the token's name MinimumMinUnitLen = 3 // minimal limitation for the length of the token's min_unit MaximumMinUnitLen = 10 // maximal limitation for the length of the token's min_unit )
const ( QueryToken = "token" QueryTokens = "tokens" QueryFees = "fees" QueryParams = "params" )
Variables ¶
var ( ErrNilOwner = sdkerrors.Register(ModuleName, 2, "the owner of the token must be specified") ErrInvalidName = sdkerrors.Register(ModuleName, 3, "invalid token name") ErrInvalidMinUnit = sdkerrors.Register(ModuleName, 4, "invalid token min_unit") ErrInvalidSymbol = sdkerrors.Register(ModuleName, 5, "must be standard denom") ErrInvalidInitSupply = sdkerrors.Register(ModuleName, 6, "invalid token initial supply") ErrInvalidMaxSupply = sdkerrors.Register(ModuleName, 7, "invalid token max supply") ErrInvalidScale = sdkerrors.Register(ModuleName, 8, "invalid token scale") ErrSymbolAlreadyExists = sdkerrors.Register(ModuleName, 9, "symbol has existed") ErrMinUnitAlreadyExists = sdkerrors.Register(ModuleName, 10, "min_unit has existed") ErrTokenNotExists = sdkerrors.Register(ModuleName, 11, "token does not exist") ErrInvalidAddress = sdkerrors.Register(ModuleName, 12, "the owner of the token must be specified") ErrInvalidToAddress = sdkerrors.Register(ModuleName, 13, "the new owner must not be same as the original owner") ErrInvalidOwner = sdkerrors.Register(ModuleName, 14, "invalid token owner") ErrNotMintable = sdkerrors.Register(ModuleName, 15, "the token is set to be non-mintable") )
token module sentinel errors
var ( PrefixTokenForSymbol = []byte{0x1} // symbol prefix for the token PrefixTokenForMinUint = []byte{0x2} // min_unit prefix for the token PrefixTokens = []byte{0x3} // prefix for the tokens )
var ( IsAlphaNumeric = regexp.MustCompile(`^[a-zA-Z0-9]+$`).MatchString // only accepts alphanumeric characters IsBeginWithAlpha = regexp.MustCompile(`^[a-zA-Z].*`).MatchString )
var ( KeyTokenTaxRate = []byte("TokenTaxRate") KeyIssueTokenBaseFee = []byte("IssueTokenBaseFee") KeyMintTokenFeeRatio = []byte("MintTokenFeeRatio") )
parameter keys
var ( ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group") )
var ( // ModuleCdc references the global irismod/token module codec. Note, the codec should // ONLY be used in certain instances of tests and for JSON encoding as Amino is // still used for that purpose. // // The actual codec used for serialization should be provided to x/staking and // defined at the application level. ModuleCdc = codec.NewHybridCodec(amino, types.NewInterfaceRegistry()) )
Functions ¶
func CheckSymbol ¶
CheckSymbol checks if the given symbol is valid
func KeyMinUint ¶
KeyMinUint returns the key of the token with the specified min_unit
func KeyTokens ¶
func KeyTokens(owner sdk.AccAddress, symbol string) []byte
KeyTokens returns the key of the specified owner and symbol. Intended for querying all tokens of an owner
func ParamKeyTable ¶
func ParamKeyTable() paramtypes.KeyTable
ParamTypeTable returns the TypeTable for coinswap module
func RegisterCodec ¶
RegisterCodec registers the necessary x/bank interfaces and concrete types on the provided Amino codec. These types are used for Amino JSON serialization.
func SetNativeToken ¶
func SetNativeToken(symbol, name, minUnit string, decimal uint32, initialSupply, maxSupply uint64, mintable bool, owner sdk.AccAddress)
SetNativeToken reset the system's default native token
func ValidateParams ¶
func ValidateToken ¶
Types ¶
type AccountKeeper ¶
type AccountKeeper interface { GetAccount(ctx sdk.Context, addr sdk.AccAddress) auth.Account GetModuleAddress(name string) sdk.AccAddress GetModuleAccount(ctx sdk.Context, name string) auth.ModuleAccountI }
AccountKeeper defines the expected account keeper for query account
type BankKeeper ¶
type BankKeeper interface { MintCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error BurnCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error GetSupply(ctx sdk.Context) (supply bank.SupplyI) GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error SendCoinsFromModuleToModule(ctx sdk.Context, senderModule, recipientModule string, amt sdk.Coins) error SpendableCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins }
BankKeeper defines the expected bank keeper for module accounts (noalias)
type Bool ¶
type Bool string
func (*Bool) UnmarshalJSON ¶
UnmarshalJSON from using string
type Codec ¶
type Codec interface { codec.Marshaler MarshalSupply(supply exported.TokenI) ([]byte, error) UnmarshalSupply(bz []byte) (exported.TokenI, error) MarshalSupplyJSON(supply exported.TokenI) ([]byte, error) UnmarshalSupplyJSON(bz []byte) (exported.TokenI, error) }
Codec defines the interface needed to serialize x/bank state. It must be aware of all concrete supply types.
type GenesisState ¶
type GenesisState struct { Params Params `json:"params"` // token params Tokens Tokens `json:"tokens"` // issued tokens }
GenesisState - all token state that must be provided at genesis
func NewGenesisState ¶
func NewGenesisState(params Params, tokens Tokens) GenesisState
NewGenesisState creates a new genesis state.
type MsgEditToken ¶
type MsgEditToken struct { Symbol string `protobuf:"bytes,1,opt,name=symbol,proto3" json:"symbol,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` MaxSupply uint64 `protobuf:"varint,3,opt,name=max_supply,json=maxSupply,proto3" json:"max_supply,omitempty" yaml:"max_supply"` Mintable Bool `protobuf:"bytes,4,opt,name=mintable,proto3,casttype=Bool" json:"mintable,omitempty"` Owner github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,5,opt,name=owner,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"owner,omitempty"` }
MsgEditToken defines an SDK message for editing a new token.
func NewMsgEditToken ¶
func NewMsgEditToken(name, symbol string, maxSupply uint64, mintable Bool, owner sdk.AccAddress) MsgEditToken
NewMsgEditToken creates a MsgEditToken
func (*MsgEditToken) Descriptor ¶
func (*MsgEditToken) Descriptor() ([]byte, []int)
func (MsgEditToken) GetSignBytes ¶
func (msg MsgEditToken) GetSignBytes() []byte
GetSignBytes implements Msg
func (MsgEditToken) GetSigners ¶
func (msg MsgEditToken) GetSigners() []sdk.AccAddress
GetSigners implements Msg
func (*MsgEditToken) Marshal ¶
func (m *MsgEditToken) Marshal() (dAtA []byte, err error)
func (*MsgEditToken) MarshalToSizedBuffer ¶
func (m *MsgEditToken) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*MsgEditToken) ProtoMessage ¶
func (*MsgEditToken) ProtoMessage()
func (*MsgEditToken) Reset ¶
func (m *MsgEditToken) Reset()
func (*MsgEditToken) Size ¶
func (m *MsgEditToken) Size() (n int)
func (*MsgEditToken) String ¶
func (m *MsgEditToken) String() string
func (*MsgEditToken) Unmarshal ¶
func (m *MsgEditToken) Unmarshal(dAtA []byte) error
func (MsgEditToken) ValidateBasic ¶
func (msg MsgEditToken) ValidateBasic() error
ValidateBasic implements Msg
func (*MsgEditToken) XXX_DiscardUnknown ¶
func (m *MsgEditToken) XXX_DiscardUnknown()
func (*MsgEditToken) XXX_Marshal ¶
func (m *MsgEditToken) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*MsgEditToken) XXX_Merge ¶
func (m *MsgEditToken) XXX_Merge(src proto.Message)
func (*MsgEditToken) XXX_Size ¶
func (m *MsgEditToken) XXX_Size() int
func (*MsgEditToken) XXX_Unmarshal ¶
func (m *MsgEditToken) XXX_Unmarshal(b []byte) error
type MsgIssueToken ¶
type MsgIssueToken struct { Symbol string `protobuf:"bytes,1,opt,name=symbol,proto3" json:"symbol,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Scale uint32 `protobuf:"varint,3,opt,name=scale,proto3" json:"scale,omitempty"` MinUnit string `protobuf:"bytes,4,opt,name=min_unit,json=minUnit,proto3" json:"min_unit,omitempty" yaml:"min_unit"` InitialSupply uint64 `protobuf:"varint,5,opt,name=initial_supply,json=initialSupply,proto3" json:"initial_supply,omitempty" yaml:"initial_supply"` MaxSupply uint64 `protobuf:"varint,6,opt,name=max_supply,json=maxSupply,proto3" json:"max_supply,omitempty" yaml:"max_supply"` Mintable bool `protobuf:"varint,7,opt,name=mintable,proto3" json:"mintable,omitempty"` Owner github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,8,opt,name=owner,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"owner,omitempty"` }
MsgIssueToken defines an SDK message for issuing a new token.
func NewMsgIssueToken ¶
func NewMsgIssueToken(symbol string, minUnit string, name string, scale uint32, initialSupply, maxSupply uint64, mintable bool, owner sdk.AccAddress) MsgIssueToken
NewMsgIssueToken - construct token issue msg.
func (*MsgIssueToken) Descriptor ¶
func (*MsgIssueToken) Descriptor() ([]byte, []int)
func (MsgIssueToken) GetSigners ¶
func (msg MsgIssueToken) GetSigners() []sdk.AccAddress
Implements Msg.
func (*MsgIssueToken) Marshal ¶
func (m *MsgIssueToken) Marshal() (dAtA []byte, err error)
func (*MsgIssueToken) MarshalToSizedBuffer ¶
func (m *MsgIssueToken) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*MsgIssueToken) ProtoMessage ¶
func (*MsgIssueToken) ProtoMessage()
func (*MsgIssueToken) Reset ¶
func (m *MsgIssueToken) Reset()
func (*MsgIssueToken) Size ¶
func (m *MsgIssueToken) Size() (n int)
func (*MsgIssueToken) String ¶
func (m *MsgIssueToken) String() string
func (MsgIssueToken) Type ¶
func (msg MsgIssueToken) Type() string
func (*MsgIssueToken) Unmarshal ¶
func (m *MsgIssueToken) Unmarshal(dAtA []byte) error
func (*MsgIssueToken) XXX_DiscardUnknown ¶
func (m *MsgIssueToken) XXX_DiscardUnknown()
func (*MsgIssueToken) XXX_Marshal ¶
func (m *MsgIssueToken) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*MsgIssueToken) XXX_Merge ¶
func (m *MsgIssueToken) XXX_Merge(src proto.Message)
func (*MsgIssueToken) XXX_Size ¶
func (m *MsgIssueToken) XXX_Size() int
func (*MsgIssueToken) XXX_Unmarshal ¶
func (m *MsgIssueToken) XXX_Unmarshal(b []byte) error
type MsgMintToken ¶
type MsgMintToken struct { Symbol string `protobuf:"bytes,1,opt,name=symbol,proto3" json:"symbol,omitempty"` Amount uint64 `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"` To github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,3,opt,name=to,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"to,omitempty"` Owner github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,4,opt,name=owner,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"owner,omitempty"` }
MsgMintToken defines an SDK message for minting a new token.
func NewMsgMintToken ¶
func NewMsgMintToken(symbol string, owner, to sdk.AccAddress, amount uint64) MsgMintToken
NewMsgMintToken creates a MsgMintToken
func (*MsgMintToken) Descriptor ¶
func (*MsgMintToken) Descriptor() ([]byte, []int)
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) Marshal ¶
func (m *MsgMintToken) Marshal() (dAtA []byte, err error)
func (*MsgMintToken) MarshalToSizedBuffer ¶
func (m *MsgMintToken) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*MsgMintToken) ProtoMessage ¶
func (*MsgMintToken) ProtoMessage()
func (*MsgMintToken) Reset ¶
func (m *MsgMintToken) Reset()
func (*MsgMintToken) Size ¶
func (m *MsgMintToken) Size() (n int)
func (*MsgMintToken) String ¶
func (m *MsgMintToken) String() string
func (*MsgMintToken) Unmarshal ¶
func (m *MsgMintToken) Unmarshal(dAtA []byte) error
func (MsgMintToken) ValidateBasic ¶
func (msg MsgMintToken) ValidateBasic() error
ValidateBasic implements Msg
func (*MsgMintToken) XXX_DiscardUnknown ¶
func (m *MsgMintToken) XXX_DiscardUnknown()
func (*MsgMintToken) XXX_Marshal ¶
func (m *MsgMintToken) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*MsgMintToken) XXX_Merge ¶
func (m *MsgMintToken) XXX_Merge(src proto.Message)
func (*MsgMintToken) XXX_Size ¶
func (m *MsgMintToken) XXX_Size() int
func (*MsgMintToken) XXX_Unmarshal ¶
func (m *MsgMintToken) XXX_Unmarshal(b []byte) error
type MsgTransferTokenOwner ¶
type MsgTransferTokenOwner struct { SrcOwner github_com_cosmos_cosmos_sdk_types.AccAddress `` /* 157-byte string literal not displayed */ DstOwner github_com_cosmos_cosmos_sdk_types.AccAddress `` /* 157-byte string literal not displayed */ Symbol string `protobuf:"bytes,3,opt,name=symbol,proto3" json:"symbol,omitempty"` }
MsgMintToken defines an SDK message for transferring the token owner.
func NewMsgTransferTokenOwner ¶
func NewMsgTransferTokenOwner(srcOwner, dstOwner sdk.AccAddress, symbol string) MsgTransferTokenOwner
func (*MsgTransferTokenOwner) Descriptor ¶
func (*MsgTransferTokenOwner) Descriptor() ([]byte, []int)
func (MsgTransferTokenOwner) GetSignBytes ¶
func (msg MsgTransferTokenOwner) GetSignBytes() []byte
GetSignBytes implements Msg
func (MsgTransferTokenOwner) GetSigners ¶
func (msg MsgTransferTokenOwner) GetSigners() []sdk.AccAddress
GetSigners implements Msg
func (*MsgTransferTokenOwner) Marshal ¶
func (m *MsgTransferTokenOwner) Marshal() (dAtA []byte, err error)
func (*MsgTransferTokenOwner) MarshalTo ¶
func (m *MsgTransferTokenOwner) MarshalTo(dAtA []byte) (int, error)
func (*MsgTransferTokenOwner) MarshalToSizedBuffer ¶
func (m *MsgTransferTokenOwner) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*MsgTransferTokenOwner) ProtoMessage ¶
func (*MsgTransferTokenOwner) ProtoMessage()
func (*MsgTransferTokenOwner) Reset ¶
func (m *MsgTransferTokenOwner) Reset()
func (MsgTransferTokenOwner) Route ¶
func (msg MsgTransferTokenOwner) Route() string
Route implements Msg
func (*MsgTransferTokenOwner) Size ¶
func (m *MsgTransferTokenOwner) Size() (n int)
func (*MsgTransferTokenOwner) String ¶
func (m *MsgTransferTokenOwner) String() string
func (MsgTransferTokenOwner) Type ¶
func (msg MsgTransferTokenOwner) Type() string
Type implements Msg
func (*MsgTransferTokenOwner) Unmarshal ¶
func (m *MsgTransferTokenOwner) Unmarshal(dAtA []byte) error
func (MsgTransferTokenOwner) ValidateBasic ¶
func (msg MsgTransferTokenOwner) ValidateBasic() error
func (*MsgTransferTokenOwner) XXX_DiscardUnknown ¶
func (m *MsgTransferTokenOwner) XXX_DiscardUnknown()
func (*MsgTransferTokenOwner) XXX_Marshal ¶
func (m *MsgTransferTokenOwner) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*MsgTransferTokenOwner) XXX_Merge ¶
func (m *MsgTransferTokenOwner) XXX_Merge(src proto.Message)
func (*MsgTransferTokenOwner) XXX_Size ¶
func (m *MsgTransferTokenOwner) XXX_Size() int
func (*MsgTransferTokenOwner) XXX_Unmarshal ¶
func (m *MsgTransferTokenOwner) XXX_Unmarshal(b []byte) error
type Params ¶
type Params struct { TokenTaxRate github_com_cosmos_cosmos_sdk_types.Dec `` /* 161-byte string literal not displayed */ IssueTokenBaseFee types.Coin `` /* 134-byte string literal not displayed */ MintTokenFeeRatio github_com_cosmos_cosmos_sdk_types.Dec `` /* 184-byte string literal not displayed */ }
token parameters
func NewParams ¶
func NewParams(tokenTaxRate sdk.Dec, issueTokenBaseFee sdk.Coin, mintTokenFeeRatio sdk.Dec, ) Params
NewParams token params constructor
func (*Params) Descriptor ¶
func (*Params) MarshalToSizedBuffer ¶
func (*Params) ParamSetPairs ¶
func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs
func (*Params) ProtoMessage ¶
func (*Params) ProtoMessage()
func (*Params) XXX_DiscardUnknown ¶
func (m *Params) XXX_DiscardUnknown()
func (*Params) XXX_Marshal ¶
func (*Params) XXX_Unmarshal ¶
type QueryTokenFeesParams ¶
type QueryTokenFeesParams struct {
Symbol string
}
QueryTokenFeesParams is the query parameters for 'custom/token/fees'
type QueryTokenParams ¶
type QueryTokenParams struct {
Denom string
}
QueryTokenParams is the query parameters for 'custom/token/token'
type QueryTokensParams ¶
type QueryTokensParams struct {
Owner sdk.AccAddress
}
QueryTokensParams is the query parameters for 'custom/token/tokens'
type Token ¶
type Token struct { Symbol string `protobuf:"bytes,1,opt,name=symbol,proto3" json:"symbol,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Scale uint32 `protobuf:"varint,3,opt,name=scale,proto3" json:"scale,omitempty"` MinUnit string `protobuf:"bytes,4,opt,name=min_unit,json=minUnit,proto3" json:"min_unit,omitempty" yaml:"min_unit"` InitialSupply uint64 `protobuf:"varint,5,opt,name=initial_supply,json=initialSupply,proto3" json:"initial_supply,omitempty" yaml:"initial_supply"` MaxSupply uint64 `protobuf:"varint,6,opt,name=max_supply,json=maxSupply,proto3" json:"max_supply,omitempty" yaml:"max_supply"` Mintable bool `protobuf:"varint,7,opt,name=mintable,proto3" json:"mintable,omitempty"` Owner github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,8,opt,name=owner,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"owner,omitempty"` }
Token defines a standard for the fungible token
func GetNativeToken ¶
func GetNativeToken() Token
func NewToken ¶
func NewToken( symbol, name, minUnit string, scale uint32, initialSupply, maxSupply uint64, mintable bool, owner sdk.AccAddress, ) Token
NewToken constructs a new Token instance
func (*Token) Descriptor ¶
func (Token) GetInitialSupply ¶
GetInitialSupply implements exported.TokenI
func (Token) GetMaxSupply ¶
GetMaxSupply implements exported.TokenI
func (Token) GetOwner ¶
func (t Token) GetOwner() sdk.AccAddress
GetOwner implements exported.TokenI
func (*Token) ProtoMessage ¶
func (*Token) ProtoMessage()
func (Token) ToMainCoin ¶
ToMainCoin return the main denom coin from args
func (*Token) XXX_DiscardUnknown ¶
func (m *Token) XXX_DiscardUnknown()