@rhinestone/deposit-modal 0.1.53 → 0.1.55

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/dist/{DepositModalReown-LNZ46L4O.mjs → DepositModalReown-5QKEE7R3.mjs} +3 -3
  2. package/dist/{DepositModalReown-OXAW4Y7O.cjs → DepositModalReown-XKP2Z55X.cjs} +4 -4
  3. package/dist/{WithdrawModalReown-V3ZJESQ5.cjs → WithdrawModalReown-CN2NJUYL.cjs} +4 -4
  4. package/dist/{WithdrawModalReown-EE74V66X.mjs → WithdrawModalReown-K57JK52O.mjs} +3 -3
  5. package/dist/{chunk-ZB5Y2ACC.mjs → chunk-AJUR6FAP.mjs} +23 -8
  6. package/dist/{chunk-ZJQZEIHA.mjs → chunk-CIXHTOO3.mjs} +1 -1
  7. package/dist/{chunk-DBBSH7HP.cjs → chunk-EAEDK474.cjs} +58 -32
  8. package/dist/{chunk-REDAO3MS.mjs → chunk-JQTV5JTB.mjs} +37 -11
  9. package/dist/{chunk-47WDWD6Z.cjs → chunk-QJVXCBUI.cjs} +231 -216
  10. package/dist/{chunk-4BL7RCZB.mjs → chunk-QOEACKBH.mjs} +53 -27
  11. package/dist/{chunk-NELAYNA3.cjs → chunk-R6U6BHCV.cjs} +1 -1
  12. package/dist/{chunk-K57KO3SW.cjs → chunk-XMNGYDDB.cjs} +120 -94
  13. package/dist/constants.cjs +2 -2
  14. package/dist/constants.mjs +1 -1
  15. package/dist/deposit.cjs +4 -4
  16. package/dist/deposit.d.cts +2 -2
  17. package/dist/deposit.d.ts +2 -2
  18. package/dist/deposit.mjs +3 -3
  19. package/dist/index.cjs +5 -5
  20. package/dist/index.d.cts +1 -1
  21. package/dist/index.d.ts +1 -1
  22. package/dist/index.mjs +4 -4
  23. package/dist/reown.cjs +5 -5
  24. package/dist/reown.d.cts +1 -1
  25. package/dist/reown.d.ts +1 -1
  26. package/dist/reown.mjs +4 -4
  27. package/dist/styles.css +45 -55
  28. package/dist/{types-D1nvo2dK.d.ts → types-B7UuWCtD.d.ts} +3 -0
  29. package/dist/{types-DgiqazTb.d.cts → types-CL7ec666.d.cts} +3 -0
  30. package/dist/withdraw.cjs +4 -4
  31. package/dist/withdraw.d.cts +2 -2
  32. package/dist/withdraw.d.ts +2 -2
  33. package/dist/withdraw.mjs +3 -3
  34. package/package.json +1 -1
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  DepositModalInner
3
- } from "./chunk-ZB5Y2ACC.mjs";
3
+ } from "./chunk-AJUR6FAP.mjs";
4
4
  import {
5
5
  ReownWalletProvider,
6
6
  useReownWallet
7
7
  } from "./chunk-MBURQ26S.mjs";
8
- import "./chunk-REDAO3MS.mjs";
9
- import "./chunk-ZJQZEIHA.mjs";
8
+ import "./chunk-JQTV5JTB.mjs";
9
+ import "./chunk-CIXHTOO3.mjs";
10
10
 
11
11
  // src/DepositModalReown.tsx
12
12
  import { useCallback, useMemo } from "react";
@@ -1,12 +1,12 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
2
2
 
3
- var _chunk47WDWD6Zcjs = require('./chunk-47WDWD6Z.cjs');
3
+ var _chunkQJVXCBUIcjs = require('./chunk-QJVXCBUI.cjs');
4
4
 
5
5
 
6
6
 
7
7
  var _chunkN2Y34LQOcjs = require('./chunk-N2Y34LQO.cjs');
8
- require('./chunk-DBBSH7HP.cjs');
9
- require('./chunk-NELAYNA3.cjs');
8
+ require('./chunk-EAEDK474.cjs');
9
+ require('./chunk-R6U6BHCV.cjs');
10
10
 
11
11
  // src/DepositModalReown.tsx
12
12
  var _react = require('react');
