@rhinestone/deposit-modal 0.5.1 → 0.6.1

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.
@@ -68,7 +68,7 @@ var _chunkNRNJAQUAcjs = require('./chunk-NRNJAQUA.cjs');
68
68
 
69
69
 
70
70
 
71
- var _chunkPDFLALUTcjs = require('./chunk-PDFLALUT.cjs');
71
+ var _chunkVPWWFWZTcjs = require('./chunk-VPWWFWZT.cjs');
72
72
 
73
73
 
74
74
  var _chunkUEKPBRBYcjs = require('./chunk-UEKPBRBY.cjs');
@@ -146,12 +146,12 @@ function AssetSelectStep({
146
146
  const [error, setError] = _react.useState.call(void 0, null);
147
147
  const defaultAssetId = _react.useMemo.call(void 0, () => {
148
148
  if (!defaultSourceChain || !defaultSourceToken) return null;
149
- return _chunkPDFLALUTcjs.getAssetId.call(void 0, {
149
+ return _chunkVPWWFWZTcjs.getAssetId.call(void 0, {
150
150
  chainId: defaultSourceChain,
151
151
  token: defaultSourceToken
152
152
  });
153
153
  }, [defaultSourceChain, defaultSourceToken]);
154
- const onTotalBalanceComputedRef = _chunkPDFLALUTcjs.useLatestRef.call(void 0, onTotalBalanceComputed);
154
+ const onTotalBalanceComputedRef = _chunkVPWWFWZTcjs.useLatestRef.call(void 0, onTotalBalanceComputed);
155
155
  _react.useEffect.call(void 0, () => {
156
156
  let active = true;
157
157
  function emitAssetsUpdate(currentAssets) {
@@ -171,7 +171,7 @@ function AssetSelectStep({
171
171
  try {
172
172
  const portfolio = await service.fetchPortfolio(address);
173
173
  if (!active) return;
174
- const portfolioAssets = _chunkPDFLALUTcjs.portfolioToAssets.call(void 0, portfolio.tokens);
174
+ const portfolioAssets = _chunkVPWWFWZTcjs.portfolioToAssets.call(void 0, portfolio.tokens);
175
175
  setAssets(portfolioAssets);
176
176
  emitAssetsUpdate(portfolioAssets);
177
177
  const hasNative = portfolioAssets.some(
@@ -247,7 +247,7 @@ function AssetSelectStep({
247
247
  const raw = _viem.formatUnits.call(void 0, BigInt(asset.balance), asset.decimals);
248
248
  const numeric = Number(raw);
249
249
  if (!Number.isFinite(numeric)) return raw;
250
- return _chunkPDFLALUTcjs.tokenFormatter.format(numeric);
250
+ return _chunkVPWWFWZTcjs.tokenFormatter.format(numeric);
251
251
  } catch (e3) {
252
252
  return asset.balance;
253
253
  }
@@ -255,20 +255,20 @@ function AssetSelectStep({
255
255
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
256
256
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
257
257
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
258
- _chunkPDFLALUTcjs.BodyHeader,
258
+ _chunkVPWWFWZTcjs.BodyHeader,
259
259
  {
260
- icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.WalletIcon, {}),
260
+ icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.WalletIcon, {}),
261
261
  title: "Your assets",
262
262
  subtitle: "Select source assets to transfer"
263
263
  }
264
264
  ),
265
265
  loading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
266
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.Spinner, { className: "rs-text-tertiary" }),
266
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.Spinner, { className: "rs-text-tertiary" }),
267
267
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
268
268
  ] }),
269
- error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.Callout, { variant: "error", children: error }),
269
+ error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.Callout, { variant: "error", children: error }),
270
270
  !loading && !error && rows.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-state", children: [
271
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.WalletIcon, { className: "rs-empty-icon" }),
271
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.WalletIcon, { className: "rs-empty-icon" }),
272
272
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-empty-text", children: "No funds in connected wallet" }),
273
273
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-address", children: [
274
274
  address.slice(0, 6),
@@ -335,14 +335,14 @@ function AssetSelectStep({
335
335
  ] })
336
336
  ] })
337
337
  ] }),
338
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: asset.balanceUsd !== void 0 && asset.balanceUsd > 0 ? _chunkPDFLALUTcjs.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 ? _chunkVPWWFWZTcjs.currencyFormatter.format(asset.balanceUsd) : tokenAmount !== "--" ? `${tokenAmount} ${asset.symbol}` : "--" })
339
339
  ]
340
340
  },
341
341
  asset.id
342
342
  );
343
343
  }) }),
344
344
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
345
- _chunkPDFLALUTcjs.Button,
345
+ _chunkVPWWFWZTcjs.Button,
346
346
  {
347
347
  onClick: () => selectedAsset && onContinue(selectedAsset),
348
348
  disabled: !selectedAsset,
@@ -351,7 +351,7 @@ function AssetSelectStep({
351
351
  }
352
352
  )
353
353
  ] }),
354
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.PoweredBy, {})
354
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.PoweredBy, {})
355
355
  ] });
356
356
  }
357
357
  async function fetchNativeAssets(address, publicClient, existing) {
@@ -359,7 +359,7 @@ async function fetchNativeAssets(address, publicClient, existing) {
359
359
  const connectedChainId = _optionalChain([publicClient, 'access', _8 => _8.chain, 'optionalAccess', _9 => _9.id]);
360
360
  if (!connectedChainId) return [];
361
361
  if (!_chunkABVRVW3Pcjs.SOURCE_CHAINS.some((chain) => chain.id === connectedChainId)) return [];
362
- const id = _chunkPDFLALUTcjs.getAssetId.call(void 0, {
362
+ const id = _chunkVPWWFWZTcjs.getAssetId.call(void 0, {
363
363
  chainId: connectedChainId,
364
364
  token: _chunkABVRVW3Pcjs.NATIVE_TOKEN_ADDRESS
365
365
  });
@@ -556,7 +556,7 @@ function AmountStep({
556
556
  const balanceTarget = _nullishCoalesce(balanceAddress, () => ( address));
557
557
  if (!balanceTarget || !publicClient) return;
558
558
  try {
559
- const bal = _chunkPDFLALUTcjs.isNativeAsset.call(void 0, asset) ? await publicClient.getBalance({ address: balanceTarget }) : await publicClient.readContract({
559
+ const bal = _chunkVPWWFWZTcjs.isNativeAsset.call(void 0, asset) ? await publicClient.getBalance({ address: balanceTarget }) : await publicClient.readContract({
560
560
  address: asset.token,
561
561
  abi: _viem.erc20Abi,
562
562
  functionName: "balanceOf",
@@ -577,7 +577,7 @@ function AmountStep({
577
577
  hasAttemptedSwitch.current = true;
578
578
  switchChain(asset.chainId).catch((err) => {
579
579
  const raw = err instanceof Error ? err.message : "Failed to switch chain";
580
- setError(_chunkPDFLALUTcjs.formatUserError.call(void 0, raw));
580
+ setError(_chunkVPWWFWZTcjs.formatUserError.call(void 0, raw));
581
581
  });
582
582
  }
583
583
  }, [chainMismatch, switchChain, asset.chainId]);
@@ -630,7 +630,7 @@ function AmountStep({
630
630
  const raw = _viem.formatUnits.call(void 0, balance, asset.decimals);
631
631
  const numeric = Number(raw);
632
632
  if (!Number.isFinite(numeric)) return raw;
633
- return _chunkPDFLALUTcjs.tokenFormatter.format(numeric);
633
+ return _chunkVPWWFWZTcjs.tokenFormatter.format(numeric);
634
634
  } catch (e8) {
635
635
  return "\u2026";
636
636
  }
@@ -751,7 +751,7 @@ function AmountStep({
751
751
  const targetTokenIcon = _chunkABVRVW3Pcjs.getTokenIcon.call(void 0, targetSymbol);
752
752
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
753
753
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
754
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.WalletIcon, {}), title: "Wallet deposit" }),
754
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.WalletIcon, {}), title: "Wallet deposit" }),
755
755
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-section", children: [
756
756
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-display", children: [
757
757
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
@@ -771,13 +771,13 @@ function AmountStep({
771
771
  " available",
772
772
  balanceUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
773
773
  " (~",
774
- _chunkPDFLALUTcjs.currencyFormatter.format(balanceUsd),
774
+ _chunkVPWWFWZTcjs.currencyFormatter.format(balanceUsd),
775
775
  ")"
776
776
  ] })
777
777
  ] }),
778
778
  minDepositUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-amount-meta-minimum", children: [
779
779
  "Min. deposit ",
780
- _chunkPDFLALUTcjs.currencyFormatter.format(minDepositUsd)
780
+ _chunkVPWWFWZTcjs.currencyFormatter.format(minDepositUsd)
781
781
  ] })
782
782
  ] })
783
783
  ] }),
@@ -818,13 +818,13 @@ function AmountStep({
818
818
  ] }),
819
819
  balanceAfterUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
820
820
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Balance after deposit" }),
821
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children: _chunkPDFLALUTcjs.currencyFormatter.format(balanceAfterUsd) })
821
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children: _chunkVPWWFWZTcjs.currencyFormatter.format(balanceAfterUsd) })
822
822
  ] })
823
823
  ] }),
824
- targetChain === _chunkABVRVW3Pcjs.HYPERCORE_CHAIN_ID && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.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, _chunkPDFLALUTcjs.Callout, { variant: "error", children: error }),
824
+ targetChain === _chunkABVRVW3Pcjs.HYPERCORE_CHAIN_ID && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.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, _chunkVPWWFWZTcjs.Callout, { variant: "error", children: error }),
826
826
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
827
- _chunkPDFLALUTcjs.Button,
827
+ _chunkVPWWFWZTcjs.Button,
828
828
  {
829
829
  onClick: handleContinue,
830
830
  fullWidth: true,
@@ -835,7 +835,7 @@ function AmountStep({
835
835
  }
836
836
  )
837
837
  ] }),
838
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.PoweredBy, {})
838
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.PoweredBy, {})
839
839
  ] });
840
840
  }
841
841
 
@@ -882,16 +882,16 @@ function ConfirmStep({
882
882
  const targetChainIcon = _chunkABVRVW3Pcjs.getChainIcon.call(void 0, targetChain);
883
883
  const sourceTokenIcon = _chunkABVRVW3Pcjs.getTokenIcon.call(void 0, asset.symbol);
884
884
  const targetTokenIcon = _chunkABVRVW3Pcjs.getTokenIcon.call(void 0, targetSymbol);
885
- const formattedSendAmount = amount && Number.isFinite(Number(amount)) ? _nullishCoalesce(_chunkPDFLALUTcjs.formatTokenAmount.call(void 0, Number(amount), asset.symbol), () => ( "0")) : "0";
885
+ const formattedSendAmount = amount && Number.isFinite(Number(amount)) ? _nullishCoalesce(_chunkVPWWFWZTcjs.formatTokenAmount.call(void 0, Number(amount), asset.symbol), () => ( "0")) : "0";
886
886
  const receiveDisplay = (() => {
887
887
  if (sameRoute) return `${formattedSendAmount} ${asset.symbol}`;
888
888
  if (quote) {
889
- const quoted = _chunkPDFLALUTcjs.formatQuotedReceive.call(void 0, quote.output, targetSymbol);
889
+ const quoted = _chunkVPWWFWZTcjs.formatQuotedReceive.call(void 0, quote.output, targetSymbol);
890
890
  if (quoted !== void 0) return quoted;
891
891
  }
892
892
  const usdValue = Number(targetAmount);
893
893
  const sourceAmountUsd = Number.isFinite(usdValue) && usdValue > 0 ? usdValue : void 0;
894
- const estimate = _chunkPDFLALUTcjs.formatReceiveEstimate.call(void 0, {
894
+ const estimate = _chunkVPWWFWZTcjs.formatReceiveEstimate.call(void 0, {
895
895
  sourceAmount: Number.isFinite(Number(amount)) ? Number(amount) : void 0,
896
896
  sourceSymbol: asset.symbol,
897
897
  targetSymbol,
@@ -910,7 +910,7 @@ function ConfirmStep({
910
910
  hasAttemptedSwitch.current = true;
911
911
  switchChain(asset.chainId).catch((err) => {
912
912
  const raw = err instanceof Error ? err.message : "Failed to switch chain";
913
- setError(_chunkPDFLALUTcjs.formatUserError.call(void 0, raw));
913
+ setError(_chunkVPWWFWZTcjs.formatUserError.call(void 0, raw));
914
914
  });
915
915
  }
916
916
  }, [chainMismatch, switchChain, asset.chainId]);
@@ -990,7 +990,7 @@ function ConfirmStep({
990
990
  const result = await executeTransfer(amountUnits);
991
991
  hash = result.txHash;
992
992
  resolvedSourceToken = result.sourceToken;
993
- } else if (_chunkPDFLALUTcjs.isNativeAsset.call(void 0, asset)) {
993
+ } else if (_chunkVPWWFWZTcjs.isNativeAsset.call(void 0, asset)) {
994
994
  hash = await walletClient.sendTransaction({
995
995
  account,
996
996
  chain,
@@ -1011,7 +1011,7 @@ function ConfirmStep({
1011
1011
  onConfirm(hash, asset.chainId, amountUnits.toString(), resolvedSourceToken);
1012
1012
  } catch (err) {
1013
1013
  const raw = err instanceof Error ? err.message : "Transfer failed";
1014
- const message = _chunkPDFLALUTcjs.formatUserError.call(void 0, raw);
1014
+ const message = _chunkVPWWFWZTcjs.formatUserError.call(void 0, raw);
1015
1015
  setError(message);
1016
1016
  _optionalChain([onError, 'optionalCall', _29 => _29(message, "TRANSFER_ERROR")]);
1017
1017
  } finally {
@@ -1020,7 +1020,7 @@ function ConfirmStep({
1020
1020
  };
1021
1021
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
1022
1022
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
1023
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.WalletIcon, {}), title: "Review deposit" }),
1023
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.WalletIcon, {}), title: "Review deposit" }),
1024
1024
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-details", children: [
1025
1025
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
1026
1026
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Source chain" }),
@@ -1074,14 +1074,14 @@ function ConfirmStep({
1074
1074
  children: feeDisplay
1075
1075
  }
1076
1076
  ),
1077
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.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, _chunkPDFLALUTcjs.InfoIcon, {}) }) })
1077
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.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, _chunkVPWWFWZTcjs.InfoIcon, {}) }) })
1078
1078
  ] })
1079
1079
  ] })
1080
1080
  ] }),
1081
- targetChain === _chunkABVRVW3Pcjs.HYPERCORE_CHAIN_ID && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.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, _chunkPDFLALUTcjs.Callout, { variant: "error", children: error }),
1081
+ targetChain === _chunkABVRVW3Pcjs.HYPERCORE_CHAIN_ID && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.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, _chunkVPWWFWZTcjs.Callout, { variant: "error", children: error }),
1083
1083
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1084
- _chunkPDFLALUTcjs.Button,
1084
+ _chunkVPWWFWZTcjs.Button,
1085
1085
  {
1086
1086
  onClick: handleConfirm,
1087
1087
  loading: isSubmitting,
@@ -1092,7 +1092,7 @@ function ConfirmStep({
1092
1092
  }
1093
1093
  )
1094
1094
  ] }),
1095
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.PoweredBy, {})
1095
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.PoweredBy, {})
1096
1096
  ] });
1097
1097
  }
1098
1098
 
@@ -1115,9 +1115,9 @@ var INITIAL_POLL_INTERVAL = 3e3;
1115
1115
  var MAX_POLL_INTERVAL = 3e4;
1116
1116
  var BACKOFF_MULTIPLIER = 1.5;
1117
1117
  function isEventForTx(event, txHash) {
1118
- const eventTxHash = _chunkPDFLALUTcjs.getEventTxHash.call(void 0, event);
1118
+ const eventTxHash = _chunkVPWWFWZTcjs.getEventTxHash.call(void 0, event);
1119
1119
  if (!eventTxHash) return false;
1120
- return _chunkPDFLALUTcjs.txRefsMatch.call(void 0, eventTxHash, txHash);
1120
+ return _chunkVPWWFWZTcjs.txRefsMatch.call(void 0, eventTxHash, txHash);
1121
1121
  }
1122
1122
  function truncateHash(hash) {
1123
1123
  return `${hash.slice(0, 4)}\u2026${hash.slice(-4)}`;
@@ -1167,14 +1167,13 @@ function formatBridgeFailedMessage(event) {
1167
1167
  }
1168
1168
  return "Bridge failed";
1169
1169
  }
1170
- var txLinkIcon = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.ExternalLinkIcon, { className: "rs-deposit-notification-link-icon" });
1170
+ var txLinkIcon = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.ExternalLinkIcon, { className: "rs-deposit-notification-link-icon" });
1171
1171
  function DepositNotification({
1172
1172
  deposit,
1173
1173
  smartAccount,
1174
1174
  solanaDepositAddress,
1175
1175
  targetChain,
1176
1176
  targetToken,
1177
- hasPostBridgeActions,
1178
1177
  service,
1179
1178
  onComplete,
1180
1179
  onFailed,
@@ -1202,17 +1201,16 @@ function DepositNotification({
1202
1201
  const pollIntervalRef = _react.useRef.call(void 0, INITIAL_POLL_INTERVAL);
1203
1202
  const pollTimeoutRef = _react.useRef.call(void 0, null);
1204
1203
  const completedRef = _react.useRef.call(void 0, _nullishCoalesce(directTransfer, () => ( false)));
1205
- const depositContextRef = _chunkPDFLALUTcjs.useLatestRef.call(void 0, {
1204
+ const depositContextRef = _chunkVPWWFWZTcjs.useLatestRef.call(void 0, {
1206
1205
  amount,
1207
1206
  sourceChain,
1208
1207
  sourceToken: token,
1209
1208
  sourceDecimals,
1210
1209
  targetChain,
1211
- targetToken,
1212
- hasPostBridgeActions
1210
+ targetToken
1213
1211
  });
1214
- const onCompleteRef = _chunkPDFLALUTcjs.useLatestRef.call(void 0, onComplete);
1215
- const onFailedRef = _chunkPDFLALUTcjs.useLatestRef.call(void 0, onFailed);
1212
+ const onCompleteRef = _chunkVPWWFWZTcjs.useLatestRef.call(void 0, onComplete);
1213
+ const onFailedRef = _chunkVPWWFWZTcjs.useLatestRef.call(void 0, onFailed);
1216
1214
  const handleComplete = _react.useCallback.call(void 0,
1217
1215
  (destTxHash) => {
1218
1216
  if (completedRef.current) return;
@@ -1255,27 +1253,17 @@ function DepositNotification({
1255
1253
  if (!isMounted) return;
1256
1254
  const lastEvent = data.lastEvent;
1257
1255
  const eventForTx = isEventForTx(lastEvent, txHash) ? lastEvent : void 0;
1258
- const awaitingPostBridgeSwap = depositContextRef.current.hasPostBridgeActions;
1259
- if (_optionalChain([eventForTx, 'optionalAccess', _35 => _35.type]) === "post-bridge-swap-complete") {
1260
- const swapTxHash = _optionalChain([eventForTx, 'access', _36 => _36.data, 'optionalAccess', _37 => _37.swap, 'optionalAccess', _38 => _38.transactionHash]);
1261
- handleComplete(swapTxHash);
1262
- return;
1263
- }
1264
- if (_optionalChain([eventForTx, 'optionalAccess', _39 => _39.type]) === "post-bridge-swap-failed") {
1265
- handleFailed(formatBridgeFailedMessage(eventForTx));
1266
- return;
1267
- }
1268
- if (_optionalChain([eventForTx, 'optionalAccess', _40 => _40.type]) === "bridge-complete" && !awaitingPostBridgeSwap) {
1269
- 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]);
1270
1258
  handleComplete(destTx);
1271
1259
  return;
1272
1260
  }
1273
- if (_optionalChain([eventForTx, 'optionalAccess', _44 => _44.type]) === "bridge-failed") {
1261
+ if (_optionalChain([eventForTx, 'optionalAccess', _39 => _39.type]) === "bridge-failed") {
1274
1262
  handleFailed(formatBridgeFailedMessage(eventForTx));
1275
1263
  return;
1276
1264
  }
1277
- if (_optionalChain([eventForTx, 'optionalAccess', _45 => _45.type]) === "error") {
1278
- 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"));
1279
1267
  handleFailed(errorMessage);
1280
1268
  return;
1281
1269
  }
@@ -1317,7 +1305,7 @@ function DepositNotification({
1317
1305
  const destExplorerUrl = destinationTxHash ? _chunkABVRVW3Pcjs.getExplorerTxUrl.call(void 0, targetChain, destinationTxHash) : null;
1318
1306
  const title = status === "complete" ? "Deposit completed" : status === "failed" ? "Deposit failed" : "Deposit received and processing\u2026";
1319
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.";
1320
- 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, _chunkPDFLALUTcjs.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, _chunkPDFLALUTcjs.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, _chunkVPWWFWZTcjs.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, _chunkVPWWFWZTcjs.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,
1321
1309
  "svg",
1322
1310
  {
1323
1311
  className: "rs-deposit-notification-spinner",
@@ -1367,7 +1355,7 @@ function DepositNotification({
1367
1355
  className: "rs-deposit-notification-close",
1368
1356
  onClick: () => onDismiss(deposit.id),
1369
1357
  "aria-label": "Dismiss",
1370
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.CloseIcon, {})
1358
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.CloseIcon, {})
1371
1359
  }
1372
1360
  )
1373
1361
  ] }),
@@ -1383,7 +1371,7 @@ function DepositNotification({
1383
1371
  "aria-expanded": expanded,
1384
1372
  children: [
1385
1373
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: expanded ? "See less details" : "See more details" }),
1386
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.ChevronDownIcon, { className: "rs-deposit-notification-toggle-chevron" })
1374
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.ChevronDownIcon, { className: "rs-deposit-notification-toggle-chevron" })
1387
1375
  ]
1388
1376
  }
1389
1377
  ),
@@ -1484,7 +1472,7 @@ function resolveSolanaTokenMeta(token) {
1484
1472
  return {};
1485
1473
  }
1486
1474
  function getDepositEventDetails(event) {
1487
- if (!_optionalChain([event, 'optionalAccess', _48 => _48.type]) || !isRecord(event.data)) return {};
1475
+ if (!_optionalChain([event, 'optionalAccess', _43 => _43.type]) || !isRecord(event.data)) return {};
1488
1476
  if (event.type === "deposit-received") {
1489
1477
  const chainId = asChainId(event.data.chain);
1490
1478
  const token = asString(event.data.token);
@@ -1499,12 +1487,12 @@ function getDepositEventDetails(event) {
1499
1487
  const source = isRecord(event.data.source) ? event.data.source : void 0;
1500
1488
  const deposit = isRecord(event.data.deposit) ? event.data.deposit : void 0;
1501
1489
  if (source || deposit) {
1502
- const chainId = _nullishCoalesce(asChainId(_optionalChain([source, 'optionalAccess', _49 => _49.chain])), () => ( asChainId(_optionalChain([deposit, 'optionalAccess', _50 => _50.chain]))));
1503
- 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]))));
1504
1492
  const solanaMeta = chainId === "solana" ? resolveSolanaTokenMeta(token) : {};
1505
1493
  return {
1506
1494
  chainId,
1507
- 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])))),
1508
1496
  token,
