@liberfi.io/react-predict 0.1.51 → 0.1.53

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, D as DFlowQuoteRequest, x as DFlowQuoteResponse, y as DFlowSubmitResponse, z as DFlowSubmitRequest, F as DFlowKYCStatus, G as PolymarketSetupStatus, W as WithdrawBuildResponse, H as WithdrawBuildRequest, I as WithdrawSubmitResponse, J as WithdrawSubmitRequest, K as WithdrawStatusResponse, N as PolymarketDepositAddresses, Q as PolymarketWithdrawResponse, R as PolymarketWithdrawRequest, T as TickSizeResponse, U as WsConnectionStatus, V as WsDataMessage, X as WsPriceEvent, Y as WsOrderbookEvent, Z as WsTradeEvent, _ as CreateOrderInput } from './server-eKqIns8z.mjs';
2
- export { b1 as BuildClobAuthMessageInput, be as BuildOrderMessageInput, aU as CLOB_AUTH_DOMAIN, aV as CLOB_AUTH_TYPES, b2 as CTF_EXCHANGE_ADDRESS, b7 as CTF_ORDER_TYPES, bd as ClobOrderPayload, ag as DFlowOrderContext, ai as DepositBuildRequest, aj as DepositBuildResponse, am as DepositStatusResponse, ak as DepositSubmitRequest, al as DepositSubmitResponse, aa as EventSummary, a_ as HttpMethod, a7 as MarketOutcome, a6 as MarketResult, a5 as MarketStatus, ab as MarketSummary, at as MatchConfidenceTier, ap as MatchGroupEntry, aq as MatchGroupMarket, au as MatchMarketFlat, ar as MatchSortField, ao as MatchStatus, as as MatchesStats, b3 as NEG_RISK_CTF_EXCHANGE_ADDRESS, b8 as ORDER_TYPE, bf as OrderMessage, af as OrderSide, ae as OrderStatus, a8 as OrderbookLevel, b5 as POLYGON_CHAIN_ID, b0 as PolymarketL2Headers, a$ as PolymarketL2HeadersInput, ah as PolymarketOrderType, ad as PredictPosition, a3 as PredictTag, a1 as PredictWsClientConfig, ac as PricePoint, a2 as ProviderMeta, aL as ResolveEventsParamsInput, b9 as SIDE, a4 as SettlementSource, bg as SignedOrder, aM as TagSlugSelection, a9 as TradeType, b4 as USDC_ADDRESS, an as UnsignedTx, av as WsChannel, aw as WsChannelEvent, ax as WsClientMessage, aD as WsErrorCode, aE as WsErrorMessage, az as WsPingMessage, aB as WsPongMessage, aA as WsServerMessage, ay as WsSubscribeMessage, aC as WsSubscribedMessage, aW as buildClobAuthMessage, bc as buildClobPayload, b6 as buildCtfExchangeDomain, ba as buildOrderMessage, aY as buildPolymarketL2Headers, bb as buildSignedOrder, $ as createPredictClient, a0 as createPredictWsClient, aZ as derivePolymarketApiKey, aF as eventQueryKey, aG as fetchEvent, aK as fetchEventsPage, aO as fetchMarket, aT as fetchMatchMarketsPage, aR as fetchMatchesPage, aX as hmacSha256Base64, aJ as infiniteEventsQueryKey, aN as marketQueryKey, aS as matchMarketsQueryKey, aQ as matchQueryKey, aP as matchesQueryKey, aI as resolveEventsParams, aH as resolveTagSlug } from './server-eKqIns8z.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, 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 PolymarketWithdrawResponse, T as PolymarketWithdrawRequest, U as TickSizeResponse, V as WsConnectionStatus, X as WsDataMessage, Y as WsPriceEvent, Z as WsOrderbookEvent, _ as WsTradeEvent, $ as CreateOrderInput } from './server-DUc4MoLH.mjs';
2
+ export { b2 as BuildClobAuthMessageInput, bf as BuildOrderMessageInput, aV as CLOB_AUTH_DOMAIN, aW as CLOB_AUTH_TYPES, b3 as CTF_EXCHANGE_ADDRESS, b8 as CTF_ORDER_TYPES, be as ClobOrderPayload, ah as DFlowOrderContext, aj as DepositBuildRequest, ak as DepositBuildResponse, an as DepositStatusResponse, al as DepositSubmitRequest, am as DepositSubmitResponse, ab as EventSummary, a$ as HttpMethod, a8 as MarketOutcome, a7 as MarketResult, a6 as MarketStatus, ac as MarketSummary, au as MatchConfidenceTier, aq as MatchGroupEntry, ar as MatchGroupMarket, av as MatchMarketFlat, as as MatchSortField, ap as MatchStatus, at as MatchesStats, b4 as NEG_RISK_CTF_EXCHANGE_ADDRESS, b9 as ORDER_TYPE, bg as OrderMessage, ag as OrderSide, af as OrderStatus, a9 as OrderbookLevel, b6 as POLYGON_CHAIN_ID, b1 as PolymarketL2Headers, b0 as PolymarketL2HeadersInput, ai as PolymarketOrderType, ae as PredictPosition, a4 as PredictTag, a2 as PredictWsClientConfig, ad as PricePoint, a3 as ProviderMeta, aM as ResolveEventsParamsInput, ba as SIDE, a5 as SettlementSource, bh as SignedOrder, aN as TagSlugSelection, aa as TradeType, b5 as USDC_ADDRESS, ao as UnsignedTx, aw as WsChannel, ax as WsChannelEvent, ay as WsClientMessage, aE as WsErrorCode, aF as WsErrorMessage, aA as WsPingMessage, aC as WsPongMessage, aB as WsServerMessage, az as WsSubscribeMessage, aD as WsSubscribedMessage, aX as buildClobAuthMessage, bd as buildClobPayload, b7 as buildCtfExchangeDomain, bb as buildOrderMessage, aZ as buildPolymarketL2Headers, bc as buildSignedOrder, a0 as createPredictClient, a1 as createPredictWsClient, a_ as derivePolymarketApiKey, aG as eventQueryKey, aH as fetchEvent, aL as fetchEventsPage, aP as fetchMarket, aU as fetchMatchMarketsPage, aS as fetchMatchesPage, aY as hmacSha256Base64, aK as infiniteEventsQueryKey, aO as marketQueryKey, aT as matchMarketsQueryKey, aR as matchQueryKey, aQ as matchesQueryKey, aJ as resolveEventsParams, aI as resolveTagSlug } from './server-DUc4MoLH.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';
@@ -509,6 +509,10 @@ type UseInfiniteTradesParams = Omit<ListTradesParams, "cursor">;
509
509
  declare function infiniteTradesQueryKey(params: UseInfiniteTradesParams): unknown[];
