@predictorsdk/client 0.5.0 → 0.6.0
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.
- package/dist/Client.d.ts +25 -1
- package/dist/Client.js +143 -1
- package/dist/api/client/requests/GetEventRequest.d.ts +1 -1
- package/dist/api/client/requests/GetMarketRequest.d.ts +13 -0
- package/dist/api/client/requests/GetMarketRequest.js +2 -0
- package/dist/api/client/requests/index.d.ts +1 -0
- package/dist/api/types/GetMarketRequestPlatform.d.ts +7 -0
- package/dist/api/types/GetMarketRequestPlatform.js +7 -0
- package/dist/api/types/MarketDetailOutcome.d.ts +4 -0
- package/dist/api/types/MarketDetailOutcome.js +2 -0
- package/dist/api/types/MarketDetailResponse.d.ts +18 -0
- package/dist/api/types/MarketDetailResponse.js +2 -0
- package/dist/api/types/MarketDetailResponseProvider.d.ts +8 -0
- package/dist/api/types/MarketDetailResponseProvider.js +8 -0
- package/dist/api/types/MarketDetailResponseStatus.d.ts +7 -0
- package/dist/api/types/MarketDetailResponseStatus.js +7 -0
- package/dist/api/types/index.d.ts +5 -0
- package/dist/api/types/index.js +5 -0
- package/dist/serialization/types/GetMarketRequestPlatform.d.ts +7 -0
- package/dist/serialization/types/GetMarketRequestPlatform.js +3 -0
- package/dist/serialization/types/MarketDetailOutcome.d.ts +9 -0
- package/dist/serialization/types/MarketDetailOutcome.js +5 -0
- package/dist/serialization/types/MarketDetailResponse.d.ts +17 -0
- package/dist/serialization/types/MarketDetailResponse.js +13 -0
- package/dist/serialization/types/MarketDetailResponseProvider.d.ts +7 -0
- package/dist/serialization/types/MarketDetailResponseProvider.js +3 -0
- package/dist/serialization/types/MarketDetailResponseStatus.d.ts +7 -0
- package/dist/serialization/types/MarketDetailResponseStatus.js +3 -0
- package/dist/serialization/types/index.d.ts +5 -0
- package/dist/serialization/types/index.js +5 -0
- package/package.json +1 -1
package/dist/Client.d.ts
CHANGED
|
@@ -46,6 +46,30 @@ export declare class PredictorSDKClient {
|
|
|
46
46
|
*/
|
|
47
47
|
getMarkets(request?: PredictorSDK.GetMarketsRequest, requestOptions?: PredictorSDKClient.RequestOptions): core.HttpResponsePromise<PredictorSDK.MarketsListResponse>;
|
|
48
48
|
private __getMarkets;
|
|
49
|
+
/**
|
|
50
|
+
* Returns a single market across the four supported platforms. The `market_id` is either the composite form returned by `GET /v1/markets` (`{provider}:{native_id}`, e.g. `kalshi:KXMLBGAME-26MAY262005HOUTEX-TEX`) or the platform-native identifier. Composite IDs dispatch unambiguously by prefix. Native IDs are routed by format inference: Kalshi tickers match the all-caps-with-hyphens shape (`KX…-…`); SX Bet hashes match `0x` + 64 hex characters; numeric ids and kebab-case slugs are shared shape between Polymarket and Predict and probe Polymarket first, falling back to Predict on 404. Pass `?platform=` explicitly to skip the probe.
|
|
51
|
+
*
|
|
52
|
+
* Response shape is intentionally strict-universal: only fields every platform's single-market endpoint exposes natively without a second fetch. Pricing lives in SX Bet's order book, Predict's market record has no close timestamp (that lives on the parent category), and SX Bet/Predict don't expose volume or liquidity on the market record in any reliable form — those fields are deliberately omitted from v0 to avoid asymmetric nullable shapes. Additions are additive when the underlying coverage improves.
|
|
53
|
+
*
|
|
54
|
+
* @param {PredictorSDK.GetMarketRequest} request
|
|
55
|
+
* @param {PredictorSDKClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
56
|
+
*
|
|
57
|
+
* @throws {@link PredictorSDK.BadRequestError}
|
|
58
|
+
* @throws {@link PredictorSDK.UnauthorizedError}
|
|
59
|
+
* @throws {@link PredictorSDK.PaymentRequiredError}
|
|
60
|
+
* @throws {@link PredictorSDK.ForbiddenError}
|
|
61
|
+
* @throws {@link PredictorSDK.NotFoundError}
|
|
62
|
+
* @throws {@link PredictorSDK.TooManyRequestsError}
|
|
63
|
+
* @throws {@link PredictorSDK.BadGatewayError}
|
|
64
|
+
* @throws {@link PredictorSDK.ServiceUnavailableError}
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* await client.getMarket({
|
|
68
|
+
* marketId: "kalshi:KXMLBGAME-26MAY262005HOUTEX-TEX"
|
|
69
|
+
* })
|
|
70
|
+
*/
|
|
71
|
+
getMarket(request: PredictorSDK.GetMarketRequest, requestOptions?: PredictorSDKClient.RequestOptions): core.HttpResponsePromise<PredictorSDK.MarketDetailResponse>;
|
|
72
|
+
private __getMarket;
|
|
49
73
|
/**
|
|
50
74
|
* Returns per-second price data for a Binance trading pair. When called without a time range, returns the latest price. With `start_time` and `end_time`, returns historical per-second prices in newest-first order. Supports cursor-based pagination for large result sets. Unknown or invalid symbols return `200` with `{"prices":[]}` and omit `total`.
|
|
51
75
|
*
|
|
@@ -122,7 +146,7 @@ export declare class PredictorSDKClient {
|
|
|
122
146
|
listPolymarketWalletPositions(request?: PredictorSDK.ListPolymarketWalletPositionsRequest, requestOptions?: PredictorSDKClient.RequestOptions): core.HttpResponsePromise<PredictorSDK.PolymarketPositionsResponse>;
|
|
123
147
|
private __listPolymarketWalletPositions;
|
|
124
148
|
/**
|
|
125
|
-
* Returns a single event and the markets nested under it on the identified platform. The `event_id` is the platform's native identifier — a Kalshi `event_ticker`, a Polymarket event slug, an SX Bet `eventId`, or a Predict market identifier. The `platform` is inferred from the ID format when unambiguous
|
|
149
|
+
* Returns a single event and the markets nested under it on the identified platform. The `event_id` is the platform's native identifier — a Kalshi `event_ticker`, a Polymarket event slug, an SX Bet `eventId`, or a Predict market identifier. The `platform` is inferred from the ID format when unambiguous (`KX…` → Kalshi, `L\d+` → SX Bet). Numeric IDs and kebab-case slugs are shared shape between Polymarket and Predict; if `?platform=` is omitted in that case, the service probes Polymarket first and falls back to Predict when Polymarket returns 404. Pass `?platform=` explicitly to skip the probe.
|
|
126
150
|
*
|
|
127
151
|
* Response is minimal in v0: each market is returned with its platform-native `market_id` and a human-readable `title`. Pricing, volume, status, and timestamps are intentionally deferred — they'll be added as additive fields to `EventMarket` in a later release. The endpoint mirrors the `/v1/markets` rollout pattern (titles first, fields later).
|
|
128
152
|
*
|
package/dist/Client.js
CHANGED
|
@@ -249,6 +249,148 @@ export class PredictorSDKClient {
|
|
|
249
249
|
}
|
|
250
250
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/markets");
|
|
251
251
|
}
|
|
252
|
+
/**
|
|
253
|
+
* Returns a single market across the four supported platforms. The `market_id` is either the composite form returned by `GET /v1/markets` (`{provider}:{native_id}`, e.g. `kalshi:KXMLBGAME-26MAY262005HOUTEX-TEX`) or the platform-native identifier. Composite IDs dispatch unambiguously by prefix. Native IDs are routed by format inference: Kalshi tickers match the all-caps-with-hyphens shape (`KX…-…`); SX Bet hashes match `0x` + 64 hex characters; numeric ids and kebab-case slugs are shared shape between Polymarket and Predict and probe Polymarket first, falling back to Predict on 404. Pass `?platform=` explicitly to skip the probe.
|
|
254
|
+
*
|
|
255
|
+
* Response shape is intentionally strict-universal: only fields every platform's single-market endpoint exposes natively without a second fetch. Pricing lives in SX Bet's order book, Predict's market record has no close timestamp (that lives on the parent category), and SX Bet/Predict don't expose volume or liquidity on the market record in any reliable form — those fields are deliberately omitted from v0 to avoid asymmetric nullable shapes. Additions are additive when the underlying coverage improves.
|
|
256
|
+
*
|
|
257
|
+
* @param {PredictorSDK.GetMarketRequest} request
|
|
258
|
+
* @param {PredictorSDKClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
259
|
+
*
|
|
260
|
+
* @throws {@link PredictorSDK.BadRequestError}
|
|
261
|
+
* @throws {@link PredictorSDK.UnauthorizedError}
|
|
262
|
+
* @throws {@link PredictorSDK.PaymentRequiredError}
|
|
263
|
+
* @throws {@link PredictorSDK.ForbiddenError}
|
|
264
|
+
* @throws {@link PredictorSDK.NotFoundError}
|
|
265
|
+
* @throws {@link PredictorSDK.TooManyRequestsError}
|
|
266
|
+
* @throws {@link PredictorSDK.BadGatewayError}
|
|
267
|
+
* @throws {@link PredictorSDK.ServiceUnavailableError}
|
|
268
|
+
*
|
|
269
|
+
* @example
|
|
270
|
+
* await client.getMarket({
|
|
271
|
+
* marketId: "kalshi:KXMLBGAME-26MAY262005HOUTEX-TEX"
|
|
272
|
+
* })
|
|
273
|
+
*/
|
|
274
|
+
getMarket(request, requestOptions) {
|
|
275
|
+
return core.HttpResponsePromise.fromPromise(this.__getMarket(request, requestOptions));
|
|
276
|
+
}
|
|
277
|
+
async __getMarket(request, requestOptions) {
|
|
278
|
+
const { marketId, platform } = request;
|
|
279
|
+
const _queryParams = {
|
|
280
|
+
platform: platform != null
|
|
281
|
+
? serializers.GetMarketRequestPlatform.jsonOrThrow(platform, {
|
|
282
|
+
unrecognizedObjectKeys: "strip",
|
|
283
|
+
omitUndefined: true,
|
|
284
|
+
})
|
|
285
|
+
: undefined,
|
|
286
|
+
};
|
|
287
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
288
|
+
const _headers = mergeHeaders(_authRequest.headers, this._options?.headers, requestOptions?.headers);
|
|
289
|
+
const _response = await core.fetcher({
|
|
290
|
+
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
291
|
+
(await core.Supplier.get(this._options.environment)) ??
|
|
292
|
+
environments.PredictorSDKEnvironment.Production, `v1/markets/${core.url.encodePathParam(marketId)}`),
|
|
293
|
+
method: "GET",
|
|
294
|
+
headers: _headers,
|
|
295
|
+
queryString: core.url
|
|
296
|
+
.queryBuilder()
|
|
297
|
+
.addMany(_queryParams)
|
|
298
|
+
.mergeAdditional(requestOptions?.queryParams)
|
|
299
|
+
.build(),
|
|
300
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
|
|
301
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
302
|
+
abortSignal: requestOptions?.abortSignal,
|
|
303
|
+
fetchFn: this._options?.fetch,
|
|
304
|
+
logging: this._options.logging,
|
|
305
|
+
});
|
|
306
|
+
if (_response.ok) {
|
|
307
|
+
return {
|
|
308
|
+
data: serializers.MarketDetailResponse.parseOrThrow(_response.body, {
|
|
309
|
+
unrecognizedObjectKeys: "passthrough",
|
|
310
|
+
allowUnrecognizedUnionMembers: true,
|
|
311
|
+
allowUnrecognizedEnumValues: true,
|
|
312
|
+
skipValidation: true,
|
|
313
|
+
breadcrumbsPrefix: ["response"],
|
|
314
|
+
}),
|
|
315
|
+
rawResponse: _response.rawResponse,
|
|
316
|
+
};
|
|
317
|
+
}
|
|
318
|
+
if (_response.error.reason === "status-code") {
|
|
319
|
+
switch (_response.error.statusCode) {
|
|
320
|
+
case 400:
|
|
321
|
+
throw new PredictorSDK.BadRequestError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
322
|
+
unrecognizedObjectKeys: "passthrough",
|
|
323
|
+
allowUnrecognizedUnionMembers: true,
|
|
324
|
+
allowUnrecognizedEnumValues: true,
|
|
325
|
+
skipValidation: true,
|
|
326
|
+
breadcrumbsPrefix: ["response"],
|
|
327
|
+
}), _response.rawResponse);
|
|
328
|
+
case 401:
|
|
329
|
+
throw new PredictorSDK.UnauthorizedError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
330
|
+
unrecognizedObjectKeys: "passthrough",
|
|
331
|
+
allowUnrecognizedUnionMembers: true,
|
|
332
|
+
allowUnrecognizedEnumValues: true,
|
|
333
|
+
skipValidation: true,
|
|
334
|
+
breadcrumbsPrefix: ["response"],
|
|
335
|
+
}), _response.rawResponse);
|
|
336
|
+
case 402:
|
|
337
|
+
throw new PredictorSDK.PaymentRequiredError(serializers.PaymentRequiredErrorBody.parseOrThrow(_response.error.body, {
|
|
338
|
+
unrecognizedObjectKeys: "passthrough",
|
|
339
|
+
allowUnrecognizedUnionMembers: true,
|
|
340
|
+
allowUnrecognizedEnumValues: true,
|
|
341
|
+
skipValidation: true,
|
|
342
|
+
breadcrumbsPrefix: ["response"],
|
|
343
|
+
}), _response.rawResponse);
|
|
344
|
+
case 403:
|
|
345
|
+
throw new PredictorSDK.ForbiddenError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
346
|
+
unrecognizedObjectKeys: "passthrough",
|
|
347
|
+
allowUnrecognizedUnionMembers: true,
|
|
348
|
+
allowUnrecognizedEnumValues: true,
|
|
349
|
+
skipValidation: true,
|
|
350
|
+
breadcrumbsPrefix: ["response"],
|
|
351
|
+
}), _response.rawResponse);
|
|
352
|
+
case 404:
|
|
353
|
+
throw new PredictorSDK.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
354
|
+
unrecognizedObjectKeys: "passthrough",
|
|
355
|
+
allowUnrecognizedUnionMembers: true,
|
|
356
|
+
allowUnrecognizedEnumValues: true,
|
|
357
|
+
skipValidation: true,
|
|
358
|
+
breadcrumbsPrefix: ["response"],
|
|
359
|
+
}), _response.rawResponse);
|
|
360
|
+
case 429:
|
|
361
|
+
throw new PredictorSDK.TooManyRequestsError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
362
|
+
unrecognizedObjectKeys: "passthrough",
|
|
363
|
+
allowUnrecognizedUnionMembers: true,
|
|
364
|
+
allowUnrecognizedEnumValues: true,
|
|
365
|
+
skipValidation: true,
|
|
366
|
+
breadcrumbsPrefix: ["response"],
|
|
367
|
+
}), _response.rawResponse);
|
|
368
|
+
case 502:
|
|
369
|
+
throw new PredictorSDK.BadGatewayError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
370
|
+
unrecognizedObjectKeys: "passthrough",
|
|
371
|
+
allowUnrecognizedUnionMembers: true,
|
|
372
|
+
allowUnrecognizedEnumValues: true,
|
|
373
|
+
skipValidation: true,
|
|
374
|
+
breadcrumbsPrefix: ["response"],
|
|
375
|
+
}), _response.rawResponse);
|
|
376
|
+
case 503:
|
|
377
|
+
throw new PredictorSDK.ServiceUnavailableError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
378
|
+
unrecognizedObjectKeys: "passthrough",
|
|
379
|
+
allowUnrecognizedUnionMembers: true,
|
|
380
|
+
allowUnrecognizedEnumValues: true,
|
|
381
|
+
skipValidation: true,
|
|
382
|
+
breadcrumbsPrefix: ["response"],
|
|
383
|
+
}), _response.rawResponse);
|
|
384
|
+
default:
|
|
385
|
+
throw new errors.PredictorSDKError({
|
|
386
|
+
statusCode: _response.error.statusCode,
|
|
387
|
+
body: _response.error.body,
|
|
388
|
+
rawResponse: _response.rawResponse,
|
|
389
|
+
});
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/markets/{market_id}");
|
|
393
|
+
}
|
|
252
394
|
/**
|
|
253
395
|
* Returns per-second price data for a Binance trading pair. When called without a time range, returns the latest price. With `start_time` and `end_time`, returns historical per-second prices in newest-first order. Supports cursor-based pagination for large result sets. Unknown or invalid symbols return `200` with `{"prices":[]}` and omit `total`.
|
|
254
396
|
*
|
|
@@ -664,7 +806,7 @@ export class PredictorSDKClient {
|
|
|
664
806
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/polymarket/wallet/positions");
|
|
665
807
|
}
|
|
666
808
|
/**
|
|
667
|
-
* Returns a single event and the markets nested under it on the identified platform. The `event_id` is the platform's native identifier — a Kalshi `event_ticker`, a Polymarket event slug, an SX Bet `eventId`, or a Predict market identifier. The `platform` is inferred from the ID format when unambiguous
|
|
809
|
+
* Returns a single event and the markets nested under it on the identified platform. The `event_id` is the platform's native identifier — a Kalshi `event_ticker`, a Polymarket event slug, an SX Bet `eventId`, or a Predict market identifier. The `platform` is inferred from the ID format when unambiguous (`KX…` → Kalshi, `L\d+` → SX Bet). Numeric IDs and kebab-case slugs are shared shape between Polymarket and Predict; if `?platform=` is omitted in that case, the service probes Polymarket first and falls back to Predict when Polymarket returns 404. Pass `?platform=` explicitly to skip the probe.
|
|
668
810
|
*
|
|
669
811
|
* Response is minimal in v0: each market is returned with its platform-native `market_id` and a human-readable `title`. Pricing, volume, status, and timestamps are intentionally deferred — they'll be added as additive fields to `EventMarket` in a later release. The endpoint mirrors the `/v1/markets` rollout pattern (titles first, fields later).
|
|
670
812
|
*
|
|
@@ -8,6 +8,6 @@ import type * as PredictorSDK from "../../index.js";
|
|
|
8
8
|
export interface GetEventRequest {
|
|
9
9
|
/** Platform-native event identifier. Examples per platform: Kalshi event ticker (`KXMLBGAME-26MAY221840CLEPHI`), Polymarket event slug (`mlb-cle-phi-2026-05-22`), SX Bet event id (`L10073358`), Predict market id (`110629`). */
|
|
10
10
|
eventId: string;
|
|
11
|
-
/** Optional platform override. When omitted, inferred from the `event_id` format: `KX…` → Kalshi, `L\d+` → SX Bet. Numeric IDs and kebab-case slugs are
|
|
11
|
+
/** Optional platform override. When omitted, inferred from the `event_id` format: `KX…` → Kalshi, `L\d+` → SX Bet. Numeric IDs and kebab-case slugs are shared shape between Polymarket and Predict; in that case the service probes Polymarket first and falls back to Predict on 404. Pass `platform` explicitly to skip the probe. */
|
|
12
12
|
platform?: PredictorSDK.GetEventRequestPlatform;
|
|
13
13
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type * as PredictorSDK from "../../index.js";
|
|
2
|
+
/**
|
|
3
|
+
* @example
|
|
4
|
+
* {
|
|
5
|
+
* marketId: "kalshi:KXMLBGAME-26MAY262005HOUTEX-TEX"
|
|
6
|
+
* }
|
|
7
|
+
*/
|
|
8
|
+
export interface GetMarketRequest {
|
|
9
|
+
/** Composite (`{provider}:{native_id}`) or platform-native market identifier. Examples per platform: Kalshi market ticker (`KXMLBGAME-26MAY262005HOUTEX-TEX`), Polymarket numeric id or slug (`540817` or `new-rhianna-album-before-gta-vi-926`), Predict market id (`356635`), SX Bet `marketHash` (`0x…64hex`). */
|
|
10
|
+
marketId: string;
|
|
11
|
+
/** Optional platform override. When omitted, inferred from the composite prefix or from the native ID format (`KX…` → Kalshi, `0x…64hex` → SX Bet). Numeric IDs and kebab-case slugs are shared shape between Polymarket and Predict; in that case the service probes Polymarket first and falls back to Predict on 404. Pass `platform` explicitly to skip the probe. When the override contradicts a composite prefix (e.g. `kalshi:X` with `?platform=polymarket`), the request returns 400. */
|
|
12
|
+
platform?: PredictorSDK.GetMarketRequestPlatform;
|
|
13
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export type { GetBinanceCryptoPricesRequest } from "./GetBinanceCryptoPricesRequest.js";
|
|
2
2
|
export type { GetEventRequest } from "./GetEventRequest.js";
|
|
3
|
+
export type { GetMarketRequest } from "./GetMarketRequest.js";
|
|
3
4
|
export type { GetMarketsRequest } from "./GetMarketsRequest.js";
|
|
4
5
|
export type { GetPolymarketWalletRequest } from "./GetPolymarketWalletRequest.js";
|
|
5
6
|
export type { GetSportsMatchingMarketsRequest } from "./GetSportsMatchingMarketsRequest.js";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const GetMarketRequestPlatform: {
|
|
2
|
+
readonly Kalshi: "kalshi";
|
|
3
|
+
readonly Polymarket: "polymarket";
|
|
4
|
+
readonly Predict: "predict";
|
|
5
|
+
readonly Sxbet: "sxbet";
|
|
6
|
+
};
|
|
7
|
+
export type GetMarketRequestPlatform = (typeof GetMarketRequestPlatform)[keyof typeof GetMarketRequestPlatform];
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export interface MarketDetailOutcome {
|
|
2
|
+
/** Outcome label as the platform reports it. Kalshi binary markets normalize to `Yes`/`No`; Polymarket parses the stringified outcomes array (also typically `Yes`/`No`); Predict reports per-outcome names; SX Bet uses outcome-one/outcome-two names (e.g. team labels with spreads applied). */
|
|
3
|
+
name: string;
|
|
4
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type * as PredictorSDK from "../index.js";
|
|
2
|
+
/**
|
|
3
|
+
* Single-market detail across all four supported platforms. Strict-universal v0 shape — only fields every platform exposes natively without a second fetch. Pricing/volume/closes_at/ event_id are deliberately omitted, see the endpoint description for the rationale.
|
|
4
|
+
*/
|
|
5
|
+
export interface MarketDetailResponse {
|
|
6
|
+
/** Composite market identifier in the format `{provider}:{provider_id}`. Matches the `id` field returned by `GET /v1/markets` so list output flows into detail lookups without preprocessing. */
|
|
7
|
+
id: string;
|
|
8
|
+
/** Prediction market provider the market_id resolved against. */
|
|
9
|
+
provider: PredictorSDK.MarketDetailResponseProvider;
|
|
10
|
+
/** Platform-native market identifier. Kalshi ticker, Polymarket numeric id, Predict numeric id, or SX Bet `marketHash`. For Polymarket markets resolved by slug, this is normalized to the numeric id. */
|
|
11
|
+
providerId: string;
|
|
12
|
+
/** Human-readable market title. Each platform exposes a slightly different field — Kalshi `title`, Polymarket `question`, Predict `title`, SX Bet composed from team names with outcome-name fallback for outright markets. */
|
|
13
|
+
title: string;
|
|
14
|
+
/** Normalized lifecycle status. Mapping per platform: Kalshi `active` → open · `closed`/`determined` → closed · `settled`/`finalized` → settled. Polymarket `archived` → settled · `closed && !archived` → closed · otherwise → open. Predict `tradingStatus=OPEN` → open · `CLOSED && !RESOLVED` → closed · `status=RESOLVED` → settled. SX Bet `ACTIVE` → open · otherwise closed. Unknown upstream values default to closed. */
|
|
15
|
+
status: PredictorSDK.MarketDetailResponseStatus;
|
|
16
|
+
/** Outcome labels for the market. Every supported platform models per-market outcomes as a 2-element list in practice (multi-outcome events are modeled as multiple binary markets nested under one event/category). Prices and sizes are deliberately omitted from v0 — see the endpoint description. */
|
|
17
|
+
outcomes: PredictorSDK.MarketDetailOutcome[];
|
|
18
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** Prediction market provider the market_id resolved against. */
|
|
2
|
+
export declare const MarketDetailResponseProvider: {
|
|
3
|
+
readonly Kalshi: "kalshi";
|
|
4
|
+
readonly Polymarket: "polymarket";
|
|
5
|
+
readonly Predict: "predict";
|
|
6
|
+
readonly Sxbet: "sxbet";
|
|
7
|
+
};
|
|
8
|
+
export type MarketDetailResponseProvider = (typeof MarketDetailResponseProvider)[keyof typeof MarketDetailResponseProvider];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
/** Prediction market provider the market_id resolved against. */
|
|
3
|
+
export const MarketDetailResponseProvider = {
|
|
4
|
+
Kalshi: "kalshi",
|
|
5
|
+
Polymarket: "polymarket",
|
|
6
|
+
Predict: "predict",
|
|
7
|
+
Sxbet: "sxbet",
|
|
8
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Normalized lifecycle status. Mapping per platform: Kalshi `active` → open · `closed`/`determined` → closed · `settled`/`finalized` → settled. Polymarket `archived` → settled · `closed && !archived` → closed · otherwise → open. Predict `tradingStatus=OPEN` → open · `CLOSED && !RESOLVED` → closed · `status=RESOLVED` → settled. SX Bet `ACTIVE` → open · otherwise closed. Unknown upstream values default to closed. */
|
|
2
|
+
export declare const MarketDetailResponseStatus: {
|
|
3
|
+
readonly Open: "open";
|
|
4
|
+
readonly Closed: "closed";
|
|
5
|
+
readonly Settled: "settled";
|
|
6
|
+
};
|
|
7
|
+
export type MarketDetailResponseStatus = (typeof MarketDetailResponseStatus)[keyof typeof MarketDetailResponseStatus];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
/** Normalized lifecycle status. Mapping per platform: Kalshi `active` → open · `closed`/`determined` → closed · `settled`/`finalized` → settled. Polymarket `archived` → settled · `closed && !archived` → closed · otherwise → open. Predict `tradingStatus=OPEN` → open · `CLOSED && !RESOLVED` → closed · `status=RESOLVED` → settled. SX Bet `ACTIVE` → open · otherwise closed. Unknown upstream values default to closed. */
|
|
3
|
+
export const MarketDetailResponseStatus = {
|
|
4
|
+
Open: "open",
|
|
5
|
+
Closed: "closed",
|
|
6
|
+
Settled: "settled",
|
|
7
|
+
};
|
|
@@ -6,6 +6,11 @@ export * from "./EventMarket.js";
|
|
|
6
6
|
export * from "./EventResponse.js";
|
|
7
7
|
export * from "./EventResponsePlatform.js";
|
|
8
8
|
export * from "./GetEventRequestPlatform.js";
|
|
9
|
+
export * from "./GetMarketRequestPlatform.js";
|
|
10
|
+
export * from "./MarketDetailOutcome.js";
|
|
11
|
+
export * from "./MarketDetailResponse.js";
|
|
12
|
+
export * from "./MarketDetailResponseProvider.js";
|
|
13
|
+
export * from "./MarketDetailResponseStatus.js";
|
|
9
14
|
export * from "./MarketsListResponse.js";
|
|
10
15
|
export * from "./PaginationBlock.js";
|
|
11
16
|
export * from "./PaymentRequiredErrorAction.js";
|
package/dist/api/types/index.js
CHANGED
|
@@ -6,6 +6,11 @@ export * from "./EventMarket.js";
|
|
|
6
6
|
export * from "./EventResponse.js";
|
|
7
7
|
export * from "./EventResponsePlatform.js";
|
|
8
8
|
export * from "./GetEventRequestPlatform.js";
|
|
9
|
+
export * from "./GetMarketRequestPlatform.js";
|
|
10
|
+
export * from "./MarketDetailOutcome.js";
|
|
11
|
+
export * from "./MarketDetailResponse.js";
|
|
12
|
+
export * from "./MarketDetailResponseProvider.js";
|
|
13
|
+
export * from "./MarketDetailResponseStatus.js";
|
|
9
14
|
export * from "./MarketsListResponse.js";
|
|
10
15
|
export * from "./PaginationBlock.js";
|
|
11
16
|
export * from "./PaymentRequiredErrorAction.js";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type * as PredictorSDK from "../../api/index.js";
|
|
2
|
+
import * as core from "../../core/index.js";
|
|
3
|
+
import type * as serializers from "../index.js";
|
|
4
|
+
export declare const GetMarketRequestPlatform: core.serialization.Schema<serializers.GetMarketRequestPlatform.Raw, PredictorSDK.GetMarketRequestPlatform>;
|
|
5
|
+
export declare namespace GetMarketRequestPlatform {
|
|
6
|
+
type Raw = "kalshi" | "polymarket" | "predict" | "sxbet";
|
|
7
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type * as PredictorSDK from "../../api/index.js";
|
|
2
|
+
import * as core from "../../core/index.js";
|
|
3
|
+
import type * as serializers from "../index.js";
|
|
4
|
+
export declare const MarketDetailOutcome: core.serialization.ObjectSchema<serializers.MarketDetailOutcome.Raw, PredictorSDK.MarketDetailOutcome>;
|
|
5
|
+
export declare namespace MarketDetailOutcome {
|
|
6
|
+
interface Raw {
|
|
7
|
+
name: string;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type * as PredictorSDK from "../../api/index.js";
|
|
2
|
+
import * as core from "../../core/index.js";
|
|
3
|
+
import type * as serializers from "../index.js";
|
|
4
|
+
import { MarketDetailOutcome } from "./MarketDetailOutcome.js";
|
|
5
|
+
import { MarketDetailResponseProvider } from "./MarketDetailResponseProvider.js";
|
|
6
|
+
import { MarketDetailResponseStatus } from "./MarketDetailResponseStatus.js";
|
|
7
|
+
export declare const MarketDetailResponse: core.serialization.ObjectSchema<serializers.MarketDetailResponse.Raw, PredictorSDK.MarketDetailResponse>;
|
|
8
|
+
export declare namespace MarketDetailResponse {
|
|
9
|
+
interface Raw {
|
|
10
|
+
id: string;
|
|
11
|
+
provider: MarketDetailResponseProvider.Raw;
|
|
12
|
+
provider_id: string;
|
|
13
|
+
title: string;
|
|
14
|
+
status: MarketDetailResponseStatus.Raw;
|
|
15
|
+
outcomes: MarketDetailOutcome.Raw[];
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
import * as core from "../../core/index.js";
|
|
3
|
+
import { MarketDetailOutcome } from "./MarketDetailOutcome.js";
|
|
4
|
+
import { MarketDetailResponseProvider } from "./MarketDetailResponseProvider.js";
|
|
5
|
+
import { MarketDetailResponseStatus } from "./MarketDetailResponseStatus.js";
|
|
6
|
+
export const MarketDetailResponse = core.serialization.object({
|
|
7
|
+
id: core.serialization.string(),
|
|
8
|
+
provider: MarketDetailResponseProvider,
|
|
9
|
+
providerId: core.serialization.property("provider_id", core.serialization.string()),
|
|
10
|
+
title: core.serialization.string(),
|
|
11
|
+
status: MarketDetailResponseStatus,
|
|
12
|
+
outcomes: core.serialization.list(MarketDetailOutcome),
|
|
13
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type * as PredictorSDK from "../../api/index.js";
|
|
2
|
+
import * as core from "../../core/index.js";
|
|
3
|
+
import type * as serializers from "../index.js";
|
|
4
|
+
export declare const MarketDetailResponseProvider: core.serialization.Schema<serializers.MarketDetailResponseProvider.Raw, PredictorSDK.MarketDetailResponseProvider>;
|
|
5
|
+
export declare namespace MarketDetailResponseProvider {
|
|
6
|
+
type Raw = "kalshi" | "polymarket" | "predict" | "sxbet";
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type * as PredictorSDK from "../../api/index.js";
|
|
2
|
+
import * as core from "../../core/index.js";
|
|
3
|
+
import type * as serializers from "../index.js";
|
|
4
|
+
export declare const MarketDetailResponseStatus: core.serialization.Schema<serializers.MarketDetailResponseStatus.Raw, PredictorSDK.MarketDetailResponseStatus>;
|
|
5
|
+
export declare namespace MarketDetailResponseStatus {
|
|
6
|
+
type Raw = "open" | "closed" | "settled";
|
|
7
|
+
}
|
|
@@ -6,6 +6,11 @@ export * from "./EventMarket.js";
|
|
|
6
6
|
export * from "./EventResponse.js";
|
|
7
7
|
export * from "./EventResponsePlatform.js";
|
|
8
8
|
export * from "./GetEventRequestPlatform.js";
|
|
9
|
+
export * from "./GetMarketRequestPlatform.js";
|
|
10
|
+
export * from "./MarketDetailOutcome.js";
|
|
11
|
+
export * from "./MarketDetailResponse.js";
|
|
12
|
+
export * from "./MarketDetailResponseProvider.js";
|
|
13
|
+
export * from "./MarketDetailResponseStatus.js";
|
|
9
14
|
export * from "./MarketsListResponse.js";
|
|
10
15
|
export * from "./PaginationBlock.js";
|
|
11
16
|
export * from "./PaymentRequiredErrorAction.js";
|
|
@@ -6,6 +6,11 @@ export * from "./EventMarket.js";
|
|
|
6
6
|
export * from "./EventResponse.js";
|
|
7
7
|
export * from "./EventResponsePlatform.js";
|
|
8
8
|
export * from "./GetEventRequestPlatform.js";
|
|
9
|
+
export * from "./GetMarketRequestPlatform.js";
|
|
10
|
+
export * from "./MarketDetailOutcome.js";
|
|
11
|
+
export * from "./MarketDetailResponse.js";
|
|
12
|
+
export * from "./MarketDetailResponseProvider.js";
|
|
13
|
+
export * from "./MarketDetailResponseStatus.js";
|
|
9
14
|
export * from "./MarketsListResponse.js";
|
|
10
15
|
export * from "./PaginationBlock.js";
|
|
11
16
|
export * from "./PaymentRequiredErrorAction.js";
|