{
  "openapi": "3.1.0",
  "info": {
    "title": "EQTY Faucet",
    "version": "1.0.0",
    "description": "V1 test EQTY ERC-20 only. No native gas distribution. Requires persistent budget reservations and exactly-once credit/payout semantics."
  },
  "servers": [
    {
      "url": "https://faucet.eqty.me/api/v1"
    }
  ],
  "paths": {
    "/assets": {
      "get": {
        "operationId": "get__assets",
        "summary": "Advertised assets/policy; check availability before mining.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Asset"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Structured API error; retry only according to code and retry_after_seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Structured API error; retry only according to code and retry_after_seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Structured API error; retry only according to code and retry_after_seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "Structured API error; retry only according to code and retry_after_seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "429": {
            "description": "Structured API error; retry only according to code and retry_after_seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "503": {
            "description": "Structured API error; retry only according to code and retry_after_seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "Structured API error; retry only according to code and retry_after_seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/status": {
      "get": {
        "operationId": "get__status",
        "summary": "Public operational status.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServiceStatus"
                }
              }
            }
          },
          "400": {
            "description": "Structured API error; retry only according to code and retry_after_seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Structured API error; retry only according to code and retry_after_seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Structured API error; retry only according to code and retry_after_seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "Structured API error; retry only according to code and retry_after_seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "429": {
            "description": "Structured API error; retry only according to code and retry_after_seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "503": {
            "description": "Structured API error; retry only according to code and retry_after_seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "Structured API error; retry only according to code and retry_after_seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/health/live": {
      "get": {
        "operationId": "get__health_live",
        "summary": "Process liveness.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Health"
                }
              }
            }
          },
          "400": {
            "description": "Structured API error; retry only according to code and retry_after_seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Structured API error; retry only according to code and retry_after_seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Structured API error; retry only according to code and retry_after_seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "Structured API error; retry only according to code and retry_after_seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "429": {
            "description": "Structured API error; retry only according to code and retry_after_seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "503": {
            "description": "Structured API error; retry only according to code and retry_after_seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "Structured API error; retry only according to code and retry_after_seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/health/ready": {
      "get": {
        "operationId": "get__health_ready",
        "summary": "Dependency readiness.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Health"
                }
              }
            }
          },
          "400": {
            "description": "Structured API error; retry only according to code and retry_after_seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Structured API error; retry only according to code and retry_after_seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Structured API error; retry only according to code and retry_after_seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "Structured API error; retry only according to code and retry_after_seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "429": {
            "description": "Structured API error; retry only according to code and retry_after_seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "503": {
            "description": "Structured API error; retry only according to code and retry_after_seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "Structured API error; retry only according to code and retry_after_seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/build": {
      "get": {
        "operationId": "get__build",
        "summary": "Executable version and corresponding source revision.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BuildInfo"
                }
              }
            }
          },
          "400": {
            "description": "Structured API error; retry only according to code and retry_after_seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Structured API error; retry only according to code and retry_after_seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Structured API error; retry only according to code and retry_after_seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "Structured API error; retry only according to code and retry_after_seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "429": {
            "description": "Structured API error; retry only according to code and retry_after_seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "503": {
            "description": "Structured API error; retry only according to code and retry_after_seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "Structured API error; retry only according to code and retry_after_seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/sessions": {
      "post": {
        "operationId": "post__sessions",
        "summary": "Create recipient-bound session; return bearer credential once.",
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionCreated"
                }
              }
            }
          },
          "400": {
            "description": "Structured API error; retry only according to code and retry_after_seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Structured API error; retry only according to code and retry_after_seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Structured API error; retry only according to code and retry_after_seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "Structured API error; retry only according to code and retry_after_seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "429": {
            "description": "Structured API error; retry only according to code and retry_after_seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "503": {
            "description": "Structured API error; retry only according to code and retry_after_seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "Structured API error; retry only according to code and retry_after_seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SessionRequest"
              }
            }
          }
        }
      }
    },
    "/sessions/{session_id}": {
      "get": {
        "operationId": "get__sessions_session_id",
        "summary": "Read durable balances and pending payouts.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionStatus"
                }
              }
            }
          },
          "400": {
            "description": "Structured API error; retry only according to code and retry_after_seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Structured API error; retry only according to code and retry_after_seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Structured API error; retry only according to code and retry_after_seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "Structured API error; retry only according to code and retry_after_seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "429": {
            "description": "Structured API error; retry only according to code and retry_after_seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "503": {
            "description": "Structured API error; retry only according to code and retry_after_seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "Structured API error; retry only according to code and retry_after_seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "sessionBearer": []
          }
        ],
        "parameters": [
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          }
        ]
      }
    },
    "/sessions/{session_id}/challenges": {
      "post": {
        "operationId": "post__sessions_session_id_challenges",
        "summary": "Issue immutable policy with reserved capacity for max_proofs.",
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChallengeEnvelope"
                }
              }
            }
          },
          "400": {
            "description": "Structured API error; retry only according to code and retry_after_seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Structured API error; retry only according to code and retry_after_seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Structured API error; retry only according to code and retry_after_seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "Structured API error; retry only according to code and retry_after_seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "429": {
            "description": "Structured API error; retry only according to code and retry_after_seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "503": {
            "description": "Structured API error; retry only according to code and retry_after_seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "Structured API error; retry only according to code and retry_after_seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "sessionBearer": []
          }
        ],
        "parameters": [
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          }
        ]
      }
    },
    "/sessions/{session_id}/proofs": {
      "post": {
        "operationId": "post__sessions_session_id_proofs",
        "summary": "Verify/credit atomically. Identical retry returns original credited amount and duplicate=true; never credits twice.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProofAccepted"
                }
              }
            }
          },
          "400": {
            "description": "Structured API error; retry only according to code and retry_after_seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Structured API error; retry only according to code and retry_after_seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Structured API error; retry only according to code and retry_after_seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "Structured API error; retry only according to code and retry_after_seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "429": {
            "description": "Structured API error; retry only according to code and retry_after_seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "503": {
            "description": "Structured API error; retry only according to code and retry_after_seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "Structured API error; retry only according to code and retry_after_seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "sessionBearer": []
          }
        ],
        "parameters": [
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProofRequest"
              }
            }
          }
        }
      }
    },
    "/sessions/{session_id}/payouts": {
      "post": {
        "operationId": "post__sessions_session_id_payouts",
        "summary": "Atomically reserve credit; duplicate idempotency key returns the same payout.",
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payout"
                }
              }
            }
          },
          "400": {
            "description": "Structured API error; retry only according to code and retry_after_seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Structured API error; retry only according to code and retry_after_seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Structured API error; retry only according to code and retry_after_seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "Structured API error; retry only according to code and retry_after_seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "429": {
            "description": "Structured API error; retry only according to code and retry_after_seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "503": {
            "description": "Structured API error; retry only according to code and retry_after_seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "Structured API error; retry only according to code and retry_after_seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "sessionBearer": []
          }
        ],
        "parameters": [
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            },
            "description": "Persist before submission. Reuse only with identical amount/session; conflict is rejected."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PayoutRequest"
              }
            }
          }
        }
      }
    },
    "/sessions/{session_id}/payouts/{payout_id}": {
      "get": {
        "operationId": "get__sessions_session_id_payouts_payout_id",
        "summary": "Read durable payout status; only confirmed means settled.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Payout"
                }
              }
            }
          },
          "400": {
            "description": "Structured API error; retry only according to code and retry_after_seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "401": {
            "description": "Structured API error; retry only according to code and retry_after_seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Structured API error; retry only according to code and retry_after_seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "409": {
            "description": "Structured API error; retry only according to code and retry_after_seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "429": {
            "description": "Structured API error; retry only according to code and retry_after_seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "503": {
            "description": "Structured API error; retry only according to code and retry_after_seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "Structured API error; retry only according to code and retry_after_seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "security": [
          {
            "sessionBearer": []
          }
        ],
        "parameters": [
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          },
          {
            "name": "payout_id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Uuid"
            }
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "sessionBearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "Opaque session resume token. Never send to another origin or follow redirects with it."
      }
    },
    "schemas": {
      "Amount": {
        "type": "string",
        "pattern": "^(0|[1-9][0-9]{0,38})$",
        "description": "Unsigned u128 token base units. Values above u128::MAX are rejected."
      },
      "Word": {
        "type": "string",
        "pattern": "^(0|[1-9][0-9]{0,19})$",
        "description": "Unsigned u64 in canonical decimal form. Values above u64::MAX are rejected."
      },
      "Address": {
        "type": "string",
        "pattern": "^0x[0-9a-fA-F]{40}$",
        "description": "Serialized as lowercase 0x-prefixed hex."
      },
      "Hash32": {
        "type": "string",
        "pattern": "^0x[0-9a-fA-F]{64}$"
      },
      "Uuid": {
        "type": "string",
        "format": "uuid"
      },
      "Asset": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "network",
          "chain_id",
          "token",
          "symbol",
          "decimals",
          "policy_version",
          "reward",
          "difficulty",
          "min_payout",
          "max_payout",
          "auto_payout",
          "available",
          "explorer_transaction_url"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "network": {
            "type": "string"
          },
          "chain_id": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "token": {
            "$ref": "#/components/schemas/Address"
          },
          "symbol": {
            "type": "string"
          },
          "decimals": {
            "type": "integer",
            "minimum": 0,
            "maximum": 38
          },
          "policy_version": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "reward": {
            "$ref": "#/components/schemas/Amount"
          },
          "difficulty": {
            "$ref": "#/components/schemas/Word"
          },
          "min_payout": {
            "$ref": "#/components/schemas/Amount"
          },
          "max_payout": {
            "$ref": "#/components/schemas/Amount"
          },
          "auto_payout": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Amount"
              },
              {
                "type": "null"
              }
            ]
          },
          "available": {
            "type": "boolean"
          },
          "explorer_transaction_url": {
            "type": "string"
          }
        }
      },
      "SessionRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "asset_id",
          "recipient"
        ],
        "properties": {
          "asset_id": {
            "type": "string"
          },
          "recipient": {
            "$ref": "#/components/schemas/Address"
          }
        }
      },
      "SessionCreated": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "session_id",
          "resume_token",
          "asset",
          "recipient"
        ],
        "properties": {
          "session_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "resume_token": {
            "type": "string",
            "readOnly": true,
            "description": "Returned once; persist securely. Never log."
          },
          "asset": {
            "$ref": "#/components/schemas/Asset"
          },
          "recipient": {
            "$ref": "#/components/schemas/Address"
          }
        }
      },
      "Challenge": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "protocol_version",
          "algorithm",
          "policy_version",
          "session_id",
          "challenge_id",
          "seed",
          "chain_id",
          "token",
          "recipient",
          "reward",
          "difficulty",
          "nonces_per_seed",
          "max_proofs",
          "issued_at",
          "expires_at"
        ],
        "properties": {
          "protocol_version": {
            "type": "integer",
            "const": 1
          },
          "algorithm": {
            "type": "string",
            "const": "hashwx-v1"
          },
          "policy_version": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "session_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "challenge_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "seed": {
            "$ref": "#/components/schemas/Hash32"
          },
          "chain_id": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "token": {
            "$ref": "#/components/schemas/Address"
          },
          "recipient": {
            "$ref": "#/components/schemas/Address"
          },
          "reward": {
            "$ref": "#/components/schemas/Amount"
          },
          "difficulty": {
            "$ref": "#/components/schemas/Word"
          },
          "nonces_per_seed": {
            "type": "integer",
            "const": 463
          },
          "max_proofs": {
            "type": "integer",
            "minimum": 1,
            "maximum": 4096
          },
          "issued_at": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "expires_at": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          }
        }
      },
      "ChallengeEnvelope": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "challenge",
          "authentication"
        ],
        "properties": {
          "challenge": {
            "$ref": "#/components/schemas/Challenge"
          },
          "authentication": {
            "$ref": "#/components/schemas/Hash32"
          }
        }
      },
      "Proof": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "challenge_id",
          "nonce",
          "hash"
        ],
        "properties": {
          "challenge_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "nonce": {
            "$ref": "#/components/schemas/Word"
          },
          "hash": {
            "$ref": "#/components/schemas/Word"
          }
        }
      },
      "ProofRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "envelope",
          "proof"
        ],
        "properties": {
          "envelope": {
            "$ref": "#/components/schemas/ChallengeEnvelope"
          },
          "proof": {
            "$ref": "#/components/schemas/Proof"
          }
        }
      },
      "Balance": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "earned",
          "available",
          "reserved",
          "paid"
        ],
        "properties": {
          "earned": {
            "$ref": "#/components/schemas/Amount"
          },
          "available": {
            "$ref": "#/components/schemas/Amount"
          },
          "reserved": {
            "$ref": "#/components/schemas/Amount"
          },
          "paid": {
            "$ref": "#/components/schemas/Amount"
          }
        }
      },
      "ProofAccepted": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "challenge_id",
          "nonce",
          "credited",
          "duplicate",
          "balance"
        ],
        "properties": {
          "challenge_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "nonce": {
            "$ref": "#/components/schemas/Word"
          },
          "credited": {
            "$ref": "#/components/schemas/Amount"
          },
          "duplicate": {
            "type": "boolean"
          },
          "balance": {
            "$ref": "#/components/schemas/Balance"
          }
        }
      },
      "PayoutRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "amount"
        ],
        "properties": {
          "amount": {
            "$ref": "#/components/schemas/Amount"
          }
        }
      },
      "Payout": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "session_id",
          "amount",
          "state",
          "transaction_hashes",
          "confirmations",
          "required_confirmations",
          "error"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "session_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "amount": {
            "$ref": "#/components/schemas/Amount"
          },
          "state": {
            "type": "string",
            "enum": [
              "queued",
              "prepared",
              "broadcast",
              "confirmed",
              "failed",
              "reconciling"
            ]
          },
          "transaction_hashes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Hash32"
            }
          },
          "confirmations": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "required_confirmations": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "SessionStatus": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "session_id",
          "asset",
          "recipient",
          "balance",
          "pending_payouts"
        ],
        "properties": {
          "session_id": {
            "$ref": "#/components/schemas/Uuid"
          },
          "asset": {
            "$ref": "#/components/schemas/Asset"
          },
          "recipient": {
            "$ref": "#/components/schemas/Address"
          },
          "balance": {
            "$ref": "#/components/schemas/Balance"
          },
          "pending_payouts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Payout"
            }
          }
        }
      },
      "ApiError": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code",
          "message",
          "retry_after_seconds"
        ],
        "properties": {
          "code": {
            "type": "string",
            "enum": [
              "invalid_request",
              "invalid_proof",
              "stale_challenge",
              "duplicate_proof",
              "unauthorized_session",
              "insufficient_credit",
              "capacity_exhausted",
              "treasury_unavailable",
              "overloaded",
              "unsupported_asset",
              "unsupported_version",
              "payout_pending",
              "idempotency_conflict",
              "internal"
            ]
          },
          "message": {
            "type": "string"
          },
          "retry_after_seconds": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "ServiceStatus": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "protocol_version",
          "available",
          "message"
        ],
        "properties": {
          "protocol_version": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "available": {
            "type": "boolean"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "Health": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "status"
        ],
        "properties": {
          "status": {
            "type": "string"
          }
        }
      },
      "BuildInfo": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "version",
          "source_revision",
          "protocol_version"
        ],
        "properties": {
          "version": {
            "type": "string"
          },
          "source_revision": {
            "type": "string"
          },
          "protocol_version": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          }
        }
      }
    }
  }
}
