hey Moralis forum,
is there anyone who can tell me why this onsucces doesnât work?. when fired it instantly returns the console.log which it only should do when the contract interaction is finished. I would want to make the onsucces run as soon as the transaction is finished in metamask.
here is my react code
const contractProcessor = useWeb3ExecuteFunction();
async function caMint() {
let options = {
contractAddress: "0x19C15f883E9FE7f2168091567425DaD8ABC7b946",
functionName: "mint",
abi: abi,
params: {
_mintAmount: 1,
_merkleProof: [],
},
msgValue: Moralis.Units.ETH(0.066 * 1),
};
await contractProcessor.fetch({
params: options,
onSuccess: (data) => {
console.log(data);
console.log("mint done");
},
onComplete: () => {
console.log("done");
},
onError: (err) => {
console.log(err);
},
});
}