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

# estimateUserOperationGas

> Learn how to use the estimateUserOperationGas JSON-RPC method.

## Understanding `estimateUserOperationGas`

* `estimateUserOperationGas` takes a partial UserOperation object and returns detailed gas estimates to be used in continued UserOperation construction. It takes:
  * Partial user operation object:
    * `sender` - string.
    * `nonce` - string.
    * `initCode` - string.
    * `callData` - string.
    * `signature` - string.`signature` can be a dummy string, such as `0xfffffffffffffffffffffffffffffff0000000000000000000000000000000007aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1c`.
    * `entrypointAddress` - string.

***

## Query example

```json JSON theme={null}
{
  "method": "eth_estimateUserOperationGas",
  "params": [
    // partial user operation
    {
      "sender": "0x8fb859e944561678be40cdd2db16551396c0b074",
      "nonce": "0x0152",
      "initCode": "0x",
      "callData": "0x9e5d4c49000000000000000000000000329a7f8b91ce7479035cb1b5d62ab41845830ce8000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000",
      "signature": "0x73c3ac716c487ca34bb858247b5ccf1dc354fbaabdd089af3b2ac8e78ba85a4959a2d76250325bd67c11771c31fccda87c33ceec17cc0de912690521bb95ffcb1b"
    },
    "0x5ff137d4b0fdcd49dca30c7cf57e578a026d2789"
  ],
  "id": 1695717515,
  "jsonrpc": "2.0",
  "chainId": 80001
}
```


## OpenAPI

````yaml openapi-bundler POST /#eth_estimateUserOperationGas
openapi: 3.0.0
info:
  title: Particle Network Bundler
  version: 1.0.0
servers:
  - url: https://bundler.particle.network
security: []
paths:
  /#eth_estimateUserOperationGas:
    post:
      summary: estimateUserOperationGas
      operationId: estimateUserOperationGas
      requestBody:
        description: Request to estimate the gas cost of a user operation.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EstimateUserOperationGasRequest'
      responses:
        '200':
          description: Successful response with gas estimation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EstimateUserOperationGasResponse'
components:
  schemas:
    EstimateUserOperationGasRequest:
      allOf:
        - $ref: '#/components/schemas/RPCRequest'
        - type: object
          properties:
            method:
              enum:
                - eth_estimateUserOperationGas
            params:
              type: array
              description: Parameters for gas estimation.
              items:
                anyOf:
                  - type: object
                    properties:
                      sender:
                        type: string
                        description: Sender address.
                        example: 0xSenderAddress
                      nonce:
                        type: string
                        description: Nonce value.
                        example: '0x1'
                      initCode:
                        type: string
                        description: Initialization code, optional.
                        example: 0xInitCode
                      callData:
                        type: string
                        description: Call data.
                        example: 0xCallData
                      signature:
                        type: string
                        description: Signature.
                        example: 0xSignature
                  - type: string
    EstimateUserOperationGasResponse:
      allOf:
        - $ref: '#/components/schemas/RPCResponse'
        - type: object
          properties:
            result:
              type: object
              properties:
                maxFeePerGas:
                  type: string
                  description: Maximum fee per gas unit.
                  example: '0x3B9ACA00'
                maxPriorityFeePerGas:
                  type: string
                  description: Maximum priority fee per gas unit.
                  example: '0x3B9ACA00'
                preVerificationGas:
                  type: string
                  description: Gas cost for pre-verification.
                  example: '0x5208'
                verificationGas:
                  type: string
                  description: Gas cost for verification.
                  example: '0x5208'
                verificationGasLimit:
                  type: string
                  description: Gas limit for verification.
                  example: '0x5208'
                callGasLimit:
                  type: string
                  description: Gas limit for the call.
                  example: '0x5208'
    RPCRequest:
      type: object
      required:
        - jsonrpc
        - id
        - method
        - params
        - chainId
      properties:
        jsonrpc:
          type: string
          default: '2.0'
          description: Version of the JSON-RPC protocol, should be 2.0.
          example: '2.0'
        id:
          type: integer
          default: 1
          description: The request identifier.
          example: 1
        chainId:
          type: integer
          description: The chain ID.
          example: 80001
        method:
          type: string
          description: API method being called.
        params:
          type: array
          description: Parameters for the API method call.
    RPCResponse:
      type: object
      required:
        - jsonrpc
        - id
        - result
        - chainId
      properties:
        jsonrpc:
          type: string
          default: '2.0'
          description: Version of the JSON-RPC protocol, should be 2.0.
          example: '2.0'
        id:
          type: integer
          default: 1
          description: The request identifier.
          example: 1
        chainId:
          type: integer
          description: The chain ID.
          example: 80001
        result:
          anyOf:
            - $ref: '#/components/schemas/AnyValue'
    AnyValue:
      anyOf:
        - type: string
        - type: number
        - type: integer
        - type: boolean
        - type: object
        - type: array
          items: {}

````