510
510
  declare function useInfiniteTrades(params: UseInfiniteTradesParams): _tanstack_react_query.UseInfiniteQueryResult<_tanstack_react_query.InfiniteData<PredictPage<PredictTrade>, unknown>, Error>;
511
511
 
512
+ type UseInfiniteTradesMultiParams = Omit<ListTradesMultiParams, "cursor">;
513
+ declare function infiniteTradesMultiQueryKey(params: UseInfiniteTradesMultiParams): unknown[];
514
+ declare function useInfiniteTradesMulti(params: UseInfiniteTradesMultiParams): _tanstack_react_query.UseInfiniteQueryResult<_tanstack_react_query.InfiniteData<PredictPage<PredictTrade>, unknown>, Error>;
515
+
512
516
  declare function dflowQuoteQueryKey(params: DFlowQuoteRequest): unknown[];
513
517
  /**
514
518
  * Fetch a DFlow quote. The query is only enabled when all required
@@ -852,4 +856,4 @@ interface CreatePolymarketOrderVariables {
852
856
  */
853
857
  declare function useCreatePolymarketOrder(mutationOptions?: Omit<UseMutationOptions<PredictOrder, Error, CreatePolymarketOrderVariables>, "mutationFn">): _tanstack_react_query.UseMutationResult<PredictOrder, Error, CreatePolymarketOrderVariables, unknown>;
854
858
 