1509
1497
  ...solanaMeta
1510
1498
  };
@@ -1530,7 +1518,6 @@ function DepositAddressStep({
1530
1518
  allowedRoutes,
1531
1519
  targetChain,
1532
1520
  targetToken,
1533
- hasPostBridgeActions,
1534
1521
  uiConfig,
1535
1522
  onDepositSubmitted,
1536
1523
  onDepositComplete,
@@ -1540,12 +1527,12 @@ function DepositAddressStep({
1540
1527
  }) {
1541
1528
  const hasSolana = Boolean(solanaDepositAddress);
1542
1529
  const allowedChainSet = _react.useMemo.call(void 0,
1543
- () => _optionalChain([allowedRoutes, 'optionalAccess', _56 => _56.sourceChains]) ? new Set(allowedRoutes.sourceChains) : null,
1544
- [_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])]
1545
1532
  );
1546
1533
  const allowedTokenSet = _react.useMemo.call(void 0,
1547
- () => _optionalChain([allowedRoutes, 'optionalAccess', _58 => _58.sourceTokens]) ? new Set(allowedRoutes.sourceTokens.map((s) => s.toUpperCase())) : null,
1548
- [_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])]
1549
1536
  );
1550
1537
  const evmChainIds = _react.useMemo.call(void 0, () => {
1551
1538
  const all = _chunkABVRVW3Pcjs.getSupportedChainIds.call(void 0, );
@@ -1637,8 +1624,8 @@ function DepositAddressStep({
1637
1624
  function handlePointerDown(event) {
1638
1625
  const target = event.target;
1639
1626
  if (!target) return;
1640
- const clickedChainDropdown = _optionalChain([chainDropdownRef, 'access', _60 => _60.current, 'optionalAccess', _61 => _61.contains, 'call', _62 => _62(target)]);
1641
- 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)]);
1642
1629
  if (clickedChainDropdown || clickedTokenDropdown) return;
1643
1630
  setChainDropdownOpen(false);
1644
1631
  setTokenDropdownOpen(false);
@@ -1651,7 +1638,7 @@ function DepositAddressStep({
1651
1638
  };
1652
1639
  }, [chainDropdownOpen, tokenDropdownOpen]);
1653
1640
  const handleCopy = _react.useCallback.call(void 0, async () => {
1654
- _optionalChain([onCopyAddress, 'optionalCall', _66 => _66()]);
1641
+ _optionalChain([onCopyAddress, 'optionalCall', _61 => _61()]);
1655
1642
  try {
1656
1643
  await navigator.clipboard.writeText(displayAddress);
1657
1644
  setCopied(true);
@@ -1730,10 +1717,10 @@ function DepositAddressStep({
1730
1717
  return;
1731
1718
  }
1732
1719
  const event = status.lastEvent;
1733
- const eventTxHash = _chunkPDFLALUTcjs.isDepositEvent.call(void 0, event) ? _nullishCoalesce(_chunkPDFLALUTcjs.getEventTxHash.call(void 0, event), () => ( null)) : null;
1720
+ const eventTxHash = _chunkVPWWFWZTcjs.isDepositEvent.call(void 0, event) ? _nullishCoalesce(_chunkVPWWFWZTcjs.getEventTxHash.call(void 0, event), () => ( null)) : null;
1734
1721
  if (baselineTxHashRef.current === void 0) {
1735
1722
  baselineTxHashRef.current = eventTxHash;
1736
- } else if (eventTxHash && (!baselineTxHashRef.current || !_chunkPDFLALUTcjs.txRefsMatch.call(void 0, eventTxHash, baselineTxHashRef.current))) {
1723
+ } else if (eventTxHash && (!baselineTxHashRef.current || !_chunkVPWWFWZTcjs.txRefsMatch.call(void 0, eventTxHash, baselineTxHashRef.current))) {
1737
1724
  const details = getDepositEventDetails(event);
1738
1725
  const chainId = _nullishCoalesce(details.chainId, () => ( "unknown"));
1739
1726
  const amount = _nullishCoalesce(details.amount, () => ( "0"));
@@ -1765,7 +1752,7 @@ function DepositAddressStep({
1765
1752
  directTransfer
1766
1753
  };
1767
1754
  setNotifications((prev) => [notification, ...prev]);
1768
- _optionalChain([onDepositSubmittedRef, 'access', _67 => _67.current, 'optionalCall', _68 => _68({
1755
+ _optionalChain([onDepositSubmittedRef, 'access', _62 => _62.current, 'optionalCall', _63 => _63({
1769
1756
  txHash: eventTxHash,
1770
1757
  sourceChain: chainId,
1771
1758
  amount,
@@ -1777,7 +1764,7 @@ function DepositAddressStep({
1777
1764
  if (!cancelled) {
1778
1765
  const msg = err instanceof Error ? err.message : "Failed to check status";
1779
1766
  setPollingError(msg);
1780
- _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")]);
1781
1768
  }
1782
1769
  }
1783
1770
  if (!cancelled) {
@@ -1793,14 +1780,14 @@ function DepositAddressStep({
1793
1780
  const handleNotificationComplete = _react.useCallback.call(void 0,
1794
1781
  (txHash, destinationTxHash, context) => {
1795
1782
  isTrackingRef.current = false;
1796
- _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)]);
1797
1784
  },
1798
1785
  []
1799
1786
  );
1800
1787
  const handleNotificationFailed = _react.useCallback.call(void 0,
1801
1788
  (txHash, error) => {
1802
1789
  isTrackingRef.current = false;
1803
- _optionalChain([onDepositFailedRef, 'access', _73 => _73.current, 'optionalCall', _74 => _74(txHash, error)]);
1790
+ _optionalChain([onDepositFailedRef, 'access', _68 => _68.current, 'optionalCall', _69 => _69(txHash, error)]);
1804
1791
  },
1805
1792
  []
1806
1793
  );
@@ -1810,7 +1797,7 @@ function DepositAddressStep({
1810
1797
  const qrIconSrc = _chunkABVRVW3Pcjs.getChainIcon.call(void 0, sourceChainId);
1811
1798
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen rs-step--with-notifications", children: [
1812
1799
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
1813
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.TransferCryptoIcon, {}), title: "Transfer crypto" }),
1800
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.TransferCryptoIcon, {}), title: "Transfer crypto" }),
1814
1801
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-selectors", children: [
1815
1802
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown", ref: chainDropdownRef, children: [
1816
1803
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-dropdown-label", children: "Supported chain" }),
@@ -1834,7 +1821,7 @@ function DepositAddressStep({
1834
1821
  }
1835
1822
  ),
1836
1823
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: _chunkABVRVW3Pcjs.getChainName.call(void 0, sourceChainId) }),
1837
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
1824
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
1838
1825
  ]
1839
1826
  }
1840
1827
  ),
@@ -1864,9 +1851,9 @@ function DepositAddressStep({
1864
1851
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Supported token" }),
1865
1852
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-deposit-address-min", children: [
1866
1853
  "Min.$",
1867
- (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),
1868
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.Tooltip, { content: "Minimum deposit amount required for the selected chain.", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1869
- _chunkPDFLALUTcjs.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, _chunkVPWWFWZTcjs.Tooltip, { content: "Minimum deposit amount required for the selected chain.", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1856
+ _chunkVPWWFWZTcjs.InfoIcon,
1870
1857
  {
1871
1858
  className: "rs-deposit-address-min-icon",
1872
1859
  "aria-hidden": "true"
@@ -1894,7 +1881,7 @@ function DepositAddressStep({
1894
1881
  }
1895
1882
  ),
1896
1883
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: sourceTokenSymbol }),
1897
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
1884
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
1898
1885
  ]
1899
1886
  }
1900
1887
  ),
@@ -1945,7 +1932,7 @@ function DepositAddressStep({
1945
1932
  className: "rs-deposit-address-copy",
1946
1933
  onClick: handleCopy,
1947
1934
  children: [
1948
- copied ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.CheckIcon, {}) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.CopyIcon, {}),
1935
+ copied ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.CheckIcon, {}) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.CopyIcon, {}),
1949
1936
  copied ? "Copied!" : "Copy address"
1950
1937
  ]
1951
1938
  }
@@ -1953,7 +1940,7 @@ function DepositAddressStep({
1953
1940
  ]
1954
1941
  }
1955
1942
  ),
1956
- targetChain === _chunkABVRVW3Pcjs.HYPERCORE_CHAIN_ID && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.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, _chunkVPWWFWZTcjs.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." }),
1957
1944
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
1958
1945
  "div",
1959
1946
  {
@@ -1971,16 +1958,16 @@ function DepositAddressStep({
1971
1958
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-label", children: "Price impact" }),
1972
1959
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-label", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: "0.00%" }) }),
1973
1960
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1974
- _chunkPDFLALUTcjs.Tooltip,
1961
+ _chunkVPWWFWZTcjs.Tooltip,
1975
1962
  {
1976
1963
  className: "rs-price-impact-info",
1977
1964
  content: "Price impact is the difference between expected and execution price, due to trade size and liquidity.",
1978
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.InfoIcon, { "aria-hidden": "true" })
1965
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.InfoIcon, { "aria-hidden": "true" })
1979
1966
  }
1980
1967
  )
1981
1968
  ] }),
1982
1969
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1983
- _chunkPDFLALUTcjs.ChevronDownIcon,
1970
+ _chunkVPWWFWZTcjs.ChevronDownIcon,
1984
1971
  {
1985
1972
  className: "rs-price-impact-chevron",
1986
1973
  "aria-hidden": "true"
@@ -1991,29 +1978,29 @@ function DepositAddressStep({
1991
1978
  ),
1992
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: [
1993
1980
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-price-impact-row", children: [
1994
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.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, _chunkVPWWFWZTcjs.PercentIcon, {}) }),
1995
1982
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-price-impact-label", children: [
1996
1983
  "Max slippage: ",
1997
1984
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: "0.2%" })
1998
1985
  ] }),
1999
1986
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2000
- _chunkPDFLALUTcjs.Tooltip,
1987
+ _chunkVPWWFWZTcjs.Tooltip,
2001
1988
  {
2002
1989
  className: "rs-price-impact-info",
2003
1990
  content: "Slippage accounts for price changes during execution. Slippage is adjusted per pair to ensure reliable execution.",
2004
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.InfoIcon, { "aria-hidden": "true" })
1991
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.InfoIcon, { "aria-hidden": "true" })
2005
1992
  }
2006
1993
  )
2007
1994
  ] }),
2008
1995
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-price-impact-row", children: [
2009
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.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, _chunkVPWWFWZTcjs.ClockIcon, {}) }),
2010
1997
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-price-impact-label", children: [
2011
1998
  "Processing time: ",
2012
1999
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: "< 1 min" })
2013
2000
  ] })
2014
2001
  ] }),
2015
2002
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-price-impact-row", children: [
2016
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.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, _chunkVPWWFWZTcjs.PlusCircleIcon, {}) }),
2017
2004
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-price-impact-label", children: [
2018
2005
  "Max deposit:",
2019
2006
  " ",
@@ -2037,7 +2024,6 @@ function DepositAddressStep({
2037
2024
  solanaDepositAddress,
2038
2025
  targetChain,
2039
2026
  targetToken,
2040
- hasPostBridgeActions,
2041
2027
  service,
2042
2028
  onComplete: handleNotificationComplete,
2043
2029
  onFailed: handleNotificationFailed,
@@ -2045,7 +2031,7 @@ function DepositAddressStep({
2045
2031
  },
2046
2032
  deposit.id
2047
2033
  )) }),
2048
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.PoweredBy, {})
2034
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.PoweredBy, {})
2049
2035
  ] });
2050
2036
  }
2051
2037
  DepositAddressStep.displayName = "DepositAddressStep";
@@ -2053,6 +2039,20 @@ DepositAddressStep.displayName = "DepositAddressStep";
2053
2039
  // src/components/steps/FiatOnrampStep.tsx
2054
2040
 
2055
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
+
2056
2056
  // src/components/steps/SwappedIframeStep.tsx
2057
2057
 
2058
2058
 
@@ -2079,7 +2079,7 @@ function FinalisingDepositStep() {
2079
2079
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "rs-finalising-subtitle", children: "We are depositing your funds to the application." })
2080
2080
  ] })
2081
2081
  ] }),
2082
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.PoweredBy, {})
2082
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.PoweredBy, {})
2083
2083
  ] });
2084
2084
  }
2085
2085
  FinalisingDepositStep.displayName = "FinalisingDepositStep";
@@ -2109,7 +2109,7 @@ function SwappedOrderTracker({
2109
2109
  ];
2110
2110
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen rs-swapped-tracker", children: [
2111
2111
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
2112
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.HandCoinsIcon, {}), title }),
2112
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.HandCoinsIcon, {}), title }),
2113
2113
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "ol", { className: "rs-swapped-tracker-steps", children: labels.map((label, idx) => {
2114
2114
  const status = stepStates[idx];
2115
2115
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
@@ -2123,7 +2123,7 @@ function SwappedOrderTracker({
2123
2123
  {
2124
2124
  className: "rs-swapped-tracker-step-marker",
2125
2125
  "aria-hidden": "true",
2126
- children: status === "complete" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.CheckIcon, {}) : status === "failed" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.CloseIcon, {}) : status === "active" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.Spinner, {}) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2126
+ children: status === "complete" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.CheckIcon, {}) : status === "failed" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.CloseIcon, {}) : status === "active" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.Spinner, {}) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2127
2127
  "svg",
2128
2128
  {
2129
2129
  className: "rs-swapped-tracker-step-ring",
@@ -2158,7 +2158,7 @@ function SwappedOrderTracker({
2158
2158
  }
2159
2159
  )
2160
2160
  ] }),
2161
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.PoweredBy, {})
2161
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.PoweredBy, {})
2162
2162
  ] });
2163
2163
  }
2164
2164
  function formatTrackerAmount(amount) {
@@ -2176,11 +2176,7 @@ var DEPOSIT_POLL_INTERVAL_MS = 2e3;
2176
2176
  var DEPOSIT_POLL_FAST_INITIAL_DELAY_MS = 1e3;
2177
2177
  var DEPOSIT_POLL_FAST_INTERVAL_MS = 500;
2178
2178
  var IFRAME_LOAD_TIMEOUT_MS = 15e3;
2179
- var SWAPPED_IFRAME_ORIGINS = /* @__PURE__ */ new Set([
2180
- "https://connect.swapped.com",
2181
- "https://sandbox.swapped.com",
2182
- "https://widget.swapped.com"
2183
- ]);
2179
+ var SWAPPED_IFRAME_ORIGINS = new Set(SWAPPED_ORIGINS);
2184
2180
  var SWAPPED_TERMINAL_STATUSES = /* @__PURE__ */ new Set([
2185
2181
  "order_completed",
2186
2182
  "order_broadcasted"
@@ -2191,12 +2187,30 @@ var SWAPPED_STATUS_VALUES = /* @__PURE__ */ new Set([
2191
2187
  "order_broadcasted",
2192
2188
  "order_cancelled"
2193
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
+ }
2194
2208
  function parseSwappedIframeMessage(raw) {
2195
2209
  let data = raw;
2196
2210
  if (typeof data === "string") {
2197
2211
  try {
2198
2212
  data = JSON.parse(data);
2199
- } catch (e16) {
2213
+ } catch (e17) {
2200
2214
  return null;
2201
2215
  }
2202
2216
  }
@@ -2211,6 +2225,7 @@ function parseSwappedIframeMessage(raw) {
2211
2225
  return {
2212
2226
  status: rawStatus,
2213
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))),
2214
2229
  orderCrypto: _nullishCoalesce(asString2(inner.order_crypto), () => ( asString2(obj.orderCrypto))),
2215
2230
  orderCryptoAmount: _nullishCoalesce(asString2(inner.order_crypto_amount), () => ( asString2(obj.orderCryptoAmount))),
2216
2231
  transactionId: _nullishCoalesce(asString2(inner.transaction_id), () => ( asString2(obj.transactionId)))
@@ -2228,6 +2243,7 @@ function SwappedIframeStep({
2228
2243
  onSwappedComplete,
2229
2244
  onSwappedFailed,
2230
2245
  onClose,
2246
+ onGoBack,
2231
2247
  onError
2232
2248
  }) {
2233
2249
  const [widgetUrl, setWidgetUrl] = _react.useState.call(void 0, null);
@@ -2241,6 +2257,7 @@ function SwappedIframeStep({
2241
2257
  const completeFiredRef = _react.useRef.call(void 0, false);
2242
2258
  const failedFiredRef = _react.useRef.call(void 0, false);
2243
2259
  const expectedOrderUuidRef = _react.useRef.call(void 0, null);
2260
+ const expectedExternalCustomerIdRef = _react.useRef.call(void 0, null);
2244
2261
  const baselineDepositTxHashRef = _react.useRef.call(void 0, void 0);
2245
2262
  const currentDepositTxHashRef = _react.useRef.call(void 0, null);
2246
2263
  const fastDepositPollEnabledRef = _react.useRef.call(void 0, false);
@@ -2253,6 +2270,8 @@ function SwappedIframeStep({
2253
2270
  onSwappedFailedRef.current = onSwappedFailed;
2254
2271
  const onErrorRef = _react.useRef.call(void 0, onError);
2255
2272
  onErrorRef.current = onError;
2273
+ const onGoBackRef = _react.useRef.call(void 0, onGoBack);
2274
+ onGoBackRef.current = onGoBack;
2256
2275
  const loadUrlRef = _react.useRef.call(void 0, loadUrl);
2257
2276
  loadUrlRef.current = loadUrl;
2258
2277
  _react.useEffect.call(void 0, () => {
@@ -2264,6 +2283,7 @@ function SwappedIframeStep({
2264
2283
  setLatestEvent(null);
2265
2284
  setPhase("iframe");
2266
2285
  expectedOrderUuidRef.current = null;
2286
+ expectedExternalCustomerIdRef.current = null;
2267
2287
  completeFiredRef.current = false;
2268
2288
  failedFiredRef.current = false;
2269
2289
  baselineDepositTxHashRef.current = void 0;
@@ -2272,13 +2292,14 @@ function SwappedIframeStep({
2272
2292
  loadUrlRef.current().then((res) => {
2273
2293
  if (cancelled) return;
2274
2294
  setWidgetUrl(res.url);
2295
+ expectedExternalCustomerIdRef.current = res.externalCustomerId;
2275
2296
  const sep = res.externalCustomerId.indexOf(":");
2276
2297
  expectedOrderUuidRef.current = sep >= 0 ? res.externalCustomerId.slice(sep + 1) : null;
2277
2298
  }).catch((err) => {
2278
2299
  if (cancelled) return;
2279
2300
  const message = err instanceof Error ? err.message : loadErrorFallback;
2280
2301
  setLoadError(message);
2281
- _optionalChain([onErrorRef, 'access', _77 => _77.current, 'optionalCall', _78 => _78(message, loadErrorCode)]);
2302
+ _optionalChain([onErrorRef, 'access', _72 => _72.current, 'optionalCall', _73 => _73(message, loadErrorCode)]);
2282
2303
  });
2283
2304
  return () => {
2284
2305
  cancelled = true;
@@ -2303,7 +2324,7 @@ function SwappedIframeStep({
2303
2324
  if (isCurrentOrder) {
2304
2325
  setOrderState(res);
2305
2326
  }
2306
- } catch (e17) {
2327
+ } catch (e18) {
2307
2328
  }
2308
2329
  if (!cancelled) {
2309
2330
  timeoutId = setTimeout(poll, STATUS_POLL_INTERVAL_MS);
@@ -2324,14 +2345,14 @@ function SwappedIframeStep({
2324
2345
  const status = await service.fetchLatestStatus(smartAccount);
2325
2346
  if (cancelled) return;
2326
2347
  const event = status.lastEvent;
2327
- const eventTxHash = _chunkPDFLALUTcjs.isDepositEvent.call(void 0, event) ? _nullishCoalesce(_chunkPDFLALUTcjs.getEventTxHash.call(void 0, event), () => ( null)) : null;
2348
+ const eventTxHash = _chunkVPWWFWZTcjs.isDepositEvent.call(void 0, event) ? _nullishCoalesce(_chunkVPWWFWZTcjs.getEventTxHash.call(void 0, event), () => ( null)) : null;
2328
2349
  if (baselineDepositTxHashRef.current === void 0) {
2329
2350
  baselineDepositTxHashRef.current = eventTxHash;
2330
- } else if (eventTxHash && (!baselineDepositTxHashRef.current || !_chunkPDFLALUTcjs.txRefsMatch.call(void 0, eventTxHash, baselineDepositTxHashRef.current))) {
2351
+ } else if (eventTxHash && (!baselineDepositTxHashRef.current || !_chunkVPWWFWZTcjs.txRefsMatch.call(void 0, eventTxHash, baselineDepositTxHashRef.current))) {
2331
2352
  currentDepositTxHashRef.current = eventTxHash;
2332
2353
  setLatestEvent(_nullishCoalesce(event, () => ( null)));
2333
2354
  }
2334
- } catch (e18) {
2355
+ } catch (e19) {
2335
2356
  }
2336
2357
  if (!cancelled) {
2337
2358
  const nextInterval = fastDepositPollEnabledRef.current ? DEPOSIT_POLL_FAST_INTERVAL_MS : DEPOSIT_POLL_INTERVAL_MS;
@@ -2352,54 +2373,61 @@ function SwappedIframeStep({
2352
2373
  }, [service, smartAccount]);
2353
2374
  _react.useEffect.call(void 0, () => {
2354
2375
  if (fastDepositPollEnabledRef.current) return;
2355
- const status = _optionalChain([orderState, 'optionalAccess', _79 => _79.status]);
2376
+ const status = _optionalChain([orderState, 'optionalAccess', _74 => _74.status]);
2356
2377
  if (!status || !SWAPPED_TERMINAL_STATUSES.has(status)) return;
2357
2378
  fastDepositPollEnabledRef.current = true;
2358
- _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)]);
2359
2380
  }, [orderState]);
2360
2381
  _react.useEffect.call(void 0, () => {
2361
2382
  function onMessage(e) {
2362
2383
  if (!SWAPPED_IFRAME_ORIGINS.has(e.origin)) return;
2363
- 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
+ }
2364
2389
  const parsed = parseSwappedIframeMessage(e.data);
2365
2390
  if (!parsed) return;
2366
- const orderId = parsed.orderId;
2367
- if (!orderId || orderId !== expectedOrderUuidRef.current) {
2391
+ const ext = parsed.externalCustomerId;
2392
+ const expected = expectedExternalCustomerIdRef.current;
2393
+ if (!ext || !expected || ext.toLowerCase() !== expected.toLowerCase()) {
2368
2394
  return;
2369
2395
  }
2370
2396
  setOrderState((prev) => ({
2371
- 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)),
2372
2400
  status: parsed.status,
2373
- orderCrypto: _nullishCoalesce(_nullishCoalesce(parsed.orderCrypto, () => ( _optionalChain([prev, 'optionalAccess', _84 => _84.orderCrypto]))), () => ( null)),
2374
- orderCryptoAmount: _nullishCoalesce(_nullishCoalesce(parsed.orderCryptoAmount, () => ( _optionalChain([prev, 'optionalAccess', _85 => _85.orderCryptoAmount]))), () => ( null)),
2375
- 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)),
2376
2404
  receivedAt: (/* @__PURE__ */ new Date()).toISOString(),
2377
- paidAmountUsd: _nullishCoalesce(_optionalChain([prev, 'optionalAccess', _87 => _87.paidAmountUsd]), () => ( null)),
2378
- paidAmountEur: _nullishCoalesce(_optionalChain([prev, 'optionalAccess', _88 => _88.paidAmountEur]), () => ( null)),
2379
- onrampFeeUsd: _nullishCoalesce(_optionalChain([prev, 'optionalAccess', _89 => _89.onrampFeeUsd]), () => ( null)),
2380
- 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))
2381
2409
  }));
2382
2410
  }
2383
2411
  window.addEventListener("message", onMessage);
2384
2412
  return () => window.removeEventListener("message", onMessage);
2385
2413
  }, []);
2386
2414
  _react.useEffect.call(void 0, () => {
2387
- if (phase === "iframe" && orderState !== null) {
2415
+ if (phase === "iframe" && (orderState !== null || latestEvent !== null)) {
2388
2416
  setPhase("tracker");
2389
2417
  }
2390
- }, [phase, orderState]);
2418
+ }, [phase, orderState, latestEvent]);
2391
2419
  const stepStates = _react.useMemo.call(void 0,
2392
- () => deriveStepStates(_nullishCoalesce(_optionalChain([orderState, 'optionalAccess', _91 => _91.status]), () => ( null)), latestEvent),
2420
+ () => deriveStepStates(_nullishCoalesce(_optionalChain([orderState, 'optionalAccess', _87 => _87.status]), () => ( null)), latestEvent),
2393
2421
  [orderState, latestEvent]
2394
2422
  );
2395
2423
  const terminalState = _react.useMemo.call(void 0, () => {
2396
- if (_chunkPDFLALUTcjs.isFailedEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))) {
2424
+ if (_chunkVPWWFWZTcjs.isFailedEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))) {
2397
2425
  return {
2398
2426
  kind: "failed",
2399
- message: _chunkPDFLALUTcjs.failureMessageForEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))
2427
+ message: _chunkVPWWFWZTcjs.failureMessageForEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))
2400
2428
  };
2401
2429
  }
2402
- if (_optionalChain([orderState, 'optionalAccess', _92 => _92.status]) === "order_cancelled") {
2430
+ if (_optionalChain([orderState, 'optionalAccess', _88 => _88.status]) === "order_cancelled") {
2403
2431
  const banner = bannerForStatus("order_cancelled", {});
2404
2432
  return { kind: "cancelled", message: _nullishCoalesce(banner.detail, () => ( banner.title)) };
2405
2433
  }
@@ -2407,30 +2435,31 @@ function SwappedIframeStep({
2407
2435
  }, [latestEvent, orderState, bannerForStatus]);
2408
2436
  _react.useEffect.call(void 0, () => {
2409
2437
  if (completeFiredRef.current || failedFiredRef.current) return;
2410
- const t = _optionalChain([latestEvent, 'optionalAccess', _93 => _93.type]);
2411
- 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";
2412
2440
  if (!isSuccess) return;
2413
2441
  const txHash = currentDepositTxHashRef.current;
2414
2442
  if (!txHash) return;
2415
2443
  completeFiredRef.current = true;
2416
2444
  onSwappedCompleteRef.current({
2417
2445
  txHash,
2418
- orderCrypto: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess', _94 => _94.orderCrypto]), () => ( null)),
2446
+ orderCrypto: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess', _90 => _90.orderCrypto]), () => ( null)),
2419
2447
  // Base-unit source amount from the deposit row/event, consistent with the
2420
2448
  // wallet/QR path. ProcessingStep + onLifecycle expect base units.
2421
- amount: _nullishCoalesce(_chunkPDFLALUTcjs.getEventSourceDetails.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0))).amount, () => ( null))
2449
+ amount: _nullishCoalesce(_chunkVPWWFWZTcjs.getEventSourceDetails.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0))).amount, () => ( null)),
2450
+ initialEvent: _nullishCoalesce(latestEvent, () => ( void 0))
2422
2451
  });
2423
2452
  }, [latestEvent, orderState]);
