@@ -813,43 +813,43 @@ export abstract class PredictionMarketExchange {
813813 /**
814814 * Fetch historical OHLCV (candlestick) price data for a specific market outcome.
815815 *
816- * @param id - The Outcome ID (outcomeId). Use outcome.outcomeId, NOT market.marketId
816+ * @param outcomeId - The Outcome ID (outcomeId). Use outcome.outcomeId, NOT market.marketId
817817 * @param params - OHLCV parameters including resolution (required)
818818 * @returns Array of price candles
819819 *
820820 * @notes **CRITICAL**: Use `outcome.outcomeId` (TS) / `outcome.outcome_id` (Python), not the market ID.
821821 * @notes Polymarket: outcomeId is the CLOB Token ID. Kalshi: outcomeId is the Market Ticker.
822822 * @notes Common resolutions: '1m' | '5m' | '15m' | '1h' | '6h' | '1d'. Arbitrary intervals (e.g. '30s', '120s', '3h') accepted by venues that support them.
823823 */
824- async fetchOHLCV ( id : string , params : OHLCVParams ) : Promise < PriceCandle [ ] > {
824+ async fetchOHLCV ( outcomeId : string , params : OHLCVParams ) : Promise < PriceCandle [ ] > {
825825 throw new Error ( "Method fetchOHLCV not implemented." ) ;
826826 }
827827
828828 /**
829829 * Fetch the current order book (bids/asks) for a specific outcome.
830830 * Essential for calculating spread, depth, and execution prices.
831831 *
832- * @param id - The Outcome ID (outcomeId) or market slug
832+ * @param outcomeId - The Outcome ID (outcomeId) or market slug
833833 * @param side - Optional 'yes' or 'no' to explicitly indicate the
834834 * outcome side. Required for exchanges where the API returns a
835835 * single orderbook per market (e.g. Limitless) and the caller
836836 * passes a slug instead of a token ID.
837837 * @returns Current order book with bids and asks
838838 */
839- async fetchOrderBook ( id : string , side ?: 'yes' | 'no' ) : Promise < OrderBook > {
839+ async fetchOrderBook ( outcomeId : string , side ?: 'yes' | 'no' ) : Promise < OrderBook > {
840840 throw new Error ( "Method fetchOrderBook not implemented." ) ;
841841 }
842842
843843 /**
844844 * Fetch raw trade history for a specific outcome.
845845 *
846- * @param id - The Outcome ID (outcomeId)
846+ * @param outcomeId - The Outcome ID (outcomeId)
847847 * @param params - Trade filter parameters
848848 * @returns Array of recent trades
849849 *
850850 * @notes Polymarket requires an API key for trade history. Use fetchOHLCV for public historical data.
851851 */
852- async fetchTrades ( id : string , params : TradesParams | HistoryFilterParams ) : Promise < Trade [ ] > {
852+ async fetchTrades ( outcomeId : string , params : TradesParams | HistoryFilterParams ) : Promise < Trade [ ] > {
853853 // Deprecation warning for resolution parameter
854854 if ( 'resolution' in params && params . resolution !== undefined ) {
855855 console . warn (
@@ -1246,11 +1246,11 @@ export abstract class PredictionMarketExchange {
12461246 * Watch order book updates in real-time via WebSocket.
12471247 * Returns a promise that resolves with the next order book update. Call repeatedly in a loop to stream updates (CCXT Pro pattern).
12481248 *
1249- * @param id - The Outcome ID to watch
1249+ * @param outcomeId - The Outcome ID to watch
12501250 * @param limit - Optional limit for orderbook depth
12511251 * @returns Promise that resolves with the current orderbook state
12521252 */
1253- async watchOrderBook ( id : string , limit ?: number ) : Promise < OrderBook > {
1253+ async watchOrderBook ( outcomeId : string , limit ?: number ) : Promise < OrderBook > {
12541254 throw new Error ( `watchOrderBook() is not supported by ${ this . name } ` ) ;
12551255 }
12561256
@@ -1260,33 +1260,33 @@ export abstract class PredictionMarketExchange {
12601260 * Exchanges with native batch support (e.g. Kalshi) send a single subscribe message
12611261 * for all tickers; others fall back to individual watchOrderBook calls.
12621262 *
1263- * @param ids - Array of Outcome IDs to watch
1263+ * @param outcomeIds - Array of Outcome IDs to watch
12641264 * @param limit - Optional limit for orderbook depth
12651265 * @returns Promise that resolves with order books keyed by ID
12661266 */
1267- async watchOrderBooks ( ids : string [ ] , limit ?: number ) : Promise < Record < string , OrderBook > > {
1267+ async watchOrderBooks ( outcomeIds : string [ ] , limit ?: number ) : Promise < Record < string , OrderBook > > {
12681268 // Default implementation: subscribe to each ID individually.
12691269 // Exchanges with native batch support (e.g. Kalshi) override this
12701270 // to send a single subscribe message for all tickers.
12711271 const entries = await Promise . all (
1272- ids . map ( async ( id ) : Promise < [ string , OrderBook ] > => {
1273- const book = await this . watchOrderBook ( id , limit ) ;
1274- return [ id , book ] ;
1272+ outcomeIds . map ( async ( oid ) : Promise < [ string , OrderBook ] > => {
1273+ const book = await this . watchOrderBook ( oid , limit ) ;
1274+ return [ oid , book ] ;
12751275 } ) ,
12761276 ) ;
12771277 const result : Record < string , OrderBook > = { } ;
1278- for ( const [ id , book ] of entries ) {
1279- result [ id ] = book ;
1278+ for ( const [ oid , book ] of entries ) {
1279+ result [ oid ] = book ;
12801280 }
12811281 return result ;
12821282 }
12831283
12841284 /**
12851285 * Unsubscribe from a previously watched order book stream.
12861286 *
1287- * @param id - The Outcome ID to stop watching
1287+ * @param outcomeId - The Outcome ID to stop watching
12881288 */
1289- async unwatchOrderBook ( id : string ) : Promise < void > {
1289+ async unwatchOrderBook ( outcomeId : string ) : Promise < void > {
12901290 throw new Error ( `unwatchOrderBook() is not supported by ${ this . name } ` ) ;
12911291 }
12921292
@@ -1298,13 +1298,13 @@ export abstract class PredictionMarketExchange {
12981298 * Watch trade executions in real-time via WebSocket.
12991299 * Returns a promise that resolves with the next trade(s). Call repeatedly in a loop to stream updates (CCXT Pro pattern).
13001300 *
1301- * @param id - The Outcome ID to watch
1301+ * @param outcomeId - The Outcome ID to watch
13021302 * @param address - Public wallet address
13031303 * @param since - Optional timestamp to filter trades from
13041304 * @param limit - Optional limit for number of trades
13051305 * @returns Promise that resolves with recent trades
13061306 */
1307- async watchTrades ( id : string , address ?: string , since ?: number , limit ?: number ) : Promise < Trade [ ] > {
1307+ async watchTrades ( outcomeId : string , address ?: string , since ?: number , limit ?: number ) : Promise < Trade [ ] > {
13081308 throw new Error ( `watchTrades() is not supported by ${ this . name } ` ) ;
13091309 }
13101310
0 commit comments