{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://0base.vc/data/v1/schema.json",
  "title": "0base.vc Network Record v1",
  "type": "object",
  "required": [
    "schemaVersion",
    "slug",
    "name",
    "symbol",
    "network",
    "serviceStatus",
    "verification",
    "description",
    "addresses",
    "observedAt",
    "sourceUrl",
    "canonicalUrl",
    "metrics"
  ],
  "properties": {
    "schemaVersion": {
      "const": 1
    },
    "slug": {
      "type": "string",
      "pattern": "^[a-z0-9-]+$"
    },
    "name": {
      "type": "string"
    },
    "symbol": {
      "type": "string"
    },
    "ecosystem": {
      "type": "string"
    },
    "network": {
      "enum": [
        "mainnet",
        "testnet"
      ]
    },
    "serviceStatus": {
      "enum": [
        "active",
        "ending",
        "ended"
      ],
      "description": "Operator support classification, not live health."
    },
    "verification": {
      "enum": [
        "onchain",
        "source-listed"
      ]
    },
    "verificationMeaning": {
      "type": "string"
    },
    "featured": {
      "type": "boolean"
    },
    "order": {
      "type": "number"
    },
    "color": {
      "type": "string",
      "pattern": "^#[0-9a-fA-F]{6}$"
    },
    "description": {
      "type": "object",
      "required": [
        "en",
        "ko"
      ],
      "properties": {
        "en": {
          "type": "string"
        },
        "ko": {
          "type": "string"
        }
      }
    },
    "website": {
      "type": "string",
      "format": "uri",
      "pattern": "^https://"
    },
    "explorer": {
      "anyOf": [
        {
          "type": "string",
          "format": "uri",
          "pattern": "^https://"
        },
        {
          "type": "null"
        }
      ]
    },
    "stakeUrl": {
      "anyOf": [
        {
          "type": "string",
          "format": "uri",
          "pattern": "^https://"
        },
        {
          "type": "null"
        }
      ]
    },
    "addresses": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "role",
          "value"
        ],
        "properties": {
          "role": {
            "enum": [
              "vote",
              "identity",
              "validator"
            ]
          },
          "value": {
            "type": "string",
            "minLength": 10
          }
        }
      }
    },
    "sourceUrl": {
      "type": "string",
      "format": "uri",
      "pattern": "^https://"
    },
    "observedAt": {
      "type": "string",
      "format": "date-time"
    },
    "legacyPath": {
      "type": "string"
    },
    "published": {
      "type": "boolean"
    },
    "canonicalUrl": {
      "type": "string",
      "format": "uri",
      "pattern": "^https://"
    },
    "localizedUrls": {
      "type": "object",
      "required": [
        "en",
        "ko"
      ],
      "properties": {
        "en": {
          "type": "string",
          "format": "uri",
          "pattern": "^https://"
        },
        "ko": {
          "type": "string",
          "format": "uri",
          "pattern": "^https://"
        }
      }
    },
    "metrics": {
      "anyOf": [
        {
          "type": "null"
        },
        {
          "$ref": "#/$defs/metrics"
        }
      ]
    }
  },
  "$defs": {
    "metrics": {
      "type": "object",
      "required": [
        "schemaVersion",
        "observedAt",
        "source",
        "voteAccount",
        "identity",
        "commissionPercent",
        "activatedStakeSol",
        "epoch",
        "status",
        "freshForSeconds",
        "stale"
      ],
      "properties": {
        "schemaVersion": {
          "const": 1
        },
        "observedAt": {
          "type": "string",
          "format": "date-time"
        },
        "source": {
          "type": "string",
          "format": "uri",
          "pattern": "^https://"
        },
        "method": {
          "const": "getVoteAccounts"
        },
        "voteAccount": {
          "type": "string"
        },
        "identity": {
          "type": "string"
        },
        "commissionPercent": {
          "type": "number",
          "minimum": 0,
          "maximum": 100
        },
        "activatedStakeSol": {
          "type": "number",
          "minimum": 0
        },
        "epoch": {
          "type": "integer",
          "minimum": 0
        },
        "status": {
          "enum": [
            "current",
            "delinquent"
          ]
        },
        "freshForSeconds": {
          "type": "integer",
          "minimum": 1
        },
        "stale": {
          "type": "boolean"
        }
      }
    }
  }
}
