@rhinestone/deposit-modal 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -67,7 +67,8 @@ var _chunkNRNJAQUAcjs = require('./chunk-NRNJAQUA.cjs');
67
67
 
68
68
 
69
69
 
70
- var _chunkPPFG3VBDcjs = require('./chunk-PPFG3VBD.cjs');
70
+
71
+ var _chunkZDYV536Qcjs = require('./chunk-ZDYV536Q.cjs');
71
72
 
72
73
 
73
74
  var _chunkUEKPBRBYcjs = require('./chunk-UEKPBRBY.cjs');
@@ -145,12 +146,12 @@ function AssetSelectStep({
145
146
  const [error, setError] = _react.useState.call(void 0, null);
146
147
  const defaultAssetId = _react.useMemo.call(void 0, () => {
147
148
  if (!defaultSourceChain || !defaultSourceToken) return null;
148
- return _chunkPPFG3VBDcjs.getAssetId.call(void 0, {
149
+ return _chunkZDYV536Qcjs.getAssetId.call(void 0, {
149
150
  chainId: defaultSourceChain,
150
151
  token: defaultSourceToken
151
152
  });
152
153
  }, [defaultSourceChain, defaultSourceToken]);
153
- const onTotalBalanceComputedRef = _chunkPPFG3VBDcjs.useLatestRef.call(void 0, onTotalBalanceComputed);
154
+ const onTotalBalanceComputedRef = _chunkZDYV536Qcjs.useLatestRef.call(void 0, onTotalBalanceComputed);
154
155
  _react.useEffect.call(void 0, () => {
155
156
  let active = true;
156
157
  function emitAssetsUpdate(currentAssets) {
@@ -170,7 +171,7 @@ function AssetSelectStep({
170
171
  try {
171
172
  const portfolio = await service.fetchPortfolio(address);
172
173
  if (!active) return;
173
- const portfolioAssets = _chunkPPFG3VBDcjs.portfolioToAssets.call(void 0, portfolio.tokens);
174
+ const portfolioAssets = _chunkZDYV536Qcjs.portfolioToAssets.call(void 0, portfolio.tokens);
174
175
  setAssets(portfolioAssets);
175
176
  emitAssetsUpdate(portfolioAssets);
176
177
  const hasNative = portfolioAssets.some(
@@ -246,7 +247,7 @@ function AssetSelectStep({
246
247
  const raw = _viem.formatUnits.call(void 0, BigInt(asset.balance), asset.decimals);
247
248
  const numeric = Number(raw);
248
249
  if (!Number.isFinite(numeric)) return raw;
249
- return _chunkPPFG3VBDcjs.tokenFormatter.format(numeric);
250
+ return _chunkZDYV536Qcjs.tokenFormatter.format(numeric);
250
251
  } catch (e3) {
251
252
  return asset.balance;
252
253
  }
@@ -254,20 +255,20 @@ function AssetSelectStep({
254
255
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
255
256
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
256
257
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
257
- _chunkPPFG3VBDcjs.BodyHeader,
258
+ _chunkZDYV536Qcjs.BodyHeader,
258
259
  {
259
- icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.WalletIcon, {}),
260
+ icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.WalletIcon, {}),
260
261
  title: "Your assets",
261
262
  subtitle: "Select source assets to transfer"
262
263
  }
263
264
  ),
264
265
  loading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
265
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.Spinner, { className: "rs-text-tertiary" }),
266
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.Spinner, { className: "rs-text-tertiary" }),
266
267
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
267
268
  ] }),
268
- error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.Callout, { variant: "error", children: error }),
269
+ error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.Callout, { variant: "error", children: error }),
269
270
  !loading && !error && rows.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-state", children: [
270
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.WalletIcon, { className: "rs-empty-icon" }),
271
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.WalletIcon, { className: "rs-empty-icon" }),
271
272
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-empty-text", children: "No funds in connected wallet" }),
272
273
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-address", children: [
273
274
  address.slice(0, 6),
@@ -334,14 +335,14 @@ function AssetSelectStep({
334
335
  ] })
335
336
  ] })
336
337
  ] }),
337
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: asset.balanceUsd !== void 0 && asset.balanceUsd > 0 ? _chunkPPFG3VBDcjs.currencyFormatter.format(asset.balanceUsd) : tokenAmount !== "--" ? `${tokenAmount} ${asset.symbol}` : "--" })
338
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: asset.balanceUsd !== void 0 && asset.balanceUsd > 0 ? _chunkZDYV536Qcjs.currencyFormatter.format(asset.balanceUsd) : tokenAmount !== "--" ? `${tokenAmount} ${asset.symbol}` : "--" })
338
339
  ]
339
340
  },
340
341
  asset.id
341
342
  );
342
343
  }) }),
343
344
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
344
- _chunkPPFG3VBDcjs.Button,
345
+ _chunkZDYV536Qcjs.Button,
345
346
  {
346
347
  onClick: () => selectedAsset && onContinue(selectedAsset),
347
348
  disabled: !selectedAsset,
@@ -350,7 +351,7 @@ function AssetSelectStep({
350
351
  }
351
352
  )
352
353
  ] }),
353
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.PoweredBy, {})
354
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.PoweredBy, {})
354
355
  ] });
355
356
  }
356
357
  async function fetchNativeAssets(address, publicClient, existing) {
@@ -358,7 +359,7 @@ async function fetchNativeAssets(address, publicClient, existing) {
358
359
  const connectedChainId = _optionalChain([publicClient, 'access', _8 => _8.chain, 'optionalAccess', _9 => _9.id]);
359
360
  if (!connectedChainId) return [];
360
361
  if (!_chunkABVRVW3Pcjs.SOURCE_CHAINS.some((chain) => chain.id === connectedChainId)) return [];
361
- const id = _chunkPPFG3VBDcjs.getAssetId.call(void 0, {
362
+ const id = _chunkZDYV536Qcjs.getAssetId.call(void 0, {
362
363
  chainId: connectedChainId,
363
364
  token: _chunkABVRVW3Pcjs.NATIVE_TOKEN_ADDRESS
364
365
  });
@@ -555,7 +556,7 @@ function AmountStep({
555
556
  const balanceTarget = _nullishCoalesce(balanceAddress, () => ( address));
556
557
  if (!balanceTarget || !publicClient) return;
557
558
  try {
558
- const bal = _chunkPPFG3VBDcjs.isNativeAsset.call(void 0, asset) ? await publicClient.getBalance({ address: balanceTarget }) : await publicClient.readContract({
559
+ const bal = _chunkZDYV536Qcjs.isNativeAsset.call(void 0, asset) ? await publicClient.getBalance({ address: balanceTarget }) : await publicClient.readContract({
559
560
  address: asset.token,
560
561
  abi: _viem.erc20Abi,
561
562
  functionName: "balanceOf",
@@ -576,7 +577,7 @@ function AmountStep({
576
577
  hasAttemptedSwitch.current = true;
577
578
  switchChain(asset.chainId).catch((err) => {
578
579
  const raw = err instanceof Error ? err.message : "Failed to switch chain";
579
- setError(_chunkPPFG3VBDcjs.formatUserError.call(void 0, raw));
580
+ setError(_chunkZDYV536Qcjs.formatUserError.call(void 0, raw));
580
581
  });
581
582
  }
582
583
  }, [chainMismatch, switchChain, asset.chainId]);
@@ -629,7 +630,7 @@ function AmountStep({
629
630
  const raw = _viem.formatUnits.call(void 0, balance, asset.decimals);
630
631
  const numeric = Number(raw);
631
632
  if (!Number.isFinite(numeric)) return raw;
632
- return _chunkPPFG3VBDcjs.tokenFormatter.format(numeric);
633
+ return _chunkZDYV536Qcjs.tokenFormatter.format(numeric);
633
634
  } catch (e8) {
634
635
  return "\u2026";
635
636
  }
@@ -750,7 +751,7 @@ function AmountStep({
750
751
  const targetTokenIcon = _chunkABVRVW3Pcjs.getTokenIcon.call(void 0, targetSymbol);
751
752
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
752
753
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
753
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.WalletIcon, {}), title: "Wallet deposit" }),
754
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.WalletIcon, {}), title: "Wallet deposit" }),
754
755
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-section", children: [
755
756
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-display", children: [
756
757
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
@@ -770,13 +771,13 @@ function AmountStep({
770
771
  " available",
771
772
  balanceUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
772
773
  " (~",
773
- _chunkPPFG3VBDcjs.currencyFormatter.format(balanceUsd),
774
+ _chunkZDYV536Qcjs.currencyFormatter.format(balanceUsd),
774
775
  ")"
775
776
  ] })
776
777
  ] }),
777
778
  minDepositUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-amount-meta-minimum", children: [
778
779
  "Min. deposit ",
779
- _chunkPPFG3VBDcjs.currencyFormatter.format(minDepositUsd)
780
+ _chunkZDYV536Qcjs.currencyFormatter.format(minDepositUsd)
780
781
  ] })
781
782
  ] })
782
783
  ] }),
@@ -817,13 +818,13 @@ function AmountStep({
817
818
  ] }),
818
819
  balanceAfterUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
819
820
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Balance after deposit" }),
820
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children: _chunkPPFG3VBDcjs.currencyFormatter.format(balanceAfterUsd) })
821
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children: _chunkZDYV536Qcjs.currencyFormatter.format(balanceAfterUsd) })
821
822
  ] })
822
823
  ] }),
823
- targetChain === _chunkABVRVW3Pcjs.HYPERCORE_CHAIN_ID && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.Callout, { variant: "warning", children: "First deposit to a new HyperCore account includes a ~1 USDC activation fee." }),
824
- error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.Callout, { variant: "error", children: error }),
824
+ targetChain === _chunkABVRVW3Pcjs.HYPERCORE_CHAIN_ID && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.Callout, { variant: "warning", children: "First deposit to a new HyperCore account includes a ~1 USDC activation fee." }),
825
+ error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.Callout, { variant: "error", children: error }),
825
826
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
826
- _chunkPPFG3VBDcjs.Button,
827
+ _chunkZDYV536Qcjs.Button,
827
828
  {
828
829
  onClick: handleContinue,
829
830
  fullWidth: true,
@@ -834,7 +835,7 @@ function AmountStep({
834
835
  }
835
836
  )
836
837
  ] }),
837
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.PoweredBy, {})
838
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.PoweredBy, {})
838
839
  ] });
839
840
  }
840
841
 
@@ -881,16 +882,16 @@ function ConfirmStep({
881
882
  const targetChainIcon = _chunkABVRVW3Pcjs.getChainIcon.call(void 0, targetChain);
882
883
  const sourceTokenIcon = _chunkABVRVW3Pcjs.getTokenIcon.call(void 0, asset.symbol);
883
884
  const targetTokenIcon = _chunkABVRVW3Pcjs.getTokenIcon.call(void 0, targetSymbol);
884
- const formattedSendAmount = amount && Number.isFinite(Number(amount)) ? _nullishCoalesce(_chunkPPFG3VBDcjs.formatTokenAmount.call(void 0, Number(amount), asset.symbol), () => ( "0")) : "0";
885
+ const formattedSendAmount = amount && Number.isFinite(Number(amount)) ? _nullishCoalesce(_chunkZDYV536Qcjs.formatTokenAmount.call(void 0, Number(amount), asset.symbol), () => ( "0")) : "0";
885
886
  const receiveDisplay = (() => {
886
887
  if (sameRoute) return `${formattedSendAmount} ${asset.symbol}`;
887
888
  if (quote) {
888
- const quoted = _chunkPPFG3VBDcjs.formatQuotedReceive.call(void 0, quote.output, targetSymbol);
889
+ const quoted = _chunkZDYV536Qcjs.formatQuotedReceive.call(void 0, quote.output, targetSymbol);
889
890
  if (quoted !== void 0) return quoted;
890
891
  }
891
892
  const usdValue = Number(targetAmount);
892
893
  const sourceAmountUsd = Number.isFinite(usdValue) && usdValue > 0 ? usdValue : void 0;
893
- const estimate = _chunkPPFG3VBDcjs.formatReceiveEstimate.call(void 0, {
894
+ const estimate = _chunkZDYV536Qcjs.formatReceiveEstimate.call(void 0, {
894
895
  sourceAmount: Number.isFinite(Number(amount)) ? Number(amount) : void 0,
895
896
  sourceSymbol: asset.symbol,
896
897
  targetSymbol,
@@ -909,7 +910,7 @@ function ConfirmStep({
909
910
  hasAttemptedSwitch.current = true;
910
911
  switchChain(asset.chainId).catch((err) => {
911
912
  const raw = err instanceof Error ? err.message : "Failed to switch chain";
912
- setError(_chunkPPFG3VBDcjs.formatUserError.call(void 0, raw));
913
+ setError(_chunkZDYV536Qcjs.formatUserError.call(void 0, raw));
913
914
  });
914
915
  }
915
916
  }, [chainMismatch, switchChain, asset.chainId]);
@@ -989,7 +990,7 @@ function ConfirmStep({
989
990
  const result = await executeTransfer(amountUnits);
990
991
  hash = result.txHash;
991
992
  resolvedSourceToken = result.sourceToken;
992
- } else if (_chunkPPFG3VBDcjs.isNativeAsset.call(void 0, asset)) {
993
+ } else if (_chunkZDYV536Qcjs.isNativeAsset.call(void 0, asset)) {
993
994
  hash = await walletClient.sendTransaction({
994
995
  account,
995
996
  chain,
@@ -1010,7 +1011,7 @@ function ConfirmStep({
1010
1011
  onConfirm(hash, asset.chainId, amountUnits.toString(), resolvedSourceToken);
1011
1012
  } catch (err) {
1012
1013
  const raw = err instanceof Error ? err.message : "Transfer failed";
1013
- const message = _chunkPPFG3VBDcjs.formatUserError.call(void 0, raw);
1014
+ const message = _chunkZDYV536Qcjs.formatUserError.call(void 0, raw);
1014
1015
  setError(message);
1015
1016
  _optionalChain([onError, 'optionalCall', _29 => _29(message, "TRANSFER_ERROR")]);
1016
1017
  } finally {
@@ -1019,7 +1020,7 @@ function ConfirmStep({
1019
1020
  };
1020
1021
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
1021
1022
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
1022
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.WalletIcon, {}), title: "Review deposit" }),
1023
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.WalletIcon, {}), title: "Review deposit" }),
1023
1024
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-details", children: [
1024
1025
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
1025
1026
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Source chain" }),
@@ -1073,14 +1074,14 @@ function ConfirmStep({
1073
1074
  children: feeDisplay
1074
1075
  }
1075
1076
  ),
1076
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.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, _chunkPPFG3VBDcjs.InfoIcon, {}) }) })
1077
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.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, _chunkZDYV536Qcjs.InfoIcon, {}) }) })
1077
1078
  ] })
1078
1079
  ] })
1079
1080
  ] }),
1080
- targetChain === _chunkABVRVW3Pcjs.HYPERCORE_CHAIN_ID && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.Callout, { variant: "warning", children: "First deposit to a new HyperCore account includes a ~1 USDC activation fee." }),
1081
- error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.Callout, { variant: "error", children: error }),
1081
+ targetChain === _chunkABVRVW3Pcjs.HYPERCORE_CHAIN_ID && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.Callout, { variant: "warning", children: "First deposit to a new HyperCore account includes a ~1 USDC activation fee." }),
1082
+ error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.Callout, { variant: "error", children: error }),
1082
1083
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1083
- _chunkPPFG3VBDcjs.Button,
1084
+ _chunkZDYV536Qcjs.Button,
1084
1085
  {
1085
1086
  onClick: handleConfirm,
1086
1087
  loading: isSubmitting,
@@ -1091,7 +1092,7 @@ function ConfirmStep({
1091
1092
  }
1092
1093
  )
1093
1094
  ] }),
1094
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.PoweredBy, {})
1095
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.PoweredBy, {})
1095
1096
  ] });
1096
1097
  }
1097
1098
 
@@ -1114,9 +1115,9 @@ var INITIAL_POLL_INTERVAL = 3e3;
1114
1115
  var MAX_POLL_INTERVAL = 3e4;
1115
1116
  var BACKOFF_MULTIPLIER = 1.5;
1116
1117
  function isEventForTx(event, txHash) {
1117
- const eventTxHash = _chunkPPFG3VBDcjs.getEventTxHash.call(void 0, event);
1118
+ const eventTxHash = _chunkZDYV536Qcjs.getEventTxHash.call(void 0, event);
1118
1119
  if (!eventTxHash) return false;
1119
- return _chunkPPFG3VBDcjs.txRefsMatch.call(void 0, eventTxHash, txHash);
1120
+ return _chunkZDYV536Qcjs.txRefsMatch.call(void 0, eventTxHash, txHash);
1120
1121
  }
1121
1122
  function truncateHash(hash) {
1122
1123
  return `${hash.slice(0, 4)}\u2026${hash.slice(-4)}`;
@@ -1166,14 +1167,13 @@ function formatBridgeFailedMessage(event) {
1166
1167
  }
1167
1168
  return "Bridge failed";
1168
1169
  }
