@liberfi.io/react-predict 0.3.31 → 0.3.32

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 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, A as AvailableSharesResponse, B as BalanceResponse, n as ListOrdersParams, o as PredictOrder, p as ListOrdersMultiParams, q as PredictOrdersResponse, r as CancelOrderResult, M as MatchesParams, s as MatchGroupPage, t as MatchGroup, u as MatchMarketParams, v as MatchMarketPage, w as ListTradesParams, x as ListTradesMultiParams, D as DFlowQuoteRequest, y as DFlowQuoteResponse, z as DFlowSubmitResponse, F as DFlowSubmitRequest, G as DFlowKYCStatus, H as PolymarketSetupStatus, W as WithdrawBuildResponse, I as WithdrawBuildRequest, J as WithdrawSubmitResponse, K as WithdrawSubmitRequest, N as WithdrawStatusResponse, Q as PolymarketDepositAddresses, R as PolymarketSupportedAsset, T as PolymarketWithdrawResponse, U as PolymarketWithdrawRequest, V as PolymarketRedeemResponse, X as TickSizeResponse, Y as FeeRateResponse, Z as WsConnectionStatus, _ as WsDataMessage, $ as WsPriceEvent, a0 as WsOrderbookEvent, a1 as WsTradeEvent, a2 as CreateOrderInput } from './server-D2N-KDxj.mjs';
2
- export { be as BuildClobAuthMessageInput, bs as BuildOrderMessageInput, b5 as CLOB_AUTH_DOMAIN, b6 as CLOB_AUTH_TYPES, bf as CTF_EXCHANGE_ADDRESS, bk as CTF_ORDER_TYPES, br as ClobOrderPayload, ak as DFlowOrderContext, am as DepositBuildRequest, an as DepositBuildResponse, aq as DepositStatusResponse, ao as DepositSubmitRequest, ap as DepositSubmitResponse, ae as EventSummary, bb as HttpMethod, ab as MarketOutcome, aa as MarketResult, a9 as MarketStatus, af as MarketSummary, aB as MatchConfidenceTier, ax as MatchGroupEntry, ay as MatchGroupMarket, aD as MatchLeg, aE as MatchMarketFlat, az as MatchSortField, aw as MatchStatus, aA as MatchesStats, bg as NEG_RISK_CTF_EXCHANGE_ADDRESS, bl as ORDER_TYPE, bt as OrderMessage, aj as OrderSide, ai as OrderStatus, ac as OrderbookLevel, bi as POLYGON_CHAIN_ID, as as PolymarketBridgeToken, bd as PolymarketL2Headers, bc as PolymarketL2HeadersInput, al as PolymarketOrderType, aR as PolymarketRedeemInput, aP as PolymarketRedeemPrepareInput, aQ as PolymarketRedeemPrepareResponse, at as PolymarketSupportedAssetsResponse, au as PolymarketWithdrawPrepareRequest, av as PolymarketWithdrawPrepareResponse, ah as PredictPosition, a7 as PredictTag, a5 as PredictWsClientConfig, ag as PricePoint, a6 as ProviderMeta, aY as ResolveEventsParamsInput, bm as SIDE, a8 as SettlementSource, aC as SignalTag, bu as SignedOrder, aZ as TagSlugSelection, ad as TradeType, bh as USDC_ADDRESS, ar as UnsignedTx, aF as WsChannel, aG as WsChannelEvent, aH as WsClientMessage, aN as WsErrorCode, aO as WsErrorMessage, aJ as WsPingMessage, aL as WsPongMessage, aK as WsServerMessage, aI as WsSubscribeMessage, aM as WsSubscribedMessage, b7 as buildClobAuthMessage, bp as buildClobPayload, bj as buildCtfExchangeDomain, bn as buildOrderMessage, b9 as buildPolymarketL2Headers, bo as buildSignedOrder, a3 as createPredictClient, a4 as createPredictWsClient, ba as derivePolymarketApiKey, aS as eventQueryKey, aT as fetchEvent, aX as fetchEventsPage, a$ as fetchMarket, b4 as fetchMatchMarketsPage, b2 as fetchMatchesPage, bq as getPolymarketSharesPrecision, b8 as hmacSha256Base64, aW as infiniteEventsQueryKey, a_ as marketQueryKey, b3 as matchMarketsQueryKey, b1 as matchQueryKey, b0 as matchesQueryKey, aV as resolveEventsParams, aU as resolveTagSlug } from './server-D2N-KDxj.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 ListCommentsParams, n as PredictComment, o as PositionsResponse, A as AvailableSharesResponse, B as BalanceResponse, p as ListOrdersParams, q as PredictOrder, r as ListOrdersMultiParams, s as PredictOrdersResponse, t as CancelOrderResult, M as MatchesParams, u as MatchGroupPage, v as MatchGroup, w as MatchMarketParams, x as MatchMarketPage, y as ListTradesParams, z as ListTradesMultiParams, D as DFlowQuoteRequest, F as DFlowQuoteResponse, G as DFlowSubmitResponse, H as DFlowSubmitRequest, I as DFlowKYCStatus, J as PolymarketSetupStatus, W as WithdrawBuildResponse, K as WithdrawBuildRequest, N as WithdrawSubmitResponse, Q as WithdrawSubmitRequest, R as WithdrawStatusResponse, T as PolymarketDepositAddresses, U as PolymarketSupportedAsset, V as PolymarketWithdrawResponse, X as PolymarketWithdrawRequest, Y as PolymarketRedeemResponse, Z as TickSizeResponse, _ as FeeRateResponse, $ as WsConnectionStatus, a0 as WsDataMessage, a1 as WsPriceEvent, a2 as WsOrderbookEvent, a3 as WsTradeEvent, a4 as CreateOrderInput } from './server-FZwoxwxh.mjs';
2
+ export { bh as BuildClobAuthMessageInput, bv as BuildOrderMessageInput, b8 as CLOB_AUTH_DOMAIN, b9 as CLOB_AUTH_TYPES, bi as CTF_EXCHANGE_ADDRESS, bn as CTF_ORDER_TYPES, bu as ClobOrderPayload, an as DFlowOrderContext, ap as DepositBuildRequest, aq as DepositBuildResponse, at as DepositStatusResponse, ar as DepositSubmitRequest, as as DepositSubmitResponse, ag as EventSummary, be as HttpMethod, ad as MarketOutcome, ac as MarketResult, ab as MarketStatus, ah as MarketSummary, aE as MatchConfidenceTier, aA as MatchGroupEntry, aB as MatchGroupMarket, aG as MatchLeg, aH as MatchMarketFlat, aC as MatchSortField, az as MatchStatus, aD as MatchesStats, bj as NEG_RISK_CTF_EXCHANGE_ADDRESS, bo as ORDER_TYPE, bw as OrderMessage, am as OrderSide, al as OrderStatus, ae as OrderbookLevel, bl as POLYGON_CHAIN_ID, av as PolymarketBridgeToken, bg as PolymarketL2Headers, bf as PolymarketL2HeadersInput, ao as PolymarketOrderType, aU as PolymarketRedeemInput, aS as PolymarketRedeemPrepareInput, aT as PolymarketRedeemPrepareResponse, aw as PolymarketSupportedAssetsResponse, ax as PolymarketWithdrawPrepareRequest, ay as PolymarketWithdrawPrepareResponse, ai as PredictCommentProfile, ak as PredictPosition, a9 as PredictTag, a7 as PredictWsClientConfig, aj as PricePoint, a8 as ProviderMeta, a$ as ResolveEventsParamsInput, bp as SIDE, aa as SettlementSource, aF as SignalTag, bx as SignedOrder, b0 as TagSlugSelection, af as TradeType, bk as USDC_ADDRESS, au as UnsignedTx, aI as WsChannel, aJ as WsChannelEvent, aK as WsClientMessage, aQ as WsErrorCode, aR as WsErrorMessage, aM as WsPingMessage, aO as WsPongMessage, aN as WsServerMessage, aL as WsSubscribeMessage, aP as WsSubscribedMessage, ba as buildClobAuthMessage, bs as buildClobPayload, bm as buildCtfExchangeDomain, bq as buildOrderMessage, bc as buildPolymarketL2Headers, br as buildSignedOrder, a5 as createPredictClient, a6 as createPredictWsClient, bd as derivePolymarketApiKey, aV as eventQueryKey, aW as fetchEvent, a_ as fetchEventsPage, b2 as fetchMarket, b7 as fetchMatchMarketsPage, b5 as fetchMatchesPage, bt as getPolymarketSharesPrecision, bb as hmacSha256Base64, aZ as infiniteEventsQueryKey, b1 as marketQueryKey, b6 as matchMarketsQueryKey, b4 as matchQueryKey, b3 as matchesQueryKey, aY as resolveEventsParams, aX as resolveTagSlug } from './server-FZwoxwxh.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';
@@ -369,6 +369,25 @@ interface UseCandlesticksParams {
369
369
  }
