gagliardetto / solana-go

Go SDK library and RPC client for the Solana Blockchain
Apache License 2.0
929 stars 264 forks source link

How can I confirm whether a Solana transaction was successful? #246

Open BillInUK opened 1 month ago

BillInUK commented 1 month ago

I asynchronously sent a Solana transaction and received a transaction ID (txId), but I want to know the final status of the transaction, including whether it was successful, failed to execute, or discarded.

BillInUK commented 1 month ago

If the transaction is successful, I can query the transaction using the transaction ID and then parse it to make a judgment. However, if the transaction is discarded, how can I accurately determine that?

BillInUK commented 1 month ago

May I confirm based on the slot of the block I referenced? For example, if the slot of the block I referenced is less than 30 slots behind the current one and I still can't find the transaction, should I consider the transaction as dropped?