{
  "openapi": "3.0.3",
  "info": {
    "title": "IntentBook API",
    "version": "1.0.0",
    "license": { "name": "Apache-2.0" },
    "description": "Public book API. Dry-run does not call execute_intents. Writes that move funds require a signed intent and the live gate."
  },
  "servers": [{ "url": "http://127.0.0.1:43123" }],
  "paths": {
    "/api/v1/book": { "get": { "summary": "Order book", "parameters": [{ "name": "pair", "in": "query", "schema": { "type": "string" } }] } },
    "/api/v1/depth": { "get": { "summary": "Aggregated depth", "parameters": [{ "name": "pair", "in": "query", "schema": { "type": "string" } }, { "name": "group", "in": "query", "schema": { "type": "string" } }] } },
    "/api/v1/candles": { "get": { "summary": "Candles 1m, 5m, 1h, 1d" } },
    "/api/v1/trades": { "get": { "summary": "Recent fills" } },
    "/api/v1/ticker": { "get": { "summary": "Mids for every pair" } },
    "/api/v1/compare": { "get": { "summary": "IntentBook book price versus 1Click" } },
    "/api/v1/quote/best": { "get": { "summary": "Best price across the book, 1Click, and Rhea" } },
    "/api/v1/accounts/{account}": { "get": { "summary": "Orders, fills, and balances" } },
    "/api/v1/orders/preview": { "post": { "summary": "Build an unsigned order. Optional standard: nep413 (default), raw_ed25519 for implicit accounts. EVM accounts always get erc191." } },
    "/api/v1/orders": { "post": { "summary": "Place a signed order. Named NEAR accounts must sign with a full-access key or a key registered on intents.near." } },
    "/api/v1/orders/cancel-preview": { "post": { "summary": "Build the cancel message the order owner signs. Body: id, account, optional standard." } },
    "/api/v1/orders/cancel": { "post": { "summary": "Cancel with { signed }: the owner's signature over the cancel-preview message. Unsigned cancels are refused." } },
    "/api/v1/orders/burn-preview": { "post": { "summary": "Build an empty intent that reuses the order nonce, for an on-chain nonce burn." } },
    "/api/v1/orders/burn": { "post": { "summary": "Simulate the signed nonce burn. Broadcast only in live mode." } },
    "/api/v1/withdraw/preview": { "post": { "summary": "Build an unsigned ft_withdraw." } },
    "/api/v1/withdraw": { "post": { "summary": "Simulate one signed ft_withdraw. Broadcast only in live mode and under the 50 USDC cap." } },
    "/api/v1/webhooks/preview": { "post": { "summary": "Build the registration message the account owner signs. Body: account, url." } },
    "/api/v1/webhooks": { "post": { "summary": "Register an HMAC webhook with { account, url, signed }. Production accepts only https URLs on public hosts." } },
    "/api/v1/stream": { "get": { "summary": "Server-sent book, trade, and ticker events" } },
    "/api/v1/ws": { "get": { "summary": "WebSocket upgrade on the same HTTP port. Query pair=BTC-USDC." } },
    "/api/v1/referrers": { "get": { "summary": "Referrer share of taker fees" } }
  }
}
