@liberfi.io/react-predict 0.3.61 → 0.3.63

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 OrderbookOutcome, h as Orderbook, i as ListMarketTradesParams, j as PredictTrade, k as PriceHistoryRange, l as PriceHistoryResponse, m as ListCandlesticksParams, C as Candlestick, n as ListCommentsParams, o as PredictComment, p as PositionsResponse, A as AvailableSharesResponse, B as BalanceResponse, q as ListOrdersParams, r as PredictOrder, s as ListOrdersMultiParams, t as PredictOrdersResponse, u as CancelOrderResult, M as MatchesParams, v as MatchGroupPage, w as MatchGroup, x as MatchMarketParams, y as MatchMarketPage, z as ListTradesParams, D as ListTradesMultiParams, F as DFlowQuoteRequest, G as DFlowQuoteResponse, H as DFlowSubmitResponse, I as DFlowSubmitRequest, J as DFlowKYCStatus, K as PolymarketSetupStatus, N as PolymarketDepositWalletDeployResponse, W as WithdrawBuildResponse, Q as WithdrawBuildRequest, R as WithdrawSubmitResponse, T as WithdrawSubmitRequest, U as WithdrawStatusResponse, V as PolymarketDepositAddresses, X as PolymarketSupportedAsset, Y as PolymarketWithdrawResponse, Z as PolymarketWithdrawRequest, _ as PolymarketWithdrawPrepareResponse, $ as PolymarketWithdrawPrepareRequest, a0 as PolymarketWithdrawQuoteResponse, a1 as PolymarketWithdrawQuoteRequest, a2 as PolymarketWithdrawRelayBuildResponse, a3 as PolymarketWithdrawRelayBuildRequest, a4 as PolymarketWithdrawRelaySubmitResponse, a5 as PolymarketWithdrawRelaySubmitRequest, a6 as PolymarketWithdrawBridgeStatusResponse, a7 as PolymarketRedeemResponse, a8 as PolymarketTypedData, a9 as TickSizeResponse, aa as FeeRateResponse, ab as RebateConfig, ac as WsConnectionStatus, ad as WsDataMessage, ae as WsPriceEvent, af as WsOrderbookEvent, ag as WsTradeEvent, ah as CreateOrderInput } from './server-h41hs9SR.mjs';
2
- export { bA as BuildClobAuthMessageInput, bO as BuildOrderMessageInput, br as CLOB_AUTH_DOMAIN, bs as CLOB_AUTH_TYPES, bB as CTF_EXCHANGE_ADDRESS, bG as CTF_ORDER_TYPES, bN as ClobOrderPayload, aF as DFlowOrderContext, aJ as DepositBuildRequest, aK as DepositBuildResponse, aN as DepositStatusResponse, aL as DepositSubmitRequest, aM as DepositSubmitResponse, ay as EventSummary, bx as HttpMethod, ar as MarketOutcome, aq as MarketResult, ap as MarketStatus, az as MarketSummary, aX as MatchConfidenceTier, aT as MatchGroupEntry, aU as MatchGroupMarket, aZ as MatchLeg, a_ as MatchMarketFlat, aV as MatchSortField, aS as MatchStatus, aW as MatchesStats, bC as NEG_RISK_CTF_EXCHANGE_ADDRESS, bH as ORDER_TYPE, bP as OrderMessage, aE as OrderSide, aD as OrderStatus, at as OrderbookBatchItem, au as OrderbookBatchResult, as as OrderbookLevel, av as OrderbooksBatchRequest, aw as OrderbooksBatchResponse, bE as POLYGON_CHAIN_ID, aP as PolymarketBridgeToken, aI as PolymarketDepositWalletDeployRequest, bz as PolymarketL2Headers, by as PolymarketL2HeadersInput, aG as PolymarketOrderType, bb as PolymarketRedeemInput, b9 as PolymarketRedeemPrepareInput, ba as PolymarketRedeemPrepareResponse, aQ as PolymarketSupportedAssetsResponse, aR as PolymarketTypedDataArg, aH as PolymarketWalletKind, aj as PredictClientOptions, aA as PredictCommentProfile, aC as PredictPosition, an as PredictTag, al as PredictWsClientConfig, aB as PricePoint, am as ProviderMeta, bi as ResolveEventsParamsInput, bI as SIDE, ao as SettlementSource, aY as SignalTag, bQ as SignedOrder, bj as TagSlugSelection, ax as TradeType, bD as USDC_ADDRESS, aO as UnsignedTx, a$ as WsChannel, b0 as WsChannelEvent, b1 as WsClientMessage, b7 as WsErrorCode, b8 as WsErrorMessage, b3 as WsPingMessage, b5 as WsPongMessage, b4 as WsServerMessage, b2 as WsSubscribeMessage, b6 as WsSubscribedMessage, bt as buildClobAuthMessage, bL as buildClobPayload, bF as buildCtfExchangeDomain, bJ as buildOrderMessage, bv as buildPolymarketL2Headers, bK as buildSignedOrder, ai as createPredictClient, ak as createPredictWsClient, bw as derivePolymarketApiKey, bc as eventQueryKey, bd as fetchEvent, bh as fetchEventsPage, bl as fetchMarket, bq as fetchMatchMarketsPage, bo as fetchMatchesPage, bM as getPolymarketSharesPrecision, bu as hmacSha256Base64, bg as infiniteEventsQueryKey, bk as marketQueryKey, bp as matchMarketsQueryKey, bn as matchQueryKey, bm as matchesQueryKey, bf as resolveEventsParams, be as resolveTagSlug } from './server-h41hs9SR.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 OrderbookOutcome, h as Orderbook, i as ListMarketTradesParams, j as PredictTrade, k as PriceHistoryRange, l as PriceHistoryResponse, m as ListCandlesticksParams, C as Candlestick, n as ListCommentsParams, o as PredictComment, p as PositionsResponse, q as PositionValueResponse, A as AvailableSharesResponse, B as BalanceResponse, r as ListOrdersParams, s as PredictOrder, t as ListOrdersMultiParams, u as PredictOrdersResponse, v as CancelOrderResult, M as MatchesParams, w as MatchGroupPage, x as MatchGroup, y as MatchMarketParams, z as MatchMarketPage, D as ListTradesParams, F as ListTradesMultiParams, G as DFlowQuoteRequest, H as DFlowQuoteResponse, I as DFlowSubmitResponse, J as DFlowSubmitRequest, K as DFlowKYCStatus, N as PolymarketSetupStatus, Q as PolymarketDepositWalletDeployResponse, W as WithdrawBuildResponse, R as WithdrawBuildRequest, T as WithdrawSubmitResponse, U as WithdrawSubmitRequest, V as WithdrawStatusResponse, X as PolymarketDepositAddresses, Y as PolymarketSupportedAsset, Z as PolymarketWithdrawResponse, _ as PolymarketWithdrawRequest, $ as PolymarketWithdrawPrepareResponse, a0 as PolymarketWithdrawPrepareRequest, a1 as PolymarketWithdrawQuoteResponse, a2 as PolymarketWithdrawQuoteRequest, a3 as PolymarketWithdrawRelayBuildResponse, a4 as PolymarketWithdrawRelayBuildRequest, a5 as PolymarketWithdrawRelaySubmitResponse, a6 as PolymarketWithdrawRelaySubmitRequest, a7 as PolymarketWithdrawBridgeStatusResponse, a8 as PolymarketRedeemResponse, a9 as PolymarketTypedData, aa as TickSizeResponse, ab as FeeRateResponse, ac as RebateConfig, ad as WsConnectionStatus, ae as WsDataMessage, af as WsPriceEvent, ag as WsOrderbookEvent, ah as WsTradeEvent, ai as CreateOrderInput } from './server-Dk8PqvnI.mjs';
2
+ export { bE as BuildClobAuthMessageInput, bT as BuildOrderMessageInput, bv as CLOB_AUTH_DOMAIN, bw as CLOB_AUTH_TYPES, bF as CTF_EXCHANGE_ADDRESS, bK as CTF_ORDER_TYPES, bS as ClobOrderPayload, aI as DFlowOrderContext, aN as DepositBuildRequest, aO as DepositBuildResponse, aR as DepositStatusResponse, aP as DepositSubmitRequest, aQ as DepositSubmitResponse, az as EventSummary, bB as HttpMethod, as as MarketOutcome, ar as MarketResult, aq as MarketStatus, aA as MarketSummary, a$ as MatchConfidenceTier, aX as MatchGroupEntry, aY as MatchGroupMarket, b1 as MatchLeg, b2 as MatchMarketFlat, aZ as MatchSortField, aW as MatchStatus, a_ as MatchesStats, bG as NEG_RISK_CTF_EXCHANGE_ADDRESS, bL as ORDER_TYPE, bU as OrderMessage, aH as OrderSide, aG as OrderStatus, au as OrderbookBatchItem, av as OrderbookBatchResult, at as OrderbookLevel, aw as OrderbooksBatchRequest, ax as OrderbooksBatchResponse, bI as POLYGON_CHAIN_ID, aT as PolymarketBridgeToken, aM as PolymarketDepositWalletDeployRequest, bD as PolymarketL2Headers, bC as PolymarketL2HeadersInput, aJ as PolymarketOrderType, bf as PolymarketRedeemInput, bd as PolymarketRedeemPrepareInput, be as PolymarketRedeemPrepareResponse, aU as PolymarketSupportedAssetsResponse, aK as PolymarketTickSize, aV as PolymarketTypedDataArg, aL as PolymarketWalletKind, aE as PositionValue, aF as PositionValueError, ak as PredictClientOptions, aB as PredictCommentProfile, aD as PredictPosition, ao as PredictTag, am as PredictWsClientConfig, aC as PricePoint, an as ProviderMeta, bm as ResolveEventsParamsInput, bM as SIDE, ap as SettlementSource, b0 as SignalTag, bV as SignedOrder, bn as TagSlugSelection, ay as TradeType, bH as USDC_ADDRESS, aS as UnsignedTx, b3 as WsChannel, b4 as WsChannelEvent, b5 as WsClientMessage, bb as WsErrorCode, bc as WsErrorMessage, b7 as WsPingMessage, b9 as WsPongMessage, b8 as WsServerMessage, b6 as WsSubscribeMessage, ba as WsSubscribedMessage, bx as buildClobAuthMessage, bP as buildClobPayload, bJ as buildCtfExchangeDomain, bN as buildOrderMessage, bz as buildPolymarketL2Headers, bO as buildSignedOrder, aj as createPredictClient, al as createPredictWsClient, bA as derivePolymarketApiKey, bg as eventQueryKey, bh as fetchEvent, bl as fetchEventsPage, bp as fetchMarket, bu as fetchMatchMarketsPage, bs as fetchMatchesPage, bQ as getPolymarketSharesPrecision, by as hmacSha256Base64, bk as infiniteEventsQueryKey, bo as marketQueryKey, bt as matchMarketsQueryKey, br as matchQueryKey, bq as matchesQueryKey, bR as normalizePolymarketTickSize, bj as resolveEventsParams, bi as resolveTagSlug } from './server-Dk8PqvnI.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';
@@ -414,6 +414,29 @@ declare function usePositions(params: UsePositionsParams, queryOptions?: Omit<Us
414
414
  */
415
415
  declare function usePositionsMulti(params: UsePositionsMultiParams, queryOptions?: Omit<UseQueryOptions<PositionsResponse, Error, PositionsResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<PositionsResponse, Error>;
416
416
 
417
+ declare function positionValueQueryKey(user: string, source?: ProviderSource): unknown[];
418
+ declare function positionValueMultiQueryKey(wallets: {
419
+ kalshi_user?: string;
420
+ polymarket_user?: string;
421
+ }): unknown[];
422
+ /** Single-source params (backward-compatible). */
423
+ interface UsePositionValueParams {
424
+ /** Provider source. Omit to aggregate all providers (same address). */
425
+ source?: ProviderSource;
426
+ user: string;
427
+ }
428
+ /** Multi-wallet params — each provider gets its own address. */
429
+ interface UsePositionValueMultiParams {
430
+ kalshi_user?: string;
431
+ polymarket_user?: string;
432
+ }
433
+ declare function usePositionValue(params: UsePositionValueParams, queryOptions?: Omit<UseQueryOptions<PositionValueResponse, Error, PositionValueResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<PositionValueResponse, Error>;
434
+ /**
435
+ * Fetch current total position value for multiple wallets in a single request.
436
+ * Each provider is queried with its own address.
437
+ */
438
+ declare function usePositionValueMulti(params: UsePositionValueMultiParams, queryOptions?: Omit<UseQueryOptions<PositionValueResponse, Error, PositionValueResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<PositionValueResponse, Error>;
439
+
417
440
  interface UseAvailableSharesParams {
418
441
  source: ProviderSource;
419
442
  user: string;
@@ -1142,4 +1165,4 @@ interface WalkOrderbookParams {
1142
1165
  */
1143
1166
  declare function walkOrderbook({ orderbook, outcome, side, sharesNeeded, slippageBps, }: WalkOrderbookParams): WalkResult;
1144
1167
 
1145
- export { AvailableSharesResponse, BalanceResponse, type BuildV2OrderParams, CancelOrderResult, type CancelOrderVariables, Candlestick, ChartRange, type ChartRangeType, type ClobOrderV2Payload, 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, OrderbookOutcome, PolymarketContext, type PolymarketContextValue, type PolymarketCredentials, PolymarketDepositAddresses, type PolymarketDepositResult, type PolymarketDepositVariables, PolymarketDepositWalletDeployResponse, PolymarketProvider, type PolymarketProviderProps, PolymarketRedeemResponse, PolymarketSetupStatus, type PolymarketSigner, PolymarketSupportedAsset, PolymarketTypedData, PolymarketWithdrawBridgeStatusResponse, PolymarketWithdrawPrepareRequest, PolymarketWithdrawPrepareResponse, PolymarketWithdrawQuoteRequest, PolymarketWithdrawQuoteResponse, PolymarketWithdrawRelayBuildRequest, PolymarketWithdrawRelayBuildResponse, PolymarketWithdrawRelaySubmitRequest, PolymarketWithdrawRelaySubmitResponse, PolymarketWithdrawRequest, PolymarketWithdrawResponse, PositionsResponse, PredictClient, PredictComment, PredictContext, type PredictContextValue, PredictEvent, PredictMarket, PredictOrder, PredictOrdersResponse, PredictPage, PredictProvider, type PredictProviderProps, PredictTrade, PredictWsClient, PriceHistoryRange, PriceHistoryResponse, ProviderSource, RebateConfig, type RedeemPositionVariables, SimilarEventsParams, type StartTradeResultConfirmationInput, type SyncBalanceAllowanceParams, TickSizeResponse, type TradeResultConfirmationState, type TradeResultExpectation, 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, buildSignedV2OrderPayload, candlesticksQueryKey, dflowKYCQueryKey, dflowQuoteQueryKey, eventStatsQueryKey, eventsQueryKey, feeRateQueryKey, fetchEvents, infiniteCommentsQueryKey, infiniteOrdersQueryKey, infiniteTradesMultiQueryKey, infiniteTradesQueryKey, marketTradesQueryKey, orderQueryKey, orderbookQueryKey, ordersMultiQueryKey, ordersQueryKey, pickBestAsk, pickBestBid, polymarketDepositAddressesQueryKey, polymarketSetupQueryKey, polymarketSupportedAssetsQueryKey, polymarketWithdrawStatusQueryKey, positionsMultiQueryKey, positionsQueryKey, priceHistoryQueryKey, rebateConfigQueryKey, similarEventsQueryKey, tickSizeQueryKey, tradesQueryKey, updatePolymarketBalanceAllowance, useAvailableShares, useBalance, useCancelOrder, useCandlesticks, useCreatePolymarketOrder, useDFlowKYC, useDFlowQuote, useDFlowSubmit, useDeployPolymarketDepositWallet, 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, usePolymarketWithdrawPrepareMutation, usePolymarketWithdrawQuoteMutation, usePolymarketWithdrawRelayBuildMutation, usePolymarketWithdrawRelaySubmitMutation, usePolymarketWithdrawStatusQuery, usePositions, usePositionsMulti, usePredictClient, usePredictWsClient, usePriceHistory, usePricesSubscription, useRealtimeOrderbook, useRealtimePrices, useRealtimeTrades, useRebateConfig, useRedeemPosition, useRunPolymarketSetup, useSearchEvents, useSimilarEvents, useTickSize, useTradeResultConfirmation, useTrades, useTradesSubscription, useWithdrawBuildMutation, useWithdrawStatusQuery, useWithdrawSubmitMutation, walkOrderbook, withdrawStatusQueryKey };
1168
+ export { AvailableSharesResponse, BalanceResponse, type BuildV2OrderParams, CancelOrderResult, type CancelOrderVariables, Candlestick, ChartRange, type ChartRangeType, type ClobOrderV2Payload, 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, OrderbookOutcome, PolymarketContext, type PolymarketContextValue, type PolymarketCredentials, PolymarketDepositAddresses, type PolymarketDepositResult, type PolymarketDepositVariables, PolymarketDepositWalletDeployResponse, PolymarketProvider, type PolymarketProviderProps, PolymarketRedeemResponse, PolymarketSetupStatus, type PolymarketSigner, PolymarketSupportedAsset, PolymarketTypedData, PolymarketWithdrawBridgeStatusResponse, PolymarketWithdrawPrepareRequest, PolymarketWithdrawPrepareResponse, PolymarketWithdrawQuoteRequest, PolymarketWithdrawQuoteResponse, PolymarketWithdrawRelayBuildRequest, PolymarketWithdrawRelayBuildResponse, PolymarketWithdrawRelaySubmitRequest, PolymarketWithdrawRelaySubmitResponse, PolymarketWithdrawRequest, PolymarketWithdrawResponse, PositionValueResponse, PositionsResponse, PredictClient, PredictComment, PredictContext, type PredictContextValue, PredictEvent, PredictMarket, PredictOrder, PredictOrdersResponse, PredictPage, PredictProvider, type PredictProviderProps, PredictTrade, PredictWsClient, PriceHistoryRange, PriceHistoryResponse, ProviderSource, RebateConfig, type RedeemPositionVariables, SimilarEventsParams, type StartTradeResultConfirmationInput, type SyncBalanceAllowanceParams, TickSizeResponse, type TradeResultConfirmationState, type TradeResultExpectation, 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 UsePositionValueMultiParams, type UsePositionValueParams, 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, buildSignedV2OrderPayload, candlesticksQueryKey, dflowKYCQueryKey, dflowQuoteQueryKey, eventStatsQueryKey, eventsQueryKey, feeRateQueryKey, fetchEvents, infiniteCommentsQueryKey, infiniteOrdersQueryKey, infiniteTradesMultiQueryKey, infiniteTradesQueryKey, marketTradesQueryKey, orderQueryKey, orderbookQueryKey, ordersMultiQueryKey, ordersQueryKey, pickBestAsk, pickBestBid, polymarketDepositAddressesQueryKey, polymarketSetupQueryKey, polymarketSupportedAssetsQueryKey, polymarketWithdrawStatusQueryKey, positionValueMultiQueryKey, positionValueQueryKey, positionsMultiQueryKey, positionsQueryKey, priceHistoryQueryKey, rebateConfigQueryKey, similarEventsQueryKey, tickSizeQueryKey, tradesQueryKey, updatePolymarketBalanceAllowance, useAvailableShares, useBalance, useCancelOrder, useCandlesticks, useCreatePolymarketOrder, useDFlowKYC, useDFlowQuote, useDFlowSubmit, useDeployPolymarketDepositWallet, 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, usePolymarketWithdrawPrepareMutation, usePolymarketWithdrawQuoteMutation, usePolymarketWithdrawRelayBuildMutation, usePolymarketWithdrawRelaySubmitMutation, usePolymarketWithdrawStatusQuery, usePositionValue, usePositionValueMulti, usePositions, usePositionsMulti, usePredictClient, usePredictWsClient, usePriceHistory, usePricesSubscription, useRealtimeOrderbook, useRealtimePrices, useRealtimeTrades, useRebateConfig, useRedeemPosition, useRunPolymarketSetup, useSearchEvents, useSimilarEvents, useTickSize, useTradeResultConfirmation, 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 OrderbookOutcome, h as Orderbook, i as ListMarketTradesParams, j as PredictTrade, k as PriceHistoryRange, l as PriceHistoryResponse, m as ListCandlesticksParams, C as Candlestick, n as ListCommentsParams, o as PredictComment, p as PositionsResponse, A as AvailableSharesResponse, B as BalanceResponse, q as ListOrdersParams, r as PredictOrder, s as ListOrdersMultiParams, t as PredictOrdersResponse, u as CancelOrderResult, M as MatchesParams, v as MatchGroupPage, w as MatchGroup, x as MatchMarketParams, y as MatchMarketPage, z as ListTradesParams, D as ListTradesMultiParams, F as DFlowQuoteRequest, G as DFlowQuoteResponse, H as DFlowSubmitResponse, I as DFlowSubmitRequest, J as DFlowKYCStatus, K as PolymarketSetupStatus, N as PolymarketDepositWalletDeployResponse, W as WithdrawBuildResponse, Q as WithdrawBuildRequest, R as WithdrawSubmitResponse, T as WithdrawSubmitRequest, U as WithdrawStatusResponse, V as PolymarketDepositAddresses, X as PolymarketSupportedAsset, Y as PolymarketWithdrawResponse, Z as PolymarketWithdrawRequest, _ as PolymarketWithdrawPrepareResponse, $ as PolymarketWithdrawPrepareRequest, a0 as PolymarketWithdrawQuoteResponse, a1 as PolymarketWithdrawQuoteRequest, a2 as PolymarketWithdrawRelayBuildResponse, a3 as PolymarketWithdrawRelayBuildRequest, a4 as PolymarketWithdrawRelaySubmitResponse, a5 as PolymarketWithdrawRelaySubmitRequest, a6 as PolymarketWithdrawBridgeStatusResponse, a7 as PolymarketRedeemResponse, a8 as PolymarketTypedData, a9 as TickSizeResponse, aa as FeeRateResponse, ab as RebateConfig, ac as WsConnectionStatus, ad as WsDataMessage, ae as WsPriceEvent, af as WsOrderbookEvent, ag as WsTradeEvent, ah as CreateOrderInput } from './server-h41hs9SR.js';
2
- export { bA as BuildClobAuthMessageInput, bO as BuildOrderMessageInput, br as CLOB_AUTH_DOMAIN, bs as CLOB_AUTH_TYPES, bB as CTF_EXCHANGE_ADDRESS, bG as CTF_ORDER_TYPES, bN as ClobOrderPayload, aF as DFlowOrderContext, aJ as DepositBuildRequest, aK as DepositBuildResponse, aN as DepositStatusResponse, aL as DepositSubmitRequest, aM as DepositSubmitResponse, ay as EventSummary, bx as HttpMethod, ar as MarketOutcome, aq as MarketResult, ap as MarketStatus, az as MarketSummary, aX as MatchConfidenceTier, aT as MatchGroupEntry, aU as MatchGroupMarket, aZ as MatchLeg, a_ as MatchMarketFlat, aV as MatchSortField, aS as MatchStatus, aW as MatchesStats, bC as NEG_RISK_CTF_EXCHANGE_ADDRESS, bH as ORDER_TYPE, bP as OrderMessage, aE as OrderSide, aD as OrderStatus, at as OrderbookBatchItem, au as OrderbookBatchResult, as as OrderbookLevel, av as OrderbooksBatchRequest, aw as OrderbooksBatchResponse, bE as POLYGON_CHAIN_ID, aP as PolymarketBridgeToken, aI as PolymarketDepositWalletDeployRequest, bz as PolymarketL2Headers, by as PolymarketL2HeadersInput, aG as PolymarketOrderType, bb as PolymarketRedeemInput, b9 as PolymarketRedeemPrepareInput, ba as PolymarketRedeemPrepareResponse, aQ as PolymarketSupportedAssetsResponse, aR as PolymarketTypedDataArg, aH as PolymarketWalletKind, aj as PredictClientOptions, aA as PredictCommentProfile, aC as PredictPosition, an as PredictTag, al as PredictWsClientConfig, aB as PricePoint, am as ProviderMeta, bi as ResolveEventsParamsInput, bI as SIDE, ao as SettlementSource, aY as SignalTag, bQ as SignedOrder, bj as TagSlugSelection, ax as TradeType, bD as USDC_ADDRESS, aO as UnsignedTx, a$ as WsChannel, b0 as WsChannelEvent, b1 as WsClientMessage, b7 as WsErrorCode, b8 as WsErrorMessage, b3 as WsPingMessage, b5 as WsPongMessage, b4 as WsServerMessage, b2 as WsSubscribeMessage, b6 as WsSubscribedMessage, bt as buildClobAuthMessage, bL as buildClobPayload, bF as buildCtfExchangeDomain, bJ as buildOrderMessage, bv as buildPolymarketL2Headers, bK as buildSignedOrder, ai as createPredictClient, ak as createPredictWsClient, bw as derivePolymarketApiKey, bc as eventQueryKey, bd as fetchEvent, bh as fetchEventsPage, bl as fetchMarket, bq as fetchMatchMarketsPage, bo as fetchMatchesPage, bM as getPolymarketSharesPrecision, bu as hmacSha256Base64, bg as infiniteEventsQueryKey, bk as marketQueryKey, bp as matchMarketsQueryKey, bn as matchQueryKey, bm as matchesQueryKey, bf as resolveEventsParams, be as resolveTagSlug } from './server-h41hs9SR.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 OrderbookOutcome, h as Orderbook, i as ListMarketTradesParams, j as PredictTrade, k as PriceHistoryRange, l as PriceHistoryResponse, m as ListCandlesticksParams, C as Candlestick, n as ListCommentsParams, o as PredictComment, p as PositionsResponse, q as PositionValueResponse, A as AvailableSharesResponse, B as BalanceResponse, r as ListOrdersParams, s as PredictOrder, t as ListOrdersMultiParams, u as PredictOrdersResponse, v as CancelOrderResult, M as MatchesParams, w as MatchGroupPage, x as MatchGroup, y as MatchMarketParams, z as MatchMarketPage, D as ListTradesParams, F as ListTradesMultiParams, G as DFlowQuoteRequest, H as DFlowQuoteResponse, I as DFlowSubmitResponse, J as DFlowSubmitRequest, K as DFlowKYCStatus, N as PolymarketSetupStatus, Q as PolymarketDepositWalletDeployResponse, W as WithdrawBuildResponse, R as WithdrawBuildRequest, T as WithdrawSubmitResponse, U as WithdrawSubmitRequest, V as WithdrawStatusResponse, X as PolymarketDepositAddresses, Y as PolymarketSupportedAsset, Z as PolymarketWithdrawResponse, _ as PolymarketWithdrawRequest, $ as PolymarketWithdrawPrepareResponse, a0 as PolymarketWithdrawPrepareRequest, a1 as PolymarketWithdrawQuoteResponse, a2 as PolymarketWithdrawQuoteRequest, a3 as PolymarketWithdrawRelayBuildResponse, a4 as PolymarketWithdrawRelayBuildRequest, a5 as PolymarketWithdrawRelaySubmitResponse, a6 as PolymarketWithdrawRelaySubmitRequest, a7 as PolymarketWithdrawBridgeStatusResponse, a8 as PolymarketRedeemResponse, a9 as PolymarketTypedData, aa as TickSizeResponse, ab as FeeRateResponse, ac as RebateConfig, ad as WsConnectionStatus, ae as WsDataMessage, af as WsPriceEvent, ag as WsOrderbookEvent, ah as WsTradeEvent, ai as CreateOrderInput } from './server-Dk8PqvnI.js';
2
+ export { bE as BuildClobAuthMessageInput, bT as BuildOrderMessageInput, bv as CLOB_AUTH_DOMAIN, bw as CLOB_AUTH_TYPES, bF as CTF_EXCHANGE_ADDRESS, bK as CTF_ORDER_TYPES, bS as ClobOrderPayload, aI as DFlowOrderContext, aN as DepositBuildRequest, aO as DepositBuildResponse, aR as DepositStatusResponse, aP as DepositSubmitRequest, aQ as DepositSubmitResponse, az as EventSummary, bB as HttpMethod, as as MarketOutcome, ar as MarketResult, aq as MarketStatus, aA as MarketSummary, a$ as MatchConfidenceTier, aX as MatchGroupEntry, aY as MatchGroupMarket, b1 as MatchLeg, b2 as MatchMarketFlat, aZ as MatchSortField, aW as MatchStatus, a_ as MatchesStats, bG as NEG_RISK_CTF_EXCHANGE_ADDRESS, bL as ORDER_TYPE, bU as OrderMessage, aH as OrderSide, aG as OrderStatus, au as OrderbookBatchItem, av as OrderbookBatchResult, at as OrderbookLevel, aw as OrderbooksBatchRequest, ax as OrderbooksBatchResponse, bI as POLYGON_CHAIN_ID, aT as PolymarketBridgeToken, aM as PolymarketDepositWalletDeployRequest, bD as PolymarketL2Headers, bC as PolymarketL2HeadersInput, aJ as PolymarketOrderType, bf as PolymarketRedeemInput, bd as PolymarketRedeemPrepareInput, be as PolymarketRedeemPrepareResponse, aU as PolymarketSupportedAssetsResponse, aK as PolymarketTickSize, aV as PolymarketTypedDataArg, aL as PolymarketWalletKind, aE as PositionValue, aF as PositionValueError, ak as PredictClientOptions, aB as PredictCommentProfile, aD as PredictPosition, ao as PredictTag, am as PredictWsClientConfig, aC as PricePoint, an as ProviderMeta, bm as ResolveEventsParamsInput, bM as SIDE, ap as SettlementSource, b0 as SignalTag, bV as SignedOrder, bn as TagSlugSelection, ay as TradeType, bH as USDC_ADDRESS, aS as UnsignedTx, b3 as WsChannel, b4 as WsChannelEvent, b5 as WsClientMessage, bb as WsErrorCode, bc as WsErrorMessage, b7 as WsPingMessage, b9 as WsPongMessage, b8 as WsServerMessage, b6 as WsSubscribeMessage, ba as WsSubscribedMessage, bx as buildClobAuthMessage, bP as buildClobPayload, bJ as buildCtfExchangeDomain, bN as buildOrderMessage, bz as buildPolymarketL2Headers, bO as buildSignedOrder, aj as createPredictClient, al as createPredictWsClient, bA as derivePolymarketApiKey, bg as eventQueryKey, bh as fetchEvent, bl as fetchEventsPage, bp as fetchMarket, bu as fetchMatchMarketsPage, bs as fetchMatchesPage, bQ as getPolymarketSharesPrecision, by as hmacSha256Base64, bk as infiniteEventsQueryKey, bo as marketQueryKey, bt as matchMarketsQueryKey, br as matchQueryKey, bq as matchesQueryKey, bR as normalizePolymarketTickSize, bj as resolveEventsParams, bi as resolveTagSlug } from './server-Dk8PqvnI.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';
@@ -414,6 +414,29 @@ declare function usePositions(params: UsePositionsParams, queryOptions?: Omit<Us
414
414
  */
415
415
  declare function usePositionsMulti(params: UsePositionsMultiParams, queryOptions?: Omit<UseQueryOptions<PositionsResponse, Error, PositionsResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<PositionsResponse, Error>;
416
416
 
417
+ declare function positionValueQueryKey(user: string, source?: ProviderSource): unknown[];
418
+ declare function positionValueMultiQueryKey(wallets: {
419
+ kalshi_user?: string;
420
+ polymarket_user?: string;
421
+ }): unknown[];
422
+ /** Single-source params (backward-compatible). */
423
+ interface UsePositionValueParams {
424
+ /** Provider source. Omit to aggregate all providers (same address). */
425
+ source?: ProviderSource;
426
+ user: string;
427
+ }
428
+ /** Multi-wallet params — each provider gets its own address. */
429
+ interface UsePositionValueMultiParams {
430
+ kalshi_user?: string;
431
+ polymarket_user?: string;
432
+ }
433
+ declare function usePositionValue(params: UsePositionValueParams, queryOptions?: Omit<UseQueryOptions<PositionValueResponse, Error, PositionValueResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<PositionValueResponse, Error>;
434
+ /**
435
+ * Fetch current total position value for multiple wallets in a single request.
436
+ * Each provider is queried with its own address.
437
+ */
438
+ declare function usePositionValueMulti(params: UsePositionValueMultiParams, queryOptions?: Omit<UseQueryOptions<PositionValueResponse, Error, PositionValueResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<PositionValueResponse, Error>;
439
+
417
440
  interface UseAvailableSharesParams {
418
441
  source: ProviderSource;
419
442
  user: string;
@@ -1142,4 +1165,4 @@ interface WalkOrderbookParams {
1142
1165
  */
1143
1166
  declare function walkOrderbook({ orderbook, outcome, side, sharesNeeded, slippageBps, }: WalkOrderbookParams): WalkResult;
1144
1167
 
1145
- export { AvailableSharesResponse, BalanceResponse, type BuildV2OrderParams, CancelOrderResult, type CancelOrderVariables, Candlestick, ChartRange, type ChartRangeType, type ClobOrderV2Payload, 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, OrderbookOutcome, PolymarketContext, type PolymarketContextValue, type PolymarketCredentials, PolymarketDepositAddresses, type PolymarketDepositResult, type PolymarketDepositVariables, PolymarketDepositWalletDeployResponse, PolymarketProvider, type PolymarketProviderProps, PolymarketRedeemResponse, PolymarketSetupStatus, type PolymarketSigner, PolymarketSupportedAsset, PolymarketTypedData, PolymarketWithdrawBridgeStatusResponse, PolymarketWithdrawPrepareRequest, PolymarketWithdrawPrepareResponse, PolymarketWithdrawQuoteRequest, PolymarketWithdrawQuoteResponse, PolymarketWithdrawRelayBuildRequest, PolymarketWithdrawRelayBuildResponse, PolymarketWithdrawRelaySubmitRequest, PolymarketWithdrawRelaySubmitResponse, PolymarketWithdrawRequest, PolymarketWithdrawResponse, PositionsResponse, PredictClient, PredictComment, PredictContext, type PredictContextValue, PredictEvent, PredictMarket, PredictOrder, PredictOrdersResponse, PredictPage, PredictProvider, type PredictProviderProps, PredictTrade, PredictWsClient, PriceHistoryRange, PriceHistoryResponse, ProviderSource, RebateConfig, type RedeemPositionVariables, SimilarEventsParams, type StartTradeResultConfirmationInput, type SyncBalanceAllowanceParams, TickSizeResponse, type TradeResultConfirmationState, type TradeResultExpectation, 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, buildSignedV2OrderPayload, candlesticksQueryKey, dflowKYCQueryKey, dflowQuoteQueryKey, eventStatsQueryKey, eventsQueryKey, feeRateQueryKey, fetchEvents, infiniteCommentsQueryKey, infiniteOrdersQueryKey, infiniteTradesMultiQueryKey, infiniteTradesQueryKey, marketTradesQueryKey, orderQueryKey, orderbookQueryKey, ordersMultiQueryKey, ordersQueryKey, pickBestAsk, pickBestBid, polymarketDepositAddressesQueryKey, polymarketSetupQueryKey, polymarketSupportedAssetsQueryKey, polymarketWithdrawStatusQueryKey, positionsMultiQueryKey, positionsQueryKey, priceHistoryQueryKey, rebateConfigQueryKey, similarEventsQueryKey, tickSizeQueryKey, tradesQueryKey, updatePolymarketBalanceAllowance, useAvailableShares, useBalance, useCancelOrder, useCandlesticks, useCreatePolymarketOrder, useDFlowKYC, useDFlowQuote, useDFlowSubmit, useDeployPolymarketDepositWallet, 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, usePolymarketWithdrawPrepareMutation, usePolymarketWithdrawQuoteMutation, usePolymarketWithdrawRelayBuildMutation, usePolymarketWithdrawRelaySubmitMutation, usePolymarketWithdrawStatusQuery, usePositions, usePositionsMulti, usePredictClient, usePredictWsClient, usePriceHistory, usePricesSubscription, useRealtimeOrderbook, useRealtimePrices, useRealtimeTrades, useRebateConfig, useRedeemPosition, useRunPolymarketSetup, useSearchEvents, useSimilarEvents, useTickSize, useTradeResultConfirmation, useTrades, useTradesSubscription, useWithdrawBuildMutation, useWithdrawStatusQuery, useWithdrawSubmitMutation, walkOrderbook, withdrawStatusQueryKey };
1168
+ export { AvailableSharesResponse, BalanceResponse, type BuildV2OrderParams, CancelOrderResult, type CancelOrderVariables, Candlestick, ChartRange, type ChartRangeType, type ClobOrderV2Payload, 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, OrderbookOutcome, PolymarketContext, type PolymarketContextValue, type PolymarketCredentials, PolymarketDepositAddresses, type PolymarketDepositResult, type PolymarketDepositVariables, PolymarketDepositWalletDeployResponse, PolymarketProvider, type PolymarketProviderProps, PolymarketRedeemResponse, PolymarketSetupStatus, type PolymarketSigner, PolymarketSupportedAsset, PolymarketTypedData, PolymarketWithdrawBridgeStatusResponse, PolymarketWithdrawPrepareRequest, PolymarketWithdrawPrepareResponse, PolymarketWithdrawQuoteRequest, PolymarketWithdrawQuoteResponse, PolymarketWithdrawRelayBuildRequest, PolymarketWithdrawRelayBuildResponse, PolymarketWithdrawRelaySubmitRequest, PolymarketWithdrawRelaySubmitResponse, PolymarketWithdrawRequest, PolymarketWithdrawResponse, PositionValueResponse, PositionsResponse, PredictClient, PredictComment, PredictContext, type PredictContextValue, PredictEvent, PredictMarket, PredictOrder, PredictOrdersResponse, PredictPage, PredictProvider, type PredictProviderProps, PredictTrade, PredictWsClient, PriceHistoryRange, PriceHistoryResponse, ProviderSource, RebateConfig, type RedeemPositionVariables, SimilarEventsParams, type StartTradeResultConfirmationInput, type SyncBalanceAllowanceParams, TickSizeResponse, type TradeResultConfirmationState, type TradeResultExpectation, 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 UsePositionValueMultiParams, type UsePositionValueParams, 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, buildSignedV2OrderPayload, candlesticksQueryKey, dflowKYCQueryKey, dflowQuoteQueryKey, eventStatsQueryKey, eventsQueryKey, feeRateQueryKey, fetchEvents, infiniteCommentsQueryKey, infiniteOrdersQueryKey, infiniteTradesMultiQueryKey, infiniteTradesQueryKey, marketTradesQueryKey, orderQueryKey, orderbookQueryKey, ordersMultiQueryKey, ordersQueryKey, pickBestAsk, pickBestBid, polymarketDepositAddressesQueryKey, polymarketSetupQueryKey, polymarketSupportedAssetsQueryKey, polymarketWithdrawStatusQueryKey, positionValueMultiQueryKey, positionValueQueryKey, positionsMultiQueryKey, positionsQueryKey, priceHistoryQueryKey, rebateConfigQueryKey, similarEventsQueryKey, tickSizeQueryKey, tradesQueryKey, updatePolymarketBalanceAllowance, useAvailableShares, useBalance, useCancelOrder, useCandlesticks, useCreatePolymarketOrder, useDFlowKYC, useDFlowQuote, useDFlowSubmit, useDeployPolymarketDepositWallet, 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, usePolymarketWithdrawPrepareMutation, usePolymarketWithdrawQuoteMutation, usePolymarketWithdrawRelayBuildMutation, usePolymarketWithdrawRelaySubmitMutation, usePolymarketWithdrawStatusQuery, usePositionValue, usePositionValueMulti, usePositions, usePositionsMulti, usePredictClient, usePredictWsClient, usePriceHistory, usePricesSubscription, useRealtimeOrderbook, useRealtimePrices, useRealtimeTrades, useRebateConfig, useRedeemPosition, useRunPolymarketSetup, useSearchEvents, useSimilarEvents, useTickSize, useTradeResultConfirmation, useTrades, useTradesSubscription, useWithdrawBuildMutation, useWithdrawStatusQuery, useWithdrawSubmitMutation, walkOrderbook, withdrawStatusQueryKey };
package/dist/index.js CHANGED
@@ -176,6 +176,23 @@ var PredictClient = class {
176
176
  const url = `${this.endpoint}/api/v1/positions${query}`;
177
177
  return await utils.httpGet(url);
178
178
  }
179
+ /**
180
+ * Maps to `GET /api/v1/positions/value`.
181
+ *
182
+ * Single-source: `getPositionValue("addr", "polymarket")`.
183
+ * Multi-wallet: `getPositionValue({ kalshi_user: "SOLaddr", polymarket_user: "EVMaddr" })`.
184
+ * Legacy agg: `getPositionValue("addr")` (same address for all providers).
185
+ */
186
+ async getPositionValue(userOrWallets, source) {
187
+ let query;
188
+ if (typeof userOrWallets === "string") {
189
+ query = buildQuery({ source, user: userOrWallets });
190
+ } else {
191
+ query = buildQuery(userOrWallets);
192
+ }
193
+ const url = `${this.endpoint}/api/v1/positions/value${query}`;
194
+ return await utils.httpGet(url);
195
+ }
179
196
  // -------------------------------------------------------------------------
180
197
  // Available shares (for sell flow)
181
198
  // -------------------------------------------------------------------------
@@ -1468,6 +1485,41 @@ function usePositionsMulti(params, queryOptions = {}) {
1468
1485
  ...queryOptions
1469
1486
  });
1470
1487
  }
1488
+ function positionValueQueryKey(user, source) {
1489
+ return ["predict", "position-value", source ?? "all", user];
1490
+ }
1491
+ function positionValueMultiQueryKey(wallets) {
1492
+ return [
1493
+ "predict",
1494
+ "position-value",
1495
+ "multi",
1496
+ wallets.kalshi_user ?? "",
1497
+ wallets.polymarket_user ?? ""
1498
+ ];
1499
+ }
1500
+ function usePositionValue(params, queryOptions = {}) {
1501
+ const client = usePredictClient();
1502
+ return reactQuery.useQuery({
1503
+ queryKey: positionValueQueryKey(params.user, params.source),
1504
+ queryFn: () => client.getPositionValue(params.user, params.source),
1505
+ enabled: Boolean(params.user),
1506
+ staleTime: 1e4,
1507
+ refetchInterval: 3e4,
1508
+ ...queryOptions
1509
+ });
1510
+ }
1511
+ function usePositionValueMulti(params, queryOptions = {}) {
1512
+ const client = usePredictClient();
1513
+ const hasAnyWallet = Boolean(params.kalshi_user || params.polymarket_user);
1514
+ return reactQuery.useQuery({
1515
+ queryKey: positionValueMultiQueryKey(params),
1516
+ queryFn: () => client.getPositionValue(params),
1517
+ enabled: hasAnyWallet,
1518
+ staleTime: 1e4,
1519
+ refetchInterval: 3e4,
1520
+ ...queryOptions
1521
+ });
1522
+ }
1471
1523
  function availableSharesQueryKey(params) {
1472
1524
  return [
1473
1525
  "predict",
@@ -1603,7 +1655,8 @@ var SLOW_AFTER_MS = 12e3;
1603
1655
  var QUERY_PREFIXES = [
1604
1656
  ["predict", "trades"],
1605
1657
  ["predict", "trades-by-wallet"],
1606
- ["predict", "available-shares"]
1658
+ ["predict", "available-shares"],
1659
+ ["predict", "position-value"]
1607
1660
  ];
1608
1661
  var OPEN_ORDER_STATUSES = /* @__PURE__ */ new Set(["live", "open", "submitted", "pending"]);
1609
1662
  function getPositionsWallets(input) {
@@ -1886,6 +1939,29 @@ function requestPositionsSnapshot(queryClient, predictClient, input) {
1886
1939
  return normalizePositionsData(data, input);
1887
1940
  });
1888
1941
  }
1942
+ function refreshPositionValueSnapshot(queryClient, predictClient, input) {
1943
+ const wallets = getPositionsWallets(input);
1944
+ const tasks = [];
1945
+ if (wallets) {
1946
+ tasks.push(
1947
+ predictClient.getPositionValue(wallets).then((data) => {
1948
+ queryClient.setQueryData(positionValueMultiQueryKey(wallets), data);
1949
+ })
1950
+ );
1951
+ }
1952
+ if (input.user) {
1953
+ tasks.push(
1954
+ predictClient.getPositionValue(input.user, input.source).then((data) => {
1955
+ queryClient.setQueryData(
1956
+ positionValueQueryKey(input.user, input.source),
1957
+ data
1958
+ );
1959
+ })
1960
+ );
1961
+ }
1962
+ if (tasks.length === 0) return Promise.resolve();
1963
+ return Promise.all(tasks).then(() => void 0);
1964
+ }
1889
1965
  function requestOrdersSnapshot(queryClient, predictClient, input) {
1890
1966
  if (!input.user) return Promise.resolve(void 0);
1891
1967
  const params = { source: input.source, wallet_address: input.user };
@@ -1976,7 +2052,11 @@ async function runFixedIntervalConfirmation({
1976
2052
  const pollField = (field, request) => {
1977
2053
  if (inFlight[field] || settled) return;
1978
2054
  inFlight[field] = true;
1979
- void request().then((value) => handleSnapshot(field, value)).catch(() => void 0).finally(() => {
2055
+ void request().then((value) => handleSnapshot(field, value)).then(() => {
2056
+ if (field === "positions") {
2057
+ void refreshPositionValueSnapshot(queryClient, predictClient, input);
2058
+ }
2059
+ }).catch(() => void 0).finally(() => {
1980
2060
  inFlight[field] = false;
1981
2061
  });
1982
2062
  };
@@ -2806,10 +2886,20 @@ var SIDE = { BUY: 0, SELL: 1 };
2806
2886
  var ROUNDING_CONFIG = {
2807
2887
  "0.1": { size: 2, price: 1, amount: 3 },
2808
2888
  "0.01": { size: 2, price: 2, amount: 4 },
2889
+ "0.005": { size: 2, price: 3, amount: 5 },
2890
+ "0.0025": { size: 2, price: 4, amount: 6 },
2809
2891
  "0.001": { size: 2, price: 3, amount: 5 },
2810
2892
  "0.0001": { size: 2, price: 4, amount: 6 }
2811
2893
  };
2812
2894
  var DEFAULT_ROUNDING = { size: 2, price: 2, amount: 4 };
2895
+ function normalizePolymarketTickSize(raw) {
2896
+ const value = typeof raw === "string" ? parseFloat(raw) : raw;
2897
+ if (value == null || !Number.isFinite(value) || value <= 0) return "0.01";
2898
+ for (const tick of Object.keys(ROUNDING_CONFIG)) {
2899
+ if (Math.abs(parseFloat(tick) - value) < 1e-9) return tick;
2900
+ }
2901
+ return "0.01";
2902
+ }
2813
2903
  function decimalPlaces(n, d) {
2814
2904
  return parseFloat(n.toFixed(d));
2815
2905
  }
@@ -3249,6 +3339,7 @@ exports.marketTradesQueryKey = marketTradesQueryKey;
3249
3339
  exports.matchMarketsQueryKey = matchMarketsQueryKey;
3250
3340
  exports.matchQueryKey = matchQueryKey;
3251
3341
  exports.matchesQueryKey = matchesQueryKey;
3342
+ exports.normalizePolymarketTickSize = normalizePolymarketTickSize;
3252
3343
  exports.orderQueryKey = orderQueryKey;
3253
3344
  exports.orderbookQueryKey = orderbookQueryKey;
3254
3345
  exports.ordersMultiQueryKey = ordersMultiQueryKey;
@@ -3259,6 +3350,8 @@ exports.polymarketDepositAddressesQueryKey = polymarketDepositAddressesQueryKey;
3259
3350
  exports.polymarketSetupQueryKey = polymarketSetupQueryKey;
3260
3351
  exports.polymarketSupportedAssetsQueryKey = polymarketSupportedAssetsQueryKey;
3261
3352
  exports.polymarketWithdrawStatusQueryKey = polymarketWithdrawStatusQueryKey;
3353
+ exports.positionValueMultiQueryKey = positionValueMultiQueryKey;
3354
+ exports.positionValueQueryKey = positionValueQueryKey;
3262
3355
  exports.positionsMultiQueryKey = positionsMultiQueryKey;
3263
3356
  exports.positionsQueryKey = positionsQueryKey;
3264
3357
  exports.priceHistoryQueryKey = priceHistoryQueryKey;
@@ -3309,6 +3402,8 @@ exports.usePolymarketWithdrawQuoteMutation = usePolymarketWithdrawQuoteMutation;
3309
3402
  exports.usePolymarketWithdrawRelayBuildMutation = usePolymarketWithdrawRelayBuildMutation;
3310
3403
  exports.usePolymarketWithdrawRelaySubmitMutation = usePolymarketWithdrawRelaySubmitMutation;
3311
3404
  exports.usePolymarketWithdrawStatusQuery = usePolymarketWithdrawStatusQuery;
3405
+ exports.usePositionValue = usePositionValue;
3406
+ exports.usePositionValueMulti = usePositionValueMulti;
3312
3407
  exports.usePositions = usePositions;
3313
3408
  exports.usePositionsMulti = usePositionsMulti;
3314
3409
  exports.usePredictClient = usePredictClient;