Function convertAmountFromHumanReadableToOnChain

  • Amount is represented in the smallest unit format on chain, this function converts a human readable amount format to the smallest unit format

    Parameters

    • value: number

      The value in human readable format

    • decimal: number

      The token decimal

    Returns number

    The value is smallest units

    Example

    human readable amount format: 500
    on chain amount format when decimal is 8: 50000000000