@liberfi.io/react-predict 0.1.17 → 0.1.19
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/index.d.mts +19 -5
- package/dist/index.d.ts +19 -5
- package/dist/index.js +63 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +59 -1
- package/dist/index.mjs.map +1 -1
- package/dist/{server-C52oqeh8.d.mts → server-CiGfmztS.d.mts} +100 -1
- package/dist/{server-C52oqeh8.d.ts → server-CiGfmztS.d.ts} +100 -1
- package/dist/server.d.mts +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.js +36 -0
- package/dist/server.js.map +1 -1
- package/dist/server.mjs +34 -1
- package/dist/server.mjs.map +1 -1
- package/package.json +3 -3
|
@@ -247,6 +247,79 @@ interface SimilarEventsParams {
|
|
|
247
247
|
/** When true, only return events from the same provider. */
|
|
248
248
|
same_source?: boolean;
|
|
249
249
|
}
|
|
250
|
+
/** Match group lifecycle status. */
|
|
251
|
+
type MatchStatus = "active" | "expired";
|
|
252
|
+
/** One provider's event within a MatchGroup. */
|
|
253
|
+
interface MatchGroupEntry {
|
|
254
|
+
id: number;
|
|
255
|
+
group_id: number;
|
|
256
|
+
source: ProviderSource;
|
|
257
|
+
event: PredictEvent;
|
|
258
|
+
}
|
|
259
|
+
/** Pairwise market comparison within a MatchGroup. */
|
|
260
|
+
interface MatchGroupMarket {
|
|
261
|
+
id: number;
|
|
262
|
+
group_id: number;
|
|
263
|
+
source_a: ProviderSource;
|
|
264
|
+
market_a: PredictMarket;
|
|
265
|
+
source_b: ProviderSource;
|
|
266
|
+
market_b: PredictMarket;
|
|
267
|
+
spread?: number;
|
|
268
|
+
spread_percent?: number;
|
|
269
|
+
arb_profit?: number;
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* A group of matched events across N providers referring to the same
|
|
273
|
+
* real-world prediction. `entries.length >= 2`.
|
|
274
|
+
*/
|
|
275
|
+
interface MatchGroup {
|
|
276
|
+
id: number;
|
|
277
|
+
title: string;
|
|
278
|
+
entries: MatchGroupEntry[];
|
|
279
|
+
matched_markets?: MatchGroupMarket[];
|
|
280
|
+
confidence: number;
|
|
281
|
+
max_spread?: number;
|
|
282
|
+
combined_volume?: number;
|
|
283
|
+
combined_volume_24h?: number;
|
|
284
|
+
status: MatchStatus;
|
|
285
|
+
created_at: string;
|
|
286
|
+
updated_at: string;
|
|
287
|
+
}
|
|
288
|
+
/** Valid sort fields for the matches list endpoint. */
|
|
289
|
+
type MatchSortField = "spread" | "volume" | "confidence";
|
|
290
|
+
/** Query parameters for `GET /api/v1/matches`. */
|
|
291
|
+
interface MatchesParams {
|
|
292
|
+
sort_by?: MatchSortField;
|
|
293
|
+
sort_asc?: boolean;
|
|
294
|
+
min_spread?: number;
|
|
295
|
+
/** Minimum combined volume (USD) filter. */
|
|
296
|
+
min_volume?: number;
|
|
297
|
+
/** Comma-separated provider sources, e.g. `"kalshi,polymarket"`. */
|
|
298
|
+
sources?: string;
|
|
299
|
+
status?: MatchStatus;
|
|
300
|
+
search?: string;
|
|
301
|
+
limit?: number;
|
|
302
|
+
cursor?: string;
|
|
303
|
+
}
|
|
304
|
+
/** Aggregate statistics returned inline with the matches listing. */
|
|
305
|
+
interface MatchesStats {
|
|
306
|
+
total_matches: number;
|
|
307
|
+
avg_spread: number;
|
|
308
|
+
max_spread: number;
|
|
309
|
+
matches_over_5_percent: number;
|
|
310
|
+
matches_over_3_percent: number;
|
|
311
|
+
total_volume: number;
|
|
312
|
+
total_volume_24h: number;
|
|
313
|
+
}
|
|
314
|
+
/** Paginated match group result with inline aggregate stats. */
|
|
315
|
+
interface MatchGroupPage {
|
|
316
|
+
items: MatchGroup[];
|
|
317
|
+
next_cursor?: string;
|
|
318
|
+
has_more?: boolean;
|
|
319
|
+
limit?: number;
|
|
320
|
+
total?: number;
|
|
321
|
+
stats?: MatchesStats;
|
|
322
|
+
}
|
|
250
323
|
/** A single user position in a prediction market. */
|
|
251
324
|
interface PredictPosition {
|
|
252
325
|
source: ProviderSource;
|
|
@@ -566,6 +639,18 @@ declare class PredictClient {
|
|
|
566
639
|
* Maps to `GET /api/v1/kyc/kalshi?wallet_address=...`.
|
|
567
640
|
*/
|
|
568
641
|
checkDFlowKYC(walletAddress: string): Promise<DFlowKYCStatus>;
|
|
642
|
+
/**
|
|
643
|
+
* List cross-platform matched event groups with inline aggregate stats.
|
|
644
|
+
*
|
|
645
|
+
* Maps to `GET /api/v1/matches`.
|
|
646
|
+
*/
|
|
647
|
+
listMatches(params?: MatchesParams): Promise<MatchGroupPage>;
|
|
648
|
+
/**
|
|
649
|
+
* Fetch a single match group by ID.
|
|
650
|
+
*
|
|
651
|
+
* Maps to `GET /api/v1/matches/:id`.
|
|
652
|
+
*/
|
|
653
|
+
getMatch(id: number): Promise<MatchGroup>;
|
|
569
654
|
/** Maps to `GET /api/v1/trades?source=...&wallet=...`. */
|
|
570
655
|
listTrades(params: ListTradesParams): Promise<PredictPage<PredictTrade>>;
|
|
571
656
|
}
|
|
@@ -800,6 +885,20 @@ declare function marketQueryKey(slug: string, source?: ProviderSource): unknown[
|
|
|
800
885
|
*/
|
|
801
886
|
declare function fetchMarket(client: PredictClient, slug: string, source?: ProviderSource): Promise<PredictMarket>;
|
|
802
887
|
|
|
888
|
+
/**
|
|
889
|
+
* Server-safe pure functions for matches query parameters.
|
|
890
|
+
*
|
|
891
|
+
* This module contains NO React imports and can be used in Server Components,
|
|
892
|
+
* route handlers, or any non-browser context.
|
|
893
|
+
*/
|
|
894
|
+
|
|
895
|
+
/** Query key for match group list queries. */
|
|
896
|
+
declare function matchesQueryKey(params?: MatchesParams): unknown[];
|
|
897
|
+
/** Query key for a single match group. */
|
|
898
|
+
declare function matchQueryKey(id: number): unknown[];
|
|
899
|
+
/** Fetch a page of matches (usable in both client and server contexts). */
|
|
900
|
+
declare function fetchMatchesPage(client: PredictClient, params: MatchesParams): Promise<MatchGroupPage>;
|
|
901
|
+
|
|
803
902
|
/**
|
|
804
903
|
* Polymarket L2 HMAC-SHA256 signing utilities.
|
|
805
904
|
*
|
|
@@ -1031,4 +1130,4 @@ interface BuildSignedOrderInput extends BuildOrderMessageInput {
|
|
|
1031
1130
|
*/
|
|
1032
1131
|
declare function buildSignedOrder(input: BuildSignedOrderInput): SignedOrder;
|
|
1033
1132
|
|
|
1034
|
-
export { type
|
|
1133
|
+
export { type OrderSide as $, createPredictClient as A, type BalanceResponse as B, type Candlestick as C, type DFlowQuoteRequest as D, type EventStatus as E, createPredictWsClient as F, type PredictWsClientConfig as G, type ProviderMeta as H, type PredictTag as I, type SettlementSource as J, type MarketStatus as K, type ListEventsParams as L, type MatchesParams as M, type MarketResult as N, type Orderbook as O, PredictClient as P, type MarketOutcome as Q, type EventSortField as R, type SimilarEventsParams as S, type OrderbookLevel as T, type TradeType as U, type EventSummary as V, type WsConnectionStatus as W, type MarketSummary as X, type PricePoint as Y, type PredictPosition as Z, type OrderStatus as _, PredictWsClient as a, type DFlowOrderContext as a0, type PolymarketOrderType as a1, type MatchStatus as a2, type MatchGroupEntry as a3, type MatchGroupMarket as a4, type MatchSortField as a5, type MatchesStats as a6, type WsChannel as a7, type WsChannelEvent as a8, type WsClientMessage as a9, type HttpMethod as aA, type PolymarketL2HeadersInput as aB, type PolymarketL2Headers as aC, type BuildClobAuthMessageInput as aD, CTF_EXCHANGE_ADDRESS as aE, NEG_RISK_CTF_EXCHANGE_ADDRESS as aF, USDC_ADDRESS as aG, POLYGON_CHAIN_ID as aH, buildCtfExchangeDomain as aI, CTF_ORDER_TYPES as aJ, ORDER_TYPE as aK, SIDE as aL, buildOrderMessage as aM, buildSignedOrder as aN, type BuildOrderMessageInput as aO, type OrderMessage as aP, type BuildSignedOrderInput as aQ, type SignedOrder as aR, DEFAULT_PAGE_SIZE as aS, type WsSubscribeMessage as aa, type WsPingMessage as ab, type WsServerMessage as ac, type WsPongMessage as ad, type WsSubscribedMessage as ae, type WsErrorCode as af, type WsErrorMessage as ag, eventQueryKey as ah, fetchEvent as ai, resolveTagSlug as aj, resolveEventsParams as ak, infiniteEventsQueryKey as al, fetchEventsPage as am, type ResolveEventsParamsInput as an, type TagSlugSelection as ao, marketQueryKey as ap, fetchMarket as aq, matchesQueryKey as ar, matchQueryKey as as, fetchMatchesPage as at, CLOB_AUTH_DOMAIN as au, CLOB_AUTH_TYPES as av, buildClobAuthMessage as aw, hmacSha256Base64 as ax, buildPolymarketL2Headers as ay, derivePolymarketApiKey as az, type PredictPage as b, type PredictEvent as c, type ProviderSource as d, type PredictMarket as e, type ListMarketTradesParams as f, type PredictTrade as g, type PriceHistoryRange as h, type PriceHistoryResponse as i, type ListCandlesticksParams as j, type PositionsResponse as k, type ListOrdersParams as l, type PredictOrder as m, type CancelOrderResult as n, type MatchGroupPage as o, type MatchGroup as p, type ListTradesParams as q, type DFlowQuoteResponse as r, type DFlowSubmitResponse as s, type DFlowSubmitRequest as t, type DFlowKYCStatus as u, type WsDataMessage as v, type WsPriceEvent as w, type WsOrderbookEvent as x, type WsTradeEvent as y, type CreateOrderInput as z };
|
|
@@ -247,6 +247,79 @@ interface SimilarEventsParams {
|
|
|
247
247
|
/** When true, only return events from the same provider. */
|
|
248
248
|
same_source?: boolean;
|
|
249
249
|
}
|
|
250
|
+
/** Match group lifecycle status. */
|
|
251
|
+
type MatchStatus = "active" | "expired";
|
|
252
|
+
/** One provider's event within a MatchGroup. */
|
|
253
|
+
interface MatchGroupEntry {
|
|
254
|
+
id: number;
|
|
255
|
+
group_id: number;
|
|
256
|
+
source: ProviderSource;
|
|
257
|
+
event: PredictEvent;
|
|
258
|
+
}
|
|
259
|
+
/** Pairwise market comparison within a MatchGroup. */
|
|
260
|
+
interface MatchGroupMarket {
|
|
261
|
+
id: number;
|
|
262
|
+
group_id: number;
|
|
263
|
+
source_a: ProviderSource;
|
|
264
|
+
market_a: PredictMarket;
|
|
265
|
+
source_b: ProviderSource;
|
|
266
|
+
market_b: PredictMarket;
|
|
267
|
+
spread?: number;
|
|
268
|
+
spread_percent?: number;
|
|
269
|
+
arb_profit?: number;
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* A group of matched events across N providers referring to the same
|
|
273
|
+
* real-world prediction. `entries.length >= 2`.
|
|
274
|
+
*/
|
|
275
|
+
interface MatchGroup {
|
|
276
|
+
id: number;
|
|
277
|
+
title: string;
|
|
278
|
+
entries: MatchGroupEntry[];
|
|
279
|
+
matched_markets?: MatchGroupMarket[];
|
|
280
|
+
confidence: number;
|
|
281
|
+
max_spread?: number;
|
|
282
|
+
combined_volume?: number;
|
|
283
|
+
combined_volume_24h?: number;
|
|
284
|
+
status: MatchStatus;
|
|
285
|
+
created_at: string;
|
|
286
|
+
updated_at: string;
|
|
287
|
+
}
|
|
288
|
+
/** Valid sort fields for the matches list endpoint. */
|
|
289
|
+
type MatchSortField = "spread" | "volume" | "confidence";
|
|
290
|
+
/** Query parameters for `GET /api/v1/matches`. */
|
|
291
|
+
interface MatchesParams {
|
|
292
|
+
sort_by?: MatchSortField;
|
|
293
|
+
sort_asc?: boolean;
|
|
294
|
+
min_spread?: number;
|
|
295
|
+
/** Minimum combined volume (USD) filter. */
|
|
296
|
+
min_volume?: number;
|
|
297
|
+
/** Comma-separated provider sources, e.g. `"kalshi,polymarket"`. */
|
|
298
|
+
sources?: string;
|
|
299
|
+
status?: MatchStatus;
|
|
300
|
+
search?: string;
|
|
301
|
+
limit?: number;
|
|
302
|
+
cursor?: string;
|
|
303
|
+
}
|
|
304
|
+
/** Aggregate statistics returned inline with the matches listing. */
|
|
305
|
+
interface MatchesStats {
|
|
306
|
+
total_matches: number;
|
|
307
|
+
avg_spread: number;
|
|
308
|
+
max_spread: number;
|
|
309
|
+
matches_over_5_percent: number;
|
|
310
|
+
matches_over_3_percent: number;
|
|
311
|
+
total_volume: number;
|
|
312
|
+
total_volume_24h: number;
|
|
313
|
+
}
|
|
314
|
+
/** Paginated match group result with inline aggregate stats. */
|
|
315
|
+
interface MatchGroupPage {
|
|
316
|
+
items: MatchGroup[];
|
|
317
|
+
next_cursor?: string;
|
|
318
|
+
has_more?: boolean;
|
|
319
|
+
limit?: number;
|
|
320
|
+
total?: number;
|
|
321
|
+
stats?: MatchesStats;
|
|
322
|
+
}
|
|
250
323
|
/** A single user position in a prediction market. */
|
|
251
324
|
interface PredictPosition {
|
|
252
325
|
source: ProviderSource;
|
|
@@ -566,6 +639,18 @@ declare class PredictClient {
|
|
|
566
639
|
* Maps to `GET /api/v1/kyc/kalshi?wallet_address=...`.
|
|
567
640
|
*/
|
|
568
641
|
checkDFlowKYC(walletAddress: string): Promise<DFlowKYCStatus>;
|
|
642
|
+
/**
|
|
643
|
+
* List cross-platform matched event groups with inline aggregate stats.
|
|
644
|
+
*
|
|
645
|
+
* Maps to `GET /api/v1/matches`.
|
|
646
|
+
*/
|
|
647
|
+
listMatches(params?: MatchesParams): Promise<MatchGroupPage>;
|
|
648
|
+
/**
|
|
649
|
+
* Fetch a single match group by ID.
|
|
650
|
+
*
|
|
651
|
+
* Maps to `GET /api/v1/matches/:id`.
|
|
652
|
+
*/
|
|
653
|
+
getMatch(id: number): Promise<MatchGroup>;
|
|
569
654
|
/** Maps to `GET /api/v1/trades?source=...&wallet=...`. */
|
|
570
655
|
listTrades(params: ListTradesParams): Promise<PredictPage<PredictTrade>>;
|
|
571
656
|
}
|
|
@@ -800,6 +885,20 @@ declare function marketQueryKey(slug: string, source?: ProviderSource): unknown[
|
|
|
800
885
|
*/
|
|
801
886
|
declare function fetchMarket(client: PredictClient, slug: string, source?: ProviderSource): Promise<PredictMarket>;
|
|
802
887
|
|
|
888
|
+
/**
|
|
889
|
+
* Server-safe pure functions for matches query parameters.
|
|
890
|
+
*
|
|
891
|
+
* This module contains NO React imports and can be used in Server Components,
|
|
892
|
+
* route handlers, or any non-browser context.
|
|
893
|
+
*/
|
|
894
|
+
|
|
895
|
+
/** Query key for match group list queries. */
|
|
896
|
+
declare function matchesQueryKey(params?: MatchesParams): unknown[];
|
|
897
|
+
/** Query key for a single match group. */
|
|
898
|
+
declare function matchQueryKey(id: number): unknown[];
|
|
899
|
+
/** Fetch a page of matches (usable in both client and server contexts). */
|
|
900
|
+
declare function fetchMatchesPage(client: PredictClient, params: MatchesParams): Promise<MatchGroupPage>;
|
|
901
|
+
|
|
803
902
|
/**
|
|
804
903
|
* Polymarket L2 HMAC-SHA256 signing utilities.
|
|
805
904
|
*
|
|
@@ -1031,4 +1130,4 @@ interface BuildSignedOrderInput extends BuildOrderMessageInput {
|
|
|
1031
1130
|
*/
|
|
1032
1131
|
declare function buildSignedOrder(input: BuildSignedOrderInput): SignedOrder;
|
|
1033
1132
|
|
|
1034
|
-
export { type
|
|
1133
|
+
export { type OrderSide as $, createPredictClient as A, type BalanceResponse as B, type Candlestick as C, type DFlowQuoteRequest as D, type EventStatus as E, createPredictWsClient as F, type PredictWsClientConfig as G, type ProviderMeta as H, type PredictTag as I, type SettlementSource as J, type MarketStatus as K, type ListEventsParams as L, type MatchesParams as M, type MarketResult as N, type Orderbook as O, PredictClient as P, type MarketOutcome as Q, type EventSortField as R, type SimilarEventsParams as S, type OrderbookLevel as T, type TradeType as U, type EventSummary as V, type WsConnectionStatus as W, type MarketSummary as X, type PricePoint as Y, type PredictPosition as Z, type OrderStatus as _, PredictWsClient as a, type DFlowOrderContext as a0, type PolymarketOrderType as a1, type MatchStatus as a2, type MatchGroupEntry as a3, type MatchGroupMarket as a4, type MatchSortField as a5, type MatchesStats as a6, type WsChannel as a7, type WsChannelEvent as a8, type WsClientMessage as a9, type HttpMethod as aA, type PolymarketL2HeadersInput as aB, type PolymarketL2Headers as aC, type BuildClobAuthMessageInput as aD, CTF_EXCHANGE_ADDRESS as aE, NEG_RISK_CTF_EXCHANGE_ADDRESS as aF, USDC_ADDRESS as aG, POLYGON_CHAIN_ID as aH, buildCtfExchangeDomain as aI, CTF_ORDER_TYPES as aJ, ORDER_TYPE as aK, SIDE as aL, buildOrderMessage as aM, buildSignedOrder as aN, type BuildOrderMessageInput as aO, type OrderMessage as aP, type BuildSignedOrderInput as aQ, type SignedOrder as aR, DEFAULT_PAGE_SIZE as aS, type WsSubscribeMessage as aa, type WsPingMessage as ab, type WsServerMessage as ac, type WsPongMessage as ad, type WsSubscribedMessage as ae, type WsErrorCode as af, type WsErrorMessage as ag, eventQueryKey as ah, fetchEvent as ai, resolveTagSlug as aj, resolveEventsParams as ak, infiniteEventsQueryKey as al, fetchEventsPage as am, type ResolveEventsParamsInput as an, type TagSlugSelection as ao, marketQueryKey as ap, fetchMarket as aq, matchesQueryKey as ar, matchQueryKey as as, fetchMatchesPage as at, CLOB_AUTH_DOMAIN as au, CLOB_AUTH_TYPES as av, buildClobAuthMessage as aw, hmacSha256Base64 as ax, buildPolymarketL2Headers as ay, derivePolymarketApiKey as az, type PredictPage as b, type PredictEvent as c, type ProviderSource as d, type PredictMarket as e, type ListMarketTradesParams as f, type PredictTrade as g, type PriceHistoryRange as h, type PriceHistoryResponse as i, type ListCandlesticksParams as j, type PositionsResponse as k, type ListOrdersParams as l, type PredictOrder as m, type CancelOrderResult as n, type MatchGroupPage as o, type MatchGroup as p, type ListTradesParams as q, type DFlowQuoteResponse as r, type DFlowSubmitResponse as s, type DFlowSubmitRequest as t, type DFlowKYCStatus as u, type WsDataMessage as v, type WsPriceEvent as w, type WsOrderbookEvent as x, type WsTradeEvent as y, type CreateOrderInput as z };
|
package/dist/server.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { B as BalanceResponse,
|
|
1
|
+
export { B as BalanceResponse, aD as BuildClobAuthMessageInput, aO as BuildOrderMessageInput, aQ as BuildSignedOrderInput, au as CLOB_AUTH_DOMAIN, av as CLOB_AUTH_TYPES, aE as CTF_EXCHANGE_ADDRESS, aJ as CTF_ORDER_TYPES, n as CancelOrderResult, C as Candlestick, z as CreateOrderInput, aS as DEFAULT_PAGE_SIZE, a0 as DFlowOrderContext, D as DFlowQuoteRequest, r as DFlowQuoteResponse, t as DFlowSubmitRequest, s as DFlowSubmitResponse, R as EventSortField, E as EventStatus, V as EventSummary, aA as HttpMethod, j as ListCandlesticksParams, L as ListEventsParams, f as ListMarketTradesParams, l as ListOrdersParams, q as ListTradesParams, Q as MarketOutcome, N as MarketResult, K as MarketStatus, X as MarketSummary, p as MatchGroup, a3 as MatchGroupEntry, a4 as MatchGroupMarket, o as MatchGroupPage, a5 as MatchSortField, a2 as MatchStatus, M as MatchesParams, a6 as MatchesStats, aF as NEG_RISK_CTF_EXCHANGE_ADDRESS, aK as ORDER_TYPE, aP as OrderMessage, $ as OrderSide, _ as OrderStatus, O as Orderbook, T as OrderbookLevel, aH as POLYGON_CHAIN_ID, aC as PolymarketL2Headers, aB as PolymarketL2HeadersInput, a1 as PolymarketOrderType, k as PositionsResponse, P as PredictClient, c as PredictEvent, e as PredictMarket, m as PredictOrder, b as PredictPage, Z as PredictPosition, I as PredictTag, g as PredictTrade, a as PredictWsClient, G as PredictWsClientConfig, h as PriceHistoryRange, i as PriceHistoryResponse, Y as PricePoint, H as ProviderMeta, d as ProviderSource, an as ResolveEventsParamsInput, aL as SIDE, J as SettlementSource, aR as SignedOrder, S as SimilarEventsParams, ao as TagSlugSelection, U as TradeType, aG as USDC_ADDRESS, a7 as WsChannel, a8 as WsChannelEvent, a9 as WsClientMessage, W as WsConnectionStatus, v as WsDataMessage, af as WsErrorCode, ag as WsErrorMessage, x as WsOrderbookEvent, ab as WsPingMessage, ad as WsPongMessage, w as WsPriceEvent, ac as WsServerMessage, aa as WsSubscribeMessage, ae as WsSubscribedMessage, y as WsTradeEvent, aw as buildClobAuthMessage, aI as buildCtfExchangeDomain, aM as buildOrderMessage, ay as buildPolymarketL2Headers, aN as buildSignedOrder, A as createPredictClient, F as createPredictWsClient, az as derivePolymarketApiKey, ah as eventQueryKey, ai as fetchEvent, am as fetchEventsPage, aq as fetchMarket, at as fetchMatchesPage, ax as hmacSha256Base64, al as infiniteEventsQueryKey, ap as marketQueryKey, as as matchQueryKey, ar as matchesQueryKey, ak as resolveEventsParams, aj as resolveTagSlug } from './server-CiGfmztS.mjs';
|
package/dist/server.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { B as BalanceResponse,
|
|
1
|
+
export { B as BalanceResponse, aD as BuildClobAuthMessageInput, aO as BuildOrderMessageInput, aQ as BuildSignedOrderInput, au as CLOB_AUTH_DOMAIN, av as CLOB_AUTH_TYPES, aE as CTF_EXCHANGE_ADDRESS, aJ as CTF_ORDER_TYPES, n as CancelOrderResult, C as Candlestick, z as CreateOrderInput, aS as DEFAULT_PAGE_SIZE, a0 as DFlowOrderContext, D as DFlowQuoteRequest, r as DFlowQuoteResponse, t as DFlowSubmitRequest, s as DFlowSubmitResponse, R as EventSortField, E as EventStatus, V as EventSummary, aA as HttpMethod, j as ListCandlesticksParams, L as ListEventsParams, f as ListMarketTradesParams, l as ListOrdersParams, q as ListTradesParams, Q as MarketOutcome, N as MarketResult, K as MarketStatus, X as MarketSummary, p as MatchGroup, a3 as MatchGroupEntry, a4 as MatchGroupMarket, o as MatchGroupPage, a5 as MatchSortField, a2 as MatchStatus, M as MatchesParams, a6 as MatchesStats, aF as NEG_RISK_CTF_EXCHANGE_ADDRESS, aK as ORDER_TYPE, aP as OrderMessage, $ as OrderSide, _ as OrderStatus, O as Orderbook, T as OrderbookLevel, aH as POLYGON_CHAIN_ID, aC as PolymarketL2Headers, aB as PolymarketL2HeadersInput, a1 as PolymarketOrderType, k as PositionsResponse, P as PredictClient, c as PredictEvent, e as PredictMarket, m as PredictOrder, b as PredictPage, Z as PredictPosition, I as PredictTag, g as PredictTrade, a as PredictWsClient, G as PredictWsClientConfig, h as PriceHistoryRange, i as PriceHistoryResponse, Y as PricePoint, H as ProviderMeta, d as ProviderSource, an as ResolveEventsParamsInput, aL as SIDE, J as SettlementSource, aR as SignedOrder, S as SimilarEventsParams, ao as TagSlugSelection, U as TradeType, aG as USDC_ADDRESS, a7 as WsChannel, a8 as WsChannelEvent, a9 as WsClientMessage, W as WsConnectionStatus, v as WsDataMessage, af as WsErrorCode, ag as WsErrorMessage, x as WsOrderbookEvent, ab as WsPingMessage, ad as WsPongMessage, w as WsPriceEvent, ac as WsServerMessage, aa as WsSubscribeMessage, ae as WsSubscribedMessage, y as WsTradeEvent, aw as buildClobAuthMessage, aI as buildCtfExchangeDomain, aM as buildOrderMessage, ay as buildPolymarketL2Headers, aN as buildSignedOrder, A as createPredictClient, F as createPredictWsClient, az as derivePolymarketApiKey, ah as eventQueryKey, ai as fetchEvent, am as fetchEventsPage, aq as fetchMarket, at as fetchMatchesPage, ax as hmacSha256Base64, al as infiniteEventsQueryKey, ap as marketQueryKey, as as matchQueryKey, ar as matchesQueryKey, ak as resolveEventsParams, aj as resolveTagSlug } from './server-CiGfmztS.js';
|
package/dist/server.js
CHANGED
|
@@ -63,6 +63,17 @@ function marketQueryKey(slug, source) {
|
|
|
63
63
|
async function fetchMarket(client, slug, source) {
|
|
64
64
|
return client.getMarket(slug, source);
|
|
65
65
|
}
|
|
66
|
+
|
|
67
|
+
// src/hooks/predict/matches.params.ts
|
|
68
|
+
function matchesQueryKey(params) {
|
|
69
|
+
return ["predict", "matches", params];
|
|
70
|
+
}
|
|
71
|
+
function matchQueryKey(id) {
|
|
72
|
+
return ["predict", "match", id];
|
|
73
|
+
}
|
|
74
|
+
async function fetchMatchesPage(client, params) {
|
|
75
|
+
return client.listMatches(params);
|
|
76
|
+
}
|
|
66
77
|
function buildQuery(params) {
|
|
67
78
|
const qs = new URLSearchParams();
|
|
68
79
|
for (const [key, value] of Object.entries(params)) {
|
|
@@ -260,6 +271,28 @@ var PredictClient = class {
|
|
|
260
271
|
return await utils.httpGet(url);
|
|
261
272
|
}
|
|
262
273
|
// -------------------------------------------------------------------------
|
|
274
|
+
// Cross-platform matches
|
|
275
|
+
// -------------------------------------------------------------------------
|
|
276
|
+
/**
|
|
277
|
+
* List cross-platform matched event groups with inline aggregate stats.
|
|
278
|
+
*
|
|
279
|
+
* Maps to `GET /api/v1/matches`.
|
|
280
|
+
*/
|
|
281
|
+
async listMatches(params) {
|
|
282
|
+
const query = buildQuery(params ?? {});
|
|
283
|
+
const url = `${this.endpoint}/api/v1/matches${query}`;
|
|
284
|
+
return await utils.httpGet(url);
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* Fetch a single match group by ID.
|
|
288
|
+
*
|
|
289
|
+
* Maps to `GET /api/v1/matches/:id`.
|
|
290
|
+
*/
|
|
291
|
+
async getMatch(id) {
|
|
292
|
+
const url = `${this.endpoint}/api/v1/matches/${id}`;
|
|
293
|
+
return await utils.httpGet(url);
|
|
294
|
+
}
|
|
295
|
+
// -------------------------------------------------------------------------
|
|
263
296
|
// Trades by wallet
|
|
264
297
|
// -------------------------------------------------------------------------
|
|
265
298
|
/** Maps to `GET /api/v1/trades?source=...&wallet=...`. */
|
|
@@ -810,9 +843,12 @@ exports.eventQueryKey = eventQueryKey;
|
|
|
810
843
|
exports.fetchEvent = fetchEvent;
|
|
811
844
|
exports.fetchEventsPage = fetchEventsPage;
|
|
812
845
|
exports.fetchMarket = fetchMarket;
|
|
846
|
+
exports.fetchMatchesPage = fetchMatchesPage;
|
|
813
847
|
exports.hmacSha256Base64 = hmacSha256Base64;
|
|
814
848
|
exports.infiniteEventsQueryKey = infiniteEventsQueryKey;
|
|
815
849
|
exports.marketQueryKey = marketQueryKey;
|
|
850
|
+
exports.matchQueryKey = matchQueryKey;
|
|
851
|
+
exports.matchesQueryKey = matchesQueryKey;
|
|
816
852
|
exports.resolveEventsParams = resolveEventsParams;
|
|
817
853
|
exports.resolveTagSlug = resolveTagSlug;
|
|
818
854
|
//# sourceMappingURL=server.js.map
|