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

# zks_estimateFee | zkSync Era

> zkSync Era API method that returns an estimate of the transaction fee for a given transaction in the zkSync network. On zkSync Era.

zkSync Era API method that returns an estimate of the transaction fee for a given transaction in the zkSync network.

This method estimates the fee required to process a transaction on the zkSync network. It considers the current network load and the transaction's complexity. Developers can use this estimate to inform users of the expected cost to ensure transactions are processed efficiently on the zkSync network.

## Parameters

The transaction request object for which the fee is estimated. It includes several fields similar to Ethereum transactions but tailored for zkSync's L2 operations:

* `from` — the string of the address initiating the transaction.
* `to` — the string of the address to which the transaction is directed. Can be a wallet address or a smart contract on zkSync.
* `data` — (optional) additional data sent with the transaction, typically used for smart contract interactions. It's a string of the hash of the method signature and encoded parameters, aligning with the Ethereum Contract ABI.

## Response

The response includes detailed fee information, breaking down the costs associated with executing the transaction on zkSync and any associated costs on the L1 network:

* `gasLimit` — the maximum gas limit that can be used for the transaction's execution.
* `gasPerPubdataLimit` — the gas cost per byte of public data in the transaction, a unique aspect of zkSync's scaling solution.
* `maxFeePerGas` — the maximum fee (in Wei) the sender will pay for each gas unit.
* `maxPriorityFeePerGas` — the maximum priority fee per gas.

## Use Case

Using `zks_estimateFee` applications can provide accurate fee estimates for various operations, ensuring users are fully informed of upfront costs. This facilitates a more efficient allocation of resources and enhances user trust through transparency.


## OpenAPI

````yaml openapi/zksync_node_api/zks_estimateFee.json POST /afb8312f3710a5bc469f4c87cad3a2e4
openapi: 3.0.0
info:
  title: JSON-RPC API
  version: 1.0.0
servers:
  - url: https://nd-995-911-243.p2pify.com
security: []
paths:
  /afb8312f3710a5bc469f4c87cad3a2e4:
    post:
      summary: zks_estimateFee example
      operationId: zks_estimateFee
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/JsonRpcRequest'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonRpcResponse'
components:
  schemas:
    JsonRpcRequest:
      type: object
      required:
        - jsonrpc
        - id
        - method
        - params
      properties:
        jsonrpc:
          type: string
          example: '2.0'
          default: '2.0'
        id:
          type: integer
          example: 2
          default: 2
        method:
          type: string
          example: zks_estimateFee
          default: zks_estimateFee
        params:
          type: array
          default:
            - from: '0x7AeD074cA56F5050D5A2E512eCc5bf7103937d76'
              to: '0x6B7f71BB1f5B74fB0Ff82cf4EA20A5F90d43E509'
              data: 0x
          items:
            type: object
            properties:
              from:
                type: string
                example: '0x7AeD074cA56F5050D5A2E512eCc5bf7103937d76'
                default: '0x7AeD074cA56F5050D5A2E512eCc5bf7103937d76'
              to:
                type: string
                example: '0x6B7f71BB1f5B74fB0Ff82cf4EA20A5F90d43E509'
                default: '0x6B7f71BB1f5B74fB0Ff82cf4EA20A5F90d43E509'
              data:
                type: string
                example: 0x
                default: 0x
    JsonRpcResponse:
      type: object
      required:
        - jsonrpc
        - id
        - result
      properties:
        jsonrpc:
          type: string
          example: '2.0'
          default: '2.0'
        id:
          type: integer
          default: 2
        result:
          type: object
          additionalProperties: true

````