@liberfi.io/react-predict 0.3.39 → 0.3.41
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/README.md +1 -1
- package/dist/index.d.mts +16 -5
- package/dist/index.d.ts +16 -5
- package/dist/index.js +93 -38
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +88 -39
- package/dist/index.mjs.map +1 -1
- package/dist/{server-Da_gQzNk.d.mts → server-BYvRRFCr.d.mts} +109 -15
- package/dist/{server-Da_gQzNk.d.ts → server-BYvRRFCr.d.ts} +109 -15
- package/dist/server.d.mts +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.js +28 -14
- package/dist/server.js.map +1 -1
- package/dist/server.mjs +28 -14
- package/dist/server.mjs.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -96,7 +96,7 @@ Key methods:
|
|
|
96
96
|
| `listOrders(params)` | `GET /api/v1/orders` |
|
|
97
97
|
| `getOrder(id, source)` | `GET /api/v1/orders/:id` |
|
|
98
98
|
| `cancelOrder(id, source)` | `DELETE /api/v1/orders/:id` |
|
|
99
|
-
| `
|
|
99
|
+
| `executePolymarketOrder(req)` | `POST /api/v1/orders/polymarket/execute` |
|
|
100
100
|
| `createDFlowQuote(body)` | `POST /api/v1/orders/dflow/quote` |
|
|
101
101
|
| `submitDFlowTransaction(body)` | `POST /api/v1/orders/dflow/submit` |
|
|
102
102
|
| `listTrades(params)` | `GET /api/v1/trades` |
|
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
|
|
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 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 TickSizeResponse, a9 as FeeRateResponse, aa as RebateConfig, ab as WsConnectionStatus, ac as WsDataMessage, ad as WsPriceEvent, ae as WsOrderbookEvent, af as WsTradeEvent, ag as CreateOrderInput } from './server-BYvRRFCr.mjs';
|
|
2
|
+
export { bv as BuildClobAuthMessageInput, bJ as BuildOrderMessageInput, bm as CLOB_AUTH_DOMAIN, bn as CLOB_AUTH_TYPES, bw as CTF_EXCHANGE_ADDRESS, bB as CTF_ORDER_TYPES, bI as ClobOrderPayload, az as DFlowOrderContext, aD as DepositBuildRequest, aE as DepositBuildResponse, aH as DepositStatusResponse, aF as DepositSubmitRequest, aG as DepositSubmitResponse, as as EventSummary, bs as HttpMethod, ap as MarketOutcome, ao as MarketResult, an as MarketStatus, at as MarketSummary, aS as MatchConfidenceTier, aO as MatchGroupEntry, aP as MatchGroupMarket, aU as MatchLeg, aV as MatchMarketFlat, aQ as MatchSortField, aN as MatchStatus, aR as MatchesStats, bx as NEG_RISK_CTF_EXCHANGE_ADDRESS, bC as ORDER_TYPE, bK as OrderMessage, ay as OrderSide, ax as OrderStatus, aq as OrderbookLevel, bz as POLYGON_CHAIN_ID, aJ as PolymarketBridgeToken, aC as PolymarketDepositWalletDeployRequest, bu as PolymarketL2Headers, bt as PolymarketL2HeadersInput, aA as PolymarketOrderType, b6 as PolymarketRedeemInput, b4 as PolymarketRedeemPrepareInput, b5 as PolymarketRedeemPrepareResponse, aK as PolymarketSupportedAssetsResponse, aL as PolymarketTypedData, aM as PolymarketTypedDataArg, aB as PolymarketWalletKind, au as PredictCommentProfile, aw as PredictPosition, al as PredictTag, aj as PredictWsClientConfig, av as PricePoint, ak as ProviderMeta, bd as ResolveEventsParamsInput, bD as SIDE, am as SettlementSource, aT as SignalTag, bL as SignedOrder, be as TagSlugSelection, ar as TradeType, by as USDC_ADDRESS, aI as UnsignedTx, aW as WsChannel, aX as WsChannelEvent, aY as WsClientMessage, b2 as WsErrorCode, b3 as WsErrorMessage, a_ as WsPingMessage, b0 as WsPongMessage, a$ as WsServerMessage, aZ as WsSubscribeMessage, b1 as WsSubscribedMessage, bo as buildClobAuthMessage, bG as buildClobPayload, bA as buildCtfExchangeDomain, bE as buildOrderMessage, bq as buildPolymarketL2Headers, bF as buildSignedOrder, ah as createPredictClient, ai as createPredictWsClient, br as derivePolymarketApiKey, b7 as eventQueryKey, b8 as fetchEvent, bc as fetchEventsPage, bg as fetchMarket, bl as fetchMatchMarketsPage, bj as fetchMatchesPage, bH as getPolymarketSharesPrecision, bp as hmacSha256Base64, bb as infiniteEventsQueryKey, bf as marketQueryKey, bk as matchMarketsQueryKey, bi as matchQueryKey, bh as matchesQueryKey, ba as resolveEventsParams, b9 as resolveTagSlug } from './server-BYvRRFCr.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';
|
|
@@ -663,6 +663,16 @@ declare function usePolymarketSupportedAssets(): _tanstack_react_query.UseQueryR
|
|
|
663
663
|
*/
|
|
664
664
|
declare function usePolymarketWithdraw(): _tanstack_react_query.UseMutationResult<PolymarketWithdrawResponse, Error, PolymarketWithdrawRequest, unknown>;
|
|
665
665
|
|
|
666
|
+
declare function usePolymarketWithdrawQuoteMutation(): _tanstack_react_query.UseMutationResult<PolymarketWithdrawQuoteResponse, Error, PolymarketWithdrawQuoteRequest, unknown>;
|
|
667
|
+
declare function usePolymarketWithdrawPrepareMutation(): _tanstack_react_query.UseMutationResult<PolymarketWithdrawPrepareResponse, Error, PolymarketWithdrawPrepareRequest, unknown>;
|
|
668
|
+
declare function usePolymarketWithdrawRelayBuildMutation(): _tanstack_react_query.UseMutationResult<PolymarketWithdrawRelayBuildResponse, Error, PolymarketWithdrawRelayBuildRequest, unknown>;
|
|
669
|
+
declare function usePolymarketWithdrawRelaySubmitMutation(): _tanstack_react_query.UseMutationResult<PolymarketWithdrawRelaySubmitResponse, Error, PolymarketWithdrawRelaySubmitRequest, unknown>;
|
|
670
|
+
declare const polymarketWithdrawStatusQueryKey: (bridgeAddress?: string, transactionId?: string) => readonly ["polymarket", "withdraw-status", string, string];
|
|
671
|
+
declare function usePolymarketWithdrawStatusQuery(params: {
|
|
672
|
+
bridge_address?: string;
|
|
673
|
+
transaction_id?: string;
|
|
674
|
+
}): _tanstack_react_query.UseQueryResult<PolymarketWithdrawBridgeStatusResponse, Error>;
|
|
675
|
+
|
|
666
676
|
interface RedeemPositionVariables {
|
|
667
677
|
wallet_address: string;
|
|
668
678
|
condition_id: string;
|
|
@@ -938,8 +948,9 @@ interface CreatePolymarketOrderVariables {
|
|
|
938
948
|
* - If shortfall > 0, signs and submits approve + swap transactions.
|
|
939
949
|
* - Polls until the swap is confirmed on-chain.
|
|
940
950
|
* 3. Builds the EIP-712 `Order` typed data and prompts the wallet for a signature.
|
|
941
|
-
* 4.
|
|
942
|
-
*
|
|
951
|
+
* 4. Submits the signed order and L2 credentials via
|
|
952
|
+
* `POST /api/v1/orders/polymarket/execute`.
|
|
953
|
+
* 5. The server forwards the raw CLOB payload and records rebate identity maps.
|
|
943
954
|
* 6. Invalidates `orders` and `positions` queries on success.
|
|
944
955
|
*
|
|
945
956
|
* @example
|
|
@@ -1090,4 +1101,4 @@ interface WalkOrderbookParams {
|
|
|
1090
1101
|
*/
|
|
1091
1102
|
declare function walkOrderbook({ orderbook, outcome, side, sharesNeeded, slippageBps, }: WalkOrderbookParams): WalkResult;
|
|
1092
1103
|
|
|
1093
|
-
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, 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 SyncBalanceAllowanceParams, TickSizeResponse, 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, 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, usePositions, usePositionsMulti, usePredictClient, usePredictWsClient, usePriceHistory, usePricesSubscription, useRealtimeOrderbook, useRealtimePrices, useRealtimeTrades, useRebateConfig, useRedeemPosition, useRunPolymarketSetup, useSearchEvents, useSimilarEvents, useTickSize, useTrades, useTradesSubscription, useWithdrawBuildMutation, useWithdrawStatusQuery, useWithdrawSubmitMutation, walkOrderbook, withdrawStatusQueryKey };
|
|
1104
|
+
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, 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 SyncBalanceAllowanceParams, TickSizeResponse, 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, 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
|
|
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 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 TickSizeResponse, a9 as FeeRateResponse, aa as RebateConfig, ab as WsConnectionStatus, ac as WsDataMessage, ad as WsPriceEvent, ae as WsOrderbookEvent, af as WsTradeEvent, ag as CreateOrderInput } from './server-BYvRRFCr.js';
|
|
2
|
+
export { bv as BuildClobAuthMessageInput, bJ as BuildOrderMessageInput, bm as CLOB_AUTH_DOMAIN, bn as CLOB_AUTH_TYPES, bw as CTF_EXCHANGE_ADDRESS, bB as CTF_ORDER_TYPES, bI as ClobOrderPayload, az as DFlowOrderContext, aD as DepositBuildRequest, aE as DepositBuildResponse, aH as DepositStatusResponse, aF as DepositSubmitRequest, aG as DepositSubmitResponse, as as EventSummary, bs as HttpMethod, ap as MarketOutcome, ao as MarketResult, an as MarketStatus, at as MarketSummary, aS as MatchConfidenceTier, aO as MatchGroupEntry, aP as MatchGroupMarket, aU as MatchLeg, aV as MatchMarketFlat, aQ as MatchSortField, aN as MatchStatus, aR as MatchesStats, bx as NEG_RISK_CTF_EXCHANGE_ADDRESS, bC as ORDER_TYPE, bK as OrderMessage, ay as OrderSide, ax as OrderStatus, aq as OrderbookLevel, bz as POLYGON_CHAIN_ID, aJ as PolymarketBridgeToken, aC as PolymarketDepositWalletDeployRequest, bu as PolymarketL2Headers, bt as PolymarketL2HeadersInput, aA as PolymarketOrderType, b6 as PolymarketRedeemInput, b4 as PolymarketRedeemPrepareInput, b5 as PolymarketRedeemPrepareResponse, aK as PolymarketSupportedAssetsResponse, aL as PolymarketTypedData, aM as PolymarketTypedDataArg, aB as PolymarketWalletKind, au as PredictCommentProfile, aw as PredictPosition, al as PredictTag, aj as PredictWsClientConfig, av as PricePoint, ak as ProviderMeta, bd as ResolveEventsParamsInput, bD as SIDE, am as SettlementSource, aT as SignalTag, bL as SignedOrder, be as TagSlugSelection, ar as TradeType, by as USDC_ADDRESS, aI as UnsignedTx, aW as WsChannel, aX as WsChannelEvent, aY as WsClientMessage, b2 as WsErrorCode, b3 as WsErrorMessage, a_ as WsPingMessage, b0 as WsPongMessage, a$ as WsServerMessage, aZ as WsSubscribeMessage, b1 as WsSubscribedMessage, bo as buildClobAuthMessage, bG as buildClobPayload, bA as buildCtfExchangeDomain, bE as buildOrderMessage, bq as buildPolymarketL2Headers, bF as buildSignedOrder, ah as createPredictClient, ai as createPredictWsClient, br as derivePolymarketApiKey, b7 as eventQueryKey, b8 as fetchEvent, bc as fetchEventsPage, bg as fetchMarket, bl as fetchMatchMarketsPage, bj as fetchMatchesPage, bH as getPolymarketSharesPrecision, bp as hmacSha256Base64, bb as infiniteEventsQueryKey, bf as marketQueryKey, bk as matchMarketsQueryKey, bi as matchQueryKey, bh as matchesQueryKey, ba as resolveEventsParams, b9 as resolveTagSlug } from './server-BYvRRFCr.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';
|
|
@@ -663,6 +663,16 @@ declare function usePolymarketSupportedAssets(): _tanstack_react_query.UseQueryR
|
|
|
663
663
|
*/
|
|
664
664
|
declare function usePolymarketWithdraw(): _tanstack_react_query.UseMutationResult<PolymarketWithdrawResponse, Error, PolymarketWithdrawRequest, unknown>;
|
|
665
665
|
|
|
666
|
+
declare function usePolymarketWithdrawQuoteMutation(): _tanstack_react_query.UseMutationResult<PolymarketWithdrawQuoteResponse, Error, PolymarketWithdrawQuoteRequest, unknown>;
|
|
667
|
+
declare function usePolymarketWithdrawPrepareMutation(): _tanstack_react_query.UseMutationResult<PolymarketWithdrawPrepareResponse, Error, PolymarketWithdrawPrepareRequest, unknown>;
|
|
668
|
+
declare function usePolymarketWithdrawRelayBuildMutation(): _tanstack_react_query.UseMutationResult<PolymarketWithdrawRelayBuildResponse, Error, PolymarketWithdrawRelayBuildRequest, unknown>;
|
|
669
|
+
declare function usePolymarketWithdrawRelaySubmitMutation(): _tanstack_react_query.UseMutationResult<PolymarketWithdrawRelaySubmitResponse, Error, PolymarketWithdrawRelaySubmitRequest, unknown>;
|
|
670
|
+
declare const polymarketWithdrawStatusQueryKey: (bridgeAddress?: string, transactionId?: string) => readonly ["polymarket", "withdraw-status", string, string];
|
|
671
|
+
declare function usePolymarketWithdrawStatusQuery(params: {
|
|
672
|
+
bridge_address?: string;
|
|
673
|
+
transaction_id?: string;
|
|
674
|
+
}): _tanstack_react_query.UseQueryResult<PolymarketWithdrawBridgeStatusResponse, Error>;
|
|
675
|
+
|
|
666
676
|
interface RedeemPositionVariables {
|
|
667
677
|
wallet_address: string;
|
|
668
678
|
condition_id: string;
|
|
@@ -938,8 +948,9 @@ interface CreatePolymarketOrderVariables {
|
|
|
938
948
|
* - If shortfall > 0, signs and submits approve + swap transactions.
|
|
939
949
|
* - Polls until the swap is confirmed on-chain.
|
|
940
950
|
* 3. Builds the EIP-712 `Order` typed data and prompts the wallet for a signature.
|
|
941
|
-
* 4.
|
|
942
|
-
*
|
|
951
|
+
* 4. Submits the signed order and L2 credentials via
|
|
952
|
+
* `POST /api/v1/orders/polymarket/execute`.
|
|
953
|
+
* 5. The server forwards the raw CLOB payload and records rebate identity maps.
|
|
943
954
|
* 6. Invalidates `orders` and `positions` queries on success.
|
|
944
955
|
*
|
|
945
956
|
* @example
|
|
@@ -1090,4 +1101,4 @@ interface WalkOrderbookParams {
|
|
|
1090
1101
|
*/
|
|
1091
1102
|
declare function walkOrderbook({ orderbook, outcome, side, sharesNeeded, slippageBps, }: WalkOrderbookParams): WalkResult;
|
|
1092
1103
|
|
|
1093
|
-
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, 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 SyncBalanceAllowanceParams, TickSizeResponse, 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, 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, usePositions, usePositionsMulti, usePredictClient, usePredictWsClient, usePriceHistory, usePricesSubscription, useRealtimeOrderbook, useRealtimePrices, useRealtimeTrades, useRebateConfig, useRedeemPosition, useRunPolymarketSetup, useSearchEvents, useSimilarEvents, useTickSize, useTrades, useTradesSubscription, useWithdrawBuildMutation, useWithdrawStatusQuery, useWithdrawSubmitMutation, walkOrderbook, withdrawStatusQueryKey };
|
|
1104
|
+
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, 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 SyncBalanceAllowanceParams, TickSizeResponse, 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, useTrades, useTradesSubscription, useWithdrawBuildMutation, useWithdrawStatusQuery, useWithdrawSubmitMutation, walkOrderbook, withdrawStatusQueryKey };
|
package/dist/index.js
CHANGED
|
@@ -255,22 +255,15 @@ var PredictClient = class {
|
|
|
255
255
|
// Polymarket trading
|
|
256
256
|
// -------------------------------------------------------------------------
|
|
257
257
|
/**
|
|
258
|
-
*
|
|
258
|
+
* Execute an already signed Polymarket CLOB order through prediction-server.
|
|
259
259
|
*
|
|
260
|
-
* Maps to `POST /api/v1/orders/polymarket`.
|
|
261
|
-
*
|
|
262
|
-
*
|
|
263
|
-
* - `POLY_ADDRESS` — the EVM wallet address.
|
|
264
|
-
* - `POLY_SIGNATURE` — L1 signature or L2 API key.
|
|
265
|
-
* - `POLY_TIMESTAMP` — Unix milliseconds string.
|
|
266
|
-
* - `POLY_NONCE` — credential nonce (use `"0"` for in-session derived creds).
|
|
267
|
-
*
|
|
268
|
-
* @param input - Order parameters.
|
|
269
|
-
* @param headers - Polymarket CLOB auth headers (`POLY_*`).
|
|
260
|
+
* Maps to `POST /api/v1/orders/polymarket/execute`. The server builds the
|
|
261
|
+
* CLOB HMAC headers from the provided L2 credentials, forwards `payload`
|
|
262
|
+
* unchanged to `/order`, and records rebate identity mappings.
|
|
270
263
|
*/
|
|
271
|
-
async
|
|
272
|
-
const url = `${this.endpoint}/api/v1/orders/polymarket`;
|
|
273
|
-
return await utils.httpPost(url,
|
|
264
|
+
async executePolymarketOrder(req) {
|
|
265
|
+
const url = `${this.endpoint}/api/v1/orders/polymarket/execute`;
|
|
266
|
+
return await utils.httpPost(url, req);
|
|
274
267
|
}
|
|
275
268
|
/** Maps to `GET /api/v1/polymarket/tick-size?token_id=xxx`. */
|
|
276
269
|
async getPolymarketTickSize(tokenId) {
|
|
@@ -474,6 +467,11 @@ var PredictClient = class {
|
|
|
474
467
|
// -------------------------------------------------------------------------
|
|
475
468
|
// Polymarket Relayer Withdraw
|
|
476
469
|
// -------------------------------------------------------------------------
|
|
470
|
+
/** Maps to `POST /api/v1/withdraw/polymarket/quote`. */
|
|
471
|
+
async quotePolymarketWithdraw(body) {
|
|
472
|
+
const url = `${this.endpoint}/api/v1/withdraw/polymarket/quote`;
|
|
473
|
+
return await utils.httpPost(url, body);
|
|
474
|
+
}
|
|
477
475
|
/**
|
|
478
476
|
* Prepare a Polymarket withdrawal by obtaining a Bridge deposit address.
|
|
479
477
|
*
|
|
@@ -483,6 +481,22 @@ var PredictClient = class {
|
|
|
483
481
|
const url = `${this.endpoint}/api/v1/withdraw/polymarket/prepare`;
|
|
484
482
|
return await utils.httpPost(url, body);
|
|
485
483
|
}
|
|
484
|
+
/** Maps to `POST /api/v1/withdraw/polymarket/build-relay`. */
|
|
485
|
+
async buildPolymarketWithdrawRelay(body) {
|
|
486
|
+
const url = `${this.endpoint}/api/v1/withdraw/polymarket/build-relay`;
|
|
487
|
+
return await utils.httpPost(url, body);
|
|
488
|
+
}
|
|
489
|
+
/** Maps to `POST /api/v1/withdraw/polymarket/submit-relay`. */
|
|
490
|
+
async submitPolymarketWithdrawRelay(body) {
|
|
491
|
+
const url = `${this.endpoint}/api/v1/withdraw/polymarket/submit-relay`;
|
|
492
|
+
return await utils.httpPost(url, body);
|
|
493
|
+
}
|
|
494
|
+
/** Maps to `GET /api/v1/withdraw/polymarket/status`. */
|
|
495
|
+
async getPolymarketWithdrawStatus(params) {
|
|
496
|
+
const query = buildQuery(params);
|
|
497
|
+
const url = `${this.endpoint}/api/v1/withdraw/polymarket/status${query}`;
|
|
498
|
+
return await utils.httpGet(url);
|
|
499
|
+
}
|
|
486
500
|
/**
|
|
487
501
|
* Execute a gasless USDC.e withdrawal from a Polymarket Safe wallet via Relayer.
|
|
488
502
|
*
|
|
@@ -1834,6 +1848,49 @@ function usePolymarketWithdraw() {
|
|
|
1834
1848
|
mutationFn: (req) => client.executePolymarketWithdraw(req)
|
|
1835
1849
|
});
|
|
1836
1850
|
}
|
|
1851
|
+
function usePolymarketWithdrawQuoteMutation() {
|
|
1852
|
+
const client = usePredictClient();
|
|
1853
|
+
return reactQuery.useMutation({
|
|
1854
|
+
mutationFn: (req) => client.quotePolymarketWithdraw(req)
|
|
1855
|
+
});
|
|
1856
|
+
}
|
|
1857
|
+
function usePolymarketWithdrawPrepareMutation() {
|
|
1858
|
+
const client = usePredictClient();
|
|
1859
|
+
return reactQuery.useMutation({
|
|
1860
|
+
mutationFn: (req) => client.preparePolymarketWithdraw(req)
|
|
1861
|
+
});
|
|
1862
|
+
}
|
|
1863
|
+
function usePolymarketWithdrawRelayBuildMutation() {
|
|
1864
|
+
const client = usePredictClient();
|
|
1865
|
+
return reactQuery.useMutation({
|
|
1866
|
+
mutationFn: (req) => client.buildPolymarketWithdrawRelay(req)
|
|
1867
|
+
});
|
|
1868
|
+
}
|
|
1869
|
+
function usePolymarketWithdrawRelaySubmitMutation() {
|
|
1870
|
+
const client = usePredictClient();
|
|
1871
|
+
return reactQuery.useMutation({
|
|
1872
|
+
mutationFn: (req) => client.submitPolymarketWithdrawRelay(req)
|
|
1873
|
+
});
|
|
1874
|
+
}
|
|
1875
|
+
var polymarketWithdrawStatusQueryKey = (bridgeAddress, transactionId) => ["polymarket", "withdraw-status", bridgeAddress ?? "", transactionId ?? ""];
|
|
1876
|
+
function usePolymarketWithdrawStatusQuery(params) {
|
|
1877
|
+
const client = usePredictClient();
|
|
1878
|
+
return reactQuery.useQuery({
|
|
1879
|
+
queryKey: polymarketWithdrawStatusQueryKey(
|
|
1880
|
+
params.bridge_address,
|
|
1881
|
+
params.transaction_id
|
|
1882
|
+
),
|
|
1883
|
+
queryFn: () => client.getPolymarketWithdrawStatus(params),
|
|
1884
|
+
enabled: Boolean(params.bridge_address || params.transaction_id),
|
|
1885
|
+
refetchInterval: (query) => {
|
|
1886
|
+
const data = query.state.data;
|
|
1887
|
+
if (data?.bridge_status === "completed" || data?.bridge_status === "failed" || data?.relayer_status === "STATE_FAILED") {
|
|
1888
|
+
return false;
|
|
1889
|
+
}
|
|
1890
|
+
return 3e3;
|
|
1891
|
+
}
|
|
1892
|
+
});
|
|
1893
|
+
}
|
|
1837
1894
|
function useRedeemPosition() {
|
|
1838
1895
|
const client = usePredictClient();
|
|
1839
1896
|
const queryClient = reactQuery.useQueryClient();
|
|
@@ -2404,19 +2461,15 @@ function useCreatePolymarketOrder(mutationOptions = {}) {
|
|
|
2404
2461
|
input,
|
|
2405
2462
|
owner: creds.apiKey
|
|
2406
2463
|
});
|
|
2407
|
-
const
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
body: body2
|
|
2464
|
+
const result2 = await client.executePolymarketOrder({
|
|
2465
|
+
payload: v2Payload,
|
|
2466
|
+
l2_api_key: creds.apiKey,
|
|
2467
|
+
l2_secret: creds.secret,
|
|
2468
|
+
l2_passphrase: creds.passphrase,
|
|
2469
|
+
signer_address: creds.address,
|
|
2470
|
+
owner: creds.apiKey
|
|
2415
2471
|
});
|
|
2416
|
-
return
|
|
2417
|
-
v2Payload,
|
|
2418
|
-
headers2
|
|
2419
|
-
);
|
|
2472
|
+
return result2.raw;
|
|
2420
2473
|
}
|
|
2421
2474
|
if (signer.signTransaction && input.funderAddress) {
|
|
2422
2475
|
const orderCost = computeOrderCost(input);
|
|
@@ -2458,19 +2511,15 @@ function useCreatePolymarketOrder(mutationOptions = {}) {
|
|
|
2458
2511
|
input.orderType
|
|
2459
2512
|
);
|
|
2460
2513
|
const clobPayload = buildClobPayload(signedOrder, creds.apiKey);
|
|
2461
|
-
const
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
body
|
|
2514
|
+
const result = await client.executePolymarketOrder({
|
|
2515
|
+
payload: clobPayload,
|
|
2516
|
+
l2_api_key: creds.apiKey,
|
|
2517
|
+
l2_secret: creds.secret,
|
|
2518
|
+
l2_passphrase: creds.passphrase,
|
|
2519
|
+
signer_address: creds.address,
|
|
2520
|
+
owner: creds.apiKey
|
|
2469
2521
|
});
|
|
2470
|
-
return
|
|
2471
|
-
clobPayload,
|
|
2472
|
-
headers
|
|
2473
|
-
);
|
|
2522
|
+
return result.raw;
|
|
2474
2523
|
},
|
|
2475
2524
|
onSuccess: () => {
|
|
2476
2525
|
queryClient.invalidateQueries({ queryKey: ["predict", "orders"] });
|
|
@@ -2660,6 +2709,7 @@ exports.pickBestBid = pickBestBid;
|
|
|
2660
2709
|
exports.polymarketDepositAddressesQueryKey = polymarketDepositAddressesQueryKey;
|
|
2661
2710
|
exports.polymarketSetupQueryKey = polymarketSetupQueryKey;
|
|
2662
2711
|
exports.polymarketSupportedAssetsQueryKey = polymarketSupportedAssetsQueryKey;
|
|
2712
|
+
exports.polymarketWithdrawStatusQueryKey = polymarketWithdrawStatusQueryKey;
|
|
2663
2713
|
exports.positionsMultiQueryKey = positionsMultiQueryKey;
|
|
2664
2714
|
exports.positionsQueryKey = positionsQueryKey;
|
|
2665
2715
|
exports.priceHistoryQueryKey = priceHistoryQueryKey;
|
|
@@ -2705,6 +2755,11 @@ exports.usePolymarketDepositAddresses = usePolymarketDepositAddresses;
|
|
|
2705
2755
|
exports.usePolymarketSetup = usePolymarketSetup;
|
|
2706
2756
|
exports.usePolymarketSupportedAssets = usePolymarketSupportedAssets;
|
|
2707
2757
|
exports.usePolymarketWithdraw = usePolymarketWithdraw;
|
|
2758
|
+
exports.usePolymarketWithdrawPrepareMutation = usePolymarketWithdrawPrepareMutation;
|
|
2759
|
+
exports.usePolymarketWithdrawQuoteMutation = usePolymarketWithdrawQuoteMutation;
|
|
2760
|
+
exports.usePolymarketWithdrawRelayBuildMutation = usePolymarketWithdrawRelayBuildMutation;
|
|
2761
|
+
exports.usePolymarketWithdrawRelaySubmitMutation = usePolymarketWithdrawRelaySubmitMutation;
|
|
2762
|
+
exports.usePolymarketWithdrawStatusQuery = usePolymarketWithdrawStatusQuery;
|
|
2708
2763
|
exports.usePositions = usePositions;
|
|
2709
2764
|
exports.usePositionsMulti = usePositionsMulti;
|
|
2710
2765
|
exports.usePredictClient = usePredictClient;
|