multiApprove(contract, sender, currency, approved, amount)

Feature

Returns raw operation to approve token with multi item. Note: If you want to cancel the approve operation, execute approve function again with amount : 0.

Parameters

string | string[] contract address, // If given a string, it is automatically converted to an array filled with the same values. string sender, string currency ID, string[] array of account’s address to approve, string[] | int[] array of amount to approve

Return Value

object approve token operation with multi item.

example1. approve token to account(0x40…), account(0xC7…)

const contract = "0x04adb9825E50940E0722E795565a4f869e469005fca";
const sender = "0xF1858E0F9921ae2F1001F9B9132eFa15201E0318fca";
const currencyID = "MCC";
const approved = ["0x403683b62188B7bbBdFF6668e1e04e5e48cc9b05fca", "0xC7b22225DDBD8af09f3c635C3b6b8300beaBa041fca"];
const amount = [100, 4000]

const Operation = mitum.token.multiApprove(contract, sender, currencyID, approved, amount);
console.log(Operation);

// output
BaseOperation {
  id: 'mitum',
  fact: ApproveFact {
    hint: Hint { s: 'mitum-token-approve-operation-fact' },
    token: Token { s: '2026-02-19 03:21:45.787 +0000 UTC' },
    _hash: <Buffer 77 90 ea 64 ec 76 98 2c cf 93 78 eb 10 e2 f6 7f 2b ce d4 98 7f f3 d4 72 72 e3 e1 5b 94 0f 11 16>,
    sender: Address {
      s: '0xF1858E0F9921ae2F1001F9B9132eFa15201E0318fca',
      type: 'mitum'
    },
    items: [ [ApproveItem], [ApproveItem] ]
  },
  hint: Hint { s: 'mitum-token-approve-operation' },
  _factSigns: [],
  _hash: <Buffer >
}

example2. approve token on the contract(0x04…) and contract(0x1e…) to account(0x40…)

Last updated