Transfer NFT
Transfer NFT
To transfer an ERC721 (NFT) asset, use the transferNFT()
method. The method takes the following parameters as inputs:
Parameter | Type | Description |
---|---|---|
nftContractAddress | address | The contract address of the ERC721 asset |
recipientAddress | address | The recipient's wallet address |
tokenId | number | The ID of the asset you wish to transfer |
- Web
- Flutter
const nftContractAddress = "NFT_CONTRACT_ADDRESS";
const recipientAddress = "RECEIVER_ADDRESS";
const tokenId = 1;
const res = await fuseSDK.transferNFT(
nftContractAddress,
recipientAddress,
tokenId
);
console.log(`UserOpHash: ${res?.userOpHash}`);
console.log("Waiting for transaction...");
const receipt = await res?.wait();
console.log("Transaction Hash:", receipt?.transactionHash);
final tokenId = 1;
final res = await fuseSDK.transferNFT(
EthereumAddress.fromHex('NFT_CONTRACT_ADDRESS'),
EthereumAddress.fromHex('RECIPIENT_ADDRESS'),
tokenId,
);
print('UserOpHash: ${res.userOpHash}');
print('Waiting for transaction...');
final ev = await res.wait();
print('Transaction hash: ${ev?.transactionHash}');