eth_getFilterLogs - Get Filter Logs
Get all Centrifuge filter logs. Historical event retrieval.
Centrifuge RPC endpoint: endpoint URLs, plans and pricing.
Returns an array of all logs matching filter with given id on the Centrifuge network. This method retrieves all accumulated logs that match the criteria of a previously created filter.
# Create a filter for block 0x86d9c9 that includes Centrifuge liquidity pool events (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": "0x86d9c9",
"toBlock": "0x86d9c9",
"address": "0x2d5d7d31f671f86c782533cc367f14109a082712",
"topics": []
}],
"id": 1
}' | jq -r '.result')
# Retrieve the logs captured by 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_getFilterLogs\", params:[$id], id:1}')"Implementation Example
Notes
- The filter must be created first using
eth_newFilter,eth_newBlockFilter, oreth_newPendingTransactionFilter - This method returns all logs accumulated since the filter was created
- Filters timeout if not accessed within a certain time period (typically 5 minutes)
- Use
eth_getFilterChangesto get only new logs since the last poll - The
removedfield helps handle chain reorganizations
Need help? Contact our support team or check the Centrifuge documentation.