This method returns all logs matching a previously created log filter, regardless of when they were last polled. It is used to backfill the full history of a filter.
bashcurl --location --request POST 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
"jsonrpc": "2.0",
"method": "eth_getFilterLogs",
"params": ["0x1a4b0d21f8e0c3b6d2a9f7e4c1b8a5d2"],
"id": "getblock.io"
}'
javascriptconst axios = require('axios');
const response = await axios.post('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/', {
jsonrpc: '2.0',
method: 'eth_getFilterLogs',
params: ['0x1a4b0d21f8e0c3b6d2a9f7e4c1b8a5d2'],
id: 'getblock.io'
}, {
headers: { 'Content-Type': 'application/json' }
});
console.log(response.data.result);
pythonimport requests
response = requests.post(
'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/',
headers={'Content-Type': 'application/json'},
json={
'jsonrpc': '2.0',
'method': 'eth_getFilterLogs',
'params': ['0x1a4b0d21f8e0c3b6d2a9f7e4c1b8a5d2'],
'id': 'getblock.io'
}
)
print(response.json())
rustuse reqwest::Client;
use serde_json::{json, Value};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::new();
let response = client
.post("https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/")
.header("Content-Type", "application/json")
.json(&json!({
"jsonrpc": "2.0",
"method": "eth_getFilterLogs",
"params": ["0x1a4b0d21f8e0c3b6d2a9f7e4c1b8a5d2"],
"id": "getblock.io"
}))
.send()
.await?
.json::<Value>()
.await?;
println!("Result: {}", response["result"]);
Ok(())
}
javascriptimport { ethers } from 'ethers';
const provider = new ethers.JsonRpcProvider('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/');
const logs = await provider.getLogs({ address: '0xAcc15dC74880C9944775448304B263D191c6077F', topics: ['0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef'] });
javascriptimport { createPublicClient, http } from 'viem';
const client = createPublicClient({
transport: http('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/')
});
const logs = await client.getFilterLogs({ filter });