BNB Smart Chain
¿Listo para usar esto en producción?
El plan gratuito cubre proyectos personales. El pago por uso escala sin necesidad de tarjeta.
BNB Smart Chain
El plan gratuito cubre proyectos personales. El pago por uso escala sin necesidad de tarjeta.
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.| # | Nombre | Tipo | Requerido | Descripción |
|---|---|---|---|---|
| 1 | filter | object | Sí | 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 | Descripción |
|---|---|
| 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.
| Código | Mensaje | 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 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.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).