@rhinestone/deposit-modal 0.6.1 → 0.8.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.
Files changed (44) hide show
  1. package/dist/{DepositModalReown-ICBGUVAA.cjs → DepositModalReown-J5YFZKFS.cjs} +9 -9
  2. package/dist/{DepositModalReown-IVRDXQAA.mjs → DepositModalReown-RZ6VSMKP.mjs} +6 -6
  3. package/dist/{WithdrawModalReown-O7PR343Z.mjs → WithdrawModalReown-4YUV2WWV.mjs} +5 -5
  4. package/dist/{WithdrawModalReown-6XWURPFZ.cjs → WithdrawModalReown-B6BGY52S.cjs} +8 -8
  5. package/dist/caip-C_ZYFIGa.d.cts +77 -0
  6. package/dist/caip-C_ZYFIGa.d.ts +77 -0
  7. package/dist/{chunk-NRNJAQUA.cjs → chunk-4IOQIWDY.cjs} +4 -4
  8. package/dist/{chunk-TCLBFO3S.mjs → chunk-5S5BQ2GM.mjs} +304 -115
  9. package/dist/{chunk-N73D3WN4.mjs → chunk-7JJ4EFDY.mjs} +13 -17
  10. package/dist/{chunk-VPWWFWZT.cjs → chunk-IRI34U6N.cjs} +331 -117
  11. package/dist/{chunk-SITLCMTI.cjs → chunk-JRFPKFL6.cjs} +102 -106
  12. package/dist/{chunk-7Q26RR6J.mjs → chunk-LXTAAHPC.mjs} +6 -4
  13. package/dist/{chunk-ABVRVW3P.cjs → chunk-PUMTR35E.cjs} +85 -31
  14. package/dist/{chunk-GBOCV2LQ.mjs → chunk-RXWJ267K.mjs} +366 -152
  15. package/dist/{chunk-WJX3TJFK.mjs → chunk-SX52FXKH.mjs} +84 -30
  16. package/dist/{chunk-F7P4MV72.mjs → chunk-TYB6AA6D.mjs} +1 -1
  17. package/dist/{chunk-VVKJRGX3.cjs → chunk-VURI4G2Z.cjs} +10 -8
  18. package/dist/{chunk-UEKPBRBY.cjs → chunk-WL7AXYQ4.cjs} +3 -3
  19. package/dist/{chunk-IZPUHIIN.cjs → chunk-XLXJW44N.cjs} +743 -554
  20. package/dist/{chunk-FJWLC4AM.mjs → chunk-YLIPI3NU.mjs} +1 -1
  21. package/dist/constants.cjs +4 -2
  22. package/dist/constants.d.cts +1 -1
  23. package/dist/constants.d.ts +1 -1
  24. package/dist/constants.mjs +5 -3
  25. package/dist/deposit.cjs +6 -6
  26. package/dist/deposit.d.cts +2 -2
  27. package/dist/deposit.d.ts +2 -2
  28. package/dist/deposit.mjs +5 -5
  29. package/dist/index.cjs +11 -7
  30. package/dist/index.d.cts +2 -2
  31. package/dist/index.d.ts +2 -2
  32. package/dist/index.mjs +12 -8
  33. package/dist/polymarket.cjs +6 -6
  34. package/dist/polymarket.mjs +3 -3
  35. package/dist/styles.css +86 -12
  36. package/dist/{types-6ROxwyfG.d.cts → types--LQWg_4W.d.cts} +1 -1
  37. package/dist/{types-6ROxwyfG.d.ts → types--LQWg_4W.d.ts} +1 -1
  38. package/dist/withdraw.cjs +5 -5
  39. package/dist/withdraw.d.cts +2 -2
  40. package/dist/withdraw.d.ts +2 -2
  41. package/dist/withdraw.mjs +4 -4
  42. package/package.json +1 -1
  43. package/dist/caip-CsslyHGL.d.cts +0 -62
  44. package/dist/caip-CsslyHGL.d.ts +0 -62
@@ -7,7 +7,7 @@ import {
7
7
  executePolymarketSafeTransfer,
8
8
  fetchPolymarketProxyWallet,
9
9
  readPolymarketBalances
10
- } from "./chunk-FJWLC4AM.mjs";
10
+ } from "./chunk-YLIPI3NU.mjs";
11
11
  import {
12
12
  AlertTriangleIcon,
13
13
  ArrowUpRightIcon,
@@ -33,6 +33,7 @@ import {
33
33
  ProcessingStep,
34
34
  RpcUrlsProvider,
35
35
  Spinner,
36
+ TokenIcon,
36
37
  Tooltip,
37
38
  TransferCryptoIcon,
38
39
  UnplugIcon,
@@ -68,10 +69,10 @@ import {
68
69
  useLatestRef,
69
70
  useRpcUrls,
70
71
  useStableRpcUrls
71
- } from "./chunk-GBOCV2LQ.mjs";
72
+ } from "./chunk-RXWJ267K.mjs";
72
73
  import {
73
74
  SAFE_ABI
74
- } from "./chunk-F7P4MV72.mjs";
75
+ } from "./chunk-TYB6AA6D.mjs";
75
76
  import {
76
77
  DEFAULT_BACKEND_URL,
77
78
  DEFAULT_SIGNER_ADDRESS,
@@ -87,21 +88,23 @@ import {
87
88
  getChainName,
88
89
  getExplorerTxUrl,
89
90
  getExplorerUrl,
91
+ getNativeSymbol,
90
92
  getSupportedChainIds,
91
93
  getTargetTokenSymbol,
92
94
  getTargetTokenSymbolsForChain,
93
95
  getTokenAddress,
94
96
  getTokenDecimalsByAddress,
95
- getTokenIcon,
96
97
  getTokenSymbol,
97
98
  isContractBytecode,
99
+ isHyperCoreCaip2,
98
100
  isNativeSol,
99
101
  isSolanaCaip2,
100
102
  isStablecoinSymbol,
103
+ isSupportedTokenAddressForChain,
101
104
  isVirtualDestination,
102
105
  parseEvmChainId,
103
106
  targetChainToCaip2
104
- } from "./chunk-WJX3TJFK.mjs";
107
+ } from "./chunk-SX52FXKH.mjs";
105
108
 
106
109
  // src/DepositModal.tsx
107
110
  import {
@@ -204,12 +207,6 @@ function AssetSelectStep({
204
207
  active = false;
205
208
  };
206
209
  }, [address, publicClient, service, onTotalBalanceComputedRef]);
207
- useEffect(() => {
208
- if (!defaultAssetId || selectedAssetId) return;
209
- if (assets.some((asset) => asset.id === defaultAssetId)) {
210
- setSelectedAssetId(defaultAssetId);
211
- }
212
- }, [assets, defaultAssetId, selectedAssetId]);
213
210
  const allowedChainSet = useMemo(
214
211
  () => allowedRoutes?.sourceChains ? new Set(allowedRoutes.sourceChains) : null,
215
212
  [allowedRoutes?.sourceChains]
@@ -226,7 +223,12 @@ function AssetSelectStep({
226
223
  return false;
227
224
  }
228
225
  if (allowedChainSet && !allowedChainSet.has(a.chainId)) return false;
229
- if (allowedTokenSet && !allowedTokenSet.has(a.symbol.toUpperCase()))
226
+ if (allowedTokenSet) {
227
+ if (!allowedTokenSet.has(a.symbol.toUpperCase())) return false;
228
+ if (!isSupportedTokenAddressForChain(a.token, a.chainId)) return false;
229
+ }
230
+ const isNativeToken = a.token.toLowerCase() === NATIVE_TOKEN_ADDRESS;
231
+ if (!isNativeToken && !(typeof a.balanceUsd === "number" && a.balanceUsd >= 0.01))
230
232
  return false;
231
233
  return true;
232
234
  }).sort((a, b) => {
@@ -240,7 +242,13 @@ function AssetSelectStep({
240
242
  return 0;
241
243
  });
242
244
  }, [assets, allowedChainSet, allowedTokenSet]);
