> ## 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 | Ronin

> The eth_estimateGas method calculates the amount of gas required to execute a transaction. eth_estimateGas on Ronin via Chainstack.

The `eth_estimateGas` method calculates the amount of gas required to execute a transaction. This estimation is done without sending the transaction to the network. It's important to note that the actual gas used by the transaction may differ from the estimate due to the dynamic nature of Ronin transactions and block inclusion.

## Parameters

* `transaction`: An object containing transaction fields, including:
  * `from` (optional): The address the transaction is sent from.
  * `to`: The address the transaction is directed to.
  * Additional fields such as `value`, `data`, and `gasPrice` can also be included for a more accurate estimate.
* `blockParameter` (optional): A string representing the block number (in hexadecimal) or one of the strings "latest", "earliest", or "pending". This parameter determines the state against which the transaction is estimated.

## Response

* `result`: The estimated amount of gas required to execute the transaction, returned as a hexadecimal number.

## Use case

Estimating gas is crucial for interacting with the Ronin network as it helps users and applications determine the appropriate gas limit to specify for a transaction. This prevents transactions from running out of gas (and thus failing) or from overestimating and locking unnecessary amounts of ether for gas.


## OpenAPI

````yaml openapi/ronin_node_api/eth_estimateGas.json POST /3997273fc956a67dc6982384500e669e
openapi: 3.0.0
info:
  title: eth_estimateGas
  version: 1.0.0
  description: >-
    Generates an estimate of how much gas is necessary to allow the transaction
    to complete. The transaction  will not be added to the blockchain. Note that
    the estimate may be significantly more than the amount of gas actually used 
    by the transaction, for various reasons including EVM mechanics and node
    performance.
servers:
  - url: https://ronin-mainnet.core.chainstack.com
security: []
paths:
  /3997273fc956a67dc6982384500e669e:
    post:
      tags:
        - blockchain
      summary: Estimate gas needed for a transaction
      operationId: 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:
                    oneOf:
                      - type: object
                        properties:
                          from:
                            type: string
                          to:
                            type: string
                        required:
                          - from
                          - to
                      - type: string
                  default:
                    - from: '0xa459322a949b97c1cbcf3c82dfc4de9fefc6fb7c'
                      to: '0xbe0eb53f46cd790cd13851d5eff43d12404d33e8'
                    - latest
      responses:
        '200':
          description: Estimated gas required for the transaction
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    type: string
                  id:
                    type: integer
                  result:
                    type: string

````