Documentation ¶
Overview ¶
nolint noalias
Index ¶
- Constants
- Variables
- func AreAnyCoinsZero(coins *sdk.Coins) bool
- func ErrTokenSymbolDoesNotExist(codespace sdk.CodespaceType) sdk.Error
- func KeyTestPubAddr() (crypto.PrivKey, crypto.PubKey, sdk.AccAddress)
- func NewTestCoins(symbol string, amount int64) sdk.Coins
- func RegisterCodec(cdc *codec.Codec)
- type CustomAccount
- func (acc *CustomAccount) FreezeCoins(coinsToFreeze sdk.Coins) error
- func (acc *CustomAccount) GetFrozenCoins() sdk.Coins
- func (acc *CustomAccount) SetFrozenCoins(frozen sdk.Coins) error
- func (acc CustomAccount) String() string
- func (acc *CustomAccount) UnfreezeCoins(coinsToUnfreeze sdk.Coins) error
- type CustomCoinAccount
- type Freezer
- type MsgBurnCoins
- type MsgFreezeCoins
- type MsgIssueToken
- type MsgMintCoins
- type MsgUnfreezeCoins
- type QueryResultSymbol
- type Token
Constants ¶
const ( DefaultCodespace sdk.CodespaceType = ModuleName CodeTokenSymbolDoesNotExist sdk.CodeType = 101 )
const ( // module name ModuleName = "assetmanagement" // StoreKey to be used when creating the KVStore StoreKey = ModuleName )
const RouterKey = ModuleName // this was defined in your key.go file
Variables ¶
var ModuleCdc = codec.New()
Functions ¶
func AreAnyCoinsZero ¶
func ErrTokenSymbolDoesNotExist ¶
func ErrTokenSymbolDoesNotExist(codespace sdk.CodespaceType) sdk.Error
func KeyTestPubAddr ¶
func NewTestCoins ¶
coins to more than cover the fee
func RegisterCodec ¶
RegisterCodec registers concrete types on the Amino codec
Types ¶
type CustomAccount ¶
type CustomAccount struct { *auth.BaseAccount FrozenCoins sdk.Coins `json:"coins" yaml:"coins"` }
CustomAccount is customised to allow temporary freezing of coins to exclude them from transactions
func NewCustomAccount ¶
func (*CustomAccount) FreezeCoins ¶
func (acc *CustomAccount) FreezeCoins(coinsToFreeze sdk.Coins) error
FreezeCoins freezes unfrozen coins for account according to input
func (*CustomAccount) GetFrozenCoins ¶
func (acc *CustomAccount) GetFrozenCoins() sdk.Coins
GetFrozenCoins retrieves frozen coins from account
func (*CustomAccount) SetFrozenCoins ¶
func (acc *CustomAccount) SetFrozenCoins(frozen sdk.Coins) error
SetFrozenCoins sets frozen coins for account
func (CustomAccount) String ¶
func (acc CustomAccount) String() string
String implements fmt.Stringer
func (*CustomAccount) UnfreezeCoins ¶
func (acc *CustomAccount) UnfreezeCoins(coinsToUnfreeze sdk.Coins) error
UnfreezeCoins unfreezes frozen coins for account according to input
type CustomCoinAccount ¶
CustomCoinAccount extends the built in account interface with extra abilities such as frozen coins
type Freezer ¶
type Freezer interface { // Get just the frozen coins GetFrozenCoins() sdk.Coins SetFrozenCoins(sdk.Coins) error // Freeze coins by a certain amount. It will reduce amount of coins available from GetCoins() FreezeCoins(sdk.Coins) error // Unfreeze coins by a certain amount. It will increase the amount of coins available from GetCoins() UnfreezeCoins(sdk.Coins) error }
Freezer allows setting and getting frozen coins
type MsgBurnCoins ¶
type MsgBurnCoins struct { Amount int64 `json:"amount"` Symbol string `json:"symbol"` Owner sdk.AccAddress `json:"owner"` }
MsgBurnCoins defines the BurnCoins message
func NewMsgBurnCoins ¶
func NewMsgBurnCoins(amount int64, symbol string, owner sdk.AccAddress) MsgBurnCoins
NewMsgBurnCoins is the constructor function for MsgBurnCoins
func (MsgBurnCoins) GetSignBytes ¶
func (msg MsgBurnCoins) GetSignBytes() []byte
GetSignBytes encodes the message for signing
func (MsgBurnCoins) GetSigners ¶
func (msg MsgBurnCoins) GetSigners() []sdk.AccAddress
GetSigners defines whose signature is required
func (MsgBurnCoins) Route ¶
func (msg MsgBurnCoins) Route() string
Route should return the name of the module
func (MsgBurnCoins) ValidateBasic ¶
func (msg MsgBurnCoins) ValidateBasic() sdk.Error
ValidateBasic runs stateless checks on the message
type MsgFreezeCoins ¶
type MsgFreezeCoins struct { Amount int64 `json:"amount"` Symbol string `json:"symbol"` Owner sdk.AccAddress `json:"owner"` }
MsgFreezeCoins defines the FreezeCoins message
func NewMsgFreezeCoins ¶
func NewMsgFreezeCoins(amount int64, symbol string, owner sdk.AccAddress) MsgFreezeCoins
NewMsgFreezeCoins is the constructor function for MsgFreezeCoins
func (MsgFreezeCoins) GetSignBytes ¶
func (msg MsgFreezeCoins) GetSignBytes() []byte
GetSignBytes encodes the message for signing
func (MsgFreezeCoins) GetSigners ¶
func (msg MsgFreezeCoins) GetSigners() []sdk.AccAddress
GetSigners defines whose signature is required
func (MsgFreezeCoins) Route ¶
func (msg MsgFreezeCoins) Route() string
Route should return the name of the module
func (MsgFreezeCoins) ValidateBasic ¶
func (msg MsgFreezeCoins) ValidateBasic() sdk.Error
ValidateBasic runs stateless checks on the message
type MsgIssueToken ¶
type MsgIssueToken struct { SourceAddress sdk.AccAddress `json:"source_address"` Name string `json:"name"` Symbol string `json:"symbol"` OriginalSymbol string `json:"original_symbol"` TotalSupply int64 `json:"total_supply"` Mintable bool `json:"mintable"` }
MsgIssueToken defines a IssueToken message
func NewMsgIssueToken ¶
func NewMsgIssueToken(sourceAddress sdk.AccAddress, name, symbol string, originalSymbol string, totalSupply int64, mintable bool) MsgIssueToken
NewMsgIssueToken is a constructor function for MsgIssueToken
func (MsgIssueToken) GetSignBytes ¶
func (msg MsgIssueToken) GetSignBytes() []byte
GetSignBytes encodes the message for signing
func (MsgIssueToken) GetSigners ¶
func (msg MsgIssueToken) GetSigners() []sdk.AccAddress
GetSigners defines whose signature is required
func (MsgIssueToken) Route ¶
func (msg MsgIssueToken) Route() string
Route should return the name of the module
func (MsgIssueToken) ValidateBasic ¶
func (msg MsgIssueToken) ValidateBasic() sdk.Error
ValidateBasic runs stateless checks on the message
type MsgMintCoins ¶
type MsgMintCoins struct { Amount int64 `json:"amount"` Symbol string `json:"symbol"` Owner sdk.AccAddress `json:"owner"` }
MsgMintCoins defines the MintCoins message
func NewMsgMintCoins ¶
func NewMsgMintCoins(amount int64, symbol string, owner sdk.AccAddress) MsgMintCoins
NewMsgMintCoins is the constructor function for MsgMintCoins
func (MsgMintCoins) GetSignBytes ¶
func (msg MsgMintCoins) GetSignBytes() []byte
GetSignBytes encodes the message for signing
func (MsgMintCoins) GetSigners ¶
func (msg MsgMintCoins) GetSigners() []sdk.AccAddress
GetSigners defines whose signature is required
func (MsgMintCoins) Route ¶
func (msg MsgMintCoins) Route() string
Route should return the name of the module
func (MsgMintCoins) ValidateBasic ¶
func (msg MsgMintCoins) ValidateBasic() sdk.Error
ValidateBasic runs stateless checks on the message
type MsgUnfreezeCoins ¶
type MsgUnfreezeCoins struct { Amount int64 `json:"amount"` Symbol string `json:"symbol"` Owner sdk.AccAddress `json:"owner"` }
MsgUnfreezeCoins defines the UnfreezeCoins message
func NewMsgUnfreezeCoins ¶
func NewMsgUnfreezeCoins(amount int64, symbol string, owner sdk.AccAddress) MsgUnfreezeCoins
NewMsgUnfreezeCoins is the constructor function for MsgUnfreezeCoins
func (MsgUnfreezeCoins) GetSignBytes ¶
func (msg MsgUnfreezeCoins) GetSignBytes() []byte
GetSignBytes encodes the message for signing
func (MsgUnfreezeCoins) GetSigners ¶
func (msg MsgUnfreezeCoins) GetSigners() []sdk.AccAddress
GetSigners defines whose signature is required
func (MsgUnfreezeCoins) Route ¶
func (msg MsgUnfreezeCoins) Route() string
Route should return the name of the module
func (MsgUnfreezeCoins) Type ¶
func (msg MsgUnfreezeCoins) Type() string
Type should return the action
func (MsgUnfreezeCoins) ValidateBasic ¶
func (msg MsgUnfreezeCoins) ValidateBasic() sdk.Error
ValidateBasic runs stateless checks on the message
type QueryResultSymbol ¶
type QueryResultSymbol []string
QueryResultSymbol is a payload for a symbols query
func (QueryResultSymbol) String ¶
func (r QueryResultSymbol) String() string
String implements fmt.Stringer
type Token ¶
type Token struct { Owner sdk.AccAddress `json:"owner"` Name string `json:"name"` // token name eg Fantom Chain Token Symbol string `json:"symbol"` // unique token trade symbol eg FTM-000 OriginalSymbol string `json:"original_symbol"` // token symbol eg FTM TotalSupply sdk.Coins `json:"total_supply"` // Total token supply Mintable bool `json:"mintable"` }
Token is a struct that contains all the metadata of the asset