eth_getFilterLogs
Returns an array of all logs matching filter with given id on Avalanche C-Chain.
Parameters
QUANTITY
- The filter id
{
"jsonrpc": "2.0",
"method": "eth_getFilterLogs",
"params": [
"0x16"
],
"id": 74
}
Returns
Array
- Array of log objects, or an empty array if nothing has changed since last poll.
Implementation Example
- cURL
- JavaScript
curl -X POST https://api-avalanche-mainnet-archive.n.dwellir.com/YOUR_API_KEY/ext/bc/C/rpc \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_getFilterLogs",
"params": [
"0x16"
],
"id": 74
}'
const response = await fetch('https://api-avalanche-mainnet-archive.n.dwellir.com/YOUR_API_KEY/ext/bc/C/rpc', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
jsonrpc: '2.0',
method: 'eth_getFilterLogs',
params: [
'0x16'
],
id: 74
})
});
const data = await response.json();
console.log(data.result);
Response Example
{
"id": 74,
"jsonrpc": "2.0",
"result": [
{
"logIndex": "0x1",
"blockNumber": "0x1b4",
"blockHash": "0x8216c5785ac562ff41e2dcfdf5785ac562ff41e2dcfdf829c5a142f1fccd7d",
"transactionHash": "0xdf829c5a142f1fccd7d8216c5785ac562ff41e2dcfdf5785ac562ff41e2dcf",
"transactionIndex": "0x0",
"address": "0x16c5785ac562ff41e2dcfdf829c5a142f1fccd7d",
"data": "0x0000000000000000000000000000000000000000000000000000000000000000",
"topics": [
"0x59ebeb90bc63057b6515673c3ecf9438e5058bca0f92585014eced636878c9a5"
]
}
]
}
Note: Use this method to retrieve all historical logs for a filter created with eth_newFilter.
Need help? Contact our support team or check the Avalanche documentation.