Skip to main content

eth_newFilter

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

Use Cases#

  • Event monitoring - Subscribe to contract events
  • Real-time updates - Track events for EVM dApp testing, XCM integration validation, and pre-mainnet deployment verification
  • 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": "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY",
"topics": [""]
}],
"id": 1
}

Returns#

TypeDescription
QUANTITYFilter ID

Code Examples#

curl -X POST https://api-moonbase-alpha.n.dwellir.com/YOUR_API_KEY \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_newFilter",
"params": [{
"fromBlock": "latest",
"address": "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY"
}],
"id": 1
}'