INNER CODE UNIT · JavaScript
ethAmt
CleBeert/crypto-trading-bot-eth-bnb · Arbitrage.js:188
const ethAmt = parseFloat(ETH_AMOUNT) * 1.2;
const amountInMax = ethers.utils.parseEther(ethAmt.toString());
const amountInMaxHex = ethers.BigNumber.from(amountInMax.toString()).toHexString();
const tx = await uniswap.swapETHForExactTokens(
amountOutHex,
path,
ACCOUNT,
deadlineHex,
{
value: amountInMaxHex,
gasPrice: ethers.BigNumber.from(newGasPrice).toHexString(),
gasLimit: ethers.BigNumber.from(gasLimit).toHexString()
}
);
console.log('\x1b[1m\x1b[37m[Bot]: Your purchase transaction was: \x1b[1m\x1b[32m', tx.hash, "\x1b[0m");
}
}