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

# klay_estimateGas

> Estimates the gas necessary to execute a transaction without broadcasting it.

### Parameters

<ParamField query="chainId" type="string" default="1001" required>
  Unique identifier for a blockchain network.
</ParamField>

<ParamField body="id" type="number" default={1} required>
  Request identifier used to match responses.
</ParamField>

<ParamField body="jsonrpc" type="string" default="2.0" required>
  JSON-RPC version.
</ParamField>

<ParamField body="method" type="string" default="klay_estimateGas" required>
  JSON-RPC method name.
</ParamField>

<ParamField body="params" type="object" default={[{"from":"0x1b3c8c1cdb4e6b6b8819345bf3c6d9c926f55f90","to":"0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b","value":"0xde0b6b3a7640000"}]} placeholder="[{&#x22;from&#x22;:&#x22;0x1b3c8c1cdb4e6b6b8819345bf3c6d9c926f55f90&#x22;,&#x22;to&#x22;:&#x22;0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b&#x22;,&#x22;value&#x22;:&#x22;0xde0b6b3a7640000&#x22;}]" required>
  Parameters: \[transaction object, block parameter].

  Positional parameters for <code>klay\_estimateGas</code>:

  <ul>
    <li><code>params\[0]</code>: Legacy transaction (pre-EIP-2718).</li>
    <li><code>params\[1]</code>: Block identifier. Can be an integer block number or a string tag: "latest", "earliest", or "pending".</li>
  </ul>
</ParamField>

### Returns

<ResponseField name="result" type="string">
  Estimated gas amount in hex. Example: <code>"0x5208"</code>.
</ResponseField>

<RequestExample>
  ```bash Curl theme={null}
  curl --request POST \
    --url https://api.uniblock.dev/uni/v1/json-rpc?chainId=1001 \
    --header 'content-type: application/json' \
    --data '{
      "id": 1,
      "jsonrpc": "2.0",
      "method": "klay_estimateGas",
      "params": [
        {
          "from": "0x1b3c8c1cdb4e6b6b8819345bf3c6d9c926f55f90",
          "to": "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b",
          "value": "0xde0b6b3a7640000"
        }
      ]
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json Success theme={null}
  {
    "jsonrpc": "2.0",
    "id": 1,
    "result": "0x5208"
  }
  ```
</ResponseExample>
