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.