{
  "openapi": "3.1.0",
  "info": {
    "title": "Allocyn API",
    "version": "1.8.0",
    "description": "Read-only REST API over the Allocyn contract on GenLayer. It reads the contract; it holds no database, no wallet and no key. Writes (create, accept, submit, evaluate) are signed by the caller's own wallet with @allocyn/sdk."
  },
  "servers": [
    {
      "url": "https://allocynapivercel.vercel.app"
    }
  ],
  "tags": [
    {
      "name": "System"
    },
    {
      "name": "Jobs"
    },
    {
      "name": "Receipts"
    },
    {
      "name": "Transactions"
    }
  ],
  "paths": {
    "/v1/health": {
      "get": {
        "operationId": "getHealth",
        "tags": [
          "System"
        ],
        "summary": "Liveness",
        "description": "Says the API process is up. Add `?deep=true` to also read the contract once (job-1) and report whether the network answers. A deep check that fails returns 503. With a database copy configured, a deep check also reports how old the copy is and how the last indexer run went (`copy`); a copy that is stale or unreachable never turns the check into a 503, because the contract is the source of truth.",
        "parameters": [
          {
            "name": "deep",
            "in": "query",
            "required": false,
            "description": "`true` also reads the contract once.",
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              },
              "X-RateLimit-Limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Remaining": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "$ref": "#/components/schemas/Health"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. See Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error (no details are exposed).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "The network did not answer, or the optional database copy is not configured.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/meta": {
      "get": {
        "operationId": "getMeta",
        "tags": [
          "System"
        ],
        "summary": "Network, contract and API facts",
        "description": "Which network and contract this API reads, the contract profile it was built for, and the read consistency in use. No network call.",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              },
              "X-RateLimit-Limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Remaining": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "$ref": "#/components/schemas/Meta"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. See Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error (no details are exposed).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/limits": {
      "get": {
        "operationId": "getLimits",
        "tags": [
          "System"
        ],
        "summary": "Input limits",
        "description": "The limits the contract reports right now (`get_limits()`), next to the copy this API was built for. `matchesPinned: false` means the contract changed and this API needs an update. `client` holds the stricter limits applied by this deployment's SDK. Answers are cached for 60 s.",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              },
              "X-RateLimit-Limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Remaining": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "$ref": "#/components/schemas/Limits"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. See Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error (no details are exposed).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "The network or contract answered badly or not at all.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/jobs": {
      "get": {
        "operationId": "listJobs",
        "tags": [
          "Jobs"
        ],
        "summary": "List jobs",
        "description": "Jobs from newest to oldest, with an optional filter by `status`, `client` or `worker`. The contract has no list view, so this reads job ids one by one, at most 100 per request, and filters what it reads: a page can hold fewer than `limit` jobs while `nextCursor` is not null. Pass `nextCursor` as `before` to continue exactly where the scan stopped. With `source=copy` (or `auto`) the list is read from the optional database copy instead: one indexed query, pages are full, but the data is final-only and as old as `syncedAt`. The default stays `contract`, which is live.",
        "parameters": [
          {
            "name": "consistency",
            "in": "query",
            "required": false,
            "description": "\"latest\" (default) includes non-final state; \"final\" reads finalized state only (genlayer-js `latest-final`).",
            "schema": {
              "type": "string",
              "enum": [
                "latest",
                "final"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many jobs to return, 1 to 50 (default 20).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50
            },
            "example": "20"
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "description": "Cursor: only jobs older than this id. Use the `nextCursor` of the previous page.",
            "schema": {
              "type": "string",
              "pattern": "^job-[1-9][0-9]{0,8}$"
            },
            "example": "job-10"
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Only jobs in this status.",
            "schema": {
              "type": "string",
              "enum": [
                "OPEN",
                "IN_PROGRESS",
                "VERIFIED",
                "NEEDS_REVISION",
                "INCONCLUSIVE"
              ]
            },
            "example": "VERIFIED"
          },
          {
            "name": "client",
            "in": "query",
            "required": false,
            "description": "Only jobs created by this address.",
            "schema": {
              "type": "string",
              "pattern": "^0x[0-9a-fA-F]{40}$"
            },
            "example": "0xa1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1"
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Search the title and description (words, in any language; every word must appear). Needs the database copy, so `source` defaults to `copy` when this is set.",
            "schema": {
              "type": "string"
            },
            "example": "logo"
          },
          {
            "name": "updatedSince",
            "in": "query",
            "required": false,
            "description": "Only jobs whose content changed at or after this time (date and time with a zone). A job that was only re-read does not count. Needs the database copy, so `source` defaults to `copy` when this is set.",
            "schema": {
              "type": "string"
            },
            "example": "2026-11-20T00:00:00Z"
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "description": "Where the list is read from: `contract` (default, live, slower), `copy` (the database copy: one indexed query, final data as of `syncedAt`) or `auto` (the copy when it is configured and reachable, else the contract).",
            "schema": {
              "type": "string",
              "enum": [
                "contract",
                "copy",
                "auto"
              ]
            },
            "example": "copy"
          },
          {
            "name": "worker",
            "in": "query",
            "required": false,
            "description": "Only jobs accepted by this address.",
            "schema": {
              "type": "string",
              "pattern": "^0x[0-9a-fA-F]{40}$"
            },
            "example": "0xb2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2"
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              },
              "X-RateLimit-Limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Remaining": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "$ref": "#/components/schemas/JobList"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. See Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error (no details are exposed).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "The network or contract answered badly or not at all.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "The network did not answer, or the optional database copy is not configured.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/stats": {
      "get": {
        "operationId": "getStats",
        "tags": [
          "Jobs"
        ],
        "summary": "Counts and statistics",
        "description": "How many jobs there are in each status, and how many deliveries got each verdict, optionally for one `client` or one `worker`. The contract has no count view, so these numbers come from an optional database copy that an indexer fills from final reads. The answer says when the copy was last refreshed (`syncedAt`). It answers `503 COPY_UNAVAILABLE` on a server that has no copy configured.",
        "parameters": [
          {
            "name": "client",
            "in": "query",
            "required": false,
            "description": "Count only the jobs created by this address. Deliveries are then not counted.",
            "schema": {
              "type": "string",
              "pattern": "^0x[0-9a-fA-F]{40}$"
            },
            "example": "0xa1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1"
          },
          {
            "name": "worker",
            "in": "query",
            "required": false,
            "description": "Count only the jobs accepted by this address, and the deliveries made by it.",
            "schema": {
              "type": "string",
              "pattern": "^0x[0-9a-fA-F]{40}$"
            },
            "example": "0xb2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2"
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              },
              "X-RateLimit-Limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Remaining": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "$ref": "#/components/schemas/Stats"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. See Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error (no details are exposed).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "The network or contract answered badly or not at all.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "The network did not answer, or the optional database copy is not configured.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/events": {
      "get": {
        "operationId": "listEvents",
        "tags": [
          "Jobs"
        ],
        "summary": "Feed of job events",
        "description": "What changed in the jobs, oldest first: a job was created or accepted, a delivery came in or got its verdict, a status moved. Cursor based: pass the `cursor` of one answer as `after` in the next, and add `wait` (up to 25 s) to hold the request until something new arrives. Events are stored, so a client that was away can catch up. Read from the optional database copy, so `detectedAt` is when the indexer saw the change, not when it happened on the network. Nothing is pushed and there are no webhooks. `503 COPY_UNAVAILABLE` on a server with no copy.",
        "parameters": [
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "Cursor: only events with a higher id. Use the `cursor` of the previous answer. Leave it out to get the newest events.",
            "schema": {
              "type": "integer",
              "minimum": 0
            },
            "example": "0"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many events to return, 1 to 100 (default 50).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "example": "50"
          },
          {
            "name": "job",
            "in": "query",
            "required": false,
            "description": "Only events of this job.",
            "schema": {
              "type": "string",
              "pattern": "^job-[1-9][0-9]{0,8}$"
            },
            "example": "job-1"
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "description": "Only this kind of event.",
            "schema": {
              "type": "string",
              "enum": [
                "job_created",
                "job_accepted",
                "delivery_submitted",
                "delivery_evaluated",
                "status_changed"
              ]
            },
            "example": "status_changed"
          },
          {
            "name": "worker",
            "in": "query",
            "required": false,
            "description": "Only events of jobs accepted by this address.",
            "schema": {
              "type": "string",
              "pattern": "^0x[0-9a-fA-F]{40}$"
            },
            "example": "0xb2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2"
          },
          {
            "name": "client",
            "in": "query",
            "required": false,
            "description": "Only events of jobs created by this address.",
            "schema": {
              "type": "string",
              "pattern": "^0x[0-9a-fA-F]{40}$"
            },
            "example": "0xa1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1"
          },
          {
            "name": "wait",
            "in": "query",
            "required": false,
            "description": "Seconds to wait for a new event when there is none yet, 0 to 25 (default 0). The server may wait less: it always answers before `REQUEST_TIMEOUT_MS`.",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 25
            },
            "example": "15"
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              },
              "X-RateLimit-Limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Remaining": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "$ref": "#/components/schemas/EventFeed"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. See Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error (no details are exposed).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "The network or contract answered badly or not at all.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "The network did not answer, or the optional database copy is not configured.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/addresses/{address}": {
      "get": {
        "operationId": "getAddressRecord",
        "tags": [
          "Jobs"
        ],
        "summary": "What the copy holds about an address",
        "description": "For one wallet address: how many jobs it created (as client) and accepted (as worker) in each status, how many deliveries it made and the verdicts they got, and its five newest jobs on each side. Counts only: no score, no ranking and no guarantee. Read from the optional database copy, so it is as old as `syncedAt`. `503 COPY_UNAVAILABLE` on a server with no copy. Answers are cached for 30 seconds.",
        "parameters": [
          {
            "name": "address",
            "in": "path",
            "required": true,
            "description": "A wallet address: 0x followed by 40 hex characters, in any letter case.",
            "schema": {
              "type": "string",
              "pattern": "^0x[0-9a-fA-F]{40}$"
            },
            "example": "0xb2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2"
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              },
              "X-RateLimit-Limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Remaining": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "$ref": "#/components/schemas/AddressRecord"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. See Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error (no details are exposed).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "The network or contract answered badly or not at all.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "The network did not answer, or the optional database copy is not configured.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/jobs/{jobId}": {
      "get": {
        "operationId": "getJob",
        "tags": [
          "Jobs"
        ],
        "summary": "Read a job",
        "description": "The job's terms, parties, status and receipt ids, read from the contract. `integrity` reports whether the hashes recompute from the returned terms.",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "description": "Job id, e.g. \"job-1\". Ids are assigned by the contract: never invent one.",
            "schema": {
              "type": "string",
              "pattern": "^job-[1-9][0-9]*$"
            },
            "example": "job-1"
          },
          {
            "name": "consistency",
            "in": "query",
            "required": false,
            "description": "\"latest\" (default) includes non-final state; \"final\" reads finalized state only (genlayer-js `latest-final`).",
            "schema": {
              "type": "string",
              "enum": [
                "latest",
                "final"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              },
              "X-RateLimit-Limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Remaining": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "$ref": "#/components/schemas/Job"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. See Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error (no details are exposed).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "The network or contract answered badly or not at all.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/jobs/{jobId}/proof": {
      "get": {
        "operationId": "getJobProof",
        "tags": [
          "Jobs"
        ],
        "summary": "Proof pack of a job",
        "description": "A portable proof pack, safe to save and send as a file (`format: \"allocyn.proof\"`, version 1). It holds: the contract it lives in, its terms, parties, status and every delivery with the per-criterion verdicts, plus a SHA-256 digest of those facts and the steps to check them against the contract yourself. The digest is not a signature. `final: true` means the job cannot change any more. Anyone can check a saved pack without trusting this API: `verifyProofPack()` in @allocyn/sdk or `allocyn verify proof.json --chain` re-read the contract and compare. The contract stores no transaction hashes, so the pack has none.",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "description": "Job id, e.g. \"job-1\". Ids are assigned by the contract: never invent one.",
            "schema": {
              "type": "string",
              "pattern": "^job-[1-9][0-9]*$"
            },
            "example": "job-1"
          },
          {
            "name": "consistency",
            "in": "query",
            "required": false,
            "description": "\"latest\" (default) includes non-final state; \"final\" reads finalized state only (genlayer-js `latest-final`).",
            "schema": {
              "type": "string",
              "enum": [
                "latest",
                "final"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              },
              "X-RateLimit-Limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Remaining": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "$ref": "#/components/schemas/Proof"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. See Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error (no details are exposed).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "The network or contract answered badly or not at all.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/jobs/{jobId}/badge.svg": {
      "get": {
        "operationId": "getJobBadge",
        "tags": [
          "Jobs"
        ],
        "summary": "Status badge (SVG)",
        "description": "A small SVG badge with the job's status, for a README or a portfolio: `![job](https://your-api/v1/jobs/job-1/badge.svg)`. It says what the contract says right now and nothing more. A missing or invalid job still answers with a badge, with the matching status code.",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "description": "Job id, e.g. \"job-1\". Ids are assigned by the contract: never invent one.",
            "schema": {
              "type": "string",
              "pattern": "^job-[1-9][0-9]*$"
            },
            "example": "job-1"
          },
          {
            "name": "consistency",
            "in": "query",
            "required": false,
            "description": "\"latest\" (default) includes non-final state; \"final\" reads finalized state only (genlayer-js `latest-final`).",
            "schema": {
              "type": "string",
              "enum": [
                "latest",
                "final"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              },
              "X-RateLimit-Limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Remaining": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "image/svg+xml": {
                "schema": {
                  "$ref": "#/components/schemas/Badge"
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter.",
            "content": {
              "image/svg+xml": {
                "schema": {
                  "$ref": "#/components/schemas/Badge"
                }
              }
            }
          },
          "404": {
            "description": "Not found.",
            "content": {
              "image/svg+xml": {
                "schema": {
                  "$ref": "#/components/schemas/Badge"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. See Retry-After.",
            "content": {
              "image/svg+xml": {
                "schema": {
                  "$ref": "#/components/schemas/Badge"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error (no details are exposed).",
            "content": {
              "image/svg+xml": {
                "schema": {
                  "$ref": "#/components/schemas/Badge"
                }
              }
            }
          },
          "502": {
            "description": "The network or contract answered badly or not at all.",
            "content": {
              "image/svg+xml": {
                "schema": {
                  "$ref": "#/components/schemas/Badge"
                }
              }
            }
          }
        }
      }
    },
    "/v1/jobs/{jobId}/wait": {
      "get": {
        "operationId": "waitForJob",
        "tags": [
          "Jobs"
        ],
        "summary": "Wait for a job to change",
        "description": "Long poll, instead of webhooks. Call it once without `since` to get the job and its `version`; call it again with that `version` as `since` and it answers when the job changes (a worker accepted, a delivery came in, validators judged) or when the wait ends with `changed: false`. Nothing is stored: if you miss an answer, ask again. The wait is capped by `timeout` (at most 25 s) and by the server's request timeout.",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "description": "Job id, e.g. \"job-1\". Ids are assigned by the contract: never invent one.",
            "schema": {
              "type": "string",
              "pattern": "^job-[1-9][0-9]*$"
            },
            "example": "job-1"
          },
          {
            "name": "consistency",
            "in": "query",
            "required": false,
            "description": "\"latest\" (default) includes non-final state; \"final\" reads finalized state only (genlayer-js `latest-final`).",
            "schema": {
              "type": "string",
              "enum": [
                "latest",
                "final"
              ]
            }
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "description": "The `version` returned by the previous call. Leave it out on the first call: the answer is immediate.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{16}$"
            },
            "example": "0123456789abcdef"
          },
          {
            "name": "timeout",
            "in": "query",
            "required": false,
            "description": "How many seconds to wait for a change, 1 to 25 (default 15). The server may use less: it always answers before `REQUEST_TIMEOUT_MS`.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 25
            },
            "example": "15"
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              },
              "X-RateLimit-Limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Remaining": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "$ref": "#/components/schemas/JobWait"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. See Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error (no details are exposed).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "The network or contract answered badly or not at all.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "504": {
            "description": "The network took too long to answer.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/jobs/{jobId}/prepare": {
      "get": {
        "operationId": "prepareAction",
        "tags": [
          "Jobs"
        ],
        "summary": "Prepare an action for the person to sign",
        "description": "Checks whether accepting, delivering or evaluating is possible on this job right now, and says exactly what the person would sign: the contract call, the SDK call and a link to the Allocyn app. It only READS the contract: it builds no transaction, holds no key and sends nothing (`sent` is always false). The person signs in their own wallet, and the contract checks everything again at that moment. For an agent: use it to start a flow, never to act on someone's behalf.",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "description": "Job id, e.g. \"job-1\". Ids are assigned by the contract: never invent one.",
            "schema": {
              "type": "string",
              "pattern": "^job-[1-9][0-9]*$"
            },
            "example": "job-1"
          },
          {
            "name": "consistency",
            "in": "query",
            "required": false,
            "description": "\"latest\" (default) includes non-final state; \"final\" reads finalized state only (genlayer-js `latest-final`).",
            "schema": {
              "type": "string",
              "enum": [
                "latest",
                "final"
              ]
            }
          },
          {
            "name": "action",
            "in": "query",
            "required": true,
            "description": "What the person wants to do: `accept` the job, `submit` a delivery, or `evaluate` the delivery that is waiting to be judged.",
            "schema": {
              "type": "string",
              "enum": [
                "accept",
                "submit",
                "evaluate"
              ]
            },
            "example": "accept"
          },
          {
            "name": "deliveryUrl",
            "in": "query",
            "required": false,
            "description": "For `submit` only: the public https page the worker will deliver.",
            "schema": {
              "type": "string",
              "pattern": "^https://[^\\s\"<>]{3,2000}$"
            },
            "example": "https://example.org/work"
          },
          {
            "name": "actor",
            "in": "query",
            "required": false,
            "description": "Optional. The address that would sign. When given, the answer also says whether that address is allowed to do it.",
            "schema": {
              "type": "string",
              "pattern": "^0x[0-9a-fA-F]{40}$"
            },
            "example": "0xb2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2"
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              },
              "X-RateLimit-Limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Remaining": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "$ref": "#/components/schemas/PreparedAction"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. See Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error (no details are exposed).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "The network or contract answered badly or not at all.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/jobs/{jobId}/receipts": {
      "get": {
        "operationId": "listJobReceipts",
        "tags": [
          "Receipts"
        ],
        "summary": "List a job's receipts",
        "description": "Every receipt of the job, in delivery order (delivery 1 first).",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "description": "Job id, e.g. \"job-1\". Ids are assigned by the contract: never invent one.",
            "schema": {
              "type": "string",
              "pattern": "^job-[1-9][0-9]*$"
            },
            "example": "job-1"
          },
          {
            "name": "consistency",
            "in": "query",
            "required": false,
            "description": "\"latest\" (default) includes non-final state; \"final\" reads finalized state only (genlayer-js `latest-final`).",
            "schema": {
              "type": "string",
              "enum": [
                "latest",
                "final"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              },
              "X-RateLimit-Limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Remaining": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "$ref": "#/components/schemas/ReceiptList"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. See Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error (no details are exposed).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "The network or contract answered badly or not at all.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/jobs/{jobId}/receipts/{deliveryIndex}": {
      "get": {
        "operationId": "getJobReceiptByIndex",
        "tags": [
          "Receipts"
        ],
        "summary": "Read one receipt by delivery number",
        "description": "The receipt of delivery N of a job. A receipt is EVALUATED once validators have judged it; before that `results` is empty.",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "description": "Job id, e.g. \"job-1\". Ids are assigned by the contract: never invent one.",
            "schema": {
              "type": "string",
              "pattern": "^job-[1-9][0-9]*$"
            },
            "example": "job-1"
          },
          {
            "name": "deliveryIndex",
            "in": "path",
            "required": true,
            "description": "1-based delivery number within the job.",
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "example": "1"
          },
          {
            "name": "consistency",
            "in": "query",
            "required": false,
            "description": "\"latest\" (default) includes non-final state; \"final\" reads finalized state only (genlayer-js `latest-final`).",
            "schema": {
              "type": "string",
              "enum": [
                "latest",
                "final"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              },
              "X-RateLimit-Limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Remaining": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "$ref": "#/components/schemas/Receipt"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. See Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error (no details are exposed).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "The network or contract answered badly or not at all.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/receipts/{receiptId}": {
      "get": {
        "operationId": "getReceipt",
        "tags": [
          "Receipts"
        ],
        "summary": "Read a receipt by id",
        "description": "A receipt by its contract id.",
        "parameters": [
          {
            "name": "receiptId",
            "in": "path",
            "required": true,
            "description": "Receipt id, e.g. \"rcpt-1\".",
            "schema": {
              "type": "string",
              "pattern": "^rcpt-[1-9][0-9]*$"
            },
            "example": "rcpt-1"
          },
          {
            "name": "consistency",
            "in": "query",
            "required": false,
            "description": "\"latest\" (default) includes non-final state; \"final\" reads finalized state only (genlayer-js `latest-final`).",
            "schema": {
              "type": "string",
              "enum": [
                "latest",
                "final"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              },
              "X-RateLimit-Limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Remaining": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "$ref": "#/components/schemas/Receipt"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. See Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error (no details are exposed).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "The network or contract answered badly or not at all.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/transactions/{txHash}": {
      "get": {
        "operationId": "getTransaction",
        "tags": [
          "Transactions"
        ],
        "summary": "Track a transaction",
        "description": "Where a transaction is in GenLayer consensus. Read-only. `decided: true` does NOT prove the change was recorded: read the job or receipt to confirm.",
        "parameters": [
          {
            "name": "txHash",
            "in": "path",
            "required": true,
            "description": "GenLayer transaction hash: 0x followed by 64 hex characters.",
            "schema": {
              "type": "string",
              "pattern": "^0x[0-9a-fA-F]{64}$"
            },
            "example": "0xabababababababababababababababababababababababababababababababab"
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                }
              },
              "X-RateLimit-Limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Remaining": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    },
                    "data": {
                      "$ref": "#/components/schemas/Transaction"
                    }
                  },
                  "required": [
                    "success",
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameter.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. See Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error (no details are exposed).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "The network or contract answered badly or not at all.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Health": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "ok"
            ]
          },
          "time": {
            "type": "string",
            "format": "date-time"
          },
          "checks": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "With `deep=true`: `chain` is `ok`; `copy` (only when a database copy is configured) is `ok`, `stale`, `failing` or `unavailable`."
          },
          "copy": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "syncedAt": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time",
                "description": "When the indexer last wrote the position."
              },
              "lagSeconds": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "Seconds since `syncedAt`."
              },
              "staleAfterSeconds": {
                "type": "integer",
                "description": "Older than this counts as stale (the indexer runs about every ten minutes)."
              },
              "copiedThrough": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "The newest job id the copy has reached."
              },
              "lastRun": {
                "type": [
                  "object",
                  "null"
                ],
                "additionalProperties": false,
                "description": "The newest recorded indexer run. Null when none was recorded.",
                "properties": {
                  "ok": {
                    "type": "boolean"
                  },
                  "finishedAt": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "newJobs": {
                    "type": "integer"
                  },
                  "refreshedJobs": {
                    "type": "integer"
                  },
                  "receipts": {
                    "type": "integer"
                  },
                  "failedRows": {
                    "type": "integer"
                  },
                  "rounds": {
                    "type": "integer"
                  }
                }
              }
            },
            "required": [
              "syncedAt",
              "lagSeconds",
              "staleAfterSeconds",
              "copiedThrough",
              "lastRun"
            ]
          }
        },
        "required": [
          "status",
          "time",
          "checks"
        ]
      },
      "Meta": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "Allocyn"
            ]
          },
          "sdkVersion": {
            "type": "string"
          },
          "network": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "name": {
                "type": "string"
              },
              "label": {
                "type": "string"
              },
              "chainId": {
                "type": "integer"
              },
              "rpcUrl": {
                "type": "string"
              },
              "explorerUrl": {
                "type": "string"
              },
              "sdkAlias": {
                "type": "string"
              }
            },
            "required": [
              "name",
              "label",
              "chainId",
              "rpcUrl",
              "explorerUrl",
              "sdkAlias"
            ]
          },
          "contractAddress": {
            "type": "string",
            "pattern": "^0x[0-9a-fA-F]{40}$"
          },
          "contractProfile": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "name": {
                "type": "string"
              },
              "sourceSha256": {
                "type": "string",
                "pattern": "^[0-9a-f]{64}$"
              },
              "limitsSource": {
                "type": "string",
                "enum": [
                  "audited-source"
                ]
              }
            },
            "required": [
              "name",
              "sourceSha256",
              "limitsSource"
            ]
          },
          "readConsistency": {
            "type": "string",
            "enum": [
              "latest",
              "final"
            ]
          },
          "canWrite": {
            "type": "boolean",
            "description": "Always false for this API: it holds no signer."
          },
          "actor": {
            "type": [
              "string",
              "null"
            ]
          },
          "api": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "version": {
                "type": "string",
                "enum": [
                  "v1"
                ]
              }
            },
            "required": [
              "version"
            ]
          }
        },
        "required": [
          "name",
          "sdkVersion",
          "network",
          "contractAddress",
          "contractProfile",
          "readConsistency",
          "canWrite",
          "actor",
          "api"
        ]
      },
      "Limits": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "source": {
            "type": "string",
            "enum": [
              "contract"
            ],
            "description": "Read from the contract's get_limits() view."
          },
          "contract": {
            "$ref": "#/components/schemas/ContractLimits"
          },
          "pinned": {
            "$ref": "#/components/schemas/ContractLimits"
          },
          "matchesPinned": {
            "type": "boolean"
          },
          "differences": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "schemaVersion": {
            "type": "integer"
          },
          "client": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "maxCriteria": {
                "type": "integer"
              },
              "maxTitleLength": {
                "type": "integer"
              },
              "maxDescriptionLength": {
                "type": "integer"
              },
              "maxCriterionLength": {
                "type": "integer"
              },
              "maxUrlLength": {
                "type": "integer"
              }
            },
            "required": [
              "maxCriteria",
              "maxTitleLength",
              "maxDescriptionLength",
              "maxCriterionLength",
              "maxUrlLength"
            ]
          },
          "contractSourceSha256": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$"
          }
        },
        "required": [
          "source",
          "contract",
          "pinned",
          "matchesPinned",
          "differences",
          "schemaVersion",
          "client",
          "contractSourceSha256"
        ]
      },
      "ContractLimits": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "minCriteria": {
            "type": "integer"
          },
          "maxCriteria": {
            "type": "integer"
          },
          "maxTitleLength": {
            "type": "integer"
          },
          "maxDescriptionLength": {
            "type": "integer"
          },
          "maxCriterionLength": {
            "type": "integer"
          },
          "maxUrlLength": {
            "type": "integer"
          },
          "maxContentBytes": {
            "type": "integer"
          },
          "minEvidenceExcerptLength": {
            "type": "integer"
          },
          "maxEvidenceExcerptLength": {
            "type": "integer"
          },
          "maxDeliveriesPerJob": {
            "type": "integer"
          }
        },
        "required": [
          "minCriteria",
          "maxCriteria",
          "maxTitleLength",
          "maxDescriptionLength",
          "maxCriterionLength",
          "maxUrlLength",
          "maxContentBytes",
          "minEvidenceExcerptLength",
          "maxEvidenceExcerptLength",
          "maxDeliveriesPerJob"
        ]
      },
      "Criterion": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string"
          },
          "text": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "text"
        ]
      },
      "Proof": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "format": {
            "type": "string",
            "enum": [
              "allocyn.proof"
            ],
            "description": "Marks the answer as a portable proof pack."
          },
          "formatVersion": {
            "type": "integer",
            "enum": [
              1
            ]
          },
          "jobId": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "OPEN",
              "IN_PROGRESS",
              "VERIFIED",
              "NEEDS_REVISION",
              "INCONCLUSIVE"
            ]
          },
          "final": {
            "type": "boolean"
          },
          "consistency": {
            "type": "string",
            "enum": [
              "latest",
              "final"
            ]
          },
          "readAt": {
            "type": "string",
            "format": "date-time"
          },
          "network": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "name": {
                "type": "string"
              },
              "chainId": {
                "type": "integer"
              }
            },
            "required": [
              "name",
              "chainId"
            ]
          },
          "contractUrl": {
            "type": "string"
          },
          "facts": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "contract": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "address": {
                    "type": "string",
                    "pattern": "^0x[0-9a-fA-F]{40}$"
                  },
                  "chainId": {
                    "type": "integer"
                  },
                  "sourceSha256": {
                    "type": "string",
                    "pattern": "^[0-9a-f]{64}$"
                  }
                },
                "required": [
                  "address",
                  "chainId",
                  "sourceSha256"
                ]
              },
              "job": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "title": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  },
                  "criteria": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/Criterion"
                    }
                  },
                  "client": {
                    "type": "string",
                    "pattern": "^0x[0-9a-fA-F]{40}$"
                  },
                  "worker": {
                    "oneOf": [
                      {
                        "type": "string",
                        "pattern": "^0x[0-9a-fA-F]{40}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "OPEN",
                      "IN_PROGRESS",
                      "VERIFIED",
                      "NEEDS_REVISION",
                      "INCONCLUSIVE"
                    ]
                  },
                  "deliveryCount": {
                    "type": "integer"
                  },
                  "termsHash": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "pattern": "^[0-9a-f]{64}$"
                  },
                  "agreementHash": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "pattern": "^[0-9a-f]{64}$"
                  }
                },
                "required": [
                  "id",
                  "title",
                  "description",
                  "criteria",
                  "client",
                  "worker",
                  "status",
                  "deliveryCount",
                  "termsHash",
                  "agreementHash"
                ]
              },
              "deliveries": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "deliveryIndex": {
                      "type": "integer"
                    },
                    "receiptId": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "PENDING",
                        "EVALUATED",
                        "SUPERSEDED"
                      ]
                    },
                    "overallStatus": {
                      "oneOf": [
                        {
                          "type": "string",
                          "enum": [
                            "VERIFIED",
                            "NEEDS_REVISION",
                            "INCONCLUSIVE"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "evidenceHash": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "pattern": "^[0-9a-f]{64}$"
                    },
                    "evidenceSize": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": false,
                        "properties": {
                          "criterionId": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "MET",
                              "NOT_MET",
                              "UNVERIFIABLE"
                            ]
                          },
                          "reasonCode": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "criterionId",
                          "status",
                          "reasonCode"
                        ]
                      }
                    }
                  },
                  "required": [
                    "deliveryIndex",
                    "receiptId",
                    "url",
                    "status",
                    "overallStatus",
                    "evidenceHash",
                    "evidenceSize",
                    "results"
                  ]
                }
              }
            },
            "required": [
              "contract",
              "job",
              "deliveries"
            ]
          },
          "digest": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "algorithm": {
                "type": "string",
                "enum": [
                  "sha256"
                ]
              },
              "value": {
                "type": "string",
                "pattern": "^[0-9a-f]{64}$"
              },
              "covers": {
                "type": "string",
                "enum": [
                  "facts"
                ]
              }
            },
            "required": [
              "algorithm",
              "value",
              "covers"
            ]
          },
          "integrity": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "termsHashMatches": {
                "type": [
                  "boolean",
                  "null"
                ]
              },
              "agreementHashMatches": {
                "type": [
                  "boolean",
                  "null"
                ]
              }
            },
            "required": [
              "termsHashMatches",
              "agreementHashMatches"
            ]
          },
          "verify": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "notes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "format",
          "formatVersion",
          "jobId",
          "status",
          "final",
          "consistency",
          "readAt",
          "network",
          "contractUrl",
          "facts",
          "digest",
          "integrity",
          "verify",
          "notes"
        ]
      },
      "JobSummary": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^job-[1-9][0-9]*$"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "OPEN",
              "IN_PROGRESS",
              "VERIFIED",
              "NEEDS_REVISION",
              "INCONCLUSIVE"
            ]
          },
          "client": {
            "type": "string",
            "pattern": "^0x[0-9a-fA-F]{40}$"
          },
          "worker": {
            "oneOf": [
              {
                "type": "string",
                "pattern": "^0x[0-9a-fA-F]{40}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "deliveryCount": {
            "type": "integer"
          }
        },
        "required": [
          "id",
          "title",
          "status",
          "client",
          "worker",
          "deliveryCount"
        ]
      },
      "JobList": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/JobSummary"
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass as `before` to continue. Null when there is nothing older."
          },
          "latest": {
            "type": [
              "string",
              "null"
            ],
            "description": "The newest job id, or null when there are no jobs."
          },
          "scanned": {
            "type": "integer",
            "description": "How many job ids were read from the contract for this page. 0 when the list came from the database copy."
          },
          "source": {
            "type": "string",
            "enum": [
              "contract",
              "copy"
            ],
            "description": "Where this page was read from."
          },
          "syncedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "From the copy: when the indexer last ran. Null when read from the contract."
          },
          "notes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "items",
          "nextCursor",
          "latest",
          "scanned",
          "source",
          "syncedAt",
          "notes"
        ]
      },
      "PreparedAction": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "jobId": {
            "type": "string"
          },
          "action": {
            "type": "string",
            "enum": [
              "accept",
              "submit",
              "evaluate"
            ]
          },
          "status": {
            "type": "string"
          },
          "final": {
            "type": "boolean"
          },
          "canProceed": {
            "type": "boolean",
            "description": "True when the contract would accept this action from the right account right now."
          },
          "reasons": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Why not, when canProceed is false."
          },
          "whoMaySign": {
            "type": "string"
          },
          "actor": {
            "type": "string"
          },
          "intent": {
            "type": [
              "object",
              "null"
            ],
            "description": "The contract call the person would sign. Null when canProceed is false."
          },
          "sdk": {
            "type": [
              "string",
              "null"
            ],
            "description": "The same call with @allocyn/sdk."
          },
          "appLink": {
            "type": [
              "string",
              "null"
            ],
            "description": "A link to the Allocyn app, when APP_URL is configured."
          },
          "sent": {
            "type": "boolean",
            "description": "Always false: nothing is sent or signed here."
          },
          "readAt": {
            "type": "string",
            "format": "date-time"
          },
          "next": {
            "type": "string"
          },
          "notes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "jobId",
          "action",
          "status",
          "final",
          "canProceed",
          "reasons",
          "whoMaySign",
          "intent",
          "sdk",
          "appLink",
          "sent",
          "readAt",
          "next",
          "notes"
        ]
      },
      "Stats": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "source": {
            "type": "string",
            "enum": [
              "copy"
            ],
            "description": "Counted in the database copy, not read from the contract."
          },
          "contract": {
            "type": [
              "string",
              "null"
            ]
          },
          "network": {
            "type": [
              "string",
              "null"
            ]
          },
          "syncedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the indexer last ran. Jobs created since are not counted."
          },
          "copiedThrough": {
            "type": [
              "string",
              "null"
            ],
            "description": "The newest job id the copy has reached."
          },
          "filter": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "client": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "worker": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "client",
              "worker"
            ]
          },
          "jobs": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "total": {
                "type": "integer"
              },
              "byStatus": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "OPEN": {
                    "type": "integer"
                  },
                  "IN_PROGRESS": {
                    "type": "integer"
                  },
                  "VERIFIED": {
                    "type": "integer"
                  },
                  "NEEDS_REVISION": {
                    "type": "integer"
                  },
                  "INCONCLUSIVE": {
                    "type": "integer"
                  }
                },
                "required": [
                  "OPEN",
                  "IN_PROGRESS",
                  "VERIFIED",
                  "NEEDS_REVISION",
                  "INCONCLUSIVE"
                ]
              }
            },
            "required": [
              "total",
              "byStatus"
            ]
          },
          "receipts": {
            "oneOf": [
              {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "total": {
                    "type": "integer"
                  },
                  "byOutcome": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "VERIFIED": {
                        "type": "integer"
                      },
                      "NEEDS_REVISION": {
                        "type": "integer"
                      },
                      "INCONCLUSIVE": {
                        "type": "integer"
                      },
                      "PENDING": {
                        "type": "integer"
                      }
                    },
                    "required": [
                      "VERIFIED",
                      "NEEDS_REVISION",
                      "INCONCLUSIVE",
                      "PENDING"
                    ]
                  }
                },
                "required": [
                  "total",
                  "byOutcome"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "Null when filtering by client."
          },
          "notes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "source",
          "contract",
          "network",
          "syncedAt",
          "copiedThrough",
          "filter",
          "jobs",
          "receipts",
          "notes"
        ]
      },
      "AddressRecord": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "address": {
            "type": "string",
            "pattern": "^0x[0-9a-fA-F]{40}$"
          },
          "source": {
            "type": "string",
            "enum": [
              "copy"
            ]
          },
          "contract": {
            "type": [
              "string",
              "null"
            ]
          },
          "network": {
            "type": [
              "string",
              "null"
            ]
          },
          "syncedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the indexer last ran."
          },
          "copiedThrough": {
            "type": [
              "string",
              "null"
            ],
            "description": "The newest job id the copy has reached."
          },
          "asWorker": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "jobs": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "total": {
                    "type": "integer"
                  },
                  "byStatus": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "OPEN": {
                        "type": "integer"
                      },
                      "IN_PROGRESS": {
                        "type": "integer"
                      },
                      "VERIFIED": {
                        "type": "integer"
                      },
                      "NEEDS_REVISION": {
                        "type": "integer"
                      },
                      "INCONCLUSIVE": {
                        "type": "integer"
                      }
                    },
                    "required": [
                      "OPEN",
                      "IN_PROGRESS",
                      "VERIFIED",
                      "NEEDS_REVISION",
                      "INCONCLUSIVE"
                    ]
                  }
                },
                "required": [
                  "total",
                  "byStatus"
                ]
              },
              "deliveries": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "total": {
                    "type": "integer"
                  },
                  "byOutcome": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "VERIFIED": {
                        "type": "integer"
                      },
                      "NEEDS_REVISION": {
                        "type": "integer"
                      },
                      "INCONCLUSIVE": {
                        "type": "integer"
                      },
                      "PENDING": {
                        "type": "integer"
                      }
                    },
                    "required": [
                      "VERIFIED",
                      "NEEDS_REVISION",
                      "INCONCLUSIVE",
                      "PENDING"
                    ]
                  }
                },
                "required": [
                  "total",
                  "byOutcome"
                ]
              }
            },
            "required": [
              "jobs",
              "deliveries"
            ]
          },
          "asClient": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "jobs": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "total": {
                    "type": "integer"
                  },
                  "byStatus": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "OPEN": {
                        "type": "integer"
                      },
                      "IN_PROGRESS": {
                        "type": "integer"
                      },
                      "VERIFIED": {
                        "type": "integer"
                      },
                      "NEEDS_REVISION": {
                        "type": "integer"
                      },
                      "INCONCLUSIVE": {
                        "type": "integer"
                      }
                    },
                    "required": [
                      "OPEN",
                      "IN_PROGRESS",
                      "VERIFIED",
                      "NEEDS_REVISION",
                      "INCONCLUSIVE"
                    ]
                  }
                },
                "required": [
                  "total",
                  "byStatus"
                ]
              }
            },
            "required": [
              "jobs"
            ]
          },
          "recent": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "asWorker": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/JobSummary"
                }
              },
              "asClient": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/JobSummary"
                }
              }
            },
            "required": [
              "asWorker",
              "asClient"
            ]
          },
          "notes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "address",
          "source",
          "contract",
          "network",
          "syncedAt",
          "copiedThrough",
          "asWorker",
          "asClient",
          "recent",
          "notes"
        ]
      },
      "EventFeed": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "id": {
                  "type": "integer"
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "job_created",
                    "job_accepted",
                    "delivery_submitted",
                    "delivery_evaluated",
                    "status_changed"
                  ]
                },
                "jobId": {
                  "type": "string",
                  "pattern": "^job-[1-9][0-9]*$"
                },
                "detectedAt": {
                  "type": "string",
                  "format": "date-time",
                  "description": "When the indexer saw the change, not when it happened on the network."
                },
                "fromStatus": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "enum": [
                    "OPEN",
                    "IN_PROGRESS",
                    "VERIFIED",
                    "NEEDS_REVISION",
                    "INCONCLUSIVE",
                    null
                  ]
                },
                "toStatus": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "enum": [
                    "OPEN",
                    "IN_PROGRESS",
                    "VERIFIED",
                    "NEEDS_REVISION",
                    "INCONCLUSIVE",
                    null
                  ]
                },
                "client": {
                  "type": "string",
                  "pattern": "^0x[0-9a-fA-F]{40}$"
                },
                "worker": {
                  "oneOf": [
                    {
                      "type": "string",
                      "pattern": "^0x[0-9a-fA-F]{40}$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "data": {
                  "type": "object",
                  "additionalProperties": true,
                  "description": "Extra facts of the event, e.g. `deliveryCount`, or `receiptId`, `deliveryIndex` and `outcome` for a verdict."
                }
              },
              "required": [
                "id",
                "type",
                "jobId",
                "detectedAt",
                "fromStatus",
                "toStatus",
                "client",
                "worker",
                "data"
              ]
            }
          },
          "cursor": {
            "type": "integer",
            "description": "Pass as `after` to get what comes next."
          },
          "source": {
            "type": "string",
            "enum": [
              "copy"
            ]
          },
          "syncedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the indexer last ran. No event after it is here."
          },
          "waitedSeconds": {
            "type": "number"
          },
          "notes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "items",
          "cursor",
          "source",
          "syncedAt",
          "waitedSeconds",
          "notes"
        ]
      },
      "JobWait": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "changed": {
            "type": "boolean",
            "description": "False on the first call and when the wait ended with no change."
          },
          "version": {
            "type": "string",
            "pattern": "^[0-9a-f]{16}$"
          },
          "waitedSeconds": {
            "type": "number"
          },
          "job": {
            "$ref": "#/components/schemas/Job"
          }
        },
        "required": [
          "changed",
          "version",
          "waitedSeconds",
          "job"
        ]
      },
      "Badge": {
        "type": "string",
        "description": "An SVG image."
      },
      "Job": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^job-[1-9][0-9]*$"
          },
          "title": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "criteria": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Criterion"
            }
          },
          "client": {
            "type": "string",
            "pattern": "^0x[0-9a-fA-F]{40}$"
          },
          "worker": {
            "oneOf": [
              {
                "type": "string",
                "pattern": "^0x[0-9a-fA-F]{40}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "OPEN",
              "IN_PROGRESS",
              "VERIFIED",
              "NEEDS_REVISION",
              "INCONCLUSIVE"
            ]
          },
          "deliveryCount": {
            "type": "integer"
          },
          "receiptIds": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^rcpt-[1-9][0-9]*$"
            }
          },
          "termsHash": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[0-9a-f]{64}$"
          },
          "agreementHash": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[0-9a-f]{64}$"
          },
          "integrity": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "termsHashMatches": {
                "type": [
                  "boolean",
                  "null"
                ]
              },
              "agreementHashMatches": {
                "type": [
                  "boolean",
                  "null"
                ]
              }
            },
            "required": [
              "termsHashMatches",
              "agreementHashMatches"
            ]
          }
        },
        "required": [
          "id",
          "title",
          "description",
          "criteria",
          "client",
          "worker",
          "status",
          "deliveryCount",
          "receiptIds",
          "termsHash",
          "agreementHash",
          "integrity"
        ]
      },
      "CriterionResult": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "criterionId": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "MET",
              "NOT_MET",
              "UNVERIFIABLE"
            ]
          },
          "reasonCode": {
            "type": "string",
            "enum": [
              "MEETS_CRITERION",
              "REQUIREMENT_NOT_MET",
              "INSUFFICIENT_EVIDENCE"
            ]
          },
          "evidenceExcerpt": {
            "type": "string",
            "description": "Literal quote from the deliverable. Plain text: never render as HTML."
          }
        },
        "required": [
          "criterionId",
          "status",
          "reasonCode",
          "evidenceExcerpt"
        ]
      },
      "Receipt": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^rcpt-[1-9][0-9]*$"
          },
          "jobId": {
            "type": "string",
            "pattern": "^job-[1-9][0-9]*$"
          },
          "deliveryIndex": {
            "type": "integer",
            "minimum": 1
          },
          "worker": {
            "type": "string",
            "pattern": "^0x[0-9a-fA-F]{40}$"
          },
          "url": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "PENDING",
              "EVALUATED",
              "SUPERSEDED"
            ]
          },
          "agreementHash": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[0-9a-f]{64}$"
          },
          "evidenceHash": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[0-9a-f]{64}$"
          },
          "evidenceSize": {
            "type": [
              "integer",
              "null"
            ]
          },
          "overallStatus": {
            "oneOf": [
              {
                "type": "string",
                "enum": [
                  "VERIFIED",
                  "NEEDS_REVISION",
                  "INCONCLUSIVE"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "evaluationRequestedBy": {
            "oneOf": [
              {
                "type": "string",
                "pattern": "^0x[0-9a-fA-F]{40}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CriterionResult"
            }
          }
        },
        "required": [
          "id",
          "jobId",
          "deliveryIndex",
          "worker",
          "url",
          "status",
          "agreementHash",
          "evidenceHash",
          "evidenceSize",
          "overallStatus",
          "evaluationRequestedBy",
          "results"
        ]
      },
      "ReceiptList": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/Receipt"
        }
      },
      "Transaction": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "txHash": {
            "type": "string",
            "pattern": "^0x[0-9a-fA-F]{64}$"
          },
          "phase": {
            "type": "string",
            "enum": [
              "idle",
              "awaiting_wallet",
              "submitted",
              "in_consensus",
              "decided",
              "finalized",
              "cancelled",
              "timed_out",
              "undetermined",
              "rejected_by_user",
              "failed",
              "unknown"
            ]
          },
          "label": {
            "type": "string"
          },
          "statusName": {
            "type": [
              "string",
              "null"
            ]
          },
          "decided": {
            "type": "boolean"
          },
          "failureMessage": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "txHash",
          "phase",
          "label",
          "statusName",
          "decided",
          "failureMessage"
        ]
      },
      "ErrorResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              false
            ]
          },
          "error": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "code": {
                "type": "string",
                "enum": [
                  "INVALID_ARGUMENT",
                  "NOT_FOUND",
                  "JOB_NOT_FOUND",
                  "RECEIPT_NOT_FOUND",
                  "METHOD_NOT_ALLOWED",
                  "RATE_LIMITED",
                  "FORBIDDEN",
                  "UPSTREAM_UNAVAILABLE",
                  "UPSTREAM_TIMEOUT",
                  "DATA_INTEGRITY",
                  "CONTRACT_NOT_FOUND",
                  "COPY_UNAVAILABLE",
                  "INTERNAL"
                ]
              },
              "message": {
                "type": "string"
              },
              "retryable": {
                "type": "boolean"
              },
              "field": {
                "type": "string"
              }
            },
            "required": [
              "code",
              "message",
              "retryable"
            ]
          }
        },
        "required": [
          "success",
          "error"
        ]
      }
    }
  }
}