Documentation ¶
Index ¶
- Constants
- Variables
- func FromQuarks(quarks uint64) uint64
- func IsValidMemo(m Memo) bool
- func IsValidMemoStrict(m Memo) bool
- func MustStrToQuarks(val string) int64
- func StrFromQuarks(amount int64) string
- func StrToQuarks(val string) (int64, error)
- func ToQuarks(kin uint64) uint64
- type Memo
- type TransactionType
Constants ¶
const ( Mint = "kinXdEcpDQeHPEuQnqmUgtYykqKGVFq6CeVX5iAHJq6" QuarksPerKin = 100000 Decimals = 5 )
const HighestVersion = 1
HighestVersion is the highest 'supported' memo version by the implementation.
const MaxTransactionType = TransactionTypeP2P
MaxTransactionType is the maximum transaction type 'supported' by the implementation.
Variables ¶
var (
TokenMint = ed25519.PublicKey{11, 51, 56, 160, 171, 44, 200, 65, 213, 176, 20, 188, 106, 60, 247, 86, 41, 24, 116, 179, 25, 201, 81, 125, 155, 191, 169, 228, 233, 102, 30, 249}
)
Functions ¶
func FromQuarks ¶
func IsValidMemo ¶
IsValidMemo returns whether or not the memo is valid.
It should be noted that there are no guarantees if the memo is valid, only if the memo is invalid. That is, this function may return false positives.
Stricter validation can be done via the IsValidMemoStrict. However, IsValidMemoStrict is not as forward compatible as IsValidMemo.
func IsValidMemoStrict ¶
IsValidMemoStrict returns whether or not the memo is valid checking against this SDKs supported version and transaction types.
It should be noted that there are no guarantees if the memo is valid, only if the memo is invalid. That is, this function may return false positives.
func MustStrToQuarks ¶
MustStrToQuarks calls StrToQuarks, panicking if there's an error.
This should only be used if you know for sure this will not panic.
func StrFromQuarks ¶
StrFromQuarks converts an int64 amount of quarks to the string representation of kin.
func StrToQuarks ¶
StrToQuarks converts a string representation of kin the quark value.
An error is returned if the value string is invalid, or it cannot be accurately represented as quarks. For example, a value smaller than quarks, or a value _far_ greater than the supply.
Types ¶
type Memo ¶
type Memo [32]byte
Memo is the 32 byte memo encoded into transactions, as defined in github.com/kinecosystem/agora-api.
func (Memo) ForeignKey ¶
ForeignKey returns the foreign key of the memo.
func (Memo) TransactionType ¶
func (m Memo) TransactionType() TransactionType
TransactionType returns the transaction type of the memo.
func (Memo) TransactionTypeRaw ¶
func (m Memo) TransactionTypeRaw() TransactionType
TransactionTypeRaw returns the transaction type of the memo, even if it is unsupported by this SDK. It should only be used as a fall back if the raw value is needed when TransactionType() yields TransactionTypeUnknown.
type TransactionType ¶
type TransactionType int16
TransactionType is the memo transaction type.
const ( TransactionTypeUnknown TransactionType = iota - 1 TransactionTypeNone TransactionTypeEarn TransactionTypeSpend TransactionTypeP2P )