eth_getFilterChanges
JSON-RPC method returns an array of logs or block hashes that have occurred since the last poll for the specified filter. This method is used to retrieve new results from filters created with eth_newFilter
or eth_newBlockFilter
, providing an efficient polling mechanism for monitoring blockchain events.
Get your own node endpoint todayStart for free and get your app to production levels immediately. No credit card required.You can sign up with your GitHub, X, Google, or Microsoft account.
Parameters
- filter_id (string) — The filter ID returned by
eth_newFilter
oreth_newBlockFilter
Response
The method returns an array of results based on the filter type:- Log filters: Array of log objects matching the filter criteria
- Block filters: Array of block hashes for new blocks
Response structure
For log filters:- Array of log objects with properties like
address
,topics
,data
,blockNumber
,transactionHash
, etc. - Empty array if no new matching logs since last poll
- Array of block hash strings
- Empty array if no new blocks since last poll
Polling behavior
State tracking:- Each call returns only new results since the last
eth_getFilterChanges
call - Filter maintains internal state of last polled position
- Subsequent calls continue from where the previous call left off
- Returns empty array if no new changes
Usage example
Basic implementation
Example request
Shell
Use cases
Theeth_getFilterChanges
method is essential for applications that need to:
- Real-time event monitoring: Monitor smart contract events as they happen
- Block synchronization: Stay synchronized with new blocks on the blockchain
- DeFi applications: React to DeFi events like swaps, transfers, and liquidations
- Trading bots: Execute trading strategies based on blockchain events
- Analytics platforms: Collect real-time data for analysis and reporting
- Notification systems: Send alerts based on specific blockchain events
- Audit tools: Monitor contracts for compliance and security events
- DEX monitoring: Track decentralized exchange activities in real-time
- NFT platforms: Monitor NFT transfers, sales, and minting events
- Bridge monitoring: Track cross-chain bridge events and transfers
- Governance tracking: Monitor DAO governance events and proposals
- Oracle monitoring: Track oracle price feeds and data updates
- Gaming applications: Monitor in-game transactions and events
- Supply chain tracking: Track product transfers and supply chain events
- Insurance monitoring: Monitor insurance claims and policy events
Body
application/json