Return useTransactor
's return value in useScaffoldContractWrite
's writeAsync
function
#585
-
Hello, I am wondering about this line in
My use case: My questions:
Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Just to be sure you can rely on const { isSuccess, data } = useScaffoldContractWrite({
contractName: "YourContract",
functionName: "setGreeting",
args: ["Hello World"],
onSuccess(data) {
console.log(data.hash);
resetForm();
},
}); Alternatively, you could also rely on
The return value |
Beta Was this translation helpful? Give feedback.
Just to be sure you can rely on
onSucess
which runs after the write is successful :Alternatively, you could also rely on
isSucess
variable.The return value
('0x${string}' | undefined)
is actually the transactionhash
which you can access throughdata
property returned byuseScaffoldContractWrite
or evenonSucess
function data.hash gives you same value 🙌