@agg-build/ui 4.10.0 → 4.11.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-SMQRUNMZ.mjs → chunk-CHM6SCOY.mjs} +2 -2
- package/dist/{chunk-H5LCCV2J.mjs → chunk-EYJS45RP.mjs} +13 -1
- package/dist/{chunk-4HTE5IEZ.mjs → chunk-NCWBKC5C.mjs} +20 -1
- package/dist/events.js +31 -19
- package/dist/events.mjs +1 -1
- package/dist/index.js +283 -252
- package/dist/index.mjs +3 -3
- package/dist/pages.js +305 -274
- package/dist/pages.mjs +3 -3
- package/dist/trading.js +20 -1
- package/dist/trading.mjs +1 -1
- package/dist/types/events/list/event-list.constants.d.mts +1 -1
- package/dist/types/events/list/event-list.constants.d.ts +1 -1
- package/package.json +3 -3
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
isErrorWithStatus,
|
|
13
13
|
useEventListTabs,
|
|
14
14
|
useEventListTabsHeaderOverflow
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-EYJS45RP.mjs";
|
|
16
16
|
import {
|
|
17
17
|
DEPOSIT_MODAL_OPEN_EVENT,
|
|
18
18
|
PlaceOrder,
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
formatChainIdLabel,
|
|
22
22
|
useClaimWinnings,
|
|
23
23
|
useResolvedMarketClaim
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-NCWBKC5C.mjs";
|
|
25
25
|
import {
|
|
26
26
|
getDisplayOutcomePrice,
|
|
27
27
|
resolveHeaderOutcomeItems,
|
|
@@ -5623,6 +5623,7 @@ import { getEffectiveDisabledVenues, isVenueInactive } from "@agg-build/sdk";
|
|
|
5623
5623
|
import { useCallback as useCallback3, useEffect as useEffect7, useMemo as useMemo9, useRef as useRef7, useState as useState6 } from "react";
|
|
5624
5624
|
|
|
5625
5625
|
// src/events/list/event-list.constants.ts
|
|
5626
|
+
import { sortVenues as sortVenues4 } from "@agg-build/hooks";
|
|
5626
5627
|
import { MatchStatus, Venue as Venue2 } from "@agg-build/sdk";
|
|
5627
5628
|
var DEFAULT_EVENTS_LIMIT = 50;
|
|
5628
5629
|
var DEFAULT_EVENT_LIST_SORT = "volume24hr";
|
|
@@ -5633,7 +5634,7 @@ var EVENT_LIST_SORT_VALUES = [
|
|
|
5633
5634
|
"endDate"
|
|
5634
5635
|
];
|
|
5635
5636
|
var getDefaultEventListTabs = (labels) => {
|
|
5636
|
-
|
|
5637
|
+
const tabs = [
|
|
5637
5638
|
{
|
|
5638
5639
|
value: "matched",
|
|
5639
5640
|
label: labels.eventList.matchedTab,
|
|
@@ -5709,6 +5710,17 @@ var getDefaultEventListTabs = (labels) => {
|
|
|
5709
5710
|
isComingSoon: true
|
|
5710
5711
|
}
|
|
5711
5712
|
];
|
|
5713
|
+
const venueRank = new Map(
|
|
5714
|
+
sortVenues4(tabs.flatMap((tab) => tab.venueLogo ? [tab.venueLogo] : [])).map((venue, i) => [
|
|
5715
|
+
venue,
|
|
5716
|
+
i
|
|
5717
|
+
])
|
|
5718
|
+
);
|
|
5719
|
+
const rank = (tab) => {
|
|
5720
|
+
var _a;
|
|
5721
|
+
return tab.venueLogo ? 1 + ((_a = venueRank.get(tab.venueLogo)) != null ? _a : venueRank.size) : 0;
|
|
5722
|
+
};
|
|
5723
|
+
return [...tabs].sort((a, b) => rank(a) - rank(b));
|
|
5712
5724
|
};
|
|
5713
5725
|
|
|
5714
5726
|
// src/events/list/event-list-tabs.tsx
|
|
@@ -1311,8 +1311,14 @@ var extractGeoBlockedVenues = (warnings) => {
|
|
|
1311
1311
|
);
|
|
1312
1312
|
};
|
|
1313
1313
|
var getSmartRouteTotalFees = (feeBreakdown) => {
|
|
1314
|
+
var _a;
|
|
1314
1315
|
if (!feeBreakdown) return null;
|
|
1315
|
-
const feeParts = [
|
|
1316
|
+
const feeParts = [
|
|
1317
|
+
feeBreakdown.venueFees,
|
|
1318
|
+
(_a = feeBreakdown.builderFee) != null ? _a : 0,
|
|
1319
|
+
feeBreakdown.bridgeFees,
|
|
1320
|
+
feeBreakdown.executionGas
|
|
1321
|
+
];
|
|
1316
1322
|
if (!feeParts.every(Number.isFinite)) return null;
|
|
1317
1323
|
return feeParts.reduce((total, fee) => total + Math.round(fee * 100) / 100, 0);
|
|
1318
1324
|
};
|
|
@@ -5707,6 +5713,7 @@ var PlaceOrder = ({
|
|
|
5707
5713
|
return formatUsd(totalFees, { minimumFractionDigits: 2, maximumFractionDigits: 2 });
|
|
5708
5714
|
}, [activeFeeBreakdown]);
|
|
5709
5715
|
const feeBreakdownRows = useMemo(() => {
|
|
5716
|
+
var _a2, _b2;
|
|
5710
5717
|
if (!activeFeeBreakdown) return [];
|
|
5711
5718
|
return [
|
|
5712
5719
|
{
|
|
@@ -5717,6 +5724,18 @@ var PlaceOrder = ({
|
|
|
5717
5724
|
maximumFractionDigits: 2
|
|
5718
5725
|
})
|
|
5719
5726
|
},
|
|
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
|
+
] : [],
|
|
5720
5739
|
{
|
|
5721
5740
|
kind: "amount",
|
|
5722
5741
|
label: tradingLabels.feeBreakdownExecutionGas,
|
package/dist/events.js
CHANGED
|
@@ -14927,7 +14927,7 @@ var MarketDetailsList = ({
|
|
|
14927
14927
|
MarketDetailsList.displayName = "MarketDetailsList";
|
|
14928
14928
|
|
|
14929
14929
|
// src/events/list/index.tsx
|
|
14930
|
-
var
|
|
14930
|
+
var import_hooks52 = require("@agg-build/hooks");
|
|
14931
14931
|
var import_sdk17 = require("@agg-build/sdk");
|
|
14932
14932
|
var Dialog2 = __toESM(require("@radix-ui/react-dialog"));
|
|
14933
14933
|
var import_react25 = require("react");
|
|
@@ -15050,16 +15050,17 @@ var CategorySidebar = ({
|
|
|
15050
15050
|
CategorySidebar.displayName = "CategorySidebar";
|
|
15051
15051
|
|
|
15052
15052
|
// src/events/list/event-list-tabs.tsx
|
|
15053
|
-
var
|
|
15053
|
+
var import_hooks51 = require("@agg-build/hooks");
|
|
15054
15054
|
var import_sdk16 = require("@agg-build/sdk");
|
|
15055
15055
|
var import_react24 = require("react");
|
|
15056
15056
|
|
|
15057
15057
|
// src/events/list/event-list.constants.ts
|
|
15058
|
+
var import_hooks50 = require("@agg-build/hooks");
|
|
15058
15059
|
var import_sdk15 = require("@agg-build/sdk");
|
|
15059
15060
|
var DEFAULT_EVENTS_LIMIT = 50;
|
|
15060
15061
|
var DEFAULT_EVENT_LIST_SORT = "volume24hr";
|
|
15061
15062
|
var getDefaultEventListTabs = (labels) => {
|
|
15062
|
-
|
|
15063
|
+
const tabs = [
|
|
15063
15064
|
{
|
|
15064
15065
|
value: "matched",
|
|
15065
15066
|
label: labels.eventList.matchedTab,
|
|
@@ -15135,6 +15136,17 @@ var getDefaultEventListTabs = (labels) => {
|
|
|
15135
15136
|
isComingSoon: true
|
|
15136
15137
|
}
|
|
15137
15138
|
];
|
|
15139
|
+
const venueRank = new Map(
|
|
15140
|
+
(0, import_hooks50.sortVenues)(tabs.flatMap((tab) => tab.venueLogo ? [tab.venueLogo] : [])).map((venue, i) => [
|
|
15141
|
+
venue,
|
|
15142
|
+
i
|
|
15143
|
+
])
|
|
15144
|
+
);
|
|
15145
|
+
const rank = (tab) => {
|
|
15146
|
+
var _a;
|
|
15147
|
+
return tab.venueLogo ? 1 + ((_a = venueRank.get(tab.venueLogo)) != null ? _a : venueRank.size) : 0;
|
|
15148
|
+
};
|
|
15149
|
+
return [...tabs].sort((a, b) => rank(a) - rank(b));
|
|
15138
15150
|
};
|
|
15139
15151
|
|
|
15140
15152
|
// src/events/list/event-list-tabs.tsx
|
|
@@ -15158,14 +15170,14 @@ var renderTabIcon = (tab, isActive) => {
|
|
|
15158
15170
|
);
|
|
15159
15171
|
};
|
|
15160
15172
|
var useEventListTabs = (tabs) => {
|
|
15161
|
-
const labels = (0,
|
|
15162
|
-
const { disabledVenues, isLoading: isAppConfigLoading } = (0,
|
|
15163
|
-
const { isLocationBlocked } = (0,
|
|
15173
|
+
const labels = (0, import_hooks51.useLabels)();
|
|
15174
|
+
const { disabledVenues, isLoading: isAppConfigLoading } = (0, import_hooks51.useAppConfig)();
|
|
15175
|
+
const { isLocationBlocked } = (0, import_hooks51.useGeoBlock)();
|
|
15164
15176
|
return (0, import_react24.useMemo)(() => {
|
|
15165
15177
|
const baseTabs = tabs != null ? tabs : getDefaultEventListTabs(labels);
|
|
15166
15178
|
return baseTabs.flatMap((tab) => {
|
|
15167
15179
|
if (!tab.venueLogo) return [tab];
|
|
15168
|
-
const availabilityState = (0,
|
|
15180
|
+
const availabilityState = (0, import_hooks51.getVenueAvailabilityState)({
|
|
15169
15181
|
venueId: tab.venueLogo,
|
|
15170
15182
|
disabledVenues,
|
|
15171
15183
|
// A globally inactive or default-disabled venue is hidden until
|
|
@@ -15289,15 +15301,15 @@ var EventList = ({
|
|
|
15289
15301
|
stateRef
|
|
15290
15302
|
}) => {
|
|
15291
15303
|
var _a, _b, _c, _d, _e, _f;
|
|
15292
|
-
const labels = (0,
|
|
15293
|
-
const { disabledVenues } = (0,
|
|
15304
|
+
const labels = (0, import_hooks52.useLabels)();
|
|
15305
|
+
const { disabledVenues } = (0, import_hooks52.useAppConfig)();
|
|
15294
15306
|
const {
|
|
15295
15307
|
features: { enableVenueEventDiscoveryFilters, showSportsMarkets }
|
|
15296
|
-
} = (0,
|
|
15308
|
+
} = (0, import_hooks52.useSdkUiConfig)();
|
|
15297
15309
|
const isDiscoveryFiltersEnabled = enableVenueEventDiscoveryFilters && !search;
|
|
15298
15310
|
const resolvedTabs = useEventListTabs();
|
|
15299
15311
|
const visibleVenues = (0, import_react25.useMemo)(
|
|
15300
|
-
() => disabledVenues.length === 0 ? void 0 : (0,
|
|
15312
|
+
() => disabledVenues.length === 0 ? void 0 : (0, import_hooks52.getVisibleVenueIdsByConfig)(import_sdk17.VENUES, disabledVenues),
|
|
15301
15313
|
[disabledVenues]
|
|
15302
15314
|
);
|
|
15303
15315
|
const [internalActiveTabValue, setInternalActiveTabValue] = (0, import_react25.useState)(
|
|
@@ -15366,7 +15378,7 @@ var EventList = ({
|
|
|
15366
15378
|
if (controlledCategoryPath == null) setInternalCategoryPath([]);
|
|
15367
15379
|
setCollapsedCategoryIds(/* @__PURE__ */ new Set());
|
|
15368
15380
|
}, [baseCategoryId, controlledCategoryPath, isDiscoveryFiltersEnabled]);
|
|
15369
|
-
const { categories: topLevelCategories } = (0,
|
|
15381
|
+
const { categories: topLevelCategories } = (0, import_hooks52.useCategories)({
|
|
15370
15382
|
queryKeyScope: "event-list-top-categories",
|
|
15371
15383
|
enabled: isDiscoveryFiltersEnabled,
|
|
15372
15384
|
limit: 100
|
|
@@ -15383,7 +15395,7 @@ var EventList = ({
|
|
|
15383
15395
|
])
|
|
15384
15396
|
);
|
|
15385
15397
|
}, [baseCategoryId, categoryPath, sortedTopLevelCategories]);
|
|
15386
|
-
const { childrenByParentId: baseChildrenByParentId, isLoading: isBaseCategoryChildrenLoading } = (0,
|
|
15398
|
+
const { childrenByParentId: baseChildrenByParentId, isLoading: isBaseCategoryChildrenLoading } = (0, import_hooks52.useCategoryChildren)({
|
|
15387
15399
|
queryKeyScope: "event-list-category-children",
|
|
15388
15400
|
enabled: isDiscoveryFiltersEnabled,
|
|
15389
15401
|
parentIds: baseCategoryChildPrefetchIds,
|
|
@@ -15404,7 +15416,7 @@ var EventList = ({
|
|
|
15404
15416
|
}
|
|
15405
15417
|
return Array.from(ids);
|
|
15406
15418
|
}, [baseCategoryId, baseChildrenByParentId, categoryPath]);
|
|
15407
|
-
const { childrenByParentId: visibleChildrenByParentId } = (0,
|
|
15419
|
+
const { childrenByParentId: visibleChildrenByParentId } = (0, import_hooks52.useCategoryChildren)({
|
|
15408
15420
|
queryKeyScope: "event-list-category-children",
|
|
15409
15421
|
enabled: isDiscoveryFiltersEnabled,
|
|
15410
15422
|
parentIds: visibleChildPrefetchIds,
|
|
@@ -15420,7 +15432,7 @@ var EventList = ({
|
|
|
15420
15432
|
}
|
|
15421
15433
|
return Array.from(ids);
|
|
15422
15434
|
}, [categoryPath, visibleChildrenByParentId]);
|
|
15423
|
-
const { childrenByParentId: visibleGrandchildrenByParentId } = (0,
|
|
15435
|
+
const { childrenByParentId: visibleGrandchildrenByParentId } = (0, import_hooks52.useCategoryChildren)({
|
|
15424
15436
|
queryKeyScope: "event-list-category-children",
|
|
15425
15437
|
enabled: isDiscoveryFiltersEnabled,
|
|
15426
15438
|
parentIds: visibleGrandchildPrefetchIds,
|
|
@@ -15505,14 +15517,14 @@ var EventList = ({
|
|
|
15505
15517
|
isFetchingNextPage,
|
|
15506
15518
|
isPlaceholderData,
|
|
15507
15519
|
loadedPageCount
|
|
15508
|
-
} = (0,
|
|
15520
|
+
} = (0, import_hooks52.useVenueEvents)({
|
|
15509
15521
|
queryKeyScope: "event-list",
|
|
15510
15522
|
venues,
|
|
15511
15523
|
search,
|
|
15512
15524
|
categoryIds: resolvedCategoryIds,
|
|
15513
15525
|
matchStatus,
|
|
15514
15526
|
limit: requestLimit,
|
|
15515
|
-
status: [
|
|
15527
|
+
status: [import_hooks52.MarketStatus.open],
|
|
15516
15528
|
sortBy: sortQueryParams.sortBy,
|
|
15517
15529
|
sortDir: sortQueryParams.sortDir,
|
|
15518
15530
|
endDateFrom,
|
|
@@ -15548,7 +15560,7 @@ var EventList = ({
|
|
|
15548
15560
|
const visibleMidpointVenueMarketIds = (0, import_react25.useMemo)(() => {
|
|
15549
15561
|
return collectMidpointVenueMarketIds(visibleVenueMarkets);
|
|
15550
15562
|
}, [visibleVenueMarkets]);
|
|
15551
|
-
const { midpointRows: sharedMidpointRows, isLoading: isSharedMidpointsLoading } = (0,
|
|
15563
|
+
const { midpointRows: sharedMidpointRows, isLoading: isSharedMidpointsLoading } = (0, import_hooks52.useVenueMarketMidpoints)({
|
|
15552
15564
|
venueMarketIds: visibleMidpointVenueMarketIds,
|
|
15553
15565
|
enabled: visibleMidpointVenueMarketIds.length > 0
|
|
15554
15566
|
});
|
|
@@ -15729,7 +15741,7 @@ var EventList = ({
|
|
|
15729
15741
|
onMarketClick,
|
|
15730
15742
|
getMarketHref,
|
|
15731
15743
|
href: getEventHref == null ? void 0 : getEventHref(event),
|
|
15732
|
-
marketStatus:
|
|
15744
|
+
marketStatus: import_hooks52.MarketStatus.open
|
|
15733
15745
|
},
|
|
15734
15746
|
event.id
|
|
15735
15747
|
)),
|
package/dist/events.mjs
CHANGED