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

# starknet_estimateFee

> Estimates the resources required by a given sequence of transactions when applied on a given state. If one of the transactions reverts or fails due to any reason (e.g. validation failure or an internal error), a TRANSACTION_EXECUTION_ERROR is returned. For v0-2 transactions the estimate is given in wei, and for v3 transactions it is given in fri.

### Parameters

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

<ParamField body="params" type="object" default={{"request":[{"type":"INVOKE","max_fee":"0x28ed6103d0000","version":"0x1","signature":["0x42527ffe9912b338983cbed67e139cfcc26a4d8cf1d1c2a85e4125fdf5f59ed","0x636147d06fefd02ed37984b752556d4b9aefdac1a50b3df0528ec7c201ad84b"],"sender_address":"0x13e3ca9a377084c37dc7eacbd1d9f8c3e3733935bcbad887c32a0e213cd6fe0","calldata":["0x2","0x57c4b510d66eb1188a7173f31cccee47b9736d40185da8144377b896d5ff3","0x2f0b3c5710379609eb5495f1ecd348cb28167711b73609fe565a72734550354","0x0","0x1","0x57c4b510d66eb1188a7173f31cccee47b9736d40185da8144377b896d5ff3","0x2f0b3c5710379609eb5495f1ecd348cb28167711b73609fe565a72734550354","0x1","0x1","0x2","0x0","0x1"],"nonce":"0x1"}],"block_id":{"block_number":59999}}} placeholder="{&#x22;request&#x22;:[{&#x22;type&#x22;:&#x22;INVOKE&#x22;,&#x22;max_fee&#x22;:&#x22;0x28ed6103d0000&#x22;,&#x22;version&#x22;:&#x22;0x1&#x22;,&#x22;signature&#x22;:[&#x22;0x42527ffe9912b338983cbed67e139cfcc26a4d8cf1d1c2a85e4125fdf5f59ed&#x22;,&#x22;0x636147d06fefd02ed37984b752556d4b9aefdac1a50b3df0528ec7c201ad84b&#x22;],&#x22;sender_address&#x22;:&#x22;0x13e3ca9a377084c37dc7eacbd1d9f8c3e3733935bcbad887c32a0e213cd6fe0&#x22;,&#x22;calldata&#x22;:[&#x22;0x2&#x22;,&#x22;0x57c4b510d66eb1188a7173f31cccee47b9736d40185da8144377b896d5ff3&#x22;,&#x22;0x2f0b3c5710379609eb5495f1ecd348cb28167711b73609fe565a72734550354&#x22;,&#x22;0x0&#x22;,&#x22;0x1&#x22;,&#x22;0x57c4b510d66eb1188a7173f31cccee47b9736d40185da8144377b896d5ff3&#x22;,&#x22;0x2f0b3c5710379609eb5495f1ecd348cb28167711b73609fe565a72734550354&#x22;,&#x22;0x1&#x22;,&#x22;0x1&#x22;,&#x22;0x2&#x22;,&#x22;0x0&#x22;,&#x22;0x1&#x22;],&#x22;nonce&#x22;:&#x22;0x1&#x22;}],&#x22;block_id&#x22;:{&#x22;block_number&#x22;:59999}}">
  The parameters for method starknet\_estimateFee: \[]

  Parameters for <code>starknet\_estimateFee</code>:

  <ul>
    <li><code>params.request</code>: Type: object\[].</li>
    <li><code>params.block\_id</code>: BlockID object containing hash and number.</li>
  </ul>
</ParamField>

### Returns

<ResponseField name="result" type="array">
  Array of fee estimates corresponding to the transactions.

  <Expandable title="items">
    <ResponseField name="items[]" type="object">
      <Expandable title="properties">
        <ResponseField name="gas_consumed" type="string">
          The Ethereum gas consumed by the transaction.
        </ResponseField>

        <ResponseField name="gas_price" type="string">
          Gas price (in gwei) used for estimation.
        </ResponseField>

        <ResponseField name="overall_fee" type="string">
          Estimated fee for the transaction (gas\_consumed \* gas\_price) in gwei.
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```bash Curl theme={null}
  curl --request POST \
    --url https://api.uniblock.dev/uni/v1/json-rpc?chainId=starknet-sepolia \
    --header 'content-type: application/json' \
    --data '{
      "id": 1,
      "jsonrpc": "2.0",
      "method": "starknet_estimateFee",
      "params": {
        "request": [
          {
            "type": "INVOKE",
            "max_fee": "0x28ed6103d0000",
            "version": "0x1",
            "signature": [
              "0x42527ffe9912b338983cbed67e139cfcc26a4d8cf1d1c2a85e4125fdf5f59ed",
              "0x636147d06fefd02ed37984b752556d4b9aefdac1a50b3df0528ec7c201ad84b"
            ],
            "sender_address": "0x13e3ca9a377084c37dc7eacbd1d9f8c3e3733935bcbad887c32a0e213cd6fe0",
            "calldata": [
              "0x2",
              "0x57c4b510d66eb1188a7173f31cccee47b9736d40185da8144377b896d5ff3",
              "0x2f0b3c5710379609eb5495f1ecd348cb28167711b73609fe565a72734550354",
              "0x0",
              "0x1",
              "0x57c4b510d66eb1188a7173f31cccee47b9736d40185da8144377b896d5ff3",
              "0x2f0b3c5710379609eb5495f1ecd348cb28167711b73609fe565a72734550354",
              "0x1",
              "0x1",
              "0x2",
              "0x0",
              "0x1"
            ],
            "nonce": "0x1"
          }
        ],
        "block_id": {
          "block_number": 59999
        }
      }
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json Success theme={null}
  {
    "jsonrpc": "2.0",
    "id": 1,
    "result": [
      {
        "gas_consumed": "0x41de",
        "gas_price": "0x67edb4f57",
        "overall_fee": "0x1abd7b153e472"
      }
    ]
  }
  ```
</ResponseExample>
