@hiveio/dhive
    Preparing search index...

    Class Asset

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

    Index
    amount: number
    symbol: AssetSymbol
    • 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 this asset in the NAI format used by block_api. The legacy STEEM/SBD and testnet TESTS/TBD symbols map to the HIVE and HBD NAIs.

      Returns NaiAsset

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

      Returns string

    • Convenience to create new Asset.

      Parameters

      • value: string | number | Asset | NaiAsset
      • 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 the NAI format used by block_api, e.g. {nai: '@@000000013', amount: '1000', precision: 3} for 1.000 HBD. Throws if the NAI is unknown, the precision does not match its symbol or the amount is not an integer string.

      Parameters

      Returns Asset

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

      Parameters

      Returns Asset