Skip to content

DenpaClient

const page = await denpa.getMarketPage("559652"); // question, description, endDate, resolved, resolutionValue, clobTokenId, volume, liquidity
const 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 universe
const feed = await getMarketFeed({ category: "music_culture" }); // both exchanges by default
const feedPM = await getMarketFeed({ providers: ["polymarket"] });
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.

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 key
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.

const wire = await denpa.getWire({ window: "1h" }); // server-side only (not CORS)
const stories = await denpa.getSituations({ window: "24h" });
const stations = denpa.stations; // StationsApi over /api/v1/stations/* on the Hono service; dk_ accepted
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.