transferNFT method

Future<ISendUserOperationResponse> transferNFT(
  1. EthereumAddress nftContractAddress,
  2. EthereumAddress recipientAddress,
  3. num tokenId, [
  4. TxOptions? options,
])

Transfers an NFT with a given tokenId to the recipientAddress.

nftContractAddress - Address of the NFT contract. recipientAddress - Address of the recipient. tokenId - ID of the token to transfer. options - Additional transaction options.

Implementation

Future<ISendUserOperationResponse> transferNFT(
  EthereumAddress nftContractAddress,
  EthereumAddress recipientAddress,
  num tokenId, [
  TxOptions? options,
]) {
  final callData = ContractsUtils.encodeERC721SafeTransferCall(
    EthereumAddress.fromHex(wallet.getSender()),
    nftContractAddress,
    recipientAddress,
    BigInt.from(tokenId),
  );

  return _executeUserOperation(
    Call(
      to: nftContractAddress,
      value: BigInt.zero,
      data: callData,
    ),
    options,
  );
}