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

# zks_estimateGasL1ToL2

> Returns an estimate of the gas required for a layer 1 (L1) to layer 2 (L2) transaction.

### Parameters

<ParamField query="chainId" type="string" default="11124" 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="zks_estimateGasL1ToL2" required>
  JSON-RPC method name.
</ParamField>

<ParamField body="params" type="object" default={[{"from":"0x1111111111111111111111111111111111111111","to":"0x2222222222222222222222222222222222222222","data":"0xffffffff"}]} placeholder="[{&#x22;from&#x22;:&#x22;0x1111111111111111111111111111111111111111&#x22;,&#x22;to&#x22;:&#x22;0x2222222222222222222222222222222222222222&#x22;,&#x22;data&#x22;:&#x22;0xffffffff&#x22;}]">
  Positional parameters for <code>zks\_estimateGasL1ToL2</code>:

  <ul>
    <li><code>params\[0]</code>: Type: object.</li>
  </ul>
</ParamField>

### Returns

<ResponseField name="result" type="string">
  The estimated gas required for a L1 to L2 transaction, in hexadecimal format. Example: <code>"0x25f64db"</code>.
</ResponseField>

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

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