@rhinestone/deposit-modal 0.3.0-alpha.2 → 0.3.0-alpha.3

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.
@@ -28,7 +28,10 @@
28
28
 
29
29
 
30
30
 
31
- var _chunkFTMCKJM4cjs = require('./chunk-FTMCKJM4.cjs');
31
+
32
+
33
+
34
+ var _chunkV6NJIPSScjs = require('./chunk-V6NJIPSS.cjs');
32
35
 
33
36
 
34
37
 
@@ -252,7 +255,7 @@ function WithdrawFormStep({
252
255
  setIsSwitching(true);
253
256
  switchChain(asset.chainId).catch((err) => {
254
257
  const raw = err instanceof Error ? err.message : "Failed to switch chain";
255
- setError(_chunkFTMCKJM4cjs.formatUserError.call(void 0, raw));
258
+ setError(_chunkV6NJIPSScjs.formatUserError.call(void 0, raw));
256
259
  }).finally(() => {
257
260
  setIsSwitching(false);
258
261
  });
@@ -272,7 +275,7 @@ function WithdrawFormStep({
272
275
  return;
273
276
  }
274
277
  try {
275
- const bal = _chunkFTMCKJM4cjs.isNativeAsset.call(void 0, asset) ? await publicClient.getBalance({ address: safeAddress }) : await publicClient.readContract({
278
+ const bal = _chunkV6NJIPSScjs.isNativeAsset.call(void 0, asset) ? await publicClient.getBalance({ address: safeAddress }) : await publicClient.readContract({
276
279
  address: asset.token,
277
280
  abi: _viem.erc20Abi,
278
281
  functionName: "balanceOf",
@@ -376,7 +379,7 @@ function WithdrawFormStep({
376
379
  await onSubmit(recipient, amount);
377
380
  } catch (err) {
378
381
  const raw = err instanceof Error ? err.message : "Withdrawal failed";
379
- setError(_chunkFTMCKJM4cjs.formatUserError.call(void 0, raw));
382
+ setError(_chunkV6NJIPSScjs.formatUserError.call(void 0, raw));
380
383
  } finally {
381
384
  setIsSubmitting(false);
382
385
  }
@@ -384,16 +387,16 @@ function WithdrawFormStep({
384
387
  if (isBalanceLoading) {
385
388
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-step", children: [
386
389
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-step-body rs-withdraw-loading", children: [
387
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.Spinner, { className: "rs-spinner--lg" }),
390
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV6NJIPSScjs.Spinner, { className: "rs-spinner--lg" }),
388
391
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-withdraw-loading-title", children: "Loading on-chain balance" }),
389
392
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-withdraw-loading-subtitle", children: chainMismatch ? `Switch to ${_chunkIVTXEYB2cjs.getChainName.call(void 0, asset.chainId)} to continue.` : "Please wait before withdrawing." })
390
393
  ] }),
391
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.PoweredBy, {})
394
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV6NJIPSScjs.PoweredBy, {})
392
395
  ] });
393
396
  }
394
397
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-step", children: [
395
398
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-step-body rs-withdraw-form", children: [
396
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.CircleArrowOutUpLeftIcon, {}), title: "Withdraw" }),
399
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV6NJIPSScjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV6NJIPSScjs.CircleArrowOutUpLeftIcon, {}), title: "Withdraw" }),
397
400
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-section", children: [
398
401
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "label", { className: "rs-withdraw-label", children: "Recipient address" }),
399
402
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-input-row", children: [
@@ -431,7 +434,7 @@ function WithdrawFormStep({
431
434
  ),
432
435
  isRecipientConnected ? null : "Use connected"
433
436
  ] }) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
434
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.WalletIcon, { className: "rs-withdraw-use-connected-icon" }),
437
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV6NJIPSScjs.WalletIcon, { className: "rs-withdraw-use-connected-icon" }),
435
438
  isRecipientConnected ? null : "Use connected"
436
439
  ] })
437
440
  }
@@ -470,7 +473,7 @@ function WithdrawFormStep({
470
473
  ) })
471
474
  ] }),
472
475
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-amount-info", children: [
473
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-withdraw-usd", children: amountUsd !== null ? _chunkFTMCKJM4cjs.currencyFormatter.format(amountUsd) : "$0.00" }),
476
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-withdraw-usd", children: amountUsd !== null ? _chunkV6NJIPSScjs.currencyFormatter.format(amountUsd) : "$0.00" }),
474
477
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-withdraw-balance", children: [
475
478
  "Balance: ",
476
479
  formattedBalance,
@@ -510,7 +513,7 @@ function WithdrawFormStep({
510
513
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: targetChainName })
511
514
  ] }),
