@rhinestone/deposit-modal 0.3.0-alpha.11 → 0.3.0-alpha.13

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.
@@ -47,7 +47,12 @@
47
47
 
48
48
 
49
49
 
50
- var _chunk2TWQGPPBcjs = require('./chunk-2TWQGPPB.cjs');
50
+
51
+
52
+
53
+
54
+
55
+ var _chunkDZNXG5JKcjs = require('./chunk-DZNXG5JK.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 _chunkDZNXG5JKcjs.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 = _chunkDZNXG5JKcjs.useLatestRef.call(void 0, onTotalBalanceComputed);
129
+ const onAssetsLoadedRef = _chunkDZNXG5JKcjs.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 = _chunkDZNXG5JKcjs.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 _chunkDZNXG5JKcjs.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
+ _chunkDZNXG5JKcjs.BodyHeader,
223
235
  {
224
- icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.WalletIcon, {}),
236
+ icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDZNXG5JKcjs.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, _chunkDZNXG5JKcjs.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, _chunkDZNXG5JKcjs.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, _chunkDZNXG5JKcjs.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 ? _chunkDZNXG5JKcjs.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
+ _chunkDZNXG5JKcjs.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, _chunkDZNXG5JKcjs.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 = _chunkDZNXG5JKcjs.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 = _chunkDZNXG5JKcjs.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(_chunkDZNXG5JKcjs.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 _chunkDZNXG5JKcjs.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, _chunkDZNXG5JKcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDZNXG5JKcjs.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
+ _chunkDZNXG5JKcjs.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
+ _chunkDZNXG5JKcjs.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: _chunkDZNXG5JKcjs.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, _chunkDZNXG5JKcjs.Callout, { variant: "error", children: error }),
787
799
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
788
- _chunk2TWQGPPBcjs.Button,
800
+ _chunkDZNXG5JKcjs.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, _chunkDZNXG5JKcjs.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(_chunkDZNXG5JKcjs.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 (_chunkDZNXG5JKcjs.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 = _chunkDZNXG5JKcjs.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, _chunkDZNXG5JKcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDZNXG5JKcjs.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, _chunkDZNXG5JKcjs.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, _chunkDZNXG5JKcjs.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, _chunkDZNXG5JKcjs.Callout, { variant: "error", children: error }),
1004
1016
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1005
- _chunk2TWQGPPBcjs.Button,
1017
+ _chunkDZNXG5JKcjs.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, _chunkDZNXG5JKcjs.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 = _chunkDZNXG5JKcjs.getEventTxHash.call(void 0, event);
1040
1052
  if (!eventTxHash) return false;
1041
- return _chunk2TWQGPPBcjs.txRefsMatch.call(void 0, eventTxHash, txHash);
1053
+ return _chunkDZNXG5JKcjs.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, _chunkDZNXG5JKcjs.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 = _chunkDZNXG5JKcjs.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 = _chunkDZNXG5JKcjs.useLatestRef.call(void 0, onComplete);
1139
+ const onFailedRef = _chunkDZNXG5JKcjs.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,7 @@ 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, _chunkDZNXG5JKcjs.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, _chunkDZNXG5JKcjs.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, _chunkDZNXG5JKcjs.Spinner, {}) });
1232
1244
  const showClose = status !== "processing";
1233
1245
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
1234
1246
  "div",
@@ -1247,7 +1259,7 @@ function DepositNotification({
1247
1259
  className: "rs-deposit-notification-close",
1248
1260
  onClick: () => onDismiss(deposit.id),
1249
1261
  "aria-label": "Dismiss",
1250
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.CloseIcon, {})
1262
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDZNXG5JKcjs.CloseIcon, {})
1251
1263
  }
1252
1264
  )
1253
1265
  ] }),
