@liberfi.io/react-predict 0.1.42 → 0.1.43

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 CHANGED
@@ -1,5 +1,5 @@
1
- import { P as PredictClient, a as PredictWsClient, L as ListEventsParams, b as PredictPage, c as PredictEvent, d as ProviderSource, E as EventStatus, e as EventSortField, S as SimilarEventsParams, f as PredictMarket, O as Orderbook, g as ListMarketTradesParams, h as PredictTrade, i as PriceHistoryRange, j as PriceHistoryResponse, k as ListCandlesticksParams, C as Candlestick, l as PositionsResponse, B as BalanceResponse, m as ListOrdersParams, n as PredictOrder, o as CancelOrderResult, M as MatchesParams, p as MatchGroupPage, q as MatchGroup, r as MatchMarketParams, s as MatchMarketPage, t as ListTradesParams, D as DFlowQuoteRequest, u as DFlowQuoteResponse, v as DFlowSubmitResponse, w as DFlowSubmitRequest, x as DFlowKYCStatus, y as PolymarketSetupStatus, W as WithdrawBuildResponse, z as WithdrawBuildRequest, A as WithdrawSubmitResponse, F as WithdrawSubmitRequest, G as WithdrawStatusResponse, H as PolymarketDepositAddresses, I as PolymarketWithdrawResponse, J as PolymarketWithdrawRequest, T as TickSizeResponse, K as WsConnectionStatus, N as WsDataMessage, Q as WsPriceEvent, R as WsOrderbookEvent, U as WsTradeEvent, V as CreateOrderInput } from './server-CYqs2N2z.mjs';
2
- export { aZ as BuildClobAuthMessageInput, ba as BuildOrderMessageInput, aQ as CLOB_AUTH_DOMAIN, aR as CLOB_AUTH_TYPES, a_ as CTF_EXCHANGE_ADDRESS, b3 as CTF_ORDER_TYPES, b9 as ClobOrderPayload, ac as DFlowOrderContext, ae as DepositBuildRequest, af as DepositBuildResponse, ai as DepositStatusResponse, ag as DepositSubmitRequest, ah as DepositSubmitResponse, a6 as EventSummary, aW as HttpMethod, a3 as MarketOutcome, a2 as MarketResult, a1 as MarketStatus, a7 as MarketSummary, ap as MatchConfidenceTier, al as MatchGroupEntry, am as MatchGroupMarket, aq as MatchMarketFlat, an as MatchSortField, ak as MatchStatus, ao as MatchesStats, a$ as NEG_RISK_CTF_EXCHANGE_ADDRESS, b4 as ORDER_TYPE, bb as OrderMessage, ab as OrderSide, aa as OrderStatus, a4 as OrderbookLevel, b1 as POLYGON_CHAIN_ID, aY as PolymarketL2Headers, aX as PolymarketL2HeadersInput, ad as PolymarketOrderType, a9 as PredictPosition, $ as PredictTag, Z as PredictWsClientConfig, a8 as PricePoint, _ as ProviderMeta, aH as ResolveEventsParamsInput, b5 as SIDE, a0 as SettlementSource, bc as SignedOrder, aI as TagSlugSelection, a5 as TradeType, b0 as USDC_ADDRESS, aj as UnsignedTx, ar as WsChannel, as as WsChannelEvent, at as WsClientMessage, az as WsErrorCode, aA as WsErrorMessage, av as WsPingMessage, ax as WsPongMessage, aw as WsServerMessage, au as WsSubscribeMessage, ay as WsSubscribedMessage, aS as buildClobAuthMessage, b8 as buildClobPayload, b2 as buildCtfExchangeDomain, b6 as buildOrderMessage, aU as buildPolymarketL2Headers, b7 as buildSignedOrder, X as createPredictClient, Y as createPredictWsClient, aV as derivePolymarketApiKey, aB as eventQueryKey, aC as fetchEvent, aG as fetchEventsPage, aK as fetchMarket, aP as fetchMatchMarketsPage, aN as fetchMatchesPage, aT as hmacSha256Base64, aF as infiniteEventsQueryKey, aJ as marketQueryKey, aO as matchMarketsQueryKey, aM as matchQueryKey, aL as matchesQueryKey, aE as resolveEventsParams, aD as resolveTagSlug } from './server-CYqs2N2z.mjs';
1
+ import { P as PredictClient, a as PredictWsClient, L as ListEventsParams, b as PredictPage, c as PredictEvent, d as ProviderSource, E as EventStats, e as EventStatus, f as EventSortField, S as SimilarEventsParams, g as PredictMarket, O as Orderbook, h as ListMarketTradesParams, i as PredictTrade, j as PriceHistoryRange, k as PriceHistoryResponse, l as ListCandlesticksParams, C as Candlestick, m as PositionsResponse, B as BalanceResponse, n as ListOrdersParams, o as PredictOrder, p as CancelOrderResult, M as MatchesParams, q as MatchGroupPage, r as MatchGroup, s as MatchMarketParams, t as MatchMarketPage, u as ListTradesParams, D as DFlowQuoteRequest, v as DFlowQuoteResponse, w as DFlowSubmitResponse, x as DFlowSubmitRequest, y as DFlowKYCStatus, z as PolymarketSetupStatus, W as WithdrawBuildResponse, A as WithdrawBuildRequest, F as WithdrawSubmitResponse, G as WithdrawSubmitRequest, H as WithdrawStatusResponse, I as PolymarketDepositAddresses, J as PolymarketWithdrawResponse, K as PolymarketWithdrawRequest, T as TickSizeResponse, N as WsConnectionStatus, Q as WsDataMessage, R as WsPriceEvent, U as WsOrderbookEvent, V as WsTradeEvent, X as CreateOrderInput } from './server-D-WAydlX.mjs';
2
+ export { a_ as BuildClobAuthMessageInput, bb as BuildOrderMessageInput, aR as CLOB_AUTH_DOMAIN, aS as CLOB_AUTH_TYPES, a$ as CTF_EXCHANGE_ADDRESS, b4 as CTF_ORDER_TYPES, ba as ClobOrderPayload, ad as DFlowOrderContext, af as DepositBuildRequest, ag as DepositBuildResponse, aj as DepositStatusResponse, ah as DepositSubmitRequest, ai as DepositSubmitResponse, a7 as EventSummary, aX as HttpMethod, a4 as MarketOutcome, a3 as MarketResult, a2 as MarketStatus, a8 as MarketSummary, aq as MatchConfidenceTier, am as MatchGroupEntry, an as MatchGroupMarket, ar as MatchMarketFlat, ao as MatchSortField, al as MatchStatus, ap as MatchesStats, b0 as NEG_RISK_CTF_EXCHANGE_ADDRESS, b5 as ORDER_TYPE, bc as OrderMessage, ac as OrderSide, ab as OrderStatus, a5 as OrderbookLevel, b2 as POLYGON_CHAIN_ID, aZ as PolymarketL2Headers, aY as PolymarketL2HeadersInput, ae as PolymarketOrderType, aa as PredictPosition, a0 as PredictTag, _ as PredictWsClientConfig, a9 as PricePoint, $ as ProviderMeta, aI as ResolveEventsParamsInput, b6 as SIDE, a1 as SettlementSource, bd as SignedOrder, aJ as TagSlugSelection, a6 as TradeType, b1 as USDC_ADDRESS, ak as UnsignedTx, as as WsChannel, at as WsChannelEvent, au as WsClientMessage, aA as WsErrorCode, aB as WsErrorMessage, aw as WsPingMessage, ay as WsPongMessage, ax as WsServerMessage, av as WsSubscribeMessage, az as WsSubscribedMessage, aT as buildClobAuthMessage, b9 as buildClobPayload, b3 as buildCtfExchangeDomain, b7 as buildOrderMessage, aV as buildPolymarketL2Headers, b8 as buildSignedOrder, Y as createPredictClient, Z as createPredictWsClient, aW as derivePolymarketApiKey, aC as eventQueryKey, aD as fetchEvent, aH as fetchEventsPage, aL as fetchMarket, aQ as fetchMatchMarketsPage, aO as fetchMatchesPage, aU as hmacSha256Base64, aG as infiniteEventsQueryKey, aK as marketQueryKey, aP as matchMarketsQueryKey, aN as matchQueryKey, aM as matchesQueryKey, aF as resolveEventsParams, aE as resolveTagSlug } from './server-D-WAydlX.mjs';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import * as react from 'react';
5
5
  import { PropsWithChildren } from 'react';
