@agg-build/hooks 2.7.2 → 3.0.0
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/{chunk-Q4FRCMP6.mjs → chunk-MGWCWGMA.mjs} +1 -1
- package/dist/{chunk-TJRQ55UC.mjs → chunk-XYWK7G2R.mjs} +124 -15
- package/dist/{chunk-DP6VYGAX.mjs → chunk-ZNY6BIDR.mjs} +1 -1
- package/dist/deposit.js +59 -2
- package/dist/deposit.mjs +2 -2
- package/dist/index.d.mts +318 -5
- package/dist/index.d.ts +318 -5
- package/dist/index.js +337 -109
- package/dist/index.mjs +148 -29
- package/dist/withdraw.js +59 -2
- package/dist/withdraw.mjs +2 -2
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useRampQuotes,
|
|
3
3
|
useRampSession
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-MGWCWGMA.mjs";
|
|
5
5
|
import {
|
|
6
6
|
useWithdrawEstimate,
|
|
7
7
|
useWithdrawFlow,
|
|
8
8
|
useWithdrawPreview,
|
|
9
9
|
useWithdrawalLifecycle
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-ZNY6BIDR.mjs";
|
|
11
11
|
import {
|
|
12
12
|
AggAuthContext,
|
|
13
13
|
AggBalanceProvider,
|
|
@@ -71,6 +71,7 @@ import {
|
|
|
71
71
|
useAggUiConfig,
|
|
72
72
|
useAggWebSocket,
|
|
73
73
|
useAggWebSocketConnectionState,
|
|
74
|
+
useBalanceRefillPolicies,
|
|
74
75
|
useCancelManagedOrder,
|
|
75
76
|
useDepositAddresses,
|
|
76
77
|
useEventListState,
|
|
@@ -97,7 +98,7 @@ import {
|
|
|
97
98
|
useSyncBalances,
|
|
98
99
|
useWithdrawManaged,
|
|
99
100
|
userActivityQueryKeys
|
|
100
|
-
} from "./chunk-
|
|
101
|
+
} from "./chunk-XYWK7G2R.mjs";
|
|
101
102
|
|
|
102
103
|
// src/index.ts
|
|
103
104
|
import { QueryClient as QueryClient4, QueryClientProvider, useQueryClient as useQueryClient3 } from "@tanstack/react-query";
|
|
@@ -960,12 +961,15 @@ function useLiveOutcomePrices(venueMarkets) {
|
|
|
960
961
|
features: { enableLiveUpdates }
|
|
961
962
|
} = useAggUiConfig();
|
|
962
963
|
const outcomeIds = useMemo6(() => {
|
|
963
|
-
var _a;
|
|
964
|
+
var _a, _b;
|
|
964
965
|
if (!(venueMarkets == null ? void 0 : venueMarkets.length)) return [];
|
|
965
966
|
const ids = /* @__PURE__ */ new Set();
|
|
966
967
|
for (const vm of venueMarkets) {
|
|
967
968
|
for (const outcome of (_a = vm.venueMarketOutcomes) != null ? _a : []) {
|
|
968
969
|
if (outcome.id) ids.add(outcome.id);
|
|
970
|
+
for (const ref of (_b = outcome.matchedVenueMarketOutcomes) != null ? _b : []) {
|
|
971
|
+
if (ref.venueMarketOutcomeId) ids.add(ref.venueMarketOutcomeId);
|
|
972
|
+
}
|
|
969
973
|
}
|
|
970
974
|
}
|
|
971
975
|
return [...ids].sort();
|
|
@@ -986,7 +990,7 @@ function useLiveOutcomePrices(venueMarkets) {
|
|
|
986
990
|
prices: EMPTY_PRICES
|
|
987
991
|
});
|
|
988
992
|
const data = useMemo6(() => {
|
|
989
|
-
var _a, _b, _c
|
|
993
|
+
var _a, _b, _c;
|
|
990
994
|
if (!(venueMarkets == null ? void 0 : venueMarkets.length)) return EMPTY_PRICES;
|
|
991
995
|
if (fingerprint === prevRef.current.fingerprint) {
|
|
992
996
|
return prevRef.current.prices;
|
|
@@ -997,16 +1001,10 @@ function useLiveOutcomePrices(venueMarkets) {
|
|
|
997
1001
|
const state = (_a = queries[i]) == null ? void 0 : _a.data;
|
|
998
1002
|
liveByOutcomeId.set(outcomeIds[i], (_c = (_b = state == null ? void 0 : state.orderbook) == null ? void 0 : _b.midpoint) != null ? _c : null);
|
|
999
1003
|
}
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
}
|
|
1005
|
-
const liveMidpoint = liveByOutcomeId.get(outcome.id);
|
|
1006
|
-
if (liveMidpoint != null) {
|
|
1007
|
-
prices.set(outcome.id, liveMidpoint);
|
|
1008
|
-
}
|
|
1009
|
-
}
|
|
1004
|
+
if (!enableLiveUpdates) return prices;
|
|
1005
|
+
for (const outcomeId of outcomeIds) {
|
|
1006
|
+
const liveMidpoint = liveByOutcomeId.get(outcomeId);
|
|
1007
|
+
if (liveMidpoint != null) prices.set(outcomeId, liveMidpoint);
|
|
1010
1008
|
}
|
|
1011
1009
|
prevRef.current = { fingerprint, prices };
|
|
1012
1010
|
return prices;
|
|
@@ -1517,8 +1515,9 @@ function useMidpoints(venueMarkets, options) {
|
|
|
1517
1515
|
const result = useMemo8(() => {
|
|
1518
1516
|
var _a2, _b, _c, _d, _e, _f;
|
|
1519
1517
|
const map = /* @__PURE__ */ new Map();
|
|
1518
|
+
const currentMap = /* @__PURE__ */ new Map();
|
|
1520
1519
|
const venueMap = /* @__PURE__ */ new Map();
|
|
1521
|
-
if (!(data == null ? void 0 : data.data) || !venueMarkets) return { map, venueMap };
|
|
1520
|
+
if (!(data == null ? void 0 : data.data) || !venueMarkets) return { map, currentMap, venueMap };
|
|
1522
1521
|
const itemByMarketId = new Map(data.data.map((item) => [item.venueMarketId, item]));
|
|
1523
1522
|
const marketById = new Map(venueMarkets.map((market) => [market.id, market]));
|
|
1524
1523
|
for (const item of data.data) {
|
|
@@ -1526,6 +1525,7 @@ function useMidpoints(venueMarkets, options) {
|
|
|
1526
1525
|
for (const o of item.outcomes) {
|
|
1527
1526
|
if (o.midpoint == null) continue;
|
|
1528
1527
|
map.set(o.venueMarketOutcomeId, o.midpoint);
|
|
1528
|
+
currentMap.set(o.venueMarketOutcomeId, o.midpoint);
|
|
1529
1529
|
if (item.venue) venueMap.set(o.venueMarketOutcomeId, item.venue);
|
|
1530
1530
|
}
|
|
1531
1531
|
}
|
|
@@ -1540,6 +1540,7 @@ function useMidpoints(venueMarkets, options) {
|
|
|
1540
1540
|
for (const ref of refs) {
|
|
1541
1541
|
const sib = resolveSiblingOutcomeMidpoint(item.matched, ref);
|
|
1542
1542
|
if (sib == null) continue;
|
|
1543
|
+
currentMap.set(ref.venueMarketOutcomeId, sib.midpoint);
|
|
1543
1544
|
if (best == null || sib.midpoint < best) {
|
|
1544
1545
|
best = sib.midpoint;
|
|
1545
1546
|
bestVenue = (_e = sib.venue) != null ? _e : bestVenue;
|
|
@@ -1562,7 +1563,7 @@ function useMidpoints(venueMarkets, options) {
|
|
|
1562
1563
|
}
|
|
1563
1564
|
}
|
|
1564
1565
|
}
|
|
1565
|
-
return { map, venueMap };
|
|
1566
|
+
return { map, currentMap, venueMap };
|
|
1566
1567
|
}, [data, venueMarkets]);
|
|
1567
1568
|
const { bestMidpoint, bestMidpointVenue } = useMemo8(() => {
|
|
1568
1569
|
let value;
|
|
@@ -1592,6 +1593,7 @@ function useMidpoints(venueMarkets, options) {
|
|
|
1592
1593
|
return {
|
|
1593
1594
|
prices: result.map,
|
|
1594
1595
|
bestMidpointsByOutcomeId: result.map,
|
|
1596
|
+
currentMidpointsByOutcomeId: result.currentMap,
|
|
1595
1597
|
venueByOutcomeId: result.venueMap,
|
|
1596
1598
|
bestPrices,
|
|
1597
1599
|
bestPriceVenuesByOutcomeId,
|
|
@@ -2353,7 +2355,9 @@ function useSmartRoute(options) {
|
|
|
2353
2355
|
refetchInterval: (queryState) => {
|
|
2354
2356
|
var _a2, _b2, _c2, _d2;
|
|
2355
2357
|
return resolveSmartRouteRefetchInterval({
|
|
2356
|
-
|
|
2358
|
+
// SELL already fans out into one quote per venue. Keep that group on a
|
|
2359
|
+
// stable cadence instead of multiplying the adaptive 5s/refreshAt poll.
|
|
2360
|
+
data: tradeSide === "sell" ? void 0 : queryState.state.data,
|
|
2357
2361
|
defaultIntervalMs: staleTimeMs,
|
|
2358
2362
|
isDocumentVisible: getIsDocumentVisible(),
|
|
2359
2363
|
isEditing: (_a2 = refreshContext == null ? void 0 : refreshContext.isEditing) != null ? _a2 : false,
|
|
@@ -2393,13 +2397,123 @@ function useSmartRoute(options) {
|
|
|
2393
2397
|
};
|
|
2394
2398
|
}
|
|
2395
2399
|
|
|
2396
|
-
// src/use-venue-
|
|
2397
|
-
import { useQueries as useQueries6 } from "@tanstack/react-query";
|
|
2400
|
+
// src/use-limit-order-venue-quotes.ts
|
|
2401
|
+
import { keepPreviousData as keepPreviousData7, useQueries as useQueries6 } from "@tanstack/react-query";
|
|
2398
2402
|
var getIsDocumentVisible2 = () => {
|
|
2399
2403
|
if (typeof document === "undefined") return true;
|
|
2400
2404
|
return document.visibilityState !== "hidden";
|
|
2401
2405
|
};
|
|
2402
2406
|
var getUniqueVenueRequests = (requests) => {
|
|
2407
|
+
const requestsByVenue = /* @__PURE__ */ new Map();
|
|
2408
|
+
for (const request of requests) {
|
|
2409
|
+
if (!request.venueMarketOutcomeId || requestsByVenue.has(request.venue)) continue;
|
|
2410
|
+
requestsByVenue.set(request.venue, request);
|
|
2411
|
+
}
|
|
2412
|
+
return [...requestsByVenue.values()].sort((left, right) => left.venue.localeCompare(right.venue));
|
|
2413
|
+
};
|
|
2414
|
+
var useLimitOrderVenueQuotes = (options) => {
|
|
2415
|
+
var _a, _b;
|
|
2416
|
+
const client = useAggClient();
|
|
2417
|
+
const {
|
|
2418
|
+
requests,
|
|
2419
|
+
tradeSide,
|
|
2420
|
+
amount,
|
|
2421
|
+
marketId,
|
|
2422
|
+
accountId,
|
|
2423
|
+
chainBalances,
|
|
2424
|
+
mode,
|
|
2425
|
+
slipCapBps,
|
|
2426
|
+
enabled = true,
|
|
2427
|
+
staleTimeMs = SMART_ROUTE_STALE_TIME_MS,
|
|
2428
|
+
refreshContext
|
|
2429
|
+
} = options;
|
|
2430
|
+
const uniqueRequests = getUniqueVenueRequests(requests);
|
|
2431
|
+
const hasValidInput = typeof amount === "number" && Number.isFinite(amount) && amount > 0;
|
|
2432
|
+
const hasRequiredAccount = tradeSide === "buy" || Boolean(accountId);
|
|
2433
|
+
const queryEnabled = enabled && hasValidInput && hasRequiredAccount;
|
|
2434
|
+
const serializedChainBalances = chainBalances ? JSON.stringify(chainBalances) : null;
|
|
2435
|
+
const queries = useQueries6({
|
|
2436
|
+
queries: uniqueRequests.map((request) => ({
|
|
2437
|
+
queryKey: [
|
|
2438
|
+
"smart-route",
|
|
2439
|
+
request.venueMarketOutcomeId,
|
|
2440
|
+
"limit-order-venue-info",
|
|
2441
|
+
{
|
|
2442
|
+
venue: request.venue,
|
|
2443
|
+
tradeSide,
|
|
2444
|
+
amount: amount != null ? amount : null,
|
|
2445
|
+
// The quote endpoint does not use limit price, so it must not be
|
|
2446
|
+
// part of this key or trigger a new informational quote.
|
|
2447
|
+
marketId: marketId != null ? marketId : null,
|
|
2448
|
+
accountId: accountId != null ? accountId : null,
|
|
2449
|
+
chainBalances: serializedChainBalances,
|
|
2450
|
+
mode: mode != null ? mode : null,
|
|
2451
|
+
slipCapBps: slipCapBps != null ? slipCapBps : null
|
|
2452
|
+
}
|
|
2453
|
+
],
|
|
2454
|
+
queryFn: (_0) => __async(null, [_0], function* ({ signal }) {
|
|
2455
|
+
return client.getSmartRoute(
|
|
2456
|
+
__spreadProps(__spreadValues(__spreadValues(__spreadValues({
|
|
2457
|
+
venueMarketOutcomeId: request.venueMarketOutcomeId,
|
|
2458
|
+
tradeSide
|
|
2459
|
+
}, tradeSide === "buy" ? { maxSpend: amount } : { sellShares: amount }), chainBalances ? { chainBalances } : {}), mode ? { mode } : {}), {
|
|
2460
|
+
slipCapBps,
|
|
2461
|
+
allowedVenues: [request.venue]
|
|
2462
|
+
}),
|
|
2463
|
+
{ signal }
|
|
2464
|
+
);
|
|
2465
|
+
}),
|
|
2466
|
+
enabled: queryEnabled,
|
|
2467
|
+
placeholderData: keepPreviousData7,
|
|
2468
|
+
staleTime: staleTimeMs,
|
|
2469
|
+
refetchInterval: (queryState) => {
|
|
2470
|
+
var _a2, _b2, _c, _d;
|
|
2471
|
+
return resolveSmartRouteRefetchInterval({
|
|
2472
|
+
data: queryState.state.data,
|
|
2473
|
+
defaultIntervalMs: staleTimeMs,
|
|
2474
|
+
isDocumentVisible: getIsDocumentVisible2(),
|
|
2475
|
+
isEditing: (_a2 = refreshContext == null ? void 0 : refreshContext.isEditing) != null ? _a2 : false,
|
|
2476
|
+
isInputValid: hasValidInput,
|
|
2477
|
+
isMarketOpen: (_b2 = refreshContext == null ? void 0 : refreshContext.isMarketOpen) != null ? _b2 : true,
|
|
2478
|
+
isPanelActive: (_c = refreshContext == null ? void 0 : refreshContext.isPanelActive) != null ? _c : true,
|
|
2479
|
+
isSubmitting: (_d = refreshContext == null ? void 0 : refreshContext.isSubmitting) != null ? _d : false,
|
|
2480
|
+
queryEnabled
|
|
2481
|
+
});
|
|
2482
|
+
},
|
|
2483
|
+
gcTime: 6e4,
|
|
2484
|
+
refetchOnWindowFocus: false,
|
|
2485
|
+
refetchIntervalInBackground: false,
|
|
2486
|
+
retry: 1
|
|
2487
|
+
}))
|
|
2488
|
+
});
|
|
2489
|
+
const quotes = queries.map((query, index) => {
|
|
2490
|
+
var _a2;
|
|
2491
|
+
const queryError = query.error;
|
|
2492
|
+
return {
|
|
2493
|
+
request: uniqueRequests[index],
|
|
2494
|
+
data: (_a2 = query.data) != null ? _a2 : null,
|
|
2495
|
+
isLoading: query.isLoading,
|
|
2496
|
+
isFetching: query.isFetching,
|
|
2497
|
+
error: queryError instanceof Error ? queryError : queryError ? new Error(String(queryError)) : null,
|
|
2498
|
+
refetch: query.refetch
|
|
2499
|
+
};
|
|
2500
|
+
});
|
|
2501
|
+
return {
|
|
2502
|
+
quotes,
|
|
2503
|
+
isLoading: quotes.some((quote) => quote.isLoading),
|
|
2504
|
+
isFetching: quotes.some((quote) => quote.isFetching),
|
|
2505
|
+
error: (_b = (_a = quotes.find((quote) => quote.error)) == null ? void 0 : _a.error) != null ? _b : null,
|
|
2506
|
+
refetch: () => Promise.all(quotes.map((quote) => quote.refetch()))
|
|
2507
|
+
};
|
|
2508
|
+
};
|
|
2509
|
+
|
|
2510
|
+
// src/use-venue-sell-quotes.ts
|
|
2511
|
+
import { useQueries as useQueries7 } from "@tanstack/react-query";
|
|
2512
|
+
var getIsDocumentVisible3 = () => {
|
|
2513
|
+
if (typeof document === "undefined") return true;
|
|
2514
|
+
return document.visibilityState !== "hidden";
|
|
2515
|
+
};
|
|
2516
|
+
var getUniqueVenueRequests2 = (requests) => {
|
|
2403
2517
|
const requestsByVenue = /* @__PURE__ */ new Map();
|
|
2404
2518
|
for (const request of requests) {
|
|
2405
2519
|
if (request.requestedSellShares <= 0 || request.sellShares <= 0 || request.availableShares <= 0) {
|
|
@@ -2424,8 +2538,8 @@ var useVenueSellQuotes = (options) => {
|
|
|
2424
2538
|
staleTimeMs = SMART_ROUTE_STALE_TIME_MS,
|
|
2425
2539
|
refreshContext
|
|
2426
2540
|
} = options;
|
|
2427
|
-
const uniqueRequests =
|
|
2428
|
-
const queries =
|
|
2541
|
+
const uniqueRequests = getUniqueVenueRequests2(requests);
|
|
2542
|
+
const queries = useQueries7({
|
|
2429
2543
|
queries: uniqueRequests.map((request) => {
|
|
2430
2544
|
const hasValidInput = request.requestedSellShares > 0 && request.sellShares > 0 && request.availableShares > 0;
|
|
2431
2545
|
const queryEnabled = enabled && !!venueMarketOutcomeId && !!accountId && hasValidInput;
|
|
@@ -2462,12 +2576,15 @@ var useVenueSellQuotes = (options) => {
|
|
|
2462
2576
|
}),
|
|
2463
2577
|
enabled: queryEnabled,
|
|
2464
2578
|
staleTime: staleTimeMs,
|
|
2465
|
-
refetchInterval: (
|
|
2579
|
+
refetchInterval: (_queryState) => {
|
|
2466
2580
|
var _a2, _b2, _c, _d;
|
|
2467
2581
|
return resolveSmartRouteRefetchInterval({
|
|
2468
|
-
|
|
2582
|
+
// Venue quotes are display companions to the aggregate SELL quote.
|
|
2583
|
+
// Poll them at the normal cadence rather than independently
|
|
2584
|
+
// accelerating every venue to the thin-liquidity interval.
|
|
2585
|
+
data: void 0,
|
|
2469
2586
|
defaultIntervalMs: staleTimeMs,
|
|
2470
|
-
isDocumentVisible:
|
|
2587
|
+
isDocumentVisible: getIsDocumentVisible3(),
|
|
2471
2588
|
isEditing: (_a2 = refreshContext == null ? void 0 : refreshContext.isEditing) != null ? _a2 : false,
|
|
2472
2589
|
isInputValid: hasValidInput,
|
|
2473
2590
|
isMarketOpen: (_b2 = refreshContext == null ? void 0 : refreshContext.isMarketOpen) != null ? _b2 : true,
|
|
@@ -2734,7 +2851,7 @@ function useEnrichedVenueEvent(options) {
|
|
|
2734
2851
|
import {
|
|
2735
2852
|
QueryClient as QueryClient3,
|
|
2736
2853
|
QueryClientContext as QueryClientContext3,
|
|
2737
|
-
keepPreviousData as
|
|
2854
|
+
keepPreviousData as keepPreviousData8,
|
|
2738
2855
|
useInfiniteQuery as useInfiniteQuery8
|
|
2739
2856
|
} from "@tanstack/react-query";
|
|
2740
2857
|
import { useContext as useContext4, useEffect as useEffect9, useMemo as useMemo11, useRef as useRef5, useState as useState9 } from "react";
|
|
@@ -2816,7 +2933,7 @@ function useVenueEvents(options) {
|
|
|
2816
2933
|
return (_a2 = lastPage.nextCursor) != null ? _a2 : void 0;
|
|
2817
2934
|
},
|
|
2818
2935
|
// TODO: RMIK - Comment out to show skeletons on category switch
|
|
2819
|
-
placeholderData:
|
|
2936
|
+
placeholderData: keepPreviousData8,
|
|
2820
2937
|
enabled: enabled && !!client
|
|
2821
2938
|
},
|
|
2822
2939
|
queryClient != null ? queryClient : fallbackQueryClient
|
|
@@ -2858,7 +2975,7 @@ function useVenueEvents(options) {
|
|
|
2858
2975
|
}
|
|
2859
2976
|
|
|
2860
2977
|
// src/use-venue-market-midpoints.ts
|
|
2861
|
-
import { keepPreviousData as
|
|
2978
|
+
import { keepPreviousData as keepPreviousData9, useQuery as useQuery9 } from "@tanstack/react-query";
|
|
2862
2979
|
var normalizeVenueMarketIds2 = (venueMarketIds) => {
|
|
2863
2980
|
return [
|
|
2864
2981
|
...new Set(venueMarketIds.map((venueMarketId) => venueMarketId.trim()).filter(Boolean))
|
|
@@ -2913,7 +3030,7 @@ function useVenueMarketMidpoints(options) {
|
|
|
2913
3030
|
gcTime: 5 * 6e4,
|
|
2914
3031
|
refetchOnWindowFocus: false,
|
|
2915
3032
|
retry: 1,
|
|
2916
|
-
placeholderData:
|
|
3033
|
+
placeholderData: keepPreviousData9
|
|
2917
3034
|
});
|
|
2918
3035
|
const midpointRows = (_d = (_c = query.data) == null ? void 0 : _c.data) != null ? _d : [];
|
|
2919
3036
|
const midpointsByVenueMarketId = mapMidpointsByVenueMarketId(midpointRows);
|
|
@@ -3277,6 +3394,7 @@ export {
|
|
|
3277
3394
|
useAggWebSocket,
|
|
3278
3395
|
useAppConfig,
|
|
3279
3396
|
useArbFeed,
|
|
3397
|
+
useBalanceRefillPolicies,
|
|
3280
3398
|
useCachedAppConfig,
|
|
3281
3399
|
useCancelManagedOrder,
|
|
3282
3400
|
useCategories,
|
|
@@ -3294,6 +3412,7 @@ export {
|
|
|
3294
3412
|
useExternalId,
|
|
3295
3413
|
useGeoBlock,
|
|
3296
3414
|
useLabels,
|
|
3415
|
+
useLimitOrderVenueQuotes,
|
|
3297
3416
|
useLinkAccount,
|
|
3298
3417
|
useLiveBestPriceCandidates,
|
|
3299
3418
|
useLiveBestPrices,
|
package/dist/withdraw.js
CHANGED
|
@@ -133,6 +133,56 @@ var enUsLabels = {
|
|
|
133
133
|
claimableWinningsTooltip: (count) => `${count} position${count === 1 ? "" : "s"} ready to claim`,
|
|
134
134
|
walletMenuFor: (profileLabel) => `Profile menu for ${profileLabel}`
|
|
135
135
|
},
|
|
136
|
+
balanceRefill: {
|
|
137
|
+
tabLabel: "Balance management",
|
|
138
|
+
title: "Automatic balance refill",
|
|
139
|
+
description: "Keep a minimum USDC balance on one network by moving funds from another managed network.",
|
|
140
|
+
networkLabel: "Network to maintain",
|
|
141
|
+
minimumLabel: "Minimum balance",
|
|
142
|
+
refillAmountLabel: "Refill by at least",
|
|
143
|
+
dailyCapLabel: "Maximum per day",
|
|
144
|
+
maximumFeeLabel: "Maximum fee per refill",
|
|
145
|
+
activeLabel: "Automatic refill is active",
|
|
146
|
+
pausedLabel: "Automatic refill is paused",
|
|
147
|
+
enableAction: "Enable automatic refill",
|
|
148
|
+
saveAction: "Save refill settings",
|
|
149
|
+
pauseAction: "Pause automatic refill",
|
|
150
|
+
resumeAction: "Resume automatic refill",
|
|
151
|
+
loading: "Loading refill settings...",
|
|
152
|
+
loadError: "Refill settings could not be loaded.",
|
|
153
|
+
saveError: "Refill settings could not be saved.",
|
|
154
|
+
saved: "Refill settings saved.",
|
|
155
|
+
consent: "By enabling, you authorize AGG to move USDC between your managed wallets within these limits.",
|
|
156
|
+
lastRefill: "Latest refill",
|
|
157
|
+
manageTitle: "Manage balances",
|
|
158
|
+
manageDescription: "Set a minimum balance and refill target for each venue. When a venue falls below your minimum, funds are automatically transferred from your balances on other venues to restore it to your refill target.",
|
|
159
|
+
noAutoRefill: "No auto-refill",
|
|
160
|
+
autoRefill: "Auto-refill",
|
|
161
|
+
minimumShortLabel: "Min",
|
|
162
|
+
refillToLabel: "Refill to",
|
|
163
|
+
unitLabel: "USDC",
|
|
164
|
+
resetAction: "Reset",
|
|
165
|
+
cancelAction: "Cancel",
|
|
166
|
+
saveChangesAction: "Save changes",
|
|
167
|
+
modalLoading: "Loading balances...",
|
|
168
|
+
modalEmptyTitle: "No supported networks",
|
|
169
|
+
modalEmptyDescription: "There are no supported networks to manage yet.",
|
|
170
|
+
modalLoadError: "Balances could not be loaded.",
|
|
171
|
+
requiredError: "Enter an amount.",
|
|
172
|
+
positiveError: "Enter an amount greater than 0.",
|
|
173
|
+
precisionError: "Use no more than 6 decimal places.",
|
|
174
|
+
relationshipError: "Refill to must be greater than or equal to Min.",
|
|
175
|
+
maximumError: (maximum) => `Enter an amount no greater than ${maximum} USDC.`,
|
|
176
|
+
createUnavailableError: "Auto-refill cannot be enabled for this network until refill limits are supported by the API.",
|
|
177
|
+
expandNetwork: (network) => `Expand ${network} balance settings`,
|
|
178
|
+
collapseNetwork: (network) => `Collapse ${network} balance settings`,
|
|
179
|
+
statuses: {
|
|
180
|
+
reserved: "Funds reserved",
|
|
181
|
+
executing: "Refill in progress",
|
|
182
|
+
completed: "Refill completed",
|
|
183
|
+
failed: "Refill failed"
|
|
184
|
+
}
|
|
185
|
+
},
|
|
136
186
|
deposit: {
|
|
137
187
|
title: "Deposit",
|
|
138
188
|
back: "Go back",
|
|
@@ -336,7 +386,8 @@ var enUsLabels = {
|
|
|
336
386
|
activity: "Activity"
|
|
337
387
|
},
|
|
338
388
|
balance: {
|
|
339
|
-
availableBalance: "
|
|
389
|
+
availableBalance: "Withdrawable Balance",
|
|
390
|
+
manage: "Manage",
|
|
340
391
|
reservedForOpenOrders: (amount) => `${amount} reserved for open orders`,
|
|
341
392
|
positionsValue: "Positions Value",
|
|
342
393
|
kalshiBalance: "Kalshi Balance",
|
|
@@ -708,6 +759,7 @@ var enUsLabels = {
|
|
|
708
759
|
tradingAccessAddKalshiAccount: "Add Kalshi Account",
|
|
709
760
|
outcome: (label) => `Outcome: ${label}`,
|
|
710
761
|
smartRouting: "Smart Routing",
|
|
762
|
+
limitRoutingCurrentPrice: (priceLabel, feeLabel) => feeLabel ? `Current ${priceLabel} \xB7 Fee ${feeLabel}` : `Current ${priceLabel}`,
|
|
711
763
|
orderTypeMarket: "Market",
|
|
712
764
|
orderTypeLimit: "Limit",
|
|
713
765
|
orderTypeAria: "Order type",
|
|
@@ -733,6 +785,10 @@ var enUsLabels = {
|
|
|
733
785
|
limitOrderPlacedDescription: "Your limit order has been submitted.",
|
|
734
786
|
orderSplitting: "Order Splitting",
|
|
735
787
|
splitOrderDescription: "We split your order for the best price:",
|
|
788
|
+
maximizePayout: "Maximize payout",
|
|
789
|
+
maximizePayoutDescription: "We\u2019ll route your shares for the highest payout:",
|
|
790
|
+
venueInventory: (sharesLabel, priceLabel) => `${sharesLabel} \xB7 ${priceLabel}`,
|
|
791
|
+
insufficientVenueInventory: (sharesLabel, priceLabel) => `Only ${sharesLabel} \xB7 ${priceLabel}`,
|
|
736
792
|
viewAllRoutes: (count) => `View all (${count})`,
|
|
737
793
|
venueUnavailableInRegion: "Unavailable in your region",
|
|
738
794
|
verified: "Verified",
|
|
@@ -1172,7 +1228,8 @@ var executionKeys = {
|
|
|
1172
1228
|
claimableClosedPositionsCount: () => ["execution", "positions", "claimable-count"],
|
|
1173
1229
|
orders: (status, cursor, limit) => ["execution", "orders", status != null ? status : null, cursor != null ? cursor : null, limit != null ? limit : null],
|
|
1174
1230
|
ordersPrefix: () => ["execution", "orders"],
|
|
1175
|
-
depositAddresses: () => ["execution", "deposit-addresses"]
|
|
1231
|
+
depositAddresses: () => ["execution", "deposit-addresses"],
|
|
1232
|
+
balanceRefillPolicies: () => ["execution", "balance-refill-policies"]
|
|
1176
1233
|
};
|
|
1177
1234
|
|
|
1178
1235
|
// src/execution/balance-invalidation.ts
|
package/dist/withdraw.mjs
CHANGED
|
@@ -3,12 +3,12 @@ import {
|
|
|
3
3
|
useWithdrawFlow,
|
|
4
4
|
useWithdrawPreview,
|
|
5
5
|
useWithdrawalLifecycle
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-ZNY6BIDR.mjs";
|
|
7
7
|
import {
|
|
8
8
|
useDepositAddresses,
|
|
9
9
|
useManagedBalances,
|
|
10
10
|
useWithdrawManaged
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-XYWK7G2R.mjs";
|
|
12
12
|
export {
|
|
13
13
|
useDepositAddresses,
|
|
14
14
|
useManagedBalances,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agg-build/hooks",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "React hooks and providers for the AGG prediction market aggregator. Wraps @agg-build/sdk with TanStack Query, shared session state, and live WebSocket data.",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"license": "MIT",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"react": "^18.0.0 || ^19.0.0",
|
|
84
84
|
"viem": "^2.0.0",
|
|
85
85
|
"wagmi": "^3.0.0 || ^2.0.0",
|
|
86
|
-
"@agg-build/sdk": "^
|
|
86
|
+
"@agg-build/sdk": "^3.0.0"
|
|
87
87
|
},
|
|
88
88
|
"peerDependenciesMeta": {
|
|
89
89
|
"@solana/wallet-adapter-react": {
|