@rhinestone/deposit-modal 0.1.65 → 0.1.67

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-Y4M3RA73.mjs → DepositModalReown-EYIV6APK.mjs} +3 -3
  2. package/dist/{DepositModalReown-6ZMLUWWD.cjs → DepositModalReown-UPYZN2XA.cjs} +4 -4
  3. package/dist/{WithdrawModalReown-HVBMAUPM.mjs → WithdrawModalReown-6VYKKKJN.mjs} +3 -3
  4. package/dist/{WithdrawModalReown-WJ5SHBV4.cjs → WithdrawModalReown-WHPQDJJJ.cjs} +4 -4
  5. package/dist/{chunk-RKRF7ANK.mjs → chunk-5FDIQNJJ.mjs} +22 -19
  6. package/dist/{chunk-4CZ7W3RS.cjs → chunk-FLVSQDP4.cjs} +181 -132
  7. package/dist/{chunk-GAHX5RAT.mjs → chunk-IUW3SJQT.mjs} +103 -54
  8. package/dist/{chunk-MGV75YLV.cjs → chunk-LTLFJPHO.cjs} +106 -103
  9. package/dist/{chunk-R6U6BHCV.cjs → chunk-MUWVDVY4.cjs} +13 -1
  10. package/dist/{chunk-IYZGLNY6.mjs → chunk-NFE5ZLD3.mjs} +1171 -374
  11. package/dist/{chunk-CIXHTOO3.mjs → chunk-SDZKKUCJ.mjs} +13 -1
  12. package/dist/{chunk-OWV4KVBM.cjs → chunk-UDKZWFCM.cjs} +1251 -454
  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 +696 -34
  28. package/dist/{types-BLIqLF0c.d.ts → types-DGQzvl6v.d.ts} +12 -1
  29. package/dist/{types-7IoN8k-P.d.cts → types-DJ1fzNC7.d.cts} +12 -1
  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 +5 -5
@@ -8,7 +8,7 @@
8
8
 
9
9
 
10
10
 
11
- var _chunkR6U6BHCVcjs = require('./chunk-R6U6BHCV.cjs');
11
+ var _chunkMUWVDVY4cjs = require('./chunk-MUWVDVY4.cjs');
12
12
 
13
13
  // src/components/ui/Modal.tsx
14
14
 
@@ -595,21 +595,61 @@ function createDepositService(baseUrl, options) {
595
595
  txHash: _optionalChain([result, 'optionalAccess', _15 => _15.txHash]) ? shortRef(result.txHash) : void 0
596
596
  });
597
597
  return result;
598
+ },
599
+ async fetchDepositHistory(params) {
600
+ const searchParams = new URLSearchParams({ account: params.account });
601
+ searchParams.set("limit", String(_nullishCoalesce(params.limit, () => ( 20))));
602
+ if (params.cursor) {
603
+ searchParams.set("cursor", params.cursor);
604
+ }
605
+ const url = apiUrl(`/deposits?${searchParams.toString()}`);
606
+ debugLog(debug, scope, "fetchDepositHistory:request", {
607
+ url,
608
+ account: shortRef(params.account),
609
+ cursor: params.cursor
610
+ });
611
+ const response = await fetch(url, {
612
+ method: "GET",
613
+ headers: { "Content-Type": "application/json" },
614
+ cache: "no-store"
615
+ });
616
+ if (!response.ok) {
617
+ const error = await response.json().catch(() => ({ error: "Unknown error" }));
618
+ debugError(
619
+ debug,
620
+ scope,
621
+ "fetchDepositHistory:failed",
622
+ error,
623
+ { status: response.status, account: shortRef(params.account) }
624
+ );
625
+ throw new Error(
626
+ error.error || `Deposit history fetch failed: ${response.status}`
627
+ );
628
+ }
629
+ const data = await response.json();
630
+ const deposits = Array.isArray(_optionalChain([data, 'optionalAccess', _16 => _16.deposits])) ? data.deposits : [];
631
+ const nextCursor = _nullishCoalesce(_nullishCoalesce(_optionalChain([data, 'optionalAccess', _17 => _17.nextCursor]), () => ( _optionalChain([data, 'optionalAccess', _18 => _18.next_cursor]))), () => ( null));
632
+ debugLog(debug, scope, "fetchDepositHistory:success", {
633
+ account: shortRef(params.account),
634
+ count: deposits.length,
635
+ hasMore: Boolean(nextCursor)
636
+ });
637
+ return { deposits, nextCursor };
598
638
  }
599
639
  };
600
640
  }
601
641
  function normalizeDirectPortfolio(data) {
602
642
  const rawTokens = _nullishCoalesce(_nullishCoalesce(extractArray(data, "tokens"), () => ( extractArray(
603
- _optionalChain([data, 'optionalAccess', _16 => _16.data]),
643
+ _optionalChain([data, 'optionalAccess', _19 => _19.data]),
604
644
  "tokens"
605
645
  ))), () => ( []));
606
- const totalUsd = _nullishCoalesce(_nullishCoalesce(extractNumber(data, "totalUsd"), () => ( extractNumber(_optionalChain([data, 'optionalAccess', _17 => _17.data]), "totalUsd"))), () => ( 0));
646
+ const totalUsd = _nullishCoalesce(_nullishCoalesce(extractNumber(data, "totalUsd"), () => ( extractNumber(_optionalChain([data, 'optionalAccess', _20 => _20.data]), "totalUsd"))), () => ( 0));
607
647
  const tokens = rawTokens.map((token) => normalizeDirectToken(token)).filter((token) => Boolean(token));
608
648
  return { tokens, totalUsd };
609
649
  }
