@rhinestone/deposit-modal 0.3.0-alpha.12 → 0.3.0-alpha.14

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 (31) hide show
  1. package/README.md +59 -0
  2. package/dist/{DepositModalReown-EC4DJ3EC.cjs → DepositModalReown-4I47KSPN.cjs} +6 -6
  3. package/dist/{DepositModalReown-QOTUF4JC.mjs → DepositModalReown-DIUIB3MU.mjs} +3 -3
  4. package/dist/{QRCode-KG47KTGX.cjs → QRCode-5DXFNKI2.cjs} +1 -1
  5. package/dist/{QRCode-YJ3EGWQS.mjs → QRCode-WUC652SH.mjs} +1 -1
  6. package/dist/{WithdrawModalReown-QEQPCSWT.mjs → WithdrawModalReown-WRUEALDP.mjs} +3 -3
  7. package/dist/{WithdrawModalReown-Z5JVENP6.cjs → WithdrawModalReown-Y3NRAKXJ.cjs} +6 -6
  8. package/dist/{chunk-YI63OMXN.cjs → chunk-2NUXDEEO.cjs} +57 -57
  9. package/dist/{chunk-I5G5ULRP.cjs → chunk-3CYGTYMY.cjs} +1322 -320
  10. package/dist/{chunk-WVE3JN3C.mjs → chunk-4ZN726P5.mjs} +345 -54
  11. package/dist/{chunk-QXIJLRKC.mjs → chunk-JTMGFWXO.mjs} +1 -1
  12. package/dist/{chunk-FGVSNARE.cjs → chunk-JTULAFMU.cjs} +2 -2
  13. package/dist/{chunk-2TWQGPPB.cjs → chunk-N4XRQPVA.cjs} +374 -83
  14. package/dist/{chunk-7MZNQ4C2.mjs → chunk-VD4WTEHP.mjs} +2 -2
  15. package/dist/{chunk-HR6BABPX.mjs → chunk-XG474KUR.mjs} +1433 -431
  16. package/dist/deposit.cjs +3 -3
  17. package/dist/deposit.d.cts +2 -2
  18. package/dist/deposit.d.ts +2 -2
  19. package/dist/deposit.mjs +2 -2
  20. package/dist/index.cjs +4 -4
  21. package/dist/index.d.cts +1 -1
  22. package/dist/index.d.ts +1 -1
  23. package/dist/index.mjs +3 -3
  24. package/dist/styles.css +525 -66
  25. package/dist/{types-D6wrO4Ow.d.cts → types-C8i2ebY1.d.cts} +25 -0
  26. package/dist/{types-D6wrO4Ow.d.ts → types-C8i2ebY1.d.ts} +25 -0
  27. package/dist/withdraw.cjs +3 -3
  28. package/dist/withdraw.d.cts +2 -2
  29. package/dist/withdraw.d.ts +2 -2
  30. package/dist/withdraw.mjs +2 -2
  31. package/package.json +3 -3
@@ -47,7 +47,12 @@
47
47
 
48
48
 
49
49
 
50
- var _chunk2TWQGPPBcjs = require('./chunk-2TWQGPPB.cjs');
50
+
51
+
52
+
53
+
54
+
55
+ var _chunkN4XRQPVAcjs = require('./chunk-N4XRQPVA.cjs');
51
56
 
52
57
 
53
58
 
@@ -84,6 +89,13 @@ var _react = require('react');
84
89
 
85
90
  // src/DepositFlow.tsx
86
91
 
92
+
93
+
94
+
95
+
96
+
97
+
98
+
87
99
  var _viem = require('viem');
88
100
 
89
101
  // src/components/steps/AssetSelectStep.tsx
@@ -108,13 +120,13 @@ function AssetSelectStep({
108
120
  const [error, setError] = _react.useState.call(void 0, null);
109
121
  const defaultAssetId = _react.useMemo.call(void 0, () => {
110
122
  if (!defaultSourceChain || !defaultSourceToken) return null;
111
- return _chunk2TWQGPPBcjs.getAssetId.call(void 0, {
123
+ return _chunkN4XRQPVAcjs.getAssetId.call(void 0, {
112
124
  chainId: defaultSourceChain,
113
125
  token: defaultSourceToken
114
126
  });
115
127
  }, [defaultSourceChain, defaultSourceToken]);
116
- const onTotalBalanceComputedRef = _chunk2TWQGPPBcjs.useLatestRef.call(void 0, onTotalBalanceComputed);
117
- const onAssetsLoadedRef = _chunk2TWQGPPBcjs.useLatestRef.call(void 0, onAssetsLoaded);
128
+ const onTotalBalanceComputedRef = _chunkN4XRQPVAcjs.useLatestRef.call(void 0, onTotalBalanceComputed);
129
+ const onAssetsLoadedRef = _chunkN4XRQPVAcjs.useLatestRef.call(void 0, onAssetsLoaded);
118
130
  _react.useEffect.call(void 0, () => {
119
131
  let active = true;
120
132
  function emitAssetsUpdate(currentAssets) {
@@ -135,7 +147,7 @@ function AssetSelectStep({
135
147
  try {
136
148
  const portfolio = await service.fetchPortfolio(address);
137
149
  if (!active) return;
138
- const portfolioAssets = _chunk2TWQGPPBcjs.portfolioToAssets.call(void 0, portfolio.tokens);
150
+ const portfolioAssets = _chunkN4XRQPVAcjs.portfolioToAssets.call(void 0, portfolio.tokens);
139
151
  setAssets(portfolioAssets);
140
152
  emitAssetsUpdate(portfolioAssets);
141
153
  const hasNative = portfolioAssets.some(
@@ -211,7 +223,7 @@ function AssetSelectStep({
211
223
  const raw = _viem.formatUnits.call(void 0, BigInt(asset.balance), asset.decimals);
212
224
  const numeric = Number(raw);
213
225
  if (!Number.isFinite(numeric)) return raw;
214
- return _chunk2TWQGPPBcjs.tokenFormatter.format(numeric);
226
+ return _chunkN4XRQPVAcjs.tokenFormatter.format(numeric);
215
227
  } catch (e3) {
216
228
  return asset.balance;
217
229
  }
@@ -219,20 +231,20 @@ function AssetSelectStep({
219
231
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
220
232
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
221
233
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
222
- _chunk2TWQGPPBcjs.BodyHeader,
234
+ _chunkN4XRQPVAcjs.BodyHeader,
223
235
  {
224
- icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.WalletIcon, {}),
236
+ icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.WalletIcon, {}),
225
237
  title: "Your assets",
226
238
  subtitle: "Select source assets to transfer"
227
239
  }
228
240
  ),
229
241
  loading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
230
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.Spinner, { className: "rs-text-tertiary" }),
242
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.Spinner, { className: "rs-text-tertiary" }),
231
243
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
232
244
  ] }),
233
- error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.Callout, { variant: "error", children: error }),
245
+ error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.Callout, { variant: "error", children: error }),
234
246
  !loading && !error && rows.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-state", children: [
235
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.WalletIcon, { className: "rs-empty-icon" }),
247
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.WalletIcon, { className: "rs-empty-icon" }),
236
248
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-empty-text", children: "No funds in connected wallet" }),
237
249
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-address", children: [
238
250
  address.slice(0, 6),
@@ -299,14 +311,14 @@ function AssetSelectStep({
299
311
  ] })
300
312
  ] })
301
313
  ] }),
302
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: asset.balanceUsd !== void 0 && asset.balanceUsd > 0 ? _chunk2TWQGPPBcjs.currencyFormatter.format(asset.balanceUsd) : tokenAmount !== "--" ? `${tokenAmount} ${asset.symbol}` : "--" })
314
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: asset.balanceUsd !== void 0 && asset.balanceUsd > 0 ? _chunkN4XRQPVAcjs.currencyFormatter.format(asset.balanceUsd) : tokenAmount !== "--" ? `${tokenAmount} ${asset.symbol}` : "--" })
303
315
  ]
304
316
  },
305
317
  asset.id
306
318
  );
307
319
  }) }),
308
320
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
309
- _chunk2TWQGPPBcjs.Button,
321
+ _chunkN4XRQPVAcjs.Button,
310
322
  {
311
323
  onClick: () => selectedAsset && onContinue(selectedAsset),
312
324
  disabled: !selectedAsset,
@@ -315,7 +327,7 @@ function AssetSelectStep({
315
327
  }
316
328
  )
317
329
  ] }),
318
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.PoweredBy, {})
330
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.PoweredBy, {})
319
331
  ] });
320
332
  }
321
333
  async function fetchNativeAssets(address, publicClient, existing) {
@@ -323,7 +335,7 @@ async function fetchNativeAssets(address, publicClient, existing) {
323
335
  const connectedChainId = _optionalChain([publicClient, 'access', _9 => _9.chain, 'optionalAccess', _10 => _10.id]);
324
336
  if (!connectedChainId) return [];
325
337
  if (!_chunk7JIDIX27cjs.SOURCE_CHAINS.some((chain) => chain.id === connectedChainId)) return [];
326
- const id = _chunk2TWQGPPBcjs.getAssetId.call(void 0, {
338
+ const id = _chunkN4XRQPVAcjs.getAssetId.call(void 0, {
327
339
  chainId: connectedChainId,
328
340
  token: _chunk7JIDIX27cjs.NATIVE_TOKEN_ADDRESS
329
341
  });
@@ -520,7 +532,7 @@ function AmountStep({
520
532
  const balanceTarget = _nullishCoalesce(balanceAddress, () => ( address));
521
533
  if (!balanceTarget || !publicClient) return;
522
534
  try {
523
- const bal = _chunk2TWQGPPBcjs.isNativeAsset.call(void 0, asset) ? await publicClient.getBalance({ address: balanceTarget }) : await publicClient.readContract({
535
+ const bal = _chunkN4XRQPVAcjs.isNativeAsset.call(void 0, asset) ? await publicClient.getBalance({ address: balanceTarget }) : await publicClient.readContract({
524
536
  address: asset.token,
525
537
  abi: _viem.erc20Abi,
526
538
  functionName: "balanceOf",
@@ -541,7 +553,7 @@ function AmountStep({
541
553
  hasAttemptedSwitch.current = true;
542
554
  switchChain(asset.chainId).catch((err) => {
543
555
  const raw = err instanceof Error ? err.message : "Failed to switch chain";
544
- setError(_chunk2TWQGPPBcjs.formatUserError.call(void 0, raw));
556
+ setError(_chunkN4XRQPVAcjs.formatUserError.call(void 0, raw));
545
557
  });
546
558
  }
547
559
  }, [chainMismatch, switchChain, asset.chainId]);
@@ -594,7 +606,7 @@ function AmountStep({
594
606
  const raw = _viem.formatUnits.call(void 0, balance, asset.decimals);
595
607
  const numeric = Number(raw);
596
608
  if (!Number.isFinite(numeric)) return raw;
597
- return _chunk2TWQGPPBcjs.tokenFormatter.format(numeric);
609
+ return _chunkN4XRQPVAcjs.tokenFormatter.format(numeric);
598
610
  } catch (e8) {
599
611
  return "\u2026";
600
612
  }
@@ -713,7 +725,7 @@ function AmountStep({
713
725
  const targetTokenIcon = _chunk7JIDIX27cjs.getTokenIcon.call(void 0, targetSymbol);
714
726
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
715
727
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
716
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.WalletIcon, {}), title: "Wallet deposit" }),
728
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.WalletIcon, {}), title: "Wallet deposit" }),
717
729
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-section", children: [
718
730
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-display", children: [
719
731
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
@@ -733,13 +745,13 @@ function AmountStep({
733
745
  " available",
734
746
  balanceUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
735
747
  " (~",
736
- _chunk2TWQGPPBcjs.currencyFormatter.format(balanceUsd),
748
+ _chunkN4XRQPVAcjs.currencyFormatter.format(balanceUsd),
737
749
  ")"
738
750
  ] })
739
751
  ] }),
740
752
  minDepositUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-amount-meta-minimum", children: [
741
753
  "Min. deposit ",
742
- _chunk2TWQGPPBcjs.currencyFormatter.format(minDepositUsd)
754
+ _chunkN4XRQPVAcjs.currencyFormatter.format(minDepositUsd)
743
755
  ] })
744
756
  ] })
745
757
  ] }),
@@ -780,12 +792,12 @@ function AmountStep({
780
792
  ] }),
781
793
  balanceAfterUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
782
794
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Balance after deposit" }),
783
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children: _chunk2TWQGPPBcjs.currencyFormatter.format(balanceAfterUsd) })
795
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children: _chunkN4XRQPVAcjs.currencyFormatter.format(balanceAfterUsd) })
784
796
  ] })
785
797
  ] }),
786
- error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.Callout, { variant: "error", children: error }),
798
+ error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.Callout, { variant: "error", children: error }),
787
799
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
788
- _chunk2TWQGPPBcjs.Button,
800
+ _chunkN4XRQPVAcjs.Button,
789
801
  {
790
802
  onClick: handleContinue,
791
803
  fullWidth: true,
@@ -796,7 +808,7 @@ function AmountStep({
796
808
  }
797
809
  )
798
810
  ] }),
799
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.PoweredBy, {})
811
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.PoweredBy, {})
800
812
  ] });
801
813
  }
802
814
 
@@ -867,7 +879,7 @@ function ConfirmStep({
867
879
  hasAttemptedSwitch.current = true;
868
880
  switchChain(asset.chainId).catch((err) => {
869
881
  const raw = err instanceof Error ? err.message : "Failed to switch chain";
870
- setError(_chunk2TWQGPPBcjs.formatUserError.call(void 0, raw));
882
+ setError(_chunkN4XRQPVAcjs.formatUserError.call(void 0, raw));
871
883
  });
872
884
  }
873
885
  }, [chainMismatch, switchChain, asset.chainId]);
@@ -914,7 +926,7 @@ function ConfirmStep({
914
926
  const result = await executeTransfer(amountUnits);
915
927
  hash = result.txHash;
916
928
  resolvedSourceToken = result.sourceToken;
917
- } else if (_chunk2TWQGPPBcjs.isNativeAsset.call(void 0, asset)) {
929
+ } else if (_chunkN4XRQPVAcjs.isNativeAsset.call(void 0, asset)) {
918
930
  hash = await walletClient.sendTransaction({
919
931
  account,
920
932
  chain,
@@ -935,7 +947,7 @@ function ConfirmStep({
935
947
  onConfirm(hash, asset.chainId, amountUnits.toString(), resolvedSourceToken);
936
948
  } catch (err) {
937
949
  const raw = err instanceof Error ? err.message : "Transfer failed";
938
- const message = _chunk2TWQGPPBcjs.formatUserError.call(void 0, raw);
950
+ const message = _chunkN4XRQPVAcjs.formatUserError.call(void 0, raw);
939
951
  setError(message);
940
952
  _optionalChain([onError, 'optionalCall', _28 => _28(message, "TRANSFER_ERROR")]);
941
953
  } finally {
@@ -944,7 +956,7 @@ function ConfirmStep({
944
956
  };
945
957
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
946
958
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
947
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.WalletIcon, {}), title: "Review deposit" }),
959
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.WalletIcon, {}), title: "Review deposit" }),
948
960
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-details", children: [
949
961
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
950
962
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Source chain" }),
@@ -996,13 +1008,13 @@ function ConfirmStep({
996
1008
  children: "$0.04"
997
1009
  }
998
1010
  ),
999
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.Tooltip, { content: feeTooltip, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-info", "aria-label": "Fee info", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.InfoIcon, {}) }) })
1011
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.Tooltip, { content: feeTooltip, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-info", "aria-label": "Fee info", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.InfoIcon, {}) }) })
1000
1012
  ] })
1001
1013
  ] })
1002
1014
  ] }),
1003
- error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.Callout, { variant: "error", children: error }),
1015
+ error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.Callout, { variant: "error", children: error }),
1004
1016
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1005
- _chunk2TWQGPPBcjs.Button,
1017
+ _chunkN4XRQPVAcjs.Button,
1006
1018
  {
1007
1019
  onClick: handleConfirm,
1008
1020
  loading: isSubmitting,
@@ -1013,7 +1025,7 @@ function ConfirmStep({
1013
1025
  }
1014
1026
  )
1015
1027
  ] }),
1016
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.PoweredBy, {})
1028
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.PoweredBy, {})
1017
1029
  ] });
1018
1030
  }
1019
1031
 
@@ -1036,9 +1048,9 @@ var INITIAL_POLL_INTERVAL = 3e3;
1036
1048
  var MAX_POLL_INTERVAL = 3e4;
1037
1049
  var BACKOFF_MULTIPLIER = 1.5;
1038
1050
  function isEventForTx(event, txHash) {
1039
- const eventTxHash = _chunk2TWQGPPBcjs.getEventTxHash.call(void 0, event);
1051
+ const eventTxHash = _chunkN4XRQPVAcjs.getEventTxHash.call(void 0, event);
1040
1052
  if (!eventTxHash) return false;
1041
- return _chunk2TWQGPPBcjs.txRefsMatch.call(void 0, eventTxHash, txHash);
1053
+ return _chunkN4XRQPVAcjs.txRefsMatch.call(void 0, eventTxHash, txHash);
1042
1054
  }
1043
1055
  function truncateHash(hash) {
1044
1056
  return `${hash.slice(0, 4)}\u2026${hash.slice(-4)}`;
@@ -1088,7 +1100,7 @@ function formatBridgeFailedMessage(event) {
1088
1100
  }
1089
1101
  return "Bridge failed";
1090
1102
  }
1091
- var txLinkIcon = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.ExternalLinkIcon, { className: "rs-deposit-notification-link-icon" });
1103
+ var txLinkIcon = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.ExternalLinkIcon, { className: "rs-deposit-notification-link-icon" });
1092
1104
  function DepositNotification({
1093
1105
  deposit,
1094
1106
  smartAccount,
@@ -1115,7 +1127,7 @@ function DepositNotification({
1115
1127
  const pollIntervalRef = _react.useRef.call(void 0, INITIAL_POLL_INTERVAL);
1116
1128
  const pollTimeoutRef = _react.useRef.call(void 0, null);
1117
1129
  const completedRef = _react.useRef.call(void 0, _nullishCoalesce(directTransfer, () => ( false)));
1118
- const depositContextRef = _chunk2TWQGPPBcjs.useLatestRef.call(void 0, {
1130
+ const depositContextRef = _chunkN4XRQPVAcjs.useLatestRef.call(void 0, {
1119
1131
  amount,
1120
1132
  sourceChain,
1121
1133
  sourceToken: token,
@@ -1123,8 +1135,8 @@ function DepositNotification({
1123
1135
  targetToken,
1124
1136
  hasPostBridgeActions
1125
1137
  });
1126
- const onCompleteRef = _chunk2TWQGPPBcjs.useLatestRef.call(void 0, onComplete);
1127
- const onFailedRef = _chunk2TWQGPPBcjs.useLatestRef.call(void 0, onFailed);
1138
+ const onCompleteRef = _chunkN4XRQPVAcjs.useLatestRef.call(void 0, onComplete);
1139
+ const onFailedRef = _chunkN4XRQPVAcjs.useLatestRef.call(void 0, onFailed);
1128
1140
  const handleComplete = _react.useCallback.call(void 0,
1129
1141
  (destTxHash) => {
1130
1142
  if (completedRef.current) return;
@@ -1228,7 +1240,38 @@ function DepositNotification({
1228
1240
  const destExplorerUrl = destinationTxHash ? _chunk7JIDIX27cjs.getExplorerTxUrl.call(void 0, targetChain, destinationTxHash) : null;
1229
1241
  const title = status === "complete" ? "Deposit completed" : status === "failed" ? "Deposit failed" : "Deposit received and processing\u2026";
1230
1242
  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.";
1231
- const statusIcon = status === "complete" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-notification-badge rs-deposit-notification-badge--complete", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.CheckIcon, {}) }) : status === "failed" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-notification-badge rs-deposit-notification-badge--failed", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.CloseIcon, {}) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-notification-badge rs-deposit-notification-badge--processing", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.Spinner, {}) });
1243
+ const statusIcon = status === "complete" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-notification-badge rs-deposit-notification-badge--complete", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.CheckIcon, {}) }) : status === "failed" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-notification-badge rs-deposit-notification-badge--failed", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.CloseIcon, {}) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-notification-badge rs-deposit-notification-badge--processing", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
1244
+ "svg",
1245
+ {
1246
+ className: "rs-deposit-notification-spinner",
1247
+ viewBox: "0 0 44 44",
1248
+ fill: "none",
1249
+ xmlns: "http://www.w3.org/2000/svg",
1250
+ "aria-hidden": "true",
1251
+ children: [
1252
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1253
+ "path",
1254
+ {
1255
+ className: "rs-deposit-notification-spinner-track",
1256
+ d: "M21.5882 42.1765C32.9588 42.1765 42.1765 32.9588 42.1765 21.5882C42.1765 10.2177 32.9588 1 21.5882 1C10.2177 1 1 10.2177 1 21.5882C1 32.9588 10.2177 42.1765 21.5882 42.1765Z",
1257
+ stroke: "#D4D4D8",
1258
+ strokeWidth: "2",
1259
+ strokeLinecap: "round"
1260
+ }
1261
+ ),
1262
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1263
+ "path",
1264
+ {
1265
+ className: "rs-deposit-notification-spinner-head",
1266
+ d: "M28.0422 2.03186C31.4239 3.1515 34.458 5.1279 36.8489 7.76854C39.2398 10.4092 40.906 13.624 41.6852 17.1",
1267
+ stroke: "#52525C",
1268
+ strokeWidth: "2",
1269
+ strokeLinecap: "round"
1270
+ }
1271
+ )
1272
+ ]
1273
+ }
1274
+ ) });
1232
1275
  const showClose = status !== "processing";
1233
1276
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
1234
1277
  "div",
@@ -1247,7 +1290,7 @@ function DepositNotification({
1247
1290
  className: "rs-deposit-notification-close",
1248
1291
  onClick: () => onDismiss(deposit.id),
1249
1292
  "aria-label": "Dismiss",
1250
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.CloseIcon, {})
1293
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.CloseIcon, {})
1251
1294
  }
1252
1295
  )
1253
1296
  ] }),
@@ -1263,7 +1306,7 @@ function DepositNotification({
1263
1306
  "aria-expanded": expanded,
1264
1307
  children: [
1265
1308
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: expanded ? "See less details" : "See more details" }),
1266
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.ChevronDownIcon, { className: "rs-deposit-notification-toggle-chevron" })
1309
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.ChevronDownIcon, { className: "rs-deposit-notification-toggle-chevron" })
1267
1310
  ]
1268
1311
  }
1269
1312
  ),
