@rhinestone/deposit-modal 0.10.0 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/dist/{DepositModalReown-MTWT6Y66.mjs → DepositModalReown-6RVLEM3B.mjs} +96 -26
  2. package/dist/{DepositModalReown-S3DSFXTX.cjs → DepositModalReown-TXTLVZIQ.cjs} +97 -27
  3. package/dist/caip-D8aRWdEY.d.cts +40 -0
  4. package/dist/caip-D8aRWdEY.d.ts +40 -0
  5. package/dist/{chunk-A223BLVC.mjs → chunk-53IFZGSF.mjs} +177 -21
  6. package/dist/{chunk-W4YAOJPG.cjs → chunk-7RNEYPI4.cjs} +614 -560
  7. package/dist/{chunk-UMCDZJMG.cjs → chunk-BLJMYCBF.cjs} +92 -90
  8. package/dist/{chunk-KW32UBUQ.mjs → chunk-DYTRG4C7.mjs} +1 -1
  9. package/dist/{chunk-LR7MKHYV.mjs → chunk-G4FVZQOM.mjs} +23 -21
  10. package/dist/{chunk-DEF767BA.cjs → chunk-GWA6GFTI.cjs} +66 -63
  11. package/dist/{chunk-A42XAHIB.cjs → chunk-HCQWFL3A.cjs} +84 -101
  12. package/dist/{chunk-7TV7GLJB.mjs → chunk-ITAYM7SB.mjs} +723 -167
  13. package/dist/{chunk-YEBXUUH3.cjs → chunk-JPRV36DT.cjs} +2 -2
  14. package/dist/{chunk-VTVOHNXM.cjs → chunk-JYKMR6QI.cjs} +3 -3
  15. package/dist/{chunk-ILT2PITN.mjs → chunk-MZ53PDIX.mjs} +1 -1
  16. package/dist/{chunk-PUJHXHRA.cjs → chunk-NPSC5R22.cjs} +805 -249
  17. package/dist/{chunk-5OEWGJR4.mjs → chunk-QRR3Y7EK.mjs} +1 -1
  18. package/dist/{chunk-H577RJN5.cjs → chunk-TENL4H64.cjs} +186 -30
  19. package/dist/{chunk-MHIOMTMM.mjs → chunk-TRD2FCAR.mjs} +140 -86
  20. package/dist/{chunk-5NJYW5FT.mjs → chunk-VRNRRN2U.mjs} +12 -9
  21. package/dist/{chunk-VDGT6NZQ.mjs → chunk-WLDTBKRA.mjs} +14 -31
  22. package/dist/{chunk-NF4NBRUP.cjs → chunk-XVKBCDZI.cjs} +1 -1
  23. package/dist/claim.cjs +6 -6
  24. package/dist/claim.d.cts +3 -2
  25. package/dist/claim.d.ts +3 -2
  26. package/dist/claim.mjs +5 -5
  27. package/dist/{caip-523Zrc3r.d.cts → constants-FuzG3h4m.d.cts} +1 -18
  28. package/dist/{caip-523Zrc3r.d.ts → constants-FuzG3h4m.d.ts} +1 -18
  29. package/dist/constants.cjs +5 -3
  30. package/dist/constants.d.cts +3 -2
  31. package/dist/constants.d.ts +3 -2
  32. package/dist/constants.mjs +4 -2
  33. package/dist/deposit.cjs +8 -8
  34. package/dist/deposit.d.cts +3 -2
  35. package/dist/deposit.d.ts +3 -2
  36. package/dist/deposit.mjs +7 -7
  37. package/dist/index.cjs +12 -10
  38. package/dist/index.d.cts +3 -2
  39. package/dist/index.d.ts +3 -2
  40. package/dist/index.mjs +11 -9
  41. package/dist/polymarket.cjs +5 -5
  42. package/dist/polymarket.mjs +2 -2
  43. package/dist/{types-C0SGf-21.d.cts → types-C7wag_iL.d.cts} +4 -3
  44. package/dist/{types-C0SGf-21.d.ts → types-D4b6Cjox.d.ts} +4 -3
  45. package/dist/withdraw.cjs +6 -6
  46. package/dist/withdraw.d.cts +3 -2
  47. package/dist/withdraw.d.ts +3 -2
  48. package/dist/withdraw.mjs +5 -5
  49. package/package.json +1 -1