855
- export { AvailableSharesResponse, BalanceResponse, CancelOrderResult, type CancelOrderVariables, Candlestick, ChartRange, type ChartRangeType, CreateOrderInput, type CreatePolymarketOrderVariables, DFlowKYCStatus, DFlowQuoteRequest, DFlowQuoteResponse, DFlowSubmitRequest, DFlowSubmitResponse, EventSortField, EventStats, EventStatus, ListCandlesticksParams, ListEventsParams, ListMarketTradesParams, ListOrdersMultiParams, 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, PredictOrdersResponse, PredictPage, PredictProvider, type PredictProviderProps, PredictTrade, PredictWsClient, PriceHistoryRange, PriceHistoryResponse, ProviderSource, SimilarEventsParams, TickSizeResponse, type UseAvailableSharesOptions, type UseAvailableSharesParams, type UseBalanceParams, type UseCancelOrderOptions, 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 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, WithdrawBuildRequest, WithdrawBuildResponse, WithdrawStatusResponse, WithdrawSubmitRequest, WithdrawSubmitResponse, WsConnectionStatus, WsDataMessage, WsOrderbookEvent, WsPriceEvent, WsTradeEvent, availableSharesQueryKey, balanceQueryKey, candlesticksQueryKey, dflowKYCQueryKey, dflowQuoteQueryKey, eventStatsQueryKey, eventsQueryKey, fetchEvents, infiniteOrdersQueryKey, infiniteTradesQueryKey, marketTradesQueryKey, orderQueryKey, orderbookQueryKey, ordersMultiQueryKey, ordersQueryKey, polymarketDepositAddressesQueryKey, polymarketSetupQueryKey, positionsMultiQueryKey, positionsQueryKey, priceHistoryQueryKey, similarEventsQueryKey, tickSizeQueryKey, tradesQueryKey, useAvailableShares, useBalance, useCancelOrder, useCandlesticks, useCreatePolymarketOrder, useDFlowKYC, useDFlowQuote, useDFlowSubmit, useEvent, useEventStats, useEvents, useInfiniteEvents, useInfiniteMatchMarkets, useInfiniteMatches, useInfiniteOrders, useInfiniteTrades, useMarket, useMarketHistory, useMarketTrades, useMatch, useOrder, useOrderbook, useOrderbookSubscription, useOrders, useOrdersMulti, usePolymarket, usePolymarketDeposit, usePolymarketDepositAddresses, usePolymarketSetup, usePolymarketWithdraw, usePositions, usePositionsMulti, usePredictClient, usePredictWsClient, usePriceHistory, usePricesSubscription, useRealtimeOrderbook, useRealtimePrices, useRealtimeTrades, useRunPolymarketSetup, useSearchEvents, useSimilarEvents, useTickSize, useTrades, useTradesSubscription, useWithdrawBuildMutation, useWithdrawStatusQuery, useWithdrawSubmitMutation, withdrawStatusQueryKey };
859
+ export { AvailableSharesResponse, BalanceResponse, CancelOrderResult, type CancelOrderVariables, Candlestick, ChartRange, type ChartRangeType, CreateOrderInput, type CreatePolymarketOrderVariables, DFlowKYCStatus, DFlowQuoteRequest, DFlowQuoteResponse, DFlowSubmitRequest, DFlowSubmitResponse, EventSortField, EventStats, EventStatus, 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, type PolymarketSigner, PolymarketWithdrawRequest, PolymarketWithdrawResponse, PositionsResponse, PredictClient, PredictContext, type PredictContextValue, PredictEvent, PredictMarket, PredictOrder, PredictOrdersResponse, PredictPage, PredictProvider, type PredictProviderProps, PredictTrade, PredictWsClient, PriceHistoryRange, PriceHistoryResponse, ProviderSource, 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, WithdrawBuildRequest, WithdrawBuildResponse, WithdrawStatusResponse, WithdrawSubmitRequest, WithdrawSubmitResponse, WsConnectionStatus, WsDataMessage, WsOrderbookEvent, WsPriceEvent, WsTradeEvent, availableSharesQueryKey, balanceQueryKey, candlesticksQueryKey, dflowKYCQueryKey, dflowQuoteQueryKey, eventStatsQueryKey, eventsQueryKey, fetchEvents, infiniteOrdersQueryKey, infiniteTradesMultiQueryKey, infiniteTradesQueryKey, marketTradesQueryKey, orderQueryKey, orderbookQueryKey, ordersMultiQueryKey, ordersQueryKey, polymarketDepositAddressesQueryKey, polymarketSetupQueryKey, positionsMultiQueryKey, positionsQueryKey, priceHistoryQueryKey, similarEventsQueryKey, tickSizeQueryKey, tradesQueryKey, useAvailableShares, useBalance, useCancelOrder, useCandlesticks, useCreatePolymarketOrder, useDFlowKYC, useDFlowQuote, useDFlowSubmit, useEvent, useEventStats, useEvents, useInfiniteEvents, useInfiniteMatchMarkets, useInfiniteMatches, useInfiniteOrders, useInfiniteTrades, useInfiniteTradesMulti, useMarket, useMarketHistory, useMarketTrades, useMatch, useOrder, useOrderbook, useOrderbookSubscription, useOrders, useOrdersMulti, 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 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, D as DFlowQuoteRequest, x as DFlowQuoteResponse, y as DFlowSubmitResponse, z as DFlowSubmitRequest, F as DFlowKYCStatus, G as PolymarketSetupStatus, W as WithdrawBuildResponse, H as WithdrawBuildRequest, I as WithdrawSubmitResponse, J as WithdrawSubmitRequest, K as WithdrawStatusResponse, N as PolymarketDepositAddresses, Q as PolymarketWithdrawResponse, R as PolymarketWithdrawRequest, T as TickSizeResponse, U as WsConnectionStatus, V as WsDataMessage, X as WsPriceEvent, Y as WsOrderbookEvent, Z as WsTradeEvent, _ as CreateOrderInput } from './server-eKqIns8z.js';
2
- export { b1 as BuildClobAuthMessageInput, be as BuildOrderMessageInput, aU as CLOB_AUTH_DOMAIN, aV as CLOB_AUTH_TYPES, b2 as CTF_EXCHANGE_ADDRESS, b7 as CTF_ORDER_TYPES, bd as ClobOrderPayload, ag as DFlowOrderContext, ai as DepositBuildRequest, aj as DepositBuildResponse, am as DepositStatusResponse, ak as DepositSubmitRequest, al as DepositSubmitResponse, aa as EventSummary, a_ as HttpMethod, a7 as MarketOutcome, a6 as MarketResult, a5 as MarketStatus, ab as MarketSummary, at as MatchConfidenceTier, ap as MatchGroupEntry, aq as MatchGroupMarket, au as MatchMarketFlat, ar as MatchSortField, ao as MatchStatus, as as MatchesStats, b3 as NEG_RISK_CTF_EXCHANGE_ADDRESS, b8 as ORDER_TYPE, bf as OrderMessage, af as OrderSide, ae as OrderStatus, a8 as OrderbookLevel, b5 as POLYGON_CHAIN_ID, b0 as PolymarketL2Headers, a$ as PolymarketL2HeadersInput, ah as PolymarketOrderType, ad as PredictPosition, a3 as PredictTag, a1 as PredictWsClientConfig, ac as PricePoint, a2 as ProviderMeta, aL as ResolveEventsParamsInput, b9 as SIDE, a4 as SettlementSource, bg as SignedOrder, aM as TagSlugSelection, a9 as TradeType, b4 as USDC_ADDRESS, an as UnsignedTx, av as WsChannel, aw as WsChannelEvent, ax as WsClientMessage, aD as WsErrorCode, aE as WsErrorMessage, az as WsPingMessage, aB as WsPongMessage, aA as WsServerMessage, ay as WsSubscribeMessage, aC as WsSubscribedMessage, aW as buildClobAuthMessage, bc as buildClobPayload, b6 as buildCtfExchangeDomain, ba as buildOrderMessage, aY as buildPolymarketL2Headers, bb as buildSignedOrder, $ as createPredictClient, a0 as createPredictWsClient, aZ as derivePolymarketApiKey, aF as eventQueryKey, aG as fetchEvent, aK as fetchEventsPage, aO as fetchMarket, aT as fetchMatchMarketsPage, aR as fetchMatchesPage, aX as hmacSha256Base64, aJ as infiniteEventsQueryKey, aN as marketQueryKey, aS as matchMarketsQueryKey, aQ as matchQueryKey, aP as matchesQueryKey, aI as resolveEventsParams, aH as resolveTagSlug } from './server-eKqIns8z.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, 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 PolymarketWithdrawResponse, T as PolymarketWithdrawRequest, U as TickSizeResponse, V as WsConnectionStatus, X as WsDataMessage, Y as WsPriceEvent, Z as WsOrderbookEvent, _ as WsTradeEvent, $ as CreateOrderInput } from './server-DUc4MoLH.js';
2
+ export { b2 as BuildClobAuthMessageInput, bf as BuildOrderMessageInput, aV as CLOB_AUTH_DOMAIN, aW as CLOB_AUTH_TYPES, b3 as CTF_EXCHANGE_ADDRESS, b8 as CTF_ORDER_TYPES, be as ClobOrderPayload, ah as DFlowOrderContext, aj as DepositBuildRequest, ak as DepositBuildResponse, an as DepositStatusResponse, al as DepositSubmitRequest, am as DepositSubmitResponse, ab as EventSummary, a$ as HttpMethod, a8 as MarketOutcome, a7 as MarketResult, a6 as MarketStatus, ac as MarketSummary, au as MatchConfidenceTier, aq as MatchGroupEntry, ar as MatchGroupMarket, av as MatchMarketFlat, as as MatchSortField, ap as MatchStatus, at as MatchesStats, b4 as NEG_RISK_CTF_EXCHANGE_ADDRESS, b9 as ORDER_TYPE, bg as OrderMessage, ag as OrderSide, af as OrderStatus, a9 as OrderbookLevel, b6 as POLYGON_CHAIN_ID, b1 as PolymarketL2Headers, b0 as PolymarketL2HeadersInput, ai as PolymarketOrderType, ae as PredictPosition, a4 as PredictTag, a2 as PredictWsClientConfig, ad as PricePoint, a3 as ProviderMeta, aM as ResolveEventsParamsInput, ba as SIDE, a5 as SettlementSource, bh as SignedOrder, aN as TagSlugSelection, aa as TradeType, b5 as USDC_ADDRESS, ao as UnsignedTx, aw as WsChannel, ax as WsChannelEvent, ay as WsClientMessage, aE as WsErrorCode, aF as WsErrorMessage, aA as WsPingMessage, aC as WsPongMessage, aB as WsServerMessage, az as WsSubscribeMessage, aD as WsSubscribedMessage, aX as buildClobAuthMessage, bd as buildClobPayload, b7 as buildCtfExchangeDomain, bb as buildOrderMessage, aZ as buildPolymarketL2Headers, bc as buildSignedOrder, a0 as createPredictClient, a1 as createPredictWsClient, a_ as derivePolymarketApiKey, aG as eventQueryKey, aH as fetchEvent, aL as fetchEventsPage, aP as fetchMarket, aU as fetchMatchMarketsPage, aS as fetchMatchesPage, aY as hmacSha256Base64, aK as infiniteEventsQueryKey, aO as marketQueryKey, aT as matchMarketsQueryKey, aR as matchQueryKey, aQ as matchesQueryKey, aJ as resolveEventsParams, aI as resolveTagSlug } from './server-DUc4MoLH.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';
@@ -509,6 +509,10 @@ type UseInfiniteTradesParams = Omit<ListTradesParams, "cursor">;
509
509
  declare function infiniteTradesQueryKey(params: UseInfiniteTradesParams): unknown[];
