DenpaClient
Market context
Section titled “Market context”const page = await denpa.getMarketPage("559652"); // question, description, endDate, resolved, resolutionValue, clobTokenId, volume, liquidityconst streams = await denpa.getMarketStreams("559652"); // MarketStream[] — unwrapped: [{ handle, url, label, updatedAt }]// module-level helpers (not client methods):import { getMarketFeed, getOpenMarkets } from "@denpa/sdk";const open = await getOpenMarkets(); // the broad Polymarket universeconst feed = await getMarketFeed({ category: "music_culture" }); // both exchanges by defaultconst feedPM = await getMarketFeed({ providers: ["polymarket"] });Binding and overlay (key required)
Section titled “Binding and overlay (key required)”await denpa.bindStream("559652", { url: "https://…/index.m3u8", label: "Studio A" });await denpa.unbindStream("559652");await denpa.setOverlay({ marketId: "559652", name: page.question, annotation: "calling YES" });// to clear it: DELETE /api/streamer/signal with the same key (no client method)The handle is resolved server-side from the key. One active market per operator.
Receipts and field record
Section titled “Receipts and field record”const receipts = await denpa.getReceipts("myhandle");// field records are REST-only (no client method):// GET /api/network/field-record/:handle// GET /api/network/field-record/me with the keyProgram clock
Section titled “Program clock”const rundown = await denpa.getProgram({ providers: ["kalshi"], categories: ["music"] });// { enabled, generatedAt, total, lanes, segments[], spec }programQuery(options) builds the same query string if you fetch yourself.
Wire and situations
Section titled “Wire and situations”const wire = await denpa.getWire({ window: "1h" }); // server-side only (not CORS)const stories = await denpa.getSituations({ window: "24h" });Stations (Station Protocol)
Section titled “Stations (Station Protocol)”const stations = denpa.stations; // StationsApi over /api/v1/stations/* on the Hono service; dk_ acceptedRealtime
Section titled “Realtime”import { DreambothSignal } from "@denpa/sdk";const sub = denpa.subscribe("show-1", (event) => console.log(event));sub.unsubscribe();Do not block first paint on a socket. Poll REST every 30 s and treat the socket as an upgrade.