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

# Start wallet settlement

> Creates a durable trade for an accepted quote and returns an unsigned
taker lock transaction for browser-wallet signing. The request carries
only the browser-generated hash commitment; the preimage stays in the
browser until redeem time and is not persisted by the server.




## OpenAPI

````yaml /openapi.yaml post /v1/quotes/{quote_id}/wallet-settlement
openapi: 3.1.0
info:
  title: Firmament Backend API
  version: 0.1.3
  summary: Public backend routes for Firmament swaps and runtime proof.
  description: >
    Firmament is a Solana RFQ maker backend for managed liquidity demos.

    This specification documents the public routes used by the swap app and
    runtime view.
servers:
  - url: https://api.firmament.shaikazeem.com
    description: Deployed Firmament API.
  - url: http://127.0.0.1:5050
    description: Local backend started with `cargo run`.
security: []
tags:
  - name: Health
    description: Runtime liveness.
  - name: Assets
    description: Supported Solana assets.
  - name: Pairs
    description: Configured directional pairs and constraints.
  - name: RFQ
    description: Firm quote requests.
  - name: Settlement
    description: Browser-wallet HTLC settlement.
  - name: Trades
    description: Trade status lookup.
  - name: Runtime
    description: Read-only runtime state, events, ledger, and trades.
paths:
  /v1/quotes/{quote_id}/wallet-settlement:
    post:
      tags:
        - Settlement
      summary: Start wallet settlement
      description: |
        Creates a durable trade for an accepted quote and returns an unsigned
        taker lock transaction for browser-wallet signing. The request carries
        only the browser-generated hash commitment; the preimage stays in the
        browser until redeem time and is not persisted by the server.
      operationId: postWalletSettlement
      parameters:
        - $ref: '#/components/parameters/QuoteId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WalletSettlementRequest'
            examples:
              start:
                value:
                  taker_wallet: '11111111111111111111111111111111'
                  secret_hash: >-
                    0000000000000000000000000000000000000000000000000000000000000000
      responses:
        '202':
          description: Wallet settlement started.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WalletSettlementResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/NotFound'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
components:
  parameters:
    QuoteId:
      name: quote_id
      in: path
      required: true
      description: Quote identifier.
      schema:
        type: string
        format: uuid
  schemas:
    WalletSettlementRequest:
      type: object
      required:
        - taker_wallet
        - secret_hash
      properties:
        taker_wallet:
          $ref: '#/components/schemas/WalletAddress'
        secret_hash:
          type: string
          pattern: ^[0-9a-fA-F]{64}$
          description: >-
            Hex-encoded SHA-256 preimage commitment generated by the browser.
            The preimage itself remains browser-local until redeem time.
    WalletSettlementResponse:
      type: object
      required:
        - quote_id
        - trade_id
        - taker_lock_transaction
        - expires_at
        - integration_status
        - next_action
      properties:
        quote_id:
          type: string
          format: uuid
        trade_id:
          type: string
          format: uuid
        taker_lock_transaction:
          $ref: '#/components/schemas/UnsignedWalletTransaction'
        expires_at:
          type: string
          format: date-time
        integration_status:
          $ref: '#/components/schemas/IntegrationStatus'
        next_action:
          $ref: '#/components/schemas/NextAction'
    WalletAddress:
      type: string
      description: Solana wallet address.
      example: '11111111111111111111111111111111'
    UnsignedWalletTransaction:
      type: object
      required:
        - transaction_base64
        - recent_blockhash
      properties:
        transaction_base64:
          type: string
          description: Base64-encoded Solana transaction bytes.
        recent_blockhash:
          type: string
    IntegrationStatus:
      type: string
      enum:
        - runtime_orchestrated
    NextAction:
      type: object
      required:
        - type
        - method
        - path
      properties:
        type:
          type: string
          example: start_wallet_settlement
        method:
          type: string
          example: POST
        path:
          type: string
          example: /v1/quotes/018f5a45-822c-7f42-9d18-9df9f88c5c7a/wallet-settlement
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
            - details
          properties:
            code:
              type: string
              example: invalid_json
            message:
              type: string
            details:
              type: array
              items:
                type: string
  responses:
    BadRequest:
      description: Request shape, path, or validation error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFound:
      description: Requested quote or trade was not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    ServiceUnavailable:
      description: Runtime service is not available for the requested action.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'

````