1169
- var txLinkIcon = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.ExternalLinkIcon, { className: "rs-deposit-notification-link-icon" });
1170
+ var txLinkIcon = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.ExternalLinkIcon, { className: "rs-deposit-notification-link-icon" });
1170
1171
  function DepositNotification({
1171
1172
  deposit,
1172
1173
  smartAccount,
1173
1174
  solanaDepositAddress,
1174
1175
  targetChain,
1175
1176
  targetToken,
1176
- hasPostBridgeActions,
1177
1177
  service,
1178
1178
  onComplete,
1179
1179
  onFailed,
@@ -1201,17 +1201,16 @@ function DepositNotification({
1201
1201
  const pollIntervalRef = _react.useRef.call(void 0, INITIAL_POLL_INTERVAL);
1202
1202
  const pollTimeoutRef = _react.useRef.call(void 0, null);
1203
1203
  const completedRef = _react.useRef.call(void 0, _nullishCoalesce(directTransfer, () => ( false)));
1204
- const depositContextRef = _chunkPPFG3VBDcjs.useLatestRef.call(void 0, {
1204
+ const depositContextRef = _chunkZDYV536Qcjs.useLatestRef.call(void 0, {
1205
1205
  amount,
1206
1206
  sourceChain,
1207
1207
  sourceToken: token,
1208
1208
  sourceDecimals,
1209
1209
  targetChain,
1210
- targetToken,
1211
- hasPostBridgeActions
1210
+ targetToken
1212
1211
  });
1213
- const onCompleteRef = _chunkPPFG3VBDcjs.useLatestRef.call(void 0, onComplete);
1214
- const onFailedRef = _chunkPPFG3VBDcjs.useLatestRef.call(void 0, onFailed);
1212
+ const onCompleteRef = _chunkZDYV536Qcjs.useLatestRef.call(void 0, onComplete);
1213
+ const onFailedRef = _chunkZDYV536Qcjs.useLatestRef.call(void 0, onFailed);
1215
1214
  const handleComplete = _react.useCallback.call(void 0,
1216
1215
  (destTxHash) => {
1217
1216
  if (completedRef.current) return;
@@ -1254,27 +1253,17 @@ function DepositNotification({
1254
1253
  if (!isMounted) return;
1255
1254
  const lastEvent = data.lastEvent;
1256
1255
  const eventForTx = isEventForTx(lastEvent, txHash) ? lastEvent : void 0;
1257
- const awaitingPostBridgeSwap = depositContextRef.current.hasPostBridgeActions;
1258
- if (_optionalChain([eventForTx, 'optionalAccess', _35 => _35.type]) === "post-bridge-swap-complete") {
1259
- const swapTxHash = _optionalChain([eventForTx, 'access', _36 => _36.data, 'optionalAccess', _37 => _37.swap, 'optionalAccess', _38 => _38.transactionHash]);
1260
- handleComplete(swapTxHash);
1261
- return;
1262
- }
1263
- if (_optionalChain([eventForTx, 'optionalAccess', _39 => _39.type]) === "post-bridge-swap-failed") {
1264
- handleFailed(formatBridgeFailedMessage(eventForTx));
1265
- return;
1266
- }
1267
- if (_optionalChain([eventForTx, 'optionalAccess', _40 => _40.type]) === "bridge-complete" && !awaitingPostBridgeSwap) {
1268
- const destTx = _optionalChain([eventForTx, 'access', _41 => _41.data, 'optionalAccess', _42 => _42.destination, 'optionalAccess', _43 => _43.transactionHash]);
1256
+ if (_optionalChain([eventForTx, 'optionalAccess', _35 => _35.type]) === "bridge-complete") {
1257
+ const destTx = _optionalChain([eventForTx, 'access', _36 => _36.data, 'optionalAccess', _37 => _37.destination, 'optionalAccess', _38 => _38.transactionHash]);
1269
1258
  handleComplete(destTx);
1270
1259
  return;
1271
1260
  }
1272
- if (_optionalChain([eventForTx, 'optionalAccess', _44 => _44.type]) === "bridge-failed") {
1261
+ if (_optionalChain([eventForTx, 'optionalAccess', _39 => _39.type]) === "bridge-failed") {
1273
1262
  handleFailed(formatBridgeFailedMessage(eventForTx));
1274
1263
  return;
1275
1264
  }
1276
- if (_optionalChain([eventForTx, 'optionalAccess', _45 => _45.type]) === "error") {
1277
- const errorMessage = _nullishCoalesce(_optionalChain([eventForTx, 'access', _46 => _46.data, 'optionalAccess', _47 => _47.message]), () => ( "Unknown error"));
1265
+ if (_optionalChain([eventForTx, 'optionalAccess', _40 => _40.type]) === "error") {
1266
+ const errorMessage = _nullishCoalesce(_optionalChain([eventForTx, 'access', _41 => _41.data, 'optionalAccess', _42 => _42.message]), () => ( "Unknown error"));
1278
1267
  handleFailed(errorMessage);
1279
1268
  return;
1280
1269
  }
@@ -1316,7 +1305,7 @@ function DepositNotification({
1316
1305
  const destExplorerUrl = destinationTxHash ? _chunkABVRVW3Pcjs.getExplorerTxUrl.call(void 0, targetChain, destinationTxHash) : null;
1317
1306
  const title = status === "complete" ? "Deposit completed" : status === "failed" ? "Deposit failed" : "Deposit received and processing\u2026";
1318
1307
  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.";
1319
- 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, _chunkPPFG3VBDcjs.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, _chunkPPFG3VBDcjs.CloseIcon, {}) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-notification-badge rs-deposit-notification-badge--processing", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
1308
+ 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, _chunkZDYV536Qcjs.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, _chunkZDYV536Qcjs.CloseIcon, {}) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-notification-badge rs-deposit-notification-badge--processing", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
1320
1309
  "svg",
1321
1310
  {
1322
1311
  className: "rs-deposit-notification-spinner",
@@ -1366,7 +1355,7 @@ function DepositNotification({
1366
1355
  className: "rs-deposit-notification-close",
1367
1356
  onClick: () => onDismiss(deposit.id),
1368
1357
  "aria-label": "Dismiss",
1369
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.CloseIcon, {})
1358
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.CloseIcon, {})
1370
1359
  }
1371
1360
  )
1372
1361
  ] }),
@@ -1382,7 +1371,7 @@ function DepositNotification({
1382
1371
  "aria-expanded": expanded,
1383
1372
  children: [
1384
1373
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: expanded ? "See less details" : "See more details" }),
1385
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.ChevronDownIcon, { className: "rs-deposit-notification-toggle-chevron" })
1374
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.ChevronDownIcon, { className: "rs-deposit-notification-toggle-chevron" })
1386
1375
  ]
1387
1376
  }
1388
1377
  ),
@@ -1483,7 +1472,7 @@ function resolveSolanaTokenMeta(token) {
1483
1472
  return {};
1484
1473
  }
1485
1474
  function getDepositEventDetails(event) {
1486
- if (!_optionalChain([event, 'optionalAccess', _48 => _48.type]) || !isRecord(event.data)) return {};
1475
+ if (!_optionalChain([event, 'optionalAccess', _43 => _43.type]) || !isRecord(event.data)) return {};
1487
1476
  if (event.type === "deposit-received") {
1488
1477
  const chainId = asChainId(event.data.chain);
1489
1478
  const token = asString(event.data.token);
@@ -1498,12 +1487,12 @@ function getDepositEventDetails(event) {
1498
1487
  const source = isRecord(event.data.source) ? event.data.source : void 0;
1499
1488
  const deposit = isRecord(event.data.deposit) ? event.data.deposit : void 0;
1500
1489
  if (source || deposit) {
1501
- const chainId = _nullishCoalesce(asChainId(_optionalChain([source, 'optionalAccess', _49 => _49.chain])), () => ( asChainId(_optionalChain([deposit, 'optionalAccess', _50 => _50.chain]))));
1502
- const token = _nullishCoalesce(_nullishCoalesce(asString(_optionalChain([source, 'optionalAccess', _51 => _51.asset])), () => ( asString(_optionalChain([deposit, 'optionalAccess', _52 => _52.asset])))), () => ( asString(_optionalChain([deposit, 'optionalAccess', _53 => _53.token]))));
1490
+ const chainId = _nullishCoalesce(asChainId(_optionalChain([source, 'optionalAccess', _44 => _44.chain])), () => ( asChainId(_optionalChain([deposit, 'optionalAccess', _45 => _45.chain]))));
1491
+ const token = _nullishCoalesce(_nullishCoalesce(asString(_optionalChain([source, 'optionalAccess', _46 => _46.asset])), () => ( asString(_optionalChain([deposit, 'optionalAccess', _47 => _47.asset])))), () => ( asString(_optionalChain([deposit, 'optionalAccess', _48 => _48.token]))));
1503
1492
  const solanaMeta = chainId === "solana" ? resolveSolanaTokenMeta(token) : {};
1504
1493
  return {
1505
1494
  chainId,
1506
- amount: _nullishCoalesce(asAmount(_optionalChain([source, 'optionalAccess', _54 => _54.amount])), () => ( asAmount(_optionalChain([deposit, 'optionalAccess', _55 => _55.amount])))),
1495
+ amount: _nullishCoalesce(asAmount(_optionalChain([source, 'optionalAccess', _49 => _49.amount])), () => ( asAmount(_optionalChain([deposit, 'optionalAccess', _50 => _50.amount])))),
1507
1496
  token,
1508
1497
  ...solanaMeta
1509
1498
  };
@@ -1529,7 +1518,6 @@ function DepositAddressStep({
1529
1518
  allowedRoutes,
1530
1519
  targetChain,
1531
1520
  targetToken,
1532
- hasPostBridgeActions,
1533
1521
  uiConfig,
1534
1522
  onDepositSubmitted,
1535
1523
  onDepositComplete,
@@ -1539,12 +1527,12 @@ function DepositAddressStep({
1539
1527
  }) {
1540
1528
  const hasSolana = Boolean(solanaDepositAddress);
1541
1529
  const allowedChainSet = _react.useMemo.call(void 0,
1542
- () => _optionalChain([allowedRoutes, 'optionalAccess', _56 => _56.sourceChains]) ? new Set(allowedRoutes.sourceChains) : null,
1543
- [_optionalChain([allowedRoutes, 'optionalAccess', _57 => _57.sourceChains])]
1530
+ () => _optionalChain([allowedRoutes, 'optionalAccess', _51 => _51.sourceChains]) ? new Set(allowedRoutes.sourceChains) : null,
1531
+ [_optionalChain([allowedRoutes, 'optionalAccess', _52 => _52.sourceChains])]
1544
1532
  );
1545
1533
  const allowedTokenSet = _react.useMemo.call(void 0,
1546
- () => _optionalChain([allowedRoutes, 'optionalAccess', _58 => _58.sourceTokens]) ? new Set(allowedRoutes.sourceTokens.map((s) => s.toUpperCase())) : null,
1547
- [_optionalChain([allowedRoutes, 'optionalAccess', _59 => _59.sourceTokens])]
1534
+ () => _optionalChain([allowedRoutes, 'optionalAccess', _53 => _53.sourceTokens]) ? new Set(allowedRoutes.sourceTokens.map((s) => s.toUpperCase())) : null,
1535
+ [_optionalChain([allowedRoutes, 'optionalAccess', _54 => _54.sourceTokens])]
1548
1536
  );
1549
1537
  const evmChainIds = _react.useMemo.call(void 0, () => {
1550
1538
  const all = _chunkABVRVW3Pcjs.getSupportedChainIds.call(void 0, );
@@ -1636,8 +1624,8 @@ function DepositAddressStep({
1636
1624
  function handlePointerDown(event) {
1637
1625
  const target = event.target;
1638
1626
  if (!target) return;
1639
- const clickedChainDropdown = _optionalChain([chainDropdownRef, 'access', _60 => _60.current, 'optionalAccess', _61 => _61.contains, 'call', _62 => _62(target)]);
1640
- const clickedTokenDropdown = _optionalChain([tokenDropdownRef, 'access', _63 => _63.current, 'optionalAccess', _64 => _64.contains, 'call', _65 => _65(target)]);
1627
+ const clickedChainDropdown = _optionalChain([chainDropdownRef, 'access', _55 => _55.current, 'optionalAccess', _56 => _56.contains, 'call', _57 => _57(target)]);
1628
+ const clickedTokenDropdown = _optionalChain([tokenDropdownRef, 'access', _58 => _58.current, 'optionalAccess', _59 => _59.contains, 'call', _60 => _60(target)]);
1641
1629
  if (clickedChainDropdown || clickedTokenDropdown) return;
1642
1630
  setChainDropdownOpen(false);
1643
1631
  setTokenDropdownOpen(false);
@@ -1650,7 +1638,7 @@ function DepositAddressStep({
1650
1638
  };
1651
1639
  }, [chainDropdownOpen, tokenDropdownOpen]);
1652
1640
  const handleCopy = _react.useCallback.call(void 0, async () => {
1653
- _optionalChain([onCopyAddress, 'optionalCall', _66 => _66()]);
1641
+ _optionalChain([onCopyAddress, 'optionalCall', _61 => _61()]);
1654
1642
  try {
1655
1643
  await navigator.clipboard.writeText(displayAddress);
1656
1644
  setCopied(true);
@@ -1729,10 +1717,10 @@ function DepositAddressStep({
1729
1717
  return;
1730
1718
  }
1731
1719
  const event = status.lastEvent;
1732
- const eventTxHash = _chunkPPFG3VBDcjs.isDepositEvent.call(void 0, event) ? _nullishCoalesce(_chunkPPFG3VBDcjs.getEventTxHash.call(void 0, event), () => ( null)) : null;
1720
+ const eventTxHash = _chunkZDYV536Qcjs.isDepositEvent.call(void 0, event) ? _nullishCoalesce(_chunkZDYV536Qcjs.getEventTxHash.call(void 0, event), () => ( null)) : null;
1733
1721
  if (baselineTxHashRef.current === void 0) {
1734
1722
  baselineTxHashRef.current = eventTxHash;
1735
- } else if (eventTxHash && (!baselineTxHashRef.current || !_chunkPPFG3VBDcjs.txRefsMatch.call(void 0, eventTxHash, baselineTxHashRef.current))) {
1723
+ } else if (eventTxHash && (!baselineTxHashRef.current || !_chunkZDYV536Qcjs.txRefsMatch.call(void 0, eventTxHash, baselineTxHashRef.current))) {
1736
1724
  const details = getDepositEventDetails(event);
1737
1725
  const chainId = _nullishCoalesce(details.chainId, () => ( "unknown"));
1738
1726
  const amount = _nullishCoalesce(details.amount, () => ( "0"));
@@ -1764,7 +1752,7 @@ function DepositAddressStep({
1764
1752
  directTransfer
1765
1753
  };
1766
1754
  setNotifications((prev) => [notification, ...prev]);
1767
- _optionalChain([onDepositSubmittedRef, 'access', _67 => _67.current, 'optionalCall', _68 => _68({
1755
+ _optionalChain([onDepositSubmittedRef, 'access', _62 => _62.current, 'optionalCall', _63 => _63({
1768
1756
  txHash: eventTxHash,
1769
1757
  sourceChain: chainId,
1770
1758
  amount,
@@ -1776,7 +1764,7 @@ function DepositAddressStep({
1776
1764
  if (!cancelled) {
1777
1765
  const msg = err instanceof Error ? err.message : "Failed to check status";
1778
1766
  setPollingError(msg);
1779
- _optionalChain([onErrorRef, 'access', _69 => _69.current, 'optionalCall', _70 => _70(msg, "STATUS_POLL_ERROR")]);
1767
+ _optionalChain([onErrorRef, 'access', _64 => _64.current, 'optionalCall', _65 => _65(msg, "STATUS_POLL_ERROR")]);
1780
1768
  }
1781
1769
  }
1782
1770
  if (!cancelled) {
@@ -1792,14 +1780,14 @@ function DepositAddressStep({
1792
1780
  const handleNotificationComplete = _react.useCallback.call(void 0,
1793
1781
  (txHash, destinationTxHash, context) => {
1794
1782
  isTrackingRef.current = false;
1795
- _optionalChain([onDepositCompleteRef, 'access', _71 => _71.current, 'optionalCall', _72 => _72(txHash, destinationTxHash, context)]);
1783
+ _optionalChain([onDepositCompleteRef, 'access', _66 => _66.current, 'optionalCall', _67 => _67(txHash, destinationTxHash, context)]);
1796
1784
  },
1797
1785
  []
1798
1786
  );
1799
1787
  const handleNotificationFailed = _react.useCallback.call(void 0,
1800
1788
  (txHash, error) => {
1801
1789
  isTrackingRef.current = false;
1802
- _optionalChain([onDepositFailedRef, 'access', _73 => _73.current, 'optionalCall', _74 => _74(txHash, error)]);
1790
+ _optionalChain([onDepositFailedRef, 'access', _68 => _68.current, 'optionalCall', _69 => _69(txHash, error)]);
1803
1791
  },
1804
1792
  []
1805
1793
  );
@@ -1809,7 +1797,7 @@ function DepositAddressStep({
1809
1797
  const qrIconSrc = _chunkABVRVW3Pcjs.getChainIcon.call(void 0, sourceChainId);
1810
1798
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen rs-step--with-notifications", children: [
1811
1799
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
1812
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.TransferCryptoIcon, {}), title: "Transfer crypto" }),
1800
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.TransferCryptoIcon, {}), title: "Transfer crypto" }),
1813
1801
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-selectors", children: [
1814
1802
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown", ref: chainDropdownRef, children: [
1815
1803
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-dropdown-label", children: "Supported chain" }),
@@ -1833,7 +1821,7 @@ function DepositAddressStep({
1833
1821
  }
1834
1822
  ),
1835
1823
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: _chunkABVRVW3Pcjs.getChainName.call(void 0, sourceChainId) }),
1836
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
1824
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
1837
1825
  ]
1838
1826
  }
1839
1827
  ),
@@ -1863,9 +1851,9 @@ function DepositAddressStep({
1863
1851
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Supported token" }),
1864
1852
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-deposit-address-min", children: [
1865
1853
  "Min.$",
1866
- (targetChain === _chunkABVRVW3Pcjs.HYPERCORE_CHAIN_ID ? Math.max(_chunkABVRVW3Pcjs.HYPERCORE_MIN_DEPOSIT_USD, _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _75 => _75.minDepositUsd]), () => ( 0))) : _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _76 => _76.minDepositUsd]), () => ( 0.1))).toFixed(2),
1867
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.Tooltip, { content: "Minimum deposit amount required for the selected chain.", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1868
- _chunkPPFG3VBDcjs.InfoIcon,
1854
+ (targetChain === _chunkABVRVW3Pcjs.HYPERCORE_CHAIN_ID ? Math.max(_chunkABVRVW3Pcjs.HYPERCORE_MIN_DEPOSIT_USD, _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _70 => _70.minDepositUsd]), () => ( 0))) : _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _71 => _71.minDepositUsd]), () => ( 0.1))).toFixed(2),
1855
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.Tooltip, { content: "Minimum deposit amount required for the selected chain.", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1856
+ _chunkZDYV536Qcjs.InfoIcon,
1869
1857
  {
1870
1858
  className: "rs-deposit-address-min-icon",
1871
1859
  "aria-hidden": "true"
@@ -1893,7 +1881,7 @@ function DepositAddressStep({
1893
1881
  }
1894
1882
  ),
1895
1883
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: sourceTokenSymbol }),
1896
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
1884
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
1897
1885
  ]
1898
1886
  }
1899
1887
  ),
@@ -1944,7 +1932,7 @@ function DepositAddressStep({
1944
1932
  className: "rs-deposit-address-copy",
1945
1933
  onClick: handleCopy,
1946
1934
  children: [
1947
- copied ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.CheckIcon, {}) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.CopyIcon, {}),
1935
+ copied ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.CheckIcon, {}) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.CopyIcon, {}),
1948
1936
  copied ? "Copied!" : "Copy address"
1949
1937
  ]
1950
1938
  }
@@ -1952,7 +1940,7 @@ function DepositAddressStep({
1952
1940
  ]
1953
1941
  }
1954
1942
  ),
1955
- targetChain === _chunkABVRVW3Pcjs.HYPERCORE_CHAIN_ID && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.Callout, { variant: "warning", children: "HyperCore's first deposit to a new account includes a ~1 USDC activation fee \u2014 send at least 1 USDC or it will fail." }),
1943
+ targetChain === _chunkABVRVW3Pcjs.HYPERCORE_CHAIN_ID && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.Callout, { variant: "warning", children: "HyperCore's first deposit to a new account includes a ~1 USDC activation fee \u2014 send at least 1 USDC or it will fail." }),
1956
1944
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
1957
1945
  "div",
1958
1946
  {
@@ -1970,16 +1958,16 @@ function DepositAddressStep({
1970
1958
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-label", children: "Price impact" }),
1971
1959
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-label", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: "0.00%" }) }),
1972
1960
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1973
- _chunkPPFG3VBDcjs.Tooltip,
1961
+ _chunkZDYV536Qcjs.Tooltip,
1974
1962
  {
1975
1963
  className: "rs-price-impact-info",
1976
1964
  content: "Price impact is the difference between expected and execution price, due to trade size and liquidity.",
1977
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.InfoIcon, { "aria-hidden": "true" })
1965
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.InfoIcon, { "aria-hidden": "true" })
1978
1966
  }
1979
1967
  )
1980
1968
  ] }),
1981
1969
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1982
- _chunkPPFG3VBDcjs.ChevronDownIcon,
1970
+ _chunkZDYV536Qcjs.ChevronDownIcon,
1983
1971
  {
1984
1972
  className: "rs-price-impact-chevron",
1985
1973
  "aria-hidden": "true"
@@ -1990,29 +1978,29 @@ function DepositAddressStep({
1990
1978
  ),
1991
1979
  /* @__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: [
1992
1980
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-price-impact-row", children: [
1993
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.PercentIcon, {}) }),
1981
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.PercentIcon, {}) }),
1994
1982
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-price-impact-label", children: [
1995
1983
  "Max slippage: ",
1996
1984
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: "0.2%" })
1997
1985
  ] }),
1998
1986
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1999
- _chunkPPFG3VBDcjs.Tooltip,
1987
+ _chunkZDYV536Qcjs.Tooltip,
2000
1988
  {
2001
1989
  className: "rs-price-impact-info",
2002
1990
  content: "Slippage accounts for price changes during execution. Slippage is adjusted per pair to ensure reliable execution.",
2003
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.InfoIcon, { "aria-hidden": "true" })
1991
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.InfoIcon, { "aria-hidden": "true" })
2004
1992
  }
2005
1993
  )
2006
1994
  ] }),
2007
1995
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-price-impact-row", children: [
2008
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.ClockIcon, {}) }),
1996
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.ClockIcon, {}) }),
2009
1997
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-price-impact-label", children: [
2010
1998
  "Processing time: ",
2011
1999
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: "< 1 min" })
2012
2000
  ] })
2013
2001
  ] }),
2014
2002
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-price-impact-row", children: [
2015
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.PlusCircleIcon, {}) }),
2003
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.PlusCircleIcon, {}) }),
2016
2004
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-price-impact-label", children: [
2017
2005
  "Max deposit:",
2018
2006
  " ",
@@ -2036,7 +2024,6 @@ function DepositAddressStep({
2036
2024
  solanaDepositAddress,
2037
2025
  targetChain,
2038
2026
  targetToken,
2039
- hasPostBridgeActions,
2040
2027
  service,
2041
2028
  onComplete: handleNotificationComplete,
2042
2029
  onFailed: handleNotificationFailed,
@@ -2044,7 +2031,7 @@ function DepositAddressStep({
2044
2031
  },
2045
2032
  deposit.id
2046
2033
  )) }),
2047
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.PoweredBy, {})
2034
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.PoweredBy, {})
2048
2035
  ] });
2049
2036
  }
2050
2037
  DepositAddressStep.displayName = "DepositAddressStep";
@@ -2052,6 +2039,20 @@ DepositAddressStep.displayName = "DepositAddressStep";
2052
2039
  // src/components/steps/FiatOnrampStep.tsx
2053
2040
 
2054
2041
 
2042
+ // src/core/swapped.ts
2043
+ var SWAPPED_ORIGINS = [
2044
+ "https://connect.swapped.com",
2045
+ "https://sandbox.swapped.com",
2046
+ "https://widget.swapped.com"
2047
+ ];
2048
+ var WIDGET_URL_EXPIRY_BUFFER_MS = 1e4;
2049
+ function isSwappedWidgetUrlFresh(res, now = Date.now()) {
2050
+ if (!res.expiresAt) return false;
2051
+ const expiry = Date.parse(res.expiresAt);
2052
+ if (!Number.isFinite(expiry)) return false;
2053
+ return expiry - now > WIDGET_URL_EXPIRY_BUFFER_MS;
2054
+ }
2055
+
2055
2056
  // src/components/steps/SwappedIframeStep.tsx
2056
2057
 
2057
2058
 
@@ -2060,13 +2061,25 @@ DepositAddressStep.displayName = "DepositAddressStep";
2060
2061
  function FinalisingDepositStep() {
2061
2062
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen rs-finalising", children: [
2062
2063
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-finalising-body", children: [
2063
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-finalising-spinner", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.Spinner, {}) }),
2064
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
2065
+ "svg",
2066
+ {
2067
+ className: "rs-finalising-spinner",
2068
+ viewBox: "0 0 80 80",
2069
+ fill: "none",
2070
+ "aria-hidden": "true",
2071
+ children: [
2072
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "circle", { className: "rs-finalising-spinner-track", cx: "40", cy: "40", r: "34" }),
2073
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "circle", { className: "rs-finalising-spinner-head", cx: "40", cy: "40", r: "34" })
2074
+ ]
2075
+ }
2076
+ ),
2064
2077
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-finalising-text", children: [
2065
2078
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h2", { className: "rs-finalising-title", children: "Finalising deposit" }),
2066
2079
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "rs-finalising-subtitle", children: "We are depositing your funds to the application." })
2067
2080
  ] })
2068
2081
  ] }),
2069
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.PoweredBy, {})
2082
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.PoweredBy, {})
2070
2083
  ] });
2071
2084
  }
2072
2085
  FinalisingDepositStep.displayName = "FinalisingDepositStep";
@@ -2082,7 +2095,6 @@ var STEP_LABELS = [
2082
2095
  function SwappedOrderTracker({
2083
2096
  amount,
2084
2097
  currency = "USDC",
2085
- chainLabel = "Base",
2086
2098
  stepStates,
2087
2099
  terminal = null,
2088
2100
  onRetry
@@ -2091,13 +2103,13 @@ function SwappedOrderTracker({
2091
2103
  const title = terminal ? terminal.kind === "cancelled" ? "Order cancelled" : "Deposit failed" : formattedAmount ? `Depositing ${formattedAmount} ${currency}` : `Depositing ${currency}`;
2092
2104
  const labels = [
2093
2105
  STEP_LABELS[0],
2094
- `${currency} received on ${chainLabel}`,
2106
+ `${currency} received`,
2095
2107
  STEP_LABELS[2],
2096
2108
  STEP_LABELS[3]
2097
2109
  ];
2098
2110
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen rs-swapped-tracker", children: [
2099
2111
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
2100
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.HandCoinsIcon, {}), title }),
2112
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.HandCoinsIcon, {}), title }),
2101
2113
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "ol", { className: "rs-swapped-tracker-steps", children: labels.map((label, idx) => {
2102
2114
  const status = stepStates[idx];
2103
2115
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
@@ -2111,7 +2123,7 @@ function SwappedOrderTracker({
2111
2123
  {
2112
2124
  className: "rs-swapped-tracker-step-marker",
2113
2125
  "aria-hidden": "true",
2114
- children: status === "complete" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.CheckIcon, {}) : status === "failed" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.CloseIcon, {}) : status === "active" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.Spinner, {}) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2126
+ children: status === "complete" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.CheckIcon, {}) : status === "failed" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.CloseIcon, {}) : status === "active" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.Spinner, {}) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2115
2127
  "svg",
2116
2128
  {
2117
2129
  className: "rs-swapped-tracker-step-ring",
@@ -2146,7 +2158,7 @@ function SwappedOrderTracker({
2146
2158
  }
2147
2159
  )
2148
2160
  ] }),
2149
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.PoweredBy, {})
2161
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.PoweredBy, {})
2150
2162
  ] });
2151
2163
  }
2152
2164
  function formatTrackerAmount(amount) {
@@ -2164,11 +2176,7 @@ var DEPOSIT_POLL_INTERVAL_MS = 2e3;
2164
2176
  var DEPOSIT_POLL_FAST_INITIAL_DELAY_MS = 1e3;
2165
2177
  var DEPOSIT_POLL_FAST_INTERVAL_MS = 500;
2166
2178
  var IFRAME_LOAD_TIMEOUT_MS = 15e3;
2167
- var SWAPPED_IFRAME_ORIGINS = /* @__PURE__ */ new Set([
2168
- "https://connect.swapped.com",
2169
- "https://sandbox.swapped.com",
2170
- "https://widget.swapped.com"
2171
- ]);
2179
+ var SWAPPED_IFRAME_ORIGINS = new Set(SWAPPED_ORIGINS);
2172
2180
  var SWAPPED_TERMINAL_STATUSES = /* @__PURE__ */ new Set([
2173
2181
  "order_completed",
2174
2182
  "order_broadcasted"
@@ -2179,12 +2187,30 @@ var SWAPPED_STATUS_VALUES = /* @__PURE__ */ new Set([
2179
2187
  "order_broadcasted",
2180
2188
  "order_cancelled"
2181
2189
  ]);
2190
+ var SWAPPED_GO_BACK_KEY = "SWAPPED_GO_BACK";
2191
+ function parseMaybeJsonString(raw) {
2192
+ try {
2193
+ return JSON.parse(raw);
2194
+ } catch (e16) {
2195
+ return raw;
2196
+ }
2197
+ }
2198
+ function isSwappedGoBackMessage(raw) {
2199
+ let data = raw;
2200
+ if (typeof data === "string") {
2201
+ data = parseMaybeJsonString(data);
2202
+ }
2203
+ if (data === SWAPPED_GO_BACK_KEY) return true;
2204
+ if (!data || typeof data !== "object") return false;
2205
+ const obj = data;
2206
+ return obj.key === SWAPPED_GO_BACK_KEY || obj.type === SWAPPED_GO_BACK_KEY;
2207
+ }
2182
2208
  function parseSwappedIframeMessage(raw) {
2183
2209
  let data = raw;
2184
2210
  if (typeof data === "string") {
2185
2211
  try {
2186
2212
  data = JSON.parse(data);
2187
- } catch (e16) {
2213
+ } catch (e17) {
2188
2214
  return null;
2189
2215
  }
2190
2216
  }
@@ -2199,6 +2225,7 @@ function parseSwappedIframeMessage(raw) {
2199
2225
  return {
2200
2226
  status: rawStatus,
2201
2227
  orderId: _nullishCoalesce(asString2(inner.order_id), () => ( asString2(obj.orderId))),
2228
+ externalCustomerId: _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(asString2(inner.external_customer_id), () => ( asString2(obj.external_customer_id))), () => ( asString2(inner.externalCustomerId))), () => ( asString2(obj.externalCustomerId))),
2202
2229
  orderCrypto: _nullishCoalesce(asString2(inner.order_crypto), () => ( asString2(obj.orderCrypto))),
2203
2230
  orderCryptoAmount: _nullishCoalesce(asString2(inner.order_crypto_amount), () => ( asString2(obj.orderCryptoAmount))),
2204
2231
  transactionId: _nullishCoalesce(asString2(inner.transaction_id), () => ( asString2(obj.transactionId)))
@@ -2216,6 +2243,7 @@ function SwappedIframeStep({
2216
2243
  onSwappedComplete,
2217
2244
  onSwappedFailed,
2218
2245
  onClose,
2246
+ onGoBack,
2219
2247
  onError
2220
2248
  }) {
2221
2249
  const [widgetUrl, setWidgetUrl] = _react.useState.call(void 0, null);
@@ -2229,6 +2257,7 @@ function SwappedIframeStep({
2229
2257
  const completeFiredRef = _react.useRef.call(void 0, false);
2230
2258
  const failedFiredRef = _react.useRef.call(void 0, false);
2231
2259
  const expectedOrderUuidRef = _react.useRef.call(void 0, null);
2260
+ const expectedExternalCustomerIdRef = _react.useRef.call(void 0, null);
2232
2261
  const baselineDepositTxHashRef = _react.useRef.call(void 0, void 0);
2233
2262
  const currentDepositTxHashRef = _react.useRef.call(void 0, null);
2234
2263
  const fastDepositPollEnabledRef = _react.useRef.call(void 0, false);
@@ -2241,6 +2270,8 @@ function SwappedIframeStep({
2241
2270
  onSwappedFailedRef.current = onSwappedFailed;
2242
2271
  const onErrorRef = _react.useRef.call(void 0, onError);
2243
2272
  onErrorRef.current = onError;
2273
+ const onGoBackRef = _react.useRef.call(void 0, onGoBack);
2274
+ onGoBackRef.current = onGoBack;
2244
2275
  const loadUrlRef = _react.useRef.call(void 0, loadUrl);
2245
2276
  loadUrlRef.current = loadUrl;
2246
2277
  _react.useEffect.call(void 0, () => {
@@ -2252,6 +2283,7 @@ function SwappedIframeStep({
2252
2283
  setLatestEvent(null);
2253
2284
  setPhase("iframe");
2254
2285
  expectedOrderUuidRef.current = null;
2286
+ expectedExternalCustomerIdRef.current = null;
2255
2287
  completeFiredRef.current = false;
2256
2288
  failedFiredRef.current = false;
2257
2289
  baselineDepositTxHashRef.current = void 0;
@@ -2260,13 +2292,14 @@ function SwappedIframeStep({
2260
2292
  loadUrlRef.current().then((res) => {
2261
2293
  if (cancelled) return;
2262
2294
  setWidgetUrl(res.url);
2295
+ expectedExternalCustomerIdRef.current = res.externalCustomerId;
2263
2296
  const sep = res.externalCustomerId.indexOf(":");
2264
2297
  expectedOrderUuidRef.current = sep >= 0 ? res.externalCustomerId.slice(sep + 1) : null;
2265
2298
  }).catch((err) => {
2266
2299
  if (cancelled) return;
2267
2300
  const message = err instanceof Error ? err.message : loadErrorFallback;
2268
2301
  setLoadError(message);
2269
- _optionalChain([onErrorRef, 'access', _77 => _77.current, 'optionalCall', _78 => _78(message, loadErrorCode)]);
2302
+ _optionalChain([onErrorRef, 'access', _72 => _72.current, 'optionalCall', _73 => _73(message, loadErrorCode)]);
2270
2303
  });
2271
2304
  return () => {
2272
2305
  cancelled = true;
@@ -2291,7 +2324,7 @@ function SwappedIframeStep({
2291
2324
  if (isCurrentOrder) {
2292
2325
  setOrderState(res);
2293
2326
  }
2294
- } catch (e17) {
2327
+ } catch (e18) {
2295
2328
  }
2296
2329
  if (!cancelled) {
2297
2330
  timeoutId = setTimeout(poll, STATUS_POLL_INTERVAL_MS);
@@ -2312,14 +2345,14 @@ function SwappedIframeStep({
2312
2345
  const status = await service.fetchLatestStatus(smartAccount);
2313
2346
  if (cancelled) return;
2314
2347
  const event = status.lastEvent;
2315
- const eventTxHash = _chunkPPFG3VBDcjs.isDepositEvent.call(void 0, event) ? _nullishCoalesce(_chunkPPFG3VBDcjs.getEventTxHash.call(void 0, event), () => ( null)) : null;
2348
+ const eventTxHash = _chunkZDYV536Qcjs.isDepositEvent.call(void 0, event) ? _nullishCoalesce(_chunkZDYV536Qcjs.getEventTxHash.call(void 0, event), () => ( null)) : null;
2316
2349
  if (baselineDepositTxHashRef.current === void 0) {
2317
2350
  baselineDepositTxHashRef.current = eventTxHash;
2318
- } else if (eventTxHash && (!baselineDepositTxHashRef.current || !_chunkPPFG3VBDcjs.txRefsMatch.call(void 0, eventTxHash, baselineDepositTxHashRef.current))) {
2351
+ } else if (eventTxHash && (!baselineDepositTxHashRef.current || !_chunkZDYV536Qcjs.txRefsMatch.call(void 0, eventTxHash, baselineDepositTxHashRef.current))) {
2319
2352
  currentDepositTxHashRef.current = eventTxHash;
2320
2353
  setLatestEvent(_nullishCoalesce(event, () => ( null)));
2321
2354
  }
2322
- } catch (e18) {
2355
+ } catch (e19) {
2323
2356
  }
2324
2357
  if (!cancelled) {
2325
2358
  const nextInterval = fastDepositPollEnabledRef.current ? DEPOSIT_POLL_FAST_INTERVAL_MS : DEPOSIT_POLL_INTERVAL_MS;
@@ -2340,32 +2373,39 @@ function SwappedIframeStep({
2340
2373
  }, [service, smartAccount]);
2341
2374
  _react.useEffect.call(void 0, () => {
2342
2375
  if (fastDepositPollEnabledRef.current) return;
2343
- const status = _optionalChain([orderState, 'optionalAccess', _79 => _79.status]);
2376
+ const status = _optionalChain([orderState, 'optionalAccess', _74 => _74.status]);
2344
2377
  if (!status || !SWAPPED_TERMINAL_STATUSES.has(status)) return;
2345
2378
  fastDepositPollEnabledRef.current = true;
2346
- _optionalChain([rescheduleDepositPollRef, 'access', _80 => _80.current, 'optionalCall', _81 => _81(DEPOSIT_POLL_FAST_INITIAL_DELAY_MS)]);
2379
+ _optionalChain([rescheduleDepositPollRef, 'access', _75 => _75.current, 'optionalCall', _76 => _76(DEPOSIT_POLL_FAST_INITIAL_DELAY_MS)]);
2347
2380
  }, [orderState]);
2348
2381
  _react.useEffect.call(void 0, () => {
2349
2382
  function onMessage(e) {
2350
2383
  if (!SWAPPED_IFRAME_ORIGINS.has(e.origin)) return;
2351
- if (e.source !== _optionalChain([iframeRef, 'access', _82 => _82.current, 'optionalAccess', _83 => _83.contentWindow])) return;
2384
+ if (e.source !== _optionalChain([iframeRef, 'access', _77 => _77.current, 'optionalAccess', _78 => _78.contentWindow])) return;
2385
+ if (isSwappedGoBackMessage(e.data)) {
2386
+ onGoBackRef.current();
2387
+ return;
2388
+ }
2352
2389
  const parsed = parseSwappedIframeMessage(e.data);
2353
2390
  if (!parsed) return;
2354
- const orderId = parsed.orderId;
2355
- if (!orderId || orderId !== expectedOrderUuidRef.current) {
2391
+ const ext = parsed.externalCustomerId;
2392
+ const expected = expectedExternalCustomerIdRef.current;
2393
+ if (!ext || !expected || ext.toLowerCase() !== expected.toLowerCase()) {
2356
2394
  return;
2357
2395
  }
2358
2396
  setOrderState((prev) => ({
2359
- orderId,
2397
+ // Normalise to the uuid the backend poll also keys on, so orderState
2398
+ // is consistent regardless of which path set it.
2399
+ orderId: _nullishCoalesce(_nullishCoalesce(expectedOrderUuidRef.current, () => ( _optionalChain([prev, 'optionalAccess', _79 => _79.orderId]))), () => ( ext)),
2360
2400
  status: parsed.status,
2361
- orderCrypto: _nullishCoalesce(_nullishCoalesce(parsed.orderCrypto, () => ( _optionalChain([prev, 'optionalAccess', _84 => _84.orderCrypto]))), () => ( null)),
2362
- orderCryptoAmount: _nullishCoalesce(_nullishCoalesce(parsed.orderCryptoAmount, () => ( _optionalChain([prev, 'optionalAccess', _85 => _85.orderCryptoAmount]))), () => ( null)),
2363
- transactionId: _nullishCoalesce(_nullishCoalesce(parsed.transactionId, () => ( _optionalChain([prev, 'optionalAccess', _86 => _86.transactionId]))), () => ( null)),
2401
+ orderCrypto: _nullishCoalesce(_nullishCoalesce(parsed.orderCrypto, () => ( _optionalChain([prev, 'optionalAccess', _80 => _80.orderCrypto]))), () => ( null)),
2402
+ orderCryptoAmount: _nullishCoalesce(_nullishCoalesce(parsed.orderCryptoAmount, () => ( _optionalChain([prev, 'optionalAccess', _81 => _81.orderCryptoAmount]))), () => ( null)),
2403
+ transactionId: _nullishCoalesce(_nullishCoalesce(parsed.transactionId, () => ( _optionalChain([prev, 'optionalAccess', _82 => _82.transactionId]))), () => ( null)),
2364
2404
  receivedAt: (/* @__PURE__ */ new Date()).toISOString(),
2365
- paidAmountUsd: _nullishCoalesce(_optionalChain([prev, 'optionalAccess', _87 => _87.paidAmountUsd]), () => ( null)),
2366
- paidAmountEur: _nullishCoalesce(_optionalChain([prev, 'optionalAccess', _88 => _88.paidAmountEur]), () => ( null)),
2367
- onrampFeeUsd: _nullishCoalesce(_optionalChain([prev, 'optionalAccess', _89 => _89.onrampFeeUsd]), () => ( null)),
2368
- paymentMethod: _nullishCoalesce(_optionalChain([prev, 'optionalAccess', _90 => _90.paymentMethod]), () => ( null))
2405
+ paidAmountUsd: _nullishCoalesce(_optionalChain([prev, 'optionalAccess', _83 => _83.paidAmountUsd]), () => ( null)),
2406
+ paidAmountEur: _nullishCoalesce(_optionalChain([prev, 'optionalAccess', _84 => _84.paidAmountEur]), () => ( null)),
2407
+ onrampFeeUsd: _nullishCoalesce(_optionalChain([prev, 'optionalAccess', _85 => _85.onrampFeeUsd]), () => ( null)),
2408
+ paymentMethod: _nullishCoalesce(_optionalChain([prev, 'optionalAccess', _86 => _86.paymentMethod]), () => ( null))
2369
2409
  }));
2370
2410
  }
2371
2411
  window.addEventListener("message", onMessage);
@@ -2377,17 +2417,17 @@ function SwappedIframeStep({
2377
2417
  }
2378
2418
  }, [phase, orderState]);
2379
2419
  const stepStates = _react.useMemo.call(void 0,
2380
- () => deriveStepStates(_nullishCoalesce(_optionalChain([orderState, 'optionalAccess', _91 => _91.status]), () => ( null)), latestEvent),
2420
+ () => deriveStepStates(_nullishCoalesce(_optionalChain([orderState, 'optionalAccess', _87 => _87.status]), () => ( null)), latestEvent),
2381
2421
  [orderState, latestEvent]
2382
2422
  );
2383
2423
  const terminalState = _react.useMemo.call(void 0, () => {
2384
- if (_chunkPPFG3VBDcjs.isFailedEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))) {
2424
+ if (_chunkZDYV536Qcjs.isFailedEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))) {
2385
2425
  return {
2386
2426
  kind: "failed",
2387
- message: _chunkPPFG3VBDcjs.failureMessageForEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))
2427
+ message: _chunkZDYV536Qcjs.failureMessageForEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))
2388
2428
  };
2389
2429
  }
2390
- if (_optionalChain([orderState, 'optionalAccess', _92 => _92.status]) === "order_cancelled") {
2430
+ if (_optionalChain([orderState, 'optionalAccess', _88 => _88.status]) === "order_cancelled") {
2391
2431
  const banner = bannerForStatus("order_cancelled", {});
2392
2432
  return { kind: "cancelled", message: _nullishCoalesce(banner.detail, () => ( banner.title)) };
2393
2433
  }
@@ -2395,30 +2435,30 @@ function SwappedIframeStep({
2395
2435
  }, [latestEvent, orderState, bannerForStatus]);
2396
2436
  _react.useEffect.call(void 0, () => {
2397
2437
  if (completeFiredRef.current || failedFiredRef.current) return;
2398
- const t = _optionalChain([latestEvent, 'optionalAccess', _93 => _93.type]);
2399
- const isSuccess = t === "bridge-complete" || t === "post-bridge-swap-complete";
2438
+ const t = _optionalChain([latestEvent, 'optionalAccess', _89 => _89.type]);
2439
+ const isSuccess = t === "bridge-complete";
2400
2440
  if (!isSuccess) return;
2401
2441
  const txHash = currentDepositTxHashRef.current;
2402
2442
  if (!txHash) return;
2403
2443
  completeFiredRef.current = true;
2404
2444
  onSwappedCompleteRef.current({
2405
2445
  txHash,
2406
- orderCrypto: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess', _94 => _94.orderCrypto]), () => ( null)),
2446
+ orderCrypto: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess', _90 => _90.orderCrypto]), () => ( null)),
2407
2447
  // Base-unit source amount from the deposit row/event, consistent with the
2408
2448
  // wallet/QR path. ProcessingStep + onLifecycle expect base units.
2409
- amount: _nullishCoalesce(_chunkPPFG3VBDcjs.getEventSourceDetails.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0))).amount, () => ( null))
2449
+ amount: _nullishCoalesce(_chunkZDYV536Qcjs.getEventSourceDetails.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0))).amount, () => ( null))
2410
2450
  });
2411
2451
  }, [latestEvent, orderState]);
2412
2452
  _react.useEffect.call(void 0, () => {
2413
2453
  if (failedFiredRef.current || completeFiredRef.current) return;
2414
- if (!_chunkPPFG3VBDcjs.isFailedEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))) return;
2454
+ if (!_chunkZDYV536Qcjs.isFailedEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))) return;
2415
2455
  const txHash = currentDepositTxHashRef.current;
2416
2456
  if (!txHash) return;
2417
2457
  failedFiredRef.current = true;
2418
2458
  setPhase("tracker");
2419
- _optionalChain([onSwappedFailedRef, 'access', _95 => _95.current, 'optionalCall', _96 => _96(
2459
+ _optionalChain([onSwappedFailedRef, 'access', _91 => _91.current, 'optionalCall', _92 => _92(
2420
2460
  txHash,
2421
- _chunkPPFG3VBDcjs.failureMessageForEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))
2461
+ _chunkZDYV536Qcjs.failureMessageForEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))
2422
2462
  )]);
2423
2463
  }, [latestEvent]);
2424
2464
  if (phase === "tracker") {
@@ -2429,8 +2469,8 @@ function SwappedIframeStep({
2429
2469
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2430
2470
  SwappedOrderTracker,
2431
2471
  {
2432
- amount: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess', _97 => _97.orderCryptoAmount]), () => ( null)),
2433
- currency: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess', _98 => _98.orderCrypto]), () => ( "USDC")),
2472
+ amount: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess', _93 => _93.orderCryptoAmount]), () => ( null)),
2473
+ currency: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess', _94 => _94.orderCrypto]), () => ( "USDC")),
2434
2474
  stepStates,
2435
2475
  terminal: terminalState,
2436
2476
  onRetry: () => setRetryToken((n) => n + 1),
@@ -2452,7 +2492,7 @@ function SwappedIframeStep({
2452
2492
  }
2453
2493
  )
2454
2494
  ] }),
2455
- !loadError && !iframeLoaded && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-fiat-onramp-loading", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.Spinner, {}) }),
2495
+ !loadError && !iframeLoaded && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-fiat-onramp-loading", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.Spinner, {}) }),
2456
2496
  widgetUrl && !loadError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2457
2497
  "iframe",
2458
2498
  {
@@ -2467,11 +2507,11 @@ function SwappedIframeStep({
2467
2507
  retryToken
2468
2508
  )
2469
2509
  ] }) }),
2470
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.PoweredBy, {})
2510
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.PoweredBy, {})
2471
2511
  ] });
2472
2512
  }
2473
2513
  function deriveStepStates(swappedStatus, latestEvent) {
2474
- if (_chunkPPFG3VBDcjs.isFailedEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))) {
2514
+ if (_chunkZDYV536Qcjs.isFailedEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))) {
2475
2515
  return ["complete", "complete", "failed", "pending"];
2476
2516
  }
2477
2517
  if (swappedStatus === "order_cancelled") {
@@ -2479,7 +2519,7 @@ function deriveStepStates(swappedStatus, latestEvent) {
2479
2519
  }
2480
2520
  const step1Complete = swappedStatus === "order_completed" || swappedStatus === "order_broadcasted";
2481
2521
  const step2Complete = latestEvent !== null;
2482
- const step3Complete = _optionalChain([latestEvent, 'optionalAccess', _99 => _99.type]) === "bridge-complete" || _optionalChain([latestEvent, 'optionalAccess', _100 => _100.type]) === "post-bridge-swap-complete";
2522
+ const step3Complete = _optionalChain([latestEvent, 'optionalAccess', _95 => _95.type]) === "bridge-complete";
2483
2523
  if (step3Complete) {
2484
2524
  return ["complete", "complete", "complete", "pending"];
2485
2525
  }
@@ -2525,18 +2565,27 @@ function FiatOnrampStep({
2525
2565
  smartAccount,
2526
2566
  service,
2527
2567
  paymentMethod,
2568
+ consumePrefetchedUrl,
2528
2569
  onSwappedComplete,
2529
2570
  onSwappedFailed,
2530
2571
  onClose,
2572
+ onGoBack,
2531
2573
  onError
2532
2574
  }) {
2533
2575
  const loadUrl = _react.useCallback.call(void 0, async () => {
2534
- const res = await service.getSwappedWidgetUrl({
2576
+ const prefetched = _optionalChain([consumePrefetchedUrl, 'optionalCall', _96 => _96(smartAccount, paymentMethod)]);
2577
+ if (prefetched) {
2578
+ try {
2579
+ const cached = await prefetched;
2580
+ if (isSwappedWidgetUrlFresh(cached)) return cached;
2581
+ } catch (e20) {
2582
+ }
2583
+ }
2584
+ return service.getSwappedWidgetUrl({
2535
2585
  smartAccount,
2536
2586
  method: paymentMethod
2537
2587
  });
2538
- return res;
2539
- }, [service, smartAccount, paymentMethod]);
2588
+ }, [service, smartAccount, paymentMethod, consumePrefetchedUrl]);
2540
2589
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2541
2590
  SwappedIframeStep,
2542
2591
  {
@@ -2551,6 +2600,7 @@ function FiatOnrampStep({
2551
2600
  onSwappedComplete,
2552
2601
  onSwappedFailed,
2553
2602
  onClose,
2603
+ onGoBack,
2554
2604
  onError
2555
2605
  }
2556
2606
  );
@@ -2596,6 +2646,7 @@ function ExchangeConnectStep({
2596
2646
  onSwappedComplete,
2597
2647
  onSwappedFailed,
2598
2648
  onClose,
2649
+ onGoBack,
2599
2650
  onError
2600
2651
  }) {
2601
2652
  const loadUrl = _react.useCallback.call(void 0, async () => {
@@ -2619,6 +2670,7 @@ function ExchangeConnectStep({
2619
2670
  onSwappedComplete,
2620
2671
  onSwappedFailed,
2621
2672
  onClose,
2673
+ onGoBack,
2622
2674
  onError
2623
2675
  }
2624
2676
  );
@@ -2631,7 +2683,7 @@ ExchangeConnectStep.displayName = "ExchangeConnectStep";
2631
2683
  function ExchangeLogo({ exchange }) {
2632
2684
  const [failed, setFailed] = _react.useState.call(void 0, false);
2633
2685
  if (!exchange.logoUrl || failed) {
2634
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.BankIcon, {});
2686
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.BankIcon, {});
2635
2687
  }
2636
2688
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2637
2689
  "img",
@@ -2666,7 +2718,7 @@ function ExchangeSelectStep({
2666
2718
  const message = err instanceof Error ? err.message : "Failed to load exchanges";
2667
2719
  setExchanges([]);
2668
2720
  setError(message);
2669
- _optionalChain([onError, 'optionalCall', _101 => _101(message, "SWAPPED_CONNECT_EXCHANGES_FAILED")]);
2721
+ _optionalChain([onError, 'optionalCall', _97 => _97(message, "SWAPPED_CONNECT_EXCHANGES_FAILED")]);
2670
2722
  }).finally(() => {
2671
2723
  if (!cancelled) setLoading(false);
2672
2724
  });
@@ -2677,14 +2729,14 @@ function ExchangeSelectStep({
2677
2729
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen rs-exchange-select", children: [
2678
2730
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
2679
2731
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2680
- _chunkPPFG3VBDcjs.BodyHeader,
2732
+ _chunkZDYV536Qcjs.BodyHeader,
2681
2733
  {
2682
- icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.UnplugIcon, {}),
2734
+ icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.UnplugIcon, {}),
2683
2735
  title: "Connect exchange",
2684
2736
  subtitle: "Select an exchange to connect"
2685
2737
  }
2686
2738
  ),
2687
- loading && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-exchange-select-state", "aria-live": "polite", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.Spinner, {}) }),
2739
+ loading && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-exchange-select-state", "aria-live": "polite", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.Spinner, {}) }),
2688
2740
  !loading && error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-exchange-select-state", "aria-live": "polite", children: [
2689
2741
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-exchange-select-state-title", children: "Couldn\u2019t load exchanges" }),
2690
2742
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
@@ -2710,7 +2762,7 @@ function ExchangeSelectStep({
2710
2762
  )
2711
2763
  ] }),
2712
2764
  !loading && !error && exchanges.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-exchange-grid", children: exchanges.map((exchange) => {
2713
- const brand = _chunkPPFG3VBDcjs.getExchangeLogo.call(void 0, exchange.name, exchange.connection);
2765
+ const brand = _chunkZDYV536Qcjs.getExchangeLogo.call(void 0, exchange.name, exchange.connection);
2714
2766
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
2715
2767
  "button",
2716
2768
  {
@@ -2733,7 +2785,7 @@ function ExchangeSelectStep({
2733
2785
  );
2734
2786
  }) })
2735
2787
  ] }),