512
515
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
513
- _chunkFTMCKJM4cjs.ChevronDownIcon,
516
+ _chunkV6NJIPSScjs.ChevronDownIcon,
514
517
  {
515
518
  className: "rs-withdraw-dropdown-arrow",
516
519
  style: {
@@ -578,7 +581,7 @@ function WithdrawFormStep({
578
581
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: targetSymbol })
579
582
  ] }),
580
583
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
581
- _chunkFTMCKJM4cjs.ChevronDownIcon,
584
+ _chunkV6NJIPSScjs.ChevronDownIcon,
582
585
  {
583
586
  className: "rs-withdraw-dropdown-arrow",
584
587
  style: {
@@ -619,16 +622,16 @@ function WithdrawFormStep({
619
622
  ] }),
620
623
  chainMismatch && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-chain-switch", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-chain-switch-text", children: isSwitching ? `Switching to ${_chunkIVTXEYB2cjs.getChainName.call(void 0, asset.chainId)}...` : `Switch to ${_chunkIVTXEYB2cjs.getChainName.call(void 0, asset.chainId)} to continue.` }) }),
621
624
  error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-error", children: [
622
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.AlertTriangleIcon, {}),
625
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV6NJIPSScjs.AlertTriangleIcon, {}),
623
626
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: error })
624
627
  ] }),
625
628
  !error && registrationError && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-error", children: [
626
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.AlertTriangleIcon, {}),
629
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV6NJIPSScjs.AlertTriangleIcon, {}),
627
630
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: registrationError })
628
631
  ] })
629
632
  ] }),
630
633
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
631
- _chunkFTMCKJM4cjs.Button,
634
+ _chunkV6NJIPSScjs.Button,
632
635
  {
633
636
  onClick: handleWithdraw,
634
637
  fullWidth: true,
@@ -637,7 +640,7 @@ function WithdrawFormStep({
637
640
  children: isBusy ? "Preparing..." : registrationPending ? "Preparing session..." : !recipient ? "Enter Recipient Address" : !amount ? "Enter Withdraw Amount" : "Withdraw"
638
641
  }
639
642
  ) }),
640
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.PoweredBy, {})
643
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV6NJIPSScjs.PoweredBy, {})
641
644
  ] });
642
645
  }
643
646
  WithdrawFormStep.displayName = "WithdrawFormStep";
@@ -677,7 +680,7 @@ function WithdrawReviewStep({
677
680
  await onConfirm();
678
681
  } catch (err) {
679
682
  const raw = err instanceof Error ? err.message : "Withdraw failed";
680
- const message = _chunkFTMCKJM4cjs.formatUserError.call(void 0, raw);
683
+ const message = _chunkV6NJIPSScjs.formatUserError.call(void 0, raw);
681
684
  setError(message);
682
685
  _optionalChain([onError, 'optionalCall', _8 => _8(message, "WITHDRAW_REVIEW_ERROR")]);
683
686
  } finally {
@@ -688,9 +691,9 @@ function WithdrawReviewStep({
688
691
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
689
692
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
690
693
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
691
- _chunkFTMCKJM4cjs.BodyHeader,
694
+ _chunkV6NJIPSScjs.BodyHeader,
692
695
  {
693
- icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.CircleArrowOutUpLeftIcon, {}),
696
+ icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV6NJIPSScjs.CircleArrowOutUpLeftIcon, {}),
694
697
  title: "Review withdrawal"
695
698
  }
696
699
  ),
@@ -741,15 +744,15 @@ function WithdrawReviewStep({
741
744
  ] })
742
745
  ] }),
743
746
  error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-error", role: "alert", children: [
744
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.AlertTriangleIcon, { style: { width: 16, height: 16, flexShrink: 0 } }),
747
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV6NJIPSScjs.AlertTriangleIcon, { style: { width: 16, height: 16, flexShrink: 0 } }),
745
748
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: error })
746
749
  ] }),
747
750
  !error && registrationError && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-error", role: "alert", children: [
748
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.AlertTriangleIcon, { style: { width: 16, height: 16, flexShrink: 0 } }),
751
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV6NJIPSScjs.AlertTriangleIcon, { style: { width: 16, height: 16, flexShrink: 0 } }),
749
752
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: registrationError })
750
753
  ] }),
751
754
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
752
- _chunkFTMCKJM4cjs.Button,
755
+ _chunkV6NJIPSScjs.Button,
753
756
  {
754
757
  onClick: handleConfirm,
755
758
  loading: isSubmitting,
@@ -760,311 +763,26 @@ function WithdrawReviewStep({
760
763
  }
761
764
  )
762
765
  ] }),
763
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.PoweredBy, {})
766
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV6NJIPSScjs.PoweredBy, {})
764
767
  ] });
765
768
  }
766
769
  WithdrawReviewStep.displayName = "WithdrawReviewStep";
