> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chainstack.com/llms.txt
> Use this file to discover all available pages before exploring further.

# eth_estimateGas | Monad

> Monad API method that generates and returns an estimate of how much gas is necessary to allow the transaction to complete. On Monad.

Monad API method that generates and returns an estimate of how much gas is necessary to allow the transaction to complete. The transaction will not be added to the blockchain.

<Note>
  **Monad-specific behavior**: Does not accept EIP-4844 (blob) transaction type, as EIP-4844 is not supported on Monad.
</Note>

## Parameters

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

## Response

* `result` — the estimated amount of gas needed for the transaction, encoded as hexadecimal.

## `eth_estimateGas` code examples

<CodeGroup>
  ```javascript ethers.js theme={"system"}
  const { ethers } = require("ethers");

  const provider = new ethers.JsonRpcProvider("CHAINSTACK_NODE_URL");

  async function estimateGas() {
    // Estimate gas for name() call on Wrapped Monad (WMON) contract
    const gasEstimate = await provider.estimateGas({
      to: "0x760AfE86e5de5fa0Ee542fc7B7B713e1c5425701",
      data: "0x06fdde03" // name()
    });
    console.log(`Estimated gas: ${gasEstimate.toString()}`);
  }

  estimateGas();
  ```

  ```python web3.py theme={"system"}
  from web3 import Web3

  node_url = "CHAINSTACK_NODE_URL"

  web3 = Web3(Web3.HTTPProvider(node_url))

  # Estimate gas for name() call on Wrapped Monad (WMON) contract
  gas_estimate = web3.eth.estimate_gas({
      'to': '0x760AfE86e5de5fa0Ee542fc7B7B713e1c5425701',
      'data': '0x06fdde03' # name()
  })
  print(f'Estimated gas: {gas_estimate}')
  ```
</CodeGroup>

## Use case

A practical use case for `eth_estimateGas` is providing accurate gas estimates to users before they confirm transactions, preventing failed transactions due to insufficient gas.


## OpenAPI

````yaml openapi/monad_node_api/gas_data/eth_estimateGas.json POST /
openapi: 3.0.0
info:
  title: Monad Node API
  version: 1.0.0
  description: This is an API for interacting with a Monad node.
servers:
  - url: https://monad-testnet.core.chainstack.com/9c5b265f20b3ea5df4f54f70eb74b800
security: []
paths:
  /:
    post:
      tags:
        - Gas data
      summary: eth_estimateGas
      operationId: eth_estimateGas
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: integer
                  default: 1
                jsonrpc:
                  type: string
                  default: '2.0'
                method:
                  type: string
                  default: eth_estimateGas
                params:
                  type: array
                  items:
                    type: object
                    properties:
                      to:
                        type: string
                      data:
                        type: string
                  default:
                    - to: '0x760AfE86e5de5fa0Ee542fc7B7B713e1c5425701'
                      data: '0x06fdde03'
      responses:
        '200':
          description: The estimated gas amount.
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    type: string
                  id:
                    type: integer
                  result:
                    type: string

````