SDK
TypeScript SDK
Browser- and Node-compatible. Uses native fetch. Zero runtime dependencies; ships with full type definitions.
Note
Shipped from the matcher host as @taifoon/clob. npm release lands in Phase A.2.Install
# Phase A.2 (PLANNED) npm i @taifoon/clob # Today: vendor the file curl -O https://api.taifoon.dev/static/clients/ts/taifoon-clob.ts
Place an order
import { Client } from "@taifoon/clob";
const c = new Client({
baseUrl: "https://api.taifoon.dev",
attribution: "bot-demo",
});
const order = await c.placeOrder({
market: "BTC-PERP",
side: "buy",
qty: "0.01",
price: "75000",
tif: "gtc",
});
console.log(order.order_id);Mint a warp session
const s = await c.mintSession({
from: "2026-05-15T00:00:00Z",
to: "2026-05-15T04:00:00Z",
markets: ["BTC-PERP"],
speedX: 100,
});
while (!(await s.done())) {
const candles = await s.candles("BTC-PERP", { tf: "1m", limit: 200 });
const decision = myStrategy(candles);
if (decision) await s.placeOrder(decision);
await s.step();
}
const receipt = await s.receipt();
if (!receipt.causality_ok) throw new Error("causality broken");