Quicknode RPC icon

Quicknode RPC

Interact with blockchain via Quicknode RPC

Estimate Gas

AI-generated

Summary

Estimates the gas cost for a specific transaction using the eth_estimateGas method.

Inputs

  • to (required) — The address the transaction is directed to.
  • from — The address the transaction is sent from.
  • data — The encoded function call data.
  • value — The value to send in Wei (as decimal or hex).

Output shape

A single record containing the gas estimate (hex), a decimal conversion, and the RPC method used.

The primary result is returned as a hex string; the decimal conversion is provided for easier reading.

Examples

Example 1: Estimating gas for a contract function call

Set To Address to the contract address, Data to the encoded function signature and parameters.

Example 2: Estimating gas for a standard ETH transfer

Set To Address to the recipient, Value to the transfer amount in Wei.

Links

Discussion