510
510
  declare function useInfiniteTrades(params: UseInfiniteTradesParams): _tanstack_react_query.UseInfiniteQueryResult<_tanstack_react_query.InfiniteData<PredictPage<PredictTrade>, unknown>, Error>;
511
511
 
512
+ type UseInfiniteTradesMultiParams = Omit<ListTradesMultiParams, "cursor">;
513
+ declare function infiniteTradesMultiQueryKey(params: UseInfiniteTradesMultiParams): unknown[];
514
+ declare function useInfiniteTradesMulti(params: UseInfiniteTradesMultiParams): _tanstack_react_query.UseInfiniteQueryResult<_tanstack_react_query.InfiniteData<PredictPage<PredictTrade>, unknown>, Error>;
515
+
512
516
  declare function dflowQuoteQueryKey(params: DFlowQuoteRequest): unknown[];
513
517
  /**
514
518
  * Fetch a DFlow quote. The query is only enabled when all required
@@ -852,4 +856,4 @@ interface CreatePolymarketOrderVariables {
852
856
  */
853
857
  declare function useCreatePolymarketOrder(mutationOptions?: Omit<UseMutationOptions<PredictOrder, Error, CreatePolymarketOrderVariables>, "mutationFn">): _tanstack_react_query.UseMutationResult<PredictOrder, Error, CreatePolymarketOrderVariables, unknown>;
