Documentation ¶
Overview ¶
Package asset allows individuals and companies to create and issue their own tokens.
[More Details](https://www.irisnet.org/docs/features/asset.html)
Index ¶
- Constants
- type Bool
- type Fees
- type FungibleToken
- func (t FungibleToken) Convert() interface{}
- func (t FungibleToken) GetInitialSupply() uint64
- func (t FungibleToken) GetMaxSupply() uint64
- func (t FungibleToken) GetMinUnit() string
- func (t FungibleToken) GetMintable() bool
- func (t FungibleToken) GetName() string
- func (t FungibleToken) GetOwner() sdk.AccAddress
- func (t FungibleToken) GetScale() uint8
- func (t FungibleToken) GetSymbol() string
- type MsgEditToken
- type MsgIssueToken
- type MsgMintToken
- type MsgTransferTokenOwner
- type Params
- type Token
- type TokenI
- type Tokens
Constants ¶
const (
ModuleName = "token"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bool ¶
type Bool string
func (*Bool) UnmarshalJSON ¶
Unmarshals from JSON assuming Bech32 encoding
type Fees ¶
type Fees struct { Exist bool `json:"exist"` // indicate if the token has existed IssueFee sdk.Coin `json:"issue_fee"` // issue fee MintFee sdk.Coin `json:"mint_fee"` // mint fee }
Fees is for the token fees query output
type FungibleToken ¶
type FungibleToken struct { Symbol string `json:"symbol" yaml:"symbol"` Name string `json:"name" yaml:"name"` Scale uint8 `json:"scale" yaml:"scale"` MinUnit string `json:"min_unit" yaml:"min_unit"` InitialSupply uint64 `json:"initial_supply" yaml:"initial_supply"` MaxSupply uint64 `json:"max_supply" yaml:"max_supply"` Mintable bool `json:"mintable" yaml:"mintable"` Owner sdk.AccAddress `json:"owner" yaml:"owner"` }
Token defines a struct for the fungible token
func (FungibleToken) Convert ¶
func (t FungibleToken) Convert() interface{}
func (FungibleToken) GetInitialSupply ¶
func (t FungibleToken) GetInitialSupply() uint64
GetInitialSupply implements exported.TokenI
func (FungibleToken) GetMaxSupply ¶
func (t FungibleToken) GetMaxSupply() uint64
GetMaxSupply implements exported.TokenI
func (FungibleToken) GetMinUnit ¶
func (t FungibleToken) GetMinUnit() string
GetMinUnit implements exported.TokenI
func (FungibleToken) GetMintable ¶
func (t FungibleToken) GetMintable() bool
GetMintable implements exported.TokenI
func (FungibleToken) GetName ¶
func (t FungibleToken) GetName() string
GetName implements exported.TokenI
func (FungibleToken) GetOwner ¶
func (t FungibleToken) GetOwner() sdk.AccAddress
GetOwner implements exported.TokenI
func (FungibleToken) GetScale ¶
func (t FungibleToken) GetScale() uint8
GetScale implements exported.TokenI
func (FungibleToken) GetSymbol ¶
func (t FungibleToken) GetSymbol() string
GetSymbol implements exported.TokenI
type MsgEditToken ¶
type MsgEditToken struct { Symbol string `json:"symbol"` // symbol of token Owner sdk.AccAddress `json:"owner"` // owner of token MaxSupply uint64 `json:"max_supply"` Mintable Bool `json:"mintable"` // mintable of token Name string `json:"name"` }
MsgEditToken for editing a specified token
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) Route ¶
func (msg MsgEditToken) Route() string
func (MsgEditToken) ValidateBasic ¶
func (msg MsgEditToken) ValidateBasic() error
ValidateBasic implements Msg
type MsgIssueToken ¶
type MsgIssueToken struct { Symbol string `json:"symbol"` Name string `json:"name"` Scale uint8 `json:"scale"` MinUnit string `json:"min_unit"` InitialSupply uint64 `json:"initial_supply"` MaxSupply uint64 `json:"max_supply"` Mintable bool `json:"mintable"` Owner sdk.AccAddress `json:"owner"` }
MsgIssueToken
func (MsgIssueToken) GetSigners ¶
func (msg MsgIssueToken) GetSigners() []sdk.AccAddress
Implements Msg.
func (MsgIssueToken) Route ¶
func (msg MsgIssueToken) Route() string
type MsgMintToken ¶
type MsgMintToken struct { Symbol string `json:"symbol"` // the symbol of the token Owner sdk.AccAddress `json:"owner"` // the current owner address of the token To sdk.AccAddress `json:"to"` // address of minting token to Amount uint64 `json:"amount"` // amount of minting token }
MsgMintToken for minting the token to a specified address
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
func (MsgMintToken) ValidateBasic ¶
func (msg MsgMintToken) ValidateBasic() error
ValidateBasic implements Msg
type MsgTransferTokenOwner ¶
type MsgTransferTokenOwner struct { SrcOwner sdk.AccAddress `json:"src_owner"` // the current owner address of the token DstOwner sdk.AccAddress `json:"dst_owner"` // the new owner Symbol string `json:"symbol"` // the token symbol }
MsgTransferTokenOwner for transferring the token owner
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) Route ¶
func (msg MsgTransferTokenOwner) Route() string
func (MsgTransferTokenOwner) Type ¶
func (msg MsgTransferTokenOwner) Type() string
Type implements Msg
func (MsgTransferTokenOwner) ValidateBasic ¶
func (msg MsgTransferTokenOwner) ValidateBasic() error
type Params ¶
type Params struct { TokenTaxRate sdk.Dec `json:"token_tax_rate"` // e.g., 40% IssueTokenBaseFee sdk.Coin `json:"issue_token_base_fee"` // e.g., 300000*10^18iris-atto MintTokenFeeRatio sdk.Dec `json:"mint_token_fee_ratio"` // e.g., 10% }
token params
type Token ¶
type Token interface { QueryToken(symbol string) (sdk.Token, error) QueryTokens(owner string) (sdk.Tokens, error) QueryFees(symbol string) (Fees, error) QueryParams() (Params, error) }
func NewClient ¶
func NewClient(bc sdk.BaseClient) Token