eth_getFilterChanges - Optimism
Example code for the eth_getFilterChanges json-rpc method. Сomplete guide on how to use eth_getFilterChanges json-rpc in GetBlock.io Web3 documentation.
Parameters
Parameter
Type
Description
Required
Request Sample
curl --location 'https://go.getblock.us/<ACCESS_TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "2.0",
"method": "eth_getFilterChanges",
"params": ["0x6c8b2705baa8223048745077aa6202d0"],
"id": "getblock.io"
}'const axios = require('axios');
const url = "https://go.getblock.io/<ACCESS-TOKEN>/";
const headers = { "Content-Type": "application/json" };
const payload = {
jsonrpc: "2.0",
method: "eth_getFilterChanges",
params: ["0x6c8b2705baa8223048745077aa6202d0"],
id: "getblock.io"
};
axios.post(url, payload, { headers })
.then(response => {
if (response.status === 200) {
console.log("eth_getFilterChanges result:", response.data.result);
} else {
console.error("Error:", response.status, response.statusText);
}
})
.catch(error => {
console.error("Error:", error.response ? error.response.data : error.message);
});Response
{
"jsonrpc": "2.0",
"id": "getblock.io",
"result": [
{
"address": "0x4200000000000000000000000000000000000006",
"topics": [
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
"0x000000000000000000000000478946bcd4a5a22b316470f5486fafb928c0ba25",
"0x0000000000000000000000009e3ed65340a913b96ba7b86d5d5876dde623946e"
],
"data": "0x00000000000000000000000000000000000000000000000051d1a85fe050a203",
"blockNumber": "0x9084924",
"transactionHash": "0xb2adcd1e6d459f23c716c938c8e909f5b622dad31d213637eeccf9dac7d114bc",
"transactionIndex": "0x3",
"blockHash": "0x1dd45b1d28600add983fa7b999246f10898329781d3338841fdf721a3a542510",
"blockTimestamp": "0x6a046c01",
"logIndex": "0x22",
"removed": false
},
]
}Response Parameters
Use Case
Error handling
Status Code
Error Message
Cause
Integration with Web3
Last updated
Was this helpful?