854
858
 
855
- export { AvailableSharesResponse, BalanceResponse, CancelOrderResult, type CancelOrderVariables, Candlestick, ChartRange, type ChartRangeType, CreateOrderInput, type CreatePolymarketOrderVariables, DFlowKYCStatus, DFlowQuoteRequest, DFlowQuoteResponse, DFlowSubmitRequest, DFlowSubmitResponse, EventSortField, EventStats, EventStatus, ListCandlesticksParams, ListEventsParams, ListMarketTradesParams, ListOrdersMultiParams, 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, PredictOrdersResponse, PredictPage, PredictProvider, type PredictProviderProps, PredictTrade, PredictWsClient, PriceHistoryRange, PriceHistoryResponse, ProviderSource, SimilarEventsParams, TickSizeResponse, type UseAvailableSharesOptions, type UseAvailableSharesParams, type UseBalanceParams, type UseCancelOrderOptions, 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 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, WithdrawBuildRequest, WithdrawBuildResponse, WithdrawStatusResponse, WithdrawSubmitRequest, WithdrawSubmitResponse, WsConnectionStatus, WsDataMessage, WsOrderbookEvent, WsPriceEvent, WsTradeEvent, availableSharesQueryKey, balanceQueryKey, candlesticksQueryKey, dflowKYCQueryKey, dflowQuoteQueryKey, eventStatsQueryKey, eventsQueryKey, fetchEvents, infiniteOrdersQueryKey, infiniteTradesQueryKey, marketTradesQueryKey, orderQueryKey, orderbookQueryKey, ordersMultiQueryKey, ordersQueryKey, polymarketDepositAddressesQueryKey, polymarketSetupQueryKey, positionsMultiQueryKey, positionsQueryKey, priceHistoryQueryKey, similarEventsQueryKey, tickSizeQueryKey, tradesQueryKey, useAvailableShares, useBalance, useCancelOrder, useCandlesticks, useCreatePolymarketOrder, useDFlowKYC, useDFlowQuote, useDFlowSubmit, useEvent, useEventStats, useEvents, useInfiniteEvents, useInfiniteMatchMarkets, useInfiniteMatches, useInfiniteOrders, useInfiniteTrades, useMarket, useMarketHistory, useMarketTrades, useMatch, useOrder, useOrderbook, useOrderbookSubscription, useOrders, useOrdersMulti, usePolymarket, usePolymarketDeposit, usePolymarketDepositAddresses, usePolymarketSetup, usePolymarketWithdraw, usePositions, usePositionsMulti, usePredictClient, usePredictWsClient, usePriceHistory, usePricesSubscription, useRealtimeOrderbook, useRealtimePrices, useRealtimeTrades, useRunPolymarketSetup, useSearchEvents, useSimilarEvents, useTickSize, useTrades, useTradesSubscription, useWithdrawBuildMutation, useWithdrawStatusQuery, useWithdrawSubmitMutation, withdrawStatusQueryKey };
859
+ export { AvailableSharesResponse, BalanceResponse, CancelOrderResult, type CancelOrderVariables, Candlestick, ChartRange, type ChartRangeType, CreateOrderInput, type CreatePolymarketOrderVariables, DFlowKYCStatus, DFlowQuoteRequest, DFlowQuoteResponse, DFlowSubmitRequest, DFlowSubmitResponse, EventSortField, EventStats, EventStatus, 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, type PolymarketSigner, PolymarketWithdrawRequest, PolymarketWithdrawResponse, PositionsResponse, PredictClient, PredictContext, type PredictContextValue, PredictEvent, PredictMarket, PredictOrder, PredictOrdersResponse, PredictPage, PredictProvider, type PredictProviderProps, PredictTrade, PredictWsClient, PriceHistoryRange, PriceHistoryResponse, ProviderSource, 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, WithdrawBuildRequest, WithdrawBuildResponse, WithdrawStatusResponse, WithdrawSubmitRequest, WithdrawSubmitResponse, WsConnectionStatus, WsDataMessage, WsOrderbookEvent, WsPriceEvent, WsTradeEvent, availableSharesQueryKey, balanceQueryKey, candlesticksQueryKey, dflowKYCQueryKey, dflowQuoteQueryKey, eventStatsQueryKey, eventsQueryKey, fetchEvents, infiniteOrdersQueryKey, infiniteTradesMultiQueryKey, infiniteTradesQueryKey, marketTradesQueryKey, orderQueryKey, orderbookQueryKey, ordersMultiQueryKey, ordersQueryKey, polymarketDepositAddressesQueryKey, polymarketSetupQueryKey, positionsMultiQueryKey, positionsQueryKey, priceHistoryQueryKey, similarEventsQueryKey, tickSizeQueryKey, tradesQueryKey, useAvailableShares, useBalance, useCancelOrder, useCandlesticks, useCreatePolymarketOrder, useDFlowKYC, useDFlowQuote, useDFlowSubmit, useEvent, useEventStats, useEvents, useInfiniteEvents, useInfiniteMatchMarkets, useInfiniteMatches, useInfiniteOrders, useInfiniteTrades, useInfiniteTradesMulti, useMarket, useMarketHistory, useMarketTrades, useMatch, useOrder, useOrderbook, useOrderbookSubscription, useOrders, useOrdersMulti, 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
@@ -348,6 +348,12 @@ var PredictClient = class {
348
348
  const url = `${this.endpoint}/api/v1/trades${query}`;
349
349
  return await utils.httpGet(url);
350
350
  }
351
+ /** Maps to `GET /api/v1/trades?kalshi_user=...&polymarket_user=...`. */
352
+ async listTradesMulti(params) {
353
+ const query = buildQuery(params);
354
+ const url = `${this.endpoint}/api/v1/trades${query}`;
355
+ return await utils.httpGet(url);
356
+ }
351
357
  // -------------------------------------------------------------------------
352
358
  // Withdraw
353
359
  // -------------------------------------------------------------------------
@@ -1499,6 +1505,19 @@ function useInfiniteTrades(params) {
1499
1505
  enabled: Boolean(params.wallet)
1500
1506
  });
