@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.
@@ -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 WsChannel as $, type PredictWsClientConfig as A, type BalanceResponse as B, type Candlestick as C, type DFlowQuoteRequest as D, type EventStatus as E, type ProviderMeta as F, type PredictTag as G, type SettlementSource as H, type MarketResult as I, type MarketOutcome as J, type EventSortField as K, type ListEventsParams as L, type MarketStatus as M, type OrderbookLevel as N, type Orderbook as O, PredictClient as P, type EventSummary as Q, type MarketSummary as R, type SimilarEventsParams as S, type TradeType as T, type PricePoint as U, type PredictPosition as V, type WsConnectionStatus as W, type OrderStatus as X, type OrderSide as Y, type DFlowOrderContext as Z, type PolymarketOrderType as _, PredictWsClient as a, type WsChannelEvent as a0, type WsClientMessage as a1, type WsSubscribeMessage as a2, type WsPingMessage as a3, type WsServerMessage as a4, type WsPongMessage as a5, type WsSubscribedMessage as a6, type WsErrorCode as a7, type WsErrorMessage as a8, eventQueryKey as a9, SIDE as aA, buildOrderMessage as aB, buildSignedOrder as aC, type BuildOrderMessageInput as aD, type OrderMessage as aE, type BuildSignedOrderInput as aF, type SignedOrder as aG, DEFAULT_PAGE_SIZE as aH, fetchEvent as aa, resolveTagSlug as ab, resolveEventsParams as ac, infiniteEventsQueryKey as ad, fetchEventsPage as ae, type ResolveEventsParamsInput as af, type TagSlugSelection as ag, marketQueryKey as ah, fetchMarket as ai, CLOB_AUTH_DOMAIN as aj, CLOB_AUTH_TYPES as ak, buildClobAuthMessage as al, hmacSha256Base64 as am, buildPolymarketL2Headers as an, derivePolymarketApiKey as ao, type HttpMethod as ap, type PolymarketL2HeadersInput as aq, type PolymarketL2Headers as ar, type BuildClobAuthMessageInput as as, CTF_EXCHANGE_ADDRESS as at, NEG_RISK_CTF_EXCHANGE_ADDRESS as au, USDC_ADDRESS as av, POLYGON_CHAIN_ID as aw, buildCtfExchangeDomain as ax, CTF_ORDER_TYPES as ay, ORDER_TYPE 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 ListTradesParams as o, type DFlowQuoteResponse as p, type DFlowSubmitResponse as q, type DFlowSubmitRequest as r, type DFlowKYCStatus as s, type WsDataMessage as t, type WsPriceEvent as u, type WsOrderbookEvent as v, type WsTradeEvent as w, type CreateOrderInput as x, createPredictClient as y, createPredictWsClient as z };
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 WsChannel as $, type PredictWsClientConfig as A, type BalanceResponse as B, type Candlestick as C, type DFlowQuoteRequest as D, type EventStatus as E, type ProviderMeta as F, type PredictTag as G, type SettlementSource as H, type MarketResult as I, type MarketOutcome as J, type EventSortField as K, type ListEventsParams as L, type MarketStatus as M, type OrderbookLevel as N, type Orderbook as O, PredictClient as P, type EventSummary as Q, type MarketSummary as R, type SimilarEventsParams as S, type TradeType as T, type PricePoint as U, type PredictPosition as V, type WsConnectionStatus as W, type OrderStatus as X, type OrderSide as Y, type DFlowOrderContext as Z, type PolymarketOrderType as _, PredictWsClient as a, type WsChannelEvent as a0, type WsClientMessage as a1, type WsSubscribeMessage as a2, type WsPingMessage as a3, type WsServerMessage as a4, type WsPongMessage as a5, type WsSubscribedMessage as a6, type WsErrorCode as a7, type WsErrorMessage as a8, eventQueryKey as a9, SIDE as aA, buildOrderMessage as aB, buildSignedOrder as aC, type BuildOrderMessageInput as aD, type OrderMessage as aE, type BuildSignedOrderInput as aF, type SignedOrder as aG, DEFAULT_PAGE_SIZE as aH, fetchEvent as aa, resolveTagSlug as ab, resolveEventsParams as ac, infiniteEventsQueryKey as ad, fetchEventsPage as ae, type ResolveEventsParamsInput as af, type TagSlugSelection as ag, marketQueryKey as ah, fetchMarket as ai, CLOB_AUTH_DOMAIN as aj, CLOB_AUTH_TYPES as ak, buildClobAuthMessage as al, hmacSha256Base64 as am, buildPolymarketL2Headers as an, derivePolymarketApiKey as ao, type HttpMethod as ap, type PolymarketL2HeadersInput as aq, type PolymarketL2Headers as ar, type BuildClobAuthMessageInput as as, CTF_EXCHANGE_ADDRESS as at, NEG_RISK_CTF_EXCHANGE_ADDRESS as au, USDC_ADDRESS as av, POLYGON_CHAIN_ID as aw, buildCtfExchangeDomain as ax, CTF_ORDER_TYPES as ay, ORDER_TYPE 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 ListTradesParams as o, type DFlowQuoteResponse as p, type DFlowSubmitResponse as q, type DFlowSubmitRequest as r, type DFlowKYCStatus as s, type WsDataMessage as t, type WsPriceEvent as u, type WsOrderbookEvent as v, type WsTradeEvent as w, type CreateOrderInput as x, createPredictClient as y, createPredictWsClient as z };
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, as as BuildClobAuthMessageInput, aD as BuildOrderMessageInput, aF as BuildSignedOrderInput, aj as CLOB_AUTH_DOMAIN, ak as CLOB_AUTH_TYPES, at as CTF_EXCHANGE_ADDRESS, ay as CTF_ORDER_TYPES, n as CancelOrderResult, C as Candlestick, x as CreateOrderInput, aH as DEFAULT_PAGE_SIZE, Z as DFlowOrderContext, D as DFlowQuoteRequest, p as DFlowQuoteResponse, r as DFlowSubmitRequest, q as DFlowSubmitResponse, K as EventSortField, E as EventStatus, Q as EventSummary, ap as HttpMethod, j as ListCandlesticksParams, L as ListEventsParams, f as ListMarketTradesParams, l as ListOrdersParams, o as ListTradesParams, J as MarketOutcome, I as MarketResult, M as MarketStatus, R as MarketSummary, au as NEG_RISK_CTF_EXCHANGE_ADDRESS, az as ORDER_TYPE, aE as OrderMessage, Y as OrderSide, X as OrderStatus, O as Orderbook, N as OrderbookLevel, aw as POLYGON_CHAIN_ID, ar as PolymarketL2Headers, aq as PolymarketL2HeadersInput, _ as PolymarketOrderType, k as PositionsResponse, P as PredictClient, c as PredictEvent, e as PredictMarket, m as PredictOrder, b as PredictPage, V as PredictPosition, G as PredictTag, g as PredictTrade, a as PredictWsClient, A as PredictWsClientConfig, h as PriceHistoryRange, i as PriceHistoryResponse, U as PricePoint, F as ProviderMeta, d as ProviderSource, af as ResolveEventsParamsInput, aA as SIDE, H as SettlementSource, aG as SignedOrder, S as SimilarEventsParams, ag as TagSlugSelection, T as TradeType, av as USDC_ADDRESS, $ as WsChannel, a0 as WsChannelEvent, a1 as WsClientMessage, W as WsConnectionStatus, t as WsDataMessage, a7 as WsErrorCode, a8 as WsErrorMessage, v as WsOrderbookEvent, a3 as WsPingMessage, a5 as WsPongMessage, u as WsPriceEvent, a4 as WsServerMessage, a2 as WsSubscribeMessage, a6 as WsSubscribedMessage, w as WsTradeEvent, al as buildClobAuthMessage, ax as buildCtfExchangeDomain, aB as buildOrderMessage, an as buildPolymarketL2Headers, aC as buildSignedOrder, y as createPredictClient, z as createPredictWsClient, ao as derivePolymarketApiKey, a9 as eventQueryKey, aa as fetchEvent, ae as fetchEventsPage, ai as fetchMarket, am as hmacSha256Base64, ad as infiniteEventsQueryKey, ah as marketQueryKey, ac as resolveEventsParams, ab as resolveTagSlug } from './server-C52oqeh8.mjs';
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, as as BuildClobAuthMessageInput, aD as BuildOrderMessageInput, aF as BuildSignedOrderInput, aj as CLOB_AUTH_DOMAIN, ak as CLOB_AUTH_TYPES, at as CTF_EXCHANGE_ADDRESS, ay as CTF_ORDER_TYPES, n as CancelOrderResult, C as Candlestick, x as CreateOrderInput, aH as DEFAULT_PAGE_SIZE, Z as DFlowOrderContext, D as DFlowQuoteRequest, p as DFlowQuoteResponse, r as DFlowSubmitRequest, q as DFlowSubmitResponse, K as EventSortField, E as EventStatus, Q as EventSummary, ap as HttpMethod, j as ListCandlesticksParams, L as ListEventsParams, f as ListMarketTradesParams, l as ListOrdersParams, o as ListTradesParams, J as MarketOutcome, I as MarketResult, M as MarketStatus, R as MarketSummary, au as NEG_RISK_CTF_EXCHANGE_ADDRESS, az as ORDER_TYPE, aE as OrderMessage, Y as OrderSide, X as OrderStatus, O as Orderbook, N as OrderbookLevel, aw as POLYGON_CHAIN_ID, ar as PolymarketL2Headers, aq as PolymarketL2HeadersInput, _ as PolymarketOrderType, k as PositionsResponse, P as PredictClient, c as PredictEvent, e as PredictMarket, m as PredictOrder, b as PredictPage, V as PredictPosition, G as PredictTag, g as PredictTrade, a as PredictWsClient, A as PredictWsClientConfig, h as PriceHistoryRange, i as PriceHistoryResponse, U as PricePoint, F as ProviderMeta, d as ProviderSource, af as ResolveEventsParamsInput, aA as SIDE, H as SettlementSource, aG as SignedOrder, S as SimilarEventsParams, ag as TagSlugSelection, T as TradeType, av as USDC_ADDRESS, $ as WsChannel, a0 as WsChannelEvent, a1 as WsClientMessage, W as WsConnectionStatus, t as WsDataMessage, a7 as WsErrorCode, a8 as WsErrorMessage, v as WsOrderbookEvent, a3 as WsPingMessage, a5 as WsPongMessage, u as WsPriceEvent, a4 as WsServerMessage, a2 as WsSubscribeMessage, a6 as WsSubscribedMessage, w as WsTradeEvent, al as buildClobAuthMessage, ax as buildCtfExchangeDomain, aB as buildOrderMessage, an as buildPolymarketL2Headers, aC as buildSignedOrder, y as createPredictClient, z as createPredictWsClient, ao as derivePolymarketApiKey, a9 as eventQueryKey, aa as fetchEvent, ae as fetchEventsPage, ai as fetchMarket, am as hmacSha256Base64, ad as infiniteEventsQueryKey, ah as marketQueryKey, ac as resolveEventsParams, ab as resolveTagSlug } from './server-C52oqeh8.js';
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