I need to do a multihop swap. For example : BNB->USDT->TOKEN. I am trying to do this swap using pancakeswap roter v2 swapExactETHForTokens method. But I get execution reverted
swap_path = [input_token_address,
Web3.toChecksumAddress('0x55d398326f99059ff775485246999027b3197955'),
output_token_address]
tx = self.contract.functions.swapExactETHForTokens(min_tokens, swap_path, account_address (int(time.time()) + 10000)).buildTransaction(
{ 'from': account_address,
'value': input_quantity_wei,
'gasPrice': Web3.toWei(current_gas, 'gwei'),
'nonce': self.web3.eth.getTransactionCount(account_address)
})
How can I perform such a swap in a single transaction using web3 py?