1501
1507
  }
1508
+ function infiniteTradesMultiQueryKey(params) {
1509
+ return ["predict", "trades-by-wallet", "infinite-multi", params];
1510
+ }
1511
+ function useInfiniteTradesMulti(params) {
1512
+ const client = usePredictClient();
1513
+ return reactQuery.useInfiniteQuery({
1514
+ queryKey: infiniteTradesMultiQueryKey(params),
1515
+ queryFn: ({ pageParam }) => client.listTradesMulti({ ...params, cursor: pageParam }),
1516
+ initialPageParam: void 0,
1517
+ getNextPageParam: (lastPage) => lastPage.has_more ? lastPage.next_cursor : void 0,
1518
+ enabled: Boolean(params.kalshi_user || params.polymarket_user)
1519
+ });
1520
+ }
1502
1521
  function dflowQuoteQueryKey(params) {
1503
1522
  return ["predict", "dflow-quote", params];
1504
1523
  }
@@ -1989,6 +2008,16 @@ function floorDecimalPlaces(n, d) {
1989
2008
  const factor = 10 ** d;
1990
2009
  return Math.floor(n * factor) / factor;
1991
2010
  }
2011
+ function ceilDecimalPlaces(n, d) {
2012
+ const factor = 10 ** d;
2013
+ return Math.ceil(n * factor) / factor;
2014
+ }
2015
+ function countDecimalPlaces(n) {
2016
+ const s = n.toString();
2017
+ const dot = s.indexOf(".");
2018
+ if (dot === -1) return 0;
2019
+ return s.length - dot - 1;
2020
+ }
1992
2021
  function toMicroUsdc(amount) {
1993
2022
  return BigInt(Math.round(amount * 1e6));
1994
2023
  }
