@liberfi.io/react-predict 0.1.17 → 0.1.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +19 -5
- package/dist/index.d.ts +19 -5
- package/dist/index.js +63 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +59 -1
- package/dist/index.mjs.map +1 -1
- package/dist/{server-C52oqeh8.d.mts → server-CiGfmztS.d.mts} +100 -1
- package/dist/{server-C52oqeh8.d.ts → server-CiGfmztS.d.ts} +100 -1
- package/dist/server.d.mts +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.js +36 -0
- package/dist/server.js.map +1 -1
- package/dist/server.mjs +34 -1
- package/dist/server.mjs.map +1 -1
- package/package.json +3 -3
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, S as SimilarEventsParams, e as PredictMarket, O as Orderbook, f as ListMarketTradesParams, g as PredictTrade, h as PriceHistoryRange, i as PriceHistoryResponse, j as ListCandlesticksParams, C as Candlestick, k as PositionsResponse, B as BalanceResponse, l as ListOrdersParams, m as PredictOrder, n as CancelOrderResult, o as ListTradesParams, D as DFlowQuoteRequest,
|
|
2
|
-
export {
|
|
1
|
+
import { P as PredictClient, a as PredictWsClient, L as ListEventsParams, b as PredictPage, c as PredictEvent, d as ProviderSource, E as EventStatus, S as SimilarEventsParams, e as PredictMarket, O as Orderbook, f as ListMarketTradesParams, g as PredictTrade, h as PriceHistoryRange, i as PriceHistoryResponse, j as ListCandlesticksParams, C as Candlestick, k as PositionsResponse, B as BalanceResponse, l as ListOrdersParams, m as PredictOrder, n as CancelOrderResult, M as MatchesParams, o as MatchGroupPage, p as MatchGroup, q as ListTradesParams, D as DFlowQuoteRequest, r as DFlowQuoteResponse, s as DFlowSubmitResponse, t as DFlowSubmitRequest, u as DFlowKYCStatus, W as WsConnectionStatus, v as WsDataMessage, w as WsPriceEvent, x as WsOrderbookEvent, y as WsTradeEvent, z as CreateOrderInput } from './server-CiGfmztS.mjs';
|
|
2
|
+
export { 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, a0 as DFlowOrderContext, R as EventSortField, V as EventSummary, aA as HttpMethod, Q as MarketOutcome, N as MarketResult, K as MarketStatus, X as MarketSummary, a3 as MatchGroupEntry, a4 as MatchGroupMarket, a5 as MatchSortField, a2 as MatchStatus, a6 as MatchesStats, aF as NEG_RISK_CTF_EXCHANGE_ADDRESS, aK as ORDER_TYPE, aP as OrderMessage, $ as OrderSide, _ as OrderStatus, T as OrderbookLevel, aH as POLYGON_CHAIN_ID, aC as PolymarketL2Headers, aB as PolymarketL2HeadersInput, a1 as PolymarketOrderType, Z as PredictPosition, I as PredictTag, G as PredictWsClientConfig, Y as PricePoint, H as ProviderMeta, an as ResolveEventsParamsInput, aL as SIDE, J as SettlementSource, aR as SignedOrder, ao as TagSlugSelection, U as TradeType, aG as USDC_ADDRESS, a7 as WsChannel, a8 as WsChannelEvent, a9 as WsClientMessage, af as WsErrorCode, ag as WsErrorMessage, ab as WsPingMessage, ad as WsPongMessage, ac as WsServerMessage, aa as WsSubscribeMessage, ae as WsSubscribedMessage, 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';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import * as react from 'react';
|
|
5
5
|
import { PropsWithChildren } from 'react';
|
|
@@ -206,7 +206,7 @@ interface UseEventParams {
|
|
|
206
206
|
*/
|
|
207
207
|
declare function useEvent(params: UseEventParams, queryOptions?: Omit<UseQueryOptions<PredictEvent, Error, PredictEvent, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<PredictEvent, Error>;
|
|
208
208
|
|
|
209
|
-
type InfiniteQueryOptions = Omit<UseInfiniteQueryOptions<PredictPage<PredictEvent>, Error, InfiniteData<PredictPage<PredictEvent>>, unknown[], string | undefined>, "queryKey" | "queryFn" | "initialPageParam" | "getNextPageParam">;
|
|
209
|
+
type InfiniteQueryOptions$1 = Omit<UseInfiniteQueryOptions<PredictPage<PredictEvent>, Error, InfiniteData<PredictPage<PredictEvent>>, unknown[], string | undefined>, "queryKey" | "queryFn" | "initialPageParam" | "getNextPageParam">;
|
|
210
210
|
/**
|
|
211
211
|
* TanStack Query infinite-query hook for `GET /api/v1/events` with cursor-based
|
|
212
212
|
* pagination via the prediction-server client.
|
|
@@ -221,7 +221,7 @@ type InfiniteQueryOptions = Omit<UseInfiniteQueryOptions<PredictPage<PredictEven
|
|
|
221
221
|
* const { data, hasNextPage, fetchNextPage } = useInfiniteEvents(params);
|
|
222
222
|
* ```
|
|
223
223
|
*/
|
|
224
|
-
declare function useInfiniteEvents(params: ListEventsParams, queryOptions?: InfiniteQueryOptions): _tanstack_react_query.UseInfiniteQueryResult<InfiniteData<PredictPage<PredictEvent>, unknown>, Error>;
|
|
224
|
+
declare function useInfiniteEvents(params: ListEventsParams, queryOptions?: InfiniteQueryOptions$1): _tanstack_react_query.UseInfiniteQueryResult<InfiniteData<PredictPage<PredictEvent>, unknown>, Error>;
|
|
225
225
|
|
|
226
226
|
interface UseSearchEventsParams {
|
|
227
227
|
/** Search keyword. */
|
|
@@ -374,6 +374,20 @@ interface CancelOrderVariables {
|
|
|
374
374
|
}
|
|
375
375
|
declare function useCancelOrder(mutationOptions?: Omit<UseMutationOptions<CancelOrderResult, Error, CancelOrderVariables>, "mutationFn">): _tanstack_react_query.UseMutationResult<CancelOrderResult, Error, CancelOrderVariables, unknown>;
|
|
376
376
|
|
|
377
|
+
type UseInfiniteMatchesParams = Omit<MatchesParams, "cursor">;
|
|
378
|
+
type InfiniteQueryOptions = Omit<UseInfiniteQueryOptions<MatchGroupPage, Error, InfiniteData<MatchGroupPage>, unknown[], string | undefined>, "queryKey" | "queryFn" | "initialPageParam" | "getNextPageParam">;
|
|
379
|
+
/**
|
|
380
|
+
* TanStack Query infinite-query hook for `GET /api/v1/matches` with
|
|
381
|
+
* cursor-based pagination.
|
|
382
|
+
*
|
|
383
|
+
* Stats are available from the first page: `data.pages[0]?.stats`.
|
|
384
|
+
*/
|
|
385
|
+
declare function useInfiniteMatches(params: UseInfiniteMatchesParams, queryOptions?: InfiniteQueryOptions): _tanstack_react_query.UseInfiniteQueryResult<InfiniteData<MatchGroupPage, unknown>, Error>;
|
|
386
|
+
/**
|
|
387
|
+
* TanStack Query hook for fetching a single match group by ID.
|
|
388
|
+
*/
|
|
389
|
+
declare function useMatch(id: number, queryOptions?: Omit<UseQueryOptions<MatchGroup, Error, MatchGroup, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<MatchGroup, Error>;
|
|
390
|
+
|
|
377
391
|
declare function tradesQueryKey(params: ListTradesParams): unknown[];
|
|
378
392
|
declare function useTrades(params: ListTradesParams, queryOptions?: Omit<UseQueryOptions<PredictPage<PredictTrade>, Error, PredictPage<PredictTrade>, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<PredictPage<PredictTrade>, Error>;
|
|
379
393
|
|
|
@@ -619,4 +633,4 @@ interface CreatePolymarketOrderVariables {
|
|
|
619
633
|
*/
|
|
620
634
|
declare function useCreatePolymarketOrder(mutationOptions?: Omit<UseMutationOptions<PredictOrder, Error, CreatePolymarketOrderVariables>, "mutationFn">): _tanstack_react_query.UseMutationResult<PredictOrder, Error, CreatePolymarketOrderVariables, unknown>;
|
|
621
635
|
|
|
622
|
-
export { BalanceResponse, CancelOrderResult, type CancelOrderVariables, Candlestick, ChartRange, type ChartRangeType, CreateOrderInput, type CreatePolymarketOrderVariables, DFlowKYCStatus, DFlowQuoteRequest, DFlowQuoteResponse, DFlowSubmitRequest, DFlowSubmitResponse, EventStatus, ListCandlesticksParams, ListEventsParams, ListMarketTradesParams, ListOrdersParams, ListTradesParams, type MarketHistoryPoint, type MarketHistorySeries, Orderbook, PolymarketContext, type PolymarketContextValue, type PolymarketCredentials, PolymarketProvider, type PolymarketProviderProps, type PolymarketSigner, PositionsResponse, PredictClient, PredictContext, type PredictContextValue, PredictEvent, PredictMarket, PredictOrder, PredictPage, PredictProvider, type PredictProviderProps, PredictTrade, PredictWsClient, PriceHistoryRange, PriceHistoryResponse, ProviderSource, SimilarEventsParams, type UseBalanceParams, type UseCandlesticksParams, type UseEventParams, type UseInfiniteOrdersParams, type UseInfiniteTradesParams, type UseMarketHistoryResult, type UseMarketParams, type UseMarketTradesParams, type UseOrderParams, type UseOrderbookParams, type UseOrderbookSubscriptionParams, type UseOrderbookSubscriptionResult, 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, WsConnectionStatus, WsDataMessage, WsOrderbookEvent, WsPriceEvent, WsTradeEvent, balanceQueryKey, candlesticksQueryKey, dflowKYCQueryKey, dflowQuoteQueryKey, eventsQueryKey, fetchEvents, infiniteOrdersQueryKey, infiniteTradesQueryKey, marketTradesQueryKey, orderQueryKey, orderbookQueryKey, ordersQueryKey, positionsQueryKey, priceHistoryQueryKey, similarEventsQueryKey, tradesQueryKey, useBalance, useCancelOrder, useCandlesticks, useCreatePolymarketOrder, useDFlowKYC, 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 };
|
|
636
|
+
export { BalanceResponse, CancelOrderResult, type CancelOrderVariables, Candlestick, ChartRange, type ChartRangeType, CreateOrderInput, type CreatePolymarketOrderVariables, DFlowKYCStatus, DFlowQuoteRequest, DFlowQuoteResponse, DFlowSubmitRequest, DFlowSubmitResponse, EventStatus, ListCandlesticksParams, ListEventsParams, ListMarketTradesParams, ListOrdersParams, ListTradesParams, type MarketHistoryPoint, type MarketHistorySeries, MatchGroup, MatchGroupPage, MatchesParams, Orderbook, PolymarketContext, type PolymarketContextValue, type PolymarketCredentials, PolymarketProvider, type PolymarketProviderProps, type PolymarketSigner, PositionsResponse, PredictClient, PredictContext, type PredictContextValue, PredictEvent, PredictMarket, PredictOrder, PredictPage, PredictProvider, type PredictProviderProps, PredictTrade, PredictWsClient, PriceHistoryRange, PriceHistoryResponse, ProviderSource, SimilarEventsParams, type UseBalanceParams, type UseCandlesticksParams, type UseEventParams, type UseInfiniteMatchesParams, type UseInfiniteOrdersParams, type UseInfiniteTradesParams, type UseMarketHistoryResult, type UseMarketParams, type UseMarketTradesParams, type UseOrderParams, type UseOrderbookParams, type UseOrderbookSubscriptionParams, type UseOrderbookSubscriptionResult, 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, WsConnectionStatus, WsDataMessage, WsOrderbookEvent, WsPriceEvent, WsTradeEvent, balanceQueryKey, candlesticksQueryKey, dflowKYCQueryKey, dflowQuoteQueryKey, eventsQueryKey, fetchEvents, infiniteOrdersQueryKey, infiniteTradesQueryKey, marketTradesQueryKey, orderQueryKey, orderbookQueryKey, ordersQueryKey, positionsQueryKey, priceHistoryQueryKey, similarEventsQueryKey, tradesQueryKey, useBalance, useCancelOrder, useCandlesticks, useCreatePolymarketOrder, useDFlowKYC, useDFlowQuote, useDFlowSubmit, useEvent, useEvents, useInfiniteEvents, useInfiniteMatches, useInfiniteOrders, useInfiniteTrades, useMarket, useMarketHistory, useMarketTrades, useMatch, useOrder, useOrderbook, useOrderbookSubscription, useOrders, usePolymarket, usePositions, usePredictClient, usePredictWsClient, usePriceHistory, usePricesSubscription, useRealtimeOrderbook, useRealtimePrices, useRealtimeTrades, useSearchEvents, useSimilarEvents, useTrades, useTradesSubscription };
|
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, S as SimilarEventsParams, e as PredictMarket, O as Orderbook, f as ListMarketTradesParams, g as PredictTrade, h as PriceHistoryRange, i as PriceHistoryResponse, j as ListCandlesticksParams, C as Candlestick, k as PositionsResponse, B as BalanceResponse, l as ListOrdersParams, m as PredictOrder, n as CancelOrderResult, o as ListTradesParams, D as DFlowQuoteRequest,
|
|
2
|
-
export {
|
|
1
|
+
import { P as PredictClient, a as PredictWsClient, L as ListEventsParams, b as PredictPage, c as PredictEvent, d as ProviderSource, E as EventStatus, S as SimilarEventsParams, e as PredictMarket, O as Orderbook, f as ListMarketTradesParams, g as PredictTrade, h as PriceHistoryRange, i as PriceHistoryResponse, j as ListCandlesticksParams, C as Candlestick, k as PositionsResponse, B as BalanceResponse, l as ListOrdersParams, m as PredictOrder, n as CancelOrderResult, M as MatchesParams, o as MatchGroupPage, p as MatchGroup, q as ListTradesParams, D as DFlowQuoteRequest, r as DFlowQuoteResponse, s as DFlowSubmitResponse, t as DFlowSubmitRequest, u as DFlowKYCStatus, W as WsConnectionStatus, v as WsDataMessage, w as WsPriceEvent, x as WsOrderbookEvent, y as WsTradeEvent, z as CreateOrderInput } from './server-CiGfmztS.js';
|
|
2
|
+
export { 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, a0 as DFlowOrderContext, R as EventSortField, V as EventSummary, aA as HttpMethod, Q as MarketOutcome, N as MarketResult, K as MarketStatus, X as MarketSummary, a3 as MatchGroupEntry, a4 as MatchGroupMarket, a5 as MatchSortField, a2 as MatchStatus, a6 as MatchesStats, aF as NEG_RISK_CTF_EXCHANGE_ADDRESS, aK as ORDER_TYPE, aP as OrderMessage, $ as OrderSide, _ as OrderStatus, T as OrderbookLevel, aH as POLYGON_CHAIN_ID, aC as PolymarketL2Headers, aB as PolymarketL2HeadersInput, a1 as PolymarketOrderType, Z as PredictPosition, I as PredictTag, G as PredictWsClientConfig, Y as PricePoint, H as ProviderMeta, an as ResolveEventsParamsInput, aL as SIDE, J as SettlementSource, aR as SignedOrder, ao as TagSlugSelection, U as TradeType, aG as USDC_ADDRESS, a7 as WsChannel, a8 as WsChannelEvent, a9 as WsClientMessage, af as WsErrorCode, ag as WsErrorMessage, ab as WsPingMessage, ad as WsPongMessage, ac as WsServerMessage, aa as WsSubscribeMessage, ae as WsSubscribedMessage, 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';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import * as react from 'react';
|
|
5
5
|
import { PropsWithChildren } from 'react';
|
|
@@ -206,7 +206,7 @@ interface UseEventParams {
|
|
|
206
206
|
*/
|
|
207
207
|
declare function useEvent(params: UseEventParams, queryOptions?: Omit<UseQueryOptions<PredictEvent, Error, PredictEvent, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<PredictEvent, Error>;
|
|
208
208
|
|
|
209
|
-
type InfiniteQueryOptions = Omit<UseInfiniteQueryOptions<PredictPage<PredictEvent>, Error, InfiniteData<PredictPage<PredictEvent>>, unknown[], string | undefined>, "queryKey" | "queryFn" | "initialPageParam" | "getNextPageParam">;
|
|
209
|
+
type InfiniteQueryOptions$1 = Omit<UseInfiniteQueryOptions<PredictPage<PredictEvent>, Error, InfiniteData<PredictPage<PredictEvent>>, unknown[], string | undefined>, "queryKey" | "queryFn" | "initialPageParam" | "getNextPageParam">;
|
|
210
210
|
/**
|
|
211
211
|
* TanStack Query infinite-query hook for `GET /api/v1/events` with cursor-based
|
|
212
212
|
* pagination via the prediction-server client.
|
|
@@ -221,7 +221,7 @@ type InfiniteQueryOptions = Omit<UseInfiniteQueryOptions<PredictPage<PredictEven
|
|
|
221
221
|
* const { data, hasNextPage, fetchNextPage } = useInfiniteEvents(params);
|
|
222
222
|
* ```
|
|
223
223
|
*/
|
|
224
|
-
declare function useInfiniteEvents(params: ListEventsParams, queryOptions?: InfiniteQueryOptions): _tanstack_react_query.UseInfiniteQueryResult<InfiniteData<PredictPage<PredictEvent>, unknown>, Error>;
|
|
224
|
+
declare function useInfiniteEvents(params: ListEventsParams, queryOptions?: InfiniteQueryOptions$1): _tanstack_react_query.UseInfiniteQueryResult<InfiniteData<PredictPage<PredictEvent>, unknown>, Error>;
|
|
225
225
|
|
|
226
226
|
interface UseSearchEventsParams {
|
|
227
227
|
/** Search keyword. */
|
|
@@ -374,6 +374,20 @@ interface CancelOrderVariables {
|
|
|
374
374
|
}
|
|
375
375
|
declare function useCancelOrder(mutationOptions?: Omit<UseMutationOptions<CancelOrderResult, Error, CancelOrderVariables>, "mutationFn">): _tanstack_react_query.UseMutationResult<CancelOrderResult, Error, CancelOrderVariables, unknown>;
|
|
376
376
|
|
|
377
|
+
type UseInfiniteMatchesParams = Omit<MatchesParams, "cursor">;
|
|
378
|
+
type InfiniteQueryOptions = Omit<UseInfiniteQueryOptions<MatchGroupPage, Error, InfiniteData<MatchGroupPage>, unknown[], string | undefined>, "queryKey" | "queryFn" | "initialPageParam" | "getNextPageParam">;
|
|
379
|
+
/**
|
|
380
|
+
* TanStack Query infinite-query hook for `GET /api/v1/matches` with
|
|
381
|
+
* cursor-based pagination.
|
|
382
|
+
*
|
|
383
|
+
* Stats are available from the first page: `data.pages[0]?.stats`.
|
|
384
|
+
*/
|
|
385
|
+
declare function useInfiniteMatches(params: UseInfiniteMatchesParams, queryOptions?: InfiniteQueryOptions): _tanstack_react_query.UseInfiniteQueryResult<InfiniteData<MatchGroupPage, unknown>, Error>;
|
|
386
|
+
/**
|
|
387
|
+
* TanStack Query hook for fetching a single match group by ID.
|
|
388
|
+
*/
|
|
389
|
+
declare function useMatch(id: number, queryOptions?: Omit<UseQueryOptions<MatchGroup, Error, MatchGroup, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<MatchGroup, Error>;
|
|
390
|
+
|
|
377
391
|
declare function tradesQueryKey(params: ListTradesParams): unknown[];
|
|
378
392
|
declare function useTrades(params: ListTradesParams, queryOptions?: Omit<UseQueryOptions<PredictPage<PredictTrade>, Error, PredictPage<PredictTrade>, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<PredictPage<PredictTrade>, Error>;
|
|
379
393
|
|
|
@@ -619,4 +633,4 @@ interface CreatePolymarketOrderVariables {
|
|
|
619
633
|
*/
|
|
620
634
|
declare function useCreatePolymarketOrder(mutationOptions?: Omit<UseMutationOptions<PredictOrder, Error, CreatePolymarketOrderVariables>, "mutationFn">): _tanstack_react_query.UseMutationResult<PredictOrder, Error, CreatePolymarketOrderVariables, unknown>;
|
|
621
635
|
|
|
622
|
-
export { BalanceResponse, CancelOrderResult, type CancelOrderVariables, Candlestick, ChartRange, type ChartRangeType, CreateOrderInput, type CreatePolymarketOrderVariables, DFlowKYCStatus, DFlowQuoteRequest, DFlowQuoteResponse, DFlowSubmitRequest, DFlowSubmitResponse, EventStatus, ListCandlesticksParams, ListEventsParams, ListMarketTradesParams, ListOrdersParams, ListTradesParams, type MarketHistoryPoint, type MarketHistorySeries, Orderbook, PolymarketContext, type PolymarketContextValue, type PolymarketCredentials, PolymarketProvider, type PolymarketProviderProps, type PolymarketSigner, PositionsResponse, PredictClient, PredictContext, type PredictContextValue, PredictEvent, PredictMarket, PredictOrder, PredictPage, PredictProvider, type PredictProviderProps, PredictTrade, PredictWsClient, PriceHistoryRange, PriceHistoryResponse, ProviderSource, SimilarEventsParams, type UseBalanceParams, type UseCandlesticksParams, type UseEventParams, type UseInfiniteOrdersParams, type UseInfiniteTradesParams, type UseMarketHistoryResult, type UseMarketParams, type UseMarketTradesParams, type UseOrderParams, type UseOrderbookParams, type UseOrderbookSubscriptionParams, type UseOrderbookSubscriptionResult, 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, WsConnectionStatus, WsDataMessage, WsOrderbookEvent, WsPriceEvent, WsTradeEvent, balanceQueryKey, candlesticksQueryKey, dflowKYCQueryKey, dflowQuoteQueryKey, eventsQueryKey, fetchEvents, infiniteOrdersQueryKey, infiniteTradesQueryKey, marketTradesQueryKey, orderQueryKey, orderbookQueryKey, ordersQueryKey, positionsQueryKey, priceHistoryQueryKey, similarEventsQueryKey, tradesQueryKey, useBalance, useCancelOrder, useCandlesticks, useCreatePolymarketOrder, useDFlowKYC, 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 };
|
|
636
|
+
export { BalanceResponse, CancelOrderResult, type CancelOrderVariables, Candlestick, ChartRange, type ChartRangeType, CreateOrderInput, type CreatePolymarketOrderVariables, DFlowKYCStatus, DFlowQuoteRequest, DFlowQuoteResponse, DFlowSubmitRequest, DFlowSubmitResponse, EventStatus, ListCandlesticksParams, ListEventsParams, ListMarketTradesParams, ListOrdersParams, ListTradesParams, type MarketHistoryPoint, type MarketHistorySeries, MatchGroup, MatchGroupPage, MatchesParams, Orderbook, PolymarketContext, type PolymarketContextValue, type PolymarketCredentials, PolymarketProvider, type PolymarketProviderProps, type PolymarketSigner, PositionsResponse, PredictClient, PredictContext, type PredictContextValue, PredictEvent, PredictMarket, PredictOrder, PredictPage, PredictProvider, type PredictProviderProps, PredictTrade, PredictWsClient, PriceHistoryRange, PriceHistoryResponse, ProviderSource, SimilarEventsParams, type UseBalanceParams, type UseCandlesticksParams, type UseEventParams, type UseInfiniteMatchesParams, type UseInfiniteOrdersParams, type UseInfiniteTradesParams, type UseMarketHistoryResult, type UseMarketParams, type UseMarketTradesParams, type UseOrderParams, type UseOrderbookParams, type UseOrderbookSubscriptionParams, type UseOrderbookSubscriptionResult, 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, WsConnectionStatus, WsDataMessage, WsOrderbookEvent, WsPriceEvent, WsTradeEvent, balanceQueryKey, candlesticksQueryKey, dflowKYCQueryKey, dflowQuoteQueryKey, eventsQueryKey, fetchEvents, infiniteOrdersQueryKey, infiniteTradesQueryKey, marketTradesQueryKey, orderQueryKey, orderbookQueryKey, ordersQueryKey, positionsQueryKey, priceHistoryQueryKey, similarEventsQueryKey, tradesQueryKey, useBalance, useCancelOrder, useCandlesticks, useCreatePolymarketOrder, useDFlowKYC, useDFlowQuote, useDFlowSubmit, useEvent, useEvents, useInfiniteEvents, useInfiniteMatches, useInfiniteOrders, useInfiniteTrades, useMarket, useMarketHistory, useMarketTrades, useMatch, useOrder, useOrderbook, useOrderbookSubscription, useOrders, usePolymarket, usePositions, usePredictClient, usePredictWsClient, usePriceHistory, usePricesSubscription, useRealtimeOrderbook, useRealtimePrices, useRealtimeTrades, useSearchEvents, useSimilarEvents, useTrades, useTradesSubscription };
|
package/dist/index.js
CHANGED
|
@@ -203,6 +203,28 @@ var PredictClient = class {
|
|
|
203
203
|
return await utils.httpGet(url);
|
|
204
204
|
}
|
|
205
205
|
// -------------------------------------------------------------------------
|
|
206
|
+
// Cross-platform matches
|
|
207
|
+
// -------------------------------------------------------------------------
|
|
208
|
+
/**
|
|
209
|
+
* List cross-platform matched event groups with inline aggregate stats.
|
|
210
|
+
*
|
|
211
|
+
* Maps to `GET /api/v1/matches`.
|
|
212
|
+
*/
|
|
213
|
+
async listMatches(params) {
|
|
214
|
+
const query = buildQuery(params ?? {});
|
|
215
|
+
const url = `${this.endpoint}/api/v1/matches${query}`;
|
|
216
|
+
return await utils.httpGet(url);
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Fetch a single match group by ID.
|
|
220
|
+
*
|
|
221
|
+
* Maps to `GET /api/v1/matches/:id`.
|
|
222
|
+
*/
|
|
223
|
+
async getMatch(id) {
|
|
224
|
+
const url = `${this.endpoint}/api/v1/matches/${id}`;
|
|
225
|
+
return await utils.httpGet(url);
|
|
226
|
+
}
|
|
227
|
+
// -------------------------------------------------------------------------
|
|
206
228
|
// Trades by wallet
|
|
207
229
|
// -------------------------------------------------------------------------
|
|
208
230
|
/** Maps to `GET /api/v1/trades?source=...&wallet=...`. */
|
|
@@ -1078,6 +1100,42 @@ function useCancelOrder(mutationOptions = {}) {
|
|
|
1078
1100
|
...mutationOptions
|
|
1079
1101
|
});
|
|
1080
1102
|
}
|
|
1103
|
+
|
|
1104
|
+
// src/hooks/predict/matches.params.ts
|
|
1105
|
+
function matchesQueryKey(params) {
|
|
1106
|
+
return ["predict", "matches", params];
|
|
1107
|
+
}
|
|
1108
|
+
function matchQueryKey(id) {
|
|
1109
|
+
return ["predict", "match", id];
|
|
1110
|
+
}
|
|
1111
|
+
async function fetchMatchesPage(client, params) {
|
|
1112
|
+
return client.listMatches(params);
|
|
1113
|
+
}
|
|
1114
|
+
|
|
1115
|
+
// src/hooks/predict/useMatches.ts
|
|
1116
|
+
function useInfiniteMatches(params, queryOptions = {}) {
|
|
1117
|
+
const client = usePredictClient();
|
|
1118
|
+
return reactQuery.useInfiniteQuery({
|
|
1119
|
+
queryKey: matchesQueryKey(params),
|
|
1120
|
+
queryFn: ({ pageParam }) => fetchMatchesPage(client, {
|
|
1121
|
+
...params,
|
|
1122
|
+
...pageParam !== void 0 ? { cursor: pageParam } : {}
|
|
1123
|
+
}),
|
|
1124
|
+
initialPageParam: void 0,
|
|
1125
|
+
getNextPageParam: (lastPage) => lastPage.has_more && lastPage.next_cursor ? lastPage.next_cursor : void 0,
|
|
1126
|
+
...queryOptions
|
|
1127
|
+
});
|
|
1128
|
+
}
|
|
1129
|
+
function useMatch(id, queryOptions = {}) {
|
|
1130
|
+
const client = usePredictClient();
|
|
1131
|
+
return reactQuery.useQuery({
|
|
1132
|
+
queryKey: matchQueryKey(id),
|
|
1133
|
+
queryFn: () => client.getMatch(id),
|
|
1134
|
+
enabled: id > 0,
|
|
1135
|
+
staleTime: 2 * 6e4,
|
|
1136
|
+
...queryOptions
|
|
1137
|
+
});
|
|
1138
|
+
}
|
|
1081
1139
|
function tradesQueryKey(params) {
|
|
1082
1140
|
return ["predict", "trades-by-wallet", params];
|
|
1083
1141
|
}
|
|
@@ -1561,12 +1619,15 @@ exports.fetchEvent = fetchEvent;
|
|
|
1561
1619
|
exports.fetchEvents = fetchEvents;
|
|
1562
1620
|
exports.fetchEventsPage = fetchEventsPage;
|
|
1563
1621
|
exports.fetchMarket = fetchMarket;
|
|
1622
|
+
exports.fetchMatchesPage = fetchMatchesPage;
|
|
1564
1623
|
exports.hmacSha256Base64 = hmacSha256Base64;
|
|
1565
1624
|
exports.infiniteEventsQueryKey = infiniteEventsQueryKey;
|
|
1566
1625
|
exports.infiniteOrdersQueryKey = infiniteOrdersQueryKey;
|
|
1567
1626
|
exports.infiniteTradesQueryKey = infiniteTradesQueryKey;
|
|
1568
1627
|
exports.marketQueryKey = marketQueryKey;
|
|
1569
1628
|
exports.marketTradesQueryKey = marketTradesQueryKey;
|
|
1629
|
+
exports.matchQueryKey = matchQueryKey;
|
|
1630
|
+
exports.matchesQueryKey = matchesQueryKey;
|
|
1570
1631
|
exports.orderQueryKey = orderQueryKey;
|
|
1571
1632
|
exports.orderbookQueryKey = orderbookQueryKey;
|
|
1572
1633
|
exports.ordersQueryKey = ordersQueryKey;
|
|
@@ -1586,11 +1647,13 @@ exports.useDFlowSubmit = useDFlowSubmit;
|
|
|
1586
1647
|
exports.useEvent = useEvent;
|
|
1587
1648
|
exports.useEvents = useEvents;
|
|
1588
1649
|
exports.useInfiniteEvents = useInfiniteEvents;
|
|
1650
|
+
exports.useInfiniteMatches = useInfiniteMatches;
|
|
1589
1651
|
exports.useInfiniteOrders = useInfiniteOrders;
|
|
1590
1652
|
exports.useInfiniteTrades = useInfiniteTrades;
|
|
1591
1653
|
exports.useMarket = useMarket;
|
|
1592
1654
|
exports.useMarketHistory = useMarketHistory;
|
|
1593
1655
|
exports.useMarketTrades = useMarketTrades;
|
|
1656
|
+
exports.useMatch = useMatch;
|
|
1594
1657
|
exports.useOrder = useOrder;
|
|
1595
1658
|
exports.useOrderbook = useOrderbook;
|
|
1596
1659
|
exports.useOrderbookSubscription = useOrderbookSubscription;
|