eth_getFilterLogs - Mantle
Example code for the eth_getFilterLogs JSON-RPC method. Complete guide on how to use eth_getFilterLogs JSON-RPC in GetBlock Web3 documentation.
This method returns an array of all logs matching filter with given ID. Unlike eth_getFilterChanges, this returns all matching logs, not just changes since last poll.
Parameters
Parameter
Type
Description
filterId
string
The filter ID returned by eth_newFilter
Request
curl --location --request POST 'https://go.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
"jsonrpc": "2.0",
"method": "eth_getFilterLogs",
"params": ["0x1a2b3c4d5e6f"],
"id": "getblock.io"
}'import axios from 'axios';
const data = JSON.stringify({
"jsonrpc": "2.0",
"method": "eth_getFilterLogs",
"params": ["0x1a2b3c4d5e6f"],
"id": "getblock.io"
});
const config = {
method: 'post',
url: 'https://go.getblock.io/<ACCESS-TOKEN>/',
headers: {
'Content-Type': 'application/json'
},
data: data
};
axios(config)
.then(response => console.log(JSON.stringify(response.data)))
.catch(error => console.log(error));Response
{
"jsonrpc": "2.0",
"id": "getblock.io",
"result": []
}Response Parameters
Field
Type
Description
result
array
Array of all log objects matching the filter
Use Case
The eth_getFilterLogs method is essential for:
Retrieving all logs for a filter
Historical event queries
Complete log retrieval
Data synchronization
Event replay scenarios
Error Handling
Status Code
Error Message
Cause
403
Forbidden
Missing or invalid ACCESS-TOKEN
-32000
Filter not found
Invalid or expired filter ID
Web3 Integration
Last updated
Was this helpful?