2736
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.PoweredBy, {})
2788
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.PoweredBy, {})
2737
2789
  ] });
2738
2790
  }
2739
2791
  ExchangeSelectStep.displayName = "ExchangeSelectStep";
@@ -2745,8 +2797,8 @@ function DepositAddressSkeleton({
2745
2797
  uiConfig,
2746
2798
  allowedRoutes
2747
2799
  }) {
2748
- const allowedChainSet = _optionalChain([allowedRoutes, 'optionalAccess', _102 => _102.sourceChains]) ? new Set(allowedRoutes.sourceChains) : null;
2749
- const allowedTokenSet = _optionalChain([allowedRoutes, 'optionalAccess', _103 => _103.sourceTokens]) ? new Set(allowedRoutes.sourceTokens.map((s) => s.toUpperCase())) : null;
2800
+ const allowedChainSet = _optionalChain([allowedRoutes, 'optionalAccess', _98 => _98.sourceChains]) ? new Set(allowedRoutes.sourceChains) : null;
2801
+ const allowedTokenSet = _optionalChain([allowedRoutes, 'optionalAccess', _99 => _99.sourceTokens]) ? new Set(allowedRoutes.sourceTokens.map((s) => s.toUpperCase())) : null;
2750
2802
  const evmChainIds = (() => {
2751
2803
  const all = _chunkABVRVW3Pcjs.getSupportedChainIds.call(void 0, );
2752
2804
  return allowedChainSet ? all.filter((id) => allowedChainSet.has(id)) : all;
@@ -2763,7 +2815,7 @@ function DepositAddressSkeleton({
2763
2815
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", "aria-busy": "true", children: [
2764
2816
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-sr-only", role: "status", children: "Preparing deposit details\u2026" }),
2765
2817
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
2766
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.TransferCryptoIcon, {}), title: "Transfer crypto" }),
2818
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.TransferCryptoIcon, {}), title: "Transfer crypto" }),
2767
2819
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-selectors", "aria-hidden": "true", children: [
2768
2820
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown", children: [
2769
2821
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-dropdown-label", children: "Supported chain" }),
@@ -2777,7 +2829,7 @@ function DepositAddressSkeleton({
2777
2829
  }
2778
2830
  ),
2779
2831
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: chainName }),
2780
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
2832
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
2781
2833
  ] })
2782
2834
  ] }),
2783
2835
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown", children: [
@@ -2785,9 +2837,9 @@ function DepositAddressSkeleton({
2785
2837
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Supported token" }),
2786
2838
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-deposit-address-min", children: [
2787
2839
  "Min.$",
2788
- (_nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _104 => _104.minDepositUsd]), () => ( 0.1))).toFixed(2),
2789
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.Tooltip, { content: "Minimum deposit amount required for the selected chain.", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2790
- _chunkPPFG3VBDcjs.InfoIcon,
2840
+ (_nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _100 => _100.minDepositUsd]), () => ( 0.1))).toFixed(2),
2841
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.Tooltip, { content: "Minimum deposit amount required for the selected chain.", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2842
+ _chunkZDYV536Qcjs.InfoIcon,
2791
2843
  {
2792
2844
  className: "rs-deposit-address-min-icon",
2793
2845
  "aria-hidden": "true"
@@ -2805,7 +2857,7 @@ function DepositAddressSkeleton({
2805
2857
  }
2806
2858
  ),
2807
2859
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: defaultToken }),
2808
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
2860
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
2809
2861
  ] })
