title: Python - how to get ethereum transactions?
body: <p>I'm getting started to Ethereum and Web3py and i would like to get transactions happening whenever they happen on a <a href="https://etherscan.io/txs?a=0x7a250d5630b4cf539739df2c5dacb4c659f2488d&amp;__cf_chl_jschl_tk__=f0f49f7b3123f0aaacde1b354ce05b09a4b56bc7-1613383659-0-AT9smBzL4c9A5Ra3NhnhXPb8siE0cJGZUVJ15cct1-odbdY7qNy6inhNz_iLxDxG4_xTANua8dGxmNGL_1bvctyh27wp588Or35i9naXbGgp7exsaI5T8RvH_h2r9BqsHfSQwzcjFfzBc9CwEEgdTnSgHer8FIPHloVze_2JVCy1He7e18cd3taERx3xQC_PZIEbQHyyVUZ3zm8vCULqqSqmKoc8oquSwQHh91QpYhw6SGfQ-GdI0E4AsBHvE-SxHAistXNXJHF8clXR_h6cJO-gwE8mqQ9t_IDuuxCkkcndjkG6joOpCwmYLFC3FksVZMWvE3Va4TJ6I_bKFlBG-ehFkrCDDo_Ta2ST-OiOsbI0WZ5l8vXE0nL4yEJVSdoRwg" rel="nofollow noreferrer">specific address</a>. In order to do this, i signed up to infura and got my project ID. So here is what i tried:</p>
  <pre><code>from web3 import Web3
  import asyncio
  import websockets
  
  ABI = {&quot;inputs&quot;:[{&quot;internalType&quot;:&quot;address&quot;,&quot;name&quot;:&quot;_factory&quot;,&quot;type&quot;:&quot;address&quot;},{&quot;internalType&quot;:&quot;address&quot;,&quot;name&quot;:&quot;_WETH&quot;,&quot;type&quot;:&quot;address&quot;}],&quot;stateMutability&quot;:&quot;nonpayable&quot;,&quot;type&quot;:&quot;constructor&quot;},{&quot;inputs&quot;:[],&quot;name&quot;:&quot;WETH&quot;,&quot;outputs&quot;:[{&quot;internalType&quot;:&quot;address&quot;,&quot;name&quot;:&quot;&quot;,&quot;type&quot;:&quot;address&quot;}],&quot;stateMutability&quot;:&quot;view&quot;,&quot;type&quot;:&quot;function&quot;},{&quot;inputs&quot;:[{&quot;internalType&quot;:&quot;address&quot;,&quot;name&quot;:&quot;tokenA&quot;,&quot;type&quot;:&quot;address&quot;},{&quot;internalType&quot;:&quot;address&quot;,&quot;name&quot;:&quot;tokenB&quot;,&quot;type&quot;:&quot;address&quot;},{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;amountADesired&quot;,&quot;type&quot;:&quot;uint256&quot;},{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;amountBDesired&quot;,&quot;type&quot;:&quot;uint256&quot;},{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;amountAMin&quot;,&quot;type&quot;:&quot;uint256&quot;},{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;amountBMin&quot;,&quot;type&quot;:&quot;uint256&quot;},{&quot;internalType&quot;:&quot;address&quot;,&quot;name&quot;:&quot;to&quot;,&quot;type&quot;:&quot;address&quot;},{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;deadline&quot;,&quot;type&quot;:&quot;uint256&quot;}],&quot;name&quot;:&quot;addLiquidity&quot;,&quot;outputs&quot;:[{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;amountA&quot;,&quot;type&quot;:&quot;uint256&quot;},{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;amountB&quot;,&quot;type&quot;:&quot;uint256&quot;},{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;liquidity&quot;,&quot;type&quot;:&quot;uint256&quot;}],&quot;stateMutability&quot;:&quot;nonpayable&quot;,&quot;type&quot;:&quot;function&quot;},{&quot;inputs&quot;:[{&quot;internalType&quot;:&quot;address&quot;,&quot;name&quot;:&quot;token&quot;,&quot;type&quot;:&quot;address&quot;},{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;amountTokenDesired&quot;,&quot;type&quot;:&quot;uint256&quot;},{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;amountTokenMin&quot;,&quot;type&quot;:&quot;uint256&quot;},{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;amountETHMin&quot;,&quot;type&quot;:&quot;uint256&quot;},{&quot;internalType&quot;:&quot;address&quot;,&quot;name&quot;:&quot;to&quot;,&quot;type&quot;:&quot;address&quot;},{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;deadline&quot;,&quot;type&quot;:&quot;uint256&quot;}],&quot;name&quot;:&quot;addLiquidityETH&quot;,&quot;outputs&quot;:[{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;amountToken&quot;,&quot;type&quot;:&quot;uint256&quot;},{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;amountETH&quot;,&quot;type&quot;:&quot;uint256&quot;},{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;liquidity&quot;,&quot;type&quot;:&quot;uint256&quot;}],&quot;stateMutability&quot;:&quot;payable&quot;,&quot;type&quot;:&quot;function&quot;},{&quot;inputs&quot;:[],&quot;name&quot;:&quot;factory&quot;,&quot;outputs&quot;:[{&quot;internalType&quot;:&quot;address&quot;,&quot;name&quot;:&quot;&quot;,&quot;type&quot;:&quot;address&quot;}],&quot;stateMutability&quot;:&quot;view&quot;,&quot;type&quot;:&quot;function&quot;},{&quot;inputs&quot;:[{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;amountOut&quot;,&quot;type&quot;:&quot;uint256&quot;},{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;reserveIn&quot;,&quot;type&quot;:&quot;uint256&quot;},{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;reserveOut&quot;,&quot;type&quot;:&quot;uint256&quot;}],&quot;name&quot;:&quot;getAmountIn&quot;,&quot;outputs&quot;:[{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;amountIn&quot;,&quot;type&quot;:&quot;uint256&quot;}],&quot;stateMutability&quot;:&quot;pure&quot;,&quot;type&quot;:&quot;function&quot;},{&quot;inputs&quot;:[{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;amountIn&quot;,&quot;type&quot;:&quot;uint256&quot;},{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;reserveIn&quot;,&quot;type&quot;:&quot;uint256&quot;},{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;reserveOut&quot;,&quot;type&quot;:&quot;uint256&quot;}],&quot;name&quot;:&quot;getAmountOut&quot;,&quot;outputs&quot;:[{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;amountOut&quot;,&quot;type&quot;:&quot;uint256&quot;}],&quot;stateMutability&quot;:&quot;pure&quot;,&quot;type&quot;:&quot;function&quot;},{&quot;inputs&quot;:[{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;amountOut&quot;,&quot;type&quot;:&quot;uint256&quot;},{&quot;internalType&quot;:&quot;address[]&quot;,&quot;name&quot;:&quot;path&quot;,&quot;type&quot;:&quot;address[]&quot;}],&quot;name&quot;:&quot;getAmountsIn&quot;,&quot;outputs&quot;:[{&quot;internalType&quot;:&quot;uint256[]&quot;,&quot;name&quot;:&quot;amounts&quot;,&quot;type&quot;:&quot;uint256[]&quot;}],&quot;stateMutability&quot;:&quot;view&quot;,&quot;type&quot;:&quot;function&quot;},{&quot;inputs&quot;:[{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;amountIn&quot;,&quot;type&quot;:&quot;uint256&quot;},{&quot;internalType&quot;:&quot;address[]&quot;,&quot;name&quot;:&quot;path&quot;,&quot;type&quot;:&quot;address[]&quot;}],&quot;name&quot;:&quot;getAmountsOut&quot;,&quot;outputs&quot;:[{&quot;internalType&quot;:&quot;uint256[]&quot;,&quot;name&quot;:&quot;amounts&quot;,&quot;type&quot;:&quot;uint256[]&quot;}],&quot;stateMutability&quot;:&quot;view&quot;,&quot;type&quot;:&quot;function&quot;},{&quot;inputs&quot;:[{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;amountA&quot;,&quot;type&quot;:&quot;uint256&quot;},{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;reserveA&quot;,&quot;type&quot;:&quot;uint256&quot;},{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;reserveB&quot;,&quot;type&quot;:&quot;uint256&quot;}],&quot;name&quot;:&quot;quote&quot;,&quot;outputs&quot;:[{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;amountB&quot;,&quot;type&quot;:&quot;uint256&quot;}],&quot;stateMutability&quot;:&quot;pure&quot;,&quot;type&quot;:&quot;function&quot;},{&quot;inputs&quot;:[{&quot;internalType&quot;:&quot;address&quot;,&quot;name&quot;:&quot;tokenA&quot;,&quot;type&quot;:&quot;address&quot;},{&quot;internalType&quot;:&quot;address&quot;,&quot;name&quot;:&quot;tokenB&quot;,&quot;type&quot;:&quot;address&quot;},{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;liquidity&quot;,&quot;type&quot;:&quot;uint256&quot;},{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;amountAMin&quot;,&quot;type&quot;:&quot;uint256&quot;},{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;amountBMin&quot;,&quot;type&quot;:&quot;uint256&quot;},{&quot;internalType&quot;:&quot;address&quot;,&quot;name&quot;:&quot;to&quot;,&quot;type&quot;:&quot;address&quot;},{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;deadline&quot;,&quot;type&quot;:&quot;uint256&quot;}],&quot;name&quot;:&quot;removeLiquidity&quot;,&quot;outputs&quot;:[{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;amountA&quot;,&quot;type&quot;:&quot;uint256&quot;},{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;amountB&quot;,&quot;type&quot;:&quot;uint256&quot;}],&quot;stateMutability&quot;:&quot;nonpayable&quot;,&quot;type&quot;:&quot;function&quot;},{&quot;inputs&quot;:[{&quot;internalType&quot;:&quot;address&quot;,&quot;name&quot;:&quot;token&quot;,&quot;type&quot;:&quot;address&quot;},{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;liquidity&quot;,&quot;type&quot;:&quot;uint256&quot;},{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;amountTokenMin&quot;,&quot;type&quot;:&quot;uint256&quot;},{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;amountETHMin&quot;,&quot;type&quot;:&quot;uint256&quot;},{&quot;internalType&quot;:&quot;address&quot;,&quot;name&quot;:&quot;to&quot;,&quot;type&quot;:&quot;address&quot;},{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;deadline&quot;,&quot;type&quot;:&quot;uint256&quot;}],&quot;name&quot;:&quot;removeLiquidityETH&quot;,&quot;outputs&quot;:[{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;amountToken&quot;,&quot;type&quot;:&quot;uint256&quot;},{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;amountETH&quot;,&quot;type&quot;:&quot;uint256&quot;}],&quot;stateMutability&quot;:&quot;nonpayable&quot;,&quot;type&quot;:&quot;function&quot;},{&quot;inputs&quot;:[{&quot;internalType&quot;:&quot;address&quot;,&quot;name&quot;:&quot;token&quot;,&quot;type&quot;:&quot;address&quot;},{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;liquidity&quot;,&quot;type&quot;:&quot;uint256&quot;},{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;amountTokenMin&quot;,&quot;type&quot;:&quot;uint256&quot;},{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;amountETHMin&quot;,&quot;type&quot;:&quot;uint256&quot;},{&quot;internalType&quot;:&quot;address&quot;,&quot;name&quot;:&quot;to&quot;,&quot;type&quot;:&quot;address&quot;},{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;deadline&quot;,&quot;type&quot;:&quot;uint256&quot;}],&quot;name&quot;:&quot;removeLiquidityETHSupportingFeeOnTransferTokens&quot;,&quot;outputs&quot;:[{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;amountETH&quot;,&quot;type&quot;:&quot;uint256&quot;}],&quot;stateMutability&quot;:&quot;nonpayable&quot;,&quot;type&quot;:&quot;function&quot;},{&quot;inputs&quot;:[{&quot;internalType&quot;:&quot;address&quot;,&quot;name&quot;:&quot;token&quot;,&quot;type&quot;:&quot;address&quot;},{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;liquidity&quot;,&quot;type&quot;:&quot;uint256&quot;},{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;amountTokenMin&quot;,&quot;type&quot;:&quot;uint256&quot;},{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;amountETHMin&quot;,&quot;type&quot;:&quot;uint256&quot;},{&quot;internalType&quot;:&quot;address&quot;,&quot;name&quot;:&quot;to&quot;,&quot;type&quot;:&quot;address&quot;},{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;deadline&quot;,&quot;type&quot;:&quot;uint256&quot;},{&quot;internalType&quot;:&quot;bool&quot;,&quot;name&quot;:&quot;approveMax&quot;,&quot;type&quot;:&quot;bool&quot;},{&quot;internalType&quot;:&quot;uint8&quot;,&quot;name&quot;:&quot;v&quot;,&quot;type&quot;:&quot;uint8&quot;},{&quot;internalType&quot;:&quot;bytes32&quot;,&quot;name&quot;:&quot;r&quot;,&quot;type&quot;:&quot;bytes32&quot;},{&quot;internalType&quot;:&quot;bytes32&quot;,&quot;name&quot;:&quot;s&quot;,&quot;type&quot;:&quot;bytes32&quot;}],&quot;name&quot;:&quot;removeLiquidityETHWithPermit&quot;,&quot;outputs&quot;:[{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;amountToken&quot;,&quot;type&quot;:&quot;uint256&quot;},{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;amountETH&quot;,&quot;type&quot;:&quot;uint256&quot;}],&quot;stateMutability&quot;:&quot;nonpayable&quot;,&quot;type&quot;:&quot;function&quot;},{&quot;inputs&quot;:[{&quot;internalType&quot;:&quot;address&quot;,&quot;name&quot;:&quot;token&quot;,&quot;type&quot;:&quot;address&quot;},{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;liquidity&quot;,&quot;type&quot;:&quot;uint256&quot;},{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;amountTokenMin&quot;,&quot;type&quot;:&quot;uint256&quot;},{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;amountETHMin&quot;,&quot;type&quot;:&quot;uint256&quot;},{&quot;internalType&quot;:&quot;address&quot;,&quot;name&quot;:&quot;to&quot;,&quot;type&quot;:&quot;address&quot;},{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;deadline&quot;,&quot;type&quot;:&quot;uint256&quot;},{&quot;internalType&quot;:&quot;bool&quot;,&quot;name&quot;:&quot;approveMax&quot;,&quot;type&quot;:&quot;bool&quot;},{&quot;internalType&quot;:&quot;uint8&quot;,&quot;name&quot;:&quot;v&quot;,&quot;type&quot;:&quot;uint8&quot;},{&quot;internalType&quot;:&quot;bytes32&quot;,&quot;name&quot;:&quot;r&quot;,&quot;type&quot;:&quot;bytes32&quot;},{&quot;internalType&quot;:&quot;bytes32&quot;,&quot;name&quot;:&quot;s&quot;,&quot;type&quot;:&quot;bytes32&quot;}],&quot;name&quot;:&quot;removeLiquidityETHWithPermitSupportingFeeOnTransferTokens&quot;,&quot;outputs&quot;:[{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;amountETH&quot;,&quot;type&quot;:&quot;uint256&quot;}],&quot;stateMutability&quot;:&quot;nonpayable&quot;,&quot;type&quot;:&quot;function&quot;},{&quot;inputs&quot;:[{&quot;internalType&quot;:&quot;address&quot;,&quot;name&quot;:&quot;tokenA&quot;,&quot;type&quot;:&quot;address&quot;},{&quot;internalType&quot;:&quot;address&quot;,&quot;name&quot;:&quot;tokenB&quot;,&quot;type&quot;:&quot;address&quot;},{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;liquidity&quot;,&quot;type&quot;:&quot;uint256&quot;},{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;amountAMin&quot;,&quot;type&quot;:&quot;uint256&quot;},{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;amountBMin&quot;,&quot;type&quot;:&quot;uint256&quot;},{&quot;internalType&quot;:&quot;address&quot;,&quot;name&quot;:&quot;to&quot;,&quot;type&quot;:&quot;address&quot;},{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;deadline&quot;,&quot;type&quot;:&quot;uint256&quot;},{&quot;internalType&quot;:&quot;bool&quot;,&quot;name&quot;:&quot;approveMax&quot;,&quot;type&quot;:&quot;bool&quot;},{&quot;internalType&quot;:&quot;uint8&quot;,&quot;name&quot;:&quot;v&quot;,&quot;type&quot;:&quot;uint8&quot;},{&quot;internalType&quot;:&quot;bytes32&quot;,&quot;name&quot;:&quot;r&quot;,&quot;type&quot;:&quot;bytes32&quot;},{&quot;internalType&quot;:&quot;bytes32&quot;,&quot;name&quot;:&quot;s&quot;,&quot;type&quot;:&quot;bytes32&quot;}],&quot;name&quot;:&quot;removeLiquidityWithPermit&quot;,&quot;outputs&quot;:[{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;amountA&quot;,&quot;type&quot;:&quot;uint256&quot;},{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;amountB&quot;,&quot;type&quot;:&quot;uint256&quot;}],&quot;stateMutability&quot;:&quot;nonpayable&quot;,&quot;type&quot;:&quot;function&quot;},{&quot;inputs&quot;:[{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;amountOut&quot;,&quot;type&quot;:&quot;uint256&quot;},{&quot;internalType&quot;:&quot;address[]&quot;,&quot;name&quot;:&quot;path&quot;,&quot;type&quot;:&quot;address[]&quot;},{&quot;internalType&quot;:&quot;address&quot;,&quot;name&quot;:&quot;to&quot;,&quot;type&quot;:&quot;address&quot;},{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;deadline&quot;,&quot;type&quot;:&quot;uint256&quot;}],&quot;name&quot;:&quot;swapETHForExactTokens&quot;,&quot;outputs&quot;:[{&quot;internalType&quot;:&quot;uint256[]&quot;,&quot;name&quot;:&quot;amounts&quot;,&quot;type&quot;:&quot;uint256[]&quot;}],&quot;stateMutability&quot;:&quot;payable&quot;,&quot;type&quot;:&quot;function&quot;},{&quot;inputs&quot;:[{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;amountOutMin&quot;,&quot;type&quot;:&quot;uint256&quot;},{&quot;internalType&quot;:&quot;address[]&quot;,&quot;name&quot;:&quot;path&quot;,&quot;type&quot;:&quot;address[]&quot;},{&quot;internalType&quot;:&quot;address&quot;,&quot;name&quot;:&quot;to&quot;,&quot;type&quot;:&quot;address&quot;},{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;deadline&quot;,&quot;type&quot;:&quot;uint256&quot;}],&quot;name&quot;:&quot;swapExactETHForTokens&quot;,&quot;outputs&quot;:[{&quot;internalType&quot;:&quot;uint256[]&quot;,&quot;name&quot;:&quot;amounts&quot;,&quot;type&quot;:&quot;uint256[]&quot;}],&quot;stateMutability&quot;:&quot;payable&quot;,&quot;type&quot;:&quot;function&quot;},{&quot;inputs&quot;:[{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;amountOutMin&quot;,&quot;type&quot;:&quot;uint256&quot;},{&quot;internalType&quot;:&quot;address[]&quot;,&quot;name&quot;:&quot;path&quot;,&quot;type&quot;:&quot;address[]&quot;},{&quot;internalType&quot;:&quot;address&quot;,&quot;name&quot;:&quot;to&quot;,&quot;type&quot;:&quot;address&quot;},{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;deadline&quot;,&quot;type&quot;:&quot;uint256&quot;}],&quot;name&quot;:&quot;swapExactETHForTokensSupportingFeeOnTransferTokens&quot;,&quot;outputs&quot;:[],&quot;stateMutability&quot;:&quot;payable&quot;,&quot;type&quot;:&quot;function&quot;},{&quot;inputs&quot;:[{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;amountIn&quot;,&quot;type&quot;:&quot;uint256&quot;},{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;amountOutMin&quot;,&quot;type&quot;:&quot;uint256&quot;},{&quot;internalType&quot;:&quot;address[]&quot;,&quot;name&quot;:&quot;path&quot;,&quot;type&quot;:&quot;address[]&quot;},{&quot;internalType&quot;:&quot;address&quot;,&quot;name&quot;:&quot;to&quot;,&quot;type&quot;:&quot;address&quot;},{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;deadline&quot;,&quot;type&quot;:&quot;uint256&quot;}],&quot;name&quot;:&quot;swapExactTokensForETH&quot;,&quot;outputs&quot;:[{&quot;internalType&quot;:&quot;uint256[]&quot;,&quot;name&quot;:&quot;amounts&quot;,&quot;type&quot;:&quot;uint256[]&quot;}],&quot;stateMutability&quot;:&quot;nonpayable&quot;,&quot;type&quot;:&quot;function&quot;},{&quot;inputs&quot;:[{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;amountIn&quot;,&quot;type&quot;:&quot;uint256&quot;},{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;amountOutMin&quot;,&quot;type&quot;:&quot;uint256&quot;},{&quot;internalType&quot;:&quot;address[]&quot;,&quot;name&quot;:&quot;path&quot;,&quot;type&quot;:&quot;address[]&quot;},{&quot;internalType&quot;:&quot;address&quot;,&quot;name&quot;:&quot;to&quot;,&quot;type&quot;:&quot;address&quot;},{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;deadline&quot;,&quot;type&quot;:&quot;uint256&quot;}],&quot;name&quot;:&quot;swapExactTokensForETHSupportingFeeOnTransferTokens&quot;,&quot;outputs&quot;:[],&quot;stateMutability&quot;:&quot;nonpayable&quot;,&quot;type&quot;:&quot;function&quot;},{&quot;inputs&quot;:[{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;amountIn&quot;,&quot;type&quot;:&quot;uint256&quot;},{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;amountOutMin&quot;,&quot;type&quot;:&quot;uint256&quot;},{&quot;internalType&quot;:&quot;address[]&quot;,&quot;name&quot;:&quot;path&quot;,&quot;type&quot;:&quot;address[]&quot;},{&quot;internalType&quot;:&quot;address&quot;,&quot;name&quot;:&quot;to&quot;,&quot;type&quot;:&quot;address&quot;},{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;deadline&quot;,&quot;type&quot;:&quot;uint256&quot;}],&quot;name&quot;:&quot;swapExactTokensForTokens&quot;,&quot;outputs&quot;:[{&quot;internalType&quot;:&quot;uint256[]&quot;,&quot;name&quot;:&quot;amounts&quot;,&quot;type&quot;:&quot;uint256[]&quot;}],&quot;stateMutability&quot;:&quot;nonpayable&quot;,&quot;type&quot;:&quot;function&quot;},{&quot;inputs&quot;:[{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;amountIn&quot;,&quot;type&quot;:&quot;uint256&quot;},{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;amountOutMin&quot;,&quot;type&quot;:&quot;uint256&quot;},{&quot;internalType&quot;:&quot;address[]&quot;,&quot;name&quot;:&quot;path&quot;,&quot;type&quot;:&quot;address[]&quot;},{&quot;internalType&quot;:&quot;address&quot;,&quot;name&quot;:&quot;to&quot;,&quot;type&quot;:&quot;address&quot;},{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;deadline&quot;,&quot;type&quot;:&quot;uint256&quot;}],&quot;name&quot;:&quot;swapExactTokensForTokensSupportingFeeOnTransferTokens&quot;,&quot;outputs&quot;:[],&quot;stateMutability&quot;:&quot;nonpayable&quot;,&quot;type&quot;:&quot;function&quot;},{&quot;inputs&quot;:[{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;amountOut&quot;,&quot;type&quot;:&quot;uint256&quot;},{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;amountInMax&quot;,&quot;type&quot;:&quot;uint256&quot;},{&quot;internalType&quot;:&quot;address[]&quot;,&quot;name&quot;:&quot;path&quot;,&quot;type&quot;:&quot;address[]&quot;},{&quot;internalType&quot;:&quot;address&quot;,&quot;name&quot;:&quot;to&quot;,&quot;type&quot;:&quot;address&quot;},{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;deadline&quot;,&quot;type&quot;:&quot;uint256&quot;}],&quot;name&quot;:&quot;swapTokensForExactETH&quot;,&quot;outputs&quot;:[{&quot;internalType&quot;:&quot;uint256[]&quot;,&quot;name&quot;:&quot;amounts&quot;,&quot;type&quot;:&quot;uint256[]&quot;}],&quot;stateMutability&quot;:&quot;nonpayable&quot;,&quot;type&quot;:&quot;function&quot;},{&quot;inputs&quot;:[{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;amountOut&quot;,&quot;type&quot;:&quot;uint256&quot;},{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;amountInMax&quot;,&quot;type&quot;:&quot;uint256&quot;},{&quot;internalType&quot;:&quot;address[]&quot;,&quot;name&quot;:&quot;path&quot;,&quot;type&quot;:&quot;address[]&quot;},{&quot;internalType&quot;:&quot;address&quot;,&quot;name&quot;:&quot;to&quot;,&quot;type&quot;:&quot;address&quot;},{&quot;internalType&quot;:&quot;uint256&quot;,&quot;name&quot;:&quot;deadline&quot;,&quot;type&quot;:&quot;uint256&quot;}],&quot;name&quot;:&quot;swapTokensForExactTokens&quot;,&quot;outputs&quot;:[{&quot;internalType&quot;:&quot;uint256[]&quot;,&quot;name&quot;:&quot;amounts&quot;,&quot;type&quot;:&quot;uint256[]&quot;}],&quot;stateMutability&quot;:&quot;nonpayable&quot;,&quot;type&quot;:&quot;function&quot;},{&quot;stateMutability&quot;:&quot;payable&quot;,&quot;type&quot;:&quot;receive&quot;}
  
  def handle_event(event):
      # Define data from the event
      print(event)
  
  
  async def log_loop(event_filter, poll_interval):
      while True:
          for event in event_filter:
              handle_event(event)
          await asyncio.sleep(poll_interval)
  
  def main():
      w3 = Web3(Web3.WebsocketProvider(f'wss://mainnet.infura.io/ws/v3/&lt;MY-PRIJECT&gt;'))
      uniswap = w3.eth.contract('0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D', abi=ABI)
      block_filter = uniswap.events.getLogs.createFilter(fromBlock = 'latest').get_all_entries()
      
      loop = asyncio.get_event_loop()
  
      try:
          loop.run_until_complete(asyncio.gather(log_loop(block_filter, 2)))
      finally:
          loop.close()
  
  if __name__ == '__main__':
      main()
  </code></pre>
  <p>The response is  this: <code>(&quot;The event 'getLogs' was not found in this contract's abi. &quot;, 'Are you sure you provided the correct contract abi?')</code></p>
  <p>I also tried to do this using Infura:</p>
  <pre><code>import asyncio
  import websockets
  
  async def connect():
      uri = &quot;wss://mainnet.infura.io/ws/v3/&lt;MY-PROJECT&gt;&quot;
      async with websockets.connect(uri) as ws:
          await ws.send('{&quot;jsonrpc&quot;:&quot;2.0&quot;, &quot;id&quot;: 1, &quot;method&quot;: &quot;eth_subscribe&quot;, &quot;params&quot;: [&quot;logs&quot;, {&quot;address&quot;: &quot;0x7a250d5630b4cf539739df2c5dacb4c659f2488d&quot;}]}')
  
          while True:
              msg = await ws.recv()
              message = json.loads(msg)
              print(message)
  
  asyncio.get_event_loop().run_until_complete(connect())
  </code></pre>
  <p>But this gives me nothing.</p>
  <p>How can i get messages as soon as a new transaction is made and get the ETH amount for that transaction? Any advice is appreciated</p>