starknet-react icon indicating copy to clipboard operation
starknet-react copied to clipboard

feat: add optional callback to handle tx status changing

Open J4ckyLIM opened this issue 2 years ago • 3 comments

Add optional callback functions to useTransaction and useTransactions hook that will handle each status of the transaction.

J4ckyLIM avatar Oct 01 '22 15:10 J4ckyLIM

Looks good, but I believe the callbacks should be called inside the onSuccess callback for useQuery.

fracek avatar Oct 01 '22 17:10 fracek

Yep you're right, it would make more sense !

J4ckyLIM avatar Oct 01 '22 17:10 J4ckyLIM

Hey @J4ckyLIM, any blocker on this issue I can help with?

fracek avatar Oct 10 '22 09:10 fracek

This can be reviewed I think :)

J4ckyLIM avatar Oct 18 '22 07:10 J4ckyLIM

Hey, I added the useTransactionReceipt hook in #180. I think you should add the callbacks to that hook and not useTransaction.

fracek avatar Oct 18 '22 19:10 fracek

You're right, it makes more sense, i'll do to it ASAP :) (likely in 10 hours or so)

J4ckyLIM avatar Oct 19 '22 08:10 J4ckyLIM

Closing this PR, work done here

J4ckyLIM avatar Oct 19 '22 17:10 J4ckyLIM