{ "openapi": "3.0.3", "info": { "title": "@capacity-exchange/server", "version": "2.0.0" }, "components": { "schemas": {} }, "paths": { "/": { "get": { "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "name", "version", "capacityAssets", "chains" ], "properties": { "name": { "type": "string" }, "version": { "type": "string" }, "capacityAssets": { "type": "array", "items": { "type": "string", "enum": [ "DUST", "ADA" ] } }, "chains": { "type": "object", "properties": { "midnight": { "type": "object", "required": [ "network", "nodeUrl", "indexerUrl", "indexerWsUrl", "proofServerUrl" ], "properties": { "network": { "type": "string" }, "nodeUrl": { "type": "string" }, "indexerUrl": { "type": "string" }, "indexerWsUrl": { "type": "string" }, "proofServerUrl": { "type": "string" } } } } } } } } } } } } }, "/health/": { "get": { "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "status", "uptime" ], "properties": { "status": { "type": "string", "enum": [ "ok" ] }, "uptime": { "type": "number" } } } } } } } } }, "/health/ready": { "get": { "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "status" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "syncing" ] }, { "type": "string", "enum": [ "ok" ] }, { "type": "string", "enum": [ "ko" ] } ] }, "midnight": { "type": "object", "required": [ "wallet", "indexer" ], "properties": { "wallet": { "type": "object", "required": [ "status" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "syncing" ] }, { "type": "string", "enum": [ "ok" ] }, { "type": "string", "enum": [ "ko" ] } ] }, "error": { "type": "string" } } }, "indexer": { "type": "object", "required": [ "status" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "ok" ] }, { "type": "string", "enum": [ "ko" ] } ] }, "height": { "type": "number" }, "error": { "type": "string" }, "details": { "type": "string" } } }, "chainState": { "type": "object", "required": [ "status" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "syncing" ] }, { "type": "string", "enum": [ "ok" ] }, { "type": "string", "enum": [ "ko" ] } ] }, "slot": { "type": "number" }, "tipAgeMs": { "type": "number" }, "error": { "type": "string" } } } } }, "cardano": { "type": "object", "required": [ "status" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "syncing" ] }, { "type": "string", "enum": [ "ok" ] }, { "type": "string", "enum": [ "ko" ] } ] }, "slot": { "type": "number" }, "tipAgeMs": { "type": "number" }, "error": { "type": "string" }, "walletLovelace": { "type": "string" } } } } } } } }, "500": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "status" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "syncing" ] }, { "type": "string", "enum": [ "ok" ] }, { "type": "string", "enum": [ "ko" ] } ] }, "midnight": { "type": "object", "required": [ "wallet", "indexer" ], "properties": { "wallet": { "type": "object", "required": [ "status" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "syncing" ] }, { "type": "string", "enum": [ "ok" ] }, { "type": "string", "enum": [ "ko" ] } ] }, "error": { "type": "string" } } }, "indexer": { "type": "object", "required": [ "status" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "ok" ] }, { "type": "string", "enum": [ "ko" ] } ] }, "height": { "type": "number" }, "error": { "type": "string" }, "details": { "type": "string" } } }, "chainState": { "type": "object", "required": [ "status" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "syncing" ] }, { "type": "string", "enum": [ "ok" ] }, { "type": "string", "enum": [ "ko" ] } ] }, "slot": { "type": "number" }, "tipAgeMs": { "type": "number" }, "error": { "type": "string" } } } } }, "cardano": { "type": "object", "required": [ "status" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "syncing" ] }, { "type": "string", "enum": [ "ok" ] }, { "type": "string", "enum": [ "ko" ] } ] }, "slot": { "type": "number" }, "tipAgeMs": { "type": "number" }, "error": { "type": "string" }, "walletLovelace": { "type": "string" } } } } } } } }, "503": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "status" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "syncing" ] }, { "type": "string", "enum": [ "ok" ] }, { "type": "string", "enum": [ "ko" ] } ] }, "midnight": { "type": "object", "required": [ "wallet", "indexer" ], "properties": { "wallet": { "type": "object", "required": [ "status" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "syncing" ] }, { "type": "string", "enum": [ "ok" ] }, { "type": "string", "enum": [ "ko" ] } ] }, "error": { "type": "string" } } }, "indexer": { "type": "object", "required": [ "status" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "ok" ] }, { "type": "string", "enum": [ "ko" ] } ] }, "height": { "type": "number" }, "error": { "type": "string" }, "details": { "type": "string" } } }, "chainState": { "type": "object", "required": [ "status" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "syncing" ] }, { "type": "string", "enum": [ "ok" ] }, { "type": "string", "enum": [ "ko" ] } ] }, "slot": { "type": "number" }, "tipAgeMs": { "type": "number" }, "error": { "type": "string" } } } } }, "cardano": { "type": "object", "required": [ "status" ], "properties": { "status": { "anyOf": [ { "type": "string", "enum": [ "syncing" ] }, { "type": "string", "enum": [ "ok" ] }, { "type": "string", "enum": [ "ko" ] } ] }, "slot": { "type": "number" }, "tipAgeMs": { "type": "number" }, "error": { "type": "string" }, "walletLovelace": { "type": "string" } } } } } } } } } } }, "/api/midnight/prices": { "get": { "parameters": [ { "schema": { "pattern": "^\\d+$", "type": "string" }, "in": "query", "name": "amount", "required": true } ], "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "title": "PricesResponse", "type": "object", "required": [ "quoteId", "prices" ], "properties": { "quoteId": { "type": "string" }, "prices": { "type": "array", "items": { "title": "Price", "type": "object", "required": [ "amount", "currency" ], "properties": { "amount": { "type": "string" }, "currency": { "title": "Currency", "type": "object", "required": [ "id", "type", "rawId" ], "properties": { "id": { "type": "string" }, "type": { "type": "string" }, "rawId": { "type": "string" } } } } } } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "title": "ErrorResponse", "type": "object", "required": [ "error", "message" ], "properties": { "error": { "type": "string" }, "message": { "type": "string" }, "details": { "type": "string" } } } } } }, "500": { "description": "Default Response", "content": { "application/json": { "schema": { "title": "ErrorResponse", "type": "object", "required": [ "error", "message" ], "properties": { "error": { "type": "string" }, "message": { "type": "string" }, "details": { "type": "string" } } } } } } } } }, "/api/midnight/offers": { "post": { "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "quoteId", "offerCurrency" ], "properties": { "quoteId": { "minLength": 1, "type": "string" }, "offerCurrency": { "minLength": 1, "type": "string" } } } } } }, "responses": { "201": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "offerId", "offerAmount", "offerCurrency", "serializedTx", "expiresAt" ], "properties": { "offerId": { "type": "string" }, "offerAmount": { "type": "string" }, "offerCurrency": { "title": "Currency", "type": "object", "required": [ "id", "type", "rawId" ], "properties": { "id": { "type": "string" }, "type": { "type": "string" }, "rawId": { "type": "string" } } }, "serializedTx": { "type": "string" }, "expiresAt": { "format": "date-time", "type": "string" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "title": "ErrorResponse", "type": "object", "required": [ "error", "message" ], "properties": { "error": { "type": "string" }, "message": { "type": "string" }, "details": { "type": "string" } } } } } }, "409": { "description": "Default Response", "content": { "application/json": { "schema": { "title": "ErrorResponse", "type": "object", "required": [ "error", "message" ], "properties": { "error": { "type": "string" }, "message": { "type": "string" }, "details": { "type": "string" } } } } } }, "410": { "description": "Default Response", "content": { "application/json": { "schema": { "title": "ErrorResponse", "type": "object", "required": [ "error", "message" ], "properties": { "error": { "type": "string" }, "message": { "type": "string" }, "details": { "type": "string" } } } } } }, "500": { "description": "Default Response", "content": { "application/json": { "schema": { "title": "ErrorResponse", "type": "object", "required": [ "error", "message" ], "properties": { "error": { "type": "string" }, "message": { "type": "string" }, "details": { "type": "string" } } } } } }, "501": { "description": "Default Response", "content": { "application/json": { "schema": { "title": "ErrorResponse", "type": "object", "required": [ "error", "message" ], "properties": { "error": { "type": "string" }, "message": { "type": "string" }, "details": { "type": "string" } } } } } }, "503": { "description": "Default Response", "content": { "application/json": { "schema": { "title": "ErrorResponse", "type": "object", "required": [ "error", "message" ], "properties": { "error": { "type": "string" }, "message": { "type": "string" }, "details": { "type": "string" } } } } } } } } }, "/api/midnight/ada/offers": { "post": { "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "quoteId", "offerCurrency", "utxoTxHash", "senderAddress", "expectedValue" ], "properties": { "quoteId": { "minLength": 1, "type": "string" }, "offerCurrency": { "minLength": 1, "type": "string" }, "utxoTxHash": { "minLength": 64, "maxLength": 64, "pattern": "^[0-9a-fA-F]{64}$", "description": "Cardano transaction hash (64 hex chars) containing the UTXO", "type": "string" }, "senderAddress": { "minLength": 1, "description": "Cardano address of the sender; at least one transaction input must originate from this address", "type": "string" }, "expectedValue": { "minLength": 1, "description": "The lovelace value (decimal string) the sender sends, disregarding the network fee", "type": "string" } } } } } }, "responses": { "201": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "offerId", "offerAmount", "offerCurrency", "serializedTx", "expiresAt" ], "properties": { "offerId": { "type": "string" }, "offerAmount": { "type": "string" }, "offerCurrency": { "title": "Currency", "type": "object", "required": [ "id", "type", "rawId" ], "properties": { "id": { "type": "string" }, "type": { "type": "string" }, "rawId": { "type": "string" } } }, "serializedTx": { "type": "string" }, "expiresAt": { "format": "date-time", "type": "string" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "title": "ErrorResponse", "type": "object", "required": [ "error", "message" ], "properties": { "error": { "type": "string" }, "message": { "type": "string" }, "details": { "type": "string" } } } } } }, "404": { "description": "Default Response", "content": { "application/json": { "schema": { "title": "ErrorResponse", "type": "object", "required": [ "error", "message" ], "properties": { "error": { "type": "string" }, "message": { "type": "string" }, "details": { "type": "string" } } } } } }, "409": { "description": "Default Response", "content": { "application/json": { "schema": { "title": "ErrorResponse", "type": "object", "required": [ "error", "message" ], "properties": { "error": { "type": "string" }, "message": { "type": "string" }, "details": { "type": "string" } } } } } }, "410": { "description": "Default Response", "content": { "application/json": { "schema": { "title": "ErrorResponse", "type": "object", "required": [ "error", "message" ], "properties": { "error": { "type": "string" }, "message": { "type": "string" }, "details": { "type": "string" } } } } } }, "500": { "description": "Default Response", "content": { "application/json": { "schema": { "title": "ErrorResponse", "type": "object", "required": [ "error", "message" ], "properties": { "error": { "type": "string" }, "message": { "type": "string" }, "details": { "type": "string" } } } } } }, "501": { "description": "Default Response", "content": { "application/json": { "schema": { "title": "ErrorResponse", "type": "object", "required": [ "error", "message" ], "properties": { "error": { "type": "string" }, "message": { "type": "string" }, "details": { "type": "string" } } } } } }, "503": { "description": "Default Response", "content": { "application/json": { "schema": { "title": "ErrorResponse", "type": "object", "required": [ "error", "message" ], "properties": { "error": { "type": "string" }, "message": { "type": "string" }, "details": { "type": "string" } } } } } } } } }, "/api/cardano/offers": { "post": { "requestBody": { "required": true, "content": { "application/cbor": { "schema": { "type": "string", "format": "binary", "description": "CBOR-encoded offer envelope" } } }, "description": "CBOR-encoded offer envelope" }, "responses": { "202": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "offerId" ], "properties": { "offerId": { "type": "string" } } } } } }, "400": { "description": "Default Response", "content": { "application/json": { "schema": { "title": "ErrorResponse", "type": "object", "required": [ "error", "message" ], "properties": { "error": { "type": "string" }, "message": { "type": "string" }, "details": { "type": "string" } } } } } }, "500": { "description": "Default Response", "content": { "application/json": { "schema": { "title": "ErrorResponse", "type": "object", "required": [ "error", "message" ], "properties": { "error": { "type": "string" }, "message": { "type": "string" }, "details": { "type": "string" } } } } } }, "503": { "description": "Default Response", "content": { "application/json": { "schema": { "title": "ErrorResponse", "type": "object", "required": [ "error", "message" ], "properties": { "error": { "type": "string" }, "message": { "type": "string" }, "details": { "type": "string" } } } } } } } } }, "/api/cardano/hints": { "get": { "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "title": "CardanoHintsResponse", "type": "array", "items": { "pattern": "^[0-9a-f]+$", "description": "A CIP-0198 signed `hints` set, CBOR as lowercase hex", "type": "string" } } } } }, "501": { "description": "Default Response", "content": { "application/json": { "schema": { "title": "ErrorResponse", "type": "object", "required": [ "error", "message" ], "properties": { "error": { "type": "string" }, "message": { "type": "string" }, "details": { "type": "string" } } } } } } } } }, "/api/midnight/sponsor": { "post": { "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "provenTx" ], "properties": { "provenTx": { "minLength": 1, "pattern": "^[0-9a-fA-F]+$", "type": "string" } } } } } }, "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "tx" ], "properties": { "tx": { "type": "string" } } } } } }, "422": { "description": "Default Response", "content": { "application/json": { "schema": { "title": "ErrorResponse", "type": "object", "required": [ "error", "message" ], "properties": { "error": { "type": "string" }, "message": { "type": "string" }, "details": { "type": "string" } } } } } }, "500": { "description": "Default Response", "content": { "application/json": { "schema": { "title": "ErrorResponse", "type": "object", "required": [ "error", "message" ], "properties": { "error": { "type": "string" }, "message": { "type": "string" }, "details": { "type": "string" } } } } } }, "501": { "description": "Default Response", "content": { "application/json": { "schema": { "title": "ErrorResponse", "type": "object", "required": [ "error", "message" ], "properties": { "error": { "type": "string" }, "message": { "type": "string" }, "details": { "type": "string" } } } } } }, "503": { "description": "Default Response", "content": { "application/json": { "schema": { "title": "ErrorResponse", "type": "object", "required": [ "error", "message" ], "properties": { "error": { "type": "string" }, "message": { "type": "string" }, "details": { "type": "string" } } } } } } } } }, "/api/metrics": { "get": { "responses": { "200": { "description": "Default Response", "content": { "application/json": { "schema": { "type": "object", "required": [ "server", "capacity", "revenue" ], "properties": { "server": { "type": "object", "required": [ "name", "version", "uptime" ], "properties": { "name": { "type": "string" }, "version": { "type": "string" }, "uptime": { "type": "number" } } }, "capacity": { "type": "array", "items": { "type": "object", "required": [ "asset", "available", "consumedTotal", "consumedLastHour", "locksLastHour", "contention" ], "properties": { "asset": { "type": "string", "enum": [ "DUST", "ADA" ] }, "available": { "type": "string" }, "consumedTotal": { "type": "string" }, "consumedLastHour": { "type": "string" }, "locksLastHour": { "type": "number" }, "contention": { "type": "object", "required": [ "lockedUtxos", "totalUtxos", "lockedAmount", "ratio", "averageRatioLastHour" ], "properties": { "lockedUtxos": { "type": "number" }, "totalUtxos": { "type": "number" }, "lockedAmount": { "type": "string" }, "ratio": { "type": "number" }, "averageRatioLastHour": { "type": "number" } } } } } }, "revenue": { "type": "object", "required": [ "byCurrency" ], "properties": { "byCurrency": { "type": "object", "additionalProperties": { "type": "string" } } } } } } } } } } } } } }