@liberfi.io/react-predict 0.1.5 → 0.1.6

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.mjs CHANGED
@@ -1012,6 +1012,19 @@ function useOrders(params, queryOptions = {}) {
1012
1012
  ...queryOptions
1013
1013
  });
1014
1014
  }
1015
+ function infiniteOrdersQueryKey(params) {
1016
+ return ["predict", "orders", "infinite", params];
1017
+ }
1018
+ function useInfiniteOrders(params) {
1019
+ const client = usePredictClient();
1020
+ return useInfiniteQuery({
1021
+ queryKey: infiniteOrdersQueryKey(params),
1022
+ queryFn: ({ pageParam }) => client.listOrders({ ...params, next_cursor: pageParam }),
1023
+ initialPageParam: void 0,
1024
+ getNextPageParam: (lastPage) => lastPage.has_more ? lastPage.next_cursor : void 0,
1025
+ enabled: Boolean(params.wallet_address)
1026
+ });
1027
+ }
1015
1028
  function orderQueryKey(id, source) {
1016
1029
  return ["predict", "order", id, source];
1017
1030
  }
@@ -1048,6 +1061,19 @@ function useTrades(params, queryOptions = {}) {
1048
1061
  ...queryOptions
1049
1062
  });
1050
1063
  }
1064
+ function infiniteTradesQueryKey(params) {
1065
+ return ["predict", "trades-by-wallet", "infinite", params];
1066
+ }
1067
+ function useInfiniteTrades(params) {
1068
+ const client = usePredictClient();
1069
+ return useInfiniteQuery({
1070
+ queryKey: infiniteTradesQueryKey(params),
1071
+ queryFn: ({ pageParam }) => client.listTrades({ ...params, cursor: pageParam }),
1072
+ initialPageParam: void 0,
1073
+ getNextPageParam: (lastPage) => lastPage.has_more ? lastPage.next_cursor : void 0,
1074
+ enabled: Boolean(params.wallet)
1075
+ });
1076
+ }
1051
1077
  function dflowQuoteQueryKey(params) {
1052
1078
  return ["predict", "dflow-quote", params];
1053
1079
  }
@@ -1459,6 +1485,6 @@ function useCreatePolymarketOrder(mutationOptions = {}) {
1459
1485
  });
1460
1486
  }
1461
1487
 
1462
- export { CLOB_AUTH_DOMAIN, CLOB_AUTH_TYPES, CTF_EXCHANGE_ADDRESS, CTF_ORDER_TYPES, ChartRange, NEG_RISK_CTF_EXCHANGE_ADDRESS, ORDER_TYPE, POLYGON_CHAIN_ID, PolymarketContext, PolymarketProvider, PredictClient, PredictContext, PredictProvider, PredictWsClient, SIDE, USDC_ADDRESS, balanceQueryKey, buildClobAuthMessage, buildCtfExchangeDomain, buildOrderMessage, buildPolymarketL2Headers, buildSignedOrder, candlesticksQueryKey, createPredictClient, createPredictWsClient, derivePolymarketApiKey, dflowQuoteQueryKey, eventQueryKey, eventsQueryKey, fetchEvent, fetchEvents, fetchEventsPage, fetchMarket, hmacSha256Base64, infiniteEventsQueryKey, marketQueryKey, marketTradesQueryKey, orderQueryKey, orderbookQueryKey, ordersQueryKey, positionsQueryKey, priceHistoryQueryKey, resolveEventsParams, resolveTagSlug, similarEventsQueryKey, tradesQueryKey, useBalance, useCancelOrder, useCandlesticks, useCreatePolymarketOrder, useDFlowQuote, useDFlowSubmit, useEvent, useEvents, useInfiniteEvents, useMarket, useMarketHistory, useMarketTrades, useOrder, useOrderbook, useOrderbookSubscription, useOrders, usePolymarket, usePositions, usePredictClient, usePredictWsClient, usePriceHistory, usePricesSubscription, useRealtimeOrderbook, useRealtimePrices, useRealtimeTrades, useSearchEvents, useSimilarEvents, useTrades, useTradesSubscription };
1488
+ export { CLOB_AUTH_DOMAIN, CLOB_AUTH_TYPES, CTF_EXCHANGE_ADDRESS, CTF_ORDER_TYPES, ChartRange, NEG_RISK_CTF_EXCHANGE_ADDRESS, ORDER_TYPE, POLYGON_CHAIN_ID, PolymarketContext, PolymarketProvider, PredictClient, PredictContext, PredictProvider, PredictWsClient, SIDE, USDC_ADDRESS, balanceQueryKey, buildClobAuthMessage, buildCtfExchangeDomain, buildOrderMessage, buildPolymarketL2Headers, buildSignedOrder, candlesticksQueryKey, createPredictClient, createPredictWsClient, derivePolymarketApiKey, dflowQuoteQueryKey, eventQueryKey, eventsQueryKey, fetchEvent, fetchEvents, fetchEventsPage, fetchMarket, hmacSha256Base64, infiniteEventsQueryKey, infiniteOrdersQueryKey, infiniteTradesQueryKey, marketQueryKey, marketTradesQueryKey, orderQueryKey, orderbookQueryKey, ordersQueryKey, positionsQueryKey, priceHistoryQueryKey, resolveEventsParams, resolveTagSlug, similarEventsQueryKey, tradesQueryKey, useBalance, useCancelOrder, useCandlesticks, useCreatePolymarketOrder, useDFlowQuote, useDFlowSubmit, useEvent, useEvents, useInfiniteEvents, useInfiniteOrders, useInfiniteTrades, useMarket, useMarketHistory, useMarketTrades, useOrder, useOrderbook, useOrderbookSubscription, useOrders, usePolymarket, usePositions, usePredictClient, usePredictWsClient, usePriceHistory, usePricesSubscription, useRealtimeOrderbook, useRealtimePrices, useRealtimeTrades, useSearchEvents, useSimilarEvents, useTrades, useTradesSubscription };
1463
1489
  //# sourceMappingURL=index.mjs.map
1464
1490
  //# sourceMappingURL=index.mjs.map