767
770
 
768
- // src/core/safe.ts
769
-
770
-
771
-
772
-
773
-
774
-
775
-
776
-
777
-
778
-
779
- var SAFE_ABI = [
780
- {
781
- type: "function",
782
- name: "isOwner",
783
- stateMutability: "view",
784
- inputs: [{ name: "owner", type: "address" }],
785
- outputs: [{ name: "", type: "bool" }]
786
- },
787
- {
788
- type: "function",
789
- name: "nonce",
790
- stateMutability: "view",
791
- inputs: [],
792
- outputs: [{ type: "uint256" }]
793
- },
794
- {
795
- type: "function",
796
- name: "execTransaction",
797
- stateMutability: "payable",
798
- inputs: [
799
- { name: "to", type: "address" },
800
- { name: "value", type: "uint256" },
801
- { name: "data", type: "bytes" },
802
- { name: "operation", type: "uint8" },
803
- { name: "safeTxGas", type: "uint256" },
804
- { name: "baseGas", type: "uint256" },
805
- { name: "gasPrice", type: "uint256" },
806
- { name: "gasToken", type: "address" },
807
- { name: "refundReceiver", type: "address" },
808
- { name: "signatures", type: "bytes" }
809
- ],
810
- outputs: [{ name: "success", type: "bool" }]
811
- },
812
- {
813
- type: "event",
814
- name: "ExecutionSuccess",
815
- inputs: [
816
- { name: "txHash", type: "bytes32", indexed: true },
817
- { name: "payment", type: "uint256", indexed: false }
818
- ],
819
- anonymous: false
820
- },
821
- {
822
- type: "event",
823
- name: "ExecutionFailure",
824
- inputs: [
825
- { name: "txHash", type: "bytes32", indexed: true },
826
- { name: "payment", type: "uint256", indexed: false }
827
- ],
828
- anonymous: false
829
- }
830
- ];
831
- async function executeSafeEthTransfer(params) {
832
- const {
833
- walletClient,
834
- publicClient,
835
- safeAddress,
836
- recipient,
837
- amount,
838
- chainId
839
- } = params;
840
- const account = walletClient.account;
841
- const chain = walletClient.chain;
842
- if (!account || !chain) {
843
- throw new Error("Wallet not connected");
844
- }
845
- if (chain.id !== chainId) {
846
- throw new Error(`Switch to ${_chunkIVTXEYB2cjs.getChainName.call(void 0, chainId)} to sign`);
847
- }
848
- const isOwner = await publicClient.readContract({
849
- address: safeAddress,
850
- abi: SAFE_ABI,
851
- functionName: "isOwner",
852
- args: [account.address]
853
- });
854
- if (!isOwner) {
855
- throw new Error("Connected wallet is not a Safe owner");
856
- }
857
- const safeTx = {
858
- to: recipient,
859
- value: amount,
860
- data: "0x",
861
- operation: 0,
862
- safeTxGas: 0n,
863
- baseGas: 0n,
864
- gasPrice: 0n,
865
- gasToken: _viem.zeroAddress,
866
- refundReceiver: _viem.zeroAddress
867
- };
868
- const signature = _viem.concat.call(void 0, [
869
- _viem.pad.call(void 0, account.address, { size: 32 }),
870
- _viem.pad.call(void 0, _viem.toHex.call(void 0, 0), { size: 32 }),
871
- _viem.toHex.call(void 0, 1, { size: 1 })
872
- ]);
873
- const txHash = await walletClient.writeContract({
874
- account,
875
- chain,
876
- address: safeAddress,
877
- abi: SAFE_ABI,
878
- functionName: "execTransaction",
879
- args: [
880
- safeTx.to,
881
- safeTx.value,
882
- safeTx.data,
883
- safeTx.operation,
884
- safeTx.safeTxGas,
885
- safeTx.baseGas,
886
- safeTx.gasPrice,
887
- safeTx.gasToken,
888
- safeTx.refundReceiver,
889
- signature
890
- ]
891
- });
892
- const receipt = await publicClient.waitForTransactionReceipt({
893
- hash: txHash
894
- });
895
- const safeLogs = receipt.logs.filter(
896
- (log) => log.address.toLowerCase() === safeAddress.toLowerCase()
897
- );
898
- const parsed = _viem.parseEventLogs.call(void 0, {
899
- abi: SAFE_ABI,
900
- logs: safeLogs,
901
- strict: false
902
- });
903
- const failed = parsed.find((log) => log.eventName === "ExecutionFailure");
904
- if (failed) {
905
- throw new Error("Safe transaction failed");
906
- }
907
- const succeeded = parsed.find((log) => log.eventName === "ExecutionSuccess");
908
- if (!succeeded) {
909
- throw new Error("Safe transaction status unavailable");
910
- }
911
- return { txHash };
912
- }
913
- async function executeSafeErc20Transfer(params) {
914
- const {
915
- walletClient,
916
- publicClient,
917
- safeAddress,
918
- tokenAddress,
919
- recipient,
920
- amount,
921
- chainId
922
- } = params;
923
- const account = walletClient.account;
924
- const chain = walletClient.chain;
925
- if (!account || !chain) {
926
- throw new Error("Wallet not connected");
927
- }
928
- if (chain.id !== chainId) {
929
- throw new Error(`Switch to ${_chunkIVTXEYB2cjs.getChainName.call(void 0, chainId)} to sign`);
930
- }
931
- const isOwner = await publicClient.readContract({
932
- address: safeAddress,
933
- abi: SAFE_ABI,
934
- functionName: "isOwner",
935
- args: [account.address]
936
- });
937
- if (!isOwner) {
938
- throw new Error("Connected wallet is not a Safe owner");
939
- }
940
- const data = _viem.encodeFunctionData.call(void 0, {
941
- abi: _viem.erc20Abi,
942
- functionName: "transfer",
943
- args: [recipient, amount]
944
- });
945
- const safeTx = {
946
- to: tokenAddress,
947
- value: 0n,
948
- data,
949
- operation: 0,
950
- safeTxGas: 0n,
951
- baseGas: 0n,
952
- gasPrice: 0n,
953
- gasToken: _viem.zeroAddress,
954
- refundReceiver: _viem.zeroAddress
955
- };
956
- const signature = _viem.concat.call(void 0, [
957
- _viem.pad.call(void 0, account.address, { size: 32 }),
958
- _viem.pad.call(void 0, _viem.toHex.call(void 0, 0), { size: 32 }),
959
- _viem.toHex.call(void 0, 1, { size: 1 })
960
- ]);
961
- const txHash = await walletClient.writeContract({
962
- account,
963
- chain,
964
- address: safeAddress,
965
- abi: SAFE_ABI,
966
- functionName: "execTransaction",
967
- args: [
968
- safeTx.to,
969
- safeTx.value,
970
- safeTx.data,
971
- safeTx.operation,
972
- safeTx.safeTxGas,
973
- safeTx.baseGas,
974
- safeTx.gasPrice,
975
- safeTx.gasToken,
976
- safeTx.refundReceiver,
977
- signature
978
- ]
979
- });
980
- const receipt = await publicClient.waitForTransactionReceipt({
981
- hash: txHash
982
- });
983
- const safeLogs = receipt.logs.filter(
984
- (log) => log.address.toLowerCase() === safeAddress.toLowerCase()
985
- );
986
- const parsed = _viem.parseEventLogs.call(void 0, {
987
- abi: SAFE_ABI,
988
- logs: safeLogs,
989
- strict: false
990
- });
991
- const failed = parsed.find((log) => log.eventName === "ExecutionFailure");
992
- if (failed) {
993
- throw new Error("Safe transaction failed");
994
- }
995
- const succeeded = parsed.find((log) => log.eventName === "ExecutionSuccess");
996
- if (!succeeded) {
997
- throw new Error("Safe transaction status unavailable");
998
- }
999
- return { txHash };
1000
- }
1001
- var SAFE_TX_TYPES = {
1002
- SafeTx: [
1003
- { name: "to", type: "address" },
1004
- { name: "value", type: "uint256" },
1005
- { name: "data", type: "bytes" },
1006
- { name: "operation", type: "uint8" },
1007
- { name: "safeTxGas", type: "uint256" },
1008
- { name: "baseGas", type: "uint256" },
1009
- { name: "gasPrice", type: "uint256" },
1010
- { name: "gasToken", type: "address" },
1011
- { name: "refundReceiver", type: "address" },
1012
- { name: "nonce", type: "uint256" }
1013
- ]
1014
- };
1015
- async function buildSafeTransaction(params) {
1016
- const { publicClient, safeAddress, to, value, data, chainId } = params;
1017
- const nonce = await publicClient.readContract({
1018
- address: safeAddress,
1019
- abi: SAFE_ABI,
1020
- functionName: "nonce"
1021
- });
1022
- const message = {
1023
- to,
1024
- value,
1025
- data,
1026
- operation: 0,
1027
- safeTxGas: 0n,
1028
- baseGas: 0n,
1029
- gasPrice: 0n,
1030
- gasToken: _viem.zeroAddress,
1031
- refundReceiver: _viem.zeroAddress,
1032
- nonce
1033
- };
1034
- const safeTxHash = _viem.hashTypedData.call(void 0, {
1035
- domain: { chainId, verifyingContract: safeAddress },
1036
- types: SAFE_TX_TYPES,
1037
- primaryType: "SafeTx",
1038
- message
1039
- });
1040
- return {
1041
- chainId,
1042
- safeAddress,
1043
- safeTxHash,
1044
- typedData: {
1045
- domain: { chainId, verifyingContract: safeAddress },
1046
- types: SAFE_TX_TYPES,
1047
- primaryType: "SafeTx",
1048
- message
1049
- }
1050
- };
1051
- }
1052
-
1053
771
  // src/WithdrawFlow.tsx
