near-api-js - v7.0.4
    Preparing search index...

    Class NativeToken

    Hierarchy

    • BaseFT
      • NativeToken
    Index

    Constructors

    Properties

    metadata: FTMetadata

    Methods

    • Get the available balance of an account in indivisible units

      Parameters

      • account: Account

        The account to get the balance of

      Returns Promise<bigint>

    • Converts indivisible units to a decimal number (represented as a string)

      Parameters

      • amount: string | number | bigint

        The amount in indivisible units (e.g. "1234")

      • Optionalprecision: number

        (optional) number of digits shown to the right of the decimal point - rounded down

      Returns string

      The amount as a decimal string (e.g. "1.234")

    • Converts a decimal number to indivisible units

      Parameters

      • amount: string | number

        The amount in decimal format (e.g. "1.234")

      Returns bigint

      The amount in indivisible units (e.g. "1234")

    • Transfer tokens from one account to another

      Parameters

      • param: { amount: string | number | bigint; from: Account; receiverId: string }
        • amount: string | number | bigint

          The amount of tokens to transfer in the smallest unit

        • from: Account

          The Account that will transfer the tokens

        • receiverId: string

          The AccountID that will receive the tokens

      Returns Promise<any>