@@ -1317,7 +1360,7 @@ function DepositNotification({
1317
1360
  // src/components/steps/DepositAddressStep.tsx
1318
1361
 
1319
1362
  var QRCode = _react.lazy.call(void 0,
1320
- () => Promise.resolve().then(() => _interopRequireWildcard(require("./QRCode-KG47KTGX.cjs"))).then((m) => ({ default: m.QRCode }))
1363
+ () => Promise.resolve().then(() => _interopRequireWildcard(require("./QRCode-5DXFNKI2.cjs"))).then((m) => ({ default: m.QRCode }))
1321
1364
  );
1322
1365
  var POLL_INTERVAL_MS = 4e3;
1323
1366
  function isRecord(value) {
@@ -1406,7 +1449,6 @@ function pickFallbackToken(tokens, current) {
1406
1449
  function DepositAddressStep({
1407
1450
  smartAccount,
1408
1451
  solanaDepositAddress,
1409
- isUpdating = false,
1410
1452
  service,
1411
1453
  allowedRoutes,
1412
1454
  targetChain,
@@ -1532,7 +1574,6 @@ function DepositAddressStep({
1532
1574
  };
1533
1575
  }, [chainDropdownOpen, tokenDropdownOpen]);
1534
1576
  const handleCopy = _react.useCallback.call(void 0, async () => {
1535
- if (isUpdating) return;
1536
1577
  _optionalChain([onCopyAddress, 'optionalCall', _65 => _65()]);
1537
1578
  try {
1538
1579
  await navigator.clipboard.writeText(displayAddress);
@@ -1550,7 +1591,7 @@ function DepositAddressStep({
1550
1591
  setCopied(true);
1551
1592
  setTimeout(() => setCopied(false), 2e3);
1552
1593
  }
1553
- }, [displayAddress, onCopyAddress, isUpdating]);
1594
+ }, [displayAddress, onCopyAddress]);
1554
1595
  const handleSelectChain = _react.useCallback.call(void 0,
1555
1596
  (nextChain) => {
1556
1597
  const nextTokens = computeTokensForChain(nextChain, allowedTokenSet);
@@ -1612,10 +1653,10 @@ function DepositAddressStep({
1612
1653
  return;
1613
1654
  }
1614
1655
  const event = status.lastEvent;
1615
- const eventTxHash = _chunk2TWQGPPBcjs.isDepositEvent.call(void 0, event) ? _nullishCoalesce(_chunk2TWQGPPBcjs.getEventTxHash.call(void 0, event), () => ( null)) : null;
1656
+ const eventTxHash = _chunkN4XRQPVAcjs.isDepositEvent.call(void 0, event) ? _nullishCoalesce(_chunkN4XRQPVAcjs.getEventTxHash.call(void 0, event), () => ( null)) : null;
1616
1657
  if (baselineTxHashRef.current === void 0) {
1617
1658
  baselineTxHashRef.current = eventTxHash;
1618
- } else if (eventTxHash && (!baselineTxHashRef.current || !_chunk2TWQGPPBcjs.txRefsMatch.call(void 0, eventTxHash, baselineTxHashRef.current))) {
1659
+ } else if (eventTxHash && (!baselineTxHashRef.current || !_chunkN4XRQPVAcjs.txRefsMatch.call(void 0, eventTxHash, baselineTxHashRef.current))) {
1619
1660
  const details = getDepositEventDetails(event);
1620
1661
  const chainId = _nullishCoalesce(details.chainId, () => ( "unknown"));
1621
1662
  const amount = _nullishCoalesce(details.amount, () => ( "0"));
@@ -1688,7 +1729,7 @@ function DepositAddressStep({
1688
1729
  const qrIconSrc = _chunk7JIDIX27cjs.getChainIcon.call(void 0, sourceChainId);
1689
1730
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen rs-step--with-notifications", children: [
1690
1731
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
1691
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.TransferCryptoIcon, {}), title: "Transfer crypto" }),
1732
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.TransferCryptoIcon, {}), title: "Transfer crypto" }),
1692
1733
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-selectors", children: [
1693
1734
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown", ref: chainDropdownRef, children: [
1694
1735
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-dropdown-label", children: "Supported chain" }),
@@ -1712,7 +1753,7 @@ function DepositAddressStep({
1712
1753
  }
1713
1754
  ),
1714
1755
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: _chunk7JIDIX27cjs.getChainName.call(void 0, sourceChainId) }),
1715
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
1756
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
1716
1757
  ]
1717
1758
  }
1718
1759
  ),
@@ -1743,8 +1784,8 @@ function DepositAddressStep({
1743
1784
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-deposit-address-min", children: [
1744
1785
  "Min.$",
1745
1786
  (_nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _74 => _74.minDepositUsd]), () => ( 0.1))).toFixed(2),
1746
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.Tooltip, { content: "Minimum deposit amount required for the selected chain.", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1747
- _chunk2TWQGPPBcjs.InfoIcon,
1787
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.Tooltip, { content: "Minimum deposit amount required for the selected chain.", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1788
+ _chunkN4XRQPVAcjs.InfoIcon,
1748
1789
  {
1749
1790
  className: "rs-deposit-address-min-icon",
1750
1791
  "aria-hidden": "true"
@@ -1772,7 +1813,7 @@ function DepositAddressStep({
1772
1813
  }
1773
1814
  ),
1774
1815
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: sourceTokenSymbol }),
1775
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
1816
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
1776
1817
  ]
1777
1818
  }
1778
1819
  ),
@@ -1806,45 +1847,24 @@ function DepositAddressStep({
1806
1847
  {
1807
1848
  style: { display: "flex", flexDirection: "column", gap: 4, width: "100%" },
1808
1849
  children: [
1850
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-well", children: [
1851
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-qr", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1852
+ _react.Suspense,
1853
+ {
1854
+ fallback: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-skeleton rs-skeleton-qr", "aria-hidden": "true" }),
1855
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, QRCode, { value: displayAddress, size: 190, iconSrc: qrIconSrc })
1856
+ }
1857
+ ) }),
1858
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-value", children: displayAddress })
1859
+ ] }),
1809
1860
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
1810
- "div",
1811
- {
1812
- className: `rs-deposit-address-well ${isUpdating ? "rs-deposit-address-well--updating" : ""}`,
1813
- children: [
1814
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-qr", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1815
- _react.Suspense,
1816
- {
1817
- fallback: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1818
- "div",
1819
- {
1820
- style: {
1821
- width: 200,
1822
- height: 200,
1823
- display: "flex",
1824
- alignItems: "center",
1825
- justifyContent: "center"
1826
- },
1827
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.Spinner, {})
1828
- }
1829
- ),
1830
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, QRCode, { value: displayAddress, size: 200, iconSrc: qrIconSrc })
1831
- }
1832
- ) }),
1833
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-value", children: displayAddress })
1834
- ]
1835
- }
1836
- ),
1837
- isUpdating ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "output", { className: "rs-deposit-address-updating", children: [
1838
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.Spinner, { className: "rs-spinner--sm" }),
1839
- "Updating deposit details\u2026"
1840
- ] }) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
1841
1861
  "button",
1842
1862
  {
1843
1863
  type: "button",
1844
1864
  className: "rs-deposit-address-copy",
1845
1865
  onClick: handleCopy,
1846
1866
  children: [
1847
- copied ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.CheckIcon, {}) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.CopyIcon, {}),
1867
+ copied ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.CheckIcon, {}) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.CopyIcon, {}),
1848
1868
  copied ? "Copied!" : "Copy address"
1849
1869
  ]
1850
1870
  }
@@ -1869,16 +1889,16 @@ function DepositAddressStep({
1869
1889
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-label", children: "Price impact" }),
1870
1890
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-label", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: "0.00%" }) }),
1871
1891
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1872
- _chunk2TWQGPPBcjs.Tooltip,
1892
+ _chunkN4XRQPVAcjs.Tooltip,
1873
1893
  {
1874
1894
  className: "rs-price-impact-info",
1875
1895
  content: "Price impact is the difference between expected and execution price, due to trade size and liquidity.",
1876
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.InfoIcon, { "aria-hidden": "true" })
1896
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.InfoIcon, { "aria-hidden": "true" })
1877
1897
  }
1878
1898
  )
1879
1899
  ] }),
1880
1900
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1881
- _chunk2TWQGPPBcjs.ChevronDownIcon,
1901
+ _chunkN4XRQPVAcjs.ChevronDownIcon,
1882
1902
  {
1883
1903
  className: "rs-price-impact-chevron",
1884
1904
  "aria-hidden": "true"
@@ -1889,29 +1909,29 @@ function DepositAddressStep({
1889
1909
  ),
1890
1910
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-price-impact-panel", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-price-impact-panel-inner", children: [
1891
1911
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-price-impact-row", children: [
1892
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.PercentIcon, {}) }),
1912
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.PercentIcon, {}) }),
1893
1913
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-price-impact-label", children: [
1894
1914
  "Max slippage: ",
1895
1915
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: "0.2%" })
1896
1916
  ] }),
1897
1917
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1898
- _chunk2TWQGPPBcjs.Tooltip,
1918
+ _chunkN4XRQPVAcjs.Tooltip,
1899
1919
  {
1900
1920
  className: "rs-price-impact-info",
1901
1921
  content: "Slippage accounts for price changes during execution. Slippage is adjusted per pair to ensure reliable execution.",
1902
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.InfoIcon, { "aria-hidden": "true" })
1922
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.InfoIcon, { "aria-hidden": "true" })
1903
1923
  }
1904
1924
  )
1905
1925
  ] }),
1906
1926
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-price-impact-row", children: [
1907
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.ClockIcon, {}) }),
1927
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.ClockIcon, {}) }),
1908
1928
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-price-impact-label", children: [
1909
1929
  "Processing time: ",
1910
1930
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: "< 1 min" })
1911
1931
  ] })
1912
1932
  ] }),
1913
1933
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-price-impact-row", children: [
1914
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.PlusCircleIcon, {}) }),
1934
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.PlusCircleIcon, {}) }),
1915
1935
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-price-impact-label", children: [
1916
1936
  "Max deposit:",
1917
1937
  " ",
@@ -1943,11 +1963,675 @@ function DepositAddressStep({
1943
1963
  },
1944
1964
  deposit.id
1945
1965
  )) }),
1946
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.PoweredBy, {})
1966
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.PoweredBy, {})
1947
1967
  ] });
1948
1968
  }
1949
1969
  DepositAddressStep.displayName = "DepositAddressStep";
1950
1970
 
