curl --request POST \
--url https://rpc.testnet.tempo.xyz/ \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"method": "eth_newFilter",
"params": [
{
"fromBlock": "latest",
"toBlock": "latest",
"address": "0x20c0000000000000000000000000000000000000",
"topics": []
}
],
"id": 1
}
'{
"jsonrpc": "<string>",
"id": 123,
"result": "<string>"
}curl --request POST \
--url https://rpc.testnet.tempo.xyz/ \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"method": "eth_newFilter",
"params": [
{
"fromBlock": "latest",
"toBlock": "latest",
"address": "0x20c0000000000000000000000000000000000000",
"topics": []
}
],
"id": 1
}
'{
"jsonrpc": "<string>",
"id": 123,
"result": "<string>"
}eth_getFilterChanges.
filterObject — the filter object:
fromBlock — (optional) block number (hex) or tag to start fromtoBlock — (optional) block number (hex) or tag to end ataddress — (optional) contract address or array of addressestopics — (optional) array of topic filtersresult — the filter IDeth_newFilter code examplesconst ethers = require('ethers');
const NODE_URL = "CHAINSTACK_NODE_URL";
const provider = new ethers.JsonRpcProvider(NODE_URL);
const PATHUSD = "0x20c0000000000000000000000000000000000000";
const createFilter = async () => {
const filterId = await provider.send("eth_newFilter", [{
address: PATHUSD,
fromBlock: "latest",
toBlock: "latest"
}]);
console.log(`Filter ID: ${filterId}`);
};
createFilter();
Was this page helpful?