{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://finance.entelekron.org/schemas/tvkusd-custody-control-profile.schema.json",
  "title": "TVKUSD Custody Control Profile",
  "type": "object",
  "additionalProperties": false,
  "required": ["$schema", "schemaVersion", "canonicalAssetId", "profileId", "status", "effectiveAt", "serviceMode", "custodyProvider", "legalAgreementIdentifiers", "supportedNetworks", "acceptedClientClasses", "productionEndpoint", "clientAccounts", "assetsUnderCustodyUsd", "operations", "requiredControls", "currentEvidence", "authority", "notice"],
  "properties": {
    "$schema": { "const": "https://finance.entelekron.org/schemas/tvkusd-custody-control-profile.schema.json" },
    "schemaVersion": { "type": "string", "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$" },
    "canonicalAssetId": { "const": "tvk-group:tvkusd" },
    "profileId": { "type": "string", "pattern": "^tvkusd-custody-[a-z0-9-]+-v[0-9]+$" },
    "status": { "enum": ["provider-not-appointed", "integration-review", "controlled-production", "suspended"] },
    "effectiveAt": { "type": "string", "format": "date-time" },
    "serviceMode": { "enum": ["architecture-only", "provider-led", "direct-controlled"] },
    "custodyProvider": { "type": ["string", "null"] },
    "legalAgreementIdentifiers": { "type": "array", "uniqueItems": true, "items": { "type": "string", "minLength": 1 } },
    "supportedNetworks": { "type": "array", "uniqueItems": true, "items": { "type": "string", "minLength": 1 } },
    "acceptedClientClasses": { "type": "array", "uniqueItems": true, "items": { "type": "string", "minLength": 1 } },
    "productionEndpoint": { "type": ["string", "null"], "format": "uri" },
    "clientAccounts": { "type": "integer", "minimum": 0 },
    "assetsUnderCustodyUsd": { "type": "string", "pattern": "^[0-9]+\\.[0-9]{2}$" },
    "operations": { "$ref": "#/$defs/booleanMap" },
    "requiredControls": { "type": "array", "minItems": 10, "uniqueItems": true, "items": { "type": "string", "minLength": 1 } },
    "currentEvidence": { "$ref": "#/$defs/booleanMap" },
    "authority": { "$ref": "#/$defs/booleanMap" },
    "notice": { "type": "string", "minLength": 1 }
  },
  "$defs": {
    "booleanMap": { "type": "object", "minProperties": 1, "additionalProperties": { "type": "boolean" } }
  }
}
