@liberfi.io/react-predict 0.1.63 → 0.1.65
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 +12 -3
- package/dist/index.d.ts +12 -3
- package/dist/index.js +28 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +26 -4
- package/dist/index.mjs.map +1 -1
- package/dist/{server-exUYV2o0.d.mts → server-DsjYCQiB.d.mts} +20 -3
- package/dist/{server-exUYV2o0.d.ts → server-DsjYCQiB.d.ts} +20 -3
- package/dist/server.d.mts +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.js +8 -3
- package/dist/server.js.map +1 -1
- package/dist/server.mjs +8 -3
- 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 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
|
|
2
|
-
export {
|
|
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 FeeRateResponse, X as WsConnectionStatus, Y as WsDataMessage, Z as WsPriceEvent, _ as WsOrderbookEvent, $ as WsTradeEvent, a0 as CreateOrderInput } from './server-DsjYCQiB.mjs';
|
|
2
|
+
export { b5 as BuildClobAuthMessageInput, bj as BuildOrderMessageInput, aY as CLOB_AUTH_DOMAIN, aZ as CLOB_AUTH_TYPES, b6 as CTF_EXCHANGE_ADDRESS, bb as CTF_ORDER_TYPES, bi as ClobOrderPayload, ai as DFlowOrderContext, ak as DepositBuildRequest, al as DepositBuildResponse, ao as DepositStatusResponse, am as DepositSubmitRequest, an as DepositSubmitResponse, ac as EventSummary, b2 as HttpMethod, a9 as MarketOutcome, a8 as MarketResult, a7 as MarketStatus, ad as MarketSummary, ax as MatchConfidenceTier, at as MatchGroupEntry, au as MatchGroupMarket, ay as MatchMarketFlat, av as MatchSortField, as as MatchStatus, aw as MatchesStats, b7 as NEG_RISK_CTF_EXCHANGE_ADDRESS, bc as ORDER_TYPE, bk as OrderMessage, ah as OrderSide, ag as OrderStatus, aa as OrderbookLevel, b9 as POLYGON_CHAIN_ID, b4 as PolymarketL2Headers, b3 as PolymarketL2HeadersInput, aj as PolymarketOrderType, aq as PolymarketWithdrawPrepareRequest, ar as PolymarketWithdrawPrepareResponse, af as PredictPosition, a5 as PredictTag, a3 as PredictWsClientConfig, ae as PricePoint, a4 as ProviderMeta, aP as ResolveEventsParamsInput, bd as SIDE, a6 as SettlementSource, bl as SignedOrder, aQ as TagSlugSelection, ab as TradeType, b8 as USDC_ADDRESS, ap as UnsignedTx, az as WsChannel, aA as WsChannelEvent, aB as WsClientMessage, aH as WsErrorCode, aI as WsErrorMessage, aD as WsPingMessage, aF as WsPongMessage, aE as WsServerMessage, aC as WsSubscribeMessage, aG as WsSubscribedMessage, a_ as buildClobAuthMessage, bg as buildClobPayload, ba as buildCtfExchangeDomain, be as buildOrderMessage, b0 as buildPolymarketL2Headers, bf as buildSignedOrder, a1 as createPredictClient, a2 as createPredictWsClient, b1 as derivePolymarketApiKey, aJ as eventQueryKey, aK as fetchEvent, aO as fetchEventsPage, aS as fetchMarket, aX as fetchMatchMarketsPage, aV as fetchMatchesPage, bh as getPolymarketSharesPrecision, a$ as hmacSha256Base64, aN as infiniteEventsQueryKey, aR as marketQueryKey, aW as matchMarketsQueryKey, aU as matchQueryKey, aT as matchesQueryKey, aM as resolveEventsParams, aL as resolveTagSlug } from './server-DsjYCQiB.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';
|
|
@@ -623,6 +623,15 @@ declare function tickSizeQueryKey(tokenId: string): unknown[];
|
|
|
623
623
|
*/
|
|
624
624
|
declare function useTickSize(tokenId?: string, queryOptions?: Omit<UseQueryOptions<TickSizeResponse, Error, TickSizeResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<TickSizeResponse, Error>;
|
|
625
625
|
|
|
626
|
+
declare function feeRateQueryKey(tokenId: string): unknown[];
|
|
627
|
+
/**
|
|
628
|
+
* Query hook that fetches the base fee rate (bps) for a Polymarket token.
|
|
629
|
+
*
|
|
630
|
+
* @param tokenId - Polymarket CLOB token ID (asset ID).
|
|
631
|
+
* @param queryOptions - React Query options (pass `enabled` to control when the query runs).
|
|
632
|
+
*/
|
|
633
|
+
declare function useFeeRate(tokenId?: string, queryOptions?: Omit<UseQueryOptions<FeeRateResponse, Error, FeeRateResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<FeeRateResponse, Error>;
|
|
634
|
+
|
|
626
635
|
interface UsePredictWsClientResult {
|
|
627
636
|
/** The WebSocket client instance, or `null` if not provided via `PredictProvider`. */
|
|
628
637
|
wsClient: PredictWsClient | null;
|
|
@@ -856,4 +865,4 @@ interface CreatePolymarketOrderVariables {
|
|
|
856
865
|
*/
|
|
857
866
|
declare function useCreatePolymarketOrder(mutationOptions?: Omit<UseMutationOptions<PredictOrder, Error, CreatePolymarketOrderVariables>, "mutationFn">): _tanstack_react_query.UseMutationResult<PredictOrder, Error, CreatePolymarketOrderVariables, unknown>;
|
|
858
867
|
|
|
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 };
|
|
868
|
+
export { AvailableSharesResponse, BalanceResponse, CancelOrderResult, type CancelOrderVariables, Candlestick, ChartRange, type ChartRangeType, CreateOrderInput, type CreatePolymarketOrderVariables, DFlowKYCStatus, DFlowQuoteRequest, DFlowQuoteResponse, DFlowSubmitRequest, DFlowSubmitResponse, EventSortField, EventStats, EventStatus, FeeRateResponse, ListCandlesticksParams, ListEventsParams, ListMarketTradesParams, ListOrdersMultiParams, ListOrdersParams, ListTradesMultiParams, ListTradesParams, type MarketHistoryPoint, type MarketHistorySeries, MatchGroup, MatchGroupPage, MatchMarketPage, MatchMarketParams, MatchesParams, Orderbook, PolymarketContext, type PolymarketContextValue, type PolymarketCredentials, PolymarketDepositAddresses, type PolymarketDepositResult, type PolymarketDepositVariables, PolymarketProvider, type PolymarketProviderProps, 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, feeRateQueryKey, 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, useFeeRate, 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, 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
|
|
2
|
-
export {
|
|
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 FeeRateResponse, X as WsConnectionStatus, Y as WsDataMessage, Z as WsPriceEvent, _ as WsOrderbookEvent, $ as WsTradeEvent, a0 as CreateOrderInput } from './server-DsjYCQiB.js';
|
|
2
|
+
export { b5 as BuildClobAuthMessageInput, bj as BuildOrderMessageInput, aY as CLOB_AUTH_DOMAIN, aZ as CLOB_AUTH_TYPES, b6 as CTF_EXCHANGE_ADDRESS, bb as CTF_ORDER_TYPES, bi as ClobOrderPayload, ai as DFlowOrderContext, ak as DepositBuildRequest, al as DepositBuildResponse, ao as DepositStatusResponse, am as DepositSubmitRequest, an as DepositSubmitResponse, ac as EventSummary, b2 as HttpMethod, a9 as MarketOutcome, a8 as MarketResult, a7 as MarketStatus, ad as MarketSummary, ax as MatchConfidenceTier, at as MatchGroupEntry, au as MatchGroupMarket, ay as MatchMarketFlat, av as MatchSortField, as as MatchStatus, aw as MatchesStats, b7 as NEG_RISK_CTF_EXCHANGE_ADDRESS, bc as ORDER_TYPE, bk as OrderMessage, ah as OrderSide, ag as OrderStatus, aa as OrderbookLevel, b9 as POLYGON_CHAIN_ID, b4 as PolymarketL2Headers, b3 as PolymarketL2HeadersInput, aj as PolymarketOrderType, aq as PolymarketWithdrawPrepareRequest, ar as PolymarketWithdrawPrepareResponse, af as PredictPosition, a5 as PredictTag, a3 as PredictWsClientConfig, ae as PricePoint, a4 as ProviderMeta, aP as ResolveEventsParamsInput, bd as SIDE, a6 as SettlementSource, bl as SignedOrder, aQ as TagSlugSelection, ab as TradeType, b8 as USDC_ADDRESS, ap as UnsignedTx, az as WsChannel, aA as WsChannelEvent, aB as WsClientMessage, aH as WsErrorCode, aI as WsErrorMessage, aD as WsPingMessage, aF as WsPongMessage, aE as WsServerMessage, aC as WsSubscribeMessage, aG as WsSubscribedMessage, a_ as buildClobAuthMessage, bg as buildClobPayload, ba as buildCtfExchangeDomain, be as buildOrderMessage, b0 as buildPolymarketL2Headers, bf as buildSignedOrder, a1 as createPredictClient, a2 as createPredictWsClient, b1 as derivePolymarketApiKey, aJ as eventQueryKey, aK as fetchEvent, aO as fetchEventsPage, aS as fetchMarket, aX as fetchMatchMarketsPage, aV as fetchMatchesPage, bh as getPolymarketSharesPrecision, a$ as hmacSha256Base64, aN as infiniteEventsQueryKey, aR as marketQueryKey, aW as matchMarketsQueryKey, aU as matchQueryKey, aT as matchesQueryKey, aM as resolveEventsParams, aL as resolveTagSlug } from './server-DsjYCQiB.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';
|
|
@@ -623,6 +623,15 @@ declare function tickSizeQueryKey(tokenId: string): unknown[];
|
|
|
623
623
|
*/
|
|
624
624
|
declare function useTickSize(tokenId?: string, queryOptions?: Omit<UseQueryOptions<TickSizeResponse, Error, TickSizeResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<TickSizeResponse, Error>;
|
|
625
625
|
|
|
626
|
+
declare function feeRateQueryKey(tokenId: string): unknown[];
|
|
627
|
+
/**
|
|
628
|
+
* Query hook that fetches the base fee rate (bps) for a Polymarket token.
|
|
629
|
+
*
|
|
630
|
+
* @param tokenId - Polymarket CLOB token ID (asset ID).
|
|
631
|
+
* @param queryOptions - React Query options (pass `enabled` to control when the query runs).
|
|
632
|
+
*/
|
|
633
|
+
declare function useFeeRate(tokenId?: string, queryOptions?: Omit<UseQueryOptions<FeeRateResponse, Error, FeeRateResponse, unknown[]>, "queryKey" | "queryFn">): _tanstack_react_query.UseQueryResult<FeeRateResponse, Error>;
|
|
634
|
+
|
|
626
635
|
interface UsePredictWsClientResult {
|
|
627
636
|
/** The WebSocket client instance, or `null` if not provided via `PredictProvider`. */
|
|
628
637
|
wsClient: PredictWsClient | null;
|
|
@@ -856,4 +865,4 @@ interface CreatePolymarketOrderVariables {
|
|
|
856
865
|
*/
|
|
857
866
|
declare function useCreatePolymarketOrder(mutationOptions?: Omit<UseMutationOptions<PredictOrder, Error, CreatePolymarketOrderVariables>, "mutationFn">): _tanstack_react_query.UseMutationResult<PredictOrder, Error, CreatePolymarketOrderVariables, unknown>;
|
|
858
867
|
|
|
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 };
|
|
868
|
+
export { AvailableSharesResponse, BalanceResponse, CancelOrderResult, type CancelOrderVariables, Candlestick, ChartRange, type ChartRangeType, CreateOrderInput, type CreatePolymarketOrderVariables, DFlowKYCStatus, DFlowQuoteRequest, DFlowQuoteResponse, DFlowSubmitRequest, DFlowSubmitResponse, EventSortField, EventStats, EventStatus, FeeRateResponse, ListCandlesticksParams, ListEventsParams, ListMarketTradesParams, ListOrdersMultiParams, ListOrdersParams, ListTradesMultiParams, ListTradesParams, type MarketHistoryPoint, type MarketHistorySeries, MatchGroup, MatchGroupPage, MatchMarketPage, MatchMarketParams, MatchesParams, Orderbook, PolymarketContext, type PolymarketContextValue, type PolymarketCredentials, PolymarketDepositAddresses, type PolymarketDepositResult, type PolymarketDepositVariables, PolymarketProvider, type PolymarketProviderProps, 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, feeRateQueryKey, 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, useFeeRate, 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
|
@@ -257,6 +257,11 @@ var PredictClient = class {
|
|
|
257
257
|
const url = `${this.endpoint}/api/v1/polymarket/tick-size?token_id=${encodeURIComponent(tokenId)}`;
|
|
258
258
|
return await utils.httpGet(url);
|
|
259
259
|
}
|
|
260
|
+
/** Maps to `GET /api/v1/polymarket/fee-rate?token_id=xxx`. */
|
|
261
|
+
async getPolymarketFeeRate(tokenId) {
|
|
262
|
+
const url = `${this.endpoint}/api/v1/polymarket/fee-rate?token_id=${encodeURIComponent(tokenId)}`;
|
|
263
|
+
return await utils.httpGet(url);
|
|
264
|
+
}
|
|
260
265
|
// -------------------------------------------------------------------------
|
|
261
266
|
// DFlow trading
|
|
262
267
|
// -------------------------------------------------------------------------
|
|
@@ -1722,6 +1727,19 @@ function useTickSize(tokenId, queryOptions = {}) {
|
|
|
1722
1727
|
...queryOptions
|
|
1723
1728
|
});
|
|
1724
1729
|
}
|
|
1730
|
+
function feeRateQueryKey(tokenId) {
|
|
1731
|
+
return ["predict", "polymarket", "fee-rate", tokenId];
|
|
1732
|
+
}
|
|
1733
|
+
function useFeeRate(tokenId, queryOptions = {}) {
|
|
1734
|
+
const client = usePredictClient();
|
|
1735
|
+
return reactQuery.useQuery({
|
|
1736
|
+
queryKey: feeRateQueryKey(tokenId ?? ""),
|
|
1737
|
+
queryFn: () => client.getPolymarketFeeRate(tokenId),
|
|
1738
|
+
enabled: !!tokenId,
|
|
1739
|
+
staleTime: 5 * 6e4,
|
|
1740
|
+
...queryOptions
|
|
1741
|
+
});
|
|
1742
|
+
}
|
|
1725
1743
|
function usePredictWsClient() {
|
|
1726
1744
|
const context = react.useContext(PredictContext);
|
|
1727
1745
|
if (!context) {
|
|
@@ -2006,8 +2024,8 @@ var SIDE = { BUY: 0, SELL: 1 };
|
|
|
2006
2024
|
var ROUNDING_CONFIG = {
|
|
2007
2025
|
"0.1": { size: 2, price: 1, amount: 3 },
|
|
2008
2026
|
"0.01": { size: 2, price: 2, amount: 4 },
|
|
2009
|
-
"0.001": { size:
|
|
2010
|
-
"0.0001": { size:
|
|
2027
|
+
"0.001": { size: 2, price: 3, amount: 5 },
|
|
2028
|
+
"0.0001": { size: 2, price: 4, amount: 6 }
|
|
2011
2029
|
};
|
|
2012
2030
|
var DEFAULT_ROUNDING = { size: 2, price: 2, amount: 4 };
|
|
2013
2031
|
function decimalPlaces(n, d) {
|
|
@@ -2089,7 +2107,7 @@ function buildOrderMessage(input) {
|
|
|
2089
2107
|
takerAmount,
|
|
2090
2108
|
expiration: String(input.expiration ?? 0),
|
|
2091
2109
|
nonce: "0",
|
|
2092
|
-
feeRateBps: "0",
|
|
2110
|
+
feeRateBps: input.feeRateBps ?? "0",
|
|
2093
2111
|
side,
|
|
2094
2112
|
signatureType: input.signatureType
|
|
2095
2113
|
};
|
|
@@ -2114,6 +2132,10 @@ function buildClobPayload(signedOrder, owner) {
|
|
|
2114
2132
|
deferExec: false
|
|
2115
2133
|
};
|
|
2116
2134
|
}
|
|
2135
|
+
function getPolymarketSharesPrecision(tickSize) {
|
|
2136
|
+
const rc = ROUNDING_CONFIG[tickSize] ?? DEFAULT_ROUNDING;
|
|
2137
|
+
return rc.size;
|
|
2138
|
+
}
|
|
2117
2139
|
|
|
2118
2140
|
// src/hooks/polymarket/useCreatePolymarketOrder.ts
|
|
2119
2141
|
var TX_POLL_INTERVAL2 = 3e3;
|
|
@@ -2244,12 +2266,14 @@ exports.dflowQuoteQueryKey = dflowQuoteQueryKey;
|
|
|
2244
2266
|
exports.eventQueryKey = eventQueryKey;
|
|
2245
2267
|
exports.eventStatsQueryKey = eventStatsQueryKey;
|
|
2246
2268
|
exports.eventsQueryKey = eventsQueryKey;
|
|
2269
|
+
exports.feeRateQueryKey = feeRateQueryKey;
|
|
2247
2270
|
exports.fetchEvent = fetchEvent;
|
|
2248
2271
|
exports.fetchEvents = fetchEvents;
|
|
2249
2272
|
exports.fetchEventsPage = fetchEventsPage;
|
|
2250
2273
|
exports.fetchMarket = fetchMarket;
|
|
2251
2274
|
exports.fetchMatchMarketsPage = fetchMatchMarketsPage;
|
|
2252
2275
|
exports.fetchMatchesPage = fetchMatchesPage;
|
|
2276
|
+
exports.getPolymarketSharesPrecision = getPolymarketSharesPrecision;
|
|
2253
2277
|
exports.hmacSha256Base64 = hmacSha256Base64;
|
|
2254
2278
|
exports.infiniteEventsQueryKey = infiniteEventsQueryKey;
|
|
2255
2279
|
exports.infiniteOrdersQueryKey = infiniteOrdersQueryKey;
|
|
@@ -2285,6 +2309,7 @@ exports.useDFlowSubmit = useDFlowSubmit;
|
|
|
2285
2309
|
exports.useEvent = useEvent;
|
|
2286
2310
|
exports.useEventStats = useEventStats;
|
|
2287
2311
|
exports.useEvents = useEvents;
|
|
2312
|
+
exports.useFeeRate = useFeeRate;
|
|
2288
2313
|
exports.useInfiniteEvents = useInfiniteEvents;
|
|
2289
2314
|
exports.useInfiniteMatchMarkets = useInfiniteMatchMarkets;
|
|
2290
2315
|
exports.useInfiniteMatches = useInfiniteMatches;
|