@agg-build/ui 4.11.0 → 4.11.3
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-CHM6SCOY.mjs → chunk-5D36HPOG.mjs} +1 -1
- package/dist/{chunk-NCWBKC5C.mjs → chunk-VHKGW4DB.mjs} +136 -46
- package/dist/index.js +136 -46
- package/dist/index.mjs +2 -2
- package/dist/pages.js +136 -46
- package/dist/pages.mjs +2 -2
- package/dist/trading.js +136 -46
- package/dist/trading.mjs +1 -1
- package/dist/types/trading/place-order/index.place-order.utils.d.mts +28 -0
- package/dist/types/trading/place-order/index.place-order.utils.d.ts +28 -0
- package/package.json +2 -2
|
@@ -1311,13 +1311,13 @@ var extractGeoBlockedVenues = (warnings) => {
|
|
|
1311
1311
|
);
|
|
1312
1312
|
};
|
|
1313
1313
|
var getSmartRouteTotalFees = (feeBreakdown) => {
|
|
1314
|
-
var _a;
|
|
1314
|
+
var _a, _b;
|
|
1315
1315
|
if (!feeBreakdown) return null;
|
|
1316
1316
|
const feeParts = [
|
|
1317
|
-
feeBreakdown.venueFees,
|
|
1318
|
-
(_a = feeBreakdown.builderFee) != null ? _a : 0,
|
|
1317
|
+
feeBreakdown.venueFees + ((_a = feeBreakdown.builderFee) != null ? _a : 0),
|
|
1319
1318
|
feeBreakdown.bridgeFees,
|
|
1320
|
-
feeBreakdown.executionGas
|
|
1319
|
+
feeBreakdown.executionGas,
|
|
1320
|
+
(_b = feeBreakdown.appFee) != null ? _b : 0
|
|
1321
1321
|
];
|
|
1322
1322
|
if (!feeParts.every(Number.isFinite)) return null;
|
|
1323
1323
|
return feeParts.reduce((total, fee) => total + Math.round(fee * 100) / 100, 0);
|
|
@@ -1412,6 +1412,72 @@ var parseDecimalString = (value) => {
|
|
|
1412
1412
|
if (!Number.isFinite(parsed) || parsed <= 0) return null;
|
|
1413
1413
|
return parsed;
|
|
1414
1414
|
};
|
|
1415
|
+
var getPlaceOrderBuyPayout = (quoteData) => {
|
|
1416
|
+
var _a;
|
|
1417
|
+
return (_a = quoteData.estimatedPayout) != null ? _a : quoteData.totalFilled;
|
|
1418
|
+
};
|
|
1419
|
+
var getPlaceOrderSellProceeds = (quoteData) => Math.max(
|
|
1420
|
+
0,
|
|
1421
|
+
quoteData.rawExecCost - quoteData.fills.reduce((sum, fill) => {
|
|
1422
|
+
var _a, _b;
|
|
1423
|
+
return sum + ((_a = fill.venueFee) != null ? _a : 0) + ((_b = fill.builderFee) != null ? _b : 0);
|
|
1424
|
+
}, 0)
|
|
1425
|
+
);
|
|
1426
|
+
var getPlaceOrderQuoteValue = (quoteData, tradeSide) => tradeSide === "sell" ? getPlaceOrderSellProceeds(quoteData) : getPlaceOrderBuyPayout(quoteData);
|
|
1427
|
+
var resolvePlaceOrderNetResult = ({
|
|
1428
|
+
quoteData,
|
|
1429
|
+
tradeSide,
|
|
1430
|
+
shares,
|
|
1431
|
+
usd,
|
|
1432
|
+
terminalOrderEvents,
|
|
1433
|
+
submittedOrders
|
|
1434
|
+
}) => {
|
|
1435
|
+
if (!quoteData) return tradeSide === "sell" ? usd : shares;
|
|
1436
|
+
const actualEvents = (terminalOrderEvents != null ? terminalOrderEvents : []).filter(
|
|
1437
|
+
(event) => (event.event === "filled" || event.event === "partial_fill") && (tradeSide === "buy" ? event.filledAmountRaw != null : event.actualSharesRaw != null)
|
|
1438
|
+
);
|
|
1439
|
+
if (actualEvents.length) {
|
|
1440
|
+
return actualEvents.reduce((sum, event) => {
|
|
1441
|
+
var _a;
|
|
1442
|
+
const outcomeId = (_a = submittedOrders == null ? void 0 : submittedOrders.find(
|
|
1443
|
+
(order) => order.orderId === event.orderId
|
|
1444
|
+
)) == null ? void 0 : _a.outcomeId;
|
|
1445
|
+
const venueFills = quoteData.fills.filter((fill) => fill.venue === event.venue);
|
|
1446
|
+
const exactFill = venueFills.find((fill) => fill.venueMarketOutcomeId === outcomeId);
|
|
1447
|
+
const fills = exactFill ? [exactFill] : venueFills;
|
|
1448
|
+
const legQuote = fills.length ? __spreadProps(__spreadValues({}, quoteData), {
|
|
1449
|
+
fills,
|
|
1450
|
+
totalFilled: fills.reduce((total, fill) => total + fill.venueQty, 0),
|
|
1451
|
+
rawExecCost: fills.reduce((total, fill) => total + fill.avgPrice * fill.venueQty, 0),
|
|
1452
|
+
estimatedPayout: fills.reduce(
|
|
1453
|
+
(total, fill) => {
|
|
1454
|
+
var _a2;
|
|
1455
|
+
return total + fill.venueQty - ((_a2 = fill.settlementFee) != null ? _a2 : 0);
|
|
1456
|
+
},
|
|
1457
|
+
0
|
|
1458
|
+
)
|
|
1459
|
+
}) : quoteData;
|
|
1460
|
+
const actual = resolveActualExecutionEconomics({
|
|
1461
|
+
quoteData: legQuote,
|
|
1462
|
+
tradeSide,
|
|
1463
|
+
terminalOrderEvents: [event],
|
|
1464
|
+
submittedOrders
|
|
1465
|
+
});
|
|
1466
|
+
return sum + resolvePlaceOrderNetResult({
|
|
1467
|
+
quoteData: legQuote,
|
|
1468
|
+
tradeSide,
|
|
1469
|
+
shares: actual.actualTotalFilled,
|
|
1470
|
+
usd: actual.actualRawExecCost
|
|
1471
|
+
});
|
|
1472
|
+
}, 0);
|
|
1473
|
+
}
|
|
1474
|
+
if (tradeSide === "sell") {
|
|
1475
|
+
const gross = quoteData.rawExecCost;
|
|
1476
|
+
return gross > 0 ? usd * (getPlaceOrderSellProceeds(quoteData) / gross) : usd;
|
|
1477
|
+
}
|
|
1478
|
+
const filled = quoteData.totalFilled;
|
|
1479
|
+
return filled > 0 ? shares * (getPlaceOrderBuyPayout(quoteData) / filled) : shares;
|
|
1480
|
+
};
|
|
1415
1481
|
var resolvePlaceOrderQuoteResult = ({
|
|
1416
1482
|
labels,
|
|
1417
1483
|
quoteData,
|
|
@@ -1420,7 +1486,7 @@ var resolvePlaceOrderQuoteResult = ({
|
|
|
1420
1486
|
if (!quoteData || quoteData.totalFilled <= 0) return null;
|
|
1421
1487
|
const avgPrice = getPlaceOrderAverageExecutionPrice(quoteData);
|
|
1422
1488
|
if (avgPrice == null) return null;
|
|
1423
|
-
const quoteValue =
|
|
1489
|
+
const quoteValue = getPlaceOrderQuoteValue(quoteData, tradeSide);
|
|
1424
1490
|
return {
|
|
1425
1491
|
hint: labels.averagePrice(avgPrice),
|
|
1426
1492
|
value: getTradingValueLabel({
|
|
@@ -1538,7 +1604,7 @@ var buildLiveRouteCards = ({
|
|
|
1538
1604
|
eventVenues = [],
|
|
1539
1605
|
geoBlockedVenues: inheritedGeoBlockedVenues
|
|
1540
1606
|
}) => {
|
|
1541
|
-
var _a, _b, _c, _d;
|
|
1607
|
+
var _a, _b, _c, _d, _e;
|
|
1542
1608
|
const geoBlockedVenues = extractGeoBlockedVenues(quoteData.warnings);
|
|
1543
1609
|
for (const venue of inheritedGeoBlockedVenues != null ? inheritedGeoBlockedVenues : []) {
|
|
1544
1610
|
geoBlockedVenues.add(venue);
|
|
@@ -1553,6 +1619,7 @@ var buildLiveRouteCards = ({
|
|
|
1553
1619
|
);
|
|
1554
1620
|
const averageExecutionPrice = (_b = getPlaceOrderAverageExecutionPrice(quoteData)) != null ? _b : void 0;
|
|
1555
1621
|
const primaryWinnerVenue = quoteData.fills.length === 1 ? primaryVenue : void 0;
|
|
1622
|
+
const primaryWinnerOutcomeId = quoteData.fills.length === 1 ? (_c = quoteData.fills[0]) == null ? void 0 : _c.venueMarketOutcomeId : void 0;
|
|
1556
1623
|
const isPrimaryRouteGeoBlocked = quoteData.fills.length > 0 && quoteData.fills.some((f) => geoBlockedVenues.has(f.venue));
|
|
1557
1624
|
const primaryCard = primaryResult ? isPrimaryRouteGeoBlocked ? isSplit ? null : {
|
|
1558
1625
|
id: "live-route",
|
|
@@ -1562,7 +1629,7 @@ var buildLiveRouteCards = ({
|
|
|
1562
1629
|
parsedPrimaryVenue.success ? parsedPrimaryVenue.data : void 0
|
|
1563
1630
|
),
|
|
1564
1631
|
executionPrice: averageExecutionPrice,
|
|
1565
|
-
numericValue:
|
|
1632
|
+
numericValue: getPlaceOrderQuoteValue(quoteData, tradeSide),
|
|
1566
1633
|
quoteData,
|
|
1567
1634
|
value: primaryResult.value,
|
|
1568
1635
|
venue: parsedPrimaryVenue.success ? parsedPrimaryVenue.data : void 0,
|
|
@@ -1575,7 +1642,7 @@ var buildLiveRouteCards = ({
|
|
|
1575
1642
|
label: isSplit ? labels.orderSplitting : getTradingVenueLabel(
|
|
1576
1643
|
parsedPrimaryVenue.success ? parsedPrimaryVenue.data : void 0
|
|
1577
1644
|
),
|
|
1578
|
-
numericValue:
|
|
1645
|
+
numericValue: getPlaceOrderQuoteValue(quoteData, tradeSide),
|
|
1579
1646
|
quoteData,
|
|
1580
1647
|
rows: mapQuoteDataToRoutingRows(quoteData, tradeSide),
|
|
1581
1648
|
description: labels.splitOrderDescription,
|
|
@@ -1585,7 +1652,7 @@ var buildLiveRouteCards = ({
|
|
|
1585
1652
|
requiresSharedKyc: primaryRequiresSharedKyc
|
|
1586
1653
|
} : null;
|
|
1587
1654
|
const soloCardId = (prefix, sq) => `${prefix}-${sq.venue}${sq.venueMarketOutcomeId ? `-${sq.venueMarketOutcomeId}` : ""}`;
|
|
1588
|
-
const soloCards = ((
|
|
1655
|
+
const soloCards = ((_d = quoteData.venueSoloQuotes) != null ? _d : []).filter(
|
|
1589
1656
|
(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
|
|
1590
1657
|
// funding lane is short (API nulls the quoteId), which is NOT always the
|
|
1591
1658
|
// whole-quote `insufficient_balance` case — an off-chain winner (Kalshi
|
|
@@ -1593,9 +1660,9 @@ var buildLiveRouteCards = ({
|
|
|
1593
1660
|
// stays unfunded. Gating on the quoteId silently hid that venue from the
|
|
1594
1661
|
// comparison list entirely. The panel's Deposit CTA fires off the same
|
|
1595
1662
|
// balance condition, and `handleExecuteQuote` rejects an empty quoteId.
|
|
1596
|
-
sq.venue !== primaryWinnerVenue
|
|
1663
|
+
(primaryWinnerOutcomeId && sq.venueMarketOutcomeId ? sq.venueMarketOutcomeId !== primaryWinnerOutcomeId : sq.venue !== primaryWinnerVenue)
|
|
1597
1664
|
).map((sq) => {
|
|
1598
|
-
var _a2, _b2;
|
|
1665
|
+
var _a2, _b2, _c2, _d2, _e2, _f;
|
|
1599
1666
|
const parsedVenue = parseVenue(sq.venue);
|
|
1600
1667
|
const venue = parsedVenue.success ? parsedVenue.data : void 0;
|
|
1601
1668
|
if (geoBlockedVenues.has(sq.venue)) {
|
|
@@ -1605,10 +1672,10 @@ var buildLiveRouteCards = ({
|
|
|
1605
1672
|
hint: labels.venueUnavailableInRegion,
|
|
1606
1673
|
kind: "venue",
|
|
1607
1674
|
label: getTradingVenueLabel(venue),
|
|
1608
|
-
numericValue: sq.filledQty,
|
|
1675
|
+
numericValue: (_a2 = sq.estimatedPayout) != null ? _a2 : sq.filledQty,
|
|
1609
1676
|
quoteData,
|
|
1610
1677
|
value: getTradingValueLabel({
|
|
1611
|
-
amount: sq.filledQty,
|
|
1678
|
+
amount: (_b2 = sq.estimatedPayout) != null ? _b2 : sq.filledQty,
|
|
1612
1679
|
minimumFractionDigits: 2,
|
|
1613
1680
|
maximumFractionDigits: 2
|
|
1614
1681
|
}),
|
|
@@ -1622,7 +1689,7 @@ var buildLiveRouteCards = ({
|
|
|
1622
1689
|
// Preview-only solos intentionally carry no executable quoteId; the card
|
|
1623
1690
|
// should still render for comparison, while the CTA stays disabled until
|
|
1624
1691
|
// the user is funded and requotes.
|
|
1625
|
-
quoteId: (
|
|
1692
|
+
quoteId: (_c2 = sq.quoteId) != null ? _c2 : "",
|
|
1626
1693
|
fills: sq.fills.map((f) => __spreadValues({}, f)),
|
|
1627
1694
|
totalFilled: sq.filledQty,
|
|
1628
1695
|
rawExecCost: sq.rawExecCost,
|
|
@@ -1635,7 +1702,7 @@ var buildLiveRouteCards = ({
|
|
|
1635
1702
|
// primary route's breakdown in place, so selecting a bridge-free venue
|
|
1636
1703
|
// still showed the primary's bridging charge. Falls back to the
|
|
1637
1704
|
// primary only when the router omitted one (non-"ok" solos).
|
|
1638
|
-
feeBreakdown: (
|
|
1705
|
+
feeBreakdown: (_d2 = sq.feeBreakdown) != null ? _d2 : quoteData.feeBreakdown
|
|
1639
1706
|
}), sq.quoteId ? { status: "ok", error: void 0 } : null);
|
|
1640
1707
|
return {
|
|
1641
1708
|
id: soloCardId("live-solo", sq),
|
|
@@ -1644,10 +1711,10 @@ var buildLiveRouteCards = ({
|
|
|
1644
1711
|
kind: "venue",
|
|
1645
1712
|
label: getTradingVenueLabel(venue),
|
|
1646
1713
|
executionPrice: avgPrice,
|
|
1647
|
-
numericValue: sq.filledQty,
|
|
1714
|
+
numericValue: (_e2 = sq.estimatedPayout) != null ? _e2 : sq.filledQty,
|
|
1648
1715
|
quoteData: soloQuoteData,
|
|
1649
1716
|
value: getTradingValueLabel({
|
|
1650
|
-
amount: sq.filledQty,
|
|
1717
|
+
amount: (_f = sq.estimatedPayout) != null ? _f : sq.filledQty,
|
|
1651
1718
|
minimumFractionDigits: 2,
|
|
1652
1719
|
maximumFractionDigits: 2
|
|
1653
1720
|
}),
|
|
@@ -1655,7 +1722,8 @@ var buildLiveRouteCards = ({
|
|
|
1655
1722
|
requiresSharedKyc: venueRequiresSharedKyc({ venue: sq.venue })
|
|
1656
1723
|
};
|
|
1657
1724
|
});
|
|
1658
|
-
const unavailableCards = ((
|
|
1725
|
+
const unavailableCards = ((_e = quoteData.venueSoloQuotes) != null ? _e : []).filter((sq) => sq.status === "unavailable" || sq.unavailableReason === "venue_unavailable").map((sq) => {
|
|
1726
|
+
var _a2, _b2;
|
|
1659
1727
|
const parsedVenue = parseVenue(sq.venue);
|
|
1660
1728
|
const venue = parsedVenue.success ? parsedVenue.data : void 0;
|
|
1661
1729
|
const temporarilyUnavailable = sq.unavailableReason === "venue_unavailable";
|
|
@@ -1666,10 +1734,10 @@ var buildLiveRouteCards = ({
|
|
|
1666
1734
|
hint: temporarilyUnavailable ? labels.venueTemporarilyUnavailable : labels.venueUnavailableInRegion,
|
|
1667
1735
|
kind: "venue",
|
|
1668
1736
|
label: getTradingVenueLabel(venue),
|
|
1669
|
-
numericValue: hasPreview ? sq.filledQty : 0,
|
|
1737
|
+
numericValue: hasPreview ? (_a2 = sq.estimatedPayout) != null ? _a2 : sq.filledQty : 0,
|
|
1670
1738
|
quoteData: __spreadProps(__spreadValues({}, quoteData), { quoteId: "" }),
|
|
1671
1739
|
value: hasPreview ? getTradingValueLabel({
|
|
1672
|
-
amount: sq.filledQty,
|
|
1740
|
+
amount: (_b2 = sq.estimatedPayout) != null ? _b2 : sq.filledQty,
|
|
1673
1741
|
minimumFractionDigits: 2,
|
|
1674
1742
|
maximumFractionDigits: 2
|
|
1675
1743
|
}) : ""
|
|
@@ -1883,10 +1951,13 @@ var getPlaceOrderPotentialReturn = (quoteData) => {
|
|
|
1883
1951
|
if (!((_a = quoteData == null ? void 0 : quoteData.fills) == null ? void 0 : _a.length) || quoteData.fills.length < 2) return 0;
|
|
1884
1952
|
const bestSoloVenueFill = Math.max(
|
|
1885
1953
|
0,
|
|
1886
|
-
...((_b = quoteData.venueSoloQuotes) != null ? _b : []).filter((quote) => quote.status === "ok" && quote.filledQty > 0).map((quote) =>
|
|
1954
|
+
...((_b = quoteData.venueSoloQuotes) != null ? _b : []).filter((quote) => quote.status === "ok" && quote.filledQty > 0).map((quote) => {
|
|
1955
|
+
var _a2;
|
|
1956
|
+
return (_a2 = quote.estimatedPayout) != null ? _a2 : quote.filledQty;
|
|
1957
|
+
})
|
|
1887
1958
|
);
|
|
1888
1959
|
if (bestSoloVenueFill <= 0) return 0;
|
|
1889
|
-
return Math.max(0, quoteData
|
|
1960
|
+
return Math.max(0, getPlaceOrderBuyPayout(quoteData) - bestSoloVenueFill);
|
|
1890
1961
|
};
|
|
1891
1962
|
var resolvePrimarySubmittedOrderId = ({
|
|
1892
1963
|
allowOrderIdFallback = true,
|
|
@@ -4291,7 +4362,7 @@ var PlaceOrder = ({
|
|
|
4291
4362
|
showResolvingState = false,
|
|
4292
4363
|
midpointsResult
|
|
4293
4364
|
}) => {
|
|
4294
|
-
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, _Z, __, _$, _aa, _ba, _ca;
|
|
4365
|
+
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, _Z, __, _$, _aa, _ba, _ca, _da;
|
|
4295
4366
|
const {
|
|
4296
4367
|
enableDebug: isExecutionDebugEnabled,
|
|
4297
4368
|
features: { enableAnimations, showFeesBreakdown, showLimitOrders: limitOrdersFeature },
|
|
@@ -5072,7 +5143,16 @@ var PlaceOrder = ({
|
|
|
5072
5143
|
});
|
|
5073
5144
|
const payoutLabel = formatUsd(usdSide);
|
|
5074
5145
|
const amountLabel = internalTab === "sell" ? sharesLabel : payoutLabel;
|
|
5075
|
-
const toWinLabel =
|
|
5146
|
+
const toWinLabel = formatUsd(
|
|
5147
|
+
resolvePlaceOrderNetResult({
|
|
5148
|
+
quoteData,
|
|
5149
|
+
tradeSide: internalTab,
|
|
5150
|
+
shares: sharesSide,
|
|
5151
|
+
usd: usdSide,
|
|
5152
|
+
terminalOrderEvents: executionProgress.terminalOrderEvents,
|
|
5153
|
+
submittedOrders: executionProgress.submittedOrders
|
|
5154
|
+
})
|
|
5155
|
+
);
|
|
5076
5156
|
const potentialReturnValue = getPlaceOrderPotentialReturn(quoteData);
|
|
5077
5157
|
const potentialReturnLabel = potentialReturnValue > 0 ? formatUsd(potentialReturnValue) : void 0;
|
|
5078
5158
|
const eventTitle = (_f2 = (_e2 = scopedSelectedEvent == null ? void 0 : scopedSelectedEvent.title) != null ? _e2 : scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.question) != null ? _f2 : "";
|
|
@@ -5476,7 +5556,16 @@ var PlaceOrder = ({
|
|
|
5476
5556
|
maximumFractionDigits: 2
|
|
5477
5557
|
})
|
|
5478
5558
|
) : formatUsd(actualEconomics.actualRawExecCost);
|
|
5479
|
-
const payoutLabel =
|
|
5559
|
+
const payoutLabel = formatUsd(
|
|
5560
|
+
resolvePlaceOrderNetResult({
|
|
5561
|
+
quoteData,
|
|
5562
|
+
tradeSide: internalTab,
|
|
5563
|
+
shares: actualEconomics.actualTotalFilled,
|
|
5564
|
+
usd: actualEconomics.actualRawExecCost,
|
|
5565
|
+
terminalOrderEvents: executionProgress.terminalOrderEvents,
|
|
5566
|
+
submittedOrders: executionProgress.submittedOrders
|
|
5567
|
+
})
|
|
5568
|
+
);
|
|
5480
5569
|
return __spreadProps(__spreadValues({}, summaryWithGroups), {
|
|
5481
5570
|
actions: summaryWithGroups.actions.map(
|
|
5482
5571
|
(action) => action.variant === "retry" ? __spreadProps(__spreadValues({}, action), { label: tradingLabels.orderTryRemaining(remainingLabel) }) : action
|
|
@@ -5712,30 +5801,21 @@ var PlaceOrder = ({
|
|
|
5712
5801
|
if (totalFees == null) return null;
|
|
5713
5802
|
return formatUsd(totalFees, { minimumFractionDigits: 2, maximumFractionDigits: 2 });
|
|
5714
5803
|
}, [activeFeeBreakdown]);
|
|
5804
|
+
const appFeeValue = (__ = activeFeeBreakdown == null ? void 0 : activeFeeBreakdown.appFee) != null ? __ : 0;
|
|
5715
5805
|
const feeBreakdownRows = useMemo(() => {
|
|
5716
|
-
var _a2
|
|
5806
|
+
var _a2;
|
|
5717
5807
|
if (!activeFeeBreakdown) return [];
|
|
5718
5808
|
return [
|
|
5719
5809
|
{
|
|
5810
|
+
// The builder slice (Hyperliquid only today) is a separate field on the
|
|
5811
|
+
// wire but reads as one cost to the user, so it renders inside "Venue".
|
|
5720
5812
|
kind: "amount",
|
|
5721
5813
|
label: tradingLabels.feeBreakdownVenueFees,
|
|
5722
|
-
value: formatUsd(activeFeeBreakdown.venueFees, {
|
|
5814
|
+
value: formatUsd(activeFeeBreakdown.venueFees + ((_a2 = activeFeeBreakdown.builderFee) != null ? _a2 : 0), {
|
|
5723
5815
|
minimumFractionDigits: 2,
|
|
5724
5816
|
maximumFractionDigits: 2
|
|
5725
5817
|
})
|
|
5726
5818
|
},
|
|
5727
|
-
// Only Hyperliquid charges a builder slice today; every other route
|
|
5728
|
-
// would show a bare "$0.00" line.
|
|
5729
|
-
...((_a2 = activeFeeBreakdown.builderFee) != null ? _a2 : 0) > 0 ? [
|
|
5730
|
-
{
|
|
5731
|
-
kind: "amount",
|
|
5732
|
-
label: tradingLabels.feeBreakdownBuilderFee,
|
|
5733
|
-
value: formatUsd((_b2 = activeFeeBreakdown.builderFee) != null ? _b2 : 0, {
|
|
5734
|
-
minimumFractionDigits: 2,
|
|
5735
|
-
maximumFractionDigits: 2
|
|
5736
|
-
})
|
|
5737
|
-
}
|
|
5738
|
-
] : [],
|
|
5739
5819
|
{
|
|
5740
5820
|
kind: "amount",
|
|
5741
5821
|
label: tradingLabels.feeBreakdownExecutionGas,
|
|
@@ -5752,23 +5832,33 @@ var PlaceOrder = ({
|
|
|
5752
5832
|
maximumFractionDigits: 2
|
|
5753
5833
|
})
|
|
5754
5834
|
},
|
|
5755
|
-
|
|
5835
|
+
// A partner charging a non-zero app fee gets a plain dollar row like every
|
|
5836
|
+
// other cost above it — the "0% fee" badge is only true, and only worth
|
|
5837
|
+
// highlighting, when the fee really is zero.
|
|
5838
|
+
appFeeValue > 0 ? {
|
|
5839
|
+
kind: "amount",
|
|
5840
|
+
label: tradingLabels.feeBreakdownAggMarket,
|
|
5841
|
+
value: formatUsd(appFeeValue, {
|
|
5842
|
+
minimumFractionDigits: 2,
|
|
5843
|
+
maximumFractionDigits: 2
|
|
5844
|
+
})
|
|
5845
|
+
} : {
|
|
5756
5846
|
kind: "badge",
|
|
5757
5847
|
label: tradingLabels.feeBreakdownAggMarket,
|
|
5758
5848
|
badgeLabel: tradingLabels.feeBreakdownPlatformFeeBadge
|
|
5759
5849
|
}
|
|
5760
5850
|
];
|
|
5761
|
-
}, [activeFeeBreakdown, tradingLabels]);
|
|
5851
|
+
}, [activeFeeBreakdown, appFeeValue, tradingLabels]);
|
|
5762
5852
|
const isActionLoading = isPrimaryActionLoading || executeManaged.isPending || placeLimitOrder.isPending || isBeforeActionPending;
|
|
5763
5853
|
const selectedLimitRouteCardId = selectedLimitVenueOption ? `limit-venue-${selectedLimitVenueOption.venue}-${selectedLimitVenueOption.venueMarketOutcomeId}` : null;
|
|
5764
|
-
const selectedLimitRouteCard = selectedLimitRouteCardId ? (
|
|
5765
|
-
const selectedRouteGeoBlocked = isLimitOrder ? (
|
|
5854
|
+
const selectedLimitRouteCard = selectedLimitRouteCardId ? (_$ = limitRouteCards.find((card) => card.id === selectedLimitRouteCardId)) != null ? _$ : null : null;
|
|
5855
|
+
const selectedRouteGeoBlocked = isLimitOrder ? (_aa = selectedLimitRouteCard == null ? void 0 : selectedLimitRouteCard.isUnavailable) != null ? _aa : false : (_ba = selectedRouteCard == null ? void 0 : selectedRouteCard.isUnavailable) != null ? _ba : false;
|
|
5766
5856
|
const geoBlockedVenuesFromWarnings = useMemo(
|
|
5767
5857
|
() => {
|
|
5768
5858
|
var _a2;
|
|
5769
5859
|
return extractGeoBlockedVenues((_a2 = smartRoute.data) == null ? void 0 : _a2.warnings);
|
|
5770
5860
|
},
|
|
5771
|
-
[(
|
|
5861
|
+
[(_ca = smartRoute.data) == null ? void 0 : _ca.warnings]
|
|
5772
5862
|
);
|
|
5773
5863
|
const isPrimaryVenueGeoBlocked = useMemo(() => {
|
|
5774
5864
|
var _a2, _b2;
|
|
@@ -6453,7 +6543,7 @@ var PlaceOrder = ({
|
|
|
6453
6543
|
PlaceOrderResolvedView,
|
|
6454
6544
|
{
|
|
6455
6545
|
tradingState: resolvedReadOnlyTradingState,
|
|
6456
|
-
resolutionTimestamp: (
|
|
6546
|
+
resolutionTimestamp: (_da = resolvedEventTradingState.resolvesAt) != null ? _da : resolvedReadOnlyTradingState.resolvesAt,
|
|
6457
6547
|
resolvedClaim,
|
|
6458
6548
|
classNames,
|
|
6459
6549
|
className,
|
|
@@ -7214,7 +7304,7 @@ var PlaceOrder = ({
|
|
|
7214
7304
|
message: internalTab === "buy" ? tradingLabels.lowLiquidityWarning : tradingLabels.lowLiquiditySellWarning
|
|
7215
7305
|
}
|
|
7216
7306
|
) : null,
|
|
7217
|
-
!shouldShowGeoBlockBanner && internalTab === "buy" && showFeesBreakdown ? /* @__PURE__ */ jsxs6("div", { className: "agg-order-platform-fee mt-1 flex items-center justify-center gap-1.5 text-agg-sm leading-agg-5 text-agg-muted-foreground", children: [
|
|
7307
|
+
!shouldShowGeoBlockBanner && internalTab === "buy" && showFeesBreakdown && appFeeValue === 0 ? /* @__PURE__ */ jsxs6("div", { className: "agg-order-platform-fee mt-1 flex items-center justify-center gap-1.5 text-agg-sm leading-agg-5 text-agg-muted-foreground", children: [
|
|
7218
7308
|
/* @__PURE__ */ jsx7(
|
|
7219
7309
|
Icon,
|
|
7220
7310
|
{
|