BNB Smart Chain
准备好在生产环境中调用了吗?
免费套餐涵盖个人项目。按量付费,无需绑卡即可扩展。
BNB Smart Chain
免费套餐涵盖个人项目。按量付费,无需绑卡即可扩展。
BNB Smart Chain is the EVM-compatible network secured by Proof-of-Staked-Authority, where validators are paid in BNB and roughly three-second blocks reach fast finality. eth_getLogs walks the historical chain and returns every event log that matches a single filter object in one round trip. That object pins down addresses, indexed topics, and a block window. Point your client at https://bsc.therpc.io/YOUR_API_KEY on chain ID 56, and this becomes the workhorse for one-shot log pulls and backfill indexing jobs, sweeping past PancakeSwap swaps or BEP-20 Transfer events without holding an open subscription.
Transfer log emitted by a BEP-20 token contract across a historical range of chain-56 blocks.| # | 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|---|
| 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 BNB Smart Chain 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 flag and re-pull once the block settles.fromBlock: "latest" burns compute units for nothing. Wire up eth_newFilter plus eth_getFilterChanges, or open an eth_subscribe stream 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).