95 lines
2.0 KiB
JSON
95 lines
2.0 KiB
JSON
{
|
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
"$id": "https://edut.ai/schemas/entitlement.v1.schema.json",
|
|
"title": "EDUT Entitlement Schema v1",
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"schema_version",
|
|
"entitlement_id",
|
|
"offer_id",
|
|
"issuer_id",
|
|
"wallet_address",
|
|
"state",
|
|
"issued_at"
|
|
],
|
|
"properties": {
|
|
"schema_version": {
|
|
"type": "string",
|
|
"const": "entitlement.v1"
|
|
},
|
|
"entitlement_id": {
|
|
"type": "string",
|
|
"pattern": "^[a-z0-9][a-z0-9._:-]{2,191}$"
|
|
},
|
|
"offer_id": {
|
|
"type": "string",
|
|
"pattern": "^[a-z0-9][a-z0-9._-]{2,127}$"
|
|
},
|
|
"issuer_id": {
|
|
"type": "string",
|
|
"pattern": "^[a-z0-9][a-z0-9._-]{2,127}$"
|
|
},
|
|
"wallet_address": {
|
|
"type": "string",
|
|
"pattern": "^0x[a-fA-F0-9]{40}$"
|
|
},
|
|
"workspace_id": {
|
|
"type": [
|
|
"string",
|
|
"null"
|
|
],
|
|
"pattern": "^[a-z0-9][a-z0-9._-]{2,127}$"
|
|
},
|
|
"state": {
|
|
"type": "string",
|
|
"enum": [
|
|
"active",
|
|
"suspended",
|
|
"revoked",
|
|
"expired"
|
|
]
|
|
},
|
|
"purchase": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"tx_hash",
|
|
"chain_id",
|
|
"currency",
|
|
"amount_atomic",
|
|
"policy_hash"
|
|
],
|
|
"properties": {
|
|
"tx_hash": {
|
|
"type": "string",
|
|
"pattern": "^0x[a-fA-F0-9]{64}$"
|
|
},
|
|
"chain_id": {
|
|
"type": "integer",
|
|
"minimum": 1
|
|
},
|
|
"currency": {
|
|
"type": "string"
|
|
},
|
|
"amount_atomic": {
|
|
"type": "string",
|
|
"pattern": "^[0-9]{1,78}$"
|
|
},
|
|
"policy_hash": {
|
|
"type": "string",
|
|
"pattern": "^[a-fA-F0-9]{64}$"
|
|
}
|
|
}
|
|
},
|
|
"issued_at": {
|
|
"type": "string",
|
|
"format": "date-time"
|
|
},
|
|
"updated_at": {
|
|
"type": "string",
|
|
"format": "date-time"
|
|
}
|
|
}
|
|
}
|