@@ -1263,7 +1275,7 @@ function DepositNotification({
1263
1275
  "aria-expanded": expanded,
1264
1276
  children: [
1265
1277
  /* @__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" })
1278
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDZNXG5JKcjs.ChevronDownIcon, { className: "rs-deposit-notification-toggle-chevron" })
1267
1279
  ]
1268
1280
  }
1269
1281
  ),
@@ -1438,8 +1450,8 @@ function DepositAddressStep({
1438
1450
  options.splice(1, 0, "solana");
1439
1451
  return options;
1440
1452
  }, [evmChainIds, hasSolana]);
1441
- const BASE_CHAIN_ID = 8453;
1442
- const defaultChainId = evmChainIds.includes(BASE_CHAIN_ID) ? BASE_CHAIN_ID : evmChainIds[0];
1453
+ const BASE_CHAIN_ID2 = 8453;
1454
+ const defaultChainId = evmChainIds.includes(BASE_CHAIN_ID2) ? BASE_CHAIN_ID2 : evmChainIds[0];
1443
1455
  const [sourceChainId, setSourceChainId] = _react.useState.call(void 0, defaultChainId);
1444
1456
  const isSolana = sourceChainId === "solana";
1445
1457
  const tokensForChain = _react.useMemo.call(void 0,
@@ -1612,10 +1624,10 @@ function DepositAddressStep({
1612
1624
  return;
1613
1625
  }
1614
1626
  const event = status.lastEvent;
1615
- const eventTxHash = _chunk2TWQGPPBcjs.isDepositEvent.call(void 0, event) ? _nullishCoalesce(_chunk2TWQGPPBcjs.getEventTxHash.call(void 0, event), () => ( null)) : null;
1627
+ const eventTxHash = _chunkDZNXG5JKcjs.isDepositEvent.call(void 0, event) ? _nullishCoalesce(_chunkDZNXG5JKcjs.getEventTxHash.call(void 0, event), () => ( null)) : null;
1616
1628
  if (baselineTxHashRef.current === void 0) {
1617
1629
  baselineTxHashRef.current = eventTxHash;
1618
- } else if (eventTxHash && (!baselineTxHashRef.current || !_chunk2TWQGPPBcjs.txRefsMatch.call(void 0, eventTxHash, baselineTxHashRef.current))) {
1630
+ } else if (eventTxHash && (!baselineTxHashRef.current || !_chunkDZNXG5JKcjs.txRefsMatch.call(void 0, eventTxHash, baselineTxHashRef.current))) {
1619
1631
  const details = getDepositEventDetails(event);
1620
1632
  const chainId = _nullishCoalesce(details.chainId, () => ( "unknown"));
1621
1633
  const amount = _nullishCoalesce(details.amount, () => ( "0"));
@@ -1688,7 +1700,7 @@ function DepositAddressStep({
1688
1700
  const qrIconSrc = _chunk7JIDIX27cjs.getChainIcon.call(void 0, sourceChainId);
1689
1701
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen rs-step--with-notifications", children: [
1690
1702
  /* @__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" }),
1703
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDZNXG5JKcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDZNXG5JKcjs.TransferCryptoIcon, {}), title: "Transfer crypto" }),
1692
1704
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-selectors", children: [
1693
1705
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown", ref: chainDropdownRef, children: [
1694
1706
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-dropdown-label", children: "Supported chain" }),
@@ -1712,7 +1724,7 @@ function DepositAddressStep({
1712
1724
  }
1713
1725
  ),
1714
1726
  /* @__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" })
1727
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDZNXG5JKcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
1716
1728
  ]
1717
1729
  }
1718
1730
  ),
@@ -1743,8 +1755,8 @@ function DepositAddressStep({
1743
1755
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-deposit-address-min", children: [
1744
1756
  "Min.$",
1745
1757
  (_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,
1758
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDZNXG5JKcjs.Tooltip, { content: "Minimum deposit amount required for the selected chain.", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1759
+ _chunkDZNXG5JKcjs.InfoIcon,
1748
1760
  {
1749
1761
  className: "rs-deposit-address-min-icon",
1750
1762
  "aria-hidden": "true"
@@ -1772,7 +1784,7 @@ function DepositAddressStep({
1772
1784
  }
1773
1785
  ),
1774
1786
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: sourceTokenSymbol }),
1775
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
1787
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDZNXG5JKcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
1776
1788
  ]
1777
1789
  }
1778
1790
  ),
@@ -1824,7 +1836,7 @@ function DepositAddressStep({
1824
1836
  alignItems: "center",
1825
1837
  justifyContent: "center"
1826
1838
  },
1827
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.Spinner, {})
1839
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDZNXG5JKcjs.Spinner, {})
1828
1840
  }
1829
1841
  ),
1830
1842
  children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, QRCode, { value: displayAddress, size: 200, iconSrc: qrIconSrc })
@@ -1835,7 +1847,7 @@ function DepositAddressStep({
1835
1847
  }
1836
1848
  ),
1837
1849
  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" }),
1850
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDZNXG5JKcjs.Spinner, { className: "rs-spinner--sm" }),
1839
1851
  "Updating deposit details\u2026"
1840
1852
  ] }) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
1841
1853
  "button",
@@ -1844,7 +1856,7 @@ function DepositAddressStep({
1844
1856
  className: "rs-deposit-address-copy",
1845
1857
  onClick: handleCopy,
1846
1858
  children: [
1847
- copied ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.CheckIcon, {}) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.CopyIcon, {}),
1859
+ copied ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDZNXG5JKcjs.CheckIcon, {}) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDZNXG5JKcjs.CopyIcon, {}),
1848
1860
  copied ? "Copied!" : "Copy address"
1849
1861
  ]
1850
1862
  }
@@ -1869,16 +1881,16 @@ function DepositAddressStep({
1869
1881
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-label", children: "Price impact" }),
1870
1882
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-label", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: "0.00%" }) }),
1871
1883
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1872
- _chunk2TWQGPPBcjs.Tooltip,
1884
+ _chunkDZNXG5JKcjs.Tooltip,
1873
1885
  {
1874
1886
  className: "rs-price-impact-info",
1875
1887
  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" })
1888
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDZNXG5JKcjs.InfoIcon, { "aria-hidden": "true" })
1877
1889
  }
1878
1890
  )
1879
1891
  ] }),
1880
1892
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1881
- _chunk2TWQGPPBcjs.ChevronDownIcon,
1893
+ _chunkDZNXG5JKcjs.ChevronDownIcon,
1882
1894
  {
1883
1895
  className: "rs-price-impact-chevron",
1884
1896
  "aria-hidden": "true"
@@ -1889,29 +1901,29 @@ function DepositAddressStep({
1889
1901
  ),
1890
1902
  /* @__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
1903
  /* @__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, {}) }),
1904
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDZNXG5JKcjs.PercentIcon, {}) }),
1893
1905
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-price-impact-label", children: [
1894
1906
  "Max slippage: ",
1895
1907
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: "0.2%" })
1896
1908
  ] }),
1897
1909
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1898
- _chunk2TWQGPPBcjs.Tooltip,
1910
+ _chunkDZNXG5JKcjs.Tooltip,
1899
1911
  {
1900
1912
  className: "rs-price-impact-info",
1901
1913
  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" })
1914
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDZNXG5JKcjs.InfoIcon, { "aria-hidden": "true" })
1903
1915
  }
1904
1916
  )
1905
1917
  ] }),
1906
1918
  /* @__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, {}) }),
1919
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDZNXG5JKcjs.ClockIcon, {}) }),
1908
1920
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-price-impact-label", children: [
1909
1921
  "Processing time: ",
1910
1922
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: "< 1 min" })
1911
1923
  ] })
1912
1924
  ] }),
1913
1925
  /* @__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, {}) }),
1926
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDZNXG5JKcjs.PlusCircleIcon, {}) }),
1915
1927
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-price-impact-label", children: [
1916
1928
  "Max deposit:",
1917
1929
  " ",
@@ -1943,11 +1955,798 @@ function DepositAddressStep({
1943
1955
  },
1944
1956
  deposit.id
1945
1957
  )) }),
1946
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.PoweredBy, {})
1958
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDZNXG5JKcjs.PoweredBy, {})
1947
1959
  ] });
1948
1960
  }
1949
1961
  DepositAddressStep.displayName = "DepositAddressStep";
1950
1962
 
1963
+ // src/components/steps/FiatOnrampStep.tsx
1964
+
1965
+
1966
+ // src/components/steps/SwappedIframeStep.tsx
1967
+
1968
+
1969
+ // src/components/steps/SwappedOrderTracker.tsx
1970
+
1971
+ var STEP_LABELS = [
1972
+ "Payment received",
1973
+ null,
1974
+ "Processing App deposit",
1975
+ "Deposit successful"
1976
+ ];
1977
+ function SwappedOrderTracker({
1978
+ amount,
1979
+ currency = "USDC",
1980
+ chainLabel = "Base",
1981
+ stepStates,
1982
+ terminal = null,
1983
+ onRetry
1984
+ }) {
1985
+ const formattedAmount = formatTrackerAmount(amount);
1986
+ const title = terminal ? terminal.kind === "cancelled" ? "Order cancelled" : "Deposit failed" : formattedAmount ? `Depositing ${formattedAmount} ${currency}` : `Depositing ${currency}`;
1987
+ const labels = [
1988
+ STEP_LABELS[0],
1989
+ `${currency} received on ${chainLabel}`,
1990
+ STEP_LABELS[2],
1991
+ STEP_LABELS[3]
1992
+ ];
1993
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen rs-swapped-tracker", children: [
1994
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
1995
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDZNXG5JKcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDZNXG5JKcjs.HandCoinsIcon, {}), title }),
1996
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "ol", { className: "rs-swapped-tracker-steps", children: labels.map((label, idx) => {
1997
+ const status = stepStates[idx];
1998
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
1999
+ "li",
2000
+ {
2001
+ className: `rs-swapped-tracker-step rs-swapped-tracker-step--${status}`,
2002
+ children: [
2003
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-swapped-tracker-step-label", children: label }),
2004
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2005
+ "span",
2006
+ {
2007
+ className: "rs-swapped-tracker-step-marker",
2008
+ "aria-hidden": "true",
2009
+ children: status === "complete" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDZNXG5JKcjs.CheckIcon, {}) : status === "failed" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDZNXG5JKcjs.CloseIcon, {}) : status === "active" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDZNXG5JKcjs.Spinner, {}) : null
2010
+ }
2011
+ )
2012
+ ]
2013
+ },
2014
+ label
2015
+ );
2016
+ }) }),
2017
+ terminal && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
2018
+ "div",
2019
+ {
2020
+ className: `rs-swapped-tracker-terminal rs-swapped-tracker-terminal--${terminal.kind}`,
2021
+ children: [
2022
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "rs-swapped-tracker-terminal-message", children: terminal.message }),
2023
+ terminal.kind === "cancelled" && onRetry && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2024
+ "button",
2025
+ {
2026
+ type: "button",
2027
+ className: "rs-swapped-tracker-retry",
2028
+ onClick: onRetry,
2029
+ children: "Try again"
2030
+ }
2031
+ )
2032
+ ]
2033
+ }
2034
+ )
2035
+ ] }),
2036
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDZNXG5JKcjs.PoweredBy, {})
2037
+ ] });
2038
+ }
2039
+ function formatTrackerAmount(amount) {
2040
+ if (!amount) return null;
2041
+ const num = Number(amount);
2042
+ if (!Number.isFinite(num)) return amount;
2043
+ return num.toFixed(2);
2044
+ }
2045
+ SwappedOrderTracker.displayName = "SwappedOrderTracker";
2046
+
2047
+ // src/components/steps/SwappedIframeStep.tsx
2048
+
2049
+ var STATUS_POLL_INTERVAL_MS = 2e3;
2050
+ var DEPOSIT_POLL_INTERVAL_MS = 2e3;
2051
+ var DEPOSIT_POLL_FAST_INITIAL_DELAY_MS = 1e3;
2052
+ var DEPOSIT_POLL_FAST_INTERVAL_MS = 500;
2053
+ var IFRAME_LOAD_TIMEOUT_MS = 15e3;
2054
+ var SWAPPED_IFRAME_ORIGINS = /* @__PURE__ */ new Set([
2055
+ "https://sandbox.swapped.com",
2056
+ "https://widget.swapped.com"
2057
+ ]);
2058
+ var SWAPPED_TERMINAL_STATUSES = /* @__PURE__ */ new Set([
2059
+ "order_completed",
2060
+ "order_broadcasted"
2061
+ ]);
2062
+ var SWAPPED_STATUS_VALUES = /* @__PURE__ */ new Set([
2063
+ "payment_pending",
2064
+ "order_completed",
2065
+ "order_broadcasted",
2066
+ "order_cancelled"
2067
+ ]);
2068
+ function parseSwappedIframeMessage(raw) {
2069
+ let data = raw;
2070
+ if (typeof data === "string") {
2071
+ try {
2072
+ data = JSON.parse(data);
2073
+ } catch (e15) {
2074
+ return null;
2075
+ }
2076
+ }
2077
+ if (!data || typeof data !== "object") return null;
2078
+ const obj = data;
2079
+ const inner = obj.data && typeof obj.data === "object" ? obj.data : obj;
2080
+ const rawStatus = _nullishCoalesce(_nullishCoalesce(inner.order_status, () => ( inner.status)), () => ( obj.status));
2081
+ if (typeof rawStatus !== "string" || !SWAPPED_STATUS_VALUES.has(rawStatus)) {
2082
+ return null;
2083
+ }
2084
+ const asString2 = (v) => typeof v === "string" && v.length > 0 ? v : void 0;
2085
+ return {
2086
+ status: rawStatus,
2087
+ orderId: _nullishCoalesce(asString2(inner.order_id), () => ( asString2(obj.orderId))),
2088
+ orderCrypto: _nullishCoalesce(asString2(inner.order_crypto), () => ( asString2(obj.orderCrypto))),
2089
+ orderCryptoAmount: _nullishCoalesce(asString2(inner.order_crypto_amount), () => ( asString2(obj.orderCryptoAmount))),
2090
+ transactionId: _nullishCoalesce(asString2(inner.transaction_id), () => ( asString2(obj.transactionId)))
2091
+ };
2092
+ }
2093
+ function SwappedIframeStep({
2094
+ smartAccount,
2095
+ service,
2096
+ variant,
2097
+ loadUrl,
2098
+ iframeTitle,
2099
+ loadErrorCode,
2100
+ loadErrorFallback,
2101
+ bannerForStatus,
2102
+ onSwappedComplete,
2103
+ onSwappedFailed,
2104
+ onClose,
2105
+ onError
2106
+ }) {
2107
+ const [widgetUrl, setWidgetUrl] = _react.useState.call(void 0, null);
2108
+ const [loadError, setLoadError] = _react.useState.call(void 0, null);
2109
+ const [iframeLoaded, setIframeLoaded] = _react.useState.call(void 0, false);
2110
+ const [retryToken, setRetryToken] = _react.useState.call(void 0, 0);
2111
+ const [orderState, setOrderState] = _react.useState.call(void 0, null);
2112
+ const [latestEvent, setLatestEvent] = _react.useState.call(void 0, null);
2113
+ const [phase, setPhase] = _react.useState.call(void 0, "iframe");
2114
+ const completeFiredRef = _react.useRef.call(void 0, false);
2115
+ const failedFiredRef = _react.useRef.call(void 0, false);
2116
+ const expectedOrderUuidRef = _react.useRef.call(void 0, null);
2117
+ const baselineDepositTxHashRef = _react.useRef.call(void 0, void 0);
2118
+ const currentDepositTxHashRef = _react.useRef.call(void 0, null);
2119
+ const fastDepositPollEnabledRef = _react.useRef.call(void 0, false);
2120
+ const rescheduleDepositPollRef = _react.useRef.call(void 0,
2121
+ null
2122
+ );
2123
+ const onSwappedCompleteRef = _react.useRef.call(void 0, onSwappedComplete);
2124
+ onSwappedCompleteRef.current = onSwappedComplete;
2125
+ const onSwappedFailedRef = _react.useRef.call(void 0, onSwappedFailed);
2126
+ onSwappedFailedRef.current = onSwappedFailed;
2127
+ const onErrorRef = _react.useRef.call(void 0, onError);
2128
+ onErrorRef.current = onError;
2129
+ const loadUrlRef = _react.useRef.call(void 0, loadUrl);
2130
+ loadUrlRef.current = loadUrl;
2131
+ _react.useEffect.call(void 0, () => {
2132
+ let cancelled = false;
2133
+ setLoadError(null);
2134
+ setIframeLoaded(false);
2135
+ setWidgetUrl(null);
2136
+ setOrderState(null);
2137
+ setLatestEvent(null);
2138
+ setPhase("iframe");
2139
+ expectedOrderUuidRef.current = null;
2140
+ completeFiredRef.current = false;
2141
+ failedFiredRef.current = false;
2142
+ baselineDepositTxHashRef.current = void 0;
2143
+ currentDepositTxHashRef.current = null;
2144
+ fastDepositPollEnabledRef.current = false;
2145
+ loadUrlRef.current().then((res) => {
2146
+ if (cancelled) return;
2147
+ setWidgetUrl(res.url);
2148
+ const sep = res.externalCustomerId.indexOf(":");
2149
+ expectedOrderUuidRef.current = sep >= 0 ? res.externalCustomerId.slice(sep + 1) : null;
2150
+ }).catch((err) => {
2151
+ if (cancelled) return;
2152
+ const message = err instanceof Error ? err.message : loadErrorFallback;
2153
+ setLoadError(message);
2154
+ _optionalChain([onErrorRef, 'access', _75 => _75.current, 'optionalCall', _76 => _76(message, loadErrorCode)]);
2155
+ });
2156
+ return () => {
2157
+ cancelled = true;
2158
+ };
2159
+ }, [service, smartAccount, retryToken, loadErrorCode, loadErrorFallback]);
2160
+ _react.useEffect.call(void 0, () => {
2161
+ if (!widgetUrl || iframeLoaded || loadError) return;
2162
+ const timer = setTimeout(() => {
2163
+ setLoadError("Iframe took too long to load.");
2164
+ }, IFRAME_LOAD_TIMEOUT_MS);
2165
+ return () => clearTimeout(timer);
2166
+ }, [widgetUrl, iframeLoaded, loadError]);
2167
+ _react.useEffect.call(void 0, () => {
2168
+ let cancelled = false;
2169
+ let timeoutId;
2170
+ async function poll() {
2171
+ if (cancelled) return;
2172
+ try {
2173
+ const res = await service.fetchSwappedOrderStatus(smartAccount);
2174
+ if (cancelled) return;
2175
+ const isCurrentOrder = res !== null && expectedOrderUuidRef.current !== null && res.orderId === expectedOrderUuidRef.current;
2176
+ if (isCurrentOrder) {
2177
+ setOrderState(res);
2178
+ }
2179
+ } catch (e16) {
2180
+ }
2181
+ if (!cancelled) {
2182
+ timeoutId = setTimeout(poll, STATUS_POLL_INTERVAL_MS);
2183
+ }
2184
+ }
2185
+ poll();
2186
+ return () => {
2187
+ cancelled = true;
2188
+ clearTimeout(timeoutId);
2189
+ };
2190
+ }, [service, smartAccount]);
2191
+ _react.useEffect.call(void 0, () => {
2192
+ let cancelled = false;
2193
+ let timeoutId;
2194
+ async function pollDeposit() {
2195
+ if (cancelled) return;
2196
+ try {
2197
+ const status = await service.fetchLatestStatus(smartAccount);
2198
+ if (cancelled) return;
2199
+ const event = status.lastEvent;
2200
+ const eventTxHash = _chunkDZNXG5JKcjs.isDepositEvent.call(void 0, event) ? _nullishCoalesce(_chunkDZNXG5JKcjs.getEventTxHash.call(void 0, event), () => ( null)) : null;
2201
+ if (baselineDepositTxHashRef.current === void 0) {
2202
+ baselineDepositTxHashRef.current = eventTxHash;
2203
+ } else if (eventTxHash && (!baselineDepositTxHashRef.current || !_chunkDZNXG5JKcjs.txRefsMatch.call(void 0, eventTxHash, baselineDepositTxHashRef.current))) {
2204
+ currentDepositTxHashRef.current = eventTxHash;
2205
+ setLatestEvent(_nullishCoalesce(event, () => ( null)));
2206
+ }
2207
+ } catch (e17) {
2208
+ }
2209
+ if (!cancelled) {
2210
+ const nextInterval = fastDepositPollEnabledRef.current ? DEPOSIT_POLL_FAST_INTERVAL_MS : DEPOSIT_POLL_INTERVAL_MS;
2211
+ timeoutId = setTimeout(pollDeposit, nextInterval);
2212
+ }
2213
+ }
2214
+ rescheduleDepositPollRef.current = (delayMs) => {
2215
+ if (cancelled) return;
2216
+ if (timeoutId !== void 0) clearTimeout(timeoutId);
2217
+ timeoutId = setTimeout(pollDeposit, delayMs);
2218
+ };
2219
+ pollDeposit();
2220
+ return () => {
2221
+ cancelled = true;
2222
+ if (timeoutId !== void 0) clearTimeout(timeoutId);
2223
+ rescheduleDepositPollRef.current = null;
2224
+ };
2225
+ }, [service, smartAccount]);
2226
+ _react.useEffect.call(void 0, () => {
2227
+ if (fastDepositPollEnabledRef.current) return;
2228
+ const status = _optionalChain([orderState, 'optionalAccess', _77 => _77.status]);
2229
+ if (!status || !SWAPPED_TERMINAL_STATUSES.has(status)) return;
2230
+ fastDepositPollEnabledRef.current = true;
2231
+ _optionalChain([rescheduleDepositPollRef, 'access', _78 => _78.current, 'optionalCall', _79 => _79(DEPOSIT_POLL_FAST_INITIAL_DELAY_MS)]);
2232
+ }, [orderState]);
2233
+ _react.useEffect.call(void 0, () => {
2234
+ function onMessage(e) {
2235
+ if (!SWAPPED_IFRAME_ORIGINS.has(e.origin)) return;
2236
+ const parsed = parseSwappedIframeMessage(e.data);
2237
+ if (!parsed) return;
2238
+ setOrderState((prev) => ({
2239
+ orderId: _nullishCoalesce(_nullishCoalesce(parsed.orderId, () => ( _optionalChain([prev, 'optionalAccess', _80 => _80.orderId]))), () => ( "")),
2240
+ status: parsed.status,
2241
+ orderCrypto: _nullishCoalesce(_nullishCoalesce(parsed.orderCrypto, () => ( _optionalChain([prev, 'optionalAccess', _81 => _81.orderCrypto]))), () => ( null)),
2242
+ orderCryptoAmount: _nullishCoalesce(_nullishCoalesce(parsed.orderCryptoAmount, () => ( _optionalChain([prev, 'optionalAccess', _82 => _82.orderCryptoAmount]))), () => ( null)),
2243
+ transactionId: _nullishCoalesce(_nullishCoalesce(parsed.transactionId, () => ( _optionalChain([prev, 'optionalAccess', _83 => _83.transactionId]))), () => ( null)),
2244
+ receivedAt: (/* @__PURE__ */ new Date()).toISOString(),
2245
+ paidAmountUsd: _nullishCoalesce(_optionalChain([prev, 'optionalAccess', _84 => _84.paidAmountUsd]), () => ( null)),
2246
+ paidAmountEur: _nullishCoalesce(_optionalChain([prev, 'optionalAccess', _85 => _85.paidAmountEur]), () => ( null)),
2247
+ onrampFeeUsd: _nullishCoalesce(_optionalChain([prev, 'optionalAccess', _86 => _86.onrampFeeUsd]), () => ( null)),
2248
+ paymentMethod: _nullishCoalesce(_optionalChain([prev, 'optionalAccess', _87 => _87.paymentMethod]), () => ( null))
2249
+ }));
2250
+ }
2251
+ window.addEventListener("message", onMessage);
2252
+ return () => window.removeEventListener("message", onMessage);
2253
+ }, []);
2254
+ _react.useEffect.call(void 0, () => {
2255
+ if (phase === "iframe" && orderState !== null) {
2256
+ setPhase("tracker");
2257
+ }
2258
+ }, [phase, orderState]);
2259
+ const stepStates = _react.useMemo.call(void 0,
2260
+ () => deriveStepStates(_nullishCoalesce(_optionalChain([orderState, 'optionalAccess', _88 => _88.status]), () => ( null)), latestEvent),
2261
+ [orderState, latestEvent]
2262
+ );
2263
+ const terminalState = _react.useMemo.call(void 0, () => {
2264
+ if (_chunkDZNXG5JKcjs.isFailedEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))) {
2265
+ return {
2266
+ kind: "failed",
2267
+ message: _chunkDZNXG5JKcjs.failureMessageForEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))
2268
+ };
2269
+ }
2270
+ if (_optionalChain([orderState, 'optionalAccess', _89 => _89.status]) === "order_cancelled") {
2271
+ const banner = bannerForStatus("order_cancelled", {});
2272
+ return { kind: "cancelled", message: _nullishCoalesce(banner.detail, () => ( banner.title)) };
2273
+ }
2274
+ return null;
2275
+ }, [latestEvent, orderState, bannerForStatus]);
2276
+ _react.useEffect.call(void 0, () => {
2277
+ if (completeFiredRef.current || failedFiredRef.current) return;
2278
+ const t = _optionalChain([latestEvent, 'optionalAccess', _90 => _90.type]);
2279
+ const isSuccess = t === "bridge-complete" || t === "post-bridge-swap-complete";
2280
+ if (!isSuccess) return;
2281
+ const txHash = currentDepositTxHashRef.current;
2282
+ if (!txHash) return;
2283
+ completeFiredRef.current = true;
2284
+ onSwappedCompleteRef.current({
2285
+ txHash,
2286
+ orderCrypto: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess', _91 => _91.orderCrypto]), () => ( null)),
2287
+ // Base-unit source amount from the deposit row/event, consistent with the
2288
+ // wallet/QR path. ProcessingStep + onLifecycle expect base units.
2289
+ amount: _nullishCoalesce(_chunkDZNXG5JKcjs.getEventSourceDetails.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0))).amount, () => ( null))
2290
+ });
2291
+ }, [latestEvent, orderState]);
2292
+ _react.useEffect.call(void 0, () => {
2293
+ if (failedFiredRef.current || completeFiredRef.current) return;
2294
+ if (!_chunkDZNXG5JKcjs.isFailedEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))) return;
2295
+ const txHash = currentDepositTxHashRef.current;
2296
+ if (!txHash) return;
2297
+ failedFiredRef.current = true;
2298
+ setPhase("tracker");
2299
+ _optionalChain([onSwappedFailedRef, 'access', _92 => _92.current, 'optionalCall', _93 => _93(
2300
+ txHash,
2301
+ _chunkDZNXG5JKcjs.failureMessageForEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))
2302
+ )]);
2303
+ }, [latestEvent]);
2304
+ if (phase === "tracker") {
2305
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2306
+ SwappedOrderTracker,
2307
+ {
2308
+ amount: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess', _94 => _94.orderCryptoAmount]), () => ( null)),
2309
+ currency: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess', _95 => _95.orderCrypto]), () => ( "USDC")),
2310
+ stepStates,
2311
+ terminal: terminalState,
2312
+ onRetry: () => setRetryToken((n) => n + 1),
2313
+ onClose
2314
+ }
2315
+ );
2316
+ }
2317
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen rs-fiat-onramp", "data-variant": variant, children: [
2318
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
2319
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2320
+ _chunkDZNXG5JKcjs.BodyHeader,
2321
+ {
2322
+ icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDZNXG5JKcjs.HandCoinsIcon, {}),
2323
+ title: "Deposit",
2324
+ subtitle: "Add money to your balance"
2325
+ }
2326
+ ),
2327
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-fiat-onramp-iframe-wrap", children: [
2328
+ loadError && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-fiat-onramp-error", children: [
2329
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { children: loadError }),
2330
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2331
+ "button",
2332
+ {
2333
+ type: "button",
2334
+ className: "rs-fiat-onramp-retry",
2335
+ onClick: () => setRetryToken((n) => n + 1),
2336
+ children: "Retry"
2337
+ }
2338
+ )
2339
+ ] }),
2340
+ !loadError && !iframeLoaded && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-fiat-onramp-loading", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDZNXG5JKcjs.Spinner, {}) }),
2341
+ widgetUrl && !loadError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2342
+ "iframe",
2343
+ {
2344
+ src: widgetUrl,
2345
+ title: iframeTitle,
2346
+ className: "rs-fiat-onramp-iframe",
2347
+ sandbox: "allow-scripts allow-forms allow-same-origin allow-popups allow-popups-to-escape-sandbox allow-top-navigation-by-user-activation",
2348
+ allow: "payment; camera; microphone; clipboard-write; geolocation",
2349
+ onLoad: () => setIframeLoaded(true)
2350
+ },
2351
+ retryToken
2352
+ )
2353
+ ] })
2354
+ ] }),
2355
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDZNXG5JKcjs.PoweredBy, {})
2356
+ ] });
2357
+ }
2358
+ function deriveStepStates(swappedStatus, latestEvent) {
2359
+ if (_chunkDZNXG5JKcjs.isFailedEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))) {
2360
+ return ["complete", "complete", "failed", "pending"];
2361
+ }
2362
+ if (swappedStatus === "order_cancelled") {
2363
+ return ["failed", "pending", "pending", "pending"];
2364
+ }
2365
+ const step1Complete = swappedStatus === "order_completed" || swappedStatus === "order_broadcasted";
2366
+ const step2Complete = latestEvent !== null;
2367
+ const step3Complete = _optionalChain([latestEvent, 'optionalAccess', _96 => _96.type]) === "bridge-complete" || _optionalChain([latestEvent, 'optionalAccess', _97 => _97.type]) === "post-bridge-swap-complete";
2368
+ if (step3Complete) {
2369
+ return ["complete", "complete", "complete", "pending"];
2370
+ }
2371
+ if (step2Complete) {
2372
+ return ["complete", "complete", "active", "pending"];
2373
+ }
2374
+ if (step1Complete) {
2375
+ return ["complete", "active", "pending", "pending"];
2376
+ }
2377
+ return ["active", "pending", "pending", "pending"];
2378
+ }
2379
+ SwappedIframeStep.displayName = "SwappedIframeStep";
2380
+
2381
+ // src/components/steps/FiatOnrampStep.tsx
2382
+
2383
+ function fiatBannerForStatus(status, context) {
2384
+ if (context.currencyMismatch) {
2385
+ return {
2386
+ level: "warning",
2387
+ title: "Currency mismatch",
2388
+ detail: "Funds may not bridge automatically. Contact support if your balance does not arrive."
2389
+ };
2390
+ }
2391
+ switch (status) {
2392
+ case "payment_pending":
2393
+ return { level: "info", title: "Verifying payment\u2026" };
2394
+ case "order_completed":
2395
+ return { level: "success", title: "Payment received \u2014 sending crypto" };
2396
+ case "order_broadcasted":
2397
+ return {
2398
+ level: "success",
2399
+ title: "Crypto sent \u2014 confirming on-chain"
2400
+ };
2401
+ case "order_cancelled":
2402
+ return {
2403
+ level: "warning",
2404
+ title: "Order cancelled",
2405
+ detail: "If you were charged, Swapped will refund within 5 business days."
2406
+ };
2407
+ }
2408
+ }
2409
+ function FiatOnrampStep({
2410
+ smartAccount,
2411
+ service,
2412
+ paymentMethod,
2413
+ onSwappedComplete,
2414
+ onSwappedFailed,
2415
+ onClose,
2416
+ onError
2417
+ }) {
2418
+ const loadUrl = _react.useCallback.call(void 0, async () => {
2419
+ const res = await service.getSwappedWidgetUrl({
2420
+ smartAccount,
2421
+ method: paymentMethod
2422
+ });
2423
+ if (res.currencyCode !== "USDC_BASE") {
2424
+ console.warn(
2425
+ `[FiatOnrampStep] Expected backend to return currencyCode=USDC_BASE, got ${res.currencyCode}. Swapped purchases may not bridge as expected.`
2426
+ );
2427
+ }
2428
+ return res;
2429
+ }, [service, smartAccount, paymentMethod]);
2430
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2431
+ SwappedIframeStep,
2432
+ {
2433
+ smartAccount,
2434
+ service,
2435
+ variant: "fiat",
2436
+ loadUrl,
2437
+ iframeTitle: "Buy crypto with Swapped",
2438
+ loadErrorCode: "SWAPPED_URL_FAILED",
2439
+ loadErrorFallback: "Failed to load on-ramp",
2440
+ bannerForStatus: fiatBannerForStatus,
2441
+ onSwappedComplete,
2442
+ onSwappedFailed,
2443
+ onClose,
2444
+ onError
2445
+ }
2446
+ );
2447
+ }
2448
+ FiatOnrampStep.displayName = "FiatOnrampStep";
2449
+
2450
+ // src/components/steps/ExchangeConnectStep.tsx
2451
+
2452
+
2453
+ function connectBannerForStatus(status, context) {
2454
+ if (context.currencyMismatch) {
2455
+ return {
2456
+ level: "warning",
2457
+ title: "Currency mismatch",
2458
+ detail: "Funds may not bridge automatically. Contact support if your balance does not arrive."
2459
+ };
2460
+ }
2461
+ switch (status) {
2462
+ case "payment_pending":
2463
+ return { level: "info", title: "Waiting for exchange transfer\u2026" };
2464
+ case "order_completed":
2465
+ return {
2466
+ level: "success",
2467
+ title: "Exchange transfer received \u2014 sending crypto"
2468
+ };
2469
+ case "order_broadcasted":
2470
+ return {
2471
+ level: "success",
2472
+ title: "Crypto sent \u2014 confirming on-chain"
2473
+ };
2474
+ case "order_cancelled":
2475
+ return {
2476
+ level: "warning",
2477
+ title: "Order cancelled",
2478
+ detail: "If your exchange already debited the funds, Swapped will refund within 5 business days."
2479
+ };
2480
+ }
2481
+ }
2482
+ function ExchangeConnectStep({
2483
+ smartAccount,
2484
+ service,
2485
+ connection,
2486
+ onSwappedComplete,
2487
+ onSwappedFailed,
2488
+ onClose,
2489
+ onError
2490
+ }) {
2491
+ const loadUrl = _react.useCallback.call(void 0, async () => {
2492
+ const res = await service.getSwappedConnectUrl({
2493
+ smartAccount,
2494
+ connection
2495
+ });
2496
+ if (res.currencyCode !== "USDC_BASE") {
2497
+ console.warn(
2498
+ `[ExchangeConnectStep] Expected backend to return currencyCode=USDC_BASE, got ${res.currencyCode}. Swapped Connect pulls may not bridge as expected.`
2499
+ );
2500
+ }
2501
+ return res;
2502
+ }, [service, smartAccount, connection]);
2503
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2504
+ SwappedIframeStep,
2505
+ {
2506
+ smartAccount,
2507
+ service,
2508
+ variant: "connect",
2509
+ loadUrl,
2510
+ iframeTitle: "Fund from exchange via Swapped",
2511
+ loadErrorCode: "SWAPPED_CONNECT_URL_FAILED",
2512
+ loadErrorFallback: "Failed to load Connect",
2513
+ bannerForStatus: connectBannerForStatus,
2514
+ onSwappedComplete,
2515
+ onSwappedFailed,
2516
+ onClose,
2517
+ onError
2518
+ }
2519
+ );
2520
+ }
2521
+ ExchangeConnectStep.displayName = "ExchangeConnectStep";
2522
+
2523
+ // src/components/steps/ExchangeSelectStep.tsx
2524
+
2525
+
2526
+ function ExchangeLogo({ exchange }) {
2527
+ const [failed, setFailed] = _react.useState.call(void 0, false);
2528
+ if (!exchange.logoUrl || failed) {
2529
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDZNXG5JKcjs.BankIcon, {});
2530
+ }
2531
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2532
+ "img",
2533
+ {
2534
+ src: exchange.logoUrl,
2535
+ alt: "",
2536
+ onError: () => setFailed(true)
2537
+ }
2538
+ );
2539
+ }
2540
+ function ExchangeSelectStep({
2541
+ service,
2542
+ onSelectExchange,
2543
+ onError
2544
+ }) {
2545
+ const [exchanges, setExchanges] = _react.useState.call(void 0, []);
2546
+ const [loading, setLoading] = _react.useState.call(void 0, true);
2547
+ const [error, setError] = _react.useState.call(void 0, null);
2548
+ const [retryToken, setRetryToken] = _react.useState.call(void 0, 0);
2549
+ const retry = _react.useCallback.call(void 0, () => {
2550
+ setRetryToken((n) => n + 1);
2551
+ }, []);
2552
+ _react.useEffect.call(void 0, () => {
2553
+ let cancelled = false;
2554
+ setLoading(true);
2555
+ setError(null);
2556
+ service.getSwappedConnectExchanges().then((res) => {
2557
+ if (cancelled) return;
2558
+ setExchanges(res.exchanges);
2559
+ }).catch((err) => {
2560
+ if (cancelled) return;
2561
+ const message = err instanceof Error ? err.message : "Failed to load exchanges";
2562
+ setExchanges([]);
2563
+ setError(message);
2564
+ _optionalChain([onError, 'optionalCall', _98 => _98(message, "SWAPPED_CONNECT_EXCHANGES_FAILED")]);
2565
+ }).finally(() => {
2566
+ if (!cancelled) setLoading(false);
2567
+ });
2568
+ return () => {
2569
+ cancelled = true;
2570
+ };
2571
+ }, [service, retryToken, onError]);
2572
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen rs-exchange-select", children: [
2573
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
2574
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2575
+ _chunkDZNXG5JKcjs.BodyHeader,
2576
+ {
2577
+ icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDZNXG5JKcjs.BankIcon, {}),
2578
+ title: "Fund from Exchange",
2579
+ subtitle: "Choose your exchange"
2580
+ }
2581
+ ),
2582
+ loading && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-exchange-select-state", "aria-live": "polite", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDZNXG5JKcjs.Spinner, {}) }),
2583
+ !loading && error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-exchange-select-state", "aria-live": "polite", children: [
2584
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-exchange-select-state-title", children: "Couldn\u2019t load exchanges" }),
2585
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2586
+ "button",
2587
+ {
2588
+ type: "button",
2589
+ className: "rs-fiat-onramp-retry",
2590
+ onClick: retry,
2591
+ children: "Retry"
2592
+ }
2593
+ )
2594
+ ] }),
2595
+ !loading && !error && exchanges.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-exchange-select-state", "aria-live": "polite", children: [
2596
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-exchange-select-state-title", children: "No exchanges available" }),
2597
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2598
+ "button",
2599
+ {
2600
+ type: "button",
2601
+ className: "rs-fiat-onramp-retry",
2602
+ onClick: retry,
2603
+ children: "Retry"
2604
+ }
2605
+ )
2606
+ ] }),
2607
+ !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,
2608
+ "button",
2609
+ {
2610
+ type: "button",
2611
+ className: "rs-exchange-card",
2612
+ onClick: () => onSelectExchange(exchange.connection),
2613
+ "aria-label": `Select ${exchange.name}`,
2614
+ children: [
2615
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-exchange-card-logo", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ExchangeLogo, { exchange }) }),
2616
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-exchange-card-name", children: exchange.name })
2617
+ ]
2618
+ },
2619
+ exchange.connection
2620
+ )) })
2621
+ ] }),
2622
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDZNXG5JKcjs.PoweredBy, {})
2623
+ ] });
2624
+ }
2625
+ ExchangeSelectStep.displayName = "ExchangeSelectStep";
2626
+
2627
+ // src/components/steps/DepositAddressSkeleton.tsx
2628
+
2629
+ var BASE_CHAIN_ID = 8453;
2630
+ function DepositAddressSkeleton({
2631
+ uiConfig,
2632
+ allowedRoutes
2633
+ }) {
2634
+ const allowedChainSet = _optionalChain([allowedRoutes, 'optionalAccess', _99 => _99.sourceChains]) ? new Set(allowedRoutes.sourceChains) : null;
2635
+ const allowedTokenSet = _optionalChain([allowedRoutes, 'optionalAccess', _100 => _100.sourceTokens]) ? new Set(allowedRoutes.sourceTokens.map((s) => s.toUpperCase())) : null;
2636
+ const evmChainIds = (() => {
2637
+ const all = _chunk7JIDIX27cjs.getSupportedChainIds.call(void 0, );
2638
+ return allowedChainSet ? all.filter((id) => allowedChainSet.has(id)) : all;
2639
+ })();
2640
+ const defaultChainId = evmChainIds.includes(BASE_CHAIN_ID) ? BASE_CHAIN_ID : evmChainIds[0];
2641
+ const tokensForChain = (() => {
2642
+ const all = _chunk7JIDIX27cjs.getTargetTokenSymbolsForChain.call(void 0, defaultChainId);
2643
+ return allowedTokenSet ? all.filter((s) => allowedTokenSet.has(s.toUpperCase())) : all;
2644
+ })();
2645
+ const defaultToken = tokensForChain.includes("USDC") ? "USDC" : _nullishCoalesce(tokensForChain[0], () => ( "USDC"));
2646
+ const chainName = _chunk7JIDIX27cjs.getChainName.call(void 0, defaultChainId);
2647
+ const chainIcon = _chunk7JIDIX27cjs.getChainIcon.call(void 0, defaultChainId);
2648
+ const tokenIcon = _chunk7JIDIX27cjs.getTokenIcon.call(void 0, defaultToken);
2649
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", "aria-busy": "true", children: [
2650
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-sr-only", role: "status", children: "Preparing deposit details\u2026" }),
2651
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
2652
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDZNXG5JKcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDZNXG5JKcjs.TransferCryptoIcon, {}), title: "Transfer crypto" }),
2653
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-selectors", "aria-hidden": "true", children: [
2654
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown", children: [
2655
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-dropdown-label", children: "Supported chain" }),
2656
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown-trigger", children: [
2657
+ chainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2658
+ "img",
2659
+ {
2660
+ src: chainIcon,
2661
+ alt: "",
2662
+ className: "rs-deposit-address-dropdown-icon"
2663
+ }
2664
+ ),
2665
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: chainName }),
2666
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDZNXG5JKcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
2667
+ ] })
2668
+ ] }),
2669
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown", children: [
2670
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown-label rs-deposit-address-dropdown-label--with-min", children: [
2671
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Supported token" }),
2672
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-deposit-address-min", children: [
2673
+ "Min.$",
2674
+ (_nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _101 => _101.minDepositUsd]), () => ( 0.1))).toFixed(2),
2675
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDZNXG5JKcjs.Tooltip, { content: "Minimum deposit amount required for the selected chain.", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2676
+ _chunkDZNXG5JKcjs.InfoIcon,
2677
+ {
2678
+ className: "rs-deposit-address-min-icon",
2679
+ "aria-hidden": "true"
2680
+ }
2681
+ ) })
2682
+ ] })
2683
+ ] }),
2684
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown-trigger", children: [
2685
+ tokenIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2686
+ "img",
2687
+ {
2688
+ src: tokenIcon,
2689
+ alt: "",
2690
+ className: "rs-deposit-address-dropdown-icon"
2691
+ }
2692
+ ),
2693
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: defaultToken }),
2694
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDZNXG5JKcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
2695
+ ] })
2696
+ ] })
2697
+ ] }),
2698
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
2699
+ "div",
2700
+ {
2701
+ style: { display: "flex", flexDirection: "column", gap: 4, width: "100%" },
2702
+ children: [
2703
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-well", children: [
2704
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-qr", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-skeleton rs-skeleton-qr", "aria-hidden": "true" }) }),
2705
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-skeleton rs-skeleton-address", "aria-hidden": "true" })
2706
+ ] }),
2707
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
2708
+ "button",
2709
+ {
2710
+ type: "button",
2711
+ className: "rs-deposit-address-copy",
2712
+ disabled: true,
2713
+ "aria-hidden": "true",
2714
+ children: [
2715
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDZNXG5JKcjs.CopyIcon, {}),
2716
+ "Copy address"
2717
+ ]
2718
+ }
2719
+ )
2720
+ ]
2721
+ }
2722
+ ),
2723
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-price-impact", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-price-impact-header", children: [
2724
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-price-impact-header-left", children: [
2725
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-label", children: "Price impact" }),
2726
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-label", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: "0.00%" }) }),
2727
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2728
+ _chunkDZNXG5JKcjs.Tooltip,
2729
+ {
2730
+ className: "rs-price-impact-info",
2731
+ content: "Price impact is the difference between expected and execution price, due to trade size and liquidity.",
2732
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDZNXG5JKcjs.InfoIcon, { "aria-hidden": "true" })
2733
+ }
2734
+ )
2735
+ ] }),
2736
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2737
+ _chunkDZNXG5JKcjs.ChevronDownIcon,
2738
+ {
2739
+ className: "rs-price-impact-chevron",
2740
+ "aria-hidden": "true"
2741
+ }
2742
+ )
2743
+ ] }) })
2744
+ ] }),
2745
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDZNXG5JKcjs.PoweredBy, {})
2746
+ ] });
2747
+ }
2748
+ DepositAddressSkeleton.displayName = "DepositAddressSkeleton";
2749
+
1951
2750
  // src/components/steps/SolanaTokenSelectStep.tsx
