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

# Resume wallet settlement

> Returns the latest persisted settlement phase for an active wallet
settlement after a browser refresh or backend restart. When the next
step needs a browser signature, the response includes a fresh unsigned
wallet transaction and a `next_action`.




## OpenAPI

````yaml /openapi.yaml post /v1/trades/{trade_id}/resume
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/trades/{trade_id}/resume:
    post:
      tags:
        - Settlement
      summary: Resume wallet settlement
      description: |
        Returns the latest persisted settlement phase for an active wallet
        settlement after a browser refresh or backend restart. When the next
        step needs a browser signature, the response includes a fresh unsigned
        wallet transaction and a `next_action`.
      operationId: postTradeResume
      parameters:
        - $ref: '#/components/parameters/TradeId'
      responses:
        '200':
          description: Active settlement recovery state.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WalletSettlementResumeResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/NotFound'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
components:
  parameters:
    TradeId:
      name: trade_id
      in: path
      required: true
      description: Trade identifier.
      schema:
        type: string
        format: uuid
  schemas:
    WalletSettlementResumeResponse:
      type: object
      required:
        - trade_id
        - quote_id
        - run_id
        - settlement_phase
        - settlement_status
        - taker_lock_transaction
        - taker_redeem_transaction
        - taker_refund_transaction
        - tx_signatures
        - tx_signature_kinds
        - expires_at
        - integration_status
      properties:
        trade_id:
          type: string
          format: uuid
        quote_id:
          type: string
          format: uuid
        run_id:
          type: string
          format: uuid
          description: Runtime invocation that created the settlement.
        settlement_phase:
          type: string
          enum:
            - pending
            - started
            - taker_locked
            - maker_locked
            - taker_redeemed
            - complete
            - refunded
            - failed
        settlement_status:
          $ref: '#/components/schemas/SettlementStatus'
        taker_lock_transaction:
          anyOf:
            - $ref: '#/components/schemas/UnsignedWalletTransaction'
            - type: 'null'
        taker_redeem_transaction:
          anyOf:
            - $ref: '#/components/schemas/UnsignedWalletTransaction'
            - type: 'null'
        taker_refund_transaction:
          anyOf:
            - $ref: '#/components/schemas/UnsignedWalletTransaction'
            - type: 'null'
        tx_signatures:
          type: array
          items:
            $ref: '#/components/schemas/TxSignature'
        tx_signature_kinds:
          type: array
          items:
            $ref: '#/components/schemas/TradeSignature'
        expires_at:
          type: string
          format: date-time
        integration_status:
          $ref: '#/components/schemas/IntegrationStatus'
        next_action:
          description: Next wallet action when another signature is needed.
          anyOf:
            - $ref: '#/components/schemas/NextAction'
            - type: 'null'
    SettlementStatus:
      type: string
      enum:
        - pending
        - initiated
        - redeemed
        - refunded
        - failed
    UnsignedWalletTransaction:
      type: object
      required:
        - transaction_base64
        - recent_blockhash
      properties:
        transaction_base64:
          type: string
          description: Base64-encoded Solana transaction bytes.
        recent_blockhash:
          type: string
    TxSignature:
      type: string
      description: Solana transaction signature.
    TradeSignature:
      type: object
      required:
        - kind
        - signature
      properties:
        kind:
          $ref: '#/components/schemas/TradeSignatureKind'
        signature:
          $ref: '#/components/schemas/TxSignature'
    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
    TradeSignatureKind:
      type: string
      enum:
        - taker_lock
        - taker_redeem
        - taker_refund
        - maker_lock
        - maker_redeem
        - maker_refund
        - gateway_burn
        - gateway_mint
        - jupiter_swap
  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'

````