Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Amount

A Value Object to facilitate SIGNA and Planck conversions/calculations.

This class is a convenient wrapper around ChainValue with decimals = 8

Note: This class uses a big number representation (ES5 compatible) under the hood, so number limits and numeric calculations are much more precise than JS number type

Hierarchy

  • Amount

Index

Methods

add

clone

divide

  • divide(value: number): Amount

equals

  • equals(amount: Amount): boolean

getPlanck

  • getPlanck(): string

getRaw

  • getRaw(): BigNumber

getSigna

  • getSigna(): string

greater

  • greater(amount: Amount): boolean

greaterOrEqual

  • greaterOrEqual(amount: Amount): boolean
  • Checks for greater or equality value

    Parameters

    • amount: Amount

      The other value to be compared

    Returns boolean

    true if greater or equal, otherwise false

less

  • less(amount: Amount): boolean

lessOrEqual

  • lessOrEqual(amount: Amount): boolean
  • Checks for lesser or equality

    Parameters

    • amount: Amount

      The other value to be compared

    Returns boolean

    true if less or equal, otherwise false

multiply

  • multiply(value: number): Amount
  • Multiplies with a numeric value (not Amount)

    Parameters

    • value: number

      A numeric value to be multiplied with

    Returns Amount

    the mutated Amount object

setPlanck

  • setPlanck(p: string): Amount

setSigna

subtract

toString

Static CurrencySymbol

  • CurrencySymbol(): string

Static Zero

Static fromPlanck

  • fromPlanck(planck: number | string): Amount

Static fromSigna

  • fromSigna(signa: number | string): Amount