eth_gasPrice

The eth_gasPrice method returns the current gas price in wei. This method provides the network's suggested gas price for transactions, which represents the amount of wei you should pay per unit of gas to have your transaction processed in a reasonable time.

It's widely used by wallets and applications to estimate transaction costs and set appropriate gas prices for user transactions. The returned value is typically based on recent blocks and represents a baseline gas price for standard transaction inclusion. Note that since EIP-1559, this method returns the legacy gas price and may not reflect the optimal maxFeePerGas and maxPriorityFeePerGas for newer transaction types. For EIP-1559 transactions, consider using eth_feeHistory or eth_maxPriorityFeePerGas instead.


Parameters

This method does not require any parameters.

Return Object
field
type
description
result
string
The current gas price in wei encoded as a hexadecimal string. This represents the network's suggested price per unit of gas. To calculate total transaction cost, multiply this value by the estimated gas amount (e.g., 21000 for a simple transfer).
Request Example
Request
Response Example
Response

Share on
Share on FacebookShare on XShare on LinkedIn
Did you find this page useful?