@rhinestone/deposit-modal 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/dist/{DepositModalReown-DNW4GH6L.cjs → DepositModalReown-KFTMS2WX.cjs} +9 -7
  2. package/dist/{DepositModalReown-6SUEC5IU.mjs → DepositModalReown-PC7EX5VK.mjs} +6 -4
  3. package/dist/{WithdrawModalReown-7UAGSOSU.mjs → WithdrawModalReown-BE23LUMT.mjs} +5 -4
  4. package/dist/{WithdrawModalReown-OUWBSKSM.cjs → WithdrawModalReown-Z2YF2FSJ.cjs} +8 -7
  5. package/dist/{caip-CrQ2KKU-.d.cts → caip-CsslyHGL.d.cts} +1 -1
  6. package/dist/{caip-CrQ2KKU-.d.ts → caip-CsslyHGL.d.ts} +1 -1
  7. package/dist/{chunk-33H6O5UU.cjs → chunk-3MXWIYAT.cjs} +16 -6
  8. package/dist/{chunk-KJ2RR2D4.mjs → chunk-3PVDRSJ7.mjs} +930 -682
  9. package/dist/{chunk-VVJAIMKB.cjs → chunk-7MP2UWIQ.cjs} +1091 -843
  10. package/dist/{chunk-MILJQWPT.cjs → chunk-ABVRVW3P.cjs} +133 -8
  11. package/dist/{chunk-2SMS542Q.cjs → chunk-AE5LHTPM.cjs} +122 -100
  12. package/dist/chunk-F7P4MV72.mjs +295 -0
  13. package/dist/chunk-FJWLC4AM.mjs +212 -0
  14. package/dist/{chunk-KAWJABTW.mjs → chunk-GKC22JC4.mjs} +901 -717
  15. package/dist/chunk-NRNJAQUA.cjs +212 -0
  16. package/dist/{chunk-RABZINV3.cjs → chunk-OQVLEVNR.cjs} +758 -574
  17. package/dist/chunk-UEKPBRBY.cjs +295 -0
  18. package/dist/{chunk-GPSBM66J.mjs → chunk-UFKFSGT3.mjs} +14 -4
  19. package/dist/{chunk-TKQYTBU6.mjs → chunk-WCIGOV34.mjs} +36 -14
  20. package/dist/{chunk-6YRDD462.mjs → chunk-WJX3TJFK.mjs} +135 -10
  21. package/dist/constants.cjs +2 -2
  22. package/dist/constants.d.cts +1 -1
  23. package/dist/constants.d.ts +1 -1
  24. package/dist/constants.mjs +1 -1
  25. package/dist/deposit.cjs +6 -4
  26. package/dist/deposit.d.cts +4 -4
  27. package/dist/deposit.d.ts +4 -4
  28. package/dist/deposit.mjs +5 -3
  29. package/dist/index.cjs +7 -5
  30. package/dist/index.d.cts +4 -3
  31. package/dist/index.d.ts +4 -3
  32. package/dist/index.mjs +6 -4
  33. package/dist/polymarket.cjs +64 -0
  34. package/dist/polymarket.d.cts +57 -0
  35. package/dist/polymarket.d.ts +57 -0
  36. package/dist/polymarket.mjs +64 -0
  37. package/dist/styles.css +252 -9
  38. package/dist/{types-BMcGO5k_.d.cts → types-CFRuisqK.d.cts} +10 -1
  39. package/dist/{types-BMcGO5k_.d.ts → types-CFRuisqK.d.ts} +10 -1
  40. package/dist/withdraw.cjs +5 -4
  41. package/dist/withdraw.d.cts +4 -4
  42. package/dist/withdraw.d.ts +4 -4
  43. package/dist/withdraw.mjs +4 -3
  44. package/package.json +15 -2
