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.
Gas on BNB Smart Chain is paid in BNB, and eth_estimateGas tells you how much a transaction will consume before you commit. The node dry-runs the call against current state on its geth-equivalent EVM, then returns the gas units the operation would burn. A BEP-20 transfer, a PancakeSwap swap, a fresh contract deployment: all of them estimate the same way. Aim it at https://bsc.therpc.io/YOUR_API_KEY (chain ID 56). The simulation never reaches a validator and changes nothing on-chain. Only the estimate comes back.
| # | Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|---|
| 1 | transaction | object | Ja | Transaction object. `to` is required for calls; omit `to` for contract deployments. Optional: `from`, `gas`, `gasPrice`/`maxFeePerGas`/`maxPriorityFeePerGas`, `value`, `data`. |
| 2 | blockTag | string | Nein | Block state to simulate against. Defaults to `latest`.Standard: latest |
| Typ | Beschreibung |
|---|---|
| string | Hex-encoded gas estimate. The node typically adds a small safety buffer above the raw simulation result. |
Try it live in the BNB Smart Chain playground.
| Code | Meldung | Ursache |
|---|---|---|
3 | execution reverted | The simulated transaction reverted; the estimate cannot be produced. |
-32000 | gas required exceeds allowance | Estimated gas exceeded the block gas limit or the supplied gas cap. |
-32602 | invalid argument | Malformed transaction object. |
Parameter
Transaction object. `to` is required for calls; omit `to` for contract deployments. Optional: `from`, `gas`, `gasPrice`/`maxFeePerGas`/`maxPriorityFeePerGas`, `value`, `data`.
"latest" | "pending" | hex block number