1952
2751
 
1953
2752
 
@@ -1975,7 +2774,7 @@ function SolanaTokenSelectStep({
1975
2774
  setError(null);
1976
2775
  const portfolioBySymbol = {};
1977
2776
  try {
1978
- _chunk2TWQGPPBcjs.debugLog.call(void 0, debug, "solana-token-select", "portfolio:request", {
2777
+ _chunkDZNXG5JKcjs.debugLog.call(void 0, debug, "solana-token-select", "portfolio:request", {
1979
2778
  solanaAddress
1980
2779
  });
1981
2780
  const portfolio = await service.fetchSolanaPortfolio(solanaAddress);
@@ -1986,7 +2785,7 @@ function SolanaTokenSelectStep({
1986
2785
  let parsed = 0n;
1987
2786
  try {
1988
2787
  parsed = BigInt(t.balance || "0");
1989
- } catch (e15) {
2788
+ } catch (e18) {
1990
2789
  parsed = 0n;
1991
2790
  }
1992
2791
  if (parsed <= 0n) continue;
@@ -1998,12 +2797,12 @@ function SolanaTokenSelectStep({
1998
2797
  };
1999
2798
  }
2000
2799
  }
2001
- _chunk2TWQGPPBcjs.debugLog.call(void 0, debug, "solana-token-select", "portfolio:success", {
2800
+ _chunkDZNXG5JKcjs.debugLog.call(void 0, debug, "solana-token-select", "portfolio:success", {
2002
2801
  symbols: Object.keys(portfolioBySymbol)
2003
2802
  });
2004
2803
  } catch (err) {
2005
2804
  if (!active) return;
2006
- _chunk2TWQGPPBcjs.debugError.call(void 0, debug, "solana-token-select", "portfolio:failure", err, {
2805
+ _chunkDZNXG5JKcjs.debugError.call(void 0, debug, "solana-token-select", "portfolio:failure", err, {
2007
2806
  solanaAddress
2008
2807
  });
2009
2808
  setError(
@@ -2028,7 +2827,7 @@ function SolanaTokenSelectStep({
2028
2827
  setTokenBalances(results);
2029
2828
  setLoading(false);
2030
2829
  const totalUsd = results.reduce((sum, r) => sum + r.balanceUsd, 0);
2031
- _optionalChain([onTotalBalanceComputed, 'optionalCall', _75 => _75(totalUsd)]);
2830
+ _optionalChain([onTotalBalanceComputed, 'optionalCall', _102 => _102(totalUsd)]);
2032
2831
  }
2033
2832
  void loadBalances();
2034
2833
  return () => {
@@ -2050,8 +2849,8 @@ function SolanaTokenSelectStep({
2050
2849
  const raw = _viem.formatUnits.call(void 0, entry.balance, entry.token.decimals);
2051
2850
  const numeric = Number(raw);
2052
2851
  if (!Number.isFinite(numeric)) return raw;
2053
- return _chunk2TWQGPPBcjs.tokenFormatter.format(numeric);
2054
- } catch (e16) {
2852
+ return _chunkDZNXG5JKcjs.tokenFormatter.format(numeric);
2853
+ } catch (e19) {
2055
2854
  return "--";
2056
2855
  }
2057
2856
  };
@@ -2060,20 +2859,20 @@ function SolanaTokenSelectStep({
2060
2859
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
2061
2860
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
2062
2861
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2063
- _chunk2TWQGPPBcjs.BodyHeader,
2862
+ _chunkDZNXG5JKcjs.BodyHeader,
2064
2863
  {
2065
- icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.WalletIcon, {}),
2864
+ icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDZNXG5JKcjs.WalletIcon, {}),
2066
2865
  title: "Your assets",
2067
2866
  subtitle: "Select source assets to transfer"
2068
2867
  }
2069
2868
  ),
2070
2869
  loading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
2071
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.Spinner, { className: "rs-text-tertiary" }),
2870
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDZNXG5JKcjs.Spinner, { className: "rs-text-tertiary" }),
2072
2871
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
2073
2872
  ] }),
2074
- error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.Callout, { variant: "error", children: error }),
2873
+ error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDZNXG5JKcjs.Callout, { variant: "error", children: error }),
2075
2874
  !loading && !error && rows.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-state", children: [
2076
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.WalletIcon, { className: "rs-empty-icon" }),
2875
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDZNXG5JKcjs.WalletIcon, { className: "rs-empty-icon" }),
2077
2876
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-empty-text", children: "No funds in connected wallet" }),
2078
2877
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-address", children: [
2079
2878
  solanaAddress.slice(0, 6),
@@ -2122,14 +2921,14 @@ function SolanaTokenSelectStep({
2122
2921
  ] })
2123
2922
  ] })
2124
2923
  ] }),
2125
- /* @__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}` : "--" })
2924
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: entry.balanceUsd > 0 ? _chunkDZNXG5JKcjs.currencyFormatter.format(entry.balanceUsd) : tokenAmount !== "--" ? `${tokenAmount} ${entry.token.symbol}` : "--" })
2126
2925
  ]
2127
2926
  },
2128
2927
  entry.token.symbol
2129
2928
  );
2130
2929
  }) }),
2131
2930
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2132
- _chunk2TWQGPPBcjs.Button,
2931
+ _chunkDZNXG5JKcjs.Button,
2133
2932
  {
2134
2933
  onClick: () => selectedEntry && onContinue(
2135
2934
  selectedEntry.token,
@@ -2142,7 +2941,7 @@ function SolanaTokenSelectStep({
2142
2941
  }
2143
2942
  )
2144
2943
  ] }),
2145
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.PoweredBy, {})
2944
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDZNXG5JKcjs.PoweredBy, {})
2146
2945
  ] });
2147
2946
  }
2148
2947
 
@@ -2174,7 +2973,7 @@ function SolanaAmountStep({
2174
2973
  const [error, setError] = _react.useState.call(void 0, null);
2175
2974
  const hasAppliedDefaultRef = _react.useRef.call(void 0, false);
2176
2975
  const isSourceStablecoin = _chunk7JIDIX27cjs.isStablecoinSymbol.call(void 0, token.symbol);
2177
- const isMaxDefault = _optionalChain([defaultAmount, 'optionalAccess', _76 => _76.trim, 'call', _77 => _77(), 'access', _78 => _78.toLowerCase, 'call', _79 => _79()]) === "max";
2976
+ const isMaxDefault = _optionalChain([defaultAmount, 'optionalAccess', _103 => _103.trim, 'call', _104 => _104(), 'access', _105 => _105.toLowerCase, 'call', _106 => _106()]) === "max";
2178
2977
  const tokenPriceUsd = _react.useMemo.call(void 0, () => {
2179
2978
  if (isSourceStablecoin) return 1;
2180
2979
  try {
@@ -2184,7 +2983,7 @@ function SolanaAmountStep({
2184
2983
  }
2185
2984
  const price = balanceUsd / balanceUnits;
2186
2985
  return price > 0 ? price : null;
2187
- } catch (e17) {
2986
+ } catch (e20) {
2188
2987
  return null;
2189
2988
  }
2190
2989
  }, [isSourceStablecoin, balance, token.decimals, balanceUsd]);
@@ -2194,8 +2993,8 @@ function SolanaAmountStep({
2194
2993
  const raw = _viem.formatUnits.call(void 0, balance, token.decimals);
2195
2994
  const numeric = Number(raw);
2196
2995
  if (!Number.isFinite(numeric)) return raw;
2197
- return _chunk2TWQGPPBcjs.tokenFormatter.format(numeric);
2198
- } catch (e18) {
2996
+ return _chunkDZNXG5JKcjs.tokenFormatter.format(numeric);
2997
+ } catch (e21) {
2199
2998
  return "\u2026";
2200
2999
  }
2201
3000
  }, [balance, token.decimals]);
@@ -2206,7 +3005,7 @@ function SolanaAmountStep({
2206
3005
  if (tokenPriceUsd !== null) return balanceUnits * tokenPriceUsd;
2207
3006
  if (Number.isFinite(balanceUsd) && balanceUsd > 0) return balanceUsd;
2208
3007
  return null;
2209
- } catch (e19) {
3008
+ } catch (e22) {
2210
3009
  return null;
2211
3010
  }
2212
3011
  }, [balance, token.decimals, tokenPriceUsd, balanceUsd]);
@@ -2220,7 +3019,7 @@ function SolanaAmountStep({
2220
3019
  if (!Number.isFinite(spendableUnits) || spendableUnits < 0) return null;
2221
3020
  if (tokenPriceUsd !== null) return spendableUnits * tokenPriceUsd;
2222
3021
  return null;
2223
- } catch (e20) {
3022
+ } catch (e23) {
2224
3023
  return null;
2225
3024
  }
2226
3025
  }, [spendableBalance, token.decimals, tokenPriceUsd]);
@@ -2235,7 +3034,7 @@ function SolanaAmountStep({
2235
3034
  const factor = 1e3;
2236
3035
  const truncated = Math.floor(value * factor) / factor;
2237
3036
  return truncated.toFixed(3).replace(/\.?0+$/, "");
2238
- } catch (e21) {
3037
+ } catch (e24) {
2239
3038
  return "";
2240
3039
  }
2241
3040
  },
@@ -2272,12 +3071,12 @@ function SolanaAmountStep({
2272
3071
  const raw = isSourceStablecoin || !hasPricing ? numericAmount : numericAmount / (_nullishCoalesce(tokenPriceUsd, () => ( 1)));
2273
3072
  try {
2274
3073
  return _viem.parseUnits.call(void 0, raw.toString(), token.decimals);
2275
- } catch (e22) {
3074
+ } catch (e25) {
2276
3075
  return null;
2277
3076
  }
2278
3077
  }, [numericAmount, isSourceStablecoin, hasPricing, tokenPriceUsd, token.decimals]);
2279
- const minDepositUsd = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _80 => _80.minDepositUsd]), () => ( null));
2280
- const maxDepositUsd = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _81 => _81.maxDepositUsd]), () => ( null));
3078
+ const minDepositUsd = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _107 => _107.minDepositUsd]), () => ( null));
3079
+ const maxDepositUsd = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _108 => _108.maxDepositUsd]), () => ( null));
2281
3080
  const isBelowMin = minDepositUsd !== null && numericAmount > 0 && numericAmount < minDepositUsd;
2282
3081
  const isAboveMax = maxDepositUsd !== null && numericAmount > maxDepositUsd;
2283
3082
  const exceedsBalance = Boolean(
@@ -2287,7 +3086,7 @@ function SolanaAmountStep({
2287
3086
  const handlePresetClick = (percentage) => {
2288
3087
  const formatted = computePresetAmount(percentage);
2289
3088
  if (!formatted) return;
2290
- _chunk2TWQGPPBcjs.debugLog.call(void 0, debug, "solana-amount", "amount:preset", {
3089
+ _chunkDZNXG5JKcjs.debugLog.call(void 0, debug, "solana-amount", "amount:preset", {
2291
3090
  percentage,
2292
3091
  symbol: token.symbol,
2293
3092
  formatted
@@ -2321,8 +3120,8 @@ function SolanaAmountStep({
2321
3120
  let amountInUnits;
2322
3121
  try {
2323
3122
  amountInUnits = _viem.parseUnits.call(void 0, sourceAmountStr, token.decimals);
2324
- } catch (e23) {
2325
- _chunk2TWQGPPBcjs.debugLog.call(void 0, debug, "solana-amount", "amount:invalid", {
3123
+ } catch (e26) {
3124
+ _chunkDZNXG5JKcjs.debugLog.call(void 0, debug, "solana-amount", "amount:invalid", {
2326
3125
  amount,
2327
3126
  sourceAmount: sourceAmountStr,
2328
3127
  reason: "parse-units-failed"
@@ -2337,7 +3136,7 @@ function SolanaAmountStep({
2337
3136
  );
2338
3137
  return;
2339
3138
  }
2340
- _chunk2TWQGPPBcjs.debugLog.call(void 0, debug, "solana-amount", "amount:continue", {
3139
+ _chunkDZNXG5JKcjs.debugLog.call(void 0, debug, "solana-amount", "amount:continue", {
2341
3140
  symbol: token.symbol,
2342
3141
  inputAmountUsd: amount,
2343
3142
  sourceAmount: sourceAmountStr,
@@ -2351,7 +3150,7 @@ function SolanaAmountStep({
2351
3150
  const sourceTokenIcon = _chunk7JIDIX27cjs.getTokenIcon.call(void 0, token.symbol);
2352
3151
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
2353
3152
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
2354
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.WalletIcon, {}), title: "Wallet deposit" }),
3153
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDZNXG5JKcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDZNXG5JKcjs.WalletIcon, {}), title: "Wallet deposit" }),
2355
3154
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-section", children: [
2356
3155
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-display", children: [
2357
3156
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
@@ -2371,13 +3170,13 @@ function SolanaAmountStep({
2371
3170
  " available",
2372
3171
  computedBalanceUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
2373
3172
  " (~",
2374
- _chunk2TWQGPPBcjs.currencyFormatter.format(computedBalanceUsd),
3173
+ _chunkDZNXG5JKcjs.currencyFormatter.format(computedBalanceUsd),
2375
3174
  ")"
2376
3175
  ] })
2377
3176
  ] }),
2378
3177
  minDepositUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-amount-meta-minimum", children: [
2379
3178
  "Min. deposit ",
2380
- _chunk2TWQGPPBcjs.currencyFormatter.format(minDepositUsd)
3179
+ _chunkDZNXG5JKcjs.currencyFormatter.format(minDepositUsd)
2381
3180
  ] })
2382
3181
  ] })
2383
3182
  ] }),
@@ -2416,12 +3215,12 @@ function SolanaAmountStep({
2416
3215
  ] }),
2417
3216
  balanceAfterUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
2418
3217
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Balance after deposit" }),
2419
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children: _chunk2TWQGPPBcjs.currencyFormatter.format(balanceAfterUsd) })
3218
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children: _chunkDZNXG5JKcjs.currencyFormatter.format(balanceAfterUsd) })
2420
3219
  ] })
2421
3220
  ] }),
2422
- error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.Callout, { variant: "error", children: error }),
3221
+ error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDZNXG5JKcjs.Callout, { variant: "error", children: error }),
2423
3222
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2424
- _chunk2TWQGPPBcjs.Button,
3223
+ _chunkDZNXG5JKcjs.Button,
2425
3224
  {
2426
3225
  onClick: handleContinue,
2427
3226
  fullWidth: true,
@@ -2430,7 +3229,7 @@ function SolanaAmountStep({
2430
3229
  }
2431
3230
  )
2432
3231
  ] }),
2433
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.PoweredBy, {})
3232
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDZNXG5JKcjs.PoweredBy, {})
2434
3233
  ] });
2435
3234
  }
2436
3235
 
@@ -2454,7 +3253,7 @@ var DEFAULT_SOLANA_RPC_URL = "https://api.mainnet.solana.com";
2454
3253
  var configuredSolanaRpcUrl = null;
2455
3254
  var cachedConnections = /* @__PURE__ */ new Map();
