{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/hashlock-markets/json-schema/hashlock-markets-thread-schema.json",
  "title": "Thread",
  "description": "one maker's negotiation on an RFQ",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/hashlock-markets-openapi.json#/components/schemas/Thread",
  "type": "object",
  "required": [
    "id",
    "rfqId",
    "takerId",
    "makerId",
    "status",
    "takerAccepted",
    "makerAccepted",
    "createdAt",
    "updatedAt"
  ],
  "properties": {
    "id": {
      "type": "string"
    },
    "rfqId": {
      "type": "string"
    },
    "takerId": {
      "type": "string"
    },
    "makerId": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "open",
        "agreed",
        "closed"
      ]
    },
    "currentQuoteAmount": {
      "type": [
        "string",
        "null"
      ],
      "description": "the price on the table, base units"
    },
    "pendingAmount": {
      "type": [
        "string",
        "null"
      ],
      "description": "a counter-proposal waiting for the other side, base units"
    },
    "pendingBy": {
      "type": [
        "string",
        "null"
      ],
      "description": "who proposed pendingAmount"
    },
    "takerAccepted": {
      "type": "boolean"
    },
    "makerAccepted": {
      "type": "boolean"
    },
    "hashlock": {
      "type": [
        "string",
        "null"
      ],
      "description": "sha256(secret), hex — the initiator's, once it has accepted"
    },
    "counterpartyName": {
      "type": [
        "string",
        "null"
      ],
      "description": "the other party's account name, when they show it; null otherwise"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    }
  }
}