I'm trying to send ETH in goerli by this code
let
provider = ethers.getDefaultProvider(process.env.ETHEREUM_NETWORK);
let wallet = new ethers.Wallet(prK, provider);
wallet.sendTransaction({
to: process.env.ADMIN_WALLET_ADDR_ON_ETHEREUM,
value: ethers.utils.parseEther("0.0001")
})
.then((x) => {
console.log(`OK: ${x}`)
});
While it'll send ETH successfully, and it'll appear on etherscan, it'll never get to the console.log(...)
part. That is, it'll stop and hang in the terminal indefinitely until I break it by Ctrl + C
.
What's the matter? How to fix it?