What I have tried
I've previously used the @web3/solana
npm package, but ended up having to create my own (private) library due to using a niche language.
Here is what I'm trying to do:
- Serialize and sign a transaction (via a 3rd party)
- Send the signed transaction
- Wait for the transaction to be processed, and confirm its validity
Here is what I tried:
- Serialize and sign the transaction
- Send the transaction via sendTransaction rpc method
- Wait for the transaction to be committed via signatureSubscribe
- Use getTransaction to confirm the transaction details, assuming the call to
signatureSubscribe
did not close its connection early, and received asignatureNotification
payload
What the problem is
I've noticed that signatureSubscribe
can sometimes abruptly close my connection.
This results in my program thinking the transaction is invalid, when the transaction is actually valid.
Is this "transaction confirmation" strategy flawed? If a connection to signatureSubscribe
errors, should it be retried?
How can I know for certain whether or not a transaction is fully valid/invalid after sending it via the rpc method?