From 747b6e78b063ef0347de313d78aa29013d4c6743 Mon Sep 17 00:00:00 2001 From: "Samuel EF. Tinnerholm" Date: Sun, 24 May 2026 17:51:46 +0300 Subject: [PATCH] fix: make params optional on compareMarketPrices and fetchRelatedMarkets Fixes #448 --- core/src/BaseExchange.ts | 6 +++--- core/src/router/Router.ts | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/core/src/BaseExchange.ts b/core/src/BaseExchange.ts index 0e27ff64..d3c1174f 100644 --- a/core/src/BaseExchange.ts +++ b/core/src/BaseExchange.ts @@ -1518,7 +1518,7 @@ export abstract class PredictionMarketExchange { * @param params - Match filter parameters (uses relation: 'identity' internally) * @returns Array of price comparisons across venues */ - async compareMarketPrices(params: FetchMatchesParams): Promise { + async compareMarketPrices(params?: FetchMatchesParams): Promise { throw new Error("Method compareMarketPrices not implemented."); } @@ -1529,7 +1529,7 @@ export abstract class PredictionMarketExchange { * @param params - Match filter parameters * @returns Array of subset/superset matches with live prices */ - async fetchRelatedMarkets(params: FetchMatchesParams): Promise { + async fetchRelatedMarkets(params?: FetchMatchesParams): Promise { throw new Error("Method fetchRelatedMarkets not implemented."); } @@ -1558,7 +1558,7 @@ export abstract class PredictionMarketExchange { * @param params - Match filter parameters * @returns Array of subset/superset matches with live prices */ - async fetchHedges(params: FetchMatchesParams): Promise { + async fetchHedges(params?: FetchMatchesParams): Promise { throw new Error("Method fetchHedges not implemented."); } diff --git a/core/src/router/Router.ts b/core/src/router/Router.ts index 2877212b..5c3c0af1 100644 --- a/core/src/router/Router.ts +++ b/core/src/router/Router.ts @@ -256,7 +256,7 @@ export class Router extends PredictionMarketExchange { // Price comparison: identity matches with live prices // ----------------------------------------------------------------------- - async compareMarketPrices(params: FetchMarketMatchesParams): Promise { + async compareMarketPrices(params: FetchMarketMatchesParams = {}): Promise { if (params.market && !params.marketId) { params = { ...params, marketId: params.market.marketId }; } @@ -281,7 +281,7 @@ export class Router extends PredictionMarketExchange { // Related markets: subset/superset matches with live prices // ----------------------------------------------------------------------- - async fetchRelatedMarkets(params: FetchMarketMatchesParams): Promise { + async fetchRelatedMarkets(params: FetchMarketMatchesParams = {}): Promise { if (params.market && !params.marketId) { params = { ...params, marketId: params.market.marketId }; } @@ -304,7 +304,7 @@ export class Router extends PredictionMarketExchange { } /** @deprecated Use {@link fetchRelatedMarkets} instead. */ - async fetchHedges(params: FetchMarketMatchesParams): Promise { + async fetchHedges(params: FetchMarketMatchesParams = {}): Promise { logger.warn('fetchHedges is deprecated, use fetchRelatedMarkets instead'); return this.fetchRelatedMarkets(params); }