Base
Pronto para usar isso em produção?
O plano gratuito cobre projetos pessoais. O pay-as-you-go escala sem cartão de crédito.
Base
O plano gratuito cobre projetos pessoais. O pay-as-you-go escala sem cartão de crédito.
eth_getLogs returns every event log that matches a filter object — you specify a block range (or a single blockHash), an optional contract address, and optional topics, and get back all matching logs in one shot. It is the primary method for backfilling an index and for one-off historical queries, the workhorse behind dashboards and subgraphs on Base. Base is Coinbase's OP Stack optimistic rollup that settles to Ethereum L1 and uses ETH for gas, with ~2s blocks; its dense event stream from DeFi venues like Aerodrome and Uniswap makes scoped filters important. Send queries to https://base.therpc.io/YOUR_API_KEY (chain ID 8453, hex 0x2105).
Transfer events for an ERC-20 token on Base across a historical block range to build a holder ledger.blockHash plus the contract address and topic.| # | Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|---|
| 1 | filter | object | Sim | Filter object. Fields: `fromBlock` (string, default "latest"), `toBlock` (string, default "latest"), `address` (string | string[]), `topics` ((string | string[] | null)[]), `blockHash` (string — mutually exclusive with fromBlock/toBlock). |
| Tipo | Descrição |
|---|---|
| array | Array of log objects. Each log: `address`, `blockHash`, `blockNumber`, `data`, `logIndex`, `removed` (bool — true on reorg), `topics`, `transactionHash`, `transactionIndex`. |
Try it live in the Base playground.
| Código | Mensagem | Causa |
|---|---|---|
-32005 | query exceeds max block range | The fromBlock–toBlock window exceeds the provider's block-range cap. |
-32005 | query returned more than 10000 results | Too many matching logs; narrow the filter or paginate. |
-32602 | invalid argument | blockHash combined with fromBlock/toBlock, or malformed topic format. |
removed field and re-query against finalized before treating an event as settled.address or topics filter can time out or hit the block-range and 10,000-result caps — paginate in chunks of roughly 1,000–5,000 blocks, which on Base's ~2s cadence is only minutes of chain time.eth_getLogs with fromBlock: "latest" to watch live events wastes calls; install eth_newFilter + eth_getFilterChanges, or use eth_subscribe, for the live tail.Parâmetros
Filter object. Fields: `fromBlock` (string, default "latest"), `toBlock` (string, default "latest"), `address` (string | string[]), `topics` ((string | string[] | null)[]), `blockHash` (string — mutually exclusive with fromBlock/toBlock).