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

# Prepare call quote

> Prepares the necessary data structure for executing one or more contract calls on a target chain. This endpoint helps construct the appropriate user operation, handles token allowance requirements, and generates a signed quote ready for execution.




## OpenAPI

````yaml post /quotes/prepare-call-quote
openapi: 3.1.0
info:
  version: 1.6.2
  title: OneBalance API
  description: >
    # OneBalance API


    The OneBalance API provides a programmatic interface for managing OneBalance
    resources using standard HTTP requests. The API documentation includes a
    design and technology overview, followed by detailed endpoint information.


    ## Features


    OneBalance API provides a complete chain abstraction toolkit:


    - Smart Account Management: Predict addresses and deploy accounts

    - Cross-Chain Balances: View aggregated balances across multiple chains

    - Multichain Transactions: Execute transfers and swaps using aggregated
    balances

    - Transaction Status: Track multichain transaction history and status

    - Token Aggregation: Access unified token lists and pricing information


    Enterprise API Access: Need higher rate limits, dedicated infrastructure, or
    custom SLAs? [Contact our sales](mailto:sales@onebalance.io) team for
    enterprise API solutions.


    ## Base URL


    OneBalance API is built on REST principles and is served over HTTPS. To
    ensure data privacy, unencrypted HTTP is not supported.


    The Base URL for all API endpoints is:


    ```bash

    https://be.onebalance.io/api

    ```


    ## Quickstart


    Try our reference application at
    [app.onebalance.io](https://app.onebalance.io) to see the API in action or
    jump straight into our [API
    Reference](https://docs.onebalance.io/api-reference/account/predict-address)
    to start building.


    ## Authentication


    The OneBalance API uses API keys to authenticate requests. All API requests
    require authentication using an API key passed in the `x-api-key` header:


    ```bash

    curl -X 'GET' \
      'https://be.onebalance.io/api/path-to/endpoint' \
      -H 'x-api-key: 42bb629272001ee1163ca0dbbbc07bcbb0ef57a57baf16c4b1d4672db4562c11'
    ```


    A public API key is available for testing purposes with limited usage:
    **42bb629272001ee1163ca0dbbbc07bcbb0ef57a57baf16c4b1d4672db4562c11**


    All API requests must be made over
    [HTTPS](https://en.wikipedia.org/wiki/HTTPS). Calls made over plain HTTP
    will fail. API requests without authentication will also fail.
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
  contact:
    name: OneBalance Support
    email: support@onebalance.io
  termsOfService: https://onebalance.io/terms-of-service
servers:
  - url: https://be.onebalance.io/api
    description: Production environment
security:
  - ApiKeyAuth: []
tags:
  - name: Account
    x-displayName: Smart Accounts
    description: >-
      Manage and predict addresses for OneBalance smart accounts. These accounts
      enable features like resource locks and streamlined cross-chain
      interactions.
  - name: Assets
    x-displayName: Aggregated Assets
    description: >-
      Retrieve details about supported aggregated assets. Aggregated assets
      represent a unified view of a token across multiple chains, simplifying
      cross-chain operations.
  - name: Balances
    x-displayName: Aggregated Balances
    description: >-
      Access and track aggregated asset balances for user accounts. These
      balances reflect a user's total holdings of an asset across all supported
      chains, usable for multichain transactions.
  - name: Chains
    x-displayName: Supported Chains
    description: >-
      List and get details about the blockchain networks currently integrated
      with and supported by the OneBalance platform.
  - name: Status
    x-displayName: Transaction Status & History
    description: >-
      Track the real-time status of quote executions and retrieve complete
      transaction histories for user accounts, offering visibility into
      multichain operations.
  - name: Quotes
    x-displayName: Quotes & Execution
    description: >-
      Request, prepare, and execute quotes for various cross-chain operations
      including asset transfers, swaps, and arbitrary contract interactions.
      These endpoints facilitate the core transaction lifecycle on OneBalance.
paths:
  /quotes/prepare-call-quote:
    post:
      tags:
        - Quotes
      summary: Prepare call quote
      description: >
        Prepares the necessary data structure for executing one or more contract
        calls on a target chain. This endpoint helps construct the appropriate
        user operation, handles token allowance requirements, and generates a
        signed quote ready for execution.
      operationId: prepareCallQuote
      parameters: []
      requestBody:
        required: true
        description: Details of the account, calls, and token requirements.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/prepare-call-request'
            examples:
              RoleBasedCall:
                summary: Role-based account call preparation
                description: Traditional role-based account for contract execution
                value:
                  account:
                    accountAddress: '0xb8e4b017f4a8870E3eB4eb15c5e180D2a34D877B'
                    adminAddress: '0x8FA09fc75bC2619e594cCb720096627DCaA7c5C4'
                    sessionAddress: '0xBbef1E2dEA96c1c2001Eb48136e513A855F46097'
                  targetChain: eip155:10
                  calls:
                    - data: >-
                        0x095ea7b3000000000000000000000000Bbef1E2dEA96c1c2001Eb48136e513A855F460970000000000000000000000000000000000000000000000000000000000000001
                      to: '0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85'
                      value: '0x0'
                  allowanceRequirements:
                    - assetType: >-
                        eip155:10/erc20:0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85
                      amount: '8000000'
                      spender: '0xb8e4b017f4a8870E3eB4eb15c5e180D2a34D877B'
                  tokensRequired:
                    - assetType: >-
                        eip155:10/erc20:0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85
                      amount: '8000000'
                  overrides:
                    - address: '0xb8e4b017f4a8870E3eB4eb15c5e180D2a34D877B'
                      balance: '0x1'
              EIP7702Call:
                summary: EIP-7702 delegation + execution
                description: >-
                  EOA account using EIP-7702 delegation for contract execution
                  (requires additional delegation signature)
                value:
                  account:
                    type: kernel-v3.3-ecdsa
                    deploymentType: EIP7702
                    signerAddress: '0x5Cb2369421F8a00Ef556d662D6E97C1419B1d37c'
                    accountAddress: '0x5Cb2369421F8a00Ef556d662D6E97C1419B1d37c'
                  targetChain: eip155:42161
                  calls:
                    - data: >-
                        0xa9059cbb0000000000000000000000004ebcfae0c3e747c95504ca7c79c46f725cb4c752000000000000000000000000000000000000000000000000000000000000000100000000
                      to: '0xaf88d065e77c8cc2239327c5edb3a432268e5831'
                      value: '0x0'
                  allowanceRequirements: []
                  tokensRequired:
                    - assetType: >-
                        eip155:42161/erc20:0xaf88d065e77c8cc2239327c5edb3a432268e5831
                      amount: '1000000'
      responses:
        '200':
          description: Call quote prepared successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/target-call-quote'
              examples:
                RoleBasedResponse:
                  summary: Role-based account response
                  description: Standard response for role-based accounts
                  value:
                    account:
                      accountAddress: '0xb8e4b017f4a8870E3eB4eb15c5e180D2a34D877B'
                      adminAddress: '0x8FA09fc75bC2619e594cCb720096627DCaA7c5C4'
                      sessionAddress: '0xBbef1E2dEA96c1c2001Eb48136e513A855F46097'
                    chainOperation:
                      userOp:
                        sender: '0xb8e4b017f4a8870e3eb4eb15c5e180d2a34d877b'
                        nonce: >-
                          1120126849530300722547379539971600052481264750391572034956634531672621056
                        factory: '0xd703aae79538628d27099b8c4f621be4ccd142d5'
                        factoryData: 0x
                        callData: >-
                          0xe9ae5c530100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000b2c639c533813f4aa9d7837caf62653d097ff85000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044a9059cbb0000000000000000000000004ebcfae0c3e747c95504ca7c79c46f725cb4c752000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000
                        callGasLimit: '737280'
                        verificationGasLimit: '3076170'
                        preVerificationGas: '0'
                        maxFeePerGas: '0'
                        maxPriorityFeePerGas: '0'
                        paymaster: '0xa784e6482bd5edbfe5991b18cbd545ebd46e1cc4'
                        paymasterVerificationGasLimit: '19219'
                        paymasterPostOpGasLimit: '0'
                        paymasterData: 0x
                        signature: 0x
                      typedDataToSign:
                        domain:
                          name: RoleBasedECDSAValidator
                          version: 1.4.3
                          chainId: 10
                          verifyingContract: '0xA24bD06230f3F54e5bf266AE7A41750eE3b789FA'
                        types:
                          Approve:
                            - name: callDataAndNonceHash
                              type: bytes32
                        primaryType: Approve
                        message:
                          callDataAndNonceHash: >-
                            0xaab2ddac63e4a7e25b7d339cacdff2f9280025cef27699ffe5f5e9e9625b15eb
                      assetType: >-
                        eip155:10/erc20:0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85
                      amount: '8000000'
                    tamperProofSignature: >-
                      0x1eeb521fc3ffd61cb3fa44526b3933155ed774d5c599491bd6dca1366bb8eaed4004f311351ed7ca2f9777e8e561556f546a32bc2b45df7fe303c709613ead541b
                EIP7702WithDelegation:
                  summary: EIP-7702 response with delegation required
                  description: >-
                    Response when EIP-7702 account needs delegation - includes
                    delegation object to be signed
                  value:
                    account:
                      type: kernel-v3.3-ecdsa
                      deploymentType: EIP7702
                      signerAddress: '0x5Cb2369421F8a00Ef556d662D6E97C1419B1d37c'
                      accountAddress: '0x5Cb2369421F8a00Ef556d662D6E97C1419B1d37c'
                    chainOperation:
                      userOp:
                        sender: '0x5cb2369421f8a00ef556d662d6e97c1419b1d37c'
                        nonce: >-
                          913479994650515257524606220465835134743662536739504622017003723935449088
                        factory: '0xd703aae79538628d27099b8c4f621be4ccd142d5'
                        factoryData: 0x
                        callData: >-
                          0xe9ae5c530100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000b2c639c533813f4aa9d7837caf62653d097ff85000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000044a9059cbb0000000000000000000000004ebcfae0c3e747c95504ca7c79c46f725cb4c752000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000
                        callGasLimit: '2841388'
                        verificationGasLimit: '59183'
                        preVerificationGas: '0'
                        maxFeePerGas: '0'
                        maxPriorityFeePerGas: '0'
                        paymaster: '0xa784e6482bd5edbfe5991b18cbd545ebd46e1cc4'
                        paymasterVerificationGasLimit: '12999'
                        paymasterPostOpGasLimit: '0'
                        paymasterData: 0x
                        signature: 0x
                      typedDataToSign:
                        domain:
                          name: RoleBasedECDSAValidator
                          version: 1.4.3
                          chainId: 10
                          verifyingContract: '0xA24bD06230f3F54e5bf266AE7A41750eE3b789FA'
                        types:
                          Approve:
                            - name: callDataAndNonceHash
                              type: bytes32
                        primaryType: Approve
                        message:
                          callDataAndNonceHash: >-
                            0x81c1563d59b790af8ab6a9574bc3be3e3a1d3b2fc6bf2c778f4efc2f966322ea
                      assetType: >-
                        eip155:10/erc20:0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85
                      amount: '1000000'
                      delegation:
                        contractAddress: '0xd6CEDDe84be40893d153Be9d467CD6aD37875b28'
                        nonce: 0
                    tamperProofSignature: >-
                      0x1eeb521fc3ffd61cb3fa44526b3933155ed774d5c599491bd6dca1366bb8eaed4004f311351ed7ca2f9777e8e561556f546a32bc2b45df7fe303c709613ead541b
        '400':
          description: Invalid request parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/http-exception'
              examples:
                InvalidAccount:
                  summary: Invalid EIP-7702 account configuration
                  value:
                    error: Validation failed
                    message: >-
                      EIP-7702 deployment type requires kernel-v3.3-ecdsa
                      account type
                    statusCode: 400
        '401':
          $ref: '#/components/responses/unauthorized'
        4XX:
          description: Prepare call quote failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/http-exception'
components:
  schemas:
    prepare-call-request:
      type: object
      properties:
        account:
          description: Account details (smart account / EOA and related addresses).
          allOf:
            - $ref: '#/components/schemas/account'
        targetChain:
          type: string
          description: Target chain in CAIP-2 notation (e.g. "eip155:10" for Optimism).
          example: eip155:10
        calls:
          description: Array of calls to be executed.
          type: array
          items:
            $ref: '#/components/schemas/evm-call-data'
          example:
            - data: >-
                0xa9059cbb0000000000000000000000004ebcfae0c3e747c95504ca7c79c46f725cb4c752000000000000000000000000000000000000000000000000000000000000000100000000
              to: '0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85'
              value: '0'
        allowanceRequirements:
          description: >-
            Array of approvals required for the call. Approvals need to be
            explicitly defined. Any approval pased as call would result into a
            failing request.
          type: array
          items:
            $ref: '#/components/schemas/token-allowance-requirement'
          example:
            - assetType: eip155:10/erc20:0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85
              amount: '8000000'
              spender: '0xb8e4b017f4a8870E3eB4eb15c5e180D2a34D877B'
        tokensRequired:
          description: Array of tokens needed for these calls.
          type: array
          items:
            $ref: '#/components/schemas/token-requirement'
          example:
            - assetType: eip155:10/erc20:0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85
              amount: '8000000'
        overrides:
          description: Optional state overrides (e.g., fake balances for simulation).
          type: array
          items:
            $ref: '#/components/schemas/override'
          example:
            - address: '0xb8e4b017f4a8870E3eB4eb15c5e180D2a34D877B'
              balance: '0x1'
        validAfter:
          type: string
          description: Permit valid after value in block timestamp.
          example: '1686239400'
        validUntil:
          type: string
          description: Permit valid until value in block timestamp.
          example: '1686339400'
        slippageTolerance:
          $ref: '#/components/schemas/slippage-tolerance'
      required:
        - account
        - targetChain
        - calls
        - allowanceRequirements
        - tokensRequired
    target-call-quote:
      type: object
      description: >-
        Response from prepare-call-quote containing all necessary data to
        execute contract calls on the target chain
      properties:
        account:
          description: Account configuration for the operation
          allOf:
            - $ref: '#/components/schemas/account'
        chainOperation:
          description: Operation (including userOp and typed data) to be executed on-chain
          allOf:
            - $ref: '#/components/schemas/chain-operation'
        tamperProofSignature:
          type: string
          description: Tamper-proof signature for the entire call request
          example: >-
            0x0e1f9f56bb4072894a24ebc6fe6e41e15f8b9c8ce7bc1d9d88e9a46b85353d55238f0e7a75fbeb71249292e2206887adc894849488d8d8c23a5a17542d5ab2511b
        callType:
          allOf:
            - $ref: '#/components/schemas/call-type'
          description: Type of operation indicating the routing strategy
        sourceAssetBalances:
          type: array
          description: >-
            Available balances for source assets that could be used for this
            operation
          items:
            $ref: '#/components/schemas/source-asset-balance'
          example:
            - assetType: eip155:10/erc20:0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85
              balance: '8000000'
              decimals: 6
              fiatValue: 8
      required:
        - account
        - chainOperation
        - tamperProofSignature
    http-exception:
      type: object
      properties:
        error:
          type: string
          description: Error name
          example: Validation failed
        message:
          type: string
          description: Error message
          example: >-
            Validation error: Must be a valid hex string starting with 0x at
            "address"
        statusCode:
          type: number
          description: Error status code
          example: 400
      required:
        - error
        - message
        - statusCode
    account:
      type: object
      description: >
        Account information that supports both role-based and basic account
        types. OneBalance supports a modular architecture designed to
        accommodate various account types with different validators, versions,
        and deployment methods.


        Learn more about account types and their capabilities at [OneBalance
        Account Models](https://docs.onebalance.io/concepts/accounts).
      oneOf:
        - $ref: '#/components/schemas/role-based-account'
        - $ref: '#/components/schemas/kernel-v3-1-account'
        - $ref: '#/components/schemas/kernel-v3-3-account'
    evm-call-data:
      type: object
      properties:
        data:
          type: string
          description: Hex-encoded call data.
          example: >-
            0x095ea7b3000000000000000000000000Bbef1E2dEA96c1c2001Eb48136e513A855F460970000000000000000000000000000000000000000000000000000000000000001
        to:
          type: string
          description: Address of the contract to be called.
          example: '0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85'
        value:
          type: string
          description: >-
            Amount of native currency (e.g. ETH) sent along with the call. Hex
            or decimal string.
          example: '0'
      required:
        - data
        - to
        - value
    token-allowance-requirement:
      type: object
      properties:
        assetType:
          type: string
          description: CAIP-19 identifier for the required token
          example: eip155:1/erc20:0x6b175474e89094c44da98b954eedeac495271d0f
        amount:
          type: string
          description: >-
            Required amount of the token in its smallest unit (considering token
            decimals). For example, if a token has 6 decimals, "1" token is
            represented as "1000000"
          example: '1000000000000000000'
        spender:
          type: string
          description: >-
            The address that is approved to transfer a specific amount on behalf
            of the user.
          example: '0x1234567890123456789012345678901234567890'
      required:
        - assetType
        - amount
    token-requirement:
      type: object
      properties:
        assetType:
          type: string
          description: CAIP-19 identifier for the required token
          example: eip155:1/erc20:0x6b175474e89094c44da98b954eedeac495271d0f
        amount:
          type: string
          description: >-
            Required amount of the token in its smallest unit (considering token
            decimals). For example, if a token has 6 decimals, "1" token is
            represented as "1000000"
          example: '1000000000000000000'
      required:
        - assetType
        - amount
    override:
      type: object
      properties:
        address:
          type: string
          description: Address whose balance/storage is being overridden.
          example: '0xb8e4b017f4a8870E3eB4eb15c5e180D2a34D877B'
        balance:
          type: string
          description: >-
            Hex-encoded balance override, e.g. "0x1", "0x5F5E100" for 100000000
            in decimal.
          example: '0x1'
      required:
        - address
        - balance
    slippage-tolerance:
      type: integer
      description: |
        Slippage tolerance in basis points (1/100th of a percent).
        For example, 50 = 0.5%, 100 = 1%, 1000 = 10%.
      minimum: 1
      example: 50
    chain-operation:
      type: object
      description: >
        Chain operation containing user operation data, typed data to sign, and
        optional EIP-7702 delegation.


        When EIP-7702 delegation is required, the delegation field will be
        present and must be signed before submission.
      properties:
        userOp:
          description: User Operation data (serialized).
          allOf:
            - $ref: '#/components/schemas/serialized-user-operation'
        typedDataToSign:
          description: Typed data to sign (EIP-712).
          allOf:
            - $ref: '#/components/schemas/hash-typed-data-parameters'
        assetType:
          type: string
          description: CAIP-19/CAIP-20 asset type, or e.g. "eth", "erc20:0x..." etc.
          example: eip155:10/erc20:0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85
        amount:
          type: string
          description: Amount in the smallest unit (wei for ETH, or token decimals).
          example: '8000000'
        delegation:
          allOf:
            - $ref: '#/components/schemas/delegation'
          description: >
            EIP-7702 delegation object (present only if account needs delegation
            on this chain).


            Must be signed using wallet's signAuthorization method before
            submission.
      required:
        - userOp
        - typedDataToSign
        - assetType
        - amount
    call-type:
      type: string
      description: >
        Type of call operation indicating the routing strategy:

        - `same_chain_exclude_solver`: Operation on the same chain without
        solver involvement

        - `cross_chain_with_solver`: Cross-chain operation requiring solver
        assistance

        - `same_chain_with_solver`: Same-chain operation with solver involvement

        - `cross_chain_with_solver_and_swaps`: Complex cross-chain operation
        with multiple swaps
      enum:
        - same_chain_exclude_solver
        - cross_chain_with_solver
        - same_chain_with_solver
        - cross_chain_with_solver_and_swaps
      example: cross_chain_with_solver
    source-asset-balance:
      type: object
      description: >-
        Available balance information for source assets during operation
        preparation
      properties:
        assetType:
          type: string
          description: CAIP-19/CAIP-20 asset type identifier
          example: eip155:42161/erc20:0xaf88d065e77c8cc2239327c5edb3a432268e5831
        balance:
          type: string
          description: >-
            Available balance in the smallest unit (wei for ETH, token decimals
            for ERC20)
          example: '20476622'
        decimals:
          type: integer
          description: Number of decimal places for the asset
          example: 6
          minimum: 0
          maximum: 18
        fiatValue:
          type: number
          description: Current fiat value of the balance in USD
          example: 20.52074709722842
          minimum: 0
      required:
        - assetType
        - balance
        - decimals
        - fiatValue
    HttpUnauthorizedException:
      type: object
      properties:
        error:
          type: string
          description: Error name
          example: UnauthorizedException
        message:
          type: string
          description: Error message
          example: Invalid or missing API key
        statusCode:
          type: number
          description: Error status code
          example: 401
        timestamp:
          type: string
          description: Error timestamp
          example: '2024-12-18T14:38:24.793Z'
        path:
          type: string
          description: Error path
          example: /api/account/predict-address
      required:
        - error
        - message
        - statusCode
        - timestamp
        - path
    role-based-account:
      type: object
      title: Role-based Account
      description: >
        Role-based account using RoleBasedValidator with Kernel 3.1. Always has
        Resource Lock enabled.

        Allows a `user_admin` role (think user cold wallet) next to the signer
        role to rotate keys and execute trustless rage quit in emergency cases.

        Secure in emergency cases related to WaaS/TEE but consumes slightly more
        gas.
      properties:
        type:
          type: string
          description: Account type identifier for role-based accounts
          enum:
            - role-based
          example: role-based
        sessionAddress:
          type: string
          description: >-
            Address associated with user's ECDSA signing key used for
            session-based operations
          example: '0x1cBFbFd62a276BF6D79d504eA4CA75a7baDcf5b1'
          pattern: ^0x[a-fA-F0-9]{40}$
        adminAddress:
          type: string
          description: >-
            Address selected by the user as backup admin. Can perform rage quit
            and key rotation. Must be different from sessionAddress.
          example: '0xc162a3cE45ad151eeCd0a5532D6E489D034aB3B8'
          pattern: ^0x[a-fA-F0-9]{40}$
        accountAddress:
          type: string
          description: >-
            Address of user's smart contract wallet (counterfactual if not yet
            deployed)
          example: '0xa8305CAD3ECEA0E4B4a02CE45E240e8687B4C2E0'
          pattern: ^0x[a-fA-F0-9]{40}$
      required:
        - type
        - sessionAddress
        - adminAddress
        - accountAddress
    kernel-v3-1-account:
      type: object
      title: Basic Account
      description: >
        Basic account using ECDSAValidator with Kernel v3.1. Standard
        ERC4337-compliant smart account

        that provides core account abstraction functionality without advanced
        features.
      properties:
        type:
          type: string
          description: Account type identifier for Kernel v3.1 ECDSA accounts
          enum:
            - kernel-v3.1-ecdsa
          example: kernel-v3.1-ecdsa
        signerAddress:
          type: string
          description: >-
            Address of the signer for this account using standard ECDSA
            authentication
          example: '0x5d6fb4eb211a6a2e406a1111b54d26c534753c8e'
          pattern: ^0x[a-fA-F0-9]{40}$
        accountAddress:
          type: string
          description: >-
            Address of user's smart contract wallet (counterfactual if not yet
            deployed)
          example: '0xb7bc0d7baf6761c302ff6772dfd8f9e22ec706e7'
          pattern: ^0x[a-fA-F0-9]{40}$
        deploymentType:
          type: string
          description: Deployment type - only ERC4337 supported for Kernel v3.1
          enum:
            - ERC4337
          example: ERC4337
      required:
        - type
        - signerAddress
        - accountAddress
    kernel-v3-3-account:
      type: object
      title: EIP-7702 Account
      description: >
        Advanced account using ECDSAValidator with Kernel v3.3. Supports both
        traditional ERC4337 deployment

        and EIP-7702 delegation for transforming existing EOAs into smart
        accounts.
      properties:
        type:
          type: string
          description: Account type identifier for Kernel v3.3 ECDSA accounts
          enum:
            - kernel-v3.3-ecdsa
          example: kernel-v3.3-ecdsa
        signerAddress:
          type: string
          description: >-
            Address of the signer for this account using standard ECDSA
            authentication
          example: '0x5d6fb4eb211a6a2e406a1111b54d26c534753c8e'
          pattern: ^0x[a-fA-F0-9]{40}$
        accountAddress:
          type: string
          description: >
            Address of user's smart contract wallet (for EIP-4337) or EOA
            address (for EIP-7702).


            **For EIP-7702**: Same as signerAddress - uses the existing EOA
            address.
          example: '0xb7bc0d7baf6761c302ff6772dfd8f9e22ec706e7'
          pattern: ^0x[a-fA-F0-9]{40}$
        deploymentType:
          type: string
          description: >
            Deployment type of the account:

            - `ERC4337`: Traditional smart contract account deployment

            - `EIP7702`: Delegate existing EOA to smart account contract (Kernel
            v3.3 exclusive feature)
          enum:
            - ERC4337
            - EIP7702
          example: ERC4337
      required:
        - type
        - signerAddress
        - accountAddress
    serialized-user-operation:
      type: object
      properties:
        sender:
          type: string
          description: The address of the sender (EOA or Smart Contract).
          example: '0xb8e4b017f4a8870e3eb4eb15c5e180d2a34d877b'
        nonce:
          type: string
          description: >-
            Nonce for the UserOp, ensures uniqueness. Incremented for each
            operation.
          example: 1120126849530...
        factory:
          type: string
          description: >-
            The address of the factory that may be used to create an account
            contract (optional for deployed accounts).
          example: '0xd703aae79538628d27099b8c4f621be4ccd142d5'
        factoryData:
          type: string
          description: >-
            Hex-encoded data for the factory (optional, if needed to deploy or
            initialize an account).
          example: 0xc5265d5d000000000000000000000000...
        callData:
          type: string
          description: Hex-encoded data representing the actual call to be made.
          example: 0xe9ae5c530100000000000000000000000000...
        callGasLimit:
          type: string
          description: Gas limit for executing the callData portion.
          example: '737280'
        verificationGasLimit:
          type: string
          description: Gas limit for the verification step (signature checks, etc.).
          example: '3076170'
        preVerificationGas:
          type: string
          description: Gas used for overhead, e.g., hashing, EVM overhead, etc.
          example: '0'
        maxFeePerGas:
          type: string
          description: Maximum fee (in wei) per gas unit.
          example: '0'
        maxPriorityFeePerGas:
          type: string
          description: Priority fee (tip) per gas unit.
          example: '0'
        paymaster:
          type: string
          description: Address of the paymaster that will sponsor or pay for gas.
          example: '0xa784e6482bd5edbfe5991b18cbd545ebd46e1cc4'
        paymasterVerificationGasLimit:
          type: string
          description: Gas limit for the paymaster verification step.
          example: '19219'
        paymasterPostOpGasLimit:
          type: string
          description: Additional gas limit for the paymaster post-operation.
          example: '0'
        paymasterData:
          type: string
          description: Additional data used by the paymaster, if any.
          example: 0x
        signature:
          type: string
          description: Signature for the entire user operation.
          example: 0x8cbd9df26744e2a02cde9fb8832d2b5f...
      required:
        - sender
        - nonce
        - callData
        - callGasLimit
        - verificationGasLimit
        - preVerificationGas
        - maxFeePerGas
        - maxPriorityFeePerGas
        - paymaster
        - paymasterVerificationGasLimit
        - paymasterPostOpGasLimit
        - paymasterData
        - signature
    hash-typed-data-parameters:
      type: object
      properties:
        domain:
          type: object
          description: >-
            EIP-712 domain separator data (e.g. name, version, chainId,
            verifyingContract).
          example:
            name: RoleBasedECDSAValidator
            version: 1.4.3
            chainId: 10
            verifyingContract: '0xA24bD06230f3F54e5bf266AE7A41750eE3b789FA'
        types:
          type: object
          description: >-
            EIP-712 type definitions for the message. Must include at least the
            primary type.
          example:
            Approve:
              - name: callDataAndNonceHash
                type: bytes32
        primaryType:
          type: string
          description: Primary type string from the types object.
          example: Approve
        message:
          type: object
          description: Data to be signed (structured according to the types).
          example:
            callDataAndNonceHash: 0xaab2ddac63e4a7e25b7d339cacdff2f9...
      required:
        - domain
        - types
        - primaryType
        - message
    delegation:
      type: object
      description: >-
        EIP-7702 delegation configuration for smart account operations. When an
        EOA needs to be delegated to a smart account contract, this object
        contains the delegation details that must be signed by the user.
      properties:
        contractAddress:
          type: string
          description: Address of the Kernel v3.3 smart account contract to delegate to
          example: '0xd6CEDDe84be40893d153Be9d467CD6aD37875b28'
          pattern: ^0x[a-fA-F0-9]{40}$
        nonce:
          type: integer
          description: >-
            Delegation nonce for preventing replay attacks. Must match the
            current nonce for the account on the target chain.
          example: 0
          minimum: 0
        signature:
          allOf:
            - $ref: '#/components/schemas/delegation-signature'
          description: >-
            Delegation signature (populated after signing with wallet's
            signAuthorization method)
      required:
        - contractAddress
        - nonce
    delegation-signature:
      type: object
      description: >-
        EIP-7702 delegation signature structure containing the ECDSA signature
        components for the delegation authorization
      properties:
        chainId:
          type: integer
          description: Chain ID where delegation occurs
          example: 10
          minimum: 1
        contractAddress:
          type: string
          description: >-
            Contract address being delegated to (must match delegation
            contractAddress)
          example: '0xd6CEDDe84be40893d153Be9d467CD6aD37875b28'
          pattern: ^0x[a-fA-F0-9]{40}$
        nonce:
          type: integer
          description: Delegation nonce (must match delegation nonce)
          example: 0
          minimum: 0
        r:
          type: string
          description: ECDSA signature r value
          example: '0x129b258b9d85f91dab87e488dea08e2803e88a96bb6a967d16fe158a09d95d0d'
          pattern: ^0x[a-fA-F0-9]{64}$
        s:
          type: string
          description: ECDSA signature s value
          example: '0x52adbaca42ea5b316df5ac0a6ae5f544f5eb450d94c76164e27252101e22d3c3'
          pattern: ^0x[a-fA-F0-9]{64}$
        v:
          type: string
          description: ECDSA signature v value (recovery ID)
          example: '0x1b'
          pattern: ^0x[a-fA-F0-9]{2}$
        yParity:
          type: integer
          description: Y parity of the signature point (0 or 1)
          example: 0
          enum:
            - 0
            - 1
        type:
          type: string
          description: >-
            Signature type identifier indicating the signature has been
            completed
          enum:
            - Signed
          example: Signed
      required:
        - chainId
        - contractAddress
        - nonce
        - r
        - s
        - v
        - yParity
        - type
  responses:
    unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/HttpUnauthorizedException'
          example:
            error: UnauthorizedException
            message: Invalid or missing API key
            statusCode: 401
            timestamp: '2024-12-18T14:38:24.793Z'
            path: /api/xxx/xxx
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      name: x-api-key
      in: header
      description: >-
        The OneBalance API uses API keys to authenticate requests. All API
        requests require authentication using an API key passed in the
        `x-api-key` header:


        ```bash

        curl -X 'GET' \
          'https://be.onebalance.io/api/path-to/endpoint' \
          -H 'x-api-key: ${ONEBALANCE_API_KEY}' \
          ...
        ```


        A public API key is available for testing purposes with limited usage:
        `42bb629272001ee1163ca0dbbbc07bcbb0ef57a57baf16c4b1d4672db4562c11`.


        All API requests must be made over HTTPS. Calls made over plain HTTP
        will fail. API requests without authentication will also fail.


        Learn how to generate API access tokens at [OneBalance
        Docs](https://docs.onebalance.io).

````