Skip to main content

eth_newFilter

Creates a filter object on Avalanche to notify when state changes (logs).

Use Cases#

  • Event monitoring - Subscribe to contract events
  • Real-time updates - Track events for institutional RWA tokenization ($18B+ transfer volume), gaming subnets, and enterprise blockchains
  • Indexing - Build event indexes incrementally

Parameters#

ParameterTypeRequiredDescription
fromBlockQUANTITY|TAGNoStarting block
toBlockQUANTITY|TAGNoEnding block
addressDATA|ArrayNoContract address(es)
topicsArrayNoTopic filters

Request#

{
"jsonrpc": "2.0",
"method": "eth_newFilter",
"params": [{
"fromBlock": "latest",
"address": "0x09383137c1eee3e1a8bc781228e4199f6b4a9bbf",
"topics": ["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"]
}],
"id": 1
}

Returns#

TypeDescription
QUANTITYFilter ID

Code Examples#

curl -X POST https://api-avalanche-mainnet-archive.n.dwellir.com/YOUR_API_KEY/ext/bc/C/rpc \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_newFilter",
"params": [{
"fromBlock": "latest",
"address": "0x09383137c1eee3e1a8bc781228e4199f6b4a9bbf"
}],
"id": 1
}'