{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/redeal-dev/json-schema/redeal-dev-deal-view-schema.json",
  "title": "DealView",
  "description": "The deal view. NEVER contains revealed inputs.",
  "x-generated": "2026-11-23",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/redeal-dev-openapi.json#/components/schemas/DealView",
  "type": "object",
  "properties": {
    "deal_id": {
      "type": "string"
    },
    "algorithm": {
      "type": "string"
    },
    "algorithm_params": {
      "type": "object"
    },
    "mode": {
      "type": "string",
      "enum": [
        "sealed",
        "open"
      ]
    },
    "retention": {
      "type": "string",
      "enum": [
        "standard",
        "purge"
      ]
    },
    "state": {
      "type": "string",
      "enum": [
        "OPEN",
        "COMMITTING",
        "REVEALING",
        "COMPUTED",
        "CERTIFIED",
        "VOID",
        "EXPIRED",
        "CANCELLED"
      ]
    },
    "initiator": {
      "type": "integer"
    },
    "parties": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "index": {
            "type": "integer"
          },
          "label": {
            "type": "string"
          },
          "committed": {
            "type": "boolean"
          },
          "commitment": {
            "type": [
              "string",
              "null"
            ]
          },
          "revealed": {
            "type": "boolean"
          }
        }
      }
    },
    "commit_deadline": {
      "type": "integer"
    },
    "reveal_deadline": {
      "type": "integer"
    },
    "created_at": {
      "type": "integer"
    },
    "commits_closed_at": {
      "type": [
        "integer",
        "null"
      ]
    },
    "reveals_closed_at": {
      "type": [
        "integer",
        "null"
      ]
    },
    "computed_at": {
      "type": [
        "integer",
        "null"
      ]
    },
    "result": {
      "type": [
        "object",
        "null"
      ]
    },
    "void_flakers": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "integer"
      }
    },
    "certificate_id": {
      "type": [
        "string",
        "null"
      ]
    }
  }
}