2424
2453
  _react.useEffect.call(void 0, () => {
2425
2454
  if (failedFiredRef.current || completeFiredRef.current) return;
2426
- if (!_chunkPDFLALUTcjs.isFailedEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))) return;
2455
+ if (!_chunkVPWWFWZTcjs.isFailedEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))) return;
2427
2456
  const txHash = currentDepositTxHashRef.current;
2428
2457
  if (!txHash) return;
2429
2458
  failedFiredRef.current = true;
2430
2459
  setPhase("tracker");
2431
- _optionalChain([onSwappedFailedRef, 'access', _95 => _95.current, 'optionalCall', _96 => _96(
2460
+ _optionalChain([onSwappedFailedRef, 'access', _91 => _91.current, 'optionalCall', _92 => _92(
2432
2461
  txHash,
2433
- _chunkPDFLALUTcjs.failureMessageForEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))
2462
+ _chunkVPWWFWZTcjs.failureMessageForEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))
2434
2463
  )]);
2435
2464
  }, [latestEvent]);
2436
2465
  if (phase === "tracker") {
@@ -2441,8 +2470,8 @@ function SwappedIframeStep({
2441
2470
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2442
2471
  SwappedOrderTracker,
2443
2472
  {
2444
- amount: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess', _97 => _97.orderCryptoAmount]), () => ( null)),
2445
- currency: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess', _98 => _98.orderCrypto]), () => ( "USDC")),
2473
+ amount: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess', _93 => _93.orderCryptoAmount]), () => ( null)),
2474
+ currency: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess', _94 => _94.orderCrypto]), () => ( "USDC")),
2446
2475
  stepStates,
2447
2476
  terminal: terminalState,
2448
2477
  onRetry: () => setRetryToken((n) => n + 1),
@@ -2464,7 +2493,7 @@ function SwappedIframeStep({
2464
2493
  }
2465
2494
  )
2466
2495
  ] }),
2467
- !loadError && !iframeLoaded && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-fiat-onramp-loading", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.Spinner, {}) }),
2496
+ !loadError && !iframeLoaded && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-fiat-onramp-loading", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.Spinner, {}) }),
2468
2497
  widgetUrl && !loadError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2469
2498
  "iframe",
2470
2499
  {
@@ -2479,11 +2508,11 @@ function SwappedIframeStep({
2479
2508
  retryToken
2480
2509
  )
2481
2510
  ] }) }),
2482
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.PoweredBy, {})
2511
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.PoweredBy, {})
2483
2512
  ] });
2484
2513
  }
2485
2514
  function deriveStepStates(swappedStatus, latestEvent) {
2486
- if (_chunkPDFLALUTcjs.isFailedEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))) {
2515
+ if (_chunkVPWWFWZTcjs.isFailedEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))) {
2487
2516
  return ["complete", "complete", "failed", "pending"];
2488
2517
  }
2489
2518
  if (swappedStatus === "order_cancelled") {
@@ -2491,7 +2520,7 @@ function deriveStepStates(swappedStatus, latestEvent) {
2491
2520
  }
2492
2521
  const step1Complete = swappedStatus === "order_completed" || swappedStatus === "order_broadcasted";
2493
2522
  const step2Complete = latestEvent !== null;
2494
- const step3Complete = _optionalChain([latestEvent, 'optionalAccess', _99 => _99.type]) === "bridge-complete" || _optionalChain([latestEvent, 'optionalAccess', _100 => _100.type]) === "post-bridge-swap-complete";
2523
+ const step3Complete = _optionalChain([latestEvent, 'optionalAccess', _95 => _95.type]) === "bridge-complete";
2495
2524
  if (step3Complete) {
2496
2525
  return ["complete", "complete", "complete", "pending"];
2497
2526
  }
@@ -2537,18 +2566,27 @@ function FiatOnrampStep({
2537
2566
  smartAccount,
2538
2567
  service,
2539
2568
  paymentMethod,
2569
+ consumePrefetchedUrl,
2540
2570
  onSwappedComplete,
2541
2571
  onSwappedFailed,
2542
2572
  onClose,
2573
+ onGoBack,
2543
2574
  onError
2544
2575
  }) {
2545
2576
  const loadUrl = _react.useCallback.call(void 0, async () => {
2546
- const res = await service.getSwappedWidgetUrl({
2577
+ const prefetched = _optionalChain([consumePrefetchedUrl, 'optionalCall', _96 => _96(smartAccount, paymentMethod)]);
2578
+ if (prefetched) {
2579
+ try {
2580
+ const cached = await prefetched;
2581
+ if (isSwappedWidgetUrlFresh(cached)) return cached;
2582
+ } catch (e20) {
2583
+ }
2584
+ }
2585
+ return service.getSwappedWidgetUrl({
2547
2586
  smartAccount,
2548
2587
  method: paymentMethod
2549
2588
  });
2550
- return res;
2551
- }, [service, smartAccount, paymentMethod]);
2589
+ }, [service, smartAccount, paymentMethod, consumePrefetchedUrl]);
2552
2590
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2553
2591
  SwappedIframeStep,
2554
2592
  {
@@ -2563,6 +2601,7 @@ function FiatOnrampStep({
2563
2601
  onSwappedComplete,
2564
2602
  onSwappedFailed,
2565
2603
  onClose,
2604
+ onGoBack,
2566
2605
  onError
2567
2606
  }
2568
2607
  );
@@ -2608,6 +2647,7 @@ function ExchangeConnectStep({
2608
2647
  onSwappedComplete,
2609
2648
  onSwappedFailed,
2610
2649
  onClose,
2650
+ onGoBack,
2611
2651
  onError
2612
2652
  }) {
2613
2653
  const loadUrl = _react.useCallback.call(void 0, async () => {
@@ -2631,6 +2671,7 @@ function ExchangeConnectStep({
2631
2671
  onSwappedComplete,
2632
2672
  onSwappedFailed,
2633
2673
  onClose,
2674
+ onGoBack,
2634
2675
  onError
2635
2676
  }
2636
2677
  );
@@ -2643,7 +2684,7 @@ ExchangeConnectStep.displayName = "ExchangeConnectStep";
2643
2684
  function ExchangeLogo({ exchange }) {
2644
2685
  const [failed, setFailed] = _react.useState.call(void 0, false);
2645
2686
  if (!exchange.logoUrl || failed) {
2646
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.BankIcon, {});
2687
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.BankIcon, {});
2647
2688
  }
2648
2689
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2649
2690
  "img",
@@ -2678,7 +2719,7 @@ function ExchangeSelectStep({
2678
2719
  const message = err instanceof Error ? err.message : "Failed to load exchanges";
2679
2720
  setExchanges([]);
2680
2721
  setError(message);
2681
- _optionalChain([onError, 'optionalCall', _101 => _101(message, "SWAPPED_CONNECT_EXCHANGES_FAILED")]);
2722
+ _optionalChain([onError, 'optionalCall', _97 => _97(message, "SWAPPED_CONNECT_EXCHANGES_FAILED")]);
2682
2723
  }).finally(() => {
2683
2724
  if (!cancelled) setLoading(false);
2684
2725
  });
@@ -2689,14 +2730,14 @@ function ExchangeSelectStep({
2689
2730
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen rs-exchange-select", children: [
2690
2731
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
2691
2732
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2692
- _chunkPDFLALUTcjs.BodyHeader,
2733
+ _chunkVPWWFWZTcjs.BodyHeader,
2693
2734
  {
2694
- icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.UnplugIcon, {}),
2735
+ icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.UnplugIcon, {}),
2695
2736
  title: "Connect exchange",
2696
2737
  subtitle: "Select an exchange to connect"
2697
2738
  }
2698
2739
  ),
2699
- loading && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-exchange-select-state", "aria-live": "polite", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.Spinner, {}) }),
2740
+ loading && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-exchange-select-state", "aria-live": "polite", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.Spinner, {}) }),
2700
2741
  !loading && error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-exchange-select-state", "aria-live": "polite", children: [
2701
2742
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-exchange-select-state-title", children: "Couldn\u2019t load exchanges" }),
2702
2743
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
@@ -2722,7 +2763,7 @@ function ExchangeSelectStep({
2722
2763
  )
2723
2764
  ] }),
2724
2765
  !loading && !error && exchanges.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-exchange-grid", children: exchanges.map((exchange) => {
2725
- const brand = _chunkPDFLALUTcjs.getExchangeLogo.call(void 0, exchange.name, exchange.connection);
2766
+ const brand = _chunkVPWWFWZTcjs.getExchangeLogo.call(void 0, exchange.name, exchange.connection);
2726
2767
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
2727
2768
  "button",
2728
2769
  {
@@ -2745,7 +2786,7 @@ function ExchangeSelectStep({
2745
2786
  );
2746
2787
  }) })
2747
2788
  ] }),
2748
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.PoweredBy, {})
2789
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.PoweredBy, {})
2749
2790
  ] });
2750
2791
  }
2751
2792
  ExchangeSelectStep.displayName = "ExchangeSelectStep";
@@ -2757,8 +2798,8 @@ function DepositAddressSkeleton({
2757
2798
  uiConfig,
2758
2799
  allowedRoutes
2759
2800
  }) {
2760
- const allowedChainSet = _optionalChain([allowedRoutes, 'optionalAccess', _102 => _102.sourceChains]) ? new Set(allowedRoutes.sourceChains) : null;
2761
- const allowedTokenSet = _optionalChain([allowedRoutes, 'optionalAccess', _103 => _103.sourceTokens]) ? new Set(allowedRoutes.sourceTokens.map((s) => s.toUpperCase())) : null;
2801
+ const allowedChainSet = _optionalChain([allowedRoutes, 'optionalAccess', _98 => _98.sourceChains]) ? new Set(allowedRoutes.sourceChains) : null;
2802
+ const allowedTokenSet = _optionalChain([allowedRoutes, 'optionalAccess', _99 => _99.sourceTokens]) ? new Set(allowedRoutes.sourceTokens.map((s) => s.toUpperCase())) : null;
2762
2803
  const evmChainIds = (() => {
2763
2804
  const all = _chunkABVRVW3Pcjs.getSupportedChainIds.call(void 0, );
2764
2805
  return allowedChainSet ? all.filter((id) => allowedChainSet.has(id)) : all;
@@ -2775,7 +2816,7 @@ function DepositAddressSkeleton({
2775
2816
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", "aria-busy": "true", children: [
2776
2817
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-sr-only", role: "status", children: "Preparing deposit details\u2026" }),
2777
2818
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
2778
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.TransferCryptoIcon, {}), title: "Transfer crypto" }),
2819
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.TransferCryptoIcon, {}), title: "Transfer crypto" }),
2779
2820
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-selectors", "aria-hidden": "true", children: [
2780
2821
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown", children: [
2781
2822
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-dropdown-label", children: "Supported chain" }),
@@ -2789,7 +2830,7 @@ function DepositAddressSkeleton({
2789
2830
  }
2790
2831
  ),
2791
2832
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: chainName }),
2792
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
2833
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
2793
2834
  ] })
2794
2835
  ] }),
2795
2836
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown", children: [
@@ -2797,9 +2838,9 @@ function DepositAddressSkeleton({
2797
2838
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Supported token" }),
2798
2839
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-deposit-address-min", children: [
2799
2840
  "Min.$",
2800
- (_nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _104 => _104.minDepositUsd]), () => ( 0.1))).toFixed(2),
2801
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.Tooltip, { content: "Minimum deposit amount required for the selected chain.", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2802
- _chunkPDFLALUTcjs.InfoIcon,
2841
+ (_nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _100 => _100.minDepositUsd]), () => ( 0.1))).toFixed(2),
2842
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.Tooltip, { content: "Minimum deposit amount required for the selected chain.", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2843
+ _chunkVPWWFWZTcjs.InfoIcon,
2803
2844
  {
2804
2845
  className: "rs-deposit-address-min-icon",
2805
2846
  "aria-hidden": "true"
@@ -2817,7 +2858,7 @@ function DepositAddressSkeleton({
2817
2858
  }
2818
2859
  ),
2819
2860
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: defaultToken }),
2820
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
2861
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
2821
2862
  ] })
2822
2863
  ] })
2823
2864
  ] }),
@@ -2838,7 +2879,7 @@ function DepositAddressSkeleton({
2838
2879
  disabled: true,
2839
2880
  "aria-hidden": "true",
2840
2881
  children: [
2841
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.CopyIcon, {}),
2882
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.CopyIcon, {}),
2842
2883
  "Copy address"
2843
2884
  ]
2844
2885
  }
@@ -2851,16 +2892,16 @@ function DepositAddressSkeleton({
2851
2892
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-label", children: "Price impact" }),
2852
2893
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-label", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: "0.00%" }) }),
2853
2894
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2854
- _chunkPDFLALUTcjs.Tooltip,
2895
+ _chunkVPWWFWZTcjs.Tooltip,
2855
2896
  {
2856
2897
  className: "rs-price-impact-info",
2857
2898
  content: "Price impact is the difference between expected and execution price, due to trade size and liquidity.",
2858
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.InfoIcon, { "aria-hidden": "true" })
2899
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.InfoIcon, { "aria-hidden": "true" })
2859
2900
  }
2860
2901
  )
2861
2902
  ] }),
2862
2903
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2863
- _chunkPDFLALUTcjs.ChevronDownIcon,
2904
+ _chunkVPWWFWZTcjs.ChevronDownIcon,
2864
2905
  {
2865
2906
  className: "rs-price-impact-chevron",
2866
2907
  "aria-hidden": "true"
@@ -2868,7 +2909,7 @@ function DepositAddressSkeleton({
2868
2909
  )
2869
2910
  ] }) })
2870
2911
  ] }),
2871
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.PoweredBy, {})
2912
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.PoweredBy, {})
2872
2913
  ] });
2873
2914
  }
2874
2915
  DepositAddressSkeleton.displayName = "DepositAddressSkeleton";
@@ -2900,7 +2941,7 @@ function SolanaTokenSelectStep({
2900
2941
  setError(null);
2901
2942
  const portfolioBySymbol = {};
2902
2943
  try {
2903
- _chunkPDFLALUTcjs.debugLog.call(void 0, debug, "solana-token-select", "portfolio:request", {
2944
+ _chunkVPWWFWZTcjs.debugLog.call(void 0, debug, "solana-token-select", "portfolio:request", {
2904
2945
  solanaAddress
2905
2946
  });
2906
2947
  const portfolio = await service.fetchSolanaPortfolio(solanaAddress);
@@ -2911,7 +2952,7 @@ function SolanaTokenSelectStep({
2911
2952
  let parsed = 0n;
2912
2953
  try {
2913
2954
  parsed = BigInt(t.balance || "0");
2914
- } catch (e19) {
2955
+ } catch (e21) {
2915
2956
  parsed = 0n;
2916
2957
  }
2917
2958
  if (parsed <= 0n) continue;
@@ -2923,12 +2964,12 @@ function SolanaTokenSelectStep({
2923
2964
  };
2924
2965
  }
2925
2966
  }
2926
- _chunkPDFLALUTcjs.debugLog.call(void 0, debug, "solana-token-select", "portfolio:success", {
2967
+ _chunkVPWWFWZTcjs.debugLog.call(void 0, debug, "solana-token-select", "portfolio:success", {
2927
2968
  symbols: Object.keys(portfolioBySymbol)
2928
2969
  });
2929
2970
  } catch (err) {
2930
2971
  if (!active) return;
2931
- _chunkPDFLALUTcjs.debugError.call(void 0, debug, "solana-token-select", "portfolio:failure", err, {
2972
+ _chunkVPWWFWZTcjs.debugError.call(void 0, debug, "solana-token-select", "portfolio:failure", err, {
2932
2973
  solanaAddress
2933
2974
  });
2934
2975
  setError(
@@ -2953,7 +2994,7 @@ function SolanaTokenSelectStep({
2953
2994
  setTokenBalances(results);
2954
2995
  setLoading(false);
2955
2996
  const totalUsd = results.reduce((sum, r) => sum + r.balanceUsd, 0);
2956
- _optionalChain([onTotalBalanceComputed, 'optionalCall', _105 => _105(totalUsd)]);
2997
+ _optionalChain([onTotalBalanceComputed, 'optionalCall', _101 => _101(totalUsd)]);
2957
2998
  }
2958
2999
  void loadBalances();
2959
3000
  return () => {
@@ -2975,8 +3016,8 @@ function SolanaTokenSelectStep({
2975
3016
  const raw = _viem.formatUnits.call(void 0, entry.balance, entry.token.decimals);
2976
3017
  const numeric = Number(raw);
2977
3018
  if (!Number.isFinite(numeric)) return raw;
2978
- return _chunkPDFLALUTcjs.tokenFormatter.format(numeric);
2979
- } catch (e20) {
3019
+ return _chunkVPWWFWZTcjs.tokenFormatter.format(numeric);
3020
+ } catch (e22) {
2980
3021
  return "--";
2981
3022
  }
2982
3023
  };
@@ -2985,20 +3026,20 @@ function SolanaTokenSelectStep({
2985
3026
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
2986
3027
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
2987
3028
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2988
- _chunkPDFLALUTcjs.BodyHeader,
3029
+ _chunkVPWWFWZTcjs.BodyHeader,
2989
3030
  {
2990
- icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.WalletIcon, {}),
3031
+ icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.WalletIcon, {}),
2991
3032
  title: "Your assets",
2992
3033
  subtitle: "Select source assets to transfer"
2993
3034
  }
2994
3035
  ),
2995
3036
  loading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
2996
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.Spinner, { className: "rs-text-tertiary" }),
3037
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.Spinner, { className: "rs-text-tertiary" }),
2997
3038
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
2998
3039
  ] }),
2999
- error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.Callout, { variant: "error", children: error }),
3040
+ error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.Callout, { variant: "error", children: error }),
3000
3041
  !loading && !error && rows.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-state", children: [
3001
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.WalletIcon, { className: "rs-empty-icon" }),
3042
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.WalletIcon, { className: "rs-empty-icon" }),
3002
3043
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-empty-text", children: "No funds in connected wallet" }),
3003
3044
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-address", children: [
3004
3045
  solanaAddress.slice(0, 6),
@@ -3047,14 +3088,14 @@ function SolanaTokenSelectStep({
3047
3088
  ] })
3048
3089
  ] })
3049
3090
  ] }),
3050
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: entry.balanceUsd > 0 ? _chunkPDFLALUTcjs.currencyFormatter.format(entry.balanceUsd) : tokenAmount !== "--" ? `${tokenAmount} ${entry.token.symbol}` : "--" })
3091
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: entry.balanceUsd > 0 ? _chunkVPWWFWZTcjs.currencyFormatter.format(entry.balanceUsd) : tokenAmount !== "--" ? `${tokenAmount} ${entry.token.symbol}` : "--" })
3051
3092
  ]
3052
3093
  },
3053
3094
  entry.token.symbol
3054
3095
  );
3055
3096
  }) }),
3056
3097
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
3057
- _chunkPDFLALUTcjs.Button,
3098
+ _chunkVPWWFWZTcjs.Button,
3058
3099
  {
3059
3100
  onClick: () => selectedEntry && onContinue(
3060
3101
  selectedEntry.token,
@@ -3067,7 +3108,7 @@ function SolanaTokenSelectStep({
3067
3108
  }
3068
3109
  )
3069
3110
  ] }),
