{
  "$defs": {
    "AnchorOperation": {
      "description": "Registry mutation represented by an anchor intent.",
      "enum": [
        "create",
        "update",
        "revoke",
        "transfer",
        "attest"
      ],
      "type": "string"
    },
    "AnchorOutboxState": {
      "description": "Durable outbox state, including the internal worker-lease transition.",
      "enum": [
        "pending",
        "claimed",
        "submitted",
        "confirmed",
        "failed",
        "abandoned"
      ],
      "type": "string"
    },
    "AnchorReceiptRecord": {
      "description": "One immutable observation returned by an anchor adapter.",
      "properties": {
        "blockHeight": {
          "description": "Optional finalized ledger height.",
          "format": "uint64",
          "minimum": 0,
          "type": [
            "integer",
            "null"
          ]
        },
        "observedAt": {
          "description": "Time the adapter observed this state.",
          "format": "date-time",
          "type": "string"
        },
        "proof": {
          "description": "Optional provider-neutral proof document."
        },
        "receiptKey": {
          "description": "Adapter-defined idempotency key for this observation.",
          "type": "string"
        },
        "state": {
          "$ref": "#/$defs/AnchorReceiptState",
          "description": "Submitted or confirmed state represented by this receipt."
        },
        "transactionId": {
          "description": "Provider-neutral external transaction or operation identifier.",
          "type": "string"
        }
      },
      "required": [
        "receiptKey",
        "transactionId",
        "state",
        "observedAt"
      ],
      "type": "object"
    },
    "AnchorReceiptState": {
      "description": "State represented by an immutable adapter receipt.",
      "enum": [
        "submitted",
        "confirmed"
      ],
      "type": "string"
    },
    "AnchorState": {
      "description": "Registry-managed lifecycle of an anchor intent or entry projection.",
      "oneOf": [
        {
          "const": "unanchored",
          "description": "No anchor has been requested for the current entry snapshot.",
          "type": "string"
        },
        {
          "const": "pending",
          "description": "Durable work exists and is ready for a worker.",
          "type": "string"
        },
        {
          "const": "submitted",
          "description": "A provider accepted the submission but has not confirmed it.",
          "type": "string"
        },
        {
          "const": "confirmed",
          "description": "The provider reported final confirmation.",
          "type": "string"
        },
        {
          "const": "failed",
          "description": "The latest attempt failed and is eligible for a bounded retry.",
          "type": "string"
        },
        {
          "const": "abandoned",
          "description": "Retry policy or an administrator ended processing permanently.",
          "type": "string"
        }
      ]
    },
    "AnchorStatusRecord": {
      "description": "Persisted status of one durable anchor intent.",
      "properties": {
        "attempts": {
          "format": "uint32",
          "minimum": 0,
          "type": "integer"
        },
        "availableAt": {
          "format": "date-time",
          "type": "string"
        },
        "createdAt": {
          "format": "date-time",
          "type": "string"
        },
        "entryDid": {
          "type": "string"
        },
        "intentId": {
          "type": "string"
        },
        "operation": {
          "$ref": "#/$defs/AnchorOperation"
        },
        "receipts": {
          "items": {
            "$ref": "#/$defs/AnchorReceiptRecord"
          },
          "type": "array"
        },
        "sequence": {
          "format": "uint64",
          "minimum": 0,
          "type": "integer"
        },
        "state": {
          "$ref": "#/$defs/AnchorOutboxState"
        },
        "transactionId": {
          "type": [
            "string",
            "null"
          ]
        },
        "updatedAt": {
          "format": "date-time",
          "type": "string"
        }
      },
      "required": [
        "intentId",
        "entryDid",
        "sequence",
        "operation",
        "state",
        "attempts",
        "availableAt",
        "createdAt",
        "updatedAt"
      ],
      "type": "object"
    }
  },
  "$id": "urn:mars:schema:v1:anchor-list-response",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "description": "Response body for `GET /v1/anchors/{did}`.",
  "properties": {
    "anchorState": {
      "$ref": "#/$defs/AnchorState"
    },
    "cursor": {
      "description": "Opaque last-seen tuple to pass to the next request, or `null` on the\nfinal page.",
      "type": [
        "string",
        "null"
      ]
    },
    "entryDid": {
      "type": "string"
    },
    "hasMore": {
      "description": "Whether another page exists after this response.",
      "type": "boolean"
    },
    "records": {
      "description": "Anchor records in stable ascending `(sequence, createdAt, intentId)`\norder.",
      "items": {
        "$ref": "#/$defs/AnchorStatusRecord"
      },
      "type": "array"
    }
  },
  "required": [
    "entryDid",
    "anchorState",
    "records",
    "hasMore"
  ],
  "title": "AnchorListResponse",
  "type": "object"
}
