@rhinestone/deposit-modal 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/dist/{DepositModalReown-6SUEC5IU.mjs → DepositModalReown-G7UX4IBZ.mjs} +5 -3
  2. package/dist/{DepositModalReown-DNW4GH6L.cjs → DepositModalReown-MECHBE6P.cjs} +8 -6
  3. package/dist/{WithdrawModalReown-7UAGSOSU.mjs → WithdrawModalReown-CUJAFUQM.mjs} +4 -3
  4. package/dist/{WithdrawModalReown-OUWBSKSM.cjs → WithdrawModalReown-WJ6VBZKK.cjs} +7 -6
  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-KAWJABTW.mjs → chunk-3C35DVPE.mjs} +2 -291
  8. package/dist/chunk-AJHFNHG3.cjs +295 -0
  9. package/dist/chunk-BAEB5AFZ.mjs +212 -0
  10. package/dist/{chunk-TKQYTBU6.mjs → chunk-DZQD3DAV.mjs} +7 -5
  11. package/dist/{chunk-2SMS542Q.cjs → chunk-LEL6GMEQ.cjs} +56 -54
  12. package/dist/{chunk-RABZINV3.cjs → chunk-MQIJZNTP.cjs} +3 -292
  13. package/dist/{chunk-KJ2RR2D4.mjs → chunk-QYSCCX4K.mjs} +534 -413
  14. package/dist/chunk-R5CPOBCF.cjs +212 -0
  15. package/dist/{chunk-GPSBM66J.mjs → chunk-R5WDHHVM.mjs} +1 -1
  16. package/dist/{chunk-VVJAIMKB.cjs → chunk-SPUZLWQS.cjs} +783 -662
  17. package/dist/chunk-TQ2AYMWS.mjs +295 -0
  18. package/dist/{chunk-33H6O5UU.cjs → chunk-ULEAK63T.cjs} +2 -2
  19. package/dist/constants.d.cts +1 -1
  20. package/dist/constants.d.ts +1 -1
  21. package/dist/deposit.cjs +5 -3
  22. package/dist/deposit.d.cts +4 -4
  23. package/dist/deposit.d.ts +4 -4
  24. package/dist/deposit.mjs +4 -2
  25. package/dist/index.cjs +6 -4
  26. package/dist/index.d.cts +4 -3
  27. package/dist/index.d.ts +4 -3
  28. package/dist/index.mjs +5 -3
  29. package/dist/polymarket.cjs +64 -0
  30. package/dist/polymarket.d.cts +57 -0
  31. package/dist/polymarket.d.ts +57 -0
  32. package/dist/polymarket.mjs +64 -0
  33. package/dist/styles.css +34 -0
  34. package/dist/{types-BMcGO5k_.d.cts → types-RzfAD14B.d.cts} +9 -0
  35. package/dist/{types-BMcGO5k_.d.ts → types-RzfAD14B.d.ts} +9 -0
  36. package/dist/withdraw.cjs +4 -3
  37. package/dist/withdraw.d.cts +4 -4
  38. package/dist/withdraw.d.ts +4 -4
  39. package/dist/withdraw.mjs +3 -2
  40. 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-BAEB5AFZ.mjs";