3070
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.PoweredBy, {})
3111
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.PoweredBy, {})
3071
3112
  ] });
3072
3113
  }
3073
3114
 
@@ -3100,7 +3141,7 @@ function SolanaAmountStep({
3100
3141
  const [error, setError] = _react.useState.call(void 0, null);
3101
3142
  const hasAppliedDefaultRef = _react.useRef.call(void 0, false);
3102
3143
  const isSourceStablecoin = _chunkABVRVW3Pcjs.isStablecoinSymbol.call(void 0, token.symbol);
3103
- const isMaxDefault = _optionalChain([defaultAmount, 'optionalAccess', _106 => _106.trim, 'call', _107 => _107(), 'access', _108 => _108.toLowerCase, 'call', _109 => _109()]) === "max";
3144
+ const isMaxDefault = _optionalChain([defaultAmount, 'optionalAccess', _102 => _102.trim, 'call', _103 => _103(), 'access', _104 => _104.toLowerCase, 'call', _105 => _105()]) === "max";
3104
3145
  const tokenPriceUsd = _react.useMemo.call(void 0, () => {
3105
3146
  if (isSourceStablecoin) return 1;
3106
3147
  try {
@@ -3110,7 +3151,7 @@ function SolanaAmountStep({
3110
3151
  }
3111
3152
  const price = balanceUsd / balanceUnits;
3112
3153
  return price > 0 ? price : null;
3113
- } catch (e21) {
3154
+ } catch (e23) {
3114
3155
  return null;
3115
3156
  }
3116
3157
  }, [isSourceStablecoin, balance, token.decimals, balanceUsd]);
@@ -3120,8 +3161,8 @@ function SolanaAmountStep({
3120
3161
  const raw = _viem.formatUnits.call(void 0, balance, token.decimals);
3121
3162
  const numeric = Number(raw);
3122
3163
  if (!Number.isFinite(numeric)) return raw;
3123
- return _chunkPDFLALUTcjs.tokenFormatter.format(numeric);
3124
- } catch (e22) {
3164
+ return _chunkVPWWFWZTcjs.tokenFormatter.format(numeric);
3165
+ } catch (e24) {
3125
3166
  return "\u2026";
3126
3167
  }
3127
3168
  }, [balance, token.decimals]);
@@ -3132,7 +3173,7 @@ function SolanaAmountStep({
3132
3173
  if (tokenPriceUsd !== null) return balanceUnits * tokenPriceUsd;
3133
3174
  if (Number.isFinite(balanceUsd) && balanceUsd > 0) return balanceUsd;
3134
3175
  return null;
3135
- } catch (e23) {
3176
+ } catch (e25) {
3136
3177
  return null;
3137
3178
  }
3138
3179
  }, [balance, token.decimals, tokenPriceUsd, balanceUsd]);
@@ -3146,7 +3187,7 @@ function SolanaAmountStep({
3146
3187
  if (!Number.isFinite(spendableUnits) || spendableUnits < 0) return null;
3147
3188
  if (tokenPriceUsd !== null) return spendableUnits * tokenPriceUsd;
3148
3189
  return null;
3149
- } catch (e24) {
3190
+ } catch (e26) {
3150
3191
  return null;
3151
3192
  }
3152
3193
  }, [spendableBalance, token.decimals, tokenPriceUsd]);
@@ -3161,7 +3202,7 @@ function SolanaAmountStep({
3161
3202
  const factor = 1e3;
3162
3203
  const truncated = Math.floor(value * factor) / factor;
3163
3204
  return truncated.toFixed(3).replace(/\.?0+$/, "");
3164
- } catch (e25) {
3205
+ } catch (e27) {
3165
3206
  return "";
3166
3207
  }
3167
3208
  },
@@ -3198,12 +3239,12 @@ function SolanaAmountStep({
3198
3239
  const raw = isSourceStablecoin || !hasPricing ? numericAmount : numericAmount / (_nullishCoalesce(tokenPriceUsd, () => ( 1)));
3199
3240
  try {
3200
3241
  return _viem.parseUnits.call(void 0, raw.toString(), token.decimals);
3201
- } catch (e26) {
3242
+ } catch (e28) {
3202
3243
  return null;
3203
3244
  }
3204
3245
  }, [numericAmount, isSourceStablecoin, hasPricing, tokenPriceUsd, token.decimals]);
3205
- 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));
3206
- const maxDepositUsd = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _112 => _112.maxDepositUsd]), () => ( null));
3246
+ 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));
3247
+ const maxDepositUsd = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _108 => _108.maxDepositUsd]), () => ( null));
3207
3248
  const isBelowMin = minDepositUsd !== null && numericAmount > 0 && numericAmount < minDepositUsd;
3208
3249
  const isAboveMax = maxDepositUsd !== null && numericAmount > maxDepositUsd;
3209
3250
  const exceedsBalance = Boolean(
@@ -3213,7 +3254,7 @@ function SolanaAmountStep({
3213
3254
  const handlePresetClick = (percentage) => {
3214
3255
  const formatted = computePresetAmount(percentage);
3215
3256
  if (!formatted) return;
3216
- _chunkPDFLALUTcjs.debugLog.call(void 0, debug, "solana-amount", "amount:preset", {
3257
+ _chunkVPWWFWZTcjs.debugLog.call(void 0, debug, "solana-amount", "amount:preset", {
3217
3258
  percentage,
3218
3259
  symbol: token.symbol,
3219
3260
  formatted
@@ -3247,8 +3288,8 @@ function SolanaAmountStep({
3247
3288
  let amountInUnits;
3248
3289
  try {
3249
3290
  amountInUnits = _viem.parseUnits.call(void 0, sourceAmountStr, token.decimals);
3250
- } catch (e27) {
3251
- _chunkPDFLALUTcjs.debugLog.call(void 0, debug, "solana-amount", "amount:invalid", {
3291
+ } catch (e29) {
3292
+ _chunkVPWWFWZTcjs.debugLog.call(void 0, debug, "solana-amount", "amount:invalid", {
3252
3293
  amount,
3253
3294
  sourceAmount: sourceAmountStr,
3254
3295
  reason: "parse-units-failed"
@@ -3263,7 +3304,7 @@ function SolanaAmountStep({
3263
3304
  );
3264
3305
  return;
3265
3306
  }
3266
- _chunkPDFLALUTcjs.debugLog.call(void 0, debug, "solana-amount", "amount:continue", {
3307
+ _chunkVPWWFWZTcjs.debugLog.call(void 0, debug, "solana-amount", "amount:continue", {
3267
3308
  symbol: token.symbol,
3268
3309
  inputAmountUsd: amount,
3269
3310
  sourceAmount: sourceAmountStr,
@@ -3277,7 +3318,7 @@ function SolanaAmountStep({
3277
3318
  const sourceTokenIcon = _chunkABVRVW3Pcjs.getTokenIcon.call(void 0, token.symbol);
3278
3319
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
3279
3320
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
3280
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.WalletIcon, {}), title: "Wallet deposit" }),
3321
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.WalletIcon, {}), title: "Wallet deposit" }),
3281
3322
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-section", children: [
3282
3323
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-display", children: [
3283
3324
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
@@ -3297,13 +3338,13 @@ function SolanaAmountStep({
3297
3338
  " available",
3298
3339
  computedBalanceUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
3299
3340
  " (~",
3300
- _chunkPDFLALUTcjs.currencyFormatter.format(computedBalanceUsd),
3341
+ _chunkVPWWFWZTcjs.currencyFormatter.format(computedBalanceUsd),
3301
3342
  ")"
3302
3343
  ] })
3303
3344
  ] }),
3304
3345
  minDepositUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-amount-meta-minimum", children: [
3305
3346
  "Min. deposit ",
3306
- _chunkPDFLALUTcjs.currencyFormatter.format(minDepositUsd)
3347
+ _chunkVPWWFWZTcjs.currencyFormatter.format(minDepositUsd)
3307
3348
  ] })
3308
3349
  ] })
3309
3350
  ] }),
@@ -3342,13 +3383,13 @@ function SolanaAmountStep({
3342
3383
  ] }),
3343
3384
  balanceAfterUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
3344
3385
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Balance after deposit" }),
3345
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children: _chunkPDFLALUTcjs.currencyFormatter.format(balanceAfterUsd) })
3386
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children: _chunkVPWWFWZTcjs.currencyFormatter.format(balanceAfterUsd) })
3346
3387
  ] })
3347
3388
  ] }),
3348
- targetChain === _chunkABVRVW3Pcjs.HYPERCORE_CHAIN_ID && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.Callout, { variant: "warning", children: "First deposit to a new HyperCore account includes a ~1 USDC activation fee." }),
3349
- error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.Callout, { variant: "error", children: error }),
3389
+ targetChain === _chunkABVRVW3Pcjs.HYPERCORE_CHAIN_ID && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.Callout, { variant: "warning", children: "First deposit to a new HyperCore account includes a ~1 USDC activation fee." }),
3390
+ error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.Callout, { variant: "error", children: error }),
3350
3391
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
3351
- _chunkPDFLALUTcjs.Button,
3392
+ _chunkVPWWFWZTcjs.Button,
3352
3393
  {
3353
3394
  onClick: handleContinue,
3354
3395
  fullWidth: true,
@@ -3357,7 +3398,7 @@ function SolanaAmountStep({
3357
3398
  }
3358
3399
  )
3359
3400
  ] }),
3360
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.PoweredBy, {})
3401
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.PoweredBy, {})
3361
3402
  ] });
3362
3403
  }
3363
3404
 
@@ -3380,10 +3421,10 @@ var _spltoken = require('@solana/spl-token');
3380
3421
  var DEFAULT_SOLANA_RPC_URL = "https://api.mainnet.solana.com";
3381
3422
  var cachedConnections = /* @__PURE__ */ new Map();
3382
3423
  function getSolanaRpcUrl(rpcUrls) {
3383
- return _nullishCoalesce(_chunkPDFLALUTcjs.rpcUrlFor.call(void 0, rpcUrls, "solana"), () => ( DEFAULT_SOLANA_RPC_URL));
3424
+ return _nullishCoalesce(_chunkVPWWFWZTcjs.rpcUrlFor.call(void 0, rpcUrls, "solana"), () => ( DEFAULT_SOLANA_RPC_URL));
3384
3425
  }
3385
3426
  function hasConfiguredSolanaRpcUrl(rpcUrls) {
3386
- return _chunkPDFLALUTcjs.rpcUrlFor.call(void 0, rpcUrls, "solana") !== void 0;
3427
+ return _chunkVPWWFWZTcjs.rpcUrlFor.call(void 0, rpcUrls, "solana") !== void 0;
3387
3428
  }
3388
3429
  function getSolanaConnection(rpcUrls) {
3389
3430
  const rpcUrl = getSolanaRpcUrl(rpcUrls);
@@ -3485,7 +3526,7 @@ function SolanaConfirmStep({
3485
3526
  onError,
3486
3527
  debug
3487
3528
  }) {
3488
- const rpcUrls = _chunkPDFLALUTcjs.useRpcUrls.call(void 0, );
3529
+ const rpcUrls = _chunkVPWWFWZTcjs.useRpcUrls.call(void 0, );
3489
3530
  const [isSubmitting, setIsSubmitting] = _react.useState.call(void 0, false);
3490
3531
  const [error, setError] = _react.useState.call(void 0, null);
3491
3532
  const targetSymbol = _chunkABVRVW3Pcjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain);
@@ -3495,13 +3536,13 @@ function SolanaConfirmStep({
3495
3536
  const targetChainIcon = _chunkABVRVW3Pcjs.getChainIcon.call(void 0, targetChain);
3496
3537
  const sourceTokenIcon = _chunkABVRVW3Pcjs.getTokenIcon.call(void 0, token.symbol);
3497
3538
  const targetTokenIcon = _chunkABVRVW3Pcjs.getTokenIcon.call(void 0, targetSymbol);
3498
- const feeSponsored = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _113 => _113.feeSponsored]), () => ( false));
3499
- const feeTooltip = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _114 => _114.feeTooltip]), () => ( (feeSponsored ? "Network fees are sponsored for this deposit." : "Network fees apply.")));
3500
- const formattedAmount = sourceAmount && Number.isFinite(Number(sourceAmount)) ? _nullishCoalesce(_chunkPDFLALUTcjs.formatTokenAmount.call(void 0, Number(sourceAmount), token.symbol), () => ( "0")) : "0";
3539
+ const feeSponsored = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _109 => _109.feeSponsored]), () => ( false));
3540
+ const feeTooltip = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _110 => _110.feeTooltip]), () => ( (feeSponsored ? "Network fees are sponsored for this deposit." : "Network fees apply.")));
3541
+ const formattedAmount = sourceAmount && Number.isFinite(Number(sourceAmount)) ? _nullishCoalesce(_chunkVPWWFWZTcjs.formatTokenAmount.call(void 0, Number(sourceAmount), token.symbol), () => ( "0")) : "0";
3501
3542
  const receiveDisplay = (() => {
3502
3543
  const usdValue = Number(targetAmount);
3503
3544
  const sourceAmountUsd = Number.isFinite(usdValue) && usdValue > 0 ? usdValue : void 0;
3504
- const estimate = _chunkPDFLALUTcjs.formatReceiveEstimate.call(void 0, {
3545
+ const estimate = _chunkVPWWFWZTcjs.formatReceiveEstimate.call(void 0, {
3505
3546
  sourceAmount: Number.isFinite(Number(sourceAmount)) ? Number(sourceAmount) : void 0,
3506
3547
  sourceSymbol: token.symbol,
3507
3548
  targetSymbol,
@@ -3513,7 +3554,7 @@ function SolanaConfirmStep({
3513
3554
  })();
3514
3555
  const handleConfirm = async () => {
3515
3556
  if (!solanaProvider) {
3516
- _chunkPDFLALUTcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:blocked", {
3557
+ _chunkVPWWFWZTcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:blocked", {
3517
3558
  reason: "missing-provider"
3518
3559
  });
3519
3560
  setError("Solana wallet not connected");
@@ -3521,7 +3562,7 @@ function SolanaConfirmStep({
3521
3562
  }
3522
3563
  const parsedAmount = parseFloat(sourceAmount);
3523
3564
  if (isNaN(parsedAmount) || parsedAmount <= 0) {
3524
- _chunkPDFLALUTcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:blocked", {
3565
+ _chunkVPWWFWZTcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:blocked", {
3525
3566
  reason: "invalid-amount",
3526
3567
  sourceAmount
3527
3568
  });
@@ -3530,7 +3571,7 @@ function SolanaConfirmStep({
3530
3571
  }
3531
3572
  setError(null);
3532
3573
  setIsSubmitting(true);
3533
- _chunkPDFLALUTcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:start", {
3574
+ _chunkVPWWFWZTcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:start", {
3534
3575
  smartAccount,
3535
3576
  solanaAddress,
3536
3577
  solanaDepositAddress,
@@ -3540,7 +3581,7 @@ function SolanaConfirmStep({
3540
3581
  });
3541
3582
  try {
3542
3583
  const check = await service.checkAccount(smartAccount);
3543
- _chunkPDFLALUTcjs.debugLog.call(void 0, debug, "solana-confirm", "check:success", {
3584
+ _chunkVPWWFWZTcjs.debugLog.call(void 0, debug, "solana-confirm", "check:success", {
3544
3585
  smartAccount,
3545
3586
  isRegistered: check.isRegistered,
3546
3587
  targetChain: check.targetChain,
@@ -3553,7 +3594,7 @@ function SolanaConfirmStep({
3553
3594
  }
3554
3595
  const connection = hasConfiguredSolanaRpcUrl(rpcUrls) ? getSolanaConnection(rpcUrls) : _nullishCoalesce(solanaConnection, () => ( getSolanaConnection(rpcUrls)));
3555
3596
  const amountUnits = _viem.parseUnits.call(void 0, sourceAmount, token.decimals);
3556
- _chunkPDFLALUTcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:start", {
3597
+ _chunkVPWWFWZTcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:start", {
3557
3598
  token: token.symbol,
3558
3599
  sourceAmount,
3559
3600
  amountUnits: amountUnits.toString()
@@ -3570,10 +3611,10 @@ function SolanaConfirmStep({
3570
3611
  token.mint,
3571
3612
  amountUnits
3572
3613
  );
3573
- _chunkPDFLALUTcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:success", {
3614
+ _chunkVPWWFWZTcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:success", {
3574
3615
  token: token.symbol,
3575
3616
  instructionCount: transaction.instructions.length,
3576
- feePayer: _optionalChain([transaction, 'access', _115 => _115.feePayer, 'optionalAccess', _116 => _116.toBase58, 'call', _117 => _117()]),
3617
+ feePayer: _optionalChain([transaction, 'access', _111 => _111.feePayer, 'optionalAccess', _112 => _112.toBase58, 'call', _113 => _113()]),
3577
3618
  recentBlockhash: transaction.recentBlockhash
3578
3619
  });
3579
3620
  const txHash = await sendSolanaTransaction(
@@ -3581,28 +3622,28 @@ function SolanaConfirmStep({
3581
3622
  connection,
3582
3623
  transaction
3583
3624
  );
3584
- _chunkPDFLALUTcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:sent", {
3625
+ _chunkVPWWFWZTcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:sent", {
3585
3626
  txHash,
3586
3627
  amountUnits: amountUnits.toString()
3587
3628
  });
3588
3629
  onConfirm(txHash, amountUnits.toString());
3589
3630
  } catch (err) {
3590
3631
  const raw = err instanceof Error ? err.message : "Transfer failed";
3591
- const message = _chunkPDFLALUTcjs.formatUserError.call(void 0, raw);
3592
- _chunkPDFLALUTcjs.debugError.call(void 0, debug, "solana-confirm", "submit:failure", err, {
3632
+ const message = _chunkVPWWFWZTcjs.formatUserError.call(void 0, raw);
3633
+ _chunkVPWWFWZTcjs.debugError.call(void 0, debug, "solana-confirm", "submit:failure", err, {
3593
3634
  smartAccount,
3594
3635
  token: token.symbol,
3595
3636
  sourceAmount
3596
3637
  });
3597
3638
  setError(message);
3598
- _optionalChain([onError, 'optionalCall', _118 => _118(message, "SOLANA_TRANSFER_ERROR")]);
3639
+ _optionalChain([onError, 'optionalCall', _114 => _114(message, "SOLANA_TRANSFER_ERROR")]);
3599
3640
  } finally {
3600
3641
  setIsSubmitting(false);
3601
3642
  }
3602
3643
  };
3603
3644
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
3604
3645
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
3605
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.WalletIcon, {}), title: "Review deposit" }),
3646
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.WalletIcon, {}), title: "Review deposit" }),
3606
3647
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-details", children: [
3607
3648
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
3608
3649
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Source chain" }),
@@ -3650,13 +3691,13 @@ function SolanaConfirmStep({
3650
3691
  children: "$0.04"
3651
3692
  }
3652
3693
  ),
3653
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.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, _chunkPDFLALUTcjs.InfoIcon, {}) }) })
3694
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.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, _chunkVPWWFWZTcjs.InfoIcon, {}) }) })
3654
3695
  ] })
3655
3696
  ] })
3656
3697
  ] }),
3657
- error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.Callout, { variant: "error", children: error }),
3698
+ error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.Callout, { variant: "error", children: error }),
3658
3699
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
3659
- _chunkPDFLALUTcjs.Button,
3700
+ _chunkVPWWFWZTcjs.Button,
3660
3701
  {
3661
3702
  onClick: handleConfirm,
3662
3703
  loading: isSubmitting,
@@ -3667,7 +3708,7 @@ function SolanaConfirmStep({
3667
3708
  }
3668
3709
  )
3669
3710
  ] }),
3670
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.PoweredBy, {})
3711
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.PoweredBy, {})
3671
3712
  ] });
3672
3713
  }
3673
3714
 
@@ -3681,18 +3722,18 @@ function DappImportAssetSelectStep({
3681
3722
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
3682
3723
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
3683
3724
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
3684
- _chunkPDFLALUTcjs.BodyHeader,
3725
+ _chunkVPWWFWZTcjs.BodyHeader,
3685
3726
  {
3686
- icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.WalletIcon, {}),
3727
+ icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.WalletIcon, {}),
3687
3728
  title: `Transfer from ${sourceLabel}`,
3688
3729
  subtitle: "Pick the balance to import"
3689
3730
  }
3690
3731
  ),
3691
3732
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-list", children: assets.map((asset) => {
3692
- const tokenAmount = asset.balance ? _chunkPDFLALUTcjs.tokenFormatter.format(
3733
+ const tokenAmount = asset.balance ? _chunkVPWWFWZTcjs.tokenFormatter.format(
3693
3734
  Number(asset.balance) / 10 ** asset.decimals
3694
3735
  ) : "0";
3695
- const balanceUsd = asset.balanceUsd && asset.balanceUsd > 0 ? _chunkPDFLALUTcjs.currencyFormatter.format(asset.balanceUsd) : `${tokenAmount} ${asset.symbol}`;
3736
+ const balanceUsd = asset.balanceUsd && asset.balanceUsd > 0 ? _chunkVPWWFWZTcjs.currencyFormatter.format(asset.balanceUsd) : `${tokenAmount} ${asset.symbol}`;
3696
3737
  const tokenIcon = _nullishCoalesce(asset.icon, () => ( _chunkABVRVW3Pcjs.getTokenIcon.call(void 0, asset.symbol)));
3697
3738
  const chainIcon = _chunkABVRVW3Pcjs.getChainIcon.call(void 0, asset.chainId);
3698
3739
  const badge = _chunkABVRVW3Pcjs.getChainBadge.call(void 0, asset.chainId);
@@ -3743,7 +3784,7 @@ function DappImportAssetSelectStep({
3743
3784
  );
3744
3785
  }) })
3745
3786
  ] }),
3746
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.PoweredBy, {})
3787
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.PoweredBy, {})
3747
3788
  ] });
3748
3789
  }
3749
3790
  DappImportAssetSelectStep.displayName = "DappImportAssetSelectStep";
@@ -3760,9 +3801,9 @@ function DappImportAssetSelectSkeleton({
3760
3801
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-sr-only", role: "status", children: error ? "Couldn't load balances" : "Loading balances\u2026" }),
3761
3802
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
3762
3803
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
3763
- _chunkPDFLALUTcjs.BodyHeader,
3804
+ _chunkVPWWFWZTcjs.BodyHeader,
3764
3805
  {
3765
- icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.WalletIcon, {}),
3806
+ icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.WalletIcon, {}),
3766
3807
  title: `Transfer from ${sourceLabel}`,
3767
3808
  subtitle: "Pick the balance to import"
3768
3809
  }
@@ -3800,7 +3841,7 @@ function DappImportAssetSelectSkeleton({
3800
3841
  children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Try again" })
3801
3842
  }
3802
3843
  ) }),
3803
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.PoweredBy, {})
3844
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.PoweredBy, {})
3804
3845
  ] });
3805
3846
  }
3806
3847
  DappImportAssetSelectSkeleton.displayName = "DappImportAssetSelectSkeleton";