610
650
  function extractOrchestratorPortfolio(data) {
611
651
  const portfolio = _nullishCoalesce(extractArray(data, "portfolio"), () => ( extractArray(
612
- _optionalChain([data, 'optionalAccess', _18 => _18.data]),
652
+ _optionalChain([data, 'optionalAccess', _21 => _21.data]),
613
653
  "portfolio"
614
654
  )));
615
655
  if (!portfolio || !Array.isArray(portfolio)) return null;
@@ -620,17 +660,17 @@ function normalizeOrchestratorPortfolio(data) {
620
660
  for (const tokenData of data.portfolio || []) {
621
661
  const chainBalances = _nullishCoalesce(_nullishCoalesce(tokenData.tokenChainBalance, () => ( tokenData.chainBalances)), () => ( []));
622
662
  for (const chainBalance of chainBalances) {
623
- const unlocked = _nullishCoalesce(_optionalChain([chainBalance, 'access', _19 => _19.balance, 'optionalAccess', _20 => _20.unlocked]), () => ( "0"));
663
+ const unlocked = _nullishCoalesce(_optionalChain([chainBalance, 'access', _22 => _22.balance, 'optionalAccess', _23 => _23.unlocked]), () => ( "0"));
624
664
  const normalizedName = tokenData.tokenName.trim();
625
665
  const isNativeSymbol = normalizedName.toUpperCase() === "ETH" || normalizedName.toUpperCase() === "ETHER";
626
- const tokenAddress = _nullishCoalesce(_nullishCoalesce(chainBalance.tokenAddress, () => ( extractTokenAddress(tokenData, chainBalance.chainId))), () => ( _chunkR6U6BHCVcjs.getTokenAddress.call(void 0, tokenData.tokenName, chainBalance.chainId)));
627
- const resolvedTokenAddress = isNativeSymbol ? _chunkR6U6BHCVcjs.NATIVE_TOKEN_ADDRESS : tokenAddress;
666
+ const tokenAddress = _nullishCoalesce(_nullishCoalesce(chainBalance.tokenAddress, () => ( extractTokenAddress(tokenData, chainBalance.chainId))), () => ( _chunkMUWVDVY4cjs.getTokenAddress.call(void 0, tokenData.tokenName, chainBalance.chainId)));
667
+ const resolvedTokenAddress = isNativeSymbol ? _chunkMUWVDVY4cjs.NATIVE_TOKEN_ADDRESS : tokenAddress;
628
668
  if (!resolvedTokenAddress) {
629
669
  continue;
630
670
  }
631
- const registrySymbol = _chunkR6U6BHCVcjs.getTokenSymbol.call(void 0, resolvedTokenAddress, chainBalance.chainId);
671
+ const registrySymbol = _chunkMUWVDVY4cjs.getTokenSymbol.call(void 0, resolvedTokenAddress, chainBalance.chainId);
632
672
  const symbol = registrySymbol !== "Token" ? registrySymbol : normalizedName || "Token";
633
- const decimals = registrySymbol !== "Token" ? _chunkR6U6BHCVcjs.getTokenDecimalsByAddress.call(void 0, resolvedTokenAddress, chainBalance.chainId) : _nullishCoalesce(tokenData.tokenDecimals, () => ( 18));
673
+ const decimals = registrySymbol !== "Token" ? _chunkMUWVDVY4cjs.getTokenDecimalsByAddress.call(void 0, resolvedTokenAddress, chainBalance.chainId) : _nullishCoalesce(tokenData.tokenDecimals, () => ( 18));
634
674
  tokens.push({
635
675
  chainId: chainBalance.chainId,
636
676
  address: resolvedTokenAddress,
@@ -654,19 +694,19 @@ function normalizeDirectToken(token) {
654
694
  if (chainId === null) return null;
655
695
  const symbol = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(extractString(token, "symbol"), () => ( extractString(token, "tokenSymbol"))), () => ( extractString(token, "tokenName"))), () => ( extractString(token, "name")));
656
696
  if (!symbol) return null;
657
- const balanceValue = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(extractString(token, "balance"), () => ( extractString(token, "amount"))), () => ( extractString(token, "value"))), () => ( extractString(token, "rawBalance"))), () => ( _optionalChain([extractNumber, 'call', _21 => _21(token, "balance"), 'optionalAccess', _22 => _22.toString, 'call', _23 => _23()]))), () => ( _optionalChain([extractNumber, 'call', _24 => _24(token, "amount"), 'optionalAccess', _25 => _25.toString, 'call', _26 => _26()]))), () => ( _optionalChain([extractNumber, 'call', _27 => _27(token, "value"), 'optionalAccess', _28 => _28.toString, 'call', _29 => _29()]))), () => ( _optionalChain([extractNumber, 'call', _30 => _30(token, "rawBalance"), 'optionalAccess', _31 => _31.toString, 'call', _32 => _32()])));
697
+ const balanceValue = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(extractString(token, "balance"), () => ( extractString(token, "amount"))), () => ( extractString(token, "value"))), () => ( extractString(token, "rawBalance"))), () => ( _optionalChain([extractNumber, 'call', _24 => _24(token, "balance"), 'optionalAccess', _25 => _25.toString, 'call', _26 => _26()]))), () => ( _optionalChain([extractNumber, 'call', _27 => _27(token, "amount"), 'optionalAccess', _28 => _28.toString, 'call', _29 => _29()]))), () => ( _optionalChain([extractNumber, 'call', _30 => _30(token, "value"), 'optionalAccess', _31 => _31.toString, 'call', _32 => _32()]))), () => ( _optionalChain([extractNumber, 'call', _33 => _33(token, "rawBalance"), 'optionalAccess', _34 => _34.toString, 'call', _35 => _35()])));
658
698
  if (!balanceValue) return null;
659
699
  const address = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(extractString(token, "address"), () => ( extractString(token, "tokenAddress"))), () => ( extractString(
660
700
  token.token,
661
701
  "address"
662
- ))), () => ( (typeof chainId === "number" ? _chunkR6U6BHCVcjs.getTokenAddress.call(void 0, symbol, chainId) : void 0)));
702
+ ))), () => ( (typeof chainId === "number" ? _chunkMUWVDVY4cjs.getTokenAddress.call(void 0, symbol, chainId) : void 0)));
663
703
  if (!address) return null;
664
704
  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));
665
705
  const isSolanaToken = chainId === "solana";
666
- const registrySymbol = isSolanaToken ? "Token" : _chunkR6U6BHCVcjs.getTokenSymbol.call(void 0, address, chainId);
706
+ const registrySymbol = isSolanaToken ? "Token" : _chunkMUWVDVY4cjs.getTokenSymbol.call(void 0, address, chainId);
667
707
  const resolvedSymbol = isSolanaToken ? symbol : registrySymbol !== "Token" ? registrySymbol : symbol;
668
708
  const backendDecimals = _nullishCoalesce(extractNumber(token, "decimals"), () => ( extractNumber(token, "tokenDecimals")));
669
- const resolvedDecimals = !isSolanaToken && registrySymbol !== "Token" ? _chunkR6U6BHCVcjs.getTokenDecimalsByAddress.call(void 0, address, chainId) : _nullishCoalesce(backendDecimals, () => ( 18));
709
+ const resolvedDecimals = !isSolanaToken && registrySymbol !== "Token" ? _chunkMUWVDVY4cjs.getTokenDecimalsByAddress.call(void 0, address, chainId) : _nullishCoalesce(backendDecimals, () => ( 18));
670
710
  return {
671
711
  chainId,
672
712
  address,
@@ -679,7 +719,7 @@ function normalizeDirectToken(token) {
679
719
  }
680
720
  function extractTokenAddress(tokenData, chainId) {
681
721
  const token = tokenData;
682
- return _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(token.tokenAddress, () => ( token.address)), () => ( _optionalChain([token, 'access', _33 => _33.addresses, 'optionalAccess', _34 => _34[chainId]]))), () => ( _optionalChain([token, 'access', _35 => _35.token, 'optionalAccess', _36 => _36.address]))), () => ( _optionalChain([token, 'access', _37 => _37.token, 'optionalAccess', _38 => _38.addresses, 'optionalAccess', _39 => _39[chainId]])));
722
+ return _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(token.tokenAddress, () => ( token.address)), () => ( _optionalChain([token, 'access', _36 => _36.addresses, 'optionalAccess', _37 => _37[chainId]]))), () => ( _optionalChain([token, 'access', _38 => _38.token, 'optionalAccess', _39 => _39.address]))), () => ( _optionalChain([token, 'access', _40 => _40.token, 'optionalAccess', _41 => _41.addresses, 'optionalAccess', _42 => _42[chainId]])));
683
723
  }
