Skip to main content

eth_getLogs

Returns an array of all logs matching a given filter object on Blast.

Why Blast? Build on the only Ethereum L2 with native yield—4% for ETH and 5%+ for stablecoins automatically with $2.5B+ TVL, auto-rebasing ETH and USDB, gas revenue sharing for developers, and Blur-backed ecosystem.

Use Cases#

The eth_getLogs method is essential for:

  • Event indexing - Track contract events for yield-generating dApps, DeFi protocols with built-in returns, and gas-subsidized applications
  • Token transfers - Monitor ERC20/ERC721 transfers
  • DeFi analytics - Track swaps, liquidity events, and more
  • Notification systems - Alert on specific on-chain events

Parameters#

ParameterTypeRequiredDescription
fromBlockQUANTITY|TAGNoStarting block (default: "latest")
toBlockQUANTITY|TAGNoEnding block (default: "latest")
addressDATA|ArrayNoContract address(es) to filter
topicsArrayNoArray of topic filters
blockHashDATANoFilter single block by hash

Request#

{
"jsonrpc": "2.0",
"method": "eth_getLogs",
"params": [{
"fromBlock": "latest",
"toBlock": "latest",
"address": "0xA8b2218036Eab12e58e02f88E8825723aB4C5E5f",
"topics": ["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"]
}],
"id": 1
}

Returns#

Array of log objects:

FieldTypeDescription
addressDATAContract that emitted the log
topicsArrayArray of indexed topics
dataDATANon-indexed log data
blockNumberQUANTITYBlock number
transactionHashDATATransaction hash
logIndexQUANTITYLog index in block

Response#

{
"jsonrpc": "2.0",
"id": 1,
"result": [{
"address": "0xA8b2218036Eab12e58e02f88E8825723aB4C5E5f",
"topics": ["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x...", "0x..."],
"data": "0x...",
"blockNumber": "0x5BAD55",
"transactionHash": "0x...",
"logIndex": "0x0"
}]
}

Code Examples#

curl -X POST https://api-blast-mainnet-archive.n.dwellir.com/YOUR_API_KEY \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_getLogs",
"params": [{
"fromBlock": "latest",
"toBlock": "latest",
"address": "0xA8b2218036Eab12e58e02f88E8825723aB4C5E5f",
"topics": ["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"]
}],
"id": 1
}'

Error Handling#

Error CodeMessageDescription
-32005Query returned more than 10000 resultsReduce block range
-32602Invalid paramsInvalid filter parameters