@delphimarkets/sdk) is a TypeScript library that lets you place, query, and cancel orders on six prediction markets through a single unified interface. It wraps the Delphi REST API and adds client-side helpers for the on-chain exchanges that require EIP-712 signed orders.
| Exchange | Chain | Wallet | Signing |
|---|---|---|---|
| Polymarket | Polygon | Gnosis Safe | Client-side EIP-712 |
| Kalshi | — | — | Server-side RSA-PSS |
| Opinion Labs | BNB Chain | Gnosis Safe | Client-side EIP-712 |
| Gemini Predictions | — | — | Server-side HMAC-SHA512 |
| Limitless | Base | EOA | Client-side EIP-712 |
| Predict.fun | BNB Chain | Predict Account / EOA | Client-side EIP-712 |
Install
fetch).
Configure
| Option | Type | Default | Description |
|---|---|---|---|
apiKey | string | required | Your Delphi API key. Sent as the X-API-Key header. |
baseUrl | string | http://localhost:8080 | Use https://api.delphiterminal.co in production. |
timeout | number | 30000 | Request timeout in milliseconds. |
Authentication
Every request to the Delphi API requires theX-API-Key header:
apiKey you pass to DelphiClient. Don’t expose your key in client-side code (browser apps) — proxy through your own backend.
How signing works
This is the most important concept to understand before you write any trading code. For Kalshi and Gemini, the server signs with credentials you registered ahead of time (RSA private key for Kalshi, HMAC secret for Gemini). No client-side cryptography needed.Quick example: Polymarket order
Polymarket
EIP-712 signed orders, Gnosis Safe wallet on Polygon
Kalshi
Server-side RSA-PSS signing, US-regulated
Opinion Labs
EIP-712 + Safe on BNB Chain
Gemini Predictions
Server-side HMAC-SHA512 signing
Limitless
EIP-712 signed orders, EOA wallet on Base
Predict.fun
EIP-712 + Kernel smart wallet on BNB Chain
Order management
The same four methods work for every exchange:exchange argument is optional on getOrder and cancelOrder — the server can resolve it from the order store. Passing it explicitly is slightly faster.
Credentials
For Kalshi, Gemini, Opinion Labs, Limitless, and Predict.fun, register your exchange credentials once, then place orders without further auth setup:Error handling
Every API error is wrapped in aDelphiError that exposes the HTTP status code and a server-provided message:
AbortError / TypeError. The SDK does not auto-retry — that’s intentional, since order placement is non-idempotent.
TypeScript types
All public types are exported from the package root:.d.ts declarations for full IDE auto-completion.
Resources
GitHub
Source code, issues, releases
npm
Package page, version history

