{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://capp.local/schemas/capp.solana-edge.operation.v2.schema.json",
  "title": "capp.solana-edge.operation.v2",
  "type": "object",
  "required": [
    "protocol",
    "operationId",
    "projectId",
    "componentId",
    "provider",
    "mode",
    "network",
    "asset",
    "recipient",
    "amountLamports",
    "intentDigest",
    "state",
    "observedState",
    "finality",
    "approval",
    "timeline",
    "simulated"
  ],
  "properties": {
    "protocol": {
      "const": "capp.solana-edge.operation.v2"
    },
    "operationId": {
      "type": "string",
      "minLength": 1,
      "maxLength": 256
    },
    "projectId": {
      "type": "string"
    },
    "componentId": {
      "type": "string"
    },
    "provider": {
      "const": "arena-demo-v1"
    },
    "mode": {
      "const": "demo"
    },
    "network": {
      "const": "demo"
    },
    "asset": {
      "const": "SOL"
    },
    "recipient": {
      "type": "string",
      "minLength": 32,
      "maxLength": 64
    },
    "amountLamports": {
      "type": "integer",
      "minimum": 1
    },
    "intentDigest": {
      "type": "string",
      "pattern": "^[a-f0-9]{64}$"
    },
    "messageDigest": {
      "type": [
        "string",
        "null"
      ],
      "pattern": "^[a-f0-9]{64}$"
    },
    "attemptId": {
      "type": [
        "string",
        "null"
      ]
    },
    "txDigest": {
      "type": [
        "string",
        "null"
      ],
      "pattern": "^[a-f0-9]{64}$"
    },
    "signature": {
      "type": [
        "string",
        "null"
      ]
    },
    "state": {
      "enum": [
        "prepared",
        "preflighted",
        "authorised",
        "finalised",
        "rejected",
        "expired",
        "submitting",
        "submitted",
        "confirmed",
        "unknown",
        "failed"
      ]
    },
    "observedState": {
      "enum": [
        "prepared",
        "preflighted",
        "authorised",
        "finalised",
        "rejected",
        "expired",
        "submitting",
        "submitted",
        "confirmed",
        "unknown",
        "failed"
      ]
    },
    "finality": {
      "enum": [
        "none",
        "simulated-finalised",
        "simulated-confirmed"
      ]
    },
    "approval": {
      "type": "object"
    },
    "preflight": {
      "type": [
        "object",
        "null"
      ]
    },
    "timeline": {
      "type": "array",
      "maxItems": 20,
      "items": {
        "type": "object"
      }
    },
    "receipt": {
      "$ref": "capp.solana-edge.receipt.v2.schema.json"
    },
    "receiptDigest": {
      "type": "string",
      "pattern": "^[a-f0-9]{64}$"
    },
    "createdAt": {
      "type": "number",
      "minimum": 0
    },
    "updatedAt": {
      "type": "number",
      "minimum": 0
    },
    "simulated": {
      "const": true
    },
    "componentObservation": {
      "type": "object"
    },
    "legKey": {
      "type": "string"
    },
    "outcomeDigest": {
      "type": "string",
      "pattern": "^[a-f0-9]{64}$"
    },
    "completedAt": {
      "type": "number"
    },
    "recoveryError": {
      "type": "object"
    }
  },
  "additionalProperties": false
}