@@ -32,7 +32,7 @@ function DepositModalWithReown(props) {
32
32
  reown.disconnect();
33
33
  }, [reown.disconnect]);
34
34
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
35
- _chunk47WDWD6Zcjs.DepositModalInner,
35
+ _chunkQJVXCBUIcjs.DepositModalInner,
36
36
  {
37
37
  ...props,
38
38
  reownWallet: reownWithSolana,
@@ -1,12 +1,12 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkK57KO3SWcjs = require('./chunk-K57KO3SW.cjs');
3
+ var _chunkXMNGYDDBcjs = require('./chunk-XMNGYDDB.cjs');
4
4
 
5
5
 
6
6
 
7
7
  var _chunkN2Y34LQOcjs = require('./chunk-N2Y34LQO.cjs');
8
- require('./chunk-DBBSH7HP.cjs');
9
- require('./chunk-NELAYNA3.cjs');
8
+ require('./chunk-EAEDK474.cjs');
9
+ require('./chunk-R6U6BHCV.cjs');
10
10
 
11
11
  // src/WithdrawModalReown.tsx
12
12
  var _react = require('react');
@@ -20,7 +20,7 @@ function WithdrawModalWithReown(props) {
20
20
  reown.disconnect();
21
21
  }, [reown.disconnect]);
22
22
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
23
- _chunkK57KO3SWcjs.WithdrawModalInner,
23
+ _chunkXMNGYDDBcjs.WithdrawModalInner,
24
24
  {
25
25
  ...props,
26
26
  reownWallet: reown,
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  WithdrawModalInner
3
- } from "./chunk-4BL7RCZB.mjs";
3
+ } from "./chunk-QOEACKBH.mjs";
4
4
  import {
5
5
  ReownWalletProvider,
6
6
  useReownWallet
7
7
  } from "./chunk-MBURQ26S.mjs";
8
- import "./chunk-REDAO3MS.mjs";
9
- import "./chunk-ZJQZEIHA.mjs";
8
+ import "./chunk-JQTV5JTB.mjs";
9
+ import "./chunk-CIXHTOO3.mjs";
10
10
 
11
11
  // src/WithdrawModalReown.tsx
12
12
  import { useCallback } from "react";
@@ -25,7 +25,7 @@ import {
25
25
  toEvmCaip2,
26
26
  tokenFormatter,
27
27
  txRefsMatch
28
- } from "./chunk-REDAO3MS.mjs";
28
+ } from "./chunk-JQTV5JTB.mjs";
29
29
  import {
30
30
  DEFAULT_BACKEND_URL,
31
31
  DEFAULT_SIGNER_ADDRESS,
@@ -41,7 +41,7 @@ import {
41
41
  getTokenIcon,
42
42
  getTokenSymbol,
43
43
  isStablecoinSymbol
44
- } from "./chunk-ZJQZEIHA.mjs";
44
+ } from "./chunk-CIXHTOO3.mjs";
45
45
 
46
46
  // src/DepositModal.tsx
