2

I am trying to fetch only the successful transactions on Solana. For this I use 2 functions under different scenarios, to fetch signatures and txns:

1. connection.getParsedTransaction(tx_signature, {commitment:'confirmed'});
2. connection.getSignaturesForAddress(address, {before: before_tx_signature, limit: tx_num || 10}, 'confirmed');

Even after using commitment as both finalized and confirmed, I still get failed transactions from the Solana blockchain. Is there a way to fetch only signatures and transactions that have been successful in Solana and not get the data for failed ones?

1 Answer 1

1

A transaction gets confirmed and finalized, whether it's a success or a failure, since the whole network needs to run it to be sure that it fails.

There is no way to only filter by success or failure at the JSON RPC level, so you have to fetch all transactions and filter out the failed transactions.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.