684
724
  function extractArray(data, key) {
685
725
  if (!data || typeof data !== "object") return null;
@@ -837,19 +877,19 @@ function setVar(targets, prop, value) {
837
877
  function applyTheme(element, theme) {
838
878
  if (!element) return;
839
879
  const parent = element.parentElement;
840
- const targets = _optionalChain([parent, 'optionalAccess', _40 => _40.classList, 'access', _41 => _41.contains, 'call', _42 => _42("rs-modal-content")]) ? [element, parent] : [element];
841
- if (_optionalChain([theme, 'optionalAccess', _43 => _43.mode])) {
880
+ const targets = _optionalChain([parent, 'optionalAccess', _43 => _43.classList, 'access', _44 => _44.contains, 'call', _45 => _45("rs-modal-content")]) ? [element, parent] : [element];
881
+ if (_optionalChain([theme, 'optionalAccess', _46 => _46.mode])) {
842
882
  element.setAttribute("data-theme", theme.mode);
843
883
  } else {
844
884
  element.removeAttribute("data-theme");
845
885
  }
846
- if (_optionalChain([theme, 'optionalAccess', _44 => _44.fontColor])) {
886
+ if (_optionalChain([theme, 'optionalAccess', _47 => _47.fontColor])) {
847
887
  setVar(targets, "--rs-foreground", theme.fontColor);
848
888
  }
849
- if (_optionalChain([theme, 'optionalAccess', _45 => _45.iconColor])) {
889
+ if (_optionalChain([theme, 'optionalAccess', _48 => _48.iconColor])) {
850
890
  setVar(targets, "--rs-icon", theme.iconColor);
851
891
  }
852
- if (_optionalChain([theme, 'optionalAccess', _46 => _46.ctaColor])) {
892
+ if (_optionalChain([theme, 'optionalAccess', _49 => _49.ctaColor])) {
853
893
  setVar(targets, "--rs-primary", theme.ctaColor);
854
894
  setVar(targets, "--rs-border-accent", theme.ctaColor);
855
895
  setVar(
@@ -857,17 +897,17 @@ function applyTheme(element, theme) {
857
897
  "--rs-primary-hover",
858
898
  _nullishCoalesce(theme.ctaHoverColor, () => ( theme.ctaColor))
859
899
  );
860
- } else if (_optionalChain([theme, 'optionalAccess', _47 => _47.ctaHoverColor])) {
900
+ } else if (_optionalChain([theme, 'optionalAccess', _50 => _50.ctaHoverColor])) {
861
901
  setVar(targets, "--rs-primary-hover", theme.ctaHoverColor);
862
902
  }
863
- if (_optionalChain([theme, 'optionalAccess', _48 => _48.borderColor])) {
903
+ if (_optionalChain([theme, 'optionalAccess', _51 => _51.borderColor])) {
864
904
  setVar(targets, "--rs-border", theme.borderColor);
865
905
  setVar(targets, "--rs-border-surface", theme.borderColor);
866
906
  }
867
- if (_optionalChain([theme, 'optionalAccess', _49 => _49.backgroundColor])) {
907
+ if (_optionalChain([theme, 'optionalAccess', _52 => _52.backgroundColor])) {
868
908
  setVar(targets, "--rs-background", theme.backgroundColor);
869
909
  }
870
- if (_optionalChain([theme, 'optionalAccess', _50 => _50.radius])) {
910
+ if (_optionalChain([theme, 'optionalAccess', _53 => _53.radius])) {
871
911
  const scale = RADIUS_SCALE[theme.radius];
872
912
  setVar(targets, "--rs-radius-sm", scale.sm);
873
913
  setVar(targets, "--rs-radius-md", scale.md);
@@ -983,13 +1023,14 @@ function ExternalLinkIcon() {
983
1023
  ] });
984
1024
  }
985
1025
  function TransferIcon() {
986
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1026
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
987
1027
  "path",
988
1028
  {
989
- fillRule: "evenodd",
990
- clipRule: "evenodd",
991
- d: "M9.99256 0.0706115C10.2112 0.195503 10.3185 0.457071 10.2527 0.704513L8.80705 6.13519H14.0826C14.2993 6.13519 14.4954 6.26695 14.5818 6.47064C14.6682 6.67433 14.6284 6.91113 14.4805 7.07349L6.85913 15.4396C6.68832 15.6271 6.41472 15.6711 6.19607 15.5462C5.97742 15.4213 5.87009 15.1598 5.93595 14.9123L7.38158 9.48164H2.10607C1.8893 9.48164 1.69319 9.34988 1.60679 9.14619C1.5204 8.9425 1.56019 8.7057 1.7081 8.54334L9.32949 0.177204C9.5003 -0.0102968 9.77391 -0.0542802 9.99256 0.0706115Z",
992
- fill: "currentColor"
1029
+ d: "M6.18056 9.99924H10V13.8187M3.13264 9.99924H3.125M6.95208 13.8187H6.94444M10.0076 16.8742H10M16.8826 9.99924H16.875M3.125 13.8187H4.27083M12.6736 9.99924H14.2014M3.125 16.8742H6.94444M10 2.36035V6.94369M14.2778 16.8742H15.6528C16.0806 16.8742 16.2945 16.8742 16.4579 16.791C16.6016 16.7177 16.7185 16.6009 16.7917 16.4572C16.875 16.2937 16.875 16.0798 16.875 15.652V14.277C16.875 13.8492 16.875 13.6353 16.7917 13.4719C16.7185 13.3282 16.6016 13.2113 16.4579 13.1381C16.2945 13.0548 16.0806 13.0548 15.6528 13.0548H14.2778C13.85 13.0548 13.6361 13.0548 13.4726 13.1381C13.3289 13.2113 13.2121 13.3282 13.1388 13.4719C13.0556 13.6353 13.0556 13.8492 13.0556 14.277V15.652C13.0556 16.0798 13.0556 16.2937 13.1388 16.4572C13.2121 16.6009 13.3289 16.7177 13.4726 16.791C13.6361 16.8742 13.85 16.8742 14.2778 16.8742ZM14.2778 6.94369H15.6528C16.0806 6.94369 16.2945 6.94369 16.4579 6.86043C16.6016 6.78719 16.7185 6.67033 16.7917 6.52659C16.875 6.36319 16.875 6.14928 16.875 5.72146V4.34646C16.875 3.91864 16.875 3.70474 16.7917 3.54133C16.7185 3.3976 16.6016 3.28074 16.4579 3.2075C16.2945 3.12424 16.0806 3.12424 15.6528 3.12424H14.2778C13.85 3.12424 13.6361 3.12424 13.4726 3.2075C13.3289 3.28074 13.2121 3.3976 13.1388 3.54133C13.0556 3.70474 13.0556 3.91864 13.0556 4.34646V5.72146C13.0556 6.14928 13.0556 6.36319 13.1388 6.52659C13.2121 6.67033 13.3289 6.78719 13.4726 6.86043C13.6361 6.94369 13.85 6.94369 14.2778 6.94369ZM4.34722 6.94369H5.72222C6.15004 6.94369 6.36395 6.94369 6.52735 6.86043C6.67109 6.78719 6.78795 6.67033 6.86119 6.52659C6.94444 6.36319 6.94444 6.14928 6.94444 5.72146V4.34646C6.94444 3.91864 6.94444 3.70474 6.86119 3.54133C6.78795 3.3976 6.67109 3.28074 6.52735 3.2075C6.36395 3.12424 6.15004 3.12424 5.72222 3.12424H4.34722C3.9194 3.12424 3.7055 3.12424 3.54209 3.2075C3.39836 3.28074 3.2815 3.3976 3.20826 3.54133C3.125 3.70474 3.125 3.91864 3.125 4.34646V5.72146C3.125 6.14928 3.125 6.36319 3.20826 6.52659C3.2815 6.67033 3.39836 6.78719 3.54209 6.86043C3.7055 6.94369 3.9194 6.94369 4.34722 6.94369Z",
1030
+ stroke: "currentColor",
1031
+ strokeWidth: "1.5",
1032
+ strokeLinecap: "round",
1033
+ strokeLinejoin: "round"
993
1034
  }
994
1035
  ) });
995
1036
  }
@@ -1033,16 +1074,16 @@ function ConnectStep({
1033
1074
  continueButtonLabel = "Continue",
1034
1075
  connectButtonLabel = "Connect external wallet"
1035
1076
  }) {
1036
- const hasWalletOptions = (_nullishCoalesce(_optionalChain([walletOptions, 'optionalAccess', _51 => _51.length]), () => ( 0))) > 0;
1077
+ const hasWalletOptions = (_nullishCoalesce(_optionalChain([walletOptions, 'optionalAccess', _54 => _54.length]), () => ( 0))) > 0;
1037
1078
  if (hasWalletOptions) {
1038
- const hasReownWallet = _nullishCoalesce(_optionalChain([walletOptions, 'optionalAccess', _52 => _52.some, 'call', _53 => _53(
1079
+ const hasReownWallet = _nullishCoalesce(_optionalChain([walletOptions, 'optionalAccess', _55 => _55.some, 'call', _56 => _56(
1039
1080
  (option) => option.kind === "external" || option.kind === "solana"
1040
1081
  )]), () => ( false));
1041
1082
  const showConnectDifferentWalletOption = Boolean(onConnect) && !hasReownWallet;
1042
1083
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-step", children: [
1043
1084
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-connect-centered rs-connect-centered--wallets", children: [
1044
1085
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-connect-wallet-list", children: [
1045
- _optionalChain([walletOptions, 'optionalAccess', _54 => _54.map, 'call', _55 => _55((option) => {
1086
+ _optionalChain([walletOptions, 'optionalAccess', _57 => _57.map, 'call', _58 => _58((option) => {
1046
1087
  const isSelected = option.id === selectedWalletId;
1047
1088
  const rawAddress = _nullishCoalesce(_nullishCoalesce(option.address, () => ( option.solanaAddress)), () => ( option.id));
1048
1089
  const shortAddress = rawAddress.length > 12 ? `${rawAddress.slice(0, 6)}...${rawAddress.slice(-4)}` : rawAddress;
@@ -1051,7 +1092,7 @@ function ConnectStep({
1051
1092
  {
1052
1093
  type: "button",
1053
1094
  className: `rs-connect-wallet-row ${isSelected ? "rs-connect-wallet-row--selected" : ""}`,
1054
- onClick: () => _optionalChain([onSelectWallet, 'optionalCall', _56 => _56(option.id)]),
1095
+ onClick: () => _optionalChain([onSelectWallet, 'optionalCall', _59 => _59(option.id)]),
1055
1096
  children: [
1056
1097
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1057
1098
  "div",
@@ -1062,7 +1103,7 @@ function ConnectStep({
1062
1103
  {
1063
1104
  src: option.icon,
1064
1105
  alt: option.label,
1065
- style: { width: 18, height: 18, borderRadius: 4 }
1106
+ style: { width: 24, height: 24, borderRadius: 6 }
1066
1107
  }
1067
1108
  ) : rowIcon(option.kind)
1068
1109
  }
@@ -1110,7 +1151,7 @@ function ConnectStep({
1110
1151
  }
1111
1152
  )
1112
1153
  ] }),
1113
- (onDisconnect || onConnect) && _optionalChain([walletOptions, 'optionalAccess', _57 => _57.some, 'call', _58 => _58(
1154
+ (onDisconnect || onConnect) && _optionalChain([walletOptions, 'optionalAccess', _60 => _60.some, 'call', _61 => _61(
1114
1155
  (option) => option.kind === "external" || option.kind === "solana"
1115
1156
  )]) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1116
1157
  "button",
@@ -1327,7 +1368,7 @@ function asNumber(value) {
1327
1368
  const trimmed = value.trim();
1328
1369
  if (!trimmed) return void 0;
1329
1370
  const caipMatch = trimmed.match(/^eip155:(\d+)$/);
1330
- if (_optionalChain([caipMatch, 'optionalAccess', _59 => _59[1]])) {
1371
+ if (_optionalChain([caipMatch, 'optionalAccess', _62 => _62[1]])) {
1331
1372
  const parsed2 = Number(caipMatch[1]);
1332
1373
  return Number.isFinite(parsed2) ? parsed2 : void 0;
1333
1374
  }
@@ -1346,28 +1387,28 @@ function asAddress(value) {
1346
1387
  return /^0x[a-fA-F0-9]{40}$/.test(value) ? value : void 0;
1347
1388
  }
1348
1389
  function getEventTxHash(event) {
1349
- if (!_optionalChain([event, 'optionalAccess', _60 => _60.type])) return void 0;
1390
+ if (!_optionalChain([event, 'optionalAccess', _63 => _63.type])) return void 0;
1350
1391
  if (event.type === "deposit-received") {
1351
- return asString(_optionalChain([event, 'access', _61 => _61.data, 'optionalAccess', _62 => _62.transactionHash]));
1392
+ return asString(_optionalChain([event, 'access', _64 => _64.data, 'optionalAccess', _65 => _65.transactionHash]));
1352
1393
  }
1353
1394
  if (event.type === "bridge-started" || event.type === "bridge-complete") {
1354
- const deposit = isRecord(_optionalChain([event, 'access', _63 => _63.data, 'optionalAccess', _64 => _64.deposit])) ? event.data.deposit : void 0;
1355
- const source = isRecord(_optionalChain([event, 'access', _65 => _65.data, 'optionalAccess', _66 => _66.source])) ? event.data.source : void 0;
1356
- return _nullishCoalesce(asString(_optionalChain([deposit, 'optionalAccess', _67 => _67.transactionHash])), () => ( asString(_optionalChain([source, 'optionalAccess', _68 => _68.transactionHash]))));
1395
+ const deposit = isRecord(_optionalChain([event, 'access', _66 => _66.data, 'optionalAccess', _67 => _67.deposit])) ? event.data.deposit : void 0;
1396
+ const source = isRecord(_optionalChain([event, 'access', _68 => _68.data, 'optionalAccess', _69 => _69.source])) ? event.data.source : void 0;
1397
+ return _nullishCoalesce(asString(_optionalChain([deposit, 'optionalAccess', _70 => _70.transactionHash])), () => ( asString(_optionalChain([source, 'optionalAccess', _71 => _71.transactionHash]))));
1357
1398
  }
1358
1399
  if (event.type === "bridge-failed" || event.type === "error") {
1359
- const deposit = isRecord(_optionalChain([event, 'access', _69 => _69.data, 'optionalAccess', _70 => _70.deposit])) ? event.data.deposit : void 0;
1360
- const source = isRecord(_optionalChain([event, 'access', _71 => _71.data, 'optionalAccess', _72 => _72.source])) ? event.data.source : void 0;
1361
- return _nullishCoalesce(asString(_optionalChain([deposit, 'optionalAccess', _73 => _73.transactionHash])), () => ( asString(_optionalChain([source, 'optionalAccess', _74 => _74.transactionHash]))));
1400
+ const deposit = isRecord(_optionalChain([event, 'access', _72 => _72.data, 'optionalAccess', _73 => _73.deposit])) ? event.data.deposit : void 0;
1401
+ const source = isRecord(_optionalChain([event, 'access', _74 => _74.data, 'optionalAccess', _75 => _75.source])) ? event.data.source : void 0;
1402
+ return _nullishCoalesce(asString(_optionalChain([deposit, 'optionalAccess', _76 => _76.transactionHash])), () => ( asString(_optionalChain([source, 'optionalAccess', _77 => _77.transactionHash]))));
1362
1403
  }
1363
1404
  if (event.type === "post-bridge-swap-complete" || event.type === "post-bridge-swap-failed") {
1364
- const deposit = isRecord(_optionalChain([event, 'access', _75 => _75.data, 'optionalAccess', _76 => _76.deposit])) ? event.data.deposit : void 0;
1365
- return asString(_optionalChain([deposit, 'optionalAccess', _77 => _77.transactionHash]));
1405
+ const deposit = isRecord(_optionalChain([event, 'access', _78 => _78.data, 'optionalAccess', _79 => _79.deposit])) ? event.data.deposit : void 0;
1406
+ return asString(_optionalChain([deposit, 'optionalAccess', _80 => _80.transactionHash]));
1366
1407
  }
1367
1408
  return void 0;
1368
1409
  }
1369
1410
  function getEventSourceDetails(event) {
1370
- if (!_optionalChain([event, 'optionalAccess', _78 => _78.type]) || !isRecord(event.data)) return {};
1411
+ if (!_optionalChain([event, 'optionalAccess', _81 => _81.type]) || !isRecord(event.data)) return {};
1371
1412
  if (event.type === "deposit-received") {
1372
1413
  return {
1373
1414
  chainId: asNumber(event.data.chain),
@@ -1379,15 +1420,15 @@ function getEventSourceDetails(event) {
1379
1420
  const deposit = isRecord(event.data.deposit) ? event.data.deposit : void 0;
1380
1421
  if (event.type === "bridge-started" || event.type === "bridge-complete" || event.type === "bridge-failed" || event.type === "error" || event.type === "post-bridge-swap-complete" || event.type === "post-bridge-swap-failed") {
1381
1422
  return {
1382
- chainId: _nullishCoalesce(asNumber(_optionalChain([source, 'optionalAccess', _79 => _79.chain])), () => ( asNumber(_optionalChain([deposit, 'optionalAccess', _80 => _80.chain])))),
1383
- amount: _nullishCoalesce(asAmount(_optionalChain([source, 'optionalAccess', _81 => _81.amount])), () => ( asAmount(_optionalChain([deposit, 'optionalAccess', _82 => _82.amount])))),
1384
- token: _nullishCoalesce(_nullishCoalesce(asAddress(_optionalChain([source, 'optionalAccess', _83 => _83.asset])), () => ( asAddress(_optionalChain([deposit, 'optionalAccess', _84 => _84.asset])))), () => ( asAddress(_optionalChain([deposit, 'optionalAccess', _85 => _85.token]))))
1423
+ chainId: _nullishCoalesce(asNumber(_optionalChain([source, 'optionalAccess', _82 => _82.chain])), () => ( asNumber(_optionalChain([deposit, 'optionalAccess', _83 => _83.chain])))),
1424
+ amount: _nullishCoalesce(asAmount(_optionalChain([source, 'optionalAccess', _84 => _84.amount])), () => ( asAmount(_optionalChain([deposit, 'optionalAccess', _85 => _85.amount])))),
1425
+ token: _nullishCoalesce(_nullishCoalesce(asAddress(_optionalChain([source, 'optionalAccess', _86 => _86.asset])), () => ( asAddress(_optionalChain([deposit, 'optionalAccess', _87 => _87.asset])))), () => ( asAddress(_optionalChain([deposit, 'optionalAccess', _88 => _88.token]))))
1385
1426
  };
1386
1427
  }
1387
1428
  return {};
1388
1429
  }
1389
1430
  function isDepositEvent(event) {
1390
- return _optionalChain([event, 'optionalAccess', _86 => _86.type]) === "deposit-received" || _optionalChain([event, 'optionalAccess', _87 => _87.type]) === "bridge-started" || _optionalChain([event, 'optionalAccess', _88 => _88.type]) === "bridge-complete" || _optionalChain([event, 'optionalAccess', _89 => _89.type]) === "bridge-failed" || _optionalChain([event, 'optionalAccess', _90 => _90.type]) === "post-bridge-swap-complete" || _optionalChain([event, 'optionalAccess', _91 => _91.type]) === "post-bridge-swap-failed" || _optionalChain([event, 'optionalAccess', _92 => _92.type]) === "error";
1431
+ return _optionalChain([event, 'optionalAccess', _89 => _89.type]) === "deposit-received" || _optionalChain([event, 'optionalAccess', _90 => _90.type]) === "bridge-started" || _optionalChain([event, 'optionalAccess', _91 => _91.type]) === "bridge-complete" || _optionalChain([event, 'optionalAccess', _92 => _92.type]) === "bridge-failed" || _optionalChain([event, 'optionalAccess', _93 => _93.type]) === "post-bridge-swap-complete" || _optionalChain([event, 'optionalAccess', _94 => _94.type]) === "post-bridge-swap-failed" || _optionalChain([event, 'optionalAccess', _95 => _95.type]) === "error";
1391
1432
  }
1392
1433
  function isHexString(value) {
1393
1434
  return value.startsWith("0x") || value.startsWith("0X");
@@ -1442,7 +1483,7 @@ function isEventForTx(event, txHash) {
1442
1483
  return txRefsMatch(eventTxHash, txHash);
1443
1484
  }
1444
1485
  function formatBridgeFailedMessage(event) {
1445
- const eventData = _nullishCoalesce(_optionalChain([event, 'optionalAccess', _93 => _93.data]), () => ( {}));
1486
+ const eventData = _nullishCoalesce(_optionalChain([event, 'optionalAccess', _96 => _96.data]), () => ( {}));
1446
1487
  const code = typeof eventData.errorCode === "string" ? eventData.errorCode : void 0;
1447
1488
  const backendMessage = typeof eventData.message === "string" ? eventData.message.trim() : "";
1448
1489
  function toUserFacingFailure(raw) {
@@ -1474,12 +1515,12 @@ function formatBridgeFailedMessage(event) {
1474
1515
  return { message: "Bridge failed" };
1475
1516
  }
1476
1517
  function parseWebhookTimestamp(event) {
1477
- if (typeof _optionalChain([event, 'optionalAccess', _94 => _94.time]) !== "string") return void 0;
1518
+ if (typeof _optionalChain([event, 'optionalAccess', _97 => _97.time]) !== "string") return void 0;
1478
1519
  const timestamp = Date.parse(event.time);
1479
1520
  return Number.isFinite(timestamp) ? timestamp : void 0;
1480
1521
  }
1481
1522
  function syncPhaseTimings(previous, event) {
1482
- if (!_optionalChain([event, 'optionalAccess', _95 => _95.type])) return previous;
1523
+ if (!_optionalChain([event, 'optionalAccess', _98 => _98.type])) return previous;
1483
1524
  const timestamp = _nullishCoalesce(parseWebhookTimestamp(event), () => ( Date.now()));
1484
1525
  const setReceived = (event.type === "deposit-received" || event.type === "bridge-started" || event.type === "bridge-complete" || event.type === "bridge-failed" || event.type === "post-bridge-swap-complete" || event.type === "post-bridge-swap-failed" || event.type === "error") && previous.receivedAt === void 0;
1485
1526
  const setBridging = (event.type === "bridge-started" || event.type === "bridge-complete" || event.type === "post-bridge-swap-complete") && previous.bridgingAt === void 0;
@@ -1520,9 +1561,9 @@ function getCurrentPhaseId(state, phaseTimings, isEarlyComplete) {
1520
1561
  if (state.type === "complete") {
1521
1562
  return void 0;
1522
1563
  }
1523
- if (_optionalChain([state, 'access', _96 => _96.lastEvent, 'optionalAccess', _97 => _97.type]) === "bridge-started" || _optionalChain([state, 'access', _98 => _98.lastEvent, 'optionalAccess', _99 => _99.type]) === "bridge-complete")
1564
+ if (_optionalChain([state, 'access', _99 => _99.lastEvent, 'optionalAccess', _100 => _100.type]) === "bridge-started" || _optionalChain([state, 'access', _101 => _101.lastEvent, 'optionalAccess', _102 => _102.type]) === "bridge-complete")
1524
1565
  return "bridging";
1525
- if (_optionalChain([state, 'access', _100 => _100.lastEvent, 'optionalAccess', _101 => _101.type]) === "deposit-received") return "received";
1566
+ if (_optionalChain([state, 'access', _103 => _103.lastEvent, 'optionalAccess', _104 => _104.type]) === "deposit-received") return "received";
1526
1567
  return "confirming";
1527
1568
  }
1528
1569
  function ProcessingStep({
@@ -1551,6 +1592,18 @@ function ProcessingStep({
1551
1592
  const pollIntervalRef = _react.useRef.call(void 0, INITIAL_POLL_INTERVAL);
1552
1593
  const pollTimeoutRef = _react.useRef.call(void 0, null);
1553
1594
  const escalatedDelayRef = _react.useRef.call(void 0, false);
1595
+ const processingContextRef = useLatestRef({
1596
+ amount,
1597
+ sourceChain,
1598
+ sourceToken,
1599
+ targetChain,
1600
+ targetToken,
1601
+ waitForFinalTx,
1602
+ hasPostBridgeActions
1603
+ });
1604
+ const onDepositCompleteRef = useLatestRef(onDepositComplete);
1605
+ const onDepositFailedRef = useLatestRef(onDepositFailed);
1606
+ const onErrorRef = useLatestRef(onError);
1554
1607
  const [state, setState] = _react.useState.call(void 0,
1555
1608
  directTransfer ? { type: "complete" } : { type: "processing" }
1556
1609
  );
@@ -1576,23 +1629,20 @@ function ProcessingStep({
1576
1629
  txHash,
1577
1630
  flowLabel
1578
1631
  });
1579
- _optionalChain([onDepositComplete, 'optionalCall', _102 => _102(txHash, void 0, {
1580
- amount,
1581
- sourceChain,
1582
- sourceToken,
1583
- targetChain,
1584
- targetToken
1632
+ const context = processingContextRef.current;
1633
+ _optionalChain([onDepositCompleteRef, 'access', _105 => _105.current, 'optionalCall', _106 => _106(txHash, void 0, {
1634
+ amount: context.amount,
1635
+ sourceChain: context.sourceChain,
1636
+ sourceToken: context.sourceToken,
1637
+ targetChain: context.targetChain,
1638
+ targetToken: context.targetToken
1585
1639
  })]);
1586
1640
  }, [
1587
- amount,
1588
1641
  debug,
1589
1642
  directTransfer,
1590
1643
  flowLabel,
1591
- onDepositComplete,
1592
- sourceChain,
1593
- sourceToken,
1594
- targetChain,
1595
- targetToken,
1644
+ onDepositCompleteRef,
1645
+ processingContextRef,
1596
1646
  txHash
1597
1647
  ]);
1598
1648
  _react.useEffect.call(void 0, () => {
@@ -1617,7 +1667,7 @@ function ProcessingStep({
1617
1667
  _react.useEffect.call(void 0, () => {
1618
1668
  if (!state.lastEvent) return;
1619
1669
  setPhaseTimings((previous) => syncPhaseTimings(previous, state.lastEvent));
1620
- }, [_optionalChain([state, 'access', _103 => _103.lastEvent, 'optionalAccess', _104 => _104.time]), _optionalChain([state, 'access', _105 => _105.lastEvent, 'optionalAccess', _106 => _106.type])]);
1670
+ }, [_optionalChain([state, 'access', _107 => _107.lastEvent, 'optionalAccess', _108 => _108.time]), _optionalChain([state, 'access', _109 => _109.lastEvent, 'optionalAccess', _110 => _110.type])]);
1621
1671
  _react.useEffect.call(void 0, () => {
1622
1672
  savePhaseTimings(txHash, phaseTimings);
1623
1673
  }, [txHash, phaseTimings]);
@@ -1644,29 +1694,30 @@ function ProcessingStep({
1644
1694
  debugLog(debug, "processing", "poll:event", {
1645
1695
  type: lastEvent2.type,
1646
1696
  matchesTx: eventMatchesTx,
1647
- intentId: _optionalChain([eventData, 'optionalAccess', _107 => _107.intentId])
1697
+ intentId: _optionalChain([eventData, 'optionalAccess', _111 => _111.intentId])
1648
1698
  });
1649
1699
  }
1650
1700
  if (!isMounted) return;
1651
- const awaitingPostBridgeSwap = waitForFinalTx && hasPostBridgeActions;
1652
- if (_optionalChain([eventForCurrentTx, 'optionalAccess', _108 => _108.type]) === "post-bridge-swap-complete") {
1701
+ const awaitingPostBridgeSwap = processingContextRef.current.waitForFinalTx && processingContextRef.current.hasPostBridgeActions;
1702
+ if (_optionalChain([eventForCurrentTx, 'optionalAccess', _112 => _112.type]) === "post-bridge-swap-complete") {
1653
1703
  setState({ type: "complete", lastEvent: eventForCurrentTx });
1654
- const swapTxHash = _optionalChain([eventForCurrentTx, 'access', _109 => _109.data, 'optionalAccess', _110 => _110.swap, 'optionalAccess', _111 => _111.transactionHash]);
1704
+ const swapTxHash = _optionalChain([eventForCurrentTx, 'access', _113 => _113.data, 'optionalAccess', _114 => _114.swap, 'optionalAccess', _115 => _115.transactionHash]);
1655
1705
  debugLog(debug, "processing", "state:complete", {
1656
1706
  txHash,
1657
1707
  destinationTxHash: swapTxHash,
1658
1708
  event: eventForCurrentTx.type
1659
1709
  });
1660
- _optionalChain([onDepositComplete, 'optionalCall', _112 => _112(txHash, swapTxHash, {
1661
- amount,
1662
- sourceChain,
1663
- sourceToken,
1664
- targetChain,
1665
- targetToken
1710
+ const context = processingContextRef.current;
1711
+ _optionalChain([onDepositCompleteRef, 'access', _116 => _116.current, 'optionalCall', _117 => _117(txHash, swapTxHash, {
1712
+ amount: context.amount,
1713
+ sourceChain: context.sourceChain,
1714
+ sourceToken: context.sourceToken,
1715
+ targetChain: context.targetChain,
1716
+ targetToken: context.targetToken
1666
1717
  })]);
1667
1718
  return;
1668
1719
  }
1669
- if (_optionalChain([eventForCurrentTx, 'optionalAccess', _113 => _113.type]) === "post-bridge-swap-failed") {
1720
+ if (_optionalChain([eventForCurrentTx, 'optionalAccess', _118 => _118.type]) === "post-bridge-swap-failed") {
1670
1721
  const formatted = formatBridgeFailedMessage(eventForCurrentTx);
1671
1722
  setState({
1672
1723
  type: "failed",
@@ -1678,42 +1729,44 @@ function ProcessingStep({
1678
1729
  message: formatted.message,
1679
1730
  code: formatted.code
1680
1731
  });
1681
- _optionalChain([onDepositFailed, 'optionalCall', _114 => _114(txHash, formatted.message)]);
1732
+ _optionalChain([onDepositFailedRef, 'access', _119 => _119.current, 'optionalCall', _120 => _120(txHash, formatted.message)]);
1682
1733
  return;
1683
1734
  }
1684
- if (_optionalChain([eventForCurrentTx, 'optionalAccess', _115 => _115.type]) === "bridge-complete" && !awaitingPostBridgeSwap) {
1735
+ if (_optionalChain([eventForCurrentTx, 'optionalAccess', _121 => _121.type]) === "bridge-complete" && !awaitingPostBridgeSwap) {
1685
1736
  setState({ type: "complete", lastEvent: eventForCurrentTx });
1686
- const destinationTxHash2 = _optionalChain([eventForCurrentTx, 'access', _116 => _116.data, 'optionalAccess', _117 => _117.destination, 'optionalAccess', _118 => _118.transactionHash]);
1737
+ const destinationTxHash2 = _optionalChain([eventForCurrentTx, 'access', _122 => _122.data, 'optionalAccess', _123 => _123.destination, 'optionalAccess', _124 => _124.transactionHash]);
1687
1738
  debugLog(debug, "processing", "state:complete", {
1688
1739
  txHash,
1689
1740
  destinationTxHash: destinationTxHash2,
1690
1741
  event: eventForCurrentTx.type
1691
1742
  });
1692
- _optionalChain([onDepositComplete, 'optionalCall', _119 => _119(txHash, destinationTxHash2, {
1693
- amount,
1694
- sourceChain,
1695
- sourceToken,
1696
- targetChain,
1697
- targetToken
1743
+ const context = processingContextRef.current;
1744
+ _optionalChain([onDepositCompleteRef, 'access', _125 => _125.current, 'optionalCall', _126 => _126(txHash, destinationTxHash2, {
1745
+ amount: context.amount,
1746
+ sourceChain: context.sourceChain,
1747
+ sourceToken: context.sourceToken,
1748
+ targetChain: context.targetChain,
1749
+ targetToken: context.targetToken
1698
1750
  })]);
1699
1751
  return;
1700
1752
  }
1701
- if (!waitForFinalTx && _optionalChain([eventForCurrentTx, 'optionalAccess', _120 => _120.type]) === "bridge-started") {
1753
+ if (!waitForFinalTx && _optionalChain([eventForCurrentTx, 'optionalAccess', _127 => _127.type]) === "bridge-started") {
1702
1754
  setState({ type: "complete", lastEvent: eventForCurrentTx });
1703
1755
  debugLog(debug, "processing", "state:early-complete", {
1704
1756
  txHash,
1705
1757
  event: eventForCurrentTx.type
1706
1758
  });
1707
- _optionalChain([onDepositComplete, 'optionalCall', _121 => _121(txHash, void 0, {
1708
- amount,
1709
- sourceChain,
1710
- sourceToken,
1711
- targetChain,
1712
- targetToken
1759
+ const context = processingContextRef.current;
1760
+ _optionalChain([onDepositCompleteRef, 'access', _128 => _128.current, 'optionalCall', _129 => _129(txHash, void 0, {
1761
+ amount: context.amount,
1762
+ sourceChain: context.sourceChain,
1763
+ sourceToken: context.sourceToken,
1764
+ targetChain: context.targetChain,
1765
+ targetToken: context.targetToken
1713
1766
  })]);
1714
1767
  return;
1715
1768
  }
1716
- if (_optionalChain([eventForCurrentTx, 'optionalAccess', _122 => _122.type]) === "bridge-failed") {
1769
+ if (_optionalChain([eventForCurrentTx, 'optionalAccess', _130 => _130.type]) === "bridge-failed") {
1717
1770
  const formatted = formatBridgeFailedMessage(eventForCurrentTx);
1718
1771
  setState({
1719
1772
  type: "failed",
@@ -1725,11 +1778,11 @@ function ProcessingStep({
1725
1778
  message: formatted.message,
1726
1779
  code: formatted.code
1727
1780
  });
1728
- _optionalChain([onDepositFailed, 'optionalCall', _123 => _123(txHash, formatted.message)]);
1781
+ _optionalChain([onDepositFailedRef, 'access', _131 => _131.current, 'optionalCall', _132 => _132(txHash, formatted.message)]);
1729
1782
  return;
1730
1783
  }
1731
- if (_optionalChain([eventForCurrentTx, 'optionalAccess', _124 => _124.type]) === "error") {
1732
- const errorMessage = _nullishCoalesce(_optionalChain([eventForCurrentTx, 'access', _125 => _125.data, 'optionalAccess', _126 => _126.message]), () => ( "Unknown error"));
1784
+ if (_optionalChain([eventForCurrentTx, 'optionalAccess', _133 => _133.type]) === "error") {
1785
+ const errorMessage = _nullishCoalesce(_optionalChain([eventForCurrentTx, 'access', _134 => _134.data, 'optionalAccess', _135 => _135.message]), () => ( "Unknown error"));
1733
1786
  setState({
1734
1787
  type: "failed",
1735
1788
  message: errorMessage,
@@ -1739,7 +1792,7 @@ function ProcessingStep({
1739
1792
  txHash,
1740
1793
  message: errorMessage
1741
1794
  });
1742
- _optionalChain([onDepositFailed, 'optionalCall', _127 => _127(txHash, errorMessage)]);
1795
+ _optionalChain([onDepositFailedRef, 'access', _136 => _136.current, 'optionalCall', _137 => _137(txHash, errorMessage)]);
1743
1796
  return;
1744
1797
  }
1745
1798
  setState((previous) => ({
@@ -1777,21 +1830,15 @@ function ProcessingStep({
1777
1830
  }
1778
1831
  };
1779
1832
  }, [
1780
- amount,
1781
1833
  debug,
1782
1834
  directTransfer,
1783
- hasPostBridgeActions,
1784
- onDepositComplete,
1785
- onDepositFailed,
1835
+ onDepositCompleteRef,
1836
+ onDepositFailedRef,
1837
+ processingContextRef,
1786
1838
  service,
1787
1839
  smartAccount,
1788
- sourceChain,
1789
- sourceToken,
1790
1840
  state.type,
1791
- targetChain,
1792
- targetToken,
1793
- txHash,
1794
- waitForFinalTx
1841
+ txHash
1795
1842
  ]);
1796
1843
  _react.useEffect.call(void 0, () => {
1797
1844
  if (directTransfer || state.type !== "processing") return;
@@ -1804,32 +1851,32 @@ function ProcessingStep({
1804
1851
  txHash,
1805
1852
  timeoutMs: ESCALATED_DELAY_MS
1806
1853
  });
1807
- _optionalChain([onError, 'optionalCall', _128 => _128(message, "PROCESS_TIMEOUT")]);
1854
+ _optionalChain([onErrorRef, 'access', _138 => _138.current, 'optionalCall', _139 => _139(message, "PROCESS_TIMEOUT")]);
1808
1855
  }, ESCALATED_DELAY_MS);
1809
1856
  return () => clearTimeout(timeoutId);
1810
- }, [debug, directTransfer, onError, state.type, txHash]);
1857
+ }, [debug, directTransfer, onErrorRef, state.type, txHash]);
1811
1858
  const isComplete = state.type === "complete";
1812
1859
  const isFailed = state.type === "failed";
1813
1860
  const isProcessing = state.type === "processing";
1814
1861
  const lastEvent = state.lastEvent;
1815
1862
  const failureMessage = state.type === "failed" ? state.message : void 0;
1816
- const isEarlyComplete = !waitForFinalTx && _optionalChain([lastEvent, 'optionalAccess', _129 => _129.type]) === "bridge-started";
1863
+ const isEarlyComplete = !waitForFinalTx && _optionalChain([lastEvent, 'optionalAccess', _140 => _140.type]) === "bridge-started";
1817
1864
  const timelineNowMs = _nullishCoalesce(phaseTimings.endedAt, () => ( Date.now()));
1818
1865
  const flowNoun = flowLabel === "withdraw" ? "withdrawal" : "deposit";
1819
1866
  const flowCapitalized = flowLabel === "withdraw" ? "Withdrawal" : "Deposit";
1820
- const isPostBridgeSwapEvent = _optionalChain([lastEvent, 'optionalAccess', _130 => _130.type]) === "post-bridge-swap-complete" || _optionalChain([lastEvent, 'optionalAccess', _131 => _131.type]) === "post-bridge-swap-failed";
1821
- const destinationTxHash = isPostBridgeSwapEvent ? _optionalChain([lastEvent, 'optionalAccess', _132 => _132.data, 'optionalAccess', _133 => _133.swap, 'optionalAccess', _134 => _134.transactionHash]) || null : _optionalChain([lastEvent, 'optionalAccess', _135 => _135.data, 'optionalAccess', _136 => _136.destination, 'optionalAccess', _137 => _137.transactionHash]) || null;
1822
- const bridgeTxHash = isPostBridgeSwapEvent ? _optionalChain([lastEvent, 'optionalAccess', _138 => _138.data, 'optionalAccess', _139 => _139.bridge, 'optionalAccess', _140 => _140.transactionHash]) || null : null;
1867
+ const isPostBridgeSwapEvent = _optionalChain([lastEvent, 'optionalAccess', _141 => _141.type]) === "post-bridge-swap-complete" || _optionalChain([lastEvent, 'optionalAccess', _142 => _142.type]) === "post-bridge-swap-failed";
1868
+ const destinationTxHash = isPostBridgeSwapEvent ? _optionalChain([lastEvent, 'optionalAccess', _143 => _143.data, 'optionalAccess', _144 => _144.swap, 'optionalAccess', _145 => _145.transactionHash]) || null : _optionalChain([lastEvent, 'optionalAccess', _146 => _146.data, 'optionalAccess', _147 => _147.destination, 'optionalAccess', _148 => _148.transactionHash]) || null;
1869
+ const bridgeTxHash = isPostBridgeSwapEvent ? _optionalChain([lastEvent, 'optionalAccess', _149 => _149.data, 'optionalAccess', _150 => _150.bridge, 'optionalAccess', _151 => _151.transactionHash]) || null : null;
1823
1870
  const sourceDetails = getEventSourceDetails(lastEvent);
1824
1871
  const displaySourceChain = _nullishCoalesce(sourceDetails.chainId, () => ( sourceChain));
1825
1872
  const displaySourceToken = _nullishCoalesce(sourceDetails.token, () => ( sourceToken));
1826
1873
  const displayAmount = _nullishCoalesce(sourceDetails.amount, () => ( amount));
1827
- const sourceExplorerUrl = _chunkR6U6BHCVcjs.getExplorerTxUrl.call(void 0, displaySourceChain, txHash);
1828
- const bridgeExplorerUrl = bridgeTxHash ? _chunkR6U6BHCVcjs.getExplorerTxUrl.call(void 0, targetChain, bridgeTxHash) : null;
1829
- const destExplorerUrl = destinationTxHash ? _chunkR6U6BHCVcjs.getExplorerTxUrl.call(void 0, targetChain, destinationTxHash) : null;
1874
+ const sourceExplorerUrl = _chunkMUWVDVY4cjs.getExplorerTxUrl.call(void 0, displaySourceChain, txHash);
1875
+ const bridgeExplorerUrl = bridgeTxHash ? _chunkMUWVDVY4cjs.getExplorerTxUrl.call(void 0, targetChain, bridgeTxHash) : null;
1876
+ const destExplorerUrl = destinationTxHash ? _chunkMUWVDVY4cjs.getExplorerTxUrl.call(void 0, targetChain, destinationTxHash) : null;
1830
1877
  const isEvmSourceToken = /^0x[a-fA-F0-9]{40}$/.test(displaySourceToken);
1831
- const sourceSymbol = displaySourceChain === "solana" ? _nullishCoalesce(providedSourceSymbol, () => ( "SOL")) : isEvmSourceToken ? _chunkR6U6BHCVcjs.getTokenSymbol.call(void 0, displaySourceToken, displaySourceChain) : _nullishCoalesce(providedSourceSymbol, () => ( "Token"));
1832
- const sourceDecimals = displaySourceChain === "solana" ? _nullishCoalesce(providedSourceDecimals, () => ( 9)) : isEvmSourceToken ? _chunkR6U6BHCVcjs.getTokenDecimalsByAddress.call(void 0,
1878
+ const sourceSymbol = displaySourceChain === "solana" ? _nullishCoalesce(providedSourceSymbol, () => ( "SOL")) : isEvmSourceToken ? _chunkMUWVDVY4cjs.getTokenSymbol.call(void 0, displaySourceToken, displaySourceChain) : _nullishCoalesce(providedSourceSymbol, () => ( "Token"));
1879
+ const sourceDecimals = displaySourceChain === "solana" ? _nullishCoalesce(providedSourceDecimals, () => ( 9)) : isEvmSourceToken ? _chunkMUWVDVY4cjs.getTokenDecimalsByAddress.call(void 0,
1833
1880
  displaySourceToken,
1834
1881
  displaySourceChain
1835
1882
  ) : _nullishCoalesce(providedSourceDecimals, () => ( 18));
@@ -1850,7 +1897,7 @@ function ProcessingStep({
1850
1897
  const activePhaseElapsedMs = isProcessing && activePhaseStartedAt !== void 0 ? timelineNowMs - activePhaseStartedAt : 0;
1851
1898
  const delayPhaseId = isProcessing && currentPhaseId && activePhaseElapsedMs >= SOFT_DELAY_MS[currentPhaseId] ? currentPhaseId : void 0;
1852
1899
  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...`;
1853
- 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', _141 => _141.lastEvent, 'optionalAccess', _142 => _142.type]) === "deposit-received" ? "Transfer received. Preparing bridge execution." : _optionalChain([state, 'access', _143 => _143.lastEvent, 'optionalAccess', _144 => _144.type]) === "bridge-started" ? `Bridge started. Sending funds to ${_chunkR6U6BHCVcjs.getChainName.call(void 0, targetChain)}.` : "Filling your transaction on the blockchain.";
1900
+ 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', _152 => _152.lastEvent, 'optionalAccess', _153 => _153.type]) === "deposit-received" ? "Transfer received. Preparing bridge execution." : _optionalChain([state, 'access', _154 => _154.lastEvent, 'optionalAccess', _155 => _155.type]) === "bridge-started" ? `Bridge started. Sending funds to ${_chunkMUWVDVY4cjs.getChainName.call(void 0, targetChain)}.` : "Filling your transaction on the blockchain.";
1854
1901
  const showAlert = !isFailed && (delayPhaseId !== void 0 || hasEscalatedDelay);
1855
1902
  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.";
1856
1903
  const fillStatus = isComplete ? "Successful" : isFailed ? "Failed" : "Processing";
@@ -1932,15 +1979,15 @@ function ProcessingStep({
1932
1979
  className: "rs-card-value",
1933
1980
  style: { display: "flex", alignItems: "center", gap: 6 },
1934
1981
  children: [
1935
- _chunkR6U6BHCVcjs.getChainIcon.call(void 0, displaySourceChain) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1982
+ _chunkMUWVDVY4cjs.getChainIcon.call(void 0, displaySourceChain) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1936
1983
  "img",
1937
1984
  {
1938
- src: _chunkR6U6BHCVcjs.getChainIcon.call(void 0, displaySourceChain),
1985
+ src: _chunkMUWVDVY4cjs.getChainIcon.call(void 0, displaySourceChain),
1939
1986
  alt: "",
1940
1987
  style: { width: 16, height: 16, borderRadius: 3 }
1941
1988
  }
1942
1989
  ),
1943
- _chunkR6U6BHCVcjs.getChainName.call(void 0, displaySourceChain),
1990
+ _chunkMUWVDVY4cjs.getChainName.call(void 0, displaySourceChain),
1944
1991
  sourceExplorerUrl && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1945
1992
  "a",
1946
1993
  {
@@ -1963,15 +2010,15 @@ function ProcessingStep({
1963
2010
  className: "rs-card-value",
1964
2011
  style: { display: "flex", alignItems: "center", gap: 6 },
1965
2012
  children: [
1966
- _chunkR6U6BHCVcjs.getChainIcon.call(void 0, targetChain) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2013
+ _chunkMUWVDVY4cjs.getChainIcon.call(void 0, targetChain) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1967
2014
  "img",
1968
2015
  {
1969
- src: _chunkR6U6BHCVcjs.getChainIcon.call(void 0, targetChain),
2016
+ src: _chunkMUWVDVY4cjs.getChainIcon.call(void 0, targetChain),
1970
2017
  alt: "",
1971
2018
  style: { width: 16, height: 16, borderRadius: 3 }
1972
2019
  }
1973
2020
  ),
1974
- _chunkR6U6BHCVcjs.getChainName.call(void 0, targetChain),
2021
+ _chunkMUWVDVY4cjs.getChainName.call(void 0, targetChain),
1975
2022
  destExplorerUrl && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1976
2023
  "a",
1977
2024
  {
@@ -1995,10 +2042,10 @@ function ProcessingStep({
1995
2042
  className: "rs-card-value",
1996
2043
  style: { display: "flex", alignItems: "center", gap: 6 },
1997
2044
  children: [
1998
- _chunkR6U6BHCVcjs.getTokenIcon.call(void 0, sourceSymbol) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2045
+ _chunkMUWVDVY4cjs.getTokenIcon.call(void 0, sourceSymbol) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1999
2046
  "img",
2000
2047
  {
2001
- src: _chunkR6U6BHCVcjs.getTokenIcon.call(void 0, sourceSymbol),
2048
+ src: _chunkMUWVDVY4cjs.getTokenIcon.call(void 0, sourceSymbol),
2002
2049
  alt: "",
2003
2050
  style: { width: 16, height: 16, borderRadius: "50%" }
2004
2051
  }
@@ -2130,7 +2177,7 @@ var clientCache = /* @__PURE__ */ new Map();
2130
2177
  function getPublicClient(chainId) {
2131
2178
  let client = clientCache.get(chainId);
2132
2179
  if (!client) {
2133
- const chain = _chunkR6U6BHCVcjs.CHAIN_BY_ID[chainId];
2180
+ const chain = _chunkMUWVDVY4cjs.CHAIN_BY_ID[chainId];
2134
2181
  client = _viem.createPublicClient.call(void 0, {
2135
2182
  chain,
2136
2183
  transport: _viem.http.call(void 0, )
@@ -2168,4 +2215,6 @@ function getPublicClient(chainId) {
2168
2215
 
2169
2216
 
2170
2217
 
2171
- exports.Modal = Modal; exports.Spinner = Spinner; exports.Button = Button; exports.ConnectStep = ConnectStep; exports.debugLog = debugLog; exports.debugError = debugError; exports.toEvmCaip2 = toEvmCaip2; exports.buildSessionDetails = buildSessionDetails; exports.createDepositService = createDepositService; exports.getAssetId = getAssetId; exports.portfolioToAssets = portfolioToAssets; exports.isNativeAsset = isNativeAsset; exports.loadSessionOwnerFromStorage = loadSessionOwnerFromStorage; exports.saveSessionOwnerToStorage = saveSessionOwnerToStorage; exports.createSessionOwnerKey = createSessionOwnerKey; exports.accountFromPrivateKey = accountFromPrivateKey; exports.PoweredBy = PoweredBy; exports.currencyFormatter = currencyFormatter; exports.tokenFormatter = tokenFormatter; exports.formatUserError = formatUserError; exports.getEventTxHash = getEventTxHash; exports.isDepositEvent = isDepositEvent; exports.txRefsMatch = txRefsMatch; exports.ProcessingStep = ProcessingStep; exports.getPublicClient = getPublicClient; exports.useLatestRef = useLatestRef; exports.applyTheme = applyTheme;
2218
+
2219
+
2220
+ exports.Modal = Modal; exports.Spinner = Spinner; exports.Button = Button; exports.ConnectStep = ConnectStep; exports.debugLog = debugLog; exports.debugError = debugError; exports.toEvmCaip2 = toEvmCaip2; exports.parseEvmChainId = parseEvmChainId; exports.isSolanaCaip2 = isSolanaCaip2; exports.buildSessionDetails = buildSessionDetails; exports.createDepositService = createDepositService; exports.getAssetId = getAssetId; exports.portfolioToAssets = portfolioToAssets; exports.isNativeAsset = isNativeAsset; exports.loadSessionOwnerFromStorage = loadSessionOwnerFromStorage; exports.saveSessionOwnerToStorage = saveSessionOwnerToStorage; exports.createSessionOwnerKey = createSessionOwnerKey; exports.accountFromPrivateKey = accountFromPrivateKey; exports.PoweredBy = PoweredBy; exports.currencyFormatter = currencyFormatter; exports.tokenFormatter = tokenFormatter; exports.formatUserError = formatUserError; exports.getEventTxHash = getEventTxHash; exports.isDepositEvent = isDepositEvent; exports.txRefsMatch = txRefsMatch; exports.useLatestRef = useLatestRef; exports.ProcessingStep = ProcessingStep; exports.getPublicClient = getPublicClient; exports.applyTheme = applyTheme;