From 5af1c35618d7c564082a2673d352af8108a6ac2e Mon Sep 17 00:00:00 2001 From: Danil Date: Wed, 23 Nov 2022 13:37:48 +0100 Subject: [PATCH] Set timeout for sending eth Signed-off-by: Danil --- src/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index a51136e..79f81c7 100644 --- a/src/index.ts +++ b/src/index.ts @@ -160,8 +160,8 @@ async function sendETH(ethWallet: ethers.Wallet, to: string, amount: BigNumber) gasPrice }); console.log(`Sending ${ethers.utils.formatEther(amount)} ETH to ${to}, tx hash: ${tx.hash}`); - await tx.wait(); - + // Do not wait for more than 30 minutes + await ethWallet.provider.waitForTransaction(tx.hash, 3, 1800000); console.log(`Transfer has succeded, tx hash: ${tx.hash}`); }); } else {