BNB Smart Chain
Bereit, das in der Produktion aufzurufen?
Das Free-Tier deckt persönliche Projekte ab. Pay-as-you-go skaliert ohne Karte.
BNB Smart Chain
Das Free-Tier deckt persönliche Projekte ab. Pay-as-you-go skaliert ohne Karte.
When you are stepping through BNB Smart Chain by height rather than by hash, eth_getTransactionByBlockNumberAndIndex is the tool to reach a single transaction. Pass a hex block number or a tag such as latest or pending, add a zero-based hex index, and the node returns that one transaction object. You get null if the height or position has no entry. BNB Smart Chain charges gas in BNB and seals blocks about every three seconds, so iterating height-by-height keeps pace with a quick chain. Send each request to https://bsc.therpc.io/YOUR_API_KEY on chain ID 56.
pending tag with its index.| # | Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|---|
| 1 | blockTag | string | Ja | The block containing the transaction. |
| 2 | transactionIndex | string (hex) | Ja | Zero-based position of the transaction within the block. |
| Typ | Beschreibung |
|---|---|
| object | null | Same transaction object as eth_getTransactionByHash. Returns null if block or index not found. |
Try it live in the BNB Smart Chain playground.
| Code | Meldung | Ursache |
|---|---|---|
-32602 | Invalid params | Block tag is malformed or transaction index is not a valid hex integer. |
"0x0" for the leading transaction, never a plain numeric 0.pending tag orders and exposes queued transactions is not uniform across node clients, so do not depend on stable positions there.Parameter
hex block number or "latest"/"earliest"/"pending"/"safe"/"finalized"
0x-prefixed hex integer (e.g. "0x0" for the first transaction)