@agg-build/hooks 2.8.0 → 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-LOFGAX6T.mjs → chunk-MGWCWGMA.mjs} +1 -1
- package/dist/{chunk-3UEZQTMJ.mjs → chunk-XYWK7G2R.mjs} +32 -4
- package/dist/{chunk-X4MMFGU5.mjs → chunk-ZNY6BIDR.mjs} +1 -1
- package/dist/deposit.js +28 -1
- package/dist/deposit.mjs +2 -2
- package/dist/index.d.mts +31 -3
- package/dist/index.d.ts +31 -3
- package/dist/index.js +40 -7
- package/dist/index.mjs +11 -6
- package/dist/withdraw.js +28 -1
- package/dist/withdraw.mjs +2 -2
- package/package.json +2 -2
|
@@ -299,6 +299,28 @@ var enUsLabels = {
|
|
|
299
299
|
saved: "Refill settings saved.",
|
|
300
300
|
consent: "By enabling, you authorize AGG to move USDC between your managed wallets within these limits.",
|
|
301
301
|
lastRefill: "Latest refill",
|
|
302
|
+
manageTitle: "Manage balances",
|
|
303
|
+
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.",
|
|
304
|
+
noAutoRefill: "No auto-refill",
|
|
305
|
+
autoRefill: "Auto-refill",
|
|
306
|
+
minimumShortLabel: "Min",
|
|
307
|
+
refillToLabel: "Refill to",
|
|
308
|
+
unitLabel: "USDC",
|
|
309
|
+
resetAction: "Reset",
|
|
310
|
+
cancelAction: "Cancel",
|
|
311
|
+
saveChangesAction: "Save changes",
|
|
312
|
+
modalLoading: "Loading balances...",
|
|
313
|
+
modalEmptyTitle: "No supported networks",
|
|
314
|
+
modalEmptyDescription: "There are no supported networks to manage yet.",
|
|
315
|
+
modalLoadError: "Balances could not be loaded.",
|
|
316
|
+
requiredError: "Enter an amount.",
|
|
317
|
+
positiveError: "Enter an amount greater than 0.",
|
|
318
|
+
precisionError: "Use no more than 6 decimal places.",
|
|
319
|
+
relationshipError: "Refill to must be greater than or equal to Min.",
|
|
320
|
+
maximumError: (maximum) => `Enter an amount no greater than ${maximum} USDC.`,
|
|
321
|
+
createUnavailableError: "Auto-refill cannot be enabled for this network until refill limits are supported by the API.",
|
|
322
|
+
expandNetwork: (network) => `Expand ${network} balance settings`,
|
|
323
|
+
collapseNetwork: (network) => `Collapse ${network} balance settings`,
|
|
302
324
|
statuses: {
|
|
303
325
|
reserved: "Funds reserved",
|
|
304
326
|
executing: "Refill in progress",
|
|
@@ -509,7 +531,8 @@ var enUsLabels = {
|
|
|
509
531
|
activity: "Activity"
|
|
510
532
|
},
|
|
511
533
|
balance: {
|
|
512
|
-
availableBalance: "
|
|
534
|
+
availableBalance: "Withdrawable Balance",
|
|
535
|
+
manage: "Manage",
|
|
513
536
|
reservedForOpenOrders: (amount) => `${amount} reserved for open orders`,
|
|
514
537
|
positionsValue: "Positions Value",
|
|
515
538
|
kalshiBalance: "Kalshi Balance",
|
|
@@ -907,6 +930,10 @@ var enUsLabels = {
|
|
|
907
930
|
limitOrderPlacedDescription: "Your limit order has been submitted.",
|
|
908
931
|
orderSplitting: "Order Splitting",
|
|
909
932
|
splitOrderDescription: "We split your order for the best price:",
|
|
933
|
+
maximizePayout: "Maximize payout",
|
|
934
|
+
maximizePayoutDescription: "We\u2019ll route your shares for the highest payout:",
|
|
935
|
+
venueInventory: (sharesLabel, priceLabel) => `${sharesLabel} \xB7 ${priceLabel}`,
|
|
936
|
+
insufficientVenueInventory: (sharesLabel, priceLabel) => `Only ${sharesLabel} \xB7 ${priceLabel}`,
|
|
910
937
|
viewAllRoutes: (count) => `View all (${count})`,
|
|
911
938
|
venueUnavailableInRegion: "Unavailable in your region",
|
|
912
939
|
verified: "Verified",
|
|
@@ -1586,7 +1613,7 @@ function AggBalanceProvider({ children }) {
|
|
|
1586
1613
|
(a, b) => a.localeCompare(b)
|
|
1587
1614
|
);
|
|
1588
1615
|
}, [managedBalances.positions]);
|
|
1589
|
-
const balancesError = balancesQuery.error;
|
|
1616
|
+
const balancesError = managedBalancesData === void 0 ? balancesQuery.error : null;
|
|
1590
1617
|
const isBalancesLoading = balancesQuery.isLoading;
|
|
1591
1618
|
const refetchBalances = balancesQuery.refetch;
|
|
1592
1619
|
const totalBalance = useMemo(() => {
|
|
@@ -1672,11 +1699,12 @@ function AggBalanceProvider({ children }) {
|
|
|
1672
1699
|
}, [buildBalanceBreakdown]);
|
|
1673
1700
|
const positionsBalanceTotal = useMemo(() => {
|
|
1674
1701
|
const positions = managedBalances.positions;
|
|
1675
|
-
|
|
1702
|
+
const actualPositionsBalance = positions.reduce(
|
|
1676
1703
|
(sum, position) => sum + (Number.isFinite(position.balance) ? position.balance : 0),
|
|
1677
1704
|
0
|
|
1678
1705
|
);
|
|
1679
|
-
|
|
1706
|
+
return actualPositionsBalance + reservedBalance;
|
|
1707
|
+
}, [managedBalances.positions, reservedBalance]);
|
|
1680
1708
|
const kalshiVenueCash = (_a = managedBalances.venueCash) == null ? void 0 : _a.find((item) => item.venue === "kalshi");
|
|
1681
1709
|
const kalshiBalance = kalshiVenueCash ? kalshiVenueCash.balanceCents / 100 : null;
|
|
1682
1710
|
const kalshiPortfolioValue = (kalshiVenueCash == null ? void 0 : kalshiVenueCash.portfolioValueCents) == null ? null : kalshiVenueCash.portfolioValueCents / 100;
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
useOnWithdrawalLifecycle,
|
|
12
12
|
useSyncBalances,
|
|
13
13
|
useWithdrawManaged
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-XYWK7G2R.mjs";
|
|
15
15
|
|
|
16
16
|
// src/withdraw/use-withdraw-flow.ts
|
|
17
17
|
import { useCallback, useEffect, useMemo, useState } from "react";
|
package/dist/deposit.js
CHANGED
|
@@ -224,6 +224,28 @@ var enUsLabels = {
|
|
|
224
224
|
saved: "Refill settings saved.",
|
|
225
225
|
consent: "By enabling, you authorize AGG to move USDC between your managed wallets within these limits.",
|
|
226
226
|
lastRefill: "Latest refill",
|
|
227
|
+
manageTitle: "Manage balances",
|
|
228
|
+
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.",
|
|
229
|
+
noAutoRefill: "No auto-refill",
|
|
230
|
+
autoRefill: "Auto-refill",
|
|
231
|
+
minimumShortLabel: "Min",
|
|
232
|
+
refillToLabel: "Refill to",
|
|
233
|
+
unitLabel: "USDC",
|
|
234
|
+
resetAction: "Reset",
|
|
235
|
+
cancelAction: "Cancel",
|
|
236
|
+
saveChangesAction: "Save changes",
|
|
237
|
+
modalLoading: "Loading balances...",
|
|
238
|
+
modalEmptyTitle: "No supported networks",
|
|
239
|
+
modalEmptyDescription: "There are no supported networks to manage yet.",
|
|
240
|
+
modalLoadError: "Balances could not be loaded.",
|
|
241
|
+
requiredError: "Enter an amount.",
|
|
242
|
+
positiveError: "Enter an amount greater than 0.",
|
|
243
|
+
precisionError: "Use no more than 6 decimal places.",
|
|
244
|
+
relationshipError: "Refill to must be greater than or equal to Min.",
|
|
245
|
+
maximumError: (maximum) => `Enter an amount no greater than ${maximum} USDC.`,
|
|
246
|
+
createUnavailableError: "Auto-refill cannot be enabled for this network until refill limits are supported by the API.",
|
|
247
|
+
expandNetwork: (network) => `Expand ${network} balance settings`,
|
|
248
|
+
collapseNetwork: (network) => `Collapse ${network} balance settings`,
|
|
227
249
|
statuses: {
|
|
228
250
|
reserved: "Funds reserved",
|
|
229
251
|
executing: "Refill in progress",
|
|
@@ -434,7 +456,8 @@ var enUsLabels = {
|
|
|
434
456
|
activity: "Activity"
|
|
435
457
|
},
|
|
436
458
|
balance: {
|
|
437
|
-
availableBalance: "
|
|
459
|
+
availableBalance: "Withdrawable Balance",
|
|
460
|
+
manage: "Manage",
|
|
438
461
|
reservedForOpenOrders: (amount) => `${amount} reserved for open orders`,
|
|
439
462
|
positionsValue: "Positions Value",
|
|
440
463
|
kalshiBalance: "Kalshi Balance",
|
|
@@ -832,6 +855,10 @@ var enUsLabels = {
|
|
|
832
855
|
limitOrderPlacedDescription: "Your limit order has been submitted.",
|
|
833
856
|
orderSplitting: "Order Splitting",
|
|
834
857
|
splitOrderDescription: "We split your order for the best price:",
|
|
858
|
+
maximizePayout: "Maximize payout",
|
|
859
|
+
maximizePayoutDescription: "We\u2019ll route your shares for the highest payout:",
|
|
860
|
+
venueInventory: (sharesLabel, priceLabel) => `${sharesLabel} \xB7 ${priceLabel}`,
|
|
861
|
+
insufficientVenueInventory: (sharesLabel, priceLabel) => `Only ${sharesLabel} \xB7 ${priceLabel}`,
|
|
835
862
|
viewAllRoutes: (count) => `View all (${count})`,
|
|
836
863
|
venueUnavailableInRegion: "Unavailable in your region",
|
|
837
864
|
verified: "Verified",
|
package/dist/deposit.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useRampQuotes,
|
|
3
3
|
useRampSession
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-MGWCWGMA.mjs";
|
|
5
5
|
import {
|
|
6
6
|
__async,
|
|
7
7
|
useAggAuthState,
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
useDepositAddresses,
|
|
12
12
|
useOptionalAggClient,
|
|
13
13
|
useSyncBalances
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-XYWK7G2R.mjs";
|
|
15
15
|
|
|
16
16
|
// src/deposit/normalize-wallet-error.ts
|
|
17
17
|
function normalizeWalletError(error, supportedChains) {
|
package/dist/index.d.mts
CHANGED
|
@@ -583,6 +583,28 @@ interface AggUiLabels {
|
|
|
583
583
|
saved: string;
|
|
584
584
|
consent: string;
|
|
585
585
|
lastRefill: string;
|
|
586
|
+
manageTitle: string;
|
|
587
|
+
manageDescription: string;
|
|
588
|
+
noAutoRefill: string;
|
|
589
|
+
autoRefill: string;
|
|
590
|
+
minimumShortLabel: string;
|
|
591
|
+
refillToLabel: string;
|
|
592
|
+
unitLabel: string;
|
|
593
|
+
resetAction: string;
|
|
594
|
+
cancelAction: string;
|
|
595
|
+
saveChangesAction: string;
|
|
596
|
+
modalLoading: string;
|
|
597
|
+
modalEmptyTitle: string;
|
|
598
|
+
modalEmptyDescription: string;
|
|
599
|
+
modalLoadError: string;
|
|
600
|
+
requiredError: string;
|
|
601
|
+
positiveError: string;
|
|
602
|
+
precisionError: string;
|
|
603
|
+
relationshipError: string;
|
|
604
|
+
maximumError: (maximum: string) => string;
|
|
605
|
+
createUnavailableError: string;
|
|
606
|
+
expandNetwork: (network: string) => string;
|
|
607
|
+
collapseNetwork: (network: string) => string;
|
|
586
608
|
statuses: {
|
|
587
609
|
reserved: string;
|
|
588
610
|
executing: string;
|
|
@@ -796,6 +818,7 @@ interface AggUiLabels {
|
|
|
796
818
|
};
|
|
797
819
|
balance: {
|
|
798
820
|
availableBalance: string;
|
|
821
|
+
manage: string;
|
|
799
822
|
reservedForOpenOrders: (amount: string) => string;
|
|
800
823
|
positionsValue: string;
|
|
801
824
|
kalshiBalance: string;
|
|
@@ -1228,6 +1251,10 @@ interface AggUiLabels {
|
|
|
1228
1251
|
limitOrderPlacedDescription: string;
|
|
1229
1252
|
orderSplitting: string;
|
|
1230
1253
|
splitOrderDescription: string;
|
|
1254
|
+
maximizePayout: string;
|
|
1255
|
+
maximizePayoutDescription: string;
|
|
1256
|
+
venueInventory: (sharesLabel: string, priceLabel: string) => string;
|
|
1257
|
+
insufficientVenueInventory: (sharesLabel: string, priceLabel: string) => string;
|
|
1231
1258
|
viewAllRoutes: (count: number) => string;
|
|
1232
1259
|
venueUnavailableInRegion: string;
|
|
1233
1260
|
verified: string;
|
|
@@ -1804,12 +1831,13 @@ interface AggBalanceContextValue {
|
|
|
1804
1831
|
availableBalanceBreakdown: AggBalanceBreakdownItem[];
|
|
1805
1832
|
/** Raw response from GET /execution/balances for direct consumer use. */
|
|
1806
1833
|
managedBalances: UnifiedBalanceResponse;
|
|
1807
|
-
/** Total cash, including
|
|
1834
|
+
/** Total cash, including reserved or otherwise held funds. */
|
|
1808
1835
|
totalBalance: number;
|
|
1809
1836
|
/** Cash immediately available for a new trade or withdrawal. */
|
|
1810
1837
|
availableBalance: number;
|
|
1811
|
-
/** Cash currently
|
|
1838
|
+
/** Cash currently held by active execution reservations. */
|
|
1812
1839
|
reservedBalance: number;
|
|
1840
|
+
/** Marked position value plus reserved cash presented as open-order exposure. */
|
|
1813
1841
|
positionsBalanceTotal: number;
|
|
1814
1842
|
kalshiBalance: number | null;
|
|
1815
1843
|
kalshiPortfolioValue: number | null;
|
|
@@ -5654,7 +5682,7 @@ interface UseVenueMarketsOptions {
|
|
|
5654
5682
|
/** Enable/disable the query. Default true. */
|
|
5655
5683
|
enabled?: boolean;
|
|
5656
5684
|
/** Sort by this field. */
|
|
5657
|
-
sortBy?: "volume" | "volume24hr" | "createdAt" | "
|
|
5685
|
+
sortBy?: "volume" | "volume24hr" | "createdAt" | "updatedAt";
|
|
5658
5686
|
/** Sort direction: "asc" or "desc". */
|
|
5659
5687
|
sortDir?: "asc" | "desc";
|
|
5660
5688
|
/** Sort surface. "list" makes axis/dates events sort by volume (matches the
|
package/dist/index.d.ts
CHANGED
|
@@ -583,6 +583,28 @@ interface AggUiLabels {
|
|
|
583
583
|
saved: string;
|
|
584
584
|
consent: string;
|
|
585
585
|
lastRefill: string;
|
|
586
|
+
manageTitle: string;
|
|
587
|
+
manageDescription: string;
|
|
588
|
+
noAutoRefill: string;
|
|
589
|
+
autoRefill: string;
|
|
590
|
+
minimumShortLabel: string;
|
|
591
|
+
refillToLabel: string;
|
|
592
|
+
unitLabel: string;
|
|
593
|
+
resetAction: string;
|
|
594
|
+
cancelAction: string;
|
|
595
|
+
saveChangesAction: string;
|
|
596
|
+
modalLoading: string;
|
|
597
|
+
modalEmptyTitle: string;
|
|
598
|
+
modalEmptyDescription: string;
|
|
599
|
+
modalLoadError: string;
|
|
600
|
+
requiredError: string;
|
|
601
|
+
positiveError: string;
|
|
602
|
+
precisionError: string;
|
|
603
|
+
relationshipError: string;
|
|
604
|
+
maximumError: (maximum: string) => string;
|
|
605
|
+
createUnavailableError: string;
|
|
606
|
+
expandNetwork: (network: string) => string;
|
|
607
|
+
collapseNetwork: (network: string) => string;
|
|
586
608
|
statuses: {
|
|
587
609
|
reserved: string;
|
|
588
610
|
executing: string;
|
|
@@ -796,6 +818,7 @@ interface AggUiLabels {
|
|
|
796
818
|
};
|
|
797
819
|
balance: {
|
|
798
820
|
availableBalance: string;
|
|
821
|
+
manage: string;
|
|
799
822
|
reservedForOpenOrders: (amount: string) => string;
|
|
800
823
|
positionsValue: string;
|
|
801
824
|
kalshiBalance: string;
|
|
@@ -1228,6 +1251,10 @@ interface AggUiLabels {
|
|
|
1228
1251
|
limitOrderPlacedDescription: string;
|
|
1229
1252
|
orderSplitting: string;
|
|
1230
1253
|
splitOrderDescription: string;
|
|
1254
|
+
maximizePayout: string;
|
|
1255
|
+
maximizePayoutDescription: string;
|
|
1256
|
+
venueInventory: (sharesLabel: string, priceLabel: string) => string;
|
|
1257
|
+
insufficientVenueInventory: (sharesLabel: string, priceLabel: string) => string;
|
|
1231
1258
|
viewAllRoutes: (count: number) => string;
|
|
1232
1259
|
venueUnavailableInRegion: string;
|
|
1233
1260
|
verified: string;
|
|
@@ -1804,12 +1831,13 @@ interface AggBalanceContextValue {
|
|
|
1804
1831
|
availableBalanceBreakdown: AggBalanceBreakdownItem[];
|
|
1805
1832
|
/** Raw response from GET /execution/balances for direct consumer use. */
|
|
1806
1833
|
managedBalances: UnifiedBalanceResponse;
|
|
1807
|
-
/** Total cash, including
|
|
1834
|
+
/** Total cash, including reserved or otherwise held funds. */
|
|
1808
1835
|
totalBalance: number;
|
|
1809
1836
|
/** Cash immediately available for a new trade or withdrawal. */
|
|
1810
1837
|
availableBalance: number;
|
|
1811
|
-
/** Cash currently
|
|
1838
|
+
/** Cash currently held by active execution reservations. */
|
|
1812
1839
|
reservedBalance: number;
|
|
1840
|
+
/** Marked position value plus reserved cash presented as open-order exposure. */
|
|
1813
1841
|
positionsBalanceTotal: number;
|
|
1814
1842
|
kalshiBalance: number | null;
|
|
1815
1843
|
kalshiPortfolioValue: number | null;
|
|
@@ -5654,7 +5682,7 @@ interface UseVenueMarketsOptions {
|
|
|
5654
5682
|
/** Enable/disable the query. Default true. */
|
|
5655
5683
|
enabled?: boolean;
|
|
5656
5684
|
/** Sort by this field. */
|
|
5657
|
-
sortBy?: "volume" | "volume24hr" | "createdAt" | "
|
|
5685
|
+
sortBy?: "volume" | "volume24hr" | "createdAt" | "updatedAt";
|
|
5658
5686
|
/** Sort direction: "asc" or "desc". */
|
|
5659
5687
|
sortDir?: "asc" | "desc";
|
|
5660
5688
|
/** Sort surface. "list" makes axis/dates events sort by volume (matches the
|
package/dist/index.js
CHANGED
|
@@ -640,6 +640,28 @@ var enUsLabels = {
|
|
|
640
640
|
saved: "Refill settings saved.",
|
|
641
641
|
consent: "By enabling, you authorize AGG to move USDC between your managed wallets within these limits.",
|
|
642
642
|
lastRefill: "Latest refill",
|
|
643
|
+
manageTitle: "Manage balances",
|
|
644
|
+
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.",
|
|
645
|
+
noAutoRefill: "No auto-refill",
|
|
646
|
+
autoRefill: "Auto-refill",
|
|
647
|
+
minimumShortLabel: "Min",
|
|
648
|
+
refillToLabel: "Refill to",
|
|
649
|
+
unitLabel: "USDC",
|
|
650
|
+
resetAction: "Reset",
|
|
651
|
+
cancelAction: "Cancel",
|
|
652
|
+
saveChangesAction: "Save changes",
|
|
653
|
+
modalLoading: "Loading balances...",
|
|
654
|
+
modalEmptyTitle: "No supported networks",
|
|
655
|
+
modalEmptyDescription: "There are no supported networks to manage yet.",
|
|
656
|
+
modalLoadError: "Balances could not be loaded.",
|
|
657
|
+
requiredError: "Enter an amount.",
|
|
658
|
+
positiveError: "Enter an amount greater than 0.",
|
|
659
|
+
precisionError: "Use no more than 6 decimal places.",
|
|
660
|
+
relationshipError: "Refill to must be greater than or equal to Min.",
|
|
661
|
+
maximumError: (maximum) => `Enter an amount no greater than ${maximum} USDC.`,
|
|
662
|
+
createUnavailableError: "Auto-refill cannot be enabled for this network until refill limits are supported by the API.",
|
|
663
|
+
expandNetwork: (network) => `Expand ${network} balance settings`,
|
|
664
|
+
collapseNetwork: (network) => `Collapse ${network} balance settings`,
|
|
643
665
|
statuses: {
|
|
644
666
|
reserved: "Funds reserved",
|
|
645
667
|
executing: "Refill in progress",
|
|
@@ -850,7 +872,8 @@ var enUsLabels = {
|
|
|
850
872
|
activity: "Activity"
|
|
851
873
|
},
|
|
852
874
|
balance: {
|
|
853
|
-
availableBalance: "
|
|
875
|
+
availableBalance: "Withdrawable Balance",
|
|
876
|
+
manage: "Manage",
|
|
854
877
|
reservedForOpenOrders: (amount) => `${amount} reserved for open orders`,
|
|
855
878
|
positionsValue: "Positions Value",
|
|
856
879
|
kalshiBalance: "Kalshi Balance",
|
|
@@ -1248,6 +1271,10 @@ var enUsLabels = {
|
|
|
1248
1271
|
limitOrderPlacedDescription: "Your limit order has been submitted.",
|
|
1249
1272
|
orderSplitting: "Order Splitting",
|
|
1250
1273
|
splitOrderDescription: "We split your order for the best price:",
|
|
1274
|
+
maximizePayout: "Maximize payout",
|
|
1275
|
+
maximizePayoutDescription: "We\u2019ll route your shares for the highest payout:",
|
|
1276
|
+
venueInventory: (sharesLabel, priceLabel) => `${sharesLabel} \xB7 ${priceLabel}`,
|
|
1277
|
+
insufficientVenueInventory: (sharesLabel, priceLabel) => `Only ${sharesLabel} \xB7 ${priceLabel}`,
|
|
1251
1278
|
viewAllRoutes: (count) => `View all (${count})`,
|
|
1252
1279
|
venueUnavailableInRegion: "Unavailable in your region",
|
|
1253
1280
|
verified: "Verified",
|
|
@@ -2168,7 +2195,7 @@ function AggBalanceProvider({ children }) {
|
|
|
2168
2195
|
(a, b) => a.localeCompare(b)
|
|
2169
2196
|
);
|
|
2170
2197
|
}, [managedBalances.positions]);
|
|
2171
|
-
const balancesError = balancesQuery.error;
|
|
2198
|
+
const balancesError = managedBalancesData === void 0 ? balancesQuery.error : null;
|
|
2172
2199
|
const isBalancesLoading = balancesQuery.isLoading;
|
|
2173
2200
|
const refetchBalances = balancesQuery.refetch;
|
|
2174
2201
|
const totalBalance = (0, import_react3.useMemo)(() => {
|
|
@@ -2254,11 +2281,12 @@ function AggBalanceProvider({ children }) {
|
|
|
2254
2281
|
}, [buildBalanceBreakdown]);
|
|
2255
2282
|
const positionsBalanceTotal = (0, import_react3.useMemo)(() => {
|
|
2256
2283
|
const positions = managedBalances.positions;
|
|
2257
|
-
|
|
2284
|
+
const actualPositionsBalance = positions.reduce(
|
|
2258
2285
|
(sum, position) => sum + (Number.isFinite(position.balance) ? position.balance : 0),
|
|
2259
2286
|
0
|
|
2260
2287
|
);
|
|
2261
|
-
|
|
2288
|
+
return actualPositionsBalance + reservedBalance;
|
|
2289
|
+
}, [managedBalances.positions, reservedBalance]);
|
|
2262
2290
|
const kalshiVenueCash = (_a = managedBalances.venueCash) == null ? void 0 : _a.find((item) => item.venue === "kalshi");
|
|
2263
2291
|
const kalshiBalance = kalshiVenueCash ? kalshiVenueCash.balanceCents / 100 : null;
|
|
2264
2292
|
const kalshiPortfolioValue = (kalshiVenueCash == null ? void 0 : kalshiVenueCash.portfolioValueCents) == null ? null : kalshiVenueCash.portfolioValueCents / 100;
|
|
@@ -7861,7 +7889,9 @@ function useSmartRoute(options) {
|
|
|
7861
7889
|
refetchInterval: (queryState) => {
|
|
7862
7890
|
var _a2, _b2, _c2, _d2;
|
|
7863
7891
|
return resolveSmartRouteRefetchInterval({
|
|
7864
|
-
|
|
7892
|
+
// SELL already fans out into one quote per venue. Keep that group on a
|
|
7893
|
+
// stable cadence instead of multiplying the adaptive 5s/refreshAt poll.
|
|
7894
|
+
data: tradeSide === "sell" ? void 0 : queryState.state.data,
|
|
7865
7895
|
defaultIntervalMs: staleTimeMs,
|
|
7866
7896
|
isDocumentVisible: getIsDocumentVisible(),
|
|
7867
7897
|
isEditing: (_a2 = refreshContext == null ? void 0 : refreshContext.isEditing) != null ? _a2 : false,
|
|
@@ -8080,10 +8110,13 @@ var useVenueSellQuotes = (options) => {
|
|
|
8080
8110
|
}),
|
|
8081
8111
|
enabled: queryEnabled,
|
|
8082
8112
|
staleTime: staleTimeMs,
|
|
8083
|
-
refetchInterval: (
|
|
8113
|
+
refetchInterval: (_queryState) => {
|
|
8084
8114
|
var _a2, _b2, _c, _d;
|
|
8085
8115
|
return resolveSmartRouteRefetchInterval({
|
|
8086
|
-
|
|
8116
|
+
// Venue quotes are display companions to the aggregate SELL quote.
|
|
8117
|
+
// Poll them at the normal cadence rather than independently
|
|
8118
|
+
// accelerating every venue to the thin-liquidity interval.
|
|
8119
|
+
data: void 0,
|
|
8087
8120
|
defaultIntervalMs: staleTimeMs,
|
|
8088
8121
|
isDocumentVisible: getIsDocumentVisible3(),
|
|
8089
8122
|
isEditing: (_a2 = refreshContext == null ? void 0 : refreshContext.isEditing) != null ? _a2 : false,
|
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,
|
|
@@ -98,7 +98,7 @@ import {
|
|
|
98
98
|
useSyncBalances,
|
|
99
99
|
useWithdrawManaged,
|
|
100
100
|
userActivityQueryKeys
|
|
101
|
-
} from "./chunk-
|
|
101
|
+
} from "./chunk-XYWK7G2R.mjs";
|
|
102
102
|
|
|
103
103
|
// src/index.ts
|
|
104
104
|
import { QueryClient as QueryClient4, QueryClientProvider, useQueryClient as useQueryClient3 } from "@tanstack/react-query";
|
|
@@ -2355,7 +2355,9 @@ function useSmartRoute(options) {
|
|
|
2355
2355
|
refetchInterval: (queryState) => {
|
|
2356
2356
|
var _a2, _b2, _c2, _d2;
|
|
2357
2357
|
return resolveSmartRouteRefetchInterval({
|
|
2358
|
-
|
|
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,
|
|
2359
2361
|
defaultIntervalMs: staleTimeMs,
|
|
2360
2362
|
isDocumentVisible: getIsDocumentVisible(),
|
|
2361
2363
|
isEditing: (_a2 = refreshContext == null ? void 0 : refreshContext.isEditing) != null ? _a2 : false,
|
|
@@ -2574,10 +2576,13 @@ var useVenueSellQuotes = (options) => {
|
|
|
2574
2576
|
}),
|
|
2575
2577
|
enabled: queryEnabled,
|
|
2576
2578
|
staleTime: staleTimeMs,
|
|
2577
|
-
refetchInterval: (
|
|
2579
|
+
refetchInterval: (_queryState) => {
|
|
2578
2580
|
var _a2, _b2, _c, _d;
|
|
2579
2581
|
return resolveSmartRouteRefetchInterval({
|
|
2580
|
-
|
|
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,
|
|
2581
2586
|
defaultIntervalMs: staleTimeMs,
|
|
2582
2587
|
isDocumentVisible: getIsDocumentVisible3(),
|
|
2583
2588
|
isEditing: (_a2 = refreshContext == null ? void 0 : refreshContext.isEditing) != null ? _a2 : false,
|
package/dist/withdraw.js
CHANGED
|
@@ -154,6 +154,28 @@ var enUsLabels = {
|
|
|
154
154
|
saved: "Refill settings saved.",
|
|
155
155
|
consent: "By enabling, you authorize AGG to move USDC between your managed wallets within these limits.",
|
|
156
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`,
|
|
157
179
|
statuses: {
|
|
158
180
|
reserved: "Funds reserved",
|
|
159
181
|
executing: "Refill in progress",
|
|
@@ -364,7 +386,8 @@ var enUsLabels = {
|
|
|
364
386
|
activity: "Activity"
|
|
365
387
|
},
|
|
366
388
|
balance: {
|
|
367
|
-
availableBalance: "
|
|
389
|
+
availableBalance: "Withdrawable Balance",
|
|
390
|
+
manage: "Manage",
|
|
368
391
|
reservedForOpenOrders: (amount) => `${amount} reserved for open orders`,
|
|
369
392
|
positionsValue: "Positions Value",
|
|
370
393
|
kalshiBalance: "Kalshi Balance",
|
|
@@ -762,6 +785,10 @@ var enUsLabels = {
|
|
|
762
785
|
limitOrderPlacedDescription: "Your limit order has been submitted.",
|
|
763
786
|
orderSplitting: "Order Splitting",
|
|
764
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}`,
|
|
765
792
|
viewAllRoutes: (count) => `View all (${count})`,
|
|
766
793
|
venueUnavailableInRegion: "Unavailable in your region",
|
|
767
794
|
verified: "Verified",
|
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": {
|