Options
All
  • Public
  • Public/Protected
  • All
Menu

Class BurstValue

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

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

  • BurstValue

Index

Methods

add

clone

divide

  • Divides by a numeric value (not BurstValue)

    Parameters

    • value: number

      A numeric value to be divided by

    Returns BurstValue

    the mutated BurstValue object

equals

getBurst

  • getBurst(): string

getPlanck

  • getPlanck(): string

getRaw

  • getRaw(): BigNumber
  • Leaky value getter

    Returns BigNumber

    the underlying value in its big number representation (immutable)

greater

greaterOrEqual

  • Checks for greater or equality value

    Parameters

    • burstValue: BurstValue

      The other value to be compared

    Returns boolean

    true if greater or equal, otherwise false

less

lessOrEqual

  • Checks for lesser or equality

    Parameters

    • burstValue: BurstValue

      The other value to be compared

    Returns boolean

    true if less or equal, otherwise false

multiply

  • Multiplies with a numeric value (not BurstValue)

    Parameters

    • value: number

      A numeric value to be multiplied with

    Returns BurstValue

    the mutated BurstValue object

setBurst

  • setBurst(b: string): void
  • Sets value as BURST, i.e. overwrites current hold value

    Parameters

    • b: string

      value in BURST

    Returns void

setPlanck

  • setPlanck(p: string): void
  • Sets value as Planck, i.e. overwrites current hold value

    Parameters

    • p: string

      The planck value

    Returns void

subtract

toString

  • Gets a string representation in form Ƀ 100 for BURST or ƀ 10000000000 for Planck

    Parameters

    Returns string

    The converted string accordingly the param in burst or Planck

Static Zero

Static fromBurst

Static fromPlanck