{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://oxyon.io/xl1/api/v1/journey.schema.json",
  "title": "oxyon.xl1.api.journey.v1",
  "description": "Stable v1 contract for GET /api/xl1/v1/{net}/journey. Fields listed are promised; others may appear (additive changes only).",
  "type": "object",
  "required": [
    "meta",
    "schema",
    "chainTruth",
    "attestation",
    "network",
    "observers",
    "candidates"
  ],
  "properties": {
    "schema": {
      "const": "oxyon.xl1.block-journey.v1"
    },
    "chainTruth": {
      "type": "object",
      "required": [
        "class",
        "height",
        "hash",
        "producer",
        "final"
      ],
      "properties": {
        "class": {
          "type": "string"
        },
        "height": {
          "type": "integer",
          "minimum": 0
        },
        "hash": {
          "type": "string",
          "pattern": "^[0-9a-f]{64}$"
        },
        "producer": {
          "type": "string",
          "pattern": "^[0-9a-f]{40}$"
        },
        "final": {
          "type": "boolean"
        }
      },
      "additionalProperties": true
    },
    "attestation": {
      "type": "object",
      "required": [
        "signed"
      ],
      "properties": {
        "signed": {
          "type": "boolean"
        }
      },
      "additionalProperties": true
    },
    "network": {
      "type": "object",
      "required": [
        "id"
      ],
      "properties": {
        "id": {
          "type": "string"
        }
      },
      "additionalProperties": true
    },
    "observers": {
      "type": "array"
    },
    "candidates": {
      "type": "array"
    },
    "meta": {
      "type": "object",
      "required": [
        "net",
        "source",
        "generatedAt",
        "apiVersion",
        "schema"
      ],
      "properties": {
        "net": {
          "enum": [
            "sequence",
            "mainnet"
          ]
        },
        "source": {
          "enum": [
            "official",
            "observed",
            "derived",
            "telemetry",
            "rpc"
          ]
        },
        "generatedAt": {
          "type": "integer",
          "minimum": 0
        },
        "apiVersion": {
          "const": 1
        },
        "schema": {
          "const": "oxyon.xl1.api.journey.v1"
        }
      },
      "additionalProperties": true
    }
  },
  "additionalProperties": true
}
