eth_getFilterChanges
Polling method for a filter, which returns an array of logs which occurred since last poll on Avalanche C-Chain.
Parameters
QUANTITY
- the filter id
{
"jsonrpc": "2.0",
"method": "eth_getFilterChanges",
"params": [
"0x16"
],
"id": 73
}
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_getFilterChanges",
"params": [
"0x16"
],
"id": 73
}'
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_getFilterChanges',
params: [
'0x16'
],
id: 73
})
});
const data = await response.json();
console.log(data.result);
Response Example
{
"id": 73,
"jsonrpc": "2.0",
"result": [
{
"logIndex": "0x1",
"blockNumber": "0x1b4",
"blockHash": "0x8216c5785ac562ff41e2dcfdf5785ac562ff41e2dcfdf829c5a142f1fccd7d",
"transactionHash": "0xdf829c5a142f1fccd7d8216c5785ac562ff41e2dcfdf5785ac562ff41e2dcf",
"transactionIndex": "0x0",
"address": "0x16c5785ac562ff41e2dcfdf829c5a142f1fccd7d",
"data": "0x0000000000000000000000000000000000000000000000000000000000000000",
"topics": [
"0x59ebeb90bc63057b6515673c3ecf9438e5058bca0f92585014eced636878c9a5"
]
}
]
}
Note: Filters on Avalanche have fast update rates due to the network's sub-second block times.
Need help? Contact our support team or check the Avalanche documentation.