Im building an app to do trades on uniswap using ethers module. ive created contracts and imported the router and the factory contracts using this code:
const factory = new ethers.Contract(
addresses.factory,
['event PairCreated(address indexed token0, address indexed token1, address pair, uint)'],
account
);
const router = new ethers.Contract(
addresses.router,
[
'function getAmountsOut(uint amountIn, address[] memory path) public view returns (uint[] memory amounts)',
'function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts)'
],
account
);
And now i pull a trade using swapExactETHForTokens function:
const tx = await router.swapExactETHForTokens(
amountOutMin // Slippage is set here too, if not wanted change to => amounts[1]
[tokenIn, tokenOut],
addresses.recipient,
Date.now() + 1000 * 60 //1 minute expiry time for contract.
);
My question is how do i implement custom gwei in my trade , there dont appeart to be an argument within uniswap trade functions for gwei at all.