Docs
Supported ChainsCronosJSON-RPC APISmart Contract Methods

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:

JavaScript
// 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

Request
fromBlockQUANTITY|TAG

Starting block (default: "latest")

toBlockQUANTITY|TAG

Ending block (default: "latest")

addressDATA|Array

Contract address(es) to filter

topicsArray

Array of topic filters

blockHashDATA

Filter single block by hash

Response Body

Response
addressDATA

Contract that emitted the log

topicsArray

Array of indexed topics

dataDATA

Non-indexed log data

blockNumberQUANTITY

Block number

transactionHashDATA

Transaction hash

logIndexQUANTITY

Log index in block

Code Examples

Bash
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 CodeMessageDescription
-32005Query returned more than 10000 resultsReduce block range
-32602Invalid paramsInvalid filter parameters