Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "src/asset"

Index

Variables

Const CHAR_A

CHAR_A: u8 = 65

ASCII code of character A.

Const CHAR_Z

CHAR_Z: u8 = 90

ASCII code of character Z.

Const MAX_AMOUNT

MAX_AMOUNT: u64 = ((1 << 62) - 1)

max amount of Asset, which is 2^62 - 1.

Functions

StringToSymbol

  • StringToSymbol(precision: u8, str: string): u64
  • Encode a string to uint64 value, for example, let symbol = StringToSymbol(4, "ABC"); // symbol = 0x43424104 the precision number 4 means there are 4 digitals after ".", Asset "100.0000 ABC" will match this symbol.

    function

    StringToSymbol

    Parameters

    • precision: u8

      symbol precision

    • str: string

      symbol as string

    Returns u64

    uint64 value.

SymbolNameLength

  • SymbolNameLength(symbolName: u64): u32
  • retrieve symbol name length.

    function

    SymbolNameLength

    Parameters

    • symbolName: u64

      encoded symbol name.

    Returns u32

    uint32

Generated using TypeDoc