eth_getFilterChanges - Poll filter for ch...
Get new Centrifuge filter results. Event log polling.
Centrifuge RPC endpoint: endpoint URLs, plans and pricing.
Polling method for a filter, which returns an array of events that have occurred since the last poll on the Centrifuge network.
# Create a log filter scoped to the latest block (requires jq)
FILTER_ID=$(curl -s -X POST https://api-centrifuge.n.dwellir.com/YOUR_API_KEY \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_newFilter",
"params": [{
"fromBlock": "latest",
"toBlock": "latest",
"address": null,
"topics": []
}],
"id": 1
}' | jq -r '.result')
# Poll for changes on that filter
curl -s -X POST https://api-centrifuge.n.dwellir.com/YOUR_API_KEY \
-H "Content-Type: application/json" \
-d "$(jq -n --arg id \"$FILTER_ID\" '{jsonrpc:\"2.0\", method:\"eth_getFilterChanges\", params:[$id], id:1}')"Implementation Example
Notes
- This method only returns changes that occurred since the last poll
- Filters timeout if not accessed within a certain time period (typically 5 minutes)
- The first call to eth_getFilterChanges returns all events since filter creation
- Subsequent calls return only new events since the previous call
- Use eth_getFilterLogs to retrieve all accumulated logs regardless of polling
Need help? Contact our support team or check the Centrifuge documentation.