pmxt-core 2.37.12 → 2.37.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist/exchanges/kalshi/api.d.ts +1 -1
  2. package/dist/exchanges/kalshi/api.js +1 -1
  3. package/dist/exchanges/limitless/api.d.ts +1 -1
  4. package/dist/exchanges/limitless/api.js +1 -1
  5. package/dist/exchanges/limitless/fetcher.js +1 -2
  6. package/dist/exchanges/limitless/index.js +3 -1
  7. package/dist/exchanges/limitless/utils.d.ts +0 -1
  8. package/dist/exchanges/limitless/utils.js +1 -2
  9. package/dist/exchanges/metaculus/cancelOrder.d.ts +2 -2
  10. package/dist/exchanges/metaculus/cancelOrder.js +1 -2
  11. package/dist/exchanges/metaculus/createOrder.d.ts +2 -2
  12. package/dist/exchanges/metaculus/createOrder.js +1 -2
  13. package/dist/exchanges/metaculus/utils.d.ts +0 -1
  14. package/dist/exchanges/metaculus/utils.js +1 -2
  15. package/dist/exchanges/myriad/api.d.ts +1 -1
  16. package/dist/exchanges/myriad/api.js +1 -1
  17. package/dist/exchanges/myriad/utils.d.ts +0 -1
  18. package/dist/exchanges/myriad/utils.js +1 -2
  19. package/dist/exchanges/opinion/api.d.ts +1 -1
  20. package/dist/exchanges/opinion/api.js +1 -1
  21. package/dist/exchanges/opinion/config.d.ts +0 -1
  22. package/dist/exchanges/opinion/config.js +1 -2
  23. package/dist/exchanges/polymarket/api-clob.d.ts +1 -1
  24. package/dist/exchanges/polymarket/api-clob.js +1 -1
  25. package/dist/exchanges/polymarket/api-data.d.ts +1 -1
  26. package/dist/exchanges/polymarket/api-data.js +1 -1
  27. package/dist/exchanges/polymarket/api-gamma.d.ts +1 -1
  28. package/dist/exchanges/polymarket/api-gamma.js +1 -1
  29. package/dist/exchanges/polymarket/auth.js +5 -0
  30. package/dist/exchanges/probable/api.d.ts +1 -1
  31. package/dist/exchanges/probable/api.js +1 -1
  32. package/dist/exchanges/probable/utils.d.ts +0 -1
  33. package/dist/exchanges/probable/utils.js +1 -2
  34. package/dist/exchanges/smarkets/fetcher.d.ts +2 -1
  35. package/dist/exchanges/smarkets/fetcher.js +4 -3
  36. package/dist/exchanges/smarkets/index.js +1 -1
  37. package/package.json +4 -4
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Auto-generated from /home/runner/work/pmxt/pmxt/core/specs/kalshi/Kalshi.yaml
3
- * Generated at: 2026-05-08T16:05:46.392Z
3
+ * Generated at: 2026-05-08T17:24:31.092Z
4
4
  * Do not edit manually -- run "npm run fetch:openapi" to regenerate.
5
5
  */
