how can I retrieve a value from the smart contract using useWeb3ExecuteFunction() ?
in ethers it would be
const nftNumber = await contract.totalNftStaked();
setSomething(nftNumber.toString() )
however I donโt succeed to retrieve a value from the smart contract and store it into a useState using
useWeb3ExecuteFunction
this is my code
const contractProcessor = useWeb3ExecuteFunction();
async function getUserNftIds() {
let options = {
contractAddress: "0x21daB594d4726d1e12fAD9b5aE7EE270C07F6b75",
functionName: "getUserNftIds",
abi: abi,
params: {
user: account,
},
// msgValue: val,
};
await contractProcessor.fetch({
params: options,
onSuccess: () => {
console.log("Approval Received");
},
onError: (error) => {
console.log("error", error);
},
});
}
thank you