Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Asset

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

Hierarchy

  • Asset

Index

Constructors

constructor

  • Parameters

    Returns Asset

Properties

amount

amount: number

symbol

symbol: AssetSymbol

Methods

add

  • Return a new Asset instance with amount added.

    Parameters

    • amount: Asset | string | number

    Returns Asset

divide

  • Return a new Asset with the amount divided.

    Parameters

    • divisor: Asset | string | number

    Returns Asset

getPrecision

  • getPrecision(): number
  • Return asset precision.

    Returns number

multiply

  • multiply(factor: Asset | string | number): Asset
  • Return a new Asset with the amount multiplied by factor.

    Parameters

    • factor: Asset | string | number

    Returns Asset

steem_symbols

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

    Returns Asset

subtract

  • subtract(amount: Asset | string | number): Asset
  • Return a new Asset instance with amount subtracted.

    Parameters

    • amount: Asset | string | number

    Returns Asset

toJSON

  • toJSON(): string
  • For JSON serialization, same as toString().

    Returns string

toString

  • toString(): string
  • Return a string representation of this asset, e.g. 42.000 HIVE.

    Returns string

Static from

  • Convenience to create new Asset.

    Parameters

    • value: string | Asset | number
    • 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

Static fromString

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

    Parameters

    Returns Asset

Static max

  • Return the larger of the two assets.

    Parameters

    Returns Asset

Static min

  • Return the smaller of the two assets.

    Parameters

    Returns Asset

Generated using TypeDoc