{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://capp.local/schemas/capp.solana-edge.operation.v3.schema.json",
  "title": "capp.solana-edge.operation.v3",
  "type": "object",
  "required": [
    "protocol",
    "operationId",
    "requestDigest",
    "sender",
    "recipient",
    "amountLamports",
    "mode",
    "network",
    "simulated",
    "state",
    "timeline",
    "approval"
  ],
  "properties": {
    "protocol": {
      "const": "capp.solana-edge.operation.v3"
    },
    "operationId": {
      "type": "string",
      "minLength": 1
    },
    "requestDigest": {
      "type": "string",
      "pattern": "^[a-f0-9]{64}$"
    },
    "sender": {
      "type": "string",
      "pattern": "^[1-9A-HJ-NP-Za-km-z]{32,44}$"
    },
    "recipient": {
      "type": "string",
      "pattern": "^[1-9A-HJ-NP-Za-km-z]{32,44}$"
    },
    "amountLamports": {
      "type": "integer",
      "minimum": 1,
      "maximum": 9007199254740991
    },
    "mode": {
      "const": "devnet"
    },
    "network": {
      "const": "devnet"
    },
    "simulated": {
      "const": false
    },
    "state": {
      "enum": [
        "preparing",
        "prepared",
        "preflighted",
        "authority-pending",
        "authorised",
        "submitting",
        "submitted",
        "unknown",
        "confirmed",
        "finalised",
        "failed",
        "blocked",
        "expired"
      ]
    },
    "timeline": {
      "type": "array"
    },
    "approval": {
      "type": "object"
    },
    "commitment": {
      "type": "object",
      "required": [
        "namespace",
        "sha256"
      ],
      "properties": {
        "namespace": {
          "type": "string",
          "pattern": "^[a-z][a-z0-9.-]{0,23}$"
        },
        "sha256": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$"
        }
      },
      "additionalProperties": false
    },
    "previousOperationId": {
      "type": "string",
      "minLength": 1,
      "description": "The retained expired, never-submitted operation this explicit refresh replaces."
    },
    "replacementOperationId": {
      "type": "string",
      "minLength": 1,
      "description": "One durable successor; repeat refresh calls resume it."
    },
    "expiry": {
      "type": "object",
      "required": [
        "reason",
        "notSubmitted",
        "observedAt"
      ],
      "properties": {
        "reason": {
          "enum": [
            "blockhash",
            "payment-request"
          ]
        },
        "notSubmitted": {
          "const": true
        },
        "observedAt": {
          "type": "number"
        }
      },
      "additionalProperties": false
    }
  },
  "additionalProperties": true
}