1971
+ // src/components/steps/FiatOnrampStep.tsx
1972
+
1973
+
1974
+ // src/components/steps/SwappedIframeStep.tsx
1975
+
1976
+
1977
+ // src/components/steps/SwappedOrderTracker.tsx
1978
+
1979
+ var STEP_LABELS = [
1980
+ "Payment received",
1981
+ null,
1982
+ "Processing App deposit",
1983
+ "Deposit successful"
1984
+ ];
1985
+ function SwappedOrderTracker({
1986
+ amount,
1987
+ currency = "USDC",
1988
+ chainLabel = "Base",
1989
+ stepStates,
1990
+ terminal = null,
1991
+ onRetry
1992
+ }) {
1993
+ const formattedAmount = formatTrackerAmount(amount);
1994
+ const title = terminal ? terminal.kind === "cancelled" ? "Order cancelled" : "Deposit failed" : formattedAmount ? `Depositing ${formattedAmount} ${currency}` : `Depositing ${currency}`;
1995
+ const labels = [
1996
+ STEP_LABELS[0],
1997
+ `${currency} received on ${chainLabel}`,
1998
+ STEP_LABELS[2],
1999
+ STEP_LABELS[3]
2000
+ ];
2001
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen rs-swapped-tracker", children: [
2002
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
2003
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.HandCoinsIcon, {}), title }),
2004
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "ol", { className: "rs-swapped-tracker-steps", children: labels.map((label, idx) => {
2005
+ const status = stepStates[idx];
2006
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
2007
+ "li",
2008
+ {
2009
+ className: `rs-swapped-tracker-step rs-swapped-tracker-step--${status}`,
2010
+ children: [
2011
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-swapped-tracker-step-label", children: label }),
2012
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2013
+ "span",
2014
+ {
2015
+ className: "rs-swapped-tracker-step-marker",
2016
+ "aria-hidden": "true",
2017
+ children: status === "complete" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.CheckIcon, {}) : status === "failed" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.CloseIcon, {}) : status === "active" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.Spinner, {}) : null
2018
+ }
2019
+ )
2020
+ ]
2021
+ },
2022
+ label
2023
+ );
2024
+ }) }),
2025
+ terminal && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
2026
+ "div",
2027
+ {
2028
+ className: `rs-swapped-tracker-terminal rs-swapped-tracker-terminal--${terminal.kind}`,
2029
+ children: [
2030
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "rs-swapped-tracker-terminal-message", children: terminal.message }),
2031
+ terminal.kind === "cancelled" && onRetry && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2032
+ "button",
2033
+ {
2034
+ type: "button",
2035
+ className: "rs-swapped-tracker-retry",
2036
+ onClick: onRetry,
2037
+ children: "Try again"
2038
+ }
2039
+ )
2040
+ ]
2041
+ }
2042
+ )
2043
+ ] }),
2044
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.PoweredBy, {})
2045
+ ] });
2046
+ }
2047
+ function formatTrackerAmount(amount) {
2048
+ if (!amount) return null;
2049
+ const num = Number(amount);
2050
+ if (!Number.isFinite(num)) return amount;
2051
+ return num.toFixed(2);
2052
+ }
2053
+ SwappedOrderTracker.displayName = "SwappedOrderTracker";
2054
+
2055
+ // src/components/steps/SwappedIframeStep.tsx
2056
+
2057
+ var STATUS_POLL_INTERVAL_MS = 2e3;
2058
+ var DEPOSIT_POLL_INTERVAL_MS = 2e3;
2059
+ var DEPOSIT_POLL_FAST_INITIAL_DELAY_MS = 1e3;
2060
+ var DEPOSIT_POLL_FAST_INTERVAL_MS = 500;
2061
+ var IFRAME_LOAD_TIMEOUT_MS = 15e3;
2062
+ var SWAPPED_IFRAME_ORIGINS = /* @__PURE__ */ new Set([
2063
+ "https://sandbox.swapped.com",
2064
+ "https://widget.swapped.com"
2065
+ ]);
2066
+ var SWAPPED_TERMINAL_STATUSES = /* @__PURE__ */ new Set([
2067
+ "order_completed",
2068
+ "order_broadcasted"
2069
+ ]);
2070
+ var SWAPPED_STATUS_VALUES = /* @__PURE__ */ new Set([
2071
+ "payment_pending",
2072
+ "order_completed",
2073
+ "order_broadcasted",
2074
+ "order_cancelled"
2075
+ ]);
2076
+ function parseSwappedIframeMessage(raw) {
2077
+ let data = raw;
2078
+ if (typeof data === "string") {
2079
+ try {
2080
+ data = JSON.parse(data);
2081
+ } catch (e15) {
2082
+ return null;
2083
+ }
2084
+ }
2085
+ if (!data || typeof data !== "object") return null;
2086
+ const obj = data;
2087
+ const inner = obj.data && typeof obj.data === "object" ? obj.data : obj;
2088
+ const rawStatus = _nullishCoalesce(_nullishCoalesce(inner.order_status, () => ( inner.status)), () => ( obj.status));
2089
+ if (typeof rawStatus !== "string" || !SWAPPED_STATUS_VALUES.has(rawStatus)) {
2090
+ return null;
2091
+ }
2092
+ const asString2 = (v) => typeof v === "string" && v.length > 0 ? v : void 0;
2093
+ return {
2094
+ status: rawStatus,
2095
+ orderId: _nullishCoalesce(asString2(inner.order_id), () => ( asString2(obj.orderId))),
2096
+ orderCrypto: _nullishCoalesce(asString2(inner.order_crypto), () => ( asString2(obj.orderCrypto))),
2097
+ orderCryptoAmount: _nullishCoalesce(asString2(inner.order_crypto_amount), () => ( asString2(obj.orderCryptoAmount))),
2098
+ transactionId: _nullishCoalesce(asString2(inner.transaction_id), () => ( asString2(obj.transactionId)))
2099
+ };
2100
+ }
2101
+ function SwappedIframeStep({
2102
+ smartAccount,
2103
+ service,
2104
+ variant,
2105
+ loadUrl,
2106
+ iframeTitle,
2107
+ loadErrorCode,
2108
+ loadErrorFallback,
2109
+ bannerForStatus,
2110
+ onSwappedComplete,
2111
+ onSwappedFailed,
2112
+ onClose,
2113
+ onError
2114
+ }) {
2115
+ const [widgetUrl, setWidgetUrl] = _react.useState.call(void 0, null);
2116
+ const [loadError, setLoadError] = _react.useState.call(void 0, null);
2117
+ const [iframeLoaded, setIframeLoaded] = _react.useState.call(void 0, false);
2118
+ const [retryToken, setRetryToken] = _react.useState.call(void 0, 0);
2119
+ const [orderState, setOrderState] = _react.useState.call(void 0, null);
2120
+ const [latestEvent, setLatestEvent] = _react.useState.call(void 0, null);
2121
+ const [phase, setPhase] = _react.useState.call(void 0, "iframe");
2122
+ const completeFiredRef = _react.useRef.call(void 0, false);
2123
+ const failedFiredRef = _react.useRef.call(void 0, false);
2124
+ const expectedOrderUuidRef = _react.useRef.call(void 0, null);
2125
+ const baselineDepositTxHashRef = _react.useRef.call(void 0, void 0);
2126
+ const currentDepositTxHashRef = _react.useRef.call(void 0, null);
2127
+ const fastDepositPollEnabledRef = _react.useRef.call(void 0, false);
2128
+ const rescheduleDepositPollRef = _react.useRef.call(void 0,
2129
+ null
2130
+ );
2131
+ const onSwappedCompleteRef = _react.useRef.call(void 0, onSwappedComplete);
2132
+ onSwappedCompleteRef.current = onSwappedComplete;
2133
+ const onSwappedFailedRef = _react.useRef.call(void 0, onSwappedFailed);
2134
+ onSwappedFailedRef.current = onSwappedFailed;
2135
+ const onErrorRef = _react.useRef.call(void 0, onError);
2136
+ onErrorRef.current = onError;
2137
+ const loadUrlRef = _react.useRef.call(void 0, loadUrl);
2138
+ loadUrlRef.current = loadUrl;
2139
+ _react.useEffect.call(void 0, () => {
2140
+ let cancelled = false;
2141
+ setLoadError(null);
2142
+ setIframeLoaded(false);
2143
+ setWidgetUrl(null);
2144
+ setOrderState(null);
2145
+ setLatestEvent(null);
2146
+ setPhase("iframe");
2147
+ expectedOrderUuidRef.current = null;
2148
+ completeFiredRef.current = false;
2149
+ failedFiredRef.current = false;
2150
+ baselineDepositTxHashRef.current = void 0;
2151
+ currentDepositTxHashRef.current = null;
2152
+ fastDepositPollEnabledRef.current = false;
2153
+ loadUrlRef.current().then((res) => {
2154
+ if (cancelled) return;
2155
+ setWidgetUrl(res.url);
2156
+ const sep = res.externalCustomerId.indexOf(":");
2157
+ expectedOrderUuidRef.current = sep >= 0 ? res.externalCustomerId.slice(sep + 1) : null;
2158
+ }).catch((err) => {
2159
+ if (cancelled) return;
2160
+ const message = err instanceof Error ? err.message : loadErrorFallback;
2161
+ setLoadError(message);
2162
+ _optionalChain([onErrorRef, 'access', _75 => _75.current, 'optionalCall', _76 => _76(message, loadErrorCode)]);
2163
+ });
2164
+ return () => {
2165
+ cancelled = true;
2166
+ };
2167
+ }, [service, smartAccount, retryToken, loadErrorCode, loadErrorFallback]);
2168
+ _react.useEffect.call(void 0, () => {
2169
+ if (!widgetUrl || iframeLoaded || loadError) return;
2170
+ const timer = setTimeout(() => {
2171
+ setLoadError("Iframe took too long to load.");
2172
+ }, IFRAME_LOAD_TIMEOUT_MS);
2173
+ return () => clearTimeout(timer);
2174
+ }, [widgetUrl, iframeLoaded, loadError]);
2175
+ _react.useEffect.call(void 0, () => {
2176
+ let cancelled = false;
2177
+ let timeoutId;
2178
+ async function poll() {
2179
+ if (cancelled) return;
2180
+ try {
2181
+ const res = await service.fetchSwappedOrderStatus(smartAccount);
2182
+ if (cancelled) return;
2183
+ const isCurrentOrder = res !== null && expectedOrderUuidRef.current !== null && res.orderId === expectedOrderUuidRef.current;
2184
+ if (isCurrentOrder) {
2185
+ setOrderState(res);
2186
+ }
2187
+ } catch (e16) {
2188
+ }
2189
+ if (!cancelled) {
2190
+ timeoutId = setTimeout(poll, STATUS_POLL_INTERVAL_MS);
2191
+ }
2192
+ }
2193
+ poll();
2194
+ return () => {
2195
+ cancelled = true;
2196
+ clearTimeout(timeoutId);
2197
+ };
2198
+ }, [service, smartAccount]);
2199
+ _react.useEffect.call(void 0, () => {
2200
+ let cancelled = false;
2201
+ let timeoutId;
2202
+ async function pollDeposit() {
2203
+ if (cancelled) return;
2204
+ try {
2205
+ const status = await service.fetchLatestStatus(smartAccount);
2206
+ if (cancelled) return;
2207
+ const event = status.lastEvent;
2208
+ const eventTxHash = _chunkN4XRQPVAcjs.isDepositEvent.call(void 0, event) ? _nullishCoalesce(_chunkN4XRQPVAcjs.getEventTxHash.call(void 0, event), () => ( null)) : null;
2209
+ if (baselineDepositTxHashRef.current === void 0) {
2210
+ baselineDepositTxHashRef.current = eventTxHash;
2211
+ } else if (eventTxHash && (!baselineDepositTxHashRef.current || !_chunkN4XRQPVAcjs.txRefsMatch.call(void 0, eventTxHash, baselineDepositTxHashRef.current))) {
2212
+ currentDepositTxHashRef.current = eventTxHash;
2213
+ setLatestEvent(_nullishCoalesce(event, () => ( null)));
2214
+ }
2215
+ } catch (e17) {
2216
+ }
2217
+ if (!cancelled) {
2218
+ const nextInterval = fastDepositPollEnabledRef.current ? DEPOSIT_POLL_FAST_INTERVAL_MS : DEPOSIT_POLL_INTERVAL_MS;
2219
+ timeoutId = setTimeout(pollDeposit, nextInterval);
2220
+ }
2221
+ }
2222
+ rescheduleDepositPollRef.current = (delayMs) => {
2223
+ if (cancelled) return;
2224
+ if (timeoutId !== void 0) clearTimeout(timeoutId);
2225
+ timeoutId = setTimeout(pollDeposit, delayMs);
2226
+ };
2227
+ pollDeposit();
2228
+ return () => {
2229
+ cancelled = true;
2230
+ if (timeoutId !== void 0) clearTimeout(timeoutId);
2231
+ rescheduleDepositPollRef.current = null;
2232
+ };
2233
+ }, [service, smartAccount]);
2234
+ _react.useEffect.call(void 0, () => {
2235
+ if (fastDepositPollEnabledRef.current) return;
2236
+ const status = _optionalChain([orderState, 'optionalAccess', _77 => _77.status]);
2237
+ if (!status || !SWAPPED_TERMINAL_STATUSES.has(status)) return;
2238
+ fastDepositPollEnabledRef.current = true;
2239
+ _optionalChain([rescheduleDepositPollRef, 'access', _78 => _78.current, 'optionalCall', _79 => _79(DEPOSIT_POLL_FAST_INITIAL_DELAY_MS)]);
2240
+ }, [orderState]);
2241
+ _react.useEffect.call(void 0, () => {
2242
+ function onMessage(e) {
2243
+ if (!SWAPPED_IFRAME_ORIGINS.has(e.origin)) return;
2244
+ const parsed = parseSwappedIframeMessage(e.data);
2245
+ if (!parsed) return;
2246
+ setOrderState((prev) => ({
2247
+ orderId: _nullishCoalesce(_nullishCoalesce(parsed.orderId, () => ( _optionalChain([prev, 'optionalAccess', _80 => _80.orderId]))), () => ( "")),
2248
+ status: parsed.status,
2249
+ orderCrypto: _nullishCoalesce(_nullishCoalesce(parsed.orderCrypto, () => ( _optionalChain([prev, 'optionalAccess', _81 => _81.orderCrypto]))), () => ( null)),
2250
+ orderCryptoAmount: _nullishCoalesce(_nullishCoalesce(parsed.orderCryptoAmount, () => ( _optionalChain([prev, 'optionalAccess', _82 => _82.orderCryptoAmount]))), () => ( null)),
2251
+ transactionId: _nullishCoalesce(_nullishCoalesce(parsed.transactionId, () => ( _optionalChain([prev, 'optionalAccess', _83 => _83.transactionId]))), () => ( null)),
2252
+ receivedAt: (/* @__PURE__ */ new Date()).toISOString(),
2253
+ paidAmountUsd: _nullishCoalesce(_optionalChain([prev, 'optionalAccess', _84 => _84.paidAmountUsd]), () => ( null)),
2254
+ paidAmountEur: _nullishCoalesce(_optionalChain([prev, 'optionalAccess', _85 => _85.paidAmountEur]), () => ( null)),
2255
+ onrampFeeUsd: _nullishCoalesce(_optionalChain([prev, 'optionalAccess', _86 => _86.onrampFeeUsd]), () => ( null)),
2256
+ paymentMethod: _nullishCoalesce(_optionalChain([prev, 'optionalAccess', _87 => _87.paymentMethod]), () => ( null))
2257
+ }));
2258
+ }
2259
+ window.addEventListener("message", onMessage);
2260
+ return () => window.removeEventListener("message", onMessage);
2261
+ }, []);
2262
+ _react.useEffect.call(void 0, () => {
2263
+ if (phase === "iframe" && orderState !== null) {
2264
+ setPhase("tracker");
2265
+ }
2266
+ }, [phase, orderState]);
2267
+ const stepStates = _react.useMemo.call(void 0,
2268
+ () => deriveStepStates(_nullishCoalesce(_optionalChain([orderState, 'optionalAccess', _88 => _88.status]), () => ( null)), latestEvent),
2269
+ [orderState, latestEvent]
2270
+ );
2271
+ const terminalState = _react.useMemo.call(void 0, () => {
2272
+ if (_chunkN4XRQPVAcjs.isFailedEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))) {
2273
+ return {
2274
+ kind: "failed",
2275
+ message: _chunkN4XRQPVAcjs.failureMessageForEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))
2276
+ };
2277
+ }
2278
+ if (_optionalChain([orderState, 'optionalAccess', _89 => _89.status]) === "order_cancelled") {
2279
+ const banner = bannerForStatus("order_cancelled", {});
2280
+ return { kind: "cancelled", message: _nullishCoalesce(banner.detail, () => ( banner.title)) };
2281
+ }
2282
+ return null;
2283
+ }, [latestEvent, orderState, bannerForStatus]);
2284
+ _react.useEffect.call(void 0, () => {
2285
+ if (completeFiredRef.current || failedFiredRef.current) return;
2286
+ const t = _optionalChain([latestEvent, 'optionalAccess', _90 => _90.type]);
2287
+ const isSuccess = t === "bridge-complete" || t === "post-bridge-swap-complete";
2288
+ if (!isSuccess) return;
2289
+ const txHash = currentDepositTxHashRef.current;
2290
+ if (!txHash) return;
2291
+ completeFiredRef.current = true;
2292
+ onSwappedCompleteRef.current({
2293
+ txHash,
2294
+ orderCrypto: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess', _91 => _91.orderCrypto]), () => ( null)),
2295
+ // Base-unit source amount from the deposit row/event, consistent with the
2296
+ // wallet/QR path. ProcessingStep + onLifecycle expect base units.
2297
+ amount: _nullishCoalesce(_chunkN4XRQPVAcjs.getEventSourceDetails.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0))).amount, () => ( null))
2298
+ });
2299
+ }, [latestEvent, orderState]);
2300
+ _react.useEffect.call(void 0, () => {
2301
+ if (failedFiredRef.current || completeFiredRef.current) return;
2302
+ if (!_chunkN4XRQPVAcjs.isFailedEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))) return;
2303
+ const txHash = currentDepositTxHashRef.current;
2304
+ if (!txHash) return;
2305
+ failedFiredRef.current = true;
2306
+ setPhase("tracker");
2307
+ _optionalChain([onSwappedFailedRef, 'access', _92 => _92.current, 'optionalCall', _93 => _93(
2308
+ txHash,
2309
+ _chunkN4XRQPVAcjs.failureMessageForEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))
2310
+ )]);
2311
+ }, [latestEvent]);
2312
+ if (phase === "tracker") {
2313
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2314
+ SwappedOrderTracker,
2315
+ {
2316
+ amount: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess', _94 => _94.orderCryptoAmount]), () => ( null)),
2317
+ currency: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess', _95 => _95.orderCrypto]), () => ( "USDC")),
2318
+ stepStates,
2319
+ terminal: terminalState,
2320
+ onRetry: () => setRetryToken((n) => n + 1),
2321
+ onClose
2322
+ }
2323
+ );
2324
+ }
2325
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen rs-fiat-onramp", "data-variant": variant, children: [
2326
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
2327
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2328
+ _chunkN4XRQPVAcjs.BodyHeader,
2329
+ {
2330
+ icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.HandCoinsIcon, {}),
2331
+ title: "Deposit",
2332
+ subtitle: "Add money to your balance"
2333
+ }
2334
+ ),
2335
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-fiat-onramp-iframe-wrap", children: [
2336
+ loadError && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-fiat-onramp-error", children: [
2337
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { children: loadError }),
2338
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2339
+ "button",
2340
+ {
2341
+ type: "button",
2342
+ className: "rs-fiat-onramp-retry",
2343
+ onClick: () => setRetryToken((n) => n + 1),
2344
+ children: "Retry"
2345
+ }
2346
+ )
2347
+ ] }),
2348
+ !loadError && !iframeLoaded && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-fiat-onramp-loading", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.Spinner, {}) }),
2349
+ widgetUrl && !loadError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2350
+ "iframe",
2351
+ {
2352
+ src: widgetUrl,
2353
+ title: iframeTitle,
2354
+ className: "rs-fiat-onramp-iframe",
2355
+ sandbox: "allow-scripts allow-forms allow-same-origin allow-popups allow-popups-to-escape-sandbox allow-top-navigation-by-user-activation",
2356
+ allow: "payment; camera; microphone; clipboard-write; geolocation",
2357
+ onLoad: () => setIframeLoaded(true)
2358
+ },
2359
+ retryToken
2360
+ )
2361
+ ] })
2362
+ ] }),
2363
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.PoweredBy, {})
2364
+ ] });
2365
+ }
2366
+ function deriveStepStates(swappedStatus, latestEvent) {
2367
+ if (_chunkN4XRQPVAcjs.isFailedEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))) {
2368
+ return ["complete", "complete", "failed", "pending"];
2369
+ }
2370
+ if (swappedStatus === "order_cancelled") {
2371
+ return ["failed", "pending", "pending", "pending"];
2372
+ }
2373
+ const step1Complete = swappedStatus === "order_completed" || swappedStatus === "order_broadcasted";
2374
+ const step2Complete = latestEvent !== null;
2375
+ const step3Complete = _optionalChain([latestEvent, 'optionalAccess', _96 => _96.type]) === "bridge-complete" || _optionalChain([latestEvent, 'optionalAccess', _97 => _97.type]) === "post-bridge-swap-complete";
2376
+ if (step3Complete) {
2377
+ return ["complete", "complete", "complete", "pending"];
2378
+ }
2379
+ if (step2Complete) {
2380
+ return ["complete", "complete", "active", "pending"];
2381
+ }
2382
+ if (step1Complete) {
2383
+ return ["complete", "active", "pending", "pending"];
2384
+ }
2385
+ return ["active", "pending", "pending", "pending"];
2386
+ }
2387
+ SwappedIframeStep.displayName = "SwappedIframeStep";
2388
+
2389
+ // src/components/steps/FiatOnrampStep.tsx
2390
+
2391
+ function fiatBannerForStatus(status, context) {
2392
+ if (context.currencyMismatch) {
2393
+ return {
2394
+ level: "warning",
2395
+ title: "Currency mismatch",
2396
+ detail: "Funds may not bridge automatically. Contact support if your balance does not arrive."
2397
+ };
2398
+ }
2399
+ switch (status) {
2400
+ case "payment_pending":
2401
+ return { level: "info", title: "Verifying payment\u2026" };
2402
+ case "order_completed":
2403
+ return { level: "success", title: "Payment received \u2014 sending crypto" };
2404
+ case "order_broadcasted":
2405
+ return {
2406
+ level: "success",
2407
+ title: "Crypto sent \u2014 confirming on-chain"
2408
+ };
2409
+ case "order_cancelled":
2410
+ return {
2411
+ level: "warning",
2412
+ title: "Order cancelled",
2413
+ detail: "If you were charged, Swapped will refund within 5 business days."
2414
+ };
2415
+ }
2416
+ }
2417
+ function FiatOnrampStep({
2418
+ smartAccount,
2419
+ service,
2420
+ paymentMethod,
2421
+ onSwappedComplete,
2422
+ onSwappedFailed,
2423
+ onClose,
2424
+ onError
2425
+ }) {
2426
+ const loadUrl = _react.useCallback.call(void 0, async () => {
2427
+ const res = await service.getSwappedWidgetUrl({
2428
+ smartAccount,
2429
+ method: paymentMethod
2430
+ });
2431
+ if (res.currencyCode !== "USDC_BASE") {
2432
+ console.warn(
2433
+ `[FiatOnrampStep] Expected backend to return currencyCode=USDC_BASE, got ${res.currencyCode}. Swapped purchases may not bridge as expected.`
2434
+ );
2435
+ }
2436
+ return res;
2437
+ }, [service, smartAccount, paymentMethod]);
2438
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2439
+ SwappedIframeStep,
2440
+ {
2441
+ smartAccount,
2442
+ service,
2443
+ variant: "fiat",
2444
+ loadUrl,
2445
+ iframeTitle: "Buy crypto with Swapped",
2446
+ loadErrorCode: "SWAPPED_URL_FAILED",
2447
+ loadErrorFallback: "Failed to load on-ramp",
2448
+ bannerForStatus: fiatBannerForStatus,
2449
+ onSwappedComplete,
2450
+ onSwappedFailed,
2451
+ onClose,
2452
+ onError
2453
+ }
2454
+ );
2455
+ }
2456
+ FiatOnrampStep.displayName = "FiatOnrampStep";
2457
+
2458
+ // src/components/steps/ExchangeConnectStep.tsx
2459
+
2460
+
2461
+ function connectBannerForStatus(status, context) {
2462
+ if (context.currencyMismatch) {
2463
+ return {
2464
+ level: "warning",
2465
+ title: "Currency mismatch",
2466
+ detail: "Funds may not bridge automatically. Contact support if your balance does not arrive."
2467
+ };
2468
+ }
2469
+ switch (status) {
2470
+ case "payment_pending":
2471
+ return { level: "info", title: "Waiting for exchange transfer\u2026" };
2472
+ case "order_completed":
2473
+ return {
2474
+ level: "success",
2475
+ title: "Exchange transfer received \u2014 sending crypto"
2476
+ };
2477
+ case "order_broadcasted":
2478
+ return {
2479
+ level: "success",
2480
+ title: "Crypto sent \u2014 confirming on-chain"
2481
+ };
2482
+ case "order_cancelled":
2483
+ return {
2484
+ level: "warning",
2485
+ title: "Order cancelled",
2486
+ detail: "If your exchange already debited the funds, Swapped will refund within 5 business days."
2487
+ };
2488
+ }
2489
+ }
2490
+ function ExchangeConnectStep({
2491
+ smartAccount,
2492
+ service,
2493
+ connection,
2494
+ onSwappedComplete,
2495
+ onSwappedFailed,
2496
+ onClose,
2497
+ onError
2498
+ }) {
2499
+ const loadUrl = _react.useCallback.call(void 0, async () => {
2500
+ const res = await service.getSwappedConnectUrl({
2501
+ smartAccount,
2502
+ connection
2503
+ });
2504
+ if (res.currencyCode !== "USDC_BASE") {
2505
+ console.warn(
2506
+ `[ExchangeConnectStep] Expected backend to return currencyCode=USDC_BASE, got ${res.currencyCode}. Swapped Connect pulls may not bridge as expected.`
2507
+ );
2508
+ }
2509
+ return res;
2510
+ }, [service, smartAccount, connection]);
2511
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2512
+ SwappedIframeStep,
2513
+ {
2514
+ smartAccount,
2515
+ service,
2516
+ variant: "connect",
2517
+ loadUrl,
2518
+ iframeTitle: "Fund from exchange via Swapped",
2519
+ loadErrorCode: "SWAPPED_CONNECT_URL_FAILED",
2520
+ loadErrorFallback: "Failed to load Connect",
2521
+ bannerForStatus: connectBannerForStatus,
2522
+ onSwappedComplete,
2523
+ onSwappedFailed,
2524
+ onClose,
2525
+ onError
2526
+ }
2527
+ );
2528
+ }
2529
+ ExchangeConnectStep.displayName = "ExchangeConnectStep";
2530
+
2531
+ // src/components/steps/ExchangeSelectStep.tsx
2532
+
2533
+
2534
+ function ExchangeLogo({ exchange }) {
2535
+ const [failed, setFailed] = _react.useState.call(void 0, false);
2536
+ if (!exchange.logoUrl || failed) {
2537
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.BankIcon, {});
2538
+ }
2539
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2540
+ "img",
2541
+ {
2542
+ src: exchange.logoUrl,
2543
+ alt: "",
2544
+ onError: () => setFailed(true)
2545
+ }
2546
+ );
2547
+ }
2548
+ function ExchangeSelectStep({
2549
+ service,
2550
+ onSelectExchange,
2551
+ onError
2552
+ }) {
2553
+ const [exchanges, setExchanges] = _react.useState.call(void 0, []);
2554
+ const [loading, setLoading] = _react.useState.call(void 0, true);
2555
+ const [error, setError] = _react.useState.call(void 0, null);
2556
+ const [retryToken, setRetryToken] = _react.useState.call(void 0, 0);
2557
+ const retry = _react.useCallback.call(void 0, () => {
2558
+ setRetryToken((n) => n + 1);
2559
+ }, []);
2560
+ _react.useEffect.call(void 0, () => {
2561
+ let cancelled = false;
2562
+ setLoading(true);
2563
+ setError(null);
2564
+ service.getSwappedConnectExchanges().then((res) => {
2565
+ if (cancelled) return;
2566
+ setExchanges(res.exchanges);
2567
+ }).catch((err) => {
2568
+ if (cancelled) return;
2569
+ const message = err instanceof Error ? err.message : "Failed to load exchanges";
2570
+ setExchanges([]);
2571
+ setError(message);
2572
+ _optionalChain([onError, 'optionalCall', _98 => _98(message, "SWAPPED_CONNECT_EXCHANGES_FAILED")]);
2573
+ }).finally(() => {
2574
+ if (!cancelled) setLoading(false);
2575
+ });
2576
+ return () => {
2577
+ cancelled = true;
2578
+ };
2579
+ }, [service, retryToken, onError]);
2580
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen rs-exchange-select", children: [
2581
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
2582
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2583
+ _chunkN4XRQPVAcjs.BodyHeader,
2584
+ {
2585
+ icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.BankIcon, {}),
2586
+ title: "Fund from Exchange",
2587
+ subtitle: "Choose your exchange"
2588
+ }
2589
+ ),
2590
+ loading && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-exchange-select-state", "aria-live": "polite", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.Spinner, {}) }),
2591
+ !loading && error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-exchange-select-state", "aria-live": "polite", children: [
2592
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-exchange-select-state-title", children: "Couldn\u2019t load exchanges" }),
2593
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2594
+ "button",
2595
+ {
2596
+ type: "button",
2597
+ className: "rs-fiat-onramp-retry",
2598
+ onClick: retry,
2599
+ children: "Retry"
2600
+ }
2601
+ )
2602
+ ] }),
2603
+ !loading && !error && exchanges.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-exchange-select-state", "aria-live": "polite", children: [
2604
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-exchange-select-state-title", children: "No exchanges available" }),
2605
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2606
+ "button",
2607
+ {
2608
+ type: "button",
2609
+ className: "rs-fiat-onramp-retry",
2610
+ onClick: retry,
2611
+ children: "Retry"
2612
+ }
2613
+ )
2614
+ ] }),
2615
+ !loading && !error && exchanges.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-exchange-grid", children: exchanges.map((exchange) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
2616
+ "button",
2617
+ {
2618
+ type: "button",
2619
+ className: "rs-exchange-card",
2620
+ onClick: () => onSelectExchange(exchange.connection),
2621
+ "aria-label": `Select ${exchange.name}`,
2622
+ children: [
2623
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-exchange-card-logo", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ExchangeLogo, { exchange }) }),
2624
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-exchange-card-name", children: exchange.name })
2625
+ ]
2626
+ },
2627
+ exchange.connection
2628
+ )) })
2629
+ ] }),
2630
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.PoweredBy, {})
2631
+ ] });
2632
+ }
2633
+ ExchangeSelectStep.displayName = "ExchangeSelectStep";
2634
+
1951
2635
  // src/components/steps/DepositAddressSkeleton.tsx
1952
2636
 
1953
2637
  var BASE_CHAIN_ID = 8453;
@@ -1955,8 +2639,8 @@ function DepositAddressSkeleton({
1955
2639
  uiConfig,
1956
2640
  allowedRoutes
1957
2641
  }) {
1958
- const allowedChainSet = _optionalChain([allowedRoutes, 'optionalAccess', _75 => _75.sourceChains]) ? new Set(allowedRoutes.sourceChains) : null;
1959
- const allowedTokenSet = _optionalChain([allowedRoutes, 'optionalAccess', _76 => _76.sourceTokens]) ? new Set(allowedRoutes.sourceTokens.map((s) => s.toUpperCase())) : null;
2642
+ const allowedChainSet = _optionalChain([allowedRoutes, 'optionalAccess', _99 => _99.sourceChains]) ? new Set(allowedRoutes.sourceChains) : null;
2643
+ const allowedTokenSet = _optionalChain([allowedRoutes, 'optionalAccess', _100 => _100.sourceTokens]) ? new Set(allowedRoutes.sourceTokens.map((s) => s.toUpperCase())) : null;
1960
2644
  const evmChainIds = (() => {
1961
2645
  const all = _chunk7JIDIX27cjs.getSupportedChainIds.call(void 0, );
1962
2646
  return allowedChainSet ? all.filter((id) => allowedChainSet.has(id)) : all;
@@ -1973,7 +2657,7 @@ function DepositAddressSkeleton({
1973
2657
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", "aria-busy": "true", children: [
1974
2658
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-sr-only", role: "status", children: "Preparing deposit details\u2026" }),
1975
2659
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
1976
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.TransferCryptoIcon, {}), title: "Transfer crypto" }),
2660
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.TransferCryptoIcon, {}), title: "Transfer crypto" }),
1977
2661
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-selectors", "aria-hidden": "true", children: [
1978
2662
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown", children: [
1979
2663
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-dropdown-label", children: "Supported chain" }),
@@ -1987,7 +2671,7 @@ function DepositAddressSkeleton({
1987
2671
  }
1988
2672
  ),
1989
2673
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: chainName }),
1990
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
2674
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
1991
2675
  ] })
1992
2676
  ] }),
1993
2677
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown", children: [
@@ -1995,9 +2679,9 @@ function DepositAddressSkeleton({
1995
2679
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Supported token" }),
1996
2680
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-deposit-address-min", children: [
1997
2681
  "Min.$",
1998
- (_nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _77 => _77.minDepositUsd]), () => ( 0.1))).toFixed(2),
1999
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.Tooltip, { content: "Minimum deposit amount required for the selected chain.", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2000
- _chunk2TWQGPPBcjs.InfoIcon,
2682
+ (_nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _101 => _101.minDepositUsd]), () => ( 0.1))).toFixed(2),
2683
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.Tooltip, { content: "Minimum deposit amount required for the selected chain.", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2684
+ _chunkN4XRQPVAcjs.InfoIcon,
2001
2685
  {
2002
2686
  className: "rs-deposit-address-min-icon",
2003
2687
  "aria-hidden": "true"
@@ -2015,7 +2699,7 @@ function DepositAddressSkeleton({
2015
2699
  }
2016
2700
  ),
2017
2701
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: defaultToken }),
2018
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
2702
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
2019
2703
  ] })
2020
2704
  ] })
2021
2705
  ] }),
@@ -2036,7 +2720,7 @@ function DepositAddressSkeleton({
2036
2720
  disabled: true,
2037
2721
  "aria-hidden": "true",
2038
2722
  children: [
2039
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.CopyIcon, {}),
2723
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.CopyIcon, {}),
2040
2724
  "Copy address"
2041
2725
  ]
2042
2726
  }
@@ -2049,16 +2733,16 @@ function DepositAddressSkeleton({
2049
2733
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-label", children: "Price impact" }),
2050
2734
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-label", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: "0.00%" }) }),
2051
2735
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2052
- _chunk2TWQGPPBcjs.Tooltip,
2736
+ _chunkN4XRQPVAcjs.Tooltip,
2053
2737
  {
2054
2738
  className: "rs-price-impact-info",
2055
2739
  content: "Price impact is the difference between expected and execution price, due to trade size and liquidity.",
2056
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.InfoIcon, { "aria-hidden": "true" })
2740
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.InfoIcon, { "aria-hidden": "true" })
2057
2741
  }
2058
2742
  )
2059
2743
  ] }),
2060
2744
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2061
- _chunk2TWQGPPBcjs.ChevronDownIcon,
2745
+ _chunkN4XRQPVAcjs.ChevronDownIcon,
2062
2746
  {
2063
2747
  className: "rs-price-impact-chevron",
2064
2748
  "aria-hidden": "true"
@@ -2066,7 +2750,7 @@ function DepositAddressSkeleton({
2066
2750
  )
2067
2751
  ] }) })
2068
2752
  ] }),
2069
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.PoweredBy, {})
2753
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.PoweredBy, {})
2070
2754
  ] });
2071
2755
  }
2072
2756
  DepositAddressSkeleton.displayName = "DepositAddressSkeleton";
