{ "openapi": "3.1.0", "info": { "title": "AITBC Wallet Daemon", "version": "0.1.0" }, "paths": { "/v1/receipts/{job_id}": { "get": { "tags": [ "wallets", "receipts" ], "summary": "Verify latest receipt for a job", "operationId": "verify_latest_receipt_v1_receipts__job_id__get", "parameters": [ { "name": "job_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Job Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ReceiptVerifyResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "404": { "description": "receipt not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/v1/receipts/{job_id}/history": { "get": { "tags": [ "wallets", "receipts" ], "summary": "Verify all historical receipts for a job", "operationId": "verify_receipt_history_v1_receipts__job_id__history_get", "parameters": [ { "name": "job_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Job Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ReceiptVerificationListResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/v1/wallets": { "get": { "tags": [ "wallets", "receipts" ], "summary": "List wallets", "operationId": "list_wallets_v1_wallets_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WalletListResponse" } } } } } }, "post": { "tags": [ "wallets", "receipts" ], "summary": "Create wallet", "operationId": "create_wallet_v1_wallets_post", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WalletCreateRequest" } } }, "required": true }, "responses": { "201": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WalletCreateResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "400": { "description": "invalid base64 secret", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/v1/wallets/{wallet_id}/balance": { "get": { "tags": [ "wallets", "receipts" ], "summary": "Get wallet balance from blockchain", "operationId": "get_wallet_balance_v1_wallets__wallet_id__balance_get", "parameters": [ { "name": "wallet_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Wallet Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": true, "title": "Response Get Wallet Balance V1 Wallets Wallet Id Balance Get" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "404": { "description": "Wallet not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/v1/wallets/{wallet_id}/unlock": { "post": { "tags": [ "wallets", "receipts" ], "summary": "Unlock wallet", "operationId": "unlock_wallet_v1_wallets__wallet_id__unlock_post", "parameters": [ { "name": "wallet_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Wallet Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WalletUnlockRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WalletUnlockResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "401": { "description": "invalid credentials", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/v1/wallets/{wallet_id}/sign": { "post": { "tags": [ "wallets", "receipts" ], "summary": "Sign payload", "operationId": "sign_payload_v1_wallets__wallet_id__sign_post", "parameters": [ { "name": "wallet_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Wallet Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WalletSignRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WalletSignResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "400": { "description": "invalid base64 message", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "401": { "description": "invalid credentials", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/v1/wallets/{wallet_id}/send": { "post": { "tags": [ "wallets", "receipts" ], "summary": "Send transaction", "description": "Sign and submit a transaction to the blockchain.\n\nThis endpoint creates, signs, and broadcasts a real transaction\nusing the wallet's private key.", "operationId": "send_transaction_v1_wallets__wallet_id__send_post", "parameters": [ { "name": "wallet_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Wallet Id" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WalletTransactionRequest" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WalletTransactionResponse" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "400": { "description": "Idempotency-Key header is required for POST /wallets/{id}/send", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "409": { "description": "Idempotency-Key was already used with a different request / A previous attempt with this Idempotency-Key did not complete and its outcome is unknown; check wallet history or resolve it before retrying / A request with this Idempotency-Key is already in progress", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "500": { "description": "Internal error - see server logs", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/v1/rpc": { "post": { "tags": [ "jsonrpc" ], "summary": "JSON-RPC endpoint", "operationId": "handle_jsonrpc_v1_rpc_post", "requestBody": { "content": { "application/json": { "schema": { "additionalProperties": true, "type": "object", "title": "Request" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "additionalProperties": true, "type": "object", "title": "Response Handle Jsonrpc V1 Rpc Post" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/v1/exchange/price": { "get": { "tags": [ "exchange" ], "summary": "Get Price", "description": "Get current ETH-AIT exchange rate.", "operationId": "get_price_v1_exchange_price_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "additionalProperties": true, "type": "object", "title": "Response Get Price V1 Exchange Price Get" } } } }, "503": { "description": "Service Unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/v1/exchange/deposits": { "get": { "tags": [ "exchange" ], "summary": "List Deposits", "description": "List ETH deposits.\n\nQuery parameters:\n- status: Filter by status (pending, verified, completed, exchange_prepay, rejected, failed)\n- limit: Maximum number of results (default: 50)\n- offset: Pagination offset (default: 0)", "operationId": "list_deposits_v1_exchange_deposits_get", "parameters": [ { "name": "status", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Status" } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "default": 50, "title": "Limit" } }, { "name": "offset", "in": "query", "required": false, "schema": { "type": "integer", "default": 0, "title": "Offset" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": true, "title": "Response List Deposits V1 Exchange Deposits Get" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/v1/exchange/deposits/{deposit_id}": { "get": { "tags": [ "exchange" ], "summary": "Get Deposit", "description": "Get a specific deposit by ID.", "operationId": "get_deposit_v1_exchange_deposits__deposit_id__get", "parameters": [ { "name": "deposit_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Deposit Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": true, "title": "Response Get Deposit V1 Exchange Deposits Deposit Id Get" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "404": { "description": "Deposit not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/v1/exchange/deposits/{deposit_id}/verify": { "post": { "tags": [ "exchange" ], "summary": "Verify Deposit", "description": "Verify a deposit (admin operation).", "operationId": "verify_deposit_v1_exchange_deposits__deposit_id__verify_post", "parameters": [ { "name": "deposit_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Deposit Id" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": true, "title": "Response Verify Deposit V1 Exchange Deposits Deposit Id Verify Post" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "400": { "description": "Deposit already {deposit['status']}", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "404": { "description": "Deposit not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "500": { "description": "Failed to update deposit status", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/v1/exchange/deposits/{deposit_id}/complete": { "post": { "tags": [ "exchange" ], "summary": "Complete Deposit", "description": "Mark a deposit as completed after AIT minting (admin operation).\n\nAn optional ``{\"tx_hash\": \"0x\u2026\"}`` body records the AIT transfer hash on\nthe row (#2550) \u2014 the CLI has always sent it and the endpoint used to\ndrop it, leaving ``ait_tx_hash`` NULL forever.", "operationId": "complete_deposit_v1_exchange_deposits__deposit_id__complete_post", "parameters": [ { "name": "deposit_id", "in": "path", "required": true, "schema": { "type": "string", "title": "Deposit Id" } } ], "requestBody": { "content": { "application/json": { "schema": { "anyOf": [ { "type": "object", "additionalProperties": true }, { "type": "null" } ], "title": "Body" } } } }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": true, "title": "Response Complete Deposit V1 Exchange Deposits Deposit Id Complete Post" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "400": { "description": "Deposit must be verified first / tx_hash must be a 0x-prefixed 32-byte hex hash", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "404": { "description": "Deposit not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "500": { "description": "Failed to update deposit status", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/v1/exchange/calculate": { "get": { "tags": [ "exchange" ], "summary": "Calculate Exchange", "description": "Calculate AIT amount for a given ETH amount.\n\nQuery parameters:\n- eth_amount: Amount of ETH to convert", "operationId": "calculate_exchange_v1_exchange_calculate_get", "parameters": [ { "name": "eth_amount", "in": "query", "required": true, "schema": { "anyOf": [ { "type": "number" }, { "type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$" } ], "title": "Eth Amount" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": true, "title": "Response Calculate Exchange V1 Exchange Calculate Get" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "400": { "description": "ETH amount must be positive", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "503": { "description": "Failed to calculate exchange rate", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/v1/exchange/history": { "get": { "tags": [ "exchange" ], "summary": "Get Price History", "description": "Get price history and all-time averages.", "operationId": "get_price_history_v1_exchange_history_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "additionalProperties": true, "type": "object", "title": "Response Get Price History V1 Exchange History Get" } } } } } } }, "/v1/exchange/status": { "get": { "tags": [ "exchange" ], "summary": "Get Bridge Status", "description": "Get bridge service status.", "operationId": "get_bridge_status_v1_exchange_status_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "additionalProperties": true, "type": "object", "title": "Response Get Bridge Status V1 Exchange Status Get" } } } } } } }, "/v1/bridge/status": { "get": { "tags": [ "bridge" ], "summary": "Get Bridge V1 Status", "description": "Get bridge service status.", "operationId": "get_bridge_v1_status_v1_bridge_status_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "additionalProperties": true, "type": "object", "title": "Response Get Bridge V1 Status V1 Bridge Status Get" } } } } } } }, "/v1/bridge/poll-request": { "post": { "tags": [ "bridge" ], "summary": "Bridge Request Poll", "description": "Public kick: ask the bridge monitor to poll ETH now.\n\nLets the website's \"Check Status\" button drive the deposit poller on\ndemand \u2014 the monitor runs a ~3-poll burst over 60s rather than this\nrequest blocking. Rate-limited per client IP; unlike POST /poll (the\nin-wallet scanner, admin-only) this triggers the crediting monitor.", "operationId": "bridge_request_poll_v1_bridge_poll_request_post", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "additionalProperties": true, "type": "object", "title": "Response Bridge Request Poll V1 Bridge Poll Request Post" } } } } } } }, "/v1/bridge/poll": { "post": { "tags": [ "bridge" ], "summary": "Trigger Bridge Poll", "description": "Manually trigger one bridge poll cycle (admin operation).", "operationId": "trigger_bridge_poll_v1_bridge_poll_post", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "additionalProperties": true, "type": "object", "title": "Response Trigger Bridge Poll V1 Bridge Poll Post" } } } }, "503": { "description": "Bridge poll skipped", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/v1/bridge/polling": { "post": { "tags": [ "bridge" ], "summary": "Set Bridge Polling", "description": "Enable or disable the automatic bridge polling loop (admin operation).", "operationId": "set_bridge_polling_v1_bridge_polling_post", "requestBody": { "content": { "application/json": { "schema": { "additionalProperties": true, "type": "object", "title": "Body" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "additionalProperties": true, "type": "object", "title": "Response Set Bridge Polling V1 Bridge Polling Post" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/v1/bridge/price": { "get": { "tags": [ "bridge" ], "summary": "Get Bridge Price", "description": "Get bridge exchange price.", "operationId": "get_bridge_price_v1_bridge_price_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "additionalProperties": true, "type": "object", "title": "Response Get Bridge Price V1 Bridge Price Get" } } } }, "503": { "description": "Service Unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/v1/bridge/deposit": { "post": { "tags": [ "bridge" ], "summary": "Bridge Deposit", "description": "Calculate bridge deposit instructions and estimate.", "operationId": "bridge_deposit_v1_bridge_deposit_post", "requestBody": { "content": { "application/json": { "schema": { "additionalProperties": true, "type": "object", "title": "Body" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "additionalProperties": true, "type": "object", "title": "Response Bridge Deposit V1 Bridge Deposit Post" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "400": { "description": "eth_amount must be a number / eth_amount must be positive / ait_address is required / Invalid ait_address: {exc} / \u2026", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "503": { "description": "Bridge ETH address not configured / Failed to calculate AIT amount", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/v1/bridge/deposits": { "get": { "tags": [ "bridge" ], "summary": "Bridge List Deposits", "description": "List bridge deposits.", "operationId": "bridge_list_deposits_v1_bridge_deposits_get", "parameters": [ { "name": "status", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Status" } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "default": 50, "title": "Limit" } }, { "name": "offset", "in": "query", "required": false, "schema": { "type": "integer", "default": 0, "title": "Offset" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": true, "title": "Response Bridge List Deposits V1 Bridge Deposits Get" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/v1/bridge/deposit/{tx_hash}": { "get": { "tags": [ "bridge" ], "summary": "Bridge Get Deposit", "description": "Get a single bridge deposit by ETH transaction hash.", "operationId": "bridge_get_deposit_v1_bridge_deposit__tx_hash__get", "parameters": [ { "name": "tx_hash", "in": "path", "required": true, "schema": { "type": "string", "title": "Tx Hash" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": true, "title": "Response Bridge Get Deposit V1 Bridge Deposit Tx Hash Get" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "404": { "description": "Deposit not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/v1/bridge/deposit/by-recipient/{address}": { "get": { "tags": [ "bridge" ], "summary": "Bridge Deposits By Recipient", "description": "Get recent bridge deposits for a single AIT recipient address.\n\nNon-enumerable: the caller must already know the recipient, matching the\nprivacy profile of the public per-tx-hash lookup. The enumerable\n/v1/bridge/deposits index stays loopback-only in nginx.", "operationId": "bridge_deposits_by_recipient_v1_bridge_deposit_by_recipient__address__get", "parameters": [ { "name": "address", "in": "path", "required": true, "schema": { "type": "string", "title": "Address" } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "default": 10, "title": "Limit" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": true, "title": "Response Bridge Deposits By Recipient V1 Bridge Deposit By Recipient Address Get" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/v1/bridge/estimate": { "get": { "tags": [ "bridge" ], "summary": "Bridge Estimate", "description": "Estimate AIT for a given ETH amount.", "operationId": "bridge_estimate_v1_bridge_estimate_get", "parameters": [ { "name": "eth_amount", "in": "query", "required": true, "schema": { "anyOf": [ { "type": "number" }, { "type": "string", "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$" } ], "title": "Eth Amount" } }, { "name": "ait_address", "in": "query", "required": true, "schema": { "type": "string", "title": "Ait Address" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": true, "title": "Response Bridge Estimate V1 Bridge Estimate Get" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "400": { "description": "eth_amount must be positive / ait_address is required / Invalid ait_address: {exc}", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "503": { "description": "Failed to calculate AIT amount", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/v1/bridge/withdraw/estimate": { "post": { "tags": [ "bridge" ], "summary": "Bridge Withdraw Estimate", "description": "Estimate the ETH amount for a given AIT withdrawal.", "operationId": "bridge_withdraw_estimate_v1_bridge_withdraw_estimate_post", "requestBody": { "content": { "application/json": { "schema": { "additionalProperties": true, "type": "object", "title": "Body" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "additionalProperties": true, "type": "object", "title": "Response Bridge Withdraw Estimate V1 Bridge Withdraw Estimate Post" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "400": { "description": "ait_amount must be a number / ait_amount must be positive / eth_address is required / Invalid eth_address: {exc} / \u2026", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "503": { "description": "Failed to calculate ETH amount", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/v1/bridge/withdraw/build": { "post": { "tags": [ "bridge" ], "summary": "Bridge Withdraw Build", "description": "Build an unsigned BRIDGE_WITHDRAW transaction for the caller to sign.", "operationId": "bridge_withdraw_build_v1_bridge_withdraw_build_post", "requestBody": { "content": { "application/json": { "schema": { "additionalProperties": true, "type": "object", "title": "Body" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "additionalProperties": true, "type": "object", "title": "Response Bridge Withdraw Build V1 Bridge Withdraw Build Post" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "400": { "description": "ait_amount must be a number / ait_amount must be positive / eth_address is required / Invalid eth_address: {exc} / \u2026", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "503": { "description": "Failed to calculate ETH amount / Chain id is not configured / Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/v1/bridge/withdraw/submit": { "post": { "tags": [ "bridge" ], "summary": "Bridge Withdraw Submit", "description": "Relay a signed BRIDGE_WITHDRAW transaction to the AITBC blockchain.", "operationId": "bridge_withdraw_submit_v1_bridge_withdraw_submit_post", "requestBody": { "content": { "application/json": { "schema": { "additionalProperties": true, "type": "object", "title": "Body" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "additionalProperties": true, "type": "object", "title": "Response Bridge Withdraw Submit V1 Bridge Withdraw Submit Post" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "400": { "description": "signed_tx is required / signed_tx must be a BRIDGE_WITHDRAW transaction / Failed to submit transaction: {exc}", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/v1/bridge/withdraw/{ait_tx_hash}": { "get": { "tags": [ "bridge" ], "summary": "Bridge Get Withdraw", "description": "Get the status of an AIT->ETH withdrawal.", "operationId": "bridge_get_withdraw_v1_bridge_withdraw__ait_tx_hash__get", "parameters": [ { "name": "ait_tx_hash", "in": "path", "required": true, "schema": { "type": "string", "title": "Ait Tx Hash" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": true, "title": "Response Bridge Get Withdraw V1 Bridge Withdraw Ait Tx Hash Get" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "404": { "description": "Withdrawal not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/v1/bridge/withdrawals": { "get": { "tags": [ "bridge" ], "summary": "Bridge List Withdrawals", "description": "List AIT->ETH withdrawals.", "operationId": "bridge_list_withdrawals_v1_bridge_withdrawals_get", "parameters": [ { "name": "status", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Status" } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "default": 50, "title": "Limit" } }, { "name": "offset", "in": "query", "required": false, "schema": { "type": "integer", "default": 0, "title": "Offset" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": true, "title": "Response Bridge List Withdrawals V1 Bridge Withdrawals Get" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/v1/bridge/sell/quote": { "post": { "tags": [ "bridge" ], "summary": "Bridge Sell Quote", "description": "Issue a quote for selling AIT for ETH via the hub escrow.", "operationId": "bridge_sell_quote_v1_bridge_sell_quote_post", "requestBody": { "content": { "application/json": { "schema": { "additionalProperties": true, "type": "object", "title": "Body" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "additionalProperties": true, "type": "object", "title": "Response Bridge Sell Quote V1 Bridge Sell Quote Post" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "400": { "description": "ait_amount must be a number / ait_amount must be positive / Minimum sell is {min_sell} AIT / eth_address is required / \u2026", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "429": { "description": "Too many open sell quotes for this shop (max {max_open}) \u2014 let one expire or lock first / Quote rate limit: wait {int(min_interval - waited) + 1}s between quotes", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "503": { "description": "Sell escrow disabled / Price feed unavailable or stale", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/v1/bridge/sell/status/{identifier}": { "get": { "tags": [ "bridge" ], "summary": "Bridge Sell Status", "description": "Sell status by quote id, lock id, or lock transaction hash.", "operationId": "bridge_sell_status_v1_bridge_sell_status__identifier__get", "parameters": [ { "name": "identifier", "in": "path", "required": true, "schema": { "type": "string", "title": "Identifier" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": true, "title": "Response Bridge Sell Status V1 Bridge Sell Status Identifier Get" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "404": { "description": "Sell quote or lock not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/v1/bridge/sell/list": { "get": { "tags": [ "bridge" ], "summary": "Bridge Sell List", "description": "List sell quotes and locks.\n\nAdmin-keyed like /settlements: the enumerable index carries every\nshop's AIT and ETH payout addresses \u2014 participant data, not a public\nboard (#1458). The nginx edge injects X-API-Key for this route so\nremote operator callers stay keyless.", "operationId": "bridge_sell_list_v1_bridge_sell_list_get", "parameters": [ { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "default": 50, "title": "Limit" } }, { "name": "offset", "in": "query", "required": false, "schema": { "type": "integer", "default": 0, "title": "Offset" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": true, "title": "Response Bridge Sell List V1 Bridge Sell List Get" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } } }, "/v1/bridge/settlements": { "get": { "tags": [ "bridge" ], "summary": "Bridge Settlements", "description": "List exchange-settlement ledger rows (CLI-1).\n\nAdmin-keyed like sell/quote: the /v1/bridge mount is publicly exposed on\nhub and settlement rows carry diagnostic error text plus release\nnonces/hashes \u2014 not a participants board. Flag-off the table is empty and\nthe route returns [].", "operationId": "bridge_settlements_v1_bridge_settlements_get", "parameters": [ { "name": "status", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Status" } }, { "name": "kind", "in": "query", "required": false, "schema": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Kind" } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "default": 50, "title": "Limit" } }, { "name": "offset", "in": "query", "required": false, "schema": { "type": "integer", "default": 0, "title": "Offset" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": true, "title": "Response Bridge Settlements V1 Bridge Settlements Get" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } }, "400": { "description": "kind must be 'trade' or 'order_refund'", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/v1/bridge/float": { "get": { "tags": [ "bridge" ], "summary": "Bridge Float", "description": "Bridge ETH float: wallet balance, pending reserve, and release\nwindows (CLI-5). Read-only \u2014 the balance is an eth_getBalance call on\nthe configured RPC; ledger figures come from the same reserve/committed\nhelpers the monitors use.\n\nAdmin-keyed like /settlements: reserve and committed totals reveal the\nbridge's in-flight payment book. ``windows.today`` starts at UTC\nmidnight; each window reports ``since`` with the host's zone name in\n``timezone``. ``windows.last_24h`` is the rolling 24h window the sell\nday-cap itself uses. Ledger stamps are aware UTC (#1575); pre-#1575\nnaive host-local rows can skew a window boundary by the host's UTC\noffset \u2014 bounded and documented.", "operationId": "bridge_float_v1_bridge_float_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "additionalProperties": true, "type": "object", "title": "Response Bridge Float V1 Bridge Float Get" } } } } } } }, "/v1/bridge/sell/config-status": { "get": { "tags": [ "bridge" ], "summary": "Bridge Sell Config Status", "description": "Sell-lane enablement + non-secret config (CLI-5).\n\nThe sell lane's enabled/disabled state readable without journald \u2014\nsell_status_document() carries the fail-closed (enabled, reason) pair\nand redacts key slots to configured booleans. Admin-keyed: config\ninternals are operator information, not a participants board.", "operationId": "bridge_sell_config_status_v1_bridge_sell_config_status_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "additionalProperties": true, "type": "object", "title": "Response Bridge Sell Config Status V1 Bridge Sell Config Status Get" } } } } } } }, "/exchange/price.json": { "get": { "tags": [ "exchange" ], "summary": "Exchange Price Json", "description": "Price ticker JSON used by the website.", "operationId": "exchange_price_json_exchange_price_json_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "additionalProperties": true, "type": "object", "title": "Response Exchange Price Json Exchange Price Json Get" } } } } } } }, "/health": { "get": { "summary": "Health Check", "operationId": "health_check_health_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "additionalProperties": { "type": "string" }, "type": "object", "title": "Response Health Check Health Get" } } } } } } }, "/ready": { "get": { "summary": "Ready Check", "description": "Readiness probe \u2014 503 while an enabled required feature is unavailable.\n\nRequired: the keystore, wallet ledger and operation-ledger databases\n(all local sqlite, proving the data dir is writable and queryable) and\nthe blockchain RPC the send/balance routes broadcast through. The\ncoordinator URL is deliberately absent \u2014 it only serves receipt\nverification, which is not part of the wallet's required surface.", "operationId": "ready_check_ready_get", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": {} } } }, "503": { "description": "readiness check failed", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "title": "Error" }, "failed": { "title": "Failed" }, "service": { "title": "Service" }, "status": { "title": "Status" } } } } } } } } } }, "components": { "schemas": { "HTTPValidationError": { "properties": { "detail": { "items": { "$ref": "#/components/schemas/ValidationError" }, "type": "array", "title": "Detail" } }, "type": "object", "title": "HTTPValidationError" }, "ReceiptVerificationListResponse": { "properties": { "items": { "items": { "$ref": "#/components/schemas/ReceiptVerificationModel" }, "type": "array", "title": "Items" } }, "type": "object", "required": [ "items" ], "title": "ReceiptVerificationListResponse" }, "ReceiptVerificationModel": { "properties": { "job_id": { "type": "string", "title": "Job Id" }, "receipt_id": { "type": "string", "title": "Receipt Id" }, "miner_signature": { "$ref": "#/components/schemas/SignatureValidationModel" }, "coordinator_attestations": { "items": { "$ref": "#/components/schemas/SignatureValidationModel" }, "type": "array", "title": "Coordinator Attestations" }, "all_valid": { "type": "boolean", "title": "All Valid" } }, "type": "object", "required": [ "job_id", "receipt_id", "miner_signature", "coordinator_attestations", "all_valid" ], "title": "ReceiptVerificationModel" }, "ReceiptVerifyResponse": { "properties": { "result": { "$ref": "#/components/schemas/ReceiptVerificationModel" } }, "type": "object", "required": [ "result" ], "title": "ReceiptVerifyResponse" }, "SignatureValidationModel": { "properties": { "key_id": { "type": "string", "title": "Key Id" }, "alg": { "type": "string", "title": "Alg", "default": "Ed25519" }, "valid": { "type": "boolean", "title": "Valid" } }, "type": "object", "required": [ "key_id", "valid" ], "title": "SignatureValidationModel" }, "ValidationError": { "properties": { "loc": { "items": { "anyOf": [ { "type": "string" }, { "type": "integer" } ] }, "type": "array", "title": "Location" }, "msg": { "type": "string", "title": "Message" }, "type": { "type": "string", "title": "Error Type" }, "input": { "title": "Input" }, "ctx": { "type": "object", "title": "Context" } }, "type": "object", "required": [ "loc", "msg", "type" ], "title": "ValidationError" }, "WalletCreateRequest": { "properties": { "chain_id": { "type": "string", "maxLength": 128, "title": "Chain Id" }, "wallet_id": { "type": "string", "maxLength": 256, "title": "Wallet Id" }, "password": { "type": "string", "maxLength": 1024, "title": "Password" }, "metadata": { "additionalProperties": true, "type": "object", "maxProperties": 64, "title": "Metadata" }, "secret_key": { "anyOf": [ { "type": "string", "maxLength": 256 }, { "type": "null" } ], "title": "Secret Key" } }, "type": "object", "required": [ "chain_id", "wallet_id", "password" ], "title": "WalletCreateRequest" }, "WalletCreateResponse": { "properties": { "wallet": { "$ref": "#/components/schemas/WalletDescriptor" } }, "type": "object", "required": [ "wallet" ], "title": "WalletCreateResponse" }, "WalletDescriptor": { "properties": { "wallet_id": { "type": "string", "title": "Wallet Id" }, "chain_id": { "type": "string", "title": "Chain Id" }, "public_key": { "type": "string", "title": "Public Key" }, "address": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Address" }, "metadata": { "additionalProperties": true, "type": "object", "title": "Metadata" } }, "type": "object", "required": [ "wallet_id", "chain_id", "public_key", "address", "metadata" ], "title": "WalletDescriptor" }, "WalletListResponse": { "properties": { "items": { "items": { "$ref": "#/components/schemas/WalletDescriptor" }, "type": "array", "title": "Items" } }, "type": "object", "required": [ "items" ], "title": "WalletListResponse" }, "WalletSignRequest": { "properties": { "password": { "type": "string", "maxLength": 1024, "title": "Password" }, "message_base64": { "type": "string", "maxLength": 87384, "title": "Message Base64" } }, "type": "object", "required": [ "password", "message_base64" ], "title": "WalletSignRequest" }, "WalletSignResponse": { "properties": { "wallet_id": { "type": "string", "title": "Wallet Id" }, "chain_id": { "type": "string", "title": "Chain Id" }, "signature_base64": { "type": "string", "title": "Signature Base64" } }, "type": "object", "required": [ "wallet_id", "chain_id", "signature_base64" ], "title": "WalletSignResponse" }, "WalletTransactionRequest": { "properties": { "password": { "type": "string", "maxLength": 1024, "title": "Password" }, "recipient": { "type": "string", "maxLength": 128, "title": "Recipient" }, "amount": { "type": "integer", "title": "Amount" }, "fee": { "type": "integer", "title": "Fee", "default": 36 }, "nonce": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "title": "Nonce" }, "chain_id": { "anyOf": [ { "type": "string", "maxLength": 128 }, { "type": "null" } ], "title": "Chain Id" }, "payload": { "anyOf": [ { "additionalProperties": true, "type": "object", "maxProperties": 64 }, { "type": "null" } ], "title": "Payload" } }, "type": "object", "required": [ "password", "recipient", "amount" ], "title": "WalletTransactionRequest", "description": "Request to send a transaction from a wallet" }, "WalletTransactionResponse": { "properties": { "success": { "type": "boolean", "title": "Success" }, "tx_hash": { "type": "string", "title": "Tx Hash" }, "status": { "type": "string", "title": "Status" }, "sender": { "type": "string", "title": "Sender" }, "recipient": { "type": "string", "title": "Recipient" }, "amount": { "type": "integer", "title": "Amount" }, "fee": { "type": "integer", "title": "Fee" }, "nonce": { "type": "integer", "title": "Nonce" } }, "type": "object", "required": [ "success", "tx_hash", "status", "sender", "recipient", "amount", "fee", "nonce" ], "title": "WalletTransactionResponse", "description": "Response after submitting a transaction" }, "WalletUnlockRequest": { "properties": { "password": { "type": "string", "maxLength": 1024, "title": "Password" } }, "type": "object", "required": [ "password" ], "title": "WalletUnlockRequest" }, "WalletUnlockResponse": { "properties": { "wallet_id": { "type": "string", "title": "Wallet Id" }, "chain_id": { "type": "string", "title": "Chain Id" }, "unlocked": { "type": "boolean", "title": "Unlocked" } }, "type": "object", "required": [ "wallet_id", "chain_id", "unlocked" ], "title": "WalletUnlockResponse" }, "ErrorResponse": { "title": "ErrorResponse", "type": "object", "properties": { "detail": { "type": "string", "title": "Detail" } }, "required": [ "detail" ], "description": "Raised as `HTTPException`; FastAPI serialises it under `detail`." } } } }