Avalanche
准备好在生产环境中调用了吗?
免费套餐涵盖个人项目。按量付费,无需绑卡即可扩展。
Avalanche
免费套餐涵盖个人项目。按量付费,无需绑卡即可扩展。
eth_getLogs returns every event log on the Avalanche C-Chain that matches a filter object — a block range (or a single blockHash), one or more contract addresses, and indexed topic filters. It is the primary method for one-shot log queries and for backfilling an indexer over historical blocks, which is how most analytics and DeFi dashboards reconstruct activity from Aave, Trader Joe, or GMX, all of which spend AVAX on gas. Unlike the stateful filter calls, it needs no prior eth_newFilter registration. Send it to https://avalanche.therpc.io/YOUR_API_KEY (chain ID 43114, 0xa86a) and the node returns the full array of matching logs.
Transfer events for a C-Chain token over a historical block range to seed balances or holder lists.blockHash and topics.| # | 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|---|
| 1 | filter | object | 是 | 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). |
| 类型 | 描述 |
|---|---|
| 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 Avalanche playground.
| 错误码 | 错误信息 | 原因 |
|---|---|---|
-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 once the block is finalized before trusting the data.eth_getLogs with fromBlock: "latest" to watch for new events is wasteful given the C-Chain's fast blocks; use eth_newFilter + eth_getFilterChanges or eth_subscribe for live tailing instead.参数
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).