@@ -2098,7 +2782,7 @@ function SolanaTokenSelectStep({
2098
2782
  setError(null);
2099
2783
  const portfolioBySymbol = {};
2100
2784
  try {
2101
- _chunk2TWQGPPBcjs.debugLog.call(void 0, debug, "solana-token-select", "portfolio:request", {
2785
+ _chunkN4XRQPVAcjs.debugLog.call(void 0, debug, "solana-token-select", "portfolio:request", {
2102
2786
  solanaAddress
2103
2787
  });
2104
2788
  const portfolio = await service.fetchSolanaPortfolio(solanaAddress);
@@ -2109,7 +2793,7 @@ function SolanaTokenSelectStep({
2109
2793
  let parsed = 0n;
2110
2794
  try {
2111
2795
  parsed = BigInt(t.balance || "0");
2112
- } catch (e15) {
2796
+ } catch (e18) {
2113
2797
  parsed = 0n;
2114
2798
  }
2115
2799
  if (parsed <= 0n) continue;
@@ -2121,12 +2805,12 @@ function SolanaTokenSelectStep({
2121
2805
  };
2122
2806
  }
2123
2807
  }
2124
- _chunk2TWQGPPBcjs.debugLog.call(void 0, debug, "solana-token-select", "portfolio:success", {
2808
+ _chunkN4XRQPVAcjs.debugLog.call(void 0, debug, "solana-token-select", "portfolio:success", {
2125
2809
  symbols: Object.keys(portfolioBySymbol)
2126
2810
  });
2127
2811
  } catch (err) {
2128
2812
  if (!active) return;
2129
- _chunk2TWQGPPBcjs.debugError.call(void 0, debug, "solana-token-select", "portfolio:failure", err, {
2813
+ _chunkN4XRQPVAcjs.debugError.call(void 0, debug, "solana-token-select", "portfolio:failure", err, {
2130
2814
  solanaAddress
2131
2815
  });
2132
2816
  setError(
@@ -2151,7 +2835,7 @@ function SolanaTokenSelectStep({
2151
2835
  setTokenBalances(results);
2152
2836
  setLoading(false);
2153
2837
  const totalUsd = results.reduce((sum, r) => sum + r.balanceUsd, 0);
2154
- _optionalChain([onTotalBalanceComputed, 'optionalCall', _78 => _78(totalUsd)]);
2838
+ _optionalChain([onTotalBalanceComputed, 'optionalCall', _102 => _102(totalUsd)]);
2155
2839
  }
2156
2840
  void loadBalances();
2157
2841
  return () => {
@@ -2173,8 +2857,8 @@ function SolanaTokenSelectStep({
2173
2857
  const raw = _viem.formatUnits.call(void 0, entry.balance, entry.token.decimals);
2174
2858
  const numeric = Number(raw);
2175
2859
  if (!Number.isFinite(numeric)) return raw;
2176
- return _chunk2TWQGPPBcjs.tokenFormatter.format(numeric);
2177
- } catch (e16) {
2860
+ return _chunkN4XRQPVAcjs.tokenFormatter.format(numeric);
2861
+ } catch (e19) {
2178
2862
  return "--";
2179
2863
  }
2180
2864
  };
@@ -2183,20 +2867,20 @@ function SolanaTokenSelectStep({
2183
2867
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
2184
2868
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
2185
2869
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2186
- _chunk2TWQGPPBcjs.BodyHeader,
2870
+ _chunkN4XRQPVAcjs.BodyHeader,
2187
2871
  {
2188
- icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.WalletIcon, {}),
2872
+ icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.WalletIcon, {}),
2189
2873
  title: "Your assets",
2190
2874
  subtitle: "Select source assets to transfer"
2191
2875
  }
2192
2876
  ),
2193
2877
  loading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
2194
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.Spinner, { className: "rs-text-tertiary" }),
2878
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.Spinner, { className: "rs-text-tertiary" }),
2195
2879
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
2196
2880
  ] }),
2197
- error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.Callout, { variant: "error", children: error }),
2881
+ error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.Callout, { variant: "error", children: error }),
2198
2882
  !loading && !error && rows.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-state", children: [
2199
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.WalletIcon, { className: "rs-empty-icon" }),
2883
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.WalletIcon, { className: "rs-empty-icon" }),
2200
2884
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-empty-text", children: "No funds in connected wallet" }),
2201
2885
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-address", children: [
2202
2886
  solanaAddress.slice(0, 6),
@@ -2245,14 +2929,14 @@ function SolanaTokenSelectStep({
2245
2929
  ] })
2246
2930
  ] })
2247
2931
  ] }),
2248
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: entry.balanceUsd > 0 ? _chunk2TWQGPPBcjs.currencyFormatter.format(entry.balanceUsd) : tokenAmount !== "--" ? `${tokenAmount} ${entry.token.symbol}` : "--" })
2932
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: entry.balanceUsd > 0 ? _chunkN4XRQPVAcjs.currencyFormatter.format(entry.balanceUsd) : tokenAmount !== "--" ? `${tokenAmount} ${entry.token.symbol}` : "--" })
2249
2933
  ]
2250
2934
  },
2251
2935
  entry.token.symbol
2252
2936
  );
2253
2937
  }) }),
2254
2938
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2255
- _chunk2TWQGPPBcjs.Button,
2939
+ _chunkN4XRQPVAcjs.Button,
2256
2940
  {
2257
2941
  onClick: () => selectedEntry && onContinue(
2258
2942
  selectedEntry.token,
@@ -2265,7 +2949,7 @@ function SolanaTokenSelectStep({
2265
2949
  }
2266
2950
  )
2267
2951
  ] }),
2268
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.PoweredBy, {})
2952
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.PoweredBy, {})
2269
2953
  ] });
2270
2954
  }
2271
2955
 
@@ -2297,7 +2981,7 @@ function SolanaAmountStep({
2297
2981
  const [error, setError] = _react.useState.call(void 0, null);
2298
2982
  const hasAppliedDefaultRef = _react.useRef.call(void 0, false);
2299
2983
  const isSourceStablecoin = _chunk7JIDIX27cjs.isStablecoinSymbol.call(void 0, token.symbol);
2300
- const isMaxDefault = _optionalChain([defaultAmount, 'optionalAccess', _79 => _79.trim, 'call', _80 => _80(), 'access', _81 => _81.toLowerCase, 'call', _82 => _82()]) === "max";
2984
+ const isMaxDefault = _optionalChain([defaultAmount, 'optionalAccess', _103 => _103.trim, 'call', _104 => _104(), 'access', _105 => _105.toLowerCase, 'call', _106 => _106()]) === "max";
2301
2985
  const tokenPriceUsd = _react.useMemo.call(void 0, () => {
2302
2986
  if (isSourceStablecoin) return 1;
2303
2987
  try {
@@ -2307,7 +2991,7 @@ function SolanaAmountStep({
2307
2991
  }
2308
2992
  const price = balanceUsd / balanceUnits;
2309
2993
  return price > 0 ? price : null;
2310
- } catch (e17) {
2994
+ } catch (e20) {
2311
2995
  return null;
2312
2996
  }
2313
2997
  }, [isSourceStablecoin, balance, token.decimals, balanceUsd]);
@@ -2317,8 +3001,8 @@ function SolanaAmountStep({
2317
3001
  const raw = _viem.formatUnits.call(void 0, balance, token.decimals);
2318
3002
  const numeric = Number(raw);
2319
3003
  if (!Number.isFinite(numeric)) return raw;
2320
- return _chunk2TWQGPPBcjs.tokenFormatter.format(numeric);
2321
- } catch (e18) {
3004
+ return _chunkN4XRQPVAcjs.tokenFormatter.format(numeric);
3005
+ } catch (e21) {
2322
3006
  return "\u2026";
2323
3007
  }
2324
3008
  }, [balance, token.decimals]);
@@ -2329,7 +3013,7 @@ function SolanaAmountStep({
2329
3013
  if (tokenPriceUsd !== null) return balanceUnits * tokenPriceUsd;
2330
3014
  if (Number.isFinite(balanceUsd) && balanceUsd > 0) return balanceUsd;
2331
3015
  return null;
2332
- } catch (e19) {
3016
+ } catch (e22) {
2333
3017
  return null;
2334
3018
  }
2335
3019
  }, [balance, token.decimals, tokenPriceUsd, balanceUsd]);
@@ -2343,7 +3027,7 @@ function SolanaAmountStep({
2343
3027
  if (!Number.isFinite(spendableUnits) || spendableUnits < 0) return null;
2344
3028
  if (tokenPriceUsd !== null) return spendableUnits * tokenPriceUsd;
2345
3029
  return null;
2346
- } catch (e20) {
3030
+ } catch (e23) {
2347
3031
  return null;
2348
3032
  }
2349
3033
  }, [spendableBalance, token.decimals, tokenPriceUsd]);
@@ -2358,7 +3042,7 @@ function SolanaAmountStep({
2358
3042
  const factor = 1e3;
2359
3043
  const truncated = Math.floor(value * factor) / factor;
2360
3044
  return truncated.toFixed(3).replace(/\.?0+$/, "");
2361
- } catch (e21) {
3045
+ } catch (e24) {
2362
3046
  return "";
2363
3047
  }
2364
3048
  },
@@ -2395,12 +3079,12 @@ function SolanaAmountStep({
2395
3079
  const raw = isSourceStablecoin || !hasPricing ? numericAmount : numericAmount / (_nullishCoalesce(tokenPriceUsd, () => ( 1)));
2396
3080
  try {
2397
3081
  return _viem.parseUnits.call(void 0, raw.toString(), token.decimals);
2398
- } catch (e22) {
3082
+ } catch (e25) {
2399
3083
  return null;
2400
3084
  }
2401
3085
  }, [numericAmount, isSourceStablecoin, hasPricing, tokenPriceUsd, token.decimals]);
2402
- const minDepositUsd = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _83 => _83.minDepositUsd]), () => ( null));
2403
- const maxDepositUsd = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _84 => _84.maxDepositUsd]), () => ( null));
3086
+ const minDepositUsd = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _107 => _107.minDepositUsd]), () => ( null));
3087
+ const maxDepositUsd = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _108 => _108.maxDepositUsd]), () => ( null));
2404
3088
  const isBelowMin = minDepositUsd !== null && numericAmount > 0 && numericAmount < minDepositUsd;
2405
3089
  const isAboveMax = maxDepositUsd !== null && numericAmount > maxDepositUsd;
2406
3090
  const exceedsBalance = Boolean(
@@ -2410,7 +3094,7 @@ function SolanaAmountStep({
2410
3094
  const handlePresetClick = (percentage) => {
2411
3095
  const formatted = computePresetAmount(percentage);
2412
3096
  if (!formatted) return;
2413
- _chunk2TWQGPPBcjs.debugLog.call(void 0, debug, "solana-amount", "amount:preset", {
3097
+ _chunkN4XRQPVAcjs.debugLog.call(void 0, debug, "solana-amount", "amount:preset", {
2414
3098
  percentage,
2415
3099
  symbol: token.symbol,
2416
3100
  formatted
@@ -2444,8 +3128,8 @@ function SolanaAmountStep({
2444
3128
  let amountInUnits;
2445
3129
  try {
2446
3130
  amountInUnits = _viem.parseUnits.call(void 0, sourceAmountStr, token.decimals);
2447
- } catch (e23) {
2448
- _chunk2TWQGPPBcjs.debugLog.call(void 0, debug, "solana-amount", "amount:invalid", {
3131
+ } catch (e26) {
3132
+ _chunkN4XRQPVAcjs.debugLog.call(void 0, debug, "solana-amount", "amount:invalid", {
2449
3133
  amount,
2450
3134
  sourceAmount: sourceAmountStr,
2451
3135
  reason: "parse-units-failed"
@@ -2460,7 +3144,7 @@ function SolanaAmountStep({
2460
3144
  );
2461
3145
  return;
2462
3146
  }
2463
- _chunk2TWQGPPBcjs.debugLog.call(void 0, debug, "solana-amount", "amount:continue", {
3147
+ _chunkN4XRQPVAcjs.debugLog.call(void 0, debug, "solana-amount", "amount:continue", {
2464
3148
  symbol: token.symbol,
2465
3149
  inputAmountUsd: amount,
2466
3150
  sourceAmount: sourceAmountStr,
@@ -2474,7 +3158,7 @@ function SolanaAmountStep({
2474
3158
  const sourceTokenIcon = _chunk7JIDIX27cjs.getTokenIcon.call(void 0, token.symbol);
2475
3159
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
2476
3160
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
2477
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.WalletIcon, {}), title: "Wallet deposit" }),
3161
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.WalletIcon, {}), title: "Wallet deposit" }),
2478
3162
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-section", children: [
2479
3163
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-display", children: [
2480
3164
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
@@ -2494,13 +3178,13 @@ function SolanaAmountStep({
2494
3178
  " available",
2495
3179
  computedBalanceUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
2496
3180
  " (~",
2497
- _chunk2TWQGPPBcjs.currencyFormatter.format(computedBalanceUsd),
3181
+ _chunkN4XRQPVAcjs.currencyFormatter.format(computedBalanceUsd),
2498
3182
  ")"
2499
3183
  ] })
2500
3184
  ] }),
2501
3185
  minDepositUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-amount-meta-minimum", children: [
2502
3186
  "Min. deposit ",
2503
- _chunk2TWQGPPBcjs.currencyFormatter.format(minDepositUsd)
3187
+ _chunkN4XRQPVAcjs.currencyFormatter.format(minDepositUsd)
2504
3188
  ] })
2505
3189
  ] })
2506
3190
  ] }),
@@ -2539,12 +3223,12 @@ function SolanaAmountStep({
2539
3223
  ] }),
2540
3224
  balanceAfterUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
2541
3225
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Balance after deposit" }),
2542
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children: _chunk2TWQGPPBcjs.currencyFormatter.format(balanceAfterUsd) })
3226
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children: _chunkN4XRQPVAcjs.currencyFormatter.format(balanceAfterUsd) })
2543
3227
  ] })
2544
3228
  ] }),
2545
- error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.Callout, { variant: "error", children: error }),
3229
+ error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.Callout, { variant: "error", children: error }),
2546
3230
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2547
- _chunk2TWQGPPBcjs.Button,
3231
+ _chunkN4XRQPVAcjs.Button,
2548
3232
  {
2549
3233
  onClick: handleContinue,
2550
3234
  fullWidth: true,
@@ -2553,7 +3237,7 @@ function SolanaAmountStep({
2553
3237
  }
2554
3238
  )
2555
3239
  ] }),
2556
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.PoweredBy, {})
3240
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.PoweredBy, {})
2557
3241
  ] });
2558
3242
  }
2559
3243
 
@@ -2577,7 +3261,7 @@ var DEFAULT_SOLANA_RPC_URL = "https://api.mainnet.solana.com";
2577
3261
  var configuredSolanaRpcUrl = null;
2578
3262
  var cachedConnections = /* @__PURE__ */ new Map();
2579
3263
  function configureSolanaRpcUrl(rpcUrl) {
2580
- const normalized = _optionalChain([rpcUrl, 'optionalAccess', _85 => _85.trim, 'call', _86 => _86()]);
3264
+ const normalized = _optionalChain([rpcUrl, 'optionalAccess', _109 => _109.trim, 'call', _110 => _110()]);
2581
3265
  configuredSolanaRpcUrl = normalized ? normalized : null;
2582
3266
  cachedConnections.clear();
2583
3267
  }
@@ -2697,8 +3381,8 @@ function SolanaConfirmStep({
2697
3381
  const targetChainIcon = _chunk7JIDIX27cjs.getChainIcon.call(void 0, targetChain);
2698
3382
  const sourceTokenIcon = _chunk7JIDIX27cjs.getTokenIcon.call(void 0, token.symbol);
2699
3383
  const targetTokenIcon = _chunk7JIDIX27cjs.getTokenIcon.call(void 0, targetSymbol);
2700
- const feeSponsored = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _87 => _87.feeSponsored]), () => ( false));
2701
- const feeTooltip = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _88 => _88.feeTooltip]), () => ( (feeSponsored ? "Network fees are sponsored for this deposit." : "Network fees apply.")));
3384
+ const feeSponsored = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _111 => _111.feeSponsored]), () => ( false));
3385
+ const feeTooltip = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _112 => _112.feeTooltip]), () => ( (feeSponsored ? "Network fees are sponsored for this deposit." : "Network fees apply.")));
2702
3386
  const formattedAmount = sourceAmount && !Number.isNaN(Number(sourceAmount)) ? Number(sourceAmount).toLocaleString("en-US", {
2703
3387
  minimumFractionDigits: 2,
2704
3388
  maximumFractionDigits: 6
@@ -2720,7 +3404,7 @@ function SolanaConfirmStep({
2720
3404
  const receiveAmount = isSameToken ? formattedReceiveAmount : `~${formattedReceiveAmount}`;
2721
3405
  const handleConfirm = async () => {
2722
3406
  if (!solanaProvider) {
2723
- _chunk2TWQGPPBcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:blocked", {
3407
+ _chunkN4XRQPVAcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:blocked", {
2724
3408
  reason: "missing-provider"
2725
3409
  });
2726
3410
  setError("Solana wallet not connected");
@@ -2728,7 +3412,7 @@ function SolanaConfirmStep({
2728
3412
  }
2729
3413
  const parsedAmount = parseFloat(sourceAmount);
2730
3414
  if (isNaN(parsedAmount) || parsedAmount <= 0) {
2731
- _chunk2TWQGPPBcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:blocked", {
3415
+ _chunkN4XRQPVAcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:blocked", {
2732
3416
  reason: "invalid-amount",
2733
3417
  sourceAmount
2734
3418
  });
@@ -2737,7 +3421,7 @@ function SolanaConfirmStep({
2737
3421
  }
2738
3422
  setError(null);
2739
3423
  setIsSubmitting(true);
2740
- _chunk2TWQGPPBcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:start", {
3424
+ _chunkN4XRQPVAcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:start", {
2741
3425
  smartAccount,
2742
3426
  solanaAddress,
2743
3427
  solanaDepositAddress,
@@ -2747,7 +3431,7 @@ function SolanaConfirmStep({
2747
3431
  });
2748
3432
  try {
2749
3433
  const check = await service.checkAccount(smartAccount);
2750
- _chunk2TWQGPPBcjs.debugLog.call(void 0, debug, "solana-confirm", "check:success", {
3434
+ _chunkN4XRQPVAcjs.debugLog.call(void 0, debug, "solana-confirm", "check:success", {
2751
3435
  smartAccount,
2752
3436
  isRegistered: check.isRegistered,
2753
3437
  targetChain: check.targetChain,
@@ -2760,7 +3444,7 @@ function SolanaConfirmStep({
2760
3444
  }
2761
3445
  const connection = hasConfiguredSolanaRpcUrl() ? getSolanaConnection() : _nullishCoalesce(solanaConnection, () => ( getSolanaConnection()));
2762
3446
  const amountUnits = _viem.parseUnits.call(void 0, sourceAmount, token.decimals);
2763
- _chunk2TWQGPPBcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:start", {
3447
+ _chunkN4XRQPVAcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:start", {
2764
3448
  token: token.symbol,
2765
3449
  sourceAmount,
2766
3450
  amountUnits: amountUnits.toString()
@@ -2777,10 +3461,10 @@ function SolanaConfirmStep({
2777
3461
  token.mint,
2778
3462
  amountUnits
2779
3463
  );
2780
- _chunk2TWQGPPBcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:success", {
3464
+ _chunkN4XRQPVAcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:success", {
2781
3465
  token: token.symbol,
2782
3466
  instructionCount: transaction.instructions.length,
2783
- feePayer: _optionalChain([transaction, 'access', _89 => _89.feePayer, 'optionalAccess', _90 => _90.toBase58, 'call', _91 => _91()]),
3467
+ feePayer: _optionalChain([transaction, 'access', _113 => _113.feePayer, 'optionalAccess', _114 => _114.toBase58, 'call', _115 => _115()]),
2784
3468
  recentBlockhash: transaction.recentBlockhash
2785
3469
  });
2786
3470
  const txHash = await sendSolanaTransaction(
@@ -2788,28 +3472,28 @@ function SolanaConfirmStep({
2788
3472
  connection,
2789
3473
  transaction
2790
3474
  );
2791
- _chunk2TWQGPPBcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:sent", {
3475
+ _chunkN4XRQPVAcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:sent", {
2792
3476
  txHash,
2793
3477
  amountUnits: amountUnits.toString()
2794
3478
  });
2795
3479
  onConfirm(txHash, amountUnits.toString());
2796
3480
  } catch (err) {
2797
3481
  const raw = err instanceof Error ? err.message : "Transfer failed";
2798
- const message = _chunk2TWQGPPBcjs.formatUserError.call(void 0, raw);
2799
- _chunk2TWQGPPBcjs.debugError.call(void 0, debug, "solana-confirm", "submit:failure", err, {
3482
+ const message = _chunkN4XRQPVAcjs.formatUserError.call(void 0, raw);
3483
+ _chunkN4XRQPVAcjs.debugError.call(void 0, debug, "solana-confirm", "submit:failure", err, {
2800
3484
  smartAccount,
2801
3485
  token: token.symbol,
2802
3486
  sourceAmount
2803
3487
  });
2804
3488
  setError(message);
2805
- _optionalChain([onError, 'optionalCall', _92 => _92(message, "SOLANA_TRANSFER_ERROR")]);
3489
+ _optionalChain([onError, 'optionalCall', _116 => _116(message, "SOLANA_TRANSFER_ERROR")]);
2806
3490
  } finally {
2807
3491
  setIsSubmitting(false);
2808
3492
  }
2809
3493
  };
2810
3494
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
2811
3495
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
2812
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.WalletIcon, {}), title: "Review deposit" }),
3496
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.WalletIcon, {}), title: "Review deposit" }),
2813
3497
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-details", children: [
2814
3498
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
2815
3499
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Source chain" }),
@@ -2861,13 +3545,13 @@ function SolanaConfirmStep({
2861
3545
  children: "$0.04"
2862
3546
  }
2863
3547
  ),
2864
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.Tooltip, { content: feeTooltip, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-info", "aria-label": "Fee info", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.InfoIcon, {}) }) })
3548
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.Tooltip, { content: feeTooltip, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-info", "aria-label": "Fee info", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.InfoIcon, {}) }) })
2865
3549
  ] })
2866
3550
  ] })
2867
3551
  ] }),
2868
- error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.Callout, { variant: "error", children: error }),
3552
+ error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.Callout, { variant: "error", children: error }),
2869
3553
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2870
- _chunk2TWQGPPBcjs.Button,
3554
+ _chunkN4XRQPVAcjs.Button,
2871
3555
  {
2872
3556
  onClick: handleConfirm,
2873
3557
  loading: isSubmitting,
@@ -2878,7 +3562,7 @@ function SolanaConfirmStep({
2878
3562
  }
2879
3563
  )
2880
3564
  ] }),
2881
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.PoweredBy, {})
3565
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.PoweredBy, {})
2882
3566
  ] });
2883
3567
  }
2884
3568
 
@@ -2892,18 +3576,18 @@ function DappImportAssetSelectStep({
2892
3576
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
2893
3577
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
2894
3578
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2895
- _chunk2TWQGPPBcjs.BodyHeader,
3579
+ _chunkN4XRQPVAcjs.BodyHeader,
2896
3580
  {
2897
- icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.WalletIcon, {}),
3581
+ icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.WalletIcon, {}),
2898
3582
  title: `Transfer from ${sourceLabel}`,
2899
3583
  subtitle: "Pick the balance to import"
2900
3584
  }