@@ -1,3 +1,13 @@
1
+ import {
2
+ POLYMARKET_COLLATERAL_OFFRAMP_ADDRESS,
3
+ POLYMARKET_ICON_URL,
4
+ POLYMARKET_POLYGON_CHAIN_ID,
5
+ POLYMARKET_PUSD_ADDRESS,
6
+ POLYMARKET_USDCE_ADDRESS,
7
+ executePolymarketSafeTransfer,
8
+ fetchPolymarketProxyWallet,
9
+ readPolymarketBalances
10
+ } from "./chunk-FJWLC4AM.mjs";
1
11
  import {
2
12
  AlertTriangleIcon,
3
13
  ArrowUpRightIcon,
@@ -21,10 +31,10 @@ import {
21
31
  PlusCircleIcon,
22
32
  PoweredBy,
23
33
  ProcessingStep,
24
- SAFE_ABI,
25
34
  Spinner,
26
35
  Tooltip,
27
36
  TransferCryptoIcon,
37
+ UnplugIcon,
28
38
  WalletIcon,
29
39
  accountFromPrivateKey,
30
40
  applyTheme,
@@ -35,6 +45,8 @@ import {
35
45
  debugError,
36
46
  debugLog,
37
47
  failureMessageForEvent,
48
+ formatReceiveEstimate,
49
+ formatTokenAmount,
38
50
  formatUserError,
39
51
  getAssetId,
40
52
  getEventSourceDetails,
@@ -50,7 +62,10 @@ import {
50
62
  tokenFormatter,
51
63
  txRefsMatch,
52
64
  useLatestRef
53
- } from "./chunk-KAWJABTW.mjs";
65
+ } from "./chunk-GKC22JC4.mjs";
66
+ import {
67
+ SAFE_ABI
68
+ } from "./chunk-F7P4MV72.mjs";
54
69
  import {
55
70
  DEFAULT_BACKEND_URL,
56
71
  DEFAULT_SIGNER_ADDRESS,
@@ -80,7 +95,7 @@ import {
80
95
  isVirtualDestination,
81
96
  parseEvmChainId,
82
97
  targetChainToCaip2
83
- } from "./chunk-6YRDD462.mjs";
98
+ } from "./chunk-WJX3TJFK.mjs";
84
99
 
85
100
  // src/DepositModal.tsx
86
101
  import {
@@ -92,7 +107,7 @@ import {
92
107
  lazy as lazy2,
93
108
  Suspense as Suspense2
94
109
  } from "react";
95
- import { isAddress as isAddress2 } from "viem";
110
+ import { isAddress } from "viem";
96
111
 
97
112
  // src/DepositFlow.tsx
98
113
  import {
@@ -863,25 +878,21 @@ function ConfirmStep({
863
878
  const targetChainIcon = getChainIcon(targetChain);
864
879
  const sourceTokenIcon = getTokenIcon(asset.symbol);
865
880
  const targetTokenIcon = getTokenIcon(targetSymbol);
866
- const formattedSendAmount = amount && !Number.isNaN(Number(amount)) ? Number(amount).toLocaleString("en-US", {
867
- minimumFractionDigits: 2,
868
- maximumFractionDigits: 6
869
- }) : "0";
870
- const formattedReceiveAmount = (() => {
871
- if (sameRoute) return formattedSendAmount;
872
- const dollarValue = Number(targetAmount);
873
- if (!Number.isFinite(dollarValue) || dollarValue <= 0)
874
- return formattedSendAmount;
875
- if (targetTokenPriceUsd !== null && targetTokenPriceUsd > 0) {
876
- const tokenAmount = dollarValue / targetTokenPriceUsd;
877
- return tokenAmount.toLocaleString("en-US", {
878
- minimumFractionDigits: 2,
879
- maximumFractionDigits: 6
880
- });
881
- }
882
- return formattedSendAmount;
881
+ const formattedSendAmount = amount && Number.isFinite(Number(amount)) ? formatTokenAmount(Number(amount), asset.symbol) ?? "0" : "0";
882
+ const receiveDisplay = (() => {
883
+ if (sameRoute) return `${formattedSendAmount} ${asset.symbol}`;
884
+ const usdValue = Number(targetAmount);
885
+ const sourceAmountUsd = Number.isFinite(usdValue) && usdValue > 0 ? usdValue : void 0;
886
+ const estimate = formatReceiveEstimate({
887
+ sourceAmount: Number.isFinite(Number(amount)) ? Number(amount) : void 0,
888
+ sourceSymbol: asset.symbol,
889
+ targetSymbol,
890
+ sourceAmountUsd,
891
+ prices: targetTokenPriceUsd !== null && targetTokenPriceUsd > 0 ? { [targetSymbol.toUpperCase()]: targetTokenPriceUsd } : {}
892
+ });
893
+ if (estimate !== void 0) return estimate;
894
+ return sourceAmountUsd !== void 0 ? `~$${sourceAmountUsd.toFixed(2)}` : `${formattedSendAmount} ${asset.symbol}`;
883
895
  })();
884
- const receiveAmount = sameRoute ? formattedReceiveAmount : `~${formattedReceiveAmount}`;
885
896
  const feeSponsored = uiConfig?.feeSponsored ?? false;
886
897
  const feeTooltip = uiConfig?.feeTooltip ?? (feeSponsored ? "Network fees are sponsored for this deposit." : "Network fees apply.");
887
898
  const feeDisplay = quote ? `$${quote.fees.totalUsd.toFixed(2)}` : null;
@@ -1035,11 +1046,7 @@ function ConfirmStep({
1035
1046
  /* @__PURE__ */ jsxs4("div", { className: "rs-review-detail-row", children: [
1036
1047
  /* @__PURE__ */ jsx4("span", { children: "Receive" }),
1037
1048
  /* @__PURE__ */ jsxs4("span", { className: "rs-review-detail-value", children: [
1038
- /* @__PURE__ */ jsxs4("span", { children: [
1039
- receiveAmount,
1040
- " ",
1041
- targetSymbol
1042
- ] }),
1049
+ /* @__PURE__ */ jsx4("span", { children: receiveDisplay }),
1043
1050
  targetTokenIcon && /* @__PURE__ */ jsx4("span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ jsx4("img", { src: targetTokenIcon, alt: "" }) })
1044
1051
  ] })
1045
1052
  ] }),
@@ -2041,12 +2048,28 @@ import { useCallback as useCallback3 } from "react";
2041
2048
  // src/components/steps/SwappedIframeStep.tsx
2042
2049
  import { useState as useState6, useEffect as useEffect6, useRef as useRef6, useMemo as useMemo4 } from "react";
2043
2050
 
2044
- // src/components/steps/SwappedOrderTracker.tsx
2051
+ // src/components/steps/FinalisingDepositStep.tsx
2045
2052
  import { jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
2053
+ function FinalisingDepositStep() {
2054
+ return /* @__PURE__ */ jsxs7("div", { className: "rs-screen rs-finalising", children: [
2055
+ /* @__PURE__ */ jsxs7("div", { className: "rs-screen-body rs-finalising-body", children: [
2056
+ /* @__PURE__ */ jsx7("span", { className: "rs-finalising-spinner", children: /* @__PURE__ */ jsx7(Spinner, {}) }),
2057
+ /* @__PURE__ */ jsxs7("div", { className: "rs-finalising-text", children: [
2058
+ /* @__PURE__ */ jsx7("h2", { className: "rs-finalising-title", children: "Finalising deposit" }),
2059
+ /* @__PURE__ */ jsx7("p", { className: "rs-finalising-subtitle", children: "We are depositing your funds to the application." })
2060
+ ] })
2061
+ ] }),
2062
+ /* @__PURE__ */ jsx7(PoweredBy, {})
2063
+ ] });
2064
+ }
2065
+ FinalisingDepositStep.displayName = "FinalisingDepositStep";
2066
+
2067
+ // src/components/steps/SwappedOrderTracker.tsx
2068
+ import { jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
2046
2069
  var STEP_LABELS = [
2047
2070
  "Payment received",
2048
2071
  null,
2049
- "Processing App deposit",
2072
+ "Processing deposit",
2050
2073
  "Deposit successful"
2051
2074
  ];
2052
2075
  function SwappedOrderTracker({
@@ -2065,23 +2088,23 @@ function SwappedOrderTracker({
2065
2088
  STEP_LABELS[2],
2066
2089
  STEP_LABELS[3]
2067
2090
  ];
2068
- return /* @__PURE__ */ jsxs7("div", { className: "rs-screen rs-swapped-tracker", children: [
2069
- /* @__PURE__ */ jsxs7("div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
2070
- /* @__PURE__ */ jsx7(BodyHeader, { icon: /* @__PURE__ */ jsx7(HandCoinsIcon, {}), title }),
2071
- /* @__PURE__ */ jsx7("ol", { className: "rs-swapped-tracker-steps", children: labels.map((label, idx) => {
2091
+ return /* @__PURE__ */ jsxs8("div", { className: "rs-screen rs-swapped-tracker", children: [
2092
+ /* @__PURE__ */ jsxs8("div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
2093
+ /* @__PURE__ */ jsx8(BodyHeader, { icon: /* @__PURE__ */ jsx8(HandCoinsIcon, {}), title }),
2094
+ /* @__PURE__ */ jsx8("ol", { className: "rs-swapped-tracker-steps", children: labels.map((label, idx) => {
2072
2095
  const status = stepStates[idx];
2073
- return /* @__PURE__ */ jsxs7(
2096
+ return /* @__PURE__ */ jsxs8(
2074
2097
  "li",
2075
2098
  {
2076
2099
  className: `rs-swapped-tracker-step rs-swapped-tracker-step--${status}`,
2077
2100
  children: [
2078
- /* @__PURE__ */ jsx7("span", { className: "rs-swapped-tracker-step-label", children: label }),
2079
- /* @__PURE__ */ jsx7(
2101
+ /* @__PURE__ */ jsx8("span", { className: "rs-swapped-tracker-step-label", children: label }),
2102
+ /* @__PURE__ */ jsx8(
2080
2103
  "span",
2081
2104
  {
2082
2105
  className: "rs-swapped-tracker-step-marker",
2083
2106
  "aria-hidden": "true",
2084
- children: status === "complete" ? /* @__PURE__ */ jsx7(CheckIcon, {}) : status === "failed" ? /* @__PURE__ */ jsx7(CloseIcon, {}) : status === "active" ? /* @__PURE__ */ jsx7(Spinner, {}) : null
2107
+ children: status === "complete" ? /* @__PURE__ */ jsx8(CheckIcon, {}) : status === "failed" ? /* @__PURE__ */ jsx8(CloseIcon, {}) : status === "active" ? /* @__PURE__ */ jsx8(Spinner, {}) : null
2085
2108
  }
2086
2109
  )
2087
2110
  ]
@@ -2089,13 +2112,13 @@ function SwappedOrderTracker({
2089
2112
  label
2090
2113
  );
2091
2114
  }) }),
2092
- terminal && /* @__PURE__ */ jsxs7(
2115
+ terminal && /* @__PURE__ */ jsxs8(
2093
2116
  "div",
2094
2117
  {
2095
2118
  className: `rs-swapped-tracker-terminal rs-swapped-tracker-terminal--${terminal.kind}`,
2096
2119
  children: [
2097
- /* @__PURE__ */ jsx7("p", { className: "rs-swapped-tracker-terminal-message", children: terminal.message }),
2098
- terminal.kind === "cancelled" && onRetry && /* @__PURE__ */ jsx7(
2120
+ /* @__PURE__ */ jsx8("p", { className: "rs-swapped-tracker-terminal-message", children: terminal.message }),
2121
+ terminal.kind === "cancelled" && onRetry && /* @__PURE__ */ jsx8(
2099
2122
  "button",
2100
2123
  {
2101
2124
  type: "button",
@@ -2108,7 +2131,7 @@ function SwappedOrderTracker({
2108
2131
  }
2109
2132
  )
2110
2133
  ] }),
2111
- /* @__PURE__ */ jsx7(PoweredBy, {})
2134
+ /* @__PURE__ */ jsx8(PoweredBy, {})
2112
2135
  ] });
2113
2136
  }
2114
2137
  function formatTrackerAmount(amount) {
@@ -2120,7 +2143,7 @@ function formatTrackerAmount(amount) {
2120
2143
  SwappedOrderTracker.displayName = "SwappedOrderTracker";
2121
2144
 
2122
2145
  // src/components/steps/SwappedIframeStep.tsx
2123
- import { jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
2146
+ import { jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
2124
2147
  var STATUS_POLL_INTERVAL_MS = 2e3;
2125
2148
  var DEPOSIT_POLL_INTERVAL_MS = 2e3;
2126
2149
  var DEPOSIT_POLL_FAST_INITIAL_DELAY_MS = 1e3;
@@ -2377,7 +2400,11 @@ function SwappedIframeStep({
2377
2400
  );
2378
2401
  }, [latestEvent]);
2379
2402
  if (phase === "tracker") {
2380
- return /* @__PURE__ */ jsx8(
2403
+ const paymentReceived = stepStates[0] === "complete";
2404
+ if (variant === "connect" && !terminalState && paymentReceived) {
2405
+ return /* @__PURE__ */ jsx9(FinalisingDepositStep, {});
2406
+ }
2407
+ return /* @__PURE__ */ jsx9(
2381
2408
  SwappedOrderTracker,
2382
2409
  {
2383
2410
  amount: orderState?.orderCryptoAmount ?? null,
@@ -2389,20 +2416,20 @@ function SwappedIframeStep({
2389
2416
  }
2390
2417
  );
2391
2418
  }
2392
- return /* @__PURE__ */ jsxs8("div", { className: "rs-screen rs-fiat-onramp", "data-variant": variant, children: [
2393
- /* @__PURE__ */ jsxs8("div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
2394
- /* @__PURE__ */ jsx8(
2419
+ return /* @__PURE__ */ jsxs9("div", { className: "rs-screen rs-fiat-onramp", "data-variant": variant, children: [
2420
+ /* @__PURE__ */ jsxs9("div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
2421
+ /* @__PURE__ */ jsx9(
2395
2422
  BodyHeader,
2396
2423
  {
2397
- icon: /* @__PURE__ */ jsx8(HandCoinsIcon, {}),
2424
+ icon: /* @__PURE__ */ jsx9(HandCoinsIcon, {}),
2398
2425
  title: "Deposit",
2399
2426
  subtitle: "Add money to your balance"
2400
2427
  }
2401
2428
  ),
2402
- /* @__PURE__ */ jsxs8("div", { className: "rs-fiat-onramp-iframe-wrap", children: [
2403
- loadError && /* @__PURE__ */ jsxs8("div", { className: "rs-fiat-onramp-error", children: [
2404
- /* @__PURE__ */ jsx8("div", { children: loadError }),
2405
- /* @__PURE__ */ jsx8(
2429
+ /* @__PURE__ */ jsxs9("div", { className: "rs-fiat-onramp-iframe-wrap", children: [
2430
+ loadError && /* @__PURE__ */ jsxs9("div", { className: "rs-fiat-onramp-error", children: [
2431
+ /* @__PURE__ */ jsx9("div", { children: loadError }),
2432
+ /* @__PURE__ */ jsx9(
2406
2433
  "button",
2407
2434
  {
2408
2435
  type: "button",
@@ -2412,8 +2439,8 @@ function SwappedIframeStep({
2412
2439
  }
2413
2440
  )
2414
2441
  ] }),
2415
- !loadError && !iframeLoaded && /* @__PURE__ */ jsx8("div", { className: "rs-fiat-onramp-loading", children: /* @__PURE__ */ jsx8(Spinner, {}) }),
2416
- widgetUrl && !loadError && /* @__PURE__ */ jsx8(
2442
+ !loadError && !iframeLoaded && /* @__PURE__ */ jsx9("div", { className: "rs-fiat-onramp-loading", children: /* @__PURE__ */ jsx9(Spinner, {}) }),
2443
+ widgetUrl && !loadError && /* @__PURE__ */ jsx9(
2417
2444
  "iframe",
2418
2445
  {
2419
2446
  src: widgetUrl,
@@ -2427,7 +2454,7 @@ function SwappedIframeStep({
2427
2454
  )
2428
2455
  ] })
2429
2456
  ] }),
2430
- /* @__PURE__ */ jsx8(PoweredBy, {})
2457
+ /* @__PURE__ */ jsx9(PoweredBy, {})
2431
2458
  ] });
2432
2459
  }
2433
2460
  function deriveStepStates(swappedStatus, latestEvent) {
@@ -2454,7 +2481,7 @@ function deriveStepStates(swappedStatus, latestEvent) {
2454
2481
  SwappedIframeStep.displayName = "SwappedIframeStep";
2455
2482
 
2456
2483
  // src/components/steps/FiatOnrampStep.tsx
2457
- import { jsx as jsx9 } from "react/jsx-runtime";
2484
+ import { jsx as jsx10 } from "react/jsx-runtime";
2458
2485
  function fiatBannerForStatus(status, context) {
2459
2486
  if (context.currencyMismatch) {
2460
2487
  return {
@@ -2495,14 +2522,9 @@ function FiatOnrampStep({
2495
2522
  smartAccount,
2496
2523
  method: paymentMethod
2497
2524
  });
2498
- if (res.currencyCode !== "USDC_BASE") {
2499
- console.warn(
2500
- `[FiatOnrampStep] Expected backend to return currencyCode=USDC_BASE, got ${res.currencyCode}. Swapped purchases may not bridge as expected.`
2501
- );
2502
- }
2503
2525
  return res;
2504
2526
  }, [service, smartAccount, paymentMethod]);
2505
- return /* @__PURE__ */ jsx9(
2527
+ return /* @__PURE__ */ jsx10(
2506
2528
  SwappedIframeStep,
2507
2529
  {
2508
2530
  smartAccount,
@@ -2524,7 +2546,7 @@ FiatOnrampStep.displayName = "FiatOnrampStep";
2524
2546
 
2525
2547
  // src/components/steps/ExchangeConnectStep.tsx
2526
2548
  import { useCallback as useCallback4 } from "react";
2527
- import { jsx as jsx10 } from "react/jsx-runtime";
2549
+ import { jsx as jsx11 } from "react/jsx-runtime";
2528
2550
  function connectBannerForStatus(status, context) {
2529
2551
  if (context.currencyMismatch) {
2530
2552
  return {
@@ -2568,14 +2590,9 @@ function ExchangeConnectStep({
2568
2590
  smartAccount,
2569
2591
  connection
2570
2592
  });
2571
- if (res.currencyCode !== "USDC_BASE") {
2572
- console.warn(
2573
- `[ExchangeConnectStep] Expected backend to return currencyCode=USDC_BASE, got ${res.currencyCode}. Swapped Connect pulls may not bridge as expected.`
2574
- );
2575
- }
2576
2593
  return res;
2577
2594
  }, [service, smartAccount, connection]);
2578
- return /* @__PURE__ */ jsx10(
2595
+ return /* @__PURE__ */ jsx11(
2579
2596
  SwappedIframeStep,
2580
2597
  {
2581
2598
  smartAccount,
@@ -2597,13 +2614,117 @@ ExchangeConnectStep.displayName = "ExchangeConnectStep";
2597
2614
 
2598
2615
  // src/components/steps/ExchangeSelectStep.tsx
2599
2616
  import { useCallback as useCallback5, useEffect as useEffect7, useState as useState7 } from "react";
2600
- import { jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
2617
+
2618
+ // src/components/ui/ExchangeLogos.tsx
2619
+ import { jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
2620
+ var HTX_LOGO_DATA_URI = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAXYAAACQCAMAAAAr6rB8AAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAACNUExURQAAAAAAPgAAPgAAPgAAQAAAPQAAPgAAPQAAPQAAPgAAOAAAPgAAPQAAPQAAPAAAOgAAPgAAPQAAPQAAQAAAQACK1QCM1QCNzwCL1gCL1gCM1QCM1gCL1gAAPgCL1wCK1ACL1QCL0wCM1gCM1QCM1ACL1AAAPQCM1gAAPgCM1gAAOgCM1gAAPgCM1v///6KyLqIAAAAsdFJOUwCAj88Qn6BQv+8g33CvQDCQT2AgUCBgEN+AkL/eb58wcECw71Cgvs/O7zGgm66ePgAAAAFiS0dELlTTEIcAAAAHdElNRQfoDAUMAwII1OX3AAAI7ElEQVR42u2dbWPaOBCEQ8Ml4UyAg5IQ0ru8kLS9Vv7/f+9CaArYs7sjg/GtrfmKjeXHYjVarcXZGa/ep4iDk46lXjjvN92GDqoXEvcG9IY9/NF0I7qnizfsodd0Kzqnd+zhsulmdE1X79gHfzbdjo5pgz1cNd2OjinbYA/DphvSLf2iHgbJRZ5Q/Q/s4brppnRJo9/Yw6jptnRIl1vsaVQ9nXohdfcGdL2D/bzpxnRHVyF19wY02MWeovuJNA4hdffT63Ife+rup9FkH3tIU9WT6LyAPSXeT6F+gXoYNN2iTuiyiD0NqqfQRQn7pOkmdUFZSFHm9BqHkKLM6TUB2CdNN6r9ygD2lA+rWyjGpBlT7bqA2P9qulktVz+D2CdNt6vlmkLqKR1Ws3BnT869XgmdPYRUl1enMgl7GlNrlNjZw7TpprVZYmdPVqZGyZ09vdtRn/pyZ08Osj71ZOopK1ObZgr1kDXdutYqS9gbkBZiEva6pIaYhL0m9bOEvQF9Cgn76dUzqCffXofGFvX07lgNmmUm9vSG6tFlDadrpUqZo+vcpp5KB44uy8QcPqKOpyUxv56+ddpseiSN1982Qp98pm5wfoOknmKamLUOW+XoVXuOYAa3n38e2Q3n9F7BPxugj5hB7XaRA90dTP3ApVQf2EGFeeB2d1ki6veHUz/QtTvBDss/iZT3DaL+Za6c8TfXrAMXsL1gx5bO2pxxDkOMFtmnXKsOzQx4wS5MG43h/x5R/+dw6uUBVfsBecZ+NkSf6uH9LjbEjAdco0qd/SF/bCn2/ff+mcbOEfX86XDq5c5+Y7gjx9hjXWS0dyQSMRuVI/uz5Ur9YscuMoylNkLv+OUI1IFnX5mzAb/YsYvMhOQI9I65HNh56pPSuS/ELMwv9hgXOY8NMUz6a/Ocy539mbCmfrELLhKmR6B3VKanTPpLutx27H5oJXbeRcZ6R3JyGmDJ6evvKyxI/+4MO3aRX5X+x01PZ3R7wFCya5m+tRM7dpHF8I69ozw9ZVaTfgn8svYG72UrsQsuspAkwN5RDgB8YEc7yew/Y2U65hg75SKf4qanbCYGlwsUnOritkHsiq4OOPdMCgiF8A5G1LvIb4RPF6WAigGNCTP+sAsuspAkKPlHZXrKLWyshWbE5SdMhBmH2AUXuY9kviqwUKanNHUU2MG0TF288osdu8hCeH9hQ4ywp0AgW/ma5xW6u0vslItckh2QHvxh8gdOEBbtxC64yP3/idn17trSBvzpAOEVlW8Iu52b8Ykdu8gCmIcVg4Hu7LAsB6c57ejuFDvlIh8/KGirp2xkhztu4jQnEd2dYhfW3wou8tkOMayNwVBeBepmd/eKHbvIQpLgV3jXuh7Z2eE8CU+GNzKmqm6xUy7yyfCOxjuQW+EChYWM/bGt2LGLLCRNlur0lB5Q8VbKS5m6FWX8YheQlZIE6sIDF2Nw85QQY0YZx9gpFzl/VL+CijE4sM8XKnb9up6xYxf5PeI1Cy7G4MD+qlJXTatv7IKLjPizcCr3iAP7jU49/7e92CkXGdmUknBxrxFi8lwfU3xjx9z4P5Nlah4rhZjcyMvwKX5LjWDHLvIrebb9zq8UYl5M6voik3PsnIuUdBlMCe8PmCEmz5/bjB27SLkeNfbmcYi5s6nrFTPusWMXmVEu8tq6J6Fhc4K6bmXcYz/7Ud1FmkYmqzqertVu7IKLZMK7WeSLx1Oqs+sOsgXYq7tIKzUgjKf3CftaP2B7vtsnWreEX3C35qddwS6kEe3wbtxRdfP4Lq3WvQXYh1KLzCRBpTt6Iqm3vLfPxBm+6SKNO8KjAxnZ245dGRetJIGeksG5qQeWeruxqzdguEjdyeABlfPsa1VutQPsn9U2DfQkge7bYYgiPXve7lmq9TKpHt7V5ACOMax7bHdOxpzeqy5yop2JA9Q3GnvsXkGDjND/AzvRaS6V04faidB+8jEmOt/uZ3WJqaTTkgRqvh2e8chjf2krdu6dI+V2+sppeEMsPsboL2R7xk7WL/bkb1CeG9zCNyLGtLZygH6tUU4SKA9ugo4nllA/pK7pOcY+Y7c6Ulyk8uTgb2TJY4/e4dMJdhggerD/int+K8EdYqfzMUaZjF/s0Dt+FYZZMUkg+36YGuCpt7TiFyYF1kufsIJDdJGy8UdPik+DWS+NOcWOkwLvPXSIPpHqUeUog4IMnWq3YoxX7DCb0hO/X04SiFFmAg7mEzJ6va9X7DA2fKzBYYsjuEix1Bo1ialKojq7T+w4KfA7fkdtfy3ZUDRLpbG38r1U063AzKJwW9Kgiv5inMZubjrgETv05rtfEeMi+1J3Z/d9qxDZXWKHU8v9sjkc3vFSk9TdwQ7tLHZ7ezx/2KkRcwgfDXSRUh5zUj6UdDLE5qf+sOOkQPEo6DDxZYSsO8DAZcLsbU0cYle941Yx4R1790H5t8HlfZmt8bxhp+f+EUkCIZcJnP6KoE7tr+wMu5IUKAq6SFyPOoTYJ+UDiQwkt+2pM+wRITsmSYBLtcvH2Uup5Ca/vrDjwC6kuSKSBPhHVD7UTEGuGt5auRbsRlKgKGzw4UOCr0pOysdZS9jUTrPOsPc577hVRJJgCI4EXsaYMDW+bX4d2OEGyFpVb4yL7FFH3q6OQt0TdiIpUBR8vWZAJwkACWURe8VTd4Qdj5DG/2cO4aPCYzBAUR5U5RnTiv2DCF/YYcCYVLiYuNRUZgFQSNGd/XsIZ9jJpECpofz8Cl2j3N2F6P6T2bXdH3a8+Ea8expVSTAkWKAp0+oxCrob7LO48pddxSw1la8DZlflDMF95P9HusFuLigp+o7OlSoJZoUrARjFreEXakm1Z+w4sJObJEVVErz51Mw6bq9cZhFhG51hx0kBekuwIXxoYj3qfodHNLZuZnUXN5R6wh6dFCgqrh717e52E51oAHmtHNQ/rjAqidl5qF8+bcZechx7LrjYmyJusj9F0l7iG23Bg8zM2e0mJfazIvQkUbOLTPlZve9H+Bz9pUmERhvyqLuv/wohbl6aFKHx9Dob4NexlzE5mKSt/gNCZI6GyUmWNAAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAyNC0xMi0wNVQxMjowMzowMiswMDowMLpM60QAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMjQtMTItMDVUMTI6MDM6MDIrMDA6MDDLEVP4AAAAKHRFWHRkYXRlOnRpbWVzdGFtcAAyMDI0LTEyLTA1VDEyOjAzOjAyKzAwOjAwnARyJwAAAABJRU5ErkJggg==";
2621
+ function Tile({
2622
+ bg,
2623
+ children,
2624
+ fg = "#fff"
2625
+ }) {
2626
+ return /* @__PURE__ */ jsxs10("svg", { viewBox: "0 0 40 40", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: [
2627
+ /* @__PURE__ */ jsx12("rect", { width: "40", height: "40", fill: bg }),
2628
+ /* @__PURE__ */ jsx12("g", { color: fg, children })
2629
+ ] });
2630
+ }
2631
+ function Icon({
2632
+ children,
2633
+ x = 8,
2634
+ y = 8,
2635
+ size = 24,
2636
+ viewBox = "0 0 24 24"
2637
+ }) {
2638
+ return /* @__PURE__ */ jsx12("svg", { x, y, width: size, height: size, viewBox, children });
2639
+ }
2640
+ var LOGOS = {
2641
+ coinbase: () => /* @__PURE__ */ jsx12(Tile, { bg: "#0052FF", children: /* @__PURE__ */ jsx12(Icon, { x: 7, y: 7, size: 26, viewBox: "0 0 512 512", children: /* @__PURE__ */ jsx12(
2642
+ "path",
2643
+ {
2644
+ fill: "#fff",
2645
+ d: "M256.737 338.138c-45.081 0-81.512-36.531-81.512-81.513 0-44.98 36.53-81.512 81.512-81.512 40.356 0 73.863 29.387 80.306 67.925h82.113C412.212 159.313 342.175 93.5 256.637 93.5c-90.069 0-163.125 73.063-163.125 163.125 0 90.07 73.056 163.125 163.125 163.125 85.538 0 155.575-65.812 162.519-149.537h-82.213c-6.443 38.537-39.85 67.925-80.206 67.925z"
2646
+ }
2647
+ ) }) }),
2648
+ binance: () => /* @__PURE__ */ jsx12(Tile, { bg: "#181A20", children: /* @__PURE__ */ jsx12(Icon, { children: /* @__PURE__ */ jsx12(
2649
+ "path",
2650
+ {
2651
+ fill: "#F0B90B",
2652
+ d: "m16.624 13.920 2.718 2.716-7.353 7.353-7.353-7.353 2.717-2.716 4.636 4.66zm4.637-4.636L24 12l-2.715 2.716L18.568 12zm-9.272.001 2.716 2.691-2.716 2.717L9.272 12zm-9.273-.001L5.409 12l-2.692 2.692L0 12zM11.989.012l7.353 7.329-2.718 2.715-4.635-4.636-4.636 4.66-2.717-2.716z"
2653
+ }
2654
+ ) }) }),
2655
+ bitfinex: () => /* @__PURE__ */ jsx12(Tile, { bg: "#101914", children: /* @__PURE__ */ jsxs10(Icon, { x: 5, y: 8, size: 30, viewBox: "780 0 116 100", children: [
2656
+ /* @__PURE__ */ jsx12(
2657
+ "path",
2658
+ {
2659
+ fill: "#97C554",
2660
+ d: "m792.54 88.414c4.795 5.078 31.135 29.418 72.478 1.17C894.913 66.302 894.166 15.827 891.294.584c-1 2.219-35.724 78.26-98.754 87.83Z"
2661
+ }
2662
+ ),
2663
+ /* @__PURE__ */ jsx12(
2664
+ "path",
2665
+ {
2666
+ fill: "#709B30",
2667
+ d: "M891.29.572c-.366-.152-38.827-5.395-76.85 19.094-23.61 15.207-26.731 37.464-25.654 52.295 55.273-6.185 101.25-69.646 102.504-71.39Z"
2668
+ }
2669
+ )
2670
+ ] }) }),
2671
+ bybit: () => /* @__PURE__ */ jsx12(Tile, { bg: "#16171A", children: /* @__PURE__ */ jsx12(Icon, { x: 4, y: 4, size: 32, children: /* @__PURE__ */ jsxs10("g", { fill: "none", children: [
2672
+ /* @__PURE__ */ jsx12("path", { fill: "#F6A500", d: "M15.829 13.626V9h.93v4.626z" }),
2673
+ /* @__PURE__ */ jsx12(
2674
+ "path",
2675
+ {
2676
+ fill: "#fff",
2677
+ d: "M4.993 15H3v-4.626h1.913c.93 0 1.471.507 1.471 1.3 0 .513-.348.845-.588.955.287.13.655.423.655 1.04 0 .863-.609 1.33-1.458 1.33m-.154-3.82h-.91v1.065h.91c.395 0 .615-.214.615-.533 0-.317-.22-.532-.615-.532m.06 1.877h-.97v1.137h.97c.42 0 .622-.259.622-.571s-.201-.565-.622-.565zm4.388.046V15h-.923v-1.898l-1.431-2.728h1.01l.889 1.864.877-1.864h1.01zM13.355 15h-1.993v-4.626h1.913c.93 0 1.47.507 1.47 1.3 0 .513-.347.845-.588.955.287.13.655.423.655 1.04 0 .863-.608 1.33-1.457 1.33m-.155-3.82h-.91v1.065h.91c.395 0 .616-.214.616-.533 0-.317-.22-.532-.616-.532m.06 1.877h-.97v1.137h.97c.422 0 .622-.259.622-.571s-.2-.565-.622-.565zm6.495-1.876V15h-.929v-3.82h-1.245v-.806H21v.806z"
2678
+ }
2679
+ )
2680
+ ] }) }) }),
2681
+ btcturk: () => /* @__PURE__ */ jsx12(Tile, { bg: "#FFFFFF", fg: "#0D0D17", children: /* @__PURE__ */ jsx12(Icon, { x: 7, y: 7, size: 26, children: /* @__PURE__ */ jsx12(
2682
+ "path",
2683
+ {
2684
+ fill: "currentColor",
2685
+ d: "M14.126 18.743c-1.05.742-1.67 1.67-1.38 2.072s1.365.128 2.414-.612 1.667-1.668 1.379-2.072c-.089-.12-.256-.186-.474-.186-.48 0-1.218.29-1.94.798m-5.76-1.584c-2.028.842-3.433 2.088-3.141 2.796.291.709 2.17.607 4.2-.23 2.03-.836 3.428-2.084 3.137-2.797-.13-.317-.576-.47-1.21-.47-.787 0-1.865.24-2.987.701m9.293-.84c-.36.683-.47 1.33-.251 1.44.22.11.685-.345 1.043-1.028s.47-1.33.25-1.44a.15.15 0 0 0-.074-.017c-.24 0-.648.433-.968 1.045m-2.927-1.891c-.695.4-1.058 1.073-.812 1.5s1.008.448 1.703.047c.695-.4 1.057-1.073.811-1.5-.128-.222-.396-.335-.72-.335-.346.01-.684.11-.981.288m2.568-.91c-.202.348-.188.735.03.86.218.127.56-.053.76-.404.202-.35.19-.735-.03-.861a.3.3 0 0 0-.155-.041c-.204 0-.447.17-.6.445m-2.592-1.499c0 .418.384.758.858.758s.858-.34.858-.758c0-.417-.384-.757-.858-.757s-.858.339-.858.757m-5.728 0c0 .938 1.057 1.697 2.361 1.697s2.36-.755 2.36-1.697-1.055-1.698-2.36-1.698-2.361.761-2.361 1.698m8.369-2.4c-.218.12-.232.513-.03.862.201.35.541.531.76.404.22-.127.232-.51.03-.861-.158-.274-.401-.446-.6-.446a.3.3 0 0 0-.155.041m-3.413-1.545c-.24.427.12 1.099.811 1.5.691.4 1.457.38 1.703-.047s-.12-1.098-.811-1.5a2 2 0 0 0-.983-.287c-.325 0-.593.112-.72.334m3.456-1.833c-.218.12-.107.762.25 1.44.358.678.825 1.144 1.045 1.029.22-.116.105-.762-.252-1.44-.32-.612-.73-1.046-.969-1.046a.2.2 0 0 0-.074.017M5.225 4.05c-.292.708 1.115 1.96 3.14 2.797s3.902.94 4.197.233-1.115-1.962-3.14-2.798c-1.123-.464-2.196-.702-2.988-.702-.633 0-1.08.154-1.21.47m7.51-.864c-.284.403.337 1.33 1.386 2.071s2.13 1.016 2.413.612c.283-.403-.336-1.33-1.387-2.071C14.427 3.289 13.692 3 13.21 3c-.219 0-.385.06-.48.186"
2686
+ }
2687
+ ) }) }),
2688
+ gate: () => /* @__PURE__ */ jsx12(Tile, { bg: "#FFFFFF", children: /* @__PURE__ */ jsx12(Icon, { x: 7, y: 7, size: 26, children: /* @__PURE__ */ jsxs10("g", { fill: "none", children: [
2689
+ /* @__PURE__ */ jsx12("path", { fill: "#2354E6", d: "M12 16.95a4.95 4.95 0 1 1 0-9.9V3a9 9 0 1 0 9 9h-4.05A4.95 4.95 0 0 1 12 16.95" }),
2690
+ /* @__PURE__ */ jsx12("path", { fill: "#17E6A1", d: "M16.95 7.05H12V12h4.95z" })
2691
+ ] }) }) }),
2692
+ gateio: () => LOGOS.gate(),
2693
+ htx: () => /* @__PURE__ */ jsxs10("svg", { viewBox: "0 0 40 40", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: [
2694
+ /* @__PURE__ */ jsx12("rect", { width: "40", height: "40", fill: "#fff" }),
2695
+ /* @__PURE__ */ jsx12("image", { href: HTX_LOGO_DATA_URI, x: "3", y: "12", width: "34", height: "13.1", preserveAspectRatio: "xMidYMid meet" })
2696
+ ] }),
2697
+ kraken: () => /* @__PURE__ */ jsx12(Tile, { bg: "#7133F5", children: /* @__PURE__ */ jsx12(Icon, { x: 6, y: 6, size: 28, children: /* @__PURE__ */ jsx12(
2698
+ "path",
2699
+ {
2700
+ fill: "#fff",
2701
+ d: "M11.998 4.5C7.028 4.5 3 8.774 3 14.047v4.09c0 .753.575 1.363 1.285 1.363s1.288-.61 1.288-1.362v-4.091c0-.755.573-1.365 1.285-1.365.71 0 1.284.61 1.284 1.365v4.09c0 .753.575 1.363 1.285 1.363.712 0 1.286-.61 1.286-1.362v-4.091c0-.755.575-1.365 1.285-1.365.712 0 1.289.61 1.289 1.365v4.09c0 .753.574 1.363 1.284 1.363s1.285-.61 1.285-1.362v-4.091c0-.755.574-1.365 1.288-1.365.71 0 1.285.61 1.285 1.365v4.09c0 .753.575 1.363 1.287 1.363.71 0 1.284-.61 1.284-1.362v-4.091C21 8.774 16.97 4.5 11.998 4.5"
2702
+ }
2703
+ ) }) }),
2704
+ kucoin: () => /* @__PURE__ */ jsx12(Tile, { bg: "#01BC8D", children: /* @__PURE__ */ jsx12(Icon, { x: 7, y: 7, size: 26, children: /* @__PURE__ */ jsx12(
2705
+ "path",
2706
+ {
2707
+ fill: "#fff",
2708
+ d: "m7.928 11.996 7.122 7.122 4.49-4.49a2.004 2.004 0 0 1 2.865 0 2.004 2.004 0 0 1 0 2.865l-5.918 5.918a2.058 2.058 0 0 1-2.883 0l-8.541-8.542v5.07a2.034 2.034 0 1 1-4.07 0V4.043a2.034 2.034 0 1 1 4.07 0v5.088L13.604.589a2.058 2.058 0 0 1 2.883 0l5.918 5.918c.785.803.785 2.088 0 2.865-.804.785-2.089.785-2.865 0l-4.49-4.49zM15.05 9.96a2.038 2.038 0 0 0-2.053 2.035c0 1.133.902 2.052 2.035 2.052a2.038 2.038 0 0 0 2.053-2.035v-.018a2.07 2.07 0 0 0-2.035-2.034z"
2709
+ }
2710
+ ) }) })
2711
+ };
2712
+ function normalize(value) {
2713
+ return value.toLowerCase().replace(/[^a-z0-9]/g, "");
2714
+ }
2715
+ function getExchangeLogo(name, connection) {
2716
+ const render = LOGOS[normalize(name)] ?? LOGOS[normalize(connection ?? "")];
2717
+ return render ? render() : null;
2718
+ }
2719
+
2720
+ // src/components/steps/ExchangeSelectStep.tsx
2721
+ import { jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
2601
2722
  function ExchangeLogo({ exchange }) {
2602
2723
  const [failed, setFailed] = useState7(false);
2603
2724
  if (!exchange.logoUrl || failed) {
2604
- return /* @__PURE__ */ jsx11(BankIcon, {});
2725
+ return /* @__PURE__ */ jsx13(BankIcon, {});
2605
2726
  }
2606
- return /* @__PURE__ */ jsx11(
2727
+ return /* @__PURE__ */ jsx13(
2607
2728
  "img",
2608
2729
  {
2609
2730
  src: exchange.logoUrl,
@@ -2644,20 +2765,20 @@ function ExchangeSelectStep({
2644
2765
  cancelled = true;
2645
2766
  };
2646
2767
  }, [service, retryToken, onError]);
2647
- return /* @__PURE__ */ jsxs9("div", { className: "rs-screen rs-exchange-select", children: [
2648
- /* @__PURE__ */ jsxs9("div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
2649
- /* @__PURE__ */ jsx11(
2768
+ return /* @__PURE__ */ jsxs11("div", { className: "rs-screen rs-exchange-select", children: [
2769
+ /* @__PURE__ */ jsxs11("div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
2770
+ /* @__PURE__ */ jsx13(
2650
2771
  BodyHeader,
2651
2772
  {
2652
- icon: /* @__PURE__ */ jsx11(BankIcon, {}),
2653
- title: "Fund from Exchange",
2654
- subtitle: "Choose your exchange"
2773
+ icon: /* @__PURE__ */ jsx13(UnplugIcon, {}),
2774
+ title: "Connect exchange",
2775
+ subtitle: "Select an exchange to connect"
2655
2776
  }
2656
2777
  ),
2657
- loading && /* @__PURE__ */ jsx11("div", { className: "rs-exchange-select-state", "aria-live": "polite", children: /* @__PURE__ */ jsx11(Spinner, {}) }),
2658
- !loading && error && /* @__PURE__ */ jsxs9("div", { className: "rs-exchange-select-state", "aria-live": "polite", children: [
2659
- /* @__PURE__ */ jsx11("div", { className: "rs-exchange-select-state-title", children: "Couldn\u2019t load exchanges" }),
2660
- /* @__PURE__ */ jsx11(
2778
+ loading && /* @__PURE__ */ jsx13("div", { className: "rs-exchange-select-state", "aria-live": "polite", children: /* @__PURE__ */ jsx13(Spinner, {}) }),
2779
+ !loading && error && /* @__PURE__ */ jsxs11("div", { className: "rs-exchange-select-state", "aria-live": "polite", children: [
2780
+ /* @__PURE__ */ jsx13("div", { className: "rs-exchange-select-state-title", children: "Couldn\u2019t load exchanges" }),
2781
+ /* @__PURE__ */ jsx13(
2661
2782
  "button",
2662
2783
  {
2663
2784
  type: "button",
@@ -2667,9 +2788,9 @@ function ExchangeSelectStep({
2667
2788
  }
2668
2789
  )
2669
2790
  ] }),
2670
- !loading && !error && exchanges.length === 0 && /* @__PURE__ */ jsxs9("div", { className: "rs-exchange-select-state", "aria-live": "polite", children: [
2671
- /* @__PURE__ */ jsx11("div", { className: "rs-exchange-select-state-title", children: "No exchanges available" }),
2672
- /* @__PURE__ */ jsx11(
2791
+ !loading && !error && exchanges.length === 0 && /* @__PURE__ */ jsxs11("div", { className: "rs-exchange-select-state", "aria-live": "polite", children: [
2792
+ /* @__PURE__ */ jsx13("div", { className: "rs-exchange-select-state-title", children: "No exchanges available" }),
2793
+ /* @__PURE__ */ jsx13(
2673
2794
  "button",
2674
2795
  {
2675
2796
  type: "button",
@@ -2679,28 +2800,37 @@ function ExchangeSelectStep({
2679
2800
  }
2680
2801
  )
2681
2802
  ] }),
2682
- !loading && !error && exchanges.length > 0 && /* @__PURE__ */ jsx11("div", { className: "rs-exchange-grid", children: exchanges.map((exchange) => /* @__PURE__ */ jsxs9(
2683
- "button",
2684
- {
2685
- type: "button",
2686
- className: "rs-exchange-card",
2687
- onClick: () => onSelectExchange(exchange.connection),
2688
- "aria-label": `Select ${exchange.name}`,
2689
- children: [
2690
- /* @__PURE__ */ jsx11("span", { className: "rs-exchange-card-logo", children: /* @__PURE__ */ jsx11(ExchangeLogo, { exchange }) }),
2691
- /* @__PURE__ */ jsx11("span", { className: "rs-exchange-card-name", children: exchange.name })
2692
- ]
2693
- },
2694
- exchange.connection
2695
- )) })
2803
+ !loading && !error && exchanges.length > 0 && /* @__PURE__ */ jsx13("div", { className: "rs-exchange-grid", children: exchanges.map((exchange) => {
2804
+ const brand = getExchangeLogo(exchange.name, exchange.connection);
2805
+ return /* @__PURE__ */ jsxs11(
2806
+ "button",
2807
+ {
2808
+ type: "button",
2809
+ className: "rs-exchange-card",
2810
+ onClick: () => onSelectExchange(exchange.connection),
2811
+ "aria-label": `Select ${exchange.name}`,
2812
+ children: [
2813
+ /* @__PURE__ */ jsx13(
2814
+ "span",
2815
+ {
2816
+ className: `rs-exchange-card-logo${brand ? " rs-exchange-card-logo--brand" : ""}`,
2817
+ children: brand ?? /* @__PURE__ */ jsx13(ExchangeLogo, { exchange })
2818
+ }
2819
+ ),
2820
+ /* @__PURE__ */ jsx13("span", { className: "rs-exchange-card-name", children: exchange.name })
2821
+ ]
2822
+ },
2823
+ exchange.connection
2824
+ );
2825
+ }) })
2696
2826
  ] }),
2697
- /* @__PURE__ */ jsx11(PoweredBy, {})
2827
+ /* @__PURE__ */ jsx13(PoweredBy, {})
2698
2828
  ] });
2699
2829
  }
2700
2830
  ExchangeSelectStep.displayName = "ExchangeSelectStep";
2701
2831
 
2702
2832
  // src/components/steps/DepositAddressSkeleton.tsx
2703
- import { jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
2833
+ import { jsx as jsx14, jsxs as jsxs12 } from "react/jsx-runtime";
2704
2834
  var BASE_CHAIN_ID = 8453;
2705
2835
  function DepositAddressSkeleton({
2706
2836
  uiConfig,
@@ -2721,15 +2851,15 @@ function DepositAddressSkeleton({
2721
2851
  const chainName = getChainName(defaultChainId);
2722
2852
  const chainIcon = getChainIcon(defaultChainId);
2723
2853
  const tokenIcon = getTokenIcon(defaultToken);
2724
- return /* @__PURE__ */ jsxs10("div", { className: "rs-screen", "aria-busy": "true", children: [
2725
- /* @__PURE__ */ jsx12("span", { className: "rs-sr-only", role: "status", children: "Preparing deposit details\u2026" }),
2726
- /* @__PURE__ */ jsxs10("div", { className: "rs-screen-body", children: [
2727
- /* @__PURE__ */ jsx12(BodyHeader, { icon: /* @__PURE__ */ jsx12(TransferCryptoIcon, {}), title: "Transfer crypto" }),
2728
- /* @__PURE__ */ jsxs10("div", { className: "rs-deposit-address-selectors", "aria-hidden": "true", children: [
2729
- /* @__PURE__ */ jsxs10("div", { className: "rs-deposit-address-dropdown", children: [
2730
- /* @__PURE__ */ jsx12("div", { className: "rs-deposit-address-dropdown-label", children: "Supported chain" }),
2731
- /* @__PURE__ */ jsxs10("div", { className: "rs-deposit-address-dropdown-trigger", children: [
2732
- chainIcon && /* @__PURE__ */ jsx12(
2854
+ return /* @__PURE__ */ jsxs12("div", { className: "rs-screen", "aria-busy": "true", children: [
2855
+ /* @__PURE__ */ jsx14("span", { className: "rs-sr-only", role: "status", children: "Preparing deposit details\u2026" }),
2856
+ /* @__PURE__ */ jsxs12("div", { className: "rs-screen-body", children: [
2857
+ /* @__PURE__ */ jsx14(BodyHeader, { icon: /* @__PURE__ */ jsx14(TransferCryptoIcon, {}), title: "Transfer crypto" }),
2858
+ /* @__PURE__ */ jsxs12("div", { className: "rs-deposit-address-selectors", "aria-hidden": "true", children: [
2859
+ /* @__PURE__ */ jsxs12("div", { className: "rs-deposit-address-dropdown", children: [
2860
+ /* @__PURE__ */ jsx14("div", { className: "rs-deposit-address-dropdown-label", children: "Supported chain" }),
2861
+ /* @__PURE__ */ jsxs12("div", { className: "rs-deposit-address-dropdown-trigger", children: [
2862
+ chainIcon && /* @__PURE__ */ jsx14(
2733
2863
  "img",
2734
2864
  {
2735
2865
  src: chainIcon,
@@ -2737,17 +2867,17 @@ function DepositAddressSkeleton({
2737
2867
  className: "rs-deposit-address-dropdown-icon"
2738
2868
  }
2739
2869
  ),
2740
- /* @__PURE__ */ jsx12("span", { children: chainName }),
2741
- /* @__PURE__ */ jsx12(ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
2870
+ /* @__PURE__ */ jsx14("span", { children: chainName }),
2871
+ /* @__PURE__ */ jsx14(ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
2742
2872
  ] })
2743
2873
  ] }),
2744
- /* @__PURE__ */ jsxs10("div", { className: "rs-deposit-address-dropdown", children: [
2745
- /* @__PURE__ */ jsxs10("div", { className: "rs-deposit-address-dropdown-label rs-deposit-address-dropdown-label--with-min", children: [
2746
- /* @__PURE__ */ jsx12("span", { children: "Supported token" }),
2747
- /* @__PURE__ */ jsxs10("span", { className: "rs-deposit-address-min", children: [
2874
+ /* @__PURE__ */ jsxs12("div", { className: "rs-deposit-address-dropdown", children: [
2875
+ /* @__PURE__ */ jsxs12("div", { className: "rs-deposit-address-dropdown-label rs-deposit-address-dropdown-label--with-min", children: [
2876
+ /* @__PURE__ */ jsx14("span", { children: "Supported token" }),
2877
+ /* @__PURE__ */ jsxs12("span", { className: "rs-deposit-address-min", children: [
2748
2878
  "Min.$",
2749
2879
  (uiConfig?.minDepositUsd ?? 0.1).toFixed(2),
2750
- /* @__PURE__ */ jsx12(Tooltip, { content: "Minimum deposit amount required for the selected chain.", children: /* @__PURE__ */ jsx12(
2880
+ /* @__PURE__ */ jsx14(Tooltip, { content: "Minimum deposit amount required for the selected chain.", children: /* @__PURE__ */ jsx14(
2751
2881
  InfoIcon,
2752
2882
  {
2753
2883
  className: "rs-deposit-address-min-icon",
@@ -2756,8 +2886,8 @@ function DepositAddressSkeleton({
2756
2886
  ) })
2757
2887
  ] })
2758
2888
  ] }),
2759
- /* @__PURE__ */ jsxs10("div", { className: "rs-deposit-address-dropdown-trigger", children: [
2760
- tokenIcon && /* @__PURE__ */ jsx12(
2889
+ /* @__PURE__ */ jsxs12("div", { className: "rs-deposit-address-dropdown-trigger", children: [
2890
+ tokenIcon && /* @__PURE__ */ jsx14(
2761
2891
  "img",
2762
2892
  {
2763
2893
  src: tokenIcon,
@@ -2765,21 +2895,21 @@ function DepositAddressSkeleton({
2765
2895
  className: "rs-deposit-address-dropdown-icon"
2766
2896
  }
2767
2897
  ),
2768
- /* @__PURE__ */ jsx12("span", { children: defaultToken }),
2769
- /* @__PURE__ */ jsx12(ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
2898
+ /* @__PURE__ */ jsx14("span", { children: defaultToken }),
2899
+ /* @__PURE__ */ jsx14(ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
2770
2900
  ] })
2771
2901
  ] })
2772
2902
  ] }),
2773
- /* @__PURE__ */ jsxs10(
2903
+ /* @__PURE__ */ jsxs12(
2774
2904
  "div",
2775
2905
  {
2776
2906
  style: { display: "flex", flexDirection: "column", gap: 4, width: "100%" },
2777
2907
  children: [
2778
- /* @__PURE__ */ jsxs10("div", { className: "rs-deposit-address-well", children: [
2779
- /* @__PURE__ */ jsx12("div", { className: "rs-deposit-address-qr", children: /* @__PURE__ */ jsx12("div", { className: "rs-skeleton rs-skeleton-qr", "aria-hidden": "true" }) }),
2780
- /* @__PURE__ */ jsx12("div", { className: "rs-skeleton rs-skeleton-address", "aria-hidden": "true" })
2908
+ /* @__PURE__ */ jsxs12("div", { className: "rs-deposit-address-well", children: [
2909
+ /* @__PURE__ */ jsx14("div", { className: "rs-deposit-address-qr", children: /* @__PURE__ */ jsx14("div", { className: "rs-skeleton rs-skeleton-qr", "aria-hidden": "true" }) }),
2910
+ /* @__PURE__ */ jsx14("div", { className: "rs-skeleton rs-skeleton-address", "aria-hidden": "true" })
2781
2911
  ] }),
2782
- /* @__PURE__ */ jsxs10(
2912
+ /* @__PURE__ */ jsxs12(
2783
2913
  "button",
2784
2914
  {
2785
2915
  type: "button",
@@ -2787,7 +2917,7 @@ function DepositAddressSkeleton({
2787
2917
  disabled: true,
2788
2918
  "aria-hidden": "true",
2789
2919
  children: [
2790
- /* @__PURE__ */ jsx12(CopyIcon, {}),
2920
+ /* @__PURE__ */ jsx14(CopyIcon, {}),
2791
2921
  "Copy address"
2792
2922
  ]
2793
2923
  }
@@ -2795,20 +2925,20 @@ function DepositAddressSkeleton({
2795
2925
  ]
2796
2926
  }
2797
2927
  ),
2798
- /* @__PURE__ */ jsx12("div", { className: "rs-price-impact", "aria-hidden": "true", children: /* @__PURE__ */ jsxs10("div", { className: "rs-price-impact-header", children: [
2799
- /* @__PURE__ */ jsxs10("span", { className: "rs-price-impact-header-left", children: [
2800
- /* @__PURE__ */ jsx12("span", { className: "rs-price-impact-label", children: "Price impact" }),
2801
- /* @__PURE__ */ jsx12("span", { className: "rs-price-impact-label", children: /* @__PURE__ */ jsx12("strong", { children: "0.00%" }) }),
2802
- /* @__PURE__ */ jsx12(
2928
+ /* @__PURE__ */ jsx14("div", { className: "rs-price-impact", "aria-hidden": "true", children: /* @__PURE__ */ jsxs12("div", { className: "rs-price-impact-header", children: [
2929
+ /* @__PURE__ */ jsxs12("span", { className: "rs-price-impact-header-left", children: [
2930
+ /* @__PURE__ */ jsx14("span", { className: "rs-price-impact-label", children: "Price impact" }),
2931
+ /* @__PURE__ */ jsx14("span", { className: "rs-price-impact-label", children: /* @__PURE__ */ jsx14("strong", { children: "0.00%" }) }),
2932
+ /* @__PURE__ */ jsx14(
2803
2933
  Tooltip,
2804
2934
  {
2805
2935
  className: "rs-price-impact-info",
2806
2936
  content: "Price impact is the difference between expected and execution price, due to trade size and liquidity.",
2807
- children: /* @__PURE__ */ jsx12(InfoIcon, { "aria-hidden": "true" })
2937
+ children: /* @__PURE__ */ jsx14(InfoIcon, { "aria-hidden": "true" })
2808
2938
  }
2809
2939
  )
2810
2940
  ] }),
2811
- /* @__PURE__ */ jsx12(
2941
+ /* @__PURE__ */ jsx14(
2812
2942
  ChevronDownIcon,
2813
2943
  {
2814
2944
  className: "rs-price-impact-chevron",
@@ -2817,7 +2947,7 @@ function DepositAddressSkeleton({
2817
2947
  )
2818
2948
  ] }) })
2819
2949
  ] }),
2820
- /* @__PURE__ */ jsx12(PoweredBy, {})
2950
+ /* @__PURE__ */ jsx14(PoweredBy, {})
2821
2951
  ] });
2822
2952
  }
2823
2953
  DepositAddressSkeleton.displayName = "DepositAddressSkeleton";
@@ -2825,7 +2955,7 @@ DepositAddressSkeleton.displayName = "DepositAddressSkeleton";
2825
2955
  // src/components/steps/SolanaTokenSelectStep.tsx
2826
2956
  import { useState as useState8, useEffect as useEffect8, useMemo as useMemo5 } from "react";
2827
2957
  import { formatUnits as formatUnits4 } from "viem";
2828
- import { jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
2958
+ import { jsx as jsx15, jsxs as jsxs13 } from "react/jsx-runtime";
2829
2959
  function SolanaTokenSelectStep({
2830
2960
  solanaAddress,
2831
2961
  service,
@@ -2931,30 +3061,30 @@ function SolanaTokenSelectStep({
2931
3061
  };
2932
3062
  const chainIcon = getChainIcon("solana");
2933
3063
  const chainName = getChainName("solana");
2934
- return /* @__PURE__ */ jsxs11("div", { className: "rs-screen", children: [
2935
- /* @__PURE__ */ jsxs11("div", { className: "rs-screen-body", children: [
2936
- /* @__PURE__ */ jsx13(
3064
+ return /* @__PURE__ */ jsxs13("div", { className: "rs-screen", children: [
3065
+ /* @__PURE__ */ jsxs13("div", { className: "rs-screen-body", children: [
3066
+ /* @__PURE__ */ jsx15(
2937
3067
  BodyHeader,
2938
3068
  {
2939
- icon: /* @__PURE__ */ jsx13(WalletIcon, {}),
3069
+ icon: /* @__PURE__ */ jsx15(WalletIcon, {}),
2940
3070
  title: "Your assets",
2941
3071
  subtitle: "Select source assets to transfer"
2942
3072
  }
2943
3073
  ),
2944
- loading && /* @__PURE__ */ jsxs11("div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
2945
- /* @__PURE__ */ jsx13(Spinner, { className: "rs-text-tertiary" }),
2946
- /* @__PURE__ */ jsx13("span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
3074
+ loading && /* @__PURE__ */ jsxs13("div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
3075
+ /* @__PURE__ */ jsx15(Spinner, { className: "rs-text-tertiary" }),
3076
+ /* @__PURE__ */ jsx15("span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
2947
3077
  ] }),
2948
- error && /* @__PURE__ */ jsx13(Callout, { variant: "error", children: error }),
2949
- !loading && !error && rows.length === 0 && /* @__PURE__ */ jsxs11("div", { className: "rs-empty-state", children: [
2950
- /* @__PURE__ */ jsx13(WalletIcon, { className: "rs-empty-icon" }),
2951
- /* @__PURE__ */ jsx13("div", { className: "rs-empty-text", children: "No funds in connected wallet" }),
2952
- /* @__PURE__ */ jsxs11("div", { className: "rs-empty-address", children: [
3078
+ error && /* @__PURE__ */ jsx15(Callout, { variant: "error", children: error }),
3079
+ !loading && !error && rows.length === 0 && /* @__PURE__ */ jsxs13("div", { className: "rs-empty-state", children: [
3080
+ /* @__PURE__ */ jsx15(WalletIcon, { className: "rs-empty-icon" }),
3081
+ /* @__PURE__ */ jsx15("div", { className: "rs-empty-text", children: "No funds in connected wallet" }),
3082
+ /* @__PURE__ */ jsxs13("div", { className: "rs-empty-address", children: [
2953
3083
  solanaAddress.slice(0, 6),
2954
3084
  "...",
2955
3085
  solanaAddress.slice(-4)
2956
3086
  ] }),
2957
- onDisconnect && /* @__PURE__ */ jsx13(
3087
+ onDisconnect && /* @__PURE__ */ jsx15(
2958
3088
  "button",
2959
3089
  {
2960
3090
  type: "button",
@@ -2964,11 +3094,11 @@ function SolanaTokenSelectStep({
2964
3094
  }
2965
3095
  )
2966
3096
  ] }),
2967
- !loading && !error && rows.length > 0 && /* @__PURE__ */ jsx13("div", { className: "rs-asset-list", children: rows.map((entry) => {
3097
+ !loading && !error && rows.length > 0 && /* @__PURE__ */ jsx15("div", { className: "rs-asset-list", children: rows.map((entry) => {
2968
3098
  const isSelected = selectedSymbol === entry.token.symbol;
2969
3099
  const tokenAmount = formatBalance(entry);
2970
3100
  const tokenIcon = getTokenIcon(entry.token.symbol);
2971
- return /* @__PURE__ */ jsxs11(
3101
+ return /* @__PURE__ */ jsxs13(
2972
3102
  "button",
2973
3103
  {
2974
3104
  type: "button",
@@ -2976,33 +3106,33 @@ function SolanaTokenSelectStep({
2976
3106
  className: `rs-asset-row ${isSelected ? "rs-asset-row--selected" : ""}`,
2977
3107
  "aria-pressed": isSelected,
2978
3108
  children: [
2979
- /* @__PURE__ */ jsxs11("div", { className: "rs-asset-info", children: [
2980
- /* @__PURE__ */ jsxs11("div", { className: "rs-asset-icon-wrapper", children: [
2981
- tokenIcon ? /* @__PURE__ */ jsx13("span", { className: "rs-asset-icon", children: /* @__PURE__ */ jsx13("img", { src: tokenIcon, alt: entry.token.symbol }) }) : /* @__PURE__ */ jsx13("span", { className: "rs-asset-icon", children: entry.token.symbol.slice(0, 4) }),
2982
- chainIcon && /* @__PURE__ */ jsx13("span", { className: "rs-asset-chain-badge", children: /* @__PURE__ */ jsx13("img", { src: chainIcon, alt: chainName }) })
3109
+ /* @__PURE__ */ jsxs13("div", { className: "rs-asset-info", children: [
3110
+ /* @__PURE__ */ jsxs13("div", { className: "rs-asset-icon-wrapper", children: [
3111
+ tokenIcon ? /* @__PURE__ */ jsx15("span", { className: "rs-asset-icon", children: /* @__PURE__ */ jsx15("img", { src: tokenIcon, alt: entry.token.symbol }) }) : /* @__PURE__ */ jsx15("span", { className: "rs-asset-icon", children: entry.token.symbol.slice(0, 4) }),
3112
+ chainIcon && /* @__PURE__ */ jsx15("span", { className: "rs-asset-chain-badge", children: /* @__PURE__ */ jsx15("img", { src: chainIcon, alt: chainName }) })
2983
3113
  ] }),
2984
- /* @__PURE__ */ jsxs11("div", { className: "rs-asset-text", children: [
2985
- /* @__PURE__ */ jsxs11("div", { className: "rs-asset-name-row", children: [
2986
- /* @__PURE__ */ jsx13("span", { className: "rs-asset-name", children: entry.token.symbol }),
2987
- /* @__PURE__ */ jsxs11("span", { className: "rs-asset-chain", children: [
3114
+ /* @__PURE__ */ jsxs13("div", { className: "rs-asset-text", children: [
3115
+ /* @__PURE__ */ jsxs13("div", { className: "rs-asset-name-row", children: [
3116
+ /* @__PURE__ */ jsx15("span", { className: "rs-asset-name", children: entry.token.symbol }),
3117
+ /* @__PURE__ */ jsxs13("span", { className: "rs-asset-chain", children: [
2988
3118
  "on ",
2989
3119
  chainName
2990
3120
  ] })
2991
3121
  ] }),
2992
- /* @__PURE__ */ jsxs11("div", { className: "rs-asset-balance-small", children: [
3122
+ /* @__PURE__ */ jsxs13("div", { className: "rs-asset-balance-small", children: [
2993
3123
  tokenAmount,
2994
3124
  " ",
2995
3125
  entry.token.symbol
2996
3126
  ] })
2997
3127
  ] })
2998
3128
  ] }),
2999
- /* @__PURE__ */ jsx13("div", { className: "rs-asset-balance", children: entry.balanceUsd > 0 ? currencyFormatter.format(entry.balanceUsd) : tokenAmount !== "--" ? `${tokenAmount} ${entry.token.symbol}` : "--" })
3129
+ /* @__PURE__ */ jsx15("div", { className: "rs-asset-balance", children: entry.balanceUsd > 0 ? currencyFormatter.format(entry.balanceUsd) : tokenAmount !== "--" ? `${tokenAmount} ${entry.token.symbol}` : "--" })
3000
3130
  ]
3001
3131
  },
3002
3132
  entry.token.symbol
3003
3133
  );
3004
3134
  }) }),
3005
- /* @__PURE__ */ jsx13(
3135
+ /* @__PURE__ */ jsx15(
3006
3136
  Button,
3007
3137
  {
3008
3138
  onClick: () => selectedEntry && onContinue(
@@ -3016,14 +3146,14 @@ function SolanaTokenSelectStep({
3016
3146
  }
3017
3147
  )
3018
3148
  ] }),
3019
- /* @__PURE__ */ jsx13(PoweredBy, {})
3149
+ /* @__PURE__ */ jsx15(PoweredBy, {})
3020
3150
  ] });
3021
3151
  }
3022
3152
 
3023
3153
  // src/components/steps/SolanaAmountStep.tsx
3024
3154
  import { useCallback as useCallback6, useEffect as useEffect9, useMemo as useMemo6, useRef as useRef7, useState as useState9 } from "react";
3025
3155
  import { formatUnits as formatUnits5, parseUnits as parseUnits3 } from "viem";
3026
- import { Fragment as Fragment2, jsx as jsx14, jsxs as jsxs12 } from "react/jsx-runtime";
3156
+ import { Fragment as Fragment2, jsx as jsx16, jsxs as jsxs14 } from "react/jsx-runtime";
3027
3157
  var SOL_FEE_RESERVE_LAMPORTS = 1000000n;
3028
3158
  var PRESETS2 = [
3029
3159
  { value: 25, label: "25%" },
@@ -3224,12 +3354,12 @@ function SolanaAmountStep({
3224
3354
  const continueLabel = exceedsBalance ? "Insufficient balance" : isAboveMax ? "Continue with max allowed deposit" : isBelowMin ? "Continue with minimum deposit" : "Continue";
3225
3355
  const continueDisabled = exceedsBalance || numericAmount === 0 && !isBelowMin;
3226
3356
  const sourceTokenIcon = getTokenIcon(token.symbol);
3227
- return /* @__PURE__ */ jsxs12("div", { className: "rs-screen", children: [
3228
- /* @__PURE__ */ jsxs12("div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
3229
- /* @__PURE__ */ jsx14(BodyHeader, { icon: /* @__PURE__ */ jsx14(WalletIcon, {}), title: "Wallet deposit" }),
3230
- /* @__PURE__ */ jsxs12("div", { className: "rs-amount-section", children: [
3231
- /* @__PURE__ */ jsxs12("div", { className: "rs-amount-display", children: [
3232
- /* @__PURE__ */ jsx14(
3357
+ return /* @__PURE__ */ jsxs14("div", { className: "rs-screen", children: [
3358
+ /* @__PURE__ */ jsxs14("div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
3359
+ /* @__PURE__ */ jsx16(BodyHeader, { icon: /* @__PURE__ */ jsx16(WalletIcon, {}), title: "Wallet deposit" }),
3360
+ /* @__PURE__ */ jsxs14("div", { className: "rs-amount-section", children: [
3361
+ /* @__PURE__ */ jsxs14("div", { className: "rs-amount-display", children: [
3362
+ /* @__PURE__ */ jsx16(
3233
3363
  AnimatedAmountInput,
3234
3364
  {
3235
3365
  value: amount,
@@ -3238,25 +3368,25 @@ function SolanaAmountStep({
3238
3368
  autoFocus: true
3239
3369
  }
3240
3370
  ),
3241
- /* @__PURE__ */ jsxs12("div", { className: "rs-amount-meta", children: [
3242
- /* @__PURE__ */ jsxs12("span", { className: "rs-amount-meta-balance", children: [
3371
+ /* @__PURE__ */ jsxs14("div", { className: "rs-amount-meta", children: [
3372
+ /* @__PURE__ */ jsxs14("span", { className: "rs-amount-meta-balance", children: [
3243
3373
  formattedBalance,
3244
3374
  " ",
3245
3375
  token.symbol,
3246
3376
  " available",
3247
- computedBalanceUsd !== null && /* @__PURE__ */ jsxs12(Fragment2, { children: [
3377
+ computedBalanceUsd !== null && /* @__PURE__ */ jsxs14(Fragment2, { children: [
3248
3378
  " (~",
3249
3379
  currencyFormatter.format(computedBalanceUsd),
3250
3380
  ")"
3251
3381
  ] })
3252
3382
  ] }),
3253
- minDepositUsd !== null && /* @__PURE__ */ jsxs12("span", { className: "rs-amount-meta-minimum", children: [
3383
+ minDepositUsd !== null && /* @__PURE__ */ jsxs14("span", { className: "rs-amount-meta-minimum", children: [
3254
3384
  "Min. deposit ",
3255
3385
  currencyFormatter.format(minDepositUsd)
3256
3386
  ] })
3257
3387
  ] })
3258
3388
  ] }),
3259
- /* @__PURE__ */ jsx14("div", { className: "rs-amount-presets", children: PRESETS2.map((preset) => /* @__PURE__ */ jsx14(
3389
+ /* @__PURE__ */ jsx16("div", { className: "rs-amount-presets", children: PRESETS2.map((preset) => /* @__PURE__ */ jsx16(
3260
3390
  "button",
3261
3391
  {
3262
3392
  type: "button",
@@ -3267,36 +3397,36 @@ function SolanaAmountStep({
3267
3397
  preset.value
3268
3398
  )) })
3269
3399
  ] }),
3270
- /* @__PURE__ */ jsxs12("div", { className: "rs-amount-details", children: [
3271
- /* @__PURE__ */ jsxs12("div", { className: "rs-amount-detail-row", children: [
3272
- /* @__PURE__ */ jsx14("span", { children: "You send" }),
3273
- /* @__PURE__ */ jsxs12("span", { className: "rs-amount-detail-value", children: [
3274
- /* @__PURE__ */ jsxs12("span", { children: [
3400
+ /* @__PURE__ */ jsxs14("div", { className: "rs-amount-details", children: [
3401
+ /* @__PURE__ */ jsxs14("div", { className: "rs-amount-detail-row", children: [
3402
+ /* @__PURE__ */ jsx16("span", { children: "You send" }),
3403
+ /* @__PURE__ */ jsxs14("span", { className: "rs-amount-detail-value", children: [
3404
+ /* @__PURE__ */ jsxs14("span", { children: [
3275
3405
  "Solana ",
3276
3406
  token.symbol
3277
3407
  ] }),
3278
- sourceTokenIcon && /* @__PURE__ */ jsx14("span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ jsx14("img", { src: sourceTokenIcon, alt: "" }) })
3408
+ sourceTokenIcon && /* @__PURE__ */ jsx16("span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ jsx16("img", { src: sourceTokenIcon, alt: "" }) })
3279
3409
  ] })
3280
3410
  ] }),
3281
- targetChainName && targetTokenSymbol && /* @__PURE__ */ jsxs12("div", { className: "rs-amount-detail-row", children: [
3282
- /* @__PURE__ */ jsx14("span", { children: "Receive" }),
3283
- /* @__PURE__ */ jsxs12("span", { className: "rs-amount-detail-value", children: [
3284
- /* @__PURE__ */ jsxs12("span", { children: [
3411
+ targetChainName && targetTokenSymbol && /* @__PURE__ */ jsxs14("div", { className: "rs-amount-detail-row", children: [
3412
+ /* @__PURE__ */ jsx16("span", { children: "Receive" }),
3413
+ /* @__PURE__ */ jsxs14("span", { className: "rs-amount-detail-value", children: [
3414
+ /* @__PURE__ */ jsxs14("span", { children: [
3285
3415
  targetChainName,
3286
3416
  " ",
3287
3417
  targetTokenSymbol
3288
3418
  ] }),
3289
- targetTokenIcon && /* @__PURE__ */ jsx14("span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ jsx14("img", { src: targetTokenIcon, alt: "" }) })
3419
+ targetTokenIcon && /* @__PURE__ */ jsx16("span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ jsx16("img", { src: targetTokenIcon, alt: "" }) })
3290
3420
  ] })
3291
3421
  ] }),
3292
- balanceAfterUsd !== null && /* @__PURE__ */ jsxs12("div", { className: "rs-amount-detail-row", children: [
3293
- /* @__PURE__ */ jsx14("span", { children: "Balance after deposit" }),
3294
- /* @__PURE__ */ jsx14("span", { className: "rs-amount-detail-value", children: currencyFormatter.format(balanceAfterUsd) })
3422
+ balanceAfterUsd !== null && /* @__PURE__ */ jsxs14("div", { className: "rs-amount-detail-row", children: [
3423
+ /* @__PURE__ */ jsx16("span", { children: "Balance after deposit" }),
3424
+ /* @__PURE__ */ jsx16("span", { className: "rs-amount-detail-value", children: currencyFormatter.format(balanceAfterUsd) })
3295
3425
  ] })
3296
3426
  ] }),
3297
- targetChain === HYPERCORE_CHAIN_ID && /* @__PURE__ */ jsx14(Callout, { variant: "warning", children: "First deposit to a new HyperCore account includes a ~1 USDC activation fee." }),
3298
- error && /* @__PURE__ */ jsx14(Callout, { variant: "error", children: error }),
3299
- /* @__PURE__ */ jsx14(
3427
+ targetChain === HYPERCORE_CHAIN_ID && /* @__PURE__ */ jsx16(Callout, { variant: "warning", children: "First deposit to a new HyperCore account includes a ~1 USDC activation fee." }),
3428
+ error && /* @__PURE__ */ jsx16(Callout, { variant: "error", children: error }),
3429
+ /* @__PURE__ */ jsx16(
3300
3430
  Button,
3301
3431
  {
3302
3432
  onClick: handleContinue,
@@ -3306,7 +3436,7 @@ function SolanaAmountStep({
3306
3436
  }
3307
3437
  )
3308
3438
  ] }),
3309
- /* @__PURE__ */ jsx14(PoweredBy, {})
3439
+ /* @__PURE__ */ jsx16(PoweredBy, {})
3310
3440
  ] });
3311
3441
  }
3312
3442
 
@@ -3419,7 +3549,7 @@ async function sendSolanaTransaction(provider, _connection, transaction) {
3419
3549
  }
3420
3550
 
3421
3551
  // src/components/steps/SolanaConfirmStep.tsx
3422
- import { jsx as jsx15, jsxs as jsxs13 } from "react/jsx-runtime";
3552
+ import { jsx as jsx17, jsxs as jsxs15 } from "react/jsx-runtime";
3423
3553
  function SolanaConfirmStep({
3424
3554
  smartAccount,
3425
3555
  solanaAddress,
@@ -3443,7 +3573,6 @@ function SolanaConfirmStep({
3443
3573
  const [isSubmitting, setIsSubmitting] = useState10(false);
3444
3574
  const [error, setError] = useState10(null);
3445
3575
  const targetSymbol = getTargetTokenSymbol(targetToken, targetChain);
3446
- const isSameToken = token.symbol.toUpperCase() === targetSymbol.toUpperCase();
3447
3576
  const sourceChainName = getChainName("solana");
3448
3577
  const targetChainName = getChainName(targetChain);
3449
3578
  const sourceChainIcon = getChainIcon("solana");
@@ -3452,25 +3581,20 @@ function SolanaConfirmStep({
3452
3581
  const targetTokenIcon = getTokenIcon(targetSymbol);
3453
3582
  const feeSponsored = uiConfig?.feeSponsored ?? false;
3454
3583
  const feeTooltip = uiConfig?.feeTooltip ?? (feeSponsored ? "Network fees are sponsored for this deposit." : "Network fees apply.");
3455
- const formattedAmount = sourceAmount && !Number.isNaN(Number(sourceAmount)) ? Number(sourceAmount).toLocaleString("en-US", {
3456
- minimumFractionDigits: 2,
3457
- maximumFractionDigits: 6
3458
- }) : "0";
3459
- const formattedReceiveAmount = (() => {
3460
- if (isSameToken) return formattedAmount;
3461
- const dollarValue = Number(targetAmount);
3462
- if (!Number.isFinite(dollarValue) || dollarValue <= 0)
3463
- return formattedAmount;
3464
- if (targetTokenPriceUsd !== null && targetTokenPriceUsd > 0) {
3465
- const tokenAmount = dollarValue / targetTokenPriceUsd;
3466
- return tokenAmount.toLocaleString("en-US", {
3467
- minimumFractionDigits: 2,
3468
- maximumFractionDigits: 6
3469
- });
3470
- }
3471
- return formattedAmount;
3584
+ const formattedAmount = sourceAmount && Number.isFinite(Number(sourceAmount)) ? formatTokenAmount(Number(sourceAmount), token.symbol) ?? "0" : "0";
3585
+ const receiveDisplay = (() => {
3586
+ const usdValue = Number(targetAmount);
3587
+ const sourceAmountUsd = Number.isFinite(usdValue) && usdValue > 0 ? usdValue : void 0;
3588
+ const estimate = formatReceiveEstimate({
3589
+ sourceAmount: Number.isFinite(Number(sourceAmount)) ? Number(sourceAmount) : void 0,
3590
+ sourceSymbol: token.symbol,
3591
+ targetSymbol,
3592
+ sourceAmountUsd,
3593
+ prices: targetTokenPriceUsd !== null && targetTokenPriceUsd > 0 ? { [targetSymbol.toUpperCase()]: targetTokenPriceUsd } : {}
3594
+ });
3595
+ if (estimate !== void 0) return estimate;
3596
+ return sourceAmountUsd !== void 0 ? `~$${sourceAmountUsd.toFixed(2)}` : `${formattedAmount} ${token.symbol}`;
3472
3597
  })();
3473
- const receiveAmount = isSameToken ? formattedReceiveAmount : `~${formattedReceiveAmount}`;
3474
3598
  const handleConfirm = async () => {
3475
3599
  if (!solanaProvider) {
3476
3600
  debugLog(debug, "solana-confirm", "submit:blocked", {
@@ -3560,66 +3684,62 @@ function SolanaConfirmStep({
3560
3684
  setIsSubmitting(false);
3561
3685
  }
3562
3686
  };
3563
- return /* @__PURE__ */ jsxs13("div", { className: "rs-screen", children: [
3564
- /* @__PURE__ */ jsxs13("div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
3565
- /* @__PURE__ */ jsx15(BodyHeader, { icon: /* @__PURE__ */ jsx15(WalletIcon, {}), title: "Review deposit" }),
3566
- /* @__PURE__ */ jsxs13("div", { className: "rs-review-details", children: [
3567
- /* @__PURE__ */ jsxs13("div", { className: "rs-review-detail-row", children: [
3568
- /* @__PURE__ */ jsx15("span", { children: "Source chain" }),
3569
- /* @__PURE__ */ jsxs13("span", { className: "rs-review-detail-value", children: [
3570
- /* @__PURE__ */ jsx15("span", { children: sourceChainName }),
3571
- sourceChainIcon && /* @__PURE__ */ jsx15("span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ jsx15("img", { src: sourceChainIcon, alt: "" }) })
3687
+ return /* @__PURE__ */ jsxs15("div", { className: "rs-screen", children: [
3688
+ /* @__PURE__ */ jsxs15("div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
3689
+ /* @__PURE__ */ jsx17(BodyHeader, { icon: /* @__PURE__ */ jsx17(WalletIcon, {}), title: "Review deposit" }),
3690
+ /* @__PURE__ */ jsxs15("div", { className: "rs-review-details", children: [
3691
+ /* @__PURE__ */ jsxs15("div", { className: "rs-review-detail-row", children: [
3692
+ /* @__PURE__ */ jsx17("span", { children: "Source chain" }),
3693
+ /* @__PURE__ */ jsxs15("span", { className: "rs-review-detail-value", children: [
3694
+ /* @__PURE__ */ jsx17("span", { children: sourceChainName }),
3695
+ sourceChainIcon && /* @__PURE__ */ jsx17("span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ jsx17("img", { src: sourceChainIcon, alt: "" }) })
3572
3696
  ] })
3573
3697
  ] }),
3574
- /* @__PURE__ */ jsxs13("div", { className: "rs-review-detail-row", children: [
3575
- /* @__PURE__ */ jsx15("span", { children: "Destination chain" }),
3576
- /* @__PURE__ */ jsxs13("span", { className: "rs-review-detail-value", children: [
3577
- /* @__PURE__ */ jsx15("span", { children: targetChainName }),
3578
- targetChainIcon && /* @__PURE__ */ jsx15("span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ jsx15("img", { src: targetChainIcon, alt: "" }) })
3698
+ /* @__PURE__ */ jsxs15("div", { className: "rs-review-detail-row", children: [
3699
+ /* @__PURE__ */ jsx17("span", { children: "Destination chain" }),
3700
+ /* @__PURE__ */ jsxs15("span", { className: "rs-review-detail-value", children: [
3701
+ /* @__PURE__ */ jsx17("span", { children: targetChainName }),
3702
+ targetChainIcon && /* @__PURE__ */ jsx17("span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ jsx17("img", { src: targetChainIcon, alt: "" }) })
3579
3703
  ] })
3580
3704
  ] }),
3581
- /* @__PURE__ */ jsxs13("div", { className: "rs-review-detail-row", children: [
3582
- /* @__PURE__ */ jsx15("span", { children: "Estimated time" }),
3583
- /* @__PURE__ */ jsx15("span", { className: "rs-review-detail-value", children: estimatedTime })
3705
+ /* @__PURE__ */ jsxs15("div", { className: "rs-review-detail-row", children: [
3706
+ /* @__PURE__ */ jsx17("span", { children: "Estimated time" }),
3707
+ /* @__PURE__ */ jsx17("span", { className: "rs-review-detail-value", children: estimatedTime })
3584
3708
  ] }),
3585
- /* @__PURE__ */ jsxs13("div", { className: "rs-review-detail-row", children: [
3586
- /* @__PURE__ */ jsx15("span", { children: "You send" }),
3587
- /* @__PURE__ */ jsxs13("span", { className: "rs-review-detail-value", children: [
3588
- /* @__PURE__ */ jsxs13("span", { children: [
3709
+ /* @__PURE__ */ jsxs15("div", { className: "rs-review-detail-row", children: [
3710
+ /* @__PURE__ */ jsx17("span", { children: "You send" }),
3711
+ /* @__PURE__ */ jsxs15("span", { className: "rs-review-detail-value", children: [
3712
+ /* @__PURE__ */ jsxs15("span", { children: [
3589
3713
  formattedAmount,
3590
3714
  " ",
3591
3715
  token.symbol
3592
3716
  ] }),
3593
- sourceTokenIcon && /* @__PURE__ */ jsx15("span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ jsx15("img", { src: sourceTokenIcon, alt: "" }) })
3717
+ sourceTokenIcon && /* @__PURE__ */ jsx17("span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ jsx17("img", { src: sourceTokenIcon, alt: "" }) })
3594
3718
  ] })
3595
3719
  ] }),
3596
- /* @__PURE__ */ jsxs13("div", { className: "rs-review-detail-row", children: [
3597
- /* @__PURE__ */ jsx15("span", { children: "Receive" }),
3598
- /* @__PURE__ */ jsxs13("span", { className: "rs-review-detail-value", children: [
3599
- /* @__PURE__ */ jsxs13("span", { children: [
3600
- receiveAmount,
3601
- " ",
3602
- targetSymbol
3603
- ] }),
3604
- targetTokenIcon && /* @__PURE__ */ jsx15("span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ jsx15("img", { src: targetTokenIcon, alt: "" }) })
3720
+ /* @__PURE__ */ jsxs15("div", { className: "rs-review-detail-row", children: [
3721
+ /* @__PURE__ */ jsx17("span", { children: "Receive" }),
3722
+ /* @__PURE__ */ jsxs15("span", { className: "rs-review-detail-value", children: [
3723
+ /* @__PURE__ */ jsx17("span", { children: receiveDisplay }),
3724
+ targetTokenIcon && /* @__PURE__ */ jsx17("span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ jsx17("img", { src: targetTokenIcon, alt: "" }) })
3605
3725
  ] })
3606
3726
  ] }),
3607
- /* @__PURE__ */ jsxs13("div", { className: "rs-review-detail-row", children: [
3608
- /* @__PURE__ */ jsx15("span", { children: "Fees" }),
3609
- /* @__PURE__ */ jsxs13("span", { className: "rs-review-detail-value", children: [
3610
- /* @__PURE__ */ jsx15(
3727
+ /* @__PURE__ */ jsxs15("div", { className: "rs-review-detail-row", children: [
3728
+ /* @__PURE__ */ jsx17("span", { children: "Fees" }),
3729
+ /* @__PURE__ */ jsxs15("span", { className: "rs-review-detail-value", children: [
3730
+ /* @__PURE__ */ jsx17(
3611
3731
  "span",
3612
3732
  {
3613
3733
  style: feeSponsored ? { textDecoration: "line-through" } : void 0,
3614
3734
  children: "$0.04"
3615
3735
  }
3616
3736
  ),
3617
- /* @__PURE__ */ jsx15(Tooltip, { content: feeTooltip, children: /* @__PURE__ */ jsx15("span", { className: "rs-review-detail-info", "aria-label": "Fee info", children: /* @__PURE__ */ jsx15(InfoIcon, {}) }) })
3737
+ /* @__PURE__ */ jsx17(Tooltip, { content: feeTooltip, children: /* @__PURE__ */ jsx17("span", { className: "rs-review-detail-info", "aria-label": "Fee info", children: /* @__PURE__ */ jsx17(InfoIcon, {}) }) })
3618
3738
  ] })
3619
3739
  ] })
3620
3740
  ] }),
3621
- error && /* @__PURE__ */ jsx15(Callout, { variant: "error", children: error }),
3622
- /* @__PURE__ */ jsx15(
3741
+ error && /* @__PURE__ */ jsx17(Callout, { variant: "error", children: error }),
3742
+ /* @__PURE__ */ jsx17(
3623
3743
  Button,
3624
3744
  {
3625
3745
  onClick: handleConfirm,
@@ -3631,28 +3751,28 @@ function SolanaConfirmStep({
3631
3751
  }
3632
3752
  )
3633
3753
  ] }),
3634
- /* @__PURE__ */ jsx15(PoweredBy, {})
3754
+ /* @__PURE__ */ jsx17(PoweredBy, {})
3635
3755
  ] });
3636
3756
  }
3637
3757
 
3638
3758
  // src/components/steps/DappImportAssetSelectStep.tsx
3639
- import { jsx as jsx16, jsxs as jsxs14 } from "react/jsx-runtime";
3759
+ import { jsx as jsx18, jsxs as jsxs16 } from "react/jsx-runtime";
3640
3760
  function DappImportAssetSelectStep({
3641
3761
  sourceLabel,
3642
3762
  assets,
3643
3763
  onSelect
3644
3764
  }) {
3645
- return /* @__PURE__ */ jsxs14("div", { className: "rs-screen", children: [
3646
- /* @__PURE__ */ jsxs14("div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
3647
- /* @__PURE__ */ jsx16(
3765
+ return /* @__PURE__ */ jsxs16("div", { className: "rs-screen", children: [
3766
+ /* @__PURE__ */ jsxs16("div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
3767
+ /* @__PURE__ */ jsx18(
3648
3768
  BodyHeader,
3649
3769
  {
3650
- icon: /* @__PURE__ */ jsx16(WalletIcon, {}),
3770
+ icon: /* @__PURE__ */ jsx18(WalletIcon, {}),
3651
3771
  title: `Transfer from ${sourceLabel}`,
3652
3772
  subtitle: "Pick the balance to import"
3653
3773
  }
3654
3774
  ),
3655
- /* @__PURE__ */ jsx16("div", { className: "rs-asset-list", children: assets.map((asset) => {
3775
+ /* @__PURE__ */ jsx18("div", { className: "rs-asset-list", children: assets.map((asset) => {
3656
3776
  const tokenAmount = asset.balance ? tokenFormatter.format(
3657
3777
  Number(asset.balance) / 10 ** asset.decimals
3658
3778
  ) : "0";
@@ -3660,23 +3780,23 @@ function DappImportAssetSelectStep({
3660
3780
  const tokenIcon = asset.icon ?? getTokenIcon(asset.symbol);
3661
3781
  const chainIcon = getChainIcon(asset.chainId);
3662
3782
  const badge = getChainBadge(asset.chainId);
3663
- return /* @__PURE__ */ jsxs14(
3783
+ return /* @__PURE__ */ jsxs16(
3664
3784
  "button",
3665
3785
  {
3666
3786
  type: "button",
3667
3787
  className: "rs-asset-row",
3668
3788
  onClick: () => onSelect(asset),
3669
3789
  children: [
3670
- /* @__PURE__ */ jsxs14("div", { className: "rs-asset-info", children: [
3671
- /* @__PURE__ */ jsxs14("div", { className: "rs-asset-icon-wrapper", children: [
3672
- /* @__PURE__ */ jsx16("span", { className: "rs-asset-icon", children: tokenIcon ? /* @__PURE__ */ jsx16("img", { src: tokenIcon, alt: asset.symbol }) : asset.symbol.slice(0, 4) }),
3673
- chainIcon ? /* @__PURE__ */ jsx16("span", { className: "rs-asset-chain-badge", children: /* @__PURE__ */ jsx16(
3790
+ /* @__PURE__ */ jsxs16("div", { className: "rs-asset-info", children: [
3791
+ /* @__PURE__ */ jsxs16("div", { className: "rs-asset-icon-wrapper", children: [
3792
+ /* @__PURE__ */ jsx18("span", { className: "rs-asset-icon", children: tokenIcon ? /* @__PURE__ */ jsx18("img", { src: tokenIcon, alt: asset.symbol }) : asset.symbol.slice(0, 4) }),
3793
+ chainIcon ? /* @__PURE__ */ jsx18("span", { className: "rs-asset-chain-badge", children: /* @__PURE__ */ jsx18(
3674
3794
  "img",
3675
3795
  {
3676
3796
  src: chainIcon,
3677
3797
  alt: getChainName(asset.chainId)
3678
3798
  }
3679
- ) }) : /* @__PURE__ */ jsx16(
3799
+ ) }) : /* @__PURE__ */ jsx18(
3680
3800
  "span",
3681
3801
  {
3682
3802
  className: "rs-asset-chain-badge",
@@ -3685,46 +3805,94 @@ function DappImportAssetSelectStep({
3685
3805
  }
3686
3806
  )
3687
3807
  ] }),
3688
- /* @__PURE__ */ jsxs14("div", { className: "rs-asset-text", children: [
3689
- /* @__PURE__ */ jsxs14("div", { className: "rs-asset-name-row", children: [
3690
- /* @__PURE__ */ jsx16("span", { className: "rs-asset-name", children: asset.symbol }),
3691
- /* @__PURE__ */ jsxs14("span", { className: "rs-asset-chain", children: [
3808
+ /* @__PURE__ */ jsxs16("div", { className: "rs-asset-text", children: [
3809
+ /* @__PURE__ */ jsxs16("div", { className: "rs-asset-name-row", children: [
3810
+ /* @__PURE__ */ jsx18("span", { className: "rs-asset-name", children: asset.symbol }),
3811
+ /* @__PURE__ */ jsxs16("span", { className: "rs-asset-chain", children: [
3692
3812
  "on ",
3693
3813
  asset.sourceLabel
3694
3814
  ] })
3695
3815
  ] }),
3696
- /* @__PURE__ */ jsxs14("div", { className: "rs-asset-balance-small", children: [
3816
+ /* @__PURE__ */ jsxs16("div", { className: "rs-asset-balance-small", children: [
3697
3817
  tokenAmount,
3698
3818
  " ",
3699
3819
  asset.symbol
3700
3820
  ] })
3701
3821
  ] })
3702
3822
  ] }),
3703
- /* @__PURE__ */ jsx16("div", { className: "rs-asset-balance", children: balanceUsd })
3823
+ /* @__PURE__ */ jsx18("div", { className: "rs-asset-balance", children: balanceUsd })
3704
3824
  ]
3705
3825
  },
3706
3826
  asset.id
3707
3827
  );
3708
3828
  }) })
3709
3829
  ] }),
3710
- /* @__PURE__ */ jsx16(PoweredBy, {})
3830
+ /* @__PURE__ */ jsx18(PoweredBy, {})
3711
3831
  ] });
3712
3832
  }
3713
3833
  DappImportAssetSelectStep.displayName = "DappImportAssetSelectStep";
3714
3834
 
3835
+ // src/components/steps/DappImportAssetSelectSkeleton.tsx
3836
+ import { jsx as jsx19, jsxs as jsxs17 } from "react/jsx-runtime";
3837
+ function DappImportAssetSelectSkeleton({
3838
+ sourceLabel,
3839
+ rowCount = 3,
3840
+ error = false,
3841
+ onRetry
3842
+ }) {
3843
+ return /* @__PURE__ */ jsxs17("div", { className: "rs-screen", "aria-busy": error ? "false" : "true", children: [
3844
+ /* @__PURE__ */ jsx19("span", { className: "rs-sr-only", role: "status", children: error ? "Couldn't load balances" : "Loading balances\u2026" }),
3845
+ /* @__PURE__ */ jsxs17("div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
3846
+ /* @__PURE__ */ jsx19(
3847
+ BodyHeader,
3848
+ {
3849
+ icon: /* @__PURE__ */ jsx19(WalletIcon, {}),
3850
+ title: `Transfer from ${sourceLabel}`,
3851
+ subtitle: "Pick the balance to import"
3852
+ }
3853
+ ),
3854
+ error ? /* @__PURE__ */ jsx19("div", { className: "rs-loading-state", children: /* @__PURE__ */ jsxs17("div", { className: "rs-loading-text", children: [
3855
+ /* @__PURE__ */ jsx19("div", { className: "rs-loading-title rs-text-error", children: "Couldn\u2019t load your balances" }),
3856
+ /* @__PURE__ */ jsx19("div", { className: "rs-loading-subtitle", children: "Check your connection and try again." })
3857
+ ] }) }) : /* @__PURE__ */ jsx19("div", { className: "rs-asset-list", "aria-hidden": "true", children: Array.from({ length: rowCount }, (_, index) => /* @__PURE__ */ jsxs17(
3858
+ "div",
3859
+ {
3860
+ className: "rs-asset-row rs-asset-row--skeleton",
3861
+ children: [
3862
+ /* @__PURE__ */ jsxs17("div", { className: "rs-asset-info", children: [
3863
+ /* @__PURE__ */ jsxs17("div", { className: "rs-asset-icon-wrapper", children: [
3864
+ /* @__PURE__ */ jsx19("span", { className: "rs-asset-icon", children: /* @__PURE__ */ jsx19("span", { className: "rs-skeleton rs-skeleton-fill" }) }),
3865
+ /* @__PURE__ */ jsx19("span", { className: "rs-asset-chain-badge", children: /* @__PURE__ */ jsx19("span", { className: "rs-skeleton rs-skeleton-fill" }) })
3866
+ ] }),
3867
+ /* @__PURE__ */ jsxs17("div", { className: "rs-asset-text", children: [
3868
+ /* @__PURE__ */ jsx19("div", { className: "rs-asset-name-row", children: /* @__PURE__ */ jsx19("span", { className: "rs-skeleton rs-skeleton-text rs-skeleton-text--name" }) }),
3869
+ /* @__PURE__ */ jsx19("div", { className: "rs-asset-balance-small", children: /* @__PURE__ */ jsx19("span", { className: "rs-skeleton rs-skeleton-text rs-skeleton-text--balance" }) })
3870
+ ] })
3871
+ ] }),
3872
+ /* @__PURE__ */ jsx19("div", { className: "rs-asset-balance", children: /* @__PURE__ */ jsx19("span", { className: "rs-skeleton rs-skeleton-text rs-skeleton-text--usd" }) })
3873
+ ]
3874
+ },
3875
+ index
3876
+ )) })
3877
+ ] }),
3878
+ error && onRetry && /* @__PURE__ */ jsx19("div", { className: "rs-step-footer", children: /* @__PURE__ */ jsx19(
3879
+ "button",
3880
+ {
3881
+ type: "button",
3882
+ className: "rs-button rs-button--default rs-button--full-width",
3883
+ onClick: onRetry,
3884
+ children: /* @__PURE__ */ jsx19("span", { children: "Try again" })
3885
+ }
3886
+ ) }),
3887
+ /* @__PURE__ */ jsx19(PoweredBy, {})
3888
+ ] });
3889
+ }
3890
+ DappImportAssetSelectSkeleton.displayName = "DappImportAssetSelectSkeleton";
3891
+
3715
3892
  // src/core/dapp-imports/polymarket/index.ts
3716
3893
  import { createElement } from "react";
3717
3894
  import { formatUnits as formatUnits6 } from "viem";
3718
3895
 
3719
- // src/core/dapp-imports/polymarket/constants.ts
3720
- var POLYMARKET_POLYGON_CHAIN_ID = 137;
3721
- var POLYMARKET_PUSD_ADDRESS = "0xC011a7E12a19f7B1f670d46F03B03f3342E82DFB";
3722
- var POLYMARKET_USDCE_ADDRESS = "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174";
3723
- var POLYMARKET_COLLATERAL_OFFRAMP_ADDRESS = "0x2957922Eb93258b93368531d39fAcCA3B4dC5854";
3724
- var SAFE_MULTI_SEND_CALL_ONLY_ADDRESS = "0x40A2aCCbd92BCA938b02010E17A5b8929b49130D";
3725
- var GAMMA_API_PUBLIC_PROFILE = "https://gamma-api.polymarket.com/public-profile";
3726
- var POLYMARKET_ICON_URL = "data:image/svg+xml,%3Csvg width='512' height='512' viewBox='0 0 512 512' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='512' height='512' fill='%232E5CFF'/%3E%3Cpath d='M375.84 389.422C375.84 403.572 375.84 410.647 371.212 414.154C366.585 417.662 359.773 415.75 346.15 411.927L127.22 350.493C119.012 348.19 114.907 347.038 112.534 343.907C110.161 340.776 110.161 336.513 110.161 327.988V184.012C110.161 175.487 110.161 171.224 112.534 168.093C114.907 164.962 119.012 163.81 127.22 161.507L346.15 100.072C359.773 96.2495 366.585 94.338 371.212 97.8455C375.84 101.353 375.84 108.428 375.84 122.578V389.422ZM164.761 330.463L346.035 381.337V279.595L164.761 330.463ZM139.963 306.862L321.201 256L139.963 205.138V306.862ZM164.759 181.537L346.035 232.406V130.663L164.759 181.537Z' fill='white'/%3E%3C/svg%3E";
3727
-
3728
3896
  // src/core/dapp-imports/polymarket/deposit-wallet.ts
3729
3897
  import {
3730
3898
  encodeFunctionData,
@@ -3891,204 +4059,12 @@ function buildPusdUnwrapCalls(recipient, amount) {
3891
4059
  ];
3892
4060
  }
3893
4061
 
3894
- // src/core/dapp-imports/polymarket/gamma-api.ts
3895
- import { getAddress, isAddress, zeroAddress } from "viem";
3896
- async function fetchPolymarketProxyWallet(eoa, signal) {
3897
- const url = `${GAMMA_API_PUBLIC_PROFILE}?address=${eoa}`;
3898
- let response;
3899
- try {
3900
- response = await fetch(url, { signal });
3901
- } catch {
3902
- return null;
3903
- }
3904
- if (!response.ok) {
3905
- return null;
3906
- }
3907
- let payload;
3908
- try {
3909
- payload = await response.json();
3910
- } catch {
3911
- return null;
3912
- }
3913
- const raw = payload.proxyWallet;
3914
- if (!raw || !isAddress(raw)) {
3915
- return null;
3916
- }
3917
- const checksummed = getAddress(raw);
3918
- if (checksummed === zeroAddress) {
3919
- return null;
3920
- }
3921
- return checksummed;
3922
- }
3923
-
3924
- // src/core/dapp-imports/polymarket/safe.ts
3925
- import {
3926
- concat,
3927
- encodeFunctionData as encodeFunctionData2,
3928
- encodePacked,
3929
- erc20Abi as erc20Abi4,
3930
- pad,
3931
- parseAbi as parseAbi2,
3932
- parseEventLogs,
3933
- toHex,
3934
- zeroAddress as zeroAddress2
3935
- } from "viem";
3936
- var COLLATERAL_OFFRAMP_ABI2 = parseAbi2([
3937
- "function unwrap(address _asset, address _to, uint256 _amount)"
3938
- ]);
3939
- var MULTI_SEND_ABI = parseAbi2(["function multiSend(bytes transactions)"]);
3940
- async function readPolymarketBalances(params) {
3941
- const { publicClient, proxyWallet } = params;
3942
- try {
3943
- const results = await publicClient.multicall({
3944
- allowFailure: true,
3945
- contracts: [
3946
- {
3947
- address: POLYMARKET_PUSD_ADDRESS,
3948
- abi: erc20Abi4,
3949
- functionName: "balanceOf",
3950
- args: [proxyWallet]
3951
- },
3952
- {
3953
- address: POLYMARKET_USDCE_ADDRESS,
3954
- abi: erc20Abi4,
3955
- functionName: "balanceOf",
3956
- args: [proxyWallet]
3957
- }
3958
- ]
3959
- });
3960
- return {
3961
- pusd: results[0].status === "success" ? results[0].result : 0n,
3962
- usdce: results[1].status === "success" ? results[1].result : 0n
3963
- };
3964
- } catch {
3965
- return { pusd: 0n, usdce: 0n };
3966
- }
3967
- }
3968
- async function executePolymarketSafeTransfer(params) {
3969
- const {
3970
- walletClient,
3971
- publicClient,
3972
- safeAddress,
3973
- recipient,
3974
- amount,
3975
- tokenKind
3976
- } = params;
3977
- const account = walletClient.account;
3978
- const chain = walletClient.chain;
3979
- if (!account || !chain) {
3980
- throw new Error("Wallet not connected");
3981
- }
3982
- if (chain.id !== POLYMARKET_POLYGON_CHAIN_ID) {
3983
- throw new Error("Switch to Polygon to sign");
3984
- }
3985
- const isOwner = await publicClient.readContract({
3986
- address: safeAddress,
3987
- abi: SAFE_ABI,
3988
- functionName: "isOwner",
3989
- args: [account.address]
3990
- });
3991
- if (!isOwner) {
3992
- throw new Error("Connected wallet is not a Polymarket Safe owner");
3993
- }
3994
- const safeTx = tokenKind === "pusd" ? buildPusdUnwrapSafeTx(recipient, amount) : buildUsdceTransferSafeTx(recipient, amount);
3995
- const signature = concat([
3996
- pad(account.address, { size: 32 }),
3997
- pad(toHex(0), { size: 32 }),
3998
- toHex(1, { size: 1 })
3999
- ]);
4000
- const txHash = await walletClient.writeContract({
4001
- account,
4002
- chain,
4003
- address: safeAddress,
4004
- abi: SAFE_ABI,
4005
- functionName: "execTransaction",
4006
- args: [
4007
- safeTx.to,
4008
- 0n,
4009
- safeTx.data,
4010
- safeTx.operation,
4011
- 0n,
4012
- 0n,
4013
- 0n,
4014
- zeroAddress2,
4015
- zeroAddress2,
4016
- signature
4017
- ]
4018
- });
4019
- const receipt = await publicClient.waitForTransactionReceipt({
4020
- hash: txHash
4021
- });
4022
- const parsed = parseEventLogs({
4023
- abi: SAFE_ABI,
4024
- logs: receipt.logs.filter(
4025
- (log) => log.address.toLowerCase() === safeAddress.toLowerCase()
4026
- ),
4027
- strict: false
4028
- });
4029
- if (parsed.some((log) => log.eventName === "ExecutionFailure")) {
4030
- throw new Error("Polymarket Safe transaction failed");
4031
- }
4032
- if (!parsed.some((log) => log.eventName === "ExecutionSuccess")) {
4033
- throw new Error("Polymarket Safe transaction status unavailable");
4034
- }
4035
- return {
4036
- txHash,
4037
- // The smart account always receives USDC.e — pUSD is unwrapped to USDC.e
4038
- // before it lands at `recipient`.
4039
- sourceToken: POLYMARKET_USDCE_ADDRESS,
4040
- sourceSymbol: tokenKind === "pusd" ? "pUSD" : "USDC.e"
4041
- };
4042
- }
4043
- function buildUsdceTransferSafeTx(recipient, amount) {
4044
- return {
4045
- to: POLYMARKET_USDCE_ADDRESS,
4046
- data: encodeFunctionData2({
4047
- abi: erc20Abi4,
4048
- functionName: "transfer",
4049
- args: [recipient, amount]
4050
- }),
4051
- operation: 0
4052
- };
4053
- }
4054
- function buildPusdUnwrapSafeTx(recipient, amount) {
4055
- const approveData = encodeFunctionData2({
4056
- abi: erc20Abi4,
4057
- functionName: "approve",
4058
- args: [POLYMARKET_COLLATERAL_OFFRAMP_ADDRESS, amount]
4059
- });
4060
- const unwrapData = encodeFunctionData2({
4061
- abi: COLLATERAL_OFFRAMP_ABI2,
4062
- functionName: "unwrap",
4063
- args: [POLYMARKET_USDCE_ADDRESS, recipient, amount]
4064
- });
4065
- return {
4066
- to: SAFE_MULTI_SEND_CALL_ONLY_ADDRESS,
4067
- data: encodeFunctionData2({
4068
- abi: MULTI_SEND_ABI,
4069
- functionName: "multiSend",
4070
- args: [
4071
- concat([
4072
- encodeMultiSendCall(POLYMARKET_PUSD_ADDRESS, approveData),
4073
- encodeMultiSendCall(POLYMARKET_COLLATERAL_OFFRAMP_ADDRESS, unwrapData)
4074
- ])
4075
- ]
4076
- }),
4077
- operation: 1
4078
- };
4079
- }
4080
- function encodeMultiSendCall(to, data) {
4081
- return encodePacked(
4082
- ["uint8", "address", "uint256", "uint256", "bytes"],
4083
- [0, to, 0n, BigInt((data.length - 2) / 2), data]
4084
- );
4085
- }
4086
-
4087
4062
  // src/core/dapp-imports/polymarket/index.ts
4088
4063
  var PROVIDER_ID = "polymarket";
4089
4064
  var polymarketProvider = {
4090
4065
  id: PROVIDER_ID,
4091
4066
  label: "Transfer from Polymarket",
4067
+ sourceLabel: "Polymarket",
4092
4068
  icon: createElement("img", {
4093
4069
  src: POLYMARKET_ICON_URL,
4094
4070
  alt: "Polymarket",
@@ -4213,6 +4189,77 @@ function getEnabledProviders(config) {
4213
4189
  );
4214
4190
  }
4215
4191
 
4192
+ // src/store/selectors.ts
4193
+ var selectedWalletIdSelector = (state) => state.wallet.selectedWalletId;
4194
+ var IDLE_SETUP_ENTRY = {
4195
+ owner: null,
4196
+ requestKey: null,
4197
+ cacheKey: null,
4198
+ status: "idle",
4199
+ smartAccount: null,
4200
+ sessionOwnerAddress: null,
4201
+ solanaDepositAddress: null,
4202
+ message: null,
4203
+ cacheable: true,
4204
+ attemptNonce: 0
4205
+ };
4206
+ function readSetupForOwner(setup, owner) {
4207
+ if (!owner) return IDLE_SETUP_ENTRY;
4208
+ const entry = setup.byOwner[owner.toLowerCase()];
4209
+ return entry ?? { ...IDLE_SETUP_ENTRY, owner };
4210
+ }
4211
+
4212
+ // src/core/dapp-imports/status.ts
4213
+ function computeDappImportStatus(providerId, inputs) {
4214
+ const { owner, availability, availabilityOwner, setup } = inputs;
4215
+ if (!owner) return "needs-connect";
4216
+ const entry = availabilityOwner?.toLowerCase() === owner.toLowerCase() ? availability[providerId] : void 0;
4217
+ if (entry === "loading" || entry === void 0) return "loading";
4218
+ if (entry === "error") {
4219
+ return {
4220
+ enabled: false,
4221
+ reason: "Couldn't load balance \u2014 tap to retry",
4222
+ retryable: true
4223
+ };
4224
+ }
4225
+ if (entry === null) return { enabled: false, reason: "No balance" };
4226
+ const setupEntry = readSetupForOwner(setup, owner);
4227
+ if (setupEntry.status === "loading") return "loading";
4228
+ if (setupEntry.status === "error") {
4229
+ return {
4230
+ enabled: false,
4231
+ reason: "Couldn't prepare account \u2014 tap to retry",
4232
+ retryable: true
4233
+ };
4234
+ }
4235
+ return { enabled: true, balanceUsd: entry.totalUsd };
4236
+ }
4237
+ function resolveBootOutcome(params) {
4238
+ const { status, setupStatus, timedOut, walletHydrating, signerAvailable } = params;
4239
+ if (status === "needs-connect") {
4240
+ return walletHydrating && !timedOut ? "wait" : "unavailable";
4241
+ }
4242
+ if (status === "loading") return timedOut ? "error" : "wait";
4243
+ if (!status.enabled) {
4244
+ return status.retryable ? "error" : "unavailable";
4245
+ }
4246
+ if (setupStatus === "ready") {
4247
+ if (!signerAvailable) return timedOut ? "error" : "wait";
4248
+ return "ready";
4249
+ }
4250
+ if (setupStatus === "error") return "error";
4251
+ return timedOut ? "error" : "wait";
4252
+ }
4253
+ function bootRetryPlan(params) {
4254
+ const { setupStatus, availabilityEntry } = params;
4255
+ return {
4256
+ restartSetup: setupStatus !== "ready",
4257
+ // `null` is a delivered "no account" — only refetch when nothing
4258
+ // usable came back ("error", still "loading", or never recorded).
4259
+ refetchAvailability: availabilityEntry === "error" || availabilityEntry === "loading" || availabilityEntry === void 0
4260
+ };
4261
+ }
4262
+
4216
4263
  // src/core/dapp-imports/types.ts
4217
4264
  function isDappImportAsset(asset) {
4218
4265
  return typeof asset.source === "string" && typeof asset.sourceLabel === "string" && "providerMetadata" in asset;
@@ -4336,6 +4383,7 @@ function applyBack(state, hasWalletOptions) {
4336
4383
  case "fiat-onramp":
4337
4384
  case "exchange-select":
4338
4385
  case "solana-token-select":
4386
+ case "dapp-import-resolving":
4339
4387
  case "dapp-import-asset-select":
4340
4388
  return {
4341
4389
  ...state,
@@ -4350,7 +4398,8 @@ function applyBack(state, hasWalletOptions) {
4350
4398
  dappImport: {
4351
4399
  ...state.dappImport,
4352
4400
  activeProviderId: null,
4353
- selectedAsset: null
4401
+ selectedAsset: null,
4402
+ bootError: false
4354
4403
  },
4355
4404
  exchange: { selectedConnection: null }
4356
4405
  };
@@ -4493,16 +4542,6 @@ function applyAction(state, action) {
4493
4542
  },
4494
4543
  exchange: { selectedConnection: action.connection }
4495
4544
  };
4496
- case "connect/auto-locked":
4497
- return {
4498
- ...state,
4499
- flow: {
4500
- ...state.flow,
4501
- mode: "wallet",
4502
- isConnectSelectionConfirmed: true,
4503
- step: "select-asset"
4504
- }
4505
- };
4506
4545
  case "connect/wallet-picker-requested":
4507
4546
  return {
4508
4547
  ...state,
@@ -4685,17 +4724,41 @@ function applyAction(state, action) {
4685
4724
  }
4686
4725
  }
4687
4726
  };
4688
- case "dapp-import/availability-cleared":
4727
+ case "dapp-import/availability-failed":
4728
+ if (!state.dappImport.availabilityOwner || ownerKey(state.dappImport.availabilityOwner) !== ownerKey(action.owner)) {
4729
+ return state;
4730
+ }
4731
+ return {
4732
+ ...state,
4733
+ dappImport: {
4734
+ ...state.dappImport,
4735
+ availability: {
4736
+ ...state.dappImport.availability,
4737
+ [action.providerId]: "error"
4738
+ }
4739
+ }
4740
+ };
4741
+ case "dapp-import/availability-retry-requested":
4742
+ return {
4743
+ ...state,
4744
+ dappImport: {
4745
+ ...state.dappImport,
4746
+ attemptNonce: state.dappImport.attemptNonce + 1
4747
+ }
4748
+ };
4749
+ case "dapp-import/availability-cleared": {
4750
+ const isBootResolving = state.flow.step === "dapp-import-resolving";
4689
4751
  return {
4690
4752
  ...state,
4691
4753
  dappImport: {
4692
4754
  ...state.dappImport,
4693
4755
  availabilityOwner: null,
4694
4756
  availability: {},
4695
- activeProviderId: null,
4696
- selectedAsset: null
4757
+ activeProviderId: isBootResolving ? state.dappImport.activeProviderId : null,
4758
+ selectedAsset: isBootResolving ? state.dappImport.selectedAsset : null
4697
4759
  }
4698
4760
  };
4761
+ }
4699
4762
  case "dapp-import/provider-selected":
4700
4763
  return {
4701
4764
  ...state,
@@ -4724,6 +4787,57 @@ function applyAction(state, action) {
4724
4787
  },
4725
4788
  flow: { ...state.flow, step: "amount" }
4726
4789
  };
4790
+ case "dapp-import/boot-requested":
4791
+ return {
4792
+ ...state,
4793
+ flow: {
4794
+ ...state.flow,
4795
+ mode: "dapp-import",
4796
+ isConnectSelectionConfirmed: true,
4797
+ step: "dapp-import-resolving"
4798
+ },
4799
+ dappImport: {
4800
+ ...state.dappImport,
4801
+ activeProviderId: action.providerId,
4802
+ selectedAsset: null,
4803
+ bootError: false
4804
+ }
4805
+ };
4806
+ case "dapp-import/boot-resolved": {
4807
+ if (state.flow.step !== "dapp-import-resolving" || state.dappImport.activeProviderId !== action.providerId) {
4808
+ return state;
4809
+ }
4810
+ switch (action.outcome) {
4811
+ case "ready":
4812
+ return {
4813
+ ...state,
4814
+ flow: { ...state.flow, step: "dapp-import-asset-select" },
4815
+ dappImport: { ...state.dappImport, bootError: false }
4816
+ };
4817
+ case "unavailable":
4818
+ return {
4819
+ ...state,
4820
+ flow: {
4821
+ ...state.flow,
4822
+ step: "connect",
4823
+ mode: null,
4824
+ isConnectSelectionConfirmed: false,
4825
+ hasNavigatedBack: true
4826
+ },
4827
+ dappImport: {
4828
+ ...state.dappImport,
4829
+ activeProviderId: null,
4830
+ selectedAsset: null,
4831
+ bootError: false
4832
+ }
4833
+ };
4834
+ case "error":
4835
+ return {
4836
+ ...state,
4837
+ dappImport: { ...state.dappImport, bootError: true }
4838
+ };
4839
+ }
4840
+ }
4727
4841
  case "back/requested":
4728
4842
  return applyBack(state, action.hasWalletOptions);
4729
4843
  case "flow/reset": {
@@ -4751,12 +4865,18 @@ function applyAction(state, action) {
4751
4865
  txHash: null,
4752
4866
  directTransfer: false
4753
4867
  },
4754
- // Preserve fetched availability for its recorded EOA — refetching on
4755
- // every modal close burns a request. Just clear active selection.
4868
+ // Drop fetched availability wholesale. The fetch effect refetches
4869
+ // unconditionally on remount (so keeping the map saves nothing),
4870
+ // and a preserved terminal entry (null / "error") could be consumed
4871
+ // by a fresh pre-routed boot before the refetch's loading update
4872
+ // lands — routing a now-funded account home off stale data.
4756
4873
  dappImport: {
4757
- ...state.dappImport,
4758
4874
  activeProviderId: null,
4759
- selectedAsset: null
4875
+ availabilityOwner: null,
4876
+ availability: {},
4877
+ selectedAsset: null,
4878
+ bootError: false,
4879
+ attemptNonce: 0
4760
4880
  },
4761
4881
  setup: { byOwner: preservedByOwner },
4762
4882
  fiat: { selectedMethod: null },
@@ -4830,7 +4950,9 @@ function createInitialState(overrides) {
4830
4950
  activeProviderId: null,
4831
4951
  availabilityOwner: null,
4832
4952
  availability: {},
4833
- selectedAsset: null
4953
+ selectedAsset: null,
4954
+ bootError: false,
4955
+ attemptNonce: 0
4834
4956
  },
4835
4957
  setup: {
4836
4958
  byOwner: {}
@@ -4844,26 +4966,6 @@ function createInitialState(overrides) {
4844
4966
  };
4845
4967
  }
4846
4968
 
4847
- // src/store/selectors.ts
4848
- var selectedWalletIdSelector = (state) => state.wallet.selectedWalletId;
4849
- var IDLE_SETUP_ENTRY = {
4850
- owner: null,
4851
- requestKey: null,
4852
- cacheKey: null,
4853
- status: "idle",
4854
- smartAccount: null,
4855
- sessionOwnerAddress: null,
4856
- solanaDepositAddress: null,
4857
- message: null,
4858
- cacheable: true,
4859
- attemptNonce: 0
4860
- };
4861
- function readSetupForOwner(setup, owner) {
4862
- if (!owner) return IDLE_SETUP_ENTRY;
4863
- const entry = setup.byOwner[owner.toLowerCase()];
4864
- return entry ?? { ...IDLE_SETUP_ENTRY, owner };
4865
- }
4866
-
4867
4969
  // src/store/index.ts
4868
4970
  function createDepositStore(overrides) {
4869
4971
  const store = createStore(() => createInitialState(overrides));
@@ -5142,34 +5244,55 @@ function mapError(error) {
5142
5244
  }
5143
5245
 
5144
5246
  // src/DepositFlow.tsx
5145
- import { Fragment as Fragment3, jsx as jsx17, jsxs as jsxs15 } from "react/jsx-runtime";
5247
+ import { Fragment as Fragment3, jsx as jsx20, jsxs as jsxs18 } from "react/jsx-runtime";
5146
5248
  function AccountPreparingSkeleton({
5147
5249
  errorMessage,
5148
5250
  onRetry
5149
5251
  }) {
5150
- return /* @__PURE__ */ jsxs15("div", { className: "rs-step", children: [
5151
- /* @__PURE__ */ jsx17("div", { className: "rs-step-body", style: { paddingTop: 0 }, children: /* @__PURE__ */ jsx17("div", { className: "rs-loading-state", children: /* @__PURE__ */ jsx17("div", { className: "rs-loading-text", children: errorMessage ? /* @__PURE__ */ jsxs15(Fragment3, { children: [
5152
- /* @__PURE__ */ jsx17("div", { className: "rs-loading-title rs-text-error", children: "Couldn\u2019t prepare account" }),
5153
- /* @__PURE__ */ jsx17("div", { className: "rs-loading-subtitle", children: errorMessage })
5154
- ] }) : /* @__PURE__ */ jsx17("div", { className: "rs-loading-title", children: "Preparing\u2026" }) }) }) }),
5155
- errorMessage && onRetry && /* @__PURE__ */ jsx17("div", { className: "rs-step-footer", children: /* @__PURE__ */ jsx17(
5252
+ return /* @__PURE__ */ jsxs18("div", { className: "rs-step", children: [
5253
+ /* @__PURE__ */ jsx20("div", { className: "rs-step-body", style: { paddingTop: 0 }, children: /* @__PURE__ */ jsx20("div", { className: "rs-loading-state", children: /* @__PURE__ */ jsx20("div", { className: "rs-loading-text", children: errorMessage ? /* @__PURE__ */ jsxs18(Fragment3, { children: [
5254
+ /* @__PURE__ */ jsx20("div", { className: "rs-loading-title rs-text-error", children: "Couldn\u2019t prepare account" }),
5255
+ /* @__PURE__ */ jsx20("div", { className: "rs-loading-subtitle", children: errorMessage })
5256
+ ] }) : /* @__PURE__ */ jsx20("div", { className: "rs-loading-title", children: "Preparing\u2026" }) }) }) }),
5257
+ errorMessage && onRetry && /* @__PURE__ */ jsx20("div", { className: "rs-step-footer", children: /* @__PURE__ */ jsx20(
5156
5258
  "button",
5157
5259
  {
5158
5260
  type: "button",
5159
5261
  className: "rs-button rs-button--default rs-button--full-width",
5160
5262
  onClick: onRetry,
5161
- children: /* @__PURE__ */ jsx17("span", { children: "Try again" })
5263
+ children: /* @__PURE__ */ jsx20("span", { children: "Try again" })
5162
5264
  }
5163
5265
  ) })
5164
5266
  ] });
5165
5267
  }
5166
5268
  var QR_AUTO_ADVANCE_HYDRATION_GRACE_MS = 1e3;
5269
+ var DAPP_IMPORT_RESOLVE_TIMEOUT_MS = 1e4;
5167
5270
  function isSameRoute2(sourceChain, sourceToken, targetChain, targetToken) {
5168
5271
  return sourceChain === targetChain && sourceToken.toLowerCase() === targetToken.toLowerCase();
5169
5272
  }
5170
5273
  var SWAPPED_SOURCE_CHAIN = 8453;
5171
5274
  var SWAPPED_SOURCE_TOKEN = "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913";
5172
5275
  var SWAPPED_SOURCE_DECIMALS = 6;
5276
+ var DEFAULT_FIAT_ONRAMP_METHODS = [
5277
+ {
5278
+ method: "creditcard",
5279
+ label: "Debit/Credit card",
5280
+ sublabel: "Instant - $10,000 limit",
5281
+ icon: "card"
5282
+ },
5283
+ {
5284
+ method: "bank-transfer",
5285
+ label: "Bank transfer",
5286
+ sublabel: "Instant - $10,000 limit",
5287
+ icon: "bank"
5288
+ },
5289
+ {
5290
+ method: "apple-pay",
5291
+ label: "Apple pay",
5292
+ sublabel: "Instant - $10,000 limit",
5293
+ icon: "apple"
5294
+ }
5295
+ ];
5173
5296
  function getAddressKey(address) {
5174
5297
  return address ? address.toLowerCase() : null;
5175
5298
  }
@@ -5252,6 +5375,8 @@ function deriveStep(flow, d, p, activeEntry, fiat, exchange) {
5252
5375
  balanceUsd: d.balanceUsd,
5253
5376
  inputAmountUsd: d.inputAmountUsd ?? void 0
5254
5377
  };
5378
+ case "dapp-import-resolving":
5379
+ return { type: "dapp-import-resolving" };
5255
5380
  case "dapp-import-asset-select":
5256
5381
  if (!smartAccount) return { type: "setup" };
5257
5382
  return { type: "dapp-import-asset-select", smartAccount };
@@ -5326,6 +5451,7 @@ function DepositFlow({
5326
5451
  forceRegister = false,
5327
5452
  enableSolana = true,
5328
5453
  dappImports,
5454
+ initialDappImport,
5329
5455
  enableFiatOnramp = false,
5330
5456
  enableQrTransfer = true,
5331
5457
  fiatOnrampMethods,
@@ -5466,6 +5592,9 @@ function DepositFlow({
5466
5592
  const isWalletHydrationPending = Boolean(
5467
5593
  dappAddress && !hasWalletOptions && (hasDappWalletClientProp && dappWalletClient === void 0 || reownWallet && !hasReownSession && !reownWallet.isReady)
5468
5594
  );
5595
+ const isDappImportWalletHydrating = Boolean(
5596
+ hasDappWalletClientProp && dappWalletClient === void 0 || reownWallet && !hasReownSession && !reownWallet.isReady
5597
+ );
5469
5598
  const showConnectStep = flowMode === null && !isConnectSelectionConfirmed;
5470
5599
  useEffect10(() => {
5471
5600
  if (!isWalletHydrationPending) {
@@ -5730,7 +5859,10 @@ function DepositFlow({
5730
5859
  portfolioAssetsRef.current = [];
5731
5860
  }
5732
5861
  }, [storeApi, hasWalletOptions, reownWallet]);
5733
- const canGoBackFromHere = effectiveStep.type === "deposit-address" || effectiveStep.type === "solana-token-select" || effectiveStep.type === "solana-amount" || effectiveStep.type === "solana-confirm" || effectiveStep.type === "amount" || effectiveStep.type === "confirm" || effectiveStep.type === "dapp-import-asset-select" || effectiveStep.type === "fiat-onramp" || effectiveStep.type === "exchange-select" || effectiveStep.type === "exchange-connect" || effectiveStep.type === "select-asset" && signerContext && !canAutoLock;
5862
+ const canGoBackFromHere = effectiveStep.type === "deposit-address" || effectiveStep.type === "solana-token-select" || effectiveStep.type === "solana-amount" || effectiveStep.type === "solana-confirm" || effectiveStep.type === "amount" || effectiveStep.type === "confirm" || // Escape hatch from a slow or stuck pre-routed resolve. Mode-gated so
5863
+ // the chevron doesn't linger if a disconnect cleared the mode out from
5864
+ // under the step.
5865
+ effectiveStep.type === "dapp-import-resolving" && flowMode === "dapp-import" || effectiveStep.type === "dapp-import-asset-select" || effectiveStep.type === "fiat-onramp" || effectiveStep.type === "exchange-select" || effectiveStep.type === "exchange-connect" || effectiveStep.type === "select-asset" && signerContext && !canAutoLock;
5734
5866
  const currentBackHandler = canGoBackFromHere ? handleBack : void 0;
5735
5867
  const currentScreen = showConnectStep ? "connect" : effectiveStep.type;
5736
5868
  useEffect10(() => {
@@ -5868,6 +6000,10 @@ function DepositFlow({
5868
6000
  // eslint-disable-next-line react-hooks/exhaustive-deps -- intentional: keyed on dappImportsKey, not the dappImports object identity
5869
6001
  [dappImportsKey, isSolanaWalletConnected]
5870
6002
  );
6003
+ const initialDappImportProvider = useMemo7(
6004
+ () => initialDappImport ? enabledDappImportProviders.find((p) => p.id === initialDappImport) ?? null : null,
6005
+ [initialDappImport, enabledDappImportProviders]
6006
+ );
5871
6007
  const handleSelectDappImport = useCallback7(
5872
6008
  (providerId) => {
5873
6009
  const owner = dappImportOwner;
@@ -5895,6 +6031,9 @@ function DepositFlow({
5895
6031
  },
5896
6032
  [storeApi]
5897
6033
  );
6034
+ const dappImportAttemptNonce = useDepositStore(
6035
+ (s) => s.dappImport.attemptNonce
6036
+ );
5898
6037
  useEffect10(() => {
5899
6038
  if (!dappImportOwner || enabledDappImportProviders.length === 0) {
5900
6039
  storeApi.dispatch({ type: "dapp-import/availability-cleared" });
@@ -5928,15 +6067,29 @@ function DepositFlow({
5928
6067
  }).catch(() => {
5929
6068
  if (controller.signal.aborted) return;
5930
6069
  storeApi.dispatch({
5931
- type: "dapp-import/availability-loaded",
6070
+ type: "dapp-import/availability-failed",
5932
6071
  providerId: provider.id,
5933
- owner: dappImportOwner,
5934
- availability: null
6072
+ owner: dappImportOwner
5935
6073
  });
5936
6074
  });
5937
6075
  }
5938
6076
  return () => controller.abort();
5939
- }, [dappImportOwner, enabledDappImportProviders, storeApi]);
6077
+ }, [
6078
+ dappImportOwner,
6079
+ enabledDappImportProviders,
6080
+ dappImportAttemptNonce,
6081
+ storeApi
6082
+ ]);
6083
+ useLayoutEffect2(() => {
6084
+ if (!initialDappImportProvider) return;
6085
+ if (flowSlice.step !== "connect" || flowSlice.mode !== null || flowSlice.isConnectSelectionConfirmed || flowSlice.hasNavigatedBack) {
6086
+ return;
6087
+ }
6088
+ storeApi.dispatch({
6089
+ type: "dapp-import/boot-requested",
6090
+ providerId: initialDappImportProvider.id
6091
+ });
6092
+ }, [initialDappImportProvider, flowSlice, storeApi]);
5940
6093
  const dappImportAvailability = useDepositStore((s) => s.dappImport.availability);
5941
6094
  const dappImportAvailabilityOwner = useDepositStore(
5942
6095
  (s) => s.dappImport.availabilityOwner
@@ -5944,48 +6097,19 @@ function DepositFlow({
5944
6097
  const activeDappImportProviderId = useDepositStore(
5945
6098
  (s) => s.dappImport.activeProviderId
5946
6099
  );
6100
+ const dappImportBootError = useDepositStore((s) => s.dappImport.bootError);
5947
6101
  const connectStepDappImports = useMemo7(
5948
- () => enabledDappImportProviders.map((provider) => {
5949
- const baseRow = {
5950
- id: provider.id,
5951
- label: provider.label,
5952
- icon: provider.icon
5953
- };
5954
- if (!dappImportOwner) {
5955
- return { ...baseRow, status: "needs-connect" };
5956
- }
5957
- const availabilityEntry = dappImportAvailabilityOwner?.toLowerCase() === dappImportOwner.toLowerCase() ? dappImportAvailability[provider.id] : void 0;
5958
- const dappImportSetup = readSetupForOwner(setupSlice, dappImportOwner);
5959
- if (availabilityEntry === "loading" || availabilityEntry === void 0) {
5960
- return { ...baseRow, status: "loading" };
5961
- }
5962
- if (availabilityEntry === null) {
5963
- return {
5964
- ...baseRow,
5965
- status: { enabled: false, reason: "No balance" }
5966
- };
5967
- }
5968
- if (dappImportSetup.status === "loading" || !dappImportOwner) {
5969
- return { ...baseRow, status: "loading" };
5970
- }
5971
- if (dappImportSetup.status === "error") {
5972
- return {
5973
- ...baseRow,
5974
- status: {
5975
- enabled: false,
5976
- reason: "Couldn't prepare account \u2014 tap to retry",
5977
- retryable: true
5978
- }
5979
- };
5980
- }
5981
- return {
5982
- ...baseRow,
5983
- status: {
5984
- enabled: true,
5985
- balanceUsd: availabilityEntry.totalUsd
5986
- }
5987
- };
5988
- }),
6102
+ () => enabledDappImportProviders.map((provider) => ({
6103
+ id: provider.id,
6104
+ label: provider.label,
6105
+ icon: provider.icon,
6106
+ status: computeDappImportStatus(provider.id, {
6107
+ owner: dappImportOwner,
6108
+ availability: dappImportAvailability,
6109
+ availabilityOwner: dappImportAvailabilityOwner,
6110
+ setup: setupSlice
6111
+ })
6112
+ })),
5989
6113
  [
5990
6114
  enabledDappImportProviders,
5991
6115
  dappImportAvailability,
@@ -6006,7 +6130,7 @@ function DepositFlow({
6006
6130
  return null;
6007
6131
  }
6008
6132
  const entry = dappImportAvailability[activeDappImportProviderId];
6009
- if (!entry || entry === "loading") return null;
6133
+ if (!entry || entry === "loading" || entry === "error") return null;
6010
6134
  return entry;
6011
6135
  }, [
6012
6136
  activeDappImportProviderId,
@@ -6014,6 +6138,96 @@ function DepositFlow({
6014
6138
  dappImportAvailabilityOwner,
6015
6139
  dappImportOwner
6016
6140
  ]);
6141
+ const isBootResolving = isDappImportMode && flowSlice.step === "dapp-import-resolving";
6142
+ const [hasResolveDeadlinePassed, setHasResolveDeadlinePassed] = useState11(false);
6143
+ useEffect10(() => {
6144
+ setHasResolveDeadlinePassed(false);
6145
+ if (!isBootResolving || dappImportBootError) return;
6146
+ const timeout = window.setTimeout(() => {
6147
+ setHasResolveDeadlinePassed(true);
6148
+ }, DAPP_IMPORT_RESOLVE_TIMEOUT_MS);
6149
+ return () => window.clearTimeout(timeout);
6150
+ }, [isBootResolving, dappImportBootError]);
6151
+ useEffect10(() => {
6152
+ if (!isBootResolving || dappImportBootError) return;
6153
+ const providerId = activeDappImportProviderId;
6154
+ if (!providerId) return;
6155
+ if (!enabledDappImportProviders.some((p) => p.id === providerId)) {
6156
+ storeApi.dispatch({
6157
+ type: "dapp-import/boot-resolved",
6158
+ providerId,
6159
+ outcome: "unavailable"
6160
+ });
6161
+ return;
6162
+ }
6163
+ const status = computeDappImportStatus(providerId, {
6164
+ owner: dappImportOwner,
6165
+ availability: dappImportAvailability,
6166
+ availabilityOwner: dappImportAvailabilityOwner,
6167
+ setup: setupSlice
6168
+ });
6169
+ const pinnableWallet = dappImportOwner ? walletOptions.find(
6170
+ (o) => (o.address ?? null)?.toLowerCase() === dappImportOwner.toLowerCase()
6171
+ ) ?? null : null;
6172
+ const outcome = resolveBootOutcome({
6173
+ status,
6174
+ setupStatus: readSetupForOwner(setupSlice, dappImportOwner).status,
6175
+ timedOut: hasResolveDeadlinePassed,
6176
+ walletHydrating: isDappImportWalletHydrating,
6177
+ signerAvailable: pinnableWallet !== null
6178
+ });
6179
+ if (outcome === "wait") return;
6180
+ if (outcome === "ready" && pinnableWallet) {
6181
+ storeApi.dispatch({
6182
+ type: "wallet/id-selected",
6183
+ walletId: pinnableWallet.id
6184
+ });
6185
+ }
6186
+ storeApi.dispatch({
6187
+ type: "dapp-import/boot-resolved",
6188
+ providerId,
6189
+ outcome
6190
+ });
6191
+ }, [
6192
+ isBootResolving,
6193
+ dappImportBootError,
6194
+ activeDappImportProviderId,
6195
+ enabledDappImportProviders,
6196
+ dappImportOwner,
6197
+ dappImportAvailability,
6198
+ dappImportAvailabilityOwner,
6199
+ setupSlice,
6200
+ hasResolveDeadlinePassed,
6201
+ isDappImportWalletHydrating,
6202
+ walletOptions,
6203
+ storeApi
6204
+ ]);
6205
+ const handleBootRetry = useCallback7(() => {
6206
+ const snapshot = storeApi.getState();
6207
+ const providerId = snapshot.dappImport.activeProviderId;
6208
+ if (!providerId) return;
6209
+ if (dappImportOwner) {
6210
+ const plan = bootRetryPlan({
6211
+ setupStatus: readSetupForOwner(snapshot.setup, dappImportOwner).status,
6212
+ availabilityEntry: snapshot.dappImport.availabilityOwner?.toLowerCase() === dappImportOwner.toLowerCase() ? snapshot.dappImport.availability[providerId] : void 0
6213
+ });
6214
+ if (plan.restartSetup) {
6215
+ storeApi.dispatch({
6216
+ type: "setup/retry-requested",
6217
+ owner: dappImportOwner
6218
+ });
6219
+ }
6220
+ if (plan.refetchAvailability) {
6221
+ storeApi.dispatch({
6222
+ type: "dapp-import/availability-retry-requested"
6223
+ });
6224
+ }
6225
+ }
6226
+ storeApi.dispatch({
6227
+ type: "dapp-import/boot-requested",
6228
+ providerId
6229
+ });
6230
+ }, [storeApi, dappImportOwner]);
6017
6231
  const handleSelectFiatMethod = useCallback7(
6018
6232
  (paymentMethod) => {
6019
6233
  storeApi.dispatch({
@@ -6414,10 +6628,17 @@ function DepositFlow({
6414
6628
  }
6415
6629
  }, [walletOptionsKey]);
6416
6630
  useEffect10(() => {
6417
- if (!showConnectStep && isConnectSelectionConfirmed && (flowMode === "wallet" || flowMode === "dapp-import") && !signerContext) {
6631
+ if (!showConnectStep && isConnectSelectionConfirmed && (flowMode === "wallet" || flowMode === "dapp-import") && flowSlice.step !== "dapp-import-resolving" && !signerContext) {
6418
6632
  storeApi.dispatch({ type: "wallet/cleared" });
6419
6633
  }
6420
- }, [showConnectStep, isConnectSelectionConfirmed, flowMode, signerContext, storeApi]);
6634
+ }, [
6635
+ showConnectStep,
6636
+ isConnectSelectionConfirmed,
6637
+ flowMode,
6638
+ flowSlice.step,
6639
+ signerContext,
6640
+ storeApi
6641
+ ]);
6421
6642
  useEffect10(() => {
6422
6643
  if (enableSolana || flowMode !== "solana-wallet") {
6423
6644
  return;
@@ -6428,7 +6649,7 @@ function DepositFlow({
6428
6649
  }
6429
6650
  }, [enableSolana, flowMode, storeApi]);
6430
6651
  useEffect10(() => {
6431
- if (hasNavigatedBack || isConnectSelectionConfirmed || flowMode || enableFiatOnramp || enableExchangeConnect) {
6652
+ if (hasNavigatedBack || isConnectSelectionConfirmed || flowMode || enableFiatOnramp || enableExchangeConnect || initialDappImportProvider) {
6432
6653
  return;
6433
6654
  }
6434
6655
  if (enableQrTransfer && !hasWalletOptions && dappAddress && !hasReownSession && !dappWalletClient && hasQrAutoAdvanceGraceElapsed) {
@@ -6444,6 +6665,7 @@ function DepositFlow({
6444
6665
  hasNavigatedBack,
6445
6666
  dappAddress,
6446
6667
  dappWalletClient,
6668
+ initialDappImportProvider,
6447
6669
  handleSelectTransferCrypto
6448
6670
  ]);
6449
6671
  const walletRows = useMemo7(() => {
@@ -6474,7 +6696,7 @@ function DepositFlow({
6474
6696
  [storeApi]
6475
6697
  );
6476
6698
  if (showConnectStep) {
6477
- return /* @__PURE__ */ jsx17("div", { className: "rs-modal-body", children: /* @__PURE__ */ jsx17(
6699
+ return /* @__PURE__ */ jsx20("div", { className: "rs-modal-body", children: /* @__PURE__ */ jsx20(
6478
6700
  ConnectStep,
6479
6701
  {
6480
6702
  walletRows,
@@ -6487,8 +6709,7 @@ function DepositFlow({
6487
6709
  }
6488
6710
  handleSelectTransferCrypto();
6489
6711
  } : void 0,
6490
- onSelectPayWithCard: enableFiatOnramp && dappAddress && (!fiatOnrampMethods || fiatOnrampMethods.length === 0) ? () => handleSelectFiatMethod() : void 0,
6491
- fiatPaymentMethods: enableFiatOnramp && dappAddress ? fiatOnrampMethods : void 0,
6712
+ fiatPaymentMethods: enableFiatOnramp && dappAddress ? fiatOnrampMethods && fiatOnrampMethods.length > 0 ? fiatOnrampMethods : DEFAULT_FIAT_ONRAMP_METHODS : void 0,
6492
6713
  onSelectFiatMethod: enableFiatOnramp && dappAddress ? (method) => handleSelectFiatMethod(method) : void 0,
6493
6714
  onSelectFundFromExchange: enableExchangeConnect && dappAddress ? () => handleSelectExchange() : void 0,
6494
6715
  onRequestConnect,
@@ -6508,6 +6729,13 @@ function DepositFlow({
6508
6729
  },
6509
6730
  dappImports: connectStepDappImports,
6510
6731
  onSelectDappImport: (providerId) => {
6732
+ const availabilityEntry = dappImportOwner && dappImportAvailabilityOwner?.toLowerCase() === dappImportOwner.toLowerCase() ? dappImportAvailability[providerId] : void 0;
6733
+ if (availabilityEntry === "error") {
6734
+ storeApi.dispatch({
6735
+ type: "dapp-import/availability-retry-requested"
6736
+ });
6737
+ return;
6738
+ }
6511
6739
  const dappImportEntry = readSetupForOwner(
6512
6740
  setupSlice,
6513
6741
  dappImportOwner
@@ -6524,21 +6752,21 @@ function DepositFlow({
6524
6752
  }
6525
6753
  if (isDepositAddressMode) {
6526
6754
  if (!dappAddress) return null;
6527
- return /* @__PURE__ */ jsxs15("div", { className: "rs-modal-body", children: [
6528
- effectiveStep.type === "setup" && (activeEntry.status === "error" ? /* @__PURE__ */ jsx17(
6755
+ return /* @__PURE__ */ jsxs18("div", { className: "rs-modal-body", children: [
6756
+ effectiveStep.type === "setup" && (activeEntry.status === "error" ? /* @__PURE__ */ jsx20(
6529
6757
  AccountPreparingSkeleton,
6530
6758
  {
6531
6759
  errorMessage: activeEntry.message ?? void 0,
6532
6760
  onRetry: () => handleRetrySetup(dappAddress)
6533
6761
  }
6534
- ) : /* @__PURE__ */ jsx17(
6762
+ ) : /* @__PURE__ */ jsx20(
6535
6763
  DepositAddressSkeleton,
6536
6764
  {
6537
6765
  uiConfig,
6538
6766
  allowedRoutes
6539
6767
  }
6540
6768
  )),
6541
- effectiveStep.type === "deposit-address" && /* @__PURE__ */ jsx17(
6769
+ effectiveStep.type === "deposit-address" && /* @__PURE__ */ jsx20(
6542
6770
  DepositAddressStep,
6543
6771
  {
6544
6772
  smartAccount: effectiveStep.smartAccount,
@@ -6571,21 +6799,21 @@ function DepositFlow({
6571
6799
  }
6572
6800
  if (isFiatOnrampMode) {
6573
6801
  if (!dappAddress) return null;
6574
- return /* @__PURE__ */ jsxs15(
6802
+ return /* @__PURE__ */ jsxs18(
6575
6803
  "div",
6576
6804
  {
6577
6805
  className: "rs-modal-body",
6578
6806
  "data-flow-mode": "fiat-onramp",
6579
6807
  "data-step-type": step.type,
6580
6808
  children: [
6581
- step.type === "setup" && /* @__PURE__ */ jsx17(
6809
+ step.type === "setup" && /* @__PURE__ */ jsx20(
6582
6810
  AccountPreparingSkeleton,
6583
6811
  {
6584
6812
  errorMessage: activeEntry.status === "error" ? activeEntry.message ?? void 0 : void 0,
6585
6813
  onRetry: activeEntry.status === "error" ? () => handleRetrySetup(dappAddress) : void 0
6586
6814
  }
6587
6815
  ),
6588
- step.type === "fiat-onramp" && /* @__PURE__ */ jsx17(
6816
+ step.type === "fiat-onramp" && /* @__PURE__ */ jsx20(
6589
6817
  FiatOnrampStep,
6590
6818
  {
6591
6819
  smartAccount: step.smartAccount,
@@ -6598,7 +6826,7 @@ function DepositFlow({
6598
6826
  onError: handleError
6599
6827
  }
6600
6828
  ),
6601
- step.type === "processing" && /* @__PURE__ */ jsx17(
6829
+ step.type === "processing" && /* @__PURE__ */ jsx20(
6602
6830
  ProcessingStep,
6603
6831
  {
6604
6832
  smartAccount: step.smartAccount,
@@ -6630,21 +6858,21 @@ function DepositFlow({
6630
6858
  }
6631
6859
  if (isExchangeConnectMode) {
6632
6860
  if (!dappAddress) return null;
6633
- return /* @__PURE__ */ jsxs15(
6861
+ return /* @__PURE__ */ jsxs18(
6634
6862
  "div",
6635
6863
  {
6636
6864
  className: "rs-modal-body",
6637
6865
  "data-flow-mode": "exchange-connect",
6638
6866
  "data-step-type": step.type,
6639
6867
  children: [
6640
- step.type === "setup" && /* @__PURE__ */ jsx17(
6868
+ step.type === "setup" && /* @__PURE__ */ jsx20(
6641
6869
  AccountPreparingSkeleton,
6642
6870
  {
6643
6871
  errorMessage: activeEntry.status === "error" ? activeEntry.message ?? void 0 : void 0,
6644
6872
  onRetry: activeEntry.status === "error" ? () => handleRetrySetup(dappAddress) : void 0
6645
6873
  }
6646
6874
  ),
6647
- step.type === "exchange-select" && /* @__PURE__ */ jsx17(
6875
+ step.type === "exchange-select" && /* @__PURE__ */ jsx20(
6648
6876
  ExchangeSelectStep,
6649
6877
  {
6650
6878
  service,
@@ -6652,7 +6880,7 @@ function DepositFlow({
6652
6880
  onError: handleError
6653
6881
  }
6654
6882
  ),
6655
- step.type === "exchange-connect" && /* @__PURE__ */ jsx17(
6883
+ step.type === "exchange-connect" && /* @__PURE__ */ jsx20(
6656
6884
  ExchangeConnectStep,
6657
6885
  {
6658
6886
  smartAccount: step.smartAccount,
@@ -6665,7 +6893,7 @@ function DepositFlow({
6665
6893
  onError: handleError
6666
6894
  }
6667
6895
  ),
6668
- step.type === "processing" && /* @__PURE__ */ jsx17(
6896
+ step.type === "processing" && /* @__PURE__ */ jsx20(
6669
6897
  ProcessingStep,
6670
6898
  {
6671
6899
  smartAccount: step.smartAccount,
@@ -6699,15 +6927,15 @@ function DepositFlow({
6699
6927
  if (!dappAddress) return null;
6700
6928
  const solanaAddr = reownWallet?.solanaAddress;
6701
6929
  const solanaProvider = reownWallet?.solanaProvider;
6702
- return /* @__PURE__ */ jsxs15("div", { className: "rs-modal-body", children: [
6703
- effectiveStep.type === "setup" && /* @__PURE__ */ jsx17(
6930
+ return /* @__PURE__ */ jsxs18("div", { className: "rs-modal-body", children: [
6931
+ effectiveStep.type === "setup" && /* @__PURE__ */ jsx20(
6704
6932
  AccountPreparingSkeleton,
6705
6933
  {
6706
6934
  errorMessage: activeEntry.status === "error" ? activeEntry.message ?? void 0 : void 0,
6707
6935
  onRetry: activeEntry.status === "error" ? () => handleRetrySetup(dappAddress) : void 0
6708
6936
  }
6709
6937
  ),
6710
- effectiveStep.type === "solana-token-select" && solanaAddr && /* @__PURE__ */ jsx17(
6938
+ effectiveStep.type === "solana-token-select" && solanaAddr && /* @__PURE__ */ jsx20(
6711
6939
  SolanaTokenSelectStep,
6712
6940
  {
6713
6941
  solanaAddress: solanaAddr,
@@ -6721,7 +6949,7 @@ function DepositFlow({
6721
6949
  debug
6722
6950
  }
6723
6951
  ),
6724
- effectiveStep.type === "solana-amount" && /* @__PURE__ */ jsx17(
6952
+ effectiveStep.type === "solana-amount" && /* @__PURE__ */ jsx20(
6725
6953
  SolanaAmountStep,
6726
6954
  {
6727
6955
  token: effectiveStep.token,
@@ -6740,7 +6968,7 @@ function DepositFlow({
6740
6968
  debug
6741
6969
  }
6742
6970
  ),
6743
- effectiveStep.type === "solana-confirm" && solanaAddr && solanaProvider ? /* @__PURE__ */ jsx17(
6971
+ effectiveStep.type === "solana-confirm" && solanaAddr && solanaProvider ? /* @__PURE__ */ jsx20(
6744
6972
  SolanaConfirmStep,
6745
6973
  {
6746
6974
  smartAccount: effectiveStep.smartAccount,
@@ -6761,16 +6989,16 @@ function DepositFlow({
6761
6989
  onError: handleError,
6762
6990
  debug
6763
6991
  }
6764
- ) : effectiveStep.type === "solana-confirm" ? /* @__PURE__ */ jsxs15("div", { className: "rs-step", children: [
6765
- /* @__PURE__ */ jsxs15("div", { className: "rs-loading-state", children: [
6766
- /* @__PURE__ */ jsx17("div", { className: "rs-step-icon rs-step-icon--error", children: /* @__PURE__ */ jsx17(
6992
+ ) : effectiveStep.type === "solana-confirm" ? /* @__PURE__ */ jsxs18("div", { className: "rs-step", children: [
6993
+ /* @__PURE__ */ jsxs18("div", { className: "rs-loading-state", children: [
6994
+ /* @__PURE__ */ jsx20("div", { className: "rs-step-icon rs-step-icon--error", children: /* @__PURE__ */ jsx20(
6767
6995
  "svg",
6768
6996
  {
6769
6997
  viewBox: "0 0 24 24",
6770
6998
  fill: "none",
6771
6999
  stroke: "currentColor",
6772
7000
  strokeWidth: "2",
6773
- children: /* @__PURE__ */ jsx17(
7001
+ children: /* @__PURE__ */ jsx20(
6774
7002
  "path",
6775
7003
  {
6776
7004
  strokeLinecap: "round",
@@ -6780,22 +7008,22 @@ function DepositFlow({
6780
7008
  )
6781
7009
  }
6782
7010
  ) }),
6783
- /* @__PURE__ */ jsxs15("div", { className: "rs-loading-text", children: [
6784
- /* @__PURE__ */ jsx17("div", { className: "rs-loading-title rs-text-error", children: "Wallet disconnected" }),
6785
- /* @__PURE__ */ jsx17("div", { className: "rs-loading-subtitle", children: "Please reconnect your Solana wallet to continue." })
7011
+ /* @__PURE__ */ jsxs18("div", { className: "rs-loading-text", children: [
7012
+ /* @__PURE__ */ jsx20("div", { className: "rs-loading-title rs-text-error", children: "Wallet disconnected" }),
7013
+ /* @__PURE__ */ jsx20("div", { className: "rs-loading-subtitle", children: "Please reconnect your Solana wallet to continue." })
6786
7014
  ] })
6787
7015
  ] }),
6788
- /* @__PURE__ */ jsx17("div", { className: "rs-step-footer", children: /* @__PURE__ */ jsx17(
7016
+ /* @__PURE__ */ jsx20("div", { className: "rs-step-footer", children: /* @__PURE__ */ jsx20(
6789
7017
  "button",
6790
7018
  {
6791
7019
  type: "button",
6792
7020
  className: "rs-button rs-button--default rs-button--full-width",
6793
7021
  onClick: handleBack,
6794
- children: /* @__PURE__ */ jsx17("span", { children: "Go Back" })
7022
+ children: /* @__PURE__ */ jsx20("span", { children: "Go Back" })
6795
7023
  }
6796
7024
  ) })
6797
7025
  ] }) : null,
6798
- effectiveStep.type === "processing" && /* @__PURE__ */ jsx17(
7026
+ effectiveStep.type === "processing" && /* @__PURE__ */ jsx20(
6799
7027
  ProcessingStep,
6800
7028
  {
6801
7029
  smartAccount: effectiveStep.smartAccount,
@@ -6822,8 +7050,26 @@ function DepositFlow({
6822
7050
  )
6823
7051
  ] });
6824
7052
  }
7053
+ if (isDappImportMode && effectiveStep.type === "dapp-import-resolving") {
7054
+ return /* @__PURE__ */ jsx20(
7055
+ "div",
7056
+ {
7057
+ className: "rs-modal-body",
7058
+ "data-flow-mode": "dapp-import",
7059
+ "data-step-type": effectiveStep.type,
7060
+ children: /* @__PURE__ */ jsx20(
7061
+ DappImportAssetSelectSkeleton,
7062
+ {
7063
+ sourceLabel: activeDappImportProvider?.sourceLabel ?? "",
7064
+ error: dappImportBootError,
7065
+ onRetry: handleBootRetry
7066
+ }
7067
+ )
7068
+ }
7069
+ );
7070
+ }
6825
7071
  if (!signerContext?.walletClient || !signerContext?.publicClient) {
6826
- return /* @__PURE__ */ jsx17("div", { className: "rs-modal-body", children: /* @__PURE__ */ jsx17("div", { className: "rs-step", children: /* @__PURE__ */ jsx17("div", { className: "rs-loading-state", children: /* @__PURE__ */ jsx17("div", { className: "rs-loading-text", children: /* @__PURE__ */ jsx17("div", { className: "rs-loading-title", children: "Connecting wallet\u2026" }) }) }) }) });
7072
+ return /* @__PURE__ */ jsx20("div", { className: "rs-modal-body", children: /* @__PURE__ */ jsx20("div", { className: "rs-step", children: /* @__PURE__ */ jsx20("div", { className: "rs-loading-state", children: /* @__PURE__ */ jsx20("div", { className: "rs-loading-text", children: /* @__PURE__ */ jsx20("div", { className: "rs-loading-title", children: "Connecting wallet\u2026" }) }) }) }) });
6827
7073
  }
6828
7074
  const ownerAddress = signerContext.ownerAddress;
6829
7075
  const ownerChainId = signerContext.walletClient?.chain?.id ?? signerContext.publicClient.chain?.id ?? setupChainId;
@@ -6833,15 +7079,15 @@ function DepositFlow({
6833
7079
  }
6834
7080
  return getPublicClient(chainId);
6835
7081
  };
6836
- return /* @__PURE__ */ jsxs15("div", { className: "rs-modal-body", children: [
6837
- effectiveStep.type === "setup" && /* @__PURE__ */ jsx17(
7082
+ return /* @__PURE__ */ jsxs18("div", { className: "rs-modal-body", children: [
7083
+ effectiveStep.type === "setup" && /* @__PURE__ */ jsx20(
6838
7084
  AccountPreparingSkeleton,
6839
7085
  {
6840
7086
  errorMessage: activeEntry.status === "error" ? activeEntry.message ?? void 0 : void 0,
6841
7087
  onRetry: activeEntry.status === "error" ? () => handleRetrySetup(ownerAddress) : void 0
6842
7088
  }
6843
7089
  ),
6844
- effectiveStep.type === "select-asset" && /* @__PURE__ */ jsx17(
7090
+ effectiveStep.type === "select-asset" && /* @__PURE__ */ jsx20(
6845
7091
  AssetSelectStep,
6846
7092
  {
6847
7093
  address: ownerAddress,
@@ -6859,15 +7105,15 @@ function DepositFlow({
6859
7105
  } : void 0
6860
7106
  }
6861
7107
  ),
6862
- effectiveStep.type === "dapp-import-asset-select" && activeDappImportProvider && activeDappImportAvailability && /* @__PURE__ */ jsx17(
7108
+ effectiveStep.type === "dapp-import-asset-select" && activeDappImportProvider && activeDappImportAvailability && /* @__PURE__ */ jsx20(
6863
7109
  DappImportAssetSelectStep,
6864
7110
  {
6865
- sourceLabel: activeDappImportAvailability.assets[0]?.sourceLabel ?? activeDappImportProvider.label,
7111
+ sourceLabel: activeDappImportAvailability.assets[0]?.sourceLabel ?? activeDappImportProvider.sourceLabel,
6866
7112
  assets: activeDappImportAvailability.assets,
6867
7113
  onSelect: handleDappImportAssetSelected
6868
7114
  }
6869
7115
  ),
6870
- effectiveStep.type === "amount" && /* @__PURE__ */ jsx17(
7116
+ effectiveStep.type === "amount" && /* @__PURE__ */ jsx20(
6871
7117
  AmountStep,
6872
7118
  {
6873
7119
  walletClient: signerContext.walletClient,
@@ -6899,7 +7145,7 @@ function DepositFlow({
6899
7145
  }
6900
7146
  }
6901
7147
  ),
6902
- effectiveStep.type === "confirm" && /* @__PURE__ */ jsx17(
7148
+ effectiveStep.type === "confirm" && /* @__PURE__ */ jsx20(
6903
7149
  ConfirmStep,
6904
7150
  {
6905
7151
  walletClient: signerContext.walletClient,
@@ -6940,7 +7186,7 @@ function DepositFlow({
6940
7186
  onError: handleError
6941
7187
  }
6942
7188
  ),
6943
- effectiveStep.type === "processing" && /* @__PURE__ */ jsx17(
7189
+ effectiveStep.type === "processing" && /* @__PURE__ */ jsx20(
6944
7190
  ProcessingStep,
6945
7191
  {
6946
7192
  smartAccount: effectiveStep.smartAccount,
@@ -6972,7 +7218,7 @@ function DepositFlow({
6972
7218
 
6973
7219
  // src/components/history/DepositHistoryPanel.tsx
6974
7220
  import { useCallback as useCallback8, useMemo as useMemo8, useState as useState12 } from "react";
6975
- import { jsx as jsx18, jsxs as jsxs16 } from "react/jsx-runtime";
7221
+ import { jsx as jsx21, jsxs as jsxs19 } from "react/jsx-runtime";
6976
7222
  function shortenHash(hash) {
6977
7223
  if (hash.length <= 14) return hash;
6978
7224
  return `${hash.slice(0, 6)}\u2026${hash.slice(-4)}`;
@@ -7099,7 +7345,7 @@ function DepositHistoryPanel({
7099
7345
  (d) => !(d.txHash && sourceHashes.has(d.txHash.toLowerCase()))
7100
7346
  );
7101
7347
  }, [deposits]);
7102
- return /* @__PURE__ */ jsxs16(
7348
+ return /* @__PURE__ */ jsxs19(
7103
7349
  "div",
7104
7350
  {
7105
7351
  className: "rs-history-panel",
@@ -7107,55 +7353,55 @@ function DepositHistoryPanel({
7107
7353
  "aria-label": "Deposit history",
7108
7354
  onKeyDown: handleKeyDown,
7109
7355
  children: [
7110
- /* @__PURE__ */ jsxs16("div", { className: "rs-modal-header--redesigned", children: [
7111
- /* @__PURE__ */ jsx18("div", { className: "rs-modal-header-nav-left", children: /* @__PURE__ */ jsx18(
7356
+ /* @__PURE__ */ jsxs19("div", { className: "rs-modal-header--redesigned", children: [
7357
+ /* @__PURE__ */ jsx21("div", { className: "rs-modal-header-nav-left", children: /* @__PURE__ */ jsx21(
7112
7358
  "button",
7113
7359
  {
7114
7360
  type: "button",
7115
7361
  className: "rs-modal-header-back",
7116
7362
  "aria-label": "Back",
7117
7363
  onClick: onClose,
7118
- children: /* @__PURE__ */ jsx18(ChevronLeftIcon, {})
7364
+ children: /* @__PURE__ */ jsx21(ChevronLeftIcon, {})
7119
7365
  }
7120
7366
  ) }),
7121
- /* @__PURE__ */ jsx18("div", { className: "rs-modal-header-nav-right", children: onCloseModal && /* @__PURE__ */ jsx18(
7367
+ /* @__PURE__ */ jsx21("div", { className: "rs-modal-header-nav-right", children: onCloseModal && /* @__PURE__ */ jsx21(
7122
7368
  "button",
7123
7369
  {
7124
7370
  type: "button",
7125
7371
  className: "rs-modal-close",
7126
7372
  "aria-label": "Close",
7127
7373
  onClick: onCloseModal,
7128
- children: /* @__PURE__ */ jsx18(CloseIcon, {})
7374
+ children: /* @__PURE__ */ jsx21(CloseIcon, {})
7129
7375
  }
7130
7376
  ) })
7131
7377
  ] }),
7132
- /* @__PURE__ */ jsxs16("div", { className: "rs-history-screen", children: [
7133
- /* @__PURE__ */ jsxs16("div", { className: "rs-history-screen-body", children: [
7134
- /* @__PURE__ */ jsx18(BodyHeader, { icon: /* @__PURE__ */ jsx18(HistoryIcon, {}), title: "History" }),
7135
- isLoading && deposits.length === 0 && /* @__PURE__ */ jsxs16("div", { className: "rs-history-empty", children: [
7136
- /* @__PURE__ */ jsx18("span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ jsx18(HistoryIcon, {}) }),
7137
- /* @__PURE__ */ jsxs16("div", { className: "rs-history-empty-text", children: [
7138
- /* @__PURE__ */ jsx18(Spinner, { className: "rs-spinner--sm" }),
7139
- /* @__PURE__ */ jsx18("span", { className: "rs-history-empty-hint", children: "Loading history\u2026" })
7378
+ /* @__PURE__ */ jsxs19("div", { className: "rs-history-screen", children: [
7379
+ /* @__PURE__ */ jsxs19("div", { className: "rs-history-screen-body", children: [
7380
+ /* @__PURE__ */ jsx21(BodyHeader, { icon: /* @__PURE__ */ jsx21(HistoryIcon, {}), title: "History" }),
7381
+ isLoading && deposits.length === 0 && /* @__PURE__ */ jsxs19("div", { className: "rs-history-empty", children: [
7382
+ /* @__PURE__ */ jsx21("span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ jsx21(HistoryIcon, {}) }),
7383
+ /* @__PURE__ */ jsxs19("div", { className: "rs-history-empty-text", children: [
7384
+ /* @__PURE__ */ jsx21(Spinner, { className: "rs-spinner--sm" }),
7385
+ /* @__PURE__ */ jsx21("span", { className: "rs-history-empty-hint", children: "Loading history\u2026" })
7140
7386
  ] })
7141
7387
  ] }),
7142
- error && !isLoading && /* @__PURE__ */ jsxs16("div", { className: "rs-history-empty", children: [
7143
- /* @__PURE__ */ jsx18("span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ jsx18(AlertTriangleIcon, {}) }),
7144
- /* @__PURE__ */ jsxs16("div", { className: "rs-history-empty-text", children: [
7145
- /* @__PURE__ */ jsx18("span", { className: "rs-history-empty-title", children: "Couldn't load history" }),
7146
- /* @__PURE__ */ jsx18("span", { className: "rs-history-empty-hint", children: error })
7388
+ error && !isLoading && /* @__PURE__ */ jsxs19("div", { className: "rs-history-empty", children: [
7389
+ /* @__PURE__ */ jsx21("span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ jsx21(AlertTriangleIcon, {}) }),
7390
+ /* @__PURE__ */ jsxs19("div", { className: "rs-history-empty-text", children: [
7391
+ /* @__PURE__ */ jsx21("span", { className: "rs-history-empty-title", children: "Couldn't load history" }),
7392
+ /* @__PURE__ */ jsx21("span", { className: "rs-history-empty-hint", children: error })
7147
7393
  ] })
7148
7394
  ] }),
7149
- !isLoading && !error && visibleDeposits.length === 0 && /* @__PURE__ */ jsxs16("div", { className: "rs-history-empty", children: [
7150
- /* @__PURE__ */ jsx18("span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ jsx18(HistoryIcon, {}) }),
7151
- /* @__PURE__ */ jsxs16("div", { className: "rs-history-empty-text", children: [
7152
- /* @__PURE__ */ jsx18("span", { className: "rs-history-empty-title", children: "No deposits yet" }),
7153
- /* @__PURE__ */ jsx18("span", { className: "rs-history-empty-hint", children: "Your deposit history will appear here" })
7395
+ !isLoading && !error && visibleDeposits.length === 0 && /* @__PURE__ */ jsxs19("div", { className: "rs-history-empty", children: [
7396
+ /* @__PURE__ */ jsx21("span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ jsx21(HistoryIcon, {}) }),
7397
+ /* @__PURE__ */ jsxs19("div", { className: "rs-history-empty-text", children: [
7398
+ /* @__PURE__ */ jsx21("span", { className: "rs-history-empty-title", children: "No deposits yet" }),
7399
+ /* @__PURE__ */ jsx21("span", { className: "rs-history-empty-hint", children: "Your deposit history will appear here" })
7154
7400
  ] })
7155
7401
  ] }),
7156
- visibleDeposits.length > 0 && /* @__PURE__ */ jsxs16("div", { className: "rs-history-list", children: [
7157
- visibleDeposits.map((deposit, i) => /* @__PURE__ */ jsx18(HistoryCard, { deposit }, deposit.txHash || i)),
7158
- hasMore && /* @__PURE__ */ jsx18(
7402
+ visibleDeposits.length > 0 && /* @__PURE__ */ jsxs19("div", { className: "rs-history-list", children: [
7403
+ visibleDeposits.map((deposit, i) => /* @__PURE__ */ jsx21(HistoryCard, { deposit }, deposit.txHash || i)),
7404
+ hasMore && /* @__PURE__ */ jsx21(
7159
7405
  "button",
7160
7406
  {
7161
7407
  type: "button",
@@ -7167,7 +7413,7 @@ function DepositHistoryPanel({
7167
7413
  )
7168
7414
  ] })
7169
7415
  ] }),
7170
- /* @__PURE__ */ jsx18(PoweredBy, {})
7416
+ /* @__PURE__ */ jsx21(PoweredBy, {})
7171
7417
  ] })
7172
7418
  ]
7173
7419
  }
@@ -7193,7 +7439,7 @@ function HistoryCard({ deposit }) {
7193
7439
  const date = deposit.createdAt ? formatDate(deposit.createdAt) : null;
7194
7440
  const txTypeLabel = `Deposit${sourceSymbol ? ` ${sourceSymbol}` : ""}`;
7195
7441
  const srcTxUrl = deposit.sourceTxHash ? getTxExplorerUrl(deposit.sourceTxHash, sourceChainId) : null;
7196
- return /* @__PURE__ */ jsxs16(
7442
+ return /* @__PURE__ */ jsxs19(
7197
7443
  "button",
7198
7444
  {
7199
7445
  type: "button",
@@ -7201,38 +7447,38 @@ function HistoryCard({ deposit }) {
7201
7447
  onClick: () => setExpanded((v) => !v),
7202
7448
  "aria-expanded": expanded,
7203
7449
  children: [
7204
- /* @__PURE__ */ jsxs16("div", { className: "rs-history-card-row", children: [
7205
- /* @__PURE__ */ jsxs16("div", { className: "rs-history-card-icons", children: [
7206
- /* @__PURE__ */ jsx18("span", { className: "rs-history-card-token", children: sourceTokenIcon ? /* @__PURE__ */ jsx18("img", { src: sourceTokenIcon, alt: "" }) : sourceSymbol.slice(0, 2) }),
7207
- sourceChainIcon && /* @__PURE__ */ jsx18("span", { className: "rs-history-card-chain", children: /* @__PURE__ */ jsx18("img", { src: sourceChainIcon, alt: "" }) })
7450
+ /* @__PURE__ */ jsxs19("div", { className: "rs-history-card-row", children: [
7451
+ /* @__PURE__ */ jsxs19("div", { className: "rs-history-card-icons", children: [
7452
+ /* @__PURE__ */ jsx21("span", { className: "rs-history-card-token", children: sourceTokenIcon ? /* @__PURE__ */ jsx21("img", { src: sourceTokenIcon, alt: "" }) : sourceSymbol.slice(0, 2) }),
7453
+ sourceChainIcon && /* @__PURE__ */ jsx21("span", { className: "rs-history-card-chain", children: /* @__PURE__ */ jsx21("img", { src: sourceChainIcon, alt: "" }) })
7208
7454
  ] }),
7209
- /* @__PURE__ */ jsxs16("div", { className: "rs-history-card-text", children: [
7210
- /* @__PURE__ */ jsx18("span", { className: "rs-history-card-title", children: txTypeLabel }),
7211
- date && /* @__PURE__ */ jsx18("span", { className: "rs-history-card-date", children: date })
7455
+ /* @__PURE__ */ jsxs19("div", { className: "rs-history-card-text", children: [
7456
+ /* @__PURE__ */ jsx21("span", { className: "rs-history-card-title", children: txTypeLabel }),
7457
+ date && /* @__PURE__ */ jsx21("span", { className: "rs-history-card-date", children: date })
7212
7458
  ] }),
7213
- /* @__PURE__ */ jsxs16("div", { className: "rs-history-card-side", children: [
7214
- /* @__PURE__ */ jsx18("span", { className: "rs-history-card-amount", children: displayAmount }),
7215
- /* @__PURE__ */ jsx18("span", { className: `rs-history-badge rs-history-badge--${status}`, children: STATUS_LABEL[status] })
7459
+ /* @__PURE__ */ jsxs19("div", { className: "rs-history-card-side", children: [
7460
+ /* @__PURE__ */ jsx21("span", { className: "rs-history-card-amount", children: displayAmount }),
7461
+ /* @__PURE__ */ jsx21("span", { className: `rs-history-badge rs-history-badge--${status}`, children: STATUS_LABEL[status] })
7216
7462
  ] })
7217
7463
  ] }),
7218
- /* @__PURE__ */ jsx18("div", { className: "rs-history-card-panel", children: /* @__PURE__ */ jsx18("div", { className: "rs-history-card-panel-inner", children: /* @__PURE__ */ jsxs16("div", { className: "rs-history-card-details", children: [
7219
- sourceChainName && /* @__PURE__ */ jsxs16("div", { className: "rs-amount-detail-row", children: [
7220
- /* @__PURE__ */ jsx18("span", { children: "Source chain" }),
7221
- /* @__PURE__ */ jsxs16("span", { className: "rs-amount-detail-value", children: [
7222
- /* @__PURE__ */ jsx18("span", { children: sourceChainName }),
7223
- sourceChainIcon && /* @__PURE__ */ jsx18("span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ jsx18("img", { src: sourceChainIcon, alt: "" }) })
7464
+ /* @__PURE__ */ jsx21("div", { className: "rs-history-card-panel", children: /* @__PURE__ */ jsx21("div", { className: "rs-history-card-panel-inner", children: /* @__PURE__ */ jsxs19("div", { className: "rs-history-card-details", children: [
7465
+ sourceChainName && /* @__PURE__ */ jsxs19("div", { className: "rs-amount-detail-row", children: [
7466
+ /* @__PURE__ */ jsx21("span", { children: "Source chain" }),
7467
+ /* @__PURE__ */ jsxs19("span", { className: "rs-amount-detail-value", children: [
7468
+ /* @__PURE__ */ jsx21("span", { children: sourceChainName }),
7469
+ sourceChainIcon && /* @__PURE__ */ jsx21("span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ jsx21("img", { src: sourceChainIcon, alt: "" }) })
7224
7470
  ] })
7225
7471
  ] }),
7226
- targetChainName && /* @__PURE__ */ jsxs16("div", { className: "rs-amount-detail-row", children: [
7227
- /* @__PURE__ */ jsx18("span", { children: "Destination chain" }),
7228
- /* @__PURE__ */ jsxs16("span", { className: "rs-amount-detail-value", children: [
7229
- /* @__PURE__ */ jsx18("span", { children: targetChainName }),
7230
- targetChainIcon && /* @__PURE__ */ jsx18("span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ jsx18("img", { src: targetChainIcon, alt: "" }) })
7472
+ targetChainName && /* @__PURE__ */ jsxs19("div", { className: "rs-amount-detail-row", children: [
7473
+ /* @__PURE__ */ jsx21("span", { children: "Destination chain" }),
7474
+ /* @__PURE__ */ jsxs19("span", { className: "rs-amount-detail-value", children: [
7475
+ /* @__PURE__ */ jsx21("span", { children: targetChainName }),
7476
+ targetChainIcon && /* @__PURE__ */ jsx21("span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ jsx21("img", { src: targetChainIcon, alt: "" }) })
7231
7477
  ] })
7232
7478
  ] }),
7233
- srcTxUrl && deposit.sourceTxHash && /* @__PURE__ */ jsxs16("div", { className: "rs-amount-detail-row", children: [
7234
- /* @__PURE__ */ jsx18("span", { children: "Transaction details" }),
7235
- /* @__PURE__ */ jsxs16(
7479
+ srcTxUrl && deposit.sourceTxHash && /* @__PURE__ */ jsxs19("div", { className: "rs-amount-detail-row", children: [
7480
+ /* @__PURE__ */ jsx21("span", { children: "Transaction details" }),
7481
+ /* @__PURE__ */ jsxs19(
7236
7482
  "a",
7237
7483
  {
7238
7484
  href: srcTxUrl,
@@ -7241,8 +7487,8 @@ function HistoryCard({ deposit }) {
7241
7487
  className: "rs-history-card-link",
7242
7488
  onClick: (e) => e.stopPropagation(),
7243
7489
  children: [
7244
- /* @__PURE__ */ jsx18("span", { children: shortenHash(deposit.sourceTxHash) }),
7245
- /* @__PURE__ */ jsx18(ArrowUpRightIcon, {})
7490
+ /* @__PURE__ */ jsx21("span", { children: shortenHash(deposit.sourceTxHash) }),
7491
+ /* @__PURE__ */ jsx21(ArrowUpRightIcon, {})
7246
7492
  ]
7247
7493
  }
7248
7494
  )
@@ -7255,9 +7501,9 @@ function HistoryCard({ deposit }) {
7255
7501
  DepositHistoryPanel.displayName = "DepositHistoryPanel";
7256
7502
 
7257
7503
  // src/DepositModal.tsx
7258
- import { jsx as jsx19, jsxs as jsxs17 } from "react/jsx-runtime";
7504
+ import { jsx as jsx22, jsxs as jsxs20 } from "react/jsx-runtime";
7259
7505
  var ReownDepositInner = lazy2(
7260
- () => import("./DepositModalReown-6SUEC5IU.mjs").then((m) => ({ default: m.DepositModalReown }))
7506
+ () => import("./DepositModalReown-PC7EX5VK.mjs").then((m) => ({ default: m.DepositModalReown }))
7261
7507
  );
7262
7508
  function sortByCreatedAtDesc(items) {
7263
7509
  return [...items].sort((a, b) => {
@@ -7273,7 +7519,7 @@ function DepositModal(props) {
7273
7519
  "dappWalletClient"
7274
7520
  );
7275
7521
  if (needsReown) {
7276
- return /* @__PURE__ */ jsx19(Suspense2, { fallback: null, children: /* @__PURE__ */ jsx19(
7522
+ return /* @__PURE__ */ jsx22(Suspense2, { fallback: null, children: /* @__PURE__ */ jsx22(
7277
7523
  ReownDepositInner,
7278
7524
  {
7279
7525
  ...props,
@@ -7281,7 +7527,7 @@ function DepositModal(props) {
7281
7527
  }
7282
7528
  ) });
7283
7529
  }
7284
- return /* @__PURE__ */ jsx19(
7530
+ return /* @__PURE__ */ jsx22(
7285
7531
  DepositModalInner,
7286
7532
  {
7287
7533
  ...props,
@@ -7313,6 +7559,7 @@ function DepositModalInner({
7313
7559
  forceRegister = false,
7314
7560
  enableSolana = true,
7315
7561
  dappImports,
7562
+ initialDappImport,
7316
7563
  enableFiatOnramp = false,
7317
7564
  enableQrTransfer = true,
7318
7565
  fiatOnrampMethods,
@@ -7356,7 +7603,7 @@ function DepositModalInner({
7356
7603
  const [recipientIsContract, setRecipientIsContract] = useState13(false);
7357
7604
  const onErrorRef = useLatestRef(onError);
7358
7605
  useEffect11(() => {
7359
- if (targetChain !== HYPERCORE_CHAIN_ID || !isAddress2(recipient, { strict: false })) {
7606
+ if (targetChain !== HYPERCORE_CHAIN_ID || !isAddress(recipient, { strict: false })) {
7360
7607
  setRecipientIsContract(false);
7361
7608
  return;
7362
7609
  }
@@ -7510,7 +7757,7 @@ function DepositModalInner({
7510
7757
  }, [isOpen, store]);
7511
7758
  const showBackButton = uiConfig?.showBackButton ?? true;
7512
7759
  const canGoBack = backHandler !== void 0;
7513
- return /* @__PURE__ */ jsx19(DepositStoreProvider, { store, children: /* @__PURE__ */ jsx19(
7760
+ return /* @__PURE__ */ jsx22(DepositStoreProvider, { store, children: /* @__PURE__ */ jsx22(
7514
7761
  Modal,
7515
7762
  {
7516
7763
  isOpen,
@@ -7518,20 +7765,20 @@ function DepositModalInner({
7518
7765
  className,
7519
7766
  inline,
7520
7767
  closeOnOverlayClick,
7521
- children: /* @__PURE__ */ jsxs17("div", { ref: modalRef, className: "rs-modal", children: [
7522
- /* @__PURE__ */ jsxs17("div", { className: "rs-modal-header--redesigned", children: [
7523
- /* @__PURE__ */ jsx19("div", { className: "rs-modal-header-nav-left", children: showBackButton && canGoBack && backHandler && /* @__PURE__ */ jsx19(
7768
+ children: /* @__PURE__ */ jsxs20("div", { ref: modalRef, className: "rs-modal", children: [
7769
+ /* @__PURE__ */ jsxs20("div", { className: "rs-modal-header--redesigned", children: [
7770
+ /* @__PURE__ */ jsx22("div", { className: "rs-modal-header-nav-left", children: showBackButton && canGoBack && backHandler && /* @__PURE__ */ jsx22(
7524
7771
  "button",
7525
7772
  {
7526
7773
  type: "button",
7527
7774
  className: "rs-modal-header-back",
7528
7775
  "aria-label": "Go back",
7529
7776
  onClick: backHandler,
7530
- children: /* @__PURE__ */ jsx19(ChevronLeftIcon, {})
7777
+ children: /* @__PURE__ */ jsx22(ChevronLeftIcon, {})
7531
7778
  }
7532
7779
  ) }),
7533
- /* @__PURE__ */ jsxs17("div", { className: "rs-modal-header-nav-right", children: [
7534
- historyButtonVisible && /* @__PURE__ */ jsx19(
7780
+ /* @__PURE__ */ jsxs20("div", { className: "rs-modal-header-nav-right", children: [
7781
+ historyButtonVisible && /* @__PURE__ */ jsx22(
7535
7782
  "button",
7536
7783
  {
7537
7784
  type: "button",
@@ -7539,22 +7786,22 @@ function DepositModalInner({
7539
7786
  "aria-label": "Deposit history",
7540
7787
  onClick: handleHistoryOpen,
7541
7788
  disabled: !recipient,
7542
- children: /* @__PURE__ */ jsx19(HistoryIcon, {})
7789
+ children: /* @__PURE__ */ jsx22(HistoryIcon, {})
7543
7790
  }
7544
7791
  ),
7545
- /* @__PURE__ */ jsx19(
7792
+ /* @__PURE__ */ jsx22(
7546
7793
  "button",
7547
7794
  {
7548
7795
  type: "button",
7549
7796
  onClick: onClose,
7550
7797
  className: "rs-modal-close",
7551
7798
  "aria-label": "Close",
7552
- children: /* @__PURE__ */ jsx19(CloseIcon, {})
7799
+ children: /* @__PURE__ */ jsx22(CloseIcon, {})
7553
7800
  }
7554
7801
  )
7555
7802
  ] })
7556
7803
  ] }),
7557
- recipientIsContract ? /* @__PURE__ */ jsx19("div", { className: "rs-modal-body", children: /* @__PURE__ */ jsx19(Callout, { variant: "error", children: "HyperCore deposits require an EOA recipient. The configured recipient is a smart contract, which is not supported." }) }) : /* @__PURE__ */ jsx19(
7804
+ recipientIsContract ? /* @__PURE__ */ jsx22("div", { className: "rs-modal-body", children: /* @__PURE__ */ jsx22(Callout, { variant: "error", children: "HyperCore deposits require an EOA recipient. The configured recipient is a smart contract, which is not supported." }) }) : /* @__PURE__ */ jsx22(
7558
7805
  DepositFlow,
7559
7806
  {
7560
7807
  dappWalletClient,
@@ -7577,6 +7824,7 @@ function DepositModalInner({
7577
7824
  forceRegister,
7578
7825
  enableSolana,
7579
7826
  dappImports,
7827
+ initialDappImport,
7580
7828
  enableFiatOnramp,
7581
7829
  enableQrTransfer,
7582
7830
  fiatOnrampMethods,
@@ -7595,7 +7843,7 @@ function DepositModalInner({
7595
7843
  debug
7596
7844
  }
7597
7845
  ),
7598
- showHistoryButton && historyOpen && /* @__PURE__ */ jsx19(
7846
+ showHistoryButton && historyOpen && /* @__PURE__ */ jsx22(
7599
7847
  DepositHistoryPanel,
7600
7848
  {
7601
7849
  deposits: historyDeposits,