BNB Smart Chain
准备好在生产环境中调用了吗?
免费套餐涵盖个人项目。按量付费,无需绑卡即可扩展。
BNB Smart Chain
免费套餐涵盖个人项目。按量付费,无需绑卡即可扩展。
Contract activity on BNB Smart Chain surfaces as event logs, and eth_newFilter is how you register interest in a specific slice of them. Chain ID 56 uses BNB as its gas token. Send the method to https://bsc.therpc.io/YOUR_API_KEY with an address and topic criteria, and it creates a server-side log filter that returns a hex filter ID. From then on you call eth_getFilterChanges with that ID to pull, incrementally, only the matching logs mined since your last poll. There is no need to restate the address-and-topics object on every request. The pattern pairs naturally with the chain's ~3-second PoSA block cadence for steady, low-overhead event ingestion.
Transfer events on a roughly per-block (~3-second) rhythm without re-specifying the full address-and-topics filter each time.Swap events from a long-running indexer process, letting the server track your read position.| # | 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|---|
| 1 | filter | object | 是 | Filter object. Fields: `fromBlock` (string), `toBlock` (string), `address` (string | string[]), `topics` ((string | string[] | null)[]). |
| 类型 | 描述 |
|---|---|
| string | Hex filter ID. Pass this to eth_getFilterChanges, eth_getFilterLogs, or eth_uninstallFilter. |
Try it live in the BNB Smart Chain playground.
| 错误码 | 错误信息 | 原因 |
|---|---|---|
-32000 | filter not found | Provider rejected filter creation, or filter limit per connection was reached. |
-32602 | invalid argument | Malformed filter object or invalid topic format. |
eth_getFilterChanges answers with filter not found.eth_subscribe logs subscription over WebSocket beats repeatedly polling this filter.参数
Filter object. Fields: `fromBlock` (string), `toBlock` (string), `address` (string | string[]), `topics` ((string | string[] | null)[]).