I am sending a transaction with sendSignedTransaction :
const tx = new Tx({ ... "gasPrice": web3.utils.toHex(41 * 1e9), ... } await web3.eth.sendSignedTransaction(serializedTx) .on('transactionHash', (hash) => { console.log('waiting....'); }) .on('receipt', (receipt) => { console.log('... Transaction validated !'); }); It works fine. Here is what i want to do:
- I want to set a very low value for gasPrice: For example 41 gwei
- If the transaction is not validated after 15 seconds, i want to increase gasPrice to 51 gwei
- etc.
How can I do that programmatically ?
Thanks