/*...inside hook...*/
// my function
const afterContractWrite = useCallback(
(result: <HowWouldYouDefineThisType?>) => {
onSettled?.();
return result.wait();
},
[onSettled]
);
//this method returns a Promise<SendTransactionResult> but the type is not exported from the lib so I can't just import it.
writeAsync?.()
.then(afterContractWrite)
/*...inside hook...*/
// my function
const afterContractWrite = useCallback(
(result: <HowWouldYouDefineThisType?>) => {
onSettled?.();
return result.wait();
},
[onSettled]
);
//this method returns a Promise<SendTransactionResult> but the type is not exported from the lib so I can't just import it.
writeAsync?.()
.then(afterContractWrite)