safe-service-client(https://github.com/safe-global/safe-core-sdk/tree/main/packages/safe-service-client) to figure out if a transaction that is pending has been replaced/rejected or not.
I do the following:
- Fetch a transaction by
- Get safeInfo using
- Check if
safeInfo.nonce > fetchedTransaction.nonce && !fetchedTransaction.isExecuted, if true, then it means the transaction has been replaced by another since the safeNonce has moved up, but the transaction is still not executed.
This works OK mostly, but there is an intermittent case where the response in the first step says that the transaction has not yet been executed or successful (even though the transaction is successful if I manually check onchain) and the response in the second step gives a nonce that is higher that the transaction nonce. This leads my script to believe that the transaction was rejected, which in reality was successful.
Is there any other way to figure out if a transaction was rejected?