@agg-build/ui 2.6.0 → 2.7.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-TQL5I4GX.mjs → chunk-C247AYH7.mjs} +1 -1
- package/dist/{chunk-FAU2VOL6.mjs → chunk-O27JUYCF.mjs} +36 -25
- package/dist/index.js +36 -25
- package/dist/index.mjs +2 -2
- package/dist/pages.js +36 -25
- package/dist/pages.mjs +2 -2
- package/dist/trading.js +36 -25
- package/dist/trading.mjs +1 -1
- package/dist/types/trading/place-order/index.place-order.utils.d.mts +9 -0
- package/dist/types/trading/place-order/index.place-order.utils.d.ts +9 -0
- package/package.json +2 -2
|
@@ -1366,7 +1366,7 @@ var buildLiveRouteCards = ({
|
|
|
1366
1366
|
};
|
|
1367
1367
|
}
|
|
1368
1368
|
const avgPrice = sq.avgPrice;
|
|
1369
|
-
const soloQuoteData = __spreadProps(__spreadValues({}, quoteData), {
|
|
1369
|
+
const soloQuoteData = __spreadValues(__spreadProps(__spreadValues({}, quoteData), {
|
|
1370
1370
|
// Preview-only solos intentionally carry no executable quoteId; the card
|
|
1371
1371
|
// should still render for comparison, while the CTA stays disabled until
|
|
1372
1372
|
// the user is funded and requotes.
|
|
@@ -1379,7 +1379,7 @@ var buildLiveRouteCards = ({
|
|
|
1379
1379
|
returnPct: sq.returnPct,
|
|
1380
1380
|
// venueSoloQuotes stripped on solo card's quoteData (only the primary needs them)
|
|
1381
1381
|
venueSoloQuotes: void 0
|
|
1382
|
-
});
|
|
1382
|
+
}), sq.quoteId ? { status: "ok", error: void 0 } : null);
|
|
1383
1383
|
return {
|
|
1384
1384
|
id: `live-solo-${sq.venue}`,
|
|
1385
1385
|
hint: labels.averagePrice(avgPrice),
|
|
@@ -1435,6 +1435,17 @@ var buildLiveRouteCards = ({
|
|
|
1435
1435
|
})() : [];
|
|
1436
1436
|
return [...baseCards, ...unavailableCards, ...warningOnlyUnavailableCards];
|
|
1437
1437
|
};
|
|
1438
|
+
var resolveDefaultRouteCardId = (routeCards, primaryStatus) => {
|
|
1439
|
+
var _a, _b, _c, _d;
|
|
1440
|
+
if (routeCards.length === 0) return null;
|
|
1441
|
+
if (primaryStatus === "insufficient_balance") {
|
|
1442
|
+
const executableCard = routeCards.find(
|
|
1443
|
+
(card) => !card.isUnavailable && card.quoteData.status === "ok" && card.quoteData.quoteId
|
|
1444
|
+
);
|
|
1445
|
+
if (executableCard) return executableCard.id;
|
|
1446
|
+
}
|
|
1447
|
+
return (_d = (_c = (_a = routeCards.find((card) => !card.isUnavailable)) == null ? void 0 : _a.id) != null ? _c : (_b = routeCards[0]) == null ? void 0 : _b.id) != null ? _d : null;
|
|
1448
|
+
};
|
|
1438
1449
|
var sellSharesToAtomicUnits = (shares) => {
|
|
1439
1450
|
if (!Number.isFinite(shares) || shares <= 0) return BigInt(0);
|
|
1440
1451
|
const [whole = "0", fraction = ""] = shares.toFixed(12).split(".");
|
|
@@ -3369,7 +3380,7 @@ var PlaceOrder = ({
|
|
|
3369
3380
|
resolvedClaim,
|
|
3370
3381
|
midpointsResult
|
|
3371
3382
|
}) => {
|
|
3372
|
-
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, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X;
|
|
3383
|
+
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, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y;
|
|
3373
3384
|
const {
|
|
3374
3385
|
enableDebug: isExecutionDebugEnabled,
|
|
3375
3386
|
features: { enableAnimations, showFeesBreakdown, showLimitOrders },
|
|
@@ -3800,13 +3811,13 @@ var PlaceOrder = ({
|
|
|
3800
3811
|
venueSellQuotes.quotes
|
|
3801
3812
|
]);
|
|
3802
3813
|
const resolvedSelectedRouteCardId = useMemo(() => {
|
|
3803
|
-
var _a2
|
|
3814
|
+
var _a2;
|
|
3804
3815
|
if (routeCards.length === 0) return null;
|
|
3805
3816
|
if (selectedRouteCardId && routeCards.some((card) => card.id === selectedRouteCardId && !card.isUnavailable)) {
|
|
3806
3817
|
return selectedRouteCardId;
|
|
3807
3818
|
}
|
|
3808
|
-
return (
|
|
3809
|
-
}, [routeCards, selectedRouteCardId]);
|
|
3819
|
+
return resolveDefaultRouteCardId(routeCards, isSell ? void 0 : (_a2 = smartRoute.data) == null ? void 0 : _a2.status);
|
|
3820
|
+
}, [routeCards, selectedRouteCardId, isSell, (_w = smartRoute.data) == null ? void 0 : _w.status]);
|
|
3810
3821
|
useEffect2(() => {
|
|
3811
3822
|
if (routeCards.length === 0) {
|
|
3812
3823
|
setSelectedRouteCardId(null);
|
|
@@ -3846,14 +3857,14 @@ var PlaceOrder = ({
|
|
|
3846
3857
|
setLimitPriceInputError(null);
|
|
3847
3858
|
}, [executionType, scopedSelectedOutcomeId, selectedOutcomeDisplayPrice]);
|
|
3848
3859
|
const orderedRouteCards = routeCards;
|
|
3849
|
-
const selectedRouteCard = (
|
|
3860
|
+
const selectedRouteCard = (_y = (_x = orderedRouteCards.find((card) => card.id === resolvedSelectedRouteCardId)) != null ? _x : orderedRouteCards[0]) != null ? _y : null;
|
|
3850
3861
|
const isKalshiRoute = useMemo(() => {
|
|
3851
3862
|
if (selectedRouteCard) {
|
|
3852
3863
|
return selectedRouteCard.venue === "kalshi" || selectedRouteCard.quoteData.fills.some((f) => f.venue === "kalshi");
|
|
3853
3864
|
}
|
|
3854
3865
|
return (scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.venue) === "kalshi";
|
|
3855
3866
|
}, [selectedRouteCard, scopedSelectedMarket]);
|
|
3856
|
-
const displayedBalance = isPaperMode ? paperTotalBalance : isKalshiRoute ? (
|
|
3867
|
+
const displayedBalance = isPaperMode ? paperTotalBalance : isKalshiRoute ? (_z = liveBalanceState.kalshiBalance) != null ? _z : 0 : liveAvailableBalance;
|
|
3857
3868
|
const legacyKalshiAccount = useMemo(
|
|
3858
3869
|
() => {
|
|
3859
3870
|
var _a2;
|
|
@@ -3861,8 +3872,8 @@ var PlaceOrder = ({
|
|
|
3861
3872
|
},
|
|
3862
3873
|
[user == null ? void 0 : user.venueAccounts]
|
|
3863
3874
|
);
|
|
3864
|
-
const isKalshiAccountActive = (
|
|
3865
|
-
const isKalshiVerified = ((
|
|
3875
|
+
const isKalshiAccountActive = (_A = kalshiKeyStatus == null ? void 0 : kalshiKeyStatus.connected) != null ? _A : (legacyKalshiAccount == null ? void 0 : legacyKalshiAccount.status) === "active";
|
|
3876
|
+
const isKalshiVerified = ((_B = kalshiKeyStatus == null ? void 0 : kalshiKeyStatus.kycStatus) != null ? _B : legacyKalshiAccount == null ? void 0 : legacyKalshiAccount.kycStatus) === "verified";
|
|
3866
3877
|
const hasKalshiConnectionState = kalshiKeyStatus !== void 0 || (user == null ? void 0 : user.venueAccounts) != null;
|
|
3867
3878
|
const isKalshiAvailable = getVenueAvailabilityState({
|
|
3868
3879
|
venueId: "kalshi",
|
|
@@ -3889,7 +3900,7 @@ var PlaceOrder = ({
|
|
|
3889
3900
|
[aggClient, onConnectKalshi, refetchKalshiKeyStatus]
|
|
3890
3901
|
);
|
|
3891
3902
|
const needsKycVerification = isAuthenticated && hasKalshiConnectionState && isKalshiRoute && isKalshiAccountActive && !isKalshiVerified;
|
|
3892
|
-
const verifyKalshiConnectionLabel = (
|
|
3903
|
+
const verifyKalshiConnectionLabel = (_F = (_E = (_D = (_C = labels.onboarding) == null ? void 0 : _C.connectKalshiModal) == null ? void 0 : _D.actions) == null ? void 0 : _E.verifyConnection) != null ? _F : tradingLabels.kycRequired;
|
|
3893
3904
|
const handleRouteCardSelect = useCallback2(
|
|
3894
3905
|
(cardId) => {
|
|
3895
3906
|
if (cardId === resolvedSelectedRouteCardId) {
|
|
@@ -3904,15 +3915,15 @@ var PlaceOrder = ({
|
|
|
3904
3915
|
[resolvedSelectedRouteCardId, routeCards]
|
|
3905
3916
|
);
|
|
3906
3917
|
const executionProgress = useExecutionProgress({
|
|
3907
|
-
orderIds: (
|
|
3908
|
-
quoteId: (
|
|
3918
|
+
orderIds: (_G = submissionProgressState == null ? void 0 : submissionProgressState.orderIds) != null ? _G : null,
|
|
3919
|
+
quoteId: (_H = submissionProgressState == null ? void 0 : submissionProgressState.quoteId) != null ? _H : null,
|
|
3909
3920
|
mode: isPaperMode ? "paper" : void 0,
|
|
3910
|
-
enabled: ((submissionProgressState == null ? void 0 : submissionProgressState.phase) === "submitting" || (submissionProgressState == null ? void 0 : submissionProgressState.phase) === "executing") && !!((
|
|
3921
|
+
enabled: ((submissionProgressState == null ? void 0 : submissionProgressState.phase) === "submitting" || (submissionProgressState == null ? void 0 : submissionProgressState.phase) === "executing") && !!((_I = submissionProgressState == null ? void 0 : submissionProgressState.orderIds) == null ? void 0 : _I.length)
|
|
3911
3922
|
});
|
|
3912
|
-
const selectedOutcomeLabel = (
|
|
3913
|
-
const headerImage = (
|
|
3914
|
-
const headerTitle = (
|
|
3915
|
-
const headerSubtitle = (
|
|
3923
|
+
const selectedOutcomeLabel = (_L = (_K = (_J = outcomes.find((outcome) => outcome.id === scopedSelectedOutcomeId)) == null ? void 0 : _J.label) != null ? _K : scopedSelectedOutcome == null ? void 0 : scopedSelectedOutcome.label) != null ? _L : "";
|
|
3924
|
+
const headerImage = (_N = (_M = scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.image) != null ? _M : scopedSelectedEvent == null ? void 0 : scopedSelectedEvent.image) != null ? _N : null;
|
|
3925
|
+
const headerTitle = (_P = (_O = scopedSelectedEvent == null ? void 0 : scopedSelectedEvent.title) != null ? _O : scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.question) != null ? _P : "";
|
|
3926
|
+
const headerSubtitle = (_Q = scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.question) != null ? _Q : "";
|
|
3916
3927
|
const buildExecutionSummary = useCallback2(
|
|
3917
3928
|
(quoteData, executionVenue, orderId, partialFillSummary) => {
|
|
3918
3929
|
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2;
|
|
@@ -4210,19 +4221,19 @@ var PlaceOrder = ({
|
|
|
4210
4221
|
queryClient,
|
|
4211
4222
|
submissionProgressState
|
|
4212
4223
|
]);
|
|
4213
|
-
const activeQuoteData = (
|
|
4224
|
+
const activeQuoteData = (_S = (_R = selectedRouteCard == null ? void 0 : selectedRouteCard.quoteData) != null ? _R : smartRoute.data) != null ? _S : null;
|
|
4214
4225
|
const visibleRouteCards = orderedRouteCards.length > PLACE_ORDER_ROUTE_COLLAPSED_CARD_COUNT && !isRoutesExpanded ? orderedRouteCards.slice(0, PLACE_ORDER_ROUTE_COLLAPSED_CARD_COUNT) : orderedRouteCards;
|
|
4215
4226
|
const hasEnteredAmount = internalAmount > 0;
|
|
4216
4227
|
const isQuoteLoading = !isLimitOrder && hasEnteredAmount && (smartRoute.isFetching || smartRoute.isLoading || isSell && (venueSellQuotes.isFetching || venueSellQuotes.isLoading));
|
|
4217
4228
|
const routeLoadingMessage = isQuoteLoading ? smartRoute.loadingReason === "updating-route" ? tradingLabels.updatingRoute : smartRoute.loadingReason === "refreshing-quotes" ? tradingLabels.refreshingQuotes : tradingLabels.findingBestOdds : null;
|
|
4218
|
-
const selectedRouteFills = (
|
|
4229
|
+
const selectedRouteFills = (_T = selectedRouteCard == null ? void 0 : selectedRouteCard.quoteData.fills) != null ? _T : [];
|
|
4219
4230
|
const isKalshiOnlyRoute = isKalshiRoute && ((selectedRouteCard == null ? void 0 : selectedRouteCard.venue) === Venue4.kalshi || selectedRouteFills.length > 0 && selectedRouteFills.every((fill) => fill.venue === Venue4.kalshi));
|
|
4220
4231
|
const isOnchainOnlyRoute = !isKalshiRoute || selectedRouteFills.length > 0 && selectedRouteFills.every((fill) => fill.venue !== Venue4.kalshi);
|
|
4221
4232
|
const kalshiRequiredAmount = isSell ? 0 : selectedRouteFills.filter((fill) => fill.venue === Venue4.kalshi).reduce((total, fill) => total + fill.venueQty * fill.avgPrice, 0);
|
|
4222
4233
|
const onchainRequiredAmount = isSell ? 0 : selectedRouteFills.filter((fill) => fill.venue !== Venue4.kalshi).reduce((total, fill) => total + fill.venueQty * fill.avgPrice, 0);
|
|
4223
4234
|
const resolvedKalshiRequiredAmount = isKalshiOnlyRoute || isKalshiRoute && selectedRouteFills.length === 0 ? internalAmount : kalshiRequiredAmount;
|
|
4224
4235
|
const resolvedOnchainRequiredAmount = isOnchainOnlyRoute || !isKalshiRoute && selectedRouteFills.length === 0 ? internalAmount : onchainRequiredAmount;
|
|
4225
|
-
const isKalshiBalanceInsufficient = !isPaperMode && isKalshiRoute && resolvedKalshiRequiredAmount > ((
|
|
4236
|
+
const isKalshiBalanceInsufficient = !isPaperMode && isKalshiRoute && resolvedKalshiRequiredAmount > ((_U = liveBalanceState.kalshiBalance) != null ? _U : 0);
|
|
4226
4237
|
const isOnchainBalanceInsufficient = resolvedOnchainRequiredAmount > liveAvailableBalance;
|
|
4227
4238
|
const isInsufficientBalance = !isSell && isAuthenticated && hasEnteredAmount && !isBalanceLoading && (isLimitOrder ? internalAmount > totalBalance : isPaperMode ? internalAmount > paperTotalBalance : isKalshiBalanceInsufficient || isOnchainBalanceInsufficient);
|
|
4228
4239
|
const isQuoteInsufficientBalance = !isLimitOrder && (activeQuoteData == null ? void 0 : activeQuoteData.status) === "insufficient_balance";
|
|
@@ -4316,7 +4327,7 @@ var PlaceOrder = ({
|
|
|
4316
4327
|
}
|
|
4317
4328
|
return (_d2 = selectedRouteCard.hint) != null ? _d2 : "";
|
|
4318
4329
|
}, [selectedRouteCard, tradingLabels]);
|
|
4319
|
-
const displayedToWinValue = (
|
|
4330
|
+
const displayedToWinValue = (_V = selectedRouteCard == null ? void 0 : selectedRouteCard.numericValue) != null ? _V : 0;
|
|
4320
4331
|
const limitOrderPayload = useMemo(() => {
|
|
4321
4332
|
if (!scopedSelectedMarket || !scopedSelectedOutcomeId || internalAmount <= 0) return null;
|
|
4322
4333
|
if (limitPriceInputError) return null;
|
|
@@ -4435,13 +4446,13 @@ var PlaceOrder = ({
|
|
|
4435
4446
|
];
|
|
4436
4447
|
}, [activeFeeBreakdown, tradingLabels]);
|
|
4437
4448
|
const isActionLoading = isPrimaryActionLoading || executeManaged.isPending || placeLimitOrder.isPending || isBeforeActionPending;
|
|
4438
|
-
const selectedRouteGeoBlocked = (
|
|
4449
|
+
const selectedRouteGeoBlocked = (_W = selectedRouteCard == null ? void 0 : selectedRouteCard.isUnavailable) != null ? _W : false;
|
|
4439
4450
|
const geoBlockedVenuesFromWarnings = useMemo(
|
|
4440
4451
|
() => {
|
|
4441
4452
|
var _a2;
|
|
4442
4453
|
return extractGeoBlockedVenues((_a2 = smartRoute.data) == null ? void 0 : _a2.warnings);
|
|
4443
4454
|
},
|
|
4444
|
-
[(
|
|
4455
|
+
[(_X = smartRoute.data) == null ? void 0 : _X.warnings]
|
|
4445
4456
|
);
|
|
4446
4457
|
const isPrimaryVenueGeoBlocked = useMemo(() => {
|
|
4447
4458
|
var _a2, _b2;
|
|
@@ -5099,7 +5110,7 @@ var PlaceOrder = ({
|
|
|
5099
5110
|
PlaceOrderResolvedView,
|
|
5100
5111
|
{
|
|
5101
5112
|
tradingState: resolvedReadOnlyTradingState,
|
|
5102
|
-
resolutionTimestamp: (
|
|
5113
|
+
resolutionTimestamp: (_Y = resolvedEventTradingState.resolvesAt) != null ? _Y : resolvedReadOnlyTradingState.resolvesAt,
|
|
5103
5114
|
resolvedClaim,
|
|
5104
5115
|
classNames,
|
|
5105
5116
|
className,
|
package/dist/index.js
CHANGED
|
@@ -20552,7 +20552,7 @@ var buildLiveRouteCards = ({
|
|
|
20552
20552
|
};
|
|
20553
20553
|
}
|
|
20554
20554
|
const avgPrice = sq.avgPrice;
|
|
20555
|
-
const soloQuoteData = __spreadProps(__spreadValues({}, quoteData), {
|
|
20555
|
+
const soloQuoteData = __spreadValues(__spreadProps(__spreadValues({}, quoteData), {
|
|
20556
20556
|
// Preview-only solos intentionally carry no executable quoteId; the card
|
|
20557
20557
|
// should still render for comparison, while the CTA stays disabled until
|
|
20558
20558
|
// the user is funded and requotes.
|
|
@@ -20565,7 +20565,7 @@ var buildLiveRouteCards = ({
|
|
|
20565
20565
|
returnPct: sq.returnPct,
|
|
20566
20566
|
// venueSoloQuotes stripped on solo card's quoteData (only the primary needs them)
|
|
20567
20567
|
venueSoloQuotes: void 0
|
|
20568
|
-
});
|
|
20568
|
+
}), sq.quoteId ? { status: "ok", error: void 0 } : null);
|
|
20569
20569
|
return {
|
|
20570
20570
|
id: `live-solo-${sq.venue}`,
|
|
20571
20571
|
hint: labels.averagePrice(avgPrice),
|
|
@@ -20621,6 +20621,17 @@ var buildLiveRouteCards = ({
|
|
|
20621
20621
|
})() : [];
|
|
20622
20622
|
return [...baseCards, ...unavailableCards, ...warningOnlyUnavailableCards];
|
|
20623
20623
|
};
|
|
20624
|
+
var resolveDefaultRouteCardId = (routeCards, primaryStatus) => {
|
|
20625
|
+
var _a, _b, _c, _d;
|
|
20626
|
+
if (routeCards.length === 0) return null;
|
|
20627
|
+
if (primaryStatus === "insufficient_balance") {
|
|
20628
|
+
const executableCard = routeCards.find(
|
|
20629
|
+
(card) => !card.isUnavailable && card.quoteData.status === "ok" && card.quoteData.quoteId
|
|
20630
|
+
);
|
|
20631
|
+
if (executableCard) return executableCard.id;
|
|
20632
|
+
}
|
|
20633
|
+
return (_d = (_c = (_a = routeCards.find((card) => !card.isUnavailable)) == null ? void 0 : _a.id) != null ? _c : (_b = routeCards[0]) == null ? void 0 : _b.id) != null ? _d : null;
|
|
20634
|
+
};
|
|
20624
20635
|
var sellSharesToAtomicUnits = (shares) => {
|
|
20625
20636
|
if (!Number.isFinite(shares) || shares <= 0) return BigInt(0);
|
|
20626
20637
|
const [whole = "0", fraction = ""] = shares.toFixed(12).split(".");
|
|
@@ -22555,7 +22566,7 @@ var PlaceOrder = ({
|
|
|
22555
22566
|
resolvedClaim,
|
|
22556
22567
|
midpointsResult
|
|
22557
22568
|
}) => {
|
|
22558
|
-
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, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X;
|
|
22569
|
+
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, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y;
|
|
22559
22570
|
const {
|
|
22560
22571
|
enableDebug: isExecutionDebugEnabled,
|
|
22561
22572
|
features: { enableAnimations, showFeesBreakdown, showLimitOrders },
|
|
@@ -22986,13 +22997,13 @@ var PlaceOrder = ({
|
|
|
22986
22997
|
venueSellQuotes.quotes
|
|
22987
22998
|
]);
|
|
22988
22999
|
const resolvedSelectedRouteCardId = (0, import_react39.useMemo)(() => {
|
|
22989
|
-
var _a2
|
|
23000
|
+
var _a2;
|
|
22990
23001
|
if (routeCards.length === 0) return null;
|
|
22991
23002
|
if (selectedRouteCardId && routeCards.some((card) => card.id === selectedRouteCardId && !card.isUnavailable)) {
|
|
22992
23003
|
return selectedRouteCardId;
|
|
22993
23004
|
}
|
|
22994
|
-
return (
|
|
22995
|
-
}, [routeCards, selectedRouteCardId]);
|
|
23005
|
+
return resolveDefaultRouteCardId(routeCards, isSell ? void 0 : (_a2 = smartRoute.data) == null ? void 0 : _a2.status);
|
|
23006
|
+
}, [routeCards, selectedRouteCardId, isSell, (_w = smartRoute.data) == null ? void 0 : _w.status]);
|
|
22996
23007
|
(0, import_react39.useEffect)(() => {
|
|
22997
23008
|
if (routeCards.length === 0) {
|
|
22998
23009
|
setSelectedRouteCardId(null);
|
|
@@ -23032,14 +23043,14 @@ var PlaceOrder = ({
|
|
|
23032
23043
|
setLimitPriceInputError(null);
|
|
23033
23044
|
}, [executionType, scopedSelectedOutcomeId, selectedOutcomeDisplayPrice]);
|
|
23034
23045
|
const orderedRouteCards = routeCards;
|
|
23035
|
-
const selectedRouteCard = (
|
|
23046
|
+
const selectedRouteCard = (_y = (_x = orderedRouteCards.find((card) => card.id === resolvedSelectedRouteCardId)) != null ? _x : orderedRouteCards[0]) != null ? _y : null;
|
|
23036
23047
|
const isKalshiRoute = (0, import_react39.useMemo)(() => {
|
|
23037
23048
|
if (selectedRouteCard) {
|
|
23038
23049
|
return selectedRouteCard.venue === "kalshi" || selectedRouteCard.quoteData.fills.some((f) => f.venue === "kalshi");
|
|
23039
23050
|
}
|
|
23040
23051
|
return (scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.venue) === "kalshi";
|
|
23041
23052
|
}, [selectedRouteCard, scopedSelectedMarket]);
|
|
23042
|
-
const displayedBalance = isPaperMode ? paperTotalBalance : isKalshiRoute ? (
|
|
23053
|
+
const displayedBalance = isPaperMode ? paperTotalBalance : isKalshiRoute ? (_z = liveBalanceState.kalshiBalance) != null ? _z : 0 : liveAvailableBalance;
|
|
23043
23054
|
const legacyKalshiAccount = (0, import_react39.useMemo)(
|
|
23044
23055
|
() => {
|
|
23045
23056
|
var _a2;
|
|
@@ -23047,8 +23058,8 @@ var PlaceOrder = ({
|
|
|
23047
23058
|
},
|
|
23048
23059
|
[user == null ? void 0 : user.venueAccounts]
|
|
23049
23060
|
);
|
|
23050
|
-
const isKalshiAccountActive = (
|
|
23051
|
-
const isKalshiVerified = ((
|
|
23061
|
+
const isKalshiAccountActive = (_A = kalshiKeyStatus == null ? void 0 : kalshiKeyStatus.connected) != null ? _A : (legacyKalshiAccount == null ? void 0 : legacyKalshiAccount.status) === "active";
|
|
23062
|
+
const isKalshiVerified = ((_B = kalshiKeyStatus == null ? void 0 : kalshiKeyStatus.kycStatus) != null ? _B : legacyKalshiAccount == null ? void 0 : legacyKalshiAccount.kycStatus) === "verified";
|
|
23052
23063
|
const hasKalshiConnectionState = kalshiKeyStatus !== void 0 || (user == null ? void 0 : user.venueAccounts) != null;
|
|
23053
23064
|
const isKalshiAvailable = (0, import_hooks63.getVenueAvailabilityState)({
|
|
23054
23065
|
venueId: "kalshi",
|
|
@@ -23075,7 +23086,7 @@ var PlaceOrder = ({
|
|
|
23075
23086
|
[aggClient, onConnectKalshi, refetchKalshiKeyStatus]
|
|
23076
23087
|
);
|
|
23077
23088
|
const needsKycVerification = isAuthenticated && hasKalshiConnectionState && isKalshiRoute && isKalshiAccountActive && !isKalshiVerified;
|
|
23078
|
-
const verifyKalshiConnectionLabel = (
|
|
23089
|
+
const verifyKalshiConnectionLabel = (_F = (_E = (_D = (_C = labels.onboarding) == null ? void 0 : _C.connectKalshiModal) == null ? void 0 : _D.actions) == null ? void 0 : _E.verifyConnection) != null ? _F : tradingLabels.kycRequired;
|
|
23079
23090
|
const handleRouteCardSelect = (0, import_react39.useCallback)(
|
|
23080
23091
|
(cardId) => {
|
|
23081
23092
|
if (cardId === resolvedSelectedRouteCardId) {
|
|
@@ -23090,15 +23101,15 @@ var PlaceOrder = ({
|
|
|
23090
23101
|
[resolvedSelectedRouteCardId, routeCards]
|
|
23091
23102
|
);
|
|
23092
23103
|
const executionProgress = (0, import_hooks63.useExecutionProgress)({
|
|
23093
|
-
orderIds: (
|
|
23094
|
-
quoteId: (
|
|
23104
|
+
orderIds: (_G = submissionProgressState == null ? void 0 : submissionProgressState.orderIds) != null ? _G : null,
|
|
23105
|
+
quoteId: (_H = submissionProgressState == null ? void 0 : submissionProgressState.quoteId) != null ? _H : null,
|
|
23095
23106
|
mode: isPaperMode ? "paper" : void 0,
|
|
23096
|
-
enabled: ((submissionProgressState == null ? void 0 : submissionProgressState.phase) === "submitting" || (submissionProgressState == null ? void 0 : submissionProgressState.phase) === "executing") && !!((
|
|
23107
|
+
enabled: ((submissionProgressState == null ? void 0 : submissionProgressState.phase) === "submitting" || (submissionProgressState == null ? void 0 : submissionProgressState.phase) === "executing") && !!((_I = submissionProgressState == null ? void 0 : submissionProgressState.orderIds) == null ? void 0 : _I.length)
|
|
23097
23108
|
});
|
|
23098
|
-
const selectedOutcomeLabel = (
|
|
23099
|
-
const headerImage = (
|
|
23100
|
-
const headerTitle = (
|
|
23101
|
-
const headerSubtitle = (
|
|
23109
|
+
const selectedOutcomeLabel = (_L = (_K = (_J = outcomes.find((outcome) => outcome.id === scopedSelectedOutcomeId)) == null ? void 0 : _J.label) != null ? _K : scopedSelectedOutcome == null ? void 0 : scopedSelectedOutcome.label) != null ? _L : "";
|
|
23110
|
+
const headerImage = (_N = (_M = scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.image) != null ? _M : scopedSelectedEvent == null ? void 0 : scopedSelectedEvent.image) != null ? _N : null;
|
|
23111
|
+
const headerTitle = (_P = (_O = scopedSelectedEvent == null ? void 0 : scopedSelectedEvent.title) != null ? _O : scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.question) != null ? _P : "";
|
|
23112
|
+
const headerSubtitle = (_Q = scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.question) != null ? _Q : "";
|
|
23102
23113
|
const buildExecutionSummary = (0, import_react39.useCallback)(
|
|
23103
23114
|
(quoteData, executionVenue, orderId, partialFillSummary) => {
|
|
23104
23115
|
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2;
|
|
@@ -23396,19 +23407,19 @@ var PlaceOrder = ({
|
|
|
23396
23407
|
queryClient,
|
|
23397
23408
|
submissionProgressState
|
|
23398
23409
|
]);
|
|
23399
|
-
const activeQuoteData = (
|
|
23410
|
+
const activeQuoteData = (_S = (_R = selectedRouteCard == null ? void 0 : selectedRouteCard.quoteData) != null ? _R : smartRoute.data) != null ? _S : null;
|
|
23400
23411
|
const visibleRouteCards = orderedRouteCards.length > PLACE_ORDER_ROUTE_COLLAPSED_CARD_COUNT && !isRoutesExpanded ? orderedRouteCards.slice(0, PLACE_ORDER_ROUTE_COLLAPSED_CARD_COUNT) : orderedRouteCards;
|
|
23401
23412
|
const hasEnteredAmount = internalAmount > 0;
|
|
23402
23413
|
const isQuoteLoading = !isLimitOrder && hasEnteredAmount && (smartRoute.isFetching || smartRoute.isLoading || isSell && (venueSellQuotes.isFetching || venueSellQuotes.isLoading));
|
|
23403
23414
|
const routeLoadingMessage = isQuoteLoading ? smartRoute.loadingReason === "updating-route" ? tradingLabels.updatingRoute : smartRoute.loadingReason === "refreshing-quotes" ? tradingLabels.refreshingQuotes : tradingLabels.findingBestOdds : null;
|
|
23404
|
-
const selectedRouteFills = (
|
|
23415
|
+
const selectedRouteFills = (_T = selectedRouteCard == null ? void 0 : selectedRouteCard.quoteData.fills) != null ? _T : [];
|
|
23405
23416
|
const isKalshiOnlyRoute = isKalshiRoute && ((selectedRouteCard == null ? void 0 : selectedRouteCard.venue) === import_sdk23.Venue.kalshi || selectedRouteFills.length > 0 && selectedRouteFills.every((fill) => fill.venue === import_sdk23.Venue.kalshi));
|
|
23406
23417
|
const isOnchainOnlyRoute = !isKalshiRoute || selectedRouteFills.length > 0 && selectedRouteFills.every((fill) => fill.venue !== import_sdk23.Venue.kalshi);
|
|
23407
23418
|
const kalshiRequiredAmount = isSell ? 0 : selectedRouteFills.filter((fill) => fill.venue === import_sdk23.Venue.kalshi).reduce((total, fill) => total + fill.venueQty * fill.avgPrice, 0);
|
|
23408
23419
|
const onchainRequiredAmount = isSell ? 0 : selectedRouteFills.filter((fill) => fill.venue !== import_sdk23.Venue.kalshi).reduce((total, fill) => total + fill.venueQty * fill.avgPrice, 0);
|
|
23409
23420
|
const resolvedKalshiRequiredAmount = isKalshiOnlyRoute || isKalshiRoute && selectedRouteFills.length === 0 ? internalAmount : kalshiRequiredAmount;
|
|
23410
23421
|
const resolvedOnchainRequiredAmount = isOnchainOnlyRoute || !isKalshiRoute && selectedRouteFills.length === 0 ? internalAmount : onchainRequiredAmount;
|
|
23411
|
-
const isKalshiBalanceInsufficient = !isPaperMode && isKalshiRoute && resolvedKalshiRequiredAmount > ((
|
|
23422
|
+
const isKalshiBalanceInsufficient = !isPaperMode && isKalshiRoute && resolvedKalshiRequiredAmount > ((_U = liveBalanceState.kalshiBalance) != null ? _U : 0);
|
|
23412
23423
|
const isOnchainBalanceInsufficient = resolvedOnchainRequiredAmount > liveAvailableBalance;
|
|
23413
23424
|
const isInsufficientBalance = !isSell && isAuthenticated && hasEnteredAmount && !isBalanceLoading && (isLimitOrder ? internalAmount > totalBalance : isPaperMode ? internalAmount > paperTotalBalance : isKalshiBalanceInsufficient || isOnchainBalanceInsufficient);
|
|
23414
23425
|
const isQuoteInsufficientBalance = !isLimitOrder && (activeQuoteData == null ? void 0 : activeQuoteData.status) === "insufficient_balance";
|
|
@@ -23502,7 +23513,7 @@ var PlaceOrder = ({
|
|
|
23502
23513
|
}
|
|
23503
23514
|
return (_d2 = selectedRouteCard.hint) != null ? _d2 : "";
|
|
23504
23515
|
}, [selectedRouteCard, tradingLabels]);
|
|
23505
|
-
const displayedToWinValue = (
|
|
23516
|
+
const displayedToWinValue = (_V = selectedRouteCard == null ? void 0 : selectedRouteCard.numericValue) != null ? _V : 0;
|
|
23506
23517
|
const limitOrderPayload = (0, import_react39.useMemo)(() => {
|
|
23507
23518
|
if (!scopedSelectedMarket || !scopedSelectedOutcomeId || internalAmount <= 0) return null;
|
|
23508
23519
|
if (limitPriceInputError) return null;
|
|
@@ -23621,13 +23632,13 @@ var PlaceOrder = ({
|
|
|
23621
23632
|
];
|
|
23622
23633
|
}, [activeFeeBreakdown, tradingLabels]);
|
|
23623
23634
|
const isActionLoading = isPrimaryActionLoading || executeManaged.isPending || placeLimitOrder.isPending || isBeforeActionPending;
|
|
23624
|
-
const selectedRouteGeoBlocked = (
|
|
23635
|
+
const selectedRouteGeoBlocked = (_W = selectedRouteCard == null ? void 0 : selectedRouteCard.isUnavailable) != null ? _W : false;
|
|
23625
23636
|
const geoBlockedVenuesFromWarnings = (0, import_react39.useMemo)(
|
|
23626
23637
|
() => {
|
|
23627
23638
|
var _a2;
|
|
23628
23639
|
return extractGeoBlockedVenues((_a2 = smartRoute.data) == null ? void 0 : _a2.warnings);
|
|
23629
23640
|
},
|
|
23630
|
-
[(
|
|
23641
|
+
[(_X = smartRoute.data) == null ? void 0 : _X.warnings]
|
|
23631
23642
|
);
|
|
23632
23643
|
const isPrimaryVenueGeoBlocked = (0, import_react39.useMemo)(() => {
|
|
23633
23644
|
var _a2, _b2;
|
|
@@ -24285,7 +24296,7 @@ var PlaceOrder = ({
|
|
|
24285
24296
|
PlaceOrderResolvedView,
|
|
24286
24297
|
{
|
|
24287
24298
|
tradingState: resolvedReadOnlyTradingState,
|
|
24288
|
-
resolutionTimestamp: (
|
|
24299
|
+
resolutionTimestamp: (_Y = resolvedEventTradingState.resolvesAt) != null ? _Y : resolvedReadOnlyTradingState.resolvesAt,
|
|
24289
24300
|
resolvedClaim,
|
|
24290
24301
|
classNames,
|
|
24291
24302
|
className,
|
package/dist/index.mjs
CHANGED
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
UserProfilePage,
|
|
12
12
|
buildAggTxExplorerHref,
|
|
13
13
|
useHomePageModals
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-C247AYH7.mjs";
|
|
15
15
|
import {
|
|
16
16
|
EventList,
|
|
17
17
|
EventListItem,
|
|
@@ -54,7 +54,7 @@ import {
|
|
|
54
54
|
requestAggWithdrawModalOpen,
|
|
55
55
|
useClaimWinnings,
|
|
56
56
|
useResolvedMarketClaim
|
|
57
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-O27JUYCF.mjs";
|
|
58
58
|
import {
|
|
59
59
|
SETTLEMENT_SECTION_ID,
|
|
60
60
|
Settlement,
|
package/dist/pages.js
CHANGED
|
@@ -18331,7 +18331,7 @@ var buildLiveRouteCards = ({
|
|
|
18331
18331
|
};
|
|
18332
18332
|
}
|
|
18333
18333
|
const avgPrice = sq.avgPrice;
|
|
18334
|
-
const soloQuoteData = __spreadProps(__spreadValues({}, quoteData), {
|
|
18334
|
+
const soloQuoteData = __spreadValues(__spreadProps(__spreadValues({}, quoteData), {
|
|
18335
18335
|
// Preview-only solos intentionally carry no executable quoteId; the card
|
|
18336
18336
|
// should still render for comparison, while the CTA stays disabled until
|
|
18337
18337
|
// the user is funded and requotes.
|
|
@@ -18344,7 +18344,7 @@ var buildLiveRouteCards = ({
|
|
|
18344
18344
|
returnPct: sq.returnPct,
|
|
18345
18345
|
// venueSoloQuotes stripped on solo card's quoteData (only the primary needs them)
|
|
18346
18346
|
venueSoloQuotes: void 0
|
|
18347
|
-
});
|
|
18347
|
+
}), sq.quoteId ? { status: "ok", error: void 0 } : null);
|
|
18348
18348
|
return {
|
|
18349
18349
|
id: `live-solo-${sq.venue}`,
|
|
18350
18350
|
hint: labels.averagePrice(avgPrice),
|
|
@@ -18400,6 +18400,17 @@ var buildLiveRouteCards = ({
|
|
|
18400
18400
|
})() : [];
|
|
18401
18401
|
return [...baseCards, ...unavailableCards, ...warningOnlyUnavailableCards];
|
|
18402
18402
|
};
|
|
18403
|
+
var resolveDefaultRouteCardId = (routeCards, primaryStatus) => {
|
|
18404
|
+
var _a, _b, _c, _d;
|
|
18405
|
+
if (routeCards.length === 0) return null;
|
|
18406
|
+
if (primaryStatus === "insufficient_balance") {
|
|
18407
|
+
const executableCard = routeCards.find(
|
|
18408
|
+
(card) => !card.isUnavailable && card.quoteData.status === "ok" && card.quoteData.quoteId
|
|
18409
|
+
);
|
|
18410
|
+
if (executableCard) return executableCard.id;
|
|
18411
|
+
}
|
|
18412
|
+
return (_d = (_c = (_a = routeCards.find((card) => !card.isUnavailable)) == null ? void 0 : _a.id) != null ? _c : (_b = routeCards[0]) == null ? void 0 : _b.id) != null ? _d : null;
|
|
18413
|
+
};
|
|
18403
18414
|
var sellSharesToAtomicUnits = (shares) => {
|
|
18404
18415
|
if (!Number.isFinite(shares) || shares <= 0) return BigInt(0);
|
|
18405
18416
|
const [whole = "0", fraction = ""] = shares.toFixed(12).split(".");
|
|
@@ -20334,7 +20345,7 @@ var PlaceOrder = ({
|
|
|
20334
20345
|
resolvedClaim,
|
|
20335
20346
|
midpointsResult
|
|
20336
20347
|
}) => {
|
|
20337
|
-
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, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X;
|
|
20348
|
+
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, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y;
|
|
20338
20349
|
const {
|
|
20339
20350
|
enableDebug: isExecutionDebugEnabled,
|
|
20340
20351
|
features: { enableAnimations, showFeesBreakdown, showLimitOrders },
|
|
@@ -20765,13 +20776,13 @@ var PlaceOrder = ({
|
|
|
20765
20776
|
venueSellQuotes.quotes
|
|
20766
20777
|
]);
|
|
20767
20778
|
const resolvedSelectedRouteCardId = (0, import_react36.useMemo)(() => {
|
|
20768
|
-
var _a2
|
|
20779
|
+
var _a2;
|
|
20769
20780
|
if (routeCards.length === 0) return null;
|
|
20770
20781
|
if (selectedRouteCardId && routeCards.some((card) => card.id === selectedRouteCardId && !card.isUnavailable)) {
|
|
20771
20782
|
return selectedRouteCardId;
|
|
20772
20783
|
}
|
|
20773
|
-
return (
|
|
20774
|
-
}, [routeCards, selectedRouteCardId]);
|
|
20784
|
+
return resolveDefaultRouteCardId(routeCards, isSell ? void 0 : (_a2 = smartRoute.data) == null ? void 0 : _a2.status);
|
|
20785
|
+
}, [routeCards, selectedRouteCardId, isSell, (_w = smartRoute.data) == null ? void 0 : _w.status]);
|
|
20775
20786
|
(0, import_react36.useEffect)(() => {
|
|
20776
20787
|
if (routeCards.length === 0) {
|
|
20777
20788
|
setSelectedRouteCardId(null);
|
|
@@ -20811,14 +20822,14 @@ var PlaceOrder = ({
|
|
|
20811
20822
|
setLimitPriceInputError(null);
|
|
20812
20823
|
}, [executionType, scopedSelectedOutcomeId, selectedOutcomeDisplayPrice]);
|
|
20813
20824
|
const orderedRouteCards = routeCards;
|
|
20814
|
-
const selectedRouteCard = (
|
|
20825
|
+
const selectedRouteCard = (_y = (_x = orderedRouteCards.find((card) => card.id === resolvedSelectedRouteCardId)) != null ? _x : orderedRouteCards[0]) != null ? _y : null;
|
|
20815
20826
|
const isKalshiRoute = (0, import_react36.useMemo)(() => {
|
|
20816
20827
|
if (selectedRouteCard) {
|
|
20817
20828
|
return selectedRouteCard.venue === "kalshi" || selectedRouteCard.quoteData.fills.some((f) => f.venue === "kalshi");
|
|
20818
20829
|
}
|
|
20819
20830
|
return (scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.venue) === "kalshi";
|
|
20820
20831
|
}, [selectedRouteCard, scopedSelectedMarket]);
|
|
20821
|
-
const displayedBalance = isPaperMode ? paperTotalBalance : isKalshiRoute ? (
|
|
20832
|
+
const displayedBalance = isPaperMode ? paperTotalBalance : isKalshiRoute ? (_z = liveBalanceState.kalshiBalance) != null ? _z : 0 : liveAvailableBalance;
|
|
20822
20833
|
const legacyKalshiAccount = (0, import_react36.useMemo)(
|
|
20823
20834
|
() => {
|
|
20824
20835
|
var _a2;
|
|
@@ -20826,8 +20837,8 @@ var PlaceOrder = ({
|
|
|
20826
20837
|
},
|
|
20827
20838
|
[user == null ? void 0 : user.venueAccounts]
|
|
20828
20839
|
);
|
|
20829
|
-
const isKalshiAccountActive = (
|
|
20830
|
-
const isKalshiVerified = ((
|
|
20840
|
+
const isKalshiAccountActive = (_A = kalshiKeyStatus == null ? void 0 : kalshiKeyStatus.connected) != null ? _A : (legacyKalshiAccount == null ? void 0 : legacyKalshiAccount.status) === "active";
|
|
20841
|
+
const isKalshiVerified = ((_B = kalshiKeyStatus == null ? void 0 : kalshiKeyStatus.kycStatus) != null ? _B : legacyKalshiAccount == null ? void 0 : legacyKalshiAccount.kycStatus) === "verified";
|
|
20831
20842
|
const hasKalshiConnectionState = kalshiKeyStatus !== void 0 || (user == null ? void 0 : user.venueAccounts) != null;
|
|
20832
20843
|
const isKalshiAvailable = (0, import_hooks60.getVenueAvailabilityState)({
|
|
20833
20844
|
venueId: "kalshi",
|
|
@@ -20854,7 +20865,7 @@ var PlaceOrder = ({
|
|
|
20854
20865
|
[aggClient, onConnectKalshi, refetchKalshiKeyStatus]
|
|
20855
20866
|
);
|
|
20856
20867
|
const needsKycVerification = isAuthenticated && hasKalshiConnectionState && isKalshiRoute && isKalshiAccountActive && !isKalshiVerified;
|
|
20857
|
-
const verifyKalshiConnectionLabel = (
|
|
20868
|
+
const verifyKalshiConnectionLabel = (_F = (_E = (_D = (_C = labels.onboarding) == null ? void 0 : _C.connectKalshiModal) == null ? void 0 : _D.actions) == null ? void 0 : _E.verifyConnection) != null ? _F : tradingLabels.kycRequired;
|
|
20858
20869
|
const handleRouteCardSelect = (0, import_react36.useCallback)(
|
|
20859
20870
|
(cardId) => {
|
|
20860
20871
|
if (cardId === resolvedSelectedRouteCardId) {
|
|
@@ -20869,15 +20880,15 @@ var PlaceOrder = ({
|
|
|
20869
20880
|
[resolvedSelectedRouteCardId, routeCards]
|
|
20870
20881
|
);
|
|
20871
20882
|
const executionProgress = (0, import_hooks60.useExecutionProgress)({
|
|
20872
|
-
orderIds: (
|
|
20873
|
-
quoteId: (
|
|
20883
|
+
orderIds: (_G = submissionProgressState == null ? void 0 : submissionProgressState.orderIds) != null ? _G : null,
|
|
20884
|
+
quoteId: (_H = submissionProgressState == null ? void 0 : submissionProgressState.quoteId) != null ? _H : null,
|
|
20874
20885
|
mode: isPaperMode ? "paper" : void 0,
|
|
20875
|
-
enabled: ((submissionProgressState == null ? void 0 : submissionProgressState.phase) === "submitting" || (submissionProgressState == null ? void 0 : submissionProgressState.phase) === "executing") && !!((
|
|
20886
|
+
enabled: ((submissionProgressState == null ? void 0 : submissionProgressState.phase) === "submitting" || (submissionProgressState == null ? void 0 : submissionProgressState.phase) === "executing") && !!((_I = submissionProgressState == null ? void 0 : submissionProgressState.orderIds) == null ? void 0 : _I.length)
|
|
20876
20887
|
});
|
|
20877
|
-
const selectedOutcomeLabel = (
|
|
20878
|
-
const headerImage = (
|
|
20879
|
-
const headerTitle = (
|
|
20880
|
-
const headerSubtitle = (
|
|
20888
|
+
const selectedOutcomeLabel = (_L = (_K = (_J = outcomes.find((outcome) => outcome.id === scopedSelectedOutcomeId)) == null ? void 0 : _J.label) != null ? _K : scopedSelectedOutcome == null ? void 0 : scopedSelectedOutcome.label) != null ? _L : "";
|
|
20889
|
+
const headerImage = (_N = (_M = scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.image) != null ? _M : scopedSelectedEvent == null ? void 0 : scopedSelectedEvent.image) != null ? _N : null;
|
|
20890
|
+
const headerTitle = (_P = (_O = scopedSelectedEvent == null ? void 0 : scopedSelectedEvent.title) != null ? _O : scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.question) != null ? _P : "";
|
|
20891
|
+
const headerSubtitle = (_Q = scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.question) != null ? _Q : "";
|
|
20881
20892
|
const buildExecutionSummary = (0, import_react36.useCallback)(
|
|
20882
20893
|
(quoteData, executionVenue, orderId, partialFillSummary) => {
|
|
20883
20894
|
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2;
|
|
@@ -21175,19 +21186,19 @@ var PlaceOrder = ({
|
|
|
21175
21186
|
queryClient,
|
|
21176
21187
|
submissionProgressState
|
|
21177
21188
|
]);
|
|
21178
|
-
const activeQuoteData = (
|
|
21189
|
+
const activeQuoteData = (_S = (_R = selectedRouteCard == null ? void 0 : selectedRouteCard.quoteData) != null ? _R : smartRoute.data) != null ? _S : null;
|
|
21179
21190
|
const visibleRouteCards = orderedRouteCards.length > PLACE_ORDER_ROUTE_COLLAPSED_CARD_COUNT && !isRoutesExpanded ? orderedRouteCards.slice(0, PLACE_ORDER_ROUTE_COLLAPSED_CARD_COUNT) : orderedRouteCards;
|
|
21180
21191
|
const hasEnteredAmount = internalAmount > 0;
|
|
21181
21192
|
const isQuoteLoading = !isLimitOrder && hasEnteredAmount && (smartRoute.isFetching || smartRoute.isLoading || isSell && (venueSellQuotes.isFetching || venueSellQuotes.isLoading));
|
|
21182
21193
|
const routeLoadingMessage = isQuoteLoading ? smartRoute.loadingReason === "updating-route" ? tradingLabels.updatingRoute : smartRoute.loadingReason === "refreshing-quotes" ? tradingLabels.refreshingQuotes : tradingLabels.findingBestOdds : null;
|
|
21183
|
-
const selectedRouteFills = (
|
|
21194
|
+
const selectedRouteFills = (_T = selectedRouteCard == null ? void 0 : selectedRouteCard.quoteData.fills) != null ? _T : [];
|
|
21184
21195
|
const isKalshiOnlyRoute = isKalshiRoute && ((selectedRouteCard == null ? void 0 : selectedRouteCard.venue) === import_sdk22.Venue.kalshi || selectedRouteFills.length > 0 && selectedRouteFills.every((fill) => fill.venue === import_sdk22.Venue.kalshi));
|
|
21185
21196
|
const isOnchainOnlyRoute = !isKalshiRoute || selectedRouteFills.length > 0 && selectedRouteFills.every((fill) => fill.venue !== import_sdk22.Venue.kalshi);
|
|
21186
21197
|
const kalshiRequiredAmount = isSell ? 0 : selectedRouteFills.filter((fill) => fill.venue === import_sdk22.Venue.kalshi).reduce((total, fill) => total + fill.venueQty * fill.avgPrice, 0);
|
|
21187
21198
|
const onchainRequiredAmount = isSell ? 0 : selectedRouteFills.filter((fill) => fill.venue !== import_sdk22.Venue.kalshi).reduce((total, fill) => total + fill.venueQty * fill.avgPrice, 0);
|
|
21188
21199
|
const resolvedKalshiRequiredAmount = isKalshiOnlyRoute || isKalshiRoute && selectedRouteFills.length === 0 ? internalAmount : kalshiRequiredAmount;
|
|
21189
21200
|
const resolvedOnchainRequiredAmount = isOnchainOnlyRoute || !isKalshiRoute && selectedRouteFills.length === 0 ? internalAmount : onchainRequiredAmount;
|
|
21190
|
-
const isKalshiBalanceInsufficient = !isPaperMode && isKalshiRoute && resolvedKalshiRequiredAmount > ((
|
|
21201
|
+
const isKalshiBalanceInsufficient = !isPaperMode && isKalshiRoute && resolvedKalshiRequiredAmount > ((_U = liveBalanceState.kalshiBalance) != null ? _U : 0);
|
|
21191
21202
|
const isOnchainBalanceInsufficient = resolvedOnchainRequiredAmount > liveAvailableBalance;
|
|
21192
21203
|
const isInsufficientBalance = !isSell && isAuthenticated && hasEnteredAmount && !isBalanceLoading && (isLimitOrder ? internalAmount > totalBalance : isPaperMode ? internalAmount > paperTotalBalance : isKalshiBalanceInsufficient || isOnchainBalanceInsufficient);
|
|
21193
21204
|
const isQuoteInsufficientBalance = !isLimitOrder && (activeQuoteData == null ? void 0 : activeQuoteData.status) === "insufficient_balance";
|
|
@@ -21281,7 +21292,7 @@ var PlaceOrder = ({
|
|
|
21281
21292
|
}
|
|
21282
21293
|
return (_d2 = selectedRouteCard.hint) != null ? _d2 : "";
|
|
21283
21294
|
}, [selectedRouteCard, tradingLabels]);
|
|
21284
|
-
const displayedToWinValue = (
|
|
21295
|
+
const displayedToWinValue = (_V = selectedRouteCard == null ? void 0 : selectedRouteCard.numericValue) != null ? _V : 0;
|
|
21285
21296
|
const limitOrderPayload = (0, import_react36.useMemo)(() => {
|
|
21286
21297
|
if (!scopedSelectedMarket || !scopedSelectedOutcomeId || internalAmount <= 0) return null;
|
|
21287
21298
|
if (limitPriceInputError) return null;
|
|
@@ -21400,13 +21411,13 @@ var PlaceOrder = ({
|
|
|
21400
21411
|
];
|
|
21401
21412
|
}, [activeFeeBreakdown, tradingLabels]);
|
|
21402
21413
|
const isActionLoading = isPrimaryActionLoading || executeManaged.isPending || placeLimitOrder.isPending || isBeforeActionPending;
|
|
21403
|
-
const selectedRouteGeoBlocked = (
|
|
21414
|
+
const selectedRouteGeoBlocked = (_W = selectedRouteCard == null ? void 0 : selectedRouteCard.isUnavailable) != null ? _W : false;
|
|
21404
21415
|
const geoBlockedVenuesFromWarnings = (0, import_react36.useMemo)(
|
|
21405
21416
|
() => {
|
|
21406
21417
|
var _a2;
|
|
21407
21418
|
return extractGeoBlockedVenues((_a2 = smartRoute.data) == null ? void 0 : _a2.warnings);
|
|
21408
21419
|
},
|
|
21409
|
-
[(
|
|
21420
|
+
[(_X = smartRoute.data) == null ? void 0 : _X.warnings]
|
|
21410
21421
|
);
|
|
21411
21422
|
const isPrimaryVenueGeoBlocked = (0, import_react36.useMemo)(() => {
|
|
21412
21423
|
var _a2, _b2;
|
|
@@ -22064,7 +22075,7 @@ var PlaceOrder = ({
|
|
|
22064
22075
|
PlaceOrderResolvedView,
|
|
22065
22076
|
{
|
|
22066
22077
|
tradingState: resolvedReadOnlyTradingState,
|
|
22067
|
-
resolutionTimestamp: (
|
|
22078
|
+
resolutionTimestamp: (_Y = resolvedEventTradingState.resolvesAt) != null ? _Y : resolvedReadOnlyTradingState.resolvesAt,
|
|
22068
22079
|
resolvedClaim,
|
|
22069
22080
|
classNames,
|
|
22070
22081
|
className,
|
package/dist/pages.mjs
CHANGED
|
@@ -8,14 +8,14 @@ import {
|
|
|
8
8
|
UserProfilePage,
|
|
9
9
|
buildAggTxExplorerHref,
|
|
10
10
|
useHomePageModals
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-C247AYH7.mjs";
|
|
12
12
|
import "./chunk-XAG432PJ.mjs";
|
|
13
13
|
import {
|
|
14
14
|
DEPOSIT_MODAL_OPEN_EVENT,
|
|
15
15
|
WITHDRAW_MODAL_OPEN_EVENT,
|
|
16
16
|
requestAggDepositModalOpen,
|
|
17
17
|
requestAggWithdrawModalOpen
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-O27JUYCF.mjs";
|
|
19
19
|
import "./chunk-JQKJDSTW.mjs";
|
|
20
20
|
import "./chunk-AHQA3B7D.mjs";
|
|
21
21
|
import "./chunk-FMYYPNZZ.mjs";
|
package/dist/trading.js
CHANGED
|
@@ -8467,7 +8467,7 @@ var buildLiveRouteCards = ({
|
|
|
8467
8467
|
};
|
|
8468
8468
|
}
|
|
8469
8469
|
const avgPrice = sq.avgPrice;
|
|
8470
|
-
const soloQuoteData = __spreadProps(__spreadValues({}, quoteData), {
|
|
8470
|
+
const soloQuoteData = __spreadValues(__spreadProps(__spreadValues({}, quoteData), {
|
|
8471
8471
|
// Preview-only solos intentionally carry no executable quoteId; the card
|
|
8472
8472
|
// should still render for comparison, while the CTA stays disabled until
|
|
8473
8473
|
// the user is funded and requotes.
|
|
@@ -8480,7 +8480,7 @@ var buildLiveRouteCards = ({
|
|
|
8480
8480
|
returnPct: sq.returnPct,
|
|
8481
8481
|
// venueSoloQuotes stripped on solo card's quoteData (only the primary needs them)
|
|
8482
8482
|
venueSoloQuotes: void 0
|
|
8483
|
-
});
|
|
8483
|
+
}), sq.quoteId ? { status: "ok", error: void 0 } : null);
|
|
8484
8484
|
return {
|
|
8485
8485
|
id: `live-solo-${sq.venue}`,
|
|
8486
8486
|
hint: labels.averagePrice(avgPrice),
|
|
@@ -8536,6 +8536,17 @@ var buildLiveRouteCards = ({
|
|
|
8536
8536
|
})() : [];
|
|
8537
8537
|
return [...baseCards, ...unavailableCards, ...warningOnlyUnavailableCards];
|
|
8538
8538
|
};
|
|
8539
|
+
var resolveDefaultRouteCardId = (routeCards, primaryStatus) => {
|
|
8540
|
+
var _a, _b, _c, _d;
|
|
8541
|
+
if (routeCards.length === 0) return null;
|
|
8542
|
+
if (primaryStatus === "insufficient_balance") {
|
|
8543
|
+
const executableCard = routeCards.find(
|
|
8544
|
+
(card) => !card.isUnavailable && card.quoteData.status === "ok" && card.quoteData.quoteId
|
|
8545
|
+
);
|
|
8546
|
+
if (executableCard) return executableCard.id;
|
|
8547
|
+
}
|
|
8548
|
+
return (_d = (_c = (_a = routeCards.find((card) => !card.isUnavailable)) == null ? void 0 : _a.id) != null ? _c : (_b = routeCards[0]) == null ? void 0 : _b.id) != null ? _d : null;
|
|
8549
|
+
};
|
|
8539
8550
|
var sellSharesToAtomicUnits = (shares) => {
|
|
8540
8551
|
if (!Number.isFinite(shares) || shares <= 0) return BigInt(0);
|
|
8541
8552
|
const [whole = "0", fraction = ""] = shares.toFixed(12).split(".");
|
|
@@ -10470,7 +10481,7 @@ var PlaceOrder = ({
|
|
|
10470
10481
|
resolvedClaim,
|
|
10471
10482
|
midpointsResult
|
|
10472
10483
|
}) => {
|
|
10473
|
-
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, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X;
|
|
10484
|
+
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, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y;
|
|
10474
10485
|
const {
|
|
10475
10486
|
enableDebug: isExecutionDebugEnabled,
|
|
10476
10487
|
features: { enableAnimations, showFeesBreakdown, showLimitOrders },
|
|
@@ -10901,13 +10912,13 @@ var PlaceOrder = ({
|
|
|
10901
10912
|
venueSellQuotes.quotes
|
|
10902
10913
|
]);
|
|
10903
10914
|
const resolvedSelectedRouteCardId = (0, import_react15.useMemo)(() => {
|
|
10904
|
-
var _a2
|
|
10915
|
+
var _a2;
|
|
10905
10916
|
if (routeCards.length === 0) return null;
|
|
10906
10917
|
if (selectedRouteCardId && routeCards.some((card) => card.id === selectedRouteCardId && !card.isUnavailable)) {
|
|
10907
10918
|
return selectedRouteCardId;
|
|
10908
10919
|
}
|
|
10909
|
-
return (
|
|
10910
|
-
}, [routeCards, selectedRouteCardId]);
|
|
10920
|
+
return resolveDefaultRouteCardId(routeCards, isSell ? void 0 : (_a2 = smartRoute.data) == null ? void 0 : _a2.status);
|
|
10921
|
+
}, [routeCards, selectedRouteCardId, isSell, (_w = smartRoute.data) == null ? void 0 : _w.status]);
|
|
10911
10922
|
(0, import_react15.useEffect)(() => {
|
|
10912
10923
|
if (routeCards.length === 0) {
|
|
10913
10924
|
setSelectedRouteCardId(null);
|
|
@@ -10947,14 +10958,14 @@ var PlaceOrder = ({
|
|
|
10947
10958
|
setLimitPriceInputError(null);
|
|
10948
10959
|
}, [executionType, scopedSelectedOutcomeId, selectedOutcomeDisplayPrice]);
|
|
10949
10960
|
const orderedRouteCards = routeCards;
|
|
10950
|
-
const selectedRouteCard = (
|
|
10961
|
+
const selectedRouteCard = (_y = (_x = orderedRouteCards.find((card) => card.id === resolvedSelectedRouteCardId)) != null ? _x : orderedRouteCards[0]) != null ? _y : null;
|
|
10951
10962
|
const isKalshiRoute = (0, import_react15.useMemo)(() => {
|
|
10952
10963
|
if (selectedRouteCard) {
|
|
10953
10964
|
return selectedRouteCard.venue === "kalshi" || selectedRouteCard.quoteData.fills.some((f) => f.venue === "kalshi");
|
|
10954
10965
|
}
|
|
10955
10966
|
return (scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.venue) === "kalshi";
|
|
10956
10967
|
}, [selectedRouteCard, scopedSelectedMarket]);
|
|
10957
|
-
const displayedBalance = isPaperMode ? paperTotalBalance : isKalshiRoute ? (
|
|
10968
|
+
const displayedBalance = isPaperMode ? paperTotalBalance : isKalshiRoute ? (_z = liveBalanceState.kalshiBalance) != null ? _z : 0 : liveAvailableBalance;
|
|
10958
10969
|
const legacyKalshiAccount = (0, import_react15.useMemo)(
|
|
10959
10970
|
() => {
|
|
10960
10971
|
var _a2;
|
|
@@ -10962,8 +10973,8 @@ var PlaceOrder = ({
|
|
|
10962
10973
|
},
|
|
10963
10974
|
[user == null ? void 0 : user.venueAccounts]
|
|
10964
10975
|
);
|
|
10965
|
-
const isKalshiAccountActive = (
|
|
10966
|
-
const isKalshiVerified = ((
|
|
10976
|
+
const isKalshiAccountActive = (_A = kalshiKeyStatus == null ? void 0 : kalshiKeyStatus.connected) != null ? _A : (legacyKalshiAccount == null ? void 0 : legacyKalshiAccount.status) === "active";
|
|
10977
|
+
const isKalshiVerified = ((_B = kalshiKeyStatus == null ? void 0 : kalshiKeyStatus.kycStatus) != null ? _B : legacyKalshiAccount == null ? void 0 : legacyKalshiAccount.kycStatus) === "verified";
|
|
10967
10978
|
const hasKalshiConnectionState = kalshiKeyStatus !== void 0 || (user == null ? void 0 : user.venueAccounts) != null;
|
|
10968
10979
|
const isKalshiAvailable = (0, import_hooks36.getVenueAvailabilityState)({
|
|
10969
10980
|
venueId: "kalshi",
|
|
@@ -10990,7 +11001,7 @@ var PlaceOrder = ({
|
|
|
10990
11001
|
[aggClient, onConnectKalshi, refetchKalshiKeyStatus]
|
|
10991
11002
|
);
|
|
10992
11003
|
const needsKycVerification = isAuthenticated && hasKalshiConnectionState && isKalshiRoute && isKalshiAccountActive && !isKalshiVerified;
|
|
10993
|
-
const verifyKalshiConnectionLabel = (
|
|
11004
|
+
const verifyKalshiConnectionLabel = (_F = (_E = (_D = (_C = labels.onboarding) == null ? void 0 : _C.connectKalshiModal) == null ? void 0 : _D.actions) == null ? void 0 : _E.verifyConnection) != null ? _F : tradingLabels.kycRequired;
|
|
10994
11005
|
const handleRouteCardSelect = (0, import_react15.useCallback)(
|
|
10995
11006
|
(cardId) => {
|
|
10996
11007
|
if (cardId === resolvedSelectedRouteCardId) {
|
|
@@ -11005,15 +11016,15 @@ var PlaceOrder = ({
|
|
|
11005
11016
|
[resolvedSelectedRouteCardId, routeCards]
|
|
11006
11017
|
);
|
|
11007
11018
|
const executionProgress = (0, import_hooks36.useExecutionProgress)({
|
|
11008
|
-
orderIds: (
|
|
11009
|
-
quoteId: (
|
|
11019
|
+
orderIds: (_G = submissionProgressState == null ? void 0 : submissionProgressState.orderIds) != null ? _G : null,
|
|
11020
|
+
quoteId: (_H = submissionProgressState == null ? void 0 : submissionProgressState.quoteId) != null ? _H : null,
|
|
11010
11021
|
mode: isPaperMode ? "paper" : void 0,
|
|
11011
|
-
enabled: ((submissionProgressState == null ? void 0 : submissionProgressState.phase) === "submitting" || (submissionProgressState == null ? void 0 : submissionProgressState.phase) === "executing") && !!((
|
|
11022
|
+
enabled: ((submissionProgressState == null ? void 0 : submissionProgressState.phase) === "submitting" || (submissionProgressState == null ? void 0 : submissionProgressState.phase) === "executing") && !!((_I = submissionProgressState == null ? void 0 : submissionProgressState.orderIds) == null ? void 0 : _I.length)
|
|
11012
11023
|
});
|
|
11013
|
-
const selectedOutcomeLabel = (
|
|
11014
|
-
const headerImage = (
|
|
11015
|
-
const headerTitle = (
|
|
11016
|
-
const headerSubtitle = (
|
|
11024
|
+
const selectedOutcomeLabel = (_L = (_K = (_J = outcomes.find((outcome) => outcome.id === scopedSelectedOutcomeId)) == null ? void 0 : _J.label) != null ? _K : scopedSelectedOutcome == null ? void 0 : scopedSelectedOutcome.label) != null ? _L : "";
|
|
11025
|
+
const headerImage = (_N = (_M = scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.image) != null ? _M : scopedSelectedEvent == null ? void 0 : scopedSelectedEvent.image) != null ? _N : null;
|
|
11026
|
+
const headerTitle = (_P = (_O = scopedSelectedEvent == null ? void 0 : scopedSelectedEvent.title) != null ? _O : scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.question) != null ? _P : "";
|
|
11027
|
+
const headerSubtitle = (_Q = scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.question) != null ? _Q : "";
|
|
11017
11028
|
const buildExecutionSummary = (0, import_react15.useCallback)(
|
|
11018
11029
|
(quoteData, executionVenue, orderId, partialFillSummary) => {
|
|
11019
11030
|
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2;
|
|
@@ -11311,19 +11322,19 @@ var PlaceOrder = ({
|
|
|
11311
11322
|
queryClient,
|
|
11312
11323
|
submissionProgressState
|
|
11313
11324
|
]);
|
|
11314
|
-
const activeQuoteData = (
|
|
11325
|
+
const activeQuoteData = (_S = (_R = selectedRouteCard == null ? void 0 : selectedRouteCard.quoteData) != null ? _R : smartRoute.data) != null ? _S : null;
|
|
11315
11326
|
const visibleRouteCards = orderedRouteCards.length > PLACE_ORDER_ROUTE_COLLAPSED_CARD_COUNT && !isRoutesExpanded ? orderedRouteCards.slice(0, PLACE_ORDER_ROUTE_COLLAPSED_CARD_COUNT) : orderedRouteCards;
|
|
11316
11327
|
const hasEnteredAmount = internalAmount > 0;
|
|
11317
11328
|
const isQuoteLoading = !isLimitOrder && hasEnteredAmount && (smartRoute.isFetching || smartRoute.isLoading || isSell && (venueSellQuotes.isFetching || venueSellQuotes.isLoading));
|
|
11318
11329
|
const routeLoadingMessage = isQuoteLoading ? smartRoute.loadingReason === "updating-route" ? tradingLabels.updatingRoute : smartRoute.loadingReason === "refreshing-quotes" ? tradingLabels.refreshingQuotes : tradingLabels.findingBestOdds : null;
|
|
11319
|
-
const selectedRouteFills = (
|
|
11330
|
+
const selectedRouteFills = (_T = selectedRouteCard == null ? void 0 : selectedRouteCard.quoteData.fills) != null ? _T : [];
|
|
11320
11331
|
const isKalshiOnlyRoute = isKalshiRoute && ((selectedRouteCard == null ? void 0 : selectedRouteCard.venue) === import_sdk17.Venue.kalshi || selectedRouteFills.length > 0 && selectedRouteFills.every((fill) => fill.venue === import_sdk17.Venue.kalshi));
|
|
11321
11332
|
const isOnchainOnlyRoute = !isKalshiRoute || selectedRouteFills.length > 0 && selectedRouteFills.every((fill) => fill.venue !== import_sdk17.Venue.kalshi);
|
|
11322
11333
|
const kalshiRequiredAmount = isSell ? 0 : selectedRouteFills.filter((fill) => fill.venue === import_sdk17.Venue.kalshi).reduce((total, fill) => total + fill.venueQty * fill.avgPrice, 0);
|
|
11323
11334
|
const onchainRequiredAmount = isSell ? 0 : selectedRouteFills.filter((fill) => fill.venue !== import_sdk17.Venue.kalshi).reduce((total, fill) => total + fill.venueQty * fill.avgPrice, 0);
|
|
11324
11335
|
const resolvedKalshiRequiredAmount = isKalshiOnlyRoute || isKalshiRoute && selectedRouteFills.length === 0 ? internalAmount : kalshiRequiredAmount;
|
|
11325
11336
|
const resolvedOnchainRequiredAmount = isOnchainOnlyRoute || !isKalshiRoute && selectedRouteFills.length === 0 ? internalAmount : onchainRequiredAmount;
|
|
11326
|
-
const isKalshiBalanceInsufficient = !isPaperMode && isKalshiRoute && resolvedKalshiRequiredAmount > ((
|
|
11337
|
+
const isKalshiBalanceInsufficient = !isPaperMode && isKalshiRoute && resolvedKalshiRequiredAmount > ((_U = liveBalanceState.kalshiBalance) != null ? _U : 0);
|
|
11327
11338
|
const isOnchainBalanceInsufficient = resolvedOnchainRequiredAmount > liveAvailableBalance;
|
|
11328
11339
|
const isInsufficientBalance = !isSell && isAuthenticated && hasEnteredAmount && !isBalanceLoading && (isLimitOrder ? internalAmount > totalBalance : isPaperMode ? internalAmount > paperTotalBalance : isKalshiBalanceInsufficient || isOnchainBalanceInsufficient);
|
|
11329
11340
|
const isQuoteInsufficientBalance = !isLimitOrder && (activeQuoteData == null ? void 0 : activeQuoteData.status) === "insufficient_balance";
|
|
@@ -11417,7 +11428,7 @@ var PlaceOrder = ({
|
|
|
11417
11428
|
}
|
|
11418
11429
|
return (_d2 = selectedRouteCard.hint) != null ? _d2 : "";
|
|
11419
11430
|
}, [selectedRouteCard, tradingLabels]);
|
|
11420
|
-
const displayedToWinValue = (
|
|
11431
|
+
const displayedToWinValue = (_V = selectedRouteCard == null ? void 0 : selectedRouteCard.numericValue) != null ? _V : 0;
|
|
11421
11432
|
const limitOrderPayload = (0, import_react15.useMemo)(() => {
|
|
11422
11433
|
if (!scopedSelectedMarket || !scopedSelectedOutcomeId || internalAmount <= 0) return null;
|
|
11423
11434
|
if (limitPriceInputError) return null;
|
|
@@ -11536,13 +11547,13 @@ var PlaceOrder = ({
|
|
|
11536
11547
|
];
|
|
11537
11548
|
}, [activeFeeBreakdown, tradingLabels]);
|
|
11538
11549
|
const isActionLoading = isPrimaryActionLoading || executeManaged.isPending || placeLimitOrder.isPending || isBeforeActionPending;
|
|
11539
|
-
const selectedRouteGeoBlocked = (
|
|
11550
|
+
const selectedRouteGeoBlocked = (_W = selectedRouteCard == null ? void 0 : selectedRouteCard.isUnavailable) != null ? _W : false;
|
|
11540
11551
|
const geoBlockedVenuesFromWarnings = (0, import_react15.useMemo)(
|
|
11541
11552
|
() => {
|
|
11542
11553
|
var _a2;
|
|
11543
11554
|
return extractGeoBlockedVenues((_a2 = smartRoute.data) == null ? void 0 : _a2.warnings);
|
|
11544
11555
|
},
|
|
11545
|
-
[(
|
|
11556
|
+
[(_X = smartRoute.data) == null ? void 0 : _X.warnings]
|
|
11546
11557
|
);
|
|
11547
11558
|
const isPrimaryVenueGeoBlocked = (0, import_react15.useMemo)(() => {
|
|
11548
11559
|
var _a2, _b2;
|
|
@@ -12200,7 +12211,7 @@ var PlaceOrder = ({
|
|
|
12200
12211
|
PlaceOrderResolvedView,
|
|
12201
12212
|
{
|
|
12202
12213
|
tradingState: resolvedReadOnlyTradingState,
|
|
12203
|
-
resolutionTimestamp: (
|
|
12214
|
+
resolutionTimestamp: (_Y = resolvedEventTradingState.resolvesAt) != null ? _Y : resolvedReadOnlyTradingState.resolvesAt,
|
|
12204
12215
|
resolvedClaim,
|
|
12205
12216
|
classNames,
|
|
12206
12217
|
className,
|
package/dist/trading.mjs
CHANGED
|
@@ -38,6 +38,15 @@ export declare const getTradingRoutePriceLabel: (value: number) => string;
|
|
|
38
38
|
export declare const isQuoteBelowVenueMinimum: (quoteData: SmartRouteResponse | null | undefined) => boolean;
|
|
39
39
|
export declare const resolvePlaceOrderQuoteStatus: ({ amount, labels, quoteData, selectedMarket, }: ResolvePlaceOrderQuoteStatusParams) => PlaceOrderQuoteStatus;
|
|
40
40
|
export declare const buildLiveRouteCards: ({ labels, quoteData, tradeSide, eventVenues, geoBlockedVenues: inheritedGeoBlockedVenues, }: BuildLiveRouteCardsParams) => PlaceOrderRouteCard[];
|
|
41
|
+
/**
|
|
42
|
+
* Default route-card pick when the user hasn't selected one (or their selection
|
|
43
|
+
* disappeared from the list). Normally the first available card wins, but when
|
|
44
|
+
* the primary route is blocked on funding (`insufficient_balance`) the panel
|
|
45
|
+
* must not park on it with a blocking alert while an executable solo (status
|
|
46
|
+
* "ok" + real quoteId) sits in the same response — default to that solo so a
|
|
47
|
+
* Kalshi-funded user with no on-chain balance lands on a submittable route.
|
|
48
|
+
*/
|
|
49
|
+
export declare const resolveDefaultRouteCardId: (routeCards: PlaceOrderRouteCard[], primaryStatus?: SmartRouteResponse["status"]) => string | null;
|
|
41
50
|
export declare const clampSellSharesToAvailability: (requestedSellShares: number, availableShares: number) => number;
|
|
42
51
|
export declare const getRemainingVenueSellShares: (availableShares: number, filledShares: number) => number;
|
|
43
52
|
export declare const buildVenueSellQuoteRequests: ({ quoteData, requestedSellShares, }: {
|
|
@@ -38,6 +38,15 @@ export declare const getTradingRoutePriceLabel: (value: number) => string;
|
|
|
38
38
|
export declare const isQuoteBelowVenueMinimum: (quoteData: SmartRouteResponse | null | undefined) => boolean;
|
|
39
39
|
export declare const resolvePlaceOrderQuoteStatus: ({ amount, labels, quoteData, selectedMarket, }: ResolvePlaceOrderQuoteStatusParams) => PlaceOrderQuoteStatus;
|
|
40
40
|
export declare const buildLiveRouteCards: ({ labels, quoteData, tradeSide, eventVenues, geoBlockedVenues: inheritedGeoBlockedVenues, }: BuildLiveRouteCardsParams) => PlaceOrderRouteCard[];
|
|
41
|
+
/**
|
|
42
|
+
* Default route-card pick when the user hasn't selected one (or their selection
|
|
43
|
+
* disappeared from the list). Normally the first available card wins, but when
|
|
44
|
+
* the primary route is blocked on funding (`insufficient_balance`) the panel
|
|
45
|
+
* must not park on it with a blocking alert while an executable solo (status
|
|
46
|
+
* "ok" + real quoteId) sits in the same response — default to that solo so a
|
|
47
|
+
* Kalshi-funded user with no on-chain balance lands on a submittable route.
|
|
48
|
+
*/
|
|
49
|
+
export declare const resolveDefaultRouteCardId: (routeCards: PlaceOrderRouteCard[], primaryStatus?: SmartRouteResponse["status"]) => string | null;
|
|
41
50
|
export declare const clampSellSharesToAvailability: (requestedSellShares: number, availableShares: number) => number;
|
|
42
51
|
export declare const getRemainingVenueSellShares: (availableShares: number, filledShares: number) => number;
|
|
43
52
|
export declare const buildVenueSellQuoteRequests: ({ quoteData, requestedSellShares, }: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agg-build/ui",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.7.0",
|
|
4
4
|
"description": "Pre-built React component library for the AGG prediction market aggregator. Tailwind-based, themeable, with primitives, event surfaces, trading flows, full pages, and modals.",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"license": "MIT",
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
"liveline": "^0.0.7",
|
|
101
101
|
"react": "^18.0.0 || ^19.0.0",
|
|
102
102
|
"react-dom": "^18.0.0 || ^19.0.0",
|
|
103
|
-
"@agg-build/hooks": "^2.
|
|
103
|
+
"@agg-build/hooks": "^2.7.0",
|
|
104
104
|
"@agg-build/sdk": "^2.5.1"
|
|
105
105
|
},
|
|
106
106
|
"dependencies": {
|