@@ -26,11 +26,24 @@ const metamaskSendTransaction = async (txn: FakeSignableTx, web3: Web3) => {
26 from: toHex(txn.from),
26 from: toHex(txn.from),
30+ if (window.ethereum) {
31+ //NOTE see also #596, #630, #646
32+ // no idea what's going on, we should figure it out,
33+ // but we apply this bandaid to hopefully stop the bleeding.
34+ // at least it also helps with the NOTE of the other branch.
35+ txHash = await window.ethereum.request({
36+ method: 'eth_sendTransaction',
37+ params: [metamaskFormattedTxn],
29− //NOTE since this gives us a receipt instead of just the hash of the signed
41+ //NOTE since this gives us a receipt instead of just the hash of the
30− // tx, it makes us wait for confirmation outside of our own
42+ // signed tx, it makes us wait for confirmation outside of our own
31− // waitForTransactionConfirm. because of this the progress bar loses
43+ // waitForTransactionConfirm. because of this the progress bar loses
32− // its progressiveness for metamask users.
44+ // its progressiveness for metamask users.
33− //TODO can we do better?
34− const receipt = await web3.eth.sendTransaction(metamaskFormattedTxn);
45+ let receipt = await await web3.eth.sendTransaction(metamaskFormattedTxn);
35− return receipt.transactionHash;
46+ txHash = receipt.transactionHash;