2456
3255
  function configureSolanaRpcUrl(rpcUrl) {
2457
- const normalized = _optionalChain([rpcUrl, 'optionalAccess', _82 => _82.trim, 'call', _83 => _83()]);
3256
+ const normalized = _optionalChain([rpcUrl, 'optionalAccess', _109 => _109.trim, 'call', _110 => _110()]);
2458
3257
  configuredSolanaRpcUrl = normalized ? normalized : null;
2459
3258
  cachedConnections.clear();
2460
3259
  }
@@ -2574,8 +3373,8 @@ function SolanaConfirmStep({
2574
3373
  const targetChainIcon = _chunk7JIDIX27cjs.getChainIcon.call(void 0, targetChain);
2575
3374
  const sourceTokenIcon = _chunk7JIDIX27cjs.getTokenIcon.call(void 0, token.symbol);
2576
3375
  const targetTokenIcon = _chunk7JIDIX27cjs.getTokenIcon.call(void 0, targetSymbol);
2577
- const feeSponsored = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _84 => _84.feeSponsored]), () => ( false));
2578
- const feeTooltip = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _85 => _85.feeTooltip]), () => ( (feeSponsored ? "Network fees are sponsored for this deposit." : "Network fees apply.")));
3376
+ const feeSponsored = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _111 => _111.feeSponsored]), () => ( false));
3377
+ const feeTooltip = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _112 => _112.feeTooltip]), () => ( (feeSponsored ? "Network fees are sponsored for this deposit." : "Network fees apply.")));
2579
3378
  const formattedAmount = sourceAmount && !Number.isNaN(Number(sourceAmount)) ? Number(sourceAmount).toLocaleString("en-US", {
2580
3379
  minimumFractionDigits: 2,
2581
3380
  maximumFractionDigits: 6
@@ -2597,7 +3396,7 @@ function SolanaConfirmStep({
2597
3396
  const receiveAmount = isSameToken ? formattedReceiveAmount : `~${formattedReceiveAmount}`;
2598
3397
  const handleConfirm = async () => {
2599
3398
  if (!solanaProvider) {
2600
- _chunk2TWQGPPBcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:blocked", {
3399
+ _chunkDZNXG5JKcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:blocked", {
2601
3400
  reason: "missing-provider"
2602
3401
  });
2603
3402
  setError("Solana wallet not connected");
@@ -2605,7 +3404,7 @@ function SolanaConfirmStep({
2605
3404
  }
2606
3405
  const parsedAmount = parseFloat(sourceAmount);
2607
3406
  if (isNaN(parsedAmount) || parsedAmount <= 0) {
2608
- _chunk2TWQGPPBcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:blocked", {
3407
+ _chunkDZNXG5JKcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:blocked", {
2609
3408
  reason: "invalid-amount",
2610
3409
  sourceAmount
2611
3410
  });
@@ -2614,7 +3413,7 @@ function SolanaConfirmStep({
2614
3413
  }
2615
3414
  setError(null);
2616
3415
  setIsSubmitting(true);
2617
- _chunk2TWQGPPBcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:start", {
3416
+ _chunkDZNXG5JKcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:start", {
2618
3417
  smartAccount,
2619
3418
  solanaAddress,
2620
3419
  solanaDepositAddress,
@@ -2624,7 +3423,7 @@ function SolanaConfirmStep({
2624
3423
  });
2625
3424
  try {
2626
3425
  const check = await service.checkAccount(smartAccount);
2627
- _chunk2TWQGPPBcjs.debugLog.call(void 0, debug, "solana-confirm", "check:success", {
3426
+ _chunkDZNXG5JKcjs.debugLog.call(void 0, debug, "solana-confirm", "check:success", {
2628
3427
  smartAccount,
2629
3428
  isRegistered: check.isRegistered,
2630
3429
  targetChain: check.targetChain,
@@ -2637,7 +3436,7 @@ function SolanaConfirmStep({
2637
3436
  }
2638
3437
  const connection = hasConfiguredSolanaRpcUrl() ? getSolanaConnection() : _nullishCoalesce(solanaConnection, () => ( getSolanaConnection()));
2639
3438
  const amountUnits = _viem.parseUnits.call(void 0, sourceAmount, token.decimals);
2640
- _chunk2TWQGPPBcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:start", {
3439
+ _chunkDZNXG5JKcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:start", {
2641
3440
  token: token.symbol,
2642
3441
  sourceAmount,
2643
3442
  amountUnits: amountUnits.toString()
@@ -2654,10 +3453,10 @@ function SolanaConfirmStep({
2654
3453
  token.mint,
2655
3454
  amountUnits
2656
3455
  );
2657
- _chunk2TWQGPPBcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:success", {
3456
+ _chunkDZNXG5JKcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:success", {
2658
3457
  token: token.symbol,
2659
3458
  instructionCount: transaction.instructions.length,
2660
- feePayer: _optionalChain([transaction, 'access', _86 => _86.feePayer, 'optionalAccess', _87 => _87.toBase58, 'call', _88 => _88()]),
3459
+ feePayer: _optionalChain([transaction, 'access', _113 => _113.feePayer, 'optionalAccess', _114 => _114.toBase58, 'call', _115 => _115()]),
2661
3460
  recentBlockhash: transaction.recentBlockhash
2662
3461
  });
2663
3462
  const txHash = await sendSolanaTransaction(
@@ -2665,28 +3464,28 @@ function SolanaConfirmStep({
2665
3464
  connection,
2666
3465
  transaction
2667
3466
  );
2668
- _chunk2TWQGPPBcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:sent", {
3467
+ _chunkDZNXG5JKcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:sent", {
2669
3468
  txHash,
2670
3469
  amountUnits: amountUnits.toString()
2671
3470
  });
2672
3471
  onConfirm(txHash, amountUnits.toString());
2673
3472
  } catch (err) {
2674
3473
  const raw = err instanceof Error ? err.message : "Transfer failed";
2675
- const message = _chunk2TWQGPPBcjs.formatUserError.call(void 0, raw);
2676
- _chunk2TWQGPPBcjs.debugError.call(void 0, debug, "solana-confirm", "submit:failure", err, {
3474
+ const message = _chunkDZNXG5JKcjs.formatUserError.call(void 0, raw);
3475
+ _chunkDZNXG5JKcjs.debugError.call(void 0, debug, "solana-confirm", "submit:failure", err, {
2677
3476
  smartAccount,
2678
3477
  token: token.symbol,
2679
3478
  sourceAmount
2680
3479
  });
2681
3480
  setError(message);
2682
- _optionalChain([onError, 'optionalCall', _89 => _89(message, "SOLANA_TRANSFER_ERROR")]);
3481
+ _optionalChain([onError, 'optionalCall', _116 => _116(message, "SOLANA_TRANSFER_ERROR")]);
2683
3482
  } finally {
2684
3483
  setIsSubmitting(false);
2685
3484
  }
2686
3485
  };
2687
3486
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
2688
3487
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
2689
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.WalletIcon, {}), title: "Review deposit" }),
3488
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDZNXG5JKcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDZNXG5JKcjs.WalletIcon, {}), title: "Review deposit" }),
2690
3489
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-details", children: [
2691
3490
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
2692
3491
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Source chain" }),
@@ -2738,13 +3537,13 @@ function SolanaConfirmStep({
2738
3537
  children: "$0.04"
2739
3538
  }
2740
3539
  ),
2741
- /* @__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, {}) }) })
3540
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDZNXG5JKcjs.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, _chunkDZNXG5JKcjs.InfoIcon, {}) }) })
2742
3541
  ] })
2743
3542
  ] })
2744
3543
  ] }),
2745
- error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.Callout, { variant: "error", children: error }),
3544
+ error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDZNXG5JKcjs.Callout, { variant: "error", children: error }),
2746
3545
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2747
- _chunk2TWQGPPBcjs.Button,
3546
+ _chunkDZNXG5JKcjs.Button,
2748
3547
  {
2749
3548
  onClick: handleConfirm,
2750
3549
  loading: isSubmitting,
@@ -2755,7 +3554,7 @@ function SolanaConfirmStep({
2755
3554
  }
2756
3555
  )
2757
3556
  ] }),
2758
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.PoweredBy, {})
3557
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDZNXG5JKcjs.PoweredBy, {})
2759
3558
  ] });
2760
3559
  }
2761
3560
 
@@ -2769,18 +3568,18 @@ function DappImportAssetSelectStep({
2769
3568
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
2770
3569
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
2771
3570
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2772
- _chunk2TWQGPPBcjs.BodyHeader,
3571
+ _chunkDZNXG5JKcjs.BodyHeader,
2773
3572
  {
2774
- icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.WalletIcon, {}),
3573
+ icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDZNXG5JKcjs.WalletIcon, {}),
2775
3574
  title: `Transfer from ${sourceLabel}`,
2776
3575
  subtitle: "Pick the balance to import"
2777
3576
  }
2778
3577
  ),
2779
3578
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-list", children: assets.map((asset) => {
2780
- const tokenAmount = asset.balance ? _chunk2TWQGPPBcjs.tokenFormatter.format(
3579
+ const tokenAmount = asset.balance ? _chunkDZNXG5JKcjs.tokenFormatter.format(
2781
3580
  Number(asset.balance) / 10 ** asset.decimals
2782
3581
  ) : "0";
2783
- const balanceUsd = asset.balanceUsd && asset.balanceUsd > 0 ? _chunk2TWQGPPBcjs.currencyFormatter.format(asset.balanceUsd) : `${tokenAmount} ${asset.symbol}`;
3582
+ const balanceUsd = asset.balanceUsd && asset.balanceUsd > 0 ? _chunkDZNXG5JKcjs.currencyFormatter.format(asset.balanceUsd) : `${tokenAmount} ${asset.symbol}`;
2784
3583
  const tokenIcon = _nullishCoalesce(asset.icon, () => ( _chunk7JIDIX27cjs.getTokenIcon.call(void 0, asset.symbol)));
2785
3584
  const chainIcon = _chunk7JIDIX27cjs.getChainIcon.call(void 0, asset.chainId);
2786
3585
  const badge = _chunk7JIDIX27cjs.getChainBadge.call(void 0, asset.chainId);
@@ -2831,7 +3630,7 @@ function DappImportAssetSelectStep({
2831
3630
  );
2832
3631
  }) })
2833
3632
  ] }),
2834
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.PoweredBy, {})
3633
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDZNXG5JKcjs.PoweredBy, {})
2835
3634
  ] });
2836
3635
  }
2837
3636
  DappImportAssetSelectStep.displayName = "DappImportAssetSelectStep";
@@ -2897,7 +3696,7 @@ async function detectPolymarketWalletKind(params) {
2897
3696
  contracts: [
2898
3697
  {
2899
3698
  address: proxyWallet,
2900
- abi: _chunk2TWQGPPBcjs.SAFE_ABI,
3699
+ abi: _chunkDZNXG5JKcjs.SAFE_ABI,
2901
3700
  functionName: "isOwner",
2902
3701
  args: [eoa]
2903
3702
  },
@@ -3022,7 +3821,7 @@ async function fetchPolymarketProxyWallet(eoa, signal) {
3022
3821
  let response;
3023
3822
  try {
3024
3823
  response = await fetch(url, { signal });
3025
- } catch (e24) {
3824
+ } catch (e27) {
3026
3825
  return null;
3027
3826
  }
3028
3827
  if (!response.ok) {
@@ -3031,7 +3830,7 @@ async function fetchPolymarketProxyWallet(eoa, signal) {
3031
3830
  let payload;
3032
3831
  try {
3033
3832
  payload = await response.json();
3034
- } catch (e25) {
3833
+ } catch (e28) {
3035
3834
  return null;
3036
3835
  }
3037
3836
  const raw = payload.proxyWallet;
@@ -3085,7 +3884,7 @@ async function readPolymarketBalances(params) {
3085
3884
  pusd: results[0].status === "success" ? results[0].result : 0n,
3086
3885
  usdce: results[1].status === "success" ? results[1].result : 0n
3087
3886
  };
3088
- } catch (e26) {
3887
+ } catch (e29) {
3089
3888
  return { pusd: 0n, usdce: 0n };
3090
3889
  }
3091
3890
  }
@@ -3108,7 +3907,7 @@ async function executePolymarketSafeTransfer(params) {
3108
3907
  }
3109
3908
  const isOwner = await publicClient.readContract({
3110
3909
  address: safeAddress,
3111
- abi: _chunk2TWQGPPBcjs.SAFE_ABI,
3910
+ abi: _chunkDZNXG5JKcjs.SAFE_ABI,
3112
3911
  functionName: "isOwner",
3113
3912
  args: [account.address]
3114
3913
  });
@@ -3125,7 +3924,7 @@ async function executePolymarketSafeTransfer(params) {
3125
3924
  account,
3126
3925
  chain,
3127
3926
  address: safeAddress,
3128
- abi: _chunk2TWQGPPBcjs.SAFE_ABI,
3927
+ abi: _chunkDZNXG5JKcjs.SAFE_ABI,
3129
3928
  functionName: "execTransaction",
3130
3929
  args: [
3131
3930
  safeTx.to,
@@ -3144,7 +3943,7 @@ async function executePolymarketSafeTransfer(params) {
3144
3943
  hash: txHash
3145
3944
  });
3146
3945
  const parsed = _viem.parseEventLogs.call(void 0, {
3147
- abi: _chunk2TWQGPPBcjs.SAFE_ABI,
3946
+ abi: _chunkDZNXG5JKcjs.SAFE_ABI,
3148
3947
  logs: receipt.logs.filter(
3149
3948
  (log) => log.address.toLowerCase() === safeAddress.toLowerCase()
3150
3949
  ),
@@ -3222,21 +4021,21 @@ var polymarketProvider = {
3222
4021
  async fetchAvailability({ eoa, getPublicClient: getPublicClient2, signal }) {
3223
4022
  const proxyWallet = await fetchPolymarketProxyWallet(eoa, signal);
3224
4023
  if (!proxyWallet) return null;
3225
- if (_optionalChain([signal, 'optionalAccess', _90 => _90.aborted])) return null;
4024
+ if (_optionalChain([signal, 'optionalAccess', _117 => _117.aborted])) return null;
3226
4025
  const polygonClient = getPublicClient2(POLYMARKET_POLYGON_CHAIN_ID);
3227
4026
  if (!polygonClient) return null;
3228
4027
  const balances = await readPolymarketBalances({
3229
4028
  publicClient: polygonClient,
3230
4029
  proxyWallet
3231
4030
  });
3232
- if (_optionalChain([signal, 'optionalAccess', _91 => _91.aborted])) return null;
4031
+ if (_optionalChain([signal, 'optionalAccess', _118 => _118.aborted])) return null;
3233
4032
  if (balances.pusd === 0n && balances.usdce === 0n) return null;
3234
4033
  const walletKind = await detectPolymarketWalletKind({
3235
4034
  publicClient: polygonClient,
3236
4035
  proxyWallet,
3237
4036
  eoa
3238
4037
  });
3239
- if (_optionalChain([signal, 'optionalAccess', _92 => _92.aborted])) return null;
4038
+ if (_optionalChain([signal, 'optionalAccess', _119 => _119.aborted])) return null;
3240
4039
  if (!walletKind) return null;
3241
4040
  const assets = [];
3242
4041
  if (balances.pusd > 0n) {
@@ -3400,6 +4199,7 @@ function applyBack(state, hasWalletOptions) {
3400
4199
  targetAmount: null,
3401
4200
  targetTokenPriceUsd: null,
3402
4201
  balance: null,
4202
+ inputAmountUsd: null,
3403
4203
  liquidityWarning: null
3404
4204
  },
3405
4205
  flow: {
@@ -3445,8 +4245,19 @@ function applyBack(state, hasWalletOptions) {
3445
4245
  },
3446
4246
  flow: { ...state.flow, step: "solana-amount", hasNavigatedBack: true }
3447
4247
  };
4248
+ case "exchange-connect":
4249
+ return {
4250
+ ...state,
4251
+ flow: {
4252
+ ...state.flow,
4253
+ step: "exchange-select",
4254
+ hasNavigatedBack: true
4255
+ }
4256
+ };
3448
4257
  case "select-asset":
3449
4258
  case "deposit-address":
4259
+ case "fiat-onramp":
4260
+ case "exchange-select":
3450
4261
  case "solana-token-select":
3451
4262
  case "dapp-import-asset-select":
3452
4263
  return {
@@ -3463,7 +4274,8 @@ function applyBack(state, hasWalletOptions) {
3463
4274
  ...state.dappImport,
3464
4275
  activeProviderId: null,
3465
4276
  selectedAsset: null
3466
- }
4277
+ },
4278
+ exchange: { selectedConnection: null }
3467
4279
  };
3468
4280
  case "connect":
3469
4281
  case "setup":
@@ -3476,7 +4288,8 @@ function applyBack(state, hasWalletOptions) {
3476
4288
  mode: null,
3477
4289
  isConnectSelectionConfirmed: false,
3478
4290
  hasNavigatedBack: hasWalletOptions || state.flow.hasNavigatedBack
3479
- }
4291
+ },
4292
+ exchange: { selectedConnection: null }
3480
4293
  };
3481
4294
  }
3482
4295
  return state;
@@ -3496,6 +4309,10 @@ function modeEntryStep(mode) {
3496
4309
  return "solana-token-select";
3497
4310
  case "dapp-import":
3498
4311
  return "dapp-import-asset-select";
4312
+ case "fiat-onramp":
4313
+ return "fiat-onramp";
4314
+ case "exchange-connect":
4315
+ return "exchange-select";
3499
4316
  }
3500
4317
  }
3501
4318
  function updateSetupEntry(state, owner, update) {
@@ -3541,7 +4358,8 @@ function applyAction(state, action) {
3541
4358
  ...state.dappImport,
3542
4359
  activeProviderId: null,
3543
4360
  selectedAsset: null
3544
- }
4361
+ },
4362
+ exchange: { selectedConnection: null }
3545
4363
  };
3546
4364
  case "connect/wallet-confirmed":
3547
4365
  if (!action.mode) return state;
@@ -3565,6 +4383,39 @@ function applyAction(state, action) {
3565
4383
  step: "deposit-address"
3566
4384
  }
3567
4385
  };
4386
+ case "connect/fiat-onramp-selected":
4387
+ return {
4388
+ ...state,
4389
+ flow: {
4390
+ ...state.flow,
4391
+ mode: "fiat-onramp",
4392
+ isConnectSelectionConfirmed: true,
4393
+ step: modeEntryStep("fiat-onramp")
4394
+ },
4395
+ fiat: { ...state.fiat, selectedMethod: _nullishCoalesce(action.paymentMethod, () => ( null)) }
4396
+ };
4397
+ case "connect/exchange-selected":
4398
+ return {
4399
+ ...state,
4400
+ flow: {
4401
+ ...state.flow,
4402
+ mode: "exchange-connect",
4403
+ isConnectSelectionConfirmed: true,
4404
+ step: modeEntryStep("exchange-connect")
4405
+ },
4406
+ exchange: { selectedConnection: null }
4407
+ };
4408
+ case "exchange/connection-selected":
4409
+ return {
4410
+ ...state,
4411
+ flow: {
4412
+ ...state.flow,
4413
+ mode: "exchange-connect",
4414
+ isConnectSelectionConfirmed: true,
4415
+ step: "exchange-connect"
4416
+ },
4417
+ exchange: { selectedConnection: action.connection }
4418
+ };
3568
4419
  case "connect/auto-locked":
3569
4420
  return {
3570
4421
  ...state,
@@ -3590,7 +4441,8 @@ function applyAction(state, action) {
3590
4441
  ...state.dappImport,
3591
4442
  activeProviderId: null,
3592
4443
  selectedAsset: null
3593
- }
4444
+ },
4445
+ exchange: { selectedConnection: null }
3594
4446
  };
3595
4447
  case "setup/started": {
3596
4448
  const existing = state.setup.byOwner[ownerKey(action.owner)];
@@ -3599,12 +4451,12 @@ function applyAction(state, action) {
3599
4451
  requestKey: action.requestKey,
3600
4452
  cacheKey: action.cacheKey,
3601
4453
  status: "loading",
3602
- smartAccount: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _93 => _93.smartAccount]), () => ( null)),
3603
- sessionOwnerAddress: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _94 => _94.sessionOwnerAddress]), () => ( null)),
3604
- solanaDepositAddress: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _95 => _95.solanaDepositAddress]), () => ( null)),
4454
+ smartAccount: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _120 => _120.smartAccount]), () => ( null)),
4455
+ sessionOwnerAddress: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _121 => _121.sessionOwnerAddress]), () => ( null)),
4456
+ solanaDepositAddress: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _122 => _122.solanaDepositAddress]), () => ( null)),
3605
4457
  message: null,
3606
4458
  cacheable: action.cacheable,
3607
- attemptNonce: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _96 => _96.attemptNonce]), () => ( 0))
4459
+ attemptNonce: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _123 => _123.attemptNonce]), () => ( 0))
3608
4460
  }));
3609
4461
  }
3610
4462
  case "setup/ready": {
@@ -3655,7 +4507,11 @@ function applyAction(state, action) {
3655
4507
  selectedAsset: action.asset,
3656
4508
  // Seed the user-facing amount input with the modal's defaultAmount
3657
4509
  // on first visit. Subsequent visits override via amount/entered.
3658
- amount: _nullishCoalesce(action.seedAmount, () => ( state.deposit.amount))
4510
+ // `inputAmountUsd` is the USD-style value the input shows; it (not
4511
+ // the native `amount`) is what re-seeds the input on back, so seed
4512
+ // it here too and reset it on a fresh pick.
4513
+ amount: _nullishCoalesce(action.seedAmount, () => ( state.deposit.amount)),
4514
+ inputAmountUsd: _nullishCoalesce(action.seedAmount, () => ( null))
3659
4515
  },
3660
4516
  flow: { ...state.flow, step: "amount" }
3661
4517
  };
@@ -3668,6 +4524,11 @@ function applyAction(state, action) {
3668
4524
  targetAmount: action.targetAmount,
3669
4525
  targetTokenPriceUsd: action.targetTokenPriceUsd,
3670
4526
  balance: _nullishCoalesce(action.balance, () => ( null)),
4527
+ // `targetAmount` is the USD-style value the user typed. Preserve it
4528
+ // as `inputAmountUsd` so back-from-confirm re-seeds the input with
4529
+ // the typed USD value rather than the converted native `amount`
4530
+ // (which corrupts the input for non-stablecoin priced tokens).
4531
+ inputAmountUsd: action.targetAmount,
3671
4532
  liquidityWarning: _nullishCoalesce(action.liquidityWarning, () => ( null))
3672
4533
  },
3673
4534
  flow: { ...state.flow, step: "confirm" }
@@ -3816,7 +4677,9 @@ function applyAction(state, action) {
3816
4677
  activeProviderId: null,
3817
4678
  selectedAsset: null
3818
4679
  },
3819
- setup: { byOwner: preservedByOwner }
4680
+ setup: { byOwner: preservedByOwner },
4681
+ fiat: { selectedMethod: null },
4682
+ exchange: { selectedConnection: null }
3820
4683
  };
3821
4684
  }
3822
4685
  case "target/changed": {
@@ -3890,6 +4753,12 @@ function createInitialState(overrides) {
3890
4753
  },
3891
4754
  setup: {
3892
4755
  byOwner: {}
4756
+ },
4757
+ fiat: {
4758
+ selectedMethod: null
4759
+ },
4760
+ exchange: {
4761
+ selectedConnection: null
3893
4762
  }
3894
4763
  };
3895
4764
  }
@@ -3958,15 +4827,15 @@ var SetupError = class extends Error {
3958
4827
  }
3959
4828
  };
3960
4829
  async function resolveSessionOwner(eoaAddress) {
3961
- const local = _chunk2TWQGPPBcjs.loadSessionOwnerFromStorage.call(void 0, eoaAddress);
4830
+ const local = _chunkDZNXG5JKcjs.loadSessionOwnerFromStorage.call(void 0, eoaAddress);
3962
4831
  if (local) {
3963
4832
  return {
3964
- account: _chunk2TWQGPPBcjs.accountFromPrivateKey.call(void 0, local.privateKey),
4833
+ account: _chunkDZNXG5JKcjs.accountFromPrivateKey.call(void 0, local.privateKey),
3965
4834
  address: local.address
3966
4835
  };
3967
4836
  }
3968
- const created = _chunk2TWQGPPBcjs.createSessionOwnerKey.call(void 0, );
3969
- _chunk2TWQGPPBcjs.saveSessionOwnerToStorage.call(void 0, eoaAddress, created.privateKey, created.address);
4837
+ const created = _chunkDZNXG5JKcjs.createSessionOwnerKey.call(void 0, );
4838
+ _chunkDZNXG5JKcjs.saveSessionOwnerToStorage.call(void 0, eoaAddress, created.privateKey, created.address);
3970
4839
  return { account: created.account, address: created.address };
3971
4840
  }
3972
4841
  function stableStringify(value) {
@@ -4016,14 +4885,14 @@ function computeCacheKey(input, sessionOwnerAddress) {
4016
4885
  });
4017
4886
  }
4018
4887
  function computeIsCacheable(input) {
4019
- return !input.forceRegister && !(_nullishCoalesce(_optionalChain([input, 'access', _97 => _97.postBridgeActions, 'optionalAccess', _98 => _98.length]), () => ( 0)));
4888
+ return !input.forceRegister && !(_nullishCoalesce(_optionalChain([input, 'access', _124 => _124.postBridgeActions, 'optionalAccess', _125 => _125.length]), () => ( 0)));
4020
4889
  }
4021
4890
  var SETUP_REQUEST_DEDUPE_TTL_MS = 3e4;
4022
4891
  var setupRequestDedupe = /* @__PURE__ */ new Map();
4023
4892
  function readDedupedAccountSetupResult(requestKey) {
4024
4893
  const now = Date.now();
4025
4894
  const existing = setupRequestDedupe.get(requestKey);
4026
- if (_optionalChain([existing, 'optionalAccess', _99 => _99.settled]) && existing.expiresAt > now && existing.result) {
4895
+ if (_optionalChain([existing, 'optionalAccess', _126 => _126.settled]) && existing.expiresAt > now && existing.result) {
4027
4896
  return existing.result;
4028
4897
  }
4029
4898
  return null;
@@ -4034,16 +4903,16 @@ async function runAccountSetup(input, deps) {
4034
4903
  try {
4035
4904
  const sessionOwner = await resolveSessionOwner(input.ownerAddress);
4036
4905
  const cacheKey = computeCacheKey(input, sessionOwner.address);
4037
- _chunk2TWQGPPBcjs.debugLog.call(void 0, debug, "account-setup", "setup:start", {
4906
+ _chunkDZNXG5JKcjs.debugLog.call(void 0, debug, "account-setup", "setup:start", {
4038
4907
  owner: input.ownerAddress,
4039
4908
  sessionOwner: sessionOwner.address,
4040
- hasPostBridgeActions: Boolean(_optionalChain([input, 'access', _100 => _100.postBridgeActions, 'optionalAccess', _101 => _101.length])),
4909
+ hasPostBridgeActions: Boolean(_optionalChain([input, 'access', _127 => _127.postBridgeActions, 'optionalAccess', _128 => _128.length])),
4041
4910
  forceRegister: _nullishCoalesce(input.forceRegister, () => ( false))
4042
4911
  });
4043
4912
  const setup = await service.setupAccount({
4044
4913
  ownerAddress: input.ownerAddress,
4045
4914
  sessionOwnerAddress: sessionOwner.address,
4046
- targetChain: _chunk2TWQGPPBcjs.targetChainToCaip2.call(void 0, input.targetChain),
4915
+ targetChain: _chunkDZNXG5JKcjs.targetChainToCaip2.call(void 0, input.targetChain),
4047
4916
  targetToken: input.targetToken,
4048
4917
  recipient: input.recipient,
4049
4918
  postBridgeActions: input.postBridgeActions,
@@ -4082,7 +4951,7 @@ async function runAccountSetup(input, deps) {
4082
4951
  primaryType: typedData.primaryType,
4083
4952
  message: typedData.message
4084
4953
  });
4085
- const sessionDetails = _chunk2TWQGPPBcjs.buildSessionDetails.call(void 0,
4954
+ const sessionDetails = _chunkDZNXG5JKcjs.buildSessionDetails.call(void 0,
4086
4955
  setup.sessionDetailsUnsigned,
4087
4956
  signature
4088
4957
  );
@@ -4096,13 +4965,13 @@ async function runAccountSetup(input, deps) {
4096
4965
  eoaAddress: input.ownerAddress,
4097
4966
  sessionOwner: sessionOwner.address,
4098
4967
  target: {
4099
- chain: _chunk2TWQGPPBcjs.targetChainToCaip2.call(void 0, input.targetChain),
4968
+ chain: _chunkDZNXG5JKcjs.targetChainToCaip2.call(void 0, input.targetChain),
4100
4969
  token: input.targetToken,
4101
4970
  ...input.recipient && { recipient: input.recipient },
4102
- ..._optionalChain([input, 'access', _102 => _102.postBridgeActions, 'optionalAccess', _103 => _103.length]) && {
4971
+ ..._optionalChain([input, 'access', _129 => _129.postBridgeActions, 'optionalAccess', _130 => _130.length]) && {
4103
4972
  postBridgeActions: input.postBridgeActions
4104
4973
  },
4105
- ..._optionalChain([input, 'access', _104 => _104.outputTokenRules, 'optionalAccess', _105 => _105.length]) && {
4974
+ ..._optionalChain([input, 'access', _131 => _131.outputTokenRules, 'optionalAccess', _132 => _132.length]) && {
4106
4975
  outputTokenRules: input.outputTokenRules
4107
4976
  },
4108
4977
  ...input.rejectUnmapped != null && {
@@ -4118,7 +4987,7 @@ async function runAccountSetup(input, deps) {
4118
4987
  isRegistered: true
4119
4988
  };
4120
4989
  } catch (error) {
4121
- _chunk2TWQGPPBcjs.debugError.call(void 0, debug, "account-setup", "setup:failed", error, {
4990
+ _chunkDZNXG5JKcjs.debugError.call(void 0, debug, "account-setup", "setup:failed", error, {
4122
4991
  owner: input.ownerAddress
4123
4992
  });
4124
4993
  if (error instanceof SetupError) throw error;
@@ -4129,7 +4998,7 @@ function runAccountSetupDeduped(input, deps, requestKey) {
4129
4998
  const now = Date.now();
4130
4999
  const existing = setupRequestDedupe.get(requestKey);
4131
5000
  if (existing && (!existing.settled || existing.expiresAt > now)) {
4132
- _chunk2TWQGPPBcjs.debugLog.call(void 0, deps.debug, "account-setup", "setup:dedupe-hit", {
5001
+ _chunkDZNXG5JKcjs.debugLog.call(void 0, deps.debug, "account-setup", "setup:dedupe-hit", {
4133
5002
  owner: input.ownerAddress,
4134
5003
  forceRegister: _nullishCoalesce(input.forceRegister, () => ( false))
4135
5004
  });
@@ -4217,10 +5086,12 @@ var QR_AUTO_ADVANCE_HYDRATION_GRACE_MS = 1e3;
4217
5086
  function isSameRoute2(sourceChain, sourceToken, targetChain, targetToken) {
4218
5087
  return sourceChain === targetChain && sourceToken.toLowerCase() === targetToken.toLowerCase();
4219
5088
  }
5089
+ var SWAPPED_SOURCE_CHAIN = 8453;
5090
+ var SWAPPED_SOURCE_TOKEN = "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913";
4220
5091
  function getAddressKey(address) {
4221
5092
  return address ? address.toLowerCase() : null;
4222
5093
  }
4223
- function deriveStep(flow, d, p, activeEntry) {
5094
+ function deriveStep(flow, d, p, activeEntry, fiat, exchange) {
4224
5095
  const flowStep = flow.step;
4225
5096
  const smartAccount = activeEntry.smartAccount;
4226
5097
  const solanaDepositAddress = activeEntry.solanaDepositAddress;
@@ -4235,6 +5106,23 @@ function deriveStep(flow, d, p, activeEntry) {
4235
5106
  smartAccount,
4236
5107
  solanaDepositAddress: _nullishCoalesce(solanaDepositAddress, () => ( void 0))
4237
5108
  };
5109
+ case "fiat-onramp":
5110
+ if (!smartAccount) return { type: "setup" };
5111
+ return {
5112
+ type: "fiat-onramp",
5113
+ smartAccount,
5114
+ paymentMethod: _nullishCoalesce(fiat.selectedMethod, () => ( void 0))
5115
+ };
5116
+ case "exchange-select":
5117
+ return { type: "exchange-select" };
5118
+ case "exchange-connect":
5119
+ if (!exchange.selectedConnection) return { type: "exchange-select" };
5120
+ if (!smartAccount) return { type: "setup" };
5121
+ return {
5122
+ type: "exchange-connect",
5123
+ smartAccount,
5124
+ connection: exchange.selectedConnection
5125
+ };
4238
5126
  case "select-asset":
4239
5127
  if (!smartAccount) return { type: "setup" };
4240
5128
  return { type: "select-asset", smartAccount };
@@ -4244,7 +5132,9 @@ function deriveStep(flow, d, p, activeEntry) {
4244
5132
  type: "amount",
4245
5133
  smartAccount,
4246
5134
  asset: d.selectedAsset,
4247
- amount: _nullishCoalesce(d.amount, () => ( void 0))
5135
+ // Seed the input from the USD-style value the user typed, not the
5136
+ // native source `amount` (which would corrupt the input on back).
5137
+ inputAmountUsd: _nullishCoalesce(d.inputAmountUsd, () => ( void 0))
4248
5138
  };
4249
5139
  case "confirm":
4250
5140
  if (!smartAccount || !d.selectedAsset || !d.amount || !d.targetAmount) {
@@ -4321,6 +5211,8 @@ function resolveOwnerForMode(mode, ctx) {
4321
5211
  switch (mode) {
4322
5212
  case "deposit-address":
4323
5213
  case "solana-wallet":
5214
+ case "fiat-onramp":
5215
+ case "exchange-connect":
4324
5216
  return _nullishCoalesce(ctx.dappAddress, () => ( null));
4325
5217
  case "wallet":
4326
5218
  return _nullishCoalesce(ctx.walletOwner, () => ( null));
@@ -4351,6 +5243,10 @@ function DepositFlow({
4351
5243
  forceRegister = false,
4352
5244
  enableSolana = true,
4353
5245
  dappImports,
5246
+ enableFiatOnramp = false,
5247
+ enableQrTransfer = true,
5248
+ fiatOnrampMethods,
5249
+ enableExchangeConnect = false,
4354
5250
  reownWallet,
4355
5251
  onConnect,
4356
5252
  onDisconnect,
@@ -4364,12 +5260,12 @@ function DepositFlow({
4364
5260
  onError,
4365
5261
  debug
4366
5262
  }) {
4367
- const onStepChangeRef = _chunk2TWQGPPBcjs.useLatestRef.call(void 0, onStepChange);
4368
- const onEventRef = _chunk2TWQGPPBcjs.useLatestRef.call(void 0, onEvent);
4369
- const onLifecycleRef = _chunk2TWQGPPBcjs.useLatestRef.call(void 0, onLifecycle);
4370
- const onErrorRef = _chunk2TWQGPPBcjs.useLatestRef.call(void 0, onError);
5263
+ const onStepChangeRef = _chunkDZNXG5JKcjs.useLatestRef.call(void 0, onStepChange);
5264
+ const onEventRef = _chunkDZNXG5JKcjs.useLatestRef.call(void 0, onEvent);
5265
+ const onLifecycleRef = _chunkDZNXG5JKcjs.useLatestRef.call(void 0, onLifecycle);
5266
+ const onErrorRef = _chunkDZNXG5JKcjs.useLatestRef.call(void 0, onError);
4371
5267
  const hasInitialReownSession = Boolean(
4372
- enableSolana ? _optionalChain([reownWallet, 'optionalAccess', _106 => _106.isConnected]) || _optionalChain([reownWallet, 'optionalAccess', _107 => _107.address]) : _optionalChain([reownWallet, 'optionalAccess', _108 => _108.address])
5268
+ enableSolana ? _optionalChain([reownWallet, 'optionalAccess', _133 => _133.isConnected]) || _optionalChain([reownWallet, 'optionalAccess', _134 => _134.address]) : _optionalChain([reownWallet, 'optionalAccess', _135 => _135.address])
4373
5269
  );
4374
5270
  const hasInitialWalletHydrationPending = Boolean(
4375
5271
  dappAddress && (hasDappWalletClientProp && dappWalletClient === void 0 || reownWallet && !hasInitialReownSession && !reownWallet.isReady)
@@ -4379,6 +5275,8 @@ function DepositFlow({
4379
5275
  const depositSlice = useDepositStore((s) => s.deposit);
4380
5276
  const processingSlice = useDepositStore((s) => s.processing);
4381
5277
  const setupSlice = useDepositStore((s) => s.setup);
5278
+ const fiatSlice = useDepositStore((s) => s.fiat);
5279
+ const exchangeSlice = useDepositStore((s) => s.exchange);
4382
5280
  const flowMode = flowSlice.mode;
4383
5281
  const isConnectSelectionConfirmed = flowSlice.isConnectSelectionConfirmed;
4384
5282
  const hasNavigatedBack = flowSlice.hasNavigatedBack;
@@ -4390,13 +5288,13 @@ function DepositFlow({
4390
5288
  const stableWalletSelectionKeyRef = _react.useRef.call(void 0, null);
4391
5289
  const logFlow = _react.useCallback.call(void 0,
4392
5290
  (message, data) => {
4393
- _chunk2TWQGPPBcjs.debugLog.call(void 0, debug, "deposit-flow", message, data);
5291
+ _chunkDZNXG5JKcjs.debugLog.call(void 0, debug, "deposit-flow", message, data);
4394
5292
  },
4395
5293
  [debug]
4396
5294
  );
4397
5295
  const logFlowError = _react.useCallback.call(void 0,
4398
5296
  (message, error, data) => {
4399
- _chunk2TWQGPPBcjs.debugError.call(void 0, debug, "deposit-flow", message, error, data);
5297
+ _chunkDZNXG5JKcjs.debugError.call(void 0, debug, "deposit-flow", message, error, data);
4400
5298
  },
4401
5299
  [debug]
4402
5300
  );
@@ -4412,19 +5310,19 @@ function DepositFlow({
4412
5310
  _viem.formatUnits.call(void 0, BigInt(asset.balance), asset.decimals)
4413
5311
  );
4414
5312
  if (balanceUnits > 0) return asset.balanceUsd / balanceUnits;
4415
- } catch (e27) {
5313
+ } catch (e30) {
4416
5314
  }
4417
5315
  }
4418
5316
  }
4419
5317
  return null;
4420
5318
  }, []);
4421
5319
  const dappSwitchChain = _react.useMemo.call(void 0, () => {
4422
- if (!_optionalChain([dappWalletClient, 'optionalAccess', _109 => _109.switchChain])) return void 0;
5320
+ if (!_optionalChain([dappWalletClient, 'optionalAccess', _136 => _136.switchChain])) return void 0;
4423
5321
  return async (chainId) => {
4424
- await _optionalChain([dappWalletClient, 'access', _110 => _110.switchChain, 'optionalCall', _111 => _111({ id: chainId })]);
5322
+ await _optionalChain([dappWalletClient, 'access', _137 => _137.switchChain, 'optionalCall', _138 => _138({ id: chainId })]);
4425
5323
  };
4426
5324
  }, [dappWalletClient]);
4427
- const connectedWalletAddress = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess', _112 => _112.account, 'optionalAccess', _113 => _113.address]), () => ( null));
5325
+ const connectedWalletAddress = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess', _139 => _139.account, 'optionalAccess', _140 => _140.address]), () => ( null));
4428
5326
  const walletOptions = _react.useMemo.call(void 0, () => {
4429
5327
  const options = [];
4430
5328
  const seen = /* @__PURE__ */ new Set();
@@ -4438,7 +5336,7 @@ function DepositFlow({
4438
5336
  });
4439
5337
  seen.add(id);
4440
5338
  }
4441
- if (enableSolana && _optionalChain([reownWallet, 'optionalAccess', _114 => _114.isConnected]) && reownWallet.isSolana && reownWallet.solanaAddress && dappAddress) {
5339
+ if (enableSolana && _optionalChain([reownWallet, 'optionalAccess', _141 => _141.isConnected]) && reownWallet.isSolana && reownWallet.solanaAddress && dappAddress) {
4442
5340
  const id = _nullishCoalesce(reownWallet.caipAddress, () => ( `solana:${reownWallet.solanaAddress}`));
4443
5341
  if (!seen.has(id)) {
4444
5342
  options.push({
@@ -4450,7 +5348,7 @@ function DepositFlow({
4450
5348
  });
4451
5349
  seen.add(id);
4452
5350
  }
4453
- } else if (_optionalChain([reownWallet, 'optionalAccess', _115 => _115.address]) && reownWallet.isConnected && reownWallet.walletClient && reownWallet.publicClient && !seen.has(`evm:${reownWallet.address.toLowerCase()}`)) {
5351
+ } else if (_optionalChain([reownWallet, 'optionalAccess', _142 => _142.address]) && reownWallet.isConnected && reownWallet.walletClient && reownWallet.publicClient && !seen.has(`evm:${reownWallet.address.toLowerCase()}`)) {
4454
5352
  const id = `evm:${reownWallet.address.toLowerCase()}`;
4455
5353
  if (!seen.has(id)) {
4456
5354
  options.push({
@@ -4467,20 +5365,20 @@ function DepositFlow({
4467
5365
  }, [
4468
5366
  connectedWalletAddress,
4469
5367
  dappAddress,
4470
- _optionalChain([reownWallet, 'optionalAccess', _116 => _116.address]),
4471
- _optionalChain([reownWallet, 'optionalAccess', _117 => _117.isConnected]),
4472
- _optionalChain([reownWallet, 'optionalAccess', _118 => _118.walletClient]),
4473
- _optionalChain([reownWallet, 'optionalAccess', _119 => _119.publicClient]),
4474
- _optionalChain([reownWallet, 'optionalAccess', _120 => _120.icon]),
5368
+ _optionalChain([reownWallet, 'optionalAccess', _143 => _143.address]),
5369
+ _optionalChain([reownWallet, 'optionalAccess', _144 => _144.isConnected]),
5370
+ _optionalChain([reownWallet, 'optionalAccess', _145 => _145.walletClient]),
5371
+ _optionalChain([reownWallet, 'optionalAccess', _146 => _146.publicClient]),
5372
+ _optionalChain([reownWallet, 'optionalAccess', _147 => _147.icon]),
4475
5373
  enableSolana,
4476
- _optionalChain([reownWallet, 'optionalAccess', _121 => _121.isSolana]),
4477
- _optionalChain([reownWallet, 'optionalAccess', _122 => _122.solanaAddress]),
4478
- _optionalChain([reownWallet, 'optionalAccess', _123 => _123.caipAddress])
5374
+ _optionalChain([reownWallet, 'optionalAccess', _148 => _148.isSolana]),
5375
+ _optionalChain([reownWallet, 'optionalAccess', _149 => _149.solanaAddress]),
5376
+ _optionalChain([reownWallet, 'optionalAccess', _150 => _150.caipAddress])
4479
5377
  ]);
4480
- const canAutoLock = _optionalChain([dappWalletClient, 'optionalAccess', _124 => _124.account]) && dappAddress && !reownWallet;
5378
+ const canAutoLock = _optionalChain([dappWalletClient, 'optionalAccess', _151 => _151.account]) && dappAddress && !reownWallet && !enableFiatOnramp && !enableExchangeConnect;
4481
5379
  const hasWalletOptions = walletOptions.length > 0;
4482
5380
  const hasReownSession = Boolean(
4483
- enableSolana ? _optionalChain([reownWallet, 'optionalAccess', _125 => _125.isConnected]) || _optionalChain([reownWallet, 'optionalAccess', _126 => _126.address]) : _optionalChain([reownWallet, 'optionalAccess', _127 => _127.address])
5381
+ enableSolana ? _optionalChain([reownWallet, 'optionalAccess', _152 => _152.isConnected]) || _optionalChain([reownWallet, 'optionalAccess', _153 => _153.address]) : _optionalChain([reownWallet, 'optionalAccess', _154 => _154.address])
4484
5382
  );
4485
5383
  const isWalletHydrationPending = Boolean(
4486
5384
  dappAddress && !hasWalletOptions && (hasDappWalletClientProp && dappWalletClient === void 0 || reownWallet && !hasReownSession && !reownWallet.isReady)
@@ -4539,16 +5437,16 @@ function DepositFlow({
4539
5437
  return {
4540
5438
  ownerAddress: dappAddress,
4541
5439
  walletClient: void 0,
4542
- publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunk2TWQGPPBcjs.getPublicClient.call(void 0, setupChainId))),
5440
+ publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkDZNXG5JKcjs.getPublicClient.call(void 0, setupChainId))),
4543
5441
  switchChain: void 0
4544
5442
  };
4545
5443
  }
4546
5444
  if (canAutoLock) {
4547
- const fallbackChainId = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess', _128 => _128.chain, 'optionalAccess', _129 => _129.id]), () => ( setupChainId));
5445
+ const fallbackChainId = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess', _155 => _155.chain, 'optionalAccess', _156 => _156.id]), () => ( setupChainId));
4548
5446
  return {
4549
5447
  ownerAddress: dappWalletClient.account.address,
4550
5448
  walletClient: dappWalletClient,
4551
- publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunk2TWQGPPBcjs.getPublicClient.call(void 0, fallbackChainId))),
5449
+ publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkDZNXG5JKcjs.getPublicClient.call(void 0, fallbackChainId))),
4552
5450
  switchChain: dappSwitchChain
4553
5451
  };
4554
5452
  }
@@ -4562,24 +5460,24 @@ function DepositFlow({
4562
5460
  return {
4563
5461
  ownerAddress: dappAddress,
4564
5462
  walletClient: void 0,
4565
- publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunk2TWQGPPBcjs.getPublicClient.call(void 0, setupChainId))),
5463
+ publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkDZNXG5JKcjs.getPublicClient.call(void 0, setupChainId))),
4566
5464
  switchChain: void 0
4567
5465
  };
4568
5466
  }
4569
- if (selectedOption.kind === "connected" && _optionalChain([dappWalletClient, 'optionalAccess', _130 => _130.account]) && selectedOption.address && dappWalletClient.account.address.toLowerCase() === selectedOption.address.toLowerCase()) {
4570
- const fallbackChainId = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess', _131 => _131.chain, 'optionalAccess', _132 => _132.id]), () => ( setupChainId));
5467
+ if (selectedOption.kind === "connected" && _optionalChain([dappWalletClient, 'optionalAccess', _157 => _157.account]) && selectedOption.address && dappWalletClient.account.address.toLowerCase() === selectedOption.address.toLowerCase()) {
5468
+ const fallbackChainId = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess', _158 => _158.chain, 'optionalAccess', _159 => _159.id]), () => ( setupChainId));
4571
5469
  return {
4572
5470
  ownerAddress: dappWalletClient.account.address,
4573
5471
  walletClient: dappWalletClient,
4574
- publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunk2TWQGPPBcjs.getPublicClient.call(void 0, fallbackChainId))),
5472
+ publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkDZNXG5JKcjs.getPublicClient.call(void 0, fallbackChainId))),
4575
5473
  switchChain: dappSwitchChain
4576
5474
  };
4577
5475
  }
4578
- if (selectedOption.kind === "external" && _optionalChain([reownWallet, 'optionalAccess', _133 => _133.address]) && selectedOption.address && reownWallet.address.toLowerCase() === selectedOption.address.toLowerCase()) {
5476
+ if (selectedOption.kind === "external" && _optionalChain([reownWallet, 'optionalAccess', _160 => _160.address]) && selectedOption.address && reownWallet.address.toLowerCase() === selectedOption.address.toLowerCase()) {
4579
5477
  return {
4580
5478
  ownerAddress: reownWallet.address,
4581
5479
  walletClient: reownWallet.walletClient,
4582
- publicClient: _nullishCoalesce(reownWallet.publicClient, () => ( _chunk2TWQGPPBcjs.getPublicClient.call(void 0, setupChainId))),
5480
+ publicClient: _nullishCoalesce(reownWallet.publicClient, () => ( _chunkDZNXG5JKcjs.getPublicClient.call(void 0, setupChainId))),
4583
5481
  switchChain: reownWallet.switchChain
4584
5482
  };
4585
5483
  }
@@ -4617,7 +5515,7 @@ function DepositFlow({
4617
5515
  return {
4618
5516
  ownerAddress: dappAddress,
4619
5517
  walletClient: void 0,
4620
- publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunk2TWQGPPBcjs.getPublicClient.call(void 0, setupChainId))),
5518
+ publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkDZNXG5JKcjs.getPublicClient.call(void 0, setupChainId))),
4621
5519
  switchChain: void 0
4622
5520
  };
4623
5521
  }
@@ -4642,37 +5540,37 @@ function DepositFlow({
4642
5540
  const selectedEvmWalletOwner = _react.useMemo.call(void 0, () => {
4643
5541
  if (!selectedWalletId) return null;
4644
5542
  const opt = walletOptions.find((o) => o.id === selectedWalletId);
4645
- if (_optionalChain([opt, 'optionalAccess', _134 => _134.kind]) === "external" && opt.address) {
5543
+ if (_optionalChain([opt, 'optionalAccess', _161 => _161.kind]) === "external" && opt.address) {
4646
5544
  return opt.address;
4647
5545
  }
4648
- if (_optionalChain([opt, 'optionalAccess', _135 => _135.kind]) === "connected" && opt.address) {
5546
+ if (_optionalChain([opt, 'optionalAccess', _162 => _162.kind]) === "connected" && opt.address) {
4649
5547
  return opt.address;
4650
5548
  }
4651
5549
  return null;
4652
5550
  }, [selectedWalletId, walletOptions]);
4653
5551
  const dappImportOwner = _react.useMemo.call(void 0, () => {
4654
5552
  if (selectedEvmWalletOwner) return selectedEvmWalletOwner;
4655
- if (_optionalChain([reownWallet, 'optionalAccess', _136 => _136.address]) && reownWallet.isConnected) {
5553
+ if (_optionalChain([reownWallet, 'optionalAccess', _163 => _163.address]) && reownWallet.isConnected) {
4656
5554
  return reownWallet.address;
4657
5555
  }
4658
5556
  if (connectedWalletAddress) return connectedWalletAddress;
4659
5557
  return null;
4660
5558
  }, [
4661
5559
  selectedEvmWalletOwner,
4662
- _optionalChain([reownWallet, 'optionalAccess', _137 => _137.address]),
4663
- _optionalChain([reownWallet, 'optionalAccess', _138 => _138.isConnected]),
5560
+ _optionalChain([reownWallet, 'optionalAccess', _164 => _164.address]),
5561
+ _optionalChain([reownWallet, 'optionalAccess', _165 => _165.isConnected]),
4664
5562
  connectedWalletAddress
4665
5563
  ]);
4666
5564
  const activeOwner = _react.useMemo.call(void 0,
4667
5565
  () => resolveOwnerForMode(flowMode, {
4668
5566
  dappAddress,
4669
- walletOwner: _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess', _139 => _139.ownerAddress]), () => ( (canAutoLock ? connectedWalletAddress : selectedEvmWalletOwner))),
5567
+ walletOwner: _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess', _166 => _166.ownerAddress]), () => ( (canAutoLock ? connectedWalletAddress : selectedEvmWalletOwner))),
4670
5568
  dappImportOwner
4671
5569
  }),
4672
5570
  [
4673
5571
  flowMode,
4674
5572
  dappAddress,
4675
- _optionalChain([signerContext, 'optionalAccess', _140 => _140.ownerAddress]),
5573
+ _optionalChain([signerContext, 'optionalAccess', _167 => _167.ownerAddress]),
4676
5574
  canAutoLock,
4677
5575
  connectedWalletAddress,
4678
5576
  selectedEvmWalletOwner,
@@ -4701,12 +5599,12 @@ function DepositFlow({
4701
5599
  return;
4702
5600
  }
4703
5601
  lastActiveSetupLifecycleKeyRef.current = lifecycleKey;
4704
- _optionalChain([onLifecycleRef, 'access', _141 => _141.current, 'optionalCall', _142 => _142({
5602
+ _optionalChain([onLifecycleRef, 'access', _168 => _168.current, 'optionalCall', _169 => _169({
4705
5603
  type: "smart-account-changed",
4706
5604
  evm: activeEntry.smartAccount,
4707
5605
  solana: _nullishCoalesce(activeEntry.solanaDepositAddress, () => ( null))
4708
5606
  })]);
4709
- _optionalChain([onLifecycleRef, 'access', _143 => _143.current, 'optionalCall', _144 => _144({
5607
+ _optionalChain([onLifecycleRef, 'access', _170 => _170.current, 'optionalCall', _171 => _171({
4710
5608
  type: "connected",
4711
5609
  address: activeOwner,
4712
5610
  smartAccount: activeEntry.smartAccount
@@ -4721,8 +5619,22 @@ function DepositFlow({
4721
5619
  onLifecycleRef
4722
5620
  ]);
4723
5621
  const effectiveStep = _react.useMemo.call(void 0,
4724
- () => deriveStep(flowSlice, depositSlice, processingSlice, activeEntry),
4725
- [flowSlice, depositSlice, processingSlice, activeEntry]
5622
+ () => deriveStep(
5623
+ flowSlice,
5624
+ depositSlice,
5625
+ processingSlice,
5626
+ activeEntry,
5627
+ fiatSlice,
5628
+ exchangeSlice
5629
+ ),
5630
+ [
5631
+ flowSlice,
5632
+ depositSlice,
5633
+ processingSlice,
5634
+ activeEntry,
5635
+ fiatSlice,
5636
+ exchangeSlice
5637
+ ]
4726
5638
  );
4727
5639
  const step = effectiveStep;
4728
5640
  const handleBack = _react.useCallback.call(void 0, () => {
@@ -4735,12 +5647,48 @@ function DepositFlow({
4735
5647
  portfolioAssetsRef.current = [];
4736
5648
  }
4737
5649
  }, [storeApi, hasWalletOptions, reownWallet]);
4738
- 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;
5650
+ 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;
4739
5651
  const currentBackHandler = canGoBackFromHere ? handleBack : void 0;
4740
5652
  const currentScreen = showConnectStep ? "connect" : effectiveStep.type;
4741
5653
  _react.useEffect.call(void 0, () => {
4742
- _optionalChain([onStepChangeRef, 'access', _145 => _145.current, 'optionalCall', _146 => _146(currentBackHandler, currentScreen)]);
5654
+ _optionalChain([onStepChangeRef, 'access', _172 => _172.current, 'optionalCall', _173 => _173(currentBackHandler, currentScreen)]);
4743
5655
  }, [currentBackHandler, currentScreen, onStepChangeRef]);
5656
+ const lastModalHeightRef = _react.useRef.call(void 0, 0);
5657
+ const modalContentElRef = _react.useRef.call(void 0, null);
5658
+ _react.useEffect.call(void 0, () => {
5659
+ const mc = document.querySelector(".rs-modal-content");
5660
+ if (!mc) return;
5661
+ modalContentElRef.current = mc;
5662
+ const ro = new ResizeObserver((entries) => {
5663
+ for (const entry of entries) {
5664
+ const border = _optionalChain([entry, 'access', _174 => _174.borderBoxSize, 'optionalAccess', _175 => _175[0], 'optionalAccess', _176 => _176.blockSize]);
5665
+ lastModalHeightRef.current = typeof border === "number" ? border : entry.contentRect.height;
5666
+ }
5667
+ });
5668
+ ro.observe(mc);
5669
+ return () => {
5670
+ ro.disconnect();
5671
+ modalContentElRef.current = null;
5672
+ };
5673
+ }, []);
5674
+ const stepPinKey = `${_nullishCoalesce(flowMode, () => ( "none"))}:${step.type}`;
5675
+ const prevStepPinKeyRef = _react.useRef.call(void 0, stepPinKey);
5676
+ _react.useLayoutEffect.call(void 0, () => {
5677
+ if (prevStepPinKeyRef.current === stepPinKey) return;
5678
+ prevStepPinKeyRef.current = stepPinKey;
5679
+ const mc = document.querySelector(".rs-modal-content");
5680
+ const lastHeight = lastModalHeightRef.current;
5681
+ if (!mc || lastHeight <= 0) return;
5682
+ const prevTransition = mc.style.transition;
5683
+ mc.style.transition = "none";
5684
+ mc.style.setProperty("min-height", `${lastHeight}px`, "important");
5685
+ void mc.offsetHeight;
5686
+ const rafId = requestAnimationFrame(() => {
5687
+ mc.style.transition = prevTransition;
5688
+ mc.style.removeProperty("min-height");
5689
+ });
5690
+ return () => cancelAnimationFrame(rafId);
5691
+ }, [stepPinKey]);
4744
5692
  const stepSendToken = effectiveStep.type === "amount" ? effectiveStep.asset.symbol : null;
4745
5693
  const stepOpenEventKey = effectiveStep.type === "select-asset" ? "select-asset" : effectiveStep.type === "deposit-address" ? "deposit-address" : effectiveStep.type === "amount" && stepSendToken ? `amount:${stepSendToken.toLowerCase()}` : null;
4746
5694
  const lastStepOpenEventKeyRef = _react.useRef.call(void 0, null);
@@ -4754,7 +5702,7 @@ function DepositFlow({
4754
5702
  }
4755
5703
  lastStepOpenEventKeyRef.current = stepOpenEventKey;
4756
5704
  if (effectiveStep.type === "select-asset") {
4757
- _optionalChain([onEventRef, 'access', _147 => _147.current, 'optionalCall', _148 => _148({
5705
+ _optionalChain([onEventRef, 'access', _177 => _177.current, 'optionalCall', _178 => _178({
4758
5706
  type: "deposit_modal_connected_wallet_select_source_open",
4759
5707
  total_balance_in_external_wallet: totalBalanceUsd,
4760
5708
  pred_balance: totalBalanceUsd
@@ -4762,7 +5710,7 @@ function DepositFlow({
4762
5710
  } else if (effectiveStep.type === "deposit-address") {
4763
5711
  const chainName = _chunk7JIDIX27cjs.getChainName.call(void 0, targetChain);
4764
5712
  const tokenSymbol = _chunk7JIDIX27cjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain);
4765
- _optionalChain([onEventRef, 'access', _149 => _149.current, 'optionalCall', _150 => _150({
5713
+ _optionalChain([onEventRef, 'access', _179 => _179.current, 'optionalCall', _180 => _180({
4766
5714
  type: "deposit_modal_transfer_crypto_open",
4767
5715
  default_chain: chainName,
4768
5716
  default_token: tokenSymbol,
@@ -4770,7 +5718,7 @@ function DepositFlow({
4770
5718
  })]);
4771
5719
  } else if (effectiveStep.type === "amount" && stepSendToken) {
4772
5720
  const receiveSymbol = _chunk7JIDIX27cjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain);
4773
- _optionalChain([onEventRef, 'access', _151 => _151.current, 'optionalCall', _152 => _152({
5721
+ _optionalChain([onEventRef, 'access', _181 => _181.current, 'optionalCall', _182 => _182({
4774
5722
  type: "deposit_modal_connected_wallet_enter_value_open",
4775
5723
  send_token: stepSendToken,
4776
5724
  receive_token: receiveSymbol,
@@ -4803,7 +5751,7 @@ function DepositFlow({
4803
5751
  targetToken
4804
5752
  ]);
4805
5753
  _react.useEffect.call(void 0, () => {
4806
- _optionalChain([onLifecycleRef, 'access', _153 => _153.current, 'optionalCall', _154 => _154({
5754
+ _optionalChain([onLifecycleRef, 'access', _183 => _183.current, 'optionalCall', _184 => _184({
4807
5755
  type: "balance-changed",
4808
5756
  totalUsd: totalBalanceUsd
4809
5757
  })]);
@@ -4811,13 +5759,15 @@ function DepositFlow({
4811
5759
  const isDepositAddressMode = flowMode === "deposit-address";
4812
5760
  const isSolanaWalletMode = flowMode === "solana-wallet";
4813
5761
  const isDappImportMode = flowMode === "dapp-import";
5762
+ const isFiatOnrampMode = flowMode === "fiat-onramp";
5763
+ const isExchangeConnectMode = flowMode === "exchange-connect";
4814
5764
  const handleSelectTransferCrypto = _react.useCallback.call(void 0, () => {
4815
5765
  storeApi.dispatch({ type: "connect/transfer-crypto-selected" });
4816
5766
  }, [storeApi]);
4817
5767
  const handleConfirmWallet = _react.useCallback.call(void 0,
4818
5768
  (walletId) => {
4819
5769
  const selectedOption = walletOptions.find((o) => o.id === walletId);
4820
- const mode = enableSolana && _optionalChain([selectedOption, 'optionalAccess', _155 => _155.kind]) === "solana" ? "solana-wallet" : "wallet";
5770
+ const mode = enableSolana && _optionalChain([selectedOption, 'optionalAccess', _185 => _185.kind]) === "solana" ? "solana-wallet" : "wallet";
4821
5771
  storeApi.dispatch({
4822
5772
  type: "connect/wallet-confirmed",
4823
5773
  walletId,
@@ -4827,7 +5777,7 @@ function DepositFlow({
4827
5777
  [walletOptions, enableSolana, storeApi]
4828
5778
  );
4829
5779
  const isSolanaWalletConnected = Boolean(
4830
- enableSolana && _optionalChain([reownWallet, 'optionalAccess', _156 => _156.isConnected]) && _optionalChain([reownWallet, 'optionalAccess', _157 => _157.isSolana])
5780
+ enableSolana && _optionalChain([reownWallet, 'optionalAccess', _186 => _186.isConnected]) && _optionalChain([reownWallet, 'optionalAccess', _187 => _187.isSolana])
4831
5781
  );
4832
5782
  const dappImportsKey = dappImports ? Object.keys(dappImports).filter((k) => dappImports[k]).sort().join(",") : "";
4833
5783
  const enabledDappImportProviders = _react.useMemo.call(void 0,
@@ -4840,7 +5790,7 @@ function DepositFlow({
4840
5790
  const owner = dappImportOwner;
4841
5791
  if (owner) {
4842
5792
  const wallet = walletOptions.find(
4843
- (o) => _optionalChain([(_nullishCoalesce(o.address, () => ( null))), 'optionalAccess', _158 => _158.toLowerCase, 'call', _159 => _159()]) === owner.toLowerCase()
5793
+ (o) => _optionalChain([(_nullishCoalesce(o.address, () => ( null))), 'optionalAccess', _188 => _188.toLowerCase, 'call', _189 => _189()]) === owner.toLowerCase()
4844
5794
  );
4845
5795
  if (wallet) {
4846
5796
  storeApi.dispatch({
@@ -4878,8 +5828,8 @@ function DepositFlow({
4878
5828
  eoa: dappImportOwner,
4879
5829
  getPublicClient: (chainId) => {
4880
5830
  try {
4881
- return _chunk2TWQGPPBcjs.getPublicClient.call(void 0, chainId);
4882
- } catch (e28) {
5831
+ return _chunkDZNXG5JKcjs.getPublicClient.call(void 0, chainId);
5832
+ } catch (e31) {
4883
5833
  return null;
4884
5834
  }
4885
5835
  },
@@ -4921,7 +5871,7 @@ function DepositFlow({
4921
5871
  if (!dappImportOwner) {
4922
5872
  return { ...baseRow, status: "needs-connect" };
4923
5873
  }
4924
- const availabilityEntry = _optionalChain([dappImportAvailabilityOwner, 'optionalAccess', _160 => _160.toLowerCase, 'call', _161 => _161()]) === dappImportOwner.toLowerCase() ? dappImportAvailability[provider.id] : void 0;
5874
+ const availabilityEntry = _optionalChain([dappImportAvailabilityOwner, 'optionalAccess', _190 => _190.toLowerCase, 'call', _191 => _191()]) === dappImportOwner.toLowerCase() ? dappImportAvailability[provider.id] : void 0;
4925
5875
  const dappImportSetup = readSetupForOwner(setupSlice, dappImportOwner);
4926
5876
  if (availabilityEntry === "loading" || availabilityEntry === void 0) {
4927
5877
  return { ...baseRow, status: "loading" };
@@ -4969,7 +5919,7 @@ function DepositFlow({
4969
5919
  }, [activeDappImportProviderId, enabledDappImportProviders]);
4970
5920
  const activeDappImportAvailability = _react.useMemo.call(void 0, () => {
4971
5921
  if (!activeDappImportProviderId) return null;
4972
- if (!dappImportOwner || _optionalChain([dappImportAvailabilityOwner, 'optionalAccess', _162 => _162.toLowerCase, 'call', _163 => _163()]) !== dappImportOwner.toLowerCase()) {
5922
+ if (!dappImportOwner || _optionalChain([dappImportAvailabilityOwner, 'optionalAccess', _192 => _192.toLowerCase, 'call', _193 => _193()]) !== dappImportOwner.toLowerCase()) {
4973
5923
  return null;
4974
5924
  }
4975
5925
  const entry = dappImportAvailability[activeDappImportProviderId];
@@ -4981,8 +5931,29 @@ function DepositFlow({
4981
5931
  dappImportAvailabilityOwner,
4982
5932
  dappImportOwner
4983
5933
  ]);
5934
+ const handleSelectFiatMethod = _react.useCallback.call(void 0,
5935
+ (paymentMethod) => {
5936
+ storeApi.dispatch({
5937
+ type: "connect/fiat-onramp-selected",
5938
+ paymentMethod
5939
+ });
5940
+ },
5941
+ [storeApi]
5942
+ );
5943
+ const handleSelectExchange = _react.useCallback.call(void 0, () => {
5944
+ storeApi.dispatch({ type: "connect/exchange-selected" });
5945
+ }, [storeApi]);
5946
+ const handleSelectExchangeConnection = _react.useCallback.call(void 0,
5947
+ (connection) => {
5948
+ storeApi.dispatch({
5949
+ type: "exchange/connection-selected",
5950
+ connection
5951
+ });
5952
+ },
5953
+ [storeApi]
5954
+ );
4984
5955
  const handleNewDeposit = _react.useCallback.call(void 0, () => {
4985
- _optionalChain([onLifecycleRef, 'access', _164 => _164.current, 'optionalCall', _165 => _165({
5956
+ _optionalChain([onLifecycleRef, 'access', _194 => _194.current, 'optionalCall', _195 => _195({
4986
5957
  type: "smart-account-changed",
4987
5958
  evm: null,
4988
5959
  solana: null
@@ -5030,13 +6001,13 @@ function DepositFlow({
5030
6001
  };
5031
6002
  push(dappAddress);
5032
6003
  push(connectedWalletAddress);
5033
- push(_optionalChain([reownWallet, 'optionalAccess', _166 => _166.address]));
6004
+ push(_optionalChain([reownWallet, 'optionalAccess', _196 => _196.address]));
5034
6005
  push(dappImportOwner);
5035
6006
  return owners;
5036
6007
  }, [
5037
6008
  dappAddress,
5038
6009
  connectedWalletAddress,
5039
- _optionalChain([reownWallet, 'optionalAccess', _167 => _167.address]),
6010
+ _optionalChain([reownWallet, 'optionalAccess', _197 => _197.address]),
5040
6011
  dappImportOwner
5041
6012
  ]);
5042
6013
  _react.useEffect.call(void 0, () => {
@@ -5050,7 +6021,7 @@ function DepositFlow({
5050
6021
  try {
5051
6022
  sessionOwner = await resolveSessionOwner(owner);
5052
6023
  } catch (error) {
5053
- _chunk2TWQGPPBcjs.debugError.call(void 0,
6024
+ _chunkDZNXG5JKcjs.debugError.call(void 0,
5054
6025
  debug,
5055
6026
  "deposit-flow",
5056
6027
  "session-owner:resolve-failed",
@@ -5141,7 +6112,7 @@ function DepositFlow({
5141
6112
  sourceChain: data.sourceChain,
5142
6113
  amount: data.amount
5143
6114
  });
5144
- _optionalChain([onLifecycleRef, 'access', _168 => _168.current, 'optionalCall', _169 => _169({ type: "submitted", ...data })]);
6115
+ _optionalChain([onLifecycleRef, 'access', _198 => _198.current, 'optionalCall', _199 => _199({ type: "submitted", ...data })]);
5145
6116
  },
5146
6117
  [logFlow, onLifecycleRef]
5147
6118
  );
@@ -5198,7 +6169,7 @@ function DepositFlow({
5198
6169
  sourceSymbol: tokenAtSubmit.symbol,
5199
6170
  sourceDecimals: tokenAtSubmit.decimals
5200
6171
  });
5201
- _optionalChain([onLifecycleRef, 'access', _170 => _170.current, 'optionalCall', _171 => _171({
6172
+ _optionalChain([onLifecycleRef, 'access', _200 => _200.current, 'optionalCall', _201 => _201({
5202
6173
  type: "submitted",
5203
6174
  txHash,
5204
6175
  sourceChain: "solana",
@@ -5209,7 +6180,7 @@ function DepositFlow({
5209
6180
  );
5210
6181
  const handleAssetContinue = _react.useCallback.call(void 0,
5211
6182
  (asset) => {
5212
- _optionalChain([onEventRef, 'access', _172 => _172.current, 'optionalCall', _173 => _173({
6183
+ _optionalChain([onEventRef, 'access', _202 => _202.current, 'optionalCall', _203 => _203({
5213
6184
  type: "deposit_modal_connected_wallet_select_source_cta_click",
5214
6185
  total_balance_in_external_wallet: totalBalanceUsd,
5215
6186
  pred_balance: totalBalanceUsd,
@@ -5262,16 +6233,41 @@ function DepositFlow({
5262
6233
  sourceChain: chainId,
5263
6234
  sourceToken: token,
5264
6235
  amount,
5265
- sourceSymbol: _optionalChain([dappImport, 'optionalAccess', _174 => _174.symbol]),
5266
- sourceDecimals: _optionalChain([dappImport, 'optionalAccess', _175 => _175.decimals]),
6236
+ sourceSymbol: _optionalChain([dappImport, 'optionalAccess', _204 => _204.symbol]),
6237
+ sourceDecimals: _optionalChain([dappImport, 'optionalAccess', _205 => _205.decimals]),
5267
6238
  directTransfer: !dappImport && isSameRoute2(chainId, token, targetChain, targetToken)
5268
6239
  });
5269
6240
  },
5270
6241
  [logFlow, storeApi, targetChain, targetToken]
5271
6242
  );
6243
+ const handleSwappedComplete = _react.useCallback.call(void 0,
6244
+ (info) => {
6245
+ logFlow("swapped:complete", {
6246
+ txHash: info.txHash,
6247
+ orderCrypto: info.orderCrypto
6248
+ });
6249
+ const amount = _nullishCoalesce(info.amount, () => ( "0"));
6250
+ storeApi.dispatch({
6251
+ type: "deposit/submitted",
6252
+ txHash: info.txHash,
6253
+ sourceChain: SWAPPED_SOURCE_CHAIN,
6254
+ sourceToken: SWAPPED_SOURCE_TOKEN,
6255
+ amount,
6256
+ sourceSymbol: _nullishCoalesce(info.orderCrypto, () => ( "USDC")),
6257
+ sourceDecimals: 6
6258
+ });
6259
+ _optionalChain([onLifecycleRef, 'access', _206 => _206.current, 'optionalCall', _207 => _207({
6260
+ type: "submitted",
6261
+ txHash: info.txHash,
6262
+ sourceChain: SWAPPED_SOURCE_CHAIN,
6263
+ amount
6264
+ })]);
6265
+ },
6266
+ [logFlow, storeApi, onLifecycleRef]
6267
+ );
5272
6268
  const handleDepositSubmittedCallback = _react.useCallback.call(void 0,
5273
6269
  (txHash, sourceChain, amount) => {
5274
- _optionalChain([onLifecycleRef, 'access', _176 => _176.current, 'optionalCall', _177 => _177({
6270
+ _optionalChain([onLifecycleRef, 'access', _208 => _208.current, 'optionalCall', _209 => _209({
5275
6271
  type: "submitted",
5276
6272
  txHash,
5277
6273
  sourceChain,
@@ -5283,7 +6279,7 @@ function DepositFlow({
5283
6279
  const handleDepositComplete = _react.useCallback.call(void 0,
5284
6280
  (txHash, destinationTxHash, context) => {
5285
6281
  logFlow("deposit:complete", { txHash, destinationTxHash, ...context });
5286
- _optionalChain([onLifecycleRef, 'access', _178 => _178.current, 'optionalCall', _179 => _179({
6282
+ _optionalChain([onLifecycleRef, 'access', _210 => _210.current, 'optionalCall', _211 => _211({
5287
6283
  type: "complete",
5288
6284
  txHash,
5289
6285
  destinationTxHash,
@@ -5295,14 +6291,14 @@ function DepositFlow({
5295
6291
  const handleDepositFailed = _react.useCallback.call(void 0,
5296
6292
  (txHash, error) => {
5297
6293
  logFlowError("deposit:failed", error, { txHash });
5298
- _optionalChain([onLifecycleRef, 'access', _180 => _180.current, 'optionalCall', _181 => _181({ type: "failed", txHash, error })]);
6294
+ _optionalChain([onLifecycleRef, 'access', _212 => _212.current, 'optionalCall', _213 => _213({ type: "failed", txHash, error })]);
5299
6295
  },
5300
6296
  [logFlowError, onLifecycleRef]
5301
6297
  );
5302
6298
  const handleError = _react.useCallback.call(void 0,
5303
6299
  (message, code) => {
5304
6300
  logFlowError("flow:error", message, { code });
5305
- _optionalChain([onErrorRef, 'access', _182 => _182.current, 'optionalCall', _183 => _183({ message, code })]);
6301
+ _optionalChain([onErrorRef, 'access', _214 => _214.current, 'optionalCall', _215 => _215({ message, code })]);
5306
6302
  },
5307
6303
  [logFlowError, onErrorRef]
5308
6304
  );
@@ -5338,13 +6334,14 @@ function DepositFlow({
5338
6334
  }
5339
6335
  }, [enableSolana, flowMode, storeApi]);
5340
6336
  _react.useEffect.call(void 0, () => {
5341
- if (hasNavigatedBack || isConnectSelectionConfirmed || flowMode) {
6337
+ if (hasNavigatedBack || isConnectSelectionConfirmed || flowMode || enableFiatOnramp || enableExchangeConnect) {
5342
6338
  return;
5343
6339
  }
5344
- if (!hasWalletOptions && dappAddress && !hasReownSession && !dappWalletClient && hasQrAutoAdvanceGraceElapsed) {
6340
+ if (enableQrTransfer && !hasWalletOptions && dappAddress && !hasReownSession && !dappWalletClient && hasQrAutoAdvanceGraceElapsed) {
5345
6341
  handleSelectTransferCrypto();
5346
6342
  }
5347
6343
  }, [
6344
+ enableQrTransfer,
5348
6345
  hasWalletOptions,
5349
6346
  hasReownSession,
5350
6347
  hasQrAutoAdvanceGraceElapsed,
@@ -5384,12 +6381,12 @@ function DepositFlow({
5384
6381
  );
5385
6382
  if (showConnectStep) {
5386
6383
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
5387
- _chunk2TWQGPPBcjs.ConnectStep,
6384
+ _chunkDZNXG5JKcjs.ConnectStep,
5388
6385
  {
5389
6386
  walletRows,
5390
6387
  transferCryptoState: dappAddress ? transferCryptoState : void 0,
5391
6388
  transferCryptoErrorReason: dappAddress ? _nullishCoalesce(transferCryptoEntry.message, () => ( void 0)) : void 0,
5392
- onSelectTransferCrypto: dappAddress ? () => {
6389
+ onSelectTransferCrypto: enableQrTransfer && dappAddress ? () => {
5393
6390
  if (transferCryptoState === "error") {
5394
6391
  handleRetrySetup(dappAddress);
5395
6392
  return;
@@ -5397,6 +6394,10 @@ function DepositFlow({
5397
6394
  if (transferCryptoState !== "ready") return;
5398
6395
  handleSelectTransferCrypto();
5399
6396
  } : void 0,
6397
+ onSelectPayWithCard: enableFiatOnramp && dappAddress && (!fiatOnrampMethods || fiatOnrampMethods.length === 0) ? () => handleSelectFiatMethod() : void 0,
6398
+ fiatPaymentMethods: enableFiatOnramp && dappAddress ? fiatOnrampMethods : void 0,
6399
+ onSelectFiatMethod: enableFiatOnramp && dappAddress ? (method) => handleSelectFiatMethod(method) : void 0,
6400
+ onSelectFundFromExchange: enableExchangeConnect && dappAddress ? () => handleSelectExchange() : void 0,
5400
6401
  onRequestConnect,
5401
6402
  onConnect,
5402
6403
  onDisconnect,
@@ -5431,13 +6432,19 @@ function DepositFlow({
5431
6432
  if (isDepositAddressMode) {
5432
6433
  if (!dappAddress) return null;
5433
6434
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
5434
- effectiveStep.type === "setup" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
6435
+ effectiveStep.type === "setup" && (activeEntry.status === "error" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
5435
6436
  AccountPreparingSkeleton,
5436
6437
  {
5437
- errorMessage: activeEntry.status === "error" ? _nullishCoalesce(activeEntry.message, () => ( void 0)) : void 0,
5438
- onRetry: activeEntry.status === "error" ? () => handleRetrySetup(dappAddress) : void 0
6438
+ errorMessage: _nullishCoalesce(activeEntry.message, () => ( void 0)),
6439
+ onRetry: () => handleRetrySetup(dappAddress)
5439
6440
  }
5440
- ),
6441
+ ) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
6442
+ DepositAddressSkeleton,
6443
+ {
6444
+ uiConfig,
6445
+ allowedRoutes
6446
+ }
6447
+ )),
5441
6448
  effectiveStep.type === "deposit-address" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
5442
6449
  DepositAddressStep,
5443
6450
  {
@@ -5448,7 +6455,7 @@ function DepositFlow({
5448
6455
  allowedRoutes,
5449
6456
  targetChain,
5450
6457
  targetToken,
5451
- hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess', _184 => _184.length])),
6458
+ hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess', _216 => _216.length])),
5452
6459
  uiConfig,
5453
6460
  onDepositSubmitted: handleDepositAddressSubmitted,
5454
6461
  onDepositComplete: handleDepositComplete,
@@ -5456,7 +6463,7 @@ function DepositFlow({
5456
6463
  onCopyAddress: () => {
5457
6464
  const chainName = _chunk7JIDIX27cjs.getChainName.call(void 0, targetChain);
5458
6465
  const tokenSymbol = _chunk7JIDIX27cjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain);
5459
- _optionalChain([onEvent, 'optionalCall', _185 => _185({
6466
+ _optionalChain([onEvent, 'optionalCall', _217 => _217({
5460
6467
  type: "deposit_modal_transfer_crypto_cta_click",
5461
6468
  default_chain: chainName,
5462
6469
  default_token: tokenSymbol,
@@ -5470,10 +6477,132 @@ function DepositFlow({
5470
6477
  )
5471
6478
  ] });
5472
6479
  }
6480
+ if (isFiatOnrampMode) {
6481
+ if (!dappAddress) return null;
6482
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
6483
+ "div",
6484
+ {
6485
+ className: "rs-modal-body",
6486
+ "data-flow-mode": "fiat-onramp",
6487
+ "data-step-type": step.type,
6488
+ children: [
6489
+ step.type === "setup" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
6490
+ AccountPreparingSkeleton,
6491
+ {
6492
+ errorMessage: activeEntry.status === "error" ? _nullishCoalesce(activeEntry.message, () => ( void 0)) : void 0,
6493
+ onRetry: activeEntry.status === "error" ? () => handleRetrySetup(dappAddress) : void 0
6494
+ }
6495
+ ),
6496
+ step.type === "fiat-onramp" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
6497
+ FiatOnrampStep,
6498
+ {
6499
+ smartAccount: step.smartAccount,
6500
+ service,
6501
+ paymentMethod: step.paymentMethod,
6502
+ onSwappedComplete: handleSwappedComplete,
6503
+ onSwappedFailed: handleDepositFailed,
6504
+ onClose: _nullishCoalesce(onClose, () => ( (() => {
6505
+ }))),
6506
+ onError: handleError
6507
+ }
6508
+ ),
6509
+ step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
6510
+ _chunkDZNXG5JKcjs.ProcessingStep,
6511
+ {
6512
+ smartAccount: step.smartAccount,
6513
+ solanaDepositAddress: step.solanaDepositAddress,
6514
+ txHash: step.txHash,
6515
+ sourceChain: step.sourceChain,
6516
+ sourceToken: step.sourceToken,
6517
+ targetChain,
6518
+ targetToken,
6519
+ amount: step.amount,
6520
+ sourceSymbol: step.sourceSymbol,
6521
+ sourceDecimals: step.sourceDecimals,
6522
+ hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess', _218 => _218.length])),
6523
+ service,
6524
+ directTransfer: step.directTransfer,
6525
+ onClose,
6526
+ onNewDeposit: handleNewDeposit,
6527
+ onDepositComplete: handleDepositComplete,
6528
+ onDepositFailed: handleDepositFailed,
6529
+ onError: handleError,
6530
+ debug
6531
+ }
6532
+ )
6533
+ ]
6534
+ }
6535
+ );
6536
+ }
6537
+ if (isExchangeConnectMode) {
6538
+ if (!dappAddress) return null;
6539
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
6540
+ "div",
6541
+ {
6542
+ className: "rs-modal-body",
6543
+ "data-flow-mode": "exchange-connect",
6544
+ "data-step-type": step.type,
6545
+ children: [
6546
+ step.type === "setup" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
6547
+ AccountPreparingSkeleton,
6548
+ {
6549
+ errorMessage: activeEntry.status === "error" ? _nullishCoalesce(activeEntry.message, () => ( void 0)) : void 0,
6550
+ onRetry: activeEntry.status === "error" ? () => handleRetrySetup(dappAddress) : void 0
6551
+ }
6552
+ ),
6553
+ step.type === "exchange-select" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
6554
+ ExchangeSelectStep,
6555
+ {
6556
+ service,
6557
+ onSelectExchange: handleSelectExchangeConnection,
6558
+ onError: handleError
6559
+ }
6560
+ ),
6561
+ step.type === "exchange-connect" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
6562
+ ExchangeConnectStep,
6563
+ {
6564
+ smartAccount: step.smartAccount,
6565
+ service,
6566
+ connection: step.connection,
6567
+ onSwappedComplete: handleSwappedComplete,
6568
+ onSwappedFailed: handleDepositFailed,
6569
+ onClose: _nullishCoalesce(onClose, () => ( (() => {
6570
+ }))),
6571
+ onError: handleError
6572
+ }
6573
+ ),
6574
+ step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
6575
+ _chunkDZNXG5JKcjs.ProcessingStep,
6576
+ {
6577
+ smartAccount: step.smartAccount,
6578
+ solanaDepositAddress: step.solanaDepositAddress,
6579
+ txHash: step.txHash,
6580
+ sourceChain: step.sourceChain,
6581
+ sourceToken: step.sourceToken,
6582
+ targetChain,
6583
+ targetToken,
6584
+ amount: step.amount,
6585
+ sourceSymbol: step.sourceSymbol,
6586
+ sourceDecimals: step.sourceDecimals,
6587
+ hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess', _219 => _219.length])),
6588
+ service,
6589
+ directTransfer: step.directTransfer,
6590
+ onClose,
6591
+ onNewDeposit: handleNewDeposit,
6592
+ onDepositComplete: handleDepositComplete,
6593
+ onDepositFailed: handleDepositFailed,
6594
+ onError: handleError,
6595
+ debug
6596
+ }
6597
+ )
6598
+ ]
6599
+ }
6600
+ );
6601
+ }
5473
6602
  if (isSolanaWalletMode) {
5474
6603
  if (!dappAddress) return null;
5475
- const solanaAddr = _optionalChain([reownWallet, 'optionalAccess', _186 => _186.solanaAddress]);
5476
- const solanaProvider = _optionalChain([reownWallet, 'optionalAccess', _187 => _187.solanaProvider]);
6604
+ const solanaAddr = _optionalChain([reownWallet, 'optionalAccess', _220 => _220.solanaAddress]);
6605
+ const solanaProvider = _optionalChain([reownWallet, 'optionalAccess', _221 => _221.solanaProvider]);
5477
6606
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
5478
6607
  effectiveStep.type === "setup" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
5479
6608
  AccountPreparingSkeleton,
@@ -5529,7 +6658,7 @@ function DepositFlow({
5529
6658
  targetToken,
5530
6659
  service,
5531
6660
  solanaProvider,
5532
- solanaConnection: _optionalChain([reownWallet, 'optionalAccess', _188 => _188.solanaConnection]),
6661
+ solanaConnection: _optionalChain([reownWallet, 'optionalAccess', _222 => _222.solanaConnection]),
5533
6662
  uiConfig,
5534
6663
  onConfirm: handleSolanaConfirmed,
5535
6664
  onError: handleError,
@@ -5570,7 +6699,7 @@ function DepositFlow({
5570
6699
  ) })
5571
6700
  ] }) : null,
5572
6701
  effectiveStep.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
5573
- _chunk2TWQGPPBcjs.ProcessingStep,
6702
+ _chunkDZNXG5JKcjs.ProcessingStep,
5574
6703
  {
5575
6704
  smartAccount: effectiveStep.smartAccount,
5576
6705
  solanaDepositAddress: effectiveStep.solanaDepositAddress,
@@ -5582,7 +6711,7 @@ function DepositFlow({
5582
6711
  amount: effectiveStep.amount,
5583
6712
  sourceSymbol: effectiveStep.sourceSymbol,
5584
6713
  sourceDecimals: effectiveStep.sourceDecimals,
5585
- hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess', _189 => _189.length])),
6714
+ hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess', _223 => _223.length])),
5586
6715
  service,
5587
6716
  directTransfer: effectiveStep.directTransfer,
5588
6717
  onClose,
@@ -5595,16 +6724,16 @@ function DepositFlow({
5595
6724
  )
5596
6725
  ] });
5597
6726
  }
5598
- if (!_optionalChain([signerContext, 'optionalAccess', _190 => _190.walletClient]) || !_optionalChain([signerContext, 'optionalAccess', _191 => _191.publicClient])) {
6727
+ if (!_optionalChain([signerContext, 'optionalAccess', _224 => _224.walletClient]) || !_optionalChain([signerContext, 'optionalAccess', _225 => _225.publicClient])) {
5599
6728
  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" }) }) }) }) });
5600
6729
  }
5601
6730
  const ownerAddress = signerContext.ownerAddress;
5602
- const ownerChainId = _nullishCoalesce(_nullishCoalesce(_optionalChain([signerContext, 'access', _192 => _192.walletClient, 'optionalAccess', _193 => _193.chain, 'optionalAccess', _194 => _194.id]), () => ( _optionalChain([signerContext, 'access', _195 => _195.publicClient, 'access', _196 => _196.chain, 'optionalAccess', _197 => _197.id]))), () => ( setupChainId));
6731
+ 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));
5603
6732
  const getReadClientForChain = (chainId) => {
5604
- if (_optionalChain([signerContext, 'access', _198 => _198.publicClient, 'access', _199 => _199.chain, 'optionalAccess', _200 => _200.id]) === chainId) {
6733
+ if (_optionalChain([signerContext, 'access', _232 => _232.publicClient, 'access', _233 => _233.chain, 'optionalAccess', _234 => _234.id]) === chainId) {
5605
6734
  return signerContext.publicClient;
5606
6735
  }
5607
- return _chunk2TWQGPPBcjs.getPublicClient.call(void 0, chainId);
6736
+ return _chunkDZNXG5JKcjs.getPublicClient.call(void 0, chainId);
5608
6737
  };
5609
6738
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
5610
6739
  effectiveStep.type === "setup" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
@@ -5635,7 +6764,7 @@ function DepositFlow({
5635
6764
  effectiveStep.type === "dapp-import-asset-select" && activeDappImportProvider && activeDappImportAvailability && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
5636
6765
  DappImportAssetSelectStep,
5637
6766
  {
5638
- sourceLabel: _nullishCoalesce(_optionalChain([activeDappImportAvailability, 'access', _201 => _201.assets, 'access', _202 => _202[0], 'optionalAccess', _203 => _203.sourceLabel]), () => ( activeDappImportProvider.label)),
6767
+ sourceLabel: _nullishCoalesce(_optionalChain([activeDappImportAvailability, 'access', _235 => _235.assets, 'access', _236 => _236[0], 'optionalAccess', _237 => _237.sourceLabel]), () => ( activeDappImportProvider.label)),
5639
6768
  assets: activeDappImportAvailability.assets,
5640
6769
  onSelect: handleDappImportAssetSelected
5641
6770
  }
@@ -5652,7 +6781,7 @@ function DepositFlow({
5652
6781
  chainId: effectiveStep.asset.depositChainId,
5653
6782
  token: effectiveStep.asset.depositToken
5654
6783
  } : void 0,
5655
- defaultAmount: _nullishCoalesce(effectiveStep.amount, () => ( defaultAmount)),
6784
+ defaultAmount: _nullishCoalesce(effectiveStep.inputAmountUsd, () => ( defaultAmount)),
5656
6785
  switchChain: signerContext.switchChain,
5657
6786
  targetChain,
5658
6787
  targetToken,
@@ -5662,7 +6791,7 @@ function DepositFlow({
5662
6791
  onContinue: handleAmountContinue,
5663
6792
  onCtaClick: (ctaName) => {
5664
6793
  const receiveSymbol = _chunk7JIDIX27cjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain);
5665
- _optionalChain([onEvent, 'optionalCall', _204 => _204({
6794
+ _optionalChain([onEvent, 'optionalCall', _238 => _238({
5666
6795
  type: "deposit_modal_connected_wallet_enter_value_cta_click",
5667
6796
  send_token: effectiveStep.asset.symbol,
5668
6797
  receive_token: receiveSymbol,
@@ -5713,7 +6842,7 @@ function DepositFlow({
5713
6842
  }
5714
6843
  ),
5715
6844
  effectiveStep.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
5716
- _chunk2TWQGPPBcjs.ProcessingStep,
6845
+ _chunkDZNXG5JKcjs.ProcessingStep,
5717
6846
  {
5718
6847
  smartAccount: effectiveStep.smartAccount,
5719
6848
  solanaDepositAddress: effectiveStep.solanaDepositAddress,
@@ -5725,7 +6854,7 @@ function DepositFlow({
5725
6854
  amount: effectiveStep.amount,
5726
6855
  sourceSymbol: effectiveStep.sourceSymbol,
5727
6856
  sourceDecimals: effectiveStep.sourceDecimals,
5728
- hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess', _205 => _205.length])),
6857
+ hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess', _239 => _239.length])),
5729
6858
  service,
5730
6859
  directTransfer: effectiveStep.directTransfer,
5731
6860
  uiConfig,
@@ -5757,15 +6886,15 @@ function formatDate(iso) {
5757
6886
  month: "short",
5758
6887
  year: "numeric"
5759
6888
  });
5760
- } catch (e29) {
6889
+ } catch (e32) {
5761
6890
  return iso;
5762
6891
  }
5763
6892
  }
5764
6893
  function resolveChainId(value) {
5765
6894
  if (value === void 0 || value === null) return null;
5766
6895
  if (typeof value === "number") return value;
5767
- if (_chunk2TWQGPPBcjs.isSolanaCaip2.call(void 0, value) || value === "solana") return "solana";
5768
- const parsed = _chunk2TWQGPPBcjs.parseEvmChainId.call(void 0, value);
6896
+ if (_chunkDZNXG5JKcjs.isSolanaCaip2.call(void 0, value) || value === "solana") return "solana";
6897
+ const parsed = _chunkDZNXG5JKcjs.parseEvmChainId.call(void 0, value);
5769
6898
  if (parsed !== null) return parsed;
5770
6899
  const num = Number(value);
5771
6900
  return Number.isFinite(num) ? num : null;
@@ -5815,7 +6944,7 @@ function formatAmount(rawAmount, token, chainId) {
5815
6944
  let frac = fracStr.slice(0, 5).replace(/0+$/, "");
5816
6945
  if (frac.length < 2) frac = frac.padEnd(2, "0");
5817
6946
  return `${whole}.${frac}`;
5818
- } catch (e30) {
6947
+ } catch (e33) {
5819
6948
  return rawAmount;
5820
6949
  }
5821
6950
  }
@@ -5864,7 +6993,7 @@ function DepositHistoryPanel({
5864
6993
  );
5865
6994
  const visibleDeposits = _react.useMemo.call(void 0, () => {
5866
6995
  const sourceHashes = new Set(
5867
- deposits.map((d) => _optionalChain([d, 'access', _206 => _206.sourceTxHash, 'optionalAccess', _207 => _207.toLowerCase, 'call', _208 => _208()])).filter((h) => Boolean(h))
6996
+ deposits.map((d) => _optionalChain([d, 'access', _240 => _240.sourceTxHash, 'optionalAccess', _241 => _241.toLowerCase, 'call', _242 => _242()])).filter((h) => Boolean(h))
5868
6997
  );
5869
6998
  return deposits.filter(
5870
6999
  (d) => !(d.txHash && sourceHashes.has(d.txHash.toLowerCase()))
@@ -5886,7 +7015,7 @@ function DepositHistoryPanel({
5886
7015
  className: "rs-modal-header-back",
5887
7016
  "aria-label": "Back",
5888
7017
  onClick: onClose,
5889
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.ChevronLeftIcon, {})
7018
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDZNXG5JKcjs.ChevronLeftIcon, {})
5890
7019
  }
5891
7020
  ) }),
5892
7021
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-header-nav-right", children: onCloseModal && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
@@ -5896,29 +7025,29 @@ function DepositHistoryPanel({
5896
7025
  className: "rs-modal-close",
5897
7026
  "aria-label": "Close",
5898
7027
  onClick: onCloseModal,
5899
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.CloseIcon, {})
7028
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDZNXG5JKcjs.CloseIcon, {})
5900
7029
  }
5901
7030
  ) })
5902
7031
  ] }),
5903
7032
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-screen", children: [
5904
7033
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-screen-body", children: [
5905
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.HistoryIcon, {}), title: "History" }),
7034
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDZNXG5JKcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDZNXG5JKcjs.HistoryIcon, {}), title: "History" }),
5906
7035
  isLoading && deposits.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty", children: [
5907
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.HistoryIcon, {}) }),
7036
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDZNXG5JKcjs.HistoryIcon, {}) }),
5908
7037
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty-text", children: [
5909
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.Spinner, { className: "rs-spinner--sm" }),
7038
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDZNXG5JKcjs.Spinner, { className: "rs-spinner--sm" }),
5910
7039
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-hint", children: "Loading history\u2026" })
5911
7040
  ] })
5912
7041
  ] }),
5913
7042
  error && !isLoading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty", children: [
5914
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.AlertTriangleIcon, {}) }),
7043
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDZNXG5JKcjs.AlertTriangleIcon, {}) }),
5915
7044
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty-text", children: [
5916
7045
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-title", children: "Couldn't load history" }),
5917
7046
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-hint", children: error })
5918
7047
  ] })
5919
7048
  ] }),
5920
7049
  !isLoading && !error && visibleDeposits.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty", children: [
5921
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.HistoryIcon, {}) }),
7050
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDZNXG5JKcjs.HistoryIcon, {}) }),
5922
7051
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty-text", children: [
5923
7052
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-title", children: "No deposits yet" }),
5924
7053
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-hint", children: "Your deposit history will appear here" })
@@ -5938,7 +7067,7 @@ function DepositHistoryPanel({
5938
7067
  )
5939
7068
  ] })
5940
7069
  ] }),
5941
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.PoweredBy, {})
7070
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDZNXG5JKcjs.PoweredBy, {})
5942
7071
  ] })
5943
7072
  ]
5944
7073
  }
@@ -5986,7 +7115,7 @@ function HistoryCard({ deposit }) {
5986
7115
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: `rs-history-badge rs-history-badge--${status}`, children: STATUS_LABEL[status] })
5987
7116
  ] })
5988
7117
  ] }),
5989
- expanded && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-card-details", children: [
7118
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-history-card-panel", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-history-card-panel-inner", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-card-details", children: [
5990
7119
  sourceChainName && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
5991
7120
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Source chain" }),
5992
7121
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-amount-detail-value", children: [
@@ -6013,12 +7142,12 @@ function HistoryCard({ deposit }) {
6013
7142
  onClick: (e) => e.stopPropagation(),
6014
7143
  children: [
6015
7144
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: shortenHash(deposit.sourceTxHash) }),
6016
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.ArrowUpRightIcon, {})
7145
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDZNXG5JKcjs.ArrowUpRightIcon, {})
6017
7146
  ]
6018
7147
  }
6019
7148
  )
6020
7149
  ] })
6021
- ] })
7150
+ ] }) }) })
6022
7151
  ]
6023
7152
  }
6024
7153
  );
@@ -6028,7 +7157,7 @@ DepositHistoryPanel.displayName = "DepositHistoryPanel";
6028
7157
  // src/DepositModal.tsx
6029
7158
 
6030
7159
  var ReownDepositInner = _react.lazy.call(void 0,
6031
- () => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-KXFF6ZXY.cjs"))).then((m) => ({ default: m.DepositModalReown }))
7160
+ () => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-CXPRZRXL.cjs"))).then((m) => ({ default: m.DepositModalReown }))
6032
7161
  );
6033
7162
  function sortByCreatedAtDesc(items) {
6034
7163
  return [...items].sort((a, b) => {
@@ -6084,6 +7213,10 @@ function DepositModalInner({
6084
7213
  forceRegister = false,
6085
7214
  enableSolana = true,
6086
7215
  dappImports,
7216
+ enableFiatOnramp = false,
7217
+ enableQrTransfer = true,
7218
+ fiatOnrampMethods,
7219
+ enableExchangeConnect = false,
6087
7220
  postBridgeActions,
6088
7221
  outputTokenRules,
6089
7222
  rejectUnmapped,
@@ -6102,12 +7235,12 @@ function DepositModalInner({
6102
7235
  debug
6103
7236
  }) {
6104
7237
  const modalRef = _react.useRef.call(void 0, null);
6105
- const onReadyRef = _chunk2TWQGPPBcjs.useLatestRef.call(void 0, onReady);
7238
+ const onReadyRef = _chunkDZNXG5JKcjs.useLatestRef.call(void 0, onReady);
6106
7239
  const [currentScreen, setCurrentScreen] = _react.useState.call(void 0, "connect");
6107
7240
  const [backHandler, setBackHandler] = _react.useState.call(void 0,
6108
7241
  void 0
6109
7242
  );
6110
- const showHistoryButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _209 => _209.showHistoryButton]), () => ( false));
7243
+ const showHistoryButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _243 => _243.showHistoryButton]), () => ( false));
6111
7244
  const historyButtonVisible = showHistoryButton && (currentScreen === "select-asset" || currentScreen === "deposit-address");
6112
7245
  const [historyOpen, setHistoryOpen] = _react.useState.call(void 0, false);
6113
7246
  const [historyDeposits, setHistoryDeposits] = _react.useState.call(void 0, []);
@@ -6121,7 +7254,7 @@ function DepositModalInner({
6121
7254
  const targetChain = targetChainProp === "solana" ? "solana" : _chunk7JIDIX27cjs.getChainId.call(void 0, targetChainProp);
6122
7255
  const sourceChain = sourceChainProp ? _chunk7JIDIX27cjs.getChainId.call(void 0, sourceChainProp) : void 0;
6123
7256
  const service = _react.useMemo.call(void 0,
6124
- () => _chunk2TWQGPPBcjs.createDepositService.call(void 0, backendUrl, {
7257
+ () => _chunkDZNXG5JKcjs.createDepositService.call(void 0, backendUrl, {
6125
7258
  debug,
6126
7259
  debugScope: "service:deposit"
6127
7260
  }),
@@ -6137,7 +7270,7 @@ function DepositModalInner({
6137
7270
  }, [store, targetChain, targetToken]);
6138
7271
  _react.useEffect.call(void 0, () => {
6139
7272
  if (isOpen && modalRef.current) {
6140
- _chunk2TWQGPPBcjs.applyTheme.call(void 0, modalRef.current, theme);
7273
+ _chunkDZNXG5JKcjs.applyTheme.call(void 0, modalRef.current, theme);
6141
7274
  }
6142
7275
  }, [isOpen, theme]);
6143
7276
  _react.useEffect.call(void 0, () => {
@@ -6145,7 +7278,7 @@ function DepositModalInner({
6145
7278
  }, [solanaRpcUrl]);
6146
7279
  _react.useEffect.call(void 0, () => {
6147
7280
  if (isOpen) {
6148
- _optionalChain([onReadyRef, 'access', _210 => _210.current, 'optionalCall', _211 => _211()]);
7281
+ _optionalChain([onReadyRef, 'access', _244 => _244.current, 'optionalCall', _245 => _245()]);
6149
7282
  }
6150
7283
  }, [isOpen, onReadyRef]);
6151
7284
  const handleStepChange = _react.useCallback.call(void 0,
@@ -6221,10 +7354,10 @@ function DepositModalInner({
6221
7354
  fetchHistory("initial");
6222
7355
  }
6223
7356
  }, [historyOpen, fetchHistory]);
6224
- const onLifecycleRef = _chunk2TWQGPPBcjs.useLatestRef.call(void 0, onLifecycle);
7357
+ const onLifecycleRef = _chunkDZNXG5JKcjs.useLatestRef.call(void 0, onLifecycle);
6225
7358
  const handleLifecycle = _react.useCallback.call(void 0,
6226
7359
  (event) => {
6227
- _optionalChain([onLifecycleRef, 'access', _212 => _212.current, 'optionalCall', _213 => _213(event)]);
7360
+ _optionalChain([onLifecycleRef, 'access', _246 => _246.current, 'optionalCall', _247 => _247(event)]);
6228
7361
  if (event.type === "smart-account-changed" && !event.evm && !event.solana) {
6229
7362
  historyStaleRef.current = true;
6230
7363
  }
@@ -6250,10 +7383,10 @@ function DepositModalInner({
6250
7383
  store.dispatch({ type: "flow/reset" });
6251
7384
  }
6252
7385
  }, [isOpen, store]);
6253
- const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _214 => _214.showBackButton]), () => ( true));
7386
+ const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _248 => _248.showBackButton]), () => ( true));
6254
7387
  const canGoBack = backHandler !== void 0;
6255
7388
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DepositStoreProvider, { store, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
6256
- _chunk2TWQGPPBcjs.Modal,
7389
+ _chunkDZNXG5JKcjs.Modal,
6257
7390
  {
6258
7391
  isOpen,
6259
7392
  onClose,
@@ -6269,7 +7402,7 @@ function DepositModalInner({
6269
7402
  className: "rs-modal-header-back",
6270
7403
  "aria-label": "Go back",
6271
7404
  onClick: backHandler,
6272
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.ChevronLeftIcon, {})
7405
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDZNXG5JKcjs.ChevronLeftIcon, {})
6273
7406
  }
6274
7407
  ) }),
6275
7408
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-header-nav-right", children: [
@@ -6281,7 +7414,7 @@ function DepositModalInner({
6281
7414
  "aria-label": "Deposit history",
6282
7415
  onClick: handleHistoryOpen,
6283
7416
  disabled: !recipient,
6284
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.HistoryIcon, {})
7417
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDZNXG5JKcjs.HistoryIcon, {})
6285
7418
  }
6286
7419
  ),
6287
7420
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
@@ -6291,7 +7424,7 @@ function DepositModalInner({
6291
7424
  onClick: onClose,
6292
7425
  className: "rs-modal-close",
6293
7426
  "aria-label": "Close",
6294
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.CloseIcon, {})
7427
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDZNXG5JKcjs.CloseIcon, {})
6295
7428
  }
6296
7429
  )
6297
7430
  ] })
@@ -6319,6 +7452,10 @@ function DepositModalInner({
6319
7452
  forceRegister,
6320
7453
  enableSolana,
6321
7454
  dappImports,
7455
+ enableFiatOnramp,
7456
+ enableQrTransfer,
7457
+ fiatOnrampMethods,
7458
+ enableExchangeConnect,
6322
7459
  reownWallet,
6323
7460
  onConnect,
6324
7461
  onDisconnect,