I’m just getting started to Infura, so i’m sorry if this is a noob question. I’m trying to get transactions in real time on this contract, so basically whenever new confirmed transactions are done, i would like to get the transaction details. Unfortunately, right now i only managed to do this:
import asyncio
import websockets
import json
async def connect():
uri = "wss://mainnet.infura.io/ws/v3/183e6817d56041a9a0e192459ce65845"
async with websockets.connect(uri) as ws:
await ws.send('{"jsonrpc":"2.0", "id": 1, "method": "eth_subscribe", "params": ["newPendingTransactions"]}')
await ws.send('{"jsonrpc":"2.0", "id": 1, "method": "eth_subscribe", "params": ["logs", {"address": "0x7a250d5630b4cf539739df2c5dacb4c659f2488d"}]}')
#msg = await asyncio.wait_for(ws.recv(), 4)
while True:
msg = await ws.recv()
message = json.loads(msg)
print(message)
asyncio.get_event_loop().run_until_complete(connect())
which will send me all the pending transactions. Is there any way to get only confirmed ones, instead of pending? Thanks in advance!