@@ -1998,16 +2027,48 @@ function normalizeTokenId(tokenId) {
1998
2027
  }
1999
2028
  return tokenId;
2000
2029
  }
2001
- function buildOrderMessage(input) {
2002
- const side = input.side === "BUY" ? SIDE.BUY : SIDE.SELL;
2003
- const rc = ROUNDING_CONFIG[input.tickSize] ?? DEFAULT_ROUNDING;
2004
- const rawPrice = decimalPlaces(input.price, rc.price);
2005
- const rawSize = side === SIDE.SELL ? floorDecimalPlaces(input.size, rc.size) : decimalPlaces(input.size, rc.size);
2030
+ var MARKET_MAKER_MAX_DECIMALS = 2;
2031
+ var MARKET_TAKER_MAX_DECIMALS = 4;
2032
+ function getMarketOrderAmounts(side, size, price, rc) {
2033
+ const rawPrice = decimalPlaces(price, rc.price);
2034
+ const makerDecimals = Math.min(rc.size, MARKET_MAKER_MAX_DECIMALS);
2035
+ const takerDecimals = Math.min(rc.amount, MARKET_TAKER_MAX_DECIMALS);
2036
+ if (side === SIDE.BUY) {
2037
+ const rawMakerAmt2 = floorDecimalPlaces(size, makerDecimals);
2038
+ let rawTakerAmt2 = rawMakerAmt2 / rawPrice;
2039
+ if (countDecimalPlaces(rawTakerAmt2) > takerDecimals) {
2040
+ rawTakerAmt2 = floorDecimalPlaces(rawTakerAmt2, takerDecimals);
2041
+ }
2042
+ return {
2043
+ makerAmount: toMicroUsdc(rawMakerAmt2).toString(),
2044
+ takerAmount: toMicroUsdc(rawTakerAmt2).toString()
2045
+ };
2046
+ }
2047
+ const rawMakerAmt = floorDecimalPlaces(size, makerDecimals);
2048
+ let rawTakerAmt = rawMakerAmt * rawPrice;
2049
+ if (countDecimalPlaces(rawTakerAmt) > takerDecimals) {
2050
+ rawTakerAmt = ceilDecimalPlaces(rawTakerAmt, takerDecimals);
2051
+ }
2052
+ return {
2053
+ makerAmount: toMicroUsdc(rawMakerAmt).toString(),
2054
+ takerAmount: toMicroUsdc(rawTakerAmt).toString()
2055
+ };
2056
+ }
2057
+ function getLimitOrderAmounts(side, size, price, rc) {
2058
+ const rawPrice = decimalPlaces(price, rc.price);
2059
+ const rawSize = side === SIDE.SELL ? floorDecimalPlaces(size, rc.size) : decimalPlaces(size, rc.size);
2006
2060
  const sizeInMicro = toMicroUsdc(rawSize);
2007
2061
  const rawAmount = decimalPlaces(rawSize * rawPrice, rc.amount);
2008
2062
  const amountInMicro = toMicroUsdc(rawAmount);
2009
2063
  const makerAmount = side === SIDE.BUY ? amountInMicro.toString() : sizeInMicro.toString();
2010
2064
  const takerAmount = side === SIDE.BUY ? sizeInMicro.toString() : amountInMicro.toString();
2065
+ return { makerAmount, takerAmount };
2066
+ }
2067
+ function buildOrderMessage(input) {
2068
+ const side = input.side === "BUY" ? SIDE.BUY : SIDE.SELL;
2069
+ const rc = ROUNDING_CONFIG[input.tickSize] ?? DEFAULT_ROUNDING;
2070
+ const isMarketOrder = input.orderType === "FOK" || input.orderType === "FAK";
2071
+ const { makerAmount, takerAmount } = isMarketOrder ? getMarketOrderAmounts(side, input.size, input.price, rc) : getLimitOrderAmounts(side, input.size, input.price, rc);
2011
2072
  const maker = input.funderAddress ?? input.signerAddress;
2012
2073
  return {
2013
2074
  salt: Math.floor(Math.random() * 1e15).toString(),
@@ -2122,6 +2183,9 @@ function useCreatePolymarketOrder(mutationOptions = {}) {
2122
2183
  }
2123
2184
  function computeOrderCost(input) {
2124
2185
  if (input.side === "SELL") return "0";
2186
+ if (input.orderType === "FOK" || input.orderType === "FAK") {
2187
+ return input.size.toFixed(6);
2188
+ }
2125
2189
  return (input.price * input.size).toFixed(6);
2126
2190
  }
2127
2191
  async function pollTxConfirmed(fetchStatus, txHash) {
@@ -2180,6 +2244,7 @@ exports.fetchMatchesPage = fetchMatchesPage;
2180
2244
  exports.hmacSha256Base64 = hmacSha256Base64;
2181
2245
  exports.infiniteEventsQueryKey = infiniteEventsQueryKey;
2182
2246
  exports.infiniteOrdersQueryKey = infiniteOrdersQueryKey;
2247
+ exports.infiniteTradesMultiQueryKey = infiniteTradesMultiQueryKey;
2183
2248
  exports.infiniteTradesQueryKey = infiniteTradesQueryKey;
2184
2249
  exports.marketQueryKey = marketQueryKey;
2185
2250
  exports.marketTradesQueryKey = marketTradesQueryKey;
@@ -2216,6 +2281,7 @@ exports.useInfiniteMatchMarkets = useInfiniteMatchMarkets;
2216
2281
  exports.useInfiniteMatches = useInfiniteMatches;
2217
2282
  exports.useInfiniteOrders = useInfiniteOrders;
2218
2283
  exports.useInfiniteTrades = useInfiniteTrades;
2284
+ exports.useInfiniteTradesMulti = useInfiniteTradesMulti;
2219
2285
  exports.useMarket = useMarket;
2220
2286
  exports.useMarketHistory = useMarketHistory;
2221
2287
  exports.useMarketTrades = useMarketTrades;