I want do something after transaction request confirmed

hi everybody , i want to run a code after request confirmed . how ?
this is my code :

  method: 'eth_sendTransaction',
  params: [txConfig],
console.log('err transaction');
1 Like

Hello @ho3einfaramarzi, welcome to MetaMask community!

You can try going through the MetaMask docs and Github repository for a solution to your issue.

1 Like


Hello, I don’t quite understand what your problem is, perhaps incorrect type casting in comparison
(line 5)

Please see the javascript documentation as requested Strict Equality


hi , this is a simple code .
i want to wait for confirmation transaction

Hi, try a finally block to mutate the state after the transaction is completed

try {
      return await contract.methods
        .send({ from: account.account, value: priceInWei });
    } catch (error) { 
       throw new Error(error.message);
    } finally {
         // immediately update state after tx
1 Like

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