gagliardetto / solana-go

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

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

Open BillInUK opened 1 day ago

BillInUK commented 1 day 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 day 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?

Darrellben commented 15 hours ago

Hi there @BillInUK ! To check the final status of a Solana transaction, use the getConfirmedTransaction or getSignatureStatus RPC methods, passing the transaction ID (txId); this will return whether the transaction was successful, failed, or discarded. If the problem persists, feel free to contact Solana Network dApps Support Team for further assistance.

Note: Click on the live chat bubble at the bottom-right of the page to chat with a live support agent.