@itsybitsycyber,
I added an approval button in the NFT balance tab, which should allow a user to give the market place permission to transfer the users NFTs. It should be updated on the âethereum-nft-marketplace-boilerplateâ repository on GitHub, if you wanna have a look for yourself, but here is the general idea:
const contractProcessor = useWeb3ExecuteFunction();
async function approveAll(nft) {
setLoading(true);
const ops = {
contractAddress: nft.token_address,
functionName: "setApprovalForAll",
abi: [{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"}],
params: {
operator: marketAddress,
approved: true
},
};
await contractProcessor.fetch({
params: ops,
onSuccess: () => {
console.log("Approval Received");
setLoading(false);
setVisibility(false);
succApprove();
},
onError: (error) => {
setLoading(false);
failApprove();
},
});
}
I tested it out by authenticating with a new user and it seemed to work good allowing me set approval and after that list the NFT
@lion33, @Skanus you might also find this helpfulâŚ