@rhinestone/deposit-modal 0.1.31 → 0.1.32

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 (35) hide show
  1. package/dist/{DepositModalReown-S7HER5HU.mjs → DepositModalReown-SZPCCNPH.mjs} +9 -5
  2. package/dist/{DepositModalReown-N7GCYZF7.cjs → DepositModalReown-XUAEWIW7.cjs} +12 -8
  3. package/dist/{WithdrawModalReown-DJCJ5U7E.cjs → WithdrawModalReown-53FDOZG2.cjs} +12 -8
  4. package/dist/{WithdrawModalReown-DMDRLYTE.mjs → WithdrawModalReown-YGGV7BL2.mjs} +9 -5
  5. package/dist/{chunk-VKQA3FO3.cjs → chunk-52FVEYTL.cjs} +4 -0
  6. package/dist/{chunk-3ICS43XC.mjs → chunk-C6I5TFSL.mjs} +4 -0
  7. package/dist/{chunk-EVU7M7A6.mjs → chunk-DLFUXLAM.mjs} +14 -13
  8. package/dist/{chunk-CS6UIMCF.mjs → chunk-K2JJKFTV.mjs} +5 -1
  9. package/dist/{chunk-AWFJFSPH.mjs → chunk-MKKJ7ZE2.mjs} +117 -176
  10. package/dist/{chunk-MU2BOEDN.cjs → chunk-NYEWO4NW.cjs} +195 -254
  11. package/dist/{chunk-SLI5FHTT.mjs → chunk-RR25E5DZ.mjs} +29 -9
  12. package/dist/{chunk-PE6OK3FH.cjs → chunk-S4UBVD3H.cjs} +5 -1
  13. package/dist/{chunk-SZ35G2DT.cjs → chunk-SQDXU7ML.cjs} +87 -67
  14. package/dist/{chunk-G2RDCQHL.cjs → chunk-YIHOACM3.cjs} +38 -37
  15. package/dist/constants.cjs +2 -2
  16. package/dist/constants.mjs +1 -1
  17. package/dist/deposit.cjs +4 -4
  18. package/dist/deposit.d.cts +2 -2
  19. package/dist/deposit.d.ts +2 -2
  20. package/dist/deposit.mjs +3 -3
  21. package/dist/index.cjs +5 -5
  22. package/dist/index.d.cts +1 -1
  23. package/dist/index.d.ts +1 -1
  24. package/dist/index.mjs +4 -4
  25. package/dist/reown.cjs +5 -5
  26. package/dist/reown.d.cts +1 -1
  27. package/dist/reown.d.ts +1 -1
  28. package/dist/reown.mjs +4 -4
  29. package/dist/{types-DTBfMH0p.d.ts → types-Bp2n2RQ3.d.ts} +0 -1
  30. package/dist/{types-DELv717e.d.cts → types-CIaQPR6F.d.cts} +0 -1
  31. package/dist/withdraw.cjs +4 -4
  32. package/dist/withdraw.d.cts +2 -2
  33. package/dist/withdraw.d.ts +2 -2
  34. package/dist/withdraw.mjs +3 -3
  35. package/package.json +1 -1
@@ -16,7 +16,7 @@ import {
16
16
  isNativeAsset,
17
17
  loadSessionOwnerFromStorage,
18
18
  saveSessionOwnerToStorage
19
- } from "./chunk-EVU7M7A6.mjs";
19
+ } from "./chunk-DLFUXLAM.mjs";
20
20
  import {
21
21
  DEFAULT_BACKEND_URL,
22
22
  DEFAULT_SIGNER_ADDRESS,
@@ -29,7 +29,7 @@ import {
29
29
  getTokenDecimalsByAddress,
30
30
  getTokenIcon,
31
31
  getTokenSymbol
32
- } from "./chunk-3ICS43XC.mjs";
32
+ } from "./chunk-C6I5TFSL.mjs";
33
33
 
34
34
  // src/WithdrawModal.tsx
