Skip to main content
POST
eth_estimateGas
curl --request POST \
  --url https://tempo-moderato.core.chainstack.com/a25a421add2280d53fdbc23417055501/ \
  --header 'Content-Type: application/json' \
  --data '
{
  "jsonrpc": "2.0",
  "method": "eth_estimateGas",
  "params": [
    {
      "from": "0x9729187D9E8Bbefa8295F39f5634cA454dd9d294",
      "to": "0x20c0000000000000000000000000000000000000",
      "data": "0x70a082310000000000000000000000009729187d9e8bbefa8295f39f5634ca454dd9d294"
    }
  ],
  "id": 1
}
'
{
  "jsonrpc": "<string>",
  "id": 123,
  "result": "<string>"
}
Tempo API method that estimates the gas needed to execute a transaction. On Tempo, gas fees are paid in TIP-20 stablecoins, not a native token.
Get you own node endpoint todayStart for free and get your app to production levels immediately. No credit card required.You can sign up with your GitHub, X, Google, or Microsoft account.

Parameters

  • callObject — the call object:
    • from — (optional) address the transaction is sent from
    • to — (optional) address the transaction is directed to
    • gas — (optional) gas provided for the transaction
    • gasPrice — (optional) gas price
    • value — (optional) value sent with the transaction
    • data — (optional) hash of the method signature and encoded parameters

Response

  • result — the estimated gas amount encoded as hexadecimal

eth_estimateGas code examples

const Web3 = require("web3");
const NODE_URL = "CHAINSTACK_NODE_URL";
const web3 = new Web3(NODE_URL);

async function estimateGas() {
  const gas = await web3.eth.estimateGas({
    from: "0x9729187D9E8Bbefa8295F39f5634cA454dd9d294",
    to: "0x20c0000000000000000000000000000000000000",
    data: "0x70a082310000000000000000000000009729187d9e8bbefa8295f39f5634ca454dd9d294"
  });
  console.log(`Estimated gas: ${gas}`);
}

estimateGas()

Body

application/json
jsonrpc
string
default:2.0
method
string
default:eth_estimateGas
params
any[]

Transaction call object

id
integer
default:1

Response

200 - application/json

The estimated gas

jsonrpc
string
id
integer
result
string

The estimated gas amount encoded as hexadecimal

Last modified on January 23, 2026