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

# createUserOp

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

## Understanding `createUserOp`

* `createUserOp` will construct and return a UserOperation object and hash using a transaction or collection of transactions, alongside smart account and fee payment information. It takes:
  * Account config object:
    * `name` - string, either `BICONOMY`, `CYBERCONNECT`, or `SIMPLE`.
    * `version` - string, either `1.0.0` or `2.0.0`.
    * `ownerAddress` - string.
    * `biconomyApiKey` - (optional, for using Biconomy's Paymaster), string.
  * Array of transactions:
    * Standard transaction object.
  * Optionally, a token `feeQuote` object, retrieved from `getFeeQuotes`, only used if you're paying the gas fee in an ERC-20 token.
  * Token paymaster address - (optional), string.

***

## Query example

```json JSON theme={null}
{
  "jsonrpc": "2.0",
  "id": "4259f7fe-87aa-44fd-89c8-fc1e41f6d3d8",
  "chainId": 80001,
  "method": "particle_aa_createUserOp",
  "params": [
    // account config
    {
      "name": "BICONOMY",
      "version": "1.0.0",
      "ownerAddress": "0xA60123a1056e9D38B64c4993615F27cCe9A9E8D5",
      "biconomyApiKey": "LdF-gC43H.6f0ec763-fde5-4d5e-89f6-1b9ef12ba4a4" // optional
    },
    // txs
    [
      {
        "to": "0x329a7f8b91Ce7479035cb1B5D62AB41845830Ce8",
        "value": "0x1",
        "data": "0x"
      }
    ],
    // optional: If you don't pass the following params, it'll create a gasless/user paid user op
    // token feeQuote
    {
      "tokenInfo": {
        "chainId": 80001,
        "name": "WMATIC",
        "symbol": "WMATIC",
        "decimals": 18,
        "address": "0x9c3C9283D3e44854697Cd22D3Faa240Cfb032889",
        "logoURI": "https://polygonscan.com/token/images/wMatic_32.png"
      },
      "fee": "374428266633331",
      "balance": "1019119852023946296",
      "premiumPercentage": "10"
    },
    // token paymaster address
    "0x00000f7365cA6C59A2C93719ad53d567ed49c14C"
  ]
}
```


## OpenAPI

````yaml openapi-aa POST /#particle_aa_createUserOp
openapi: 3.0.0
info:
  title: Particle Network Account Abstraction RPC
  version: 1.0.0
servers:
  - url: https://rpc.particle.network/evm-chain
security:
  - BasicAuth: []
paths:
  /#particle_aa_createUserOp:
    post:
      summary: createUserOp
      operationId: createUserOp
      requestBody:
        description: Request to create a user operation.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateUserOpRequest'
      responses:
        '200':
          description: Successful response with created user operation details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateUserOpResponse'
components:
  schemas:
    CreateUserOpRequest:
      allOf:
        - $ref: '#/components/schemas/RPCRequest'
        - type: object
          properties:
            method:
              enum:
                - particle_aa_createUserOp
            params:
              type: array
              description: Parameters for creating a user operation.
              items:
                oneOf:
                  - type: string
                  - type: object
                    properties:
                      to:
                        type: string
                        description: Recipient address.
                        example: 0xRecipientAddress
                      value:
                        type: string
                        description: Amount value.
                        example: '1000000000000000000'
                      data:
                        type: string
                        description: Transaction data.
                        example: 0xTransactionData
                  - type: object
                    properties:
                      tokenInfo:
                        type: object
                        description: Token information.
                        properties:
                          chainId:
                            type: number
                            description: Chain ID.
                            example: 80001
                          name:
                            type: string
                            description: Token name.
                            example: Example Token
                          symbol:
                            type: string
                            description: Token symbol.
                            example: EXT
                          decimals:
                            type: number
                            description: Token decimals.
                            example: 18
                          address:
                            type: string
                            description: Token address.
                            example: 0xTokenAddress
                          logoURI:
                            type: string
                            description: Token logo URI.
                            example: https://example.com/logo.png
                      fee:
                        type: string
                        description: Fee amount.
                        example: '0.01'
                      balance:
                        type: string
                        description: Balance amount.
                        example: '1000000000000000000'
                      premiumPercentage:
                        type: string
                        description: Premium percentage.
                        example: '1'
                  - type: string
    CreateUserOpResponse:
      allOf:
        - $ref: '#/components/schemas/RPCResponse'
        - type: object
          properties:
            result:
              type: object
              properties:
                userOp:
                  type: object
                  description: User operation details.
                userOpHash:
                  type: string
                  description: User operation hash.
                  example: 0xUserOpHash
    RPCRequest:
      type: object
      required:
        - jsonrpc
        - id
        - method
        - params
      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
        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
      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
        result:
          anyOf:
            - $ref: '#/components/schemas/AnyValue'
        chainId:
          type: integer
          description: The blockchain chain ID.
          example: 80001
    AnyValue:
      anyOf:
        - type: string
        - type: number
        - type: integer
        - type: boolean
        - type: object
        - type: array
          items: {}
  securitySchemes:
    BasicAuth:
      type: http
      scheme: basic

````