@agg-build/ui 2.1.0 → 2.1.1

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.
Files changed (34) hide show
  1. package/dist/{chunk-Y6PVXAUQ.mjs → chunk-IQT4I5B4.mjs} +387 -250
  2. package/dist/{chunk-R6FBYAY5.mjs → chunk-NK57KMYN.mjs} +2 -2
  3. package/dist/{chunk-YMVD6Q2A.mjs → chunk-RPXRTXCY.mjs} +1 -1
  4. package/dist/{chunk-C5M2OOM3.mjs → chunk-TERG43WW.mjs} +1 -1
  5. package/dist/{chunk-3OI2ZLLT.mjs → chunk-WU2C3C6K.mjs} +1 -1
  6. package/dist/{chunk-YAEA6EDG.mjs → chunk-XHDGSRG7.mjs} +8 -6
  7. package/dist/{chunk-DXF2LMNN.mjs → chunk-YJO6LMRT.mjs} +781 -753
  8. package/dist/events.js +941 -914
  9. package/dist/events.mjs +3 -3
  10. package/dist/index.js +2788 -2621
  11. package/dist/index.mjs +11 -7
  12. package/dist/modals.js +851 -824
  13. package/dist/modals.mjs +3 -3
  14. package/dist/pages.js +1968 -1803
  15. package/dist/pages.mjs +8 -6
  16. package/dist/primitives.js +782 -753
  17. package/dist/primitives.mjs +3 -1
  18. package/dist/styles.css +1 -1
  19. package/dist/tailwind.css +1 -1
  20. package/dist/trading.js +532 -501
  21. package/dist/trading.mjs +4 -4
  22. package/dist/types/pages/user-profile/index.d.mts +1 -0
  23. package/dist/types/pages/user-profile/index.d.ts +1 -0
  24. package/dist/types/pages/user-profile/transaction-explorer.d.mts +1 -0
  25. package/dist/types/pages/user-profile/transaction-explorer.d.ts +1 -0
  26. package/dist/types/pages/user-profile/user-profile.types.d.mts +8 -2
  27. package/dist/types/pages/user-profile/user-profile.types.d.ts +8 -2
  28. package/dist/types/primitives/icon/index.d.mts +2 -1
  29. package/dist/types/primitives/icon/index.d.ts +2 -1
  30. package/dist/types/primitives/icon/registry.d.mts +4 -0
  31. package/dist/types/primitives/icon/registry.d.ts +4 -0
  32. package/dist/types/primitives/icon/svg/paper-mode.d.mts +5 -0
  33. package/dist/types/primitives/icon/svg/paper-mode.d.ts +5 -0
  34. package/package.json +2 -2
@@ -10,13 +10,13 @@ import {
10
10
  isErrorWithStatus,
11
11
  useEventListTabs,
12
12
  useEventListTabsHeaderOverflow
13
- } from "./chunk-R6FBYAY5.mjs";
13
+ } from "./chunk-NK57KMYN.mjs";
14
14
  import {
15
15
  DEPOSIT_MODAL_OPEN_EVENT,
16
16
  PlaceOrder,
17
17
  SettlementDetails,
18
18
  WITHDRAW_MODAL_OPEN_EVENT
19
- } from "./chunk-YAEA6EDG.mjs";
19
+ } from "./chunk-XHDGSRG7.mjs";
20
20
  import {
21
21
  AggErrorBoundary,
22
22
  Button,
@@ -47,7 +47,7 @@ import {
47
47
  shortenAddress,
48
48
  sortCategoriesForNavigation,
49
49
  useOptionalToast
50
- } from "./chunk-DXF2LMNN.mjs";
50
+ } from "./chunk-YJO6LMRT.mjs";
51
51
 
52
52
  // src/pages/home/index.tsx