2901
3585
  ),
2902
3586
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-list", children: assets.map((asset) => {
2903
- const tokenAmount = asset.balance ? _chunk2TWQGPPBcjs.tokenFormatter.format(
3587
+ const tokenAmount = asset.balance ? _chunkN4XRQPVAcjs.tokenFormatter.format(
2904
3588
  Number(asset.balance) / 10 ** asset.decimals
2905
3589
  ) : "0";
2906
- const balanceUsd = asset.balanceUsd && asset.balanceUsd > 0 ? _chunk2TWQGPPBcjs.currencyFormatter.format(asset.balanceUsd) : `${tokenAmount} ${asset.symbol}`;
3590
+ const balanceUsd = asset.balanceUsd && asset.balanceUsd > 0 ? _chunkN4XRQPVAcjs.currencyFormatter.format(asset.balanceUsd) : `${tokenAmount} ${asset.symbol}`;
2907
3591
  const tokenIcon = _nullishCoalesce(asset.icon, () => ( _chunk7JIDIX27cjs.getTokenIcon.call(void 0, asset.symbol)));
2908
3592
  const chainIcon = _chunk7JIDIX27cjs.getChainIcon.call(void 0, asset.chainId);
2909
3593
  const badge = _chunk7JIDIX27cjs.getChainBadge.call(void 0, asset.chainId);
@@ -2954,7 +3638,7 @@ function DappImportAssetSelectStep({
2954
3638
  );
2955
3639
  }) })
2956
3640
  ] }),
2957
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.PoweredBy, {})
3641
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.PoweredBy, {})
2958
3642
  ] });
2959
3643
  }
2960
3644
  DappImportAssetSelectStep.displayName = "DappImportAssetSelectStep";
@@ -3020,7 +3704,7 @@ async function detectPolymarketWalletKind(params) {
3020
3704
  contracts: [
3021
3705
  {
3022
3706
  address: proxyWallet,
3023
- abi: _chunk2TWQGPPBcjs.SAFE_ABI,
3707
+ abi: _chunkN4XRQPVAcjs.SAFE_ABI,
3024
3708
  functionName: "isOwner",
3025
3709
  args: [eoa]
3026
3710
  },
@@ -3145,7 +3829,7 @@ async function fetchPolymarketProxyWallet(eoa, signal) {
3145
3829
  let response;
3146
3830
  try {
3147
3831
  response = await fetch(url, { signal });
3148
- } catch (e24) {
3832
+ } catch (e27) {
3149
3833
  return null;
3150
3834
  }
3151
3835
  if (!response.ok) {
@@ -3154,7 +3838,7 @@ async function fetchPolymarketProxyWallet(eoa, signal) {
3154
3838
  let payload;
3155
3839
  try {
3156
3840
  payload = await response.json();
3157
- } catch (e25) {
3841
+ } catch (e28) {
3158
3842
  return null;
3159
3843
  }
3160
3844
  const raw = payload.proxyWallet;
@@ -3208,7 +3892,7 @@ async function readPolymarketBalances(params) {
3208
3892
  pusd: results[0].status === "success" ? results[0].result : 0n,
3209
3893
  usdce: results[1].status === "success" ? results[1].result : 0n
3210
3894
  };
3211
- } catch (e26) {
3895
+ } catch (e29) {
3212
3896
  return { pusd: 0n, usdce: 0n };
3213
3897
  }
3214
3898
  }
@@ -3231,7 +3915,7 @@ async function executePolymarketSafeTransfer(params) {
3231
3915
  }
3232
3916
  const isOwner = await publicClient.readContract({
3233
3917
  address: safeAddress,
3234
- abi: _chunk2TWQGPPBcjs.SAFE_ABI,
3918
+ abi: _chunkN4XRQPVAcjs.SAFE_ABI,
3235
3919
  functionName: "isOwner",
3236
3920
  args: [account.address]
3237
3921
  });
@@ -3248,7 +3932,7 @@ async function executePolymarketSafeTransfer(params) {
3248
3932
  account,
3249
3933
  chain,
3250
3934
  address: safeAddress,
3251
- abi: _chunk2TWQGPPBcjs.SAFE_ABI,
3935
+ abi: _chunkN4XRQPVAcjs.SAFE_ABI,
3252
3936
  functionName: "execTransaction",
3253
3937
  args: [
3254
3938
  safeTx.to,
@@ -3267,7 +3951,7 @@ async function executePolymarketSafeTransfer(params) {
3267
3951
  hash: txHash
3268
3952
  });
3269
3953
  const parsed = _viem.parseEventLogs.call(void 0, {
3270
- abi: _chunk2TWQGPPBcjs.SAFE_ABI,
3954
+ abi: _chunkN4XRQPVAcjs.SAFE_ABI,
3271
3955
  logs: receipt.logs.filter(
3272
3956
  (log) => log.address.toLowerCase() === safeAddress.toLowerCase()
3273
3957
  ),
@@ -3345,21 +4029,21 @@ var polymarketProvider = {
3345
4029
  async fetchAvailability({ eoa, getPublicClient: getPublicClient2, signal }) {
3346
4030
  const proxyWallet = await fetchPolymarketProxyWallet(eoa, signal);
3347
4031
  if (!proxyWallet) return null;
3348
- if (_optionalChain([signal, 'optionalAccess', _93 => _93.aborted])) return null;
4032
+ if (_optionalChain([signal, 'optionalAccess', _117 => _117.aborted])) return null;
3349
4033
  const polygonClient = getPublicClient2(POLYMARKET_POLYGON_CHAIN_ID);
3350
4034
  if (!polygonClient) return null;
3351
4035
  const balances = await readPolymarketBalances({
3352
4036
  publicClient: polygonClient,
3353
4037
  proxyWallet
3354
4038
  });
3355
- if (_optionalChain([signal, 'optionalAccess', _94 => _94.aborted])) return null;
4039
+ if (_optionalChain([signal, 'optionalAccess', _118 => _118.aborted])) return null;
3356
4040
  if (balances.pusd === 0n && balances.usdce === 0n) return null;
3357
4041
  const walletKind = await detectPolymarketWalletKind({
3358
4042
  publicClient: polygonClient,
3359
4043
  proxyWallet,
3360
4044
  eoa
3361
4045
  });
3362
- if (_optionalChain([signal, 'optionalAccess', _95 => _95.aborted])) return null;
4046
+ if (_optionalChain([signal, 'optionalAccess', _119 => _119.aborted])) return null;
3363
4047
  if (!walletKind) return null;
3364
4048
  const assets = [];
3365
4049
  if (balances.pusd > 0n) {
@@ -3569,8 +4253,19 @@ function applyBack(state, hasWalletOptions) {
3569
4253
  },
3570
4254
  flow: { ...state.flow, step: "solana-amount", hasNavigatedBack: true }
3571
4255
  };
4256
+ case "exchange-connect":
4257
+ return {
4258
+ ...state,
4259
+ flow: {
4260
+ ...state.flow,
4261
+ step: "exchange-select",
4262
+ hasNavigatedBack: true
4263
+ }
4264
+ };
3572
4265
  case "select-asset":
3573
4266
  case "deposit-address":
4267
+ case "fiat-onramp":
4268
+ case "exchange-select":
3574
4269
  case "solana-token-select":
3575
4270
  case "dapp-import-asset-select":
3576
4271
  return {
@@ -3587,7 +4282,8 @@ function applyBack(state, hasWalletOptions) {
3587
4282
  ...state.dappImport,
3588
4283
  activeProviderId: null,
3589
4284
  selectedAsset: null
3590
- }
4285
+ },
4286
+ exchange: { selectedConnection: null }
3591
4287
  };
3592
4288
  case "connect":
3593
4289
  case "setup":
@@ -3600,7 +4296,8 @@ function applyBack(state, hasWalletOptions) {
3600
4296
  mode: null,
3601
4297
  isConnectSelectionConfirmed: false,
3602
4298
  hasNavigatedBack: hasWalletOptions || state.flow.hasNavigatedBack
3603
- }
4299
+ },
4300
+ exchange: { selectedConnection: null }
3604
4301
  };
3605
4302
  }
3606
4303
  return state;
@@ -3620,6 +4317,10 @@ function modeEntryStep(mode) {
3620
4317
  return "solana-token-select";
3621
4318
  case "dapp-import":
3622
4319
  return "dapp-import-asset-select";
4320
+ case "fiat-onramp":
4321
+ return "fiat-onramp";
4322
+ case "exchange-connect":
4323
+ return "exchange-select";
3623
4324
  }
3624
4325
  }
3625
4326
  function updateSetupEntry(state, owner, update) {
@@ -3665,7 +4366,8 @@ function applyAction(state, action) {
3665
4366
  ...state.dappImport,
3666
4367
  activeProviderId: null,
3667
4368
  selectedAsset: null
3668
- }
4369
+ },
4370
+ exchange: { selectedConnection: null }
3669
4371
  };
3670
4372
  case "connect/wallet-confirmed":
3671
4373
  if (!action.mode) return state;
@@ -3689,6 +4391,39 @@ function applyAction(state, action) {
3689
4391
  step: "deposit-address"
3690
4392
  }
3691
4393
  };
4394
+ case "connect/fiat-onramp-selected":
4395
+ return {
4396
+ ...state,
4397
+ flow: {
4398
+ ...state.flow,
4399
+ mode: "fiat-onramp",
4400
+ isConnectSelectionConfirmed: true,
4401
+ step: modeEntryStep("fiat-onramp")
4402
+ },
4403
+ fiat: { ...state.fiat, selectedMethod: _nullishCoalesce(action.paymentMethod, () => ( null)) }
4404
+ };
4405
+ case "connect/exchange-selected":
4406
+ return {
4407
+ ...state,
4408
+ flow: {
4409
+ ...state.flow,
4410
+ mode: "exchange-connect",
4411
+ isConnectSelectionConfirmed: true,
4412
+ step: modeEntryStep("exchange-connect")
4413
+ },
4414
+ exchange: { selectedConnection: null }
4415
+ };
4416
+ case "exchange/connection-selected":
4417
+ return {
4418
+ ...state,
4419
+ flow: {
4420
+ ...state.flow,
4421
+ mode: "exchange-connect",
4422
+ isConnectSelectionConfirmed: true,
4423
+ step: "exchange-connect"
4424
+ },
4425
+ exchange: { selectedConnection: action.connection }
4426
+ };
3692
4427
  case "connect/auto-locked":
3693
4428
  return {
3694
4429
  ...state,
@@ -3714,7 +4449,8 @@ function applyAction(state, action) {
3714
4449
  ...state.dappImport,
3715
4450
  activeProviderId: null,
3716
4451
  selectedAsset: null
3717
- }
4452
+ },
4453
+ exchange: { selectedConnection: null }
3718
4454
  };
3719
4455
  case "setup/started": {
3720
4456
  const existing = state.setup.byOwner[ownerKey(action.owner)];
@@ -3723,12 +4459,12 @@ function applyAction(state, action) {
3723
4459
  requestKey: action.requestKey,
3724
4460
  cacheKey: action.cacheKey,
3725
4461
  status: "loading",
3726
- smartAccount: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _96 => _96.smartAccount]), () => ( null)),
3727
- sessionOwnerAddress: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _97 => _97.sessionOwnerAddress]), () => ( null)),
3728
- solanaDepositAddress: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _98 => _98.solanaDepositAddress]), () => ( null)),
4462
+ smartAccount: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _120 => _120.smartAccount]), () => ( null)),
4463
+ sessionOwnerAddress: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _121 => _121.sessionOwnerAddress]), () => ( null)),
4464
+ solanaDepositAddress: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _122 => _122.solanaDepositAddress]), () => ( null)),
3729
4465
  message: null,
3730
4466
  cacheable: action.cacheable,
3731
- attemptNonce: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _99 => _99.attemptNonce]), () => ( 0))
4467
+ attemptNonce: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _123 => _123.attemptNonce]), () => ( 0))
3732
4468
  }));
3733
4469
  }
3734
4470
  case "setup/ready": {
@@ -3949,7 +4685,9 @@ function applyAction(state, action) {
3949
4685
  activeProviderId: null,
3950
4686
  selectedAsset: null
3951
4687
  },
3952
- setup: { byOwner: preservedByOwner }
4688
+ setup: { byOwner: preservedByOwner },
4689
+ fiat: { selectedMethod: null },
4690
+ exchange: { selectedConnection: null }
3953
4691
  };
3954
4692
  }
3955
4693
  case "target/changed": {
@@ -4023,6 +4761,12 @@ function createInitialState(overrides) {
4023
4761
  },
4024
4762
  setup: {
4025
4763
  byOwner: {}
4764
+ },
4765
+ fiat: {
4766
+ selectedMethod: null
4767
+ },
4768
+ exchange: {
4769
+ selectedConnection: null
4026
4770
  }
4027
4771
  };
4028
4772
  }
@@ -4091,15 +4835,15 @@ var SetupError = class extends Error {
4091
4835
  }
4092
4836
  };
4093
4837
  async function resolveSessionOwner(eoaAddress) {
4094
- const local = _chunk2TWQGPPBcjs.loadSessionOwnerFromStorage.call(void 0, eoaAddress);
4838
+ const local = _chunkN4XRQPVAcjs.loadSessionOwnerFromStorage.call(void 0, eoaAddress);
4095
4839
  if (local) {
4096
4840
  return {
4097
- account: _chunk2TWQGPPBcjs.accountFromPrivateKey.call(void 0, local.privateKey),
4841
+ account: _chunkN4XRQPVAcjs.accountFromPrivateKey.call(void 0, local.privateKey),
4098
4842
  address: local.address
4099
4843
  };
4100
4844
  }
4101
- const created = _chunk2TWQGPPBcjs.createSessionOwnerKey.call(void 0, );
4102
- _chunk2TWQGPPBcjs.saveSessionOwnerToStorage.call(void 0, eoaAddress, created.privateKey, created.address);
4845
+ const created = _chunkN4XRQPVAcjs.createSessionOwnerKey.call(void 0, );
4846
+ _chunkN4XRQPVAcjs.saveSessionOwnerToStorage.call(void 0, eoaAddress, created.privateKey, created.address);
4103
4847
  return { account: created.account, address: created.address };
4104
4848
  }
4105
4849
  function stableStringify(value) {
@@ -4149,14 +4893,14 @@ function computeCacheKey(input, sessionOwnerAddress) {
4149
4893
  });
4150
4894
  }
4151
4895
  function computeIsCacheable(input) {
4152
- return !input.forceRegister && !(_nullishCoalesce(_optionalChain([input, 'access', _100 => _100.postBridgeActions, 'optionalAccess', _101 => _101.length]), () => ( 0)));
4896
+ return !input.forceRegister && !(_nullishCoalesce(_optionalChain([input, 'access', _124 => _124.postBridgeActions, 'optionalAccess', _125 => _125.length]), () => ( 0)));
4153
4897
  }
4154
4898
  var SETUP_REQUEST_DEDUPE_TTL_MS = 3e4;
4155
4899
  var setupRequestDedupe = /* @__PURE__ */ new Map();