2810
2862
  ] })
2811
2863
  ] }),
@@ -2826,7 +2878,7 @@ function DepositAddressSkeleton({
2826
2878
  disabled: true,
2827
2879
  "aria-hidden": "true",
2828
2880
  children: [
2829
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.CopyIcon, {}),
2881
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.CopyIcon, {}),
2830
2882
  "Copy address"
2831
2883
  ]
2832
2884
  }
@@ -2839,16 +2891,16 @@ function DepositAddressSkeleton({
2839
2891
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-label", children: "Price impact" }),
2840
2892
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-label", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: "0.00%" }) }),
2841
2893
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2842
- _chunkPPFG3VBDcjs.Tooltip,
2894
+ _chunkZDYV536Qcjs.Tooltip,
2843
2895
  {
2844
2896
  className: "rs-price-impact-info",
2845
2897
  content: "Price impact is the difference between expected and execution price, due to trade size and liquidity.",
2846
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.InfoIcon, { "aria-hidden": "true" })
2898
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.InfoIcon, { "aria-hidden": "true" })
2847
2899
  }
2848
2900
  )
2849
2901
  ] }),
2850
2902
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2851
- _chunkPPFG3VBDcjs.ChevronDownIcon,
2903
+ _chunkZDYV536Qcjs.ChevronDownIcon,
2852
2904
  {
2853
2905
  className: "rs-price-impact-chevron",
2854
2906
  "aria-hidden": "true"
@@ -2856,7 +2908,7 @@ function DepositAddressSkeleton({
2856
2908
  )
2857
2909
  ] }) })
2858
2910
  ] }),
2859
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.PoweredBy, {})
2911
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.PoweredBy, {})
2860
2912
  ] });
2861
2913
  }
2862
2914
  DepositAddressSkeleton.displayName = "DepositAddressSkeleton";
@@ -2888,7 +2940,7 @@ function SolanaTokenSelectStep({
2888
2940
  setError(null);
2889
2941
  const portfolioBySymbol = {};
2890
2942
  try {
2891
- _chunkPPFG3VBDcjs.debugLog.call(void 0, debug, "solana-token-select", "portfolio:request", {
2943
+ _chunkZDYV536Qcjs.debugLog.call(void 0, debug, "solana-token-select", "portfolio:request", {
2892
2944
  solanaAddress
2893
2945
  });
2894
2946
  const portfolio = await service.fetchSolanaPortfolio(solanaAddress);
@@ -2899,7 +2951,7 @@ function SolanaTokenSelectStep({
2899
2951
  let parsed = 0n;
2900
2952
  try {
2901
2953
  parsed = BigInt(t.balance || "0");
2902
- } catch (e19) {
2954
+ } catch (e21) {
2903
2955
  parsed = 0n;
2904
2956
  }
2905
2957
  if (parsed <= 0n) continue;
@@ -2911,12 +2963,12 @@ function SolanaTokenSelectStep({
2911
2963
  };
2912
2964
  }
2913
2965
  }
2914
- _chunkPPFG3VBDcjs.debugLog.call(void 0, debug, "solana-token-select", "portfolio:success", {
2966
+ _chunkZDYV536Qcjs.debugLog.call(void 0, debug, "solana-token-select", "portfolio:success", {
2915
2967
  symbols: Object.keys(portfolioBySymbol)
2916
2968
  });
2917
2969
  } catch (err) {
2918
2970
  if (!active) return;
2919
- _chunkPPFG3VBDcjs.debugError.call(void 0, debug, "solana-token-select", "portfolio:failure", err, {
2971
+ _chunkZDYV536Qcjs.debugError.call(void 0, debug, "solana-token-select", "portfolio:failure", err, {
2920
2972
  solanaAddress
2921
2973
  });
2922
2974
  setError(
@@ -2941,7 +2993,7 @@ function SolanaTokenSelectStep({
2941
2993
  setTokenBalances(results);
2942
2994
  setLoading(false);
2943
2995
  const totalUsd = results.reduce((sum, r) => sum + r.balanceUsd, 0);
2944
- _optionalChain([onTotalBalanceComputed, 'optionalCall', _105 => _105(totalUsd)]);
2996
+ _optionalChain([onTotalBalanceComputed, 'optionalCall', _101 => _101(totalUsd)]);
2945
2997
  }
2946
2998
  void loadBalances();
2947
2999
  return () => {
@@ -2963,8 +3015,8 @@ function SolanaTokenSelectStep({
2963
3015
  const raw = _viem.formatUnits.call(void 0, entry.balance, entry.token.decimals);
2964
3016
  const numeric = Number(raw);
2965
3017
  if (!Number.isFinite(numeric)) return raw;
2966
- return _chunkPPFG3VBDcjs.tokenFormatter.format(numeric);
2967
- } catch (e20) {
3018
+ return _chunkZDYV536Qcjs.tokenFormatter.format(numeric);
3019
+ } catch (e22) {
2968
3020
  return "--";
2969
3021
  }
2970
3022
  };
@@ -2973,20 +3025,20 @@ function SolanaTokenSelectStep({
2973
3025
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
2974
3026
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
2975
3027
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2976
- _chunkPPFG3VBDcjs.BodyHeader,
3028
+ _chunkZDYV536Qcjs.BodyHeader,
2977
3029
  {
2978
- icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.WalletIcon, {}),
3030
+ icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.WalletIcon, {}),
2979
3031
  title: "Your assets",
2980
3032
  subtitle: "Select source assets to transfer"
2981
3033
  }
2982
3034
  ),
2983
3035
  loading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
2984
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.Spinner, { className: "rs-text-tertiary" }),
3036
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.Spinner, { className: "rs-text-tertiary" }),
2985
3037
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
2986
3038
  ] }),
2987
- error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.Callout, { variant: "error", children: error }),
3039
+ error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.Callout, { variant: "error", children: error }),
2988
3040
  !loading && !error && rows.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-state", children: [
2989
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.WalletIcon, { className: "rs-empty-icon" }),
3041
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.WalletIcon, { className: "rs-empty-icon" }),
2990
3042
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-empty-text", children: "No funds in connected wallet" }),
2991
3043
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-address", children: [
2992
3044
  solanaAddress.slice(0, 6),
@@ -3035,14 +3087,14 @@ function SolanaTokenSelectStep({
3035
3087
  ] })
3036
3088
  ] })
3037
3089
  ] }),
3038
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: entry.balanceUsd > 0 ? _chunkPPFG3VBDcjs.currencyFormatter.format(entry.balanceUsd) : tokenAmount !== "--" ? `${tokenAmount} ${entry.token.symbol}` : "--" })
3090
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: entry.balanceUsd > 0 ? _chunkZDYV536Qcjs.currencyFormatter.format(entry.balanceUsd) : tokenAmount !== "--" ? `${tokenAmount} ${entry.token.symbol}` : "--" })
3039
3091
  ]
3040
3092
  },
3041
3093
  entry.token.symbol
3042
3094
  );
3043
3095
  }) }),
3044
3096
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
3045
- _chunkPPFG3VBDcjs.Button,
3097
+ _chunkZDYV536Qcjs.Button,
3046
3098
  {
3047
3099
  onClick: () => selectedEntry && onContinue(
3048
3100
  selectedEntry.token,
@@ -3055,7 +3107,7 @@ function SolanaTokenSelectStep({
3055
3107
  }
3056
3108
  )
3057
3109
  ] }),
3058
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.PoweredBy, {})
3110
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.PoweredBy, {})
3059
3111
  ] });
3060
3112
  }
3061
3113
 
@@ -3088,7 +3140,7 @@ function SolanaAmountStep({
3088
3140
  const [error, setError] = _react.useState.call(void 0, null);
3089
3141
  const hasAppliedDefaultRef = _react.useRef.call(void 0, false);
3090
3142
  const isSourceStablecoin = _chunkABVRVW3Pcjs.isStablecoinSymbol.call(void 0, token.symbol);
3091
- const isMaxDefault = _optionalChain([defaultAmount, 'optionalAccess', _106 => _106.trim, 'call', _107 => _107(), 'access', _108 => _108.toLowerCase, 'call', _109 => _109()]) === "max";
3143
+ const isMaxDefault = _optionalChain([defaultAmount, 'optionalAccess', _102 => _102.trim, 'call', _103 => _103(), 'access', _104 => _104.toLowerCase, 'call', _105 => _105()]) === "max";
3092
3144
  const tokenPriceUsd = _react.useMemo.call(void 0, () => {
3093
3145
  if (isSourceStablecoin) return 1;
3094
3146
  try {
@@ -3098,7 +3150,7 @@ function SolanaAmountStep({
3098
3150
  }
3099
3151
  const price = balanceUsd / balanceUnits;
3100
3152
  return price > 0 ? price : null;
3101
- } catch (e21) {
3153
+ } catch (e23) {
3102
3154
  return null;
3103
3155
  }
3104
3156
  }, [isSourceStablecoin, balance, token.decimals, balanceUsd]);
@@ -3108,8 +3160,8 @@ function SolanaAmountStep({
3108
3160
  const raw = _viem.formatUnits.call(void 0, balance, token.decimals);
3109
3161
  const numeric = Number(raw);
3110
3162
  if (!Number.isFinite(numeric)) return raw;
3111
- return _chunkPPFG3VBDcjs.tokenFormatter.format(numeric);
3112
- } catch (e22) {
3163
+ return _chunkZDYV536Qcjs.tokenFormatter.format(numeric);
3164
+ } catch (e24) {
3113
3165
  return "\u2026";
3114
3166
  }
3115
3167
  }, [balance, token.decimals]);
@@ -3120,7 +3172,7 @@ function SolanaAmountStep({
3120
3172
  if (tokenPriceUsd !== null) return balanceUnits * tokenPriceUsd;
3121
3173
  if (Number.isFinite(balanceUsd) && balanceUsd > 0) return balanceUsd;
3122
3174
  return null;
3123
- } catch (e23) {
3175
+ } catch (e25) {
3124
3176
  return null;
3125
3177
  }
3126
3178
  }, [balance, token.decimals, tokenPriceUsd, balanceUsd]);
@@ -3134,7 +3186,7 @@ function SolanaAmountStep({
3134
3186
  if (!Number.isFinite(spendableUnits) || spendableUnits < 0) return null;
3135
3187
  if (tokenPriceUsd !== null) return spendableUnits * tokenPriceUsd;
3136
3188
  return null;
3137
- } catch (e24) {
3189
+ } catch (e26) {
3138
3190
  return null;
3139
3191
  }
3140
3192
  }, [spendableBalance, token.decimals, tokenPriceUsd]);
@@ -3149,7 +3201,7 @@ function SolanaAmountStep({
3149
3201
  const factor = 1e3;
3150
3202
  const truncated = Math.floor(value * factor) / factor;
3151
3203
  return truncated.toFixed(3).replace(/\.?0+$/, "");
3152
- } catch (e25) {
3204
+ } catch (e27) {
3153
3205
  return "";
3154
3206
  }
3155
3207
  },
@@ -3186,12 +3238,12 @@ function SolanaAmountStep({
3186
3238
  const raw = isSourceStablecoin || !hasPricing ? numericAmount : numericAmount / (_nullishCoalesce(tokenPriceUsd, () => ( 1)));
3187
3239
  try {
3188
3240
  return _viem.parseUnits.call(void 0, raw.toString(), token.decimals);
3189
- } catch (e26) {
3241
+ } catch (e28) {
3190
3242
  return null;
3191
3243
  }
3192
3244
  }, [numericAmount, isSourceStablecoin, hasPricing, tokenPriceUsd, token.decimals]);
3193
- const minDepositUsd = targetChain === _chunkABVRVW3Pcjs.HYPERCORE_CHAIN_ID ? Math.max(_chunkABVRVW3Pcjs.HYPERCORE_MIN_DEPOSIT_USD, _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _110 => _110.minDepositUsd]), () => ( 0))) : _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _111 => _111.minDepositUsd]), () => ( null));
3194
- const maxDepositUsd = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _112 => _112.maxDepositUsd]), () => ( null));
3245
+ const minDepositUsd = targetChain === _chunkABVRVW3Pcjs.HYPERCORE_CHAIN_ID ? Math.max(_chunkABVRVW3Pcjs.HYPERCORE_MIN_DEPOSIT_USD, _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _106 => _106.minDepositUsd]), () => ( 0))) : _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _107 => _107.minDepositUsd]), () => ( null));
3246
+ const maxDepositUsd = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _108 => _108.maxDepositUsd]), () => ( null));
3195
3247
  const isBelowMin = minDepositUsd !== null && numericAmount > 0 && numericAmount < minDepositUsd;
3196
3248
  const isAboveMax = maxDepositUsd !== null && numericAmount > maxDepositUsd;
3197
3249
  const exceedsBalance = Boolean(
@@ -3201,7 +3253,7 @@ function SolanaAmountStep({
3201
3253
  const handlePresetClick = (percentage) => {
3202
3254
  const formatted = computePresetAmount(percentage);
3203
3255
  if (!formatted) return;
3204
- _chunkPPFG3VBDcjs.debugLog.call(void 0, debug, "solana-amount", "amount:preset", {
3256
+ _chunkZDYV536Qcjs.debugLog.call(void 0, debug, "solana-amount", "amount:preset", {
3205
3257
  percentage,
3206
3258
  symbol: token.symbol,
3207
3259
  formatted
@@ -3235,8 +3287,8 @@ function SolanaAmountStep({
3235
3287
  let amountInUnits;
3236
3288
  try {
3237
3289
  amountInUnits = _viem.parseUnits.call(void 0, sourceAmountStr, token.decimals);
3238
- } catch (e27) {
3239
- _chunkPPFG3VBDcjs.debugLog.call(void 0, debug, "solana-amount", "amount:invalid", {
3290
+ } catch (e29) {
3291
+ _chunkZDYV536Qcjs.debugLog.call(void 0, debug, "solana-amount", "amount:invalid", {
3240
3292
  amount,
3241
3293
  sourceAmount: sourceAmountStr,
3242
3294
  reason: "parse-units-failed"
@@ -3251,7 +3303,7 @@ function SolanaAmountStep({
3251
3303
  );
3252
3304
  return;
3253
3305
  }
3254
- _chunkPPFG3VBDcjs.debugLog.call(void 0, debug, "solana-amount", "amount:continue", {
3306
+ _chunkZDYV536Qcjs.debugLog.call(void 0, debug, "solana-amount", "amount:continue", {
3255
3307
  symbol: token.symbol,
3256
3308
  inputAmountUsd: amount,
3257
3309
  sourceAmount: sourceAmountStr,
@@ -3265,7 +3317,7 @@ function SolanaAmountStep({
3265
3317
  const sourceTokenIcon = _chunkABVRVW3Pcjs.getTokenIcon.call(void 0, token.symbol);
3266
3318
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
3267
3319
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
3268
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.WalletIcon, {}), title: "Wallet deposit" }),
3320
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.WalletIcon, {}), title: "Wallet deposit" }),
3269
3321
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-section", children: [
3270
3322
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-display", children: [
3271
3323
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
@@ -3285,13 +3337,13 @@ function SolanaAmountStep({
3285
3337
  " available",
3286
3338
  computedBalanceUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
3287
3339
  " (~",
3288
- _chunkPPFG3VBDcjs.currencyFormatter.format(computedBalanceUsd),
3340
+ _chunkZDYV536Qcjs.currencyFormatter.format(computedBalanceUsd),
3289
3341
  ")"
3290
3342
  ] })
3291
3343
  ] }),
3292
3344
  minDepositUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-amount-meta-minimum", children: [
3293
3345
  "Min. deposit ",
3294
- _chunkPPFG3VBDcjs.currencyFormatter.format(minDepositUsd)
3346
+ _chunkZDYV536Qcjs.currencyFormatter.format(minDepositUsd)
3295
3347
  ] })
3296
3348
  ] })
3297
3349
  ] }),
@@ -3330,13 +3382,13 @@ function SolanaAmountStep({
3330
3382
  ] }),
3331
3383
  balanceAfterUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
3332
3384
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Balance after deposit" }),
3333
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children: _chunkPPFG3VBDcjs.currencyFormatter.format(balanceAfterUsd) })
3385
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children: _chunkZDYV536Qcjs.currencyFormatter.format(balanceAfterUsd) })
3334
3386
  ] })
3335
3387
  ] }),
3336
- targetChain === _chunkABVRVW3Pcjs.HYPERCORE_CHAIN_ID && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.Callout, { variant: "warning", children: "First deposit to a new HyperCore account includes a ~1 USDC activation fee." }),
3337
- error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.Callout, { variant: "error", children: error }),
3388
+ targetChain === _chunkABVRVW3Pcjs.HYPERCORE_CHAIN_ID && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.Callout, { variant: "warning", children: "First deposit to a new HyperCore account includes a ~1 USDC activation fee." }),
3389
+ error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.Callout, { variant: "error", children: error }),
3338
3390
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
3339
- _chunkPPFG3VBDcjs.Button,
3391
+ _chunkZDYV536Qcjs.Button,
3340
3392
  {
3341
3393
  onClick: handleContinue,
3342
3394
  fullWidth: true,
@@ -3345,7 +3397,7 @@ function SolanaAmountStep({
3345
3397
  }
3346
3398
  )
3347
3399
  ] }),
3348
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.PoweredBy, {})
3400
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.PoweredBy, {})
3349
3401
  ] });
3350
3402
  }
3351
3403
 
@@ -3368,10 +3420,10 @@ var _spltoken = require('@solana/spl-token');
3368
3420
  var DEFAULT_SOLANA_RPC_URL = "https://api.mainnet.solana.com";
3369
3421
  var cachedConnections = /* @__PURE__ */ new Map();
3370
3422
  function getSolanaRpcUrl(rpcUrls) {
3371
- return _nullishCoalesce(_chunkPPFG3VBDcjs.rpcUrlFor.call(void 0, rpcUrls, "solana"), () => ( DEFAULT_SOLANA_RPC_URL));
3423
+ return _nullishCoalesce(_chunkZDYV536Qcjs.rpcUrlFor.call(void 0, rpcUrls, "solana"), () => ( DEFAULT_SOLANA_RPC_URL));
3372
3424
  }
3373
3425
  function hasConfiguredSolanaRpcUrl(rpcUrls) {
3374
- return _chunkPPFG3VBDcjs.rpcUrlFor.call(void 0, rpcUrls, "solana") !== void 0;
3426
+ return _chunkZDYV536Qcjs.rpcUrlFor.call(void 0, rpcUrls, "solana") !== void 0;
3375
3427
  }
3376
3428
  function getSolanaConnection(rpcUrls) {
3377
3429
  const rpcUrl = getSolanaRpcUrl(rpcUrls);
@@ -3473,7 +3525,7 @@ function SolanaConfirmStep({
3473
3525
  onError,
3474
3526
  debug
3475
3527
  }) {
3476
- const rpcUrls = _chunkPPFG3VBDcjs.useRpcUrls.call(void 0, );
3528
+ const rpcUrls = _chunkZDYV536Qcjs.useRpcUrls.call(void 0, );
3477
3529
  const [isSubmitting, setIsSubmitting] = _react.useState.call(void 0, false);
3478
3530
  const [error, setError] = _react.useState.call(void 0, null);
3479
3531
  const targetSymbol = _chunkABVRVW3Pcjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain);
@@ -3483,13 +3535,13 @@ function SolanaConfirmStep({
3483
3535
  const targetChainIcon = _chunkABVRVW3Pcjs.getChainIcon.call(void 0, targetChain);
3484
3536
  const sourceTokenIcon = _chunkABVRVW3Pcjs.getTokenIcon.call(void 0, token.symbol);
3485
3537
  const targetTokenIcon = _chunkABVRVW3Pcjs.getTokenIcon.call(void 0, targetSymbol);
3486
- const feeSponsored = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _113 => _113.feeSponsored]), () => ( false));
3487
- const feeTooltip = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _114 => _114.feeTooltip]), () => ( (feeSponsored ? "Network fees are sponsored for this deposit." : "Network fees apply.")));
3488
- const formattedAmount = sourceAmount && Number.isFinite(Number(sourceAmount)) ? _nullishCoalesce(_chunkPPFG3VBDcjs.formatTokenAmount.call(void 0, Number(sourceAmount), token.symbol), () => ( "0")) : "0";
3538
+ const feeSponsored = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _109 => _109.feeSponsored]), () => ( false));
3539
+ const feeTooltip = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _110 => _110.feeTooltip]), () => ( (feeSponsored ? "Network fees are sponsored for this deposit." : "Network fees apply.")));
3540
+ const formattedAmount = sourceAmount && Number.isFinite(Number(sourceAmount)) ? _nullishCoalesce(_chunkZDYV536Qcjs.formatTokenAmount.call(void 0, Number(sourceAmount), token.symbol), () => ( "0")) : "0";
3489
3541
  const receiveDisplay = (() => {
3490
3542
  const usdValue = Number(targetAmount);
3491
3543
  const sourceAmountUsd = Number.isFinite(usdValue) && usdValue > 0 ? usdValue : void 0;
3492
- const estimate = _chunkPPFG3VBDcjs.formatReceiveEstimate.call(void 0, {
3544
+ const estimate = _chunkZDYV536Qcjs.formatReceiveEstimate.call(void 0, {
3493
3545
  sourceAmount: Number.isFinite(Number(sourceAmount)) ? Number(sourceAmount) : void 0,
3494
3546
  sourceSymbol: token.symbol,
3495
3547
  targetSymbol,
@@ -3501,7 +3553,7 @@ function SolanaConfirmStep({
3501
3553
  })();
3502
3554
  const handleConfirm = async () => {
3503
3555
  if (!solanaProvider) {
3504
- _chunkPPFG3VBDcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:blocked", {
3556
+ _chunkZDYV536Qcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:blocked", {
3505
3557
  reason: "missing-provider"
3506
3558
  });
3507
3559
  setError("Solana wallet not connected");
@@ -3509,7 +3561,7 @@ function SolanaConfirmStep({
3509
3561
  }
3510
3562
  const parsedAmount = parseFloat(sourceAmount);
3511
3563
  if (isNaN(parsedAmount) || parsedAmount <= 0) {
3512
- _chunkPPFG3VBDcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:blocked", {
3564
+ _chunkZDYV536Qcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:blocked", {
3513
3565
  reason: "invalid-amount",
3514
3566
  sourceAmount
3515
3567
  });
@@ -3518,7 +3570,7 @@ function SolanaConfirmStep({
3518
3570
  }
3519
3571
  setError(null);
3520
3572
  setIsSubmitting(true);
3521
- _chunkPPFG3VBDcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:start", {
3573
+ _chunkZDYV536Qcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:start", {
3522
3574
  smartAccount,
3523
3575
  solanaAddress,
3524
3576
  solanaDepositAddress,
@@ -3528,7 +3580,7 @@ function SolanaConfirmStep({
3528
3580
  });
3529
3581
  try {
3530
3582
  const check = await service.checkAccount(smartAccount);
3531
- _chunkPPFG3VBDcjs.debugLog.call(void 0, debug, "solana-confirm", "check:success", {
3583
+ _chunkZDYV536Qcjs.debugLog.call(void 0, debug, "solana-confirm", "check:success", {
3532
3584
  smartAccount,
3533
3585
  isRegistered: check.isRegistered,
3534
3586
  targetChain: check.targetChain,
@@ -3541,7 +3593,7 @@ function SolanaConfirmStep({
3541
3593
  }
3542
3594
  const connection = hasConfiguredSolanaRpcUrl(rpcUrls) ? getSolanaConnection(rpcUrls) : _nullishCoalesce(solanaConnection, () => ( getSolanaConnection(rpcUrls)));
3543
3595
  const amountUnits = _viem.parseUnits.call(void 0, sourceAmount, token.decimals);
3544
- _chunkPPFG3VBDcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:start", {
3596
+ _chunkZDYV536Qcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:start", {
3545
3597
  token: token.symbol,
3546
3598
  sourceAmount,
3547
3599
  amountUnits: amountUnits.toString()
@@ -3558,10 +3610,10 @@ function SolanaConfirmStep({
3558
3610
  token.mint,
3559
3611
  amountUnits
3560
3612
  );
3561
- _chunkPPFG3VBDcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:success", {
3613
+ _chunkZDYV536Qcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:success", {
3562
3614
  token: token.symbol,
3563
3615
  instructionCount: transaction.instructions.length,
3564
- feePayer: _optionalChain([transaction, 'access', _115 => _115.feePayer, 'optionalAccess', _116 => _116.toBase58, 'call', _117 => _117()]),
3616
+ feePayer: _optionalChain([transaction, 'access', _111 => _111.feePayer, 'optionalAccess', _112 => _112.toBase58, 'call', _113 => _113()]),
3565
3617
  recentBlockhash: transaction.recentBlockhash
3566
3618
  });
3567
3619
  const txHash = await sendSolanaTransaction(
@@ -3569,28 +3621,28 @@ function SolanaConfirmStep({
3569
3621
  connection,
3570
3622
  transaction
3571
3623
  );
3572
- _chunkPPFG3VBDcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:sent", {
3624
+ _chunkZDYV536Qcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:sent", {
3573
3625
  txHash,
3574
3626
  amountUnits: amountUnits.toString()
3575
3627
  });
3576
3628
  onConfirm(txHash, amountUnits.toString());
3577
3629
  } catch (err) {
3578
3630
  const raw = err instanceof Error ? err.message : "Transfer failed";
3579
- const message = _chunkPPFG3VBDcjs.formatUserError.call(void 0, raw);
3580
- _chunkPPFG3VBDcjs.debugError.call(void 0, debug, "solana-confirm", "submit:failure", err, {
3631
+ const message = _chunkZDYV536Qcjs.formatUserError.call(void 0, raw);
3632
+ _chunkZDYV536Qcjs.debugError.call(void 0, debug, "solana-confirm", "submit:failure", err, {
3581
3633
  smartAccount,
3582
3634
  token: token.symbol,
3583
3635
  sourceAmount
3584
3636
  });
3585
3637
  setError(message);
3586
- _optionalChain([onError, 'optionalCall', _118 => _118(message, "SOLANA_TRANSFER_ERROR")]);
3638
+ _optionalChain([onError, 'optionalCall', _114 => _114(message, "SOLANA_TRANSFER_ERROR")]);
3587
3639
  } finally {
3588
3640
  setIsSubmitting(false);
3589
3641
  }
3590
3642
  };
3591
3643
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
3592
3644
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
3593
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.WalletIcon, {}), title: "Review deposit" }),
3645
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.WalletIcon, {}), title: "Review deposit" }),
3594
3646
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-details", children: [
3595
3647
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
3596
3648
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Source chain" }),
@@ -3638,13 +3690,13 @@ function SolanaConfirmStep({
3638
3690
  children: "$0.04"
3639
3691
  }
3640
3692
  ),
3641
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.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, _chunkPPFG3VBDcjs.InfoIcon, {}) }) })
3693
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.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, _chunkZDYV536Qcjs.InfoIcon, {}) }) })
3642
3694
  ] })
