approveAll(contract, sender, approved, mode, currency)
Feature
Return raw operation that delegates or cancels permission to the given account for all NFTs owned by the sender.
Parameters
string
contract address,
string
sender,
string
approved,
”allow”
| ”cancel”
mode,
string
currency ID
Return Value
object
approveAll operation
mode == “allow” : delegate all permissions to the operator.
mode == “cancel” : If mode is 'false', revoke all privileges delegated to operator.
example
const contractAddress = "0x41EFb6902ADcb1214a7123b01af66b1D13b89864fca";
const sender = "0x4874C17C354c498cf44D2946612DBe47fBcE7E87fca";
const approved = "0x07469989b2562afF5E5C3B116CD3AA5Ef814e5a1fca";
const mode = "cancel";
const currencyID = "MCC";
const op = mitum.nft.approveAll(contractAddress, sender, approved, mode, currencyID);
console.log(op);
// output
Operation {
id: 'mitum',
fact: ApproveAllFact {
hint: Hint { s: 'mitum-nft-approve-all-operation-fact' },
token: Token { s: '2023-10-10 05:06:03.217 +0000 UTC' },
_hash: <Buffer 4e e0 c1 48 30 c8 9f 63 51 ef a2 0a 80 58 62 8e 17 d4 9a 93 4d 5b 4c 82 fa fc 5e 78 42 4b 47 a3>,
sender: Address {
s: '0x4874C17C354c498cf44D2946612DBe47fBcE7E87fca',
type: 'mitum'
},
items: [ [AppproveAllItem] ]
},
hint: Hint { s: 'mitum-nft-approve-all-operation' },
_factSigns: [],
_hash: <Buffer >
}
PreviousgetApproved(contract, nftIdx)Next⚠️ multiApproveAll(contract, sender, approved, mode, currency)
Last updated