@@ -11,17 +11,16 @@ import {
11
11
  getEventTxHash,
12
12
  getExchangeLogo,
13
13
  getExchangeLogoSrc,
14
- getPublicClient,
15
14
  isDepositEvent,
16
15
  isFailedEvent,
17
16
  readDedupedAccountSetupResult,
18
17
  runAccountSetupDeduped,
19
18
  txRefsMatch,
20
19
  warnRemovedProps
21
- } from "./chunk-VDGT6NZQ.mjs";
20
+ } from "./chunk-WLDTBKRA.mjs";
22
21
  import {
23
22
  ListRow
24
- } from "./chunk-KW32UBUQ.mjs";
23
+ } from "./chunk-DYTRG4C7.mjs";
25
24
  import {
26
25
  AlertTriangleIcon,
27
26
  AppleIcon,
@@ -32,6 +31,7 @@ import {
32
31
  Callout,
33
32
  CardIcon,
34
33
  CdnIcon,
34
+ ChainCatalogProvider,
35
35
  CheckIcon,
36
36
  ChevronDownIcon,
37
37
  ChevronLeftIcon,
@@ -55,6 +55,7 @@ import {
55
55
  UnplugIcon,
56
56
  WalletIcon,
57
57
  applyTheme,
58
+ catalogKeyForChain,
58
59
  chainIdsByValue,
59
60
  checkBackendUrl,
60
61
  createDepositService,
@@ -66,6 +67,7 @@ import {
66
67
  formatTokenAmount,
67
68
  formatUserError,
68
69
  getAssetId,
70
+ getPublicClient,
69
71
  isDisplayStablecoinSymbol,
70
72
  isNativeAsset,
71
73
  isRecognizedToken,
@@ -74,10 +76,16 @@ import {
74
76
  resolveAppFeeBps,
75
77
  rpcUrlFor,
76
78
  tokenFormatter,
79
+ useCatalogChain,
80
+ useChainCatalog,
81
+ useChainName,
82
+ useDepositChainIds,
83
+ useExplorerTxUrl,
84
+ useIsDepositChain,
77
85
  useLatestRef,
78
86
  useRpcUrls,
79
87
  useStableRpcUrls
80
- } from "./chunk-7TV7GLJB.mjs";
88
+ } from "./chunk-ITAYM7SB.mjs";
81
89
  import {
82
90
  POLYMARKET_COLLATERAL_OFFRAMP_ADDRESS,
83
91
  POLYMARKET_ICON_URL,
@@ -88,21 +96,21 @@ import {
88
96
  executePolymarketSafeTransfer,
89
97
  fetchPolymarketProxyWallet,
90
98
  readPolymarketBalances
91
- } from "./chunk-ILT2PITN.mjs";
99
+ } from "./chunk-MZ53PDIX.mjs";
92
100
  import {
93
101
  CHAIN_BY_ID,
94
102
  HYPERCORE_CHAIN_ID,
95
103
  HYPERCORE_MIN_DEPOSIT_USD,
104
+ HYPERCORE_SPOT_CAIP2,
96
105
  NATIVE_TOKEN_ADDRESS,
97
106
  SOLANA_TOKENS,
98
- SOURCE_CHAINS,
99
107
  cdnIconUrl,
100
108
  findTokenDecimals,
109
+ getBundledTargetTokens,
101
110
  getChainBadge,
102
111
  getChainIcon,
103
112
  getChainId,
104
113
  getChainName,
105
- getExplorerTxUrl,
106
114
  getExplorerUrl,
107
115
  getNativeSymbol,
108
116
  getSupportedChainIds,
@@ -112,12 +120,16 @@ import {
112
120
  getTokenDecimalsByAddress,
113
121
  getTokenSymbol,
114
122
  isHyperCoreCaip2,
123
+ isHyperCoreDestination,
115
124
  isNativeSol,
116
125
  isSolanaCaip2,
117
126
  isStablecoinSymbol,
118
127
  isVirtualDestination,
119
- parseEvmChainId
120
- } from "./chunk-A223BLVC.mjs";
128
+ parseEvmChainId,
129
+ publishShortlistTokens,
130
+ targetChainToCaip2,
131
+ targetChainToChainId
132
+ } from "./chunk-53IFZGSF.mjs";
121
133
 
122
134
  // src/DepositModal.tsx
123
135
  import {
@@ -208,11 +220,14 @@ SegmentedToggle.displayName = "SegmentedToggle";
208
220
  import { jsx as jsx2 } from "react/jsx-runtime";
209
221
  function ChainIcon({ chainId, className, loading }) {
210
222
  const badge = getChainBadge(chainId);
223
+ const catalogChain = useCatalogChain(catalogKeyForChain(chainId));
224
+ const name = catalogChain?.name ?? getChainName(chainId);
225
+ const initial = (catalogChain?.name ?? badge.shortLabel).charAt(0);
211
226
  return /* @__PURE__ */ jsx2(
212
227
  CdnIcon,
213
228
  {
214
- src: getChainIcon(chainId),
215
- alt: getChainName(chainId),
229
+ src: catalogChain?.iconUrl ?? getChainIcon(chainId),
230
+ alt: name,
216
231
  className,
217
232
  loading,
218
233
  fallback: /* @__PURE__ */ jsx2(
@@ -220,8 +235,8 @@ function ChainIcon({ chainId, className, loading }) {
220
235
  {
221
236
  className: "rs-chain-badge-fallback",
222
237
  style: { backgroundColor: badge.bg, color: badge.color },
223
- "aria-label": getChainName(chainId),
224
- children: badge.shortLabel.charAt(0)
238
+ "aria-label": name,
239
+ children: initial
225
240
  }
226
241
  )
227
242
  }
@@ -680,6 +695,9 @@ function AssetSelectStep({
680
695
  const [selectedAssetId, setSelectedAssetId] = useState2(null);
681
696
  const [loading, setLoading] = useState2(true);
682
697
  const [error, setError] = useState2(null);
698
+ const isDepositChain = useIsDepositChain();
699
+ const { catalog } = useChainCatalog();
700
+ const chainName = useChainName();
683
701
  const defaultAssetId = useMemo(() => {
684
702
  if (!defaultSourceChain || !defaultSourceToken) return null;
685
703
  return getAssetId({
@@ -714,10 +732,13 @@ function AssetSelectStep({
714
732
  (asset) => asset.token.toLowerCase() === NATIVE_TOKEN_ADDRESS
715
733
  );
716
734
  if (!hasNative) {
735
+ const connectedChainId = publicClient.chain?.id;
717
736
  const nativeAssets = await fetchNativeAssets(
718
737
  address,
719
738
  publicClient,
720
- portfolioAssets
739
+ portfolioAssets,
740
+ isDepositChain,
741
+ connectedChainId != null ? catalog?.byChainId.get(connectedChainId) : void 0
721
742
  );
722
743
  if (!active) return;
723
744
  if (nativeAssets.length > 0) {
@@ -739,9 +760,17 @@ function AssetSelectStep({
739
760
  return () => {
740
761
  active = false;
741
762
  };
742
- }, [address, publicClient, service, onTotalBalanceComputedRef]);
763
+ }, [
764
+ address,
765
+ publicClient,
766
+ service,
767
+ onTotalBalanceComputedRef,
768
+ isDepositChain,
769
+ catalog
770
+ ]);
743
771
  const rows = useMemo(() => {
744
772
  return assets.filter((a) => {
773
+ if (!isDepositChain(a.chainId)) return false;
745
774
  try {
746
775
  if (BigInt(a.balance ?? "0") <= BigInt(0)) return false;
747
776
  } catch {
@@ -761,7 +790,7 @@ function AssetSelectStep({
761
790
  if (balB < balA) return -1;
762
791
  return 0;
763
792
  });
764
- }, [assets]);
793
+ }, [assets, isDepositChain]);
765
794
  useEffect2(() => {
766
795
  if (!defaultAssetId || selectedAssetId) return;
767
796
  if (rows.some((asset) => asset.id === defaultAssetId)) {
@@ -835,7 +864,7 @@ function AssetSelectStep({
835
864
  fallback: asset.symbol.slice(0, 4)
836
865
  }
837
866
  ) }),
838
- chainIcon ? /* @__PURE__ */ jsx6("span", { className: "rs-asset-chain-badge", children: /* @__PURE__ */ jsx6(CdnIcon, { src: chainIcon, alt: getChainName(asset.chainId) }) }) : /* @__PURE__ */ jsx6(
867
+ chainIcon ? /* @__PURE__ */ jsx6("span", { className: "rs-asset-chain-badge", children: /* @__PURE__ */ jsx6(CdnIcon, { src: chainIcon, alt: chainName(asset.chainId) }) }) : /* @__PURE__ */ jsx6(
839
868
  "span",
840
869
  {
841
870
  className: "rs-asset-chain-badge",
@@ -852,7 +881,7 @@ function AssetSelectStep({
852
881
  /* @__PURE__ */ jsx6("span", { className: "rs-asset-name", children: asset.symbol }),
853
882
  /* @__PURE__ */ jsxs5("span", { className: "rs-asset-chain", children: [
854
883
  "on ",
855
- getChainName(asset.chainId)
884
+ chainName(asset.chainId)
856
885
  ] })
857
886
  ] }),
858
887
  /* @__PURE__ */ jsxs5("div", { className: "rs-asset-balance-small", children: [
@@ -881,11 +910,11 @@ function AssetSelectStep({
881
910
  /* @__PURE__ */ jsx6(PoweredBy, {})
882
911
  ] });
883
912
  }
884
- async function fetchNativeAssets(address, publicClient, existing) {
913
+ async function fetchNativeAssets(address, publicClient, existing, isDepositChain, catalogChain) {
885
914
  const existingIds = new Set(existing.map((asset) => asset.id));
886
915
  const connectedChainId = publicClient.chain?.id;
887
916
  if (!connectedChainId) return [];
888
- if (!SOURCE_CHAINS.some((chain) => chain.id === connectedChainId)) return [];
917
+ if (!isDepositChain(connectedChainId)) return [];
889
918
  const id = getAssetId({
890
919
  chainId: connectedChainId,
891
920
  token: NATIVE_TOKEN_ADDRESS
@@ -893,7 +922,8 @@ async function fetchNativeAssets(address, publicClient, existing) {
893
922
  if (existingIds.has(id)) return [];
894
923
  try {
895
924
  const balance = await publicClient.getBalance({ address });
896
- const nativeSymbol = getNativeSymbol(connectedChainId);
925
+ const nativeSymbol = catalogChain?.nativeToken.symbol ?? getNativeSymbol(connectedChainId);
926
+ const nativeDecimals = catalogChain?.nativeToken.decimals ?? 18;
897
927
  return [
898
928
  {
899
929
  id,
@@ -901,7 +931,7 @@ async function fetchNativeAssets(address, publicClient, existing) {
901
931
  token: NATIVE_TOKEN_ADDRESS,
902
932
  symbol: nativeSymbol,
903
933
  name: nativeSymbol,
904
- decimals: 18,
934
+ decimals: nativeDecimals,
905
935
  balance: balance.toString()
906
936
  }
907
937
  ];
@@ -1058,7 +1088,8 @@ function AmountStep({
1058
1088
  const chainMismatch = Boolean(
1059
1089
  walletClient?.chain?.id && walletClient.chain.id !== asset.chainId
1060
1090
  );
1061
- const targetSymbol = getTargetTokenSymbol(targetToken, targetChain);
1091
+ const targetChainId = targetChainToChainId(targetChain);
1092
+ const targetSymbol = getTargetTokenSymbol(targetToken, targetChainId);
1062
1093
  const isSourceStablecoin = isStablecoinSymbol(asset.symbol);
1063
1094
  const tokenPriceUsd = useMemo2(() => {
1064
1095
  if (tokenPriceUsdOverride !== void 0 && tokenPriceUsdOverride > 0)
@@ -1180,7 +1211,7 @@ function AmountStep({
1180
1211
  return null;
1181
1212
  }
1182
1213
  }, [numericAmount, isSourceStablecoin, hasPricing, tokenPriceUsd, asset.decimals]);
1183
- const minDepositUsd = targetChain === HYPERCORE_CHAIN_ID ? Math.max(HYPERCORE_MIN_DEPOSIT_USD, uiConfig?.minDepositUsd ?? 0) : uiConfig?.minDepositUsd ?? null;
1214
+ const minDepositUsd = isHyperCoreDestination(targetChain) ? Math.max(HYPERCORE_MIN_DEPOSIT_USD, uiConfig?.minDepositUsd ?? 0) : uiConfig?.minDepositUsd ?? null;
1184
1215
  const maxDepositUsd = uiConfig?.maxDepositUsd ?? null;
1185
1216
  const isBelowMin = minDepositUsd !== null && numericAmount > 0 && amountUsd < minDepositUsd;
1186
1217
  const isAboveMax = maxDepositUsd !== null && amountUsd > maxDepositUsd;
@@ -1246,8 +1277,9 @@ function AmountStep({
1246
1277
  };
1247
1278
  const continueLabel = exceedsBalance ? "Insufficient balance" : isAboveMax ? "Continue with max allowed deposit" : isBelowMin ? "Continue with minimum deposit" : "Continue";
1248
1279
  const continueDisabled = chainMismatch || exceedsBalance || numericAmount === 0 && !isBelowMin || balance === null;
1249
- const sourceChainName = getChainName(asset.chainId);
1250
- const targetChainName = getChainName(targetChain);
1280
+ const chainName = useChainName();
1281
+ const sourceChainName = chainName(asset.chainId);
1282
+ const targetChainName = chainName(targetChainId);
1251
1283
  return /* @__PURE__ */ jsxs7("div", { className: "rs-screen", children: [
1252
1284
  /* @__PURE__ */ jsxs7("div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
1253
1285
  /* @__PURE__ */ jsx8(BodyHeader, { icon: /* @__PURE__ */ jsx8(WalletIcon, {}), title: "Wallet deposit" }),
@@ -1320,7 +1352,6 @@ function AmountStep({
1320
1352
  /* @__PURE__ */ jsx8("span", { className: "rs-amount-detail-value", children: currencyFormatter.format(balanceAfterUsd) })
1321
1353
  ] })
1322
1354
  ] }),
1323
- targetChain === HYPERCORE_CHAIN_ID && /* @__PURE__ */ jsx8(Callout, { variant: "warning", children: "First deposit to a new HyperCore account includes a ~1 USDC activation fee." }),
1324
1355
  error && /* @__PURE__ */ jsx8(Callout, { variant: "error", children: error }),
1325
1356
  /* @__PURE__ */ jsx8(
1326
1357
  Button,
@@ -1395,11 +1426,12 @@ function ConfirmStep({
1395
1426
  recipient
1396
1427
  ]);
1397
1428
  const quote = setupReady && quoteResult?.requestKey === quoteRequestKey ? quoteResult.quote : null;
1398
- const targetSymbol = sameRoute ? asset.symbol : getTargetTokenSymbol(targetToken, targetChain);
1429
+ const targetChainId = targetChainToChainId(targetChain);
1430
+ const targetSymbol = sameRoute ? asset.symbol : getTargetTokenSymbol(targetToken, targetChainId);
1399
1431
  const sourceChainName = getChainName(asset.chainId);
1400
- const targetChainName = getChainName(targetChain);
1432
+ const targetChainName = getChainName(targetChainId);
1401
1433
  const sourceChainIcon = getChainIcon(asset.chainId);
1402
- const targetChainIcon = getChainIcon(targetChain);
1434
+ const targetChainIcon = getChainIcon(targetChainId);
1403
1435
  const formattedSendAmount = amount && Number.isFinite(Number(amount)) ? formatTokenAmount(Number(amount), asset.symbol) ?? "0" : "0";
1404
1436
  const mustHaveQuote = !appFeesResolved || resolveAppFeeBps(
1405
1437
  appFees,
@@ -1622,7 +1654,6 @@ function ConfirmStep({
1622
1654
  ) })
1623
1655
  ] })
1624
1656
  ] }),
1625
- targetChain === HYPERCORE_CHAIN_ID && /* @__PURE__ */ jsx9(Callout, { variant: "warning", children: "First deposit to a new HyperCore account includes a ~1 USDC activation fee." }),
1626
1657
  error && /* @__PURE__ */ jsx9(Callout, { variant: "error", children: error }),
1627
1658
  /* @__PURE__ */ jsx9(
1628
1659
  Button,
@@ -1848,8 +1879,9 @@ function DepositNotification({
1848
1879
  status,
1849
1880
  txHash
1850
1881
  ]);
1851
- const sourceExplorerUrl = sourceChain === "unknown" ? void 0 : getExplorerTxUrl(sourceChain, txHash);
1852
- const destExplorerUrl = destinationTxHash ? getExplorerTxUrl(targetChain, destinationTxHash) : null;
1882
+ const explorerTxUrl = useExplorerTxUrl();
1883
+ const sourceExplorerUrl = sourceChain === "unknown" ? void 0 : explorerTxUrl(sourceChain, txHash);
1884
+ const destExplorerUrl = destinationTxHash ? explorerTxUrl(targetChainToChainId(targetChain), destinationTxHash) : null;
1853
1885
  const title = status === "complete" ? "Deposit completed" : status === "failed" ? "Deposit failed" : "Deposit received and processing\u2026";
1854
1886
  const subtitle = status === "complete" ? "Your deposit has been credited to your account." : status === "failed" ? "Your deposit could not be processed." : "Your deposit will be credited to your account shortly.";
1855
1887
  const statusIcon = status === "complete" ? /* @__PURE__ */ jsx10("div", { className: "rs-deposit-notification-badge rs-deposit-notification-badge--complete", children: /* @__PURE__ */ jsx10(CheckIcon, {}) }) : status === "failed" ? /* @__PURE__ */ jsx10("div", { className: "rs-deposit-notification-badge rs-deposit-notification-badge--failed", children: /* @__PURE__ */ jsx10(CloseIcon, {}) }) : /* @__PURE__ */ jsx10("div", { className: "rs-deposit-notification-badge rs-deposit-notification-badge--processing", children: /* @__PURE__ */ jsxs9(
@@ -2050,21 +2082,25 @@ function getDepositEventDetails(event) {
2050
2082
  function isSameRoute(sourceChain, sourceToken, targetChain, targetToken) {
2051
2083
  return sourceChain === targetChain && sourceToken.toLowerCase() === targetToken.toLowerCase();
2052
2084
  }
2053
- function chainLabel(chainId) {
2054
- return getChainName(chainId).replace(/\s+(One|Mainnet|Smart Chain)$/i, "");
2085
+ function chainLabel(chainId, catalogChain) {
2086
+ const name = catalogChain?.name ?? getChainName(chainId);
2087
+ return name.replace(/\s+(One|Mainnet|Smart Chain|Chain)$/i, "");
2055
2088
  }
2056
- function computeTokensForChain(chainId, topTokens) {
2089
+ function computeTokensForChain(chainId, topTokens, catalogChain) {
2057
2090
  const fromBackend = topTokens?.[String(chainId)]?.map((t) => t.symbol);
2058
- const all = fromBackend ?? (chainId === "solana" ? SOLANA_TOKENS.map((t) => t.symbol) : (
2059
- // HyperCore accepts USDC + USDT0 as origin tokens (native Hyperliquid L1
2060
- // spot transfers); it has no EVM source-chain matrix entry.
2061
- chainId === "hypercore" ? ["USDC", "USDT0"] : getTargetTokenSymbolsForChain(chainId)
2062
- ));
2063
- return all;
2064
- }
2065
- function resolveSourceTokenAddress(symbol, chainId, topTokens) {
2091
+ if (fromBackend) return fromBackend;
2092
+ if (chainId === "solana") return SOLANA_TOKENS.map((t) => t.symbol);
2093
+ if (chainId === "hypercore") return ["USDC", "USDT0"];
2094
+ const bundled = getBundledTargetTokens(chainId).map((t) => t.symbol);
2095
+ if (bundled.length > 0) return bundled;
2096
+ return Array.isArray(catalogChain?.supportedTokens) ? catalogChain.supportedTokens.map((t) => t.symbol) : [];
2097
+ }
2098
+ function resolveSourceTokenAddress(symbol, chainId, topTokens, catalogChain) {
2066
2099
  const top = topTokens?.[String(chainId)]?.find((t) => t.symbol === symbol);
2067
- return top?.address ?? getTokenAddress(symbol, chainId);
2100
+ if (top?.address) return top.address;
2101
+ const fromRegistry = getTokenAddress(symbol, chainId);
2102
+ if (fromRegistry) return fromRegistry;
2103
+ return Array.isArray(catalogChain?.supportedTokens) ? catalogChain.supportedTokens.find((t) => t.symbol === symbol)?.address : void 0;
2068
2104
  }
2069
2105
  function TokenGlyph({ symbol }) {
2070
2106
  return /* @__PURE__ */ jsx11(
@@ -2098,25 +2134,38 @@ function DepositAddressStep({
2098
2134
  const [topTokens, setTopTokens] = useState6(null);
2099
2135
  useEffect6(() => {
2100
2136
  let active = true;
2137
+ setTopTokens(null);
2101
2138
  service.getTopTokens().then((t) => {
2102
- if (active) setTopTokens(t);
2139
+ if (!active) return;
2140
+ setTopTokens(t);
2141
+ if (t) publishShortlistTokens(t);
2103
2142
  });
2104
2143
  return () => {
2105
2144
  active = false;
2106
2145
  };
2107
2146
  }, [service]);
2108
2147
  const BASE_CHAIN_ID2 = 8453;
2109
- const evmChainIds = useMemo3(() => getSupportedChainIds(), []);
2148
+ const evmChainIds = useDepositChainIds();
2149
+ const { catalog } = useChainCatalog();
2150
+ const catalogFor = useCallback2(
2151
+ (chain) => {
2152
+ if (!catalog) return void 0;
2153
+ const key = catalogKeyForChain(chain);
2154
+ return typeof key === "number" ? catalog.byChainId.get(key) : catalog.byCaip2.get(key);
2155
+ },
2156
+ [catalog]
2157
+ );
2110
2158
  const chainOptions = useMemo3(() => {
2159
+ const acceptsDeposits = (chain) => catalogFor(chain)?.deposit !== false;
2111
2160
  const options = [...evmChainIds];
2112
2161
  const extras = [];
2113
- if (hasSolana) extras.push("solana");
2114
- extras.push("hypercore");
2162
+ if (hasSolana && acceptsDeposits("solana")) extras.push("solana");
2163
+ if (acceptsDeposits("hypercore")) extras.push("hypercore");
2115
2164
  options.splice(1, 0, ...extras);
2116
2165
  return options.filter(
2117
- (chain) => topTokens?.[String(chain)]?.length !== 0
2166
+ (chain) => topTokens?.[String(chain)]?.length !== 0 && computeTokensForChain(chain, topTokens, catalogFor(chain)).length > 0
2118
2167
  );
2119
- }, [evmChainIds, hasSolana, topTokens]);
2168
+ }, [evmChainIds, hasSolana, topTokens, catalogFor]);
2120
2169
  const preferredChainId = (options) => options.includes(BASE_CHAIN_ID2) ? BASE_CHAIN_ID2 : options[0] ?? BASE_CHAIN_ID2;
2121
2170
  const [sourceChainId, setSourceChainId] = useState6(() => preferredChainId(chainOptions));
2122
2171
  useEffect6(() => {
@@ -2127,8 +2176,8 @@ function DepositAddressStep({
2127
2176
  const isSolana = sourceChainId === "solana";
2128
2177
  const isHyperCore = sourceChainId === "hypercore";
2129
2178
  const tokensForChain = useMemo3(
2130
- () => computeTokensForChain(sourceChainId, topTokens),
2131
- [sourceChainId, topTokens]
2179
+ () => computeTokensForChain(sourceChainId, topTokens, catalogFor(sourceChainId)),
2180
+ [sourceChainId, topTokens, catalogFor]
2132
2181
  );
2133
2182
  const defaultToken = pickFallbackToken(tokensForChain, "USDC");
2134
2183
  const [sourceTokenSymbol, setSourceTokenSymbol] = useState6(defaultToken);
@@ -2159,7 +2208,8 @@ function DepositAddressStep({
2159
2208
  const sourceTokenAddress = resolveSourceTokenAddress(
2160
2209
  sourceTokenSymbol,
2161
2210
  sourceChainId,
2162
- topTokens
2211
+ topTokens,
2212
+ catalogFor(sourceChainId)
2163
2213
  );
2164
2214
  if (!sourceTokenAddress) {
2165
2215
  setLiquidityHelper({ kind: "idle" });
@@ -2170,7 +2220,7 @@ function DepositAddressStep({
2170
2220
  service.checkLiquidity({
2171
2221
  sourceChainId,
2172
2222
  sourceToken: sourceTokenAddress,
2173
- destinationChainId: targetChain,
2223
+ destinationChainId: targetChainToCaip2(targetChain),
2174
2224
  destinationToken: targetToken,
2175
2225
  amount: "1"
2176
2226
  }).then((result) => {
@@ -2244,14 +2294,18 @@ function DepositAddressStep({
2244
2294
  }, [displayAddress, onCopyAddress]);
2245
2295
  const handleSelectChain = useCallback2(
2246
2296
  (nextChain) => {
2247
- const nextTokens = computeTokensForChain(nextChain, topTokens);
2297
+ const nextTokens = computeTokensForChain(
2298
+ nextChain,
2299
+ topTokens,
2300
+ catalogFor(nextChain)
2301
+ );
2248
2302
  setSourceChainId(nextChain);
2249
2303
  setSourceTokenSymbol(pickFallbackToken(nextTokens, sourceTokenSymbol));
2250
2304
  setChainDropdownOpen(false);
2251
2305
  setTokenDropdownOpen(false);
2252
2306
  setCopied(false);
2253
2307
  },
2254
- [sourceTokenSymbol, topTokens]
2308
+ [sourceTokenSymbol, topTokens, catalogFor]
2255
2309
  );
2256
2310
  const onDepositSubmittedRef = useRef5(onDepositSubmitted);
2257
2311
  onDepositSubmittedRef.current = onDepositSubmitted;
@@ -2380,7 +2434,7 @@ function DepositAddressStep({
2380
2434
  const handleNotificationDismiss = useCallback2((id) => {
2381
2435
  setNotifications((prev) => prev.filter((n) => n.id !== id));
2382
2436
  }, []);
2383
- const qrIconSrc = getChainIcon(sourceChainId);
2437
+ const qrIconSrc = catalogFor(sourceChainId)?.iconUrl ?? getChainIcon(sourceChainId);
2384
2438
  return /* @__PURE__ */ jsxs10("div", { className: "rs-screen rs-step--with-notifications", children: [
2385
2439
  /* @__PURE__ */ jsxs10("div", { className: "rs-screen-body", children: [
2386
2440
  /* @__PURE__ */ jsx11(BodyHeader, { icon: /* @__PURE__ */ jsx11(TransferCryptoIcon, {}), title: "Transfer crypto" }),
@@ -2401,11 +2455,11 @@ function DepositAddressStep({
2401
2455
  /* @__PURE__ */ jsx11(
2402
2456
  CdnIcon,
2403
2457
  {
2404
- src: getChainIcon(sourceChainId),
2458
+ src: catalogFor(sourceChainId)?.iconUrl ?? getChainIcon(sourceChainId),
2405
2459
  className: "rs-deposit-address-dropdown-icon"
2406
2460
  }
2407
2461
  ),
2408
- /* @__PURE__ */ jsx11("span", { children: chainLabel(sourceChainId) }),
2462
+ /* @__PURE__ */ jsx11("span", { children: chainLabel(sourceChainId, catalogFor(sourceChainId)) }),
2409
2463
  /* @__PURE__ */ jsx11(ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
2410
2464
  ]
2411
2465
  }
@@ -2420,11 +2474,11 @@ function DepositAddressStep({
2420
2474
  /* @__PURE__ */ jsx11(
2421
2475
  CdnIcon,
2422
2476
  {
2423
- src: getChainIcon(chainId),
2477
+ src: catalogFor(chainId)?.iconUrl ?? getChainIcon(chainId),
2424
2478
  className: "rs-deposit-address-dropdown-icon"
2425
2479
  }
2426
2480
  ),
2427
- /* @__PURE__ */ jsx11("span", { children: chainLabel(chainId) })
2481
+ /* @__PURE__ */ jsx11("span", { children: chainLabel(chainId, catalogFor(chainId)) })
2428
2482
  ]
2429
2483
  },
2430
2484
  String(chainId)
@@ -2435,7 +2489,7 @@ function DepositAddressStep({
2435
2489
  /* @__PURE__ */ jsx11("span", { children: "Supported token" }),
2436
2490
  /* @__PURE__ */ jsxs10("span", { className: "rs-deposit-address-min", children: [
2437
2491
  "Min.$",
2438
- (targetChain === HYPERCORE_CHAIN_ID || isHyperCore ? Math.max(HYPERCORE_MIN_DEPOSIT_USD, uiConfig?.minDepositUsd ?? 0) : uiConfig?.minDepositUsd ?? 0.1).toFixed(2),
2492
+ (isHyperCoreDestination(targetChain) || isHyperCore ? Math.max(HYPERCORE_MIN_DEPOSIT_USD, uiConfig?.minDepositUsd ?? 0) : uiConfig?.minDepositUsd ?? 0.1).toFixed(2),
2439
2493
  /* @__PURE__ */ jsx11(Tooltip, { content: "Minimum deposit amount required for the selected chain.", children: /* @__PURE__ */ jsx11(
2440
2494
  InfoIcon,
2441
2495
  {
@@ -2510,7 +2564,6 @@ function DepositAddressStep({
2510
2564
  ]
2511
2565
  }
2512
2566
  ),
2513
- targetChain === HYPERCORE_CHAIN_ID && /* @__PURE__ */ jsx11(Callout, { variant: "warning", children: "HyperCore's first deposit to a new account includes a ~1 USDC activation fee \u2014 send at least 1 USDC or it will fail." }),
2514
2567
  /* @__PURE__ */ jsxs10(
2515
2568
  "div",
2516
2569
  {
@@ -2569,7 +2622,7 @@ function DepositAddressStep({
2569
2622
  /* @__PURE__ */ jsx11("strong", { children: "< 1 min" })
2570
2623
  ] })
2571
2624
  ] }),
2572
- /* @__PURE__ */ jsxs10("div", { className: "rs-price-impact-row", children: [
2625
+ liquidityHelper.kind !== "idle" && /* @__PURE__ */ jsxs10("div", { className: "rs-price-impact-row", children: [
2573
2626
  /* @__PURE__ */ jsx11("span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ jsx11(PlusCircleIcon, {}) }),
2574
2627
  /* @__PURE__ */ jsxs10("span", { className: "rs-price-impact-label", children: [
2575
2628
  "Max deposit:",
@@ -3911,7 +3964,7 @@ function SolanaAmountStep({
3911
3964
  return null;
3912
3965
  }
3913
3966
  }, [numericAmount, isSourceStablecoin, hasPricing, tokenPriceUsd, token.decimals]);
3914
- const minDepositUsd = targetChain === HYPERCORE_CHAIN_ID ? Math.max(HYPERCORE_MIN_DEPOSIT_USD, uiConfig?.minDepositUsd ?? 0) : uiConfig?.minDepositUsd ?? null;
3967
+ const minDepositUsd = isHyperCoreDestination(targetChain) ? Math.max(HYPERCORE_MIN_DEPOSIT_USD, uiConfig?.minDepositUsd ?? 0) : uiConfig?.minDepositUsd ?? null;
3915
3968
  const maxDepositUsd = uiConfig?.maxDepositUsd ?? null;
3916
3969
  const isBelowMin = minDepositUsd !== null && numericAmount > 0 && numericAmount < minDepositUsd;
3917
3970
  const isAboveMax = maxDepositUsd !== null && numericAmount > maxDepositUsd;
@@ -4053,7 +4106,6 @@ function SolanaAmountStep({
4053
4106
  /* @__PURE__ */ jsx20("span", { className: "rs-amount-detail-value", children: currencyFormatter.format(balanceAfterUsd) })
4054
4107
  ] })
4055
4108
  ] }),
4056
- targetChain === HYPERCORE_CHAIN_ID && /* @__PURE__ */ jsx20(Callout, { variant: "warning", children: "First deposit to a new HyperCore account includes a ~1 USDC activation fee." }),
4057
4109
  error && /* @__PURE__ */ jsx20(Callout, { variant: "error", children: error }),
4058
4110
  /* @__PURE__ */ jsx20(
4059
4111
  Button,
@@ -4196,11 +4248,12 @@ function SolanaConfirmStep({
4196
4248
  const rpcUrls = useRpcUrls();
4197
4249
  const [isSubmitting, setIsSubmitting] = useState11(false);
4198
4250
  const [error, setError] = useState11(null);
4199
- const targetSymbol = getTargetTokenSymbol(targetToken, targetChain);
4251
+ const targetChainId = targetChainToChainId(targetChain);
4252
+ const targetSymbol = getTargetTokenSymbol(targetToken, targetChainId);
4200
4253
  const sourceChainName = getChainName("solana");
4201
- const targetChainName = getChainName(targetChain);
4254
+ const targetChainName = getChainName(targetChainId);
4202
4255
  const sourceChainIcon = getChainIcon("solana");
4203
- const targetChainIcon = getChainIcon(targetChain);
4256
+ const targetChainIcon = getChainIcon(targetChainId);
4204
4257
  const feeSponsored = uiConfig?.feeSponsored ?? false;
4205
4258
  const feeTooltip = uiConfig?.feeTooltip ?? (feeSponsored ? "Network fees are sponsored for this deposit." : "Network fees apply.");
4206
4259
  const formattedAmount = sourceAmount && Number.isFinite(Number(sourceAmount)) ? formatTokenAmount(Number(sourceAmount), token.symbol) ?? "0" : "0";
@@ -6548,7 +6601,8 @@ function DepositFlow({
6548
6601
  selectedWalletId
6549
6602
  ]);
6550
6603
  const setupChainId = typeof targetChain === "number" && !isVirtualDestination(targetChain) ? targetChain : typeof defaultSourceChain === "number" ? defaultSourceChain : base.id;
6551
- const targetSymbol = getTargetTokenSymbol(targetToken, targetChain);
6604
+ const targetChainId = targetChainToChainId(targetChain);
6605
+ const targetSymbol = getTargetTokenSymbol(targetToken, targetChainId);
6552
6606
  const isTargetStablecoin = isStablecoinSymbol(targetSymbol);
6553
6607
  const targetMarketPriceRef = useRef8(null);
6554
6608
  useEffect11(() => {
@@ -6558,7 +6612,7 @@ function DepositFlow({
6558
6612
  }
6559
6613
  let cancelled = false;
6560
6614
  fetchTokenPriceUsd(service, {
6561
- chainId: targetChain,
6615
+ chainId: targetChainId,
6562
6616
  address: targetToken,
6563
6617
  symbol: targetSymbol
6564
6618
  }).then((price) => {
@@ -6831,8 +6885,8 @@ function DepositFlow({
6831
6885
  pred_balance: totalBalanceUsd
6832
6886
  });
6833
6887
  } else if (effectiveStep.type === "deposit-address") {
6834
- const chainName = getChainName(targetChain);
6835
- const tokenSymbol = getTargetTokenSymbol(targetToken, targetChain);
6888
+ const chainName = getChainName(targetChainId);
6889
+ const tokenSymbol = getTargetTokenSymbol(targetToken, targetChainId);
6836
6890
  onEventRef.current?.({
6837
6891
  type: "deposit_modal_transfer_crypto_open",
6838
6892
  default_chain: chainName,
@@ -6840,7 +6894,7 @@ function DepositFlow({
6840
6894
  pred_balance: totalBalanceUsd
6841
6895
  });
6842
6896
  } else if (effectiveStep.type === "amount" && stepSendToken) {
6843
- const receiveSymbol = getTargetTokenSymbol(targetToken, targetChain);
6897
+ const receiveSymbol = getTargetTokenSymbol(targetToken, targetChainId);
6844
6898
  onEventRef.current?.({
6845
6899
  type: "deposit_modal_connected_wallet_enter_value_open",
6846
6900
  send_token: stepSendToken,
@@ -7573,7 +7627,7 @@ function DepositFlow({
7573
7627
  );
7574
7628
  const handleSolanaAmountContinue = useCallback7(
7575
7629
  (token, sourceAmount, inputAmountUsd) => {
7576
- const targetSym = getTargetTokenSymbol(targetToken, targetChain);
7630
+ const targetSym = getTargetTokenSymbol(targetToken, targetChainId);
7577
7631
  const isTargetStable = isStablecoinSymbol(targetSym);
7578
7632
  const targetTokenPriceUsd = isTargetStable ? 1 : targetMarketPriceRef.current;
7579
7633
  logFlow("solana:amount:continue", {
@@ -7651,7 +7705,7 @@ function DepositFlow({
7651
7705
  (amount, targetAmount, balance) => {
7652
7706
  const entry = storeApi.getState().setup;
7653
7707
  if (entry.status !== "ready") return;
7654
- const targetSym = getTargetTokenSymbol(targetToken, targetChain);
7708
+ const targetSym = getTargetTokenSymbol(targetToken, targetChainId);
7655
7709
  const isTargetStable = isStablecoinSymbol(targetSym);
7656
7710
  const targetTokenPriceUsd = isTargetStable ? 1 : targetMarketPriceRef.current;
7657
7711
  storeApi.dispatch({
@@ -7927,8 +7981,8 @@ function DepositFlow({
7927
7981
  onDepositComplete: handleDepositComplete,
7928
7982
  onDepositFailed: handleDepositFailed,
7929
7983
  onCopyAddress: () => {
7930
- const chainName = getChainName(targetChain);
7931
- const tokenSymbol = getTargetTokenSymbol(targetToken, targetChain);
7984
+ const chainName = getChainName(targetChainId);
7985
+ const tokenSymbol = getTargetTokenSymbol(targetToken, targetChainId);
7932
7986
  onEvent?.({
7933
7987
  type: "deposit_modal_transfer_crypto_cta_click",
7934
7988
  default_chain: chainName,
@@ -8114,8 +8168,8 @@ function DepositFlow({
8114
8168
  defaultAmount: effectiveStep.inputAmountUsd,
8115
8169
  uiConfig,
8116
8170
  targetChain,
8117
- targetChainName: getChainName(targetChain),
8118
- targetTokenSymbol: getTargetTokenSymbol(targetToken, targetChain),
8171
+ targetChainName: getChainName(targetChainId),
8172
+ targetTokenSymbol: getTargetTokenSymbol(targetToken, targetChainId),
8119
8173
  appBalanceUsd,
8120
8174
  onContinue: handleSolanaAmountContinue,
8121
8175
  debug
@@ -8316,7 +8370,7 @@ function DepositFlow({
8316
8370
  service,
8317
8371
  onContinue: handleAmountContinue,
8318
8372
  onCtaClick: (ctaName) => {
8319
- const receiveSymbol = getTargetTokenSymbol(targetToken, targetChain);
8373
+ const receiveSymbol = getTargetTokenSymbol(targetToken, targetChainId);
8320
8374
  onEvent?.({
8321
8375
  type: "deposit_modal_connected_wallet_enter_value_cta_click",
8322
8376
  send_token: effectiveStep.asset.symbol,
@@ -8695,7 +8749,7 @@ DepositHistoryPanel.displayName = "DepositHistoryPanel";
8695
8749
  // src/DepositModal.tsx
8696
8750
  import { jsx as jsx27, jsxs as jsxs24 } from "react/jsx-runtime";
8697
8751
  var ReownDepositInner = lazy2(
8698
- () => import("./DepositModalReown-MTWT6Y66.mjs").then((m) => ({ default: m.DepositModalReown }))
8752
+ () => import("./DepositModalReown-6RVLEM3B.mjs").then((m) => ({ default: m.DepositModalReown }))
8699
8753
  );
8700
8754
  function sortByCreatedAtDesc(items) {
8701
8755
  return [...items].sort((a, b) => {
@@ -8789,7 +8843,7 @@ function DepositModalInner({
8789
8843
  const cursorRef = useRef9(null);
8790
8844
  const historyStaleRef = useRef9(false);
8791
8845
  const historyLoadedRef = useRef9(false);
8792
- const targetChain = targetChainProp === "solana" ? "solana" : getChainId(targetChainProp);
8846
+ const targetChain = targetChainProp === "solana" || targetChainProp === HYPERCORE_SPOT_CAIP2 ? targetChainProp : getChainId(targetChainProp);
8793
8847
  const sourceChain = sourceChainProp ? getChainId(sourceChainProp) : void 0;
8794
8848
  const rpcUrls = useStableRpcUrls(rpcUrlsProp);
8795
8849
  const service = useMemo9(
@@ -8944,7 +8998,7 @@ function DepositModalInner({
8944
8998
  const canGoBack = backHandler !== void 0;
8945
8999
  const hideHeaderChrome = swappedImmersive;
8946
9000
  const modalClassName = `rs-modal${hideHeaderChrome ? " rs-modal--swapped-iframe" : ""}`;
8947
- return /* @__PURE__ */ jsx27(RpcUrlsProvider, { value: rpcUrls, children: /* @__PURE__ */ jsx27(DepositStoreProvider, { store, children: /* @__PURE__ */ jsx27(
9001
+ return /* @__PURE__ */ jsx27(RpcUrlsProvider, { value: rpcUrls, children: /* @__PURE__ */ jsx27(ChainCatalogProvider, { service, rpcUrls, children: /* @__PURE__ */ jsx27(DepositStoreProvider, { store, children: /* @__PURE__ */ jsx27(
8948
9002
  Modal,
8949
9003
  {
8950
9004
  isOpen,
@@ -9043,7 +9097,7 @@ function DepositModalInner({
9043
9097
  )
9044
9098
  ] })
9045
9099
  }
9046
- ) }) });
9100
+ ) }) }) });
9047
9101
  }
9048
9102
 
9049
9103
  export {