@@ -3990,21 +4031,21 @@ var polymarketProvider = {
3990
4031
  async fetchAvailability({ eoa, getPublicClient: getPublicClient2, signal }) {
3991
4032
  const proxyWallet = await _chunkNRNJAQUAcjs.fetchPolymarketProxyWallet.call(void 0, eoa, signal);
3992
4033
  if (!proxyWallet) return null;
3993
- if (_optionalChain([signal, 'optionalAccess', _119 => _119.aborted])) return null;
4034
+ if (_optionalChain([signal, 'optionalAccess', _115 => _115.aborted])) return null;
3994
4035
  const polygonClient = getPublicClient2(_chunkNRNJAQUAcjs.POLYMARKET_POLYGON_CHAIN_ID);
3995
4036
  if (!polygonClient) return null;
3996
4037
  const balances = await _chunkNRNJAQUAcjs.readPolymarketBalances.call(void 0, {
3997
4038
  publicClient: polygonClient,
3998
4039
  proxyWallet
3999
4040
  });
4000
- if (_optionalChain([signal, 'optionalAccess', _120 => _120.aborted])) return null;
4041
+ if (_optionalChain([signal, 'optionalAccess', _116 => _116.aborted])) return null;
4001
4042
  if (balances.pusd === 0n && balances.usdce === 0n) return null;
4002
4043
  const walletKind = await detectPolymarketWalletKind({
4003
4044
  publicClient: polygonClient,
4004
4045
  proxyWallet,
4005
4046
  eoa
4006
4047
  });
4007
- if (_optionalChain([signal, 'optionalAccess', _121 => _121.aborted])) return null;
4048
+ if (_optionalChain([signal, 'optionalAccess', _117 => _117.aborted])) return null;
4008
4049
  if (!walletKind) return null;
4009
4050
  const assets = [];
4010
4051
  if (balances.pusd > 0n) {
@@ -4105,6 +4146,68 @@ function getEnabledProviders(config) {
4105
4146
  );
4106
4147
  }
4107
4148
 
4149
+ // src/store/state.ts
4150
+ function portfolioKey(network, address) {
4151
+ return network === "evm" ? `evm:${address.toLowerCase()}` : `solana:${address}`;
4152
+ }
4153
+ function createInitialState(overrides) {
4154
+ return {
4155
+ flow: {
4156
+ step: "connect",
4157
+ mode: null,
4158
+ isConnectSelectionConfirmed: false,
4159
+ hasNavigatedBack: false
4160
+ },
4161
+ wallet: {
4162
+ selectedWalletId: null
4163
+ },
4164
+ deposit: {
4165
+ targetChain: overrides.targetChain,
4166
+ targetToken: overrides.targetToken,
4167
+ sourceChain: null,
4168
+ sourceToken: null,
4169
+ sourceSymbol: null,
4170
+ sourceDecimals: null,
4171
+ selectedAsset: null,
4172
+ selectedSolanaToken: null,
4173
+ amount: null,
4174
+ targetAmount: null,
4175
+ targetTokenPriceUsd: null,
4176
+ balance: null,
4177
+ balanceUsd: null,
4178
+ inputAmountUsd: null,
4179
+ liquidityWarning: null
4180
+ },
4181
+ processing: {
4182
+ txHash: null,
4183
+ directTransfer: false,
4184
+ swappedContext: null,
4185
+ initialEvent: null
4186
+ },
4187
+ dappImport: {
4188
+ activeProviderId: null,
4189
+ availabilityOwner: null,
4190
+ availability: {},
4191
+ selectedAsset: null,
4192
+ bootError: false,
4193
+ attemptNonce: 0
4194
+ },
4195
+ setup: {
4196
+ byOwner: {}
4197
+ },
4198
+ portfolio: {
4199
+ byKey: {},
4200
+ nextRequestId: 0
4201
+ },
4202
+ fiat: {
4203
+ selectedMethod: null
4204
+ },
4205
+ exchange: {
4206
+ selectedConnection: null
4207
+ }
4208
+ };
4209
+ }
4210
+
4108
4211
  // src/store/selectors.ts
4109
4212
  var selectedWalletIdSelector = (state) => state.wallet.selectedWalletId;
4110
4213
  var IDLE_SETUP_ENTRY = {
@@ -4124,12 +4227,16 @@ function readSetupForOwner(setup, owner) {
4124
4227
  const entry = setup.byOwner[owner.toLowerCase()];
4125
4228
  return _nullishCoalesce(entry, () => ( { ...IDLE_SETUP_ENTRY, owner }));
4126
4229
  }
4230
+ function readPortfolioEntry(portfolio, network, address) {
4231
+ if (!address) return void 0;
4232
+ return portfolio.byKey[portfolioKey(network, address)];
4233
+ }
4127
4234
 
4128
4235
  // src/core/dapp-imports/status.ts
4129
4236
  function computeDappImportStatus(providerId, inputs) {
4130
4237
  const { owner, availability, availabilityOwner, setup } = inputs;
4131
4238
  if (!owner) return "needs-connect";
4132
- const entry = _optionalChain([availabilityOwner, 'optionalAccess', _122 => _122.toLowerCase, 'call', _123 => _123()]) === owner.toLowerCase() ? availability[providerId] : void 0;
4239
+ const entry = _optionalChain([availabilityOwner, 'optionalAccess', _118 => _118.toLowerCase, 'call', _119 => _119()]) === owner.toLowerCase() ? availability[providerId] : void 0;
4133
4240
  if (entry === "loading" || entry === void 0) return "loading";
4134
4241
  if (entry === "error") {
4135
4242
  return {
@@ -4483,12 +4590,12 @@ function applyAction(state, action) {
4483
4590
  requestKey: action.requestKey,
4484
4591
  cacheKey: action.cacheKey,
4485
4592
  status: "loading",
4486
- smartAccount: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _124 => _124.smartAccount]), () => ( null)),
4487
- sessionOwnerAddress: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _125 => _125.sessionOwnerAddress]), () => ( null)),
4488
- solanaDepositAddress: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _126 => _126.solanaDepositAddress]), () => ( null)),
4593
+ smartAccount: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _120 => _120.smartAccount]), () => ( null)),
4594
+ sessionOwnerAddress: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _121 => _121.sessionOwnerAddress]), () => ( null)),
4595
+ solanaDepositAddress: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _122 => _122.solanaDepositAddress]), () => ( null)),
4489
4596
  message: null,
4490
4597
  cacheable: action.cacheable,
4491
- attemptNonce: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _127 => _127.attemptNonce]), () => ( 0))
4598
+ attemptNonce: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _123 => _123.attemptNonce]), () => ( 0))
4492
4599
  }));
4493
4600
  }
4494
4601
  case "setup/ready": {
@@ -4531,6 +4638,79 @@ function applyAction(state, action) {
4531
4638
  message: null,
4532
4639
  attemptNonce: entry.attemptNonce + 1
4533
4640
  }));
4641
+ case "portfolio/loading": {
4642
+ const key = portfolioKey(action.network, action.address);
4643
+ const requestId = state.portfolio.nextRequestId + 1;
4644
+ return {
4645
+ ...state,
4646
+ portfolio: {
4647
+ nextRequestId: requestId,
4648
+ byKey: {
4649
+ ...state.portfolio.byKey,
4650
+ [key]: { status: "loading", requestId, totalUsd: null }
4651
+ }
4652
+ }
4653
+ };
4654
+ }
4655
+ case "portfolio/reconciled": {
4656
+ const retainedKeys = new Set(
4657
+ action.wallets.map(
4658
+ ({ network, address }) => portfolioKey(network, address)
4659
+ )
4660
+ );
4661
+ const entries = Object.entries(state.portfolio.byKey);
4662
+ const retainedEntries = entries.filter(([key]) => retainedKeys.has(key));
4663
+ if (retainedEntries.length === entries.length) return state;
4664
+ return {
4665
+ ...state,
4666
+ portfolio: {
4667
+ ...state.portfolio,
4668
+ byKey: Object.fromEntries(retainedEntries)
4669
+ }
4670
+ };
4671
+ }
4672
+ case "portfolio/loaded": {
4673
+ const key = portfolioKey(action.network, action.address);
4674
+ const existing = state.portfolio.byKey[key];
4675
+ if (!existing || existing.status !== "loading" || existing.requestId !== action.requestId) {
4676
+ return state;
4677
+ }
4678
+ return {
4679
+ ...state,
4680
+ portfolio: {
4681
+ ...state.portfolio,
4682
+ byKey: {
4683
+ ...state.portfolio.byKey,
4684
+ [key]: {
4685
+ status: "ready",
4686
+ requestId: action.requestId,
4687
+ totalUsd: action.totalUsd
4688
+ }
4689
+ }
4690
+ }
4691
+ };
4692
+ }
4693
+ case "portfolio/failed": {
4694
+ const key = portfolioKey(action.network, action.address);
4695
+ const existing = state.portfolio.byKey[key];
4696
+ if (!existing || existing.status !== "loading" || existing.requestId !== action.requestId) {
4697
+ return state;
4698
+ }
4699
+ return {
4700
+ ...state,
4701
+ portfolio: {
4702
+ ...state.portfolio,
4703
+ byKey: {
4704
+ ...state.portfolio.byKey,
4705
+ [key]: {
4706
+ status: "error",
4707
+ requestId: action.requestId,
4708
+ totalUsd: existing.totalUsd
4709
+ }
4710
+ }
4711
+ }
4712
+ };
4713
+ }
4534
4714
  case "asset/selected":
4535
4715
  return {
4536
4716
  ...state,
@@ -4611,7 +4791,8 @@ function applyAction(state, action) {
4611
4791
  ...state.processing,
4612
4792
  txHash: action.txHash,
4613
4793
  directTransfer: _nullishCoalesce(action.directTransfer, () => ( false)),
4614
- swappedContext: _nullishCoalesce(action.swappedContext, () => ( null))
4794
+ swappedContext: _nullishCoalesce(action.swappedContext, () => ( null)),
4795
+ initialEvent: _nullishCoalesce(action.initialEvent, () => ( null))
4615
4796
  },
4616
4797
  flow: { ...state.flow, step: "processing" }
4617
4798
  };
@@ -4781,7 +4962,8 @@ function applyAction(state, action) {
4781
4962
  processing: {
4782
4963
  txHash: null,
4783
4964
  directTransfer: false,
4784
- swappedContext: null
4965
+ swappedContext: null,
4966
+ initialEvent: null
4785
4967
  },
4786
4968
  // Drop fetched availability wholesale. The fetch effect refetches
4787
4969
  // unconditionally on remount (so keeping the map saves nothing),
@@ -4797,6 +4979,13 @@ function applyAction(state, action) {
4797
4979
  attemptNonce: 0
4798
4980
  },
4799
4981
  setup: { byOwner: preservedByOwner },
4982
+ // Ephemeral fetched balances — drop wholesale on close so a reopen
4983
+ // refetches rather than surfacing a stale balance (same hazard the
4984
+ // dappImport drop above guards against).
4985
+ portfolio: {
4986
+ byKey: {},
4987
+ nextRequestId: state.portfolio.nextRequestId
4988
+ },
4800
4989
  fiat: { selectedMethod: null },
4801
4990
  exchange: { selectedConnection: null }
4802
4991
  };
@@ -4831,60 +5020,6 @@ function applyAction(state, action) {
4831
5020
  }
4832
5021
  }
4833
5022
 
4834
- // src/store/state.ts
4835
- function createInitialState(overrides) {
4836
- return {
4837
- flow: {
4838
- step: "connect",
4839
- mode: null,
4840
- isConnectSelectionConfirmed: false,
4841
- hasNavigatedBack: false
4842
- },
4843
- wallet: {
4844
- selectedWalletId: null
4845
- },
4846
- deposit: {
4847
- targetChain: overrides.targetChain,
4848
- targetToken: overrides.targetToken,
4849
- sourceChain: null,
4850
- sourceToken: null,
4851
- sourceSymbol: null,
4852
- sourceDecimals: null,
4853
- selectedAsset: null,
4854
- selectedSolanaToken: null,
4855
- amount: null,
4856
- targetAmount: null,
4857
- targetTokenPriceUsd: null,
4858
- balance: null,
4859
- balanceUsd: null,
4860
- inputAmountUsd: null,
4861
- liquidityWarning: null
4862
- },
4863
- processing: {
4864
- txHash: null,
4865
- directTransfer: false,
4866
- swappedContext: null
4867
- },
4868
- dappImport: {
4869
- activeProviderId: null,
4870
- availabilityOwner: null,
4871
- availability: {},
4872
- selectedAsset: null,
4873
- bootError: false,
4874
- attemptNonce: 0
4875
- },
4876
- setup: {
4877
- byOwner: {}
4878
- },
4879
- fiat: {
4880
- selectedMethod: null
4881
- },
4882
- exchange: {
4883
- selectedConnection: null
4884
- }
4885
- };
4886
- }
4887
-
4888
5023
  // src/store/index.ts
4889
5024
  function createDepositStore(overrides) {
4890
5025
  const store = _vanilla.createStore.call(void 0, () => createInitialState(overrides));
@@ -4929,15 +5064,15 @@ var SetupError = class extends Error {
4929
5064
  }
4930
5065
  };
4931
5066
  async function resolveSessionOwner(eoaAddress) {
4932
- const local = _chunkPDFLALUTcjs.loadSessionOwnerFromStorage.call(void 0, eoaAddress);
5067
+ const local = _chunkVPWWFWZTcjs.loadSessionOwnerFromStorage.call(void 0, eoaAddress);
4933
5068
  if (local) {
4934
5069
  return {
4935
- account: _chunkPDFLALUTcjs.accountFromPrivateKey.call(void 0, local.privateKey),
5070
+ account: _chunkVPWWFWZTcjs.accountFromPrivateKey.call(void 0, local.privateKey),
4936
5071
  address: local.address
4937
5072
  };
4938
5073
  }
4939
- const created = _chunkPDFLALUTcjs.createSessionOwnerKey.call(void 0, );
4940
- _chunkPDFLALUTcjs.saveSessionOwnerToStorage.call(void 0, eoaAddress, created.privateKey, created.address);
5074
+ const created = _chunkVPWWFWZTcjs.createSessionOwnerKey.call(void 0, );
5075
+ _chunkVPWWFWZTcjs.saveSessionOwnerToStorage.call(void 0, eoaAddress, created.privateKey, created.address);
4941
5076
  return { account: created.account, address: created.address };
4942
5077
  }
4943
5078
  function stableStringify(value) {
@@ -4968,8 +5103,7 @@ function computeRequestKey(input, sessionOwnerAddress) {
4968
5103
  signerAddress: input.signerAddress.toLowerCase(),
4969
5104
  sessionChainIds: _nullishCoalesce(input.sessionChainIds, () => ( null)),
4970
5105
  enableSolana: _nullishCoalesce(input.enableSolana, () => ( true)),
4971
- forceRegister: _nullishCoalesce(input.forceRegister, () => ( false)),
4972
- postBridgeActions: _nullishCoalesce(input.postBridgeActions, () => ( null))
5106
+ forceRegister: _nullishCoalesce(input.forceRegister, () => ( false))
4973
5107
  });
4974
5108
  }
4975
5109
  function computeCacheKey(input, sessionOwnerAddress) {
@@ -4987,14 +5121,14 @@ function computeCacheKey(input, sessionOwnerAddress) {
4987
5121
  });
4988
5122
  }
4989
5123
  function computeIsCacheable(input) {
4990
- return !input.forceRegister && !(_nullishCoalesce(_optionalChain([input, 'access', _128 => _128.postBridgeActions, 'optionalAccess', _129 => _129.length]), () => ( 0)));
5124
+ return !input.forceRegister;
4991
5125
  }
4992
5126
  var SETUP_REQUEST_DEDUPE_TTL_MS = 3e4;
4993
5127
  var setupRequestDedupe = /* @__PURE__ */ new Map();
