Function fromMAS

  • Convert any value expressed in Massa back to nanoMassa (the smallest unit of Massa). This function takes an input value in Massa and returns the equivalent value in nanoMassa.

    Parameters

    • amountInMassa: string | number | bigint | BigNumber

      The amount to convert, expressed in Massa. Can be a number, string, BigNumber, or bigint.

    Returns bigint

    The amount expressed in nanoMassa, as a bigint.

    Remarks

    Massa is a unit of currency and nanoMassa is a sub-unit, where 1 Massa equals 10^9 nanoMassa. This function uses the BigNumber library to perform calculations with arbitrary precision.

    Example

    const nanoMassa = fromMAS(1); // returns 1000000000n
    

Generated using TypeDoc