Class Asset

Class representing a hive asset, e.g. 1.000 HIVE or 12.112233 VESTS.

Hierarchy

  • Asset

Constructors

Properties

amount: number
symbol: AssetSymbol

Methods

  • Return a new Asset instance with amount added.

    Parameters

    • amount: string | number | Asset

    Returns Asset

  • Return a new Asset with the amount divided.

    Parameters

    • divisor: string | number | Asset

    Returns Asset

  • Return asset precision.

    Returns number

  • Return a new Asset with the amount multiplied by factor.

    Parameters

    • factor: string | number | Asset

    Returns Asset

  • returns a representation of this asset using only STEEM SBD for legacy purposes

    Returns Asset

  • Return a new Asset instance with amount subtracted.

    Parameters

    • amount: string | number | Asset

    Returns Asset

  • For JSON serialization, same as toString().

    Returns string

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

    Returns string

  • Convenience to create new Asset.

    Parameters

    • value: string | number | Asset
    • Optional symbol: 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 a string, e.g. 42.000 HIVE.

    Parameters

    Returns Asset

Generated using TypeDoc