# ⚠️ multiApproveAll(contract, sender, approved, mode, currency)

<table data-header-hidden><thead><tr><th width="144.5"></th><th></th></tr></thead><tbody><tr><td>Feature</td><td>Return raw operation with multiple item that delegates or cancels permission to the given account for all NFTs of given contract address owned by the sender.</td></tr><tr><td>Parameters</td><td><p><code>string</code> | <code>string[]</code> contract address, // If given a string, it is automatically converted to an array filled with the same values. </p><p><code>string</code> sender, </p><p><code>string[]</code> approved, </p><p><code>”allow”</code> | <code>”cancel”</code> mode, </p><p><code>string</code> currency ID</p></td></tr><tr><td>Return Value</td><td><code>object</code> approveAll operation</td></tr></tbody></table>

* mode == “allow” : delegate all permissions to the operator.
* mode == “cancel” : If mode is 'false', revoke all privileges delegated to operator.

example1. In contract(`0x54…`), all NFT rights owned by the sender are delegated to account(`0x79…`) and account(`0xAB…`).

```javascript
const contractAddress = "0x548a042cDe4589880dD53BacE89de602BefC5E2bfca";
const sender = "0x4526f3D0EdC63D9EaeCD94D56551e0f061CFCa47fca";
const currencyID = "MCC";

const approved = ["0x79245aF85B1D3d2CD49c77a717919dDF5537c11dfca","0xABC52ebcd61C0D448863df7d69389612953Bc698fca"]

const mintOperation = mitum.nft.multiApproveAll(contractAddress, sender, approved, "cancel", currencyID);
console.log(mintOperation);

console.log(op);

// output
Operation {
  id: 'mitum',
  fact: ApproveAllFact {
    hint: Hint { s: 'mitum-nft-approve-all-operation-fact' },
    token: Token { s: '2025-01-14 04:56:57.091 +0000 UTC' },
    _hash: <Buffer 06 ab 64 b0 92 e3 19 9c fd 51 4c 47 d4 46 02 5b 57 0a a3 89 26 2b c1 88 58 7d 8d a9 f2 91 97 12>,
    sender: Address {
      s: '0x4526f3D0EdC63D9EaeCD94D56551e0f061CFCa47fca',
      type: 'mitum'
    },
    items: [ [ApproveAllItem], [ApproveAllItem] ]
  },
  hint: Hint { s: 'mitum-nft-approve-all-operation' },
  _factSigns: [],
  _hash: <Buffer >
}
```

example2. In contract (`0x54…`), the sender's NFT rights are delegated to account(`0x4d…`); in contract account(`0x79…`), they are delegated to account(`0xAB…`).

```jsx
const contractAddress = ["0x548a042cDe4589880dD53BacE89de602BefC5E2bfca", "0x4d30d89CDb19DBc1Eb22DDBF5343D29932F2fF0afca"];
const sender = "0x4526f3D0EdC63D9EaeCD94D56551e0f061CFCa47fca";
const currencyID = "MCC";

const approved = ["0x79245aF85B1D3d2CD49c77a717919dDF5537c11dfca","0xABC52ebcd61C0D448863df7d69389612953Bc698fca"]

const mintOperation = mitum.nft.multiApproveAll(contractAddress, sender, approved, "cancel", currencyID);
console.log(mintOperation);

console.log(op);

// output
Operation {
  id: 'mitum',
  fact: ApproveAllFact {
    hint: Hint { s: 'mitum-nft-approve-all-operation-fact' },
    token: Token { s: '2025-01-14 04:56:57.091 +0000 UTC' },
    _hash: <Buffer 06 ab 64 b0 92 e3 19 9c fd 51 4c 47 d4 46 02 5b 57 0a a3 89 26 2b c1 88 58 7d 8d a9 f2 91 97 12>,
    sender: Address {
      s: '0x4526f3D0EdC63D9EaeCD94D56551e0f061CFCa47fca',
      type: 'mitum'
    },
    items: [ [ApproveAllItem], [ApproveAllItem] ]
  },
  hint: Hint { s: 'mitum-nft-approve-all-operation' },
  _factSigns: [],
  _hash: <Buffer >
}
```
