I use the following code to create the swap_transaction:
swap_transaction = router_contract.functions.swapETHForExactTokens(
0, [weth_address ,token_address], account_address, int(time.time()) + (10000)
).build_transaction(
{
'nonce': nonce,
'gas': 200000,
'gasPrice': w3.to_wei(gasprice,'gwei'),
'from': account_address,
'value': w3.to_wei(ether_amount,'ether')
}
)
Here I use the swapETHForExactTokens function but I have also seen the 'swapExactETHForTokensSupportingFeeOnTransferTokens' function. What is the difference between these two and which one should I use? In tutorials and the unofficial uniswap python package the 'swapETHForExactTokens' is used but when I go to etherscan I also see the other function. Thank you