1054
772
 
1055
773
 
1056
774
  var ADDR_REGEX = /^0x[a-fA-F0-9]{40}$/;
1057
775
  var REGISTRATION_DEBOUNCE_MS = 600;
1058
776
  function resolveSessionOwner(eoaAddress) {
1059
- const localOwner = _chunkFTMCKJM4cjs.loadSessionOwnerFromStorage.call(void 0, eoaAddress);
777
+ const localOwner = _chunkV6NJIPSScjs.loadSessionOwnerFromStorage.call(void 0, eoaAddress);
1060
778
  if (localOwner) {
1061
779
  return {
1062
- account: _chunkFTMCKJM4cjs.accountFromPrivateKey.call(void 0, localOwner.privateKey),
780
+ account: _chunkV6NJIPSScjs.accountFromPrivateKey.call(void 0, localOwner.privateKey),
1063
781
  address: localOwner.address
1064
782
  };
1065
783
  }
1066
- const created = _chunkFTMCKJM4cjs.createSessionOwnerKey.call(void 0, );
1067
- _chunkFTMCKJM4cjs.saveSessionOwnerToStorage.call(void 0, eoaAddress, created.privateKey, created.address);
784
+ const created = _chunkV6NJIPSScjs.createSessionOwnerKey.call(void 0, );
785
+ _chunkV6NJIPSScjs.saveSessionOwnerToStorage.call(void 0, eoaAddress, created.privateKey, created.address);
1068
786
  return { account: created.account, address: created.address };
1069
787
  }
