Why would I do polling with getTransaction
or getSignatureStatus
, when I can just use sendAndConfirm
to check the tx status?
1 Answer
I can see polling to be useful if I wanted to display the TX state in realtime.
Although it seems like sendAndConfirm
is an abstracted method on top of getSignatureStatus
polling
Answer 1:
You can't sendAndConfirm on the frontend using the wallet adapter. You gotta use the wallet's sign method, then send the signed transaction, and thus you will have to poll the transaction status to check for inclusion in a block
Answer 2
It's useful for fault tolerance -- If you're sending a tx from a server w/ sendAndConfirm, and the server crashes, when you start up again, you have no idea of which transactions were in progress.
More context and answers in this twitter thread.