Polygon
Polygon
Polygon
免费套餐涵盖个人项目。按量付费,无需绑卡即可扩展。
eth_gasPrice returns the node's suggested legacy gas price in wei — the per-gas price, denominated in MATIC's smallest unit, that a type-0 transaction would use right now. On Polygon PoS fees are famously low, but they do rise when the network is busy, so this is a fast way to read current conditions before building a transaction. Call https://polygon.therpc.io/YOUR_API_KEY (chain ID 137, 0x89) and you get a single hex value such as 0x6fc23ac00, which you convert to gwei by dividing by 1e9.
gasPrice field when building a legacy (type-0) Polygon transaction for tooling that does not speak EIP-1559.eth_feeHistory percentiles to cross-check the suggested MATIC price.此方法不需要任何参数,传入空数组 [] 即可。
| 类型 | 描述 |
|---|---|
| string (hex) | Hex-encoded gas price in wei (e.g. "0x4a817c800" = 20 gwei). |
Try it live in the Polygon playground.
| 错误码 | 错误信息 | 原因 |
|---|---|---|
-32603 | Internal error | Node could not estimate current gas price. |
eth_maxPriorityFeePerGas plus eth_feeHistory to set maxFeePerGas and the tip precisely.