Documentation
¶
Overview ¶
Currency type implementation.
Default types for currency module implementation.
Implements destroy type for currencies module.
Implements errors codes and functions for currencies module.
Issue type implementation for currencies.
Querier.
Index ¶
- Constants
- Variables
- func ErrExistsIssue(issueID string) sdk.Error
- func ErrIncorrectDecimals(d1, d2 int8, symbol string) sdk.Error
- func ErrNotExistCurrency(symbol string) sdk.Error
- func ErrWrongAmount(amount string) sdk.Error
- func ErrWrongDecimals(decimals int8) sdk.Error
- func ErrWrongIssueID(issueID string) sdk.Error
- func ErrWrongRecipient() sdk.Error
- func ErrWrongSymbol(symbol string) sdk.Error
- func GetCurrencyKey(symbol string) []byte
- func GetDestroyKey(id sdk.Int) []byte
- func GetIssuesKey(issueID string) []byte
- func GetLastIDKey() []byte
- type Currency
- type CurrencyReq
- type Destroy
- type DestroyReq
- type Destroys
- type DestroysReq
- type Issue
- type IssueReq
Constants ¶
View Source
const ( ModuleName = "currencies" Router = ModuleName RouterKey = ModuleName DefaultCodespace sdk.CodespaceType = ModuleName )
View Source
const ( CodeErrWrongSymbol = 101 CodeErrWrongAmount = 102 CodeErrWrongDecimals = 103 CodeErrWrongIssueID = 104 CodeErrIncorrectDecimals = 105 CodeErrExistsIssue = 106 CodeErrNotExistCurrency = 107 CodeErrWrongRecipient = 108 )
Variables ¶
View Source
var ( KeyDelimiter = []byte(":") DestroyQueue = []byte("destroy") )
Functions ¶
func ErrIncorrectDecimals ¶
Currency.Decimals != decimals in request
func ErrNotExistCurrency ¶
Currency.Symbol != requested symbol
func ErrWrongIssueID ¶
Issue.Recipient is empty / Msg.IssueID is empty
Types ¶
type Currency ¶
type Currency struct {
CurrencyId sdk.Int `json:"currencyId" swaggertype:"string"`
Symbol string `json:"symbol" example:"dfi"` // Denom
Supply sdk.Int `json:"supply" swaggertype:"string" example:"100"` // Total amount
Decimals int8 `json:"decimals" example:"0"`
}
func NewCurrency ¶
New currency
type Destroy ¶
type Destroy struct {
ID types.Int `json:"id" swaggertype:"string" example:"0"` // CallID
ChainID string `json:"chainID" example:"testnet"`
Symbol string `json:"symbol" example:"dfi"`
Amount types.Int `json:"amount" swaggertype:"string" example:"100"`
Spender types.AccAddress `json:"spender" swaggertype:"string" format:"bech32" example:"wallet13jyjuz3kkdvqw8u4qfkwd94emdl3vx394kn07h"`
Recipient string `json:"recipient" format:"bech32" example:"wallet13jyjuz3kkdvqw8u4qfkwd94emdl3vx394kn07h"`
Timestamp int64 `json:"timestamp" format:"seconds" example:"1585295757"` // UNIX time
TxHash string `json:"tx_hash" example:"fd82ce32835dfd7042808eaf6ff09cece952b9da20460fa462420a93607fa96f"`
}
swagger:model
func NewDestroy ¶
type DestroyReq ¶
Request to get destroy by destroy id.
Click to show internal directories.
Click to hide internal directories.