Optimism
Optimism
Optimism
El plan gratuito cubre proyectos personales. El pago por uso escala sin necesidad de tarjeta.
eth_gasPrice returns the node's suggested legacy gas price for OP Mainnet, expressed in ETH wei. It is a single combined number useful for a quick read of current L2 fee conditions or for filling the gasPrice field of a type-0 transaction. Because OP Mainnet supports EIP-1559, this value is derived from the base fee plus a tip and tends to overestimate for type-2 transactions. Query https://optimism.therpc.io/YOUR_API_KEY (chain ID 10, 0xa) to fetch it.
gasPrice field when constructing a legacy (type-0) transaction for tooling that doesn't speak EIP-1559.eth_feeHistory percentiles to cross-check your OP Mainnet fee estimate.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 Optimism playground.
| Código | Mensaje | Causa |
|---|---|---|
-32603 | Internal error | Node could not estimate current gas price. |
eth_maxPriorityFeePerGas plus eth_feeHistory when building type-2 transactions.