370
370
  declare function useCandlesticks(params: UseCandlesticksParams, queryOptions?: Omit<UseQueryOptions<Candlestick[], Error, Candlestick[], unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<Candlestick[], Error>;
371
371
 
372
+ /**
373
+ * Params for {@link useInfiniteComments}. `slug` identifies the event; the
374
+ * remaining fields mirror {@link ListCommentsParams} minus the opaque `cursor`,
375
+ * which the hook manages internally for pagination.
376
+ */
377
+ interface UseInfiniteCommentsParams extends Omit<ListCommentsParams, "cursor"> {
378
+ /** Canonical event slug. */
379
+ slug: string;
380
+ }
381
+ declare function infiniteCommentsQueryKey(params: UseInfiniteCommentsParams): unknown[];
382
+ /**
383
+ * Infinite (cursor-paginated) comments for a prediction event.
384
+ *
385
+ * The server transparently resolves the event to its parent series when one
386
+ * exists, so the same hook works for standalone events and grouped events
387
+ * (e.g. World Cup matches) alike.
388
+ */
389
+ declare function useInfiniteComments(params: UseInfiniteCommentsParams): _tanstack_react_query.UseInfiniteQueryResult<_tanstack_react_query.InfiniteData<PredictPage<PredictComment>, unknown>, Error>;
390
+
372
391
  declare function positionsQueryKey(user: string, source?: ProviderSource): unknown[];
373
392
  declare function positionsMultiQueryKey(wallets: {
374
393
  kalshi_user?: string;
@@ -993,4 +1012,4 @@ interface WalkOrderbookParams {
993
1012
  */
994
1013
  declare function walkOrderbook({ orderbook, outcome, side, sharesNeeded, slippageBps, }: WalkOrderbookParams): WalkResult;
995
1014
 
996
- export { AvailableSharesResponse, BalanceResponse, CancelOrderResult, type CancelOrderVariables, Candlestick, ChartRange, type ChartRangeType, CreateOrderInput, type CreatePolymarketOrderVariables, DFlowKYCStatus, DFlowQuoteRequest, DFlowQuoteResponse, DFlowSubmitRequest, DFlowSubmitResponse, EventSortField, EventStats, EventStatus, FeeRateResponse, ListCandlesticksParams, ListEventsParams, ListMarketTradesParams, ListOrdersMultiParams, ListOrdersParams, ListTradesMultiParams, ListTradesParams, type MarketHistoryPoint, type MarketHistorySeries, MatchGroup, MatchGroupPage, MatchMarketPage, MatchMarketParams, MatchesParams, Orderbook, PolymarketContext, type PolymarketContextValue, type PolymarketCredentials, PolymarketDepositAddresses, type PolymarketDepositResult, type PolymarketDepositVariables, PolymarketProvider, type PolymarketProviderProps, PolymarketRedeemResponse, type PolymarketSigner, PolymarketSupportedAsset, PolymarketWithdrawRequest, PolymarketWithdrawResponse, PositionsResponse, PredictClient, PredictContext, type PredictContextValue, PredictEvent, PredictMarket, PredictOrder, PredictOrdersResponse, PredictPage, PredictProvider, type PredictProviderProps, PredictTrade, PredictWsClient, PriceHistoryRange, PriceHistoryResponse, ProviderSource, type RedeemPositionVariables, SimilarEventsParams, TickSizeResponse, type UseAvailableSharesOptions, type UseAvailableSharesParams, type UseBalanceParams, type UseCancelOrderOptions, type UseCandlesticksParams, type UseEventParams, type UseInfiniteMatchMarketsParams, type UseInfiniteMatchesParams, type UseInfiniteOrdersOptions, type UseInfiniteOrdersParams, type UseInfiniteTradesMultiParams, type UseInfiniteTradesParams, type UseMarketHistoryResult, type UseMarketParams, type UseMarketTradesParams, type UseOrderParams, type UseOrderbookParams, type UseOrderbookSubscriptionParams, type UseOrderbookSubscriptionResult, type UseOrdersMultiOptions, 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, type WalkOrderbookParams, type WalkOutcome, type WalkResult, type WalkSide, type WalkStatus, WithdrawBuildRequest, WithdrawBuildResponse, WithdrawStatusResponse, WithdrawSubmitRequest, WithdrawSubmitResponse, WsConnectionStatus, WsDataMessage, WsOrderbookEvent, WsPriceEvent, WsTradeEvent, availableSharesQueryKey, balanceQueryKey, candlesticksQueryKey, dflowKYCQueryKey, dflowQuoteQueryKey, eventStatsQueryKey, eventsQueryKey, feeRateQueryKey, fetchEvents, infiniteOrdersQueryKey, infiniteTradesMultiQueryKey, infiniteTradesQueryKey, marketTradesQueryKey, orderQueryKey, orderbookQueryKey, ordersMultiQueryKey, ordersQueryKey, pickBestAsk, pickBestBid, polymarketDepositAddressesQueryKey, polymarketSetupQueryKey, polymarketSupportedAssetsQueryKey, positionsMultiQueryKey, positionsQueryKey, priceHistoryQueryKey, similarEventsQueryKey, tickSizeQueryKey, tradesQueryKey, useAvailableShares, useBalance, useCancelOrder, useCandlesticks, useCreatePolymarketOrder, useDFlowKYC, useDFlowQuote, useDFlowSubmit, useEvent, useEventStats, useEvents, useFeeRate, useInfiniteEvents, useInfiniteMatchMarkets, useInfiniteMatches, useInfiniteOrders, useInfiniteTrades, useInfiniteTradesMulti, useMarket, useMarketHistory, useMarketTrades, useMatch, useOrder, useOrderbook, useOrderbookSubscription, useOrders, useOrdersMulti, usePolymarket, usePolymarketDeposit, usePolymarketDepositAddresses, usePolymarketSetup, usePolymarketSupportedAssets, usePolymarketWithdraw, usePositions, usePositionsMulti, usePredictClient, usePredictWsClient, usePriceHistory, usePricesSubscription, useRealtimeOrderbook, useRealtimePrices, useRealtimeTrades, useRedeemPosition, useRunPolymarketSetup, useSearchEvents, useSimilarEvents, useTickSize, useTrades, useTradesSubscription, useWithdrawBuildMutation, useWithdrawStatusQuery, useWithdrawSubmitMutation, walkOrderbook, withdrawStatusQueryKey };
1015
+ export { AvailableSharesResponse, BalanceResponse, CancelOrderResult, type CancelOrderVariables, Candlestick, ChartRange, type ChartRangeType, CreateOrderInput, type CreatePolymarketOrderVariables, DFlowKYCStatus, DFlowQuoteRequest, DFlowQuoteResponse, DFlowSubmitRequest, DFlowSubmitResponse, EventSortField, EventStats, EventStatus, FeeRateResponse, ListCandlesticksParams, ListCommentsParams, ListEventsParams, ListMarketTradesParams, ListOrdersMultiParams, ListOrdersParams, ListTradesMultiParams, ListTradesParams, type MarketHistoryPoint, type MarketHistorySeries, MatchGroup, MatchGroupPage, MatchMarketPage, MatchMarketParams, MatchesParams, Orderbook, PolymarketContext, type PolymarketContextValue, type PolymarketCredentials, PolymarketDepositAddresses, type PolymarketDepositResult, type PolymarketDepositVariables, PolymarketProvider, type PolymarketProviderProps, PolymarketRedeemResponse, type PolymarketSigner, PolymarketSupportedAsset, PolymarketWithdrawRequest, PolymarketWithdrawResponse, PositionsResponse, PredictClient, PredictComment, PredictContext, type PredictContextValue, PredictEvent, PredictMarket, PredictOrder, PredictOrdersResponse, PredictPage, PredictProvider, type PredictProviderProps, PredictTrade, PredictWsClient, PriceHistoryRange, PriceHistoryResponse, ProviderSource, type RedeemPositionVariables, SimilarEventsParams, TickSizeResponse, type UseAvailableSharesOptions, type UseAvailableSharesParams, type UseBalanceParams, type UseCancelOrderOptions, type UseCandlesticksParams, type UseEventParams, type UseInfiniteCommentsParams, type UseInfiniteMatchMarketsParams, type UseInfiniteMatchesParams, type UseInfiniteOrdersOptions, type UseInfiniteOrdersParams, type UseInfiniteTradesMultiParams, type UseInfiniteTradesParams, type UseMarketHistoryResult, type UseMarketParams, type UseMarketTradesParams, type UseOrderParams, type UseOrderbookParams, type UseOrderbookSubscriptionParams, type UseOrderbookSubscriptionResult, type UseOrdersMultiOptions, 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, type WalkOrderbookParams, type WalkOutcome, type WalkResult, type WalkSide, type WalkStatus, WithdrawBuildRequest, WithdrawBuildResponse, WithdrawStatusResponse, WithdrawSubmitRequest, WithdrawSubmitResponse, WsConnectionStatus, WsDataMessage, WsOrderbookEvent, WsPriceEvent, WsTradeEvent, availableSharesQueryKey, balanceQueryKey, candlesticksQueryKey, dflowKYCQueryKey, dflowQuoteQueryKey, eventStatsQueryKey, eventsQueryKey, feeRateQueryKey, fetchEvents, infiniteCommentsQueryKey, infiniteOrdersQueryKey, infiniteTradesMultiQueryKey, infiniteTradesQueryKey, marketTradesQueryKey, orderQueryKey, orderbookQueryKey, ordersMultiQueryKey, ordersQueryKey, pickBestAsk, pickBestBid, polymarketDepositAddressesQueryKey, polymarketSetupQueryKey, polymarketSupportedAssetsQueryKey, positionsMultiQueryKey, positionsQueryKey, priceHistoryQueryKey, similarEventsQueryKey, tickSizeQueryKey, tradesQueryKey, useAvailableShares, useBalance, useCancelOrder, useCandlesticks, useCreatePolymarketOrder, useDFlowKYC, useDFlowQuote, useDFlowSubmit, useEvent, useEventStats, useEvents, useFeeRate, useInfiniteComments, useInfiniteEvents, useInfiniteMatchMarkets, useInfiniteMatches, useInfiniteOrders, useInfiniteTrades, useInfiniteTradesMulti, useMarket, useMarketHistory, useMarketTrades, useMatch, useOrder, useOrderbook, useOrderbookSubscription, useOrders, useOrdersMulti, usePolymarket, usePolymarketDeposit, usePolymarketDepositAddresses, usePolymarketSetup, usePolymarketSupportedAssets, usePolymarketWithdraw, usePositions, usePositionsMulti, usePredictClient, usePredictWsClient, usePriceHistory, usePricesSubscription, useRealtimeOrderbook, useRealtimePrices, useRealtimeTrades, useRedeemPosition, useRunPolymarketSetup, useSearchEvents, useSimilarEvents, useTickSize, useTrades, useTradesSubscription, useWithdrawBuildMutation, useWithdrawStatusQuery, useWithdrawSubmitMutation, walkOrderbook, 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 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, A as AvailableSharesResponse, B as BalanceResponse, n as ListOrdersParams, o as PredictOrder, p as ListOrdersMultiParams, q as PredictOrdersResponse, r as CancelOrderResult, M as MatchesParams, s as MatchGroupPage, t as MatchGroup, u as MatchMarketParams, v as MatchMarketPage, w as ListTradesParams, x as ListTradesMultiParams, D as DFlowQuoteRequest, y as DFlowQuoteResponse, z as DFlowSubmitResponse, F as DFlowSubmitRequest, G as DFlowKYCStatus, H as PolymarketSetupStatus, W as WithdrawBuildResponse, I as WithdrawBuildRequest, J as WithdrawSubmitResponse, K as WithdrawSubmitRequest, N as WithdrawStatusResponse, Q as PolymarketDepositAddresses, R as PolymarketSupportedAsset, T as PolymarketWithdrawResponse, U as PolymarketWithdrawRequest, V as PolymarketRedeemResponse, X as TickSizeResponse, Y as FeeRateResponse, Z as WsConnectionStatus, _ as WsDataMessage, $ as WsPriceEvent, a0 as WsOrderbookEvent, a1 as WsTradeEvent, a2 as CreateOrderInput } from './server-D2N-KDxj.js';
2
- export { be as BuildClobAuthMessageInput, bs as BuildOrderMessageInput, b5 as CLOB_AUTH_DOMAIN, b6 as CLOB_AUTH_TYPES, bf as CTF_EXCHANGE_ADDRESS, bk as CTF_ORDER_TYPES, br as ClobOrderPayload, ak as DFlowOrderContext, am as DepositBuildRequest, an as DepositBuildResponse, aq as DepositStatusResponse, ao as DepositSubmitRequest, ap as DepositSubmitResponse, ae as EventSummary, bb as HttpMethod, ab as MarketOutcome, aa as MarketResult, a9 as MarketStatus, af as MarketSummary, aB as MatchConfidenceTier, ax as MatchGroupEntry, ay as MatchGroupMarket, aD as MatchLeg, aE as MatchMarketFlat, az as MatchSortField, aw as MatchStatus, aA as MatchesStats, bg as NEG_RISK_CTF_EXCHANGE_ADDRESS, bl as ORDER_TYPE, bt as OrderMessage, aj as OrderSide, ai as OrderStatus, ac as OrderbookLevel, bi as POLYGON_CHAIN_ID, as as PolymarketBridgeToken, bd as PolymarketL2Headers, bc as PolymarketL2HeadersInput, al as PolymarketOrderType, aR as PolymarketRedeemInput, aP as PolymarketRedeemPrepareInput, aQ as PolymarketRedeemPrepareResponse, at as PolymarketSupportedAssetsResponse, au as PolymarketWithdrawPrepareRequest, av as PolymarketWithdrawPrepareResponse, ah as PredictPosition, a7 as PredictTag, a5 as PredictWsClientConfig, ag as PricePoint, a6 as ProviderMeta, aY as ResolveEventsParamsInput, bm as SIDE, a8 as SettlementSource, aC as SignalTag, bu as SignedOrder, aZ as TagSlugSelection, ad as TradeType, bh as USDC_ADDRESS, ar as UnsignedTx, aF as WsChannel, aG as WsChannelEvent, aH as WsClientMessage, aN as WsErrorCode, aO as WsErrorMessage, aJ as WsPingMessage, aL as WsPongMessage, aK as WsServerMessage, aI as WsSubscribeMessage, aM as WsSubscribedMessage, b7 as buildClobAuthMessage, bp as buildClobPayload, bj as buildCtfExchangeDomain, bn as buildOrderMessage, b9 as buildPolymarketL2Headers, bo as buildSignedOrder, a3 as createPredictClient, a4 as createPredictWsClient, ba as derivePolymarketApiKey, aS as eventQueryKey, aT as fetchEvent, aX as fetchEventsPage, a$ as fetchMarket, b4 as fetchMatchMarketsPage, b2 as fetchMatchesPage, bq as getPolymarketSharesPrecision, b8 as hmacSha256Base64, aW as infiniteEventsQueryKey, a_ as marketQueryKey, b3 as matchMarketsQueryKey, b1 as matchQueryKey, b0 as matchesQueryKey, aV as resolveEventsParams, aU as resolveTagSlug } from './server-D2N-KDxj.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 ListCommentsParams, n as PredictComment, o as PositionsResponse, A as AvailableSharesResponse, B as BalanceResponse, p as ListOrdersParams, q as PredictOrder, r as ListOrdersMultiParams, s as PredictOrdersResponse, t as CancelOrderResult, M as MatchesParams, u as MatchGroupPage, v as MatchGroup, w as MatchMarketParams, x as MatchMarketPage, y as ListTradesParams, z as ListTradesMultiParams, D as DFlowQuoteRequest, F as DFlowQuoteResponse, G as DFlowSubmitResponse, H as DFlowSubmitRequest, I as DFlowKYCStatus, J as PolymarketSetupStatus, W as WithdrawBuildResponse, K as WithdrawBuildRequest, N as WithdrawSubmitResponse, Q as WithdrawSubmitRequest, R as WithdrawStatusResponse, T as PolymarketDepositAddresses, U as PolymarketSupportedAsset, V as PolymarketWithdrawResponse, X as PolymarketWithdrawRequest, Y as PolymarketRedeemResponse, Z as TickSizeResponse, _ as FeeRateResponse, $ as WsConnectionStatus, a0 as WsDataMessage, a1 as WsPriceEvent, a2 as WsOrderbookEvent, a3 as WsTradeEvent, a4 as CreateOrderInput } from './server-FZwoxwxh.js';
2
+ export { bh as BuildClobAuthMessageInput, bv as BuildOrderMessageInput, b8 as CLOB_AUTH_DOMAIN, b9 as CLOB_AUTH_TYPES, bi as CTF_EXCHANGE_ADDRESS, bn as CTF_ORDER_TYPES, bu as ClobOrderPayload, an as DFlowOrderContext, ap as DepositBuildRequest, aq as DepositBuildResponse, at as DepositStatusResponse, ar as DepositSubmitRequest, as as DepositSubmitResponse, ag as EventSummary, be as HttpMethod, ad as MarketOutcome, ac as MarketResult, ab as MarketStatus, ah as MarketSummary, aE as MatchConfidenceTier, aA as MatchGroupEntry, aB as MatchGroupMarket, aG as MatchLeg, aH as MatchMarketFlat, aC as MatchSortField, az as MatchStatus, aD as MatchesStats, bj as NEG_RISK_CTF_EXCHANGE_ADDRESS, bo as ORDER_TYPE, bw as OrderMessage, am as OrderSide, al as OrderStatus, ae as OrderbookLevel, bl as POLYGON_CHAIN_ID, av as PolymarketBridgeToken, bg as PolymarketL2Headers, bf as PolymarketL2HeadersInput, ao as PolymarketOrderType, aU as PolymarketRedeemInput, aS as PolymarketRedeemPrepareInput, aT as PolymarketRedeemPrepareResponse, aw as PolymarketSupportedAssetsResponse, ax as PolymarketWithdrawPrepareRequest, ay as PolymarketWithdrawPrepareResponse, ai as PredictCommentProfile, ak as PredictPosition, a9 as PredictTag, a7 as PredictWsClientConfig, aj as PricePoint, a8 as ProviderMeta, a$ as ResolveEventsParamsInput, bp as SIDE, aa as SettlementSource, aF as SignalTag, bx as SignedOrder, b0 as TagSlugSelection, af as TradeType, bk as USDC_ADDRESS, au as UnsignedTx, aI as WsChannel, aJ as WsChannelEvent, aK as WsClientMessage, aQ as WsErrorCode, aR as WsErrorMessage, aM as WsPingMessage, aO as WsPongMessage, aN as WsServerMessage, aL as WsSubscribeMessage, aP as WsSubscribedMessage, ba as buildClobAuthMessage, bs as buildClobPayload, bm as buildCtfExchangeDomain, bq as buildOrderMessage, bc as buildPolymarketL2Headers, br as buildSignedOrder, a5 as createPredictClient, a6 as createPredictWsClient, bd as derivePolymarketApiKey, aV as eventQueryKey, aW as fetchEvent, a_ as fetchEventsPage, b2 as fetchMarket, b7 as fetchMatchMarketsPage, b5 as fetchMatchesPage, bt as getPolymarketSharesPrecision, bb as hmacSha256Base64, aZ as infiniteEventsQueryKey, b1 as marketQueryKey, b6 as matchMarketsQueryKey, b4 as matchQueryKey, b3 as matchesQueryKey, aY as resolveEventsParams, aX as resolveTagSlug } from './server-FZwoxwxh.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';
@@ -369,6 +369,25 @@ interface UseCandlesticksParams {
369
369
  }
370
370
  declare function useCandlesticks(params: UseCandlesticksParams, queryOptions?: Omit<UseQueryOptions<Candlestick[], Error, Candlestick[], unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<Candlestick[], Error>;
371
371
 
372
+ /**
373
+ * Params for {@link useInfiniteComments}. `slug` identifies the event; the
374
+ * remaining fields mirror {@link ListCommentsParams} minus the opaque `cursor`,
375
+ * which the hook manages internally for pagination.
376
+ */
377
+ interface UseInfiniteCommentsParams extends Omit<ListCommentsParams, "cursor"> {
378
+ /** Canonical event slug. */
379
+ slug: string;
380
+ }
381
+ declare function infiniteCommentsQueryKey(params: UseInfiniteCommentsParams): unknown[];
382
+ /**
383
+ * Infinite (cursor-paginated) comments for a prediction event.
384
+ *
385
+ * The server transparently resolves the event to its parent series when one
386
+ * exists, so the same hook works for standalone events and grouped events
387
+ * (e.g. World Cup matches) alike.
388
+ */
389
+ declare function useInfiniteComments(params: UseInfiniteCommentsParams): _tanstack_react_query.UseInfiniteQueryResult<_tanstack_react_query.InfiniteData<PredictPage<PredictComment>, unknown>, Error>;
390
+
372
391
  declare function positionsQueryKey(user: string, source?: ProviderSource): unknown[];
373
392
  declare function positionsMultiQueryKey(wallets: {
374
393
  kalshi_user?: string;
@@ -993,4 +1012,4 @@ interface WalkOrderbookParams {
993
1012
  */
994
1013
  declare function walkOrderbook({ orderbook, outcome, side, sharesNeeded, slippageBps, }: WalkOrderbookParams): WalkResult;
995
1014
 
996
- export { AvailableSharesResponse, BalanceResponse, CancelOrderResult, type CancelOrderVariables, Candlestick, ChartRange, type ChartRangeType, CreateOrderInput, type CreatePolymarketOrderVariables, DFlowKYCStatus, DFlowQuoteRequest, DFlowQuoteResponse, DFlowSubmitRequest, DFlowSubmitResponse, EventSortField, EventStats, EventStatus, FeeRateResponse, ListCandlesticksParams, ListEventsParams, ListMarketTradesParams, ListOrdersMultiParams, ListOrdersParams, ListTradesMultiParams, ListTradesParams, type MarketHistoryPoint, type MarketHistorySeries, MatchGroup, MatchGroupPage, MatchMarketPage, MatchMarketParams, MatchesParams, Orderbook, PolymarketContext, type PolymarketContextValue, type PolymarketCredentials, PolymarketDepositAddresses, type PolymarketDepositResult, type PolymarketDepositVariables, PolymarketProvider, type PolymarketProviderProps, PolymarketRedeemResponse, type PolymarketSigner, PolymarketSupportedAsset, PolymarketWithdrawRequest, PolymarketWithdrawResponse, PositionsResponse, PredictClient, PredictContext, type PredictContextValue, PredictEvent, PredictMarket, PredictOrder, PredictOrdersResponse, PredictPage, PredictProvider, type PredictProviderProps, PredictTrade, PredictWsClient, PriceHistoryRange, PriceHistoryResponse, ProviderSource, type RedeemPositionVariables, SimilarEventsParams, TickSizeResponse, type UseAvailableSharesOptions, type UseAvailableSharesParams, type UseBalanceParams, type UseCancelOrderOptions, type UseCandlesticksParams, type UseEventParams, type UseInfiniteMatchMarketsParams, type UseInfiniteMatchesParams, type UseInfiniteOrdersOptions, type UseInfiniteOrdersParams, type UseInfiniteTradesMultiParams, type UseInfiniteTradesParams, type UseMarketHistoryResult, type UseMarketParams, type UseMarketTradesParams, type UseOrderParams, type UseOrderbookParams, type UseOrderbookSubscriptionParams, type UseOrderbookSubscriptionResult, type UseOrdersMultiOptions, 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, type WalkOrderbookParams, type WalkOutcome, type WalkResult, type WalkSide, type WalkStatus, WithdrawBuildRequest, WithdrawBuildResponse, WithdrawStatusResponse, WithdrawSubmitRequest, WithdrawSubmitResponse, WsConnectionStatus, WsDataMessage, WsOrderbookEvent, WsPriceEvent, WsTradeEvent, availableSharesQueryKey, balanceQueryKey, candlesticksQueryKey, dflowKYCQueryKey, dflowQuoteQueryKey, eventStatsQueryKey, eventsQueryKey, feeRateQueryKey, fetchEvents, infiniteOrdersQueryKey, infiniteTradesMultiQueryKey, infiniteTradesQueryKey, marketTradesQueryKey, orderQueryKey, orderbookQueryKey, ordersMultiQueryKey, ordersQueryKey, pickBestAsk, pickBestBid, polymarketDepositAddressesQueryKey, polymarketSetupQueryKey, polymarketSupportedAssetsQueryKey, positionsMultiQueryKey, positionsQueryKey, priceHistoryQueryKey, similarEventsQueryKey, tickSizeQueryKey, tradesQueryKey, useAvailableShares, useBalance, useCancelOrder, useCandlesticks, useCreatePolymarketOrder, useDFlowKYC, useDFlowQuote, useDFlowSubmit, useEvent, useEventStats, useEvents, useFeeRate, useInfiniteEvents, useInfiniteMatchMarkets, useInfiniteMatches, useInfiniteOrders, useInfiniteTrades, useInfiniteTradesMulti, useMarket, useMarketHistory, useMarketTrades, useMatch, useOrder, useOrderbook, useOrderbookSubscription, useOrders, useOrdersMulti, usePolymarket, usePolymarketDeposit, usePolymarketDepositAddresses, usePolymarketSetup, usePolymarketSupportedAssets, usePolymarketWithdraw, usePositions, usePositionsMulti, usePredictClient, usePredictWsClient, usePriceHistory, usePricesSubscription, useRealtimeOrderbook, useRealtimePrices, useRealtimeTrades, useRedeemPosition, useRunPolymarketSetup, useSearchEvents, useSimilarEvents, useTickSize, useTrades, useTradesSubscription, useWithdrawBuildMutation, useWithdrawStatusQuery, useWithdrawSubmitMutation, walkOrderbook, withdrawStatusQueryKey };
1015
+ export { AvailableSharesResponse, BalanceResponse, CancelOrderResult, type CancelOrderVariables, Candlestick, ChartRange, type ChartRangeType, CreateOrderInput, type CreatePolymarketOrderVariables, DFlowKYCStatus, DFlowQuoteRequest, DFlowQuoteResponse, DFlowSubmitRequest, DFlowSubmitResponse, EventSortField, EventStats, EventStatus, FeeRateResponse, ListCandlesticksParams, ListCommentsParams, ListEventsParams, ListMarketTradesParams, ListOrdersMultiParams, ListOrdersParams, ListTradesMultiParams, ListTradesParams, type MarketHistoryPoint, type MarketHistorySeries, MatchGroup, MatchGroupPage, MatchMarketPage, MatchMarketParams, MatchesParams, Orderbook, PolymarketContext, type PolymarketContextValue, type PolymarketCredentials, PolymarketDepositAddresses, type PolymarketDepositResult, type PolymarketDepositVariables, PolymarketProvider, type PolymarketProviderProps, PolymarketRedeemResponse, type PolymarketSigner, PolymarketSupportedAsset, PolymarketWithdrawRequest, PolymarketWithdrawResponse, PositionsResponse, PredictClient, PredictComment, PredictContext, type PredictContextValue, PredictEvent, PredictMarket, PredictOrder, PredictOrdersResponse, PredictPage, PredictProvider, type PredictProviderProps, PredictTrade, PredictWsClient, PriceHistoryRange, PriceHistoryResponse, ProviderSource, type RedeemPositionVariables, SimilarEventsParams, TickSizeResponse, type UseAvailableSharesOptions, type UseAvailableSharesParams, type UseBalanceParams, type UseCancelOrderOptions, type UseCandlesticksParams, type UseEventParams, type UseInfiniteCommentsParams, type UseInfiniteMatchMarketsParams, type UseInfiniteMatchesParams, type UseInfiniteOrdersOptions, type UseInfiniteOrdersParams, type UseInfiniteTradesMultiParams, type UseInfiniteTradesParams, type UseMarketHistoryResult, type UseMarketParams, type UseMarketTradesParams, type UseOrderParams, type UseOrderbookParams, type UseOrderbookSubscriptionParams, type UseOrderbookSubscriptionResult, type UseOrdersMultiOptions, 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, type WalkOrderbookParams, type WalkOutcome, type WalkResult, type WalkSide, type WalkStatus, WithdrawBuildRequest, WithdrawBuildResponse, WithdrawStatusResponse, WithdrawSubmitRequest, WithdrawSubmitResponse, WsConnectionStatus, WsDataMessage, WsOrderbookEvent, WsPriceEvent, WsTradeEvent, availableSharesQueryKey, balanceQueryKey, candlesticksQueryKey, dflowKYCQueryKey, dflowQuoteQueryKey, eventStatsQueryKey, eventsQueryKey, feeRateQueryKey, fetchEvents, infiniteCommentsQueryKey, infiniteOrdersQueryKey, infiniteTradesMultiQueryKey, infiniteTradesQueryKey, marketTradesQueryKey, orderQueryKey, orderbookQueryKey, ordersMultiQueryKey, ordersQueryKey, pickBestAsk, pickBestBid, polymarketDepositAddressesQueryKey, polymarketSetupQueryKey, polymarketSupportedAssetsQueryKey, positionsMultiQueryKey, positionsQueryKey, priceHistoryQueryKey, similarEventsQueryKey, tickSizeQueryKey, tradesQueryKey, useAvailableShares, useBalance, useCancelOrder, useCandlesticks, useCreatePolymarketOrder, useDFlowKYC, useDFlowQuote, useDFlowSubmit, useEvent, useEventStats, useEvents, useFeeRate, useInfiniteComments, useInfiniteEvents, useInfiniteMatchMarkets, useInfiniteMatches, useInfiniteOrders, useInfiniteTrades, useInfiniteTradesMulti, useMarket, useMarketHistory, useMarketTrades, useMatch, useOrder, useOrderbook, useOrderbookSubscription, useOrders, useOrdersMulti, usePolymarket, usePolymarketDeposit, usePolymarketDepositAddresses, usePolymarketSetup, usePolymarketSupportedAssets, usePolymarketWithdraw, usePositions, usePositionsMulti, usePredictClient, usePredictWsClient, usePriceHistory, usePricesSubscription, useRealtimeOrderbook, useRealtimePrices, useRealtimeTrades, useRedeemPosition, useRunPolymarketSetup, useSearchEvents, useSimilarEvents, useTickSize, useTrades, useTradesSubscription, useWithdrawBuildMutation, useWithdrawStatusQuery, useWithdrawSubmitMutation, walkOrderbook, withdrawStatusQueryKey };
package/dist/index.js CHANGED
@@ -71,6 +71,25 @@ var PredictClient = class {
71
71
  const url = `${this.endpoint}/api/v1/events/${encodeURIComponent(slug)}/similar${query}`;
72
72
  return await utils.httpGet(url);
73
73
  }
74
+ /**
75
+ * List comments for a prediction event.
76
+ *
77
+ * Maps to `GET /api/v1/events/:slug/comments`.
78
+ *
79
+ * The server resolves the event to its parent series when one exists
80
+ * (Polymarket attaches discussion at the series level for grouped events such
81
+ * as World Cup matches) and otherwise returns event-level comments. Callers
82
+ * stay unaware of the event-vs-series distinction.
83
+ *
84
+ * @param slug - Canonical event slug.
85
+ * @param params - Query parameters (source, pagination, sort, holders filter).
86
+ * @returns A paginated page of comments.
87
+ */
88
+ async listEventComments(slug, params) {
89
+ const query = buildQuery(params);
90
+ const url = `${this.endpoint}/api/v1/events/${encodeURIComponent(slug)}/comments${query}`;
91
+ return await utils.httpGet(url);
92
+ }
74
93
  // -------------------------------------------------------------------------
75
94
  // Markets
76
95
  // -------------------------------------------------------------------------
@@ -1301,6 +1320,20 @@ function useCandlesticks(params, queryOptions = {}) {
1301
1320
  ...queryOptions
1302
1321
  });
1303
1322
  }
1323
+ function infiniteCommentsQueryKey(params) {
1324
+ return ["predict", "comments", "infinite", params];
1325
+ }
1326
+ function useInfiniteComments(params) {
1327
+ const { slug, ...query } = params;
1328
+ const client = usePredictClient();
1329
+ return reactQuery.useInfiniteQuery({
1330
+ queryKey: infiniteCommentsQueryKey(params),
1331
+ queryFn: ({ pageParam }) => client.listEventComments(slug, { ...query, cursor: pageParam }),
1332
+ initialPageParam: void 0,
1333
+ getNextPageParam: (lastPage) => lastPage.has_more ? lastPage.next_cursor : void 0,
1334
+ enabled: Boolean(slug) && Boolean(query.source)
1335
+ });
1336
+ }
1304
1337
  function positionsQueryKey(user, source) {
1305
1338
  return ["predict", "positions", source ?? "all", user];
1306
1339
  }
@@ -2455,6 +2488,7 @@ exports.fetchMatchMarketsPage = fetchMatchMarketsPage;
2455
2488
  exports.fetchMatchesPage = fetchMatchesPage;
2456
2489
  exports.getPolymarketSharesPrecision = getPolymarketSharesPrecision;
2457
2490
  exports.hmacSha256Base64 = hmacSha256Base64;
2491
+ exports.infiniteCommentsQueryKey = infiniteCommentsQueryKey;
2458
2492
  exports.infiniteEventsQueryKey = infiniteEventsQueryKey;
2459
2493
  exports.infiniteOrdersQueryKey = infiniteOrdersQueryKey;
2460
2494
  exports.infiniteTradesMultiQueryKey = infiniteTradesMultiQueryKey;
@@ -2493,6 +2527,7 @@ exports.useEvent = useEvent;
2493
2527
  exports.useEventStats = useEventStats;
2494
2528
  exports.useEvents = useEvents;
2495
2529
  exports.useFeeRate = useFeeRate;
2530
+ exports.useInfiniteComments = useInfiniteComments;
2496
2531
  exports.useInfiniteEvents = useInfiniteEvents;
2497
2532
  exports.useInfiniteMatchMarkets = useInfiniteMatchMarkets;
2498
2533
  exports.useInfiniteMatches = useInfiniteMatches;