Skip to main content

eth_newFilter

POST

Registers log query conditions to create a filter and returns the filter ID.Query the created filter with eth_getFilterChanges or eth_getFilterLogs.

📘 A filter expires automatically if it is not queried with eth_getFilterChanges for a certain period.

param[0]
filterOptionsobjectrequired
The log query conditions.
fromBlockstring
The block number to start searching from, or the latest tag.
toBlockstring
The block number to stop searching at, or the latest tag.
addressoneOf
The contract address or list of addresses that emitted the logs.The contract address.
topicsarray
The list of topics to query. Their order is significant, and each position may contain null or an array of OR conditions.
Responses
codestringrequired
Code identifying the cause of the failed request.
messagestringrequired
Detailed message including the name and value of the invalid parameter.
{
"code": "ERROR_CODE",
"message": "Unauthorized"
}
cURL
curl -X POST 'https://tron-mainnet.nodit.io' \
-H 'Content-Type: application/json' \
-H 'X-API-KEY: nodit-demo' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "eth_newFilter",
"params": [
{
"fromBlock": "0x989680",
"toBlock": "0x9959d0",
"topics": [
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"
]
}
]
}'