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

Feature: add Transaction Replacement support #6

Open
sambacha opened this issue Apr 18, 2022 · 0 comments
Open

Feature: add Transaction Replacement support #6

sambacha opened this issue Apr 18, 2022 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@sambacha
Copy link
Contributor

When using tx.wait() on a transaction made from the sendTransaction() method of a Signer (including non-constant methods on Contract), if the transaction is repriced or cancelled, a TRANSACTION_REPLACED error is thrown along with some extra details of what happened, allowing for appropriate “next steps” to be taken.

Error {
  code: "TRANSACTION_REPLACED",
  // The reason why the transaction was replaced
  // - "repriced" is generally nothing of concern, the 
  //   only difference in the transaction is the gasPrice
  // - "cancelled" means the `to` has been set to the `from`,
  //   the data has been set to `0x` and value set to 0
  // - "replaced" means that the transaction is unrelated to
  //   the original transaction
  reason: "repriced" | "cancelled" | "replaced",
  // This is a short-hand property as the effects of either a
  // "cancelled" or "replaced" tx are effectively cancelled
  cancelled: (reason === "cancelled" || reason === "replaced"),
  // The TransactionResponse which replaced the original
  replacement: [ the replacement transaction response ]
  // The TransactionReceipt of the replacement transaction
  receipt: [ the receipt for the replacement transaction ],
}

This should be supported 
@sambacha sambacha self-assigned this Apr 18, 2022
@sambacha sambacha added the enhancement New feature or request label Apr 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: 🔀 Backlog
Development

No branches or pull requests

1 participant