3643
3695
  ] })
3644
3696
  ] }),
3645
- error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.Callout, { variant: "error", children: error }),
3697
+ error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.Callout, { variant: "error", children: error }),
3646
3698
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
3647
- _chunkPPFG3VBDcjs.Button,
3699
+ _chunkZDYV536Qcjs.Button,
3648
3700
  {
3649
3701
  onClick: handleConfirm,
3650
3702
  loading: isSubmitting,
@@ -3655,7 +3707,7 @@ function SolanaConfirmStep({
3655
3707
  }
3656
3708
  )
3657
3709
  ] }),
3658
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.PoweredBy, {})
3710
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.PoweredBy, {})
3659
3711
  ] });
3660
3712
  }
3661
3713
 
@@ -3669,18 +3721,18 @@ function DappImportAssetSelectStep({
3669
3721
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
3670
3722
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
3671
3723
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
3672
- _chunkPPFG3VBDcjs.BodyHeader,
3724
+ _chunkZDYV536Qcjs.BodyHeader,
3673
3725
  {
3674
- icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.WalletIcon, {}),
3726
+ icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.WalletIcon, {}),
3675
3727
  title: `Transfer from ${sourceLabel}`,
3676
3728
  subtitle: "Pick the balance to import"
3677
3729
  }
3678
3730
  ),
3679
3731
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-list", children: assets.map((asset) => {
3680
- const tokenAmount = asset.balance ? _chunkPPFG3VBDcjs.tokenFormatter.format(
3732
+ const tokenAmount = asset.balance ? _chunkZDYV536Qcjs.tokenFormatter.format(
3681
3733
  Number(asset.balance) / 10 ** asset.decimals
3682
3734
  ) : "0";
3683
- const balanceUsd = asset.balanceUsd && asset.balanceUsd > 0 ? _chunkPPFG3VBDcjs.currencyFormatter.format(asset.balanceUsd) : `${tokenAmount} ${asset.symbol}`;
3735
+ const balanceUsd = asset.balanceUsd && asset.balanceUsd > 0 ? _chunkZDYV536Qcjs.currencyFormatter.format(asset.balanceUsd) : `${tokenAmount} ${asset.symbol}`;
3684
3736
  const tokenIcon = _nullishCoalesce(asset.icon, () => ( _chunkABVRVW3Pcjs.getTokenIcon.call(void 0, asset.symbol)));
3685
3737
  const chainIcon = _chunkABVRVW3Pcjs.getChainIcon.call(void 0, asset.chainId);
3686
3738
  const badge = _chunkABVRVW3Pcjs.getChainBadge.call(void 0, asset.chainId);
@@ -3731,7 +3783,7 @@ function DappImportAssetSelectStep({
3731
3783
  );
3732
3784
  }) })
3733
3785
  ] }),
3734
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.PoweredBy, {})
3786
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.PoweredBy, {})
3735
3787
  ] });
3736
3788
  }
3737
3789
  DappImportAssetSelectStep.displayName = "DappImportAssetSelectStep";
@@ -3748,9 +3800,9 @@ function DappImportAssetSelectSkeleton({
3748
3800
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-sr-only", role: "status", children: error ? "Couldn't load balances" : "Loading balances\u2026" }),
3749
3801
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
3750
3802
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
3751
- _chunkPPFG3VBDcjs.BodyHeader,
3803
+ _chunkZDYV536Qcjs.BodyHeader,
3752
3804
  {
3753
- icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.WalletIcon, {}),
3805
+ icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.WalletIcon, {}),
3754
3806
  title: `Transfer from ${sourceLabel}`,
3755
3807
  subtitle: "Pick the balance to import"
3756
3808
  }
@@ -3788,7 +3840,7 @@ function DappImportAssetSelectSkeleton({
3788
3840
  children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Try again" })
3789
3841
  }
3790
3842
  ) }),
3791
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.PoweredBy, {})
3843
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.PoweredBy, {})
3792
3844
  ] });
3793
3845
  }
3794
3846
  DappImportAssetSelectSkeleton.displayName = "DappImportAssetSelectSkeleton";
@@ -3978,21 +4030,21 @@ var polymarketProvider = {
3978
4030
  async fetchAvailability({ eoa, getPublicClient: getPublicClient2, signal }) {
3979
4031
  const proxyWallet = await _chunkNRNJAQUAcjs.fetchPolymarketProxyWallet.call(void 0, eoa, signal);
3980
4032
  if (!proxyWallet) return null;
3981
- if (_optionalChain([signal, 'optionalAccess', _119 => _119.aborted])) return null;
4033
+ if (_optionalChain([signal, 'optionalAccess', _115 => _115.aborted])) return null;
3982
4034
  const polygonClient = getPublicClient2(_chunkNRNJAQUAcjs.POLYMARKET_POLYGON_CHAIN_ID);
3983
4035
  if (!polygonClient) return null;
3984
4036
  const balances = await _chunkNRNJAQUAcjs.readPolymarketBalances.call(void 0, {
3985
4037
  publicClient: polygonClient,
3986
4038
  proxyWallet
3987
4039
  });
3988
- if (_optionalChain([signal, 'optionalAccess', _120 => _120.aborted])) return null;
4040
+ if (_optionalChain([signal, 'optionalAccess', _116 => _116.aborted])) return null;
3989
4041
  if (balances.pusd === 0n && balances.usdce === 0n) return null;
3990
4042
  const walletKind = await detectPolymarketWalletKind({
3991
4043
  publicClient: polygonClient,
3992
4044
  proxyWallet,
3993
4045
  eoa
3994
4046
  });
3995
- if (_optionalChain([signal, 'optionalAccess', _121 => _121.aborted])) return null;
4047
+ if (_optionalChain([signal, 'optionalAccess', _117 => _117.aborted])) return null;
3996
4048
  if (!walletKind) return null;
3997
4049
  const assets = [];
3998
4050
  if (balances.pusd > 0n) {
@@ -4093,6 +4145,67 @@ function getEnabledProviders(config) {
4093
4145
  );
4094
4146
  }
4095
4147
 
4148
+ // src/store/state.ts
4149
+ function portfolioKey(network, address) {
4150
+ return network === "evm" ? `evm:${address.toLowerCase()}` : `solana:${address}`;
4151
+ }
4152
+ function createInitialState(overrides) {
4153
+ return {
4154
+ flow: {
4155
+ step: "connect",
4156
+ mode: null,
4157
+ isConnectSelectionConfirmed: false,
4158
+ hasNavigatedBack: false
4159
+ },
4160
+ wallet: {
4161
+ selectedWalletId: null
4162
+ },
4163
+ deposit: {
4164
+ targetChain: overrides.targetChain,
4165
+ targetToken: overrides.targetToken,
4166
+ sourceChain: null,
4167
+ sourceToken: null,
4168
+ sourceSymbol: null,
4169
+ sourceDecimals: null,
4170
+ selectedAsset: null,
4171
+ selectedSolanaToken: null,
4172
+ amount: null,
4173
+ targetAmount: null,
4174
+ targetTokenPriceUsd: null,
4175
+ balance: null,
4176
+ balanceUsd: null,
4177
+ inputAmountUsd: null,
4178
+ liquidityWarning: null
4179
+ },
4180
+ processing: {
4181
+ txHash: null,
4182
+ directTransfer: false,
4183
+ swappedContext: null
4184
+ },
4185
+ dappImport: {
4186
+ activeProviderId: null,
4187
+ availabilityOwner: null,
4188
+ availability: {},
4189
+ selectedAsset: null,
4190
+ bootError: false,
4191
+ attemptNonce: 0
4192
+ },
4193
+ setup: {
4194
+ byOwner: {}
4195
+ },
4196
+ portfolio: {
4197
+ byKey: {},
4198
+ nextRequestId: 0
4199
+ },
4200
+ fiat: {
4201
+ selectedMethod: null
4202
+ },
4203
+ exchange: {
4204
+ selectedConnection: null
4205
+ }
4206
+ };
4207
+ }
4208
+
4096
4209
  // src/store/selectors.ts
4097
4210
  var selectedWalletIdSelector = (state) => state.wallet.selectedWalletId;
4098
4211
  var IDLE_SETUP_ENTRY = {
@@ -4112,12 +4225,16 @@ function readSetupForOwner(setup, owner) {
4112
4225
  const entry = setup.byOwner[owner.toLowerCase()];
4113
4226
  return _nullishCoalesce(entry, () => ( { ...IDLE_SETUP_ENTRY, owner }));
4114
4227
  }
4228
+ function readPortfolioEntry(portfolio, network, address) {
4229
+ if (!address) return void 0;
4230
+ return portfolio.byKey[portfolioKey(network, address)];
4231
+ }
4115
4232
 
4116
4233
  // src/core/dapp-imports/status.ts
4117
4234
  function computeDappImportStatus(providerId, inputs) {
4118
4235
  const { owner, availability, availabilityOwner, setup } = inputs;
4119
4236
  if (!owner) return "needs-connect";
4120
- const entry = _optionalChain([availabilityOwner, 'optionalAccess', _122 => _122.toLowerCase, 'call', _123 => _123()]) === owner.toLowerCase() ? availability[providerId] : void 0;
4237
+ const entry = _optionalChain([availabilityOwner, 'optionalAccess', _118 => _118.toLowerCase, 'call', _119 => _119()]) === owner.toLowerCase() ? availability[providerId] : void 0;
4121
4238
  if (entry === "loading" || entry === void 0) return "loading";
4122
4239
  if (entry === "error") {
4123
4240
  return {
@@ -4471,12 +4588,12 @@ function applyAction(state, action) {
4471
4588
  requestKey: action.requestKey,
4472
4589
  cacheKey: action.cacheKey,
4473
4590
  status: "loading",
4474
- smartAccount: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _124 => _124.smartAccount]), () => ( null)),
4475
- sessionOwnerAddress: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _125 => _125.sessionOwnerAddress]), () => ( null)),
4476
- solanaDepositAddress: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _126 => _126.solanaDepositAddress]), () => ( null)),
4591
+ smartAccount: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _120 => _120.smartAccount]), () => ( null)),
4592
+ sessionOwnerAddress: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _121 => _121.sessionOwnerAddress]), () => ( null)),
4593
+ solanaDepositAddress: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _122 => _122.solanaDepositAddress]), () => ( null)),
4477
4594
  message: null,
4478
4595
  cacheable: action.cacheable,
4479
- attemptNonce: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _127 => _127.attemptNonce]), () => ( 0))
4596
+ attemptNonce: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _123 => _123.attemptNonce]), () => ( 0))
4480
4597
  }));
4481
4598
  }
4482
4599
  case "setup/ready": {
@@ -4519,6 +4636,79 @@ function applyAction(state, action) {
4519
4636
  message: null,
4520
4637
  attemptNonce: entry.attemptNonce + 1
4521
4638
  }));
4639
+ case "portfolio/loading": {
4640
+ const key = portfolioKey(action.network, action.address);
4641
+ const requestId = state.portfolio.nextRequestId + 1;
4642
+ return {
4643
+ ...state,
4644
+ portfolio: {
4645
+ nextRequestId: requestId,
4646
+ byKey: {
4647
+ ...state.portfolio.byKey,
4648
+ [key]: { status: "loading", requestId, totalUsd: null }
4649
+ }
4650
+ }
4651
+ };
4652
+ }
4653
+ case "portfolio/reconciled": {
4654
+ const retainedKeys = new Set(
4655
+ action.wallets.map(
4656
+ ({ network, address }) => portfolioKey(network, address)
4657
+ )
4658
+ );
4659
+ const entries = Object.entries(state.portfolio.byKey);
4660
+ const retainedEntries = entries.filter(([key]) => retainedKeys.has(key));
4661
+ if (retainedEntries.length === entries.length) return state;
4662
+ return {
4663
+ ...state,
4664
+ portfolio: {
4665
+ ...state.portfolio,
4666
+ byKey: Object.fromEntries(retainedEntries)
4667
+ }
4668
+ };
4669
+ }
4670
+ case "portfolio/loaded": {
4671
+ const key = portfolioKey(action.network, action.address);
4672
+ const existing = state.portfolio.byKey[key];
4673
+ if (!existing || existing.status !== "loading" || existing.requestId !== action.requestId) {
4674
+ return state;
4675
+ }
4676
+ return {
4677
+ ...state,
4678
+ portfolio: {
4679
+ ...state.portfolio,
4680
+ byKey: {
4681
+ ...state.portfolio.byKey,
4682
+ [key]: {
4683
+ status: "ready",
4684
+ requestId: action.requestId,
4685
+ totalUsd: action.totalUsd
4686
+ }
4687
+ }
4688
+ }
4689
+ };
4690
+ }
4691
+ case "portfolio/failed": {
4692
+ const key = portfolioKey(action.network, action.address);
4693
+ const existing = state.portfolio.byKey[key];
4694
+ if (!existing || existing.status !== "loading" || existing.requestId !== action.requestId) {
4695
+ return state;
4696
+ }
4697
+ return {
4698
+ ...state,
4699
+ portfolio: {
4700
+ ...state.portfolio,
4701
+ byKey: {
4702
+ ...state.portfolio.byKey,
4703
+ [key]: {
4704
+ status: "error",
4705
+ requestId: action.requestId,
4706
+ totalUsd: existing.totalUsd
4707
+ }
4708
+ }
4709
+ }
4710
+ };
4711
+ }
4522
4712
  case "asset/selected":
4523
4713
  return {
4524
4714
  ...state,
@@ -4785,6 +4975,13 @@ function applyAction(state, action) {
4785
4975
  attemptNonce: 0
4786
4976
  },
4787
4977
  setup: { byOwner: preservedByOwner },
4978
+ // Ephemeral fetched balances — drop wholesale on close so a reopen
4979
+ // refetches rather than surfacing a stale balance (same hazard the
4980
+ // dappImport drop above guards against).
4981
+ portfolio: {
4982
+ byKey: {},
4983
+ nextRequestId: state.portfolio.nextRequestId
4984
+ },
4788
4985
  fiat: { selectedMethod: null },
4789
4986
  exchange: { selectedConnection: null }
4790
4987
  };
@@ -4819,60 +5016,6 @@ function applyAction(state, action) {
4819
5016
  }
4820
5017
  }
4821
5018
 
4822
- // src/store/state.ts
4823
- function createInitialState(overrides) {
4824
- return {
4825
- flow: {
4826
- step: "connect",
4827
- mode: null,
4828
- isConnectSelectionConfirmed: false,
4829
- hasNavigatedBack: false
4830
- },
4831
- wallet: {
4832
- selectedWalletId: null
4833
- },
4834
- deposit: {
4835
- targetChain: overrides.targetChain,
4836
- targetToken: overrides.targetToken,
4837
- sourceChain: null,
4838
- sourceToken: null,
4839
- sourceSymbol: null,
4840
- sourceDecimals: null,
4841
- selectedAsset: null,
4842
- selectedSolanaToken: null,
4843
- amount: null,
4844
- targetAmount: null,
4845
- targetTokenPriceUsd: null,
4846
- balance: null,
4847
- balanceUsd: null,
4848
- inputAmountUsd: null,
4849
- liquidityWarning: null
4850
- },
4851
- processing: {
4852
- txHash: null,
4853
- directTransfer: false,
4854
- swappedContext: null
4855
- },
4856
- dappImport: {
4857
- activeProviderId: null,
4858
- availabilityOwner: null,
4859
- availability: {},
4860
- selectedAsset: null,
4861
- bootError: false,
4862
- attemptNonce: 0
4863
- },
4864
- setup: {
4865
- byOwner: {}
4866
- },
4867
- fiat: {
4868
- selectedMethod: null
4869
- },
4870
- exchange: {
4871
- selectedConnection: null
4872
- }
4873
- };
4874
- }
4875
-
4876
5019
  // src/store/index.ts
4877
5020
  function createDepositStore(overrides) {
4878
5021
  const store = _vanilla.createStore.call(void 0, () => createInitialState(overrides));
@@ -4917,15 +5060,15 @@ var SetupError = class extends Error {
4917
5060
  }
4918
5061
  };
4919
5062
  async function resolveSessionOwner(eoaAddress) {
4920
- const local = _chunkPPFG3VBDcjs.loadSessionOwnerFromStorage.call(void 0, eoaAddress);
5063
+ const local = _chunkZDYV536Qcjs.loadSessionOwnerFromStorage.call(void 0, eoaAddress);
4921
5064
  if (local) {
4922
5065
  return {
4923
- account: _chunkPPFG3VBDcjs.accountFromPrivateKey.call(void 0, local.privateKey),
5066
+ account: _chunkZDYV536Qcjs.accountFromPrivateKey.call(void 0, local.privateKey),
4924
5067
  address: local.address
4925
5068
  };
4926
5069
  }
4927
- const created = _chunkPPFG3VBDcjs.createSessionOwnerKey.call(void 0, );
4928
- _chunkPPFG3VBDcjs.saveSessionOwnerToStorage.call(void 0, eoaAddress, created.privateKey, created.address);
5070
+ const created = _chunkZDYV536Qcjs.createSessionOwnerKey.call(void 0, );
5071
+ _chunkZDYV536Qcjs.saveSessionOwnerToStorage.call(void 0, eoaAddress, created.privateKey, created.address);
4929
5072
  return { account: created.account, address: created.address };
4930
5073
  }
4931
5074
  function stableStringify(value) {
@@ -4956,8 +5099,7 @@ function computeRequestKey(input, sessionOwnerAddress) {
4956
5099
  signerAddress: input.signerAddress.toLowerCase(),
4957
5100
  sessionChainIds: _nullishCoalesce(input.sessionChainIds, () => ( null)),
4958
5101
  enableSolana: _nullishCoalesce(input.enableSolana, () => ( true)),
4959
- forceRegister: _nullishCoalesce(input.forceRegister, () => ( false)),
4960
- postBridgeActions: _nullishCoalesce(input.postBridgeActions, () => ( null))
5102
+ forceRegister: _nullishCoalesce(input.forceRegister, () => ( false))
4961
5103
  });
4962
5104
  }
4963
5105
  function computeCacheKey(input, sessionOwnerAddress) {
@@ -4975,14 +5117,14 @@ function computeCacheKey(input, sessionOwnerAddress) {
4975
5117
  });
4976
5118
  }
4977
5119
  function computeIsCacheable(input) {
4978
- return !input.forceRegister && !(_nullishCoalesce(_optionalChain([input, 'access', _128 => _128.postBridgeActions, 'optionalAccess', _129 => _129.length]), () => ( 0)));
5120
+ return !input.forceRegister;
4979
5121
  }
4980
5122
  var SETUP_REQUEST_DEDUPE_TTL_MS = 3e4;
4981
5123
  var setupRequestDedupe = /* @__PURE__ */ new Map();
