Can I get the wait() from ContractTransaction type from a transaction hash? #3716
Replies: 2 comments 5 replies
-
Unfortunately that logic is quite complex and potentially incredible expensive to perform manually. Basically, once the tx is sent, each block with all transactions is fetched as they are mined, searching for the matching sender/nonce pair. So it is not easily accessible, since providing an incorrect block height can result in large amounts of traffic. In v6, it is possible to use the TransactionResponse object to do it, but the developer should be very aware of its implementation and what the consequences of specifying an incorrect block number are… See this method (I’ll be fleshing out the docs soon): https://docs.ethers.org/v6-beta/api/providers/#TransactionResponse-replaceableTransaction |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm sending the transaction hash to my API and wish to
wait()
on the transaction in the API, so I can be aware of any errors on the transaction (cancellation, replacement due to sped up transaction, etc.)However, it seems I can only call
wait()
when I get the ContractTransaction in the client-side and can't do it in the API. Is there a workaround for this?I hope I'm making sense
Beta Was this translation helpful? Give feedback.
All reactions