eth_getLogs - Cronos RPC Method
Query event logs on Cronos. Essential for indexing DeFi protocols, NFT marketplaces, and Crypto.com ecosystem integrations on the EVM-compatible Crypto.com blockchain.
Returns an array of all logs matching a given filter object on Cronos.
Why Cronos? Build on the EVM-compatible Crypto.com blockchain with fast finality and deep Crypto.com ecosystem integration.
Use Cases
The eth_getLogs method is essential for:
- Event indexing - Track contract events for DeFi protocols, NFT marketplaces, and Crypto.com ecosystem integrations
- Token transfers - Monitor ERC20/ERC721 transfers
- DeFi analytics - Track swaps, liquidity events, and more
- Notification systems - Alert on specific on-chain events
Cronos Rate Limits
Block Range Limit
On Cronos, eth_getLogs queries are subject to a maximum block range of 500 blocks. This means the difference between fromBlock and toBlock cannot exceed 500 blocks per request.
Additionally, each query can return a maximum of 10,000 log entries.
For querying larger block ranges, split your requests into smaller batches:
// Example: Query in 500-block batches
const BATCH_SIZE = 500;
let fromBlock = startBlock;
while (fromBlock <= endBlock) {
const toBlock = Math.min(fromBlock + BATCH_SIZE - 1, endBlock);
const logs = await provider.getLogs({ fromBlock, toBlock, ...filter });
// Process logs
fromBlock = toBlock + 1;
}Request Parameters
Starting block (default: "latest")
Ending block (default: "latest")
Contract address(es) to filter
Array of topic filters
Filter single block by hash
Response Body
Contract that emitted the log
Array of indexed topics
Non-indexed log data
Block number
Transaction hash
Log index in block
Code Examples
curl -X POST https://api-cronos-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": "0x5C7F8A570d578ED84E63fdFA7b1eE72dEae1AE23",
"topics": ["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"]
}],
"id": 1
}'Error Handling
| Error Code | Message | Description |
|---|---|---|
| -32005 | Query returned more than 10000 results | Reduce block range |
| -32602 | Invalid params | Invalid filter parameters |
Related Methods
eth_newFilter- Create a filter for logseth_getFilterChanges- Poll filter for new logs
eth_call
Execute smart contract calls without creating transactions on Cronos. Essential for reading contract state for DeFi protocols, NFT marketplaces, and Crypto.com ecosystem integrations.
eth_newFilter
Create an event log filter on Cronos. Essential for event monitoring, contract activity tracking, and DeFi event streaming for DeFi protocols, NFT marketplaces, and Crypto.com ecosystem integrations.