Class representing a blurt asset, e.g. 1.000 BLURT or 12.112233 VESTS.

Constructors

Properties

amount: number
symbol: AssetSymbol

Methods

  • For JSON serialization, same as toString().

    Returns string

  • Return a string representation of this asset, e.g. 42.000 BLURT.

    Returns string

  • Convenience to create new Asset.

    Parameters

    • value: string | number | Asset
    • Optionalsymbol: AssetSymbol

      Symbol to use when created from number. Will also be used to validate the asset, throws if the passed value has a different symbol than this.

    Returns Asset

  • Create a new Asset instance from detail, e.g. { amount: "101000", precision: 6, nai: "@@000000037" } @@000000021 => BLURT_SYMBOL @@000000037 => VESTS_SYMBOL

    Parameters

    • value: {
          amount: string;
          nai: string;
          precision: number;
      }
      • amount: string
      • nai: string
      • precision: number

    Returns Asset

  • Create a new Asset instance from a string, e.g. 42.000 BLURT.

    Parameters

    Returns Asset