1070
788
  function targetsEqual(a, b) {
@@ -1100,19 +818,19 @@ function WithdrawFlow({
1100
818
  onError,
1101
819
  debug
1102
820
  }) {
1103
- const onStepChangeRef = _chunkFTMCKJM4cjs.useLatestRef.call(void 0, onStepChange);
1104
- const onEventRef = _chunkFTMCKJM4cjs.useLatestRef.call(void 0, onEvent);
1105
- const onLifecycleRef = _chunkFTMCKJM4cjs.useLatestRef.call(void 0, onLifecycle);
1106
- const onErrorRef = _chunkFTMCKJM4cjs.useLatestRef.call(void 0, onError);
821
+ const onStepChangeRef = _chunkV6NJIPSScjs.useLatestRef.call(void 0, onStepChange);
822
+ const onEventRef = _chunkV6NJIPSScjs.useLatestRef.call(void 0, onEvent);
823
+ const onLifecycleRef = _chunkV6NJIPSScjs.useLatestRef.call(void 0, onLifecycle);
824
+ const onErrorRef = _chunkV6NJIPSScjs.useLatestRef.call(void 0, onError);
1107
825
  const logFlow = _react.useCallback.call(void 0,
1108
826
  (message, data) => {
1109
- _chunkFTMCKJM4cjs.debugLog.call(void 0, debug, "withdraw-flow", message, data);
827
+ _chunkV6NJIPSScjs.debugLog.call(void 0, debug, "withdraw-flow", message, data);
1110
828
  },
1111
829
  [debug]
1112
830
  );
1113
831
  const logFlowError = _react.useCallback.call(void 0,
1114
832
  (message, error, data) => {
1115
- _chunkFTMCKJM4cjs.debugError.call(void 0, debug, "withdraw-flow", message, error, data);
833
+ _chunkV6NJIPSScjs.debugError.call(void 0, debug, "withdraw-flow", message, error, data);
1116
834
  },
1117
835
  [debug]
1118
836
  );
@@ -1187,14 +905,14 @@ function WithdrawFlow({
1187
905
  return {
1188
906
  ownerAddress: dappAddress,
1189
907
  walletClient: _nullishCoalesce(dappWalletClient, () => ( void 0)),
1190
- publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkFTMCKJM4cjs.getPublicClient.call(void 0, sourceChain))),
908
+ publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkV6NJIPSScjs.getPublicClient.call(void 0, sourceChain))),
1191
909
  switchChain: dappSwitchChain
1192
910
  };
1193
911
  }
1194
912
  return {
1195
913
  ownerAddress: dappWalletClient.account.address,
1196
914
  walletClient: dappWalletClient,
1197
- publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkFTMCKJM4cjs.getPublicClient.call(void 0, sourceChain))),
915
+ publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkV6NJIPSScjs.getPublicClient.call(void 0, sourceChain))),
1198
916
  switchChain: dappSwitchChain
