Hello Moralis Team,
wanted to ask you if Moralis is supporting speeding-up transactions via MetaMask on all 5 chains, POL, BSC, FTM, AVAX, ETH.
Currently most of the web3 libraries do not have support out of the box for transactions that has been speeded-up by a user using clients such as MetaMask.
Last year the founder of ethers.js added support for it, however, it does not seem to work on Polygon and BSC well. Havenât tested yet on FTM and AVAX.
Info about adding support:
https://blog.ricmoo.com/highlights-ethers-js-may-2021-2826e858277d
Thread about the support:
- Do you currently support it on all chains and it is working?
- Could you point me to the location in your docs if you do support it.
- Could you let me know if there are any caveats when integrating this functionality into react-app.
For clarity the way ethers.js is doing it is by having the following check:
// Send the transaction
const tx = await contract.transfer(to, amount);
try {
// Wait for the transaction to be mined
const receipt = await tx.wait();
// The transactions was mined without issue
myProcessMinedTransaction(tx, receipt);
} catch (error) {
if (error.code === Logger.errors.TRANSACTION_REPLACED) {
if (error.cancelled) {
// The transaction was replaced :'(
myProcessCancelledTransaction(tx, error.replacement);
} else {
// The user used "speed up" or something similar
// in their client, but we now have the updated info
myProcessMinedTransaction(error.replacement, error.receipt);
}
}
}
The problem is that on Polygon if you send first a transaction with low gas fee and then right after you use the speed up function in MetaMask, if the new transaction gets mined we get a new hash and at that point we should get to the:
catch (error) {
if (error.code === Logger.errors.TRANSACTION_REPLACED) {
if (error.cancelled) {
// The transaction was replaced :'(
myProcessCancelledTransaction(tx, error.replacement);
} else {
// The user used "speed up" or something similar
// in their client, but we now have the updated info
myProcessMinedTransaction(error.replacement, error.receipt);
}
}
But that never happens.
Thank you!
speed up, speeded up, sped up, speeded-up, speed-up, transactions, txs, new hash, trx, double hash, no receipt, dApp