47
47
  import {
@@ -1453,11 +1453,23 @@ function DepositAddressStep({
1453
1453
  smartAccount,
1454
1454
  solanaDepositAddress,
1455
1455
  service,
1456
+ allowedRoutes,
1456
1457
  onDepositDetected,
1457
1458
  onError
1458
1459
  }) {
1459
1460
  const hasSolana = Boolean(solanaDepositAddress);
1460
- const evmChainIds = useMemo4(() => getSupportedChainIds(), []);
1461
+ const allowedChainSet = useMemo4(
1462
+ () => allowedRoutes?.sourceChains ? new Set(allowedRoutes.sourceChains) : null,
1463
+ [allowedRoutes?.sourceChains]
1464
+ );
1465
+ const allowedTokenSet = useMemo4(
1466
+ () => allowedRoutes?.sourceTokens ? new Set(allowedRoutes.sourceTokens.map((s) => s.toUpperCase())) : null,
1467
+ [allowedRoutes?.sourceTokens]
1468
+ );
1469
+ const evmChainIds = useMemo4(() => {
1470
+ const all = getSupportedChainIds();
1471
+ return allowedChainSet ? all.filter((id) => allowedChainSet.has(id)) : all;
1472
+ }, [allowedChainSet]);
1461
1473
  const chainOptions = useMemo4(
1462
1474
  () => hasSolana ? [...evmChainIds, "solana"] : evmChainIds,
1463
1475
  [evmChainIds, hasSolana]
@@ -1466,10 +1478,10 @@ function DepositAddressStep({
1466
1478
  const defaultChainId = evmChainIds.includes(BASE_CHAIN_ID) ? BASE_CHAIN_ID : evmChainIds[0];
1467
1479
  const [sourceChainId, setSourceChainId] = useState6(defaultChainId);
1468
1480
  const isSolana = sourceChainId === "solana";
1469
- const tokensForChain = useMemo4(
1470
- () => isSolana ? SOLANA_TOKENS.map((t) => t.symbol) : getTargetTokenSymbolsForChain(sourceChainId),
1471
- [sourceChainId, isSolana]
1472
- );
1481
+ const tokensForChain = useMemo4(() => {
1482
+ const all = isSolana ? SOLANA_TOKENS.map((t) => t.symbol) : getTargetTokenSymbolsForChain(sourceChainId);
1483
+ return allowedTokenSet ? all.filter((s) => allowedTokenSet.has(s.toUpperCase())) : all;
1484
+ }, [sourceChainId, isSolana, allowedTokenSet]);
1473
1485
  const defaultToken = tokensForChain.includes("USDC") ? "USDC" : tokensForChain[0] ?? "USDC";
1474
1486
  const [sourceTokenSymbol, setSourceTokenSymbol] = useState6(defaultToken);
1475
1487
  useEffect6(() => {
@@ -3298,6 +3310,7 @@ function DepositFlow({
3298
3310
  smartAccount: step.smartAccount,
3299
3311
  solanaDepositAddress: enableSolana ? step.solanaDepositAddress : void 0,
3300
3312
  service,
3313
+ allowedRoutes,
3301
3314
  onDepositDetected: handleDepositAddressDetected,
3302
3315
  onError: handleError
3303
3316
  }
@@ -3557,7 +3570,7 @@ function DepositFlow({
3557
3570
  // src/DepositModal.tsx
3558
3571
  import { jsx as jsx11, jsxs as jsxs11 } from "react/jsx-runtime";
3559
3572
  var ReownDepositInner = lazy(
3560
- () => import("./DepositModalReown-LNZ46L4O.mjs").then((m) => ({ default: m.DepositModalReown }))
3573
+ () => import("./DepositModalReown-5QKEE7R3.mjs").then((m) => ({ default: m.DepositModalReown }))
3561
3574
  );
3562
3575
  function DepositModal(props) {
3563
3576
  const needsReown = !!props.reownAppId;
@@ -3593,6 +3606,7 @@ function DepositModalInner({
3593
3606
  isOpen,
3594
3607
  onClose,
3595
3608
  inline,
3609
+ closeOnOverlayClick,
3596
3610
  sourceChain: sourceChainProp,
3597
3611
  sourceToken,
3598
3612
  defaultAmount,
@@ -3682,6 +3696,7 @@ function DepositModalInner({
3682
3696
  onClose,
3683
3697
  className,
3684
3698
  inline,
3699
+ closeOnOverlayClick,
3685
3700
  children: /* @__PURE__ */ jsxs11("div", { ref: modalRef, className: "rs-modal", children: [
3686
3701
  /* @__PURE__ */ jsxs11("div", { className: "rs-modal-header--redesigned", children: [
3687
3702
  /* @__PURE__ */ jsx11("div", { className: "rs-modal-header-nav-left", children: showBackButton && canGoBack && /* @__PURE__ */ jsx11(
@@ -26,7 +26,7 @@ var SUPPORTED_TOKEN_MATRIX = {
26
26
  ETH: [mainnet.id, base.id, arbitrum.id, optimism.id, polygon.id, soneium.id],
27
27
  WETH: [mainnet.id, base.id, arbitrum.id, optimism.id, polygon.id, soneium.id],
28
28
  USDC: [mainnet.id, base.id, arbitrum.id, optimism.id, polygon.id, soneium.id],
29
- USDT: [mainnet.id, arbitrum.id, polygon.id, bsc.id, plasma.id]
29
+ USDT: [mainnet.id, arbitrum.id, optimism.id, polygon.id, bsc.id, plasma.id]
30
30
  };
31
31
  var CHAIN_DISPLAY_ORDER = [
32
32
  mainnet.id,
@@ -8,7 +8,7 @@
8
8
 
9
9
 
10
10
 
11
- var _chunkNELAYNA3cjs = require('./chunk-NELAYNA3.cjs');
11
+ var _chunkR6U6BHCVcjs = require('./chunk-R6U6BHCV.cjs');
12
12
 
13
13
  // src/components/ui/Modal.tsx
14
14
 
@@ -31,7 +31,8 @@ function Modal({
31
31
  onClose,
32
32
  children,
33
33
  className = "",
34
- inline = false
34
+ inline = false,
35
+ closeOnOverlayClick = false
35
36
  }) {
36
37
  const overlayRef = _react.useRef.call(void 0, null);
37
38
  const contentRef = _react.useRef.call(void 0, null);
@@ -95,11 +96,11 @@ function Modal({
95
96
  );
96
97
  const handleOverlayClick = _react.useCallback.call(void 0,
97
98
  (event) => {
98
- if (event.target === overlayRef.current) {
99
+ if (closeOnOverlayClick && event.target === overlayRef.current) {
99
100
  onClose();
100
101
  }
101
102
  },
102
- [onClose]
103
+ [closeOnOverlayClick, onClose]
103
104
  );
104
105
  if (!isOpen) return null;
105
106
  if (inline) {
@@ -620,14 +621,14 @@ function normalizeOrchestratorPortfolio(data) {
620
621
  const unlocked = _nullishCoalesce(_optionalChain([chainBalance, 'access', _17 => _17.balance, 'optionalAccess', _18 => _18.unlocked]), () => ( "0"));
621
622
  const normalizedName = tokenData.tokenName.trim();
622
623
  const isNativeSymbol = normalizedName.toUpperCase() === "ETH" || normalizedName.toUpperCase() === "ETHER";
623
- const tokenAddress = _nullishCoalesce(_nullishCoalesce(chainBalance.tokenAddress, () => ( extractTokenAddress(tokenData, chainBalance.chainId))), () => ( _chunkNELAYNA3cjs.getTokenAddress.call(void 0, tokenData.tokenName, chainBalance.chainId)));
624
- const resolvedTokenAddress = isNativeSymbol ? _chunkNELAYNA3cjs.NATIVE_TOKEN_ADDRESS : tokenAddress;
624
+ const tokenAddress = _nullishCoalesce(_nullishCoalesce(chainBalance.tokenAddress, () => ( extractTokenAddress(tokenData, chainBalance.chainId))), () => ( _chunkR6U6BHCVcjs.getTokenAddress.call(void 0, tokenData.tokenName, chainBalance.chainId)));
625
+ const resolvedTokenAddress = isNativeSymbol ? _chunkR6U6BHCVcjs.NATIVE_TOKEN_ADDRESS : tokenAddress;
625
626
  if (!resolvedTokenAddress) {
626
627
  continue;
627
628
  }
628
- const registrySymbol = _chunkNELAYNA3cjs.getTokenSymbol.call(void 0, resolvedTokenAddress, chainBalance.chainId);
629
+ const registrySymbol = _chunkR6U6BHCVcjs.getTokenSymbol.call(void 0, resolvedTokenAddress, chainBalance.chainId);
629
630
  const symbol = registrySymbol !== "Token" ? registrySymbol : normalizedName || "Token";
630
- const decimals = registrySymbol !== "Token" ? _chunkNELAYNA3cjs.getTokenDecimalsByAddress.call(void 0, resolvedTokenAddress, chainBalance.chainId) : _nullishCoalesce(tokenData.tokenDecimals, () => ( 18));
631
+ const decimals = registrySymbol !== "Token" ? _chunkR6U6BHCVcjs.getTokenDecimalsByAddress.call(void 0, resolvedTokenAddress, chainBalance.chainId) : _nullishCoalesce(tokenData.tokenDecimals, () => ( 18));
631
632
  tokens.push({
632
633
  chainId: chainBalance.chainId,
633
634
  address: resolvedTokenAddress,
@@ -656,14 +657,14 @@ function normalizeDirectToken(token) {
656
657
  const address = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(extractString(token, "address"), () => ( extractString(token, "tokenAddress"))), () => ( extractString(
657
658
  token.token,
658
659
  "address"
659
- ))), () => ( (typeof chainId === "number" ? _chunkNELAYNA3cjs.getTokenAddress.call(void 0, symbol, chainId) : void 0)));
660
+ ))), () => ( (typeof chainId === "number" ? _chunkR6U6BHCVcjs.getTokenAddress.call(void 0, symbol, chainId) : void 0)));
660
661
  if (!address) return null;
661
662
  const balanceUsd = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(extractNumber(token, "balanceUsd"), () => ( extractNumber(token, "usdValue"))), () => ( extractNumber(token, "valueUsd"))), () => ( extractNumericString(token, "balanceUsd"))), () => ( extractNumericString(token, "usdValue"))), () => ( extractNumericString(token, "valueUsd"))), () => ( 0));
662
663
  const isSolanaToken = chainId === "solana";
663
- const registrySymbol = isSolanaToken ? "Token" : _chunkNELAYNA3cjs.getTokenSymbol.call(void 0, address, chainId);
664
+ const registrySymbol = isSolanaToken ? "Token" : _chunkR6U6BHCVcjs.getTokenSymbol.call(void 0, address, chainId);
664
665
  const resolvedSymbol = isSolanaToken ? symbol : registrySymbol !== "Token" ? registrySymbol : symbol;
665
666
  const backendDecimals = _nullishCoalesce(extractNumber(token, "decimals"), () => ( extractNumber(token, "tokenDecimals")));
666
- const resolvedDecimals = !isSolanaToken && registrySymbol !== "Token" ? _chunkNELAYNA3cjs.getTokenDecimalsByAddress.call(void 0, address, chainId) : _nullishCoalesce(backendDecimals, () => ( 18));
667
+ const resolvedDecimals = !isSolanaToken && registrySymbol !== "Token" ? _chunkR6U6BHCVcjs.getTokenDecimalsByAddress.call(void 0, address, chainId) : _nullishCoalesce(backendDecimals, () => ( 18));
667
668
  return {
668
669
  chainId,
669
670
  address,
@@ -766,21 +767,46 @@ function formatUserError(raw) {
766
767
  if (lower.includes("execution reverted")) {
767
768
  return "Transaction would fail on-chain";
768
769
  }
770
+ if (lower.includes("timed out") || lower.includes("took too long")) {
771
+ return "Request timed out \u2014 please try again";
772
+ }
773
+ if (lower.includes("econnrefused") || lower.includes("econnreset") || lower.includes("enotfound") || lower.includes("fetch failed")) {
774
+ return "Service unavailable \u2014 please try again";
775
+ }
769
776
  if (lower.includes("recent blockhash") || lower.includes("latest blockhash")) {
770
777
  return "Solana RPC unavailable \u2014 please retry";
771
778
  }
772
779
  if (lower.includes("network") || lower.includes("disconnected")) {
773
780
  return "Network error \u2014 check your connection";
774
781
  }
775
- const detailsCut = raw.indexOf("\n\nRequest Arguments:");
776
- if (detailsCut !== -1) {
777
- const short = raw.slice(0, detailsCut).trim();
778
- return short.length > 80 ? short.slice(0, 80) + "..." : short;
782
+ if (lower.includes("rate limit") || lower.includes("429")) {
783
+ return "Rate limited \u2014 please try again shortly";
784
+ }
785
+ let cleaned = raw;
786
+ const stripMarkers = [
787
+ "\n\nRequest Arguments:",
788
+ "\nRaw Call Arguments:",
789
+ "\nRequest body:",
790
+ "\nContract Call:",
791
+ "\nDocs:",
792
+ "\nDetails:",
793
+ "\nVersion:",
794
+ "\nURL:"
795
+ ];
796
+ for (const marker of stripMarkers) {
797
+ const idx = cleaned.indexOf(marker);
798
+ if (idx !== -1) {
799
+ cleaned = cleaned.slice(0, idx).trim();
800
+ }
801
+ }
802
+ cleaned = cleaned.replace(/https?:\/\/\S+/g, "").trim();
803
+ if (cleaned.length === 0) {
804
+ return "An unexpected error occurred";
779
805
  }
780
- if (raw.length > 80) {
781
- return raw.slice(0, 80) + "...";
806
+ if (cleaned.length > 120) {
807
+ return cleaned.slice(0, 120) + "...";
782
808
  }
783
- return raw;
809
+ return cleaned;
784
810
  }
785
811
 
786
812
  // src/core/theme.ts
@@ -1732,11 +1758,11 @@ function ProcessingStep({
1732
1758
  const displaySourceChain = _nullishCoalesce(sourceDetails.chainId, () => ( sourceChain));
1733
1759
  const displaySourceToken = _nullishCoalesce(sourceDetails.token, () => ( sourceToken));
1734
1760
  const displayAmount = _nullishCoalesce(sourceDetails.amount, () => ( amount));
1735
- const sourceExplorerUrl = _chunkNELAYNA3cjs.getExplorerTxUrl.call(void 0, displaySourceChain, txHash);
1736
- const destExplorerUrl = destinationTxHash ? _chunkNELAYNA3cjs.getExplorerTxUrl.call(void 0, targetChain, destinationTxHash) : null;
1761
+ const sourceExplorerUrl = _chunkR6U6BHCVcjs.getExplorerTxUrl.call(void 0, displaySourceChain, txHash);
1762
+ const destExplorerUrl = destinationTxHash ? _chunkR6U6BHCVcjs.getExplorerTxUrl.call(void 0, targetChain, destinationTxHash) : null;
1737
1763
  const isEvmSourceToken = /^0x[a-fA-F0-9]{40}$/.test(displaySourceToken);
1738
- const sourceSymbol = displaySourceChain === "solana" ? _nullishCoalesce(providedSourceSymbol, () => ( "SOL")) : isEvmSourceToken ? _chunkNELAYNA3cjs.getTokenSymbol.call(void 0, displaySourceToken, displaySourceChain) : _nullishCoalesce(providedSourceSymbol, () => ( "Token"));
1739
- const sourceDecimals = displaySourceChain === "solana" ? _nullishCoalesce(providedSourceDecimals, () => ( 9)) : isEvmSourceToken ? _chunkNELAYNA3cjs.getTokenDecimalsByAddress.call(void 0,
1764
+ const sourceSymbol = displaySourceChain === "solana" ? _nullishCoalesce(providedSourceSymbol, () => ( "SOL")) : isEvmSourceToken ? _chunkR6U6BHCVcjs.getTokenSymbol.call(void 0, displaySourceToken, displaySourceChain) : _nullishCoalesce(providedSourceSymbol, () => ( "Token"));
1765
+ const sourceDecimals = displaySourceChain === "solana" ? _nullishCoalesce(providedSourceDecimals, () => ( 9)) : isEvmSourceToken ? _chunkR6U6BHCVcjs.getTokenDecimalsByAddress.call(void 0,
1740
1766
  displaySourceToken,
1741
1767
  displaySourceChain
1742
1768
  ) : _nullishCoalesce(providedSourceDecimals, () => ( 18));
@@ -1757,7 +1783,7 @@ function ProcessingStep({
1757
1783
  const activePhaseElapsedMs = isProcessing && activePhaseStartedAt !== void 0 ? timelineNowMs - activePhaseStartedAt : 0;
1758
1784
  const delayPhaseId = isProcessing && currentPhaseId && activePhaseElapsedMs >= SOFT_DELAY_MS[currentPhaseId] ? currentPhaseId : void 0;
1759
1785
  const headerTitle = isFailed ? `${flowCapitalized} could not be completed` : isComplete ? isEarlyComplete ? `${flowCapitalized} confirmed` : `${flowCapitalized} successful` : delayPhaseId === "received" ? "Bridge pending" : delayPhaseId === "bridging" ? "Bridge delayed" : delayPhaseId === "confirming" ? `Confirming ${flowNoun}` : `Submitting transaction...`;
1760
- const headerDescription = isFailed ? _nullishCoalesce(failureMessage, () => ( "The transfer could not be completed.")) : isComplete ? directTransfer ? "Your transfer is complete." : isEarlyComplete ? "The bridge has started. Funds will arrive shortly." : "Your funds were successfully deposited." : delayPhaseId === "received" ? "Funds are in. We are still waiting for the bridge transaction to begin." : delayPhaseId === "bridging" ? "The bridge has started but settlement is taking longer than expected." : delayPhaseId === "confirming" ? "The source transaction has not been picked up yet, but we are still polling automatically." : _optionalChain([state, 'access', _114 => _114.lastEvent, 'optionalAccess', _115 => _115.type]) === "deposit-received" ? "Transfer received. Preparing bridge execution." : _optionalChain([state, 'access', _116 => _116.lastEvent, 'optionalAccess', _117 => _117.type]) === "bridge-started" ? `Bridge started. Sending funds to ${_chunkNELAYNA3cjs.getChainName.call(void 0, targetChain)}.` : "Filling your transaction on the blockchain.";
1786
+ const headerDescription = isFailed ? _nullishCoalesce(failureMessage, () => ( "The transfer could not be completed.")) : isComplete ? directTransfer ? "Your transfer is complete." : isEarlyComplete ? "The bridge has started. Funds will arrive shortly." : "Your funds were successfully deposited." : delayPhaseId === "received" ? "Funds are in. We are still waiting for the bridge transaction to begin." : delayPhaseId === "bridging" ? "The bridge has started but settlement is taking longer than expected." : delayPhaseId === "confirming" ? "The source transaction has not been picked up yet, but we are still polling automatically." : _optionalChain([state, 'access', _114 => _114.lastEvent, 'optionalAccess', _115 => _115.type]) === "deposit-received" ? "Transfer received. Preparing bridge execution." : _optionalChain([state, 'access', _116 => _116.lastEvent, 'optionalAccess', _117 => _117.type]) === "bridge-started" ? `Bridge started. Sending funds to ${_chunkR6U6BHCVcjs.getChainName.call(void 0, targetChain)}.` : "Filling your transaction on the blockchain.";
1761
1787
  const showAlert = !isFailed && (delayPhaseId !== void 0 || hasEscalatedDelay);
1762
1788
  const alertMessage = hasEscalatedDelay ? "Taking longer than expected. You can close this window \u2014 processing continues in the background." : "This step is slower than usual but still processing.";
1763
1789
  const fillStatus = isComplete ? "Successful" : isFailed ? "Failed" : "Processing";
@@ -1839,15 +1865,15 @@ function ProcessingStep({
1839
1865
  className: "rs-card-value",
1840
1866
  style: { display: "flex", alignItems: "center", gap: 6 },
1841
1867
  children: [
1842
- _chunkNELAYNA3cjs.getChainIcon.call(void 0, displaySourceChain) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1868
+ _chunkR6U6BHCVcjs.getChainIcon.call(void 0, displaySourceChain) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1843
1869
  "img",
1844
1870
  {
1845
- src: _chunkNELAYNA3cjs.getChainIcon.call(void 0, displaySourceChain),
1871
+ src: _chunkR6U6BHCVcjs.getChainIcon.call(void 0, displaySourceChain),
1846
1872
  alt: "",
1847
1873
  style: { width: 16, height: 16, borderRadius: 3 }
1848
1874
  }
1849
1875
  ),
1850
- _chunkNELAYNA3cjs.getChainName.call(void 0, displaySourceChain),
1876
+ _chunkR6U6BHCVcjs.getChainName.call(void 0, displaySourceChain),
1851
1877
  sourceExplorerUrl && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1852
1878
  "a",
1853
1879
  {
@@ -1870,15 +1896,15 @@ function ProcessingStep({
1870
1896
  className: "rs-card-value",
1871
1897
  style: { display: "flex", alignItems: "center", gap: 6 },
1872
1898
  children: [
1873
- _chunkNELAYNA3cjs.getChainIcon.call(void 0, targetChain) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1899
+ _chunkR6U6BHCVcjs.getChainIcon.call(void 0, targetChain) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1874
1900
  "img",
1875
1901
  {
1876
- src: _chunkNELAYNA3cjs.getChainIcon.call(void 0, targetChain),
1902
+ src: _chunkR6U6BHCVcjs.getChainIcon.call(void 0, targetChain),
1877
1903
  alt: "",
1878
1904
  style: { width: 16, height: 16, borderRadius: 3 }
1879
1905
  }
1880
1906
  ),
1881
- _chunkNELAYNA3cjs.getChainName.call(void 0, targetChain),
1907
+ _chunkR6U6BHCVcjs.getChainName.call(void 0, targetChain),
1882
1908
  destExplorerUrl && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1883
1909
  "a",
1884
1910
  {
@@ -1902,10 +1928,10 @@ function ProcessingStep({
1902
1928
  className: "rs-card-value",
1903
1929
  style: { display: "flex", alignItems: "center", gap: 6 },
1904
1930
  children: [
1905
- _chunkNELAYNA3cjs.getTokenIcon.call(void 0, sourceSymbol) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1931
+ _chunkR6U6BHCVcjs.getTokenIcon.call(void 0, sourceSymbol) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1906
1932
  "img",
1907
1933
  {
1908
- src: _chunkNELAYNA3cjs.getTokenIcon.call(void 0, sourceSymbol),
1934
+ src: _chunkR6U6BHCVcjs.getTokenIcon.call(void 0, sourceSymbol),
1909
1935
  alt: "",
1910
1936
  style: { width: 16, height: 16, borderRadius: "50%" }
1911
1937
  }
@@ -2020,7 +2046,7 @@ var clientCache = /* @__PURE__ */ new Map();
2020
2046
  function getPublicClient(chainId) {
2021
2047
  let client = clientCache.get(chainId);
2022
2048
  if (!client) {
2023
- const chain = _chunkNELAYNA3cjs.CHAIN_BY_ID[chainId];
2049
+ const chain = _chunkR6U6BHCVcjs.CHAIN_BY_ID[chainId];
2024
2050
  client = _viem.createPublicClient.call(void 0, {
2025
2051
  chain,
2026
2052
  transport: _viem.http.call(void 0, )
@@ -8,7 +8,7 @@ import {
8
8
  getTokenDecimalsByAddress,
9
9
  getTokenIcon,
10
10
  getTokenSymbol
11
- } from "./chunk-ZJQZEIHA.mjs";
11
+ } from "./chunk-CIXHTOO3.mjs";
12
12
 
13
13
  // src/components/ui/Modal.tsx
14
14
  import {
@@ -31,7 +31,8 @@ function Modal({
31
31
  onClose,
32
32
  children,
33
33
  className = "",
34
- inline = false
34
+ inline = false,
35
+ closeOnOverlayClick = false
35
36
  }) {
36
37
  const overlayRef = useRef(null);
37
38
  const contentRef = useRef(null);
@@ -95,11 +96,11 @@ function Modal({
95
96
  );
96
97
  const handleOverlayClick = useCallback(
97
98
  (event) => {
98
- if (event.target === overlayRef.current) {
99
+ if (closeOnOverlayClick && event.target === overlayRef.current) {
99
100
  onClose();
100
101
  }
101
102
  },
102
- [onClose]
103
+ [closeOnOverlayClick, onClose]
103
104
  );
104
105
  if (!isOpen) return null;
105
106
  if (inline) {
@@ -766,21 +767,46 @@ function formatUserError(raw) {
766
767
  if (lower.includes("execution reverted")) {
767
768
  return "Transaction would fail on-chain";
768
769
  }
770
+ if (lower.includes("timed out") || lower.includes("took too long")) {
771
+ return "Request timed out \u2014 please try again";
772
+ }
773
+ if (lower.includes("econnrefused") || lower.includes("econnreset") || lower.includes("enotfound") || lower.includes("fetch failed")) {
774
+ return "Service unavailable \u2014 please try again";
775
+ }
769
776
  if (lower.includes("recent blockhash") || lower.includes("latest blockhash")) {
770
777
  return "Solana RPC unavailable \u2014 please retry";
771
778
  }
772
779
  if (lower.includes("network") || lower.includes("disconnected")) {
773
780
  return "Network error \u2014 check your connection";
774
781
  }
775
- const detailsCut = raw.indexOf("\n\nRequest Arguments:");
776
- if (detailsCut !== -1) {
777
- const short = raw.slice(0, detailsCut).trim();
778
- return short.length > 80 ? short.slice(0, 80) + "..." : short;
782
+ if (lower.includes("rate limit") || lower.includes("429")) {
783
+ return "Rate limited \u2014 please try again shortly";
784
+ }
785
+ let cleaned = raw;
786
+ const stripMarkers = [
787
+ "\n\nRequest Arguments:",
788
+ "\nRaw Call Arguments:",
789
+ "\nRequest body:",
790
+ "\nContract Call:",
791
+ "\nDocs:",
792
+ "\nDetails:",
793
+ "\nVersion:",
794
+ "\nURL:"
795
+ ];
796
+ for (const marker of stripMarkers) {
797
+ const idx = cleaned.indexOf(marker);
798
+ if (idx !== -1) {
799
+ cleaned = cleaned.slice(0, idx).trim();
800
+ }
801
+ }
802
+ cleaned = cleaned.replace(/https?:\/\/\S+/g, "").trim();
803
+ if (cleaned.length === 0) {
804
+ return "An unexpected error occurred";
779
805
  }
780
- if (raw.length > 80) {
781
- return raw.slice(0, 80) + "...";
806
+ if (cleaned.length > 120) {
807
+ return cleaned.slice(0, 120) + "...";
782
808
  }
783
- return raw;
809
+ return cleaned;
784
810
  }
785
811
 
786
812
  // src/core/theme.ts