1199
917
  };
1200
918
  }
@@ -1205,7 +923,7 @@ function WithdrawFlow({
1205
923
  return {
1206
924
  ownerAddress: dappWalletClient.account.address,
1207
925
  walletClient: dappWalletClient,
1208
- publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkFTMCKJM4cjs.getPublicClient.call(void 0, sourceChain))),
926
+ publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkV6NJIPSScjs.getPublicClient.call(void 0, sourceChain))),
1209
927
  switchChain: dappSwitchChain
1210
928
  };
1211
929
  }
@@ -1262,7 +980,7 @@ function WithdrawFlow({
1262
980
  const setup = await service.setupAccount({
1263
981
  ownerAddress,
1264
982
  sessionOwnerAddress: sessionOwner.address,
1265
- targetChain: _chunkFTMCKJM4cjs.toEvmCaip2.call(void 0, targetChain),
983
+ targetChain: _chunkV6NJIPSScjs.toEvmCaip2.call(void 0, targetChain),
1266
984
  targetToken,
1267
985
  recipient: recipientForRegistration,
1268
986
  signerAddress,
@@ -1287,7 +1005,7 @@ function WithdrawFlow({
1287
1005
  message: typedData.message
1288
1006
  });
1289
1007
  if (cancelled) return;
1290
- const sessionDetails = _chunkFTMCKJM4cjs.buildSessionDetails.call(void 0,
1008
+ const sessionDetails = _chunkV6NJIPSScjs.buildSessionDetails.call(void 0,
1291
1009
  setup.sessionDetailsUnsigned,
1292
1010
  signature
1293
1011
  );
@@ -1301,7 +1019,7 @@ function WithdrawFlow({
1301
1019
  eoaAddress: ownerAddress,
1302
1020
  sessionOwner: sessionOwner.address,
1303
1021
  target: {
1304
- chain: _chunkFTMCKJM4cjs.toEvmCaip2.call(void 0, targetChain),
1022
+ chain: _chunkV6NJIPSScjs.toEvmCaip2.call(void 0, targetChain),
1305
1023
  token: targetToken,
1306
1024
  recipient: recipientForRegistration
1307
1025
  }
@@ -1324,7 +1042,7 @@ function WithdrawFlow({
1324
1042
  } catch (err) {
1325
1043
  if (cancelled) return;
1326
1044
  const raw = err instanceof Error ? err.message : "Registration failed";
1327
- const message = _chunkFTMCKJM4cjs.formatUserError.call(void 0, raw);
1045
+ const message = _chunkV6NJIPSScjs.formatUserError.call(void 0, raw);
1328
1046
  logFlowError("auto-register:failed", err, {
1329
1047
  ownerAddress,
1330
1048
  targetChain,
@@ -1360,7 +1078,7 @@ function WithdrawFlow({
1360
1078
  const symbol = _chunkIVTXEYB2cjs.getTokenSymbol.call(void 0, sourceToken, sourceChain);
1361
1079
  const decimals = _chunkIVTXEYB2cjs.getTokenDecimalsByAddress.call(void 0, sourceToken, sourceChain);
1362
1080
  return {
1363
- id: _chunkFTMCKJM4cjs.getAssetId.call(void 0, { chainId: sourceChain, token: sourceToken }),
1081
+ id: _chunkV6NJIPSScjs.getAssetId.call(void 0, { chainId: sourceChain, token: sourceToken }),
1364
1082
  chainId: sourceChain,
1365
1083
  token: sourceToken,
1366
1084
  symbol,
@@ -1468,7 +1186,7 @@ function WithdrawFlow({
1468
1186
  targetToken
1469
1187
  });
1470
1188
  const amountUnits = _viem.parseUnits.call(void 0, amountValue, asset.decimals);
1471
- const pc = _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess', _44 => _44.publicClient]), () => ( _chunkFTMCKJM4cjs.getPublicClient.call(void 0, sourceChain)));
1189
+ const pc = _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess', _44 => _44.publicClient]), () => ( _chunkV6NJIPSScjs.getPublicClient.call(void 0, sourceChain)));
1472
1190
  let result;
1473
1191
  if (onSignTransaction) {
1474
1192
  const transferTarget = isSameRoute ? recipient : smartAccount;
@@ -1481,7 +1199,7 @@ function WithdrawFlow({
1481
1199
  args: [transferTarget, amountUnits]
1482
1200
  })
1483
1201
  };
1484
- const request = await buildSafeTransaction({
1202
+ const request = await _chunkV6NJIPSScjs.buildSafeTransaction.call(void 0, {
1485
1203
  publicClient: pc,
1486
1204
  safeAddress,
1487
1205
  to: transferData.to,
@@ -1492,7 +1210,7 @@ function WithdrawFlow({
1492
1210
  const { signature } = await onSignTransaction(request);
1493
1211
  const relayResult = await service.relayWithdraw({
1494
1212
  smartAccount,
1495
- chainId: _chunkFTMCKJM4cjs.toEvmCaip2.call(void 0, sourceChain),
1213
+ chainId: _chunkV6NJIPSScjs.toEvmCaip2.call(void 0, sourceChain),
1496
1214
  safeAddress,
1497
1215
  safeTransaction: request.typedData.message,
1498
1216
  signature
@@ -1502,7 +1220,7 @@ function WithdrawFlow({
1502
1220
  }
1503
1221
  result = { txHash: relayResult.txHash };
1504
1222
  } else if (isSourceNative) {
1505
- result = await executeSafeEthTransfer({
1223
+ result = await _chunkV6NJIPSScjs.executeSafeEthTransfer.call(void 0, {
1506
1224
  walletClient: signerContext.walletClient,
1507
1225
  publicClient: pc,
1508
1226
  safeAddress,
@@ -1511,7 +1229,7 @@ function WithdrawFlow({
1511
1229
  chainId: sourceChain
1512
1230
  });
1513
1231
  } else {
1514
- result = await executeSafeErc20Transfer({
1232
+ result = await _chunkV6NJIPSScjs.executeSafeErc20Transfer.call(void 0, {
1515
1233
  walletClient: signerContext.walletClient,
1516
1234
  publicClient: pc,
1517
1235
  safeAddress,
@@ -1544,7 +1262,7 @@ function WithdrawFlow({
1544
1262
  targetChain,
1545
1263
  targetToken
1546
1264
  });
1547
- handleError(_chunkFTMCKJM4cjs.formatUserError.call(void 0, raw), "WITHDRAW_FLOW_ERROR");
1265
+ handleError(_chunkV6NJIPSScjs.formatUserError.call(void 0, raw), "WITHDRAW_FLOW_ERROR");
1548
1266
  throw err;
1549
1267
  }
1550
1268
  },
@@ -1670,10 +1388,18 @@ function WithdrawFlow({
1670
1388
  return _optionalChain([selected, 'optionalAccess', _58 => _58.kind]) === "external" ? _nullishCoalesce(selected.icon, () => ( _optionalChain([reownWallet, 'optionalAccess', _59 => _59.icon]))) : void 0;
1671
1389
  }, [walletOptions, ownerAddress, _optionalChain([reownWallet, 'optionalAccess', _60 => _60.icon])]);
1672
1390
  if (showConnectStep) {
1391
+ const withdrawRows = walletOptions.map((option) => ({
1392
+ id: option.id,
1393
+ kind: option.kind,
1394
+ label: option.label,
1395
+ icon: option.icon,
1396
+ address: _nullishCoalesce(_nullishCoalesce(option.address, () => ( option.solanaAddress)), () => ( option.id)),
1397
+ state: "ready"
1398
+ }));
1673
1399
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1674
- _chunkFTMCKJM4cjs.ConnectStep,
1400
+ _chunkV6NJIPSScjs.ConnectStep,
1675
1401
  {
1676
- walletOptions,
1402
+ walletRows: withdrawRows,
1677
1403
  onConfirmWallet: (walletId) => {
1678
1404
  setSelectedWalletId(walletId);
1679
1405
  setIsConnectSelectionConfirmed(true);
@@ -1689,7 +1415,7 @@ function WithdrawFlow({
1689
1415
  if (!signerContext) return null;
1690
1416
  if (!onSignTransaction && !signerContext.walletClient) return null;
1691
1417
  const resolvedConnectedRecipient = _optionalChain([selectedWalletOption, 'optionalAccess', _61 => _61.kind]) === "external" ? selectedWalletOption.address : void 0;
1692
- const formPublicClient = _nullishCoalesce(signerContext.publicClient, () => ( _chunkFTMCKJM4cjs.getPublicClient.call(void 0, sourceChain)));
1418
+ const formPublicClient = _nullishCoalesce(signerContext.publicClient, () => ( _chunkV6NJIPSScjs.getPublicClient.call(void 0, sourceChain)));
1693
1419
  const stepView = deriveStepView(flowStep, registration);
1694
1420
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
1695
1421
  stepView === "form" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
@@ -1733,7 +1459,7 @@ function WithdrawFlow({
1733
1459
  }
1734
1460
  ),
1735
1461
  stepView === "processing" && registration.kind !== "idle" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1736
- _chunkFTMCKJM4cjs.ProcessingStep,
1462
+ _chunkV6NJIPSScjs.ProcessingStep,
1737
1463
  {
1738
1464
  smartAccount: registration.kind === "ready" || registration.kind === "stale" ? registration.smartAccount : "0x0",
1739
1465
  txHash: _nullishCoalesce(storeApi.getState().txHash, () => ( "0x0")),
@@ -1767,7 +1493,7 @@ function deriveStepView(step, _registration) {
1767
1493
  // src/WithdrawModal.tsx
1768
1494
 
1769
1495
  var ReownWithdrawInner = _react.lazy.call(void 0,
1770
- () => Promise.resolve().then(() => _interopRequireWildcard(require("./WithdrawModalReown-K52AK53K.cjs"))).then((m) => ({
1496
+ () => Promise.resolve().then(() => _interopRequireWildcard(require("./WithdrawModalReown-KGFCNAJP.cjs"))).then((m) => ({
1771
1497
  default: m.WithdrawModalReown
1772
1498
  }))
1773
1499
  );
@@ -1815,18 +1541,18 @@ function WithdrawModalInner({
1815
1541
  debug
1816
1542
  }) {
1817
1543
  const modalRef = _react.useRef.call(void 0, null);
1818
- const onReadyRef = _chunkFTMCKJM4cjs.useLatestRef.call(void 0, onReady);
1544
+ const onReadyRef = _chunkV6NJIPSScjs.useLatestRef.call(void 0, onReady);
1819
1545
  const [backHandler, setBackHandler] = _react.useState.call(void 0,
1820
1546
  void 0
1821
1547
  );
1822
1548
  const targetChain = _chunkIVTXEYB2cjs.getChainId.call(void 0, targetChainProp);
1823
1549
  const sourceChain = _chunkIVTXEYB2cjs.getChainId.call(void 0, sourceChainProp);
1824
1550
  const service = _react.useMemo.call(void 0,
1825
- () => _chunkFTMCKJM4cjs.createDepositService.call(void 0, backendUrl, { debug, debugScope: "service:withdraw" }),
1551
+ () => _chunkV6NJIPSScjs.createDepositService.call(void 0, backendUrl, { debug, debugScope: "service:withdraw" }),
1826
1552
  [backendUrl, debug]
1827
1553
  );
1828
1554
  const store = _react.useMemo.call(void 0, () => createWithdrawStore(), []);
1829
- const onErrorRef = _chunkFTMCKJM4cjs.useLatestRef.call(void 0, onError);
1555
+ const onErrorRef = _chunkV6NJIPSScjs.useLatestRef.call(void 0, onError);
1830
1556
  _react.useEffect.call(void 0, () => {
1831
1557
  if (isOpen && onSignTransaction && !dappAddress) {
1832
1558
  _optionalChain([onErrorRef, 'access', _62 => _62.current, 'optionalCall', _63 => _63({
@@ -1837,7 +1563,7 @@ function WithdrawModalInner({
1837
1563
  }, [isOpen, onSignTransaction, dappAddress, onErrorRef]);
1838
1564
  _react.useEffect.call(void 0, () => {
1839
1565
  if (isOpen && modalRef.current) {
1840
- _chunkFTMCKJM4cjs.applyTheme.call(void 0, modalRef.current, theme);
1566
+ _chunkV6NJIPSScjs.applyTheme.call(void 0, modalRef.current, theme);
1841
1567
  }
1842
1568
  }, [isOpen, theme]);
1843
1569
  _react.useEffect.call(void 0, () => {
@@ -1856,7 +1582,7 @@ function WithdrawModalInner({
1856
1582
  const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _66 => _66.showBackButton]), () => ( true));
1857
1583
  const canGoBack = backHandler !== void 0;
1858
1584
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, WithdrawStoreProvider, { store, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1859
- _chunkFTMCKJM4cjs.Modal,
1585
+ _chunkV6NJIPSScjs.Modal,
1860
1586
  {
1861
1587
  isOpen,
1862
1588
  onClose,
@@ -1872,7 +1598,7 @@ function WithdrawModalInner({
1872
1598
  className: "rs-modal-header-back",
1873
1599
  "aria-label": "Go back",
1874
1600
  onClick: backHandler,
1875
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.ChevronLeftIcon, {})
1601
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV6NJIPSScjs.ChevronLeftIcon, {})
1876
1602
  }
1877
1603
  ) }),
1878
1604
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-header-nav-right", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
@@ -1882,7 +1608,7 @@ function WithdrawModalInner({
1882
1608
  onClick: onClose,
1883
1609
  className: "rs-modal-close",
1884
1610
  "aria-label": "Close",
1885
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.CloseIcon, {})
1611
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV6NJIPSScjs.CloseIcon, {})
1886
1612
  }
1887
1613
  ) })
1888
1614
  ] }),