4156
4900
  function readDedupedAccountSetupResult(requestKey) {
4157
4901
  const now = Date.now();
4158
4902
  const existing = setupRequestDedupe.get(requestKey);
4159
- if (_optionalChain([existing, 'optionalAccess', _102 => _102.settled]) && existing.expiresAt > now && existing.result) {
4903
+ if (_optionalChain([existing, 'optionalAccess', _126 => _126.settled]) && existing.expiresAt > now && existing.result) {
4160
4904
  return existing.result;
4161
4905
  }
4162
4906
  return null;
@@ -4167,16 +4911,16 @@ async function runAccountSetup(input, deps) {
4167
4911
  try {
4168
4912
  const sessionOwner = await resolveSessionOwner(input.ownerAddress);
4169
4913
  const cacheKey = computeCacheKey(input, sessionOwner.address);
4170
- _chunk2TWQGPPBcjs.debugLog.call(void 0, debug, "account-setup", "setup:start", {
4914
+ _chunkN4XRQPVAcjs.debugLog.call(void 0, debug, "account-setup", "setup:start", {
4171
4915
  owner: input.ownerAddress,
4172
4916
  sessionOwner: sessionOwner.address,
4173
- hasPostBridgeActions: Boolean(_optionalChain([input, 'access', _103 => _103.postBridgeActions, 'optionalAccess', _104 => _104.length])),
4917
+ hasPostBridgeActions: Boolean(_optionalChain([input, 'access', _127 => _127.postBridgeActions, 'optionalAccess', _128 => _128.length])),
4174
4918
  forceRegister: _nullishCoalesce(input.forceRegister, () => ( false))
4175
4919
  });
4176
4920
  const setup = await service.setupAccount({
4177
4921
  ownerAddress: input.ownerAddress,
4178
4922
  sessionOwnerAddress: sessionOwner.address,
4179
- targetChain: _chunk2TWQGPPBcjs.targetChainToCaip2.call(void 0, input.targetChain),
4923
+ targetChain: _chunkN4XRQPVAcjs.targetChainToCaip2.call(void 0, input.targetChain),
4180
4924
  targetToken: input.targetToken,
4181
4925
  recipient: input.recipient,
4182
4926
  postBridgeActions: input.postBridgeActions,
@@ -4215,7 +4959,7 @@ async function runAccountSetup(input, deps) {
4215
4959
  primaryType: typedData.primaryType,
4216
4960
  message: typedData.message
4217
4961
  });
4218
- const sessionDetails = _chunk2TWQGPPBcjs.buildSessionDetails.call(void 0,
4962
+ const sessionDetails = _chunkN4XRQPVAcjs.buildSessionDetails.call(void 0,
4219
4963
  setup.sessionDetailsUnsigned,
4220
4964
  signature
4221
4965
  );
@@ -4229,13 +4973,13 @@ async function runAccountSetup(input, deps) {
4229
4973
  eoaAddress: input.ownerAddress,
4230
4974
  sessionOwner: sessionOwner.address,
4231
4975
  target: {
4232
- chain: _chunk2TWQGPPBcjs.targetChainToCaip2.call(void 0, input.targetChain),
4976
+ chain: _chunkN4XRQPVAcjs.targetChainToCaip2.call(void 0, input.targetChain),
4233
4977
  token: input.targetToken,
4234
4978
  ...input.recipient && { recipient: input.recipient },
4235
- ..._optionalChain([input, 'access', _105 => _105.postBridgeActions, 'optionalAccess', _106 => _106.length]) && {
4979
+ ..._optionalChain([input, 'access', _129 => _129.postBridgeActions, 'optionalAccess', _130 => _130.length]) && {
4236
4980
  postBridgeActions: input.postBridgeActions
4237
4981
  },
4238
- ..._optionalChain([input, 'access', _107 => _107.outputTokenRules, 'optionalAccess', _108 => _108.length]) && {
4982
+ ..._optionalChain([input, 'access', _131 => _131.outputTokenRules, 'optionalAccess', _132 => _132.length]) && {
4239
4983
  outputTokenRules: input.outputTokenRules
4240
4984
  },
4241
4985
  ...input.rejectUnmapped != null && {
@@ -4251,7 +4995,7 @@ async function runAccountSetup(input, deps) {
4251
4995
  isRegistered: true
4252
4996
  };
4253
4997
  } catch (error) {
4254
- _chunk2TWQGPPBcjs.debugError.call(void 0, debug, "account-setup", "setup:failed", error, {
4998
+ _chunkN4XRQPVAcjs.debugError.call(void 0, debug, "account-setup", "setup:failed", error, {
4255
4999
  owner: input.ownerAddress
4256
5000
  });
4257
5001
  if (error instanceof SetupError) throw error;
@@ -4262,7 +5006,7 @@ function runAccountSetupDeduped(input, deps, requestKey) {
4262
5006
  const now = Date.now();
4263
5007
  const existing = setupRequestDedupe.get(requestKey);
4264
5008
  if (existing && (!existing.settled || existing.expiresAt > now)) {
4265
- _chunk2TWQGPPBcjs.debugLog.call(void 0, deps.debug, "account-setup", "setup:dedupe-hit", {
5009
+ _chunkN4XRQPVAcjs.debugLog.call(void 0, deps.debug, "account-setup", "setup:dedupe-hit", {
4266
5010
  owner: input.ownerAddress,
4267
5011
  forceRegister: _nullishCoalesce(input.forceRegister, () => ( false))
4268
5012
  });
@@ -4350,10 +5094,12 @@ var QR_AUTO_ADVANCE_HYDRATION_GRACE_MS = 1e3;
4350
5094
  function isSameRoute2(sourceChain, sourceToken, targetChain, targetToken) {
4351
5095
  return sourceChain === targetChain && sourceToken.toLowerCase() === targetToken.toLowerCase();
4352
5096
  }
5097
+ var SWAPPED_SOURCE_CHAIN = 8453;
5098
+ var SWAPPED_SOURCE_TOKEN = "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913";
4353
5099
  function getAddressKey(address) {
4354
5100
  return address ? address.toLowerCase() : null;
4355
5101
  }
4356
- function deriveStep(flow, d, p, activeEntry) {
5102
+ function deriveStep(flow, d, p, activeEntry, fiat, exchange) {
4357
5103
  const flowStep = flow.step;
4358
5104
  const smartAccount = activeEntry.smartAccount;
4359
5105
  const solanaDepositAddress = activeEntry.solanaDepositAddress;
@@ -4368,6 +5114,23 @@ function deriveStep(flow, d, p, activeEntry) {
4368
5114
  smartAccount,
4369
5115
  solanaDepositAddress: _nullishCoalesce(solanaDepositAddress, () => ( void 0))
4370
5116
  };
5117
+ case "fiat-onramp":
5118
+ if (!smartAccount) return { type: "setup" };
5119
+ return {
5120
+ type: "fiat-onramp",
5121
+ smartAccount,
5122
+ paymentMethod: _nullishCoalesce(fiat.selectedMethod, () => ( void 0))
5123
+ };
5124
+ case "exchange-select":
5125
+ return { type: "exchange-select" };
5126
+ case "exchange-connect":
5127
+ if (!exchange.selectedConnection) return { type: "exchange-select" };
5128
+ if (!smartAccount) return { type: "setup" };
5129
+ return {
5130
+ type: "exchange-connect",
5131
+ smartAccount,
5132
+ connection: exchange.selectedConnection
5133
+ };
4371
5134
  case "select-asset":
4372
5135
  if (!smartAccount) return { type: "setup" };
4373
5136
  return { type: "select-asset", smartAccount };
@@ -4456,6 +5219,8 @@ function resolveOwnerForMode(mode, ctx) {
4456
5219
  switch (mode) {
4457
5220
  case "deposit-address":
4458
5221
  case "solana-wallet":
5222
+ case "fiat-onramp":
5223
+ case "exchange-connect":
4459
5224
  return _nullishCoalesce(ctx.dappAddress, () => ( null));
4460
5225
  case "wallet":
4461
5226
  return _nullishCoalesce(ctx.walletOwner, () => ( null));
@@ -4486,6 +5251,10 @@ function DepositFlow({
4486
5251
  forceRegister = false,
4487
5252
  enableSolana = true,
4488
5253
  dappImports,
5254
+ enableFiatOnramp = false,
5255
+ enableQrTransfer = true,
5256
+ fiatOnrampMethods,
5257
+ enableExchangeConnect = false,
4489
5258
  reownWallet,
4490
5259
  onConnect,
4491
5260
  onDisconnect,
@@ -4499,12 +5268,12 @@ function DepositFlow({
4499
5268
  onError,
4500
5269
  debug
4501
5270
  }) {
4502
- const onStepChangeRef = _chunk2TWQGPPBcjs.useLatestRef.call(void 0, onStepChange);
4503
- const onEventRef = _chunk2TWQGPPBcjs.useLatestRef.call(void 0, onEvent);
4504
- const onLifecycleRef = _chunk2TWQGPPBcjs.useLatestRef.call(void 0, onLifecycle);
4505
- const onErrorRef = _chunk2TWQGPPBcjs.useLatestRef.call(void 0, onError);
5271
+ const onStepChangeRef = _chunkN4XRQPVAcjs.useLatestRef.call(void 0, onStepChange);
5272
+ const onEventRef = _chunkN4XRQPVAcjs.useLatestRef.call(void 0, onEvent);
5273
+ const onLifecycleRef = _chunkN4XRQPVAcjs.useLatestRef.call(void 0, onLifecycle);
5274
+ const onErrorRef = _chunkN4XRQPVAcjs.useLatestRef.call(void 0, onError);
4506
5275
  const hasInitialReownSession = Boolean(
4507
- enableSolana ? _optionalChain([reownWallet, 'optionalAccess', _109 => _109.isConnected]) || _optionalChain([reownWallet, 'optionalAccess', _110 => _110.address]) : _optionalChain([reownWallet, 'optionalAccess', _111 => _111.address])
5276
+ enableSolana ? _optionalChain([reownWallet, 'optionalAccess', _133 => _133.isConnected]) || _optionalChain([reownWallet, 'optionalAccess', _134 => _134.address]) : _optionalChain([reownWallet, 'optionalAccess', _135 => _135.address])
4508
5277
  );
4509
5278
  const hasInitialWalletHydrationPending = Boolean(
4510
5279
  dappAddress && (hasDappWalletClientProp && dappWalletClient === void 0 || reownWallet && !hasInitialReownSession && !reownWallet.isReady)
@@ -4514,6 +5283,8 @@ function DepositFlow({
4514
5283
  const depositSlice = useDepositStore((s) => s.deposit);
4515
5284
  const processingSlice = useDepositStore((s) => s.processing);
4516
5285
  const setupSlice = useDepositStore((s) => s.setup);
5286
+ const fiatSlice = useDepositStore((s) => s.fiat);
5287
+ const exchangeSlice = useDepositStore((s) => s.exchange);
4517
5288
  const flowMode = flowSlice.mode;
4518
5289
  const isConnectSelectionConfirmed = flowSlice.isConnectSelectionConfirmed;
4519
5290
  const hasNavigatedBack = flowSlice.hasNavigatedBack;
@@ -4525,13 +5296,13 @@ function DepositFlow({
4525
5296
  const stableWalletSelectionKeyRef = _react.useRef.call(void 0, null);
4526
5297
  const logFlow = _react.useCallback.call(void 0,
4527
5298
  (message, data) => {
4528
- _chunk2TWQGPPBcjs.debugLog.call(void 0, debug, "deposit-flow", message, data);
5299
+ _chunkN4XRQPVAcjs.debugLog.call(void 0, debug, "deposit-flow", message, data);
4529
5300
  },
4530
5301
  [debug]
4531
5302
  );
4532
5303
  const logFlowError = _react.useCallback.call(void 0,
4533
5304
  (message, error, data) => {
4534
- _chunk2TWQGPPBcjs.debugError.call(void 0, debug, "deposit-flow", message, error, data);
5305
+ _chunkN4XRQPVAcjs.debugError.call(void 0, debug, "deposit-flow", message, error, data);
4535
5306
  },
4536
5307
  [debug]
4537
5308
  );
@@ -4547,19 +5318,19 @@ function DepositFlow({
4547
5318
  _viem.formatUnits.call(void 0, BigInt(asset.balance), asset.decimals)
4548
5319
  );
4549
5320
  if (balanceUnits > 0) return asset.balanceUsd / balanceUnits;
4550
- } catch (e27) {
5321
+ } catch (e30) {
4551
5322
  }
4552
5323
  }
4553
5324
  }
4554
5325
  return null;
4555
5326
  }, []);
4556
5327
  const dappSwitchChain = _react.useMemo.call(void 0, () => {
4557
- if (!_optionalChain([dappWalletClient, 'optionalAccess', _112 => _112.switchChain])) return void 0;
5328
+ if (!_optionalChain([dappWalletClient, 'optionalAccess', _136 => _136.switchChain])) return void 0;
4558
5329
  return async (chainId) => {
4559
- await _optionalChain([dappWalletClient, 'access', _113 => _113.switchChain, 'optionalCall', _114 => _114({ id: chainId })]);
5330
+ await _optionalChain([dappWalletClient, 'access', _137 => _137.switchChain, 'optionalCall', _138 => _138({ id: chainId })]);
4560
5331
  };
4561
5332
  }, [dappWalletClient]);
4562
- const connectedWalletAddress = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess', _115 => _115.account, 'optionalAccess', _116 => _116.address]), () => ( null));
5333
+ const connectedWalletAddress = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess', _139 => _139.account, 'optionalAccess', _140 => _140.address]), () => ( null));
4563
5334
  const walletOptions = _react.useMemo.call(void 0, () => {
4564
5335
  const options = [];
4565
5336
  const seen = /* @__PURE__ */ new Set();
@@ -4573,7 +5344,7 @@ function DepositFlow({
4573
5344
  });
4574
5345
  seen.add(id);
4575
5346
  }
4576
- if (enableSolana && _optionalChain([reownWallet, 'optionalAccess', _117 => _117.isConnected]) && reownWallet.isSolana && reownWallet.solanaAddress && dappAddress) {
5347
+ if (enableSolana && _optionalChain([reownWallet, 'optionalAccess', _141 => _141.isConnected]) && reownWallet.isSolana && reownWallet.solanaAddress && dappAddress) {
4577
5348
  const id = _nullishCoalesce(reownWallet.caipAddress, () => ( `solana:${reownWallet.solanaAddress}`));
4578
5349
  if (!seen.has(id)) {
4579
5350
  options.push({
@@ -4585,7 +5356,7 @@ function DepositFlow({
4585
5356
  });
4586
5357
  seen.add(id);
4587
5358
  }
4588
- } else if (_optionalChain([reownWallet, 'optionalAccess', _118 => _118.address]) && reownWallet.isConnected && reownWallet.walletClient && reownWallet.publicClient && !seen.has(`evm:${reownWallet.address.toLowerCase()}`)) {
5359
+ } else if (_optionalChain([reownWallet, 'optionalAccess', _142 => _142.address]) && reownWallet.isConnected && reownWallet.walletClient && reownWallet.publicClient && !seen.has(`evm:${reownWallet.address.toLowerCase()}`)) {
4589
5360
  const id = `evm:${reownWallet.address.toLowerCase()}`;
4590
5361
  if (!seen.has(id)) {
4591
5362
  options.push({
@@ -4602,20 +5373,20 @@ function DepositFlow({
4602
5373
  }, [
4603
5374
  connectedWalletAddress,
4604
5375
  dappAddress,
4605
- _optionalChain([reownWallet, 'optionalAccess', _119 => _119.address]),
4606
- _optionalChain([reownWallet, 'optionalAccess', _120 => _120.isConnected]),
4607
- _optionalChain([reownWallet, 'optionalAccess', _121 => _121.walletClient]),
4608
- _optionalChain([reownWallet, 'optionalAccess', _122 => _122.publicClient]),
4609
- _optionalChain([reownWallet, 'optionalAccess', _123 => _123.icon]),
5376
+ _optionalChain([reownWallet, 'optionalAccess', _143 => _143.address]),
5377
+ _optionalChain([reownWallet, 'optionalAccess', _144 => _144.isConnected]),
5378
+ _optionalChain([reownWallet, 'optionalAccess', _145 => _145.walletClient]),
5379
+ _optionalChain([reownWallet, 'optionalAccess', _146 => _146.publicClient]),
5380
+ _optionalChain([reownWallet, 'optionalAccess', _147 => _147.icon]),
4610
5381
  enableSolana,
4611
- _optionalChain([reownWallet, 'optionalAccess', _124 => _124.isSolana]),
4612
- _optionalChain([reownWallet, 'optionalAccess', _125 => _125.solanaAddress]),
4613
- _optionalChain([reownWallet, 'optionalAccess', _126 => _126.caipAddress])
5382
+ _optionalChain([reownWallet, 'optionalAccess', _148 => _148.isSolana]),
5383
+ _optionalChain([reownWallet, 'optionalAccess', _149 => _149.solanaAddress]),
5384
+ _optionalChain([reownWallet, 'optionalAccess', _150 => _150.caipAddress])
4614
5385
  ]);
4615
- const canAutoLock = _optionalChain([dappWalletClient, 'optionalAccess', _127 => _127.account]) && dappAddress && !reownWallet;
5386
+ const canAutoLock = _optionalChain([dappWalletClient, 'optionalAccess', _151 => _151.account]) && dappAddress && !reownWallet && !enableFiatOnramp && !enableExchangeConnect;
4616
5387
  const hasWalletOptions = walletOptions.length > 0;
4617
5388
  const hasReownSession = Boolean(
4618
- enableSolana ? _optionalChain([reownWallet, 'optionalAccess', _128 => _128.isConnected]) || _optionalChain([reownWallet, 'optionalAccess', _129 => _129.address]) : _optionalChain([reownWallet, 'optionalAccess', _130 => _130.address])
5389
+ enableSolana ? _optionalChain([reownWallet, 'optionalAccess', _152 => _152.isConnected]) || _optionalChain([reownWallet, 'optionalAccess', _153 => _153.address]) : _optionalChain([reownWallet, 'optionalAccess', _154 => _154.address])
4619
5390
  );
4620
5391
  const isWalletHydrationPending = Boolean(
4621
5392
  dappAddress && !hasWalletOptions && (hasDappWalletClientProp && dappWalletClient === void 0 || reownWallet && !hasReownSession && !reownWallet.isReady)
@@ -4674,16 +5445,16 @@ function DepositFlow({
4674
5445
  return {
4675
5446
  ownerAddress: dappAddress,
4676
5447
  walletClient: void 0,
4677
- publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunk2TWQGPPBcjs.getPublicClient.call(void 0, setupChainId))),
5448
+ publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkN4XRQPVAcjs.getPublicClient.call(void 0, setupChainId))),
4678
5449
  switchChain: void 0
4679
5450
  };
4680
5451
  }
4681
5452
  if (canAutoLock) {
4682
- const fallbackChainId = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess', _131 => _131.chain, 'optionalAccess', _132 => _132.id]), () => ( setupChainId));
5453
+ const fallbackChainId = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess', _155 => _155.chain, 'optionalAccess', _156 => _156.id]), () => ( setupChainId));
4683
5454
  return {
4684
5455
  ownerAddress: dappWalletClient.account.address,
4685
5456
  walletClient: dappWalletClient,
4686
- publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunk2TWQGPPBcjs.getPublicClient.call(void 0, fallbackChainId))),
5457
+ publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkN4XRQPVAcjs.getPublicClient.call(void 0, fallbackChainId))),
4687
5458
  switchChain: dappSwitchChain
4688
5459
  };
4689
5460
  }
@@ -4697,24 +5468,24 @@ function DepositFlow({
4697
5468
  return {
4698
5469
  ownerAddress: dappAddress,
4699
5470
  walletClient: void 0,
4700
- publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunk2TWQGPPBcjs.getPublicClient.call(void 0, setupChainId))),
5471
+ publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkN4XRQPVAcjs.getPublicClient.call(void 0, setupChainId))),
4701
5472
  switchChain: void 0
4702
5473
  };
4703
5474
  }
4704
- if (selectedOption.kind === "connected" && _optionalChain([dappWalletClient, 'optionalAccess', _133 => _133.account]) && selectedOption.address && dappWalletClient.account.address.toLowerCase() === selectedOption.address.toLowerCase()) {
4705
- const fallbackChainId = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess', _134 => _134.chain, 'optionalAccess', _135 => _135.id]), () => ( setupChainId));
5475
+ if (selectedOption.kind === "connected" && _optionalChain([dappWalletClient, 'optionalAccess', _157 => _157.account]) && selectedOption.address && dappWalletClient.account.address.toLowerCase() === selectedOption.address.toLowerCase()) {
5476
+ const fallbackChainId = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess', _158 => _158.chain, 'optionalAccess', _159 => _159.id]), () => ( setupChainId));
4706
5477
  return {
4707
5478
  ownerAddress: dappWalletClient.account.address,
4708
5479
  walletClient: dappWalletClient,
4709
- publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunk2TWQGPPBcjs.getPublicClient.call(void 0, fallbackChainId))),
5480
+ publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkN4XRQPVAcjs.getPublicClient.call(void 0, fallbackChainId))),
4710
5481
  switchChain: dappSwitchChain
4711
5482
  };
4712
5483
  }
4713
- if (selectedOption.kind === "external" && _optionalChain([reownWallet, 'optionalAccess', _136 => _136.address]) && selectedOption.address && reownWallet.address.toLowerCase() === selectedOption.address.toLowerCase()) {
5484
+ if (selectedOption.kind === "external" && _optionalChain([reownWallet, 'optionalAccess', _160 => _160.address]) && selectedOption.address && reownWallet.address.toLowerCase() === selectedOption.address.toLowerCase()) {
4714
5485
  return {
4715
5486
  ownerAddress: reownWallet.address,
4716
5487
  walletClient: reownWallet.walletClient,
4717
- publicClient: _nullishCoalesce(reownWallet.publicClient, () => ( _chunk2TWQGPPBcjs.getPublicClient.call(void 0, setupChainId))),
5488
+ publicClient: _nullishCoalesce(reownWallet.publicClient, () => ( _chunkN4XRQPVAcjs.getPublicClient.call(void 0, setupChainId))),
4718
5489
  switchChain: reownWallet.switchChain
4719
5490
  };
4720
5491
  }
@@ -4752,7 +5523,7 @@ function DepositFlow({
4752
5523
  return {
4753
5524
  ownerAddress: dappAddress,
4754
5525
  walletClient: void 0,
4755
- publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunk2TWQGPPBcjs.getPublicClient.call(void 0, setupChainId))),
5526
+ publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkN4XRQPVAcjs.getPublicClient.call(void 0, setupChainId))),
4756
5527
  switchChain: void 0
4757
5528
  };
4758
5529
  }
@@ -4777,37 +5548,37 @@ function DepositFlow({
4777
5548
  const selectedEvmWalletOwner = _react.useMemo.call(void 0, () => {
4778
5549
  if (!selectedWalletId) return null;
4779
5550
  const opt = walletOptions.find((o) => o.id === selectedWalletId);
4780
- if (_optionalChain([opt, 'optionalAccess', _137 => _137.kind]) === "external" && opt.address) {
5551
+ if (_optionalChain([opt, 'optionalAccess', _161 => _161.kind]) === "external" && opt.address) {
4781
5552
  return opt.address;
4782
5553
  }
4783
- if (_optionalChain([opt, 'optionalAccess', _138 => _138.kind]) === "connected" && opt.address) {
5554
+ if (_optionalChain([opt, 'optionalAccess', _162 => _162.kind]) === "connected" && opt.address) {
4784
5555
  return opt.address;
4785
5556
  }
4786
5557
  return null;
4787
5558
  }, [selectedWalletId, walletOptions]);
4788
5559
  const dappImportOwner = _react.useMemo.call(void 0, () => {
4789
5560
  if (selectedEvmWalletOwner) return selectedEvmWalletOwner;
4790
- if (_optionalChain([reownWallet, 'optionalAccess', _139 => _139.address]) && reownWallet.isConnected) {
5561
+ if (_optionalChain([reownWallet, 'optionalAccess', _163 => _163.address]) && reownWallet.isConnected) {
4791
5562
  return reownWallet.address;
4792
5563
  }
4793
5564
  if (connectedWalletAddress) return connectedWalletAddress;
4794
5565
  return null;
4795
5566
  }, [
4796
5567
  selectedEvmWalletOwner,
4797
- _optionalChain([reownWallet, 'optionalAccess', _140 => _140.address]),
4798
- _optionalChain([reownWallet, 'optionalAccess', _141 => _141.isConnected]),
5568
+ _optionalChain([reownWallet, 'optionalAccess', _164 => _164.address]),
5569
+ _optionalChain([reownWallet, 'optionalAccess', _165 => _165.isConnected]),
4799
5570
  connectedWalletAddress
4800
5571
  ]);
4801
5572
  const activeOwner = _react.useMemo.call(void 0,
4802
5573
  () => resolveOwnerForMode(flowMode, {
4803
5574
  dappAddress,
4804
- walletOwner: _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess', _142 => _142.ownerAddress]), () => ( (canAutoLock ? connectedWalletAddress : selectedEvmWalletOwner))),
5575
+ walletOwner: _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess', _166 => _166.ownerAddress]), () => ( (canAutoLock ? connectedWalletAddress : selectedEvmWalletOwner))),
4805
5576
  dappImportOwner
4806
5577
  }),
4807
5578
  [
4808
5579
  flowMode,
4809
5580
  dappAddress,
4810
- _optionalChain([signerContext, 'optionalAccess', _143 => _143.ownerAddress]),
5581
+ _optionalChain([signerContext, 'optionalAccess', _167 => _167.ownerAddress]),
4811
5582
  canAutoLock,
4812
5583
  connectedWalletAddress,
4813
5584
  selectedEvmWalletOwner,
@@ -4836,12 +5607,12 @@ function DepositFlow({
4836
5607
  return;
4837
5608
  }
4838
5609
  lastActiveSetupLifecycleKeyRef.current = lifecycleKey;
4839
- _optionalChain([onLifecycleRef, 'access', _144 => _144.current, 'optionalCall', _145 => _145({
5610
+ _optionalChain([onLifecycleRef, 'access', _168 => _168.current, 'optionalCall', _169 => _169({
4840
5611
  type: "smart-account-changed",
4841
5612
  evm: activeEntry.smartAccount,
4842
5613
  solana: _nullishCoalesce(activeEntry.solanaDepositAddress, () => ( null))
4843
5614
  })]);
4844
- _optionalChain([onLifecycleRef, 'access', _146 => _146.current, 'optionalCall', _147 => _147({
5615
+ _optionalChain([onLifecycleRef, 'access', _170 => _170.current, 'optionalCall', _171 => _171({
4845
5616
  type: "connected",
4846
5617
  address: activeOwner,
4847
5618
  smartAccount: activeEntry.smartAccount
@@ -4856,8 +5627,22 @@ function DepositFlow({
4856
5627
  onLifecycleRef
4857
5628
  ]);
4858
5629
  const effectiveStep = _react.useMemo.call(void 0,
4859
- () => deriveStep(flowSlice, depositSlice, processingSlice, activeEntry),
4860
- [flowSlice, depositSlice, processingSlice, activeEntry]
5630
+ () => deriveStep(
5631
+ flowSlice,
5632
+ depositSlice,
5633
+ processingSlice,
5634
+ activeEntry,
5635
+ fiatSlice,
5636
+ exchangeSlice
5637
+ ),
5638
+ [
5639
+ flowSlice,
5640
+ depositSlice,
5641
+ processingSlice,
5642
+ activeEntry,
5643
+ fiatSlice,
5644
+ exchangeSlice
5645
+ ]
4861
5646
  );
4862
5647
  const step = effectiveStep;
4863
5648
  const handleBack = _react.useCallback.call(void 0, () => {
@@ -4870,12 +5655,48 @@ function DepositFlow({
4870
5655
  portfolioAssetsRef.current = [];
4871
5656
  }
4872
5657
  }, [storeApi, hasWalletOptions, reownWallet]);
4873
- const canGoBackFromHere = effectiveStep.type === "deposit-address" || effectiveStep.type === "solana-token-select" || effectiveStep.type === "solana-amount" || effectiveStep.type === "solana-confirm" || effectiveStep.type === "amount" || effectiveStep.type === "confirm" || effectiveStep.type === "dapp-import-asset-select" || effectiveStep.type === "select-asset" && signerContext && !canAutoLock;
5658
+ const canGoBackFromHere = effectiveStep.type === "deposit-address" || effectiveStep.type === "solana-token-select" || effectiveStep.type === "solana-amount" || effectiveStep.type === "solana-confirm" || effectiveStep.type === "amount" || effectiveStep.type === "confirm" || effectiveStep.type === "dapp-import-asset-select" || effectiveStep.type === "fiat-onramp" || effectiveStep.type === "exchange-select" || effectiveStep.type === "exchange-connect" || effectiveStep.type === "select-asset" && signerContext && !canAutoLock;
4874
5659
  const currentBackHandler = canGoBackFromHere ? handleBack : void 0;
4875
5660
  const currentScreen = showConnectStep ? "connect" : effectiveStep.type;
4876
5661
  _react.useEffect.call(void 0, () => {
4877
- _optionalChain([onStepChangeRef, 'access', _148 => _148.current, 'optionalCall', _149 => _149(currentBackHandler, currentScreen)]);
5662
+ _optionalChain([onStepChangeRef, 'access', _172 => _172.current, 'optionalCall', _173 => _173(currentBackHandler, currentScreen)]);
4878
5663
  }, [currentBackHandler, currentScreen, onStepChangeRef]);
5664
+ const lastModalHeightRef = _react.useRef.call(void 0, 0);
5665
+ const modalContentElRef = _react.useRef.call(void 0, null);
5666
+ _react.useEffect.call(void 0, () => {
5667
+ const mc = document.querySelector(".rs-modal-content");
5668
+ if (!mc) return;
5669
+ modalContentElRef.current = mc;
5670
+ const ro = new ResizeObserver((entries) => {
5671
+ for (const entry of entries) {
5672
+ const border = _optionalChain([entry, 'access', _174 => _174.borderBoxSize, 'optionalAccess', _175 => _175[0], 'optionalAccess', _176 => _176.blockSize]);
5673
+ lastModalHeightRef.current = typeof border === "number" ? border : entry.contentRect.height;
5674
+ }
5675
+ });
5676
+ ro.observe(mc);
5677
+ return () => {
5678
+ ro.disconnect();
5679
+ modalContentElRef.current = null;
5680
+ };
5681
+ }, []);
5682
+ const stepPinKey = `${_nullishCoalesce(flowMode, () => ( "none"))}:${step.type}`;
5683
+ const prevStepPinKeyRef = _react.useRef.call(void 0, stepPinKey);
5684
+ _react.useLayoutEffect.call(void 0, () => {
5685
+ if (prevStepPinKeyRef.current === stepPinKey) return;
5686
+ prevStepPinKeyRef.current = stepPinKey;
5687
+ const mc = document.querySelector(".rs-modal-content");
5688
+ const lastHeight = lastModalHeightRef.current;
5689
+ if (!mc || lastHeight <= 0) return;
5690
+ const prevTransition = mc.style.transition;
5691
+ mc.style.transition = "none";
5692
+ mc.style.setProperty("min-height", `${lastHeight}px`, "important");
5693
+ void mc.offsetHeight;
5694
+ const rafId = requestAnimationFrame(() => {
5695
+ mc.style.transition = prevTransition;
5696
+ mc.style.removeProperty("min-height");
5697
+ });
5698
+ return () => cancelAnimationFrame(rafId);
5699
+ }, [stepPinKey]);
4879
5700
  const stepSendToken = effectiveStep.type === "amount" ? effectiveStep.asset.symbol : null;
4880
5701
  const stepOpenEventKey = effectiveStep.type === "select-asset" ? "select-asset" : effectiveStep.type === "deposit-address" ? "deposit-address" : effectiveStep.type === "amount" && stepSendToken ? `amount:${stepSendToken.toLowerCase()}` : null;
4881
5702
  const lastStepOpenEventKeyRef = _react.useRef.call(void 0, null);
@@ -4889,7 +5710,7 @@ function DepositFlow({
4889
5710
  }
4890
5711
  lastStepOpenEventKeyRef.current = stepOpenEventKey;
4891
5712
  if (effectiveStep.type === "select-asset") {
4892
- _optionalChain([onEventRef, 'access', _150 => _150.current, 'optionalCall', _151 => _151({
5713
+ _optionalChain([onEventRef, 'access', _177 => _177.current, 'optionalCall', _178 => _178({
4893
5714
  type: "deposit_modal_connected_wallet_select_source_open",
4894
5715
  total_balance_in_external_wallet: totalBalanceUsd,
4895
5716
  pred_balance: totalBalanceUsd
@@ -4897,7 +5718,7 @@ function DepositFlow({
4897
5718
  } else if (effectiveStep.type === "deposit-address") {
4898
5719
  const chainName = _chunk7JIDIX27cjs.getChainName.call(void 0, targetChain);
4899
5720
  const tokenSymbol = _chunk7JIDIX27cjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain);
4900
- _optionalChain([onEventRef, 'access', _152 => _152.current, 'optionalCall', _153 => _153({
5721
+ _optionalChain([onEventRef, 'access', _179 => _179.current, 'optionalCall', _180 => _180({
4901
5722
  type: "deposit_modal_transfer_crypto_open",
4902
5723
  default_chain: chainName,
4903
5724
  default_token: tokenSymbol,
@@ -4905,7 +5726,7 @@ function DepositFlow({
4905
5726
  })]);
4906
5727
  } else if (effectiveStep.type === "amount" && stepSendToken) {
4907
5728
  const receiveSymbol = _chunk7JIDIX27cjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain);
4908
- _optionalChain([onEventRef, 'access', _154 => _154.current, 'optionalCall', _155 => _155({
5729
+ _optionalChain([onEventRef, 'access', _181 => _181.current, 'optionalCall', _182 => _182({
4909
5730
  type: "deposit_modal_connected_wallet_enter_value_open",
4910
5731
  send_token: stepSendToken,
4911
5732
  receive_token: receiveSymbol,
@@ -4938,7 +5759,7 @@ function DepositFlow({
4938
5759
  targetToken
4939
5760
  ]);
4940
5761
  _react.useEffect.call(void 0, () => {
4941
- _optionalChain([onLifecycleRef, 'access', _156 => _156.current, 'optionalCall', _157 => _157({
5762
+ _optionalChain([onLifecycleRef, 'access', _183 => _183.current, 'optionalCall', _184 => _184({
4942
5763
  type: "balance-changed",
4943
5764
  totalUsd: totalBalanceUsd
4944
5765
  })]);
@@ -4946,13 +5767,15 @@ function DepositFlow({
4946
5767
  const isDepositAddressMode = flowMode === "deposit-address";
4947
5768
  const isSolanaWalletMode = flowMode === "solana-wallet";
4948
5769
  const isDappImportMode = flowMode === "dapp-import";
5770
+ const isFiatOnrampMode = flowMode === "fiat-onramp";
5771
+ const isExchangeConnectMode = flowMode === "exchange-connect";
4949
5772
  const handleSelectTransferCrypto = _react.useCallback.call(void 0, () => {
4950
5773
  storeApi.dispatch({ type: "connect/transfer-crypto-selected" });
4951
5774
  }, [storeApi]);
4952
5775
  const handleConfirmWallet = _react.useCallback.call(void 0,
4953
5776
  (walletId) => {
4954
5777
  const selectedOption = walletOptions.find((o) => o.id === walletId);
4955
- const mode = enableSolana && _optionalChain([selectedOption, 'optionalAccess', _158 => _158.kind]) === "solana" ? "solana-wallet" : "wallet";
5778
+ const mode = enableSolana && _optionalChain([selectedOption, 'optionalAccess', _185 => _185.kind]) === "solana" ? "solana-wallet" : "wallet";
4956
5779
  storeApi.dispatch({
4957
5780
  type: "connect/wallet-confirmed",
4958
5781
  walletId,
@@ -4962,7 +5785,7 @@ function DepositFlow({
4962
5785
  [walletOptions, enableSolana, storeApi]
4963
5786
  );
4964
5787
  const isSolanaWalletConnected = Boolean(
4965
- enableSolana && _optionalChain([reownWallet, 'optionalAccess', _159 => _159.isConnected]) && _optionalChain([reownWallet, 'optionalAccess', _160 => _160.isSolana])
5788
+ enableSolana && _optionalChain([reownWallet, 'optionalAccess', _186 => _186.isConnected]) && _optionalChain([reownWallet, 'optionalAccess', _187 => _187.isSolana])
4966
5789
  );
4967
5790
  const dappImportsKey = dappImports ? Object.keys(dappImports).filter((k) => dappImports[k]).sort().join(",") : "";
4968
5791
  const enabledDappImportProviders = _react.useMemo.call(void 0,
@@ -4975,7 +5798,7 @@ function DepositFlow({
4975
5798
  const owner = dappImportOwner;
4976
5799
  if (owner) {
4977
5800
  const wallet = walletOptions.find(
4978
- (o) => _optionalChain([(_nullishCoalesce(o.address, () => ( null))), 'optionalAccess', _161 => _161.toLowerCase, 'call', _162 => _162()]) === owner.toLowerCase()
5801
+ (o) => _optionalChain([(_nullishCoalesce(o.address, () => ( null))), 'optionalAccess', _188 => _188.toLowerCase, 'call', _189 => _189()]) === owner.toLowerCase()
4979
5802
  );
4980
5803
  if (wallet) {
4981
5804
  storeApi.dispatch({
@@ -5013,8 +5836,8 @@ function DepositFlow({
5013
5836
  eoa: dappImportOwner,
5014
5837
  getPublicClient: (chainId) => {
5015
5838
  try {
5016
- return _chunk2TWQGPPBcjs.getPublicClient.call(void 0, chainId);
5017
- } catch (e28) {
5839
+ return _chunkN4XRQPVAcjs.getPublicClient.call(void 0, chainId);
5840
+ } catch (e31) {
5018
5841
  return null;
5019
5842
  }
5020
5843
  },
@@ -5056,7 +5879,7 @@ function DepositFlow({
5056
5879
  if (!dappImportOwner) {
5057
5880
  return { ...baseRow, status: "needs-connect" };
5058
5881
  }
5059
- const availabilityEntry = _optionalChain([dappImportAvailabilityOwner, 'optionalAccess', _163 => _163.toLowerCase, 'call', _164 => _164()]) === dappImportOwner.toLowerCase() ? dappImportAvailability[provider.id] : void 0;
5882
+ const availabilityEntry = _optionalChain([dappImportAvailabilityOwner, 'optionalAccess', _190 => _190.toLowerCase, 'call', _191 => _191()]) === dappImportOwner.toLowerCase() ? dappImportAvailability[provider.id] : void 0;
5060
5883
  const dappImportSetup = readSetupForOwner(setupSlice, dappImportOwner);
5061
5884
  if (availabilityEntry === "loading" || availabilityEntry === void 0) {
5062
5885
  return { ...baseRow, status: "loading" };
@@ -5104,7 +5927,7 @@ function DepositFlow({
5104
5927
  }, [activeDappImportProviderId, enabledDappImportProviders]);
5105
5928
  const activeDappImportAvailability = _react.useMemo.call(void 0, () => {
5106
5929
  if (!activeDappImportProviderId) return null;
5107
- if (!dappImportOwner || _optionalChain([dappImportAvailabilityOwner, 'optionalAccess', _165 => _165.toLowerCase, 'call', _166 => _166()]) !== dappImportOwner.toLowerCase()) {
5930
+ if (!dappImportOwner || _optionalChain([dappImportAvailabilityOwner, 'optionalAccess', _192 => _192.toLowerCase, 'call', _193 => _193()]) !== dappImportOwner.toLowerCase()) {
5108
5931
  return null;
5109
5932
  }
5110
5933
  const entry = dappImportAvailability[activeDappImportProviderId];
@@ -5116,8 +5939,29 @@ function DepositFlow({
5116
5939
  dappImportAvailabilityOwner,
5117
5940
  dappImportOwner
5118
5941
  ]);
5942
+ const handleSelectFiatMethod = _react.useCallback.call(void 0,
5943
+ (paymentMethod) => {
5944
+ storeApi.dispatch({
5945
+ type: "connect/fiat-onramp-selected",
5946
+ paymentMethod
5947
+ });
5948
+ },
5949
+ [storeApi]
5950
+ );
5951
+ const handleSelectExchange = _react.useCallback.call(void 0, () => {
5952
+ storeApi.dispatch({ type: "connect/exchange-selected" });
5953
+ }, [storeApi]);
5954
+ const handleSelectExchangeConnection = _react.useCallback.call(void 0,
5955
+ (connection) => {
5956
+ storeApi.dispatch({
5957
+ type: "exchange/connection-selected",
5958
+ connection
5959
+ });
5960
+ },
5961
+ [storeApi]
5962
+ );
5119
5963
  const handleNewDeposit = _react.useCallback.call(void 0, () => {
5120
- _optionalChain([onLifecycleRef, 'access', _167 => _167.current, 'optionalCall', _168 => _168({
5964
+ _optionalChain([onLifecycleRef, 'access', _194 => _194.current, 'optionalCall', _195 => _195({
5121
5965
  type: "smart-account-changed",
5122
5966
  evm: null,
5123
5967
  solana: null
@@ -5165,13 +6009,13 @@ function DepositFlow({
5165
6009
  };
5166
6010
  push(dappAddress);
5167
6011
  push(connectedWalletAddress);
5168
- push(_optionalChain([reownWallet, 'optionalAccess', _169 => _169.address]));
6012
+ push(_optionalChain([reownWallet, 'optionalAccess', _196 => _196.address]));
5169
6013
  push(dappImportOwner);
5170
6014
  return owners;
5171
6015
  }, [
5172
6016
  dappAddress,
5173
6017
  connectedWalletAddress,
5174
- _optionalChain([reownWallet, 'optionalAccess', _170 => _170.address]),
6018
+ _optionalChain([reownWallet, 'optionalAccess', _197 => _197.address]),
5175
6019
  dappImportOwner
5176
6020
  ]);
5177
6021
  _react.useEffect.call(void 0, () => {
@@ -5185,7 +6029,7 @@ function DepositFlow({
5185
6029
  try {
5186
6030
  sessionOwner = await resolveSessionOwner(owner);
5187
6031
  } catch (error) {
5188
- _chunk2TWQGPPBcjs.debugError.call(void 0,
6032
+ _chunkN4XRQPVAcjs.debugError.call(void 0,
5189
6033
  debug,
5190
6034
  "deposit-flow",
5191
6035
  "session-owner:resolve-failed",
@@ -5276,7 +6120,7 @@ function DepositFlow({
5276
6120
  sourceChain: data.sourceChain,
5277
6121
  amount: data.amount
5278
6122
  });
5279
- _optionalChain([onLifecycleRef, 'access', _171 => _171.current, 'optionalCall', _172 => _172({ type: "submitted", ...data })]);
6123
+ _optionalChain([onLifecycleRef, 'access', _198 => _198.current, 'optionalCall', _199 => _199({ type: "submitted", ...data })]);
5280
6124
  },
5281
6125
  [logFlow, onLifecycleRef]
5282
6126
  );
@@ -5333,7 +6177,7 @@ function DepositFlow({
5333
6177
  sourceSymbol: tokenAtSubmit.symbol,
5334
6178
  sourceDecimals: tokenAtSubmit.decimals
5335
6179
  });
5336
- _optionalChain([onLifecycleRef, 'access', _173 => _173.current, 'optionalCall', _174 => _174({
6180
+ _optionalChain([onLifecycleRef, 'access', _200 => _200.current, 'optionalCall', _201 => _201({
5337
6181
  type: "submitted",
5338
6182
  txHash,
5339
6183
  sourceChain: "solana",
@@ -5344,7 +6188,7 @@ function DepositFlow({
5344
6188
  );
5345
6189
  const handleAssetContinue = _react.useCallback.call(void 0,
5346
6190
  (asset) => {
5347
- _optionalChain([onEventRef, 'access', _175 => _175.current, 'optionalCall', _176 => _176({
6191
+ _optionalChain([onEventRef, 'access', _202 => _202.current, 'optionalCall', _203 => _203({
5348
6192
  type: "deposit_modal_connected_wallet_select_source_cta_click",
5349
6193
  total_balance_in_external_wallet: totalBalanceUsd,
5350
6194
  pred_balance: totalBalanceUsd,
@@ -5397,16 +6241,41 @@ function DepositFlow({
5397
6241
  sourceChain: chainId,
5398
6242
  sourceToken: token,
5399
6243
  amount,
5400
- sourceSymbol: _optionalChain([dappImport, 'optionalAccess', _177 => _177.symbol]),
5401
- sourceDecimals: _optionalChain([dappImport, 'optionalAccess', _178 => _178.decimals]),
6244
+ sourceSymbol: _optionalChain([dappImport, 'optionalAccess', _204 => _204.symbol]),
6245
+ sourceDecimals: _optionalChain([dappImport, 'optionalAccess', _205 => _205.decimals]),
5402
6246
  directTransfer: !dappImport && isSameRoute2(chainId, token, targetChain, targetToken)
5403
6247
  });
5404
6248
  },
5405
6249
  [logFlow, storeApi, targetChain, targetToken]
5406
6250
  );
6251
+ const handleSwappedComplete = _react.useCallback.call(void 0,
6252
+ (info) => {
6253
+ logFlow("swapped:complete", {
6254
+ txHash: info.txHash,
6255
+ orderCrypto: info.orderCrypto
6256
+ });
6257
+ const amount = _nullishCoalesce(info.amount, () => ( "0"));
6258
+ storeApi.dispatch({
6259
+ type: "deposit/submitted",
6260
+ txHash: info.txHash,
6261
+ sourceChain: SWAPPED_SOURCE_CHAIN,
6262
+ sourceToken: SWAPPED_SOURCE_TOKEN,
6263
+ amount,
6264
+ sourceSymbol: _nullishCoalesce(info.orderCrypto, () => ( "USDC")),
6265
+ sourceDecimals: 6
6266
+ });
6267
+ _optionalChain([onLifecycleRef, 'access', _206 => _206.current, 'optionalCall', _207 => _207({
6268
+ type: "submitted",
6269
+ txHash: info.txHash,
6270
+ sourceChain: SWAPPED_SOURCE_CHAIN,
6271
+ amount
6272
+ })]);
6273
+ },
6274
+ [logFlow, storeApi, onLifecycleRef]
6275
+ );
5407
6276
  const handleDepositSubmittedCallback = _react.useCallback.call(void 0,
5408
6277
  (txHash, sourceChain, amount) => {
5409
- _optionalChain([onLifecycleRef, 'access', _179 => _179.current, 'optionalCall', _180 => _180({
6278
+ _optionalChain([onLifecycleRef, 'access', _208 => _208.current, 'optionalCall', _209 => _209({
5410
6279
  type: "submitted",
5411
6280
  txHash,
5412
6281
  sourceChain,
@@ -5418,7 +6287,7 @@ function DepositFlow({
5418
6287
  const handleDepositComplete = _react.useCallback.call(void 0,
5419
6288
  (txHash, destinationTxHash, context) => {
5420
6289
  logFlow("deposit:complete", { txHash, destinationTxHash, ...context });
5421
- _optionalChain([onLifecycleRef, 'access', _181 => _181.current, 'optionalCall', _182 => _182({
6290
+ _optionalChain([onLifecycleRef, 'access', _210 => _210.current, 'optionalCall', _211 => _211({
5422
6291
  type: "complete",
5423
6292
  txHash,
5424
6293
  destinationTxHash,
@@ -5430,14 +6299,14 @@ function DepositFlow({
5430
6299
  const handleDepositFailed = _react.useCallback.call(void 0,
5431
6300
  (txHash, error) => {
5432
6301
  logFlowError("deposit:failed", error, { txHash });
5433
- _optionalChain([onLifecycleRef, 'access', _183 => _183.current, 'optionalCall', _184 => _184({ type: "failed", txHash, error })]);
6302
+ _optionalChain([onLifecycleRef, 'access', _212 => _212.current, 'optionalCall', _213 => _213({ type: "failed", txHash, error })]);
5434
6303
  },
5435
6304
  [logFlowError, onLifecycleRef]
5436
6305
  );
5437
6306
  const handleError = _react.useCallback.call(void 0,
5438
6307
  (message, code) => {
5439
6308
  logFlowError("flow:error", message, { code });
5440
- _optionalChain([onErrorRef, 'access', _185 => _185.current, 'optionalCall', _186 => _186({ message, code })]);
6309
+ _optionalChain([onErrorRef, 'access', _214 => _214.current, 'optionalCall', _215 => _215({ message, code })]);
5441
6310
  },
5442
6311
  [logFlowError, onErrorRef]
5443
6312
  );
@@ -5473,13 +6342,14 @@ function DepositFlow({
5473
6342
  }
5474
6343
  }, [enableSolana, flowMode, storeApi]);
5475
6344
  _react.useEffect.call(void 0, () => {
5476
- if (hasNavigatedBack || isConnectSelectionConfirmed || flowMode) {
6345
+ if (hasNavigatedBack || isConnectSelectionConfirmed || flowMode || enableFiatOnramp || enableExchangeConnect) {
5477
6346
  return;
5478
6347
  }
5479
- if (!hasWalletOptions && dappAddress && !hasReownSession && !dappWalletClient && hasQrAutoAdvanceGraceElapsed) {
6348
+ if (enableQrTransfer && !hasWalletOptions && dappAddress && !hasReownSession && !dappWalletClient && hasQrAutoAdvanceGraceElapsed) {
5480
6349
  handleSelectTransferCrypto();
5481
6350
  }
5482
6351
  }, [
6352
+ enableQrTransfer,
5483
6353
  hasWalletOptions,
5484
6354
  hasReownSession,
5485
6355
  hasQrAutoAdvanceGraceElapsed,
@@ -5519,19 +6389,22 @@ function DepositFlow({
5519
6389
  );
5520
6390
  if (showConnectStep) {
5521
6391
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
5522
- _chunk2TWQGPPBcjs.ConnectStep,
6392
+ _chunkN4XRQPVAcjs.ConnectStep,
5523
6393
  {
5524
6394
  walletRows,
5525
6395
  transferCryptoState: dappAddress ? transferCryptoState : void 0,
5526
6396
  transferCryptoErrorReason: dappAddress ? _nullishCoalesce(transferCryptoEntry.message, () => ( void 0)) : void 0,
5527
- onSelectTransferCrypto: dappAddress ? () => {
6397
+ onSelectTransferCrypto: enableQrTransfer && dappAddress ? () => {
5528
6398
  if (transferCryptoState === "error") {
5529
6399
  handleRetrySetup(dappAddress);
5530
6400
  return;
5531
6401
  }
5532
- if (transferCryptoState !== "ready") return;
5533
6402
  handleSelectTransferCrypto();
5534
6403
  } : void 0,
6404
+ onSelectPayWithCard: enableFiatOnramp && dappAddress && (!fiatOnrampMethods || fiatOnrampMethods.length === 0) ? () => handleSelectFiatMethod() : void 0,
6405
+ fiatPaymentMethods: enableFiatOnramp && dappAddress ? fiatOnrampMethods : void 0,
6406
+ onSelectFiatMethod: enableFiatOnramp && dappAddress ? (method) => handleSelectFiatMethod(method) : void 0,
6407
+ onSelectFundFromExchange: enableExchangeConnect && dappAddress ? () => handleSelectExchange() : void 0,
5535
6408
  onRequestConnect,
5536
6409
  onConnect,
5537
6410
  onDisconnect,
@@ -5584,12 +6457,11 @@ function DepositFlow({
5584
6457
  {
5585
6458
  smartAccount: effectiveStep.smartAccount,
5586
6459
  solanaDepositAddress: enableSolana ? effectiveStep.solanaDepositAddress : void 0,
5587
- isUpdating: activeEntry.status !== "ready",
5588
6460
  service,
5589
6461
  allowedRoutes,
5590
6462
  targetChain,
5591
6463
  targetToken,
5592
- hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess', _187 => _187.length])),
6464
+ hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess', _216 => _216.length])),
5593
6465
  uiConfig,
5594
6466
  onDepositSubmitted: handleDepositAddressSubmitted,
5595
6467
  onDepositComplete: handleDepositComplete,
@@ -5597,7 +6469,7 @@ function DepositFlow({
5597
6469
  onCopyAddress: () => {
5598
6470
  const chainName = _chunk7JIDIX27cjs.getChainName.call(void 0, targetChain);
5599
6471
  const tokenSymbol = _chunk7JIDIX27cjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain);
5600
- _optionalChain([onEvent, 'optionalCall', _188 => _188({
6472
+ _optionalChain([onEvent, 'optionalCall', _217 => _217({
5601
6473
  type: "deposit_modal_transfer_crypto_cta_click",
5602
6474
  default_chain: chainName,
5603
6475
  default_token: tokenSymbol,
@@ -5611,10 +6483,132 @@ function DepositFlow({
5611
6483
  )
5612
6484
  ] });
5613
6485
  }
6486
+ if (isFiatOnrampMode) {
6487
+ if (!dappAddress) return null;
6488
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
6489
+ "div",
6490
+ {
6491
+ className: "rs-modal-body",
6492
+ "data-flow-mode": "fiat-onramp",
6493
+ "data-step-type": step.type,
6494
+ children: [
6495
+ step.type === "setup" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
6496
+ AccountPreparingSkeleton,
6497
+ {
6498
+ errorMessage: activeEntry.status === "error" ? _nullishCoalesce(activeEntry.message, () => ( void 0)) : void 0,
6499
+ onRetry: activeEntry.status === "error" ? () => handleRetrySetup(dappAddress) : void 0
6500
+ }
6501
+ ),
6502
+ step.type === "fiat-onramp" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
6503
+ FiatOnrampStep,
6504
+ {
6505
+ smartAccount: step.smartAccount,
6506
+ service,
6507
+ paymentMethod: step.paymentMethod,
6508
+ onSwappedComplete: handleSwappedComplete,
6509
+ onSwappedFailed: handleDepositFailed,
6510
+ onClose: _nullishCoalesce(onClose, () => ( (() => {
6511
+ }))),
6512
+ onError: handleError
6513
+ }
6514
+ ),
6515
+ step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
6516
+ _chunkN4XRQPVAcjs.ProcessingStep,
6517
+ {
6518
+ smartAccount: step.smartAccount,
6519
+ solanaDepositAddress: step.solanaDepositAddress,
6520
+ txHash: step.txHash,
6521
+ sourceChain: step.sourceChain,
6522
+ sourceToken: step.sourceToken,
6523
+ targetChain,
6524
+ targetToken,
6525
+ amount: step.amount,
6526
+ sourceSymbol: step.sourceSymbol,
6527
+ sourceDecimals: step.sourceDecimals,
6528
+ hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess', _218 => _218.length])),
6529
+ service,
6530
+ directTransfer: step.directTransfer,
6531
+ onClose,
6532
+ onNewDeposit: handleNewDeposit,
6533
+ onDepositComplete: handleDepositComplete,
6534
+ onDepositFailed: handleDepositFailed,
6535
+ onError: handleError,
6536
+ debug
6537
+ }
6538
+ )
6539
+ ]
6540
+ }
6541
+ );
6542
+ }
6543
+ if (isExchangeConnectMode) {
6544
+ if (!dappAddress) return null;
6545
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
6546
+ "div",
6547
+ {
6548
+ className: "rs-modal-body",
6549
+ "data-flow-mode": "exchange-connect",
6550
+ "data-step-type": step.type,
6551
+ children: [
6552
+ step.type === "setup" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
6553
+ AccountPreparingSkeleton,
6554
+ {
6555
+ errorMessage: activeEntry.status === "error" ? _nullishCoalesce(activeEntry.message, () => ( void 0)) : void 0,
6556
+ onRetry: activeEntry.status === "error" ? () => handleRetrySetup(dappAddress) : void 0
6557
+ }
6558
+ ),
6559
+ step.type === "exchange-select" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
6560
+ ExchangeSelectStep,
6561
+ {
6562
+ service,
6563
+ onSelectExchange: handleSelectExchangeConnection,
6564
+ onError: handleError
6565
+ }
6566
+ ),
6567
+ step.type === "exchange-connect" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
6568
+ ExchangeConnectStep,
6569
+ {
6570
+ smartAccount: step.smartAccount,
6571
+ service,
6572
+ connection: step.connection,
6573
+ onSwappedComplete: handleSwappedComplete,
6574
+ onSwappedFailed: handleDepositFailed,
6575
+ onClose: _nullishCoalesce(onClose, () => ( (() => {
6576
+ }))),
6577
+ onError: handleError
6578
+ }
6579
+ ),
6580
+ step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
6581
+ _chunkN4XRQPVAcjs.ProcessingStep,
6582
+ {
6583
+ smartAccount: step.smartAccount,
6584
+ solanaDepositAddress: step.solanaDepositAddress,
6585
+ txHash: step.txHash,
6586
+ sourceChain: step.sourceChain,
6587
+ sourceToken: step.sourceToken,
6588
+ targetChain,
6589
+ targetToken,
6590
+ amount: step.amount,
6591
+ sourceSymbol: step.sourceSymbol,
6592
+ sourceDecimals: step.sourceDecimals,
6593
+ hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess', _219 => _219.length])),
6594
+ service,
6595
+ directTransfer: step.directTransfer,
6596
+ onClose,
6597
+ onNewDeposit: handleNewDeposit,
6598
+ onDepositComplete: handleDepositComplete,
6599
+ onDepositFailed: handleDepositFailed,
6600
+ onError: handleError,
6601
+ debug
6602
+ }
6603
+ )
6604
+ ]
6605
+ }
6606
+ );
6607
+ }
5614
6608
  if (isSolanaWalletMode) {
5615
6609
  if (!dappAddress) return null;
5616
- const solanaAddr = _optionalChain([reownWallet, 'optionalAccess', _189 => _189.solanaAddress]);
5617
- const solanaProvider = _optionalChain([reownWallet, 'optionalAccess', _190 => _190.solanaProvider]);
6610
+ const solanaAddr = _optionalChain([reownWallet, 'optionalAccess', _220 => _220.solanaAddress]);
6611
+ const solanaProvider = _optionalChain([reownWallet, 'optionalAccess', _221 => _221.solanaProvider]);
5618
6612
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
5619
6613
  effectiveStep.type === "setup" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
5620
6614
  AccountPreparingSkeleton,
@@ -5670,7 +6664,7 @@ function DepositFlow({
5670
6664
  targetToken,
5671
6665
  service,
5672
6666
  solanaProvider,
5673
- solanaConnection: _optionalChain([reownWallet, 'optionalAccess', _191 => _191.solanaConnection]),
6667
+ solanaConnection: _optionalChain([reownWallet, 'optionalAccess', _222 => _222.solanaConnection]),
5674
6668
  uiConfig,
5675
6669
  onConfirm: handleSolanaConfirmed,
5676
6670
  onError: handleError,
@@ -5711,7 +6705,7 @@ function DepositFlow({
5711
6705
  ) })
5712
6706
  ] }) : null,
5713
6707
  effectiveStep.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
5714
- _chunk2TWQGPPBcjs.ProcessingStep,
6708
+ _chunkN4XRQPVAcjs.ProcessingStep,
5715
6709
  {
5716
6710
  smartAccount: effectiveStep.smartAccount,
5717
6711
  solanaDepositAddress: effectiveStep.solanaDepositAddress,
@@ -5723,7 +6717,7 @@ function DepositFlow({
5723
6717
  amount: effectiveStep.amount,
5724
6718
  sourceSymbol: effectiveStep.sourceSymbol,
5725
6719
  sourceDecimals: effectiveStep.sourceDecimals,
5726
- hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess', _192 => _192.length])),
6720
+ hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess', _223 => _223.length])),
5727
6721
  service,
5728
6722
  directTransfer: effectiveStep.directTransfer,
5729
6723
  onClose,
@@ -5736,16 +6730,16 @@ function DepositFlow({
5736
6730
  )
5737
6731
  ] });
5738
6732
  }
5739
- if (!_optionalChain([signerContext, 'optionalAccess', _193 => _193.walletClient]) || !_optionalChain([signerContext, 'optionalAccess', _194 => _194.publicClient])) {
6733
+ if (!_optionalChain([signerContext, 'optionalAccess', _224 => _224.walletClient]) || !_optionalChain([signerContext, 'optionalAccess', _225 => _225.publicClient])) {
5740
6734
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-loading-state", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-loading-text", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-loading-title", children: "Connecting wallet\u2026" }) }) }) }) });
5741
6735
  }
5742
6736
  const ownerAddress = signerContext.ownerAddress;
5743
- const ownerChainId = _nullishCoalesce(_nullishCoalesce(_optionalChain([signerContext, 'access', _195 => _195.walletClient, 'optionalAccess', _196 => _196.chain, 'optionalAccess', _197 => _197.id]), () => ( _optionalChain([signerContext, 'access', _198 => _198.publicClient, 'access', _199 => _199.chain, 'optionalAccess', _200 => _200.id]))), () => ( setupChainId));
6737
+ const ownerChainId = _nullishCoalesce(_nullishCoalesce(_optionalChain([signerContext, 'access', _226 => _226.walletClient, 'optionalAccess', _227 => _227.chain, 'optionalAccess', _228 => _228.id]), () => ( _optionalChain([signerContext, 'access', _229 => _229.publicClient, 'access', _230 => _230.chain, 'optionalAccess', _231 => _231.id]))), () => ( setupChainId));
5744
6738
  const getReadClientForChain = (chainId) => {
5745
- if (_optionalChain([signerContext, 'access', _201 => _201.publicClient, 'access', _202 => _202.chain, 'optionalAccess', _203 => _203.id]) === chainId) {
6739
+ if (_optionalChain([signerContext, 'access', _232 => _232.publicClient, 'access', _233 => _233.chain, 'optionalAccess', _234 => _234.id]) === chainId) {
5746
6740
  return signerContext.publicClient;
5747
6741
  }
5748
- return _chunk2TWQGPPBcjs.getPublicClient.call(void 0, chainId);
6742
+ return _chunkN4XRQPVAcjs.getPublicClient.call(void 0, chainId);
5749
6743
  };
5750
6744
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
5751
6745
  effectiveStep.type === "setup" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
@@ -5776,7 +6770,7 @@ function DepositFlow({
5776
6770
  effectiveStep.type === "dapp-import-asset-select" && activeDappImportProvider && activeDappImportAvailability && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
5777
6771
  DappImportAssetSelectStep,
5778
6772
  {
5779
- sourceLabel: _nullishCoalesce(_optionalChain([activeDappImportAvailability, 'access', _204 => _204.assets, 'access', _205 => _205[0], 'optionalAccess', _206 => _206.sourceLabel]), () => ( activeDappImportProvider.label)),
6773
+ sourceLabel: _nullishCoalesce(_optionalChain([activeDappImportAvailability, 'access', _235 => _235.assets, 'access', _236 => _236[0], 'optionalAccess', _237 => _237.sourceLabel]), () => ( activeDappImportProvider.label)),
5780
6774
  assets: activeDappImportAvailability.assets,
5781
6775
  onSelect: handleDappImportAssetSelected
5782
6776
  }
@@ -5803,7 +6797,7 @@ function DepositFlow({
5803
6797
  onContinue: handleAmountContinue,
5804
6798
  onCtaClick: (ctaName) => {
5805
6799
  const receiveSymbol = _chunk7JIDIX27cjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain);
5806
- _optionalChain([onEvent, 'optionalCall', _207 => _207({
6800
+ _optionalChain([onEvent, 'optionalCall', _238 => _238({
5807
6801
  type: "deposit_modal_connected_wallet_enter_value_cta_click",
5808
6802
  send_token: effectiveStep.asset.symbol,
5809
6803
  receive_token: receiveSymbol,
@@ -5854,7 +6848,7 @@ function DepositFlow({
5854
6848
  }
5855
6849
  ),
5856
6850
  effectiveStep.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
5857
- _chunk2TWQGPPBcjs.ProcessingStep,
6851
+ _chunkN4XRQPVAcjs.ProcessingStep,
5858
6852
  {
5859
6853
  smartAccount: effectiveStep.smartAccount,
5860
6854
  solanaDepositAddress: effectiveStep.solanaDepositAddress,
@@ -5866,7 +6860,7 @@ function DepositFlow({
5866
6860
  amount: effectiveStep.amount,
5867
6861
  sourceSymbol: effectiveStep.sourceSymbol,
5868
6862
  sourceDecimals: effectiveStep.sourceDecimals,
5869
- hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess', _208 => _208.length])),
6863
+ hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess', _239 => _239.length])),
5870
6864
  service,
5871
6865
  directTransfer: effectiveStep.directTransfer,
5872
6866
  uiConfig,
@@ -5898,15 +6892,15 @@ function formatDate(iso) {
5898
6892
  month: "short",
5899
6893
  year: "numeric"
5900
6894
  });
5901
- } catch (e29) {
6895
+ } catch (e32) {
5902
6896
  return iso;
5903
6897
  }
5904
6898
  }
5905
6899
  function resolveChainId(value) {
5906
6900
  if (value === void 0 || value === null) return null;
5907
6901
  if (typeof value === "number") return value;
5908
- if (_chunk2TWQGPPBcjs.isSolanaCaip2.call(void 0, value) || value === "solana") return "solana";
5909
- const parsed = _chunk2TWQGPPBcjs.parseEvmChainId.call(void 0, value);
6902
+ if (_chunkN4XRQPVAcjs.isSolanaCaip2.call(void 0, value) || value === "solana") return "solana";
6903
+ const parsed = _chunkN4XRQPVAcjs.parseEvmChainId.call(void 0, value);
5910
6904
  if (parsed !== null) return parsed;
5911
6905
  const num = Number(value);
5912
6906
  return Number.isFinite(num) ? num : null;
@@ -5956,7 +6950,7 @@ function formatAmount(rawAmount, token, chainId) {
5956
6950
  let frac = fracStr.slice(0, 5).replace(/0+$/, "");
5957
6951
  if (frac.length < 2) frac = frac.padEnd(2, "0");
5958
6952
  return `${whole}.${frac}`;
5959
- } catch (e30) {
6953
+ } catch (e33) {
5960
6954
  return rawAmount;
5961
6955
  }
5962
6956
  }
@@ -6005,7 +6999,7 @@ function DepositHistoryPanel({
6005
6999
  );
6006
7000
  const visibleDeposits = _react.useMemo.call(void 0, () => {
6007
7001
  const sourceHashes = new Set(
6008
- deposits.map((d) => _optionalChain([d, 'access', _209 => _209.sourceTxHash, 'optionalAccess', _210 => _210.toLowerCase, 'call', _211 => _211()])).filter((h) => Boolean(h))
7002
+ deposits.map((d) => _optionalChain([d, 'access', _240 => _240.sourceTxHash, 'optionalAccess', _241 => _241.toLowerCase, 'call', _242 => _242()])).filter((h) => Boolean(h))
6009
7003
  );
6010
7004
  return deposits.filter(
6011
7005
  (d) => !(d.txHash && sourceHashes.has(d.txHash.toLowerCase()))
@@ -6027,7 +7021,7 @@ function DepositHistoryPanel({
6027
7021
  className: "rs-modal-header-back",
6028
7022
  "aria-label": "Back",
6029
7023
  onClick: onClose,
6030
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.ChevronLeftIcon, {})
7024
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.ChevronLeftIcon, {})
6031
7025
  }
6032
7026
  ) }),
6033
7027
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-header-nav-right", children: onCloseModal && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
@@ -6037,29 +7031,29 @@ function DepositHistoryPanel({
6037
7031
  className: "rs-modal-close",
6038
7032
  "aria-label": "Close",
6039
7033
  onClick: onCloseModal,
6040
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.CloseIcon, {})
7034
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.CloseIcon, {})
6041
7035
  }
6042
7036
  ) })
6043
7037
  ] }),
6044
7038
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-screen", children: [
6045
7039
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-screen-body", children: [
6046
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.HistoryIcon, {}), title: "History" }),
7040
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.HistoryIcon, {}), title: "History" }),
6047
7041
  isLoading && deposits.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty", children: [
6048
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.HistoryIcon, {}) }),
7042
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.HistoryIcon, {}) }),
6049
7043
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty-text", children: [
6050
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.Spinner, { className: "rs-spinner--sm" }),
7044
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.Spinner, { className: "rs-spinner--sm" }),
6051
7045
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-hint", children: "Loading history\u2026" })
6052
7046
  ] })
6053
7047
  ] }),
6054
7048
  error && !isLoading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty", children: [
6055
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.AlertTriangleIcon, {}) }),
7049
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.AlertTriangleIcon, {}) }),
6056
7050
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty-text", children: [
6057
7051
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-title", children: "Couldn't load history" }),
6058
7052
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-hint", children: error })
6059
7053
  ] })
6060
7054
  ] }),
6061
7055
  !isLoading && !error && visibleDeposits.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty", children: [
6062
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.HistoryIcon, {}) }),
7056
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.HistoryIcon, {}) }),
6063
7057
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty-text", children: [
6064
7058
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-title", children: "No deposits yet" }),
6065
7059
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-hint", children: "Your deposit history will appear here" })
@@ -6079,7 +7073,7 @@ function DepositHistoryPanel({
6079
7073
  )
6080
7074
  ] })
6081
7075
  ] }),
6082
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.PoweredBy, {})
7076
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.PoweredBy, {})
6083
7077
  ] })
6084
7078
  ]
6085
7079
  }
@@ -6154,7 +7148,7 @@ function HistoryCard({ deposit }) {
6154
7148
  onClick: (e) => e.stopPropagation(),
6155
7149
  children: [
6156
7150
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: shortenHash(deposit.sourceTxHash) }),
6157
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.ArrowUpRightIcon, {})
7151
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.ArrowUpRightIcon, {})
6158
7152
  ]
6159
7153
  }
6160
7154
  )
@@ -6169,7 +7163,7 @@ DepositHistoryPanel.displayName = "DepositHistoryPanel";
6169
7163
  // src/DepositModal.tsx
6170
7164
 
6171
7165
  var ReownDepositInner = _react.lazy.call(void 0,
6172
- () => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-EC4DJ3EC.cjs"))).then((m) => ({ default: m.DepositModalReown }))
7166
+ () => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-4I47KSPN.cjs"))).then((m) => ({ default: m.DepositModalReown }))
6173
7167
  );
6174
7168
  function sortByCreatedAtDesc(items) {
6175
7169
  return [...items].sort((a, b) => {
@@ -6225,6 +7219,10 @@ function DepositModalInner({
6225
7219
  forceRegister = false,
6226
7220
  enableSolana = true,
6227
7221
  dappImports,
7222
+ enableFiatOnramp = false,
7223
+ enableQrTransfer = true,
7224
+ fiatOnrampMethods,
7225
+ enableExchangeConnect = false,
6228
7226
  postBridgeActions,
6229
7227
  outputTokenRules,
6230
7228
  rejectUnmapped,
@@ -6243,12 +7241,12 @@ function DepositModalInner({
6243
7241
  debug
6244
7242
  }) {
6245
7243
  const modalRef = _react.useRef.call(void 0, null);
6246
- const onReadyRef = _chunk2TWQGPPBcjs.useLatestRef.call(void 0, onReady);
7244
+ const onReadyRef = _chunkN4XRQPVAcjs.useLatestRef.call(void 0, onReady);
6247
7245
  const [currentScreen, setCurrentScreen] = _react.useState.call(void 0, "connect");
6248
7246
  const [backHandler, setBackHandler] = _react.useState.call(void 0,
6249
7247
  void 0
6250
7248
  );
6251
- const showHistoryButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _212 => _212.showHistoryButton]), () => ( false));
7249
+ const showHistoryButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _243 => _243.showHistoryButton]), () => ( false));
6252
7250
  const historyButtonVisible = showHistoryButton && (currentScreen === "select-asset" || currentScreen === "deposit-address");
6253
7251
  const [historyOpen, setHistoryOpen] = _react.useState.call(void 0, false);
6254
7252
  const [historyDeposits, setHistoryDeposits] = _react.useState.call(void 0, []);
@@ -6262,7 +7260,7 @@ function DepositModalInner({
6262
7260
  const targetChain = targetChainProp === "solana" ? "solana" : _chunk7JIDIX27cjs.getChainId.call(void 0, targetChainProp);
6263
7261
  const sourceChain = sourceChainProp ? _chunk7JIDIX27cjs.getChainId.call(void 0, sourceChainProp) : void 0;
6264
7262
  const service = _react.useMemo.call(void 0,
6265
- () => _chunk2TWQGPPBcjs.createDepositService.call(void 0, backendUrl, {
7263
+ () => _chunkN4XRQPVAcjs.createDepositService.call(void 0, backendUrl, {
6266
7264
  debug,
6267
7265
  debugScope: "service:deposit"
6268
7266
  }),
@@ -6278,7 +7276,7 @@ function DepositModalInner({
6278
7276
  }, [store, targetChain, targetToken]);
6279
7277
  _react.useEffect.call(void 0, () => {
6280
7278
  if (isOpen && modalRef.current) {
6281
- _chunk2TWQGPPBcjs.applyTheme.call(void 0, modalRef.current, theme);
7279
+ _chunkN4XRQPVAcjs.applyTheme.call(void 0, modalRef.current, theme);
6282
7280
  }
6283
7281
  }, [isOpen, theme]);
6284
7282
  _react.useEffect.call(void 0, () => {
@@ -6286,7 +7284,7 @@ function DepositModalInner({
6286
7284
  }, [solanaRpcUrl]);
6287
7285
  _react.useEffect.call(void 0, () => {
6288
7286
  if (isOpen) {
6289
- _optionalChain([onReadyRef, 'access', _213 => _213.current, 'optionalCall', _214 => _214()]);
7287
+ _optionalChain([onReadyRef, 'access', _244 => _244.current, 'optionalCall', _245 => _245()]);
6290
7288
  }
6291
7289
  }, [isOpen, onReadyRef]);
6292
7290
  const handleStepChange = _react.useCallback.call(void 0,
@@ -6362,10 +7360,10 @@ function DepositModalInner({
6362
7360
  fetchHistory("initial");
6363
7361
  }
6364
7362
  }, [historyOpen, fetchHistory]);
6365
- const onLifecycleRef = _chunk2TWQGPPBcjs.useLatestRef.call(void 0, onLifecycle);
7363
+ const onLifecycleRef = _chunkN4XRQPVAcjs.useLatestRef.call(void 0, onLifecycle);
6366
7364
  const handleLifecycle = _react.useCallback.call(void 0,
6367
7365
  (event) => {
6368
- _optionalChain([onLifecycleRef, 'access', _215 => _215.current, 'optionalCall', _216 => _216(event)]);
7366
+ _optionalChain([onLifecycleRef, 'access', _246 => _246.current, 'optionalCall', _247 => _247(event)]);
6369
7367
  if (event.type === "smart-account-changed" && !event.evm && !event.solana) {
6370
7368
  historyStaleRef.current = true;
6371
7369
  }
@@ -6391,10 +7389,10 @@ function DepositModalInner({
6391
7389
  store.dispatch({ type: "flow/reset" });
6392
7390
  }
6393
7391
  }, [isOpen, store]);
6394
- const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _217 => _217.showBackButton]), () => ( true));
7392
+ const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _248 => _248.showBackButton]), () => ( true));
6395
7393
  const canGoBack = backHandler !== void 0;
6396
7394
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DepositStoreProvider, { store, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
6397
- _chunk2TWQGPPBcjs.Modal,
7395
+ _chunkN4XRQPVAcjs.Modal,
6398
7396
  {
6399
7397
  isOpen,
6400
7398
  onClose,
@@ -6410,7 +7408,7 @@ function DepositModalInner({
6410
7408
  className: "rs-modal-header-back",
6411
7409
  "aria-label": "Go back",
6412
7410
  onClick: backHandler,
6413
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.ChevronLeftIcon, {})
7411
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.ChevronLeftIcon, {})
6414
7412
  }
6415
7413
  ) }),
6416
7414
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-header-nav-right", children: [
@@ -6422,7 +7420,7 @@ function DepositModalInner({
6422
7420
  "aria-label": "Deposit history",
6423
7421
  onClick: handleHistoryOpen,
6424
7422
  disabled: !recipient,
6425
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.HistoryIcon, {})
7423
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.HistoryIcon, {})
6426
7424
  }
6427
7425
  ),
6428
7426
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
@@ -6432,7 +7430,7 @@ function DepositModalInner({
6432
7430
  onClick: onClose,
6433
7431
  className: "rs-modal-close",
6434
7432
  "aria-label": "Close",
6435
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.CloseIcon, {})
7433
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN4XRQPVAcjs.CloseIcon, {})
6436
7434
  }
6437
7435
  )
6438
7436
  ] })
@@ -6460,6 +7458,10 @@ function DepositModalInner({
6460
7458
  forceRegister,
6461
7459
  enableSolana,
6462
7460
  dappImports,
7461
+ enableFiatOnramp,
7462
+ enableQrTransfer,
7463
+ fiatOnrampMethods,
7464
+ enableExchangeConnect,
6463
7465
  reownWallet,
6464
7466
  onConnect,
6465
7467
  onDisconnect,