4994
5128
  function readDedupedAccountSetupResult(requestKey) {
4995
5129
  const now = Date.now();
4996
5130
  const existing = setupRequestDedupe.get(requestKey);
4997
- if (_optionalChain([existing, 'optionalAccess', _130 => _130.settled]) && existing.expiresAt > now && existing.result) {
5131
+ if (_optionalChain([existing, 'optionalAccess', _124 => _124.settled]) && existing.expiresAt > now && existing.result) {
4998
5132
  return existing.result;
4999
5133
  }
5000
5134
  return null;
@@ -5005,10 +5139,9 @@ async function runAccountSetup(input, deps) {
5005
5139
  try {
5006
5140
  const sessionOwner = await resolveSessionOwner(input.ownerAddress);
5007
5141
  const cacheKey = computeCacheKey(input, sessionOwner.address);
5008
- _chunkPDFLALUTcjs.debugLog.call(void 0, debug, "account-setup", "setup:start", {
5142
+ _chunkVPWWFWZTcjs.debugLog.call(void 0, debug, "account-setup", "setup:start", {
5009
5143
  owner: input.ownerAddress,
5010
5144
  sessionOwner: sessionOwner.address,
5011
- hasPostBridgeActions: Boolean(_optionalChain([input, 'access', _131 => _131.postBridgeActions, 'optionalAccess', _132 => _132.length])),
5012
5145
  forceRegister: _nullishCoalesce(input.forceRegister, () => ( false))
5013
5146
  });
5014
5147
  const setup = await service.setupAccount({
@@ -5017,7 +5150,6 @@ async function runAccountSetup(input, deps) {
5017
5150
  targetChain: _chunkABVRVW3Pcjs.targetChainToCaip2.call(void 0, input.targetChain),
5018
5151
  targetToken: input.targetToken,
5019
5152
  recipient: input.recipient,
5020
- postBridgeActions: input.postBridgeActions,
5021
5153
  outputTokenRules: input.outputTokenRules,
5022
5154
  rejectUnmapped: input.rejectUnmapped,
5023
5155
  signerAddress: input.signerAddress,
@@ -5053,7 +5185,7 @@ async function runAccountSetup(input, deps) {
5053
5185
  primaryType: typedData.primaryType,
5054
5186
  message: typedData.message
5055
5187
  });
5056
- const sessionDetails = _chunkPDFLALUTcjs.buildSessionDetails.call(void 0,
5188
+ const sessionDetails = _chunkVPWWFWZTcjs.buildSessionDetails.call(void 0,
5057
5189
  setup.sessionDetailsUnsigned,
5058
5190
  signature
5059
5191
  );
@@ -5070,10 +5202,7 @@ async function runAccountSetup(input, deps) {
5070
5202
  chain: _chunkABVRVW3Pcjs.targetChainToCaip2.call(void 0, input.targetChain),
5071
5203
  token: input.targetToken,
5072
5204
  ...input.recipient && { recipient: input.recipient },
5073
- ..._optionalChain([input, 'access', _133 => _133.postBridgeActions, 'optionalAccess', _134 => _134.length]) && {
5074
- postBridgeActions: input.postBridgeActions
5075
- },
5076
- ..._optionalChain([input, 'access', _135 => _135.outputTokenRules, 'optionalAccess', _136 => _136.length]) && {
5205
+ ..._optionalChain([input, 'access', _125 => _125.outputTokenRules, 'optionalAccess', _126 => _126.length]) && {
5077
5206
  outputTokenRules: input.outputTokenRules
5078
5207
  },
5079
5208
  ...input.rejectUnmapped != null && {
@@ -5089,7 +5218,7 @@ async function runAccountSetup(input, deps) {
5089
5218
  isRegistered: true
5090
5219
  };
5091
5220
  } catch (error) {
5092
- _chunkPDFLALUTcjs.debugError.call(void 0, debug, "account-setup", "setup:failed", error, {
5221
+ _chunkVPWWFWZTcjs.debugError.call(void 0, debug, "account-setup", "setup:failed", error, {
5093
5222
  owner: input.ownerAddress
5094
5223
  });
5095
5224
  if (error instanceof SetupError) throw error;
@@ -5100,7 +5229,7 @@ function runAccountSetupDeduped(input, deps, requestKey) {
5100
5229
  const now = Date.now();
5101
5230
  const existing = setupRequestDedupe.get(requestKey);
5102
5231
  if (existing && (!existing.settled || existing.expiresAt > now)) {
5103
- _chunkPDFLALUTcjs.debugLog.call(void 0, deps.debug, "account-setup", "setup:dedupe-hit", {
5232
+ _chunkVPWWFWZTcjs.debugLog.call(void 0, deps.debug, "account-setup", "setup:dedupe-hit", {
5104
5233
  owner: input.ownerAddress,
5105
5234
  forceRegister: _nullishCoalesce(input.forceRegister, () => ( false))
5106
5235
  });
@@ -5330,7 +5459,8 @@ function deriveStep(flow, d, p, activeEntry, fiat, exchange) {
5330
5459
  sourceDecimals: _nullishCoalesce(d.sourceDecimals, () => ( void 0)),
5331
5460
  inputAmountUsd: _nullishCoalesce(d.inputAmountUsd, () => ( void 0)),
5332
5461
  directTransfer: p.directTransfer,
5333
- swappedContext: _nullishCoalesce(p.swappedContext, () => ( void 0))
5462
+ swappedContext: _nullishCoalesce(p.swappedContext, () => ( void 0)),
5463
+ initialEvent: _nullishCoalesce(p.initialEvent, () => ( void 0))
5334
5464
  };
5335
5465
  }
5336
5466
  }
@@ -5362,7 +5492,6 @@ function DepositFlow({
5362
5492
  amount: defaultAmount,
5363
5493
  recipient,
5364
5494
  appBalanceUsd,
5365
- postBridgeActions,
5366
5495
  outputTokenRules,
5367
5496
  rejectUnmapped,
5368
5497
  signerAddress = _chunkABVRVW3Pcjs.DEFAULT_SIGNER_ADDRESS,
@@ -5388,16 +5517,17 @@ function DepositFlow({
5388
5517
  onError,
5389
5518
  debug
5390
5519
  }) {
5391
- const rpcUrls = _chunkPDFLALUTcjs.useRpcUrls.call(void 0, );
5392
- const onStepChangeRef = _chunkPDFLALUTcjs.useLatestRef.call(void 0, onStepChange);
5393
- const onEventRef = _chunkPDFLALUTcjs.useLatestRef.call(void 0, onEvent);
5394
- const onLifecycleRef = _chunkPDFLALUTcjs.useLatestRef.call(void 0, onLifecycle);
5395
- const onErrorRef = _chunkPDFLALUTcjs.useLatestRef.call(void 0, onError);
5520
+ const rpcUrls = _chunkVPWWFWZTcjs.useRpcUrls.call(void 0, );
5521
+ const onStepChangeRef = _chunkVPWWFWZTcjs.useLatestRef.call(void 0, onStepChange);
5522
+ const onEventRef = _chunkVPWWFWZTcjs.useLatestRef.call(void 0, onEvent);
5523
+ const onLifecycleRef = _chunkVPWWFWZTcjs.useLatestRef.call(void 0, onLifecycle);
5524
+ const onErrorRef = _chunkVPWWFWZTcjs.useLatestRef.call(void 0, onError);
5396
5525
  const storeApi = useDepositStoreApi();
5397
5526
  const flowSlice = useDepositStore((s) => s.flow);
5398
5527
  const depositSlice = useDepositStore((s) => s.deposit);
5399
5528
  const processingSlice = useDepositStore((s) => s.processing);
5400
5529
  const setupSlice = useDepositStore((s) => s.setup);
5530
+ const portfolioSlice = useDepositStore((s) => s.portfolio);
5401
5531
  const fiatSlice = useDepositStore((s) => s.fiat);
5402
5532
  const exchangeSlice = useDepositStore((s) => s.exchange);
5403
5533
  const flowMode = flowSlice.mode;
@@ -5408,23 +5538,42 @@ function DepositFlow({
5408
5538
  const stableWalletSelectionKeyRef = _react.useRef.call(void 0, null);
5409
5539
  const logFlow = _react.useCallback.call(void 0,
5410
5540
  (message, data) => {
5411
- _chunkPDFLALUTcjs.debugLog.call(void 0, debug, "deposit-flow", message, data);
5541
+ _chunkVPWWFWZTcjs.debugLog.call(void 0, debug, "deposit-flow", message, data);
5412
5542
  },
5413
5543
  [debug]
5414
5544
  );
5415
5545
  const logFlowError = _react.useCallback.call(void 0,
5416
5546
  (message, error, data) => {
5417
- _chunkPDFLALUTcjs.debugError.call(void 0, debug, "deposit-flow", message, error, data);
5547
+ _chunkVPWWFWZTcjs.debugError.call(void 0, debug, "deposit-flow", message, error, data);
5418
5548
  },
5419
5549
  [debug]
5420
5550
  );
5551
+ const enableSwappedPreconnect = enableFiatOnramp || enableExchangeConnect;
5552
+ _react.useEffect.call(void 0, () => {
5553
+ if (!enableSwappedPreconnect) return;
5554
+ if (typeof document === "undefined") return;
5555
+ const links = [];
5556
+ for (const origin of SWAPPED_ORIGINS) {
5557
+ for (const rel of ["preconnect", "dns-prefetch"]) {
5558
+ const link = document.createElement("link");
5559
+ link.rel = rel;
5560
+ link.href = origin;
5561
+ link.dataset.rsSwappedPreconnect = "";
5562
+ document.head.appendChild(link);
5563
+ links.push(link);
5564
+ }
5565
+ }
5566
+ return () => {
5567
+ for (const link of links) link.remove();
5568
+ };
5569
+ }, [enableSwappedPreconnect]);
5421
5570
  const dappSwitchChain = _react.useMemo.call(void 0, () => {
5422
- if (!_optionalChain([dappWalletClient, 'optionalAccess', _137 => _137.switchChain])) return void 0;
5571
+ if (!_optionalChain([dappWalletClient, 'optionalAccess', _127 => _127.switchChain])) return void 0;
5423
5572
  return async (chainId) => {
5424
- await _optionalChain([dappWalletClient, 'access', _138 => _138.switchChain, 'optionalCall', _139 => _139({ id: chainId })]);
5573
+ await _optionalChain([dappWalletClient, 'access', _128 => _128.switchChain, 'optionalCall', _129 => _129({ id: chainId })]);
5425
5574
  };
5426
5575
  }, [dappWalletClient]);
5427
- const connectedWalletAddress = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess', _140 => _140.account, 'optionalAccess', _141 => _141.address]), () => ( null));
5576
+ const connectedWalletAddress = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess', _130 => _130.account, 'optionalAccess', _131 => _131.address]), () => ( null));
5428
5577
  const walletOptions = _react.useMemo.call(void 0, () => {
5429
5578
  const options = [];
5430
5579
  const seen = /* @__PURE__ */ new Set();
@@ -5438,7 +5587,7 @@ function DepositFlow({
5438
5587
  });
5439
5588
  seen.add(id);
5440
5589
  }
5441
- if (enableSolana && _optionalChain([reownWallet, 'optionalAccess', _142 => _142.isConnected]) && reownWallet.isSolana && reownWallet.solanaAddress && dappAddress) {
5590
+ if (enableSolana && _optionalChain([reownWallet, 'optionalAccess', _132 => _132.isConnected]) && reownWallet.isSolana && reownWallet.solanaAddress && dappAddress) {
5442
5591
  const id = _nullishCoalesce(reownWallet.caipAddress, () => ( `solana:${reownWallet.solanaAddress}`));
5443
5592
  if (!seen.has(id)) {
5444
5593
  options.push({
@@ -5450,7 +5599,7 @@ function DepositFlow({
5450
5599
  });
5451
5600
  seen.add(id);
5452
5601
  }
5453
- } else if (_optionalChain([reownWallet, 'optionalAccess', _143 => _143.address]) && reownWallet.isConnected && reownWallet.walletClient && reownWallet.publicClient && !seen.has(`evm:${reownWallet.address.toLowerCase()}`)) {
5602
+ } else if (_optionalChain([reownWallet, 'optionalAccess', _133 => _133.address]) && reownWallet.isConnected && reownWallet.walletClient && reownWallet.publicClient && !seen.has(`evm:${reownWallet.address.toLowerCase()}`)) {
5454
5603
  const id = `evm:${reownWallet.address.toLowerCase()}`;
5455
5604
  if (!seen.has(id)) {
5456
5605
  options.push({
@@ -5467,20 +5616,20 @@ function DepositFlow({
5467
5616
  }, [
5468
5617
  connectedWalletAddress,
5469
5618
  dappAddress,
5470
- _optionalChain([reownWallet, 'optionalAccess', _144 => _144.address]),
5471
- _optionalChain([reownWallet, 'optionalAccess', _145 => _145.isConnected]),
5472
- _optionalChain([reownWallet, 'optionalAccess', _146 => _146.walletClient]),
5473
- _optionalChain([reownWallet, 'optionalAccess', _147 => _147.publicClient]),
5474
- _optionalChain([reownWallet, 'optionalAccess', _148 => _148.icon]),
5619
+ _optionalChain([reownWallet, 'optionalAccess', _134 => _134.address]),
5620
+ _optionalChain([reownWallet, 'optionalAccess', _135 => _135.isConnected]),
5621
+ _optionalChain([reownWallet, 'optionalAccess', _136 => _136.walletClient]),
5622
+ _optionalChain([reownWallet, 'optionalAccess', _137 => _137.publicClient]),
5623
+ _optionalChain([reownWallet, 'optionalAccess', _138 => _138.icon]),
5475
5624
  enableSolana,
5476
- _optionalChain([reownWallet, 'optionalAccess', _149 => _149.isSolana]),
5477
- _optionalChain([reownWallet, 'optionalAccess', _150 => _150.solanaAddress]),
5478
- _optionalChain([reownWallet, 'optionalAccess', _151 => _151.caipAddress])
5625
+ _optionalChain([reownWallet, 'optionalAccess', _139 => _139.isSolana]),
5626
+ _optionalChain([reownWallet, 'optionalAccess', _140 => _140.solanaAddress]),
5627
+ _optionalChain([reownWallet, 'optionalAccess', _141 => _141.caipAddress])
5479
5628
  ]);
5480
- const canAutoLock = _optionalChain([dappWalletClient, 'optionalAccess', _152 => _152.account]) && dappAddress && !reownWallet && !enableFiatOnramp && !enableExchangeConnect;
5629
+ const canAutoLock = _optionalChain([dappWalletClient, 'optionalAccess', _142 => _142.account]) && dappAddress && !reownWallet && !enableFiatOnramp && !enableExchangeConnect;
5481
5630
  const hasWalletOptions = walletOptions.length > 0;
5482
5631
  const hasReownSession = Boolean(
5483
- enableSolana ? _optionalChain([reownWallet, 'optionalAccess', _153 => _153.isConnected]) || _optionalChain([reownWallet, 'optionalAccess', _154 => _154.address]) : _optionalChain([reownWallet, 'optionalAccess', _155 => _155.address])
5632
+ enableSolana ? _optionalChain([reownWallet, 'optionalAccess', _143 => _143.isConnected]) || _optionalChain([reownWallet, 'optionalAccess', _144 => _144.address]) : _optionalChain([reownWallet, 'optionalAccess', _145 => _145.address])
5484
5633
  );
5485
5634
  const isDappImportWalletHydrating = Boolean(
5486
5635
  hasDappWalletClientProp && dappWalletClient === void 0 || reownWallet && !hasReownSession && !reownWallet.isReady
@@ -5528,16 +5677,16 @@ function DepositFlow({
5528
5677
  return {
5529
5678
  ownerAddress: dappAddress,
5530
5679
  walletClient: void 0,
5531
- publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkPDFLALUTcjs.getPublicClient.call(void 0, setupChainId, rpcUrls))),
5680
+ publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkVPWWFWZTcjs.getPublicClient.call(void 0, setupChainId, rpcUrls))),
5532
5681
  switchChain: void 0
5533
5682
  };
5534
5683
  }
5535
5684
  if (canAutoLock) {
5536
- const fallbackChainId = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess', _156 => _156.chain, 'optionalAccess', _157 => _157.id]), () => ( setupChainId));
5685
+ const fallbackChainId = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess', _146 => _146.chain, 'optionalAccess', _147 => _147.id]), () => ( setupChainId));
5537
5686
  return {
5538
5687
  ownerAddress: dappWalletClient.account.address,
5539
5688
  walletClient: dappWalletClient,
5540
- publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkPDFLALUTcjs.getPublicClient.call(void 0, fallbackChainId, rpcUrls))),
5689
+ publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkVPWWFWZTcjs.getPublicClient.call(void 0, fallbackChainId, rpcUrls))),
5541
5690
  switchChain: dappSwitchChain
5542
5691
  };
5543
5692
  }
@@ -5551,24 +5700,24 @@ function DepositFlow({
5551
5700
  return {
5552
5701
  ownerAddress: dappAddress,
5553
5702
  walletClient: void 0,
5554
- publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkPDFLALUTcjs.getPublicClient.call(void 0, setupChainId, rpcUrls))),
5703
+ publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkVPWWFWZTcjs.getPublicClient.call(void 0, setupChainId, rpcUrls))),
5555
5704
  switchChain: void 0
5556
5705
  };
5557
5706
  }
5558
- if (selectedOption.kind === "connected" && _optionalChain([dappWalletClient, 'optionalAccess', _158 => _158.account]) && selectedOption.address && dappWalletClient.account.address.toLowerCase() === selectedOption.address.toLowerCase()) {
5559
- const fallbackChainId = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess', _159 => _159.chain, 'optionalAccess', _160 => _160.id]), () => ( setupChainId));
5707
+ if (selectedOption.kind === "connected" && _optionalChain([dappWalletClient, 'optionalAccess', _148 => _148.account]) && selectedOption.address && dappWalletClient.account.address.toLowerCase() === selectedOption.address.toLowerCase()) {
5708
+ const fallbackChainId = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess', _149 => _149.chain, 'optionalAccess', _150 => _150.id]), () => ( setupChainId));
5560
5709
  return {
5561
5710
  ownerAddress: dappWalletClient.account.address,
5562
5711
  walletClient: dappWalletClient,
5563
- publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkPDFLALUTcjs.getPublicClient.call(void 0, fallbackChainId, rpcUrls))),
5712
+ publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkVPWWFWZTcjs.getPublicClient.call(void 0, fallbackChainId, rpcUrls))),
5564
5713
  switchChain: dappSwitchChain
5565
5714
  };
5566
5715
  }
5567
- if (selectedOption.kind === "external" && _optionalChain([reownWallet, 'optionalAccess', _161 => _161.address]) && selectedOption.address && reownWallet.address.toLowerCase() === selectedOption.address.toLowerCase()) {
5716
+ if (selectedOption.kind === "external" && _optionalChain([reownWallet, 'optionalAccess', _151 => _151.address]) && selectedOption.address && reownWallet.address.toLowerCase() === selectedOption.address.toLowerCase()) {
5568
5717
  return {
5569
5718
  ownerAddress: reownWallet.address,
5570
5719
  walletClient: reownWallet.walletClient,
5571
- publicClient: _nullishCoalesce(reownWallet.publicClient, () => ( _chunkPDFLALUTcjs.getPublicClient.call(void 0, setupChainId, rpcUrls))),
5720
+ publicClient: _nullishCoalesce(reownWallet.publicClient, () => ( _chunkVPWWFWZTcjs.getPublicClient.call(void 0, setupChainId, rpcUrls))),
5572
5721
  switchChain: reownWallet.switchChain
5573
5722
  };
5574
5723
  }
@@ -5607,7 +5756,7 @@ function DepositFlow({
5607
5756
  return {
5608
5757
  ownerAddress: dappAddress,
5609
5758
  walletClient: void 0,
5610
- publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkPDFLALUTcjs.getPublicClient.call(void 0, setupChainId, rpcUrls))),
5759
+ publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkVPWWFWZTcjs.getPublicClient.call(void 0, setupChainId, rpcUrls))),
5611
5760
  switchChain: void 0
5612
5761
  };
5613
5762
  }
@@ -5632,37 +5781,37 @@ function DepositFlow({
5632
5781
  const selectedEvmWalletOwner = _react.useMemo.call(void 0, () => {
5633
5782
  if (!selectedWalletId) return null;
5634
5783
  const opt = walletOptions.find((o) => o.id === selectedWalletId);
5635
- if (_optionalChain([opt, 'optionalAccess', _162 => _162.kind]) === "external" && opt.address) {
5784
+ if (_optionalChain([opt, 'optionalAccess', _152 => _152.kind]) === "external" && opt.address) {
5636
5785
  return opt.address;
5637
5786
  }
5638
- if (_optionalChain([opt, 'optionalAccess', _163 => _163.kind]) === "connected" && opt.address) {
5787
+ if (_optionalChain([opt, 'optionalAccess', _153 => _153.kind]) === "connected" && opt.address) {
5639
5788
  return opt.address;
5640
5789
  }
5641
5790
  return null;
5642
5791
  }, [selectedWalletId, walletOptions]);
5643
5792
  const dappImportOwner = _react.useMemo.call(void 0, () => {
5644
5793
  if (selectedEvmWalletOwner) return selectedEvmWalletOwner;
5645
- if (_optionalChain([reownWallet, 'optionalAccess', _164 => _164.address]) && reownWallet.isConnected) {
5794
+ if (_optionalChain([reownWallet, 'optionalAccess', _154 => _154.address]) && reownWallet.isConnected) {
5646
5795
  return reownWallet.address;
5647
5796
  }
5648
5797
  if (connectedWalletAddress) return connectedWalletAddress;
5649
5798
  return null;
5650
5799
  }, [
5651
5800
  selectedEvmWalletOwner,
5652
- _optionalChain([reownWallet, 'optionalAccess', _165 => _165.address]),
5653
- _optionalChain([reownWallet, 'optionalAccess', _166 => _166.isConnected]),
5801
+ _optionalChain([reownWallet, 'optionalAccess', _155 => _155.address]),
5802
+ _optionalChain([reownWallet, 'optionalAccess', _156 => _156.isConnected]),
5654
5803
  connectedWalletAddress
5655
5804
  ]);
5656
5805
  const activeOwner = _react.useMemo.call(void 0,
5657
5806
  () => resolveOwnerForMode(flowMode, {
5658
5807
  dappAddress,
5659
- walletOwner: _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess', _167 => _167.ownerAddress]), () => ( (canAutoLock ? connectedWalletAddress : selectedEvmWalletOwner))),
5808
+ walletOwner: _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess', _157 => _157.ownerAddress]), () => ( (canAutoLock ? connectedWalletAddress : selectedEvmWalletOwner))),
5660
5809
  dappImportOwner
5661
5810
  }),
5662
5811
  [
5663
5812
  flowMode,
5664
5813
  dappAddress,
5665
- _optionalChain([signerContext, 'optionalAccess', _168 => _168.ownerAddress]),
5814
+ _optionalChain([signerContext, 'optionalAccess', _158 => _158.ownerAddress]),
5666
5815
  canAutoLock,
5667
5816
  connectedWalletAddress,
5668
5817
  selectedEvmWalletOwner,
@@ -5691,12 +5840,12 @@ function DepositFlow({
5691
5840
  return;
5692
5841
  }
5693
5842
  lastActiveSetupLifecycleKeyRef.current = lifecycleKey;
5694
- _optionalChain([onLifecycleRef, 'access', _169 => _169.current, 'optionalCall', _170 => _170({
5843
+ _optionalChain([onLifecycleRef, 'access', _159 => _159.current, 'optionalCall', _160 => _160({
5695
5844
  type: "smart-account-changed",
5696
5845
  evm: activeEntry.smartAccount,
5697
5846
  solana: _nullishCoalesce(activeEntry.solanaDepositAddress, () => ( null))
5698
5847
  })]);
5699
- _optionalChain([onLifecycleRef, 'access', _171 => _171.current, 'optionalCall', _172 => _172({
5848
+ _optionalChain([onLifecycleRef, 'access', _161 => _161.current, 'optionalCall', _162 => _162({
5700
5849
  type: "connected",
5701
5850
  address: activeOwner,
5702
5851
  smartAccount: activeEntry.smartAccount
@@ -5742,7 +5891,7 @@ function DepositFlow({
5742
5891
  const currentBackHandler = canGoBackFromHere ? handleBack : void 0;
5743
5892
  const currentScreen = showConnectStep ? "connect" : effectiveStep.type;
5744
5893
  _react.useEffect.call(void 0, () => {
5745
- _optionalChain([onStepChangeRef, 'access', _173 => _173.current, 'optionalCall', _174 => _174(currentBackHandler, currentScreen)]);
5894
+ _optionalChain([onStepChangeRef, 'access', _163 => _163.current, 'optionalCall', _164 => _164(currentBackHandler, currentScreen)]);
5746
5895
  }, [currentBackHandler, currentScreen, onStepChangeRef]);
5747
5896
  const lastModalHeightRef = _react.useRef.call(void 0, 0);
5748
5897
  const modalContentElRef = _react.useRef.call(void 0, null);
@@ -5752,7 +5901,7 @@ function DepositFlow({
5752
5901
  modalContentElRef.current = mc;
5753
5902
  const ro = new ResizeObserver((entries) => {
5754
5903
  for (const entry of entries) {
5755
- const border = _optionalChain([entry, 'access', _175 => _175.borderBoxSize, 'optionalAccess', _176 => _176[0], 'optionalAccess', _177 => _177.blockSize]);
5904
+ const border = _optionalChain([entry, 'access', _165 => _165.borderBoxSize, 'optionalAccess', _166 => _166[0], 'optionalAccess', _167 => _167.blockSize]);
5756
5905
  lastModalHeightRef.current = typeof border === "number" ? border : entry.contentRect.height;
5757
5906
  }
5758
5907
  });
@@ -5793,7 +5942,7 @@ function DepositFlow({
5793
5942
  }
5794
5943
  lastStepOpenEventKeyRef.current = stepOpenEventKey;
5795
5944
  if (effectiveStep.type === "select-asset") {
5796
- _optionalChain([onEventRef, 'access', _178 => _178.current, 'optionalCall', _179 => _179({
5945
+ _optionalChain([onEventRef, 'access', _168 => _168.current, 'optionalCall', _169 => _169({
5797
5946
  type: "deposit_modal_connected_wallet_select_source_open",
5798
5947
  total_balance_in_external_wallet: totalBalanceUsd,
5799
5948
  pred_balance: totalBalanceUsd
@@ -5801,7 +5950,7 @@ function DepositFlow({
5801
5950
  } else if (effectiveStep.type === "deposit-address") {
5802
5951
  const chainName = _chunkABVRVW3Pcjs.getChainName.call(void 0, targetChain);
5803
5952
  const tokenSymbol = _chunkABVRVW3Pcjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain);
5804
- _optionalChain([onEventRef, 'access', _180 => _180.current, 'optionalCall', _181 => _181({
5953
+ _optionalChain([onEventRef, 'access', _170 => _170.current, 'optionalCall', _171 => _171({
5805
5954
  type: "deposit_modal_transfer_crypto_open",
5806
5955
  default_chain: chainName,
5807
5956
  default_token: tokenSymbol,
@@ -5809,7 +5958,7 @@ function DepositFlow({
5809
5958
  })]);
5810
5959
  } else if (effectiveStep.type === "amount" && stepSendToken) {
5811
5960
  const receiveSymbol = _chunkABVRVW3Pcjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain);
5812
- _optionalChain([onEventRef, 'access', _182 => _182.current, 'optionalCall', _183 => _183({
5961
+ _optionalChain([onEventRef, 'access', _172 => _172.current, 'optionalCall', _173 => _173({
5813
5962
  type: "deposit_modal_connected_wallet_enter_value_open",
5814
5963
  send_token: stepSendToken,
5815
5964
  receive_token: receiveSymbol,
@@ -5842,7 +5991,7 @@ function DepositFlow({
5842
5991
  targetToken
5843
5992
  ]);
5844
5993
  _react.useEffect.call(void 0, () => {
5845
- _optionalChain([onLifecycleRef, 'access', _184 => _184.current, 'optionalCall', _185 => _185({
5994
+ _optionalChain([onLifecycleRef, 'access', _174 => _174.current, 'optionalCall', _175 => _175({
5846
5995
  type: "balance-changed",
5847
5996
  totalUsd: totalBalanceUsd
5848
5997
  })]);
@@ -5858,7 +6007,7 @@ function DepositFlow({
5858
6007
  const handleConfirmWallet = _react.useCallback.call(void 0,
5859
6008
  (walletId) => {
5860
6009
  const selectedOption = walletOptions.find((o) => o.id === walletId);
5861
- const mode = enableSolana && _optionalChain([selectedOption, 'optionalAccess', _186 => _186.kind]) === "solana" ? "solana-wallet" : "wallet";
6010
+ const mode = enableSolana && _optionalChain([selectedOption, 'optionalAccess', _176 => _176.kind]) === "solana" ? "solana-wallet" : "wallet";
5862
6011
  storeApi.dispatch({
5863
6012
  type: "connect/wallet-confirmed",
5864
6013
  walletId,
@@ -5868,7 +6017,7 @@ function DepositFlow({
5868
6017
  [walletOptions, enableSolana, storeApi]
5869
6018
  );
5870
6019
  const isSolanaWalletConnected = Boolean(
5871
- enableSolana && _optionalChain([reownWallet, 'optionalAccess', _187 => _187.isConnected]) && _optionalChain([reownWallet, 'optionalAccess', _188 => _188.isSolana])
6020
+ enableSolana && _optionalChain([reownWallet, 'optionalAccess', _177 => _177.isConnected]) && _optionalChain([reownWallet, 'optionalAccess', _178 => _178.isSolana])
5872
6021
  );
5873
6022
  const dappImportsKey = dappImports ? Object.keys(dappImports).filter((k) => dappImports[k]).sort().join(",") : "";
5874
6023
  const enabledDappImportProviders = _react.useMemo.call(void 0,
@@ -5885,7 +6034,7 @@ function DepositFlow({
5885
6034
  const owner = dappImportOwner;
5886
6035
  if (owner) {
5887
6036
  const wallet = walletOptions.find(
5888
- (o) => _optionalChain([(_nullishCoalesce(o.address, () => ( null))), 'optionalAccess', _189 => _189.toLowerCase, 'call', _190 => _190()]) === owner.toLowerCase()
6037
+ (o) => _optionalChain([(_nullishCoalesce(o.address, () => ( null))), 'optionalAccess', _179 => _179.toLowerCase, 'call', _180 => _180()]) === owner.toLowerCase()
5889
6038
  );
5890
6039
  if (wallet) {
5891
6040
  storeApi.dispatch({
@@ -5926,8 +6075,8 @@ function DepositFlow({
5926
6075
  eoa: dappImportOwner,
5927
6076
  getPublicClient: (chainId) => {
5928
6077
  try {
5929
- return _chunkPDFLALUTcjs.getPublicClient.call(void 0, chainId, rpcUrls);
5930
- } catch (e28) {
6078
+ return _chunkVPWWFWZTcjs.getPublicClient.call(void 0, chainId, rpcUrls);
6079
+ } catch (e30) {
5931
6080
  return null;
5932
6081
  }
5933
6082
  },
@@ -6003,7 +6152,7 @@ function DepositFlow({
6003
6152
  }, [activeDappImportProviderId, enabledDappImportProviders]);
6004
6153
  const activeDappImportAvailability = _react.useMemo.call(void 0, () => {
6005
6154
  if (!activeDappImportProviderId) return null;
6006
- if (!dappImportOwner || _optionalChain([dappImportAvailabilityOwner, 'optionalAccess', _191 => _191.toLowerCase, 'call', _192 => _192()]) !== dappImportOwner.toLowerCase()) {
6155
+ if (!dappImportOwner || _optionalChain([dappImportAvailabilityOwner, 'optionalAccess', _181 => _181.toLowerCase, 'call', _182 => _182()]) !== dappImportOwner.toLowerCase()) {
6007
6156
  return null;
6008
6157
  }
6009
6158
  const entry = dappImportAvailability[activeDappImportProviderId];
@@ -6044,7 +6193,7 @@ function DepositFlow({
6044
6193
  setup: setupSlice
6045
6194
  });
6046
6195
  const pinnableWallet = dappImportOwner ? _nullishCoalesce(walletOptions.find(
6047
- (o) => _optionalChain([(_nullishCoalesce(o.address, () => ( null))), 'optionalAccess', _193 => _193.toLowerCase, 'call', _194 => _194()]) === dappImportOwner.toLowerCase()
6196
+ (o) => _optionalChain([(_nullishCoalesce(o.address, () => ( null))), 'optionalAccess', _183 => _183.toLowerCase, 'call', _184 => _184()]) === dappImportOwner.toLowerCase()
6048
6197
  ), () => ( null)) : null;
6049
6198
  const outcome = resolveBootOutcome({
6050
6199
  status,
@@ -6086,7 +6235,7 @@ function DepositFlow({
6086
6235
  if (dappImportOwner) {
6087
6236
  const plan = bootRetryPlan({
6088
6237
  setupStatus: readSetupForOwner(snapshot.setup, dappImportOwner).status,
6089
- 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
6238
+ 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
6090
6239
  });
6091
6240
  if (plan.restartSetup) {
6092
6241
  storeApi.dispatch({
@@ -6126,8 +6275,48 @@ function DepositFlow({
6126
6275
  },
6127
6276
  [storeApi]
6128
6277
  );
6278
+ const swappedUrlPrefetchRef = _react.useRef.call(void 0, /* @__PURE__ */ new Map());
6279
+ const prefetchSwappedWidgetUrl = _react.useCallback.call(void 0,
6280
+ (smartAccount, method) => {
6281
+ const cache = swappedUrlPrefetchRef.current;
6282
+ const key = _nullishCoalesce(method, () => ( ""));
6283
+ const owner = smartAccount.toLowerCase();
6284
+ const existing = cache.get(key);
6285
+ if (existing && existing.smartAccount === owner) return;
6286
+ const promise = service.getSwappedWidgetUrl({ smartAccount, method });
6287
+ promise.catch(() => {
6288
+ });
6289
+ cache.set(key, { smartAccount: owner, promise });
6290
+ logFlow("swapped:prefetch", { method: _nullishCoalesce(method, () => ( null)) });
6291
+ },
6292
+ [service, logFlow]
6293
+ );
6294
+ const consumeSwappedWidgetUrlPrefetch = _react.useCallback.call(void 0,
6295
+ (smartAccount, method) => {
6296
+ const cache = swappedUrlPrefetchRef.current;
6297
+ const key = _nullishCoalesce(method, () => ( ""));
6298
+ const entry = cache.get(key);
6299
+ if (!entry) return null;
6300
+ cache.delete(key);
6301
+ if (entry.smartAccount !== smartAccount.toLowerCase()) return null;
6302
+ return entry.promise;
6303
+ },
6304
+ []
6305
+ );
6306
+ const handlePrefetchFiatMethod = _react.useCallback.call(void 0,
6307
+ (method) => {
6308
+ if (!enableFiatOnramp || !dappAddress) return;
6309
+ const entry = readSetupForOwner(setupSlice, dappAddress);
6310
+ if (entry.status !== "ready" || !entry.smartAccount) return;
6311
+ prefetchSwappedWidgetUrl(entry.smartAccount, method);
6312
+ },
6313
+ [enableFiatOnramp, dappAddress, setupSlice, prefetchSwappedWidgetUrl]
6314
+ );
6315
+ _react.useEffect.call(void 0, () => {
6316
+ swappedUrlPrefetchRef.current.clear();
6317
+ }, [dappAddress]);
6129
6318
  const handleNewDeposit = _react.useCallback.call(void 0, () => {
6130
- _optionalChain([onLifecycleRef, 'access', _199 => _199.current, 'optionalCall', _200 => _200({
6319
+ _optionalChain([onLifecycleRef, 'access', _189 => _189.current, 'optionalCall', _190 => _190({
6131
6320
  type: "smart-account-changed",
6132
6321
  evm: null,
6133
6322
  solana: null
@@ -6135,6 +6324,7 @@ function DepositFlow({
6135
6324
  storeApi.dispatch({ type: "flow/reset" });
6136
6325
  stableWalletSignerRef.current = null;
6137
6326
  stableWalletSelectionKeyRef.current = null;
6327
+ swappedUrlPrefetchRef.current.clear();
6138
6328
  }, [onLifecycleRef, storeApi]);
6139
6329
  const setupInputBase = _react.useMemo.call(void 0,
6140
6330
  () => ({
@@ -6143,7 +6333,6 @@ function DepositFlow({
6143
6333
  signerAddress,
6144
6334
  sessionChainIds,
6145
6335
  recipient,
6146
- postBridgeActions,
6147
6336
  outputTokenRules,
6148
6337
  rejectUnmapped,
6149
6338
  forceRegister,
@@ -6155,7 +6344,6 @@ function DepositFlow({
6155
6344
  signerAddress,
6156
6345
  sessionChainIds,
6157
6346
  recipient,
6158
- postBridgeActions,
6159
6347
  outputTokenRules,
6160
6348
  rejectUnmapped,
6161
6349
  forceRegister,
@@ -6174,13 +6362,13 @@ function DepositFlow({
6174
6362
  };
6175
6363
  push(dappAddress);
6176
6364
  push(connectedWalletAddress);
6177
- push(_optionalChain([reownWallet, 'optionalAccess', _201 => _201.address]));
6365
+ push(_optionalChain([reownWallet, 'optionalAccess', _191 => _191.address]));
6178
6366
  push(dappImportOwner);
6179
6367
  return owners;
6180
6368
  }, [
6181
6369
  dappAddress,
6182
6370
  connectedWalletAddress,
6183
- _optionalChain([reownWallet, 'optionalAccess', _202 => _202.address]),
6371
+ _optionalChain([reownWallet, 'optionalAccess', _192 => _192.address]),
6184
6372
  dappImportOwner
6185
6373
  ]);
6186
6374
  _react.useEffect.call(void 0, () => {
@@ -6194,7 +6382,7 @@ function DepositFlow({
6194
6382
  try {
6195
6383
  sessionOwner = await resolveSessionOwner(owner);
6196
6384
  } catch (error) {
6197
- _chunkPDFLALUTcjs.debugError.call(void 0,
6385
+ _chunkVPWWFWZTcjs.debugError.call(void 0,
6198
6386
  debug,
6199
6387
  "deposit-flow",
6200
6388
  "session-owner:resolve-failed",
@@ -6278,6 +6466,58 @@ function DepositFlow({
6278
6466
  storeApi,
6279
6467
  setupSlice.byOwner
6280
6468
  ]);
6469
+ const walletOptionsKey = _react.useMemo.call(void 0,
6470
+ () => walletOptions.map((option) => option.id).join(","),
6471
+ [walletOptions]
6472
+ );
6473
+ const desiredPortfolios = _react.useMemo.call(void 0,
6474
+ () => walletOptions.flatMap((option) => {
6475
+ const network = option.kind === "solana" ? "solana" : "evm";
6476
+ const address = option.kind === "solana" ? option.solanaAddress : option.address;
6477
+ return address ? [{ network, address }] : [];
6478
+ }),
6479
+ // eslint-disable-next-line react-hooks/exhaustive-deps -- keyed on the stable id-join, not the walletOptions array identity
6480
+ [walletOptionsKey]
6481
+ );
6482
+ _react.useEffect.call(void 0, () => {
6483
+ storeApi.dispatch({
6484
+ type: "portfolio/reconciled",
6485
+ wallets: desiredPortfolios
6486
+ });
6487
+ desiredPortfolios.forEach(({ network, address }) => {
6488
+ if (readPortfolioEntry(storeApi.getState().portfolio, network, address)) {
6489
+ return;
6490
+ }
6491
+ storeApi.dispatch({ type: "portfolio/loading", network, address });
6492
+ const requestId = _optionalChain([readPortfolioEntry, 'call', _193 => _193(
6493
+ storeApi.getState().portfolio,
6494
+ network,
6495
+ address
6496
+ ), 'optionalAccess', _194 => _194.requestId]);
6497
+ if (requestId === void 0) return;
6498
+ void (async () => {
6499
+ try {
6500
+ const portfolio = network === "solana" ? await service.fetchSolanaPortfolio(address, {
6501
+ forceRefresh: true
6502
+ }) : await service.fetchPortfolio(address, { forceRefresh: true });
6503
+ storeApi.dispatch({
6504
+ type: "portfolio/loaded",
6505
+ network,
6506
+ address,
6507
+ requestId,
6508
+ totalUsd: portfolio.totalUsd
6509
+ });
6510
+ } catch (e31) {
6511
+ storeApi.dispatch({
6512
+ type: "portfolio/failed",
6513
+ network,
6514
+ address,
6515
+ requestId
6516
+ });
6517
+ }
6518
+ })();
6519
+ });
6520
+ }, [desiredPortfolios, service, storeApi, portfolioSlice.byKey]);
6281
6521
  const handleDepositAddressSubmitted = _react.useCallback.call(void 0,
6282
6522
  (data) => {
6283
6523
  logFlow("deposit-address:detected", {
@@ -6285,7 +6525,7 @@ function DepositFlow({
6285
6525
  sourceChain: data.sourceChain,
6286
6526
  amount: data.amount
6287
6527
  });
6288
- _optionalChain([onLifecycleRef, 'access', _203 => _203.current, 'optionalCall', _204 => _204({ type: "submitted", ...data })]);
6528
+ _optionalChain([onLifecycleRef, 'access', _195 => _195.current, 'optionalCall', _196 => _196({ type: "submitted", ...data })]);
6289
6529
  },
6290
6530
  [logFlow, onLifecycleRef]
6291
6531
  );
@@ -6345,7 +6585,7 @@ function DepositFlow({
6345
6585
  sourceDecimals: tokenAtSubmit.decimals,
6346
6586
  inputAmountUsd: amountUsd
6347
6587
  });
6348
- _optionalChain([onLifecycleRef, 'access', _205 => _205.current, 'optionalCall', _206 => _206({
6588
+ _optionalChain([onLifecycleRef, 'access', _197 => _197.current, 'optionalCall', _198 => _198({
6349
6589
  type: "submitted",
6350
6590
  txHash,
6351
6591
  sourceChain: "solana",
@@ -6358,7 +6598,7 @@ function DepositFlow({
6358
6598
  );
6359
6599
  const handleAssetContinue = _react.useCallback.call(void 0,
6360
6600
  (asset) => {
6361
- _optionalChain([onEventRef, 'access', _207 => _207.current, 'optionalCall', _208 => _208({
6601
+ _optionalChain([onEventRef, 'access', _199 => _199.current, 'optionalCall', _200 => _200({
6362
6602
  type: "deposit_modal_connected_wallet_select_source_cta_click",
6363
6603
  total_balance_in_external_wallet: totalBalanceUsd,
6364
6604
  pred_balance: totalBalanceUsd,
@@ -6412,8 +6652,8 @@ function DepositFlow({
6412
6652
  sourceChain: chainId,
6413
6653
  sourceToken: token,
6414
6654
  amount,
6415
- sourceSymbol: _optionalChain([asset, 'optionalAccess', _209 => _209.symbol]),
6416
- sourceDecimals: _optionalChain([asset, 'optionalAccess', _210 => _210.decimals]),
6655
+ sourceSymbol: _optionalChain([asset, 'optionalAccess', _201 => _201.symbol]),
6656
+ sourceDecimals: _optionalChain([asset, 'optionalAccess', _202 => _202.decimals]),
6417
6657
  inputAmountUsd: _nullishCoalesce(depositAtSubmit.inputAmountUsd, () => ( void 0)),
6418
6658
  directTransfer: !dappImport && isSameRoute2(chainId, token, targetChain, targetToken)
6419
6659
  });
@@ -6443,9 +6683,10 @@ function DepositFlow({
6443
6683
  amount,
6444
6684
  sourceSymbol: _nullishCoalesce(info.orderCrypto, () => ( "USDC")),
6445
6685
  sourceDecimals: SWAPPED_SOURCE_DECIMALS,
6446
- swappedContext
6686
+ swappedContext,
6687
+ initialEvent: info.initialEvent
6447
6688
  });
6448
- _optionalChain([onLifecycleRef, 'access', _211 => _211.current, 'optionalCall', _212 => _212({
6689
+ _optionalChain([onLifecycleRef, 'access', _203 => _203.current, 'optionalCall', _204 => _204({
6449
6690
  type: "submitted",
6450
6691
  txHash: info.txHash,
6451
6692
  sourceChain: SWAPPED_SOURCE_CHAIN,
@@ -6458,12 +6699,12 @@ function DepositFlow({
6458
6699
  const handleDepositSubmittedCallback = _react.useCallback.call(void 0,
6459
6700
  (txHash, sourceChain, amount) => {
6460
6701
  const depositAtSubmit = storeApi.getState().deposit;
6461
- _optionalChain([onLifecycleRef, 'access', _213 => _213.current, 'optionalCall', _214 => _214({
6702
+ _optionalChain([onLifecycleRef, 'access', _205 => _205.current, 'optionalCall', _206 => _206({
6462
6703
  type: "submitted",
6463
6704
  txHash,
6464
6705
  sourceChain,
6465
6706
  amount,
6466
- sourceDecimals: _optionalChain([depositAtSubmit, 'access', _215 => _215.selectedAsset, 'optionalAccess', _216 => _216.decimals]),
6707
+ sourceDecimals: _optionalChain([depositAtSubmit, 'access', _207 => _207.selectedAsset, 'optionalAccess', _208 => _208.decimals]),
6467
6708
  amountUsd: _nullishCoalesce(depositAtSubmit.inputAmountUsd, () => ( void 0))
6468
6709
  })]);
6469
6710
  },
@@ -6472,7 +6713,7 @@ function DepositFlow({
6472
6713
  const handleDepositComplete = _react.useCallback.call(void 0,
6473
6714
  (txHash, destinationTxHash, context) => {
6474
6715
  logFlow("deposit:complete", { txHash, destinationTxHash, ...context });
6475
- _optionalChain([onLifecycleRef, 'access', _217 => _217.current, 'optionalCall', _218 => _218({
6716
+ _optionalChain([onLifecycleRef, 'access', _209 => _209.current, 'optionalCall', _210 => _210({
6476
6717
  type: "complete",
6477
6718
  txHash,
6478
6719
  destinationTxHash,
@@ -6484,24 +6725,20 @@ function DepositFlow({
6484
6725
  const handleDepositFailed = _react.useCallback.call(void 0,
6485
6726
  (txHash, error) => {
6486
6727
  logFlowError("deposit:failed", error, { txHash });
6487
- _optionalChain([onLifecycleRef, 'access', _219 => _219.current, 'optionalCall', _220 => _220({ type: "failed", txHash, error })]);
6728
+ _optionalChain([onLifecycleRef, 'access', _211 => _211.current, 'optionalCall', _212 => _212({ type: "failed", txHash, error })]);
6488
6729
  },
6489
6730
  [logFlowError, onLifecycleRef]
6490
6731
  );
6491
6732
  const handleError = _react.useCallback.call(void 0,
6492
6733
  (message, code) => {
6493
6734
  logFlowError("flow:error", message, { code });
6494
- _optionalChain([onErrorRef, 'access', _221 => _221.current, 'optionalCall', _222 => _222({ message, code })]);
6735
+ _optionalChain([onErrorRef, 'access', _213 => _213.current, 'optionalCall', _214 => _214({ message, code })]);
6495
6736
  },
6496
6737
  [logFlowError, onErrorRef]
6497
6738
  );
6498
6739
  const handleTotalBalanceComputed = _react.useCallback.call(void 0, (total) => {
6499
6740
  setTotalBalanceUsd(total);
6500
6741
  }, []);
6501
- const walletOptionsKey = _react.useMemo.call(void 0,
6502
- () => walletOptions.map((option) => option.id).join(","),
6503
- [walletOptions]
6504
- );
6505
6742
  _react.useEffect.call(void 0, () => {
6506
6743
  if (storeApi.getState().flow.mode) {
6507
6744
  return;
@@ -6538,6 +6775,13 @@ function DepositFlow({
6538
6775
  const ownerForRow = option.kind === "solana" ? dappAddress : _nullishCoalesce(option.address, () => ( null));
6539
6776
  const entry = readSetupForOwner(setupSlice, _nullishCoalesce(ownerForRow, () => ( null)));
6540
6777
  const state = entry.status === "ready" ? "ready" : entry.status === "error" ? "error" : "loading";
6778
+ const network = option.kind === "solana" ? "solana" : "evm";
6779
+ const balanceAddress = option.kind === "solana" ? option.solanaAddress : option.address;
6780
+ const portfolioEntry = readPortfolioEntry(
6781
+ portfolioSlice,
6782
+ network,
6783
+ balanceAddress
6784
+ );
6541
6785
  return {
6542
6786
  id: option.id,
6543
6787
  kind: option.kind,
@@ -6545,10 +6789,12 @@ function DepositFlow({
6545
6789
  icon: option.icon,
6546
6790
  address: _nullishCoalesce(_nullishCoalesce(option.address, () => ( option.solanaAddress)), () => ( option.id)),
6547
6791
  state,
6548
- errorReason: _nullishCoalesce(entry.message, () => ( void 0))
6792
+ errorReason: _nullishCoalesce(entry.message, () => ( void 0)),
6793
+ balanceStatus: _nullishCoalesce(_optionalChain([portfolioEntry, 'optionalAccess', _215 => _215.status]), () => ( "loading")),
6794
+ balanceUsd: _optionalChain([portfolioEntry, 'optionalAccess', _216 => _216.status]) === "ready" ? portfolioEntry.totalUsd : null
6549
6795
  };
6550
6796
  });
6551
- }, [walletOptions, setupSlice, dappAddress]);
6797
+ }, [walletOptions, setupSlice, dappAddress, portfolioSlice]);
6552
6798
  const transferCryptoEntry = _react.useMemo.call(void 0,
6553
6799
  () => readSetupForOwner(setupSlice, dappAddress),
6554
6800
  [setupSlice, dappAddress]
@@ -6562,7 +6808,7 @@ function DepositFlow({
6562
6808
  );
6563
6809
  if (showConnectStep) {
6564
6810
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
6565
- _chunkPDFLALUTcjs.ConnectStep,
6811
+ _chunkVPWWFWZTcjs.ConnectStep,
6566
6812
  {
6567
6813
  walletRows,
6568
6814
  transferCryptoState: dappAddress ? transferCryptoState : void 0,
@@ -6576,6 +6822,7 @@ function DepositFlow({
6576
6822
  } : void 0,
6577
6823
  fiatPaymentMethods: enableFiatOnramp && dappAddress ? fiatOnrampMethods && fiatOnrampMethods.length > 0 ? fiatOnrampMethods : DEFAULT_FIAT_ONRAMP_METHODS : void 0,
6578
6824
  onSelectFiatMethod: enableFiatOnramp && dappAddress ? (method) => handleSelectFiatMethod(method) : void 0,
6825
+ onPrefetchFiatMethod: enableFiatOnramp && dappAddress ? handlePrefetchFiatMethod : void 0,
6579
6826
  onSelectFundFromExchange: enableExchangeConnect && dappAddress ? () => handleSelectExchange() : void 0,
6580
6827
  onRequestConnect,
6581
6828
  onConnect,
@@ -6594,7 +6841,7 @@ function DepositFlow({
6594
6841
  },
6595
6842
  dappImports: connectStepDappImports,
6596
6843
  onSelectDappImport: (providerId) => {
6597
- const availabilityEntry = dappImportOwner && _optionalChain([dappImportAvailabilityOwner, 'optionalAccess', _223 => _223.toLowerCase, 'call', _224 => _224()]) === dappImportOwner.toLowerCase() ? dappImportAvailability[providerId] : void 0;
6844
+ const availabilityEntry = dappImportOwner && _optionalChain([dappImportAvailabilityOwner, 'optionalAccess', _217 => _217.toLowerCase, 'call', _218 => _218()]) === dappImportOwner.toLowerCase() ? dappImportAvailability[providerId] : void 0;
6598
6845
  if (availabilityEntry === "error") {
6599
6846
  storeApi.dispatch({
6600
6847
  type: "dapp-import/availability-retry-requested"
@@ -6640,7 +6887,6 @@ function DepositFlow({
6640
6887
  allowedRoutes,
6641
6888
  targetChain,
6642
6889
  targetToken,
6643
- hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess', _225 => _225.length])),
6644
6890
  uiConfig,
6645
6891
  onDepositSubmitted: handleDepositAddressSubmitted,
6646
6892
  onDepositComplete: handleDepositComplete,
@@ -6648,7 +6894,7 @@ function DepositFlow({
6648
6894
  onCopyAddress: () => {
6649
6895
  const chainName = _chunkABVRVW3Pcjs.getChainName.call(void 0, targetChain);
6650
6896
  const tokenSymbol = _chunkABVRVW3Pcjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain);
6651
- _optionalChain([onEvent, 'optionalCall', _226 => _226({
6897
+ _optionalChain([onEvent, 'optionalCall', _219 => _219({
6652
6898
  type: "deposit_modal_transfer_crypto_cta_click",
6653
6899
  default_chain: chainName,
6654
6900
  default_token: tokenSymbol,
@@ -6684,15 +6930,17 @@ function DepositFlow({
6684
6930
  smartAccount: step.smartAccount,
6685
6931
  service,
6686
6932
  paymentMethod: step.paymentMethod,
6933
+ consumePrefetchedUrl: consumeSwappedWidgetUrlPrefetch,
6687
6934
  onSwappedComplete: handleSwappedComplete,
6688
6935
  onSwappedFailed: handleDepositFailed,
6689
6936
  onClose: _nullishCoalesce(onClose, () => ( (() => {
6690
6937
  }))),
6938
+ onGoBack: handleBack,
6691
6939
  onError: handleError
6692
6940
  }
6693
6941
  ),
6694
6942
  step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
6695
- _chunkPDFLALUTcjs.ProcessingStep,
6943
+ _chunkVPWWFWZTcjs.ProcessingStep,
6696
6944
  {
6697
6945
  smartAccount: step.smartAccount,
6698
6946
  solanaDepositAddress: step.solanaDepositAddress,
@@ -6706,9 +6954,9 @@ function DepositFlow({
6706
6954
  sourceDecimals: step.sourceDecimals,
6707
6955
  amountUsd: step.inputAmountUsd,
6708
6956
  swappedContext: step.swappedContext,
6709
- hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess', _227 => _227.length])),
6710
6957
  service,
6711
6958
  directTransfer: step.directTransfer,
6959
+ initialEvent: step.initialEvent,
6712
6960
  isSwappedOrder: true,
6713
6961
  onClose,
6714
6962
  onNewDeposit: handleNewDeposit,
@@ -6756,11 +7004,12 @@ function DepositFlow({
6756
7004
  onSwappedFailed: handleDepositFailed,
6757
7005
  onClose: _nullishCoalesce(onClose, () => ( (() => {
6758
7006
  }))),
7007
+ onGoBack: handleBack,
6759
7008
  onError: handleError
6760
7009
  }
6761
7010
  ),
6762
7011
  step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
6763
- _chunkPDFLALUTcjs.ProcessingStep,
7012
+ _chunkVPWWFWZTcjs.ProcessingStep,
6764
7013
  {
6765
7014
  smartAccount: step.smartAccount,
6766
7015
  solanaDepositAddress: step.solanaDepositAddress,
@@ -6774,9 +7023,9 @@ function DepositFlow({
6774
7023
  sourceDecimals: step.sourceDecimals,
6775
7024
  amountUsd: step.inputAmountUsd,
6776
7025
  swappedContext: step.swappedContext,
6777
- hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess', _228 => _228.length])),
6778
7026
  service,
6779
7027
  directTransfer: step.directTransfer,
7028
+ initialEvent: step.initialEvent,
6780
7029
  isSwappedOrder: true,
6781
7030
  onClose,
6782
7031
  onNewDeposit: handleNewDeposit,
@@ -6792,8 +7041,8 @@ function DepositFlow({
6792
7041
  }
6793
7042
  if (isSolanaWalletMode) {
6794
7043
  if (!dappAddress) return null;
6795
- const solanaAddr = _optionalChain([reownWallet, 'optionalAccess', _229 => _229.solanaAddress]);
6796
- const solanaProvider = _optionalChain([reownWallet, 'optionalAccess', _230 => _230.solanaProvider]);
7044
+ const solanaAddr = _optionalChain([reownWallet, 'optionalAccess', _220 => _220.solanaAddress]);
7045
+ const solanaProvider = _optionalChain([reownWallet, 'optionalAccess', _221 => _221.solanaProvider]);
6797
7046
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
6798
7047
  effectiveStep.type === "setup" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
6799
7048
  AccountPreparingSkeleton,
@@ -6850,7 +7099,7 @@ function DepositFlow({
6850
7099
  targetToken,
6851
7100
  service,
6852
7101
  solanaProvider,
6853
- solanaConnection: _optionalChain([reownWallet, 'optionalAccess', _231 => _231.solanaConnection]),
7102
+ solanaConnection: _optionalChain([reownWallet, 'optionalAccess', _222 => _222.solanaConnection]),
6854
7103
  uiConfig,
6855
7104
  onConfirm: handleSolanaConfirmed,
6856
7105
  onError: handleError,
@@ -6891,7 +7140,7 @@ function DepositFlow({
6891
7140
  ) })
6892
7141
  ] }) : null,
6893
7142
  effectiveStep.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
6894
- _chunkPDFLALUTcjs.ProcessingStep,
7143
+ _chunkVPWWFWZTcjs.ProcessingStep,
6895
7144
  {
6896
7145
  smartAccount: effectiveStep.smartAccount,
6897
7146
  solanaDepositAddress: effectiveStep.solanaDepositAddress,
@@ -6904,9 +7153,9 @@ function DepositFlow({
6904
7153
  sourceSymbol: effectiveStep.sourceSymbol,
6905
7154
  sourceDecimals: effectiveStep.sourceDecimals,
6906
7155
  amountUsd: effectiveStep.inputAmountUsd,
6907
- hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess', _232 => _232.length])),
6908
7156
  service,
6909
7157
  directTransfer: effectiveStep.directTransfer,
7158
+ initialEvent: effectiveStep.initialEvent,
6910
7159
  onClose,
6911
7160
  onNewDeposit: handleNewDeposit,
6912
7161
  onDepositComplete: handleDepositComplete,
@@ -6927,7 +7176,7 @@ function DepositFlow({
6927
7176
  children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
6928
7177
  DappImportAssetSelectSkeleton,
6929
7178
  {
6930
- sourceLabel: _nullishCoalesce(_optionalChain([activeDappImportProvider, 'optionalAccess', _233 => _233.sourceLabel]), () => ( "")),
7179
+ sourceLabel: _nullishCoalesce(_optionalChain([activeDappImportProvider, 'optionalAccess', _223 => _223.sourceLabel]), () => ( "")),
6931
7180
  error: dappImportBootError,
6932
7181
  onRetry: handleBootRetry
6933
7182
  }
@@ -6935,16 +7184,16 @@ function DepositFlow({
6935
7184
  }
6936
7185
  );
6937
7186
  }
6938
- if (!_optionalChain([signerContext, 'optionalAccess', _234 => _234.walletClient]) || !_optionalChain([signerContext, 'optionalAccess', _235 => _235.publicClient])) {
7187
+ if (!_optionalChain([signerContext, 'optionalAccess', _224 => _224.walletClient]) || !_optionalChain([signerContext, 'optionalAccess', _225 => _225.publicClient])) {
6939
7188
  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" }) }) }) }) });
6940
7189
  }
6941
7190
  const ownerAddress = signerContext.ownerAddress;
6942
- 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));
7191
+ 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));
6943
7192
  const getReadClientForChain = (chainId) => {
6944
- if (_optionalChain([signerContext, 'access', _242 => _242.publicClient, 'access', _243 => _243.chain, 'optionalAccess', _244 => _244.id]) === chainId) {
7193
+ if (_optionalChain([signerContext, 'access', _232 => _232.publicClient, 'access', _233 => _233.chain, 'optionalAccess', _234 => _234.id]) === chainId) {
6945
7194
  return signerContext.publicClient;
6946
7195
  }
6947
- return _chunkPDFLALUTcjs.getPublicClient.call(void 0, chainId, rpcUrls);
7196
+ return _chunkVPWWFWZTcjs.getPublicClient.call(void 0, chainId, rpcUrls);
6948
7197
  };
6949
7198
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
6950
7199
  effectiveStep.type === "setup" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
@@ -6974,7 +7223,7 @@ function DepositFlow({
6974
7223
  effectiveStep.type === "dapp-import-asset-select" && activeDappImportProvider && activeDappImportAvailability && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
6975
7224
  DappImportAssetSelectStep,
6976
7225
  {
6977
- sourceLabel: _nullishCoalesce(_optionalChain([activeDappImportAvailability, 'access', _245 => _245.assets, 'access', _246 => _246[0], 'optionalAccess', _247 => _247.sourceLabel]), () => ( activeDappImportProvider.sourceLabel)),
7226
+ sourceLabel: _nullishCoalesce(_optionalChain([activeDappImportAvailability, 'access', _235 => _235.assets, 'access', _236 => _236[0], 'optionalAccess', _237 => _237.sourceLabel]), () => ( activeDappImportProvider.sourceLabel)),
6978
7227
  assets: activeDappImportAvailability.assets,
6979
7228
  onSelect: handleDappImportAssetSelected
6980
7229
  }
@@ -7001,7 +7250,7 @@ function DepositFlow({
7001
7250
  onContinue: handleAmountContinue,
7002
7251
  onCtaClick: (ctaName) => {
7003
7252
  const receiveSymbol = _chunkABVRVW3Pcjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain);
7004
- _optionalChain([onEvent, 'optionalCall', _248 => _248({
7253
+ _optionalChain([onEvent, 'optionalCall', _238 => _238({
7005
7254
  type: "deposit_modal_connected_wallet_enter_value_cta_click",
7006
7255
  send_token: effectiveStep.asset.symbol,
7007
7256
  receive_token: receiveSymbol,
@@ -7053,7 +7302,7 @@ function DepositFlow({
7053
7302
  }
7054
7303
  ),
7055
7304
  effectiveStep.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
7056
- _chunkPDFLALUTcjs.ProcessingStep,
7305
+ _chunkVPWWFWZTcjs.ProcessingStep,
7057
7306
  {
7058
7307
  smartAccount: effectiveStep.smartAccount,
7059
7308
  solanaDepositAddress: effectiveStep.solanaDepositAddress,
@@ -7066,9 +7315,9 @@ function DepositFlow({
7066
7315
  sourceSymbol: effectiveStep.sourceSymbol,
7067
7316
  sourceDecimals: effectiveStep.sourceDecimals,
7068
7317
  amountUsd: effectiveStep.inputAmountUsd,
7069
- hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess', _249 => _249.length])),
7070
7318
  service,
7071
7319
  directTransfer: effectiveStep.directTransfer,
7320
+ initialEvent: effectiveStep.initialEvent,
7072
7321
  uiConfig,
7073
7322
  onClose,
7074
7323
  onNewDeposit: handleNewDeposit,
@@ -7098,7 +7347,7 @@ function formatDate(iso) {
7098
7347
  month: "short",
7099
7348
  year: "numeric"
7100
7349
  });
7101
- } catch (e29) {
7350
+ } catch (e32) {
7102
7351
  return iso;
7103
7352
  }
7104
7353
  }
@@ -7156,7 +7405,7 @@ function formatAmount(rawAmount, token, chainId) {
7156
7405
  let frac = fracStr.slice(0, 5).replace(/0+$/, "");
7157
7406
  if (frac.length < 2) frac = frac.padEnd(2, "0");
7158
7407
  return `${whole}.${frac}`;
7159
- } catch (e30) {
7408
+ } catch (e33) {
7160
7409
  return rawAmount;
7161
7410
  }
7162
7411
  }
@@ -7205,7 +7454,7 @@ function DepositHistoryPanel({
7205
7454
  );
7206
7455
  const visibleDeposits = _react.useMemo.call(void 0, () => {
7207
7456
  const sourceHashes = new Set(
7208
- deposits.map((d) => _optionalChain([d, 'access', _250 => _250.sourceTxHash, 'optionalAccess', _251 => _251.toLowerCase, 'call', _252 => _252()])).filter((h) => Boolean(h))
7457
+ deposits.map((d) => _optionalChain([d, 'access', _239 => _239.sourceTxHash, 'optionalAccess', _240 => _240.toLowerCase, 'call', _241 => _241()])).filter((h) => Boolean(h))
7209
7458
  );
7210
7459
  return deposits.filter(
7211
7460
  (d) => !(d.txHash && sourceHashes.has(d.txHash.toLowerCase()))
@@ -7227,7 +7476,7 @@ function DepositHistoryPanel({
7227
7476
  className: "rs-modal-header-back",
7228
7477
  "aria-label": "Back",
7229
7478
  onClick: onClose,
7230
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.ChevronLeftIcon, {})
7479
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.ChevronLeftIcon, {})
7231
7480
  }
7232
7481
  ) }),
7233
7482
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-header-nav-right", children: onCloseModal && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
@@ -7237,29 +7486,29 @@ function DepositHistoryPanel({
7237
7486
  className: "rs-modal-close",
7238
7487
  "aria-label": "Close",
7239
7488
  onClick: onCloseModal,
7240
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.CloseIcon, {})
7489
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.CloseIcon, {})
7241
7490
  }
7242
7491
  ) })
7243
7492
  ] }),
7244
7493
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-screen", children: [
7245
7494
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-screen-body", children: [
7246
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.HistoryIcon, {}), title: "History" }),
7495
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.HistoryIcon, {}), title: "History" }),
7247
7496
  isLoading && deposits.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty", children: [
7248
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.HistoryIcon, {}) }),
7497
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.HistoryIcon, {}) }),
7249
7498
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty-text", children: [
7250
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.Spinner, { className: "rs-spinner--sm" }),
7499
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.Spinner, { className: "rs-spinner--sm" }),
7251
7500
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-hint", children: "Loading history\u2026" })
7252
7501
  ] })
7253
7502
  ] }),
7254
7503
  error && !isLoading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty", children: [
7255
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.AlertTriangleIcon, {}) }),
7504
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.AlertTriangleIcon, {}) }),
7256
7505
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty-text", children: [
7257
7506
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-title", children: "Couldn't load history" }),
7258
7507
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-hint", children: error })
7259
7508
  ] })
7260
7509
  ] }),
7261
7510
  !isLoading && !error && visibleDeposits.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty", children: [
7262
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.HistoryIcon, {}) }),
7511
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.HistoryIcon, {}) }),
7263
7512
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty-text", children: [
7264
7513
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-title", children: "No deposits yet" }),
7265
7514
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-hint", children: "Your deposit history will appear here" })
@@ -7279,7 +7528,7 @@ function DepositHistoryPanel({
7279
7528
  )
7280
7529
  ] })
7281
7530
  ] }),
7282
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.PoweredBy, {})
7531
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.PoweredBy, {})
7283
7532
  ] })
7284
7533
  ]
7285
7534
  }
@@ -7354,7 +7603,7 @@ function HistoryCard({ deposit }) {
7354
7603
  onClick: (e) => e.stopPropagation(),
7355
7604
  children: [
7356
7605
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: shortenHash(deposit.sourceTxHash) }),
7357
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.ArrowUpRightIcon, {})
7606
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.ArrowUpRightIcon, {})
7358
7607
  ]
7359
7608
  }
7360
7609
  )
@@ -7369,7 +7618,7 @@ DepositHistoryPanel.displayName = "DepositHistoryPanel";
7369
7618
  // src/DepositModal.tsx
7370
7619
 
7371
7620
  var ReownDepositInner = _react.lazy.call(void 0,
7372
- () => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-HWKF3O62.cjs"))).then((m) => ({ default: m.DepositModalReown }))
7621
+ () => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-ICBGUVAA.cjs"))).then((m) => ({ default: m.DepositModalReown }))
7373
7622
  );
7374
7623
  function sortByCreatedAtDesc(items) {
7375
7624
  return [...items].sort((a, b) => {
@@ -7430,7 +7679,6 @@ function DepositModalInner({
7430
7679
  enableQrTransfer = true,
7431
7680
  fiatOnrampMethods,
7432
7681
  enableExchangeConnect = false,
7433
- postBridgeActions,
7434
7682
  outputTokenRules,
7435
7683
  rejectUnmapped,
7436
7684
  reownWallet,
@@ -7448,12 +7696,12 @@ function DepositModalInner({
7448
7696
  debug
7449
7697
  }) {
7450
7698
  const modalRef = _react.useRef.call(void 0, null);
7451
- const onReadyRef = _chunkPDFLALUTcjs.useLatestRef.call(void 0, onReady);
7699
+ const onReadyRef = _chunkVPWWFWZTcjs.useLatestRef.call(void 0, onReady);
7452
7700
  const [currentScreen, setCurrentScreen] = _react.useState.call(void 0, "connect");
7453
7701
  const [backHandler, setBackHandler] = _react.useState.call(void 0,
7454
7702
  void 0
7455
7703
  );
7456
- const showHistoryButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _253 => _253.showHistoryButton]), () => ( false));
7704
+ const showHistoryButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _242 => _242.showHistoryButton]), () => ( false));
7457
7705
  const historyButtonVisible = showHistoryButton && (currentScreen === "select-asset" || currentScreen === "deposit-address");
7458
7706
  const [historyOpen, setHistoryOpen] = _react.useState.call(void 0, false);
7459
7707
  const [historyDeposits, setHistoryDeposits] = _react.useState.call(void 0, []);
@@ -7466,21 +7714,21 @@ function DepositModalInner({
7466
7714
  const historyLoadedRef = _react.useRef.call(void 0, false);
7467
7715
  const targetChain = targetChainProp === "solana" ? "solana" : _chunkABVRVW3Pcjs.getChainId.call(void 0, targetChainProp);
7468
7716
  const sourceChain = sourceChainProp ? _chunkABVRVW3Pcjs.getChainId.call(void 0, sourceChainProp) : void 0;
7469
- const rpcUrls = _chunkPDFLALUTcjs.useStableRpcUrls.call(void 0, rpcUrlsProp);
7717
+ const rpcUrls = _chunkVPWWFWZTcjs.useStableRpcUrls.call(void 0, rpcUrlsProp);
7470
7718
  const [recipientIsContract, setRecipientIsContract] = _react.useState.call(void 0, false);
7471
- const onErrorRef = _chunkPDFLALUTcjs.useLatestRef.call(void 0, onError);
7719
+ const onErrorRef = _chunkVPWWFWZTcjs.useLatestRef.call(void 0, onError);
7472
7720
  _react.useEffect.call(void 0, () => {
7473
7721
  if (targetChain !== _chunkABVRVW3Pcjs.HYPERCORE_CHAIN_ID || !_viem.isAddress.call(void 0, recipient, { strict: false })) {
7474
7722
  setRecipientIsContract(false);
7475
7723
  return;
7476
7724
  }
7477
7725
  let cancelled = false;
7478
- _chunkPDFLALUTcjs.getHyperEvmReadClient.call(void 0, rpcUrls).getCode({ address: recipient }).then((code) => {
7726
+ _chunkVPWWFWZTcjs.getHyperEvmReadClient.call(void 0, rpcUrls).getCode({ address: recipient }).then((code) => {
7479
7727
  if (cancelled) return;
7480
7728
  const isContract = _chunkABVRVW3Pcjs.isContractBytecode.call(void 0, code);
7481
7729
  setRecipientIsContract(isContract);
7482
7730
  if (isContract) {
7483
- _optionalChain([onErrorRef, 'access', _254 => _254.current, 'optionalCall', _255 => _255({
7731
+ _optionalChain([onErrorRef, 'access', _243 => _243.current, 'optionalCall', _244 => _244({
7484
7732
  message: "HyperCore deposits require an EOA recipient; the configured recipient is a smart contract.",
7485
7733
  code: "HYPERCORE_RECIPIENT_NOT_EOA"
7486
7734
  })]);
@@ -7493,7 +7741,7 @@ function DepositModalInner({
7493
7741
  };
7494
7742
  }, [targetChain, recipient, onErrorRef, rpcUrls]);
7495
7743
  const service = _react.useMemo.call(void 0,
7496
- () => _chunkPDFLALUTcjs.createDepositService.call(void 0, backendUrl, {
7744
+ () => _chunkVPWWFWZTcjs.createDepositService.call(void 0, backendUrl, {
7497
7745
  debug,
7498
7746
  debugScope: "service:deposit"
7499
7747
  }),
@@ -7509,12 +7757,12 @@ function DepositModalInner({
7509
7757
  }, [store, targetChain, targetToken]);
7510
7758
  _react.useEffect.call(void 0, () => {
7511
7759
  if (isOpen && modalRef.current) {
7512
- _chunkPDFLALUTcjs.applyTheme.call(void 0, modalRef.current, theme);
7760
+ _chunkVPWWFWZTcjs.applyTheme.call(void 0, modalRef.current, theme);
7513
7761
  }
7514
7762
  }, [isOpen, theme]);
7515
7763
  _react.useEffect.call(void 0, () => {
7516
7764
  if (isOpen) {
7517
- _optionalChain([onReadyRef, 'access', _256 => _256.current, 'optionalCall', _257 => _257()]);
7765
+ _optionalChain([onReadyRef, 'access', _245 => _245.current, 'optionalCall', _246 => _246()]);
7518
7766
  }
7519
7767
  }, [isOpen, onReadyRef]);
7520
7768
  const handleStepChange = _react.useCallback.call(void 0,
@@ -7590,10 +7838,10 @@ function DepositModalInner({
7590
7838
  fetchHistory("initial");
7591
7839
  }
7592
7840
  }, [historyOpen, fetchHistory]);
7593
- const onLifecycleRef = _chunkPDFLALUTcjs.useLatestRef.call(void 0, onLifecycle);
7841
+ const onLifecycleRef = _chunkVPWWFWZTcjs.useLatestRef.call(void 0, onLifecycle);
7594
7842
  const handleLifecycle = _react.useCallback.call(void 0,
7595
7843
  (event) => {
7596
- _optionalChain([onLifecycleRef, 'access', _258 => _258.current, 'optionalCall', _259 => _259(event)]);
7844
+ _optionalChain([onLifecycleRef, 'access', _247 => _247.current, 'optionalCall', _248 => _248(event)]);
7597
7845
  if (event.type === "smart-account-changed" && !event.evm && !event.solana) {
7598
7846
  historyStaleRef.current = true;
7599
7847
  }
@@ -7619,10 +7867,10 @@ function DepositModalInner({
7619
7867
  store.dispatch({ type: "flow/reset" });
7620
7868
  }
7621
7869
  }, [isOpen, store]);
7622
- const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _260 => _260.showBackButton]), () => ( true));
7870
+ const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _249 => _249.showBackButton]), () => ( true));
7623
7871
  const canGoBack = backHandler !== void 0;
7624
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.RpcUrlsProvider, { value: rpcUrls, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DepositStoreProvider, { store, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
7625
- _chunkPDFLALUTcjs.Modal,
7872
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.RpcUrlsProvider, { value: rpcUrls, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DepositStoreProvider, { store, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
7873
+ _chunkVPWWFWZTcjs.Modal,
7626
7874
  {
7627
7875
  isOpen,
7628
7876
  onClose,
@@ -7638,7 +7886,7 @@ function DepositModalInner({
7638
7886
  className: "rs-modal-header-back",
7639
7887
  "aria-label": "Go back",
7640
7888
  onClick: backHandler,
7641
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.ChevronLeftIcon, {})
7889
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.ChevronLeftIcon, {})
7642
7890
  }
7643
7891
  ) }),
7644
7892
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-header-nav-right", children: [
@@ -7650,7 +7898,7 @@ function DepositModalInner({
7650
7898
  "aria-label": "Deposit history",
7651
7899
  onClick: handleHistoryOpen,
7652
7900
  disabled: !recipient,
7653
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.HistoryIcon, {})
7901
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.HistoryIcon, {})
7654
7902
  }
7655
7903
  ),
7656
7904
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
@@ -7660,12 +7908,12 @@ function DepositModalInner({
7660
7908
  onClick: onClose,
7661
7909
  className: "rs-modal-close",
7662
7910
  "aria-label": "Close",
7663
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.CloseIcon, {})
7911
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.CloseIcon, {})
7664
7912
  }
7665
7913
  )
7666
7914
  ] })
7667
7915
  ] }),
7668
- recipientIsContract ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.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,
7916
+ recipientIsContract ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.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,
7669
7917
  DepositFlow,
7670
7918
  {
7671
7919
  dappWalletClient,
@@ -7680,7 +7928,6 @@ function DepositModalInner({
7680
7928
  amount: defaultAmount,
7681
7929
  recipient,
7682
7930
  appBalanceUsd,
7683
- postBridgeActions,
7684
7931
  outputTokenRules,
7685
7932
  rejectUnmapped,
7686
7933
  signerAddress,