Запрос
curl https://eth.l0vdinfra.com/YOUR_KEY \
-X POST \
-H "Content-Type: application/json" \
--data '{"jsonrpc":"2.0","id":1,"method":"eth_newFilter","params":[{"address":"0xdAC17F958D2ee523a2206206994597C13D831ec7","topics":["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"]}]}'
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x0400000000000000b27af21a8da84662"
}
Параметры и свой эндпоинт
Параметры
filterobjectобязательный- fromBlock, toBlock, address and topics, as in eth_getLogs.
Возвращает
string Filter ID.
Когда использовать
Follow new events without managing block ranges: create a filter once, then poll eth_getFilterChanges every few seconds.
Как читать ответ
The result is an opaque filter ID; keep it and pass it to the polling methods.
Советы
- A filter that is not polled for about 5 minutes is removed; create a new one if polling returns "filter not found".
- For history and backfills use eth_getLogs with block ranges: filters only see new blocks.
- Call eth_uninstallFilter when you are done.
Связанные методы