BNB Smart Chain
准备好在生产环境中调用了吗?
免费套餐涵盖个人项目。按量付费,无需绑卡即可扩展。
BNB Smart Chain
免费套餐涵盖个人项目。按量付费,无需绑卡即可扩展。
eth_feeHistory looks backward across a window of recent BNB Smart Chain blocks and returns each block's base fee (paid in BNB), its gas-used ratio, and priority-fee samples at the percentiles you request. With BSC sealing a block roughly every three seconds under PoSA, even a few dozen blocks captures a fresh, fine-grained fee picture. Call https://bsc.therpc.io/YOUR_API_KEY at chain ID 56, and the data becomes the raw input for an EIP-1559 fee strategy that picks sensible maxFeePerGas and tip values.
maxFeePerGas and maxPriorityFeePerGas for a BNB transaction.gasUsedRatio climb toward 1.0 to detect BSC congestion during busy PancakeSwap windows.| # | 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|---|
| 1 | blockCount | string | number | 是 | Number of blocks to include in the history window. Most providers cap this at 1024. |
| 2 | newestBlock | string | 是 | The most recent block to include in the window.默认值: latest |
| 3 | rewardPercentiles | number[] | 否 | Array of percentile values (0–100) at which to sample priority fees from each block. Pass an empty array to omit reward data. |
| 类型 | 描述 |
|---|---|
| object | Object with: `oldestBlock` (hex, starting block of the window), `baseFeePerGas` (array of hex wei — one per block plus the next predicted value), `gasUsedRatio` (array of floats 0–1 per block), `reward` (array of arrays — per-block percentile priority fees in hex wei; only present when `rewardPercen |
Try it live in the BNB Smart Chain playground.
| 错误码 | 错误信息 | 原因 |
|---|---|---|
-32602 | invalid argument | blockCount is 0, out of range, or rewardPercentiles contains values outside 0–100. |
-32000 | block not found | `newestBlock` references a block that does not exist on this node. |
baseFeePerGas array carries one extra trailing entry: the node's forecast for the next BSC block, which has not been sealed yet — do not mistake it for a confirmed fee.blockCount returns a hefty payload, so cap the window at roughly 100–200 blocks per request and page through longer ranges.参数
Hex or decimal integer, e.g. "0xa" or 10
"latest" | "safe" | "finalized" | hex block number
Array of percentile values (0–100) at which to sample priority fees from each block. Pass an empty array to omit reward data.