243
- const selectedAsset = selectedAssetId && assets.find((asset) => asset.id === selectedAssetId);
245
+ useEffect(() => {
246
+ if (!defaultAssetId || selectedAssetId) return;
247
+ if (rows.some((asset) => asset.id === defaultAssetId)) {
248
+ setSelectedAssetId(defaultAssetId);
249
+ }
250
+ }, [rows, defaultAssetId, selectedAssetId]);
251
+ const selectedAsset = selectedAssetId && rows.find((asset) => asset.id === selectedAssetId);
244
252
  const formatBalance = (asset) => {
245
253
  if (!asset.balance) return "--";
246
254
  try {
@@ -289,7 +297,6 @@ function AssetSelectStep({
289
297
  const isSelected = selectedAssetId === asset.id;
290
298
  const tokenAmount = formatBalance(asset);
291
299
  const badge = getChainBadge(asset.chainId);
292
- const tokenIcon = getTokenIcon(asset.symbol);
293
300
  const chainIcon = getChainIcon(asset.chainId);
294
301
  return /* @__PURE__ */ jsxs(
295
302
  "button",
@@ -301,7 +308,13 @@ function AssetSelectStep({
301
308
  children: [
302
309
  /* @__PURE__ */ jsxs("div", { className: "rs-asset-info", children: [
303
310
  /* @__PURE__ */ jsxs("div", { className: "rs-asset-icon-wrapper", children: [
304
- tokenIcon ? /* @__PURE__ */ jsx("span", { className: "rs-asset-icon", children: /* @__PURE__ */ jsx("img", { src: tokenIcon, alt: asset.symbol }) }) : /* @__PURE__ */ jsx("span", { className: "rs-asset-icon", children: asset.symbol.slice(0, 4) }),
311
+ /* @__PURE__ */ jsx("span", { className: "rs-asset-icon", children: /* @__PURE__ */ jsx(
312
+ TokenIcon,
313
+ {
314
+ symbol: asset.symbol,
315
+ fallback: asset.symbol.slice(0, 4)
316
+ }
317
+ ) }),
305
318
  chainIcon ? /* @__PURE__ */ jsx("span", { className: "rs-asset-chain-badge", children: /* @__PURE__ */ jsx(
306
319
  "img",
307
320
  {
@@ -366,13 +379,14 @@ async function fetchNativeAssets(address, publicClient, existing) {
366
379
  if (existingIds.has(id)) return [];
367
380
  try {
368
381
  const balance = await publicClient.getBalance({ address });
382
+ const nativeSymbol = getNativeSymbol(connectedChainId);
369
383
  return [
370
384
  {
371
385
  id,
372
386
  chainId: connectedChainId,
373
387
  token: NATIVE_TOKEN_ADDRESS,
374
- symbol: "ETH",
375
- name: "Ethereum",
388
+ symbol: nativeSymbol,
389
+ name: nativeSymbol,
376
390
  decimals: 18,
377
391
  balance: balance.toString()
378
392
  }
@@ -747,8 +761,6 @@ function AmountStep({
747
761
  const continueDisabled = chainMismatch || isCheckingLiquidity || exceedsBalance || numericAmount === 0 && !isBelowMin || balance === null;
748
762
  const sourceChainName = getChainName(asset.chainId);
749
763
  const targetChainName = getChainName(targetChain);
750
- const sourceTokenIcon = getTokenIcon(asset.symbol);
751
- const targetTokenIcon = getTokenIcon(targetSymbol);
752
764
  return /* @__PURE__ */ jsxs3("div", { className: "rs-screen", children: [
753
765
  /* @__PURE__ */ jsxs3("div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
754
766
  /* @__PURE__ */ jsx3(BodyHeader, { icon: /* @__PURE__ */ jsx3(WalletIcon, {}), title: "Wallet deposit" }),
@@ -802,7 +814,7 @@ function AmountStep({
802
814
  " ",
803
815
  asset.symbol
804
816
  ] }),
805
- sourceTokenIcon && /* @__PURE__ */ jsx3("span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ jsx3("img", { src: sourceTokenIcon, alt: "" }) })
817
+ /* @__PURE__ */ jsx3("span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ jsx3(TokenIcon, { symbol: asset.symbol }) })
806
818
  ] })
807
819
  ] }),
808
820
  /* @__PURE__ */ jsxs3("div", { className: "rs-amount-detail-row", children: [
@@ -813,7 +825,7 @@ function AmountStep({
813
825
  " ",
814
826
  targetSymbol
815
827
  ] }),
816
- targetTokenIcon && /* @__PURE__ */ jsx3("span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ jsx3("img", { src: targetTokenIcon, alt: "" }) })
828
+ /* @__PURE__ */ jsx3("span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ jsx3(TokenIcon, { symbol: targetSymbol }) })
817
829
  ] })
818
830
  ] }),
819
831
  balanceAfterUsd !== null && /* @__PURE__ */ jsxs3("div", { className: "rs-amount-detail-row", children: [
@@ -880,8 +892,6 @@ function ConfirmStep({
880
892
  const targetChainName = getChainName(targetChain);
881
893
  const sourceChainIcon = getChainIcon(asset.chainId);
882
894
  const targetChainIcon = getChainIcon(targetChain);
883
- const sourceTokenIcon = getTokenIcon(asset.symbol);
884
- const targetTokenIcon = getTokenIcon(targetSymbol);
885
895
  const formattedSendAmount = amount && Number.isFinite(Number(amount)) ? formatTokenAmount(Number(amount), asset.symbol) ?? "0" : "0";
886
896
  const receiveDisplay = (() => {
887
897
  if (sameRoute) return `${formattedSendAmount} ${asset.symbol}`;
@@ -1008,7 +1018,13 @@ function ConfirmStep({
1008
1018
  });
1009
1019
  }
1010
1020
  onDepositSubmitted?.(hash, asset.chainId, amountUnits.toString());
1011
- onConfirm(hash, asset.chainId, amountUnits.toString(), resolvedSourceToken);
1021
+ onConfirm(
1022
+ hash,
1023
+ asset.chainId,
1024
+ amountUnits.toString(),
1025
+ resolvedSourceToken,
1026
+ quote?.fees?.breakdown
1027
+ );
1012
1028
  } catch (err) {
1013
1029
  const raw = err instanceof Error ? err.message : "Transfer failed";
1014
1030
  const message = formatUserError(raw);
@@ -1048,14 +1064,14 @@ function ConfirmStep({
1048
1064
  " ",
1049
1065
  asset.symbol
1050
1066
  ] }),
1051
- sourceTokenIcon && /* @__PURE__ */ jsx4("span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ jsx4("img", { src: sourceTokenIcon, alt: "" }) })
1067
+ /* @__PURE__ */ jsx4("span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ jsx4(TokenIcon, { symbol: asset.symbol }) })
1052
1068
  ] })
1053
1069
  ] }),
1054
1070
  /* @__PURE__ */ jsxs4("div", { className: "rs-review-detail-row", children: [
1055
1071
  /* @__PURE__ */ jsx4("span", { children: "Receive" }),
1056
1072
  /* @__PURE__ */ jsxs4("span", { className: "rs-review-detail-value", children: [
1057
1073
  /* @__PURE__ */ jsx4("span", { children: receiveDisplay }),
1058
- targetTokenIcon && /* @__PURE__ */ jsx4("span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ jsx4("img", { src: targetTokenIcon, alt: "" }) })
1074
+ /* @__PURE__ */ jsx4("span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ jsx4(TokenIcon, { symbol: targetSymbol }) })
1059
1075
  ] })
1060
1076
  ] }),
1061
1077
  /* @__PURE__ */ jsxs4("div", { className: "rs-review-detail-row", children: [
@@ -1442,6 +1458,7 @@ function asNumber(value) {
1442
1458
  function asChainId(value) {
1443
1459
  if (typeof value === "string") {
1444
1460
  if (value.startsWith("solana")) return "solana";
1461
+ if (value.startsWith("hypercore")) return "hypercore";
1445
1462
  const eip155Match = value.match(/^eip155:(\d+)$/);
1446
1463
  if (eip155Match) return Number(eip155Match[1]);
1447
1464
  }
@@ -1502,14 +1519,36 @@ function getDepositEventDetails(event) {
1502
1519
  function isSameRoute(sourceChain, sourceToken, targetChain, targetToken) {
1503
1520
  return sourceChain === targetChain && sourceToken.toLowerCase() === targetToken.toLowerCase();
1504
1521
  }
1505
- function computeTokensForChain(chainId, allowedTokenSet) {
1506
- const all = chainId === "solana" ? SOLANA_TOKENS.map((t) => t.symbol) : getTargetTokenSymbolsForChain(chainId);
1522
+ function chainLabel(chainId) {
1523
+ return getChainName(chainId).replace(/\s+(One|Mainnet|Smart Chain)$/i, "");
1524
+ }
1525
+ function computeTokensForChain(chainId, allowedTokenSet, topTokens) {
1526
+ const fromBackend = topTokens?.[String(chainId)]?.map((t) => t.symbol);
1527
+ const all = fromBackend ?? (chainId === "solana" ? SOLANA_TOKENS.map((t) => t.symbol) : (
1528
+ // HyperCore accepts USDC + USDT0 as origin tokens (native Hyperliquid L1
1529
+ // spot transfers); it has no EVM source-chain matrix entry.
1530
+ chainId === "hypercore" ? ["USDC", "USDT0"] : getTargetTokenSymbolsForChain(chainId)
1531
+ ));
1507
1532
  return allowedTokenSet ? all.filter((s) => allowedTokenSet.has(s.toUpperCase())) : all;
1508
1533
  }
1534
+ function resolveSourceTokenAddress(symbol, chainId, topTokens) {
1535
+ const top = topTokens?.[String(chainId)]?.find((t) => t.symbol === symbol);
1536
+ return top?.address ?? getTokenAddress(symbol, chainId);
1537
+ }
1538
+ function TokenGlyph({ symbol }) {
1539
+ return /* @__PURE__ */ jsx6(
1540
+ TokenIcon,
1541
+ {
1542
+ symbol,
1543
+ className: "rs-deposit-address-dropdown-icon",
1544
+ fallback: /* @__PURE__ */ jsx6("span", { className: "rs-deposit-address-dropdown-icon rs-deposit-address-dropdown-icon--fallback", children: symbol.slice(0, 3) })
1545
+ }
1546
+ );
1547
+ }
1509
1548
  function pickFallbackToken(tokens, current) {
1510
1549
  if (tokens.includes(current)) return current;
1511
1550
  if (tokens.includes("USDC")) return "USDC";
1512
- return tokens[0] ?? "USDC";
1551
+ return tokens[0] ?? "";
1513
1552
  }
1514
1553
  function DepositAddressStep({
1515
1554
  smartAccount,
@@ -1539,21 +1578,45 @@ function DepositAddressStep({
1539
1578
  return allowedChainSet ? all.filter((id) => allowedChainSet.has(id)) : all;
1540
1579
  }, [allowedChainSet]);
1541
1580
  const chainOptions = useMemo3(() => {
1542
- if (!hasSolana) return evmChainIds;
1543
1581
  const options = [...evmChainIds];
1544
- options.splice(1, 0, "solana");
1582
+ const extras = [];
1583
+ if (hasSolana) extras.push("solana");
1584
+ if (!allowedChainSet || allowedChainSet.has(HYPERCORE_CHAIN_ID)) {
1585
+ extras.push("hypercore");
1586
+ }
1587
+ options.splice(1, 0, ...extras);
1545
1588
  return options;
1546
- }, [evmChainIds, hasSolana]);
1589
+ }, [evmChainIds, hasSolana, allowedChainSet]);
1547
1590
  const BASE_CHAIN_ID2 = 8453;
1548
- const defaultChainId = evmChainIds.includes(BASE_CHAIN_ID2) ? BASE_CHAIN_ID2 : evmChainIds[0];
1591
+ const chainHasAllowedToken = (id) => !allowedTokenSet || getTargetTokenSymbolsForChain(id).some(
1592
+ (s) => allowedTokenSet.has(s.toUpperCase())
1593
+ );
1594
+ const evmDefault = evmChainIds.includes(BASE_CHAIN_ID2) && chainHasAllowedToken(BASE_CHAIN_ID2) ? BASE_CHAIN_ID2 : evmChainIds.find(chainHasAllowedToken) ?? evmChainIds[0];
1595
+ const defaultChainId = evmDefault ?? chainOptions[0];
1549
1596
  const [sourceChainId, setSourceChainId] = useState5(defaultChainId);
1550
1597
  const isSolana = sourceChainId === "solana";
1598
+ const isHyperCore = sourceChainId === "hypercore";
1599
+ const [topTokens, setTopTokens] = useState5(null);
1600
+ useEffect5(() => {
1601
+ let active = true;
1602
+ service.getTopTokens().then((t) => {
1603
+ if (active) setTopTokens(t);
1604
+ });
1605
+ return () => {
1606
+ active = false;
1607
+ };
1608
+ }, [service]);
1551
1609
  const tokensForChain = useMemo3(
1552
- () => computeTokensForChain(sourceChainId, allowedTokenSet),
1553
- [sourceChainId, allowedTokenSet]
1610
+ () => computeTokensForChain(sourceChainId, allowedTokenSet, topTokens),
1611
+ [sourceChainId, allowedTokenSet, topTokens]
1554
1612
  );
1555
1613
  const defaultToken = pickFallbackToken(tokensForChain, "USDC");
1556
1614
  const [sourceTokenSymbol, setSourceTokenSymbol] = useState5(defaultToken);
1615
+ useEffect5(() => {
1616
+ if (!tokensForChain.includes(sourceTokenSymbol)) {
1617
+ setSourceTokenSymbol(pickFallbackToken(tokensForChain, sourceTokenSymbol));
1618
+ }
1619
+ }, [tokensForChain, sourceTokenSymbol]);
1557
1620
  const [copied, setCopied] = useState5(false);
1558
1621
  const [pollingError, setPollingError] = useState5(null);
1559
1622
  const [chainDropdownOpen, setChainDropdownOpen] = useState5(false);
@@ -1569,13 +1632,14 @@ function DepositAddressStep({
1569
1632
  kind: "idle"
1570
1633
  });
1571
1634
  useEffect5(() => {
1572
- if (isSolana) {
1635
+ if (isSolana || isHyperCore) {
1573
1636
  setLiquidityHelper({ kind: "idle" });
1574
1637
  return;
1575
1638
  }
1576
- const sourceTokenAddress = getTokenAddress(
1639
+ const sourceTokenAddress = resolveSourceTokenAddress(
1577
1640
  sourceTokenSymbol,
1578
- sourceChainId
1641
+ sourceChainId,
1642
+ topTokens
1579
1643
  );
1580
1644
  if (!sourceTokenAddress) {
1581
1645
  setLiquidityHelper({ kind: "idle" });
@@ -1612,11 +1676,13 @@ function DepositAddressStep({
1612
1676
  };
1613
1677
  }, [
1614
1678
  isSolana,
1679
+ isHyperCore,
1615
1680
  sourceChainId,
1616
1681
  sourceTokenSymbol,
1617
1682
  targetChain,
1618
1683
  targetToken,
1619
- service
1684
+ service,
1685
+ topTokens
1620
1686
  ]);
1621
1687
  const displayAddress = isSolana && solanaDepositAddress ? solanaDepositAddress : smartAccount;
1622
1688
  useEffect5(() => {
@@ -1658,14 +1724,18 @@ function DepositAddressStep({
1658
1724
  }, [displayAddress, onCopyAddress]);
1659
1725
  const handleSelectChain = useCallback2(
1660
1726
  (nextChain) => {
1661
- const nextTokens = computeTokensForChain(nextChain, allowedTokenSet);
1727
+ const nextTokens = computeTokensForChain(
1728
+ nextChain,
1729
+ allowedTokenSet,
1730
+ topTokens
1731
+ );
1662
1732
  setSourceChainId(nextChain);
1663
1733
  setSourceTokenSymbol(pickFallbackToken(nextTokens, sourceTokenSymbol));
1664
1734
  setChainDropdownOpen(false);
1665
1735
  setTokenDropdownOpen(false);
1666
1736
  setCopied(false);
1667
1737
  },
1668
- [allowedTokenSet, sourceTokenSymbol]
1738
+ [allowedTokenSet, sourceTokenSymbol, topTokens]
1669
1739
  );
1670
1740
  const onDepositSubmittedRef = useRef5(onDepositSubmitted);
1671
1741
  onDepositSubmittedRef.current = onDepositSubmitted;
@@ -1820,7 +1890,7 @@ function DepositAddressStep({
1820
1890
  className: "rs-deposit-address-dropdown-icon"
1821
1891
  }
1822
1892
  ),
1823
- /* @__PURE__ */ jsx6("span", { children: getChainName(sourceChainId) }),
1893
+ /* @__PURE__ */ jsx6("span", { children: chainLabel(sourceChainId) }),
1824
1894
  /* @__PURE__ */ jsx6(ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
1825
1895
  ]
1826
1896
  }
@@ -1840,7 +1910,7 @@ function DepositAddressStep({
1840
1910
  className: "rs-deposit-address-dropdown-icon"
1841
1911
  }
1842
1912
  ),
1843
- /* @__PURE__ */ jsx6("span", { children: getChainName(chainId) })
1913
+ /* @__PURE__ */ jsx6("span", { children: chainLabel(chainId) })
1844
1914
  ]
1845
1915
  },
1846
1916
  String(chainId)
@@ -1851,7 +1921,7 @@ function DepositAddressStep({
1851
1921
  /* @__PURE__ */ jsx6("span", { children: "Supported token" }),
1852
1922
  /* @__PURE__ */ jsxs6("span", { className: "rs-deposit-address-min", children: [
1853
1923
  "Min.$",
1854
- (targetChain === HYPERCORE_CHAIN_ID ? Math.max(HYPERCORE_MIN_DEPOSIT_USD, uiConfig?.minDepositUsd ?? 0) : uiConfig?.minDepositUsd ?? 0.1).toFixed(2),
1924
+ (targetChain === HYPERCORE_CHAIN_ID || isHyperCore ? Math.max(HYPERCORE_MIN_DEPOSIT_USD, uiConfig?.minDepositUsd ?? 0) : uiConfig?.minDepositUsd ?? 0.1).toFixed(2),
1855
1925
  /* @__PURE__ */ jsx6(Tooltip, { content: "Minimum deposit amount required for the selected chain.", children: /* @__PURE__ */ jsx6(
1856
1926
  InfoIcon,
1857
1927
  {
@@ -1872,14 +1942,7 @@ function DepositAddressStep({
1872
1942
  setChainDropdownOpen(false);
1873
1943
  },
1874
1944
  children: [
1875
- getTokenIcon(sourceTokenSymbol) && /* @__PURE__ */ jsx6(
1876
- "img",
1877
- {
1878
- src: getTokenIcon(sourceTokenSymbol),
1879
- alt: "",
1880
- className: "rs-deposit-address-dropdown-icon"
1881
- }
1882
- ),
1945
+ /* @__PURE__ */ jsx6(TokenGlyph, { symbol: sourceTokenSymbol }),
1883
1946
  /* @__PURE__ */ jsx6("span", { children: sourceTokenSymbol }),
1884
1947
  /* @__PURE__ */ jsx6(ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
1885
1948
  ]
@@ -1895,14 +1958,7 @@ function DepositAddressStep({
1895
1958
  setTokenDropdownOpen(false);
1896
1959
  },
1897
1960
  children: [
1898
- getTokenIcon(symbol) && /* @__PURE__ */ jsx6(
1899
- "img",
1900
- {
1901
- src: getTokenIcon(symbol),
1902
- alt: "",
1903
- className: "rs-deposit-address-dropdown-icon"
1904
- }
1905
- ),
1961
+ /* @__PURE__ */ jsx6(TokenGlyph, { symbol }),
1906
1962
  /* @__PURE__ */ jsx6("span", { children: symbol })
1907
1963
  ]
1908
1964
  },
@@ -2176,6 +2232,7 @@ var DEPOSIT_POLL_INTERVAL_MS = 2e3;
2176
2232
  var DEPOSIT_POLL_FAST_INITIAL_DELAY_MS = 1e3;
2177
2233
  var DEPOSIT_POLL_FAST_INTERVAL_MS = 500;
2178
2234
  var IFRAME_LOAD_TIMEOUT_MS = 15e3;
2235
+ var SWAPPED_SUCCESS_HANDOFF_DELAY_MS = 1400;
2179
2236
  var SWAPPED_IFRAME_ORIGINS = new Set(SWAPPED_ORIGINS);
2180
2237
  var SWAPPED_TERMINAL_STATUSES = /* @__PURE__ */ new Set([
2181
2238
  "order_completed",
@@ -2244,7 +2301,8 @@ function SwappedIframeStep({
2244
2301
  onSwappedFailed,
2245
2302
  onClose,
2246
2303
  onGoBack,
2247
- onError
2304
+ onError,
2305
+ onImmersiveChange
2248
2306
  }) {
2249
2307
  const [widgetUrl, setWidgetUrl] = useState6(null);
2250
2308
  const [loadError, setLoadError] = useState6(null);
@@ -2256,6 +2314,7 @@ function SwappedIframeStep({
2256
2314
  const iframeRef = useRef6(null);
2257
2315
  const completeFiredRef = useRef6(false);
2258
2316
  const failedFiredRef = useRef6(false);
2317
+ const completeTimeoutRef = useRef6(null);
2259
2318
  const expectedOrderUuidRef = useRef6(null);
2260
2319
  const expectedExternalCustomerIdRef = useRef6(null);
2261
2320
  const baselineDepositTxHashRef = useRef6(void 0);
@@ -2272,6 +2331,8 @@ function SwappedIframeStep({
2272
2331
  onErrorRef.current = onError;
2273
2332
  const onGoBackRef = useRef6(onGoBack);
2274
2333
  onGoBackRef.current = onGoBack;
2334
+ const onImmersiveChangeRef = useRef6(onImmersiveChange);
2335
+ onImmersiveChangeRef.current = onImmersiveChange;
2275
2336
  const loadUrlRef = useRef6(loadUrl);
2276
2337
  loadUrlRef.current = loadUrl;
2277
2338
  useEffect6(() => {
@@ -2282,6 +2343,10 @@ function SwappedIframeStep({
2282
2343
  setOrderState(null);
2283
2344
  setLatestEvent(null);
2284
2345
  setPhase("iframe");
2346
+ if (completeTimeoutRef.current !== null) {
2347
+ clearTimeout(completeTimeoutRef.current);
2348
+ completeTimeoutRef.current = null;
2349
+ }
2285
2350
  expectedOrderUuidRef.current = null;
2286
2351
  expectedExternalCustomerIdRef.current = null;
2287
2352
  completeFiredRef.current = false;
@@ -2303,6 +2368,10 @@ function SwappedIframeStep({
2303
2368
  });
2304
2369
  return () => {
2305
2370
  cancelled = true;
2371
+ if (completeTimeoutRef.current !== null) {
2372
+ clearTimeout(completeTimeoutRef.current);
2373
+ completeTimeoutRef.current = null;
2374
+ }
2306
2375
  };
2307
2376
  }, [service, smartAccount, retryToken, loadErrorCode, loadErrorFallback]);
2308
2377
  useEffect6(() => {
@@ -2412,10 +2481,11 @@ function SwappedIframeStep({
2412
2481
  return () => window.removeEventListener("message", onMessage);
2413
2482
  }, []);
2414
2483
  useEffect6(() => {
2415
- if (phase === "iframe" && (orderState !== null || latestEvent !== null)) {
2484
+ const swappedProvesLive = orderState !== null && !(variant === "fiat" && orderState.status === "payment_pending");
2485
+ if (phase === "iframe" && (swappedProvesLive || latestEvent !== null)) {
2416
2486
  setPhase("tracker");
2417
2487
  }
2418
- }, [phase, orderState, latestEvent]);
2488
+ }, [phase, orderState, latestEvent, variant]);
2419
2489
  const stepStates = useMemo4(
2420
2490
  () => deriveStepStates(orderState?.status ?? null, latestEvent),
2421
2491
  [orderState, latestEvent]
@@ -2441,15 +2511,21 @@ function SwappedIframeStep({
2441
2511
  const txHash = currentDepositTxHashRef.current;
2442
2512
  if (!txHash) return;
2443
2513
  completeFiredRef.current = true;
2444
- onSwappedCompleteRef.current({
2514
+ const info = {
2515
+ smartAccount,
2445
2516
  txHash,
2446
2517
  orderCrypto: orderState?.orderCrypto ?? null,
2447
2518
  // Base-unit source amount from the deposit row/event, consistent with the
2448
2519
  // wallet/QR path. ProcessingStep + onLifecycle expect base units.
2449
2520
  amount: getEventSourceDetails(latestEvent ?? void 0).amount ?? null,
2521
+ expectedOrderUuid: expectedOrderUuidRef.current,
2450
2522
  initialEvent: latestEvent ?? void 0
2451
- });
2452
- }, [latestEvent, orderState]);
2523
+ };
2524
+ completeTimeoutRef.current = setTimeout(() => {
2525
+ completeTimeoutRef.current = null;
2526
+ onSwappedCompleteRef.current(info);
2527
+ }, SWAPPED_SUCCESS_HANDOFF_DELAY_MS);
2528
+ }, [latestEvent, orderState, smartAccount]);
2453
2529
  useEffect6(() => {
2454
2530
  if (failedFiredRef.current || completeFiredRef.current) return;
2455
2531
  if (!isFailedEvent(latestEvent ?? void 0)) return;
@@ -2462,6 +2538,11 @@ function SwappedIframeStep({
2462
2538
  failureMessageForEvent(latestEvent ?? void 0)
2463
2539
  );
2464
2540
  }, [latestEvent]);
2541
+ const immersive = variant === "fiat" && phase === "iframe" && !loadError;
2542
+ useEffect6(() => {
2543
+ onImmersiveChangeRef.current?.(immersive);
2544
+ }, [immersive]);
2545
+ useEffect6(() => () => onImmersiveChangeRef.current?.(false), []);
2465
2546
  if (phase === "tracker") {
2466
2547
  const paymentReceived = stepStates[0] === "complete";
2467
2548
  if (variant === "connect" && !terminalState && paymentReceived) {
@@ -2508,7 +2589,7 @@ function SwappedIframeStep({
2508
2589
  retryToken
2509
2590
  )
2510
2591
  ] }) }),
2511
- /* @__PURE__ */ jsx9(PoweredBy, {})
2592
+ loadError && /* @__PURE__ */ jsx9(PoweredBy, {})
2512
2593
  ] });
2513
2594
  }
2514
2595
  function deriveStepStates(swappedStatus, latestEvent) {
@@ -2519,10 +2600,10 @@ function deriveStepStates(swappedStatus, latestEvent) {
2519
2600
  return ["failed", "pending", "pending", "pending"];
2520
2601
  }
2521
2602
  const step1Complete = swappedStatus === "order_completed" || swappedStatus === "order_broadcasted";
2522
- const step2Complete = latestEvent !== null;
2603
+ const step2Complete = latestEvent !== null || swappedStatus === "order_broadcasted";
2523
2604
  const step3Complete = latestEvent?.type === "bridge-complete";
2524
2605
  if (step3Complete) {
2525
- return ["complete", "complete", "complete", "pending"];
2606
+ return ["complete", "complete", "complete", "complete"];
2526
2607
  }
2527
2608
  if (step2Complete) {
2528
2609
  return ["complete", "complete", "active", "pending"];
@@ -2571,7 +2652,8 @@ function FiatOnrampStep({
2571
2652
  onSwappedFailed,
2572
2653
  onClose,
2573
2654
  onGoBack,
2574
- onError
2655
+ onError,
2656
+ onImmersiveChange
2575
2657
  }) {
2576
2658
  const loadUrl = useCallback3(async () => {
2577
2659
  const prefetched = consumePrefetchedUrl?.(smartAccount, paymentMethod);
@@ -2602,7 +2684,8 @@ function FiatOnrampStep({
2602
2684
  onSwappedFailed,
2603
2685
  onClose,
2604
2686
  onGoBack,
2605
- onError
2687
+ onError,
2688
+ onImmersiveChange
2606
2689
  }
2607
2690
  );
2608
2691
  }
@@ -2648,7 +2731,8 @@ function ExchangeConnectStep({
2648
2731
  onSwappedFailed,
2649
2732
  onClose,
2650
2733
  onGoBack,
2651
- onError
2734
+ onError,
2735
+ onImmersiveChange
2652
2736
  }) {
2653
2737
  const loadUrl = useCallback4(async () => {
2654
2738
  const res = await service.getSwappedConnectUrl({
@@ -2672,7 +2756,8 @@ function ExchangeConnectStep({
2672
2756
  onSwappedFailed,
2673
2757
  onClose,
2674
2758
  onGoBack,
2675
- onError
2759
+ onError,
2760
+ onImmersiveChange
2676
2761
  }
2677
2762
  );
2678
2763
  }
@@ -2812,7 +2897,6 @@ function DepositAddressSkeleton({
2812
2897
  const defaultToken = tokensForChain.includes("USDC") ? "USDC" : tokensForChain[0] ?? "USDC";
2813
2898
  const chainName = getChainName(defaultChainId);
2814
2899
  const chainIcon = getChainIcon(defaultChainId);
2815
- const tokenIcon = getTokenIcon(defaultToken);
2816
2900
  return /* @__PURE__ */ jsxs11("div", { className: "rs-screen", "aria-busy": "true", children: [
2817
2901
  /* @__PURE__ */ jsx13("span", { className: "rs-sr-only", role: "status", children: "Preparing deposit details\u2026" }),
2818
2902
  /* @__PURE__ */ jsxs11("div", { className: "rs-screen-body", children: [
@@ -2849,11 +2933,10 @@ function DepositAddressSkeleton({
2849
2933
  ] })
2850
2934
  ] }),
2851
2935
  /* @__PURE__ */ jsxs11("div", { className: "rs-deposit-address-dropdown-trigger", children: [
2852
- tokenIcon && /* @__PURE__ */ jsx13(
2853
- "img",
2936
+ /* @__PURE__ */ jsx13(
2937
+ TokenIcon,
2854
2938
  {
2855
- src: tokenIcon,
2856
- alt: "",
2939
+ symbol: defaultToken,
2857
2940
  className: "rs-deposit-address-dropdown-icon"
2858
2941
  }
2859
2942
  ),
@@ -3059,7 +3142,6 @@ function SolanaTokenSelectStep({
3059
3142
  !loading && !error && rows.length > 0 && /* @__PURE__ */ jsx14("div", { className: "rs-asset-list", children: rows.map((entry) => {
3060
3143
  const isSelected = selectedSymbol === entry.token.symbol;
3061
3144
  const tokenAmount = formatBalance(entry);
3062
- const tokenIcon = getTokenIcon(entry.token.symbol);
3063
3145
  return /* @__PURE__ */ jsxs12(
3064
3146
  "button",
3065
3147
  {
@@ -3070,7 +3152,13 @@ function SolanaTokenSelectStep({
3070
3152
  children: [
3071
3153
  /* @__PURE__ */ jsxs12("div", { className: "rs-asset-info", children: [
3072
3154
  /* @__PURE__ */ jsxs12("div", { className: "rs-asset-icon-wrapper", children: [
3073
- tokenIcon ? /* @__PURE__ */ jsx14("span", { className: "rs-asset-icon", children: /* @__PURE__ */ jsx14("img", { src: tokenIcon, alt: entry.token.symbol }) }) : /* @__PURE__ */ jsx14("span", { className: "rs-asset-icon", children: entry.token.symbol.slice(0, 4) }),
3155
+ /* @__PURE__ */ jsx14("span", { className: "rs-asset-icon", children: /* @__PURE__ */ jsx14(
3156
+ TokenIcon,
3157
+ {
3158
+ symbol: entry.token.symbol,
3159
+ fallback: entry.token.symbol.slice(0, 4)
3160
+ }
3161
+ ) }),
3074
3162
  chainIcon && /* @__PURE__ */ jsx14("span", { className: "rs-asset-chain-badge", children: /* @__PURE__ */ jsx14("img", { src: chainIcon, alt: chainName }) })
3075
3163
  ] }),
3076
3164
  /* @__PURE__ */ jsxs12("div", { className: "rs-asset-text", children: [
@@ -3132,7 +3220,6 @@ function SolanaAmountStep({
3132
3220
  targetChain,
3133
3221
  targetChainName,
3134
3222
  targetTokenSymbol,
3135
- targetTokenIcon,
3136
3223
  appBalanceUsd,
3137
3224
  onContinue,
3138
3225
  debug
@@ -3315,7 +3402,6 @@ function SolanaAmountStep({
3315
3402
  };
3316
3403
  const continueLabel = exceedsBalance ? "Insufficient balance" : isAboveMax ? "Continue with max allowed deposit" : isBelowMin ? "Continue with minimum deposit" : "Continue";
3317
3404
  const continueDisabled = exceedsBalance || numericAmount === 0 && !isBelowMin;
3318
- const sourceTokenIcon = getTokenIcon(token.symbol);
3319
3405
  return /* @__PURE__ */ jsxs13("div", { className: "rs-screen", children: [
3320
3406
  /* @__PURE__ */ jsxs13("div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
3321
3407
  /* @__PURE__ */ jsx15(BodyHeader, { icon: /* @__PURE__ */ jsx15(WalletIcon, {}), title: "Wallet deposit" }),
@@ -3367,7 +3453,7 @@ function SolanaAmountStep({
3367
3453
  "Solana ",
3368
3454
  token.symbol
3369
3455
  ] }),
3370
- sourceTokenIcon && /* @__PURE__ */ jsx15("span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ jsx15("img", { src: sourceTokenIcon, alt: "" }) })
3456
+ /* @__PURE__ */ jsx15("span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ jsx15(TokenIcon, { symbol: token.symbol }) })
3371
3457
  ] })
3372
3458
  ] }),
3373
3459
  targetChainName && targetTokenSymbol && /* @__PURE__ */ jsxs13("div", { className: "rs-amount-detail-row", children: [
@@ -3378,7 +3464,7 @@ function SolanaAmountStep({
3378
3464
  " ",
3379
3465
  targetTokenSymbol
3380
3466
  ] }),
3381
- targetTokenIcon && /* @__PURE__ */ jsx15("span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ jsx15("img", { src: targetTokenIcon, alt: "" }) })
3467
+ /* @__PURE__ */ jsx15("span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ jsx15(TokenIcon, { symbol: targetTokenSymbol }) })
3382
3468
  ] })
3383
3469
  ] }),
3384
3470
  balanceAfterUsd !== null && /* @__PURE__ */ jsxs13("div", { className: "rs-amount-detail-row", children: [
@@ -3534,8 +3620,6 @@ function SolanaConfirmStep({
3534
3620
  const targetChainName = getChainName(targetChain);
3535
3621
  const sourceChainIcon = getChainIcon("solana");
3536
3622
  const targetChainIcon = getChainIcon(targetChain);
3537
- const sourceTokenIcon = getTokenIcon(token.symbol);
3538
- const targetTokenIcon = getTokenIcon(targetSymbol);
3539
3623
  const feeSponsored = uiConfig?.feeSponsored ?? false;
3540
3624
  const feeTooltip = uiConfig?.feeTooltip ?? (feeSponsored ? "Network fees are sponsored for this deposit." : "Network fees apply.");
3541
3625
  const formattedAmount = sourceAmount && Number.isFinite(Number(sourceAmount)) ? formatTokenAmount(Number(sourceAmount), token.symbol) ?? "0" : "0";
@@ -3671,14 +3755,14 @@ function SolanaConfirmStep({
3671
3755
  " ",
3672
3756
  token.symbol
3673
3757
  ] }),
3674
- sourceTokenIcon && /* @__PURE__ */ jsx16("span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ jsx16("img", { src: sourceTokenIcon, alt: "" }) })
3758
+ /* @__PURE__ */ jsx16("span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ jsx16(TokenIcon, { symbol: token.symbol }) })
3675
3759
  ] })
3676
3760
  ] }),
3677
3761
  /* @__PURE__ */ jsxs14("div", { className: "rs-review-detail-row", children: [
3678
3762
  /* @__PURE__ */ jsx16("span", { children: "Receive" }),
3679
3763
  /* @__PURE__ */ jsxs14("span", { className: "rs-review-detail-value", children: [
3680
3764
  /* @__PURE__ */ jsx16("span", { children: receiveDisplay }),
3681
- targetTokenIcon && /* @__PURE__ */ jsx16("span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ jsx16("img", { src: targetTokenIcon, alt: "" }) })
3765
+ /* @__PURE__ */ jsx16("span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ jsx16(TokenIcon, { symbol: targetSymbol }) })
3682
3766
  ] })
3683
3767
  ] }),
3684
3768
  /* @__PURE__ */ jsxs14("div", { className: "rs-review-detail-row", children: [
@@ -3734,7 +3818,7 @@ function DappImportAssetSelectStep({
3734
3818
  Number(asset.balance) / 10 ** asset.decimals
3735
3819
  ) : "0";
3736
3820
  const balanceUsd = asset.balanceUsd && asset.balanceUsd > 0 ? currencyFormatter.format(asset.balanceUsd) : `${tokenAmount} ${asset.symbol}`;
3737
- const tokenIcon = asset.icon ?? getTokenIcon(asset.symbol);
3821
+ const assetIcon = asset.icon;
3738
3822
  const chainIcon = getChainIcon(asset.chainId);
3739
3823
  const badge = getChainBadge(asset.chainId);
3740
3824
  return /* @__PURE__ */ jsxs15(
@@ -3746,7 +3830,13 @@ function DappImportAssetSelectStep({
3746
3830
  children: [
3747
3831
  /* @__PURE__ */ jsxs15("div", { className: "rs-asset-info", children: [
3748
3832
  /* @__PURE__ */ jsxs15("div", { className: "rs-asset-icon-wrapper", children: [
3749
- /* @__PURE__ */ jsx17("span", { className: "rs-asset-icon", children: tokenIcon ? /* @__PURE__ */ jsx17("img", { src: tokenIcon, alt: asset.symbol }) : asset.symbol.slice(0, 4) }),
3833
+ /* @__PURE__ */ jsx17("span", { className: "rs-asset-icon", children: assetIcon ? /* @__PURE__ */ jsx17("img", { src: assetIcon, alt: asset.symbol }) : /* @__PURE__ */ jsx17(
3834
+ TokenIcon,
3835
+ {
3836
+ symbol: asset.symbol,
3837
+ fallback: asset.symbol.slice(0, 4)
3838
+ }
3839
+ ) }),
3750
3840
  chainIcon ? /* @__PURE__ */ jsx17("span", { className: "rs-asset-chain-badge", children: /* @__PURE__ */ jsx17(
3751
3841
  "img",
3752
3842
  {
@@ -4182,7 +4272,8 @@ function createInitialState(overrides) {
4182
4272
  txHash: null,
4183
4273
  directTransfer: false,
4184
4274
  swappedContext: null,
4185
- initialEvent: null
4275
+ initialEvent: null,
4276
+ quoteFeeBreakdown: null
4186
4277
  },
4187
4278
  dappImport: {
4188
4279
  activeProviderId: null,
@@ -4792,10 +4883,22 @@ function applyAction(state, action) {
4792
4883
  txHash: action.txHash,
4793
4884
  directTransfer: action.directTransfer ?? false,
4794
4885
  swappedContext: action.swappedContext ?? null,
4795
- initialEvent: action.initialEvent ?? null
4886
+ initialEvent: action.initialEvent ?? null,
4887
+ quoteFeeBreakdown: action.quoteFeeBreakdown ?? null
4796
4888
  },
4797
4889
  flow: { ...state.flow, step: "processing" }
4798
4890
  };
4891
+ case "processing/quote-fee-breakdown-loaded":
4892
+ if (state.flow.step !== "processing" || state.processing.txHash?.toLowerCase() !== action.txHash.toLowerCase()) {
4893
+ return state;
4894
+ }
4895
+ return {
4896
+ ...state,
4897
+ processing: {
4898
+ ...state.processing,
4899
+ quoteFeeBreakdown: action.quoteFeeBreakdown
4900
+ }
4901
+ };
4799
4902
  case "dapp-import/availability-loading":
4800
4903
  return {
4801
4904
  ...state,
@@ -4963,7 +5066,8 @@ function applyAction(state, action) {
4963
5066
  txHash: null,
4964
5067
  directTransfer: false,
4965
5068
  swappedContext: null,
4966
- initialEvent: null
5069
+ initialEvent: null,
5070
+ quoteFeeBreakdown: null
4967
5071
  },
4968
5072
  // Drop fetched availability wholesale. The fetch effect refetches
4969
5073
  // unconditionally on remount (so keeping the map saves nothing),
@@ -5320,6 +5424,33 @@ function isSameRoute2(sourceChain, sourceToken, targetChain, targetToken) {
5320
5424
  var SWAPPED_SOURCE_CHAIN = 8453;
5321
5425
  var SWAPPED_SOURCE_TOKEN = "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913";
5322
5426
  var SWAPPED_SOURCE_DECIMALS = 6;
5427
+ var SWAPPED_QUOTE_FEE_TIMEOUT_MS = 2500;
5428
+ async function fetchQuoteFeeBreakdown(params) {
5429
+ try {
5430
+ if (BigInt(params.amount) <= 0n) return void 0;
5431
+ } catch {
5432
+ return void 0;
5433
+ }
5434
+ let timeoutId;
5435
+ try {
5436
+ const quote = await Promise.race([
5437
+ params.service.getQuotePreview({
5438
+ account: params.account,
5439
+ sourceChainId: params.sourceChainId,
5440
+ sourceToken: params.sourceToken,
5441
+ amount: params.amount
5442
+ }),
5443
+ new Promise((resolve) => {
5444
+ timeoutId = setTimeout(resolve, SWAPPED_QUOTE_FEE_TIMEOUT_MS, null);
5445
+ })
5446
+ ]);
5447
+ return quote?.fees?.breakdown;
5448
+ } catch {
5449
+ return void 0;
5450
+ } finally {
5451
+ if (timeoutId !== void 0) clearTimeout(timeoutId);
5452
+ }
5453
+ }
5323
5454
  var DEFAULT_FIAT_ONRAMP_METHODS = [
5324
5455
  {
5325
5456
  method: "creditcard",
@@ -5444,7 +5575,12 @@ function deriveStep(flow, d, p, activeEntry, fiat, exchange) {
5444
5575
  balanceUsd: d.balanceUsd
5445
5576
  };
5446
5577
  case "processing":
5447
- if (!smartAccount || !p.txHash || !d.amount || d.sourceChain === null || d.sourceChain === "unknown" || !d.sourceToken) {
5578
+ if (!smartAccount || !p.txHash || !d.amount || d.sourceChain === null || d.sourceChain === "unknown" || // HyperCore is a QR/deposit-address-only source (no wallet flow), so it
5579
+ // never dispatches `deposit/submitted` and never reaches this store
5580
+ // `processing` step — its completion is tracked by the DepositNotification
5581
+ // on the deposit-address screen. Excluding it here keeps `sourceChain`
5582
+ // narrowed to the EVM/Solana shape ProcessingStep expects.
5583
+ d.sourceChain === "hypercore" || !d.sourceToken) {
5448
5584
  return { type: "setup" };
5449
5585
  }
5450
5586
  return {
@@ -5460,7 +5596,8 @@ function deriveStep(flow, d, p, activeEntry, fiat, exchange) {
5460
5596
  inputAmountUsd: d.inputAmountUsd ?? void 0,
5461
5597
  directTransfer: p.directTransfer,
5462
5598
  swappedContext: p.swappedContext ?? void 0,
5463
- initialEvent: p.initialEvent ?? void 0
5599
+ initialEvent: p.initialEvent ?? void 0,
5600
+ quoteFeeBreakdown: p.quoteFeeBreakdown ?? void 0
5464
5601
  };
5465
5602
  }
5466
5603
  }
@@ -5511,6 +5648,7 @@ function DepositFlow({
5511
5648
  uiConfig,
5512
5649
  allowedRoutes,
5513
5650
  onStepChange,
5651
+ onSwappedImmersiveChange,
5514
5652
  onClose,
5515
5653
  onLifecycle,
5516
5654
  onEvent,
@@ -6636,7 +6774,7 @@ function DepositFlow({
6636
6774
  [targetToken, targetChain, storeApi, activeOwner]
6637
6775
  );
6638
6776
  const handleDepositSubmitted = useCallback7(
6639
- (txHash, chainId, amount, token) => {
6777
+ (txHash, chainId, amount, token, quoteFeeBreakdown) => {
6640
6778
  logFlow("evm:submitted", {
6641
6779
  txHash,
6642
6780
  sourceChain: chainId,
@@ -6655,7 +6793,8 @@ function DepositFlow({
6655
6793
  sourceSymbol: asset?.symbol,
6656
6794
  sourceDecimals: asset?.decimals,
6657
6795
  inputAmountUsd: depositAtSubmit.inputAmountUsd ?? void 0,
6658
- directTransfer: !dappImport && isSameRoute2(chainId, token, targetChain, targetToken)
6796
+ directTransfer: !dappImport && isSameRoute2(chainId, token, targetChain, targetToken),
6797
+ quoteFeeBreakdown
6659
6798
  });
6660
6799
  },
6661
6800
  [logFlow, storeApi, targetChain, targetToken]
@@ -6670,10 +6809,12 @@ function DepositFlow({
6670
6809
  const stateAtComplete = storeApi.getState();
6671
6810
  const swappedContext = stateAtComplete.flow.mode === "exchange-connect" ? {
6672
6811
  variant: "connect",
6673
- method: stateAtComplete.exchange.selectedConnection
6812
+ method: stateAtComplete.exchange.selectedConnection,
6813
+ expectedOrderUuid: info.expectedOrderUuid
6674
6814
  } : stateAtComplete.flow.mode === "fiat-onramp" ? {
6675
6815
  variant: "fiat",
6676
- method: stateAtComplete.fiat.selectedMethod
6816
+ method: stateAtComplete.fiat.selectedMethod,
6817
+ expectedOrderUuid: info.expectedOrderUuid
6677
6818
  } : void 0;
6678
6819
  storeApi.dispatch({
6679
6820
  type: "deposit/submitted",
@@ -6693,8 +6834,23 @@ function DepositFlow({
6693
6834
  amount,
6694
6835
  sourceDecimals: SWAPPED_SOURCE_DECIMALS
6695
6836
  });
6837
+ void (async () => {
6838
+ const quoteFeeBreakdown = await fetchQuoteFeeBreakdown({
6839
+ service,
6840
+ account: info.smartAccount,
6841
+ sourceChainId: SWAPPED_SOURCE_CHAIN,
6842
+ sourceToken: SWAPPED_SOURCE_TOKEN,
6843
+ amount
6844
+ });
6845
+ if (!quoteFeeBreakdown) return;
6846
+ storeApi.dispatch({
6847
+ type: "processing/quote-fee-breakdown-loaded",
6848
+ txHash: info.txHash,
6849
+ quoteFeeBreakdown
6850
+ });
6851
+ })();
6696
6852
  },
6697
- [logFlow, storeApi, onLifecycleRef]
6853
+ [logFlow, onLifecycleRef, service, storeApi]
6698
6854
  );
6699
6855
  const handleDepositSubmittedCallback = useCallback7(
6700
6856
  (txHash, sourceChain, amount) => {
@@ -6936,7 +7092,8 @@ function DepositFlow({
6936
7092
  onClose: onClose ?? (() => {
6937
7093
  }),
6938
7094
  onGoBack: handleBack,
6939
- onError: handleError
7095
+ onError: handleError,
7096
+ onImmersiveChange: onSwappedImmersiveChange
6940
7097
  }
6941
7098
  ),
6942
7099
  step.type === "processing" && /* @__PURE__ */ jsx19(
@@ -6954,10 +7111,12 @@ function DepositFlow({
6954
7111
  sourceDecimals: step.sourceDecimals,
6955
7112
  amountUsd: step.inputAmountUsd,
6956
7113
  swappedContext: step.swappedContext,
7114
+ quoteFeeBreakdown: step.quoteFeeBreakdown,
6957
7115
  service,
6958
7116
  directTransfer: step.directTransfer,
6959
7117
  initialEvent: step.initialEvent,
6960
7118
  isSwappedOrder: true,
7119
+ uiConfig,
6961
7120
  onClose,
6962
7121
  onNewDeposit: handleNewDeposit,
6963
7122
  onDepositComplete: handleDepositComplete,
@@ -7005,7 +7164,8 @@ function DepositFlow({
7005
7164
  onClose: onClose ?? (() => {
7006
7165
  }),
7007
7166
  onGoBack: handleBack,
7008
- onError: handleError
7167
+ onError: handleError,
7168
+ onImmersiveChange: onSwappedImmersiveChange
7009
7169
  }
7010
7170
  ),
7011
7171
  step.type === "processing" && /* @__PURE__ */ jsx19(
@@ -7023,10 +7183,12 @@ function DepositFlow({
7023
7183
  sourceDecimals: step.sourceDecimals,
7024
7184
  amountUsd: step.inputAmountUsd,
7025
7185
  swappedContext: step.swappedContext,
7186
+ quoteFeeBreakdown: step.quoteFeeBreakdown,
7026
7187
  service,
7027
7188
  directTransfer: step.directTransfer,
7028
7189
  initialEvent: step.initialEvent,
7029
7190
  isSwappedOrder: true,
7191
+ uiConfig,
7030
7192
  onClose,
7031
7193
  onNewDeposit: handleNewDeposit,
7032
7194
  onDepositComplete: handleDepositComplete,
@@ -7076,9 +7238,6 @@ function DepositFlow({
7076
7238
  targetChain,
7077
7239
  targetChainName: getChainName(targetChain),
7078
7240
  targetTokenSymbol: getTargetTokenSymbol(targetToken, targetChain),
7079
- targetTokenIcon: getTokenIcon(
7080
- getTargetTokenSymbol(targetToken, targetChain)
7081
- ),
7082
7241
  appBalanceUsd,
7083
7242
  onContinue: handleSolanaAmountContinue,
7084
7243
  debug
@@ -7156,6 +7315,7 @@ function DepositFlow({
7156
7315
  service,
7157
7316
  directTransfer: effectiveStep.directTransfer,
7158
7317
  initialEvent: effectiveStep.initialEvent,
7318
+ quoteFeeBreakdown: effectiveStep.quoteFeeBreakdown,
7159
7319
  onClose,
7160
7320
  onNewDeposit: handleNewDeposit,
7161
7321
  onDepositComplete: handleDepositComplete,
@@ -7318,6 +7478,7 @@ function DepositFlow({
7318
7478
  service,
7319
7479
  directTransfer: effectiveStep.directTransfer,
7320
7480
  initialEvent: effectiveStep.initialEvent,
7481
+ quoteFeeBreakdown: effectiveStep.quoteFeeBreakdown,
7321
7482
  uiConfig,
7322
7483
  onClose,
7323
7484
  onNewDeposit: handleNewDeposit,
@@ -7355,6 +7516,7 @@ function resolveChainId(value) {
7355
7516
  if (value === void 0 || value === null) return null;
7356
7517
  if (typeof value === "number") return value;
7357
7518
  if (isSolanaCaip2(value) || value === "solana") return "solana";
7519
+ if (isHyperCoreCaip2(value) || value === "hypercore") return "hypercore";
7358
7520
  const parsed = parseEvmChainId(value);
7359
7521
  if (parsed !== null) return parsed;
7360
7522
  const num = Number(value);
@@ -7373,7 +7535,8 @@ function resolveTokenSymbol(token, chainId) {
7373
7535
  }
7374
7536
  }
7375
7537
  if (chainId !== null && chainId !== void 0 && chainId !== "solana" && /^0x[a-fA-F0-9]{40}$/.test(token)) {
7376
- const sym = getTokenSymbol(token, chainId);
7538
+ const evmChainId = chainId === "hypercore" ? HYPERCORE_CHAIN_ID : chainId;
7539
+ const sym = getTokenSymbol(token, evmChainId);
7377
7540
  if (sym !== "Token") return sym;
7378
7541
  }
7379
7542
  return shortenHash(token);
@@ -7393,7 +7556,8 @@ function formatAmount(rawAmount, token, chainId) {
7393
7556
  decimals = 9;
7394
7557
  }
7395
7558
  } else if (/^0x[a-fA-F0-9]{40}$/.test(token)) {
7396
- decimals = getTokenDecimalsByAddress(token, chainId);
7559
+ const evmChainId = chainId === "hypercore" ? HYPERCORE_CHAIN_ID : chainId;
7560
+ decimals = getTokenDecimalsByAddress(token, evmChainId);
7397
7561
  }
7398
7562
  }
7399
7563
  try {
@@ -7544,7 +7708,6 @@ function HistoryCard({ deposit }) {
7544
7708
  const sourceChainIcon = sourceChainId ? getChainIcon(sourceChainId) : void 0;
7545
7709
  const targetChainIcon = targetChainId ? getChainIcon(targetChainId) : void 0;
7546
7710
  const sourceSymbol = resolveTokenSymbol(deposit.token, sourceChainId);
7547
- const sourceTokenIcon = sourceSymbol ? getTokenIcon(sourceSymbol) : void 0;
7548
7711
  const rawAmount = deposit.sourceAmount && deposit.sourceAmount !== "0" ? deposit.sourceAmount : deposit.amount;
7549
7712
  const formattedAmount = rawAmount ? formatAmount(rawAmount, deposit.token, sourceChainId) : null;
7550
7713
  const displayAmount = formattedAmount ? sourceSymbol && /^USD/.test(sourceSymbol) ? `$${Number(formattedAmount).toLocaleString("en-US", {
@@ -7553,7 +7716,8 @@ function HistoryCard({ deposit }) {
7553
7716
  })}` : `${formattedAmount} ${sourceSymbol}` : "\u2014";
7554
7717
  const date = deposit.createdAt ? formatDate(deposit.createdAt) : null;
7555
7718
  const txTypeLabel = `Deposit${sourceSymbol ? ` ${sourceSymbol}` : ""}`;
7556
- const srcTxUrl = deposit.sourceTxHash ? getTxExplorerUrl(deposit.sourceTxHash, sourceChainId) : null;
7719
+ const srcTxHash = sourceChainId === "hypercore" ? deposit.txHash : deposit.sourceTxHash;
7720
+ const srcTxUrl = srcTxHash ? getTxExplorerUrl(srcTxHash, sourceChainId) : null;
7557
7721
  return /* @__PURE__ */ jsxs18(
7558
7722
  "button",
7559
7723
  {
@@ -7564,7 +7728,7 @@ function HistoryCard({ deposit }) {
7564
7728
  children: [
7565
7729
  /* @__PURE__ */ jsxs18("div", { className: "rs-history-card-row", children: [
7566
7730
  /* @__PURE__ */ jsxs18("div", { className: "rs-history-card-icons", children: [
7567
- /* @__PURE__ */ jsx20("span", { className: "rs-history-card-token", children: sourceTokenIcon ? /* @__PURE__ */ jsx20("img", { src: sourceTokenIcon, alt: "" }) : sourceSymbol.slice(0, 2) }),
7731
+ /* @__PURE__ */ jsx20("span", { className: "rs-history-card-token", children: /* @__PURE__ */ jsx20(TokenIcon, { symbol: sourceSymbol, fallback: sourceSymbol.slice(0, 2) }) }),
7568
7732
  sourceChainIcon && /* @__PURE__ */ jsx20("span", { className: "rs-history-card-chain", children: /* @__PURE__ */ jsx20("img", { src: sourceChainIcon, alt: "" }) })
7569
7733
  ] }),
7570
7734
  /* @__PURE__ */ jsxs18("div", { className: "rs-history-card-text", children: [
@@ -7591,7 +7755,7 @@ function HistoryCard({ deposit }) {
7591
7755
  targetChainIcon && /* @__PURE__ */ jsx20("span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ jsx20("img", { src: targetChainIcon, alt: "" }) })
7592
7756
  ] })
7593
7757
  ] }),
7594
- srcTxUrl && deposit.sourceTxHash && /* @__PURE__ */ jsxs18("div", { className: "rs-amount-detail-row", children: [
7758
+ srcTxUrl && srcTxHash && /* @__PURE__ */ jsxs18("div", { className: "rs-amount-detail-row", children: [
7595
7759
  /* @__PURE__ */ jsx20("span", { children: "Transaction details" }),
7596
7760
  /* @__PURE__ */ jsxs18(
7597
7761
  "a",
@@ -7602,7 +7766,7 @@ function HistoryCard({ deposit }) {
7602
7766
  className: "rs-history-card-link",
7603
7767
  onClick: (e) => e.stopPropagation(),
7604
7768
  children: [
7605
- /* @__PURE__ */ jsx20("span", { children: shortenHash(deposit.sourceTxHash) }),
7769
+ /* @__PURE__ */ jsx20("span", { children: shortenHash(srcTxHash) }),
7606
7770
  /* @__PURE__ */ jsx20(ArrowUpRightIcon, {})
7607
7771
  ]
7608
7772
  }
@@ -7618,7 +7782,7 @@ DepositHistoryPanel.displayName = "DepositHistoryPanel";
7618
7782
  // src/DepositModal.tsx
7619
7783
  import { jsx as jsx21, jsxs as jsxs19 } from "react/jsx-runtime";
7620
7784
  var ReownDepositInner = lazy2(
7621
- () => import("./DepositModalReown-IVRDXQAA.mjs").then((m) => ({ default: m.DepositModalReown }))
7785
+ () => import("./DepositModalReown-RZ6VSMKP.mjs").then((m) => ({ default: m.DepositModalReown }))
7622
7786
  );
7623
7787
  function sortByCreatedAtDesc(items) {
7624
7788
  return [...items].sort((a, b) => {
@@ -7698,6 +7862,7 @@ function DepositModalInner({
7698
7862
  const modalRef = useRef9(null);
7699
7863
  const onReadyRef = useLatestRef(onReady);
7700
7864
  const [currentScreen, setCurrentScreen] = useState13("connect");
7865
+ const [swappedImmersive, setSwappedImmersive] = useState13(false);
7701
7866
  const [backHandler, setBackHandler] = useState13(
7702
7867
  void 0
7703
7868
  );
@@ -7747,6 +7912,24 @@ function DepositModalInner({
7747
7912
  }),
7748
7913
  [backendUrl, debug]
7749
7914
  );
7915
+ const [clientSetup, setClientSetup] = useState13(
7916
+ null
7917
+ );
7918
+ useEffect11(() => {
7919
+ if (!isOpen) return;
7920
+ let active = true;
7921
+ service.getSetup().then((config) => {
7922
+ if (active) setClientSetup(config);
7923
+ });
7924
+ return () => {
7925
+ active = false;
7926
+ };
7927
+ }, [isOpen, service]);
7928
+ useEffect11(() => {
7929
+ if (debug && clientSetup) {
7930
+ console.debug("[deposit] client setup config (not shown yet)", clientSetup);
7931
+ }
7932
+ }, [debug, clientSetup]);
7750
7933
  const store = useMemo9(
7751
7934
  () => createDepositStore({ targetChain, targetToken }),
7752
7935
  // eslint-disable-next-line react-hooks/exhaustive-deps
@@ -7860,6 +8043,9 @@ function DepositModalInner({
7860
8043
  cursorRef.current = null;
7861
8044
  historyStaleRef.current = false;
7862
8045
  historyLoadedRef.current = false;
8046
+ setCurrentScreen("connect");
8047
+ setBackHandler(void 0);
8048
+ setSwappedImmersive(false);
7863
8049
  }
7864
8050
  }, [isOpen]);
7865
8051
  useEffect11(() => {
@@ -7869,6 +8055,8 @@ function DepositModalInner({
7869
8055
  }, [isOpen, store]);
7870
8056
  const showBackButton = uiConfig?.showBackButton ?? true;
7871
8057
  const canGoBack = backHandler !== void 0;
8058
+ const hideHeaderChrome = swappedImmersive;
8059
+ const modalClassName = `rs-modal${hideHeaderChrome ? " rs-modal--swapped-iframe" : ""}`;
7872
8060
  return /* @__PURE__ */ jsx21(RpcUrlsProvider, { value: rpcUrls, children: /* @__PURE__ */ jsx21(DepositStoreProvider, { store, children: /* @__PURE__ */ jsx21(
7873
8061
  Modal,
7874
8062
  {
@@ -7877,8 +8065,8 @@ function DepositModalInner({
7877
8065
  className,
7878
8066
  inline,
7879
8067
  closeOnOverlayClick,
7880
- children: /* @__PURE__ */ jsxs19("div", { ref: modalRef, className: "rs-modal", children: [
7881
- /* @__PURE__ */ jsxs19("div", { className: "rs-modal-header--redesigned", children: [
8068
+ children: /* @__PURE__ */ jsxs19("div", { ref: modalRef, className: modalClassName, children: [
8069
+ !hideHeaderChrome && /* @__PURE__ */ jsxs19("div", { className: "rs-modal-header--redesigned", children: [
7882
8070
  /* @__PURE__ */ jsx21("div", { className: "rs-modal-header-nav-left", children: showBackButton && canGoBack && backHandler && /* @__PURE__ */ jsx21(
7883
8071
  "button",
7884
8072
  {
@@ -7947,6 +8135,7 @@ function DepositModalInner({
7947
8135
  uiConfig,
7948
8136
  allowedRoutes,
7949
8137
  onStepChange: handleStepChange,
8138
+ onSwappedImmersiveChange: setSwappedImmersive,
7950
8139
  onClose,
7951
8140
  onLifecycle: handleLifecycle,
7952
8141
  onEvent,