nftApproveOperation static method

UserOperation nftApproveOperation(
  1. EthereumAddress contractAddress,
  2. EthereumAddress owner,
  3. EthereumAddress spender,
  4. BigInt tokenId
)

Returns a UserOperation to approve the spender of the NFT.

  • contractAddress: The address of the contract.
  • owner: The address of the owner of the NFT.
  • spender: The address of the spender of the NFT.

Implementation

static UserOperation nftApproveOperation(EthereumAddress contractAddress,
    EthereumAddress owner, EthereumAddress spender, BigInt tokenId) {
  final innerCallData = execute(owner,
      to: contractAddress,
      innerCallData: encodeERC721ApproveCall(
        contractAddress,
        spender,
        tokenId,
      ));
  return UserOperation.partial(callData: hexlify(innerCallData));
}