@agg-build/ui 2.0.0 → 2.1.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-2UKDQ7WP.mjs → chunk-3OI2ZLLT.mjs} +94 -39
- package/dist/{chunk-4CM4F4S6.mjs → chunk-C5M2OOM3.mjs} +1 -1
- package/dist/{chunk-2ZS3BPSF.mjs → chunk-DXF2LMNN.mjs} +132 -81
- package/dist/{chunk-RWOF44TC.mjs → chunk-R6FBYAY5.mjs} +239 -183
- package/dist/{chunk-RF2EPYLN.mjs → chunk-Y6PVXAUQ.mjs} +27 -77
- package/dist/{chunk-R3U6YXSQ.mjs → chunk-YAEA6EDG.mjs} +31 -18
- package/dist/{chunk-HH7L3KLS.mjs → chunk-YMVD6Q2A.mjs} +1 -1
- package/dist/events.js +497 -462
- package/dist/events.mjs +3 -3
- package/dist/index.js +2116 -1990
- package/dist/index.mjs +9 -7
- package/dist/modals.js +278 -171
- package/dist/modals.mjs +5 -3
- package/dist/pages.js +1557 -1487
- package/dist/pages.mjs +6 -6
- package/dist/primitives.js +137 -86
- package/dist/primitives.mjs +1 -1
- package/dist/styles.css +1 -1
- package/dist/tailwind.css +1 -1
- package/dist/trading.js +28 -15
- package/dist/trading.mjs +4 -4
- package/dist/types/events/list/category-sidebar.d.mts +33 -0
- package/dist/types/events/list/category-sidebar.d.ts +33 -0
- package/dist/types/events/list/event-list-tabs.d.mts +2 -0
- package/dist/types/events/list/event-list-tabs.d.ts +2 -0
- package/dist/types/events/list/index.d.mts +1 -0
- package/dist/types/events/list/index.d.ts +1 -0
- package/dist/types/pages/event-market/event-market.types.d.mts +1 -0
- package/dist/types/pages/event-market/event-market.types.d.ts +1 -0
- package/dist/types/pages/user-profile/index.d.mts +1 -1
- package/dist/types/pages/user-profile/index.d.ts +1 -1
- package/dist/types/pages/user-profile/user-profile.types.d.mts +1 -0
- package/dist/types/pages/user-profile/user-profile.types.d.ts +1 -0
- package/dist/types/shared/use-horizontal-scroll-state.d.mts +15 -0
- package/dist/types/shared/use-horizontal-scroll-state.d.ts +15 -0
- package/dist/types/withdraw/index.d.mts +9 -1
- package/dist/types/withdraw/index.d.ts +9 -1
- package/dist/types/withdraw/steps/withdraw-amount.d.mts +10 -1
- package/dist/types/withdraw/steps/withdraw-amount.d.ts +10 -1
- package/dist/types/withdraw/withdraw-modal.types.d.mts +8 -0
- package/dist/types/withdraw/withdraw-modal.types.d.ts +8 -0
- package/package.json +3 -3
|
@@ -10,13 +10,13 @@ import {
|
|
|
10
10
|
isErrorWithStatus,
|
|
11
11
|
useEventListTabs,
|
|
12
12
|
useEventListTabsHeaderOverflow
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-R6FBYAY5.mjs";
|
|
14
14
|
import {
|
|
15
15
|
DEPOSIT_MODAL_OPEN_EVENT,
|
|
16
16
|
PlaceOrder,
|
|
17
17
|
SettlementDetails,
|
|
18
18
|
WITHDRAW_MODAL_OPEN_EVENT
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-YAEA6EDG.mjs";
|
|
20
20
|
import {
|
|
21
21
|
AggErrorBoundary,
|
|
22
22
|
Button,
|
|
@@ -47,7 +47,7 @@ import {
|
|
|
47
47
|
shortenAddress,
|
|
48
48
|
sortCategoriesForNavigation,
|
|
49
49
|
useOptionalToast
|
|
50
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-DXF2LMNN.mjs";
|
|
51
51
|
|
|
52
52
|
// src/pages/home/index.tsx
|
|
53
53
|
import {
|
|
@@ -185,6 +185,7 @@ var resolveMobileTradePlaceOrderClassNames = (classNames) => {
|
|
|
185
185
|
var EventMarketPageMobileTrade = ({
|
|
186
186
|
classNames,
|
|
187
187
|
eventTradingState,
|
|
188
|
+
executionMode,
|
|
188
189
|
showPlaceOrder = true,
|
|
189
190
|
isOpen,
|
|
190
191
|
onOpenChange,
|
|
@@ -226,6 +227,7 @@ var EventMarketPageMobileTrade = ({
|
|
|
226
227
|
PlaceOrder,
|
|
227
228
|
{
|
|
228
229
|
eventTradingState,
|
|
230
|
+
executionMode,
|
|
229
231
|
midpointsResult,
|
|
230
232
|
className: cn(
|
|
231
233
|
"agg-mobile-trade-panel w-full overflow-hidden rounded-t-agg-2xl sm:rounded-agg-xl",
|
|
@@ -281,7 +283,7 @@ var EventMarketPageLoadingState = ({
|
|
|
281
283
|
{
|
|
282
284
|
className: cn(
|
|
283
285
|
"agg-event-market-page",
|
|
284
|
-
"w-full mx-auto max-w-[
|
|
286
|
+
"w-full mx-auto max-w-[1440px] px-6 lg:px-10 pb-10",
|
|
285
287
|
classNames == null ? void 0 : classNames.root
|
|
286
288
|
),
|
|
287
289
|
children: /* @__PURE__ */ jsxs(
|
|
@@ -353,6 +355,7 @@ var EventMarketPageContent = ({
|
|
|
353
355
|
classNames,
|
|
354
356
|
ariaLabel,
|
|
355
357
|
showPlaceOrder,
|
|
358
|
+
executionMode,
|
|
356
359
|
stickyOrderPanel,
|
|
357
360
|
resolvedClaim
|
|
358
361
|
}) => {
|
|
@@ -380,7 +383,7 @@ var EventMarketPageContent = ({
|
|
|
380
383
|
{
|
|
381
384
|
className: cn(
|
|
382
385
|
"agg-event-market-page",
|
|
383
|
-
"w-full mx-auto max-w-[
|
|
386
|
+
"w-full mx-auto max-w-[1440px] px-6 lg:px-10 pb-10",
|
|
384
387
|
classNames == null ? void 0 : classNames.root
|
|
385
388
|
),
|
|
386
389
|
"aria-label": ariaLabel != null ? ariaLabel : event.title,
|
|
@@ -440,6 +443,7 @@ var EventMarketPageContent = ({
|
|
|
440
443
|
PlaceOrder,
|
|
441
444
|
{
|
|
442
445
|
eventTradingState,
|
|
446
|
+
executionMode,
|
|
443
447
|
resolvedClaim,
|
|
444
448
|
midpointsResult,
|
|
445
449
|
className: cn(
|
|
@@ -465,6 +469,7 @@ var EventMarketPageContent = ({
|
|
|
465
469
|
PlaceOrder,
|
|
466
470
|
{
|
|
467
471
|
eventTradingState,
|
|
472
|
+
executionMode,
|
|
468
473
|
resolvedClaim,
|
|
469
474
|
midpointsResult,
|
|
470
475
|
className: cn(stickyOrderPanelState == null ? void 0 : stickyOrderPanelState.placeOrder, classNames == null ? void 0 : classNames.trade),
|
|
@@ -481,6 +486,7 @@ var EventMarketPageContent = ({
|
|
|
481
486
|
{
|
|
482
487
|
classNames,
|
|
483
488
|
eventTradingState,
|
|
489
|
+
executionMode,
|
|
484
490
|
showPlaceOrder,
|
|
485
491
|
isOpen: isMobileTradeOpen,
|
|
486
492
|
onOpenChange: setIsMobileTradeOpen,
|
|
@@ -1043,7 +1049,7 @@ var HomePage = ({
|
|
|
1043
1049
|
"w-full bg-agg-secondary border-b border-agg-separator h-14! md:h-15!",
|
|
1044
1050
|
classNames == null ? void 0 : classNames.header
|
|
1045
1051
|
),
|
|
1046
|
-
children: /* @__PURE__ */ jsx2("div", { className: "mx-auto h-full w-full max-w-[
|
|
1052
|
+
children: /* @__PURE__ */ jsx2("div", { className: "mx-auto h-full w-full max-w-[1440px] px-6 lg:px-10", children: /* @__PURE__ */ jsx2(
|
|
1047
1053
|
Tabs,
|
|
1048
1054
|
{
|
|
1049
1055
|
ariaLabel: labels.home.categoryTabsAria,
|
|
@@ -1061,7 +1067,7 @@ var HomePage = ({
|
|
|
1061
1067
|
"div",
|
|
1062
1068
|
{
|
|
1063
1069
|
className: cn(
|
|
1064
|
-
"w-full mx-auto px-6 lg:px-10 max-w-[
|
|
1070
|
+
"w-full mx-auto px-6 lg:px-10 max-w-[1440px]",
|
|
1065
1071
|
"pt-4 sm:pt-6 md:pt-8 pb-10"
|
|
1066
1072
|
),
|
|
1067
1073
|
children: [
|
|
@@ -1143,7 +1149,6 @@ import {
|
|
|
1143
1149
|
useAggAuthState,
|
|
1144
1150
|
useAggBalance,
|
|
1145
1151
|
useAggClient,
|
|
1146
|
-
useDepositAddresses,
|
|
1147
1152
|
useExecutionOrders,
|
|
1148
1153
|
useExecutionPositions,
|
|
1149
1154
|
useGeoBlock,
|
|
@@ -3354,7 +3359,6 @@ var toSignedAmountLabel = (sign, executionPrice, filledAmountRaw) => {
|
|
|
3354
3359
|
const amountLabel = toAmountLabel(executionPrice, filledAmountRaw);
|
|
3355
3360
|
return amountLabel === "-" ? amountLabel : `${sign}${amountLabel}`;
|
|
3356
3361
|
};
|
|
3357
|
-
var SVM_CHAIN_IDS = /* @__PURE__ */ new Set(["792703809"]);
|
|
3358
3362
|
var OPEN_ORDER_STATUSES = /* @__PURE__ */ new Set([
|
|
3359
3363
|
"pending",
|
|
3360
3364
|
"signing",
|
|
@@ -3465,44 +3469,6 @@ var shouldFetchFullUserProfile = (userProfile) => {
|
|
|
3465
3469
|
if (!userProfile) return true;
|
|
3466
3470
|
return !userProfile.username && !userProfile.avatarUrl && ((_b = (_a = userProfile.accounts) == null ? void 0 : _a.length) != null ? _b : 0) === 0 && ((_d = (_c = userProfile.wallets) == null ? void 0 : _c.length) != null ? _d : 0) === 0;
|
|
3467
3471
|
};
|
|
3468
|
-
var normalizeAddress = (address) => {
|
|
3469
|
-
const trimmed = address == null ? void 0 : address.trim();
|
|
3470
|
-
return trimmed ? trimmed.toLowerCase() : void 0;
|
|
3471
|
-
};
|
|
3472
|
-
var toNumericChainId = (chainId) => {
|
|
3473
|
-
const parsed = Number(chainId);
|
|
3474
|
-
return Number.isFinite(parsed) ? parsed : void 0;
|
|
3475
|
-
};
|
|
3476
|
-
var getConnectedWalletAccountAddresses = (userProfile) => {
|
|
3477
|
-
var _a;
|
|
3478
|
-
const accounts = (_a = userProfile == null ? void 0 : userProfile.accounts) != null ? _a : [];
|
|
3479
|
-
const walletAccounts = accounts.filter((account) => {
|
|
3480
|
-
var _a2;
|
|
3481
|
-
const provider = (_a2 = account.provider) == null ? void 0 : _a2.toLowerCase();
|
|
3482
|
-
return provider === "wallet" || provider === "solana_wallet";
|
|
3483
|
-
});
|
|
3484
|
-
return new Set(
|
|
3485
|
-
walletAccounts.map((account) => normalizeAddress(account.providerAccountId)).filter((address) => !!address)
|
|
3486
|
-
);
|
|
3487
|
-
};
|
|
3488
|
-
var resolveDepositActivitySource = ({
|
|
3489
|
-
fromAddress,
|
|
3490
|
-
chainId,
|
|
3491
|
-
connectedWalletAddresses,
|
|
3492
|
-
depositAddress
|
|
3493
|
-
}) => {
|
|
3494
|
-
const normalizedFromAddress = normalizeAddress(fromAddress);
|
|
3495
|
-
if (normalizedFromAddress && connectedWalletAddresses.has(normalizedFromAddress)) {
|
|
3496
|
-
return "wallet";
|
|
3497
|
-
}
|
|
3498
|
-
if (normalizedFromAddress && normalizedFromAddress === normalizeAddress(depositAddress)) {
|
|
3499
|
-
return "crypto";
|
|
3500
|
-
}
|
|
3501
|
-
if (SVM_CHAIN_IDS.has(chainId.trim())) {
|
|
3502
|
-
return "wallet";
|
|
3503
|
-
}
|
|
3504
|
-
return "crypto";
|
|
3505
|
-
};
|
|
3506
3472
|
var toTradeThumbnailSrc = (item, orders) => {
|
|
3507
3473
|
var _a, _b, _c;
|
|
3508
3474
|
if ((_a = item.venueMarket) == null ? void 0 : _a.image) return item.venueMarket.image;
|
|
@@ -3571,6 +3537,7 @@ var UserProfilePage = ({
|
|
|
3571
3537
|
activePositions,
|
|
3572
3538
|
closedPositions,
|
|
3573
3539
|
activities,
|
|
3540
|
+
executionMode = "live",
|
|
3574
3541
|
onEditProfile,
|
|
3575
3542
|
onDeposit,
|
|
3576
3543
|
onWithdraw,
|
|
@@ -3652,15 +3619,18 @@ var UserProfilePage = ({
|
|
|
3652
3619
|
return [...new Set(fromBalance)].sort((a, b) => a.localeCompare(b));
|
|
3653
3620
|
}, [balanceState, shouldUseHookData]);
|
|
3654
3621
|
const [positionFilter, setPositionFilter] = useState6(initialPositionFilter);
|
|
3622
|
+
const queryExecutionMode = executionMode === "paper" ? "paper" : void 0;
|
|
3655
3623
|
const activePositionsQuery = useExecutionPositions({
|
|
3656
3624
|
enabled: shouldUseHookData && isAuthenticated,
|
|
3657
3625
|
status: "active",
|
|
3658
|
-
limit: 25
|
|
3626
|
+
limit: 25,
|
|
3627
|
+
mode: queryExecutionMode
|
|
3659
3628
|
});
|
|
3660
3629
|
const closedPositionsQuery = useExecutionPositions({
|
|
3661
3630
|
enabled: shouldUseHookData && isAuthenticated,
|
|
3662
3631
|
status: "closed",
|
|
3663
|
-
limit: 25
|
|
3632
|
+
limit: 25,
|
|
3633
|
+
mode: queryExecutionMode
|
|
3664
3634
|
});
|
|
3665
3635
|
const handlePositionFilterChange = useCallback3(
|
|
3666
3636
|
(filter) => {
|
|
@@ -3674,16 +3644,13 @@ var UserProfilePage = ({
|
|
|
3674
3644
|
}, [initialPositionFilter]);
|
|
3675
3645
|
const ordersQuery = useExecutionOrders({
|
|
3676
3646
|
enabled: shouldUseHookData && isAuthenticated,
|
|
3677
|
-
limit: 25
|
|
3647
|
+
limit: 25,
|
|
3648
|
+
mode: queryExecutionMode
|
|
3678
3649
|
});
|
|
3679
3650
|
const activityQuery = useUserActivity({
|
|
3680
3651
|
enabled: shouldUseHookData && isAuthenticated,
|
|
3681
3652
|
limit: 25
|
|
3682
3653
|
});
|
|
3683
|
-
const depositAddressesQuery = useDepositAddresses({
|
|
3684
|
-
enabled: shouldUseHookData && isAuthenticated,
|
|
3685
|
-
poll: false
|
|
3686
|
-
});
|
|
3687
3654
|
const handleCancelOrder = useCallback3(
|
|
3688
3655
|
(order) => __async(null, null, function* () {
|
|
3689
3656
|
if (onCancelOrder) {
|
|
@@ -3983,8 +3950,6 @@ var UserProfilePage = ({
|
|
|
3983
3950
|
const resolvedActivities = useMemo4(() => {
|
|
3984
3951
|
if (activities) return activities.filter(isVisibleUserProfileActivity);
|
|
3985
3952
|
const formatTime = isHydrated ? toRelativeTimeLabel : toAbsoluteTimeLabel;
|
|
3986
|
-
const fullUser = profileUser != null ? profileUser : currentUser;
|
|
3987
|
-
const connectedWalletAddresses = getConnectedWalletAccountAddresses(fullUser);
|
|
3988
3953
|
return activityQuery.activities.filter(isVisibleActivityItem).map((item, index) => {
|
|
3989
3954
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C;
|
|
3990
3955
|
const timeLabel = formatTime(getRuntimeActivityCreatedAt(item));
|
|
@@ -4060,16 +4025,10 @@ var UserProfilePage = ({
|
|
|
4060
4025
|
const errorMessage = timedOut ? PENDING_TRANSFER_TIMEOUT_ERROR_MESSAGE : (_q = getActivityErrorMessage(depositItem)) != null ? _q : void 0;
|
|
4061
4026
|
const isFailed = status === "failed";
|
|
4062
4027
|
const hasError = timedOut || hasActivityError(depositItem);
|
|
4063
|
-
const depositSource =
|
|
4064
|
-
fromAddress: depositItem.fromAddress,
|
|
4065
|
-
chainId: depositItem.chainId,
|
|
4066
|
-
connectedWalletAddresses,
|
|
4067
|
-
depositAddress: depositAddressesQuery.getAddress(toNumericChainId(depositItem.chainId))
|
|
4068
|
-
});
|
|
4028
|
+
const depositSource = depositItem.source;
|
|
4069
4029
|
const depositTitlesBySource = {
|
|
4070
|
-
|
|
4071
|
-
|
|
4072
|
-
card: labels.userProfile.activity.depositStatusTitles.card
|
|
4030
|
+
connected_wallet: labels.userProfile.activity.depositStatusTitles.connectedWallet,
|
|
4031
|
+
external_wallet: labels.userProfile.activity.depositStatusTitles.externalWallet
|
|
4073
4032
|
};
|
|
4074
4033
|
const amountLabel = status === "failed" || status === "canceled" ? ZERO_AMOUNT_LABEL : toTokenAmountLabel({
|
|
4075
4034
|
amountRaw: depositItem.amountRaw,
|
|
@@ -4089,7 +4048,7 @@ var UserProfilePage = ({
|
|
|
4089
4048
|
subtitleLabel: `from ${(_r = shortenAddress(depositItem.fromAddress)) != null ? _r : depositItem.fromAddress} \xB7 ${formatChainIdLabel(depositItem.chainId)}`,
|
|
4090
4049
|
amountLabel,
|
|
4091
4050
|
timeLabel,
|
|
4092
|
-
depositSource,
|
|
4051
|
+
depositSource: depositSource === "connected_wallet" ? "wallet" : "crypto",
|
|
4093
4052
|
chainId: depositItem.chainId
|
|
4094
4053
|
};
|
|
4095
4054
|
}
|
|
@@ -4131,16 +4090,7 @@ var UserProfilePage = ({
|
|
|
4131
4090
|
timeLabel
|
|
4132
4091
|
};
|
|
4133
4092
|
});
|
|
4134
|
-
}, [
|
|
4135
|
-
activities,
|
|
4136
|
-
activityQuery.activities,
|
|
4137
|
-
currentUser,
|
|
4138
|
-
depositAddressesQuery,
|
|
4139
|
-
isHydrated,
|
|
4140
|
-
labels,
|
|
4141
|
-
ordersQuery.orders,
|
|
4142
|
-
profileUser
|
|
4143
|
-
]);
|
|
4093
|
+
}, [activities, activityQuery.activities, isHydrated, labels, ordersQuery.orders]);
|
|
4144
4094
|
const resolvedOpenOrders = useMemo4(() => {
|
|
4145
4095
|
if (openOrders) return openOrders;
|
|
4146
4096
|
return ordersQuery.orders.filter((order) => isOpenOrderStatus(order.status)).map((order) => {
|
|
@@ -4241,7 +4191,7 @@ var UserProfilePage = ({
|
|
|
4241
4191
|
{
|
|
4242
4192
|
className: cn(
|
|
4243
4193
|
"agg-user-profile-page",
|
|
4244
|
-
"w-full mx-auto px-6 lg:px-10 pb-10 max-w-[
|
|
4194
|
+
"w-full mx-auto px-6 lg:px-10 pb-10 max-w-[1440px]",
|
|
4245
4195
|
classNames == null ? void 0 : classNames.root
|
|
4246
4196
|
),
|
|
4247
4197
|
children: /* @__PURE__ */ jsxs11(
|
|
@@ -8,10 +8,10 @@ import {
|
|
|
8
8
|
getTradingValueLabel,
|
|
9
9
|
getTradingVenueLabel,
|
|
10
10
|
resolveOrderEligibilityMessage
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-C5M2OOM3.mjs";
|
|
12
12
|
import {
|
|
13
13
|
GeoBlockBanner
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-YMVD6Q2A.mjs";
|
|
15
15
|
import {
|
|
16
16
|
AGG_TERMS_OF_SERVICE_URL,
|
|
17
17
|
Button,
|
|
@@ -38,7 +38,7 @@ import {
|
|
|
38
38
|
formatUsd,
|
|
39
39
|
getMotionClassName,
|
|
40
40
|
skeletonViews
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-DXF2LMNN.mjs";
|
|
42
42
|
|
|
43
43
|
// src/trading/types.ts
|
|
44
44
|
import { Venue, enumGuard, isFiniteNonNeg, safeParse } from "@agg-build/sdk";
|
|
@@ -3396,6 +3396,7 @@ var PlaceOrder = ({
|
|
|
3396
3396
|
const visibleRouteCards = orderedRouteCards.length > PLACE_ORDER_ROUTE_COLLAPSED_CARD_COUNT && !isRoutesExpanded ? orderedRouteCards.slice(0, PLACE_ORDER_ROUTE_COLLAPSED_CARD_COUNT) : orderedRouteCards;
|
|
3397
3397
|
const hasEnteredAmount = internalAmount > 0;
|
|
3398
3398
|
const isQuoteLoading = hasEnteredAmount && (smartRoute.isFetching || smartRoute.isLoading);
|
|
3399
|
+
const routeLoadingMessage = isQuoteLoading ? smartRoute.loadingReason === "updating-route" ? tradingLabels.updatingRoute : smartRoute.loadingReason === "refreshing-quotes" ? tradingLabels.refreshingQuotes : tradingLabels.findingBestOdds : null;
|
|
3399
3400
|
const isInsufficientBalance = !isSell && isAuthenticated && hasEnteredAmount && !isBalanceLoading && internalAmount > totalBalance;
|
|
3400
3401
|
const isQuoteInsufficientBalance = (activeQuoteData == null ? void 0 : activeQuoteData.status) === "insufficient_balance";
|
|
3401
3402
|
const shouldShowInsufficientBalanceAlert = isInsufficientBalance || isQuoteInsufficientBalance;
|
|
@@ -3545,7 +3546,7 @@ var PlaceOrder = ({
|
|
|
3545
3546
|
const shouldShowGeoBlockBanner = isTradingBlocked || selectedRouteGeoBlocked || isPrimaryVenueGeoBlocked;
|
|
3546
3547
|
const actionLabel = `${internalTab === "buy" ? tradingLabels.buy : tradingLabels.sell} ${selectedOutcomeLabel}`.trim();
|
|
3547
3548
|
const isActionDisabled = isPrimaryActionDisabled || !orderEligibility.canPlaceOrder || isActionLoading || !hasEnteredAmount || !scopedSelectedMarket || isInsufficientBalance || isQuoteInsufficientBalance || isBelowMinimum || isQuoteLoading || !selectedRouteCard || !selectedRouteCard.quoteData.quoteId || selectedRouteGeoBlocked || !isAuthenticated || quoteStatus !== void 0;
|
|
3548
|
-
const shouldShowSmartRouting = orderEligibility.canPlaceOrder && hasEnteredAmount && !isBelowMinimum && (orderedRouteCards.length > 0 || smartRoute.isFetching);
|
|
3549
|
+
const shouldShowSmartRouting = orderEligibility.canPlaceOrder && hasEnteredAmount && !isBelowMinimum && (orderedRouteCards.length > 0 || smartRoute.isFetching || smartRoute.isLoading);
|
|
3549
3550
|
const shouldShowRouteToggle = !isQuoteLoading && orderedRouteCards.length > PLACE_ORDER_ROUTE_COLLAPSED_CARD_COUNT;
|
|
3550
3551
|
const handleReturnToOrderForm = useCallback2(() => {
|
|
3551
3552
|
const submittedSelection = submittedSelectionRef.current;
|
|
@@ -4176,19 +4177,10 @@ var PlaceOrder = ({
|
|
|
4176
4177
|
}
|
|
4177
4178
|
) : null
|
|
4178
4179
|
] }),
|
|
4179
|
-
/* @__PURE__ */ jsx4("div", { className: "agg-route-list flex flex-col gap-2", children: isQuoteLoading ? /* @__PURE__ */ jsxs3(
|
|
4180
|
-
|
|
4181
|
-
{
|
|
4182
|
-
|
|
4183
|
-
role: "status",
|
|
4184
|
-
"aria-label": labels.common.loading,
|
|
4185
|
-
"aria-live": "polite",
|
|
4186
|
-
children: [
|
|
4187
|
-
/* @__PURE__ */ jsx4(PlaceOrderRouteCardSkeleton, {}),
|
|
4188
|
-
/* @__PURE__ */ jsx4(PlaceOrderRouteCardSkeleton, {})
|
|
4189
|
-
]
|
|
4190
|
-
}
|
|
4191
|
-
) : visibleRouteCards.length > 0 ? visibleRouteCards.map((card) => {
|
|
4180
|
+
/* @__PURE__ */ jsx4("div", { className: "agg-route-list flex flex-col gap-2", children: isQuoteLoading ? /* @__PURE__ */ jsxs3("div", { className: "agg-route-loading flex flex-col gap-2", "aria-hidden": "true", children: [
|
|
4181
|
+
/* @__PURE__ */ jsx4(PlaceOrderRouteCardSkeleton, {}),
|
|
4182
|
+
/* @__PURE__ */ jsx4(PlaceOrderRouteCardSkeleton, {})
|
|
4183
|
+
] }) : visibleRouteCards.length > 0 ? visibleRouteCards.map((card) => {
|
|
4192
4184
|
return /* @__PURE__ */ jsx4(Fragment, { children: renderRouteCard({
|
|
4193
4185
|
card,
|
|
4194
4186
|
enableAnimations,
|
|
@@ -4279,7 +4271,28 @@ var PlaceOrder = ({
|
|
|
4279
4271
|
onClick: handleDepositRequiredClick,
|
|
4280
4272
|
children: tradingLabels.deposit
|
|
4281
4273
|
}
|
|
4282
|
-
) : needsKycVerification && !submissionFeedback && !shouldShowGeoBlockBanner ? /* @__PURE__ */ jsx4(InitiateKycButton, { label: tradingLabels.kycRequired, onOpen: openVerifyModal }) : !
|
|
4274
|
+
) : needsKycVerification && !submissionFeedback && !shouldShowGeoBlockBanner ? /* @__PURE__ */ jsx4(InitiateKycButton, { label: tradingLabels.kycRequired, onOpen: openVerifyModal }) : isQuoteLoading && !isActionLoading ? /* @__PURE__ */ jsx4(
|
|
4275
|
+
Button,
|
|
4276
|
+
{
|
|
4277
|
+
size: "large",
|
|
4278
|
+
variant: "secondary",
|
|
4279
|
+
className: "agg-order-submit-loading h-12 w-full px-8 text-agg-base leading-agg-6 shadow-none",
|
|
4280
|
+
disabled: true,
|
|
4281
|
+
"aria-live": "polite",
|
|
4282
|
+
"aria-label": routeLoadingMessage != null ? routeLoadingMessage : labels.common.loading,
|
|
4283
|
+
prefix: /* @__PURE__ */ jsx4(
|
|
4284
|
+
"span",
|
|
4285
|
+
{
|
|
4286
|
+
className: cn(
|
|
4287
|
+
"inline-block h-4 w-4 shrink-0 rounded-agg-full border-2 border-current border-r-transparent",
|
|
4288
|
+
getMotionClassName(enableAnimations, "animate-spin")
|
|
4289
|
+
),
|
|
4290
|
+
"aria-hidden": "true"
|
|
4291
|
+
}
|
|
4292
|
+
),
|
|
4293
|
+
children: routeLoadingMessage
|
|
4294
|
+
}
|
|
4295
|
+
) : !isAuthenticated ? /* @__PURE__ */ jsx4(
|
|
4283
4296
|
Button,
|
|
4284
4297
|
{
|
|
4285
4298
|
size: "large",
|