INNER CODE UNIT · JavaScript
deadline
CleBeert/crypto-trading-bot-eth-bnb · swapWeb3.js:150
const deadline = Math.floor(Date.now() / 1000) + 60 * 20;
const deadlineHex = ethers.BigNumber.from(deadline.toString()).toHexString();
const nonceCount = await web3.eth.getTransactionCount(ACCOUNT)
const tx = await uniswap.swapExactTokensForETH(
amountInHex,
amountOutMinHex,
path,
ACCOUNT,
deadlineHex,
{
nonce: nonceCount + 1,
gasPrice: ethers.BigNumber.from(newGasPrice).toHexString(),
gasLimit: ethers.BigNumber.from(gasLimit).toHexString()
}
);
console.log('\x1b[1m\x1b[37m[Bot]: Your sell transaction was: \x1b[1m\x1b[32m', tx.hash, "\x1b[0m");