@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
package/dist/index.js
CHANGED
|
@@ -21717,13 +21717,13 @@ var extractGeoBlockedVenues = (warnings) => {
|
|
|
21717
21717
|
);
|
|
21718
21718
|
};
|
|
21719
21719
|
var getSmartRouteTotalFees = (feeBreakdown) => {
|
|
21720
|
-
var _a;
|
|
21720
|
+
var _a, _b;
|
|
21721
21721
|
if (!feeBreakdown) return null;
|
|
21722
21722
|
const feeParts = [
|
|
21723
|
-
feeBreakdown.venueFees,
|
|
21724
|
-
(_a = feeBreakdown.builderFee) != null ? _a : 0,
|
|
21723
|
+
feeBreakdown.venueFees + ((_a = feeBreakdown.builderFee) != null ? _a : 0),
|
|
21725
21724
|
feeBreakdown.bridgeFees,
|
|
21726
|
-
feeBreakdown.executionGas
|
|
21725
|
+
feeBreakdown.executionGas,
|
|
21726
|
+
(_b = feeBreakdown.appFee) != null ? _b : 0
|
|
21727
21727
|
];
|
|
21728
21728
|
if (!feeParts.every(Number.isFinite)) return null;
|
|
21729
21729
|
return feeParts.reduce((total, fee) => total + Math.round(fee * 100) / 100, 0);
|
|
@@ -21818,6 +21818,72 @@ var parseDecimalString = (value) => {
|
|
|
21818
21818
|
if (!Number.isFinite(parsed) || parsed <= 0) return null;
|
|
21819
21819
|
return parsed;
|
|
21820
21820
|
};
|
|
21821
|
+
var getPlaceOrderBuyPayout = (quoteData) => {
|
|
21822
|
+
var _a;
|
|
21823
|
+
return (_a = quoteData.estimatedPayout) != null ? _a : quoteData.totalFilled;
|
|
21824
|
+
};
|
|
21825
|
+
var getPlaceOrderSellProceeds = (quoteData) => Math.max(
|
|
21826
|
+
0,
|
|
21827
|
+
quoteData.rawExecCost - quoteData.fills.reduce((sum, fill) => {
|
|
21828
|
+
var _a, _b;
|
|
21829
|
+
return sum + ((_a = fill.venueFee) != null ? _a : 0) + ((_b = fill.builderFee) != null ? _b : 0);
|
|
21830
|
+
}, 0)
|
|
21831
|
+
);
|
|
21832
|
+
var getPlaceOrderQuoteValue = (quoteData, tradeSide) => tradeSide === "sell" ? getPlaceOrderSellProceeds(quoteData) : getPlaceOrderBuyPayout(quoteData);
|
|
21833
|
+
var resolvePlaceOrderNetResult = ({
|
|
21834
|
+
quoteData,
|
|
21835
|
+
tradeSide,
|
|
21836
|
+
shares,
|
|
21837
|
+
usd,
|
|
21838
|
+
terminalOrderEvents,
|
|
21839
|
+
submittedOrders
|
|
21840
|
+
}) => {
|
|
21841
|
+
if (!quoteData) return tradeSide === "sell" ? usd : shares;
|
|
21842
|
+
const actualEvents = (terminalOrderEvents != null ? terminalOrderEvents : []).filter(
|
|
21843
|
+
(event) => (event.event === "filled" || event.event === "partial_fill") && (tradeSide === "buy" ? event.filledAmountRaw != null : event.actualSharesRaw != null)
|
|
21844
|
+
);
|
|
21845
|
+
if (actualEvents.length) {
|
|
21846
|
+
return actualEvents.reduce((sum, event) => {
|
|
21847
|
+
var _a;
|
|
21848
|
+
const outcomeId = (_a = submittedOrders == null ? void 0 : submittedOrders.find(
|
|
21849
|
+
(order) => order.orderId === event.orderId
|
|
21850
|
+
)) == null ? void 0 : _a.outcomeId;
|
|
21851
|
+
const venueFills = quoteData.fills.filter((fill) => fill.venue === event.venue);
|
|
21852
|
+
const exactFill = venueFills.find((fill) => fill.venueMarketOutcomeId === outcomeId);
|
|
21853
|
+
const fills = exactFill ? [exactFill] : venueFills;
|
|
21854
|
+
const legQuote = fills.length ? __spreadProps(__spreadValues({}, quoteData), {
|
|
21855
|
+
fills,
|
|
21856
|
+
totalFilled: fills.reduce((total, fill) => total + fill.venueQty, 0),
|
|
21857
|
+
rawExecCost: fills.reduce((total, fill) => total + fill.avgPrice * fill.venueQty, 0),
|
|
21858
|
+
estimatedPayout: fills.reduce(
|
|
21859
|
+
(total, fill) => {
|
|
21860
|
+
var _a2;
|
|
21861
|
+
return total + fill.venueQty - ((_a2 = fill.settlementFee) != null ? _a2 : 0);
|
|
21862
|
+
},
|
|
21863
|
+
0
|
|
21864
|
+
)
|
|
21865
|
+
}) : quoteData;
|
|
21866
|
+
const actual = resolveActualExecutionEconomics({
|
|
21867
|
+
quoteData: legQuote,
|
|
21868
|
+
tradeSide,
|
|
21869
|
+
terminalOrderEvents: [event],
|
|
21870
|
+
submittedOrders
|
|
21871
|
+
});
|
|
21872
|
+
return sum + resolvePlaceOrderNetResult({
|
|
21873
|
+
quoteData: legQuote,
|
|
21874
|
+
tradeSide,
|
|
21875
|
+
shares: actual.actualTotalFilled,
|
|
21876
|
+
usd: actual.actualRawExecCost
|
|
21877
|
+
});
|
|
21878
|
+
}, 0);
|
|
21879
|
+
}
|
|
21880
|
+
if (tradeSide === "sell") {
|
|
21881
|
+
const gross = quoteData.rawExecCost;
|
|
21882
|
+
return gross > 0 ? usd * (getPlaceOrderSellProceeds(quoteData) / gross) : usd;
|
|
21883
|
+
}
|
|
21884
|
+
const filled = quoteData.totalFilled;
|
|
21885
|
+
return filled > 0 ? shares * (getPlaceOrderBuyPayout(quoteData) / filled) : shares;
|
|
21886
|
+
};
|
|
21821
21887
|
var resolvePlaceOrderQuoteResult = ({
|
|
21822
21888
|
labels,
|
|
21823
21889
|
quoteData,
|
|
@@ -21826,7 +21892,7 @@ var resolvePlaceOrderQuoteResult = ({
|
|
|
21826
21892
|
if (!quoteData || quoteData.totalFilled <= 0) return null;
|
|
21827
21893
|
const avgPrice = getPlaceOrderAverageExecutionPrice(quoteData);
|
|
21828
21894
|
if (avgPrice == null) return null;
|
|
21829
|
-
const quoteValue =
|
|
21895
|
+
const quoteValue = getPlaceOrderQuoteValue(quoteData, tradeSide);
|
|
21830
21896
|
return {
|
|
21831
21897
|
hint: labels.averagePrice(avgPrice),
|
|
21832
21898
|
value: getTradingValueLabel({
|
|
@@ -21944,7 +22010,7 @@ var buildLiveRouteCards = ({
|
|
|
21944
22010
|
eventVenues = [],
|
|
21945
22011
|
geoBlockedVenues: inheritedGeoBlockedVenues
|
|
21946
22012
|
}) => {
|
|
21947
|
-
var _a, _b, _c, _d;
|
|
22013
|
+
var _a, _b, _c, _d, _e;
|
|
21948
22014
|
const geoBlockedVenues = extractGeoBlockedVenues(quoteData.warnings);
|
|
21949
22015
|
for (const venue of inheritedGeoBlockedVenues != null ? inheritedGeoBlockedVenues : []) {
|
|
21950
22016
|
geoBlockedVenues.add(venue);
|
|
@@ -21959,6 +22025,7 @@ var buildLiveRouteCards = ({
|
|
|
21959
22025
|
);
|
|
21960
22026
|
const averageExecutionPrice = (_b = getPlaceOrderAverageExecutionPrice(quoteData)) != null ? _b : void 0;
|
|
21961
22027
|
const primaryWinnerVenue = quoteData.fills.length === 1 ? primaryVenue : void 0;
|
|
22028
|
+
const primaryWinnerOutcomeId = quoteData.fills.length === 1 ? (_c = quoteData.fills[0]) == null ? void 0 : _c.venueMarketOutcomeId : void 0;
|
|
21962
22029
|
const isPrimaryRouteGeoBlocked = quoteData.fills.length > 0 && quoteData.fills.some((f) => geoBlockedVenues.has(f.venue));
|
|
21963
22030
|
const primaryCard = primaryResult ? isPrimaryRouteGeoBlocked ? isSplit ? null : {
|
|
21964
22031
|
id: "live-route",
|
|
@@ -21968,7 +22035,7 @@ var buildLiveRouteCards = ({
|
|
|
21968
22035
|
parsedPrimaryVenue.success ? parsedPrimaryVenue.data : void 0
|
|
21969
22036
|
),
|
|
21970
22037
|
executionPrice: averageExecutionPrice,
|
|
21971
|
-
numericValue:
|
|
22038
|
+
numericValue: getPlaceOrderQuoteValue(quoteData, tradeSide),
|
|
21972
22039
|
quoteData,
|
|
21973
22040
|
value: primaryResult.value,
|
|
21974
22041
|
venue: parsedPrimaryVenue.success ? parsedPrimaryVenue.data : void 0,
|
|
@@ -21981,7 +22048,7 @@ var buildLiveRouteCards = ({
|
|
|
21981
22048
|
label: isSplit ? labels.orderSplitting : getTradingVenueLabel(
|
|
21982
22049
|
parsedPrimaryVenue.success ? parsedPrimaryVenue.data : void 0
|
|
21983
22050
|
),
|
|
21984
|
-
numericValue:
|
|
22051
|
+
numericValue: getPlaceOrderQuoteValue(quoteData, tradeSide),
|
|
21985
22052
|
quoteData,
|
|
21986
22053
|
rows: mapQuoteDataToRoutingRows(quoteData, tradeSide),
|
|
21987
22054
|
description: labels.splitOrderDescription,
|
|
@@ -21991,7 +22058,7 @@ var buildLiveRouteCards = ({
|
|
|
21991
22058
|
requiresSharedKyc: primaryRequiresSharedKyc
|
|
21992
22059
|
} : null;
|
|
21993
22060
|
const soloCardId = (prefix, sq) => `${prefix}-${sq.venue}${sq.venueMarketOutcomeId ? `-${sq.venueMarketOutcomeId}` : ""}`;
|
|
21994
|
-
const soloCards = ((
|
|
22061
|
+
const soloCards = ((_d = quoteData.venueSoloQuotes) != null ? _d : []).filter(
|
|
21995
22062
|
(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
|
|
21996
22063
|
// funding lane is short (API nulls the quoteId), which is NOT always the
|
|
21997
22064
|
// whole-quote `insufficient_balance` case — an off-chain winner (Kalshi
|
|
@@ -21999,9 +22066,9 @@ var buildLiveRouteCards = ({
|
|
|
21999
22066
|
// stays unfunded. Gating on the quoteId silently hid that venue from the
|
|
22000
22067
|
// comparison list entirely. The panel's Deposit CTA fires off the same
|
|
22001
22068
|
// balance condition, and `handleExecuteQuote` rejects an empty quoteId.
|
|
22002
|
-
sq.venue !== primaryWinnerVenue
|
|
22069
|
+
(primaryWinnerOutcomeId && sq.venueMarketOutcomeId ? sq.venueMarketOutcomeId !== primaryWinnerOutcomeId : sq.venue !== primaryWinnerVenue)
|
|
22003
22070
|
).map((sq) => {
|
|
22004
|
-
var _a2, _b2;
|
|
22071
|
+
var _a2, _b2, _c2, _d2, _e2, _f;
|
|
22005
22072
|
const parsedVenue = parseVenue(sq.venue);
|
|
22006
22073
|
const venue = parsedVenue.success ? parsedVenue.data : void 0;
|
|
22007
22074
|
if (geoBlockedVenues.has(sq.venue)) {
|
|
@@ -22011,10 +22078,10 @@ var buildLiveRouteCards = ({
|
|
|
22011
22078
|
hint: labels.venueUnavailableInRegion,
|
|
22012
22079
|
kind: "venue",
|
|
22013
22080
|
label: getTradingVenueLabel(venue),
|
|
22014
|
-
numericValue: sq.filledQty,
|
|
22081
|
+
numericValue: (_a2 = sq.estimatedPayout) != null ? _a2 : sq.filledQty,
|
|
22015
22082
|
quoteData,
|
|
22016
22083
|
value: getTradingValueLabel({
|
|
22017
|
-
amount: sq.filledQty,
|
|
22084
|
+
amount: (_b2 = sq.estimatedPayout) != null ? _b2 : sq.filledQty,
|
|
22018
22085
|
minimumFractionDigits: 2,
|
|
22019
22086
|
maximumFractionDigits: 2
|
|
22020
22087
|
}),
|
|
@@ -22028,7 +22095,7 @@ var buildLiveRouteCards = ({
|
|
|
22028
22095
|
// Preview-only solos intentionally carry no executable quoteId; the card
|
|
22029
22096
|
// should still render for comparison, while the CTA stays disabled until
|
|
22030
22097
|
// the user is funded and requotes.
|
|
22031
|
-
quoteId: (
|
|
22098
|
+
quoteId: (_c2 = sq.quoteId) != null ? _c2 : "",
|
|
22032
22099
|
fills: sq.fills.map((f) => __spreadValues({}, f)),
|
|
22033
22100
|
totalFilled: sq.filledQty,
|
|
22034
22101
|
rawExecCost: sq.rawExecCost,
|
|
@@ -22041,7 +22108,7 @@ var buildLiveRouteCards = ({
|
|
|
22041
22108
|
// primary route's breakdown in place, so selecting a bridge-free venue
|
|
22042
22109
|
// still showed the primary's bridging charge. Falls back to the
|
|
22043
22110
|
// primary only when the router omitted one (non-"ok" solos).
|
|
22044
|
-
feeBreakdown: (
|
|
22111
|
+
feeBreakdown: (_d2 = sq.feeBreakdown) != null ? _d2 : quoteData.feeBreakdown
|
|
22045
22112
|
}), sq.quoteId ? { status: "ok", error: void 0 } : null);
|
|
22046
22113
|
return {
|
|
22047
22114
|
id: soloCardId("live-solo", sq),
|
|
@@ -22050,10 +22117,10 @@ var buildLiveRouteCards = ({
|
|
|
22050
22117
|
kind: "venue",
|
|
22051
22118
|
label: getTradingVenueLabel(venue),
|
|
22052
22119
|
executionPrice: avgPrice,
|
|
22053
|
-
numericValue: sq.filledQty,
|
|
22120
|
+
numericValue: (_e2 = sq.estimatedPayout) != null ? _e2 : sq.filledQty,
|
|
22054
22121
|
quoteData: soloQuoteData,
|
|
22055
22122
|
value: getTradingValueLabel({
|
|
22056
|
-
amount: sq.filledQty,
|
|
22123
|
+
amount: (_f = sq.estimatedPayout) != null ? _f : sq.filledQty,
|
|
22057
22124
|
minimumFractionDigits: 2,
|
|
22058
22125
|
maximumFractionDigits: 2
|
|
22059
22126
|
}),
|
|
@@ -22061,7 +22128,8 @@ var buildLiveRouteCards = ({
|
|
|
22061
22128
|
requiresSharedKyc: venueRequiresSharedKyc({ venue: sq.venue })
|
|
22062
22129
|
};
|
|
22063
22130
|
});
|
|
22064
|
-
const unavailableCards = ((
|
|
22131
|
+
const unavailableCards = ((_e = quoteData.venueSoloQuotes) != null ? _e : []).filter((sq) => sq.status === "unavailable" || sq.unavailableReason === "venue_unavailable").map((sq) => {
|
|
22132
|
+
var _a2, _b2;
|
|
22065
22133
|
const parsedVenue = parseVenue(sq.venue);
|
|
22066
22134
|
const venue = parsedVenue.success ? parsedVenue.data : void 0;
|
|
22067
22135
|
const temporarilyUnavailable = sq.unavailableReason === "venue_unavailable";
|
|
@@ -22072,10 +22140,10 @@ var buildLiveRouteCards = ({
|
|
|
22072
22140
|
hint: temporarilyUnavailable ? labels.venueTemporarilyUnavailable : labels.venueUnavailableInRegion,
|
|
22073
22141
|
kind: "venue",
|
|
22074
22142
|
label: getTradingVenueLabel(venue),
|
|
22075
|
-
numericValue: hasPreview ? sq.filledQty : 0,
|
|
22143
|
+
numericValue: hasPreview ? (_a2 = sq.estimatedPayout) != null ? _a2 : sq.filledQty : 0,
|
|
22076
22144
|
quoteData: __spreadProps(__spreadValues({}, quoteData), { quoteId: "" }),
|
|
22077
22145
|
value: hasPreview ? getTradingValueLabel({
|
|
22078
|
-
amount: sq.filledQty,
|
|
22146
|
+
amount: (_b2 = sq.estimatedPayout) != null ? _b2 : sq.filledQty,
|
|
22079
22147
|
minimumFractionDigits: 2,
|
|
22080
22148
|
maximumFractionDigits: 2
|
|
22081
22149
|
}) : ""
|
|
@@ -22289,10 +22357,13 @@ var getPlaceOrderPotentialReturn = (quoteData) => {
|
|
|
22289
22357
|
if (!((_a = quoteData == null ? void 0 : quoteData.fills) == null ? void 0 : _a.length) || quoteData.fills.length < 2) return 0;
|
|
22290
22358
|
const bestSoloVenueFill = Math.max(
|
|
22291
22359
|
0,
|
|
22292
|
-
...((_b = quoteData.venueSoloQuotes) != null ? _b : []).filter((quote) => quote.status === "ok" && quote.filledQty > 0).map((quote) =>
|
|
22360
|
+
...((_b = quoteData.venueSoloQuotes) != null ? _b : []).filter((quote) => quote.status === "ok" && quote.filledQty > 0).map((quote) => {
|
|
22361
|
+
var _a2;
|
|
22362
|
+
return (_a2 = quote.estimatedPayout) != null ? _a2 : quote.filledQty;
|
|
22363
|
+
})
|
|
22293
22364
|
);
|
|
22294
22365
|
if (bestSoloVenueFill <= 0) return 0;
|
|
22295
|
-
return Math.max(0, quoteData
|
|
22366
|
+
return Math.max(0, getPlaceOrderBuyPayout(quoteData) - bestSoloVenueFill);
|
|
22296
22367
|
};
|
|
22297
22368
|
var resolvePrimarySubmittedOrderId = ({
|
|
22298
22369
|
allowOrderIdFallback = true,
|
|
@@ -24697,7 +24768,7 @@ var PlaceOrder = ({
|
|
|
24697
24768
|
showResolvingState = false,
|
|
24698
24769
|
midpointsResult
|
|
24699
24770
|
}) => {
|
|
24700
|
-
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;
|
|
24771
|
+
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;
|
|
24701
24772
|
const {
|
|
24702
24773
|
enableDebug: isExecutionDebugEnabled,
|
|
24703
24774
|
features: { enableAnimations, showFeesBreakdown, showLimitOrders: limitOrdersFeature },
|
|
@@ -25478,7 +25549,16 @@ var PlaceOrder = ({
|
|
|
25478
25549
|
});
|
|
25479
25550
|
const payoutLabel = formatUsd(usdSide);
|
|
25480
25551
|
const amountLabel = internalTab === "sell" ? sharesLabel : payoutLabel;
|
|
25481
|
-
const toWinLabel =
|
|
25552
|
+
const toWinLabel = formatUsd(
|
|
25553
|
+
resolvePlaceOrderNetResult({
|
|
25554
|
+
quoteData,
|
|
25555
|
+
tradeSide: internalTab,
|
|
25556
|
+
shares: sharesSide,
|
|
25557
|
+
usd: usdSide,
|
|
25558
|
+
terminalOrderEvents: executionProgress.terminalOrderEvents,
|
|
25559
|
+
submittedOrders: executionProgress.submittedOrders
|
|
25560
|
+
})
|
|
25561
|
+
);
|
|
25482
25562
|
const potentialReturnValue = getPlaceOrderPotentialReturn(quoteData);
|
|
25483
25563
|
const potentialReturnLabel = potentialReturnValue > 0 ? formatUsd(potentialReturnValue) : void 0;
|
|
25484
25564
|
const eventTitle = (_f2 = (_e2 = scopedSelectedEvent == null ? void 0 : scopedSelectedEvent.title) != null ? _e2 : scopedSelectedMarket == null ? void 0 : scopedSelectedMarket.question) != null ? _f2 : "";
|
|
@@ -25882,7 +25962,16 @@ var PlaceOrder = ({
|
|
|
25882
25962
|
maximumFractionDigits: 2
|
|
25883
25963
|
})
|
|
25884
25964
|
) : formatUsd(actualEconomics.actualRawExecCost);
|
|
25885
|
-
const payoutLabel =
|
|
25965
|
+
const payoutLabel = formatUsd(
|
|
25966
|
+
resolvePlaceOrderNetResult({
|
|
25967
|
+
quoteData,
|
|
25968
|
+
tradeSide: internalTab,
|
|
25969
|
+
shares: actualEconomics.actualTotalFilled,
|
|
25970
|
+
usd: actualEconomics.actualRawExecCost,
|
|
25971
|
+
terminalOrderEvents: executionProgress.terminalOrderEvents,
|
|
25972
|
+
submittedOrders: executionProgress.submittedOrders
|
|
25973
|
+
})
|
|
25974
|
+
);
|
|
25886
25975
|
return __spreadProps(__spreadValues({}, summaryWithGroups), {
|
|
25887
25976
|
actions: summaryWithGroups.actions.map(
|
|
25888
25977
|
(action) => action.variant === "retry" ? __spreadProps(__spreadValues({}, action), { label: tradingLabels.orderTryRemaining(remainingLabel) }) : action
|
|
@@ -26118,30 +26207,21 @@ var PlaceOrder = ({
|
|
|
26118
26207
|
if (totalFees == null) return null;
|
|
26119
26208
|
return formatUsd(totalFees, { minimumFractionDigits: 2, maximumFractionDigits: 2 });
|
|
26120
26209
|
}, [activeFeeBreakdown]);
|
|
26210
|
+
const appFeeValue = (__ = activeFeeBreakdown == null ? void 0 : activeFeeBreakdown.appFee) != null ? __ : 0;
|
|
26121
26211
|
const feeBreakdownRows = (0, import_react41.useMemo)(() => {
|
|
26122
|
-
var _a2
|
|
26212
|
+
var _a2;
|
|
26123
26213
|
if (!activeFeeBreakdown) return [];
|
|
26124
26214
|
return [
|
|
26125
26215
|
{
|
|
26216
|
+
// The builder slice (Hyperliquid only today) is a separate field on the
|
|
26217
|
+
// wire but reads as one cost to the user, so it renders inside "Venue".
|
|
26126
26218
|
kind: "amount",
|
|
26127
26219
|
label: tradingLabels.feeBreakdownVenueFees,
|
|
26128
|
-
value: formatUsd(activeFeeBreakdown.venueFees, {
|
|
26220
|
+
value: formatUsd(activeFeeBreakdown.venueFees + ((_a2 = activeFeeBreakdown.builderFee) != null ? _a2 : 0), {
|
|
26129
26221
|
minimumFractionDigits: 2,
|
|
26130
26222
|
maximumFractionDigits: 2
|
|
26131
26223
|
})
|
|
26132
26224
|
},
|
|
26133
|
-
// Only Hyperliquid charges a builder slice today; every other route
|
|
26134
|
-
// would show a bare "$0.00" line.
|
|
26135
|
-
...((_a2 = activeFeeBreakdown.builderFee) != null ? _a2 : 0) > 0 ? [
|
|
26136
|
-
{
|
|
26137
|
-
kind: "amount",
|
|
26138
|
-
label: tradingLabels.feeBreakdownBuilderFee,
|
|
26139
|
-
value: formatUsd((_b2 = activeFeeBreakdown.builderFee) != null ? _b2 : 0, {
|
|
26140
|
-
minimumFractionDigits: 2,
|
|
26141
|
-
maximumFractionDigits: 2
|
|
26142
|
-
})
|
|
26143
|
-
}
|
|
26144
|
-
] : [],
|
|
26145
26225
|
{
|
|
26146
26226
|
kind: "amount",
|
|
26147
26227
|
label: tradingLabels.feeBreakdownExecutionGas,
|
|
@@ -26158,23 +26238,33 @@ var PlaceOrder = ({
|
|
|
26158
26238
|
maximumFractionDigits: 2
|
|
26159
26239
|
})
|
|
26160
26240
|
},
|
|
26161
|
-
|
|
26241
|
+
// A partner charging a non-zero app fee gets a plain dollar row like every
|
|
26242
|
+
// other cost above it — the "0% fee" badge is only true, and only worth
|
|
26243
|
+
// highlighting, when the fee really is zero.
|
|
26244
|
+
appFeeValue > 0 ? {
|
|
26245
|
+
kind: "amount",
|
|
26246
|
+
label: tradingLabels.feeBreakdownAggMarket,
|
|
26247
|
+
value: formatUsd(appFeeValue, {
|
|
26248
|
+
minimumFractionDigits: 2,
|
|
26249
|
+
maximumFractionDigits: 2
|
|
26250
|
+
})
|
|
26251
|
+
} : {
|
|
26162
26252
|
kind: "badge",
|
|
26163
26253
|
label: tradingLabels.feeBreakdownAggMarket,
|
|
26164
26254
|
badgeLabel: tradingLabels.feeBreakdownPlatformFeeBadge
|
|
26165
26255
|
}
|
|
26166
26256
|
];
|
|
26167
|
-
}, [activeFeeBreakdown, tradingLabels]);
|
|
26257
|
+
}, [activeFeeBreakdown, appFeeValue, tradingLabels]);
|
|
26168
26258
|
const isActionLoading = isPrimaryActionLoading || executeManaged.isPending || placeLimitOrder.isPending || isBeforeActionPending;
|
|
26169
26259
|
const selectedLimitRouteCardId = selectedLimitVenueOption ? `limit-venue-${selectedLimitVenueOption.venue}-${selectedLimitVenueOption.venueMarketOutcomeId}` : null;
|
|
26170
|
-
const selectedLimitRouteCard = selectedLimitRouteCardId ? (
|
|
26171
|
-
const selectedRouteGeoBlocked = isLimitOrder ? (
|
|
26260
|
+
const selectedLimitRouteCard = selectedLimitRouteCardId ? (_$ = limitRouteCards.find((card) => card.id === selectedLimitRouteCardId)) != null ? _$ : null : null;
|
|
26261
|
+
const selectedRouteGeoBlocked = isLimitOrder ? (_aa = selectedLimitRouteCard == null ? void 0 : selectedLimitRouteCard.isUnavailable) != null ? _aa : false : (_ba = selectedRouteCard == null ? void 0 : selectedRouteCard.isUnavailable) != null ? _ba : false;
|
|
26172
26262
|
const geoBlockedVenuesFromWarnings = (0, import_react41.useMemo)(
|
|
26173
26263
|
() => {
|
|
26174
26264
|
var _a2;
|
|
26175
26265
|
return extractGeoBlockedVenues((_a2 = smartRoute.data) == null ? void 0 : _a2.warnings);
|
|
26176
26266
|
},
|
|
26177
|
-
[(
|
|
26267
|
+
[(_ca = smartRoute.data) == null ? void 0 : _ca.warnings]
|
|
26178
26268
|
);
|
|
26179
26269
|
const isPrimaryVenueGeoBlocked = (0, import_react41.useMemo)(() => {
|
|
26180
26270
|
var _a2, _b2;
|
|
@@ -26859,7 +26949,7 @@ var PlaceOrder = ({
|
|
|
26859
26949
|
PlaceOrderResolvedView,
|
|
26860
26950
|
{
|
|
26861
26951
|
tradingState: resolvedReadOnlyTradingState,
|
|
26862
|
-
resolutionTimestamp: (
|
|
26952
|
+
resolutionTimestamp: (_da = resolvedEventTradingState.resolvesAt) != null ? _da : resolvedReadOnlyTradingState.resolvesAt,
|
|
26863
26953
|
resolvedClaim,
|
|
26864
26954
|
classNames,
|
|
26865
26955
|
className,
|
|
@@ -27620,7 +27710,7 @@ var PlaceOrder = ({
|
|
|
27620
27710
|
message: internalTab === "buy" ? tradingLabels.lowLiquidityWarning : tradingLabels.lowLiquiditySellWarning
|
|
27621
27711
|
}
|
|
27622
27712
|
) : null,
|
|
27623
|
-
!shouldShowGeoBlockBanner && internalTab === "buy" && showFeesBreakdown ? /* @__PURE__ */ (0, import_jsx_runtime178.jsxs)("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: [
|
|
27713
|
+
!shouldShowGeoBlockBanner && internalTab === "buy" && showFeesBreakdown && appFeeValue === 0 ? /* @__PURE__ */ (0, import_jsx_runtime178.jsxs)("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: [
|
|
27624
27714
|
/* @__PURE__ */ (0, import_jsx_runtime178.jsx)(
|
|
27625
27715
|
Icon,
|
|
27626
27716
|
{
|
package/dist/index.mjs
CHANGED
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
formatRecurringCountdown,
|
|
15
15
|
formatShareAmount,
|
|
16
16
|
useHomePageModals
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-5D36HPOG.mjs";
|
|
18
18
|
import {
|
|
19
19
|
EventList,
|
|
20
20
|
EventListItem,
|
|
@@ -67,7 +67,7 @@ import {
|
|
|
67
67
|
useResolvedMarketClaim,
|
|
68
68
|
useSharedKycFlow,
|
|
69
69
|
venueRequiresSharedKyc
|
|
70
|
-
} from "./chunk-
|
|
70
|
+
} from "./chunk-VHKGW4DB.mjs";
|
|
71
71
|
import {
|
|
72
72
|
SETTLEMENT_SECTION_ID,
|
|
73
73
|
Settlement,
|