35
35
  import {
@@ -48,7 +48,7 @@ import { useCallback as useCallback2, useEffect as useEffect2, useMemo as useMem
48
48
  // src/components/steps/WithdrawFormStep.tsx
49
49
  import { useCallback, useEffect, useMemo, useRef, useState } from "react";
50
50
  import { erc20Abi, formatUnits, parseUnits } from "viem";
51
- import { jsx, jsxs } from "react/jsx-runtime";
51
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
52
52
  function useClickOutside(ref, onClose) {
53
53
  useEffect(() => {
54
54
  function handleClick(e) {
@@ -75,6 +75,7 @@ function WithdrawFormStep({
75
75
  onTargetChainChange,
76
76
  onTargetTokenChange,
77
77
  switchChain,
78
+ walletIcon,
78
79
  submitting = false,
79
80
  onSubmit,
80
81
  onBalanceUsdChange
@@ -264,14 +265,22 @@ function WithdrawFormStep({
264
265
  }
265
266
  }
266
267
  ),
267
- address && /* @__PURE__ */ jsxs(
268
+ address && /* @__PURE__ */ jsx(
268
269
  "button",
269
270
  {
270
271
  type: "button",
271
272
  className: `rs-withdraw-use-connected ${isRecipientConnected ? "rs-withdraw-use-connected--active" : ""}`,
272
273
  onClick: handleUseConnected,
273
274
  title: isRecipientConnected ? "Using connected wallet" : "Use connected wallet",
274
- children: [
275
+ children: walletIcon ? /* @__PURE__ */ jsx(
276
+ "img",
277
+ {
278
+ src: walletIcon,
279
+ alt: "Wallet",
280
+ style: { width: 18, height: 18, borderRadius: 4 },
281
+ className: "rs-withdraw-use-connected-icon"
282
+ }
283
+ ) : /* @__PURE__ */ jsxs(Fragment, { children: [
275
284
  /* @__PURE__ */ jsx(
276
285
  "svg",
277
286
  {
@@ -291,7 +300,7 @@ function WithdrawFormStep({
291
300
  }
292
301
  ),
293
302
  isRecipientConnected ? null : "Wallet"
294
- ]
303
+ ] })
295
304
  }
296
305
  )
297
306
  ] })
@@ -860,6 +869,7 @@ function WithdrawFlow({
860
869
  waitForFinalTx = true,
861
870
  reownWallet,
862
871
  onConnect,
872
+ onDisconnect,
863
873
  onSignTransaction,
864
874
  onRequestConnect,
865
875
  connectButtonLabel,
@@ -905,7 +915,8 @@ function WithdrawFlow({
905
915
  options.push({
906
916
  address: reownWallet.address,
907
917
  label: "External Wallet",
908
- kind: "external"
918
+ kind: "external",
919
+ icon: reownWallet.icon
909
920
  });
910
921
  }
911
922
  return options;
@@ -1236,6 +1247,7 @@ function WithdrawFlow({
1236
1247
  onSelectAddress: setSelectedConnectAddress,
1237
1248
  onRequestConnect,
1238
1249
  onConnect,
1250
+ onDisconnect,
1239
1251
  onContinue: () => {
1240
1252
  if (selectedConnectAddressEffective) {
1241
1253
  setSelectedConnectAddress(selectedConnectAddressEffective);
@@ -1250,6 +1262,12 @@ function WithdrawFlow({
1250
1262
  if (!onSignTransaction && !signerContext.walletClient) return null;
1251
1263
  const ownerAddress = signerContext.ownerAddress;
1252
1264
  const formPublicClient = signerContext.publicClient ?? getPublicClient(sourceChain);
1265
+ const selectedWalletIcon = useMemo2(() => {
1266
+ const selected = walletOptions.find(
1267
+ (o) => o.address.toLowerCase() === ownerAddress.toLowerCase()
1268
+ );
1269
+ return selected?.icon ?? reownWallet?.icon;
1270
+ }, [walletOptions, ownerAddress, reownWallet?.icon]);
1253
1271
  return /* @__PURE__ */ jsxs2("div", { className: "rs-modal-body", children: [
1254
1272
  step.type === "form" && /* @__PURE__ */ jsx2(
1255
1273
  WithdrawFormStep,
@@ -1268,6 +1286,7 @@ function WithdrawFlow({
1268
1286
  onTargetChainChange: handleTargetChainChange,
1269
1287
  onTargetTokenChange: handleTargetTokenChange,
1270
1288
  switchChain: signerContext.switchChain,
1289
+ walletIcon: selectedWalletIcon,
1271
1290
  submitting: isSubmitting,
1272
1291
  onSubmit: handleFormSubmit,
1273
1292
  onBalanceUsdChange: setTotalBalanceUsd
@@ -1281,7 +1300,6 @@ function WithdrawFlow({
1281
1300
  sourceChain: step.sourceChain,
1282
1301
  sourceToken: step.sourceToken,
1283
1302
  targetChain,
1284
- targetToken,
1285
1303
  amount: step.amount,
1286
1304
  waitForFinalTx,
1287
1305
  service,
@@ -1300,7 +1318,7 @@ function WithdrawFlow({
1300
1318
  // src/WithdrawModal.tsx
1301
1319
  import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
1302
1320
  var ReownWithdrawInner = lazy(
1303
- () => import("./WithdrawModalReown-DMDRLYTE.mjs").then((m) => ({
1321
+ () => import("./WithdrawModalReown-YGGV7BL2.mjs").then((m) => ({
1304
1322
  default: m.WithdrawModalReown
1305
1323
  }))
1306
1324
  );
@@ -1333,6 +1351,7 @@ function WithdrawModalInner({
1333
1351
  waitForFinalTx = true,
1334
1352
  reownWallet,
1335
1353
  onConnect,
1354
+ onDisconnect,
1336
1355
  onSignTransaction,
1337
1356
  onRequestConnect,
1338
1357
  connectButtonLabel,
@@ -1501,6 +1520,7 @@ function WithdrawModalInner({
1501
1520
  waitForFinalTx,
1502
1521
  reownWallet,
1503
1522
  onConnect,
1523
+ onDisconnect,
1504
1524
  onSignTransaction,
1505
1525
  onRequestConnect,
1506
1526
  connectButtonLabel,
@@ -341,6 +341,9 @@ function getTokenSymbol(token, chainId) {
341
341
  }
342
342
  return "Token";
343
343
  }
344
+ function isStablecoinSymbol(symbol) {
345
+ return /^(usdc|usdt|dai|usd)$/i.test(symbol);
346
+ }
344
347
  var CHAIN_BADGES = {
345
348
  [_chains.mainnet.id]: { shortLabel: "ETH", color: "#627EEA", bg: "#EEF2FF" },
346
349
  [_chains.base.id]: { shortLabel: "Base", color: "#0052FF", bg: "#E7F0FF" },
@@ -427,4 +430,5 @@ function getTokenIcon(symbol) {
427
430
 
428
431
 
429
432
 
430
- exports.DEFAULT_BACKEND_URL = DEFAULT_BACKEND_URL; exports.DEFAULT_SIGNER_ADDRESS = DEFAULT_SIGNER_ADDRESS; exports.NATIVE_TOKEN_ADDRESS = NATIVE_TOKEN_ADDRESS; exports.CHAIN_BY_ID = CHAIN_BY_ID; exports.SOURCE_CHAINS = SOURCE_CHAINS; exports.SUPPORTED_CHAINS = SUPPORTED_CHAINS; exports.chainRegistry = chainRegistry; exports.getChainId = getChainId; exports.getChainObject = getChainObject; exports.getUsdcAddress = getUsdcAddress; exports.getUsdcDecimals = getUsdcDecimals; exports.getTokenAddress = getTokenAddress; exports.getTokenDecimals = getTokenDecimals; exports.getTargetTokenSymbolsForChain = getTargetTokenSymbolsForChain; exports.getSupportedTokenSymbolsForChain = getSupportedTokenSymbolsForChain; exports.getSupportedChainIds = getSupportedChainIds; exports.isSupportedTokenAddressForChain = isSupportedTokenAddressForChain; exports.getSupportedTargetTokens = getSupportedTargetTokens; exports.getTokenDecimalsByAddress = getTokenDecimalsByAddress; exports.findChainIdForToken = findChainIdForToken; exports.getTokenSymbol = getTokenSymbol; exports.getChainName = getChainName; exports.getChainBadge = getChainBadge; exports.getExplorerUrl = getExplorerUrl; exports.getExplorerTxUrl = getExplorerTxUrl; exports.getExplorerName = getExplorerName; exports.getChainIcon = getChainIcon; exports.getTokenIcon = getTokenIcon;
433
+
434
+ exports.DEFAULT_BACKEND_URL = DEFAULT_BACKEND_URL; exports.DEFAULT_SIGNER_ADDRESS = DEFAULT_SIGNER_ADDRESS; exports.NATIVE_TOKEN_ADDRESS = NATIVE_TOKEN_ADDRESS; exports.CHAIN_BY_ID = CHAIN_BY_ID; exports.SOURCE_CHAINS = SOURCE_CHAINS; exports.SUPPORTED_CHAINS = SUPPORTED_CHAINS; exports.chainRegistry = chainRegistry; exports.getChainId = getChainId; exports.getChainObject = getChainObject; exports.getUsdcAddress = getUsdcAddress; exports.getUsdcDecimals = getUsdcDecimals; exports.getTokenAddress = getTokenAddress; exports.getTokenDecimals = getTokenDecimals; exports.getTargetTokenSymbolsForChain = getTargetTokenSymbolsForChain; exports.getSupportedTokenSymbolsForChain = getSupportedTokenSymbolsForChain; exports.getSupportedChainIds = getSupportedChainIds; exports.isSupportedTokenAddressForChain = isSupportedTokenAddressForChain; exports.getSupportedTargetTokens = getSupportedTargetTokens; exports.getTokenDecimalsByAddress = getTokenDecimalsByAddress; exports.findChainIdForToken = findChainIdForToken; exports.getTokenSymbol = getTokenSymbol; exports.isStablecoinSymbol = isStablecoinSymbol; exports.getChainName = getChainName; exports.getChainBadge = getChainBadge; exports.getExplorerUrl = getExplorerUrl; exports.getExplorerTxUrl = getExplorerTxUrl; exports.getExplorerName = getExplorerName; exports.getChainIcon = getChainIcon; exports.getTokenIcon = getTokenIcon;
@@ -16,7 +16,7 @@
16
16
 
17
17
 
18
18
 
19
- var _chunkG2RDCQHLcjs = require('./chunk-G2RDCQHL.cjs');
19
+ var _chunkYIHOACM3cjs = require('./chunk-YIHOACM3.cjs');
20
20
 
21
21
 
22
22
 
@@ -29,7 +29,7 @@ var _chunkG2RDCQHLcjs = require('./chunk-G2RDCQHL.cjs');
29
29
 
30
30
 
31
31
 
32
- var _chunkPE6OK3FHcjs = require('./chunk-PE6OK3FH.cjs');
32
+ var _chunkS4UBVD3Hcjs = require('./chunk-S4UBVD3H.cjs');
33
33
 
34
34
  // src/WithdrawModal.tsx
35
35
 
@@ -75,6 +75,7 @@ function WithdrawFormStep({
75
75
  onTargetChainChange,
76
76
  onTargetTokenChange,
77
77
  switchChain,
78
+ walletIcon,
78
79
  submitting = false,
79
80
  onSubmit,
80
81
  onBalanceUsdChange
@@ -101,8 +102,8 @@ function WithdrawFormStep({
101
102
  const chainMismatch = Boolean(
102
103
  _optionalChain([walletClient, 'optionalAccess', _3 => _3.chain, 'optionalAccess', _4 => _4.id]) && walletClient.chain.id !== asset.chainId
103
104
  );
104
- const targetSymbol = _chunkPE6OK3FHcjs.getTokenSymbol.call(void 0, targetToken, targetChain);
105
- const targetChainName = _chunkPE6OK3FHcjs.getChainName.call(void 0, targetChain);
105
+ const targetSymbol = _chunkS4UBVD3Hcjs.getTokenSymbol.call(void 0, targetToken, targetChain);
106
+ const targetChainName = _chunkS4UBVD3Hcjs.getChainName.call(void 0, targetChain);
106
107
  const isBusy = submitting || isSubmitting;
107
108
  _react.useEffect.call(void 0, () => {
108
109
  if (chainMismatch && switchChain && !hasAttemptedSwitch.current) {
@@ -110,7 +111,7 @@ function WithdrawFormStep({
110
111
  setIsSwitching(true);
111
112
  switchChain(asset.chainId).catch((err) => {
112
113
  const raw = err instanceof Error ? err.message : "Failed to switch chain";
113
- setError(_chunkG2RDCQHLcjs.formatUserError.call(void 0, raw));
114
+ setError(_chunkYIHOACM3cjs.formatUserError.call(void 0, raw));
114
115
  }).finally(() => {
115
116
  setIsSwitching(false);
116
117
  });
@@ -127,7 +128,7 @@ function WithdrawFormStep({
127
128
  return;
128
129
  }
129
130
  try {
130
- const bal = _chunkG2RDCQHLcjs.isNativeAsset.call(void 0, asset) ? await publicClient.getBalance({ address: safeAddress }) : await publicClient.readContract({
131
+ const bal = _chunkYIHOACM3cjs.isNativeAsset.call(void 0, asset) ? await publicClient.getBalance({ address: safeAddress }) : await publicClient.readContract({
131
132
  address: asset.token,
132
133
  abi: _viem.erc20Abi,
133
134
  functionName: "balanceOf",
@@ -229,7 +230,7 @@ function WithdrawFormStep({
229
230
  await onSubmit(recipient, amount);
230
231
  } catch (err) {
231
232
  const raw = err instanceof Error ? err.message : "Withdrawal failed";
232
- setError(_chunkG2RDCQHLcjs.formatUserError.call(void 0, raw));
233
+ setError(_chunkYIHOACM3cjs.formatUserError.call(void 0, raw));
233
234
  } finally {
234
235
  setIsSubmitting(false);
235
236
  }
@@ -241,7 +242,7 @@ function WithdrawFormStep({
241
242
  await switchChain(asset.chainId);
242
243
  } catch (err) {
243
244
  const raw = err instanceof Error ? err.message : "Failed to switch chain";
244
- setError(_chunkG2RDCQHLcjs.formatUserError.call(void 0, raw));
245
+ setError(_chunkYIHOACM3cjs.formatUserError.call(void 0, raw));
245
246
  } finally {
246
247
  setIsSwitching(false);
247
248
  }
@@ -264,14 +265,22 @@ function WithdrawFormStep({
264
265
  }
265
266
  }
266
267
  ),
267
- address && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
268
+ address && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
268
269
  "button",
269
270
  {
270
271
  type: "button",
271
272
  className: `rs-withdraw-use-connected ${isRecipientConnected ? "rs-withdraw-use-connected--active" : ""}`,
272
273
  onClick: handleUseConnected,
273
274
  title: isRecipientConnected ? "Using connected wallet" : "Use connected wallet",
274
- children: [
275
+ children: walletIcon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
276
+ "img",
277
+ {
278
+ src: walletIcon,
279
+ alt: "Wallet",
280
+ style: { width: 18, height: 18, borderRadius: 4 },
281
+ className: "rs-withdraw-use-connected-icon"
282
+ }
283
+ ) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
275
284
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
276
285
  "svg",
277
286
  {
@@ -291,7 +300,7 @@ function WithdrawFormStep({
291
300
  }
292
301
  ),
293
302
  isRecipientConnected ? null : "Wallet"
294
- ]
303
+ ] })
295
304
  }
296
305
  )
297
306
  ] })
@@ -331,7 +340,7 @@ function WithdrawFormStep({
331
340
  ] })
332
341
  ] }),
333
342
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-amount-info", children: [
334
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-withdraw-usd", children: amountUsd !== null ? _chunkG2RDCQHLcjs.currencyFormatter.format(amountUsd) : "$0.00" }),
343
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-withdraw-usd", children: amountUsd !== null ? _chunkYIHOACM3cjs.currencyFormatter.format(amountUsd) : "$0.00" }),
335
344
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-withdraw-balance", children: [
336
345
  formattedBalance,
337
346
  " ",
@@ -359,10 +368,10 @@ function WithdrawFormStep({
359
368
  },
360
369
  children: [
361
370
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-dropdown-value", children: [
362
- _chunkPE6OK3FHcjs.getTokenIcon.call(void 0, targetSymbol) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
371
+ _chunkS4UBVD3Hcjs.getTokenIcon.call(void 0, targetSymbol) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
363
372
  "img",
364
373
  {
365
- src: _chunkPE6OK3FHcjs.getTokenIcon.call(void 0, targetSymbol),
374
+ src: _chunkS4UBVD3Hcjs.getTokenIcon.call(void 0, targetSymbol),
366
375
  alt: targetSymbol,
367
376
  className: "rs-withdraw-dropdown-icon"
368
377
  }
@@ -403,10 +412,10 @@ function WithdrawFormStep({
403
412
  setShowTokenDropdown(false);
404
413
  },
405
414
  children: [
406
- _chunkPE6OK3FHcjs.getTokenIcon.call(void 0, option.symbol) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
415
+ _chunkS4UBVD3Hcjs.getTokenIcon.call(void 0, option.symbol) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
407
416
  "img",
408
417
  {
409
- src: _chunkPE6OK3FHcjs.getTokenIcon.call(void 0, option.symbol),
418
+ src: _chunkS4UBVD3Hcjs.getTokenIcon.call(void 0, option.symbol),
410
419
  alt: option.symbol,
411
420
  className: "rs-withdraw-dropdown-icon"
412
421
  }
@@ -439,10 +448,10 @@ function WithdrawFormStep({
439
448
  },
440
449
  children: [
441
450
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-dropdown-value", children: [
442
- _chunkPE6OK3FHcjs.getChainIcon.call(void 0, targetChain) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
451
+ _chunkS4UBVD3Hcjs.getChainIcon.call(void 0, targetChain) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
443
452
  "img",
444
453
  {
445
- src: _chunkPE6OK3FHcjs.getChainIcon.call(void 0, targetChain),
454
+ src: _chunkS4UBVD3Hcjs.getChainIcon.call(void 0, targetChain),
446
455
  alt: targetChainName,
447
456
  className: "rs-withdraw-dropdown-icon"
448
457
  }
@@ -483,10 +492,10 @@ function WithdrawFormStep({
483
492
  setShowChainDropdown(false);
484
493
  },
485
494
  children: [
486
- _chunkPE6OK3FHcjs.getChainIcon.call(void 0, chain.id) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
495
+ _chunkS4UBVD3Hcjs.getChainIcon.call(void 0, chain.id) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
487
496
  "img",
488
497
  {
489
- src: _chunkPE6OK3FHcjs.getChainIcon.call(void 0, chain.id),
498
+ src: _chunkS4UBVD3Hcjs.getChainIcon.call(void 0, chain.id),
490
499
  alt: chain.name,
491
500
  className: "rs-withdraw-dropdown-icon"
492
501
  }
@@ -504,11 +513,11 @@ function WithdrawFormStep({
504
513
  chainMismatch && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-chain-switch", children: [
505
514
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-chain-switch-text", children: [
506
515
  "Switch to ",
507
- _chunkPE6OK3FHcjs.getChainName.call(void 0, asset.chainId),
516
+ _chunkS4UBVD3Hcjs.getChainName.call(void 0, asset.chainId),
508
517
  " to continue."
509
518
  ] }),
510
519
  switchChain && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
511
- _chunkG2RDCQHLcjs.Button,
520
+ _chunkYIHOACM3cjs.Button,
512
521
  {
513
522
  variant: "outline",
514
523
  size: "small",
@@ -540,7 +549,7 @@ function WithdrawFormStep({
540
549
  ] })
541
550
  ] }),
542
551
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
543
- _chunkG2RDCQHLcjs.Button,
552
+ _chunkYIHOACM3cjs.Button,
544
553
  {
545
554
  onClick: handleWithdraw,
546
555
  fullWidth: true,
@@ -549,7 +558,7 @@ function WithdrawFormStep({
549
558
  children: isBusy ? "Preparing..." : "Withdraw"
550
559
  }
551
560
  ) }),
552
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkG2RDCQHLcjs.PoweredBy, {})
561
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkYIHOACM3cjs.PoweredBy, {})
553
562
  ] });
554
563
  }
555
564
  WithdrawFormStep.displayName = "WithdrawFormStep";
@@ -632,7 +641,7 @@ async function executeSafeEthTransfer(params) {
632
641
  throw new Error("Wallet not connected");
633
642
  }
634
643
  if (chain.id !== chainId) {
635
- throw new Error(`Switch to ${_chunkPE6OK3FHcjs.getChainName.call(void 0, chainId)} to sign`);
644
+ throw new Error(`Switch to ${_chunkS4UBVD3Hcjs.getChainName.call(void 0, chainId)} to sign`);
636
645
  }
637
646
  const isOwner = await publicClient.readContract({
638
647
  address: safeAddress,
@@ -715,7 +724,7 @@ async function executeSafeErc20Transfer(params) {
715
724
  throw new Error("Wallet not connected");
716
725
  }
717
726
  if (chain.id !== chainId) {
718
- throw new Error(`Switch to ${_chunkPE6OK3FHcjs.getChainName.call(void 0, chainId)} to sign`);
727
+ throw new Error(`Switch to ${_chunkS4UBVD3Hcjs.getChainName.call(void 0, chainId)} to sign`);
719
728
  }
720
729
  const isOwner = await publicClient.readContract({
721
730
  address: safeAddress,
@@ -854,12 +863,13 @@ function WithdrawFlow({
854
863
  recipient: defaultRecipient,
855
864
  amount: defaultAmount,
856
865
  service,
857
- signerAddress = _chunkPE6OK3FHcjs.DEFAULT_SIGNER_ADDRESS,
866
+ signerAddress = _chunkS4UBVD3Hcjs.DEFAULT_SIGNER_ADDRESS,
858
867
  sessionChainIds,
859
868
  forceRegister = false,
860
869
  waitForFinalTx = true,
861
870
  reownWallet,
862
871
  onConnect,
872
+ onDisconnect,
863
873
  onSignTransaction,
864
874
  onRequestConnect,
865
875
  connectButtonLabel,
@@ -905,7 +915,8 @@ function WithdrawFlow({
905
915
  options.push({
906
916
  address: reownWallet.address,
907
917
  label: "External Wallet",
908
- kind: "external"
918
+ kind: "external",
919
+ icon: reownWallet.icon
909
920
  });
910
921
  }
911
922
  return options;
@@ -923,14 +934,14 @@ function WithdrawFlow({
923
934
  return {
924
935
  ownerAddress: dappAddress,
925
936
  walletClient: _nullishCoalesce(dappWalletClient, () => ( void 0)),
926
- publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkG2RDCQHLcjs.getPublicClient.call(void 0, sourceChain))),
937
+ publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkYIHOACM3cjs.getPublicClient.call(void 0, sourceChain))),
927
938
  switchChain: dappSwitchChain
928
939
  };
929
940
  }
930
941
  return {
931
942
  ownerAddress: dappWalletClient.account.address,
932
943
  walletClient: dappWalletClient,
933
- publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkG2RDCQHLcjs.getPublicClient.call(void 0, sourceChain))),
944
+ publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkYIHOACM3cjs.getPublicClient.call(void 0, sourceChain))),
934
945
  switchChain: dappSwitchChain
935
946
  };
936
947
  }
@@ -939,7 +950,7 @@ function WithdrawFlow({
939
950
  return {
940
951
  ownerAddress: dappWalletClient.account.address,
941
952
  walletClient: dappWalletClient,
942
- publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkG2RDCQHLcjs.getPublicClient.call(void 0, sourceChain))),
953
+ publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkYIHOACM3cjs.getPublicClient.call(void 0, sourceChain))),
943
954
  switchChain: dappSwitchChain
944
955
  };
945
956
  }
@@ -965,10 +976,10 @@ function WithdrawFlow({
965
976
  sourceChain
966
977
  ]);
967
978
  const asset = _react.useMemo.call(void 0, () => {
968
- const symbol = _chunkPE6OK3FHcjs.getTokenSymbol.call(void 0, sourceToken, sourceChain);
969
- const decimals = _chunkPE6OK3FHcjs.getTokenDecimalsByAddress.call(void 0, sourceToken, sourceChain);
979
+ const symbol = _chunkS4UBVD3Hcjs.getTokenSymbol.call(void 0, sourceToken, sourceChain);
980
+ const decimals = _chunkS4UBVD3Hcjs.getTokenDecimalsByAddress.call(void 0, sourceToken, sourceChain);
970
981
  return {
971
- id: _chunkG2RDCQHLcjs.getAssetId.call(void 0, { chainId: sourceChain, token: sourceToken }),
982
+ id: _chunkYIHOACM3cjs.getAssetId.call(void 0, { chainId: sourceChain, token: sourceToken }),
972
983
  chainId: sourceChain,
973
984
  token: sourceToken,
974
985
  symbol,
@@ -976,7 +987,7 @@ function WithdrawFlow({
976
987
  decimals
977
988
  };
978
989
  }, [sourceChain, sourceToken]);
979
- const isSourceNative = sourceToken.toLowerCase() === _chunkPE6OK3FHcjs.NATIVE_TOKEN_ADDRESS.toLowerCase();
990
+ const isSourceNative = sourceToken.toLowerCase() === _chunkS4UBVD3Hcjs.NATIVE_TOKEN_ADDRESS.toLowerCase();
980
991
  const stepIndex = step.type === "form" ? 0 : 1;
981
992
  const currentBackHandler = void 0;
982
993
  _react.useEffect.call(void 0, () => {
@@ -998,15 +1009,15 @@ function WithdrawFlow({
998
1009
  [onError]
999
1010
  );
1000
1011
  const resolveSessionOwner = _react.useCallback.call(void 0, async (eoaAddress) => {
1001
- const localOwner = _chunkG2RDCQHLcjs.loadSessionOwnerFromStorage.call(void 0, eoaAddress);
1012
+ const localOwner = _chunkYIHOACM3cjs.loadSessionOwnerFromStorage.call(void 0, eoaAddress);
1002
1013
  if (localOwner) {
1003
1014
  return {
1004
- account: _chunkG2RDCQHLcjs.accountFromPrivateKey.call(void 0, localOwner.privateKey),
1015
+ account: _chunkYIHOACM3cjs.accountFromPrivateKey.call(void 0, localOwner.privateKey),
1005
1016
  address: localOwner.address
1006
1017
  };
1007
1018
  }
1008
- const created = _chunkG2RDCQHLcjs.createSessionOwnerKey.call(void 0, );
1009
- _chunkG2RDCQHLcjs.saveSessionOwnerToStorage.call(void 0, eoaAddress, created.privateKey, created.address);
1019
+ const created = _chunkYIHOACM3cjs.createSessionOwnerKey.call(void 0, );
1020
+ _chunkYIHOACM3cjs.saveSessionOwnerToStorage.call(void 0, eoaAddress, created.privateKey, created.address);
1010
1021
  return {
1011
1022
  account: created.account,
1012
1023
  address: created.address
@@ -1050,7 +1061,7 @@ function WithdrawFlow({
1050
1061
  primaryType: typedData.primaryType,
1051
1062
  message: typedData.message
1052
1063
  });
1053
- const sessionDetails = _chunkG2RDCQHLcjs.buildSessionDetails.call(void 0, setup.sessionDetailsUnsigned, signature);
1064
+ const sessionDetails = _chunkYIHOACM3cjs.buildSessionDetails.call(void 0, setup.sessionDetailsUnsigned, signature);
1054
1065
  await service.registerAccount({
1055
1066
  address: smartAccount,
1056
1067
  accountParams: {
@@ -1069,7 +1080,7 @@ function WithdrawFlow({
1069
1080
  }
1070
1081
  handleConnected(ownerAddress2, smartAccount);
1071
1082
  const amountUnits = _viem.parseUnits.call(void 0, amountValue, asset.decimals);
1072
- const pc = _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess', _24 => _24.publicClient]), () => ( _chunkG2RDCQHLcjs.getPublicClient.call(void 0, sourceChain)));
1083
+ const pc = _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess', _24 => _24.publicClient]), () => ( _chunkYIHOACM3cjs.getPublicClient.call(void 0, sourceChain)));
1073
1084
  let result;
1074
1085
  if (onSignTransaction) {
1075
1086
  const transferData = isSourceNative ? { to: smartAccount, value: amountUnits, data: "0x" } : {
@@ -1137,7 +1148,7 @@ function WithdrawFlow({
1137
1148
  });
1138
1149
  } catch (err) {
1139
1150
  const raw = err instanceof Error ? err.message : "Withdraw failed";
1140
- handleError(_chunkG2RDCQHLcjs.formatUserError.call(void 0, raw), "WITHDRAW_FLOW_ERROR");
1151
+ handleError(_chunkYIHOACM3cjs.formatUserError.call(void 0, raw), "WITHDRAW_FLOW_ERROR");
1141
1152
  throw err;
1142
1153
  } finally {
1143
1154
  setIsSubmitting(false);
@@ -1176,12 +1187,12 @@ function WithdrawFlow({
1176
1187
  [onWithdrawFailed]
1177
1188
  );
1178
1189
  const targetChainOptions = _react.useMemo.call(void 0, () => {
1179
- return _chunkPE6OK3FHcjs.SOURCE_CHAINS.filter(
1180
- (chain) => _chunkPE6OK3FHcjs.getSupportedTargetTokens.call(void 0, chain.id).length > 0
1190
+ return _chunkS4UBVD3Hcjs.SOURCE_CHAINS.filter(
1191
+ (chain) => _chunkS4UBVD3Hcjs.getSupportedTargetTokens.call(void 0, chain.id).length > 0
1181
1192
  );
1182
1193
  }, []);
1183
1194
  const targetTokenOptions = _react.useMemo.call(void 0,
1184
- () => _chunkPE6OK3FHcjs.getSupportedTargetTokens.call(void 0, targetChain),
1195
+ () => _chunkS4UBVD3Hcjs.getSupportedTargetTokens.call(void 0, targetChain),
1185
1196
  [targetChain]
1186
1197
  );
1187
1198
  _react.useEffect.call(void 0, () => {
@@ -1196,7 +1207,7 @@ function WithdrawFlow({
1196
1207
  const handleTargetChainChange = _react.useCallback.call(void 0,
1197
1208
  (chainId) => {
1198
1209
  setTargetChain(chainId);
1199
- const options = _chunkPE6OK3FHcjs.getSupportedTargetTokens.call(void 0, chainId);
1210
+ const options = _chunkS4UBVD3Hcjs.getSupportedTargetTokens.call(void 0, chainId);
1200
1211
  if (options.length === 0) {
1201
1212
  return;
1202
1213
  }
@@ -1229,13 +1240,14 @@ function WithdrawFlow({
1229
1240
  }, [walletOptionsKey, selectedConnectAddressEffective]);
1230
1241
  if (showConnectStep) {
1231
1242
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1232
- _chunkG2RDCQHLcjs.ConnectStep,
1243
+ _chunkYIHOACM3cjs.ConnectStep,
1233
1244
  {
1234
1245
  walletOptions,
1235
1246
  selectedAddress: selectedConnectAddressEffective,
1236
1247
  onSelectAddress: setSelectedConnectAddress,
1237
1248
  onRequestConnect,
1238
1249
  onConnect,
1250
+ onDisconnect,
1239
1251
  onContinue: () => {
1240
1252
  if (selectedConnectAddressEffective) {
1241
1253
  setSelectedConnectAddress(selectedConnectAddressEffective);
@@ -1249,7 +1261,13 @@ function WithdrawFlow({
1249
1261
  if (!signerContext) return null;
1250
1262
  if (!onSignTransaction && !signerContext.walletClient) return null;
1251
1263
  const ownerAddress = signerContext.ownerAddress;
1252
- const formPublicClient = _nullishCoalesce(signerContext.publicClient, () => ( _chunkG2RDCQHLcjs.getPublicClient.call(void 0, sourceChain)));
1264
+ const formPublicClient = _nullishCoalesce(signerContext.publicClient, () => ( _chunkYIHOACM3cjs.getPublicClient.call(void 0, sourceChain)));
1265
+ const selectedWalletIcon = _react.useMemo.call(void 0, () => {
1266
+ const selected = walletOptions.find(
1267
+ (o) => o.address.toLowerCase() === ownerAddress.toLowerCase()
1268
+ );
1269
+ return _nullishCoalesce(_optionalChain([selected, 'optionalAccess', _28 => _28.icon]), () => ( _optionalChain([reownWallet, 'optionalAccess', _29 => _29.icon])));
1270
+ }, [walletOptions, ownerAddress, _optionalChain([reownWallet, 'optionalAccess', _30 => _30.icon])]);
1253
1271
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
1254
1272
  step.type === "form" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1255
1273
  WithdrawFormStep,
@@ -1268,20 +1286,20 @@ function WithdrawFlow({
1268
1286
  onTargetChainChange: handleTargetChainChange,
1269
1287
  onTargetTokenChange: handleTargetTokenChange,
1270
1288
  switchChain: signerContext.switchChain,
1289
+ walletIcon: selectedWalletIcon,
1271
1290
  submitting: isSubmitting,
1272
1291
  onSubmit: handleFormSubmit,
1273
1292
  onBalanceUsdChange: setTotalBalanceUsd
1274
1293
  }
1275
1294
  ),
1276
1295
  step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1277
- _chunkG2RDCQHLcjs.ProcessingStep,
1296
+ _chunkYIHOACM3cjs.ProcessingStep,
1278
1297
  {
1279
1298
  smartAccount: step.smartAccount,
1280
1299
  txHash: step.txHash,
1281
1300
  sourceChain: step.sourceChain,
1282
1301
  sourceToken: step.sourceToken,
1283
1302
  targetChain,
1284
- targetToken,
1285
1303
  amount: step.amount,
1286
1304
  waitForFinalTx,
1287
1305
  service,
@@ -1300,7 +1318,7 @@ function WithdrawFlow({
1300
1318
  // src/WithdrawModal.tsx
1301
1319
 
1302
1320
  var ReownWithdrawInner = _react.lazy.call(void 0,
1303
- () => Promise.resolve().then(() => _interopRequireWildcard(require("./WithdrawModalReown-DJCJ5U7E.cjs"))).then((m) => ({
1321
+ () => Promise.resolve().then(() => _interopRequireWildcard(require("./WithdrawModalReown-53FDOZG2.cjs"))).then((m) => ({
1304
1322
  default: m.WithdrawModalReown
1305
1323
  }))
1306
1324
  );
@@ -1326,13 +1344,14 @@ function WithdrawModalInner({
1326
1344
  isOpen,
1327
1345
  onClose,
1328
1346
  inline,
1329
- backendUrl = _chunkPE6OK3FHcjs.DEFAULT_BACKEND_URL,
1330
- signerAddress = _chunkPE6OK3FHcjs.DEFAULT_SIGNER_ADDRESS,
1347
+ backendUrl = _chunkS4UBVD3Hcjs.DEFAULT_BACKEND_URL,
1348
+ signerAddress = _chunkS4UBVD3Hcjs.DEFAULT_SIGNER_ADDRESS,
1331
1349
  sessionChainIds,
1332
1350
  forceRegister = false,
1333
1351
  waitForFinalTx = true,
1334
1352
  reownWallet,
1335
1353
  onConnect,
1354
+ onDisconnect,
1336
1355
  onSignTransaction,
1337
1356
  onRequestConnect,
1338
1357
  connectButtonLabel,
@@ -1352,19 +1371,19 @@ function WithdrawModalInner({
1352
1371
  const [currentStepIndex, setCurrentStepIndex] = _react.useState.call(void 0, 0);
1353
1372
  const [totalBalanceUsd, setTotalBalanceUsd] = _react.useState.call(void 0, null);
1354
1373
  const backHandlerRef = _react.useRef.call(void 0, void 0);
1355
- const targetChain = _chunkPE6OK3FHcjs.getChainId.call(void 0, targetChainProp);
1356
- const sourceChain = _chunkPE6OK3FHcjs.getChainId.call(void 0, sourceChainProp);
1357
- const service = _react.useMemo.call(void 0, () => _chunkG2RDCQHLcjs.createDepositService.call(void 0, backendUrl), [backendUrl]);
1374
+ const targetChain = _chunkS4UBVD3Hcjs.getChainId.call(void 0, targetChainProp);
1375
+ const sourceChain = _chunkS4UBVD3Hcjs.getChainId.call(void 0, sourceChainProp);
1376
+ const service = _react.useMemo.call(void 0, () => _chunkYIHOACM3cjs.createDepositService.call(void 0, backendUrl), [backendUrl]);
1358
1377
  _react.useEffect.call(void 0, () => {
1359
1378
  if (isOpen && modalRef.current) {
1360
- _chunkG2RDCQHLcjs.applyTheme.call(void 0, modalRef.current, theme);
1379
+ _chunkYIHOACM3cjs.applyTheme.call(void 0, modalRef.current, theme);
1361
1380
  }
1362
1381
  }, [isOpen, theme]);
1363
1382
  const hasCalledReady = _react.useRef.call(void 0, false);
1364
1383
  _react.useEffect.call(void 0, () => {
1365
1384
  if (isOpen && !hasCalledReady.current) {
1366
1385
  hasCalledReady.current = true;
1367
- _optionalChain([onReady, 'optionalCall', _28 => _28()]);
1386
+ _optionalChain([onReady, 'optionalCall', _31 => _31()]);
1368
1387
  }
1369
1388
  }, [isOpen, onReady]);
1370
1389
  _react.useEffect.call(void 0, () => {
@@ -1383,17 +1402,17 @@ function WithdrawModalInner({
1383
1402
  setTotalBalanceUsd(balance2);
1384
1403
  }, []);
1385
1404
  const handleBack = _react.useCallback.call(void 0, () => {
1386
- _optionalChain([backHandlerRef, 'access', _29 => _29.current, 'optionalCall', _30 => _30()]);
1405
+ _optionalChain([backHandlerRef, 'access', _32 => _32.current, 'optionalCall', _33 => _33()]);
1387
1406
  }, []);
1388
- const showLogo = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _31 => _31.showLogo]), () => ( false));
1389
- const showStepper = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _32 => _32.showStepper]), () => ( false));
1390
- const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _33 => _33.showBackButton]), () => ( true));
1391
- const balance = _optionalChain([uiConfig, 'optionalAccess', _34 => _34.balance]);
1392
- const logoUrl = _nullishCoalesce(_optionalChain([branding, 'optionalAccess', _35 => _35.logoUrl]), () => ( "https://github.com/rhinestonewtf.png"));
1393
- const title = _nullishCoalesce(_optionalChain([branding, 'optionalAccess', _36 => _36.title]), () => ( "Withdraw"));
1407
+ const showLogo = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _34 => _34.showLogo]), () => ( false));
1408
+ const showStepper = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _35 => _35.showStepper]), () => ( false));
1409
+ const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _36 => _36.showBackButton]), () => ( true));
1410
+ const balance = _optionalChain([uiConfig, 'optionalAccess', _37 => _37.balance]);
1411
+ const logoUrl = _nullishCoalesce(_optionalChain([branding, 'optionalAccess', _38 => _38.logoUrl]), () => ( "https://github.com/rhinestonewtf.png"));
1412
+ const title = _nullishCoalesce(_optionalChain([branding, 'optionalAccess', _39 => _39.title]), () => ( "Withdraw"));
1394
1413
  const canGoBack = currentStepIndex > 0 && currentStepIndex < 3 && backHandlerRef.current;
1395
1414
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1396
- _chunkG2RDCQHLcjs.Modal,
1415
+ _chunkYIHOACM3cjs.Modal,
1397
1416
  {
1398
1417
  isOpen,
1399
1418
  onClose,
@@ -1451,7 +1470,7 @@ function WithdrawModalInner({
1451
1470
  ] }),
1452
1471
  balance && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-header-balance", children: [
1453
1472
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-modal-header-balance-label", children: balance.title }),
1454
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-modal-header-balance-value", children: _nullishCoalesce(balance.amount, () => ( (totalBalanceUsd !== null ? _chunkG2RDCQHLcjs.currencyFormatter.format(totalBalanceUsd) : null))) })
1473
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-modal-header-balance-value", children: _nullishCoalesce(balance.amount, () => ( (totalBalanceUsd !== null ? _chunkYIHOACM3cjs.currencyFormatter.format(totalBalanceUsd) : null))) })
1455
1474
  ] })
1456
1475
  ] }),
1457
1476
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-header-nav-right", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
@@ -1501,6 +1520,7 @@ function WithdrawModalInner({
1501
1520
  waitForFinalTx,
1502
1521
  reownWallet,
1503
1522
  onConnect,
1523
+ onDisconnect,
1504
1524
  onSignTransaction,
1505
1525
  onRequestConnect,
1506
1526
  connectButtonLabel,