@@ -239,6 +239,19 @@ type InfiniteQueryOptions$2 = Omit<UseInfiniteQueryOptions<PredictPage<PredictEv
239
239
  */
240
240
  declare function useInfiniteEvents(params: ListEventsParams, queryOptions?: InfiniteQueryOptions$2): _tanstack_react_query.UseInfiniteQueryResult<InfiniteData<PredictPage<PredictEvent>, unknown>, Error>;
241
241
 
242
+ /** Stable TanStack Query key for event aggregate statistics. */
243
+ declare function eventStatsQueryKey(): unknown[];
244
+ /**
245
+ * React Query hook for `GET /api/v1/events/stats`.
246
+ *
247
+ * Returns aggregate statistics (total events, 24h volume, avg liquidity,
248
+ * active sources) for all open prediction events. The backend caches the
249
+ * result in Redis with a 30-second TTL.
250
+ *
251
+ * @param queryOptions - Additional TanStack Query options (e.g. `enabled`, `staleTime`).
252
+ */
253
+ declare function useEventStats(queryOptions?: Omit<UseQueryOptions<EventStats, Error, EventStats, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<EventStats, Error>;
254
+
242
255
  interface UseSearchEventsParams {
243
256
  /** Search keyword. */
244
257
  keyword: string;
@@ -795,4 +808,4 @@ interface CreatePolymarketOrderVariables {
795
808
  */
796
809
  declare function useCreatePolymarketOrder(mutationOptions?: Omit<UseMutationOptions<PredictOrder, Error, CreatePolymarketOrderVariables>, "mutationFn">): _tanstack_react_query.UseMutationResult<PredictOrder, Error, CreatePolymarketOrderVariables, unknown>;
797
810
 
798
- export { BalanceResponse, CancelOrderResult, type CancelOrderVariables, Candlestick, ChartRange, type ChartRangeType, CreateOrderInput, type CreatePolymarketOrderVariables, DFlowKYCStatus, DFlowQuoteRequest, DFlowQuoteResponse, DFlowSubmitRequest, DFlowSubmitResponse, EventSortField, EventStatus, ListCandlesticksParams, ListEventsParams, ListMarketTradesParams, ListOrdersParams, ListTradesParams, type MarketHistoryPoint, type MarketHistorySeries, MatchGroup, MatchGroupPage, MatchMarketPage, MatchMarketParams, MatchesParams, Orderbook, PolymarketContext, type PolymarketContextValue, type PolymarketCredentials, PolymarketDepositAddresses, type PolymarketDepositResult, type PolymarketDepositVariables, PolymarketProvider, type PolymarketProviderProps, type PolymarketSigner, PolymarketWithdrawRequest, PolymarketWithdrawResponse, PositionsResponse, PredictClient, PredictContext, type PredictContextValue, PredictEvent, PredictMarket, PredictOrder, PredictPage, PredictProvider, type PredictProviderProps, PredictTrade, PredictWsClient, PriceHistoryRange, PriceHistoryResponse, ProviderSource, SimilarEventsParams, TickSizeResponse, type UseBalanceParams, type UseCandlesticksParams, type UseEventParams, type UseInfiniteMatchMarketsParams, type UseInfiniteMatchesParams, type UseInfiniteOrdersOptions, type UseInfiniteOrdersParams, type UseInfiniteTradesParams, type UseMarketHistoryResult, type UseMarketParams, type UseMarketTradesParams, type UseOrderParams, type UseOrderbookParams, type UseOrderbookSubscriptionParams, type UseOrderbookSubscriptionResult, type UseOrdersOptions, type UsePositionsMultiParams, type UsePositionsParams, type UsePredictWsClientResult, type UsePriceHistoryParams, type UsePricesSubscriptionParams, type UsePricesSubscriptionResult, type UseRealtimeOrderbookParams, type UseRealtimePricesParams, type UseRealtimeTradesParams, type UseRealtimeTradesResult, type UseSearchEventsParams, type UseSimilarEventsParams, type UseTradesSubscriptionParams, type UseTradesSubscriptionResult, type UseWithdrawStatusQueryParams, WithdrawBuildRequest, WithdrawBuildResponse, WithdrawStatusResponse, WithdrawSubmitRequest, WithdrawSubmitResponse, WsConnectionStatus, WsDataMessage, WsOrderbookEvent, WsPriceEvent, WsTradeEvent, balanceQueryKey, candlesticksQueryKey, dflowKYCQueryKey, dflowQuoteQueryKey, eventsQueryKey, fetchEvents, infiniteOrdersQueryKey, infiniteTradesQueryKey, marketTradesQueryKey, orderQueryKey, orderbookQueryKey, ordersQueryKey, polymarketDepositAddressesQueryKey, polymarketSetupQueryKey, positionsMultiQueryKey, positionsQueryKey, priceHistoryQueryKey, similarEventsQueryKey, tickSizeQueryKey, tradesQueryKey, useBalance, useCancelOrder, useCandlesticks, useCreatePolymarketOrder, useDFlowKYC, useDFlowQuote, useDFlowSubmit, useEvent, useEvents, useInfiniteEvents, useInfiniteMatchMarkets, useInfiniteMatches, useInfiniteOrders, useInfiniteTrades, useMarket, useMarketHistory, useMarketTrades, useMatch, useOrder, useOrderbook, useOrderbookSubscription, useOrders, usePolymarket, usePolymarketDeposit, usePolymarketDepositAddresses, usePolymarketSetup, usePolymarketWithdraw, usePositions, usePositionsMulti, usePredictClient, usePredictWsClient, usePriceHistory, usePricesSubscription, useRealtimeOrderbook, useRealtimePrices, useRealtimeTrades, useRunPolymarketSetup, useSearchEvents, useSimilarEvents, useTickSize, useTrades, useTradesSubscription, useWithdrawBuildMutation, useWithdrawStatusQuery, useWithdrawSubmitMutation, withdrawStatusQueryKey };
811
+ export { BalanceResponse, CancelOrderResult, type CancelOrderVariables, Candlestick, ChartRange, type ChartRangeType, CreateOrderInput, type CreatePolymarketOrderVariables, DFlowKYCStatus, DFlowQuoteRequest, DFlowQuoteResponse, DFlowSubmitRequest, DFlowSubmitResponse, EventSortField, EventStats, EventStatus, ListCandlesticksParams, ListEventsParams, ListMarketTradesParams, ListOrdersParams, ListTradesParams, type MarketHistoryPoint, type MarketHistorySeries, MatchGroup, MatchGroupPage, MatchMarketPage, MatchMarketParams, MatchesParams, Orderbook, PolymarketContext, type PolymarketContextValue, type PolymarketCredentials, PolymarketDepositAddresses, type PolymarketDepositResult, type PolymarketDepositVariables, PolymarketProvider, type PolymarketProviderProps, type PolymarketSigner, PolymarketWithdrawRequest, PolymarketWithdrawResponse, PositionsResponse, PredictClient, PredictContext, type PredictContextValue, PredictEvent, PredictMarket, PredictOrder, PredictPage, PredictProvider, type PredictProviderProps, PredictTrade, PredictWsClient, PriceHistoryRange, PriceHistoryResponse, ProviderSource, SimilarEventsParams, TickSizeResponse, type UseBalanceParams, type UseCandlesticksParams, type UseEventParams, type UseInfiniteMatchMarketsParams, type UseInfiniteMatchesParams, type UseInfiniteOrdersOptions, type UseInfiniteOrdersParams, type UseInfiniteTradesParams, type UseMarketHistoryResult, type UseMarketParams, type UseMarketTradesParams, type UseOrderParams, type UseOrderbookParams, type UseOrderbookSubscriptionParams, type UseOrderbookSubscriptionResult, type UseOrdersOptions, type UsePositionsMultiParams, type UsePositionsParams, type UsePredictWsClientResult, type UsePriceHistoryParams, type UsePricesSubscriptionParams, type UsePricesSubscriptionResult, type UseRealtimeOrderbookParams, type UseRealtimePricesParams, type UseRealtimeTradesParams, type UseRealtimeTradesResult, type UseSearchEventsParams, type UseSimilarEventsParams, type UseTradesSubscriptionParams, type UseTradesSubscriptionResult, type UseWithdrawStatusQueryParams, WithdrawBuildRequest, WithdrawBuildResponse, WithdrawStatusResponse, WithdrawSubmitRequest, WithdrawSubmitResponse, WsConnectionStatus, WsDataMessage, WsOrderbookEvent, WsPriceEvent, WsTradeEvent, balanceQueryKey, candlesticksQueryKey, dflowKYCQueryKey, dflowQuoteQueryKey, eventStatsQueryKey, eventsQueryKey, fetchEvents, infiniteOrdersQueryKey, infiniteTradesQueryKey, marketTradesQueryKey, orderQueryKey, orderbookQueryKey, ordersQueryKey, polymarketDepositAddressesQueryKey, polymarketSetupQueryKey, positionsMultiQueryKey, positionsQueryKey, priceHistoryQueryKey, similarEventsQueryKey, tickSizeQueryKey, tradesQueryKey, useBalance, useCancelOrder, useCandlesticks, useCreatePolymarketOrder, useDFlowKYC, useDFlowQuote, useDFlowSubmit, useEvent, useEventStats, useEvents, useInfiniteEvents, useInfiniteMatchMarkets, useInfiniteMatches, useInfiniteOrders, useInfiniteTrades, useMarket, useMarketHistory, useMarketTrades, useMatch, useOrder, useOrderbook, useOrderbookSubscription, useOrders, usePolymarket, usePolymarketDeposit, usePolymarketDepositAddresses, usePolymarketSetup, usePolymarketWithdraw, usePositions, usePositionsMulti, usePredictClient, usePredictWsClient, usePriceHistory, usePricesSubscription, useRealtimeOrderbook, useRealtimePrices, useRealtimeTrades, useRunPolymarketSetup, useSearchEvents, useSimilarEvents, useTickSize, useTrades, useTradesSubscription, useWithdrawBuildMutation, useWithdrawStatusQuery, useWithdrawSubmitMutation, withdrawStatusQueryKey };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { P as PredictClient, a as PredictWsClient, L as ListEventsParams, b as PredictPage, c as PredictEvent, d as ProviderSource, E as EventStatus, e as EventSortField, S as SimilarEventsParams, f as PredictMarket, O as Orderbook, g as ListMarketTradesParams, h as PredictTrade, i as PriceHistoryRange, j as PriceHistoryResponse, k as ListCandlesticksParams, C as Candlestick, l as PositionsResponse, B as BalanceResponse, m as ListOrdersParams, n as PredictOrder, o as CancelOrderResult, M as MatchesParams, p as MatchGroupPage, q as MatchGroup, r as MatchMarketParams, s as MatchMarketPage, t as ListTradesParams, D as DFlowQuoteRequest, u as DFlowQuoteResponse, v as DFlowSubmitResponse, w as DFlowSubmitRequest, x as DFlowKYCStatus, y as PolymarketSetupStatus, W as WithdrawBuildResponse, z as WithdrawBuildRequest, A as WithdrawSubmitResponse, F as WithdrawSubmitRequest, G as WithdrawStatusResponse, H as PolymarketDepositAddresses, I as PolymarketWithdrawResponse, J as PolymarketWithdrawRequest, T as TickSizeResponse, K as WsConnectionStatus, N as WsDataMessage, Q as WsPriceEvent, R as WsOrderbookEvent, U as WsTradeEvent, V as CreateOrderInput } from './server-CYqs2N2z.js';
2
- export { aZ as BuildClobAuthMessageInput, ba as BuildOrderMessageInput, aQ as CLOB_AUTH_DOMAIN, aR as CLOB_AUTH_TYPES, a_ as CTF_EXCHANGE_ADDRESS, b3 as CTF_ORDER_TYPES, b9 as ClobOrderPayload, ac as DFlowOrderContext, ae as DepositBuildRequest, af as DepositBuildResponse, ai as DepositStatusResponse, ag as DepositSubmitRequest, ah as DepositSubmitResponse, a6 as EventSummary, aW as HttpMethod, a3 as MarketOutcome, a2 as MarketResult, a1 as MarketStatus, a7 as MarketSummary, ap as MatchConfidenceTier, al as MatchGroupEntry, am as MatchGroupMarket, aq as MatchMarketFlat, an as MatchSortField, ak as MatchStatus, ao as MatchesStats, a$ as NEG_RISK_CTF_EXCHANGE_ADDRESS, b4 as ORDER_TYPE, bb as OrderMessage, ab as OrderSide, aa as OrderStatus, a4 as OrderbookLevel, b1 as POLYGON_CHAIN_ID, aY as PolymarketL2Headers, aX as PolymarketL2HeadersInput, ad as PolymarketOrderType, a9 as PredictPosition, $ as PredictTag, Z as PredictWsClientConfig, a8 as PricePoint, _ as ProviderMeta, aH as ResolveEventsParamsInput, b5 as SIDE, a0 as SettlementSource, bc as SignedOrder, aI as TagSlugSelection, a5 as TradeType, b0 as USDC_ADDRESS, aj as UnsignedTx, ar as WsChannel, as as WsChannelEvent, at as WsClientMessage, az as WsErrorCode, aA as WsErrorMessage, av as WsPingMessage, ax as WsPongMessage, aw as WsServerMessage, au as WsSubscribeMessage, ay as WsSubscribedMessage, aS as buildClobAuthMessage, b8 as buildClobPayload, b2 as buildCtfExchangeDomain, b6 as buildOrderMessage, aU as buildPolymarketL2Headers, b7 as buildSignedOrder, X as createPredictClient, Y as createPredictWsClient, aV as derivePolymarketApiKey, aB as eventQueryKey, aC as fetchEvent, aG as fetchEventsPage, aK as fetchMarket, aP as fetchMatchMarketsPage, aN as fetchMatchesPage, aT as hmacSha256Base64, aF as infiniteEventsQueryKey, aJ as marketQueryKey, aO as matchMarketsQueryKey, aM as matchQueryKey, aL as matchesQueryKey, aE as resolveEventsParams, aD as resolveTagSlug } from './server-CYqs2N2z.js';
1
+ import { P as PredictClient, a as PredictWsClient, L as ListEventsParams, b as PredictPage, c as PredictEvent, d as ProviderSource, E as EventStats, e as EventStatus, f as EventSortField, S as SimilarEventsParams, g as PredictMarket, O as Orderbook, h as ListMarketTradesParams, i as PredictTrade, j as PriceHistoryRange, k as PriceHistoryResponse, l as ListCandlesticksParams, C as Candlestick, m as PositionsResponse, B as BalanceResponse, n as ListOrdersParams, o as PredictOrder, p as CancelOrderResult, M as MatchesParams, q as MatchGroupPage, r as MatchGroup, s as MatchMarketParams, t as MatchMarketPage, u as ListTradesParams, D as DFlowQuoteRequest, v as DFlowQuoteResponse, w as DFlowSubmitResponse, x as DFlowSubmitRequest, y as DFlowKYCStatus, z as PolymarketSetupStatus, W as WithdrawBuildResponse, A as WithdrawBuildRequest, F as WithdrawSubmitResponse, G as WithdrawSubmitRequest, H as WithdrawStatusResponse, I as PolymarketDepositAddresses, J as PolymarketWithdrawResponse, K as PolymarketWithdrawRequest, T as TickSizeResponse, N as WsConnectionStatus, Q as WsDataMessage, R as WsPriceEvent, U as WsOrderbookEvent, V as WsTradeEvent, X as CreateOrderInput } from './server-D-WAydlX.js';
2
+ export { a_ as BuildClobAuthMessageInput, bb as BuildOrderMessageInput, aR as CLOB_AUTH_DOMAIN, aS as CLOB_AUTH_TYPES, a$ as CTF_EXCHANGE_ADDRESS, b4 as CTF_ORDER_TYPES, ba as ClobOrderPayload, ad as DFlowOrderContext, af as DepositBuildRequest, ag as DepositBuildResponse, aj as DepositStatusResponse, ah as DepositSubmitRequest, ai as DepositSubmitResponse, a7 as EventSummary, aX as HttpMethod, a4 as MarketOutcome, a3 as MarketResult, a2 as MarketStatus, a8 as MarketSummary, aq as MatchConfidenceTier, am as MatchGroupEntry, an as MatchGroupMarket, ar as MatchMarketFlat, ao as MatchSortField, al as MatchStatus, ap as MatchesStats, b0 as NEG_RISK_CTF_EXCHANGE_ADDRESS, b5 as ORDER_TYPE, bc as OrderMessage, ac as OrderSide, ab as OrderStatus, a5 as OrderbookLevel, b2 as POLYGON_CHAIN_ID, aZ as PolymarketL2Headers, aY as PolymarketL2HeadersInput, ae as PolymarketOrderType, aa as PredictPosition, a0 as PredictTag, _ as PredictWsClientConfig, a9 as PricePoint, $ as ProviderMeta, aI as ResolveEventsParamsInput, b6 as SIDE, a1 as SettlementSource, bd as SignedOrder, aJ as TagSlugSelection, a6 as TradeType, b1 as USDC_ADDRESS, ak as UnsignedTx, as as WsChannel, at as WsChannelEvent, au as WsClientMessage, aA as WsErrorCode, aB as WsErrorMessage, aw as WsPingMessage, ay as WsPongMessage, ax as WsServerMessage, av as WsSubscribeMessage, az as WsSubscribedMessage, aT as buildClobAuthMessage, b9 as buildClobPayload, b3 as buildCtfExchangeDomain, b7 as buildOrderMessage, aV as buildPolymarketL2Headers, b8 as buildSignedOrder, Y as createPredictClient, Z as createPredictWsClient, aW as derivePolymarketApiKey, aC as eventQueryKey, aD as fetchEvent, aH as fetchEventsPage, aL as fetchMarket, aQ as fetchMatchMarketsPage, aO as fetchMatchesPage, aU as hmacSha256Base64, aG as infiniteEventsQueryKey, aK as marketQueryKey, aP as matchMarketsQueryKey, aN as matchQueryKey, aM as matchesQueryKey, aF as resolveEventsParams, aE as resolveTagSlug } from './server-D-WAydlX.js';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import * as react from 'react';
5
5
  import { PropsWithChildren } from 'react';
@@ -239,6 +239,19 @@ type InfiniteQueryOptions$2 = Omit<UseInfiniteQueryOptions<PredictPage<PredictEv
239
239
  */
240
240
  declare function useInfiniteEvents(params: ListEventsParams, queryOptions?: InfiniteQueryOptions$2): _tanstack_react_query.UseInfiniteQueryResult<InfiniteData<PredictPage<PredictEvent>, unknown>, Error>;
241
241
 
242
+ /** Stable TanStack Query key for event aggregate statistics. */
243
+ declare function eventStatsQueryKey(): unknown[];
244
+ /**
245
+ * React Query hook for `GET /api/v1/events/stats`.
246
+ *
247
+ * Returns aggregate statistics (total events, 24h volume, avg liquidity,
248
+ * active sources) for all open prediction events. The backend caches the
249
+ * result in Redis with a 30-second TTL.
250
+ *
251
+ * @param queryOptions - Additional TanStack Query options (e.g. `enabled`, `staleTime`).
252
+ */
253
+ declare function useEventStats(queryOptions?: Omit<UseQueryOptions<EventStats, Error, EventStats, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<EventStats, Error>;
254
+
242
255
  interface UseSearchEventsParams {
243
256
  /** Search keyword. */
244
257
  keyword: string;
@@ -795,4 +808,4 @@ interface CreatePolymarketOrderVariables {
795
808
  */
796
809
  declare function useCreatePolymarketOrder(mutationOptions?: Omit<UseMutationOptions<PredictOrder, Error, CreatePolymarketOrderVariables>, "mutationFn">): _tanstack_react_query.UseMutationResult<PredictOrder, Error, CreatePolymarketOrderVariables, unknown>;
797
810
 
798
- export { BalanceResponse, CancelOrderResult, type CancelOrderVariables, Candlestick, ChartRange, type ChartRangeType, CreateOrderInput, type CreatePolymarketOrderVariables, DFlowKYCStatus, DFlowQuoteRequest, DFlowQuoteResponse, DFlowSubmitRequest, DFlowSubmitResponse, EventSortField, EventStatus, ListCandlesticksParams, ListEventsParams, ListMarketTradesParams, ListOrdersParams, ListTradesParams, type MarketHistoryPoint, type MarketHistorySeries, MatchGroup, MatchGroupPage, MatchMarketPage, MatchMarketParams, MatchesParams, Orderbook, PolymarketContext, type PolymarketContextValue, type PolymarketCredentials, PolymarketDepositAddresses, type PolymarketDepositResult, type PolymarketDepositVariables, PolymarketProvider, type PolymarketProviderProps, type PolymarketSigner, PolymarketWithdrawRequest, PolymarketWithdrawResponse, PositionsResponse, PredictClient, PredictContext, type PredictContextValue, PredictEvent, PredictMarket, PredictOrder, PredictPage, PredictProvider, type PredictProviderProps, PredictTrade, PredictWsClient, PriceHistoryRange, PriceHistoryResponse, ProviderSource, SimilarEventsParams, TickSizeResponse, type UseBalanceParams, type UseCandlesticksParams, type UseEventParams, type UseInfiniteMatchMarketsParams, type UseInfiniteMatchesParams, type UseInfiniteOrdersOptions, type UseInfiniteOrdersParams, type UseInfiniteTradesParams, type UseMarketHistoryResult, type UseMarketParams, type UseMarketTradesParams, type UseOrderParams, type UseOrderbookParams, type UseOrderbookSubscriptionParams, type UseOrderbookSubscriptionResult, type UseOrdersOptions, type UsePositionsMultiParams, type UsePositionsParams, type UsePredictWsClientResult, type UsePriceHistoryParams, type UsePricesSubscriptionParams, type UsePricesSubscriptionResult, type UseRealtimeOrderbookParams, type UseRealtimePricesParams, type UseRealtimeTradesParams, type UseRealtimeTradesResult, type UseSearchEventsParams, type UseSimilarEventsParams, type UseTradesSubscriptionParams, type UseTradesSubscriptionResult, type UseWithdrawStatusQueryParams, WithdrawBuildRequest, WithdrawBuildResponse, WithdrawStatusResponse, WithdrawSubmitRequest, WithdrawSubmitResponse, WsConnectionStatus, WsDataMessage, WsOrderbookEvent, WsPriceEvent, WsTradeEvent, balanceQueryKey, candlesticksQueryKey, dflowKYCQueryKey, dflowQuoteQueryKey, eventsQueryKey, fetchEvents, infiniteOrdersQueryKey, infiniteTradesQueryKey, marketTradesQueryKey, orderQueryKey, orderbookQueryKey, ordersQueryKey, polymarketDepositAddressesQueryKey, polymarketSetupQueryKey, positionsMultiQueryKey, positionsQueryKey, priceHistoryQueryKey, similarEventsQueryKey, tickSizeQueryKey, tradesQueryKey, useBalance, useCancelOrder, useCandlesticks, useCreatePolymarketOrder, useDFlowKYC, useDFlowQuote, useDFlowSubmit, useEvent, useEvents, useInfiniteEvents, useInfiniteMatchMarkets, useInfiniteMatches, useInfiniteOrders, useInfiniteTrades, useMarket, useMarketHistory, useMarketTrades, useMatch, useOrder, useOrderbook, useOrderbookSubscription, useOrders, usePolymarket, usePolymarketDeposit, usePolymarketDepositAddresses, usePolymarketSetup, usePolymarketWithdraw, usePositions, usePositionsMulti, usePredictClient, usePredictWsClient, usePriceHistory, usePricesSubscription, useRealtimeOrderbook, useRealtimePrices, useRealtimeTrades, useRunPolymarketSetup, useSearchEvents, useSimilarEvents, useTickSize, useTrades, useTradesSubscription, useWithdrawBuildMutation, useWithdrawStatusQuery, useWithdrawSubmitMutation, withdrawStatusQueryKey };
811
+ export { BalanceResponse, CancelOrderResult, type CancelOrderVariables, Candlestick, ChartRange, type ChartRangeType, CreateOrderInput, type CreatePolymarketOrderVariables, DFlowKYCStatus, DFlowQuoteRequest, DFlowQuoteResponse, DFlowSubmitRequest, DFlowSubmitResponse, EventSortField, EventStats, EventStatus, ListCandlesticksParams, ListEventsParams, ListMarketTradesParams, ListOrdersParams, ListTradesParams, type MarketHistoryPoint, type MarketHistorySeries, MatchGroup, MatchGroupPage, MatchMarketPage, MatchMarketParams, MatchesParams, Orderbook, PolymarketContext, type PolymarketContextValue, type PolymarketCredentials, PolymarketDepositAddresses, type PolymarketDepositResult, type PolymarketDepositVariables, PolymarketProvider, type PolymarketProviderProps, type PolymarketSigner, PolymarketWithdrawRequest, PolymarketWithdrawResponse, PositionsResponse, PredictClient, PredictContext, type PredictContextValue, PredictEvent, PredictMarket, PredictOrder, PredictPage, PredictProvider, type PredictProviderProps, PredictTrade, PredictWsClient, PriceHistoryRange, PriceHistoryResponse, ProviderSource, SimilarEventsParams, TickSizeResponse, type UseBalanceParams, type UseCandlesticksParams, type UseEventParams, type UseInfiniteMatchMarketsParams, type UseInfiniteMatchesParams, type UseInfiniteOrdersOptions, type UseInfiniteOrdersParams, type UseInfiniteTradesParams, type UseMarketHistoryResult, type UseMarketParams, type UseMarketTradesParams, type UseOrderParams, type UseOrderbookParams, type UseOrderbookSubscriptionParams, type UseOrderbookSubscriptionResult, type UseOrdersOptions, type UsePositionsMultiParams, type UsePositionsParams, type UsePredictWsClientResult, type UsePriceHistoryParams, type UsePricesSubscriptionParams, type UsePricesSubscriptionResult, type UseRealtimeOrderbookParams, type UseRealtimePricesParams, type UseRealtimeTradesParams, type UseRealtimeTradesResult, type UseSearchEventsParams, type UseSimilarEventsParams, type UseTradesSubscriptionParams, type UseTradesSubscriptionResult, type UseWithdrawStatusQueryParams, WithdrawBuildRequest, WithdrawBuildResponse, WithdrawStatusResponse, WithdrawSubmitRequest, WithdrawSubmitResponse, WsConnectionStatus, WsDataMessage, WsOrderbookEvent, WsPriceEvent, WsTradeEvent, balanceQueryKey, candlesticksQueryKey, dflowKYCQueryKey, dflowQuoteQueryKey, eventStatsQueryKey, eventsQueryKey, fetchEvents, infiniteOrdersQueryKey, infiniteTradesQueryKey, marketTradesQueryKey, orderQueryKey, orderbookQueryKey, ordersQueryKey, polymarketDepositAddressesQueryKey, polymarketSetupQueryKey, positionsMultiQueryKey, positionsQueryKey, priceHistoryQueryKey, similarEventsQueryKey, tickSizeQueryKey, tradesQueryKey, useBalance, useCancelOrder, useCandlesticks, useCreatePolymarketOrder, useDFlowKYC, useDFlowQuote, useDFlowSubmit, useEvent, useEventStats, useEvents, useInfiniteEvents, useInfiniteMatchMarkets, useInfiniteMatches, useInfiniteOrders, useInfiniteTrades, useMarket, useMarketHistory, useMarketTrades, useMatch, useOrder, useOrderbook, useOrderbookSubscription, useOrders, usePolymarket, usePolymarketDeposit, usePolymarketDepositAddresses, usePolymarketSetup, usePolymarketWithdraw, usePositions, usePositionsMulti, usePredictClient, usePredictWsClient, usePriceHistory, usePricesSubscription, useRealtimeOrderbook, useRealtimePrices, useRealtimeTrades, useRunPolymarketSetup, useSearchEvents, useSimilarEvents, useTickSize, useTrades, useTradesSubscription, useWithdrawBuildMutation, useWithdrawStatusQuery, useWithdrawSubmitMutation, withdrawStatusQueryKey };
package/dist/index.js CHANGED
@@ -52,6 +52,15 @@ var PredictClient = class {
52
52
  const url = `${this.endpoint}/api/v1/events/${encodeURIComponent(slug)}${query}`;
53
53
  return await utils.httpGet(url);
54
54
  }
55
+ /**
56
+ * Fetch aggregate statistics for all open events.
57
+ *
58
+ * Maps to `GET /api/v1/events/stats`.
59
+ */
60
+ async getEventStats() {
61
+ const url = `${this.endpoint}/api/v1/events/stats`;
62
+ return await utils.httpGet(url);
63
+ }
55
64
  /**
56
65
  * Fetch events similar to the given slug.
57
66
  *
@@ -994,6 +1003,18 @@ function useInfiniteEvents(params, queryOptions = {}) {
994
1003
  ...queryOptions
995
1004
  });
996
1005
  }
1006
+ function eventStatsQueryKey() {
1007
+ return ["predict", "events", "stats"];
1008
+ }
1009
+ function useEventStats(queryOptions = {}) {
1010
+ const client = usePredictClient();
1011
+ return reactQuery.useQuery({
1012
+ queryKey: eventStatsQueryKey(),
1013
+ queryFn: () => client.getEventStats(),
1014
+ staleTime: 3e4,
1015
+ ...queryOptions
1016
+ });
1017
+ }
997
1018
  function searchEventsQueryKey(params) {
998
1019
  return ["predict", "search", params];
999
1020
  }
@@ -1342,7 +1363,8 @@ function useInfiniteMatchMarkets(params, queryOptions = {}) {
1342
1363
  }),
1343
1364
  initialPageParam: 0,
1344
1365
  getNextPageParam: (lastPage) => {
1345
- const nextOffset = lastPage.offset + lastPage.items.length;
1366
+ const items = lastPage.items ?? [];
1367
+ const nextOffset = lastPage.offset + items.length;
1346
1368
  return nextOffset < lastPage.total ? nextOffset : void 0;
1347
1369
  },
1348
1370
  ...queryOptions
@@ -2048,6 +2070,7 @@ exports.derivePolymarketApiKey = derivePolymarketApiKey;
2048
2070
  exports.dflowKYCQueryKey = dflowKYCQueryKey;
2049
2071
  exports.dflowQuoteQueryKey = dflowQuoteQueryKey;
2050
2072
  exports.eventQueryKey = eventQueryKey;
2073
+ exports.eventStatsQueryKey = eventStatsQueryKey;
2051
2074
  exports.eventsQueryKey = eventsQueryKey;
2052
2075
  exports.fetchEvent = fetchEvent;
2053
2076
  exports.fetchEvents = fetchEvents;
@@ -2085,6 +2108,7 @@ exports.useDFlowKYC = useDFlowKYC;
2085
2108
  exports.useDFlowQuote = useDFlowQuote;
2086
2109
  exports.useDFlowSubmit = useDFlowSubmit;
2087
2110
  exports.useEvent = useEvent;
2111
+ exports.useEventStats = useEventStats;
2088
2112
  exports.useEvents = useEvents;
2089
2113
  exports.useInfiniteEvents = useInfiniteEvents;
2090
2114
  exports.useInfiniteMatchMarkets = useInfiniteMatchMarkets;