@agg-build/ui 4.9.1 → 4.10.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-GKYBQEBC.mjs → chunk-4HTE5IEZ.mjs} +43 -26
- package/dist/{chunk-TNNLRRHC.mjs → chunk-6EHT5OFU.mjs} +1 -1
- package/dist/{chunk-GVIS3YXU.mjs → chunk-H5LCCV2J.mjs} +22 -11
- package/dist/{chunk-GG57TRNE.mjs → chunk-I72YHWOI.mjs} +2 -2
- package/dist/{chunk-XQLLZTEW.mjs → chunk-SMQRUNMZ.mjs} +19 -10
- package/dist/{chunk-H7L4HDXS.mjs → chunk-TXQJUVRW.mjs} +3 -2
- package/dist/{chunk-NYL6A6AD.mjs → chunk-W7HQVQ22.mjs} +257 -195
- package/dist/events.js +753 -680
- package/dist/events.mjs +3 -3
- package/dist/index.js +2703 -2603
- package/dist/index.mjs +7 -7
- package/dist/modals.js +1352 -1289
- package/dist/modals.mjs +3 -3
- package/dist/pages.js +2063 -1963
- package/dist/pages.mjs +6 -6
- package/dist/primitives.js +288 -226
- package/dist/primitives.mjs +1 -1
- package/dist/trading.js +845 -765
- package/dist/trading.mjs +4 -4
- package/dist/types/events/item-details/event-list-item-details.types.d.mts +2 -0
- package/dist/types/events/item-details/event-list-item-details.types.d.ts +2 -0
- package/dist/types/pages/event-market/event-market.types.d.mts +2 -0
- package/dist/types/pages/event-market/event-market.types.d.ts +2 -0
- package/dist/types/pages/event-market/sports-event-market-page.d.mts +1 -1
- package/dist/types/pages/event-market/sports-event-market-page.d.ts +1 -1
- package/dist/types/pages/user-profile/user-profile.types.d.mts +2 -0
- package/dist/types/pages/user-profile/user-profile.types.d.ts +2 -0
- package/dist/types/primitives/venue-logo/svg/logo-pred.d.mts +10 -0
- package/dist/types/primitives/venue-logo/svg/logo-pred.d.ts +10 -0
- package/dist/types/trading/place-order/index.place-order.execution-view.d.mts +2 -1
- package/dist/types/trading/place-order/index.place-order.execution-view.d.ts +2 -1
- package/dist/types/trading/place-order/index.place-order.types.d.mts +8 -0
- package/dist/types/trading/place-order/index.place-order.types.d.ts +8 -0
- package/dist/types/trading/place-order/index.place-order.utils.d.mts +1 -1
- package/dist/types/trading/place-order/index.place-order.utils.d.ts +1 -1
- package/package.json +3 -3
|
@@ -9,13 +9,13 @@ import {
|
|
|
9
9
|
getTradingVenueLabel,
|
|
10
10
|
prepareSettlementDifferences,
|
|
11
11
|
resolveOrderEligibilityMessage
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-6EHT5OFU.mjs";
|
|
13
13
|
import {
|
|
14
14
|
ConnectKalshiModal,
|
|
15
15
|
GeoBlockBanner,
|
|
16
16
|
SharedKycModal,
|
|
17
17
|
subscribeAggDepositNotification
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-TXQJUVRW.mjs";
|
|
19
19
|
import {
|
|
20
20
|
AGG_TERMS_OF_SERVICE_URL,
|
|
21
21
|
Button,
|
|
@@ -48,7 +48,7 @@ import {
|
|
|
48
48
|
resolveResolvedOutcomeLabel,
|
|
49
49
|
skeletonViews,
|
|
50
50
|
useOptionalToast
|
|
51
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-W7HQVQ22.mjs";
|
|
52
52
|
|
|
53
53
|
// src/trading/types.ts
|
|
54
54
|
import { Venue, enumGuard, isFiniteNonNeg, safeParse } from "@agg-build/sdk";
|
|
@@ -1139,6 +1139,9 @@ var isPredictionMarketPrice = (value) => {
|
|
|
1139
1139
|
var getPlaceOrderAverageExecutionPrice = (quoteData) => {
|
|
1140
1140
|
var _a;
|
|
1141
1141
|
if (!quoteData || quoteData.totalFilled <= 0) return null;
|
|
1142
|
+
const chFill = quoteData.fills.length === 1 ? quoteData.fills[0] : void 0;
|
|
1143
|
+
if ((chFill == null ? void 0 : chFill.venue) === "prophetx" && chFill.limitPriceMicroUsdc != null)
|
|
1144
|
+
return Number(chFill.limitPriceMicroUsdc) / 1e6;
|
|
1142
1145
|
if (isFiniteNonNegativePrice((_a = quoteData.slippage) == null ? void 0 : _a.vwap)) return quoteData.slippage.vwap;
|
|
1143
1146
|
const averageExecutionPrice = quoteData.rawExecCost / quoteData.totalFilled;
|
|
1144
1147
|
return isFiniteNonNegativePrice(averageExecutionPrice) ? averageExecutionPrice : null;
|
|
@@ -1362,14 +1365,16 @@ var mapQuoteDataToRoutingRows = (quoteData, tradeSide = "buy") => {
|
|
|
1362
1365
|
if (!(quoteData == null ? void 0 : quoteData.fills.length)) return [];
|
|
1363
1366
|
return quoteData.fills.map((fill) => {
|
|
1364
1367
|
const allocationValueLabel = getTradingValueLabel(__spreadValues({
|
|
1365
|
-
amount: fill.venueQty * fill.avgPrice
|
|
1368
|
+
amount: tradeSide === "sell" && fill.outAmount != null ? Number(fill.outAmount) / 1e6 : tradeSide === "buy" && fill.inAmount != null ? Number(fill.inAmount) / 1e6 : fill.venueQty * fill.avgPrice
|
|
1366
1369
|
}, tradeSide === "sell" ? { minimumFractionDigits: 2, maximumFractionDigits: 2 } : {}));
|
|
1367
1370
|
const allocationSharesLabel = `${formatFlooredShareAmount(fill.venueQty, 2)} shares`;
|
|
1368
1371
|
const requiresSharedKyc = venueRequiresSharedKyc({ venue: fill.venue });
|
|
1369
1372
|
return __spreadProps(__spreadValues({
|
|
1370
1373
|
venue: fill.venue,
|
|
1371
1374
|
label: tradeSide === "sell" ? allocationSharesLabel : allocationValueLabel,
|
|
1372
|
-
priceLabel: getTradingRoutePriceLabel(
|
|
1375
|
+
priceLabel: getTradingRoutePriceLabel(
|
|
1376
|
+
fill.limitPriceMicroUsdc != null ? Number(fill.limitPriceMicroUsdc) / 1e6 : fill.avgPrice
|
|
1377
|
+
)
|
|
1373
1378
|
}, requiresSharedKyc ? { requiresSharedKyc: true } : {}), {
|
|
1374
1379
|
resultLabel: tradeSide === "sell" ? allocationValueLabel : getTradingValueLabel({
|
|
1375
1380
|
amount: fill.venueQty,
|
|
@@ -1433,9 +1438,10 @@ var resolvePlaceOrderQuoteStatus = ({
|
|
|
1433
1438
|
amount,
|
|
1434
1439
|
labels,
|
|
1435
1440
|
quoteData,
|
|
1436
|
-
selectedMarket
|
|
1441
|
+
selectedMarket,
|
|
1442
|
+
tradeSide = "buy"
|
|
1437
1443
|
}) => {
|
|
1438
|
-
var _a, _b, _c;
|
|
1444
|
+
var _a, _b, _c, _d, _e;
|
|
1439
1445
|
if (!selectedMarket) {
|
|
1440
1446
|
return {
|
|
1441
1447
|
tone: "warning",
|
|
@@ -1455,9 +1461,10 @@ var resolvePlaceOrderQuoteStatus = ({
|
|
|
1455
1461
|
};
|
|
1456
1462
|
}
|
|
1457
1463
|
if (quoteData.status === "no_orderbooks") {
|
|
1464
|
+
const serverError = (_a = quoteData.error) == null ? void 0 : _a.trim();
|
|
1458
1465
|
return {
|
|
1459
1466
|
tone: "error",
|
|
1460
|
-
message: labels.noOrderbooks,
|
|
1467
|
+
message: serverError || labels.noOrderbooks,
|
|
1461
1468
|
placement: "above-action"
|
|
1462
1469
|
};
|
|
1463
1470
|
}
|
|
@@ -1471,26 +1478,27 @@ var resolvePlaceOrderQuoteStatus = ({
|
|
|
1471
1478
|
if (quoteData.status === "insufficient_input_amount") {
|
|
1472
1479
|
return {
|
|
1473
1480
|
tone: "error",
|
|
1474
|
-
message: (
|
|
1481
|
+
message: (_b = quoteData.message) != null ? _b : labels.insufficientInputAmount,
|
|
1475
1482
|
placement: "above-action"
|
|
1476
1483
|
};
|
|
1477
1484
|
}
|
|
1478
1485
|
if (quoteData.status === "invalid_input") {
|
|
1479
1486
|
return {
|
|
1480
1487
|
tone: "error",
|
|
1481
|
-
message: (
|
|
1488
|
+
message: (_c = quoteData.message) != null ? _c : labels.quoteUnavailable,
|
|
1482
1489
|
placement: "above-action"
|
|
1483
1490
|
};
|
|
1484
1491
|
}
|
|
1485
1492
|
if (quoteData.status === "insufficient_position") {
|
|
1486
|
-
const total = (
|
|
1493
|
+
const total = (_d = quoteData.positionAvailability) == null ? void 0 : _d.totalSellableShares;
|
|
1487
1494
|
const message = total != null ? labels.insufficientPosition(total) : labels.insufficientPositionGeneric;
|
|
1488
1495
|
return { tone: "error", message, placement: "above-action" };
|
|
1489
1496
|
}
|
|
1490
1497
|
if (quoteData.status === "insufficient_depth") {
|
|
1498
|
+
const serverError = (_e = quoteData.error) == null ? void 0 : _e.trim();
|
|
1491
1499
|
return {
|
|
1492
1500
|
tone: "error",
|
|
1493
|
-
message: labels.insufficientSellDepth,
|
|
1501
|
+
message: tradeSide === "sell" ? serverError || labels.insufficientSellDepth : serverError || labels.insufficientLiquidity,
|
|
1494
1502
|
placement: "above-action"
|
|
1495
1503
|
};
|
|
1496
1504
|
}
|
|
@@ -1570,6 +1578,7 @@ var buildLiveRouteCards = ({
|
|
|
1570
1578
|
executionPrice: averageExecutionPrice,
|
|
1571
1579
|
requiresSharedKyc: primaryRequiresSharedKyc
|
|
1572
1580
|
} : null;
|
|
1581
|
+
const soloCardId = (prefix, sq) => `${prefix}-${sq.venue}${sq.venueMarketOutcomeId ? `-${sq.venueMarketOutcomeId}` : ""}`;
|
|
1573
1582
|
const soloCards = ((_c = quoteData.venueSoloQuotes) != null ? _c : []).filter(
|
|
1574
1583
|
(sq) => sq.status === "ok" && sq.unavailableReason !== "venue_unavailable" && sq.avgPrice !== null && sq.filledQty > 0 && // No `sq.quoteId` requirement: a solo is preview-only whenever its own
|
|
1575
1584
|
// funding lane is short (API nulls the quoteId), which is NOT always the
|
|
@@ -1585,7 +1594,8 @@ var buildLiveRouteCards = ({
|
|
|
1585
1594
|
const venue = parsedVenue.success ? parsedVenue.data : void 0;
|
|
1586
1595
|
if (geoBlockedVenues.has(sq.venue)) {
|
|
1587
1596
|
return {
|
|
1588
|
-
id:
|
|
1597
|
+
id: soloCardId("live-unavailable", sq),
|
|
1598
|
+
venueMarketOutcomeId: sq.venueMarketOutcomeId,
|
|
1589
1599
|
hint: labels.venueUnavailableInRegion,
|
|
1590
1600
|
kind: "venue",
|
|
1591
1601
|
label: getTradingVenueLabel(venue),
|
|
@@ -1622,7 +1632,8 @@ var buildLiveRouteCards = ({
|
|
|
1622
1632
|
feeBreakdown: (_b2 = sq.feeBreakdown) != null ? _b2 : quoteData.feeBreakdown
|
|
1623
1633
|
}), sq.quoteId ? { status: "ok", error: void 0 } : null);
|
|
1624
1634
|
return {
|
|
1625
|
-
id:
|
|
1635
|
+
id: soloCardId("live-solo", sq),
|
|
1636
|
+
venueMarketOutcomeId: sq.venueMarketOutcomeId,
|
|
1626
1637
|
hint: labels.averagePrice(avgPrice),
|
|
1627
1638
|
kind: "venue",
|
|
1628
1639
|
label: getTradingVenueLabel(venue),
|
|
@@ -1644,7 +1655,8 @@ var buildLiveRouteCards = ({
|
|
|
1644
1655
|
const temporarilyUnavailable = sq.unavailableReason === "venue_unavailable";
|
|
1645
1656
|
const hasPreview = temporarilyUnavailable && sq.filledQty > 0;
|
|
1646
1657
|
return __spreadProps(__spreadValues({
|
|
1647
|
-
id:
|
|
1658
|
+
id: soloCardId("live-unavailable", sq),
|
|
1659
|
+
venueMarketOutcomeId: sq.venueMarketOutcomeId,
|
|
1648
1660
|
hint: temporarilyUnavailable ? labels.venueTemporarilyUnavailable : labels.venueUnavailableInRegion,
|
|
1649
1661
|
kind: "venue",
|
|
1650
1662
|
label: getTradingVenueLabel(venue),
|
|
@@ -2794,8 +2806,8 @@ var resolveOrderPresentation = ({
|
|
|
2794
2806
|
const quotedShares = parseRawUsd(order.quotedSharesRaw);
|
|
2795
2807
|
const actualShares = parseRawUsd(order.actualSharesRaw);
|
|
2796
2808
|
const filledAmount = parseRawUsd(order.filledAmountRaw);
|
|
2797
|
-
const fallbackAmount = fallbackFill ? tradeSide === "buy" ? fallbackFill.venueQty * fallbackFill.avgPrice : fallbackFill.venueQty : 0;
|
|
2798
|
-
const amount = tradeSide === "buy" ? filledAmount != null ? filledAmount : quotedShares != null && quotedPrice > 0 ? quotedShares * quotedPrice : fallbackAmount : (_b = actualShares != null ? actualShares : quotedShares) != null ? _b : fallbackAmount;
|
|
2809
|
+
const fallbackAmount = fallbackFill ? tradeSide === "buy" ? fallbackFill.inAmount != null ? Number(fallbackFill.inAmount) / 1e6 : fallbackFill.venueQty * fallbackFill.avgPrice : fallbackFill.venueQty : 0;
|
|
2810
|
+
const amount = tradeSide === "buy" ? filledAmount != null ? filledAmount : (fallbackFill == null ? void 0 : fallbackFill.inAmount) != null ? fallbackAmount : quotedShares != null && quotedPrice > 0 ? quotedShares * quotedPrice : fallbackAmount : (_b = actualShares != null ? actualShares : quotedShares) != null ? _b : fallbackAmount;
|
|
2799
2811
|
return {
|
|
2800
2812
|
venue,
|
|
2801
2813
|
venueLabel,
|
|
@@ -2980,7 +2992,7 @@ var deriveExecutionOrderGroups = ({
|
|
|
2980
2992
|
(event) => event.event === "partial_fill"
|
|
2981
2993
|
);
|
|
2982
2994
|
const hasVenueExecutionProgress = venueRawSteps.some(isRawStepStarted);
|
|
2983
|
-
const quotedAmount = fill.venueQty * fill.avgPrice;
|
|
2995
|
+
const quotedAmount = tradeSide === "buy" && fill.inAmount != null ? Number(fill.inAmount) / 1e6 : fill.venueQty * fill.avgPrice;
|
|
2984
2996
|
const actualFill = resolveActualFillPresentation({
|
|
2985
2997
|
fallbackAmount: quotedAmount,
|
|
2986
2998
|
fallbackPrice: fill.avgPrice,
|
|
@@ -3277,7 +3289,8 @@ var PlaceOrderExecutionView = ({
|
|
|
3277
3289
|
eventTitle,
|
|
3278
3290
|
groups,
|
|
3279
3291
|
labels,
|
|
3280
|
-
progress
|
|
3292
|
+
progress,
|
|
3293
|
+
settlementHint
|
|
3281
3294
|
}) => {
|
|
3282
3295
|
return /* @__PURE__ */ jsx4(
|
|
3283
3296
|
Card,
|
|
@@ -3321,7 +3334,8 @@ var PlaceOrderExecutionView = ({
|
|
|
3321
3334
|
groups,
|
|
3322
3335
|
labels
|
|
3323
3336
|
}
|
|
3324
|
-
)
|
|
3337
|
+
),
|
|
3338
|
+
settlementHint ? /* @__PURE__ */ jsx4("p", { className: "text-agg-sm leading-agg-5 text-agg-muted-foreground", children: settlementHint }) : null
|
|
3325
3339
|
] })
|
|
3326
3340
|
] })
|
|
3327
3341
|
}
|
|
@@ -5262,13 +5276,13 @@ var PlaceOrder = ({
|
|
|
5262
5276
|
setSubmissionProgressState((prev) => {
|
|
5263
5277
|
if (!prev || prev.phase === "success" || prev.phase === "failed") return prev;
|
|
5264
5278
|
return __spreadProps(__spreadValues({}, prev), {
|
|
5265
|
-
phase: "
|
|
5266
|
-
errorMessage:
|
|
5279
|
+
phase: "executing",
|
|
5280
|
+
errorMessage: tradingLabels.orderStillSettling
|
|
5267
5281
|
});
|
|
5268
5282
|
});
|
|
5269
5283
|
}, timeoutMs);
|
|
5270
5284
|
return () => clearTimeout(id);
|
|
5271
|
-
}, [submissionProgressState == null ? void 0 : submissionProgressState.phase, estDurationMs]);
|
|
5285
|
+
}, [submissionProgressState == null ? void 0 : submissionProgressState.phase, estDurationMs, tradingLabels.orderStillSettling]);
|
|
5272
5286
|
const emitTerminalOrderNotifications = useCallback3(() => {
|
|
5273
5287
|
const toast = toastCtx == null ? void 0 : toastCtx.toast;
|
|
5274
5288
|
if (!toast) return;
|
|
@@ -5379,11 +5393,13 @@ var PlaceOrder = ({
|
|
|
5379
5393
|
amount: internalAmount,
|
|
5380
5394
|
labels: tradingLabels,
|
|
5381
5395
|
quoteData: activeQuoteData,
|
|
5382
|
-
selectedMarket: scopedSelectedMarket
|
|
5396
|
+
selectedMarket: scopedSelectedMarket,
|
|
5397
|
+
tradeSide: isSell ? "sell" : "buy"
|
|
5383
5398
|
});
|
|
5384
5399
|
}, [
|
|
5385
5400
|
activeQuoteData,
|
|
5386
5401
|
internalAmount,
|
|
5402
|
+
isSell,
|
|
5387
5403
|
orderEligibility.canPlaceOrder,
|
|
5388
5404
|
scopedSelectedMarket,
|
|
5389
5405
|
tradingLabels
|
|
@@ -5742,7 +5758,7 @@ var PlaceOrder = ({
|
|
|
5742
5758
|
return fills.length > 0 && fills.every((f) => geoBlockedVenuesFromWarnings.has(f.venue));
|
|
5743
5759
|
}, [selectedRouteCard, geoBlockedVenuesFromWarnings]);
|
|
5744
5760
|
const shouldShowGeoBlockBanner = isTradingBlocked || selectedRouteGeoBlocked || isPrimaryVenueGeoBlocked || isLimitOrder && limitRouteCards.length > 0 && limitRouteCards.every((card) => card.isUnavailable);
|
|
5745
|
-
const shouldShowLowLiquidityWarning = !isQuoteInputEditing && !isQuoteLoading && (activeQuoteData == null ? void 0 : activeQuoteData.venueMarketOutcomeId) === scopedSelectedOutcomeId && isPlaceOrderAveragePriceWorse({
|
|
5761
|
+
const shouldShowLowLiquidityWarning = !isQuoteInputEditing && !isQuoteLoading && (activeQuoteData == null ? void 0 : activeQuoteData.venueMarketOutcomeId) === scopedSelectedOutcomeId && !(activeQuoteData == null ? void 0 : activeQuoteData.fills.some((fill) => fill.venue === "prophetx")) && isPlaceOrderAveragePriceWorse({
|
|
5746
5762
|
averageExecutionPrice: selectedRouteCard == null ? void 0 : selectedRouteCard.executionPrice,
|
|
5747
5763
|
displayedMarketPrice: selectedOutcomeDisplayPrice,
|
|
5748
5764
|
tradeSide: internalTab
|
|
@@ -6206,7 +6222,8 @@ var PlaceOrder = ({
|
|
|
6206
6222
|
eventTitle: headerTitle,
|
|
6207
6223
|
groups: executionOrderGroups,
|
|
6208
6224
|
labels: tradingLabels,
|
|
6209
|
-
progress: executionProgressPercent
|
|
6225
|
+
progress: executionProgressPercent,
|
|
6226
|
+
settlementHint: submissionProgressState.phase === "executing" ? submissionProgressState.errorMessage : void 0
|
|
6210
6227
|
}
|
|
6211
6228
|
);
|
|
6212
6229
|
}
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
resolveUnifiedOrderBookEntries,
|
|
25
25
|
sortOutcomeSelectorOutcomes,
|
|
26
26
|
useEventTradingContext
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-6EHT5OFU.mjs";
|
|
28
28
|
import {
|
|
29
29
|
AutocompleteSelect,
|
|
30
30
|
Badge,
|
|
@@ -78,7 +78,7 @@ import {
|
|
|
78
78
|
sortOutcomes,
|
|
79
79
|
splitEventsByLifecycle,
|
|
80
80
|
validateSubcategoryPath
|
|
81
|
-
} from "./chunk-
|
|
81
|
+
} from "./chunk-W7HQVQ22.mjs";
|
|
82
82
|
|
|
83
83
|
// src/events/item/index.tsx
|
|
84
84
|
import {
|
|
@@ -2893,6 +2893,7 @@ var EventListItemDetailsContent = ({
|
|
|
2893
2893
|
event,
|
|
2894
2894
|
defaultMarketId,
|
|
2895
2895
|
defaultOutcomeId,
|
|
2896
|
+
defaultTradeSide,
|
|
2896
2897
|
classNames,
|
|
2897
2898
|
venueInfo,
|
|
2898
2899
|
detailsStats,
|
|
@@ -2979,7 +2980,7 @@ var EventListItemDetailsContent = ({
|
|
|
2979
2980
|
if (!tradingContext) return;
|
|
2980
2981
|
if (!defaultMarketId) return;
|
|
2981
2982
|
if (tradingContext.selectedEventId !== event.id) return;
|
|
2982
|
-
const applyKey = `${event.id}::${defaultMarketId}::${defaultOutcomeId != null ? defaultOutcomeId : ""}`;
|
|
2983
|
+
const applyKey = `${event.id}::${defaultMarketId}::${defaultOutcomeId != null ? defaultOutcomeId : ""}::${defaultTradeSide != null ? defaultTradeSide : ""}`;
|
|
2983
2984
|
if (lastAppliedDefaultRef.current === applyKey) return;
|
|
2984
2985
|
const nextMarket = event.venueMarkets.find((market) => market.id === defaultMarketId);
|
|
2985
2986
|
if (!nextMarket) return;
|
|
@@ -2989,14 +2990,17 @@ var EventListItemDetailsContent = ({
|
|
|
2989
2990
|
);
|
|
2990
2991
|
if (!nextOutcome) return;
|
|
2991
2992
|
tradingContext.selectMarketAndOutcome(defaultMarketId, defaultOutcomeId);
|
|
2992
|
-
|
|
2993
|
-
|
|
2993
|
+
} else {
|
|
2994
|
+
tradingContext.selectMarket(defaultMarketId, nextMarket);
|
|
2995
|
+
}
|
|
2996
|
+
if (defaultTradeSide === "sell" || defaultTradeSide === "buy") {
|
|
2997
|
+
tradingContext.setTradeSide(defaultTradeSide);
|
|
2994
2998
|
}
|
|
2995
|
-
tradingContext.selectMarket(defaultMarketId, nextMarket);
|
|
2996
2999
|
lastAppliedDefaultRef.current = applyKey;
|
|
2997
3000
|
}, [
|
|
2998
3001
|
defaultMarketId,
|
|
2999
3002
|
defaultOutcomeId,
|
|
3003
|
+
defaultTradeSide,
|
|
3000
3004
|
event.id,
|
|
3001
3005
|
event.venueMarkets,
|
|
3002
3006
|
tradingContext,
|
|
@@ -3345,6 +3349,7 @@ var EventListItemDetails = (props) => {
|
|
|
3345
3349
|
classNames,
|
|
3346
3350
|
defaultMarketId,
|
|
3347
3351
|
defaultOutcomeId,
|
|
3352
|
+
defaultTradeSide,
|
|
3348
3353
|
venueInfo,
|
|
3349
3354
|
detailsStats,
|
|
3350
3355
|
ariaLabel: ariaLabelOverride,
|
|
@@ -3356,6 +3361,7 @@ var EventListItemDetails = (props) => {
|
|
|
3356
3361
|
classNames,
|
|
3357
3362
|
defaultMarketId,
|
|
3358
3363
|
defaultOutcomeId,
|
|
3364
|
+
defaultTradeSide,
|
|
3359
3365
|
venueInfo,
|
|
3360
3366
|
detailsStats,
|
|
3361
3367
|
ariaLabel: ariaLabelOverride,
|
|
@@ -4470,7 +4476,7 @@ var MarketDetailsContent = ({
|
|
|
4470
4476
|
suppressOutcomeFallbackSelection,
|
|
4471
4477
|
midpointsResult
|
|
4472
4478
|
}) => {
|
|
4473
|
-
var _a, _b, _c, _d, _e, _f, _g
|
|
4479
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
4474
4480
|
const config = useSdkUiConfig5();
|
|
4475
4481
|
const {
|
|
4476
4482
|
features: { enableAnimations },
|
|
@@ -4727,11 +4733,10 @@ var MarketDetailsContent = ({
|
|
|
4727
4733
|
});
|
|
4728
4734
|
}, [model, selectedOutcomeLabel, selectedOutcomeId]);
|
|
4729
4735
|
const orderBookEnabled = isOpened && effectiveSelectedTab === "order-book" && !marketTradingState.isTradingDisabled;
|
|
4730
|
-
const
|
|
4731
|
-
const primaryOutcomeId = (_i = (_h = selectedOutcomesByVenue[0]) == null ? void 0 : _h.outcome.id) != null ? _i : null;
|
|
4736
|
+
const primaryOutcomeId = (_g = (_f = selectedOutcomesByVenue[0]) == null ? void 0 : _f.outcome.id) != null ? _g : null;
|
|
4732
4737
|
const marketOrderbookResult = useMarketOrderbook({
|
|
4733
|
-
|
|
4734
|
-
enabled: orderBookEnabled && !!
|
|
4738
|
+
venueMarketOutcomeId: primaryOutcomeId,
|
|
4739
|
+
enabled: orderBookEnabled && !!primaryOutcomeId,
|
|
4735
4740
|
venueOutcomes: selectedOutcomesByVenue.map((item) => ({
|
|
4736
4741
|
venue: item.venue,
|
|
4737
4742
|
venueMarketOutcomeId: item.outcomeId
|
|
@@ -5664,6 +5669,12 @@ var getDefaultEventListTabs = (labels) => {
|
|
|
5664
5669
|
venueLogo: Venue2.predict,
|
|
5665
5670
|
venues: [Venue2.predict]
|
|
5666
5671
|
},
|
|
5672
|
+
{
|
|
5673
|
+
value: Venue2.pred,
|
|
5674
|
+
label: labels.venues.pred,
|
|
5675
|
+
venueLogo: Venue2.pred,
|
|
5676
|
+
venues: [Venue2.pred]
|
|
5677
|
+
},
|
|
5667
5678
|
{
|
|
5668
5679
|
value: Venue2.hyperliquid,
|
|
5669
5680
|
label: labels.venues.hyperliquid,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
ConnectKalshiModal,
|
|
4
4
|
dispatchAggDepositNotification
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-TXQJUVRW.mjs";
|
|
6
6
|
import {
|
|
7
7
|
BoltIcon,
|
|
8
8
|
Button,
|
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
shortenAddress,
|
|
37
37
|
useOptionalToast,
|
|
38
38
|
venueLogoLabels
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-W7HQVQ22.mjs";
|
|
40
40
|
|
|
41
41
|
// src/deposit/index.tsx
|
|
42
42
|
import { useAggAuthState, useAggUiConfig, useDepositAddresses, useLabels as useLabels11 } from "@agg-build/hooks";
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
isErrorWithStatus,
|
|
13
13
|
useEventListTabs,
|
|
14
14
|
useEventListTabsHeaderOverflow
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-H5LCCV2J.mjs";
|
|
16
16
|
import {
|
|
17
17
|
DEPOSIT_MODAL_OPEN_EVENT,
|
|
18
18
|
PlaceOrder,
|
|
@@ -21,12 +21,12 @@ import {
|
|
|
21
21
|
formatChainIdLabel,
|
|
22
22
|
useClaimWinnings,
|
|
23
23
|
useResolvedMarketClaim
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-4HTE5IEZ.mjs";
|
|
25
25
|
import {
|
|
26
26
|
getDisplayOutcomePrice,
|
|
27
27
|
resolveHeaderOutcomeItems,
|
|
28
28
|
resolveMarketFromVenueMarkets
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-6EHT5OFU.mjs";
|
|
30
30
|
import {
|
|
31
31
|
AggErrorBoundary,
|
|
32
32
|
Button,
|
|
@@ -62,7 +62,7 @@ import {
|
|
|
62
62
|
skeletonViews,
|
|
63
63
|
sortCategoriesForNavigation,
|
|
64
64
|
useOptionalToast
|
|
65
|
-
} from "./chunk-
|
|
65
|
+
} from "./chunk-W7HQVQ22.mjs";
|
|
66
66
|
|
|
67
67
|
// src/pages/home/index.tsx
|
|
68
68
|
import {
|
|
@@ -2309,6 +2309,7 @@ var SportsEventMarketPage = ({
|
|
|
2309
2309
|
event,
|
|
2310
2310
|
defaultMarketId,
|
|
2311
2311
|
defaultOutcomeId,
|
|
2312
|
+
defaultTradeSide,
|
|
2312
2313
|
classNames,
|
|
2313
2314
|
ariaLabel,
|
|
2314
2315
|
showPlaceOrder,
|
|
@@ -2407,6 +2408,7 @@ var SportsEventMarketPage = ({
|
|
|
2407
2408
|
event: composedEvent,
|
|
2408
2409
|
defaultMarketId,
|
|
2409
2410
|
defaultOutcomeId,
|
|
2411
|
+
defaultTradeSide,
|
|
2410
2412
|
eventTradingState,
|
|
2411
2413
|
midpointsResult,
|
|
2412
2414
|
sportsLiveState: sportsLiveStateByEventId.get(event.id),
|
|
@@ -2548,6 +2550,7 @@ var EventMarketPageContent = ({
|
|
|
2548
2550
|
event,
|
|
2549
2551
|
defaultMarketId,
|
|
2550
2552
|
defaultOutcomeId,
|
|
2553
|
+
defaultTradeSide,
|
|
2551
2554
|
classNames,
|
|
2552
2555
|
ariaLabel,
|
|
2553
2556
|
showPlaceOrder,
|
|
@@ -2707,6 +2710,7 @@ var EventMarketPageContent = ({
|
|
|
2707
2710
|
event,
|
|
2708
2711
|
defaultMarketId,
|
|
2709
2712
|
defaultOutcomeId,
|
|
2713
|
+
defaultTradeSide,
|
|
2710
2714
|
eventTradingState,
|
|
2711
2715
|
midpointsResult,
|
|
2712
2716
|
recurringMarkets: recurringMarketsPresentation,
|
|
@@ -4003,6 +4007,7 @@ var CLAIM_VENUE_LABELS = {
|
|
|
4003
4007
|
[Venue.limitless]: "Limitless",
|
|
4004
4008
|
[Venue.opinion]: "Opinion",
|
|
4005
4009
|
[Venue.predict]: "Predict",
|
|
4010
|
+
[Venue.pred]: "PRED",
|
|
4006
4011
|
[Venue.probable]: "Probable",
|
|
4007
4012
|
[Venue.myriad]: "Myriad",
|
|
4008
4013
|
[Venue.hyperliquid]: "Hyperliquid",
|
|
@@ -4158,6 +4163,7 @@ var VENUE_LABELS = {
|
|
|
4158
4163
|
[Venue2.opinion]: "Opinion",
|
|
4159
4164
|
[Venue2.polymarket]: "Polymarket",
|
|
4160
4165
|
[Venue2.predict]: "Predict",
|
|
4166
|
+
[Venue2.pred]: "PRED",
|
|
4161
4167
|
[Venue2.probable]: "Probable",
|
|
4162
4168
|
[Venue2.myriad]: "Myriad",
|
|
4163
4169
|
[Venue2.hyperliquid]: "Hyperliquid",
|
|
@@ -7411,7 +7417,8 @@ var POSITION_ROW_VENUE_ORDER = [
|
|
|
7411
7417
|
Venue3.polymarket,
|
|
7412
7418
|
Venue3.kalshi,
|
|
7413
7419
|
Venue3.opinion,
|
|
7414
|
-
Venue3.limitless
|
|
7420
|
+
Venue3.limitless,
|
|
7421
|
+
Venue3.pred
|
|
7415
7422
|
];
|
|
7416
7423
|
function venueBreakdownSortKey(venue) {
|
|
7417
7424
|
const idx = POSITION_ROW_VENUE_ORDER.indexOf(venue);
|
|
@@ -8032,7 +8039,8 @@ var UserProfilePage = ({
|
|
|
8032
8039
|
const eventId = (_d = group.eventId) != null ? _d : venueEventId;
|
|
8033
8040
|
const marketId = group.targetMarketId;
|
|
8034
8041
|
return group.venueMarket.venueMarketOutcomes.map((outcome) => {
|
|
8035
|
-
var _a3, _b3, _c3, _d2;
|
|
8042
|
+
var _a3, _b3, _c3, _d2, _e, _f;
|
|
8043
|
+
const outcomeId = (_b3 = (_a3 = outcome.venueBreakdown.find((row) => row.venueMarketOutcomeId)) == null ? void 0 : _a3.venueMarketOutcomeId) != null ? _b3 : void 0;
|
|
8036
8044
|
const isResolved = group.venueMarket.status === "resolved";
|
|
8037
8045
|
const isUnpriced = outcome.priceSource === "entry";
|
|
8038
8046
|
const averagePriceCents = Math.round(outcome.avgEntryPrice * 100);
|
|
@@ -8050,12 +8058,13 @@ var UserProfilePage = ({
|
|
|
8050
8058
|
const pnlPercent = displayPnlPercent == null ? null : displayPnlPercent.toFixed(2);
|
|
8051
8059
|
const winningOutcomeIds = outcome.winner === true ? outcome.venueBreakdown.map((breakdown) => breakdown.venueMarketOutcomeId) : [];
|
|
8052
8060
|
return {
|
|
8053
|
-
id: `${group.targetMarketId}-${outcome.label}-${(
|
|
8061
|
+
id: `${group.targetMarketId}-${outcome.label}-${(_c3 = outcome.title) != null ? _c3 : ""}`,
|
|
8054
8062
|
eventId,
|
|
8055
8063
|
marketId,
|
|
8056
|
-
|
|
8064
|
+
outcomeId,
|
|
8065
|
+
thumbnailSrc: (_d2 = group.venueMarket.image) != null ? _d2 : fallbackThumbnailSrc,
|
|
8057
8066
|
title: group.venueMarket.question,
|
|
8058
|
-
outcomeLabel: ((
|
|
8067
|
+
outcomeLabel: ((_e = outcome.title) == null ? void 0 : _e.trim()) || outcome.label,
|
|
8059
8068
|
resolutionLabel: winningOutcomeLabel,
|
|
8060
8069
|
venueShareBreakdown: buildVenueShareBreakdown(outcome),
|
|
8061
8070
|
totalShares: outcome.totalSize,
|
|
@@ -8071,7 +8080,7 @@ var UserProfilePage = ({
|
|
|
8071
8080
|
isPnlPositive: displayPnlValue != null && displayPnlValue >= 0,
|
|
8072
8081
|
status: group.status,
|
|
8073
8082
|
marketStatus: group.venueMarket.status,
|
|
8074
|
-
winner: (
|
|
8083
|
+
winner: (_f = outcome.winner) != null ? _f : null,
|
|
8075
8084
|
resolutionDate: group.resolutionDate,
|
|
8076
8085
|
closedTotalTradedLabel: formatUsd2(totalTradedValue),
|
|
8077
8086
|
totalTradedValue,
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
__spreadProps,
|
|
21
21
|
__spreadValues,
|
|
22
22
|
cn
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-W7HQVQ22.mjs";
|
|
24
24
|
|
|
25
25
|
// src/geo-block-banner/index.tsx
|
|
26
26
|
import { useLabels } from "@agg-build/hooks";
|
|
@@ -171,7 +171,8 @@ var ONBOARDING_STEPS = {
|
|
|
171
171
|
var ONCHAIN_VENUES = [
|
|
172
172
|
Venue.polymarket,
|
|
173
173
|
Venue.opinion,
|
|
174
|
-
Venue.predict
|
|
174
|
+
Venue.predict,
|
|
175
|
+
Venue.pred
|
|
175
176
|
].filter(isVenueActive);
|
|
176
177
|
|
|
177
178
|
// src/onboarding/steps/how-it-works.tsx
|