Transaction tools

  1. Can MetaMask send a webhook notifying the completion of a transaction?
  2. Can MetaMask provide a unique identifier to see transactions that have taken place?
  3. Is there a Javascript API to cancel transactions?
3 Likes

Hi @nejteh ,

Welcome to the MetaMask community :fox_face:

Have you taken a look at the MetaMask docs?

3 Likes

Yes we’ve been through them… maybe we missed something.

2 Likes
  1. Yes, you should track the status of your promise
try {
      your transaction (await)
    } catch (error) {
      throw new Error(error.message);
    } finally {
      immediately update state after tx
    }
  1. Yes, the above entity returns a value, after the promise is resolved

data.transactionHash

  1. Essentially, the only way to do this is to try to send another transaction using the same account and nonce combination and hope that it is mined before the transaction you want to reverse is mined. It’s merely a side effect of how nonce is used to guarantee transaction order rather than a cancellation feature.

Yon may use third party tools but as per github excerpts:

Use this code with your own reponsibility. And there’s no guarantee if this works

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.