4982
5124
  function readDedupedAccountSetupResult(requestKey) {
4983
5125
  const now = Date.now();
4984
5126
  const existing = setupRequestDedupe.get(requestKey);
4985
- if (_optionalChain([existing, 'optionalAccess', _130 => _130.settled]) && existing.expiresAt > now && existing.result) {
5127
+ if (_optionalChain([existing, 'optionalAccess', _124 => _124.settled]) && existing.expiresAt > now && existing.result) {
4986
5128
  return existing.result;
4987
5129
  }
4988
5130
  return null;
@@ -4993,10 +5135,9 @@ async function runAccountSetup(input, deps) {
4993
5135
  try {
4994
5136
  const sessionOwner = await resolveSessionOwner(input.ownerAddress);
4995
5137
  const cacheKey = computeCacheKey(input, sessionOwner.address);
4996
- _chunkPPFG3VBDcjs.debugLog.call(void 0, debug, "account-setup", "setup:start", {
5138
+ _chunkZDYV536Qcjs.debugLog.call(void 0, debug, "account-setup", "setup:start", {
4997
5139
  owner: input.ownerAddress,
4998
5140
  sessionOwner: sessionOwner.address,
4999
- hasPostBridgeActions: Boolean(_optionalChain([input, 'access', _131 => _131.postBridgeActions, 'optionalAccess', _132 => _132.length])),
5000
5141
  forceRegister: _nullishCoalesce(input.forceRegister, () => ( false))
5001
5142
  });
5002
5143
  const setup = await service.setupAccount({
@@ -5005,7 +5146,6 @@ async function runAccountSetup(input, deps) {
5005
5146
  targetChain: _chunkABVRVW3Pcjs.targetChainToCaip2.call(void 0, input.targetChain),
5006
5147
  targetToken: input.targetToken,
5007
5148
  recipient: input.recipient,
5008
- postBridgeActions: input.postBridgeActions,
5009
5149
  outputTokenRules: input.outputTokenRules,
5010
5150
  rejectUnmapped: input.rejectUnmapped,
5011
5151
  signerAddress: input.signerAddress,
@@ -5041,7 +5181,7 @@ async function runAccountSetup(input, deps) {
5041
5181
  primaryType: typedData.primaryType,
5042
5182
  message: typedData.message
5043
5183
  });
5044
- const sessionDetails = _chunkPPFG3VBDcjs.buildSessionDetails.call(void 0,
5184
+ const sessionDetails = _chunkZDYV536Qcjs.buildSessionDetails.call(void 0,
5045
5185
  setup.sessionDetailsUnsigned,
5046
5186
  signature
5047
5187
  );
@@ -5058,10 +5198,7 @@ async function runAccountSetup(input, deps) {
5058
5198
  chain: _chunkABVRVW3Pcjs.targetChainToCaip2.call(void 0, input.targetChain),
5059
5199
  token: input.targetToken,
5060
5200
  ...input.recipient && { recipient: input.recipient },
5061
- ..._optionalChain([input, 'access', _133 => _133.postBridgeActions, 'optionalAccess', _134 => _134.length]) && {
5062
- postBridgeActions: input.postBridgeActions
5063
- },
5064
- ..._optionalChain([input, 'access', _135 => _135.outputTokenRules, 'optionalAccess', _136 => _136.length]) && {
5201
+ ..._optionalChain([input, 'access', _125 => _125.outputTokenRules, 'optionalAccess', _126 => _126.length]) && {
5065
5202
  outputTokenRules: input.outputTokenRules
5066
5203
  },
5067
5204
  ...input.rejectUnmapped != null && {
@@ -5077,7 +5214,7 @@ async function runAccountSetup(input, deps) {
5077
5214
  isRegistered: true
5078
5215
  };
5079
5216
  } catch (error) {
5080
- _chunkPPFG3VBDcjs.debugError.call(void 0, debug, "account-setup", "setup:failed", error, {
5217
+ _chunkZDYV536Qcjs.debugError.call(void 0, debug, "account-setup", "setup:failed", error, {
5081
5218
  owner: input.ownerAddress
5082
5219
  });
5083
5220
  if (error instanceof SetupError) throw error;
@@ -5088,7 +5225,7 @@ function runAccountSetupDeduped(input, deps, requestKey) {
5088
5225
  const now = Date.now();
5089
5226
  const existing = setupRequestDedupe.get(requestKey);
5090
5227
  if (existing && (!existing.settled || existing.expiresAt > now)) {
5091
- _chunkPPFG3VBDcjs.debugLog.call(void 0, deps.debug, "account-setup", "setup:dedupe-hit", {
5228
+ _chunkZDYV536Qcjs.debugLog.call(void 0, deps.debug, "account-setup", "setup:dedupe-hit", {
5092
5229
  owner: input.ownerAddress,
5093
5230
  forceRegister: _nullishCoalesce(input.forceRegister, () => ( false))
5094
5231
  });
@@ -5350,7 +5487,6 @@ function DepositFlow({
5350
5487
  amount: defaultAmount,
5351
5488
  recipient,
5352
5489
  appBalanceUsd,
5353
- postBridgeActions,
5354
5490
  outputTokenRules,
5355
5491
  rejectUnmapped,
5356
5492
  signerAddress = _chunkABVRVW3Pcjs.DEFAULT_SIGNER_ADDRESS,
@@ -5376,16 +5512,17 @@ function DepositFlow({
5376
5512
  onError,
5377
5513
  debug
5378
5514
  }) {
5379
- const rpcUrls = _chunkPPFG3VBDcjs.useRpcUrls.call(void 0, );
5380
- const onStepChangeRef = _chunkPPFG3VBDcjs.useLatestRef.call(void 0, onStepChange);
5381
- const onEventRef = _chunkPPFG3VBDcjs.useLatestRef.call(void 0, onEvent);
5382
- const onLifecycleRef = _chunkPPFG3VBDcjs.useLatestRef.call(void 0, onLifecycle);
5383
- const onErrorRef = _chunkPPFG3VBDcjs.useLatestRef.call(void 0, onError);
5515
+ const rpcUrls = _chunkZDYV536Qcjs.useRpcUrls.call(void 0, );
5516
+ const onStepChangeRef = _chunkZDYV536Qcjs.useLatestRef.call(void 0, onStepChange);
5517
+ const onEventRef = _chunkZDYV536Qcjs.useLatestRef.call(void 0, onEvent);
5518
+ const onLifecycleRef = _chunkZDYV536Qcjs.useLatestRef.call(void 0, onLifecycle);
5519
+ const onErrorRef = _chunkZDYV536Qcjs.useLatestRef.call(void 0, onError);
5384
5520
  const storeApi = useDepositStoreApi();
5385
5521
  const flowSlice = useDepositStore((s) => s.flow);
5386
5522
  const depositSlice = useDepositStore((s) => s.deposit);
5387
5523
  const processingSlice = useDepositStore((s) => s.processing);
5388
5524
  const setupSlice = useDepositStore((s) => s.setup);
5525
+ const portfolioSlice = useDepositStore((s) => s.portfolio);
5389
5526
  const fiatSlice = useDepositStore((s) => s.fiat);
5390
5527
  const exchangeSlice = useDepositStore((s) => s.exchange);
5391
5528
  const flowMode = flowSlice.mode;
@@ -5396,23 +5533,42 @@ function DepositFlow({
5396
5533
  const stableWalletSelectionKeyRef = _react.useRef.call(void 0, null);
5397
5534
  const logFlow = _react.useCallback.call(void 0,
5398
5535
  (message, data) => {
5399
- _chunkPPFG3VBDcjs.debugLog.call(void 0, debug, "deposit-flow", message, data);
5536
+ _chunkZDYV536Qcjs.debugLog.call(void 0, debug, "deposit-flow", message, data);
5400
5537
  },
5401
5538
  [debug]
5402
5539
  );
5403
5540
  const logFlowError = _react.useCallback.call(void 0,
5404
5541
  (message, error, data) => {
5405
- _chunkPPFG3VBDcjs.debugError.call(void 0, debug, "deposit-flow", message, error, data);
5542
+ _chunkZDYV536Qcjs.debugError.call(void 0, debug, "deposit-flow", message, error, data);
5406
5543
  },
5407
5544
  [debug]
5408
5545
  );
5546
+ const enableSwappedPreconnect = enableFiatOnramp || enableExchangeConnect;
5547
+ _react.useEffect.call(void 0, () => {
5548
+ if (!enableSwappedPreconnect) return;
5549
+ if (typeof document === "undefined") return;
5550
+ const links = [];
5551
+ for (const origin of SWAPPED_ORIGINS) {
5552
+ for (const rel of ["preconnect", "dns-prefetch"]) {
5553
+ const link = document.createElement("link");
5554
+ link.rel = rel;
5555
+ link.href = origin;
5556
+ link.dataset.rsSwappedPreconnect = "";
5557
+ document.head.appendChild(link);
5558
+ links.push(link);
5559
+ }
5560
+ }
5561
+ return () => {
5562
+ for (const link of links) link.remove();
5563
+ };
5564
+ }, [enableSwappedPreconnect]);
5409
5565
  const dappSwitchChain = _react.useMemo.call(void 0, () => {
5410
- if (!_optionalChain([dappWalletClient, 'optionalAccess', _137 => _137.switchChain])) return void 0;
5566
+ if (!_optionalChain([dappWalletClient, 'optionalAccess', _127 => _127.switchChain])) return void 0;
5411
5567
  return async (chainId) => {
5412
- await _optionalChain([dappWalletClient, 'access', _138 => _138.switchChain, 'optionalCall', _139 => _139({ id: chainId })]);
5568
+ await _optionalChain([dappWalletClient, 'access', _128 => _128.switchChain, 'optionalCall', _129 => _129({ id: chainId })]);
5413
5569
  };
5414
5570
  }, [dappWalletClient]);
5415
- const connectedWalletAddress = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess', _140 => _140.account, 'optionalAccess', _141 => _141.address]), () => ( null));
5571
+ const connectedWalletAddress = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess', _130 => _130.account, 'optionalAccess', _131 => _131.address]), () => ( null));
5416
5572
  const walletOptions = _react.useMemo.call(void 0, () => {
5417
5573
  const options = [];
5418
5574
  const seen = /* @__PURE__ */ new Set();
@@ -5426,7 +5582,7 @@ function DepositFlow({
5426
5582
  });
5427
5583
  seen.add(id);
5428
5584
  }
5429
- if (enableSolana && _optionalChain([reownWallet, 'optionalAccess', _142 => _142.isConnected]) && reownWallet.isSolana && reownWallet.solanaAddress && dappAddress) {
5585
+ if (enableSolana && _optionalChain([reownWallet, 'optionalAccess', _132 => _132.isConnected]) && reownWallet.isSolana && reownWallet.solanaAddress && dappAddress) {
5430
5586
  const id = _nullishCoalesce(reownWallet.caipAddress, () => ( `solana:${reownWallet.solanaAddress}`));
5431
5587
  if (!seen.has(id)) {
5432
5588
  options.push({
@@ -5438,7 +5594,7 @@ function DepositFlow({
5438
5594
  });
5439
5595
  seen.add(id);
5440
5596
  }
5441
- } else if (_optionalChain([reownWallet, 'optionalAccess', _143 => _143.address]) && reownWallet.isConnected && reownWallet.walletClient && reownWallet.publicClient && !seen.has(`evm:${reownWallet.address.toLowerCase()}`)) {
5597
+ } else if (_optionalChain([reownWallet, 'optionalAccess', _133 => _133.address]) && reownWallet.isConnected && reownWallet.walletClient && reownWallet.publicClient && !seen.has(`evm:${reownWallet.address.toLowerCase()}`)) {
5442
5598
  const id = `evm:${reownWallet.address.toLowerCase()}`;
5443
5599
  if (!seen.has(id)) {
5444
5600
  options.push({
@@ -5455,20 +5611,20 @@ function DepositFlow({
5455
5611
  }, [
5456
5612
  connectedWalletAddress,
5457
5613
  dappAddress,
5458
- _optionalChain([reownWallet, 'optionalAccess', _144 => _144.address]),
5459
- _optionalChain([reownWallet, 'optionalAccess', _145 => _145.isConnected]),
5460
- _optionalChain([reownWallet, 'optionalAccess', _146 => _146.walletClient]),
5461
- _optionalChain([reownWallet, 'optionalAccess', _147 => _147.publicClient]),
5462
- _optionalChain([reownWallet, 'optionalAccess', _148 => _148.icon]),
5614
+ _optionalChain([reownWallet, 'optionalAccess', _134 => _134.address]),
5615
+ _optionalChain([reownWallet, 'optionalAccess', _135 => _135.isConnected]),
5616
+ _optionalChain([reownWallet, 'optionalAccess', _136 => _136.walletClient]),
5617
+ _optionalChain([reownWallet, 'optionalAccess', _137 => _137.publicClient]),
5618
+ _optionalChain([reownWallet, 'optionalAccess', _138 => _138.icon]),
5463
5619
  enableSolana,
5464
- _optionalChain([reownWallet, 'optionalAccess', _149 => _149.isSolana]),
5465
- _optionalChain([reownWallet, 'optionalAccess', _150 => _150.solanaAddress]),
5466
- _optionalChain([reownWallet, 'optionalAccess', _151 => _151.caipAddress])
5620
+ _optionalChain([reownWallet, 'optionalAccess', _139 => _139.isSolana]),
5621
+ _optionalChain([reownWallet, 'optionalAccess', _140 => _140.solanaAddress]),
5622
+ _optionalChain([reownWallet, 'optionalAccess', _141 => _141.caipAddress])
5467
5623
  ]);
5468
- const canAutoLock = _optionalChain([dappWalletClient, 'optionalAccess', _152 => _152.account]) && dappAddress && !reownWallet && !enableFiatOnramp && !enableExchangeConnect;
5624
+ const canAutoLock = _optionalChain([dappWalletClient, 'optionalAccess', _142 => _142.account]) && dappAddress && !reownWallet && !enableFiatOnramp && !enableExchangeConnect;
5469
5625
  const hasWalletOptions = walletOptions.length > 0;
5470
5626
  const hasReownSession = Boolean(
5471
- enableSolana ? _optionalChain([reownWallet, 'optionalAccess', _153 => _153.isConnected]) || _optionalChain([reownWallet, 'optionalAccess', _154 => _154.address]) : _optionalChain([reownWallet, 'optionalAccess', _155 => _155.address])
5627
+ enableSolana ? _optionalChain([reownWallet, 'optionalAccess', _143 => _143.isConnected]) || _optionalChain([reownWallet, 'optionalAccess', _144 => _144.address]) : _optionalChain([reownWallet, 'optionalAccess', _145 => _145.address])
5472
5628
  );
5473
5629
  const isDappImportWalletHydrating = Boolean(
5474
5630
  hasDappWalletClientProp && dappWalletClient === void 0 || reownWallet && !hasReownSession && !reownWallet.isReady
@@ -5516,16 +5672,16 @@ function DepositFlow({
5516
5672
  return {
5517
5673
  ownerAddress: dappAddress,
5518
5674
  walletClient: void 0,
5519
- publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkPPFG3VBDcjs.getPublicClient.call(void 0, setupChainId, rpcUrls))),
5675
+ publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkZDYV536Qcjs.getPublicClient.call(void 0, setupChainId, rpcUrls))),
5520
5676
  switchChain: void 0
5521
5677
  };
5522
5678
  }
5523
5679
  if (canAutoLock) {
5524
- const fallbackChainId = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess', _156 => _156.chain, 'optionalAccess', _157 => _157.id]), () => ( setupChainId));
5680
+ const fallbackChainId = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess', _146 => _146.chain, 'optionalAccess', _147 => _147.id]), () => ( setupChainId));
5525
5681
  return {
5526
5682
  ownerAddress: dappWalletClient.account.address,
5527
5683
  walletClient: dappWalletClient,
5528
- publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkPPFG3VBDcjs.getPublicClient.call(void 0, fallbackChainId, rpcUrls))),
5684
+ publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkZDYV536Qcjs.getPublicClient.call(void 0, fallbackChainId, rpcUrls))),
5529
5685
  switchChain: dappSwitchChain
5530
5686
  };
5531
5687
  }
@@ -5539,24 +5695,24 @@ function DepositFlow({
5539
5695
  return {
5540
5696
  ownerAddress: dappAddress,
5541
5697
  walletClient: void 0,
5542
- publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkPPFG3VBDcjs.getPublicClient.call(void 0, setupChainId, rpcUrls))),
5698
+ publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkZDYV536Qcjs.getPublicClient.call(void 0, setupChainId, rpcUrls))),
5543
5699
  switchChain: void 0
5544
5700
  };
5545
5701
  }
5546
- if (selectedOption.kind === "connected" && _optionalChain([dappWalletClient, 'optionalAccess', _158 => _158.account]) && selectedOption.address && dappWalletClient.account.address.toLowerCase() === selectedOption.address.toLowerCase()) {
5547
- const fallbackChainId = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess', _159 => _159.chain, 'optionalAccess', _160 => _160.id]), () => ( setupChainId));
5702
+ if (selectedOption.kind === "connected" && _optionalChain([dappWalletClient, 'optionalAccess', _148 => _148.account]) && selectedOption.address && dappWalletClient.account.address.toLowerCase() === selectedOption.address.toLowerCase()) {
5703
+ const fallbackChainId = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess', _149 => _149.chain, 'optionalAccess', _150 => _150.id]), () => ( setupChainId));
5548
5704
  return {
5549
5705
  ownerAddress: dappWalletClient.account.address,
5550
5706
  walletClient: dappWalletClient,
5551
- publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkPPFG3VBDcjs.getPublicClient.call(void 0, fallbackChainId, rpcUrls))),
5707
+ publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkZDYV536Qcjs.getPublicClient.call(void 0, fallbackChainId, rpcUrls))),
5552
5708
  switchChain: dappSwitchChain
5553
5709
  };
5554
5710
  }
5555
- if (selectedOption.kind === "external" && _optionalChain([reownWallet, 'optionalAccess', _161 => _161.address]) && selectedOption.address && reownWallet.address.toLowerCase() === selectedOption.address.toLowerCase()) {
5711
+ if (selectedOption.kind === "external" && _optionalChain([reownWallet, 'optionalAccess', _151 => _151.address]) && selectedOption.address && reownWallet.address.toLowerCase() === selectedOption.address.toLowerCase()) {
5556
5712
  return {
5557
5713
  ownerAddress: reownWallet.address,
5558
5714
  walletClient: reownWallet.walletClient,
5559
- publicClient: _nullishCoalesce(reownWallet.publicClient, () => ( _chunkPPFG3VBDcjs.getPublicClient.call(void 0, setupChainId, rpcUrls))),
5715
+ publicClient: _nullishCoalesce(reownWallet.publicClient, () => ( _chunkZDYV536Qcjs.getPublicClient.call(void 0, setupChainId, rpcUrls))),
5560
5716
  switchChain: reownWallet.switchChain
5561
5717
  };
5562
5718
  }
@@ -5595,7 +5751,7 @@ function DepositFlow({
5595
5751
  return {
5596
5752
  ownerAddress: dappAddress,
5597
5753
  walletClient: void 0,
5598
- publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkPPFG3VBDcjs.getPublicClient.call(void 0, setupChainId, rpcUrls))),
5754
+ publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkZDYV536Qcjs.getPublicClient.call(void 0, setupChainId, rpcUrls))),
5599
5755
  switchChain: void 0
5600
5756
  };
5601
5757
  }
@@ -5620,37 +5776,37 @@ function DepositFlow({
5620
5776
  const selectedEvmWalletOwner = _react.useMemo.call(void 0, () => {
5621
5777
  if (!selectedWalletId) return null;
5622
5778
  const opt = walletOptions.find((o) => o.id === selectedWalletId);
5623
- if (_optionalChain([opt, 'optionalAccess', _162 => _162.kind]) === "external" && opt.address) {
5779
+ if (_optionalChain([opt, 'optionalAccess', _152 => _152.kind]) === "external" && opt.address) {
5624
5780
  return opt.address;
5625
5781
  }
5626
- if (_optionalChain([opt, 'optionalAccess', _163 => _163.kind]) === "connected" && opt.address) {
5782
+ if (_optionalChain([opt, 'optionalAccess', _153 => _153.kind]) === "connected" && opt.address) {
5627
5783
  return opt.address;
5628
5784
  }
5629
5785
  return null;
5630
5786
  }, [selectedWalletId, walletOptions]);
5631
5787
  const dappImportOwner = _react.useMemo.call(void 0, () => {
5632
5788
  if (selectedEvmWalletOwner) return selectedEvmWalletOwner;
5633
- if (_optionalChain([reownWallet, 'optionalAccess', _164 => _164.address]) && reownWallet.isConnected) {
5789
+ if (_optionalChain([reownWallet, 'optionalAccess', _154 => _154.address]) && reownWallet.isConnected) {
5634
5790
  return reownWallet.address;
5635
5791
  }
5636
5792
  if (connectedWalletAddress) return connectedWalletAddress;
5637
5793
  return null;
5638
5794
  }, [
5639
5795
  selectedEvmWalletOwner,
5640
- _optionalChain([reownWallet, 'optionalAccess', _165 => _165.address]),
5641
- _optionalChain([reownWallet, 'optionalAccess', _166 => _166.isConnected]),
5796
+ _optionalChain([reownWallet, 'optionalAccess', _155 => _155.address]),
5797
+ _optionalChain([reownWallet, 'optionalAccess', _156 => _156.isConnected]),
5642
5798
  connectedWalletAddress
5643
5799
  ]);
5644
5800
  const activeOwner = _react.useMemo.call(void 0,
5645
5801
  () => resolveOwnerForMode(flowMode, {
5646
5802
  dappAddress,
5647
- walletOwner: _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess', _167 => _167.ownerAddress]), () => ( (canAutoLock ? connectedWalletAddress : selectedEvmWalletOwner))),
5803
+ walletOwner: _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess', _157 => _157.ownerAddress]), () => ( (canAutoLock ? connectedWalletAddress : selectedEvmWalletOwner))),
5648
5804
  dappImportOwner
5649
5805
  }),
5650
5806
  [
5651
5807
  flowMode,
5652
5808
  dappAddress,
5653
- _optionalChain([signerContext, 'optionalAccess', _168 => _168.ownerAddress]),
5809
+ _optionalChain([signerContext, 'optionalAccess', _158 => _158.ownerAddress]),
5654
5810
  canAutoLock,
5655
5811
  connectedWalletAddress,
5656
5812
  selectedEvmWalletOwner,
@@ -5679,12 +5835,12 @@ function DepositFlow({
5679
5835
  return;
5680
5836
  }
5681
5837
  lastActiveSetupLifecycleKeyRef.current = lifecycleKey;
5682
- _optionalChain([onLifecycleRef, 'access', _169 => _169.current, 'optionalCall', _170 => _170({
5838
+ _optionalChain([onLifecycleRef, 'access', _159 => _159.current, 'optionalCall', _160 => _160({
5683
5839
  type: "smart-account-changed",
5684
5840
  evm: activeEntry.smartAccount,
5685
5841
  solana: _nullishCoalesce(activeEntry.solanaDepositAddress, () => ( null))
5686
5842
  })]);
5687
- _optionalChain([onLifecycleRef, 'access', _171 => _171.current, 'optionalCall', _172 => _172({
5843
+ _optionalChain([onLifecycleRef, 'access', _161 => _161.current, 'optionalCall', _162 => _162({
5688
5844
  type: "connected",
5689
5845
  address: activeOwner,
5690
5846
  smartAccount: activeEntry.smartAccount
@@ -5730,7 +5886,7 @@ function DepositFlow({
5730
5886
  const currentBackHandler = canGoBackFromHere ? handleBack : void 0;
5731
5887
  const currentScreen = showConnectStep ? "connect" : effectiveStep.type;
5732
5888
  _react.useEffect.call(void 0, () => {
5733
- _optionalChain([onStepChangeRef, 'access', _173 => _173.current, 'optionalCall', _174 => _174(currentBackHandler, currentScreen)]);
5889
+ _optionalChain([onStepChangeRef, 'access', _163 => _163.current, 'optionalCall', _164 => _164(currentBackHandler, currentScreen)]);
5734
5890
  }, [currentBackHandler, currentScreen, onStepChangeRef]);
5735
5891
  const lastModalHeightRef = _react.useRef.call(void 0, 0);
5736
5892
  const modalContentElRef = _react.useRef.call(void 0, null);
@@ -5740,7 +5896,7 @@ function DepositFlow({
5740
5896
  modalContentElRef.current = mc;
5741
5897
  const ro = new ResizeObserver((entries) => {
5742
5898
  for (const entry of entries) {
5743
- const border = _optionalChain([entry, 'access', _175 => _175.borderBoxSize, 'optionalAccess', _176 => _176[0], 'optionalAccess', _177 => _177.blockSize]);
5899
+ const border = _optionalChain([entry, 'access', _165 => _165.borderBoxSize, 'optionalAccess', _166 => _166[0], 'optionalAccess', _167 => _167.blockSize]);
5744
5900
  lastModalHeightRef.current = typeof border === "number" ? border : entry.contentRect.height;
5745
5901
  }
5746
5902
  });
@@ -5781,7 +5937,7 @@ function DepositFlow({
5781
5937
  }
5782
5938
  lastStepOpenEventKeyRef.current = stepOpenEventKey;
5783
5939
  if (effectiveStep.type === "select-asset") {
5784
- _optionalChain([onEventRef, 'access', _178 => _178.current, 'optionalCall', _179 => _179({
5940
+ _optionalChain([onEventRef, 'access', _168 => _168.current, 'optionalCall', _169 => _169({
5785
5941
  type: "deposit_modal_connected_wallet_select_source_open",
5786
5942
  total_balance_in_external_wallet: totalBalanceUsd,
5787
5943
  pred_balance: totalBalanceUsd
@@ -5789,7 +5945,7 @@ function DepositFlow({
5789
5945
  } else if (effectiveStep.type === "deposit-address") {
5790
5946
  const chainName = _chunkABVRVW3Pcjs.getChainName.call(void 0, targetChain);
5791
5947
  const tokenSymbol = _chunkABVRVW3Pcjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain);
5792
- _optionalChain([onEventRef, 'access', _180 => _180.current, 'optionalCall', _181 => _181({
5948
+ _optionalChain([onEventRef, 'access', _170 => _170.current, 'optionalCall', _171 => _171({
5793
5949
  type: "deposit_modal_transfer_crypto_open",
5794
5950
  default_chain: chainName,
5795
5951
  default_token: tokenSymbol,
@@ -5797,7 +5953,7 @@ function DepositFlow({
5797
5953
  })]);
5798
5954
  } else if (effectiveStep.type === "amount" && stepSendToken) {
5799
5955
  const receiveSymbol = _chunkABVRVW3Pcjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain);
5800
- _optionalChain([onEventRef, 'access', _182 => _182.current, 'optionalCall', _183 => _183({
5956
+ _optionalChain([onEventRef, 'access', _172 => _172.current, 'optionalCall', _173 => _173({
5801
5957
  type: "deposit_modal_connected_wallet_enter_value_open",
5802
5958
  send_token: stepSendToken,
5803
5959
  receive_token: receiveSymbol,
@@ -5830,7 +5986,7 @@ function DepositFlow({
5830
5986
  targetToken
5831
5987
  ]);
5832
5988
  _react.useEffect.call(void 0, () => {
5833
- _optionalChain([onLifecycleRef, 'access', _184 => _184.current, 'optionalCall', _185 => _185({
5989
+ _optionalChain([onLifecycleRef, 'access', _174 => _174.current, 'optionalCall', _175 => _175({
5834
5990
  type: "balance-changed",
5835
5991
  totalUsd: totalBalanceUsd
5836
5992
  })]);
@@ -5846,7 +6002,7 @@ function DepositFlow({
5846
6002
  const handleConfirmWallet = _react.useCallback.call(void 0,
5847
6003
  (walletId) => {
5848
6004
  const selectedOption = walletOptions.find((o) => o.id === walletId);
5849
- const mode = enableSolana && _optionalChain([selectedOption, 'optionalAccess', _186 => _186.kind]) === "solana" ? "solana-wallet" : "wallet";
6005
+ const mode = enableSolana && _optionalChain([selectedOption, 'optionalAccess', _176 => _176.kind]) === "solana" ? "solana-wallet" : "wallet";
5850
6006
  storeApi.dispatch({
5851
6007
  type: "connect/wallet-confirmed",
5852
6008
  walletId,
@@ -5856,7 +6012,7 @@ function DepositFlow({
5856
6012
  [walletOptions, enableSolana, storeApi]
5857
6013
  );
5858
6014
  const isSolanaWalletConnected = Boolean(
5859
- enableSolana && _optionalChain([reownWallet, 'optionalAccess', _187 => _187.isConnected]) && _optionalChain([reownWallet, 'optionalAccess', _188 => _188.isSolana])
6015
+ enableSolana && _optionalChain([reownWallet, 'optionalAccess', _177 => _177.isConnected]) && _optionalChain([reownWallet, 'optionalAccess', _178 => _178.isSolana])
5860
6016
  );
5861
6017
  const dappImportsKey = dappImports ? Object.keys(dappImports).filter((k) => dappImports[k]).sort().join(",") : "";
5862
6018
  const enabledDappImportProviders = _react.useMemo.call(void 0,
@@ -5873,7 +6029,7 @@ function DepositFlow({
5873
6029
  const owner = dappImportOwner;
5874
6030
  if (owner) {
5875
6031
  const wallet = walletOptions.find(
5876
- (o) => _optionalChain([(_nullishCoalesce(o.address, () => ( null))), 'optionalAccess', _189 => _189.toLowerCase, 'call', _190 => _190()]) === owner.toLowerCase()
6032
+ (o) => _optionalChain([(_nullishCoalesce(o.address, () => ( null))), 'optionalAccess', _179 => _179.toLowerCase, 'call', _180 => _180()]) === owner.toLowerCase()
5877
6033
  );
5878
6034
  if (wallet) {
5879
6035
  storeApi.dispatch({
@@ -5914,8 +6070,8 @@ function DepositFlow({
5914
6070
  eoa: dappImportOwner,
5915
6071
  getPublicClient: (chainId) => {
5916
6072
  try {
5917
- return _chunkPPFG3VBDcjs.getPublicClient.call(void 0, chainId, rpcUrls);
5918
- } catch (e28) {
6073
+ return _chunkZDYV536Qcjs.getPublicClient.call(void 0, chainId, rpcUrls);
6074
+ } catch (e30) {
5919
6075
  return null;
5920
6076
  }
5921
6077
  },
@@ -5991,7 +6147,7 @@ function DepositFlow({
5991
6147
  }, [activeDappImportProviderId, enabledDappImportProviders]);
5992
6148
  const activeDappImportAvailability = _react.useMemo.call(void 0, () => {
5993
6149
  if (!activeDappImportProviderId) return null;
5994
- if (!dappImportOwner || _optionalChain([dappImportAvailabilityOwner, 'optionalAccess', _191 => _191.toLowerCase, 'call', _192 => _192()]) !== dappImportOwner.toLowerCase()) {
6150
+ if (!dappImportOwner || _optionalChain([dappImportAvailabilityOwner, 'optionalAccess', _181 => _181.toLowerCase, 'call', _182 => _182()]) !== dappImportOwner.toLowerCase()) {
5995
6151
  return null;
5996
6152
  }
5997
6153
  const entry = dappImportAvailability[activeDappImportProviderId];
@@ -6032,7 +6188,7 @@ function DepositFlow({
6032
6188
  setup: setupSlice
6033
6189
  });
6034
6190
  const pinnableWallet = dappImportOwner ? _nullishCoalesce(walletOptions.find(
6035
- (o) => _optionalChain([(_nullishCoalesce(o.address, () => ( null))), 'optionalAccess', _193 => _193.toLowerCase, 'call', _194 => _194()]) === dappImportOwner.toLowerCase()
6191
+ (o) => _optionalChain([(_nullishCoalesce(o.address, () => ( null))), 'optionalAccess', _183 => _183.toLowerCase, 'call', _184 => _184()]) === dappImportOwner.toLowerCase()
6036
6192
  ), () => ( null)) : null;
6037
6193
  const outcome = resolveBootOutcome({
6038
6194
  status,
@@ -6074,7 +6230,7 @@ function DepositFlow({
6074
6230
  if (dappImportOwner) {
6075
6231
  const plan = bootRetryPlan({
6076
6232
  setupStatus: readSetupForOwner(snapshot.setup, dappImportOwner).status,
6077
- availabilityEntry: _optionalChain([snapshot, 'access', _195 => _195.dappImport, 'access', _196 => _196.availabilityOwner, 'optionalAccess', _197 => _197.toLowerCase, 'call', _198 => _198()]) === dappImportOwner.toLowerCase() ? snapshot.dappImport.availability[providerId] : void 0
6233
+ availabilityEntry: _optionalChain([snapshot, 'access', _185 => _185.dappImport, 'access', _186 => _186.availabilityOwner, 'optionalAccess', _187 => _187.toLowerCase, 'call', _188 => _188()]) === dappImportOwner.toLowerCase() ? snapshot.dappImport.availability[providerId] : void 0
6078
6234
  });
6079
6235
  if (plan.restartSetup) {
6080
6236
  storeApi.dispatch({
@@ -6114,8 +6270,48 @@ function DepositFlow({
6114
6270
  },
6115
6271
  [storeApi]
6116
6272
  );
6273
+ const swappedUrlPrefetchRef = _react.useRef.call(void 0, /* @__PURE__ */ new Map());
6274
+ const prefetchSwappedWidgetUrl = _react.useCallback.call(void 0,
6275
+ (smartAccount, method) => {
6276
+ const cache = swappedUrlPrefetchRef.current;
6277
+ const key = _nullishCoalesce(method, () => ( ""));
6278
+ const owner = smartAccount.toLowerCase();
6279
+ const existing = cache.get(key);
6280
+ if (existing && existing.smartAccount === owner) return;
6281
+ const promise = service.getSwappedWidgetUrl({ smartAccount, method });
6282
+ promise.catch(() => {
6283
+ });
6284
+ cache.set(key, { smartAccount: owner, promise });
6285
+ logFlow("swapped:prefetch", { method: _nullishCoalesce(method, () => ( null)) });
6286
+ },
6287
+ [service, logFlow]
6288
+ );
6289
+ const consumeSwappedWidgetUrlPrefetch = _react.useCallback.call(void 0,
6290
+ (smartAccount, method) => {
6291
+ const cache = swappedUrlPrefetchRef.current;
6292
+ const key = _nullishCoalesce(method, () => ( ""));
6293
+ const entry = cache.get(key);
6294
+ if (!entry) return null;
6295
+ cache.delete(key);
6296
+ if (entry.smartAccount !== smartAccount.toLowerCase()) return null;
6297
+ return entry.promise;
6298
+ },
6299
+ []
6300
+ );
6301
+ const handlePrefetchFiatMethod = _react.useCallback.call(void 0,
6302
+ (method) => {
6303
+ if (!enableFiatOnramp || !dappAddress) return;
6304
+ const entry = readSetupForOwner(setupSlice, dappAddress);
6305
+ if (entry.status !== "ready" || !entry.smartAccount) return;
6306
+ prefetchSwappedWidgetUrl(entry.smartAccount, method);
6307
+ },
6308
+ [enableFiatOnramp, dappAddress, setupSlice, prefetchSwappedWidgetUrl]
6309
+ );
6310
+ _react.useEffect.call(void 0, () => {
6311
+ swappedUrlPrefetchRef.current.clear();
6312
+ }, [dappAddress]);
6117
6313
  const handleNewDeposit = _react.useCallback.call(void 0, () => {
6118
- _optionalChain([onLifecycleRef, 'access', _199 => _199.current, 'optionalCall', _200 => _200({
6314
+ _optionalChain([onLifecycleRef, 'access', _189 => _189.current, 'optionalCall', _190 => _190({
6119
6315
  type: "smart-account-changed",
6120
6316
  evm: null,
6121
6317
  solana: null
@@ -6123,6 +6319,7 @@ function DepositFlow({
6123
6319
  storeApi.dispatch({ type: "flow/reset" });
6124
6320
  stableWalletSignerRef.current = null;
6125
6321
  stableWalletSelectionKeyRef.current = null;
6322
+ swappedUrlPrefetchRef.current.clear();
6126
6323
  }, [onLifecycleRef, storeApi]);
6127
6324
  const setupInputBase = _react.useMemo.call(void 0,
6128
6325
  () => ({
@@ -6131,7 +6328,6 @@ function DepositFlow({
6131
6328
  signerAddress,
6132
6329
  sessionChainIds,
6133
6330
  recipient,
6134
- postBridgeActions,
6135
6331
  outputTokenRules,
6136
6332
  rejectUnmapped,
6137
6333
  forceRegister,
@@ -6143,7 +6339,6 @@ function DepositFlow({
6143
6339
  signerAddress,
6144
6340
  sessionChainIds,
6145
6341
  recipient,
6146
- postBridgeActions,
6147
6342
  outputTokenRules,
6148
6343
  rejectUnmapped,
6149
6344
  forceRegister,
@@ -6162,13 +6357,13 @@ function DepositFlow({
6162
6357
  };
6163
6358
  push(dappAddress);
6164
6359
  push(connectedWalletAddress);
6165
- push(_optionalChain([reownWallet, 'optionalAccess', _201 => _201.address]));
6360
+ push(_optionalChain([reownWallet, 'optionalAccess', _191 => _191.address]));
6166
6361
  push(dappImportOwner);
6167
6362
  return owners;
6168
6363
  }, [
6169
6364
  dappAddress,
6170
6365
  connectedWalletAddress,
6171
- _optionalChain([reownWallet, 'optionalAccess', _202 => _202.address]),
6366
+ _optionalChain([reownWallet, 'optionalAccess', _192 => _192.address]),
6172
6367
  dappImportOwner
6173
6368
  ]);
6174
6369
  _react.useEffect.call(void 0, () => {
@@ -6182,7 +6377,7 @@ function DepositFlow({
6182
6377
  try {
6183
6378
  sessionOwner = await resolveSessionOwner(owner);
6184
6379
  } catch (error) {
6185
- _chunkPPFG3VBDcjs.debugError.call(void 0,
6380
+ _chunkZDYV536Qcjs.debugError.call(void 0,
6186
6381
  debug,
6187
6382
  "deposit-flow",
6188
6383
  "session-owner:resolve-failed",
@@ -6266,6 +6461,58 @@ function DepositFlow({
6266
6461
  storeApi,
6267
6462
  setupSlice.byOwner
6268
6463
  ]);
6464
+ const walletOptionsKey = _react.useMemo.call(void 0,
6465
+ () => walletOptions.map((option) => option.id).join(","),
6466
+ [walletOptions]
6467
+ );
6468
+ const desiredPortfolios = _react.useMemo.call(void 0,
6469
+ () => walletOptions.flatMap((option) => {
6470
+ const network = option.kind === "solana" ? "solana" : "evm";
6471
+ const address = option.kind === "solana" ? option.solanaAddress : option.address;
6472
+ return address ? [{ network, address }] : [];
6473
+ }),
6474
+ // eslint-disable-next-line react-hooks/exhaustive-deps -- keyed on the stable id-join, not the walletOptions array identity
6475
+ [walletOptionsKey]
6476
+ );
6477
+ _react.useEffect.call(void 0, () => {
6478
+ storeApi.dispatch({
6479
+ type: "portfolio/reconciled",
6480
+ wallets: desiredPortfolios
6481
+ });
6482
+ desiredPortfolios.forEach(({ network, address }) => {
6483
+ if (readPortfolioEntry(storeApi.getState().portfolio, network, address)) {
6484
+ return;
6485
+ }
6486
+ storeApi.dispatch({ type: "portfolio/loading", network, address });
6487
+ const requestId = _optionalChain([readPortfolioEntry, 'call', _193 => _193(
6488
+ storeApi.getState().portfolio,
6489
+ network,
6490
+ address
6491
+ ), 'optionalAccess', _194 => _194.requestId]);
6492
+ if (requestId === void 0) return;
6493
+ void (async () => {
6494
+ try {
6495
+ const portfolio = network === "solana" ? await service.fetchSolanaPortfolio(address, {
6496
+ forceRefresh: true
6497
+ }) : await service.fetchPortfolio(address, { forceRefresh: true });
6498
+ storeApi.dispatch({
6499
+ type: "portfolio/loaded",
6500
+ network,
6501
+ address,
6502
+ requestId,
6503
+ totalUsd: portfolio.totalUsd
6504
+ });
6505
+ } catch (e31) {
6506
+ storeApi.dispatch({
6507
+ type: "portfolio/failed",
6508
+ network,
6509
+ address,
6510
+ requestId
6511
+ });
6512
+ }
6513
+ })();
6514
+ });
6515
+ }, [desiredPortfolios, service, storeApi, portfolioSlice.byKey]);
6269
6516
  const handleDepositAddressSubmitted = _react.useCallback.call(void 0,
6270
6517
  (data) => {
6271
6518
  logFlow("deposit-address:detected", {
@@ -6273,7 +6520,7 @@ function DepositFlow({
6273
6520
  sourceChain: data.sourceChain,
6274
6521
  amount: data.amount
6275
6522
  });
6276
- _optionalChain([onLifecycleRef, 'access', _203 => _203.current, 'optionalCall', _204 => _204({ type: "submitted", ...data })]);
6523
+ _optionalChain([onLifecycleRef, 'access', _195 => _195.current, 'optionalCall', _196 => _196({ type: "submitted", ...data })]);
6277
6524
  },
6278
6525
  [logFlow, onLifecycleRef]
6279
6526
  );
@@ -6333,7 +6580,7 @@ function DepositFlow({
6333
6580
  sourceDecimals: tokenAtSubmit.decimals,
6334
6581
  inputAmountUsd: amountUsd
6335
6582
  });
6336
- _optionalChain([onLifecycleRef, 'access', _205 => _205.current, 'optionalCall', _206 => _206({
6583
+ _optionalChain([onLifecycleRef, 'access', _197 => _197.current, 'optionalCall', _198 => _198({
6337
6584
  type: "submitted",
6338
6585
  txHash,
6339
6586
  sourceChain: "solana",
@@ -6346,7 +6593,7 @@ function DepositFlow({
6346
6593
  );
6347
6594
  const handleAssetContinue = _react.useCallback.call(void 0,
6348
6595
  (asset) => {
6349
- _optionalChain([onEventRef, 'access', _207 => _207.current, 'optionalCall', _208 => _208({
6596
+ _optionalChain([onEventRef, 'access', _199 => _199.current, 'optionalCall', _200 => _200({
6350
6597
  type: "deposit_modal_connected_wallet_select_source_cta_click",
6351
6598
  total_balance_in_external_wallet: totalBalanceUsd,
6352
6599
  pred_balance: totalBalanceUsd,
@@ -6400,8 +6647,8 @@ function DepositFlow({
6400
6647
  sourceChain: chainId,
6401
6648
  sourceToken: token,
6402
6649
  amount,
6403
- sourceSymbol: _optionalChain([asset, 'optionalAccess', _209 => _209.symbol]),
6404
- sourceDecimals: _optionalChain([asset, 'optionalAccess', _210 => _210.decimals]),
6650
+ sourceSymbol: _optionalChain([asset, 'optionalAccess', _201 => _201.symbol]),
6651
+ sourceDecimals: _optionalChain([asset, 'optionalAccess', _202 => _202.decimals]),
6405
6652
  inputAmountUsd: _nullishCoalesce(depositAtSubmit.inputAmountUsd, () => ( void 0)),
6406
6653
  directTransfer: !dappImport && isSameRoute2(chainId, token, targetChain, targetToken)
6407
6654
  });
@@ -6433,7 +6680,7 @@ function DepositFlow({
6433
6680
  sourceDecimals: SWAPPED_SOURCE_DECIMALS,
6434
6681
  swappedContext
6435
6682
  });
6436
- _optionalChain([onLifecycleRef, 'access', _211 => _211.current, 'optionalCall', _212 => _212({
6683
+ _optionalChain([onLifecycleRef, 'access', _203 => _203.current, 'optionalCall', _204 => _204({
6437
6684
  type: "submitted",
6438
6685
  txHash: info.txHash,
6439
6686
  sourceChain: SWAPPED_SOURCE_CHAIN,
@@ -6446,12 +6693,12 @@ function DepositFlow({
6446
6693
  const handleDepositSubmittedCallback = _react.useCallback.call(void 0,
6447
6694
  (txHash, sourceChain, amount) => {
6448
6695
  const depositAtSubmit = storeApi.getState().deposit;
6449
- _optionalChain([onLifecycleRef, 'access', _213 => _213.current, 'optionalCall', _214 => _214({
6696
+ _optionalChain([onLifecycleRef, 'access', _205 => _205.current, 'optionalCall', _206 => _206({
6450
6697
  type: "submitted",
6451
6698
  txHash,
6452
6699
  sourceChain,
6453
6700
  amount,
6454
- sourceDecimals: _optionalChain([depositAtSubmit, 'access', _215 => _215.selectedAsset, 'optionalAccess', _216 => _216.decimals]),
6701
+ sourceDecimals: _optionalChain([depositAtSubmit, 'access', _207 => _207.selectedAsset, 'optionalAccess', _208 => _208.decimals]),
6455
6702
  amountUsd: _nullishCoalesce(depositAtSubmit.inputAmountUsd, () => ( void 0))
6456
6703
  })]);
6457
6704
  },
@@ -6460,7 +6707,7 @@ function DepositFlow({
6460
6707
  const handleDepositComplete = _react.useCallback.call(void 0,
6461
6708
  (txHash, destinationTxHash, context) => {
6462
6709
  logFlow("deposit:complete", { txHash, destinationTxHash, ...context });
6463
- _optionalChain([onLifecycleRef, 'access', _217 => _217.current, 'optionalCall', _218 => _218({
6710
+ _optionalChain([onLifecycleRef, 'access', _209 => _209.current, 'optionalCall', _210 => _210({
6464
6711
  type: "complete",
6465
6712
  txHash,
6466
6713
  destinationTxHash,
@@ -6472,24 +6719,20 @@ function DepositFlow({
6472
6719
  const handleDepositFailed = _react.useCallback.call(void 0,
6473
6720
  (txHash, error) => {
6474
6721
  logFlowError("deposit:failed", error, { txHash });
6475
- _optionalChain([onLifecycleRef, 'access', _219 => _219.current, 'optionalCall', _220 => _220({ type: "failed", txHash, error })]);
6722
+ _optionalChain([onLifecycleRef, 'access', _211 => _211.current, 'optionalCall', _212 => _212({ type: "failed", txHash, error })]);
6476
6723
  },
6477
6724
  [logFlowError, onLifecycleRef]
6478
6725
  );
6479
6726
  const handleError = _react.useCallback.call(void 0,
6480
6727
  (message, code) => {
6481
6728
  logFlowError("flow:error", message, { code });
6482
- _optionalChain([onErrorRef, 'access', _221 => _221.current, 'optionalCall', _222 => _222({ message, code })]);
6729
+ _optionalChain([onErrorRef, 'access', _213 => _213.current, 'optionalCall', _214 => _214({ message, code })]);
6483
6730
  },
6484
6731
  [logFlowError, onErrorRef]
6485
6732
  );
6486
6733
  const handleTotalBalanceComputed = _react.useCallback.call(void 0, (total) => {
6487
6734
  setTotalBalanceUsd(total);
6488
6735
  }, []);
6489
- const walletOptionsKey = _react.useMemo.call(void 0,
6490
- () => walletOptions.map((option) => option.id).join(","),
6491
- [walletOptions]
6492
- );
6493
6736
  _react.useEffect.call(void 0, () => {
6494
6737
  if (storeApi.getState().flow.mode) {
6495
6738
  return;
@@ -6526,6 +6769,13 @@ function DepositFlow({
6526
6769
  const ownerForRow = option.kind === "solana" ? dappAddress : _nullishCoalesce(option.address, () => ( null));
6527
6770
  const entry = readSetupForOwner(setupSlice, _nullishCoalesce(ownerForRow, () => ( null)));
6528
6771
  const state = entry.status === "ready" ? "ready" : entry.status === "error" ? "error" : "loading";
6772
+ const network = option.kind === "solana" ? "solana" : "evm";
6773
+ const balanceAddress = option.kind === "solana" ? option.solanaAddress : option.address;
6774
+ const portfolioEntry = readPortfolioEntry(
6775
+ portfolioSlice,
6776
+ network,
6777
+ balanceAddress
6778
+ );
6529
6779
  return {
6530
6780
  id: option.id,
6531
6781
  kind: option.kind,
@@ -6533,10 +6783,12 @@ function DepositFlow({
6533
6783
  icon: option.icon,
6534
6784
  address: _nullishCoalesce(_nullishCoalesce(option.address, () => ( option.solanaAddress)), () => ( option.id)),
6535
6785
  state,
6536
- errorReason: _nullishCoalesce(entry.message, () => ( void 0))
6786
+ errorReason: _nullishCoalesce(entry.message, () => ( void 0)),
6787
+ balanceStatus: _nullishCoalesce(_optionalChain([portfolioEntry, 'optionalAccess', _215 => _215.status]), () => ( "loading")),
6788
+ balanceUsd: _optionalChain([portfolioEntry, 'optionalAccess', _216 => _216.status]) === "ready" ? portfolioEntry.totalUsd : null
6537
6789
  };
6538
6790
  });
6539
- }, [walletOptions, setupSlice, dappAddress]);
6791
+ }, [walletOptions, setupSlice, dappAddress, portfolioSlice]);
6540
6792
  const transferCryptoEntry = _react.useMemo.call(void 0,
6541
6793
  () => readSetupForOwner(setupSlice, dappAddress),
6542
6794
  [setupSlice, dappAddress]
@@ -6550,7 +6802,7 @@ function DepositFlow({
6550
6802
  );
6551
6803
  if (showConnectStep) {
6552
6804
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
6553
- _chunkPPFG3VBDcjs.ConnectStep,
6805
+ _chunkZDYV536Qcjs.ConnectStep,
6554
6806
  {
6555
6807
  walletRows,
6556
6808
  transferCryptoState: dappAddress ? transferCryptoState : void 0,
@@ -6564,6 +6816,7 @@ function DepositFlow({
6564
6816
  } : void 0,
6565
6817
  fiatPaymentMethods: enableFiatOnramp && dappAddress ? fiatOnrampMethods && fiatOnrampMethods.length > 0 ? fiatOnrampMethods : DEFAULT_FIAT_ONRAMP_METHODS : void 0,
6566
6818
  onSelectFiatMethod: enableFiatOnramp && dappAddress ? (method) => handleSelectFiatMethod(method) : void 0,
6819
+ onPrefetchFiatMethod: enableFiatOnramp && dappAddress ? handlePrefetchFiatMethod : void 0,
6567
6820
  onSelectFundFromExchange: enableExchangeConnect && dappAddress ? () => handleSelectExchange() : void 0,
6568
6821
  onRequestConnect,
6569
6822
  onConnect,
@@ -6582,7 +6835,7 @@ function DepositFlow({
6582
6835
  },
6583
6836
  dappImports: connectStepDappImports,
6584
6837
  onSelectDappImport: (providerId) => {
6585
- const availabilityEntry = dappImportOwner && _optionalChain([dappImportAvailabilityOwner, 'optionalAccess', _223 => _223.toLowerCase, 'call', _224 => _224()]) === dappImportOwner.toLowerCase() ? dappImportAvailability[providerId] : void 0;
6838
+ const availabilityEntry = dappImportOwner && _optionalChain([dappImportAvailabilityOwner, 'optionalAccess', _217 => _217.toLowerCase, 'call', _218 => _218()]) === dappImportOwner.toLowerCase() ? dappImportAvailability[providerId] : void 0;
6586
6839
  if (availabilityEntry === "error") {
6587
6840
  storeApi.dispatch({
6588
6841
  type: "dapp-import/availability-retry-requested"
@@ -6628,7 +6881,6 @@ function DepositFlow({
6628
6881
  allowedRoutes,
6629
6882
  targetChain,
6630
6883
  targetToken,
6631
- hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess', _225 => _225.length])),
6632
6884
  uiConfig,
6633
6885
  onDepositSubmitted: handleDepositAddressSubmitted,
6634
6886
  onDepositComplete: handleDepositComplete,
@@ -6636,7 +6888,7 @@ function DepositFlow({
6636
6888
  onCopyAddress: () => {
6637
6889
  const chainName = _chunkABVRVW3Pcjs.getChainName.call(void 0, targetChain);
6638
6890
  const tokenSymbol = _chunkABVRVW3Pcjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain);
6639
- _optionalChain([onEvent, 'optionalCall', _226 => _226({
6891
+ _optionalChain([onEvent, 'optionalCall', _219 => _219({
6640
6892
  type: "deposit_modal_transfer_crypto_cta_click",
6641
6893
  default_chain: chainName,
6642
6894
  default_token: tokenSymbol,
@@ -6672,15 +6924,17 @@ function DepositFlow({
6672
6924
  smartAccount: step.smartAccount,
6673
6925
  service,
6674
6926
  paymentMethod: step.paymentMethod,
6927
+ consumePrefetchedUrl: consumeSwappedWidgetUrlPrefetch,
6675
6928
  onSwappedComplete: handleSwappedComplete,
6676
6929
  onSwappedFailed: handleDepositFailed,
6677
6930
  onClose: _nullishCoalesce(onClose, () => ( (() => {
6678
6931
  }))),
6932
+ onGoBack: handleBack,
6679
6933
  onError: handleError
6680
6934
  }
6681
6935
  ),
6682
6936
  step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
6683
- _chunkPPFG3VBDcjs.ProcessingStep,
6937
+ _chunkZDYV536Qcjs.ProcessingStep,
6684
6938
  {
6685
6939
  smartAccount: step.smartAccount,
6686
6940
  solanaDepositAddress: step.solanaDepositAddress,
@@ -6694,7 +6948,6 @@ function DepositFlow({
6694
6948
  sourceDecimals: step.sourceDecimals,
6695
6949
  amountUsd: step.inputAmountUsd,
6696
6950
  swappedContext: step.swappedContext,
6697
- hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess', _227 => _227.length])),
6698
6951
  service,
6699
6952
  directTransfer: step.directTransfer,
6700
6953
  isSwappedOrder: true,
@@ -6744,11 +6997,12 @@ function DepositFlow({
6744
6997
  onSwappedFailed: handleDepositFailed,
6745
6998
  onClose: _nullishCoalesce(onClose, () => ( (() => {
6746
6999
  }))),
7000
+ onGoBack: handleBack,
6747
7001
  onError: handleError
6748
7002
  }
6749
7003
  ),
6750
7004
  step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
6751
- _chunkPPFG3VBDcjs.ProcessingStep,
7005
+ _chunkZDYV536Qcjs.ProcessingStep,
6752
7006
  {
6753
7007
  smartAccount: step.smartAccount,
6754
7008
  solanaDepositAddress: step.solanaDepositAddress,
@@ -6762,7 +7016,6 @@ function DepositFlow({
6762
7016
  sourceDecimals: step.sourceDecimals,
6763
7017
  amountUsd: step.inputAmountUsd,
6764
7018
  swappedContext: step.swappedContext,
6765
- hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess', _228 => _228.length])),
6766
7019
  service,
6767
7020
  directTransfer: step.directTransfer,
6768
7021
  isSwappedOrder: true,
@@ -6780,8 +7033,8 @@ function DepositFlow({
6780
7033
  }
6781
7034
  if (isSolanaWalletMode) {
6782
7035
  if (!dappAddress) return null;
6783
- const solanaAddr = _optionalChain([reownWallet, 'optionalAccess', _229 => _229.solanaAddress]);
6784
- const solanaProvider = _optionalChain([reownWallet, 'optionalAccess', _230 => _230.solanaProvider]);
7036
+ const solanaAddr = _optionalChain([reownWallet, 'optionalAccess', _220 => _220.solanaAddress]);
7037
+ const solanaProvider = _optionalChain([reownWallet, 'optionalAccess', _221 => _221.solanaProvider]);
6785
7038
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
6786
7039
  effectiveStep.type === "setup" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
6787
7040
  AccountPreparingSkeleton,
@@ -6838,7 +7091,7 @@ function DepositFlow({
6838
7091
  targetToken,
6839
7092
  service,
6840
7093
  solanaProvider,
6841
- solanaConnection: _optionalChain([reownWallet, 'optionalAccess', _231 => _231.solanaConnection]),
7094
+ solanaConnection: _optionalChain([reownWallet, 'optionalAccess', _222 => _222.solanaConnection]),
6842
7095
  uiConfig,
6843
7096
  onConfirm: handleSolanaConfirmed,
6844
7097
  onError: handleError,
@@ -6879,7 +7132,7 @@ function DepositFlow({
6879
7132
  ) })
6880
7133
  ] }) : null,
6881
7134
  effectiveStep.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
6882
- _chunkPPFG3VBDcjs.ProcessingStep,
7135
+ _chunkZDYV536Qcjs.ProcessingStep,
6883
7136
  {
6884
7137
  smartAccount: effectiveStep.smartAccount,
6885
7138
  solanaDepositAddress: effectiveStep.solanaDepositAddress,
@@ -6892,7 +7145,6 @@ function DepositFlow({
6892
7145
  sourceSymbol: effectiveStep.sourceSymbol,
6893
7146
  sourceDecimals: effectiveStep.sourceDecimals,
6894
7147
  amountUsd: effectiveStep.inputAmountUsd,
6895
- hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess', _232 => _232.length])),
6896
7148
  service,
6897
7149
  directTransfer: effectiveStep.directTransfer,
6898
7150
  onClose,
@@ -6915,7 +7167,7 @@ function DepositFlow({
6915
7167
  children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
6916
7168
  DappImportAssetSelectSkeleton,
6917
7169
  {
6918
- sourceLabel: _nullishCoalesce(_optionalChain([activeDappImportProvider, 'optionalAccess', _233 => _233.sourceLabel]), () => ( "")),
7170
+ sourceLabel: _nullishCoalesce(_optionalChain([activeDappImportProvider, 'optionalAccess', _223 => _223.sourceLabel]), () => ( "")),
6919
7171
  error: dappImportBootError,
6920
7172
  onRetry: handleBootRetry
6921
7173
  }
@@ -6923,16 +7175,16 @@ function DepositFlow({
6923
7175
  }
6924
7176
  );
6925
7177
  }
6926
- if (!_optionalChain([signerContext, 'optionalAccess', _234 => _234.walletClient]) || !_optionalChain([signerContext, 'optionalAccess', _235 => _235.publicClient])) {
7178
+ if (!_optionalChain([signerContext, 'optionalAccess', _224 => _224.walletClient]) || !_optionalChain([signerContext, 'optionalAccess', _225 => _225.publicClient])) {
6927
7179
  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" }) }) }) }) });
6928
7180
  }
6929
7181
  const ownerAddress = signerContext.ownerAddress;
6930
- const ownerChainId = _nullishCoalesce(_nullishCoalesce(_optionalChain([signerContext, 'access', _236 => _236.walletClient, 'optionalAccess', _237 => _237.chain, 'optionalAccess', _238 => _238.id]), () => ( _optionalChain([signerContext, 'access', _239 => _239.publicClient, 'access', _240 => _240.chain, 'optionalAccess', _241 => _241.id]))), () => ( setupChainId));
7182
+ 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));
6931
7183
  const getReadClientForChain = (chainId) => {
6932
- if (_optionalChain([signerContext, 'access', _242 => _242.publicClient, 'access', _243 => _243.chain, 'optionalAccess', _244 => _244.id]) === chainId) {
7184
+ if (_optionalChain([signerContext, 'access', _232 => _232.publicClient, 'access', _233 => _233.chain, 'optionalAccess', _234 => _234.id]) === chainId) {
6933
7185
  return signerContext.publicClient;
6934
7186
  }
6935
- return _chunkPPFG3VBDcjs.getPublicClient.call(void 0, chainId, rpcUrls);
7187
+ return _chunkZDYV536Qcjs.getPublicClient.call(void 0, chainId, rpcUrls);
6936
7188
  };
6937
7189
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
6938
7190
  effectiveStep.type === "setup" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
@@ -6962,7 +7214,7 @@ function DepositFlow({
6962
7214
  effectiveStep.type === "dapp-import-asset-select" && activeDappImportProvider && activeDappImportAvailability && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
6963
7215
  DappImportAssetSelectStep,
6964
7216
  {
6965
- sourceLabel: _nullishCoalesce(_optionalChain([activeDappImportAvailability, 'access', _245 => _245.assets, 'access', _246 => _246[0], 'optionalAccess', _247 => _247.sourceLabel]), () => ( activeDappImportProvider.sourceLabel)),
7217
+ sourceLabel: _nullishCoalesce(_optionalChain([activeDappImportAvailability, 'access', _235 => _235.assets, 'access', _236 => _236[0], 'optionalAccess', _237 => _237.sourceLabel]), () => ( activeDappImportProvider.sourceLabel)),
6966
7218
  assets: activeDappImportAvailability.assets,
6967
7219
  onSelect: handleDappImportAssetSelected
6968
7220
  }
@@ -6989,7 +7241,7 @@ function DepositFlow({
6989
7241
  onContinue: handleAmountContinue,
6990
7242
  onCtaClick: (ctaName) => {
6991
7243
  const receiveSymbol = _chunkABVRVW3Pcjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain);
6992
- _optionalChain([onEvent, 'optionalCall', _248 => _248({
7244
+ _optionalChain([onEvent, 'optionalCall', _238 => _238({
6993
7245
  type: "deposit_modal_connected_wallet_enter_value_cta_click",
6994
7246
  send_token: effectiveStep.asset.symbol,
6995
7247
  receive_token: receiveSymbol,
@@ -7041,7 +7293,7 @@ function DepositFlow({
7041
7293
  }
7042
7294
  ),
7043
7295
  effectiveStep.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
7044
- _chunkPPFG3VBDcjs.ProcessingStep,
7296
+ _chunkZDYV536Qcjs.ProcessingStep,
7045
7297
  {
7046
7298
  smartAccount: effectiveStep.smartAccount,
7047
7299
  solanaDepositAddress: effectiveStep.solanaDepositAddress,
@@ -7054,7 +7306,6 @@ function DepositFlow({
7054
7306
  sourceSymbol: effectiveStep.sourceSymbol,
7055
7307
  sourceDecimals: effectiveStep.sourceDecimals,
7056
7308
  amountUsd: effectiveStep.inputAmountUsd,
7057
- hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess', _249 => _249.length])),
7058
7309
  service,
7059
7310
  directTransfer: effectiveStep.directTransfer,
7060
7311
  uiConfig,
@@ -7086,7 +7337,7 @@ function formatDate(iso) {
7086
7337
  month: "short",
7087
7338
  year: "numeric"
7088
7339
  });
7089
- } catch (e29) {
7340
+ } catch (e32) {
7090
7341
  return iso;
7091
7342
  }
7092
7343
  }
@@ -7144,7 +7395,7 @@ function formatAmount(rawAmount, token, chainId) {
7144
7395
  let frac = fracStr.slice(0, 5).replace(/0+$/, "");
7145
7396
  if (frac.length < 2) frac = frac.padEnd(2, "0");
7146
7397
  return `${whole}.${frac}`;
7147
- } catch (e30) {
7398
+ } catch (e33) {
7148
7399
  return rawAmount;
7149
7400
  }
7150
7401
  }
@@ -7193,7 +7444,7 @@ function DepositHistoryPanel({
7193
7444
  );
7194
7445
  const visibleDeposits = _react.useMemo.call(void 0, () => {
7195
7446
  const sourceHashes = new Set(
7196
- deposits.map((d) => _optionalChain([d, 'access', _250 => _250.sourceTxHash, 'optionalAccess', _251 => _251.toLowerCase, 'call', _252 => _252()])).filter((h) => Boolean(h))
7447
+ deposits.map((d) => _optionalChain([d, 'access', _239 => _239.sourceTxHash, 'optionalAccess', _240 => _240.toLowerCase, 'call', _241 => _241()])).filter((h) => Boolean(h))
7197
7448
  );
7198
7449
  return deposits.filter(
7199
7450
  (d) => !(d.txHash && sourceHashes.has(d.txHash.toLowerCase()))
@@ -7215,7 +7466,7 @@ function DepositHistoryPanel({
7215
7466
  className: "rs-modal-header-back",
7216
7467
  "aria-label": "Back",
7217
7468
  onClick: onClose,
7218
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.ChevronLeftIcon, {})
7469
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.ChevronLeftIcon, {})
7219
7470
  }
7220
7471
  ) }),
7221
7472
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-header-nav-right", children: onCloseModal && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
@@ -7225,29 +7476,29 @@ function DepositHistoryPanel({
7225
7476
  className: "rs-modal-close",
7226
7477
  "aria-label": "Close",
7227
7478
  onClick: onCloseModal,
7228
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.CloseIcon, {})
7479
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.CloseIcon, {})
7229
7480
  }
7230
7481
  ) })
7231
7482
  ] }),
7232
7483
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-screen", children: [
7233
7484
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-screen-body", children: [
7234
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.HistoryIcon, {}), title: "History" }),
7485
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.HistoryIcon, {}), title: "History" }),
7235
7486
  isLoading && deposits.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty", children: [
7236
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.HistoryIcon, {}) }),
7487
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.HistoryIcon, {}) }),
7237
7488
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty-text", children: [
7238
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.Spinner, { className: "rs-spinner--sm" }),
7489
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.Spinner, { className: "rs-spinner--sm" }),
7239
7490
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-hint", children: "Loading history\u2026" })
7240
7491
  ] })
7241
7492
  ] }),
7242
7493
  error && !isLoading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty", children: [
7243
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.AlertTriangleIcon, {}) }),
7494
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.AlertTriangleIcon, {}) }),
7244
7495
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty-text", children: [
7245
7496
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-title", children: "Couldn't load history" }),
7246
7497
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-hint", children: error })
7247
7498
  ] })
7248
7499
  ] }),
7249
7500
  !isLoading && !error && visibleDeposits.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty", children: [
7250
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.HistoryIcon, {}) }),
7501
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.HistoryIcon, {}) }),
7251
7502
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty-text", children: [
7252
7503
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-title", children: "No deposits yet" }),
7253
7504
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-hint", children: "Your deposit history will appear here" })
@@ -7267,7 +7518,7 @@ function DepositHistoryPanel({
7267
7518
  )
7268
7519
  ] })
7269
7520
  ] }),
7270
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.PoweredBy, {})
7521
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.PoweredBy, {})
7271
7522
  ] })
7272
7523
  ]
7273
7524
  }
@@ -7342,7 +7593,7 @@ function HistoryCard({ deposit }) {
7342
7593
  onClick: (e) => e.stopPropagation(),
7343
7594
  children: [
7344
7595
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: shortenHash(deposit.sourceTxHash) }),
7345
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.ArrowUpRightIcon, {})
7596
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.ArrowUpRightIcon, {})
7346
7597
  ]
7347
7598
  }
7348
7599
  )
@@ -7357,7 +7608,7 @@ DepositHistoryPanel.displayName = "DepositHistoryPanel";
7357
7608
  // src/DepositModal.tsx
7358
7609
 
7359
7610
  var ReownDepositInner = _react.lazy.call(void 0,
7360
- () => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-GHEUERDG.cjs"))).then((m) => ({ default: m.DepositModalReown }))
7611
+ () => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-J3KYAOD3.cjs"))).then((m) => ({ default: m.DepositModalReown }))
7361
7612
  );
7362
7613
  function sortByCreatedAtDesc(items) {
7363
7614
  return [...items].sort((a, b) => {
@@ -7407,7 +7658,7 @@ function DepositModalInner({
7407
7658
  recipient,
7408
7659
  appBalanceUsd,
7409
7660
  backendUrl = _chunkABVRVW3Pcjs.DEFAULT_BACKEND_URL,
7410
- rpcUrls,
7661
+ rpcUrls: rpcUrlsProp,
7411
7662
  signerAddress = _chunkABVRVW3Pcjs.DEFAULT_SIGNER_ADDRESS,
7412
7663
  sessionChainIds,
7413
7664
  forceRegister = false,
@@ -7418,7 +7669,6 @@ function DepositModalInner({
7418
7669
  enableQrTransfer = true,
7419
7670
  fiatOnrampMethods,
7420
7671
  enableExchangeConnect = false,
7421
- postBridgeActions,
7422
7672
  outputTokenRules,
7423
7673
  rejectUnmapped,
7424
7674
  reownWallet,
@@ -7436,12 +7686,12 @@ function DepositModalInner({
7436
7686
  debug
7437
7687
  }) {
7438
7688
  const modalRef = _react.useRef.call(void 0, null);
7439
- const onReadyRef = _chunkPPFG3VBDcjs.useLatestRef.call(void 0, onReady);
7689
+ const onReadyRef = _chunkZDYV536Qcjs.useLatestRef.call(void 0, onReady);
7440
7690
  const [currentScreen, setCurrentScreen] = _react.useState.call(void 0, "connect");
7441
7691
  const [backHandler, setBackHandler] = _react.useState.call(void 0,
7442
7692
  void 0
7443
7693
  );
7444
- const showHistoryButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _253 => _253.showHistoryButton]), () => ( false));
7694
+ const showHistoryButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _242 => _242.showHistoryButton]), () => ( false));
7445
7695
  const historyButtonVisible = showHistoryButton && (currentScreen === "select-asset" || currentScreen === "deposit-address");
7446
7696
  const [historyOpen, setHistoryOpen] = _react.useState.call(void 0, false);
7447
7697
  const [historyDeposits, setHistoryDeposits] = _react.useState.call(void 0, []);
@@ -7454,20 +7704,21 @@ function DepositModalInner({
7454
7704
  const historyLoadedRef = _react.useRef.call(void 0, false);
7455
7705
  const targetChain = targetChainProp === "solana" ? "solana" : _chunkABVRVW3Pcjs.getChainId.call(void 0, targetChainProp);
7456
7706
  const sourceChain = sourceChainProp ? _chunkABVRVW3Pcjs.getChainId.call(void 0, sourceChainProp) : void 0;
7707
+ const rpcUrls = _chunkZDYV536Qcjs.useStableRpcUrls.call(void 0, rpcUrlsProp);
7457
7708
  const [recipientIsContract, setRecipientIsContract] = _react.useState.call(void 0, false);
7458
- const onErrorRef = _chunkPPFG3VBDcjs.useLatestRef.call(void 0, onError);
7709
+ const onErrorRef = _chunkZDYV536Qcjs.useLatestRef.call(void 0, onError);
7459
7710
  _react.useEffect.call(void 0, () => {
7460
7711
  if (targetChain !== _chunkABVRVW3Pcjs.HYPERCORE_CHAIN_ID || !_viem.isAddress.call(void 0, recipient, { strict: false })) {
7461
7712
  setRecipientIsContract(false);
7462
7713
  return;
7463
7714
  }
7464
7715
  let cancelled = false;
7465
- _chunkPPFG3VBDcjs.getHyperEvmReadClient.call(void 0, rpcUrls).getCode({ address: recipient }).then((code) => {
7716
+ _chunkZDYV536Qcjs.getHyperEvmReadClient.call(void 0, rpcUrls).getCode({ address: recipient }).then((code) => {
7466
7717
  if (cancelled) return;
7467
7718
  const isContract = _chunkABVRVW3Pcjs.isContractBytecode.call(void 0, code);
7468
7719
  setRecipientIsContract(isContract);
7469
7720
  if (isContract) {
7470
- _optionalChain([onErrorRef, 'access', _254 => _254.current, 'optionalCall', _255 => _255({
7721
+ _optionalChain([onErrorRef, 'access', _243 => _243.current, 'optionalCall', _244 => _244({
7471
7722
  message: "HyperCore deposits require an EOA recipient; the configured recipient is a smart contract.",
7472
7723
  code: "HYPERCORE_RECIPIENT_NOT_EOA"
7473
7724
  })]);
@@ -7480,7 +7731,7 @@ function DepositModalInner({
7480
7731
  };
7481
7732
  }, [targetChain, recipient, onErrorRef, rpcUrls]);
7482
7733
  const service = _react.useMemo.call(void 0,
7483
- () => _chunkPPFG3VBDcjs.createDepositService.call(void 0, backendUrl, {
7734
+ () => _chunkZDYV536Qcjs.createDepositService.call(void 0, backendUrl, {
7484
7735
  debug,
7485
7736
  debugScope: "service:deposit"
7486
7737
  }),
@@ -7496,12 +7747,12 @@ function DepositModalInner({
7496
7747
  }, [store, targetChain, targetToken]);
7497
7748
  _react.useEffect.call(void 0, () => {
7498
7749
  if (isOpen && modalRef.current) {
7499
- _chunkPPFG3VBDcjs.applyTheme.call(void 0, modalRef.current, theme);
7750
+ _chunkZDYV536Qcjs.applyTheme.call(void 0, modalRef.current, theme);
7500
7751
  }
7501
7752
  }, [isOpen, theme]);
7502
7753
  _react.useEffect.call(void 0, () => {
7503
7754
  if (isOpen) {
7504
- _optionalChain([onReadyRef, 'access', _256 => _256.current, 'optionalCall', _257 => _257()]);
7755
+ _optionalChain([onReadyRef, 'access', _245 => _245.current, 'optionalCall', _246 => _246()]);
7505
7756
  }
7506
7757
  }, [isOpen, onReadyRef]);
7507
7758
  const handleStepChange = _react.useCallback.call(void 0,
@@ -7577,10 +7828,10 @@ function DepositModalInner({
7577
7828
  fetchHistory("initial");
7578
7829
  }
7579
7830
  }, [historyOpen, fetchHistory]);
7580
- const onLifecycleRef = _chunkPPFG3VBDcjs.useLatestRef.call(void 0, onLifecycle);
7831
+ const onLifecycleRef = _chunkZDYV536Qcjs.useLatestRef.call(void 0, onLifecycle);
7581
7832
  const handleLifecycle = _react.useCallback.call(void 0,
7582
7833
  (event) => {
7583
- _optionalChain([onLifecycleRef, 'access', _258 => _258.current, 'optionalCall', _259 => _259(event)]);
7834
+ _optionalChain([onLifecycleRef, 'access', _247 => _247.current, 'optionalCall', _248 => _248(event)]);
7584
7835
  if (event.type === "smart-account-changed" && !event.evm && !event.solana) {
7585
7836
  historyStaleRef.current = true;
7586
7837
  }
@@ -7606,10 +7857,10 @@ function DepositModalInner({
7606
7857
  store.dispatch({ type: "flow/reset" });
7607
7858
  }
7608
7859
  }, [isOpen, store]);
7609
- const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _260 => _260.showBackButton]), () => ( true));
7860
+ const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _249 => _249.showBackButton]), () => ( true));
7610
7861
  const canGoBack = backHandler !== void 0;
7611
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.RpcUrlsProvider, { value: rpcUrls, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DepositStoreProvider, { store, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
7612
- _chunkPPFG3VBDcjs.Modal,
7862
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.RpcUrlsProvider, { value: rpcUrls, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DepositStoreProvider, { store, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
7863
+ _chunkZDYV536Qcjs.Modal,
7613
7864
  {
7614
7865
  isOpen,
7615
7866
  onClose,
@@ -7625,7 +7876,7 @@ function DepositModalInner({
7625
7876
  className: "rs-modal-header-back",
7626
7877
  "aria-label": "Go back",
7627
7878
  onClick: backHandler,
7628
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.ChevronLeftIcon, {})
7879
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.ChevronLeftIcon, {})
7629
7880
  }
7630
7881
  ) }),
7631
7882
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-header-nav-right", children: [
@@ -7637,7 +7888,7 @@ function DepositModalInner({
7637
7888
  "aria-label": "Deposit history",
7638
7889
  onClick: handleHistoryOpen,
7639
7890
  disabled: !recipient,
7640
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.HistoryIcon, {})
7891
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.HistoryIcon, {})
7641
7892
  }
7642
7893
  ),
7643
7894
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
@@ -7647,12 +7898,12 @@ function DepositModalInner({
7647
7898
  onClick: onClose,
7648
7899
  className: "rs-modal-close",
7649
7900
  "aria-label": "Close",
7650
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.CloseIcon, {})
7901
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.CloseIcon, {})
7651
7902
  }
7652
7903
  )
7653
7904
  ] })
7654
7905
  ] }),
7655
- recipientIsContract ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.Callout, { variant: "error", children: "HyperCore deposits require an EOA recipient. The configured recipient is a smart contract, which is not supported." }) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
7906
+ recipientIsContract ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.Callout, { variant: "error", children: "HyperCore deposits require an EOA recipient. The configured recipient is a smart contract, which is not supported." }) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
7656
7907
  DepositFlow,
7657
7908
  {
7658
7909
  dappWalletClient,
@@ -7667,7 +7918,6 @@ function DepositModalInner({
7667
7918
  amount: defaultAmount,
7668
7919
  recipient,
7669
7920
  appBalanceUsd,
7670
- postBridgeActions,
7671
7921
  outputTokenRules,
7672
7922
  rejectUnmapped,
7673
7923
  signerAddress,