Ethereum
Ethereum
Ethereum
免费套餐涵盖个人项目。按量付费,无需绑卡即可扩展。
eth_gasPrice gives you the node's single suggested price per unit of gas, in wei of ETH, for Ethereum mainnet. It predates EIP-1559: on London-and-later Ethereum the node derives this figure from the current base fee plus a typical tip and collapses it into one number, the way a legacy type-0 transaction expects. It's a fast, no-parameter read of "what's gas roughly costing right now." Hit https://ethereum.therpc.io/YOUR_API_KEY (chain ID 1) and you get back something like 0x4a817c800 — 20 gwei. For modern type-2 transactions you'll usually want the richer eth_feeHistory data instead, but this remains the quickest pulse-check.
gasPrice field on a type-0 transaction for tooling or hardware wallets that still build pre-1559 transactions.eth_feeHistory percentiles to cross-check your estimator rather than trusting either source alone.此方法不需要任何参数,传入空数组 [] 即可。
| 类型 | 描述 |
|---|---|
| string (hex) | Hex-encoded gas price in wei (e.g. "0x4a817c800" = 20 gwei). |
Try it live in the Ethereum playground.
| 错误码 | 错误信息 | 原因 |
|---|---|---|
-32603 | Internal error | Node could not estimate current gas price. |
maxFeePerGas; reach for eth_maxPriorityFeePerGas and eth_feeHistory instead.