Constructors

Properties

accountId: string

Methods

  • Transfer multiple tokens and amounts from one account to another

    Parameters

    • param: {
          amounts: (string | number | bigint)[];
          approvals?: [owner_id: string, approval_id: number][];
          from: AccountLike;
          memo?: string;
          receiverId: string;
          tokenIds: string[];
      }
      • amounts: (string | number | bigint)[]

        The amounts of each token to transfer in the smallest unit

      • Optionalapprovals?: [owner_id: string, approval_id: number][]

        Optional array of approval tuples [owner_id, approval_id] or nulls per tokenId

      • from: AccountLike

        The Account that will transfer the tokens

      • Optionalmemo?: string

        Optional memo for indexing

      • receiverId: string

        The AccountID that will receive the tokens

      • tokenIds: string[]

        The tokens to transfer

    Returns Promise<any>

  • Get the available balance of an account for the given token in indivisible units

    Parameters

    • account: AccountLike

      The account to get the balance of

    • tokenId: string

      The token to retrieve the balance from

    Returns Promise<bigint>

    The balance in the smallest unit as bigint

  • Get the available balances of an account for the given tokens in indivisible units

    Parameters

    • account: AccountLike

      The account to get the balances of

    • tokenIds: string[]

      The tokens to retrieve the balances from

    Returns Promise<bigint[]>

    The balances in the smallest unit as bigint[] matching the order of tokenIds

  • Transfer tokens from one account to another

    Parameters

    • param: {
          amount: string | number | bigint;
          approval?: [owner_id: string, approval_id: number];
          from: AccountLike;
          memo?: string;
          receiverId: string;
          tokenId: string;
      }
      • amount: string | number | bigint

        The amount of tokens to transfer in the smallest unit

      • Optionalapproval?: [owner_id: string, approval_id: number]

        Optional approval tuple [owner_id, approval_id]

      • from: AccountLike

        The Account that will transfer the tokens

      • Optionalmemo?: string

        Optional memo for indexing

      • receiverId: string

        The AccountID that will receive the tokens

      • tokenId: string

        The token to transfer

    Returns Promise<any>

  • Transfer tokens and call a function on the receiver contract. Only works if the receiver implements the mt_on_transfer method

    Parameters

    • param: {
          amount: bigint;
          approval?: [owner_id: string, approval_id: number];
          from: AccountLike;
          memo?: string;
          msg: string;
          receiverId: string;
          tokenId: string;
      }
      • amount: bigint

        The amount of tokens to transfer in the smallest unit

      • Optionalapproval?: [owner_id: string, approval_id: number]

        Optional approval tuple [owner_id, approval_id]

      • from: AccountLike

        The Account that will transfer the tokens

      • Optionalmemo?: string

        Optional memo for indexing

      • msg: string

        The message to send to the mt_on_transfer method

      • receiverId: string

        The AccountID that will receive the tokens

      • tokenId: string

        The token to transfer

    Returns Promise<any>