Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add isTransactionReplaced method to SafeApiKit #1030

Open
hubagaspar91 opened this issue Oct 28, 2024 · 0 comments
Open

Add isTransactionReplaced method to SafeApiKit #1030

hubagaspar91 opened this issue Oct 28, 2024 · 0 comments

Comments

@hubagaspar91
Copy link

Context / issue

I've been working with the Safe SDKs for the past weeks, and they're pretty great, but there's a feature I think is missing specifically from the SafeApiKit - to be able to easily tell if an arbitrary Safe transaction was replaced (rejected).

I have implemented a solution for this in our project, which is quite simple, and I'd be happy to open a PR that implements that in the SafeApiKit itself.

Proposed solution

Basically, my solution would be:

  • Add an isTransactionReplaced or similarly named method to apiKit
  • It takes a safeAddress and either a safeTxHash or a SafeMultisigTransactionResponse | SafeMultisigTransaction
  • If a safeTxHash was provided, get the full transaction (apiKit.getTransaction(safeTxHash))
  • After that, query all transactions with the same nonce
  • If any is already executed, and has a different safeTxHash than what was provided, return true
  • Else return false

Alternatives

Maybe there's already a way to get this info easily using apiKit, if there is, feel free to close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant