Skip to content

Commit dcc2d67

Browse files
committed
fix: typed FetchOrderBookParams for OpenAPI docs generation
Replace Record<string, any> with FetchOrderBookParams interface so the OpenAPI generator can enumerate side, since, until params in the auto-generated docs.
1 parent 42697d7 commit dcc2d67

4 files changed

Lines changed: 34 additions & 2 deletions

File tree

changelog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [2.43.2] - 2026-05-22
6+
7+
### Fixed
8+
9+
- **Docs**: `fetchOrderBook` params (`side`, `since`, `until`) now appear in auto-generated API docs. Replaced `Record<string, any>` with typed `FetchOrderBookParams` interface so the OpenAPI generator can enumerate the properties.
10+
511
## [2.43.1] - 2026-05-22
612

713
### Fixed

core/src/BaseExchange.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,19 @@ export interface MyTradesParams {
166166
cursor?: string; // for Kalshi cursor pagination
167167
}
168168

169+
export interface FetchOrderBookParams {
170+
/** Outcome side: 'yes' or 'no'. Required for exchanges like Limitless
171+
* where the API returns a single orderbook per market. */
172+
side?: 'yes' | 'no';
173+
/** Unix timestamp (ms) — fetch a historical snapshot at or before this
174+
* time, or the start of a range when combined with `until` (hosted API only). */
175+
since?: number;
176+
/** Unix timestamp (ms) — end of a historical range. When combined with
177+
* `since`, returns an array of reconstructed L2 OrderBook snapshots
178+
* between `since` and `until` (hosted API only). */
179+
until?: number;
180+
}
181+
169182
export interface OrderHistoryParams {
170183
marketId?: string; // required for Limitless (slug)
171184
/** Only return records after this date */
@@ -856,7 +869,7 @@ export abstract class PredictionMarketExchange {
856869
* @returns Order book with bids and asks. Returns OrderBook[] when
857870
* both `since` and `until` are provided.
858871
*/
859-
async fetchOrderBook(outcomeId: string, limit?: number, params?: Record<string, any>): Promise<OrderBook> {
872+
async fetchOrderBook(outcomeId: string, limit?: number, params?: FetchOrderBookParams): Promise<OrderBook> {
860873
throw new Error("Method fetchOrderBook not implemented.");
861874
}
862875

sdks/typescript/pmxt/client.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import {
2222
EventFilterCriteria,
2323
EventFilterFunction,
2424
ExecutionPriceResult,
25+
FetchOrderBookParams,
2526
MarketFetchParams,
2627
MarketFilterCriteria,
2728
MarketFilterFunction,
@@ -766,7 +767,7 @@ export abstract class Exchange {
766767
}
767768
}
768769

769-
async fetchOrderBook(outcomeId: string | MarketOutcome, limit?: number, params?: Record<string, any>): Promise<OrderBook | OrderBook[]> {
770+
async fetchOrderBook(outcomeId: string | MarketOutcome, limit?: number, params?: FetchOrderBookParams): Promise<OrderBook | OrderBook[]> {
770771
await this.initPromise;
771772
try {
772773
const args: any[] = [];

sdks/typescript/pmxt/models.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,18 @@ export interface TradesParams {
522522
limit?: number;
523523
}
524524

525+
/**
526+
* Parameters for fetchOrderBook historical queries.
527+
*/
528+
export interface FetchOrderBookParams {
529+
/** Outcome side: 'yes' or 'no' (for exchanges like Limitless) */
530+
side?: 'yes' | 'no';
531+
/** Unix timestamp (ms) — historical snapshot at or before this time */
532+
since?: number;
533+
/** Unix timestamp (ms) — end of range. With `since`, returns OrderBook[] */
534+
until?: number;
535+
}
536+
525537
/**
526538
* Parameters for fetching the authenticated user's trade history.
527539
*/

0 commit comments

Comments
 (0)