{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://capp.local/schemas/capp.solana-policy-result.v1.schema.json",
  "title": "capp.solana-policy-result.v1",
  "type": "object",
  "required": [
    "protocol",
    "allowed",
    "decision",
    "authorises",
    "intentDigest",
    "policyDigest",
    "checks",
    "violations"
  ],
  "properties": {
    "protocol": {
      "const": "capp.solana-policy-result.v1"
    },
    "allowed": {
      "type": "boolean"
    },
    "decision": {
      "enum": [
        "approve",
        "reject",
        "review"
      ]
    },
    "authorises": {
      "const": false
    },
    "network": {
      "type": "string"
    },
    "intentDigest": {
      "type": "string"
    },
    "messageDigest": {
      "type": [
        "string",
        "null"
      ]
    },
    "policyDigest": {
      "type": "string",
      "pattern": "^[a-f0-9]{64}$"
    },
    "positionEffect": {
      "type": [
        "string",
        "null"
      ]
    },
    "riskReducing": {
      "type": "boolean"
    },
    "exposureIncreasing": {
      "type": "boolean"
    },
    "violations": {
      "type": "array",
      "maxItems": 128,
      "items": {
        "type": "string"
      }
    },
    "checks": {
      "type": "array",
      "maxItems": 256,
      "items": {
        "type": "object",
        "required": [
          "id",
          "pass",
          "bypass"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "pass": {
            "type": "boolean"
          },
          "bypass": {
            "type": "boolean"
          },
          "detail": {
            "type": "string"
          }
        },
        "additionalProperties": false
      }
    },
    "simulation": {},
    "policy": {
      "type": "object"
    },
    "claimedIntentDigest": {
      "type": [
        "string",
        "null"
      ]
    },
    "metadataVerified": {
      "type": "boolean"
    },
    "transactionInstructionsVerified": {
      "type": "boolean"
    },
    "simulationBindsExactBytes": {
      "type": "boolean"
    },
    "createdAt": {
      "type": "number"
    },
    "simulatedTransactionDigest": {
      "type": [
        "string",
        "null"
      ],
      "pattern": "^[a-f0-9]{64}$"
    },
    "transferFacts": {
      "type": [
        "object",
        "null"
      ]
    },
    "accountObservation": {
      "type": [
        "object",
        "null"
      ]
    }
  },
  "additionalProperties": false
}
