nftApproveOperation static method
- EthereumAddress contractAddress,
- EthereumAddress owner,
- EthereumAddress spender,
- 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));
}