Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Asset

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

Hierarchy

  • Asset

Index

Constructors

constructor

  • Parameters

    Returns Asset

Properties

Readonly amount

amount: number

Readonly 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

subtract

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

    Parameters

    • amount: Asset | string | number

    Returns Asset

symbols

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

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

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

    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