I need to send 0.1 ETH to 10 unique addresses from the same address at the same time. I am manually incrementing each transaction's nonce, and the transactions are sent successfully.
However, each transaction is entered into a new block. For example, transaction A in block 1, B in 2, C in 3, and so on. The problem is that this isn't scalable across n
transactions, because I'd have to wait for n
blocks to confirm.
Is there a proper way to batch-send ETH so that the collective of transactions confirms as quickly as possible?
Edit: This has only been tested on Kovan. Even with Kovan's 4 second block time, shouldn't transactions sent at the exact same time be included in the same block?
await
for the transactions to complete.BatchRequest
: web3js.readthedocs.io/en/v1.2.6/web3-eth.html#batchrequest. And you can never 100% guarantee to have all transactions in one block. It's up to the miner to decide which transactions to include. The only thing you can guarantee is the order by setting the nonce.BatchRequest
does the trick. Although, I can't get a transaction'sconfNumber
from aweb3.eth.sendSignedTransaction.request()
, only thetxHash
from the callback.