@liberfi.io/react-predict 0.3.40 → 0.3.42
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 +13 -3
- package/dist/index.d.ts +13 -3
- package/dist/index.js +70 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +65 -1
- package/dist/index.mjs.map +1 -1
- package/dist/{server-DYdQCzYz.d.mts → server-BYvRRFCr.d.mts} +85 -3
- package/dist/{server-DYdQCzYz.d.ts → server-BYvRRFCr.d.ts} +85 -3
- package/dist/server.d.mts +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.js +21 -0
- package/dist/server.js.map +1 -1
- package/dist/server.mjs +21 -0
- package/dist/server.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -465,6 +465,11 @@ var PredictClient = class {
|
|
|
465
465
|
// -------------------------------------------------------------------------
|
|
466
466
|
// Polymarket Relayer Withdraw
|
|
467
467
|
// -------------------------------------------------------------------------
|
|
468
|
+
/** Maps to `POST /api/v1/withdraw/polymarket/quote`. */
|
|
469
|
+
async quotePolymarketWithdraw(body) {
|
|
470
|
+
const url = `${this.endpoint}/api/v1/withdraw/polymarket/quote`;
|
|
471
|
+
return await httpPost(url, body);
|
|
472
|
+
}
|
|
468
473
|
/**
|
|
469
474
|
* Prepare a Polymarket withdrawal by obtaining a Bridge deposit address.
|
|
470
475
|
*
|
|
@@ -474,6 +479,22 @@ var PredictClient = class {
|
|
|
474
479
|
const url = `${this.endpoint}/api/v1/withdraw/polymarket/prepare`;
|
|
475
480
|
return await httpPost(url, body);
|
|
476
481
|
}
|
|
482
|
+
/** Maps to `POST /api/v1/withdraw/polymarket/build-relay`. */
|
|
483
|
+
async buildPolymarketWithdrawRelay(body) {
|
|
484
|
+
const url = `${this.endpoint}/api/v1/withdraw/polymarket/build-relay`;
|
|
485
|
+
return await httpPost(url, body);
|
|
486
|
+
}
|
|
487
|
+
/** Maps to `POST /api/v1/withdraw/polymarket/submit-relay`. */
|
|
488
|
+
async submitPolymarketWithdrawRelay(body) {
|
|
489
|
+
const url = `${this.endpoint}/api/v1/withdraw/polymarket/submit-relay`;
|
|
490
|
+
return await httpPost(url, body);
|
|
491
|
+
}
|
|
492
|
+
/** Maps to `GET /api/v1/withdraw/polymarket/status`. */
|
|
493
|
+
async getPolymarketWithdrawStatus(params) {
|
|
494
|
+
const query = buildQuery(params);
|
|
495
|
+
const url = `${this.endpoint}/api/v1/withdraw/polymarket/status${query}`;
|
|
496
|
+
return await httpGet(url);
|
|
497
|
+
}
|
|
477
498
|
/**
|
|
478
499
|
* Execute a gasless USDC.e withdrawal from a Polymarket Safe wallet via Relayer.
|
|
479
500
|
*
|
|
@@ -1825,6 +1846,49 @@ function usePolymarketWithdraw() {
|
|
|
1825
1846
|
mutationFn: (req) => client.executePolymarketWithdraw(req)
|
|
1826
1847
|
});
|
|
1827
1848
|
}
|
|
1849
|
+
function usePolymarketWithdrawQuoteMutation() {
|
|
1850
|
+
const client = usePredictClient();
|
|
1851
|
+
return useMutation({
|
|
1852
|
+
mutationFn: (req) => client.quotePolymarketWithdraw(req)
|
|
1853
|
+
});
|
|
1854
|
+
}
|
|
1855
|
+
function usePolymarketWithdrawPrepareMutation() {
|
|
1856
|
+
const client = usePredictClient();
|
|
1857
|
+
return useMutation({
|
|
1858
|
+
mutationFn: (req) => client.preparePolymarketWithdraw(req)
|
|
1859
|
+
});
|
|
1860
|
+
}
|
|
1861
|
+
function usePolymarketWithdrawRelayBuildMutation() {
|
|
1862
|
+
const client = usePredictClient();
|
|
1863
|
+
return useMutation({
|
|
1864
|
+
mutationFn: (req) => client.buildPolymarketWithdrawRelay(req)
|
|
1865
|
+
});
|
|
1866
|
+
}
|
|
1867
|
+
function usePolymarketWithdrawRelaySubmitMutation() {
|
|
1868
|
+
const client = usePredictClient();
|
|
1869
|
+
return useMutation({
|
|
1870
|
+
mutationFn: (req) => client.submitPolymarketWithdrawRelay(req)
|
|
1871
|
+
});
|
|
1872
|
+
}
|
|
1873
|
+
var polymarketWithdrawStatusQueryKey = (bridgeAddress, transactionId) => ["polymarket", "withdraw-status", bridgeAddress ?? "", transactionId ?? ""];
|
|
1874
|
+
function usePolymarketWithdrawStatusQuery(params) {
|
|
1875
|
+
const client = usePredictClient();
|
|
1876
|
+
return useQuery({
|
|
1877
|
+
queryKey: polymarketWithdrawStatusQueryKey(
|
|
1878
|
+
params.bridge_address,
|
|
1879
|
+
params.transaction_id
|
|
1880
|
+
),
|
|
1881
|
+
queryFn: () => client.getPolymarketWithdrawStatus(params),
|
|
1882
|
+
enabled: Boolean(params.bridge_address || params.transaction_id),
|
|
1883
|
+
refetchInterval: (query) => {
|
|
1884
|
+
const data = query.state.data;
|
|
1885
|
+
if (data?.bridge_status === "completed" || data?.bridge_status === "failed" || data?.relayer_status === "STATE_FAILED") {
|
|
1886
|
+
return false;
|
|
1887
|
+
}
|
|
1888
|
+
return 3e3;
|
|
1889
|
+
}
|
|
1890
|
+
});
|
|
1891
|
+
}
|
|
1828
1892
|
function useRedeemPosition() {
|
|
1829
1893
|
const client = usePredictClient();
|
|
1830
1894
|
const queryClient = useQueryClient();
|
|
@@ -2581,6 +2645,6 @@ function walkOrderbook({
|
|
|
2581
2645
|
};
|
|
2582
2646
|
}
|
|
2583
2647
|
|
|
2584
|
-
export { CLOB_AUTH_DOMAIN, CLOB_AUTH_TYPES, CTF_EXCHANGE_ADDRESS, CTF_ORDER_TYPES, ChartRange, NEG_RISK_CTF_EXCHANGE_ADDRESS, ORDER_TYPE, POLYGON_CHAIN_ID, PolymarketContext, PolymarketProvider, PredictClient, PredictContext, PredictProvider, PredictWsClient, SIDE, USDC_ADDRESS, availableSharesQueryKey, balanceQueryKey, buildClobAuthMessage, buildClobPayload, buildCtfExchangeDomain, buildOrderMessage, buildPolymarketL2Headers, buildSignedOrder, buildSignedV2OrderPayload, candlesticksQueryKey, createPredictClient, createPredictWsClient, derivePolymarketApiKey, dflowKYCQueryKey, dflowQuoteQueryKey, eventQueryKey, eventStatsQueryKey, eventsQueryKey, feeRateQueryKey, fetchEvent, fetchEvents, fetchEventsPage, fetchMarket, fetchMatchMarketsPage, fetchMatchesPage, getPolymarketSharesPrecision, hmacSha256Base64, infiniteCommentsQueryKey, infiniteEventsQueryKey, infiniteOrdersQueryKey, infiniteTradesMultiQueryKey, infiniteTradesQueryKey, marketQueryKey, marketTradesQueryKey, matchMarketsQueryKey, matchQueryKey, matchesQueryKey, orderQueryKey, orderbookQueryKey, ordersMultiQueryKey, ordersQueryKey, pickBestAsk, pickBestBid, polymarketDepositAddressesQueryKey, polymarketSetupQueryKey, polymarketSupportedAssetsQueryKey, positionsMultiQueryKey, positionsQueryKey, priceHistoryQueryKey, rebateConfigQueryKey, resolveEventsParams, resolveTagSlug, 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 };
|
|
2648
|
+
export { CLOB_AUTH_DOMAIN, CLOB_AUTH_TYPES, CTF_EXCHANGE_ADDRESS, CTF_ORDER_TYPES, ChartRange, NEG_RISK_CTF_EXCHANGE_ADDRESS, ORDER_TYPE, POLYGON_CHAIN_ID, PolymarketContext, PolymarketProvider, PredictClient, PredictContext, PredictProvider, PredictWsClient, SIDE, USDC_ADDRESS, availableSharesQueryKey, balanceQueryKey, buildClobAuthMessage, buildClobPayload, buildCtfExchangeDomain, buildOrderMessage, buildPolymarketL2Headers, buildSignedOrder, buildSignedV2OrderPayload, candlesticksQueryKey, createPredictClient, createPredictWsClient, derivePolymarketApiKey, dflowKYCQueryKey, dflowQuoteQueryKey, eventQueryKey, eventStatsQueryKey, eventsQueryKey, feeRateQueryKey, fetchEvent, fetchEvents, fetchEventsPage, fetchMarket, fetchMatchMarketsPage, fetchMatchesPage, getPolymarketSharesPrecision, hmacSha256Base64, infiniteCommentsQueryKey, infiniteEventsQueryKey, infiniteOrdersQueryKey, infiniteTradesMultiQueryKey, infiniteTradesQueryKey, marketQueryKey, marketTradesQueryKey, matchMarketsQueryKey, matchQueryKey, matchesQueryKey, orderQueryKey, orderbookQueryKey, ordersMultiQueryKey, ordersQueryKey, pickBestAsk, pickBestBid, polymarketDepositAddressesQueryKey, polymarketSetupQueryKey, polymarketSupportedAssetsQueryKey, polymarketWithdrawStatusQueryKey, positionsMultiQueryKey, positionsQueryKey, priceHistoryQueryKey, rebateConfigQueryKey, resolveEventsParams, resolveTagSlug, 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 };
|
|
2585
2649
|
//# sourceMappingURL=index.mjs.map
|
|
2586
2650
|
//# sourceMappingURL=index.mjs.map
|