I am using a useWeb3Contract
hook and using runContractFunction
I am calling the contract function. I am handling the errors of this function call using onError
function provided by runContractFunction
, as you can below;
await preMintNFT({
onSuccess: (tx) => handleSuccess(tx as ContractTransaction),
onError: (error) => {
handleErrors(error);
},
});
This is the error that Metamask throw, but I am not able to get these error key/value using the error
instance provided by the OnError
function.
I am looking forward to the solution. Thanks.