Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Asset

Class representing a steem asset, e.g. 1.000 STEEM or 12.112233 VESTS.

Hierarchy

  • Asset

Index

Constructors

constructor

Properties

amount

amount: number

symbol

symbol: AssetSymbol

Methods

add

divide

getPrecision

  • getPrecision(): 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

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 STEEM.

    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 STEEM.

    Parameters

    Returns Asset

Static max

Static min

Generated using TypeDoc