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

# Execute wallet operation

> Proxies DeFi wallet operations to the web3-wallet-worker via
service binding. Supports EVM chain operations including swaps,
balance checks, and token approvals.




## OpenAPI

````yaml /docs/openapi-minimal.yaml post /wallet/{path}
openapi: 3.0.3
info:
  title: Hoox API
  description: |
    REST API for the Hoox algorithmic trading platform.

    Ingest trade signals, check system health, and manage DeFi wallet
    operations on the Cloudflare edge. All requests are handled by the
    Hoox gateway worker (`workers/hoox`) running at the network edge.
  version: 1.0.0
  contact:
    name: Hoox Support
    email: support@hoox.sh
servers:
  - url: https://api.hoox.sh
    description: Production API
  - url: https://staging.hoox.sh
    description: Staging environment
security: []
paths:
  /wallet/{path}:
    parameters:
      - name: path
        in: path
        required: true
        schema:
          type: string
        description: Wallet operation path (e.g., swap, balance, approve)
    post:
      tags:
        - Wallet
      summary: Execute wallet operation
      description: |
        Proxies DeFi wallet operations to the web3-wallet-worker via
        service binding. Supports EVM chain operations including swaps,
        balance checks, and token approvals.
      operationId: executeWalletOperation
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - chain
                - to
                - value
                - data
              properties:
                chain:
                  type: string
                  description: EVM-compatible chain
                  enum:
                    - ethereum
                    - arbitrum
                    - polygon
                  example: arbitrum
                to:
                  type: string
                  description: Recipient or contract address
                  example: '0x6b175474e89094c44da98b954eedeac495271d0f'
                value:
                  type: string
                  description: Transaction value in wei (as string)
                  example: '100000000000000000'
                data:
                  type: string
                  description: Encoded contract call data
                  example: 0xa9059cbb000000000000000000000000...
                gasLimit:
                  type: integer
                  description: Optional transaction gas limit
                  example: 200000
      responses:
        '200':
          description: Wallet operation successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SuccessResponse'
        '400':
          description: |
            Invalid request — malformed JSON, missing required fields,
            or invalid value (e.g. malformed address, non-positive wei
            value, gas limit out of range).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: |
            Internal authentication missing or invalid. Wallet routes
            require the `X-Internal-Auth-Key` header (or service
            binding from another worker).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: |
            Authorization failed — caller's IP not on the allowlist,
            wallet disabled in `WALLET_CONFIG_KV`, or the target chain
            is not enabled.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: |
            Rate limit exceeded on wallet operations. Default ceiling
            is enforced by the shared `createRateLimiter` middleware.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: |
            Internal processing error — RPC provider failure, signing
            failure, or unhandled exception in the web3-wallet-worker.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    SuccessResponse:
      type: object
      properties:
        success:
          type: boolean
          example: true
        requestId:
          type: string
          format: uuid
          description: Unique request trace identifier
          example: 9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d
        tradeResult:
          type: object
          nullable: true
          properties:
            success:
              type: boolean
            orderId:
              type: string
              example: '18049284739'
            status:
              type: string
              example: Filled
            executedQty:
              type: number
              example: 0.005
            price:
              type: number
              example: 68425.5
            queued:
              type: boolean
              description: True if the trade was queued rather than executed immediately
        notificationResult:
          type: object
          nullable: true
          properties:
            success:
              type: boolean
            messageId:
              type: integer
              nullable: true
              example: 482904
    ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          example: false
        requestId:
          type: string
          format: uuid
          description: Request trace identifier
          example: 9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d
        error:
          type: string
          description: Human-readable error description
          example: Invalid JSON payload structure.

````