⚠️ multiTransfer(contract, sender, receiver, nftIdx, currencyId)
Feature
Return raw operation to transfer multiple NFTs. The owner of the NFT or an approved account delegated can execute the operation to transfer ownership of the NFT to the 'receiver'.
Parameters
string | string[] contract address, // If given a string, it is automatically converted to an array filled with the same values.
string sender (= owner or approved account),
string[] receiver,
int[] nftIdx,
string currency Id
Return Value
object transfer Operation with multi item.
example1. transfer two nfts with index 0, 1 in contract (0x4d…) to receiver (0xA1…)
const contractAddress = "0x4d30d89CDb19DBc1Eb22DDBF5343D29932F2fF0afca";
const sender = "0x79245aF85B1D3d2CD49c77a717919dDF5537c11dfca";
const receiver = "0xA16532383f12A9a3dF61E9ff997a0211483AA8dEfca"
const currencyID = "MCC";
const mintOperation = mitum.nft.multiTransfer(contractAddress, sender, [receiver, receiver], [1, 2], currencyID);
console.log(mintOperation);
// output
Operation {
id: 'mitum',
fact: TransferFact {
hint: Hint { s: 'mitum-nft-transfer-operation-fact' },
token: Token { s: '2025-01-14 05:25:09.792 +0000 UTC' },
_hash: <Buffer 1b dc 48 41 f5 58 4e 80 c0 e0 fe 42 42 e3 26 52 4e 99 2c 82 f4 3f c3 42 93 42 7e 97 3d bb 5d 93>,
sender: Address {
s: '0x79245aF85B1D3d2CD49c77a717919dDF5537c11dfca',
type: 'mitum'
},
items: [ [TransferItem], [TransferItem] ]
},
hint: Hint { s: 'mitum-nft-transfer-operation' },
_factSigns: [],
_hash: <Buffer >
}example2. transfer a nft with index 0 in contract (0x4d…) to receiver (0xA1…) and transfer nft with index 0 in contract (0xd7…) to receiver (0x64…).
Previoustransfer(contract, sender, receiver, nftIdx, currencyId)NextgetNFTs(contract, factHash?, limit?, offset?, reverse?)
Last updated