Ethereum
¿Listo para usar esto en producción?
El plan gratuito cubre proyectos personales. El pago por uso escala sin necesidad de tarjeta.
Ethereum
El plan gratuito cubre proyectos personales. El pago por uso escala sin necesidad de tarjeta.
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.Este método no acepta parámetros. Pasa un array vacío [].
| Tipo | Descripción |
|---|---|
| string (hex) | Hex-encoded gas price in wei (e.g. "0x4a817c800" = 20 gwei). |
Try it live in the Ethereum playground.
| Código | Mensaje | Causa |
|---|---|---|
-32603 | Internal error | Node could not estimate current gas price. |
maxFeePerGas; reach for eth_maxPriorityFeePerGas and eth_feeHistory instead.