53
53
  import {
@@ -56,7 +56,7 @@ import {
56
56
  useCategories,
57
57
  useEventListState,
58
58
  useLabels as useLabels2,
59
- useSdkUiConfig,
59
+ useSdkUiConfig as useSdkUiConfig2,
60
60
  useSearch
61
61
  } from "@agg-build/hooks";
62
62
  import { VENUES } from "@agg-build/sdk";
@@ -69,7 +69,8 @@ import {
69
69
  useEnrichedVenueEvent,
70
70
  useEventTradingContext,
71
71
  useLabels,
72
- useMidpoints
72
+ useMidpoints,
73
+ useSdkUiConfig
73
74
  } from "@agg-build/hooks";
74
75
  import * as Dialog from "@radix-ui/react-dialog";
75
76
  import { useEffect, useMemo, useRef, useState } from "react";
@@ -363,6 +364,10 @@ var EventMarketPageContent = ({
363
364
  const stickyOrderPanelState = resolveEventMarketPageStickyState({
364
365
  stickyOrderPanel
365
366
  });
367
+ const {
368
+ trading: { executionMode: configuredExecutionMode }
369
+ } = useSdkUiConfig();
370
+ const resolvedExecutionMode = executionMode != null ? executionMode : configuredExecutionMode;
366
371
  const [isMobileTradeOpen, setIsMobileTradeOpen] = useState(false);
367
372
  const isMobileViewport = useIsMobileEventMarketViewport();
368
373
  const tradingContext = useEventTradingContext();
@@ -443,7 +448,7 @@ var EventMarketPageContent = ({
443
448
  PlaceOrder,
444
449
  {
445
450
  eventTradingState,
446
- executionMode,
451
+ executionMode: resolvedExecutionMode,
447
452
  resolvedClaim,
448
453
  midpointsResult,
449
454
  className: cn(
@@ -469,7 +474,7 @@ var EventMarketPageContent = ({
469
474
  PlaceOrder,
470
475
  {
471
476
  eventTradingState,
472
- executionMode,
477
+ executionMode: resolvedExecutionMode,
473
478
  resolvedClaim,
474
479
  midpointsResult,
475
480
  className: cn(stickyOrderPanelState == null ? void 0 : stickyOrderPanelState.placeOrder, classNames == null ? void 0 : classNames.trade),
@@ -486,7 +491,7 @@ var EventMarketPageContent = ({
486
491
  {
487
492
  classNames,
488
493
  eventTradingState,
489
- executionMode,
494
+ executionMode: resolvedExecutionMode,
490
495
  showPlaceOrder,
491
496
  isOpen: isMobileTradeOpen,
492
497
  onOpenChange: setIsMobileTradeOpen,
@@ -670,7 +675,7 @@ var HomeSearchResults = ({
670
675
  onMarketClick
671
676
  }) => {
672
677
  const labels = useLabels2();
673
- const { search: searchConfig } = useSdkUiConfig();
678
+ const { search: searchConfig } = useSdkUiConfig2();
674
679
  const { disabledVenues } = useAppConfig();
675
680
  const [activeVenueTabValue, setActiveVenueTabValue] = useState4("matched");
676
681
  const eventListTabs = useEventListTabs();
@@ -864,8 +869,9 @@ var HomePage = ({
864
869
  isShowingAllResults,
865
870
  onChange: onSearchChange,
866
871
  onSelect: onSelectEventInternal
867
- }
868
- } = useSdkUiConfig();
872
+ },
873
+ trading: { executionMode }
874
+ } = useSdkUiConfig2();
869
875
  const { capture, consume } = useEventListState();
870
876
  const [snapshot] = useState4(() => consume());
871
877
  const eventListStateRef = useRef3(null);
@@ -1063,7 +1069,14 @@ var HomePage = ({
1063
1069
  ) })
1064
1070
  }
1065
1071
  ) : null,
1066
- resolvedSelectedEvent ? /* @__PURE__ */ jsx2(EventMarketPage, { eventId: resolvedSelectedEvent.id, stickyOrderPanel }) : /* @__PURE__ */ jsxs2(
1072
+ resolvedSelectedEvent ? /* @__PURE__ */ jsx2(
1073
+ EventMarketPage,
1074
+ {
1075
+ eventId: resolvedSelectedEvent.id,
1076
+ executionMode,
1077
+ stickyOrderPanel
1078
+ }
1079
+ ) : /* @__PURE__ */ jsxs2(
1067
1080
  "div",
1068
1081
  {
1069
1082
  className: cn(
@@ -1152,10 +1165,11 @@ import {
1152
1165
  useExecutionOrders,
1153
1166
  useExecutionPositions,
1154
1167
  useGeoBlock,
1155
- useLabels as useLabels6,
1168
+ useLabels as useLabels7,
1156
1169
  useQueryClient,
1157
1170
  useRedeem,
1158
1171
  useRedeemLifecycles,
1172
+ useSdkUiConfig as useSdkUiConfig3,
1159
1173
  useUserActivity
1160
1174
  } from "@agg-build/hooks";
1161
1175
  import { Venue } from "@agg-build/sdk";
@@ -1182,6 +1196,7 @@ var formatChainIdLabel = (chainId) => {
1182
1196
  };
1183
1197
 
1184
1198
  // src/pages/user-profile/components/available-balance-card.tsx
1199
+ import { useLabels as useLabels3 } from "@agg-build/hooks";
1185
1200
  import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
1186
1201
  var BASE_URL = "https://assets.snagsolutions.io";
1187
1202
  var CHAIN_ID_TO_ICON_URL = {
@@ -1210,6 +1225,9 @@ var CHAIN_VENUE_MAP = {
1210
1225
  "1337": ["hyperliquid"]
1211
1226
  // HyperCore
1212
1227
  };
1228
+ var isPaperChain = (row) => {
1229
+ return row.key === "0" || row.label.trim().toLowerCase() === "paper";
1230
+ };
1213
1231
  var chainIconUrl = (label, key) => {
1214
1232
  if (key && CHAIN_ID_TO_ICON_URL[key]) return CHAIN_ID_TO_ICON_URL[key];
1215
1233
  const k = label.trim().toLowerCase();
@@ -1227,12 +1245,16 @@ var chainIconUrl = (label, key) => {
1227
1245
  return void 0;
1228
1246
  };
1229
1247
  var AvailableBalanceCard = ({
1230
- label = "Available Balance",
1248
+ label,
1231
1249
  valueLabel,
1232
1250
  chains,
1233
1251
  isLoading = false,
1234
1252
  className
1235
1253
  }) => {
1254
+ const labels = useLabels3();
1255
+ const balanceLabels = labels.userProfile.balance;
1256
+ const resolvedLabel = label != null ? label : balanceLabels.availableBalance;
1257
+ const hasPaperBalance = chains.some(isPaperChain);
1236
1258
  return /* @__PURE__ */ jsxs3(
1237
1259
  "div",
1238
1260
  {
@@ -1262,21 +1284,23 @@ var AvailableBalanceCard = ({
1262
1284
  )
1263
1285
  }
1264
1286
  ),
1265
- /* @__PURE__ */ jsx3("span", { className: "font-agg-sans text-agg-base leading-6 font-agg-normal text-agg-foreground", children: label })
1287
+ /* @__PURE__ */ jsx3("span", { className: "font-agg-sans text-agg-base leading-6 font-agg-normal text-agg-foreground", children: resolvedLabel })
1266
1288
  ] }) }),
1267
1289
  /* @__PURE__ */ jsxs3("div", { className: "agg-balance-summary flex items-center justify-between gap-3", children: [
1268
1290
  /* @__PURE__ */ jsx3("div", { className: "agg-balance-value font-agg-sans text-agg-2xl leading-8 font-agg-bold text-agg-foreground", children: isLoading ? /* @__PURE__ */ jsx3("div", { role: "status", "aria-label": "Loading available balance", children: /* @__PURE__ */ jsx3(SkeletonBlock, { className: "h-8 w-24 rounded-agg-sm" }) }) : valueLabel }),
1269
1291
  /* @__PURE__ */ jsx3(
1270
1292
  Tooltip,
1271
1293
  {
1272
- "aria-label": "Balance by network",
1294
+ "aria-label": balanceLabels.balanceByNetwork,
1273
1295
  size: "medium",
1274
1296
  side: "bottom",
1275
1297
  content: /* @__PURE__ */ jsxs3("div", { className: "flex flex-col gap-4 items-start justify-start", children: [
1276
- /* @__PURE__ */ jsx3("div", { className: "font-agg-sans text-agg-base leading-agg-6 font-agg-bold text-agg-foreground", children: "Balance by network" }),
1298
+ /* @__PURE__ */ jsx3("div", { className: "font-agg-sans text-agg-base leading-agg-6 font-agg-bold text-agg-foreground", children: balanceLabels.balanceByNetwork }),
1277
1299
  /* @__PURE__ */ jsx3("div", { role: "list", className: "agg-balance-list flex flex-col gap-3 w-full", children: chains.map((row) => {
1278
1300
  var _a;
1279
1301
  const iconUrl = chainIconUrl(row.label, row.key);
1302
+ const isPaper = isPaperChain(row);
1303
+ const rowLabel = isPaper ? balanceLabels.paperModeNetwork : row.label;
1280
1304
  return /* @__PURE__ */ jsxs3(
1281
1305
  "div",
1282
1306
  {
@@ -1292,8 +1316,8 @@ var AvailableBalanceCard = ({
1292
1316
  "aria-hidden": true,
1293
1317
  className: "size-full object-contain"
1294
1318
  }
1295
- ) }) : /* @__PURE__ */ jsx3("span", { className: "flex h-4 w-4 shrink-0 items-center justify-center rounded-[4px] border border-agg-separator text-[10px] leading-3 text-agg-muted-foreground", children: row.label.slice(0, 2).toUpperCase() }),
1296
- /* @__PURE__ */ jsx3("span", { className: "truncate font-agg-sans text-agg-sm leading-5 font-agg-normal text-agg-foreground", children: row.label })
1319
+ ) }) : isPaper ? /* @__PURE__ */ jsx3("span", { className: "flex h-4 w-4 shrink-0 items-center justify-center rounded-[4px] bg-agg-secondary-hover text-agg-primary", children: /* @__PURE__ */ jsx3(Icon, { name: "paper-mode", size: "small", className: "h-4 w-4" }) }) : /* @__PURE__ */ jsx3("span", { className: "flex h-4 w-4 shrink-0 items-center justify-center rounded-[4px] border border-agg-separator text-[10px] leading-3 text-agg-muted-foreground", children: rowLabel.slice(0, 2).toUpperCase() }),
1320
+ /* @__PURE__ */ jsx3("span", { className: "truncate font-agg-sans text-agg-sm leading-5 font-agg-normal text-agg-foreground", children: rowLabel })
1297
1321
  ] }),
1298
1322
  /* @__PURE__ */ jsx3("span", { className: "w-[100px] shrink-0 whitespace-nowrap text-right tabular-nums font-agg-sans text-agg-sm leading-agg-5 font-agg-bold text-agg-foreground", children: row.balance.toLocaleString("en-US", {
1299
1323
  style: "currency",
@@ -1315,17 +1339,29 @@ var AvailableBalanceCard = ({
1315
1339
  row.key
1316
1340
  );
1317
1341
  }) }),
1318
- /* @__PURE__ */ jsx3("div", { className: "agg-balance-note rounded-agg-lg bg-agg-secondary-hover p-3", children: /* @__PURE__ */ jsx3("p", { className: "font-agg-sans text-agg-xs leading-agg-4 font-agg-normal text-agg-foreground", children: "Funds are stored across networks. We handle routing automatically, but keeping funds on the right network enables faster trades and lower fees. When depositing, you can choose your preferred network." }) })
1342
+ hasPaperBalance ? /* @__PURE__ */ jsx3("div", { className: "agg-balance-paper-warning rounded-agg-lg bg-agg-primary/10 p-3", children: /* @__PURE__ */ jsxs3("div", { className: "flex items-start gap-2", children: [
1343
+ /* @__PURE__ */ jsx3(
1344
+ Icon,
1345
+ {
1346
+ name: "paper-mode",
1347
+ size: "small",
1348
+ className: "mt-0.5 h-4 w-4 shrink-0 text-agg-primary"
1349
+ }
1350
+ ),
1351
+ /* @__PURE__ */ jsx3("p", { className: "font-agg-sans text-agg-xs leading-agg-4 font-agg-normal text-agg-foreground", children: balanceLabels.paperModeWarning })
1352
+ ] }) }) : null,
1353
+ /* @__PURE__ */ jsx3("div", { className: "agg-balance-note rounded-agg-lg bg-agg-secondary-hover p-3", children: /* @__PURE__ */ jsx3("p", { className: "font-agg-sans text-agg-xs leading-agg-4 font-agg-normal text-agg-foreground", children: balanceLabels.networkTooltipDescription }) })
1319
1354
  ] }),
1320
1355
  children: /* @__PURE__ */ jsxs3(
1321
1356
  "button",
1322
1357
  {
1323
1358
  type: "button",
1324
- "aria-label": "Balance by network",
1359
+ "aria-label": balanceLabels.balanceByNetwork,
1325
1360
  className: "agg-balance-trigger flex min-h-[20px] min-w-[20px] items-center gap-1 rounded-[6px] border-0 bg-agg-secondary-hover p-1.5",
1326
1361
  children: [
1327
1362
  (chains.slice(0, 4).length > 0 ? chains.slice(0, 4) : [{ key: "placeholder", label: "", balance: 0, accountCount: 0 }]).map((row) => {
1328
1363
  const iconUrl = chainIconUrl(row.label, row.key);
1364
+ const isPaper = isPaperChain(row);
1329
1365
  return iconUrl ? /* @__PURE__ */ jsx3(
1330
1366
  "span",
1331
1367
  {
@@ -1333,6 +1369,21 @@ var AvailableBalanceCard = ({
1333
1369
  children: /* @__PURE__ */ jsx3("img", { src: iconUrl, alt: row.label, className: "size-full object-contain" })
1334
1370
  },
1335
1371
  `icon-${row.key}`
1372
+ ) : isPaper ? /* @__PURE__ */ jsx3(
1373
+ "span",
1374
+ {
1375
+ className: "relative flex h-4 w-4 shrink-0 items-center justify-center rounded-[4px] bg-agg-secondary text-agg-primary",
1376
+ children: /* @__PURE__ */ jsx3(
1377
+ Icon,
1378
+ {
1379
+ name: "paper-mode",
1380
+ size: "small",
1381
+ className: "h-4 w-4",
1382
+ title: balanceLabels.paperModeNetwork
1383
+ }
1384
+ )
1385
+ },
1386
+ `icon-${row.key}`
1336
1387
  ) : /* @__PURE__ */ jsx3(
1337
1388
  "span",
1338
1389
  {
@@ -1359,7 +1410,7 @@ var AvailableBalanceCard = ({
1359
1410
  AvailableBalanceCard.displayName = "AvailableBalanceCard";
1360
1411
 
1361
1412
  // src/pages/user-profile/components/positions-activity.tsx
1362
- import { optimizedImageUrl as optimizedImageUrl2, useLabels as useLabels4 } from "@agg-build/hooks";
1413
+ import { optimizedImageUrl as optimizedImageUrl2, useLabels as useLabels5 } from "@agg-build/hooks";
1363
1414
  import { Fragment as Fragment4, useEffect as useEffect4, useMemo as useMemo3, useRef as useRef4, useState as useState5 } from "react";
1364
1415
 
1365
1416
  // src/pages/user-profile/user-profile.constants.ts
@@ -1566,18 +1617,31 @@ ConditionalWrapper.displayName = "ConditionalWrapper";
1566
1617
 
1567
1618
  // src/pages/user-profile/components/activity-row.tsx
1568
1619
  import { Fragment as Fragment2, jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
1620
+ var shouldOpenInNewTab = (activity) => {
1621
+ return activity.kind === "redeem" || activity.kind === "deposit" || activity.kind === "withdrawal";
1622
+ };
1569
1623
  var shouldUseNativeLinkNavigation = (event) => {
1570
1624
  return event.metaKey || event.ctrlKey || event.shiftKey || event.altKey || event.button === 1;
1571
1625
  };
1572
- var RowWrapper = ({ className, href, onClick, children }) => {
1626
+ var RowWrapper = ({
1627
+ className,
1628
+ href,
1629
+ target,
1630
+ rel,
1631
+ onClick,
1632
+ children
1633
+ }) => {
1573
1634
  if (href) {
1635
+ const opensInNewTab = target === "_blank";
1574
1636
  return /* @__PURE__ */ jsx4(
1575
1637
  "a",
1576
1638
  {
1577
1639
  href,
1578
1640
  className,
1641
+ target,
1642
+ rel,
1579
1643
  onClick: (event) => {
1580
- if (shouldUseNativeLinkNavigation(event)) return;
1644
+ if (shouldUseNativeLinkNavigation(event) || opensInNewTab) return;
1581
1645
  event.preventDefault();
1582
1646
  onClick();
1583
1647
  },
@@ -1759,141 +1823,152 @@ var TradeOutcomeShares = ({
1759
1823
  var RedeemRow = ({
1760
1824
  activity,
1761
1825
  className,
1826
+ href,
1762
1827
  onClick
1763
1828
  }) => {
1764
1829
  const tone = resolveToneClasses(activity);
1765
1830
  const statusVisual = getStatusVisual(activity);
1766
1831
  const activityStatus = resolveActivityStatus(activity);
1767
1832
  const shouldShowInlineStatus = activityStatus !== "completed";
1768
- return /* @__PURE__ */ jsx4("button", { type: "button", className, onClick, children: /* @__PURE__ */ jsx4(
1769
- ConditionalWrapper,
1833
+ return /* @__PURE__ */ jsx4(
1834
+ RowWrapper,
1770
1835
  {
1771
- condition: !!activity.errorMessage,
1772
- wrapper: (children) => /* @__PURE__ */ jsx4(
1773
- Tooltip,
1774
- {
1775
- size: "medium",
1776
- content: /* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-4", children: [
1777
- /* @__PURE__ */ jsx4(Icon, { name: "info", size: "small", className: "shrink-0 text-agg-error" }),
1778
- /* @__PURE__ */ jsx4("p", { className: "font-agg-sans text-agg-sm font-agg-normal text-left", children: activity.errorMessage })
1779
- ] }),
1780
- sideOffset: 4,
1781
- children
1782
- }
1783
- ),
1784
- children: /* @__PURE__ */ jsxs4(
1785
- "div",
1836
+ className,
1837
+ href,
1838
+ target: href ? "_blank" : void 0,
1839
+ rel: href ? "noopener noreferrer" : void 0,
1840
+ onClick,
1841
+ children: /* @__PURE__ */ jsx4(
1842
+ ConditionalWrapper,
1786
1843
  {
1787
- className: cn(
1788
- "flex w-full flex-col gap-3 text-left transition-colors sm:min-h-16 sm:flex-row sm:items-center",
1789
- "relative z-10"
1790
- ),
1791
- "data-status": activityStatus,
1792
- children: [
1793
- /* @__PURE__ */ jsx4(RedeemTypeCell, { activity, tone }),
1794
- /* @__PURE__ */ jsxs4("div", { className: "flex w-full items-center justify-between sm:hidden", children: [
1795
- /* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-2", children: [
1796
- /* @__PURE__ */ jsx4(
1797
- Icon,
1798
- {
1799
- name: "gift-bonus",
1800
- size: "small",
1801
- className: cn(
1802
- "shrink-0 text-agg-foreground",
1803
- activity.hasError || activity.errorMessage ? "text-agg-error!" : ""
1804
- )
1805
- }
1806
- ),
1807
- /* @__PURE__ */ jsx4(
1808
- "p",
1809
- {
1810
- className: cn(
1811
- "agg-activity-type font-agg-sans text-agg-sm leading-agg-5 font-agg-normal",
1812
- tone.primary,
1813
- activity.hasError || activity.errorMessage ? "text-agg-error!" : ""
1814
- ),
1815
- children: activity.type
1816
- }
1817
- )
1844
+ condition: !!activity.errorMessage,
1845
+ wrapper: (children) => /* @__PURE__ */ jsx4(
1846
+ Tooltip,
1847
+ {
1848
+ size: "medium",
1849
+ content: /* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-4", children: [
1850
+ /* @__PURE__ */ jsx4(Icon, { name: "info", size: "small", className: "shrink-0 text-agg-error" }),
1851
+ /* @__PURE__ */ jsx4("p", { className: "font-agg-sans text-agg-sm font-agg-normal text-left", children: activity.errorMessage })
1818
1852
  ] }),
1819
- /* @__PURE__ */ jsx4(OutcomeBadge, { label: activity.outcomeLabel, tone })
1820
- ] }),
1821
- /* @__PURE__ */ jsxs4("div", { className: "flex w-full items-center justify-between sm:contents", children: [
1822
- /* @__PURE__ */ jsxs4("div", { className: "flex min-w-0 flex-1 items-center gap-3 sm:gap-4", children: [
1823
- /* @__PURE__ */ jsx4("div", { className: "agg-activity-image flex h-10 w-10 shrink-0 items-center justify-center sm:h-15 sm:w-15", children: /* @__PURE__ */ jsx4(
1824
- RemoteImage,
1825
- {
1826
- src: activity.thumbnailSrc,
1827
- alt: "",
1828
- className: "h-full w-full rounded-agg-sm object-cover sm:rounded-agg-lg",
1829
- classNames: { placeholder: "rounded-agg-sm sm:rounded-agg-lg" }
1830
- }
1831
- ) }),
1832
- /* @__PURE__ */ jsxs4("div", { className: "flex min-w-0 flex-1 flex-col justify-center gap-1 sm:gap-2", children: [
1833
- /* @__PURE__ */ jsxs4("div", { className: "flex min-w-0 items-center gap-2", children: [
1853
+ sideOffset: 4,
1854
+ children
1855
+ }
1856
+ ),
1857
+ children: /* @__PURE__ */ jsxs4(
1858
+ "div",
1859
+ {
1860
+ className: cn(
1861
+ "flex w-full flex-col gap-3 text-left transition-colors sm:min-h-16 sm:flex-row sm:items-center",
1862
+ "relative z-10"
1863
+ ),
1864
+ "data-status": activityStatus,
1865
+ children: [
1866
+ /* @__PURE__ */ jsx4(RedeemTypeCell, { activity, tone }),
1867
+ /* @__PURE__ */ jsxs4("div", { className: "flex w-full items-center justify-between sm:hidden", children: [
1868
+ /* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-2", children: [
1834
1869
  /* @__PURE__ */ jsx4(
1835
- "p",
1836
- {
1837
- className: cn(
1838
- "min-w-0 overflow-hidden text-ellipsis whitespace-nowrap font-agg-sans text-agg-sm leading-agg-5 font-agg-bold sm:text-agg-base sm:leading-agg-6",
1839
- tone.primary
1840
- ),
1841
- children: activity.title
1842
- }
1843
- ),
1844
- shouldShowInlineStatus ? statusVisual.spin ? /* @__PURE__ */ jsx4(
1845
- LoadingIcon,
1846
- {
1847
- size: "small",
1848
- className: cn("shrink-0", statusVisual.iconClassName)
1849
- }
1850
- ) : /* @__PURE__ */ jsx4(
1851
1870
  Icon,
1852
1871
  {
1853
- name: statusVisual.icon,
1872
+ name: "gift-bonus",
1854
1873
  size: "small",
1855
- className: cn("shrink-0", statusVisual.iconClassName)
1874
+ className: cn(
1875
+ "shrink-0 text-agg-foreground",
1876
+ activity.hasError || activity.errorMessage ? "text-agg-error!" : ""
1877
+ )
1856
1878
  }
1857
- ) : null
1858
- ] }),
1859
- /* @__PURE__ */ jsxs4("div", { className: "flex min-w-0 items-center gap-2 sm:gap-3", children: [
1860
- /* @__PURE__ */ jsx4("div", { className: "hidden sm:block", children: /* @__PURE__ */ jsx4(OutcomeBadge, { label: activity.outcomeLabel, tone }) }),
1879
+ ),
1861
1880
  /* @__PURE__ */ jsx4(
1862
1881
  "p",
1863
1882
  {
1864
1883
  className: cn(
1865
- "min-w-0 overflow-hidden text-ellipsis whitespace-nowrap font-agg-sans text-agg-sm leading-agg-5 font-agg-normal",
1866
- tone.meta
1884
+ "agg-activity-type font-agg-sans text-agg-sm leading-agg-5 font-agg-normal",
1885
+ tone.primary,
1886
+ activity.hasError || activity.errorMessage ? "text-agg-error!" : ""
1867
1887
  ),
1868
- children: activity.marketTitle
1888
+ children: activity.type
1869
1889
  }
1870
1890
  )
1871
- ] })
1872
- ] })
1873
- ] }),
1874
- /* @__PURE__ */ jsx4(
1875
- AmountTimeStack,
1876
- {
1877
- amountLabel: activity.amountLabel,
1878
- timeLabel: activity.timeLabel,
1879
- tone,
1880
- mobile: true
1881
- }
1882
- )
1883
- ] }),
1884
- /* @__PURE__ */ jsx4(
1885
- AmountTimeStack,
1886
- {
1887
- amountLabel: activity.amountLabel,
1888
- timeLabel: activity.timeLabel,
1889
- tone
1890
- }
1891
- )
1892
- ]
1891
+ ] }),
1892
+ /* @__PURE__ */ jsx4(OutcomeBadge, { label: activity.outcomeLabel, tone })
1893
+ ] }),
1894
+ /* @__PURE__ */ jsxs4("div", { className: "flex w-full items-center justify-between sm:contents", children: [
1895
+ /* @__PURE__ */ jsxs4("div", { className: "flex min-w-0 flex-1 items-center gap-3 sm:gap-4", children: [
1896
+ /* @__PURE__ */ jsx4("div", { className: "agg-activity-image flex h-10 w-10 shrink-0 items-center justify-center sm:h-15 sm:w-15", children: /* @__PURE__ */ jsx4(
1897
+ RemoteImage,
1898
+ {
1899
+ src: activity.thumbnailSrc,
1900
+ alt: "",
1901
+ className: "h-full w-full rounded-agg-sm object-cover sm:rounded-agg-lg",
1902
+ classNames: { placeholder: "rounded-agg-sm sm:rounded-agg-lg" }
1903
+ }
1904
+ ) }),
1905
+ /* @__PURE__ */ jsxs4("div", { className: "flex min-w-0 flex-1 flex-col justify-center gap-1 sm:gap-2", children: [
1906
+ /* @__PURE__ */ jsxs4("div", { className: "flex min-w-0 items-center gap-2", children: [
1907
+ /* @__PURE__ */ jsx4(
1908
+ "p",
1909
+ {
1910
+ className: cn(
1911
+ "min-w-0 overflow-hidden text-ellipsis whitespace-nowrap font-agg-sans text-agg-sm leading-agg-5 font-agg-bold sm:text-agg-base sm:leading-agg-6",
1912
+ tone.primary
1913
+ ),
1914
+ children: activity.title
1915
+ }
1916
+ ),
1917
+ shouldShowInlineStatus ? statusVisual.spin ? /* @__PURE__ */ jsx4(
1918
+ LoadingIcon,
1919
+ {
1920
+ size: "small",
1921
+ className: cn("shrink-0", statusVisual.iconClassName)
1922
+ }
1923
+ ) : /* @__PURE__ */ jsx4(
1924
+ Icon,
1925
+ {
1926
+ name: statusVisual.icon,
1927
+ size: "small",
1928
+ className: cn("shrink-0", statusVisual.iconClassName)
1929
+ }
1930
+ ) : null
1931
+ ] }),
1932
+ /* @__PURE__ */ jsxs4("div", { className: "flex min-w-0 items-center gap-2 sm:gap-3", children: [
1933
+ /* @__PURE__ */ jsx4("div", { className: "hidden sm:block", children: /* @__PURE__ */ jsx4(OutcomeBadge, { label: activity.outcomeLabel, tone }) }),
1934
+ /* @__PURE__ */ jsx4(
1935
+ "p",
1936
+ {
1937
+ className: cn(
1938
+ "min-w-0 overflow-hidden text-ellipsis whitespace-nowrap font-agg-sans text-agg-sm leading-agg-5 font-agg-normal",
1939
+ tone.meta
1940
+ ),
1941
+ children: activity.marketTitle
1942
+ }
1943
+ )
1944
+ ] })
1945
+ ] })
1946
+ ] }),
1947
+ /* @__PURE__ */ jsx4(
1948
+ AmountTimeStack,
1949
+ {
1950
+ amountLabel: activity.amountLabel,
1951
+ timeLabel: activity.timeLabel,
1952
+ tone,
1953
+ mobile: true
1954
+ }
1955
+ )
1956
+ ] }),
1957
+ /* @__PURE__ */ jsx4(
1958
+ AmountTimeStack,
1959
+ {
1960
+ amountLabel: activity.amountLabel,
1961
+ timeLabel: activity.timeLabel,
1962
+ tone
1963
+ }
1964
+ )
1965
+ ]
1966
+ }
1967
+ )
1893
1968
  }
1894
1969
  )
1895
1970
  }
1896
- ) });
1971
+ );
1897
1972
  };
1898
1973
  var TradeRow = ({
1899
1974
  activity,
@@ -1996,124 +2071,135 @@ var TradeRow = ({
1996
2071
  var TransferRow = ({
1997
2072
  activity,
1998
2073
  className,
2074
+ href,
1999
2075
  onClick
2000
2076
  }) => {
2001
2077
  const tone = resolveToneClasses(activity);
2002
2078
  const transferStatus = resolveActivityStatus(activity);
2003
2079
  const transferIconName = TRANSFER_ICON[activity.kind];
2004
2080
  const statusVisual = getStatusVisual(activity);
2005
- return /* @__PURE__ */ jsx4("button", { type: "button", className, onClick, children: /* @__PURE__ */ jsx4(
2006
- ConditionalWrapper,
2081
+ return /* @__PURE__ */ jsx4(
2082
+ RowWrapper,
2007
2083
  {
2008
- condition: !!activity.errorMessage,
2009
- wrapper: (children) => /* @__PURE__ */ jsx4(
2010
- Tooltip,
2011
- {
2012
- size: "medium",
2013
- content: /* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-4", children: [
2014
- /* @__PURE__ */ jsx4(Icon, { name: "info", size: "small", className: "shrink-0 text-agg-error" }),
2015
- /* @__PURE__ */ jsx4("p", { className: "font-agg-sans text-agg-sm font-agg-normal text-left", children: activity.errorMessage })
2016
- ] }),
2017
- sideOffset: 4,
2018
- children
2019
- }
2020
- ),
2021
- children: /* @__PURE__ */ jsxs4(
2022
- "div",
2084
+ className,
2085
+ href,
2086
+ target: href ? "_blank" : void 0,
2087
+ rel: href ? "noopener noreferrer" : void 0,
2088
+ onClick,
2089
+ children: /* @__PURE__ */ jsx4(
2090
+ ConditionalWrapper,
2023
2091
  {
2024
- className: cn(
2025
- "flex w-full flex-col gap-3 text-left transition-colors sm:min-h-16 sm:flex-row sm:items-center",
2026
- "relative z-10"
2092
+ condition: !!activity.errorMessage,
2093
+ wrapper: (children) => /* @__PURE__ */ jsx4(
2094
+ Tooltip,
2095
+ {
2096
+ size: "medium",
2097
+ content: /* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-4", children: [
2098
+ /* @__PURE__ */ jsx4(Icon, { name: "info", size: "small", className: "shrink-0 text-agg-error" }),
2099
+ /* @__PURE__ */ jsx4("p", { className: "font-agg-sans text-agg-sm font-agg-normal text-left", children: activity.errorMessage })
2100
+ ] }),
2101
+ sideOffset: 4,
2102
+ children
2103
+ }
2027
2104
  ),
2028
- children: [
2029
- /* @__PURE__ */ jsx4(TransferTypeCell, { activity, tone }),
2030
- /* @__PURE__ */ jsx4("div", { className: "flex w-full items-center justify-between sm:hidden", children: /* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-2", children: [
2031
- /* @__PURE__ */ jsx4(
2032
- Icon,
2033
- {
2034
- name: transferIconName,
2035
- size: "small",
2036
- className: cn(
2037
- "shrink-0 text-agg-foreground",
2038
- activity.hasError || activity.errorMessage ? "text-agg-error!" : ""
2039
- )
2040
- }
2105
+ children: /* @__PURE__ */ jsxs4(
2106
+ "div",
2107
+ {
2108
+ className: cn(
2109
+ "flex w-full flex-col gap-3 text-left transition-colors sm:min-h-16 sm:flex-row sm:items-center",
2110
+ "relative z-10"
2041
2111
  ),
2042
- /* @__PURE__ */ jsx4(
2043
- "p",
2044
- {
2045
- className: cn(
2046
- "font-agg-sans text-agg-sm leading-agg-5 font-agg-normal",
2047
- tone.primary,
2048
- activity.hasError || activity.errorMessage ? "text-agg-error!" : ""
2049
- ),
2050
- children: activity.type
2051
- }
2052
- )
2053
- ] }) }),
2054
- /* @__PURE__ */ jsxs4("div", { className: "flex w-full items-center justify-between sm:contents", children: [
2055
- /* @__PURE__ */ jsxs4("div", { className: "flex min-w-0 flex-1 items-center gap-3 sm:gap-4", children: [
2056
- /* @__PURE__ */ jsx4(
2057
- "div",
2058
- {
2059
- className: "agg-activity-deposit-square hidden h-15 w-15 shrink-0 items-center justify-center rounded-agg-lg bg-agg-secondary-hover sm:flex",
2060
- "data-status": transferStatus,
2061
- children: statusVisual.spin ? /* @__PURE__ */ jsx4(LoadingIcon, { size: "medium", className: cn(statusVisual.iconClassName) }) : /* @__PURE__ */ jsx4(
2062
- Icon,
2063
- {
2064
- name: statusVisual.icon,
2065
- size: "medium",
2066
- className: cn(statusVisual.iconClassName)
2067
- }
2068
- )
2069
- }
2070
- ),
2071
- /* @__PURE__ */ jsxs4("div", { className: "flex min-w-0 flex-1 flex-col justify-center gap-1", children: [
2112
+ children: [
2113
+ /* @__PURE__ */ jsx4(TransferTypeCell, { activity, tone }),
2114
+ /* @__PURE__ */ jsx4("div", { className: "flex w-full items-center justify-between sm:hidden", children: /* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-2", children: [
2072
2115
  /* @__PURE__ */ jsx4(
2073
- "p",
2116
+ Icon,
2074
2117
  {
2118
+ name: transferIconName,
2119
+ size: "small",
2075
2120
  className: cn(
2076
- "min-w-0 overflow-hidden text-ellipsis whitespace-nowrap font-agg-sans text-agg-sm leading-agg-5 font-agg-bold sm:text-agg-base sm:leading-agg-6",
2077
- tone.primary
2078
- ),
2079
- children: activity.title
2121
+ "shrink-0 text-agg-foreground",
2122
+ activity.hasError || activity.errorMessage ? "text-agg-error!" : ""
2123
+ )
2080
2124
  }
2081
2125
  ),
2082
2126
  /* @__PURE__ */ jsx4(
2083
2127
  "p",
2084
2128
  {
2085
2129
  className: cn(
2086
- "min-w-0 overflow-hidden text-ellipsis whitespace-nowrap font-agg-sans text-agg-sm leading-agg-5 font-agg-normal",
2087
- tone.meta
2130
+ "font-agg-sans text-agg-sm leading-agg-5 font-agg-normal",
2131
+ tone.primary,
2132
+ activity.hasError || activity.errorMessage ? "text-agg-error!" : ""
2088
2133
  ),
2089
- children: activity.subtitleLabel
2134
+ children: activity.type
2090
2135
  }
2091
2136
  )
2092
- ] })
2093
- ] }),
2094
- /* @__PURE__ */ jsx4(
2095
- AmountTimeStack,
2096
- {
2097
- amountLabel: activity.amountLabel,
2098
- timeLabel: activity.timeLabel,
2099
- tone,
2100
- mobile: true
2101
- }
2102
- )
2103
- ] }),
2104
- /* @__PURE__ */ jsx4(
2105
- AmountTimeStack,
2106
- {
2107
- amountLabel: activity.amountLabel,
2108
- timeLabel: activity.timeLabel,
2109
- tone
2110
- }
2111
- )
2112
- ]
2137
+ ] }) }),
2138
+ /* @__PURE__ */ jsxs4("div", { className: "flex w-full items-center justify-between sm:contents", children: [
2139
+ /* @__PURE__ */ jsxs4("div", { className: "flex min-w-0 flex-1 items-center gap-3 sm:gap-4", children: [
2140
+ /* @__PURE__ */ jsx4(
2141
+ "div",
2142
+ {
2143
+ className: "agg-activity-deposit-square hidden h-15 w-15 shrink-0 items-center justify-center rounded-agg-lg bg-agg-secondary-hover sm:flex",
2144
+ "data-status": transferStatus,
2145
+ children: statusVisual.spin ? /* @__PURE__ */ jsx4(LoadingIcon, { size: "medium", className: cn(statusVisual.iconClassName) }) : /* @__PURE__ */ jsx4(
2146
+ Icon,
2147
+ {
2148
+ name: statusVisual.icon,
2149
+ size: "medium",
2150
+ className: cn(statusVisual.iconClassName)
2151
+ }
2152
+ )
2153
+ }
2154
+ ),
2155
+ /* @__PURE__ */ jsxs4("div", { className: "flex min-w-0 flex-1 flex-col justify-center gap-1", children: [
2156
+ /* @__PURE__ */ jsx4(
2157
+ "p",
2158
+ {
2159
+ className: cn(
2160
+ "min-w-0 overflow-hidden text-ellipsis whitespace-nowrap font-agg-sans text-agg-sm leading-agg-5 font-agg-bold sm:text-agg-base sm:leading-agg-6",
2161
+ tone.primary
2162
+ ),
2163
+ children: activity.title
2164
+ }
2165
+ ),
2166
+ /* @__PURE__ */ jsx4(
2167
+ "p",
2168
+ {
2169
+ className: cn(
2170
+ "min-w-0 overflow-hidden text-ellipsis whitespace-nowrap font-agg-sans text-agg-sm leading-agg-5 font-agg-normal",
2171
+ tone.meta
2172
+ ),
2173
+ children: activity.subtitleLabel
2174
+ }
2175
+ )
2176
+ ] })
2177
+ ] }),
2178
+ /* @__PURE__ */ jsx4(
2179
+ AmountTimeStack,
2180
+ {
2181
+ amountLabel: activity.amountLabel,
2182
+ timeLabel: activity.timeLabel,
2183
+ tone,
2184
+ mobile: true
2185
+ }
2186
+ )
2187
+ ] }),
2188
+ /* @__PURE__ */ jsx4(
2189
+ AmountTimeStack,
2190
+ {
2191
+ amountLabel: activity.amountLabel,
2192
+ timeLabel: activity.timeLabel,
2193
+ tone
2194
+ }
2195
+ )
2196
+ ]
2197
+ }
2198
+ )
2113
2199
  }
2114
2200
  )
2115
2201
  }
2116
- ) });
2202
+ );
2117
2203
  };
2118
2204
  var ActivityRow = ({ activity, href, onClick }) => {
2119
2205
  const handleClick = () => {
@@ -2130,9 +2216,25 @@ var ActivityRow = ({ activity, href, onClick }) => {
2130
2216
  return /* @__PURE__ */ jsx4(TradeRow, { activity, className: sharedClassName, href, onClick: handleClick });
2131
2217
  }
2132
2218
  if (activity.kind === "redeem") {
2133
- return /* @__PURE__ */ jsx4(RedeemRow, { activity, className: sharedClassName, onClick: handleClick });
2219
+ return /* @__PURE__ */ jsx4(
2220
+ RedeemRow,
2221
+ {
2222
+ activity,
2223
+ className: sharedClassName,
2224
+ href: shouldOpenInNewTab(activity) ? href : void 0,
2225
+ onClick: handleClick
2226
+ }
2227
+ );
2134
2228
  }
2135
- return /* @__PURE__ */ jsx4(TransferRow, { activity, className: sharedClassName, onClick: handleClick });
2229
+ return /* @__PURE__ */ jsx4(
2230
+ TransferRow,
2231
+ {
2232
+ activity,
2233
+ className: sharedClassName,
2234
+ href: shouldOpenInNewTab(activity) ? href : void 0,
2235
+ onClick: handleClick
2236
+ }
2237
+ );
2136
2238
  };
2137
2239
  ActivityRow.displayName = "ActivityRow";
2138
2240
 
@@ -2158,7 +2260,7 @@ var EmptyState = ({ title, description, className }) => {
2158
2260
  EmptyState.displayName = "EmptyState";
2159
2261
 
2160
2262
  // src/pages/user-profile/components/position-row.tsx
2161
- import { optimizedImageUrl, useLabels as useLabels3 } from "@agg-build/hooks";
2263
+ import { optimizedImageUrl, useLabels as useLabels4 } from "@agg-build/hooks";
2162
2264
  import { Fragment as Fragment3, jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
2163
2265
  var shouldUseNativeLinkNavigation2 = (event) => {
2164
2266
  return event.metaKey || event.ctrlKey || event.shiftKey || event.altKey || event.button === 1;
@@ -2296,7 +2398,7 @@ var PositionRow = ({
2296
2398
  onClaim,
2297
2399
  isClaiming = false
2298
2400
  }) => {
2299
- const labels = useLabels3().userProfile.positions;
2401
+ const labels = useLabels4().userProfile.positions;
2300
2402
  const model = toPositionRowViewModel(position, {
2301
2403
  avgPrefix: labels.avgPrefix,
2302
2404
  nowPrefix: labels.nowPrefix,
@@ -2509,7 +2611,7 @@ var PositionsActivity = ({
2509
2611
  initialPositionFilter = "active",
2510
2612
  className
2511
2613
  }) => {
2512
- const positionsLabels = useLabels4().userProfile.positions;
2614
+ const positionsLabels = useLabels5().userProfile.positions;
2513
2615
  const isTabControlled = tab !== void 0;
2514
2616
  const [internalActiveTab, setInternalActiveTab] = useState5(
2515
2617
  tab != null ? tab : USER_PROFILE_TAB_POSITIONS
@@ -2979,7 +3081,7 @@ var PositionsValueCard = ({
2979
3081
  PositionsValueCard.displayName = "PositionsValueCard";
2980
3082
 
2981
3083
  // src/pages/user-profile/components/user-info-card.tsx
2982
- import { optimizedImageUrl as optimizedImageUrl3, useLabels as useLabels5 } from "@agg-build/hooks";
3084
+ import { optimizedImageUrl as optimizedImageUrl3, useLabels as useLabels6 } from "@agg-build/hooks";
2983
3085
 
2984
3086
  // src/pages/user-profile/components/default-avatar.tsx
2985
3087
  import { jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
@@ -3038,7 +3140,7 @@ var UserInfoCard = ({
3038
3140
  className
3039
3141
  }) => {
3040
3142
  var _a;
3041
- const labels = useLabels5();
3143
+ const labels = useLabels6();
3042
3144
  const wallets = (_a = user.connectedWallets) != null ? _a : [];
3043
3145
  const hasWallets = wallets.length > 0;
3044
3146
  return /* @__PURE__ */ jsxs10(
@@ -3171,6 +3273,27 @@ var UserInfoCard = ({
3171
3273
  };
3172
3274
  UserInfoCard.displayName = "UserInfoCard";
3173
3275
 
3276
+ // src/pages/user-profile/transaction-explorer.ts
3277
+ var AGG_TX_EXPLORER_URLS = {
3278
+ "1": "https://etherscan.io/tx/",
3279
+ "56": "https://bscscan.com/tx/",
3280
+ "137": "https://polygonscan.com/tx/",
3281
+ "1337": "https://app.hyperliquid.xyz/explorer/tx/",
3282
+ "8453": "https://basescan.org/tx/",
3283
+ "42161": "https://arbiscan.io/tx/",
3284
+ "792703809": "https://solscan.io/tx/"
3285
+ };
3286
+ var buildAggTxExplorerHref = (chainId, txHash) => {
3287
+ if (chainId === null || chainId === void 0) return void 0;
3288
+ if (!txHash) return void 0;
3289
+ const normalizedChainId = String(chainId).trim();
3290
+ const normalizedTxHash = txHash.trim();
3291
+ if (!normalizedChainId || !normalizedTxHash) return void 0;
3292
+ const baseUrl = AGG_TX_EXPLORER_URLS[normalizedChainId];
3293
+ if (!baseUrl) return void 0;
3294
+ return `${baseUrl}${normalizedTxHash}`;
3295
+ };
3296
+
3174
3297
  // src/pages/user-profile/index.tsx
3175
3298
  import { jsx as jsx11, jsxs as jsxs11 } from "react/jsx-runtime";
3176
3299
  var currencyFormatter = new Intl.NumberFormat("en-US", {
@@ -3210,7 +3333,11 @@ var TOKEN_DECIMALS_BY_SYMBOL = {
3210
3333
  var TOKEN_DECIMALS_BY_CHAIN_AND_SYMBOL = {
3211
3334
  "56": {
3212
3335
  USDC: 18,
3213
- USDT: 18
3336
+ USDT: 18,
3337
+ // USD1 (World Liberty Financial) is the Myriad settlement token on BNB and
3338
+ // is 18-dec like the other BNB stables. Without this it falls back to 6-dec
3339
+ // and renders an 18-dec amount inflated by ~10^12 (e.g. $3.90 → trillions).
3340
+ USD1: 18
3214
3341
  }
3215
3342
  };
3216
3343
  var parseRawMicroValue = (value) => {
@@ -3537,7 +3664,7 @@ var UserProfilePage = ({
3537
3664
  activePositions,
3538
3665
  closedPositions,
3539
3666
  activities,
3540
- executionMode = "live",
3667
+ executionMode,
3541
3668
  onEditProfile,
3542
3669
  onDeposit,
3543
3670
  onWithdraw,
@@ -3586,7 +3713,10 @@ var UserProfilePage = ({
3586
3713
  const { isDepositBlocked } = useGeoBlock();
3587
3714
  const balanceState = useAggBalance();
3588
3715
  const client = useAggClient();
3589
- const labels = useLabels6();
3716
+ const labels = useLabels7();
3717
+ const {
3718
+ trading: { executionMode: configuredExecutionMode }
3719
+ } = useSdkUiConfig3();
3590
3720
  const claimNotificationLabels = labels.notifications.claim;
3591
3721
  const toastCtx = useOptionalToast();
3592
3722
  const queryClient = useQueryClient();
@@ -3619,7 +3749,8 @@ var UserProfilePage = ({
3619
3749
  return [...new Set(fromBalance)].sort((a, b) => a.localeCompare(b));
3620
3750
  }, [balanceState, shouldUseHookData]);
3621
3751
  const [positionFilter, setPositionFilter] = useState6(initialPositionFilter);
3622
- const queryExecutionMode = executionMode === "paper" ? "paper" : void 0;
3752
+ const resolvedExecutionMode = executionMode != null ? executionMode : configuredExecutionMode;
3753
+ const queryExecutionMode = resolvedExecutionMode === "paper" ? "paper" : void 0;
3623
3754
  const activePositionsQuery = useExecutionPositions({
3624
3755
  enabled: shouldUseHookData && isAuthenticated,
3625
3756
  status: "active",
@@ -3951,7 +4082,7 @@ var UserProfilePage = ({
3951
4082
  if (activities) return activities.filter(isVisibleUserProfileActivity);
3952
4083
  const formatTime = isHydrated ? toRelativeTimeLabel : toAbsoluteTimeLabel;
3953
4084
  return activityQuery.activities.filter(isVisibleActivityItem).map((item, index) => {
3954
- 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;
4085
+ 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;
3955
4086
  const timeLabel = formatTime(getRuntimeActivityCreatedAt(item));
3956
4087
  if (item.type === "trade") {
3957
4088
  const tradeItem = item;
@@ -4006,13 +4137,15 @@ var UserProfilePage = ({
4006
4137
  return {
4007
4138
  kind: "withdrawal",
4008
4139
  id: withdrawalItem.id,
4140
+ chainId: (_p = withdrawalItem.chainId) != null ? _p : void 0,
4141
+ txHash: (_q = withdrawalItem.txHash) != null ? _q : void 0,
4009
4142
  isFailed,
4010
4143
  hasError,
4011
4144
  errorMessage,
4012
4145
  status,
4013
4146
  type: labels.userProfile.activity.withdrawalType,
4014
4147
  title: titleByStatus[status],
4015
- subtitleLabel: `to ${(_p = shortenAddress(withdrawalItem.destinationAddress)) != null ? _p : withdrawalItem.destinationAddress} \xB7 ${formatChainIdLabel(withdrawalItem.destinationChainId)}`,
4148
+ subtitleLabel: `to ${(_r = shortenAddress(withdrawalItem.destinationAddress)) != null ? _r : withdrawalItem.destinationAddress} \xB7 ${formatChainIdLabel(withdrawalItem.destinationChainId)}`,
4016
4149
  amountLabel,
4017
4150
  timeLabel
4018
4151
  };
@@ -4022,7 +4155,7 @@ var UserProfilePage = ({
4022
4155
  const normalizedStatus = normalizeDepositStatus(depositItem.status);
4023
4156
  const timedOut = normalizedStatus === "pending" && isPendingTransferTimedOut(depositItem.createdAt);
4024
4157
  const status = timedOut ? "failed" : normalizedStatus;
4025
- const errorMessage = timedOut ? PENDING_TRANSFER_TIMEOUT_ERROR_MESSAGE : (_q = getActivityErrorMessage(depositItem)) != null ? _q : void 0;
4158
+ const errorMessage = timedOut ? PENDING_TRANSFER_TIMEOUT_ERROR_MESSAGE : (_s = getActivityErrorMessage(depositItem)) != null ? _s : void 0;
4026
4159
  const isFailed = status === "failed";
4027
4160
  const hasError = timedOut || hasActivityError(depositItem);
4028
4161
  const depositSource = depositItem.source;
@@ -4039,17 +4172,18 @@ var UserProfilePage = ({
4039
4172
  return {
4040
4173
  kind: "deposit",
4041
4174
  id: depositItem.id,
4175
+ chainId: depositItem.chainId,
4176
+ txHash: depositItem.txHash,
4042
4177
  isFailed,
4043
4178
  hasError,
4044
4179
  errorMessage,
4045
4180
  status,
4046
4181
  type: labels.userProfile.activity.depositType,
4047
4182
  title: depositTitlesBySource[depositSource][status],
4048
- subtitleLabel: `from ${(_r = shortenAddress(depositItem.fromAddress)) != null ? _r : depositItem.fromAddress} \xB7 ${formatChainIdLabel(depositItem.chainId)}`,
4183
+ subtitleLabel: `from ${(_t = shortenAddress(depositItem.fromAddress)) != null ? _t : depositItem.fromAddress} \xB7 ${formatChainIdLabel(depositItem.chainId)}`,
4049
4184
  amountLabel,
4050
4185
  timeLabel,
4051
- depositSource: depositSource === "connected_wallet" ? "wallet" : "crypto",
4052
- chainId: depositItem.chainId
4186
+ depositSource: depositSource === "connected_wallet" ? "wallet" : "crypto"
4053
4187
  };
4054
4188
  }
4055
4189
  if (item.type === "redeem") {
@@ -4057,23 +4191,25 @@ var UserProfilePage = ({
4057
4191
  const redeemLegs = Array.isArray(redeemItem.legs) ? redeemItem.legs : [];
4058
4192
  const firstLeg = redeemLegs[0];
4059
4193
  const status = getDerivedRedeemStatus(redeemItem);
4060
- const firstLegErrorMessage = (_t = (_s = redeemLegs.find((leg) => typeof leg.errorMessage === "string" && leg.errorMessage)) == null ? void 0 : _s.errorMessage) != null ? _t : void 0;
4061
- const errorMessage = (_u = getActivityErrorMessage(redeemItem)) != null ? _u : firstLegErrorMessage;
4194
+ const firstLegErrorMessage = (_v = (_u = redeemLegs.find((leg) => typeof leg.errorMessage === "string" && leg.errorMessage)) == null ? void 0 : _u.errorMessage) != null ? _v : void 0;
4195
+ const errorMessage = (_w = getActivityErrorMessage(redeemItem)) != null ? _w : firstLegErrorMessage;
4062
4196
  const isFailed = status === "failed";
4063
4197
  const hasError = isFailed || !!(errorMessage == null ? void 0 : errorMessage.trim());
4064
4198
  const titleByStatus = labels.userProfile.activity.redeemStatusTitles;
4065
4199
  return {
4066
4200
  kind: "redeem",
4067
4201
  id: redeemItem.id,
4202
+ chainId: (_x = firstLeg == null ? void 0 : firstLeg.chainId) != null ? _x : void 0,
4203
+ txHash: (_y = firstLeg == null ? void 0 : firstLeg.txHash) != null ? _y : void 0,
4068
4204
  isFailed,
4069
4205
  hasError,
4070
4206
  errorMessage: errorMessage != null ? errorMessage : void 0,
4071
4207
  status,
4072
4208
  type: labels.userProfile.activity.redeemType,
4073
4209
  title: titleByStatus[status],
4074
- thumbnailSrc: (_w = (_v = firstLeg == null ? void 0 : firstLeg.venueMarket) == null ? void 0 : _v.image) != null ? _w : fallbackThumbnailSrc,
4075
- marketTitle: (_y = (_x = firstLeg == null ? void 0 : firstLeg.venueMarket) == null ? void 0 : _x.question) != null ? _y : "Market",
4076
- outcomeLabel: (_C = (_B = (_z = firstLeg == null ? void 0 : firstLeg.venueMarketOutcome) == null ? void 0 : _z.title) != null ? _B : (_A = firstLeg == null ? void 0 : firstLeg.venueMarketOutcome) == null ? void 0 : _A.label) != null ? _C : "",
4210
+ thumbnailSrc: (_A = (_z = firstLeg == null ? void 0 : firstLeg.venueMarket) == null ? void 0 : _z.image) != null ? _A : fallbackThumbnailSrc,
4211
+ marketTitle: (_C = (_B = firstLeg == null ? void 0 : firstLeg.venueMarket) == null ? void 0 : _B.question) != null ? _C : "Market",
4212
+ outcomeLabel: (_G = (_F = (_D = firstLeg == null ? void 0 : firstLeg.venueMarketOutcome) == null ? void 0 : _D.title) != null ? _F : (_E = firstLeg == null ? void 0 : firstLeg.venueMarketOutcome) == null ? void 0 : _E.label) != null ? _G : "",
4077
4213
  amountLabel: status === "failed" || status === "canceled" ? ZERO_AMOUNT_LABEL : toRedeemPayoutAmountLabel(redeemItem),
4078
4214
  timeLabel
4079
4215
  };
@@ -4325,5 +4461,6 @@ export {
4325
4461
  USER_PROFILE_TAB_POSITIONS,
4326
4462
  USER_PROFILE_TAB_OPEN_ORDERS,
4327
4463
  USER_PROFILE_TAB_ACTIVITY,
4464
+ buildAggTxExplorerHref,
4328
4465
  UserProfilePage
4329
4466
  };