{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://oxyon.io/xl1/api/v1/producers.schema.json",
  "title": "oxyon.xl1.api.producers.v1",
  "description": "Stable v1 contract for GET /api/xl1/v1/{net}/producers. Fields listed are promised; others may appear (additive changes only).",
  "type": "object",
  "required": [
    "meta",
    "window",
    "from",
    "to",
    "total",
    "rows"
  ],
  "properties": {
    "window": {
      "type": "string"
    },
    "from": {
      "type": "integer",
      "minimum": 0
    },
    "to": {
      "type": "integer",
      "minimum": 0
    },
    "total": {
      "type": "integer",
      "minimum": 0
    },
    "rows": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "rank",
          "producer",
          "blocks",
          "share"
        ],
        "properties": {
          "rank": {
            "type": "integer",
            "minimum": 0
          },
          "producer": {
            "type": "string",
            "pattern": "^[0-9a-f]{40}$"
          },
          "blocks": {
            "type": "integer",
            "minimum": 0
          },
          "share": {
            "type": "number"
          }
        },
        "additionalProperties": true
      }
    },
    "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.producers.v1"
        }
      },
      "additionalProperties": true
    }
  },
  "additionalProperties": true
}
