๐Ÿ”ต Base
eth_gasPrice

eth_gasPrice RPC Method

The eth_gasPrice method returns the current network gas price in wei, as calculated by the Base network client.
This value is useful when crafting legacy-style transactions (non-EIP-1559), or for estimating default gas fees in dApps and wallets.

โœ… Use this to fetch the base gas price for standard transactions
โœ… For modern EIP-1559 transactions, prefer baseFeePerGas and maxPriorityFeePerGas

Need RPC API keys?

Get 12.5M archival requests for free today.


๐Ÿ” Returns

  • gasPrice โ€” Integer value in hexadecimal format (wei)
    Example: "0x922e5f200" = 39,000,000,000 wei (or 39 Gwei)

๐Ÿšซ Parameters

None.


๐Ÿ“ค Request

POST https://base-mainnet.chainnodes.org/YOUR-API-KEY

โœ… Replace YOUR-API-KEY with your key from the CHAINNODES Dashboard (opens in a new tab).
โœ… You may replace base-mainnet with any other supported network.


๐Ÿ“ฅ Example

curl https://base-mainnet.chainnodes.org/YOUR-API-KEY \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"eth_gasPrice","params":[],"id":1}'

๐Ÿ“ฆ Response

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "0x922e5f200"
}
๐Ÿ’ก

Confusing? Ask blockchain developers in Chainnodes Telegram Chat (opens in a new tab)


๐Ÿ› ๏ธ Use Cases for eth_gasPrice

The eth_gasPrice method is still widely used, especially for applications that need simple, fast gas estimates or operate on legacy transaction formats.

Here are some common scenarios:


๐Ÿ”น Wallets & dApps (Legacy Transactions)

Many wallets or smart contracts not yet migrated to EIP-1559 still rely on a single gasPrice field. This method provides a baseline fee value.

const tx = {
  from: userAddress,
  to: contractAddress,
  data: encodedData,
  gas: 21000,
  gasPrice: await provider.send("eth_gasPrice", [])
}

๐Ÿ”น Displaying Real-Time Gas Fees in Gwei

Use this method to power a UI element that shows current network gas prices for Base.

const gasPrice = await provider.send("eth_gasPrice", [])
console.log(`Current Base gas price: ${parseInt(gasPrice, 16) / 1e9} Gwei`)

๐Ÿ”น Chain Monitoring Tools

Chain dashboards or developer tools can use eth_gasPrice to plot gas trends and alert users when prices spike or drop.


๐Ÿ”น Transaction Fee Calculation

For simple apps that want to show users the ETH (or in Base's case, ETH on Base) cost of a transaction.

const gasPrice = BigInt(await provider.send("eth_gasPrice", []))
const estimatedFee = gasPrice * 21000n // standard ETH transfer gas cost

Base RPC API Documentation by CHAINNODES is based on Erigon node client. Contact us if you are interested in specific methods that are only available on geth, besu, Nethermind or reth