I has code which sends ETH and ERC-20 and of which I want to make sense:
let tx1 = await transferETH(amount, privateKey);
console.log(`${tx1.hash}`);
const receipt1 = await tx1.wait();
console.log(`Done`);
And
let tx2 = await transferERC20(amount, privateKey);
console.log(`${tx2.hash}`);
const receipt2 = await tx2.wait();
console.log(`Done`);
I wonder, is it actually possible for a TX to produce hash before it's been mined into a block?
And which procedure takes at least 10 minutes, as per design of Ethereum protocol:
a) transfer and producing a hash - transferETH/ERC20
? Or b) mining a TX into a block - wait()
?
Or perhaps a) and b) are more or less close in terms of time they take? One goes immediately, in seconds, after the other, that is.