1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| import time
import requests
data = requests.post("https://bsc-mainnet.nodereal.io/v1/***", data='{"jsonrpc":"2.0","method":"eth_newPendingTransactionFilter","params":[],"id":1}') # 解析 JSON 响应 json_response = data.json()
# 提取 pending 交易信息 if "result" in json_response: r = json_response["result"]
while 1: c = '{"jsonrpc":"2.0","method":"eth_getFilterChanges","params":["' + r + '"],"id":2}' data = requests.post("https://bsc-mainnet.nodereal.io/v1/***", data=c) print(data.json())
time.sleep(0.5)
|