6
6
  export declare const kalshiApiSpec: {
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.kalshiApiSpec = void 0;
4
4
  /**
5
5
  * Auto-generated from /home/runner/work/pmxt/pmxt/core/specs/kalshi/Kalshi.yaml
6
- * Generated at: 2026-05-08T16:05:46.392Z
6
+ * Generated at: 2026-05-08T17:24:31.092Z
7
7
  * Do not edit manually -- run "npm run fetch:openapi" to regenerate.
8
8
  */
9
9
  exports.kalshiApiSpec = {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Auto-generated from /home/runner/work/pmxt/pmxt/core/specs/limitless/Limitless.yaml
3
- * Generated at: 2026-05-08T16:05:46.423Z
3
+ * Generated at: 2026-05-08T17:24:31.127Z
4
4
  * Do not edit manually -- run "npm run fetch:openapi" to regenerate.
5
5
  */
6
6
  export declare const limitlessApiSpec: {
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.limitlessApiSpec = void 0;
4
4
  /**
5
5
  * Auto-generated from /home/runner/work/pmxt/pmxt/core/specs/limitless/Limitless.yaml
6
- * Generated at: 2026-05-08T16:05:46.423Z
6
+ * Generated at: 2026-05-08T17:24:31.127Z
7
7
  * Do not edit manually -- run "npm run fetch:openapi" to regenerate.
8
8
  */
9
9
  exports.limitlessApiSpec = {
@@ -129,8 +129,7 @@ class LimitlessFetcher {
129
129
  }
130
130
  async fetchRawMyTrades(_params, apiKey) {
131
131
  try {
132
- const baseUrl = process.env.LIMITLESS_BASE_URL || 'https://api.limitless.exchange';
133
- const response = await this.http.get(`${baseUrl}/portfolio/trades`, {
132
+ const response = await this.http.get(`${this.apiUrl}/portfolio/trades`, {
134
133
  headers: { Authorization: `Bearer ${apiKey}` },
135
134
  });
136
135
  const trades = Array.isArray(response.data) ? response.data : (response.data?.data || []);
@@ -15,6 +15,7 @@ const client_1 = require("./client");
15
15
  const errors_2 = require("./errors");
16
16
  const fetcher_1 = require("./fetcher");
17
17
  const normalizer_1 = require("./normalizer");
18
+ const utils_1 = require("./utils");
18
19
  const websocket_1 = require("./websocket");
19
20
  class LimitlessExchange extends BaseExchange_1.PredictionMarketExchange {
20
21
  capabilityOverrides = {
@@ -96,7 +97,8 @@ class LimitlessExchange extends BaseExchange_1.PredictionMarketExchange {
96
97
  callApi: this.callApi.bind(this),
97
98
  getHeaders: () => this.getHeaders(),
98
99
  };
99
- this.fetcher = new fetcher_1.LimitlessFetcher(ctx, this.http, this.auth?.getApiKey(), this.auth?.host);
100
+ const limitlessBaseUrl = this.auth?.host || credentials?.baseUrl || utils_1.DEFAULT_LIMITLESS_API_URL;
101
+ this.fetcher = new fetcher_1.LimitlessFetcher(ctx, this.http, this.auth?.getApiKey(), limitlessBaseUrl);
100
102
  this.normalizer = new normalizer_1.LimitlessNormalizer();
101
103
  }
102
104
  get name() {
@@ -1,6 +1,5 @@
1
1
  import { UnifiedMarket, CandleInterval } from '../../types';
2
2
  export declare const DEFAULT_LIMITLESS_API_URL = "https://api.limitless.exchange";
3
- export declare const LIMITLESS_API_URL: string;
4
3
  export declare function mapMarketToUnified(market: any): UnifiedMarket | null;
5
4
  export declare function mapIntervalToFidelity(interval: CandleInterval): number;
6
5
  /**
@@ -1,12 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LIMITLESS_API_URL = exports.DEFAULT_LIMITLESS_API_URL = void 0;
3
+ exports.DEFAULT_LIMITLESS_API_URL = void 0;
4
4
  exports.mapMarketToUnified = mapMarketToUnified;
5
5
  exports.mapIntervalToFidelity = mapIntervalToFidelity;
6
6
  exports.paginateLimitlessMarkets = paginateLimitlessMarkets;
7
7
  const market_utils_1 = require("../../utils/market-utils");
8
8
  exports.DEFAULT_LIMITLESS_API_URL = 'https://api.limitless.exchange';
9
- exports.LIMITLESS_API_URL = process.env.LIMITLESS_BASE_URL || exports.DEFAULT_LIMITLESS_API_URL;
10
9
  function mapMarketToUnified(market) {
11
10
  if (!market)
12
11
  return null;
@@ -8,8 +8,8 @@ export interface CancelOrderContext {
8
8
  http: AxiosInstance;
9
9
  /** Returns auth headers. Throws if no token is configured. */
10
10
  getAuthHeaders: () => Record<string, string>;
11
- /** Optional base URL override (defaults to the standard Metaculus API). */
12
- baseUrl?: string;
11
+ /** Base URL for the Metaculus API. */
12
+ baseUrl: string;
13
13
  }
14
14
  /**
15
15
  * Withdraw a forecast on Metaculus, mapped from the unified cancelOrder interface.
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.cancelOrder = cancelOrder;
4
4
  const errors_1 = require("../../errors");
5
5
  const errors_2 = require("./errors");
6
- const utils_1 = require("./utils");
7
6
  /**
8
7
  * Withdraw a forecast on Metaculus, mapped from the unified cancelOrder interface.
9
8
  *
@@ -48,7 +47,7 @@ async function cancelOrder(orderId, ctx) {
48
47
  // Bypasses callApi because the API expects an array body.
49
48
  await ctx.http.request({
50
49
  method: "POST",
51
- url: `${ctx.baseUrl || utils_1.DEFAULT_BASE_URL}/questions/withdraw/`,
50
+ url: `${ctx.baseUrl}/questions/withdraw/`,
52
51
  data: [{ question: questionId }],
53
52
  headers: { "Content-Type": "application/json", ...headers },
54
53
  });
@@ -60,8 +60,8 @@ export interface CreateOrderContext {
60
60
  http: AxiosInstance;
61
61
  /** Returns auth headers. Throws if no token is configured. */
62
62
  getAuthHeaders: () => Record<string, string>;
63
- /** Optional base URL override (defaults to the standard Metaculus API). */
64
- baseUrl?: string;
63
+ /** Base URL for the Metaculus API. */
64
+ baseUrl: string;
65
65
  /**
66
66
  * Fetch current market outcomes to read multiple-choice probabilities.
67
67
  * Only needed for multiple-choice questions.
@@ -6,7 +6,6 @@ exports.redistributeProbabilities = redistributeProbabilities;
6
6
  exports.createOrder = createOrder;
7
7
  const errors_1 = require("../../errors");
8
8
  const errors_2 = require("./errors");
9
- const utils_1 = require("./utils");
10
9
  /**
11
10
  * Parse a Metaculus outcomeId into its components.
12
11
  *
@@ -256,7 +255,7 @@ async function createOrder(params, ctx) {
256
255
  // array body, but the implicit API infrastructure always sends objects.
257
256
  await ctx.http.request({
258
257
  method: "POST",
259
- url: `${ctx.baseUrl || utils_1.DEFAULT_BASE_URL}/questions/forecast/`,
258
+ url: `${ctx.baseUrl}/questions/forecast/`,
260
259
  data: payload,
261
260
  headers: { "Content-Type": "application/json", ...headers },
262
261
  });
@@ -6,7 +6,6 @@ import { UnifiedMarket } from "../../types";
6
6
  * Paths in the spec (/posts/, /posts/{postId}/) are appended directly by BaseExchange.
7
7
  */
8
8
  export declare const DEFAULT_BASE_URL = "https://www.metaculus.com/api";
9
- export declare const BASE_URL: string;
10
9
  /**
11
10
  * Map a Metaculus post `status` to pmxt unified status.
12
11
  *
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BASE_URL = exports.DEFAULT_BASE_URL = void 0;
3
+ exports.DEFAULT_BASE_URL = void 0;
4
4
  exports.mapStatus = mapStatus;
5
5
  exports.mapMarketToUnified = mapMarketToUnified;
6
6
  exports.expandPost = expandPost;
@@ -12,7 +12,6 @@ const market_utils_1 = require("../../utils/market-utils");
12
12
  * Paths in the spec (/posts/, /posts/{postId}/) are appended directly by BaseExchange.
13
13
  */
14
14
  exports.DEFAULT_BASE_URL = "https://www.metaculus.com/api";
15
- exports.BASE_URL = process.env.METACULUS_BASE_URL || exports.DEFAULT_BASE_URL;
16
15
  /**
17
16
  * Map a Metaculus post `status` to pmxt unified status.
18
17
  *
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Auto-generated from /home/runner/work/pmxt/pmxt/core/specs/myriad/myriad.yaml
3
- * Generated at: 2026-05-08T16:05:46.434Z
3
+ * Generated at: 2026-05-08T17:24:31.139Z
4
4
  * Do not edit manually -- run "npm run fetch:openapi" to regenerate.
5
5
  */
6
6
  export declare const myriadApiSpec: {
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.myriadApiSpec = void 0;
4
4
  /**
5
5
  * Auto-generated from /home/runner/work/pmxt/pmxt/core/specs/myriad/myriad.yaml
6
- * Generated at: 2026-05-08T16:05:46.434Z
6
+ * Generated at: 2026-05-08T17:24:31.139Z
7
7
  * Do not edit manually -- run "npm run fetch:openapi" to regenerate.
8
8
  */
9
9
  exports.myriadApiSpec = {
@@ -1,6 +1,5 @@
1
1
  import { UnifiedMarket, UnifiedEvent } from '../../types';
2
2
  export declare const DEFAULT_BASE_URL = "https://api-v2.myriadprotocol.com";
3
- export declare const BASE_URL: string;
4
3
  export declare const NETWORKS: {
5
4
  readonly ABSTRACT: 2741;
6
5
  readonly LINEA: 59144;
@@ -1,13 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CONTRACTS = exports.NETWORKS = exports.BASE_URL = exports.DEFAULT_BASE_URL = void 0;
3
+ exports.CONTRACTS = exports.NETWORKS = exports.DEFAULT_BASE_URL = void 0;
4
4
  exports.mapMarketState = mapMarketState;
5
5
  exports.mapStatusToMyriad = mapStatusToMyriad;
6
6
  exports.mapMarketToUnified = mapMarketToUnified;
7
7
  exports.mapQuestionToEvent = mapQuestionToEvent;
8
8
  const market_utils_1 = require("../../utils/market-utils");
9
9
  exports.DEFAULT_BASE_URL = 'https://api-v2.myriadprotocol.com';
10
- exports.BASE_URL = process.env.MYRIAD_BASE_URL || exports.DEFAULT_BASE_URL;
11
10
  // Mainnet network IDs
12
11
  exports.NETWORKS = {
13
12
  ABSTRACT: 2741,
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Auto-generated from /home/runner/work/pmxt/pmxt/core/specs/opinion/opinion-openapi.yaml
3
- * Generated at: 2026-05-08T16:05:46.438Z
3
+ * Generated at: 2026-05-08T17:24:31.144Z
4
4
  * Do not edit manually -- run "npm run fetch:openapi" to regenerate.
5
5
  */
6
6
  export declare const opinionApiSpec: {
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.opinionApiSpec = void 0;
4
4
  /**
5
5
  * Auto-generated from /home/runner/work/pmxt/pmxt/core/specs/opinion/opinion-openapi.yaml
6
- * Generated at: 2026-05-08T16:05:46.438Z
6
+ * Generated at: 2026-05-08T17:24:31.144Z
7
7
  * Do not edit manually -- run "npm run fetch:openapi" to regenerate.
8
8
  */
9
9
  exports.opinionApiSpec = {
@@ -1,5 +1,4 @@
1
1
  export declare const DEFAULT_OPINION_API_URL = "https://openapi.opinion.trade/openapi";
2
- export declare const OPINION_API_URL: string;
3
2
  export declare const OPINION_WS_URL = "wss://ws.opinion.trade";
4
3
  export declare const OPINION_MAX_PAGE_SIZE = 20;
5
4
  export declare const OPINION_CHAIN_ID = 56;
@@ -1,8 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OPINION_DEFAULT_RPC_URL = exports.OPINION_CHAIN_ID = exports.OPINION_MAX_PAGE_SIZE = exports.OPINION_WS_URL = exports.OPINION_API_URL = exports.DEFAULT_OPINION_API_URL = void 0;
3
+ exports.OPINION_DEFAULT_RPC_URL = exports.OPINION_CHAIN_ID = exports.OPINION_MAX_PAGE_SIZE = exports.OPINION_WS_URL = exports.DEFAULT_OPINION_API_URL = void 0;
4
4
  exports.DEFAULT_OPINION_API_URL = "https://openapi.opinion.trade/openapi";
5
- exports.OPINION_API_URL = process.env.OPINION_BASE_URL || exports.DEFAULT_OPINION_API_URL;
6
5
  exports.OPINION_WS_URL = "wss://ws.opinion.trade";
7
6
  exports.OPINION_MAX_PAGE_SIZE = 20;
8
7
  // CLOB SDK chain constants
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Auto-generated from /home/runner/work/pmxt/pmxt/core/specs/polymarket/PolymarketClobAPI.yaml
3
- * Generated at: 2026-05-08T16:05:46.397Z
3
+ * Generated at: 2026-05-08T17:24:31.097Z
4
4
  * Do not edit manually -- run "npm run fetch:openapi" to regenerate.
5
5
  */
6
6
  export declare const polymarketClobSpec: {
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.polymarketClobSpec = void 0;
4
4
  /**
5
5
  * Auto-generated from /home/runner/work/pmxt/pmxt/core/specs/polymarket/PolymarketClobAPI.yaml
6
- * Generated at: 2026-05-08T16:05:46.397Z
6
+ * Generated at: 2026-05-08T17:24:31.097Z
7
7
  * Do not edit manually -- run "npm run fetch:openapi" to regenerate.
8
8
  */
9
9
  exports.polymarketClobSpec = {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Auto-generated from /home/runner/work/pmxt/pmxt/core/specs/polymarket/Polymarket_Data_API.yaml
3
- * Generated at: 2026-05-08T16:05:46.407Z
3
+ * Generated at: 2026-05-08T17:24:31.109Z
4
4
  * Do not edit manually -- run "npm run fetch:openapi" to regenerate.
5
5
  */
6
6
  export declare const polymarketDataSpec: {
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.polymarketDataSpec = void 0;
4
4
  /**
5
5
  * Auto-generated from /home/runner/work/pmxt/pmxt/core/specs/polymarket/Polymarket_Data_API.yaml
6
- * Generated at: 2026-05-08T16:05:46.407Z
6
+ * Generated at: 2026-05-08T17:24:31.109Z
7
7
  * Do not edit manually -- run "npm run fetch:openapi" to regenerate.
8
8
  */
9
9
  exports.polymarketDataSpec = {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Auto-generated from /home/runner/work/pmxt/pmxt/core/specs/polymarket/PolymarketGammaAPI.yaml
3
- * Generated at: 2026-05-08T16:05:46.405Z
3
+ * Generated at: 2026-05-08T17:24:31.107Z
4
4
  * Do not edit manually -- run "npm run fetch:openapi" to regenerate.
5
5
  */
6
6
  export declare const polymarketGammaSpec: {
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.polymarketGammaSpec = void 0;
4
4
  /**
5
5
  * Auto-generated from /home/runner/work/pmxt/pmxt/core/specs/polymarket/PolymarketGammaAPI.yaml
6
- * Generated at: 2026-05-08T16:05:46.405Z
6
+ * Generated at: 2026-05-08T17:24:31.107Z
7
7
  * Do not edit manually -- run "npm run fetch:openapi" to regenerate.
8
8
  */
9
9
  exports.polymarketGammaSpec = {
@@ -15,6 +15,7 @@ const POLYGON_CHAIN_ID = 137;
15
15
  const SIG_TYPE_EOA = 0;
16
16
  const SIG_TYPE_POLY_PROXY = 1;
17
17
  const SIG_TYPE_GNOSIS_SAFE = 2;
18
+ const SIG_TYPE_POLY_1271 = 3; // Deposit wallet (ERC-1271, recommended for new API users)
18
19
  /**
19
20
  * Manages Polymarket authentication and CLOB client initialization.
20
21
  * Handles both L1 (wallet-based) and L2 (API credentials) authentication.
@@ -165,6 +166,10 @@ class PolymarketAuth {
165
166
  case 'gnosissafe':
166
167
  case 'safe':
167
168
  return SIG_TYPE_GNOSIS_SAFE;
169
+ case 'poly1271':
170
+ case '1271':
171
+ case 'depositwallet':
172
+ return SIG_TYPE_POLY_1271;
168
173
  default:
169
174
  const parsed = parseInt(normalized);
170
175
  return isNaN(parsed) ? SIG_TYPE_EOA : parsed;
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Auto-generated from /home/runner/work/pmxt/pmxt/core/specs/probable/probable.yaml
3
- * Generated at: 2026-05-08T16:05:46.428Z
3
+ * Generated at: 2026-05-08T17:24:31.132Z
4
4
  * Do not edit manually -- run "npm run fetch:openapi" to regenerate.
5
5
  */
6
6
  export declare const probableApiSpec: {
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.probableApiSpec = void 0;
4
4
  /**
5
5
  * Auto-generated from /home/runner/work/pmxt/pmxt/core/specs/probable/probable.yaml
6
- * Generated at: 2026-05-08T16:05:46.428Z
6
+ * Generated at: 2026-05-08T17:24:31.132Z
7
7
  * Do not edit manually -- run "npm run fetch:openapi" to regenerate.
8
8
  */
9
9
  exports.probableApiSpec = {
@@ -1,6 +1,5 @@
1
1
  import { UnifiedMarket, UnifiedEvent } from '../../types';
2
2
  export declare const DEFAULT_BASE_URL = "https://market-api.probable.markets";
3
- export declare const BASE_URL: string;
4
3
  export declare const SEARCH_PATH = "/public/api/v1/public-search/";
5
4
  export declare const EVENTS_PATH = "/public/api/v1/events/";
6
5
  export declare const MARKETS_PATH = "/public/api/v1/markets/";
@@ -1,12 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MARKETS_PATH = exports.EVENTS_PATH = exports.SEARCH_PATH = exports.BASE_URL = exports.DEFAULT_BASE_URL = void 0;
3
+ exports.MARKETS_PATH = exports.EVENTS_PATH = exports.SEARCH_PATH = exports.DEFAULT_BASE_URL = void 0;
4
4
  exports.mapMarketToUnified = mapMarketToUnified;
5
5
  exports.mapEventToUnified = mapEventToUnified;
6
6
  exports.enrichMarketsWithPrices = enrichMarketsWithPrices;
7
7
  const market_utils_1 = require("../../utils/market-utils");
8
8
  exports.DEFAULT_BASE_URL = 'https://market-api.probable.markets';
9
- exports.BASE_URL = process.env.PROBABLE_BASE_URL || exports.DEFAULT_BASE_URL;
10
9
  exports.SEARCH_PATH = '/public/api/v1/public-search/';
11
10
  exports.EVENTS_PATH = '/public/api/v1/events/';
12
11
  exports.MARKETS_PATH = '/public/api/v1/markets/';
@@ -153,7 +153,8 @@ export interface SmarketsRawEventWithMarkets {
153
153
  }
154
154
  export declare class SmarketsFetcher implements IExchangeFetcher<SmarketsRawEventWithMarkets, SmarketsRawEventWithMarkets> {
155
155
  private readonly ctx;
156
- constructor(ctx: FetcherContext);
156
+ private readonly baseUrl;
157
+ constructor(ctx: FetcherContext, baseUrl?: string);
157
158
  fetchRawMarkets(params?: MarketFilterParams): Promise<SmarketsRawEventWithMarkets[]>;
158
159
  fetchRawEvents(params: EventFetchParams): Promise<SmarketsRawEventWithMarkets[]>;
159
160
  fetchRawOrderBook(id: string): Promise<Record<string, SmarketsRawQuote>>;
@@ -13,8 +13,10 @@ const EVENT_ID_BATCH_SIZE = 50;
13
13
  const MARKET_ID_BATCH_SIZE = 100;
14
14
  class SmarketsFetcher {
15
15
  ctx;
16
- constructor(ctx) {
16
+ baseUrl;
17
+ constructor(ctx, baseUrl) {
17
18
  this.ctx = ctx;
19
+ this.baseUrl = baseUrl || 'https://api.smarkets.com';
18
20
  }
19
21
  // -- Markets (returns enriched events with nested markets/contracts) ------
20
22
  async fetchRawMarkets(params) {
@@ -54,8 +56,7 @@ class SmarketsFetcher {
54
56
  (0, validation_1.validateIdFormat)(id, 'OrderBook');
55
57
  // get_quotes is marked as private in the spec but works without auth
56
58
  // (returns delayed data). Use a direct HTTP call so it works without credentials.
57
- const smarketsBase = process.env.SMARKETS_BASE_URL || 'https://api.smarkets.com';
58
- const url = `${smarketsBase}/v3/markets/${encodeURIComponent(id)}/quotes/`;
59
+ const url = `${this.baseUrl}/v3/markets/${encodeURIComponent(id)}/quotes/`;
59
60
  const headers = {
60
61
  ...this.ctx.getHeaders(),
61
62
  };
@@ -52,7 +52,7 @@ class SmarketsExchange extends BaseExchange_1.PredictionMarketExchange {
52
52
  callApi: this.callApi.bind(this),
53
53
  getHeaders: () => this.auth?.getHeaders('', '') ?? {},
54
54
  };
55
- this.fetcher = new fetcher_1.SmarketsFetcher(ctx);
55
+ this.fetcher = new fetcher_1.SmarketsFetcher(ctx, this.config.apiUrl);
56
56
  this.normalizer = new normalizer_1.SmarketsNormalizer();
57
57
  }
58
58
  get name() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmxt-core",
3
- "version": "2.37.12",
3
+ "version": "2.37.14",
4
4
  "description": "pmxt is a unified prediction market data API. The ccxt for prediction markets.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -29,8 +29,8 @@
29
29
  "test": "jest -c jest.config.js",
30
30
  "server": "tsx watch src/server/index.ts",
31
31
  "server:prod": "node dist/server/index.js",
32
- "generate:sdk:python": "npx @openapitools/openapi-generator-cli generate -i src/server/openapi.yaml -g python -o ../sdks/python/generated --package-name pmxt_internal --additional-properties=projectName=pmxt-internal,packageVersion=2.37.12,library=urllib3",
33
- "generate:sdk:typescript": "npx @openapitools/openapi-generator-cli generate -i src/server/openapi.yaml -g typescript-fetch -o ../sdks/typescript/generated --additional-properties=npmName=pmxtjs,npmVersion=2.37.12,supportsES6=true,typescriptThreePlus=true && node ../sdks/typescript/scripts/fix-generated.js",
32
+ "generate:sdk:python": "npx @openapitools/openapi-generator-cli generate -i src/server/openapi.yaml -g python -o ../sdks/python/generated --package-name pmxt_internal --additional-properties=projectName=pmxt-internal,packageVersion=2.37.14,library=urllib3",
33
+ "generate:sdk:typescript": "npx @openapitools/openapi-generator-cli generate -i src/server/openapi.yaml -g typescript-fetch -o ../sdks/typescript/generated --additional-properties=npmName=pmxtjs,npmVersion=2.37.14,supportsES6=true,typescriptThreePlus=true && node ../sdks/typescript/scripts/fix-generated.js",
34
34
  "fetch:openapi": "node scripts/fetch-openapi-specs.js",
35
35
  "extract:jsdoc": "node ../scripts/extract-jsdoc.js",
36
36
  "generate:docs": "npm run extract:jsdoc && node ../scripts/generate-api-docs.js",
@@ -47,7 +47,7 @@
47
47
  "dependencies": {
48
48
  "@limitless-exchange/sdk": "^1.0.5",
49
49
  "@opinion-labs/opinion-clob-sdk": "^0.6.0",
50
- "@polymarket/clob-client-v2": "^1.0.0",
50
+ "@polymarket/clob-client-v2": "^1.0.5",
51
51
  "@prob/clob": "0.5.0",
52
52
  "@solana/web3.js": "^1.98.4",
53
53
  "@types/express": "^5.0.6",