{
  "$defs": {
    "AnchorStatus": {
      "description": "Status of an on-chain anchor operation.",
      "oneOf": [
        {
          "description": "Transaction submitted but not yet confirmed.",
          "properties": {
            "status": {
              "const": "pending",
              "type": "string"
            }
          },
          "required": [
            "status"
          ],
          "type": "object"
        },
        {
          "description": "Transaction confirmed on-chain.",
          "properties": {
            "status": {
              "const": "confirmed",
              "type": "string"
            }
          },
          "required": [
            "status"
          ],
          "type": "object"
        },
        {
          "description": "Anchor operation failed.",
          "properties": {
            "reason": {
              "description": "Human-readable failure reason.",
              "type": "string"
            },
            "status": {
              "const": "failed",
              "type": "string"
            }
          },
          "required": [
            "status",
            "reason"
          ],
          "type": "object"
        }
      ]
    }
  },
  "$id": "urn:mars:schema:v1:anchor-response",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "description": "Response to an anchor submission.",
  "properties": {
    "status": {
      "$ref": "#/$defs/AnchorStatus",
      "description": "Current status of the anchor operation."
    },
    "txHash": {
      "description": "Transaction hash assigned by the Sigil chain.",
      "type": "string"
    }
  },
  "required": [
    "txHash",
    "status"
  ],
  "title": "AnchorResponse",
  "type": "object"
}