1
11
  import {
2
12
  AlertTriangleIcon,
3
13
  ArrowUpRightIcon,
@@ -21,7 +31,6 @@ import {
21
31
  PlusCircleIcon,
22
32
  PoweredBy,
23
33
  ProcessingStep,
24
- SAFE_ABI,
25
34
  Spinner,
26
35
  Tooltip,
27
36
  TransferCryptoIcon,
@@ -50,7 +59,10 @@ import {
50
59
  tokenFormatter,
51
60
  txRefsMatch,
52
61
  useLatestRef
53
- } from "./chunk-KAWJABTW.mjs";
62
+ } from "./chunk-3C35DVPE.mjs";
63
+ import {
64
+ SAFE_ABI
65
+ } from "./chunk-TQ2AYMWS.mjs";
54
66
  import {
55
67
  DEFAULT_BACKEND_URL,
56
68
  DEFAULT_SIGNER_ADDRESS,
@@ -92,7 +104,7 @@ import {
92
104
  lazy as lazy2,
93
105
  Suspense as Suspense2
94
106
  } from "react";
95
- import { isAddress as isAddress2 } from "viem";
107
+ import { isAddress } from "viem";
96
108
 
97
109
  // src/DepositFlow.tsx
98
110
  import {
@@ -3712,19 +3724,67 @@ function DappImportAssetSelectStep({
3712
3724
  }
3713
3725
  DappImportAssetSelectStep.displayName = "DappImportAssetSelectStep";
3714
3726
 
3727
+ // src/components/steps/DappImportAssetSelectSkeleton.tsx
3728
+ import { jsx as jsx17, jsxs as jsxs15 } from "react/jsx-runtime";
3729
+ function DappImportAssetSelectSkeleton({
3730
+ sourceLabel,
3731
+ rowCount = 3,
3732
+ error = false,
3733
+ onRetry
3734
+ }) {
3735
+ return /* @__PURE__ */ jsxs15("div", { className: "rs-screen", "aria-busy": error ? "false" : "true", children: [
3736
+ /* @__PURE__ */ jsx17("span", { className: "rs-sr-only", role: "status", children: error ? "Couldn't load balances" : "Loading balances\u2026" }),
3737
+ /* @__PURE__ */ jsxs15("div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
3738
+ /* @__PURE__ */ jsx17(
3739
+ BodyHeader,
3740
+ {
3741
+ icon: /* @__PURE__ */ jsx17(WalletIcon, {}),
3742
+ title: `Transfer from ${sourceLabel}`,
3743
+ subtitle: "Pick the balance to import"
3744
+ }
3745
+ ),
3746
+ error ? /* @__PURE__ */ jsx17("div", { className: "rs-loading-state", children: /* @__PURE__ */ jsxs15("div", { className: "rs-loading-text", children: [
3747
+ /* @__PURE__ */ jsx17("div", { className: "rs-loading-title rs-text-error", children: "Couldn\u2019t load your balances" }),
3748
+ /* @__PURE__ */ jsx17("div", { className: "rs-loading-subtitle", children: "Check your connection and try again." })
3749
+ ] }) }) : /* @__PURE__ */ jsx17("div", { className: "rs-asset-list", "aria-hidden": "true", children: Array.from({ length: rowCount }, (_, index) => /* @__PURE__ */ jsxs15(
3750
+ "div",
3751
+ {
3752
+ className: "rs-asset-row rs-asset-row--skeleton",
3753
+ children: [
3754
+ /* @__PURE__ */ jsxs15("div", { className: "rs-asset-info", children: [
3755
+ /* @__PURE__ */ jsxs15("div", { className: "rs-asset-icon-wrapper", children: [
3756
+ /* @__PURE__ */ jsx17("span", { className: "rs-asset-icon", children: /* @__PURE__ */ jsx17("span", { className: "rs-skeleton rs-skeleton-fill" }) }),
3757
+ /* @__PURE__ */ jsx17("span", { className: "rs-asset-chain-badge", children: /* @__PURE__ */ jsx17("span", { className: "rs-skeleton rs-skeleton-fill" }) })
3758
+ ] }),
3759
+ /* @__PURE__ */ jsxs15("div", { className: "rs-asset-text", children: [
3760
+ /* @__PURE__ */ jsx17("div", { className: "rs-asset-name-row", children: /* @__PURE__ */ jsx17("span", { className: "rs-skeleton rs-skeleton-text rs-skeleton-text--name" }) }),
3761
+ /* @__PURE__ */ jsx17("div", { className: "rs-asset-balance-small", children: /* @__PURE__ */ jsx17("span", { className: "rs-skeleton rs-skeleton-text rs-skeleton-text--balance" }) })
3762
+ ] })
3763
+ ] }),
3764
+ /* @__PURE__ */ jsx17("div", { className: "rs-asset-balance", children: /* @__PURE__ */ jsx17("span", { className: "rs-skeleton rs-skeleton-text rs-skeleton-text--usd" }) })
3765
+ ]
3766
+ },
3767
+ index
3768
+ )) })
3769
+ ] }),
3770
+ error && onRetry && /* @__PURE__ */ jsx17("div", { className: "rs-step-footer", children: /* @__PURE__ */ jsx17(
3771
+ "button",
3772
+ {
3773
+ type: "button",
3774
+ className: "rs-button rs-button--default rs-button--full-width",
3775
+ onClick: onRetry,
3776
+ children: /* @__PURE__ */ jsx17("span", { children: "Try again" })
3777
+ }
3778
+ ) }),
3779
+ /* @__PURE__ */ jsx17(PoweredBy, {})
3780
+ ] });
3781
+ }
3782
+ DappImportAssetSelectSkeleton.displayName = "DappImportAssetSelectSkeleton";
3783
+
3715
3784
  // src/core/dapp-imports/polymarket/index.ts
3716
3785
  import { createElement } from "react";
3717
3786
  import { formatUnits as formatUnits6 } from "viem";
3718
3787
 
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
3788
  // src/core/dapp-imports/polymarket/deposit-wallet.ts
3729
3789
  import {
3730
3790
  encodeFunctionData,
@@ -3891,204 +3951,12 @@ function buildPusdUnwrapCalls(recipient, amount) {
3891
3951
  ];
3892
3952
  }
3893
3953
 
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
3954
  // src/core/dapp-imports/polymarket/index.ts
4088
3955
  var PROVIDER_ID = "polymarket";
4089
3956
  var polymarketProvider = {
4090
3957
  id: PROVIDER_ID,
4091
3958
  label: "Transfer from Polymarket",
3959
+ sourceLabel: "Polymarket",
4092
3960
  icon: createElement("img", {
4093
3961
  src: POLYMARKET_ICON_URL,
4094
3962
  alt: "Polymarket",
@@ -4213,6 +4081,77 @@ function getEnabledProviders(config) {
4213
4081
  );
4214
4082
  }
4215
4083
 
4084
+ // src/store/selectors.ts
4085
+ var selectedWalletIdSelector = (state) => state.wallet.selectedWalletId;
4086
+ var IDLE_SETUP_ENTRY = {
4087
+ owner: null,
4088
+ requestKey: null,
4089
+ cacheKey: null,
4090
+ status: "idle",
4091
+ smartAccount: null,
4092
+ sessionOwnerAddress: null,
4093
+ solanaDepositAddress: null,
4094
+ message: null,
4095
+ cacheable: true,
4096
+ attemptNonce: 0
4097
+ };
4098
+ function readSetupForOwner(setup, owner) {
4099
+ if (!owner) return IDLE_SETUP_ENTRY;
4100
+ const entry = setup.byOwner[owner.toLowerCase()];
4101
+ return entry ?? { ...IDLE_SETUP_ENTRY, owner };
4102
+ }
4103
+
4104
+ // src/core/dapp-imports/status.ts
4105
+ function computeDappImportStatus(providerId, inputs) {
4106
+ const { owner, availability, availabilityOwner, setup } = inputs;
4107
+ if (!owner) return "needs-connect";
4108
+ const entry = availabilityOwner?.toLowerCase() === owner.toLowerCase() ? availability[providerId] : void 0;
4109
+ if (entry === "loading" || entry === void 0) return "loading";
4110
+ if (entry === "error") {
4111
+ return {
4112
+ enabled: false,
4113
+ reason: "Couldn't load balance \u2014 tap to retry",
4114
+ retryable: true
4115
+ };
4116
+ }
4117
+ if (entry === null) return { enabled: false, reason: "No balance" };
4118
+ const setupEntry = readSetupForOwner(setup, owner);
4119
+ if (setupEntry.status === "loading") return "loading";
4120
+ if (setupEntry.status === "error") {
4121
+ return {
4122
+ enabled: false,
4123
+ reason: "Couldn't prepare account \u2014 tap to retry",
4124
+ retryable: true
4125
+ };
4126
+ }
4127
+ return { enabled: true, balanceUsd: entry.totalUsd };
4128
+ }
4129
+ function resolveBootOutcome(params) {
4130
+ const { status, setupStatus, timedOut, walletHydrating, signerAvailable } = params;
4131
+ if (status === "needs-connect") {
4132
+ return walletHydrating && !timedOut ? "wait" : "unavailable";
4133
+ }
4134
+ if (status === "loading") return timedOut ? "error" : "wait";
4135
+ if (!status.enabled) {
4136
+ return status.retryable ? "error" : "unavailable";
4137
+ }
4138
+ if (setupStatus === "ready") {
4139
+ if (!signerAvailable) return timedOut ? "error" : "wait";
4140
+ return "ready";
4141
+ }
4142
+ if (setupStatus === "error") return "error";
4143
+ return timedOut ? "error" : "wait";
4144
+ }
4145
+ function bootRetryPlan(params) {
4146
+ const { setupStatus, availabilityEntry } = params;
4147
+ return {
4148
+ restartSetup: setupStatus !== "ready",
4149
+ // `null` is a delivered "no account" — only refetch when nothing
4150
+ // usable came back ("error", still "loading", or never recorded).
4151
+ refetchAvailability: availabilityEntry === "error" || availabilityEntry === "loading" || availabilityEntry === void 0
4152
+ };
4153
+ }
4154
+
4216
4155
  // src/core/dapp-imports/types.ts
4217
4156
  function isDappImportAsset(asset) {
4218
4157
  return typeof asset.source === "string" && typeof asset.sourceLabel === "string" && "providerMetadata" in asset;
@@ -4336,6 +4275,7 @@ function applyBack(state, hasWalletOptions) {
4336
4275
  case "fiat-onramp":
4337
4276
  case "exchange-select":
4338
4277
  case "solana-token-select":
4278
+ case "dapp-import-resolving":
4339
4279
  case "dapp-import-asset-select":
4340
4280
  return {
4341
4281
  ...state,
@@ -4350,7 +4290,8 @@ function applyBack(state, hasWalletOptions) {
4350
4290
  dappImport: {
4351
4291
  ...state.dappImport,
4352
4292
  activeProviderId: null,
4353
- selectedAsset: null
4293
+ selectedAsset: null,
4294
+ bootError: false
4354
4295
  },
4355
4296
  exchange: { selectedConnection: null }
4356
4297
  };
@@ -4493,16 +4434,6 @@ function applyAction(state, action) {
4493
4434
  },
4494
4435
  exchange: { selectedConnection: action.connection }
4495
4436
  };
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
4437
  case "connect/wallet-picker-requested":
4507
4438
  return {
4508
4439
  ...state,
@@ -4685,17 +4616,41 @@ function applyAction(state, action) {
4685
4616
  }
4686
4617
  }
4687
4618
  };
4688
- case "dapp-import/availability-cleared":
4619
+ case "dapp-import/availability-failed":
4620
+ if (!state.dappImport.availabilityOwner || ownerKey(state.dappImport.availabilityOwner) !== ownerKey(action.owner)) {
4621
+ return state;
4622
+ }
4623
+ return {
4624
+ ...state,
4625
+ dappImport: {
4626
+ ...state.dappImport,
4627
+ availability: {
4628
+ ...state.dappImport.availability,
4629
+ [action.providerId]: "error"
4630
+ }
4631
+ }
4632
+ };
4633
+ case "dapp-import/availability-retry-requested":
4634
+ return {
4635
+ ...state,
4636
+ dappImport: {
4637
+ ...state.dappImport,
4638
+ attemptNonce: state.dappImport.attemptNonce + 1
4639
+ }
4640
+ };
4641
+ case "dapp-import/availability-cleared": {
4642
+ const isBootResolving = state.flow.step === "dapp-import-resolving";
4689
4643
  return {
4690
4644
  ...state,
4691
4645
  dappImport: {
4692
4646
  ...state.dappImport,
4693
4647
  availabilityOwner: null,
4694
4648
  availability: {},
4695
- activeProviderId: null,
4696
- selectedAsset: null
4649
+ activeProviderId: isBootResolving ? state.dappImport.activeProviderId : null,
4650
+ selectedAsset: isBootResolving ? state.dappImport.selectedAsset : null
4697
4651
  }
4698
4652
  };
4653
+ }
4699
4654
  case "dapp-import/provider-selected":
4700
4655
  return {
4701
4656
  ...state,
@@ -4724,6 +4679,57 @@ function applyAction(state, action) {
4724
4679
  },
4725
4680
  flow: { ...state.flow, step: "amount" }
4726
4681
  };
4682
+ case "dapp-import/boot-requested":
4683
+ return {
4684
+ ...state,
4685
+ flow: {
4686
+ ...state.flow,
4687
+ mode: "dapp-import",
4688
+ isConnectSelectionConfirmed: true,
4689
+ step: "dapp-import-resolving"
4690
+ },
4691
+ dappImport: {
4692
+ ...state.dappImport,
4693
+ activeProviderId: action.providerId,
4694
+ selectedAsset: null,
4695
+ bootError: false
4696
+ }
4697
+ };
4698
+ case "dapp-import/boot-resolved": {
4699
+ if (state.flow.step !== "dapp-import-resolving" || state.dappImport.activeProviderId !== action.providerId) {
4700
+ return state;
4701
+ }
4702
+ switch (action.outcome) {
4703
+ case "ready":
4704
+ return {
4705
+ ...state,
4706
+ flow: { ...state.flow, step: "dapp-import-asset-select" },
4707
+ dappImport: { ...state.dappImport, bootError: false }
4708
+ };
4709
+ case "unavailable":
4710
+ return {
4711
+ ...state,
4712
+ flow: {
4713
+ ...state.flow,
4714
+ step: "connect",
4715
+ mode: null,
4716
+ isConnectSelectionConfirmed: false,
4717
+ hasNavigatedBack: true
4718
+ },
4719
+ dappImport: {
4720
+ ...state.dappImport,
4721
+ activeProviderId: null,
4722
+ selectedAsset: null,
4723
+ bootError: false
4724
+ }
4725
+ };
4726
+ case "error":
4727
+ return {
4728
+ ...state,
4729
+ dappImport: { ...state.dappImport, bootError: true }
4730
+ };
4731
+ }
4732
+ }
4727
4733
  case "back/requested":
4728
4734
  return applyBack(state, action.hasWalletOptions);
4729
4735
  case "flow/reset": {
@@ -4751,12 +4757,18 @@ function applyAction(state, action) {
4751
4757
  txHash: null,
4752
4758
  directTransfer: false
4753
4759
  },
4754
- // Preserve fetched availability for its recorded EOA — refetching on
4755
- // every modal close burns a request. Just clear active selection.
4760
+ // Drop fetched availability wholesale. The fetch effect refetches
4761
+ // unconditionally on remount (so keeping the map saves nothing),
4762
+ // and a preserved terminal entry (null / "error") could be consumed
4763
+ // by a fresh pre-routed boot before the refetch's loading update
4764
+ // lands — routing a now-funded account home off stale data.
4756
4765
  dappImport: {
4757
- ...state.dappImport,
4758
4766
  activeProviderId: null,
4759
- selectedAsset: null
4767
+ availabilityOwner: null,
4768
+ availability: {},
4769
+ selectedAsset: null,
4770
+ bootError: false,
4771
+ attemptNonce: 0
4760
4772
  },
4761
4773
  setup: { byOwner: preservedByOwner },
4762
4774
  fiat: { selectedMethod: null },
@@ -4830,7 +4842,9 @@ function createInitialState(overrides) {
4830
4842
  activeProviderId: null,
4831
4843
  availabilityOwner: null,
4832
4844
  availability: {},
4833
- selectedAsset: null
4845
+ selectedAsset: null,
4846
+ bootError: false,
4847
+ attemptNonce: 0
4834
4848
  },
4835
4849
  setup: {
4836
4850
  byOwner: {}
@@ -4844,26 +4858,6 @@ function createInitialState(overrides) {
4844
4858
  };
4845
4859
  }
4846
4860
 
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
4861
  // src/store/index.ts
4868
4862
  function createDepositStore(overrides) {
4869
4863
  const store = createStore(() => createInitialState(overrides));
@@ -5142,28 +5136,29 @@ function mapError(error) {
5142
5136
  }
5143
5137
 
5144
5138
  // src/DepositFlow.tsx
5145
- import { Fragment as Fragment3, jsx as jsx17, jsxs as jsxs15 } from "react/jsx-runtime";
5139
+ import { Fragment as Fragment3, jsx as jsx18, jsxs as jsxs16 } from "react/jsx-runtime";
5146
5140
  function AccountPreparingSkeleton({
5147
5141
  errorMessage,
5148
5142
  onRetry
5149
5143
  }) {
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(
5144
+ return /* @__PURE__ */ jsxs16("div", { className: "rs-step", children: [
5145
+ /* @__PURE__ */ jsx18("div", { className: "rs-step-body", style: { paddingTop: 0 }, children: /* @__PURE__ */ jsx18("div", { className: "rs-loading-state", children: /* @__PURE__ */ jsx18("div", { className: "rs-loading-text", children: errorMessage ? /* @__PURE__ */ jsxs16(Fragment3, { children: [
5146
+ /* @__PURE__ */ jsx18("div", { className: "rs-loading-title rs-text-error", children: "Couldn\u2019t prepare account" }),
5147
+ /* @__PURE__ */ jsx18("div", { className: "rs-loading-subtitle", children: errorMessage })
5148
+ ] }) : /* @__PURE__ */ jsx18("div", { className: "rs-loading-title", children: "Preparing\u2026" }) }) }) }),
5149
+ errorMessage && onRetry && /* @__PURE__ */ jsx18("div", { className: "rs-step-footer", children: /* @__PURE__ */ jsx18(
5156
5150
  "button",
5157
5151
  {
5158
5152
  type: "button",
5159
5153
  className: "rs-button rs-button--default rs-button--full-width",
5160
5154
  onClick: onRetry,
5161
- children: /* @__PURE__ */ jsx17("span", { children: "Try again" })
5155
+ children: /* @__PURE__ */ jsx18("span", { children: "Try again" })
5162
5156
  }
5163
5157
  ) })
5164
5158
  ] });
5165
5159
  }
5166
5160
  var QR_AUTO_ADVANCE_HYDRATION_GRACE_MS = 1e3;
5161
+ var DAPP_IMPORT_RESOLVE_TIMEOUT_MS = 1e4;
5167
5162
  function isSameRoute2(sourceChain, sourceToken, targetChain, targetToken) {
5168
5163
  return sourceChain === targetChain && sourceToken.toLowerCase() === targetToken.toLowerCase();
5169
5164
  }
@@ -5252,6 +5247,8 @@ function deriveStep(flow, d, p, activeEntry, fiat, exchange) {
5252
5247
  balanceUsd: d.balanceUsd,
5253
5248
  inputAmountUsd: d.inputAmountUsd ?? void 0
5254
5249
  };
5250
+ case "dapp-import-resolving":
5251
+ return { type: "dapp-import-resolving" };
5255
5252
  case "dapp-import-asset-select":
5256
5253
  if (!smartAccount) return { type: "setup" };
5257
5254
  return { type: "dapp-import-asset-select", smartAccount };
@@ -5326,6 +5323,7 @@ function DepositFlow({
5326
5323
  forceRegister = false,
5327
5324
  enableSolana = true,
5328
5325
  dappImports,
5326
+ initialDappImport,
5329
5327
  enableFiatOnramp = false,
5330
5328
  enableQrTransfer = true,
5331
5329
  fiatOnrampMethods,
@@ -5466,6 +5464,9 @@ function DepositFlow({
5466
5464
  const isWalletHydrationPending = Boolean(
5467
5465
  dappAddress && !hasWalletOptions && (hasDappWalletClientProp && dappWalletClient === void 0 || reownWallet && !hasReownSession && !reownWallet.isReady)
5468
5466
  );
5467
+ const isDappImportWalletHydrating = Boolean(
5468
+ hasDappWalletClientProp && dappWalletClient === void 0 || reownWallet && !hasReownSession && !reownWallet.isReady
5469
+ );
5469
5470
  const showConnectStep = flowMode === null && !isConnectSelectionConfirmed;
5470
5471
  useEffect10(() => {
5471
5472
  if (!isWalletHydrationPending) {
@@ -5730,7 +5731,10 @@ function DepositFlow({
5730
5731
  portfolioAssetsRef.current = [];
5731
5732
  }
5732
5733
  }, [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;
5734
+ 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
5735
+ // the chevron doesn't linger if a disconnect cleared the mode out from
5736
+ // under the step.
5737
+ 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
5738
  const currentBackHandler = canGoBackFromHere ? handleBack : void 0;
5735
5739
  const currentScreen = showConnectStep ? "connect" : effectiveStep.type;
5736
5740
  useEffect10(() => {
@@ -5868,6 +5872,10 @@ function DepositFlow({
5868
5872
  // eslint-disable-next-line react-hooks/exhaustive-deps -- intentional: keyed on dappImportsKey, not the dappImports object identity
5869
5873
  [dappImportsKey, isSolanaWalletConnected]
5870
5874
  );
5875
+ const initialDappImportProvider = useMemo7(
5876
+ () => initialDappImport ? enabledDappImportProviders.find((p) => p.id === initialDappImport) ?? null : null,
5877
+ [initialDappImport, enabledDappImportProviders]
5878
+ );
5871
5879
  const handleSelectDappImport = useCallback7(
5872
5880
  (providerId) => {
5873
5881
  const owner = dappImportOwner;
@@ -5895,6 +5903,9 @@ function DepositFlow({
5895
5903
  },
5896
5904
  [storeApi]
5897
5905
  );
5906
+ const dappImportAttemptNonce = useDepositStore(
5907
+ (s) => s.dappImport.attemptNonce
5908
+ );
5898
5909
  useEffect10(() => {
5899
5910
  if (!dappImportOwner || enabledDappImportProviders.length === 0) {
5900
5911
  storeApi.dispatch({ type: "dapp-import/availability-cleared" });
@@ -5928,15 +5939,29 @@ function DepositFlow({
5928
5939
  }).catch(() => {
5929
5940
  if (controller.signal.aborted) return;
5930
5941
  storeApi.dispatch({
5931
- type: "dapp-import/availability-loaded",
5942
+ type: "dapp-import/availability-failed",
5932
5943
  providerId: provider.id,
5933
- owner: dappImportOwner,
5934
- availability: null
5944
+ owner: dappImportOwner
5935
5945
  });
5936
5946
  });
5937
5947
  }
5938
5948
  return () => controller.abort();
5939
- }, [dappImportOwner, enabledDappImportProviders, storeApi]);
5949
+ }, [
5950
+ dappImportOwner,
5951
+ enabledDappImportProviders,
5952
+ dappImportAttemptNonce,
5953
+ storeApi
5954
+ ]);
5955
+ useLayoutEffect2(() => {
5956
+ if (!initialDappImportProvider) return;
5957
+ if (flowSlice.step !== "connect" || flowSlice.mode !== null || flowSlice.isConnectSelectionConfirmed || flowSlice.hasNavigatedBack) {
5958
+ return;
5959
+ }
5960
+ storeApi.dispatch({
5961
+ type: "dapp-import/boot-requested",
5962
+ providerId: initialDappImportProvider.id
5963
+ });
5964
+ }, [initialDappImportProvider, flowSlice, storeApi]);
5940
5965
  const dappImportAvailability = useDepositStore((s) => s.dappImport.availability);
5941
5966
  const dappImportAvailabilityOwner = useDepositStore(
5942
5967
  (s) => s.dappImport.availabilityOwner
@@ -5944,48 +5969,19 @@ function DepositFlow({
5944
5969
  const activeDappImportProviderId = useDepositStore(
5945
5970
  (s) => s.dappImport.activeProviderId
5946
5971
  );
5972
+ const dappImportBootError = useDepositStore((s) => s.dappImport.bootError);
5947
5973
  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
- }),
5974
+ () => enabledDappImportProviders.map((provider) => ({
5975
+ id: provider.id,
5976
+ label: provider.label,
5977
+ icon: provider.icon,
5978
+ status: computeDappImportStatus(provider.id, {
5979
+ owner: dappImportOwner,
5980
+ availability: dappImportAvailability,
5981
+ availabilityOwner: dappImportAvailabilityOwner,
5982
+ setup: setupSlice
5983
+ })
5984
+ })),
5989
5985
  [
5990
5986
  enabledDappImportProviders,
5991
5987
  dappImportAvailability,
@@ -6006,7 +6002,7 @@ function DepositFlow({
6006
6002
  return null;
6007
6003
  }
6008
6004
  const entry = dappImportAvailability[activeDappImportProviderId];
6009
- if (!entry || entry === "loading") return null;
6005
+ if (!entry || entry === "loading" || entry === "error") return null;
6010
6006
  return entry;
6011
6007
  }, [
6012
6008
  activeDappImportProviderId,
@@ -6014,6 +6010,96 @@ function DepositFlow({
6014
6010
  dappImportAvailabilityOwner,
6015
6011
  dappImportOwner
6016
6012
  ]);
6013
+ const isBootResolving = isDappImportMode && flowSlice.step === "dapp-import-resolving";
6014
+ const [hasResolveDeadlinePassed, setHasResolveDeadlinePassed] = useState11(false);
6015
+ useEffect10(() => {
6016
+ setHasResolveDeadlinePassed(false);
6017
+ if (!isBootResolving || dappImportBootError) return;
6018
+ const timeout = window.setTimeout(() => {
6019
+ setHasResolveDeadlinePassed(true);
6020
+ }, DAPP_IMPORT_RESOLVE_TIMEOUT_MS);
6021
+ return () => window.clearTimeout(timeout);
6022
+ }, [isBootResolving, dappImportBootError]);
6023
+ useEffect10(() => {
6024
+ if (!isBootResolving || dappImportBootError) return;
6025
+ const providerId = activeDappImportProviderId;
6026
+ if (!providerId) return;
6027
+ if (!enabledDappImportProviders.some((p) => p.id === providerId)) {
6028
+ storeApi.dispatch({
6029
+ type: "dapp-import/boot-resolved",
6030
+ providerId,
6031
+ outcome: "unavailable"
6032
+ });
6033
+ return;
6034
+ }
6035
+ const status = computeDappImportStatus(providerId, {
6036
+ owner: dappImportOwner,
6037
+ availability: dappImportAvailability,
6038
+ availabilityOwner: dappImportAvailabilityOwner,
6039
+ setup: setupSlice
6040
+ });
6041
+ const pinnableWallet = dappImportOwner ? walletOptions.find(
6042
+ (o) => (o.address ?? null)?.toLowerCase() === dappImportOwner.toLowerCase()
6043
+ ) ?? null : null;
6044
+ const outcome = resolveBootOutcome({
6045
+ status,
6046
+ setupStatus: readSetupForOwner(setupSlice, dappImportOwner).status,
6047
+ timedOut: hasResolveDeadlinePassed,
6048
+ walletHydrating: isDappImportWalletHydrating,
6049
+ signerAvailable: pinnableWallet !== null
6050
+ });
6051
+ if (outcome === "wait") return;
6052
+ if (outcome === "ready" && pinnableWallet) {
6053
+ storeApi.dispatch({
6054
+ type: "wallet/id-selected",
6055
+ walletId: pinnableWallet.id
6056
+ });
6057
+ }
6058
+ storeApi.dispatch({
6059
+ type: "dapp-import/boot-resolved",
6060
+ providerId,
6061
+ outcome
6062
+ });
6063
+ }, [
6064
+ isBootResolving,
6065
+ dappImportBootError,
6066
+ activeDappImportProviderId,
6067
+ enabledDappImportProviders,
6068
+ dappImportOwner,
6069
+ dappImportAvailability,
6070
+ dappImportAvailabilityOwner,
6071
+ setupSlice,
6072
+ hasResolveDeadlinePassed,
6073
+ isDappImportWalletHydrating,
6074
+ walletOptions,
6075
+ storeApi
6076
+ ]);
6077
+ const handleBootRetry = useCallback7(() => {
6078
+ const snapshot = storeApi.getState();
6079
+ const providerId = snapshot.dappImport.activeProviderId;
6080
+ if (!providerId) return;
6081
+ if (dappImportOwner) {
6082
+ const plan = bootRetryPlan({
6083
+ setupStatus: readSetupForOwner(snapshot.setup, dappImportOwner).status,
6084
+ availabilityEntry: snapshot.dappImport.availabilityOwner?.toLowerCase() === dappImportOwner.toLowerCase() ? snapshot.dappImport.availability[providerId] : void 0
6085
+ });
6086
+ if (plan.restartSetup) {
6087
+ storeApi.dispatch({
6088
+ type: "setup/retry-requested",
6089
+ owner: dappImportOwner
6090
+ });
6091
+ }
6092
+ if (plan.refetchAvailability) {
6093
+ storeApi.dispatch({
6094
+ type: "dapp-import/availability-retry-requested"
6095
+ });
6096
+ }
6097
+ }
6098
+ storeApi.dispatch({
6099
+ type: "dapp-import/boot-requested",
6100
+ providerId
6101
+ });
6102
+ }, [storeApi, dappImportOwner]);
6017
6103
  const handleSelectFiatMethod = useCallback7(
6018
6104
  (paymentMethod) => {
6019
6105
  storeApi.dispatch({
@@ -6414,10 +6500,17 @@ function DepositFlow({
6414
6500
  }
6415
6501
  }, [walletOptionsKey]);
6416
6502
  useEffect10(() => {
6417
- if (!showConnectStep && isConnectSelectionConfirmed && (flowMode === "wallet" || flowMode === "dapp-import") && !signerContext) {
6503
+ if (!showConnectStep && isConnectSelectionConfirmed && (flowMode === "wallet" || flowMode === "dapp-import") && flowSlice.step !== "dapp-import-resolving" && !signerContext) {
6418
6504
  storeApi.dispatch({ type: "wallet/cleared" });
6419
6505
  }
6420
- }, [showConnectStep, isConnectSelectionConfirmed, flowMode, signerContext, storeApi]);
6506
+ }, [
6507
+ showConnectStep,
6508
+ isConnectSelectionConfirmed,
6509
+ flowMode,
6510
+ flowSlice.step,
6511
+ signerContext,
6512
+ storeApi
6513
+ ]);
6421
6514
  useEffect10(() => {
6422
6515
  if (enableSolana || flowMode !== "solana-wallet") {
6423
6516
  return;
@@ -6428,7 +6521,7 @@ function DepositFlow({
6428
6521
  }
6429
6522
  }, [enableSolana, flowMode, storeApi]);
6430
6523
  useEffect10(() => {
6431
- if (hasNavigatedBack || isConnectSelectionConfirmed || flowMode || enableFiatOnramp || enableExchangeConnect) {
6524
+ if (hasNavigatedBack || isConnectSelectionConfirmed || flowMode || enableFiatOnramp || enableExchangeConnect || initialDappImportProvider) {
6432
6525
  return;
6433
6526
  }
6434
6527
  if (enableQrTransfer && !hasWalletOptions && dappAddress && !hasReownSession && !dappWalletClient && hasQrAutoAdvanceGraceElapsed) {
@@ -6444,6 +6537,7 @@ function DepositFlow({
6444
6537
  hasNavigatedBack,
6445
6538
  dappAddress,
6446
6539
  dappWalletClient,
6540
+ initialDappImportProvider,
6447
6541
  handleSelectTransferCrypto
6448
6542
  ]);
6449
6543
  const walletRows = useMemo7(() => {
@@ -6474,7 +6568,7 @@ function DepositFlow({
6474
6568
  [storeApi]
6475
6569
  );
6476
6570
  if (showConnectStep) {
6477
- return /* @__PURE__ */ jsx17("div", { className: "rs-modal-body", children: /* @__PURE__ */ jsx17(
6571
+ return /* @__PURE__ */ jsx18("div", { className: "rs-modal-body", children: /* @__PURE__ */ jsx18(
6478
6572
  ConnectStep,
6479
6573
  {
6480
6574
  walletRows,
@@ -6508,6 +6602,13 @@ function DepositFlow({
6508
6602
  },
6509
6603
  dappImports: connectStepDappImports,
6510
6604
  onSelectDappImport: (providerId) => {
6605
+ const availabilityEntry = dappImportOwner && dappImportAvailabilityOwner?.toLowerCase() === dappImportOwner.toLowerCase() ? dappImportAvailability[providerId] : void 0;
6606
+ if (availabilityEntry === "error") {
6607
+ storeApi.dispatch({
6608
+ type: "dapp-import/availability-retry-requested"
6609
+ });
6610
+ return;
6611
+ }
6511
6612
  const dappImportEntry = readSetupForOwner(
6512
6613
  setupSlice,
6513
6614
  dappImportOwner
@@ -6524,21 +6625,21 @@ function DepositFlow({
6524
6625
  }
6525
6626
  if (isDepositAddressMode) {
6526
6627
  if (!dappAddress) return null;
6527
- return /* @__PURE__ */ jsxs15("div", { className: "rs-modal-body", children: [
6528
- effectiveStep.type === "setup" && (activeEntry.status === "error" ? /* @__PURE__ */ jsx17(
6628
+ return /* @__PURE__ */ jsxs16("div", { className: "rs-modal-body", children: [
6629
+ effectiveStep.type === "setup" && (activeEntry.status === "error" ? /* @__PURE__ */ jsx18(
6529
6630
  AccountPreparingSkeleton,
6530
6631
  {
6531
6632
  errorMessage: activeEntry.message ?? void 0,
6532
6633
  onRetry: () => handleRetrySetup(dappAddress)
6533
6634
  }
6534
- ) : /* @__PURE__ */ jsx17(
6635
+ ) : /* @__PURE__ */ jsx18(
6535
6636
  DepositAddressSkeleton,
6536
6637
  {
6537
6638
  uiConfig,
6538
6639
  allowedRoutes
6539
6640
  }
6540
6641
  )),
6541
- effectiveStep.type === "deposit-address" && /* @__PURE__ */ jsx17(
6642
+ effectiveStep.type === "deposit-address" && /* @__PURE__ */ jsx18(
6542
6643
  DepositAddressStep,
6543
6644
  {
6544
6645
  smartAccount: effectiveStep.smartAccount,
@@ -6571,21 +6672,21 @@ function DepositFlow({
6571
6672
  }
6572
6673
  if (isFiatOnrampMode) {
6573
6674
  if (!dappAddress) return null;
6574
- return /* @__PURE__ */ jsxs15(
6675
+ return /* @__PURE__ */ jsxs16(
6575
6676
  "div",
6576
6677
  {
6577
6678
  className: "rs-modal-body",
6578
6679
  "data-flow-mode": "fiat-onramp",
6579
6680
  "data-step-type": step.type,
6580
6681
  children: [
6581
- step.type === "setup" && /* @__PURE__ */ jsx17(
6682
+ step.type === "setup" && /* @__PURE__ */ jsx18(
6582
6683
  AccountPreparingSkeleton,
6583
6684
  {
6584
6685
  errorMessage: activeEntry.status === "error" ? activeEntry.message ?? void 0 : void 0,
6585
6686
  onRetry: activeEntry.status === "error" ? () => handleRetrySetup(dappAddress) : void 0
6586
6687
  }
6587
6688
  ),
6588
- step.type === "fiat-onramp" && /* @__PURE__ */ jsx17(
6689
+ step.type === "fiat-onramp" && /* @__PURE__ */ jsx18(
6589
6690
  FiatOnrampStep,
6590
6691
  {
6591
6692
  smartAccount: step.smartAccount,
@@ -6598,7 +6699,7 @@ function DepositFlow({
6598
6699
  onError: handleError
6599
6700
  }
6600
6701
  ),
6601
- step.type === "processing" && /* @__PURE__ */ jsx17(
6702
+ step.type === "processing" && /* @__PURE__ */ jsx18(
6602
6703
  ProcessingStep,
6603
6704
  {
6604
6705
  smartAccount: step.smartAccount,
@@ -6630,21 +6731,21 @@ function DepositFlow({
6630
6731
  }
6631
6732
  if (isExchangeConnectMode) {
6632
6733
  if (!dappAddress) return null;
6633
- return /* @__PURE__ */ jsxs15(
6734
+ return /* @__PURE__ */ jsxs16(
6634
6735
  "div",
6635
6736
  {
6636
6737
  className: "rs-modal-body",
6637
6738
  "data-flow-mode": "exchange-connect",
6638
6739
  "data-step-type": step.type,
6639
6740
  children: [
6640
- step.type === "setup" && /* @__PURE__ */ jsx17(
6741
+ step.type === "setup" && /* @__PURE__ */ jsx18(
6641
6742
  AccountPreparingSkeleton,
6642
6743
  {
6643
6744
  errorMessage: activeEntry.status === "error" ? activeEntry.message ?? void 0 : void 0,
6644
6745
  onRetry: activeEntry.status === "error" ? () => handleRetrySetup(dappAddress) : void 0
6645
6746
  }
6646
6747
  ),
6647
- step.type === "exchange-select" && /* @__PURE__ */ jsx17(
6748
+ step.type === "exchange-select" && /* @__PURE__ */ jsx18(
6648
6749
  ExchangeSelectStep,
6649
6750
  {
6650
6751
  service,
@@ -6652,7 +6753,7 @@ function DepositFlow({
6652
6753
  onError: handleError
6653
6754
  }
6654
6755
  ),
6655
- step.type === "exchange-connect" && /* @__PURE__ */ jsx17(
6756
+ step.type === "exchange-connect" && /* @__PURE__ */ jsx18(
6656
6757
  ExchangeConnectStep,
6657
6758
  {
6658
6759
  smartAccount: step.smartAccount,
@@ -6665,7 +6766,7 @@ function DepositFlow({
6665
6766
  onError: handleError
6666
6767
  }
6667
6768
  ),
6668
- step.type === "processing" && /* @__PURE__ */ jsx17(
6769
+ step.type === "processing" && /* @__PURE__ */ jsx18(
6669
6770
  ProcessingStep,
6670
6771
  {
6671
6772
  smartAccount: step.smartAccount,
@@ -6699,15 +6800,15 @@ function DepositFlow({
6699
6800
  if (!dappAddress) return null;
6700
6801
  const solanaAddr = reownWallet?.solanaAddress;
6701
6802
  const solanaProvider = reownWallet?.solanaProvider;
6702
- return /* @__PURE__ */ jsxs15("div", { className: "rs-modal-body", children: [
6703
- effectiveStep.type === "setup" && /* @__PURE__ */ jsx17(
6803
+ return /* @__PURE__ */ jsxs16("div", { className: "rs-modal-body", children: [
6804
+ effectiveStep.type === "setup" && /* @__PURE__ */ jsx18(
6704
6805
  AccountPreparingSkeleton,
6705
6806
  {
6706
6807
  errorMessage: activeEntry.status === "error" ? activeEntry.message ?? void 0 : void 0,
6707
6808
  onRetry: activeEntry.status === "error" ? () => handleRetrySetup(dappAddress) : void 0
6708
6809
  }
6709
6810
  ),
6710
- effectiveStep.type === "solana-token-select" && solanaAddr && /* @__PURE__ */ jsx17(
6811
+ effectiveStep.type === "solana-token-select" && solanaAddr && /* @__PURE__ */ jsx18(
6711
6812
  SolanaTokenSelectStep,
6712
6813
  {
6713
6814
  solanaAddress: solanaAddr,
@@ -6721,7 +6822,7 @@ function DepositFlow({
6721
6822
  debug
6722
6823
  }
6723
6824
  ),
6724
- effectiveStep.type === "solana-amount" && /* @__PURE__ */ jsx17(
6825
+ effectiveStep.type === "solana-amount" && /* @__PURE__ */ jsx18(
6725
6826
  SolanaAmountStep,
6726
6827
  {
6727
6828
  token: effectiveStep.token,
@@ -6740,7 +6841,7 @@ function DepositFlow({
6740
6841
  debug
6741
6842
  }
6742
6843
  ),
6743
- effectiveStep.type === "solana-confirm" && solanaAddr && solanaProvider ? /* @__PURE__ */ jsx17(
6844
+ effectiveStep.type === "solana-confirm" && solanaAddr && solanaProvider ? /* @__PURE__ */ jsx18(
6744
6845
  SolanaConfirmStep,
6745
6846
  {
6746
6847
  smartAccount: effectiveStep.smartAccount,
@@ -6761,16 +6862,16 @@ function DepositFlow({
6761
6862
  onError: handleError,
6762
6863
  debug
6763
6864
  }
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(
6865
+ ) : effectiveStep.type === "solana-confirm" ? /* @__PURE__ */ jsxs16("div", { className: "rs-step", children: [
6866
+ /* @__PURE__ */ jsxs16("div", { className: "rs-loading-state", children: [
6867
+ /* @__PURE__ */ jsx18("div", { className: "rs-step-icon rs-step-icon--error", children: /* @__PURE__ */ jsx18(
6767
6868
  "svg",
6768
6869
  {
6769
6870
  viewBox: "0 0 24 24",
6770
6871
  fill: "none",
6771
6872
  stroke: "currentColor",
6772
6873
  strokeWidth: "2",
6773
- children: /* @__PURE__ */ jsx17(
6874
+ children: /* @__PURE__ */ jsx18(
6774
6875
  "path",
6775
6876
  {
6776
6877
  strokeLinecap: "round",
@@ -6780,22 +6881,22 @@ function DepositFlow({
6780
6881
  )
6781
6882
  }
6782
6883
  ) }),
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." })
6884
+ /* @__PURE__ */ jsxs16("div", { className: "rs-loading-text", children: [
6885
+ /* @__PURE__ */ jsx18("div", { className: "rs-loading-title rs-text-error", children: "Wallet disconnected" }),
6886
+ /* @__PURE__ */ jsx18("div", { className: "rs-loading-subtitle", children: "Please reconnect your Solana wallet to continue." })
6786
6887
  ] })
6787
6888
  ] }),
6788
- /* @__PURE__ */ jsx17("div", { className: "rs-step-footer", children: /* @__PURE__ */ jsx17(
6889
+ /* @__PURE__ */ jsx18("div", { className: "rs-step-footer", children: /* @__PURE__ */ jsx18(
6789
6890
  "button",
6790
6891
  {
6791
6892
  type: "button",
6792
6893
  className: "rs-button rs-button--default rs-button--full-width",
6793
6894
  onClick: handleBack,
6794
- children: /* @__PURE__ */ jsx17("span", { children: "Go Back" })
6895
+ children: /* @__PURE__ */ jsx18("span", { children: "Go Back" })
6795
6896
  }
6796
6897
  ) })
6797
6898
  ] }) : null,
6798
- effectiveStep.type === "processing" && /* @__PURE__ */ jsx17(
6899
+ effectiveStep.type === "processing" && /* @__PURE__ */ jsx18(
6799
6900
  ProcessingStep,
6800
6901
  {
6801
6902
  smartAccount: effectiveStep.smartAccount,
@@ -6822,8 +6923,26 @@ function DepositFlow({
6822
6923
  )
6823
6924
  ] });
6824
6925
  }
6926
+ if (isDappImportMode && effectiveStep.type === "dapp-import-resolving") {
6927
+ return /* @__PURE__ */ jsx18(
6928
+ "div",
6929
+ {
6930
+ className: "rs-modal-body",
6931
+ "data-flow-mode": "dapp-import",
6932
+ "data-step-type": effectiveStep.type,
6933
+ children: /* @__PURE__ */ jsx18(
6934
+ DappImportAssetSelectSkeleton,
6935
+ {
6936
+ sourceLabel: activeDappImportProvider?.sourceLabel ?? "",
6937
+ error: dappImportBootError,
6938
+ onRetry: handleBootRetry
6939
+ }
6940
+ )
6941
+ }
6942
+ );
6943
+ }
6825
6944
  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" }) }) }) }) });
6945
+ return /* @__PURE__ */ jsx18("div", { className: "rs-modal-body", children: /* @__PURE__ */ jsx18("div", { className: "rs-step", children: /* @__PURE__ */ jsx18("div", { className: "rs-loading-state", children: /* @__PURE__ */ jsx18("div", { className: "rs-loading-text", children: /* @__PURE__ */ jsx18("div", { className: "rs-loading-title", children: "Connecting wallet\u2026" }) }) }) }) });
6827
6946
  }
6828
6947
  const ownerAddress = signerContext.ownerAddress;
6829
6948
  const ownerChainId = signerContext.walletClient?.chain?.id ?? signerContext.publicClient.chain?.id ?? setupChainId;
@@ -6833,15 +6952,15 @@ function DepositFlow({
6833
6952
  }
6834
6953
  return getPublicClient(chainId);
6835
6954
  };
6836
- return /* @__PURE__ */ jsxs15("div", { className: "rs-modal-body", children: [
6837
- effectiveStep.type === "setup" && /* @__PURE__ */ jsx17(
6955
+ return /* @__PURE__ */ jsxs16("div", { className: "rs-modal-body", children: [
6956
+ effectiveStep.type === "setup" && /* @__PURE__ */ jsx18(
6838
6957
  AccountPreparingSkeleton,
6839
6958
  {
6840
6959
  errorMessage: activeEntry.status === "error" ? activeEntry.message ?? void 0 : void 0,
6841
6960
  onRetry: activeEntry.status === "error" ? () => handleRetrySetup(ownerAddress) : void 0
6842
6961
  }
6843
6962
  ),
6844
- effectiveStep.type === "select-asset" && /* @__PURE__ */ jsx17(
6963
+ effectiveStep.type === "select-asset" && /* @__PURE__ */ jsx18(
6845
6964
  AssetSelectStep,
6846
6965
  {
6847
6966
  address: ownerAddress,
@@ -6859,15 +6978,15 @@ function DepositFlow({
6859
6978
  } : void 0
6860
6979
  }
6861
6980
  ),
6862
- effectiveStep.type === "dapp-import-asset-select" && activeDappImportProvider && activeDappImportAvailability && /* @__PURE__ */ jsx17(
6981
+ effectiveStep.type === "dapp-import-asset-select" && activeDappImportProvider && activeDappImportAvailability && /* @__PURE__ */ jsx18(
6863
6982
  DappImportAssetSelectStep,
6864
6983
  {
6865
- sourceLabel: activeDappImportAvailability.assets[0]?.sourceLabel ?? activeDappImportProvider.label,
6984
+ sourceLabel: activeDappImportAvailability.assets[0]?.sourceLabel ?? activeDappImportProvider.sourceLabel,
6866
6985
  assets: activeDappImportAvailability.assets,
6867
6986
  onSelect: handleDappImportAssetSelected
6868
6987
  }
6869
6988
  ),
6870
- effectiveStep.type === "amount" && /* @__PURE__ */ jsx17(
6989
+ effectiveStep.type === "amount" && /* @__PURE__ */ jsx18(
6871
6990
  AmountStep,
6872
6991
  {
6873
6992
  walletClient: signerContext.walletClient,
@@ -6899,7 +7018,7 @@ function DepositFlow({
6899
7018
  }
6900
7019
  }
6901
7020
  ),
6902
- effectiveStep.type === "confirm" && /* @__PURE__ */ jsx17(
7021
+ effectiveStep.type === "confirm" && /* @__PURE__ */ jsx18(
6903
7022
  ConfirmStep,
6904
7023
  {
6905
7024
  walletClient: signerContext.walletClient,
@@ -6940,7 +7059,7 @@ function DepositFlow({
6940
7059
  onError: handleError
6941
7060
  }
6942
7061
  ),
6943
- effectiveStep.type === "processing" && /* @__PURE__ */ jsx17(
7062
+ effectiveStep.type === "processing" && /* @__PURE__ */ jsx18(
6944
7063
  ProcessingStep,
6945
7064
  {
6946
7065
  smartAccount: effectiveStep.smartAccount,
@@ -6972,7 +7091,7 @@ function DepositFlow({
6972
7091
 
6973
7092
  // src/components/history/DepositHistoryPanel.tsx
6974
7093
  import { useCallback as useCallback8, useMemo as useMemo8, useState as useState12 } from "react";
6975
- import { jsx as jsx18, jsxs as jsxs16 } from "react/jsx-runtime";
7094
+ import { jsx as jsx19, jsxs as jsxs17 } from "react/jsx-runtime";
6976
7095
  function shortenHash(hash) {
6977
7096
  if (hash.length <= 14) return hash;
6978
7097
  return `${hash.slice(0, 6)}\u2026${hash.slice(-4)}`;
@@ -7099,7 +7218,7 @@ function DepositHistoryPanel({
7099
7218
  (d) => !(d.txHash && sourceHashes.has(d.txHash.toLowerCase()))
7100
7219
  );
7101
7220
  }, [deposits]);
7102
- return /* @__PURE__ */ jsxs16(
7221
+ return /* @__PURE__ */ jsxs17(
7103
7222
  "div",
7104
7223
  {
7105
7224
  className: "rs-history-panel",
@@ -7107,55 +7226,55 @@ function DepositHistoryPanel({
7107
7226
  "aria-label": "Deposit history",
7108
7227
  onKeyDown: handleKeyDown,
7109
7228
  children: [
7110
- /* @__PURE__ */ jsxs16("div", { className: "rs-modal-header--redesigned", children: [
7111
- /* @__PURE__ */ jsx18("div", { className: "rs-modal-header-nav-left", children: /* @__PURE__ */ jsx18(
7229
+ /* @__PURE__ */ jsxs17("div", { className: "rs-modal-header--redesigned", children: [
7230
+ /* @__PURE__ */ jsx19("div", { className: "rs-modal-header-nav-left", children: /* @__PURE__ */ jsx19(
7112
7231
  "button",
7113
7232
  {
7114
7233
  type: "button",
7115
7234
  className: "rs-modal-header-back",
7116
7235
  "aria-label": "Back",
7117
7236
  onClick: onClose,
7118
- children: /* @__PURE__ */ jsx18(ChevronLeftIcon, {})
7237
+ children: /* @__PURE__ */ jsx19(ChevronLeftIcon, {})
7119
7238
  }
7120
7239
  ) }),
7121
- /* @__PURE__ */ jsx18("div", { className: "rs-modal-header-nav-right", children: onCloseModal && /* @__PURE__ */ jsx18(
7240
+ /* @__PURE__ */ jsx19("div", { className: "rs-modal-header-nav-right", children: onCloseModal && /* @__PURE__ */ jsx19(
7122
7241
  "button",
7123
7242
  {
7124
7243
  type: "button",
7125
7244
  className: "rs-modal-close",
7126
7245
  "aria-label": "Close",
7127
7246
  onClick: onCloseModal,
7128
- children: /* @__PURE__ */ jsx18(CloseIcon, {})
7247
+ children: /* @__PURE__ */ jsx19(CloseIcon, {})
7129
7248
  }
7130
7249
  ) })
7131
7250
  ] }),
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" })
7251
+ /* @__PURE__ */ jsxs17("div", { className: "rs-history-screen", children: [
7252
+ /* @__PURE__ */ jsxs17("div", { className: "rs-history-screen-body", children: [
7253
+ /* @__PURE__ */ jsx19(BodyHeader, { icon: /* @__PURE__ */ jsx19(HistoryIcon, {}), title: "History" }),
7254
+ isLoading && deposits.length === 0 && /* @__PURE__ */ jsxs17("div", { className: "rs-history-empty", children: [
7255
+ /* @__PURE__ */ jsx19("span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ jsx19(HistoryIcon, {}) }),
7256
+ /* @__PURE__ */ jsxs17("div", { className: "rs-history-empty-text", children: [
7257
+ /* @__PURE__ */ jsx19(Spinner, { className: "rs-spinner--sm" }),
7258
+ /* @__PURE__ */ jsx19("span", { className: "rs-history-empty-hint", children: "Loading history\u2026" })
7140
7259
  ] })
7141
7260
  ] }),
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 })
7261
+ error && !isLoading && /* @__PURE__ */ jsxs17("div", { className: "rs-history-empty", children: [
7262
+ /* @__PURE__ */ jsx19("span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ jsx19(AlertTriangleIcon, {}) }),
7263
+ /* @__PURE__ */ jsxs17("div", { className: "rs-history-empty-text", children: [
7264
+ /* @__PURE__ */ jsx19("span", { className: "rs-history-empty-title", children: "Couldn't load history" }),
7265
+ /* @__PURE__ */ jsx19("span", { className: "rs-history-empty-hint", children: error })
7147
7266
  ] })
7148
7267
  ] }),
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" })
7268
+ !isLoading && !error && visibleDeposits.length === 0 && /* @__PURE__ */ jsxs17("div", { className: "rs-history-empty", children: [
7269
+ /* @__PURE__ */ jsx19("span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ jsx19(HistoryIcon, {}) }),
7270
+ /* @__PURE__ */ jsxs17("div", { className: "rs-history-empty-text", children: [
7271
+ /* @__PURE__ */ jsx19("span", { className: "rs-history-empty-title", children: "No deposits yet" }),
7272
+ /* @__PURE__ */ jsx19("span", { className: "rs-history-empty-hint", children: "Your deposit history will appear here" })
7154
7273
  ] })
7155
7274
  ] }),
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(
7275
+ visibleDeposits.length > 0 && /* @__PURE__ */ jsxs17("div", { className: "rs-history-list", children: [
7276
+ visibleDeposits.map((deposit, i) => /* @__PURE__ */ jsx19(HistoryCard, { deposit }, deposit.txHash || i)),
7277
+ hasMore && /* @__PURE__ */ jsx19(
7159
7278
  "button",
7160
7279
  {
7161
7280
  type: "button",
@@ -7167,7 +7286,7 @@ function DepositHistoryPanel({
7167
7286
  )
7168
7287
  ] })
7169
7288
  ] }),
7170
- /* @__PURE__ */ jsx18(PoweredBy, {})
7289
+ /* @__PURE__ */ jsx19(PoweredBy, {})
7171
7290
  ] })
7172
7291
  ]
7173
7292
  }
@@ -7193,7 +7312,7 @@ function HistoryCard({ deposit }) {
7193
7312
  const date = deposit.createdAt ? formatDate(deposit.createdAt) : null;
7194
7313
  const txTypeLabel = `Deposit${sourceSymbol ? ` ${sourceSymbol}` : ""}`;
7195
7314
  const srcTxUrl = deposit.sourceTxHash ? getTxExplorerUrl(deposit.sourceTxHash, sourceChainId) : null;
7196
- return /* @__PURE__ */ jsxs16(
7315
+ return /* @__PURE__ */ jsxs17(
7197
7316
  "button",
7198
7317
  {
7199
7318
  type: "button",
@@ -7201,38 +7320,38 @@ function HistoryCard({ deposit }) {
7201
7320
  onClick: () => setExpanded((v) => !v),
7202
7321
  "aria-expanded": expanded,
7203
7322
  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: "" }) })
7323
+ /* @__PURE__ */ jsxs17("div", { className: "rs-history-card-row", children: [
7324
+ /* @__PURE__ */ jsxs17("div", { className: "rs-history-card-icons", children: [
7325
+ /* @__PURE__ */ jsx19("span", { className: "rs-history-card-token", children: sourceTokenIcon ? /* @__PURE__ */ jsx19("img", { src: sourceTokenIcon, alt: "" }) : sourceSymbol.slice(0, 2) }),
7326
+ sourceChainIcon && /* @__PURE__ */ jsx19("span", { className: "rs-history-card-chain", children: /* @__PURE__ */ jsx19("img", { src: sourceChainIcon, alt: "" }) })
7208
7327
  ] }),
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 })
7328
+ /* @__PURE__ */ jsxs17("div", { className: "rs-history-card-text", children: [
7329
+ /* @__PURE__ */ jsx19("span", { className: "rs-history-card-title", children: txTypeLabel }),
7330
+ date && /* @__PURE__ */ jsx19("span", { className: "rs-history-card-date", children: date })
7212
7331
  ] }),
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] })
7332
+ /* @__PURE__ */ jsxs17("div", { className: "rs-history-card-side", children: [
7333
+ /* @__PURE__ */ jsx19("span", { className: "rs-history-card-amount", children: displayAmount }),
7334
+ /* @__PURE__ */ jsx19("span", { className: `rs-history-badge rs-history-badge--${status}`, children: STATUS_LABEL[status] })
7216
7335
  ] })
7217
7336
  ] }),
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: "" }) })
7337
+ /* @__PURE__ */ jsx19("div", { className: "rs-history-card-panel", children: /* @__PURE__ */ jsx19("div", { className: "rs-history-card-panel-inner", children: /* @__PURE__ */ jsxs17("div", { className: "rs-history-card-details", children: [
7338
+ sourceChainName && /* @__PURE__ */ jsxs17("div", { className: "rs-amount-detail-row", children: [
7339
+ /* @__PURE__ */ jsx19("span", { children: "Source chain" }),
7340
+ /* @__PURE__ */ jsxs17("span", { className: "rs-amount-detail-value", children: [
7341
+ /* @__PURE__ */ jsx19("span", { children: sourceChainName }),
7342
+ sourceChainIcon && /* @__PURE__ */ jsx19("span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ jsx19("img", { src: sourceChainIcon, alt: "" }) })
7224
7343
  ] })
7225
7344
  ] }),
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: "" }) })
7345
+ targetChainName && /* @__PURE__ */ jsxs17("div", { className: "rs-amount-detail-row", children: [
7346
+ /* @__PURE__ */ jsx19("span", { children: "Destination chain" }),
7347
+ /* @__PURE__ */ jsxs17("span", { className: "rs-amount-detail-value", children: [
7348
+ /* @__PURE__ */ jsx19("span", { children: targetChainName }),
7349
+ targetChainIcon && /* @__PURE__ */ jsx19("span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ jsx19("img", { src: targetChainIcon, alt: "" }) })
7231
7350
  ] })
7232
7351
  ] }),
7233
- srcTxUrl && deposit.sourceTxHash && /* @__PURE__ */ jsxs16("div", { className: "rs-amount-detail-row", children: [
7234
- /* @__PURE__ */ jsx18("span", { children: "Transaction details" }),
7235
- /* @__PURE__ */ jsxs16(
7352
+ srcTxUrl && deposit.sourceTxHash && /* @__PURE__ */ jsxs17("div", { className: "rs-amount-detail-row", children: [
7353
+ /* @__PURE__ */ jsx19("span", { children: "Transaction details" }),
7354
+ /* @__PURE__ */ jsxs17(
7236
7355
  "a",
7237
7356
  {
7238
7357
  href: srcTxUrl,
@@ -7241,8 +7360,8 @@ function HistoryCard({ deposit }) {
7241
7360
  className: "rs-history-card-link",
7242
7361
  onClick: (e) => e.stopPropagation(),
7243
7362
  children: [
7244
- /* @__PURE__ */ jsx18("span", { children: shortenHash(deposit.sourceTxHash) }),
7245
- /* @__PURE__ */ jsx18(ArrowUpRightIcon, {})
7363
+ /* @__PURE__ */ jsx19("span", { children: shortenHash(deposit.sourceTxHash) }),
7364
+ /* @__PURE__ */ jsx19(ArrowUpRightIcon, {})
7246
7365
  ]
7247
7366
  }
7248
7367
  )
@@ -7255,9 +7374,9 @@ function HistoryCard({ deposit }) {
7255
7374
  DepositHistoryPanel.displayName = "DepositHistoryPanel";
7256
7375
 
7257
7376
  // src/DepositModal.tsx
7258
- import { jsx as jsx19, jsxs as jsxs17 } from "react/jsx-runtime";
7377
+ import { jsx as jsx20, jsxs as jsxs18 } from "react/jsx-runtime";
7259
7378
  var ReownDepositInner = lazy2(
7260
- () => import("./DepositModalReown-6SUEC5IU.mjs").then((m) => ({ default: m.DepositModalReown }))
7379
+ () => import("./DepositModalReown-G7UX4IBZ.mjs").then((m) => ({ default: m.DepositModalReown }))
7261
7380
  );
7262
7381
  function sortByCreatedAtDesc(items) {
7263
7382
  return [...items].sort((a, b) => {
@@ -7273,7 +7392,7 @@ function DepositModal(props) {
7273
7392
  "dappWalletClient"
7274
7393
  );
7275
7394
  if (needsReown) {
7276
- return /* @__PURE__ */ jsx19(Suspense2, { fallback: null, children: /* @__PURE__ */ jsx19(
7395
+ return /* @__PURE__ */ jsx20(Suspense2, { fallback: null, children: /* @__PURE__ */ jsx20(
7277
7396
  ReownDepositInner,
7278
7397
  {
7279
7398
  ...props,
@@ -7281,7 +7400,7 @@ function DepositModal(props) {
7281
7400
  }
7282
7401
  ) });
7283
7402
  }
7284
- return /* @__PURE__ */ jsx19(
7403
+ return /* @__PURE__ */ jsx20(
7285
7404
  DepositModalInner,
7286
7405
  {
7287
7406
  ...props,
@@ -7313,6 +7432,7 @@ function DepositModalInner({
7313
7432
  forceRegister = false,
7314
7433
  enableSolana = true,
7315
7434
  dappImports,
7435
+ initialDappImport,
7316
7436
  enableFiatOnramp = false,
7317
7437
  enableQrTransfer = true,
7318
7438
  fiatOnrampMethods,
@@ -7356,7 +7476,7 @@ function DepositModalInner({
7356
7476
  const [recipientIsContract, setRecipientIsContract] = useState13(false);
7357
7477
  const onErrorRef = useLatestRef(onError);
7358
7478
  useEffect11(() => {
7359
- if (targetChain !== HYPERCORE_CHAIN_ID || !isAddress2(recipient, { strict: false })) {
7479
+ if (targetChain !== HYPERCORE_CHAIN_ID || !isAddress(recipient, { strict: false })) {
7360
7480
  setRecipientIsContract(false);
7361
7481
  return;
7362
7482
  }
@@ -7510,7 +7630,7 @@ function DepositModalInner({
7510
7630
  }, [isOpen, store]);
7511
7631
  const showBackButton = uiConfig?.showBackButton ?? true;
7512
7632
  const canGoBack = backHandler !== void 0;
7513
- return /* @__PURE__ */ jsx19(DepositStoreProvider, { store, children: /* @__PURE__ */ jsx19(
7633
+ return /* @__PURE__ */ jsx20(DepositStoreProvider, { store, children: /* @__PURE__ */ jsx20(
7514
7634
  Modal,
7515
7635
  {
7516
7636
  isOpen,
@@ -7518,20 +7638,20 @@ function DepositModalInner({
7518
7638
  className,
7519
7639
  inline,
7520
7640
  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(
7641
+ children: /* @__PURE__ */ jsxs18("div", { ref: modalRef, className: "rs-modal", children: [
7642
+ /* @__PURE__ */ jsxs18("div", { className: "rs-modal-header--redesigned", children: [
7643
+ /* @__PURE__ */ jsx20("div", { className: "rs-modal-header-nav-left", children: showBackButton && canGoBack && backHandler && /* @__PURE__ */ jsx20(
7524
7644
  "button",
7525
7645
  {
7526
7646
  type: "button",
7527
7647
  className: "rs-modal-header-back",
7528
7648
  "aria-label": "Go back",
7529
7649
  onClick: backHandler,
7530
- children: /* @__PURE__ */ jsx19(ChevronLeftIcon, {})
7650
+ children: /* @__PURE__ */ jsx20(ChevronLeftIcon, {})
7531
7651
  }
7532
7652
  ) }),
7533
- /* @__PURE__ */ jsxs17("div", { className: "rs-modal-header-nav-right", children: [
7534
- historyButtonVisible && /* @__PURE__ */ jsx19(
7653
+ /* @__PURE__ */ jsxs18("div", { className: "rs-modal-header-nav-right", children: [
7654
+ historyButtonVisible && /* @__PURE__ */ jsx20(
7535
7655
  "button",
7536
7656
  {
7537
7657
  type: "button",
@@ -7539,22 +7659,22 @@ function DepositModalInner({
7539
7659
  "aria-label": "Deposit history",
7540
7660
  onClick: handleHistoryOpen,
7541
7661
  disabled: !recipient,
7542
- children: /* @__PURE__ */ jsx19(HistoryIcon, {})
7662
+ children: /* @__PURE__ */ jsx20(HistoryIcon, {})
7543
7663
  }
7544
7664
  ),
7545
- /* @__PURE__ */ jsx19(
7665
+ /* @__PURE__ */ jsx20(
7546
7666
  "button",
7547
7667
  {
7548
7668
  type: "button",
7549
7669
  onClick: onClose,
7550
7670
  className: "rs-modal-close",
7551
7671
  "aria-label": "Close",
7552
- children: /* @__PURE__ */ jsx19(CloseIcon, {})
7672
+ children: /* @__PURE__ */ jsx20(CloseIcon, {})
7553
7673
  }
7554
7674
  )
7555
7675
  ] })
7556
7676
  ] }),
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(
7677
+ recipientIsContract ? /* @__PURE__ */ jsx20("div", { className: "rs-modal-body", children: /* @__PURE__ */ jsx20(Callout, { variant: "error", children: "HyperCore deposits require an EOA recipient. The configured recipient is a smart contract, which is not supported." }) }) : /* @__PURE__ */ jsx20(
7558
7678
  DepositFlow,
7559
7679
  {
7560
7680
  dappWalletClient,
@@ -7577,6 +7697,7 @@ function DepositModalInner({
7577
7697
  forceRegister,
7578
7698
  enableSolana,
7579
7699
  dappImports,
7700
+ initialDappImport,
7580
7701
  enableFiatOnramp,
7581
7702
  enableQrTransfer,
7582
7703
  fiatOnrampMethods,
@@ -7595,7 +7716,7 @@ function DepositModalInner({
7595
7716
  debug
7596
7717
  }
7597
7718
  ),
7598
- showHistoryButton && historyOpen && /* @__PURE__ */ jsx19(
7719
+ showHistoryButton && historyOpen && /* @__PURE__ */ jsx20(
7599
7720
  DepositHistoryPanel,
7600
7721
  {
7601
7722
  deposits: historyDeposits,