Build on the book
One book. Every app.
Wallets, apps and AI agents share the same public book. Reads need no key. Every write that acts for an account is a signature the server checks, and settlement is a NEAR Intents batch, never a custodial transfer.
REST + OpenAPI
Versioned under /api/v1 with CORS open for reads. The machine-readable spec is at /openapi.json and a small TypeScript client lives in packages/sdk.
Live streams
Server-sent events at /api/v1/stream and a WebSocket at /api/v1/ws on the same port. Fills also go out as HMAC-signed webhooks with retries.
Embed and earn
Drop one script tag into any site. The embedding app's referrer id is stored with each fill and earns half of the taker fee.
Quickstart
shell
curl https://intentbook.up.railway.app/api/v1/book?pair=BTC-USDC curl https://intentbook.up.railway.app/api/v1/trades?pair=BTC-USDC curl "https://intentbook.up.railway.app/api/v1/quote/best?pair=NEAR-USDC&side=BUY&qty=2" curl https://intentbook.up.railway.app/openapi.json
Embed
html
<script src="https://intentbook.up.railway.app/widget.js" data-referrer="your-app" data-origin="https://intentbook.up.railway.app"></script>
Reads · no key
- GET
/api/v1/book?pair=BTC-USDCBids, asks, mid, spread, lot - GET
/api/v1/trades?pair=BTC-USDCMatches with their simulate_intents result - GET
/api/v1/tickerMids and samples for every pair - GET
/api/v1/depth?pair=BTC-USDC&group=1Grouped depth - GET
/api/v1/candles?pair=BTC-USDC&interval=1m1m, 5m, 1h, 1d candles - GET
/api/v1/compare?pair=BTC-USDC&side=BUY&qty=0.0001Book price versus 1Click - GET
/api/v1/quote/best?pair=NEAR-USDC&side=BUY&qty=2Best of book, 1Click and Rhea - GET
/api/v1/orders?account=Orders for one account - GET
/api/v1/accounts/{account}Orders, fills and balances - GET
/api/v1/referrers?id=A referrer's share of taker fees - GET
/api/v1/status?depositAddress=1Click deposit status - GET
/api/v1/healthFee, salt, mode, key sources
Writes · signed
- POST
/api/v1/orders/previewUnsigned order legs to sign - POST
/api/v1/ordersSigned legs: match, simulate, rest - POST
/api/v1/orders/cancel-previewCancel message for the owner - POST
/api/v1/orders/cancelSigned cancel only - POST
/api/v1/orders/burn-previewEmpty intent with the order nonce - POST
/api/v1/orders/burnSigned nonce burn, then the live gate - POST
/api/v1/withdraw/previewUnsigned ft_withdraw - POST
/api/v1/withdrawOne signed ft_withdraw, then the live gate - POST
/api/v1/webhooks/previewRegistration message to sign - POST
/api/v1/webhooksSigned HMAC fill webhook - POST
/api/v1/deposit-quote1Click quote, dry by default - POST
/api/v1/near-depositUnsigned ft_transfer_call template