{
  "$id": "https://litecoinregister.org/api/v1/schema.json",
  "title": "Litecoin Register entity",
  "version": "1.0.0",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
      "description": "Stable identifier. Never reused or changed; used in every URL for this entity."
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "description": "Common name of the entity."
    },
    "legal_name": {
      "description": "Registered legal name, or null.",
      "type": [
        "string",
        "null"
      ]
    },
    "aliases": {
      "default": [],
      "description": "Other names the entity is known by.",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "category": {
      "type": "string",
      "enum": [
        "exchange",
        "investment_product",
        "corporate_treasury",
        "miner",
        "government",
        "ecosystem"
      ],
      "description": "What kind of holder this is."
    },
    "subcategory": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "centralized-exchange",
            "broker",
            "swap-service",
            "industry-aggregate",
            "single-asset-fund",
            "multi-asset-fund",
            "public-company",
            "private-company",
            "mining-company",
            "mining-pool",
            "seized-funds",
            "reserve-holding",
            "layer-2",
            "extension-block",
            "cross-chain-protocol",
            "wrapped-token",
            "collectible"
          ]
        },
        {
          "type": "null"
        }
      ],
      "description": "Finer classification within the category, or null."
    },
    "jurisdiction": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string",
          "pattern": "^[A-Z]{2}$",
          "description": "ISO 3166-1 alpha-2 code. EU means Europe with no specific country; ZZ means unknown. XA–XZ are used only by fixture data."
        },
        "name": {
          "type": "string",
          "minLength": 1,
          "description": "Human-readable jurisdiction name."
        }
      },
      "required": [
        "code",
        "name"
      ],
      "additionalProperties": false,
      "description": "Primary legal jurisdiction of the entity."
    },
    "website": {
      "anyOf": [
        {
          "type": "string",
          "format": "uri"
        },
        {
          "type": "null"
        }
      ],
      "description": "Official website, or null."
    },
    "tickers": {
      "default": [],
      "description": "Exchange tickers, for listed products or companies.",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "status": {
      "default": "active",
      "description": "Operating status.",
      "type": "string",
      "enum": [
        "active",
        "inactive",
        "defunct"
      ]
    },
    "summary": {
      "type": "string",
      "minLength": 1,
      "maxLength": 280,
      "description": "One-sentence description, at most 280 characters."
    },
    "description": {
      "type": "string",
      "minLength": 1,
      "description": "Longer plain-text description."
    },
    "holdings": {
      "minItems": 1,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "as_of": {
            "type": "string",
            "format": "date",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
            "description": "Date the balance applies to (YYYY-MM-DD). Not the date it was published."
          },
          "amount_ltc": {
            "type": "number",
            "minimum": 0,
            "description": "Litecoin held, in whole LTC (1 LTC = 100,000,000 litoshis). Decimal, never a string."
          },
          "method": {
            "type": "string",
            "enum": [
              "proof_of_reserves",
              "regulatory_filing",
              "court_record",
              "self_reported",
              "on_chain_attribution",
              "third_party_estimate"
            ],
            "description": "How the figure was obtained. See /methodology for definitions."
          },
          "source_ids": {
            "minItems": 1,
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
            },
            "description": "IDs of entries in this entity’s sources array that support the figure."
          },
          "note": {
            "description": "Caveats a reader needs to interpret the figure correctly.",
            "type": "string"
          }
        },
        "required": [
          "as_of",
          "amount_ltc",
          "method",
          "source_ids"
        ],
        "additionalProperties": false,
        "description": "A point-in-time balance for one entity."
      },
      "description": "Balance history. The entry with the latest as_of is the current holding."
    },
    "sources": {
      "minItems": 1,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
            "description": "Identifier for this source, unique within the entity. Referenced by holding.source_ids."
          },
          "title": {
            "type": "string",
            "minLength": 1,
            "description": "Title of the document or page."
          },
          "publisher": {
            "type": "string",
            "minLength": 1,
            "description": "Organization that published the source."
          },
          "url": {
            "type": "string",
            "format": "uri",
            "description": "Where the source can be read."
          },
          "kind": {
            "type": "string",
            "enum": [
              "filing",
              "attestation",
              "press_release",
              "court_document",
              "news",
              "on_chain",
              "website"
            ],
            "description": "What sort of document the source is."
          },
          "published": {
            "description": "Publication date of the source (YYYY-MM-DD), if known.",
            "type": "string",
            "format": "date",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
          },
          "accessed": {
            "type": "string",
            "format": "date",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
            "description": "Date the registry last confirmed the source said what we cite it for (YYYY-MM-DD)."
          }
        },
        "required": [
          "id",
          "title",
          "publisher",
          "url",
          "kind",
          "accessed"
        ],
        "additionalProperties": false,
        "description": "A document that supports one or more holding snapshots."
      },
      "description": "All documents cited by this record."
    },
    "tags": {
      "default": [],
      "description": "Free-form lowercase tags.",
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
      }
    },
    "last_reviewed": {
      "type": "string",
      "format": "date",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
      "description": "Date an editor last reviewed the whole record (YYYY-MM-DD)."
    },
    "is_fixture": {
      "default": false,
      "description": "True for placeholder data used during development. Fixture records describe fictional entities and must not be cited.",
      "type": "boolean"
    },
    "subcategory_label": {
      "description": "Human-readable form of subcategory, or null.",
      "type": [
        "string",
        "null"
      ]
    },
    "category_label": {
      "type": "string",
      "description": "Human-readable form of category."
    },
    "address_count": {
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991,
      "description": "Number of addresses attributed to the entity. The list itself is at urls.addresses_csv."
    },
    "current_holding": {
      "type": "object",
      "properties": {
        "as_of": {
          "type": "string",
          "format": "date",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
          "description": "Date the balance applies to (YYYY-MM-DD). Not the date it was published."
        },
        "amount_ltc": {
          "type": "number",
          "minimum": 0,
          "description": "Litecoin held, in whole LTC (1 LTC = 100,000,000 litoshis). Decimal, never a string."
        },
        "method": {
          "type": "string",
          "enum": [
            "proof_of_reserves",
            "regulatory_filing",
            "court_record",
            "self_reported",
            "on_chain_attribution",
            "third_party_estimate"
          ],
          "description": "How the figure was obtained. See /methodology for definitions."
        },
        "source_ids": {
          "minItems": 1,
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
          },
          "description": "IDs of entries in this entity’s sources array that support the figure."
        },
        "note": {
          "description": "Caveats a reader needs to interpret the figure correctly.",
          "type": "string"
        },
        "method_label": {
          "type": "string",
          "description": "Human-readable form of method."
        },
        "sources": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
                "description": "Identifier for this source, unique within the entity. Referenced by holding.source_ids."
              },
              "title": {
                "type": "string",
                "minLength": 1,
                "description": "Title of the document or page."
              },
              "publisher": {
                "type": "string",
                "minLength": 1,
                "description": "Organization that published the source."
              },
              "url": {
                "type": "string",
                "format": "uri",
                "description": "Where the source can be read."
              },
              "kind": {
                "type": "string",
                "enum": [
                  "filing",
                  "attestation",
                  "press_release",
                  "court_document",
                  "news",
                  "on_chain",
                  "website"
                ],
                "description": "What sort of document the source is."
              },
              "published": {
                "description": "Publication date of the source (YYYY-MM-DD), if known.",
                "type": "string",
                "format": "date",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
              },
              "accessed": {
                "type": "string",
                "format": "date",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
                "description": "Date the registry last confirmed the source said what we cite it for (YYYY-MM-DD)."
              }
            },
            "required": [
              "id",
              "title",
              "publisher",
              "url",
              "kind",
              "accessed"
            ],
            "additionalProperties": false,
            "description": "A document that supports one or more holding snapshots."
          },
          "description": "The sources cited by this holding, resolved from source_ids."
        }
      },
      "required": [
        "as_of",
        "amount_ltc",
        "method",
        "source_ids",
        "method_label",
        "sources"
      ],
      "additionalProperties": false,
      "description": "The holding with the latest as_of date. This is the figure to quote."
    },
    "urls": {
      "type": "object",
      "properties": {
        "html": {
          "type": "string",
          "format": "uri",
          "description": "Canonical human-readable page."
        },
        "json": {
          "type": "string",
          "format": "uri",
          "description": "This record as JSON."
        },
        "markdown": {
          "type": "string",
          "format": "uri",
          "description": "This record as Markdown, for language models."
        },
        "csv": {
          "type": "string",
          "format": "uri",
          "description": "Full holding history for this record as CSV, one row per observation."
        },
        "addresses_csv": {
          "anyOf": [
            {
              "type": "string",
              "format": "uri"
            },
            {
              "type": "null"
            }
          ],
          "description": "The addresses attributed to this entity as CSV (address, label, attribution), or null if it has none. For on_chain_attribution figures these are exactly the addresses whose balances are summed."
        }
      },
      "required": [
        "html",
        "json",
        "markdown",
        "csv",
        "addresses_csv"
      ],
      "additionalProperties": false,
      "description": "Absolute URLs for this record in each format."
    }
  },
  "required": [
    "id",
    "name",
    "legal_name",
    "aliases",
    "category",
    "subcategory",
    "jurisdiction",
    "website",
    "tickers",
    "status",
    "summary",
    "description",
    "holdings",
    "sources",
    "tags",
    "last_reviewed",
    "is_fixture",
    "subcategory_label",
    "category_label",
    "address_count",
    "current_holding",
    "urls"
  ],
  "additionalProperties": false,
  "description": "A publicly known entity that holds Litecoin, as published by the Litecoin Register API."
}
