@rhinestone/deposit-modal 0.4.3 → 0.5.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.
- package/dist/{DepositModalReown-MCDIOJLT.cjs → DepositModalReown-HWKF3O62.cjs} +7 -6
- package/dist/{DepositModalReown-ORSBSEMO.mjs → DepositModalReown-YJBDBCRA.mjs} +4 -3
- package/dist/{WithdrawModalReown-XPB53FKZ.mjs → WithdrawModalReown-AQTB4OZN.mjs} +12 -4
- package/dist/{WithdrawModalReown-KKGW62YO.cjs → WithdrawModalReown-USNQEAEM.cjs} +14 -6
- package/dist/{chunk-7EQQD7B4.mjs → chunk-4YLVKTSU.mjs} +60 -16
- package/dist/{chunk-36R7XKXP.cjs → chunk-AMEXFHB4.cjs} +380 -338
- package/dist/{chunk-PQDHZZ2B.cjs → chunk-HT364QJK.cjs} +28 -6
- package/dist/{chunk-IDJBMNV2.mjs → chunk-KYHPKMTK.mjs} +19 -11
- package/dist/{chunk-EDUWRMQI.cjs → chunk-PDFLALUT.cjs} +132 -88
- package/dist/{chunk-V72YVCR6.mjs → chunk-QEW5NAGV.mjs} +28 -6
- package/dist/{chunk-3NZUMDST.cjs → chunk-V4XVFT25.cjs} +66 -58
- package/dist/{chunk-ANPDY6NJ.mjs → chunk-XPJJWJPM.mjs} +86 -44
- package/dist/deposit.cjs +3 -3
- package/dist/deposit.d.cts +2 -2
- package/dist/deposit.d.ts +2 -2
- package/dist/deposit.mjs +2 -2
- package/dist/index.cjs +4 -4
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +3 -3
- package/dist/styles.css +80 -40
- package/dist/{types-CUOqIIvZ.d.cts → types-_m8w8BYq.d.cts} +29 -2
- package/dist/{types-CUOqIIvZ.d.ts → types-_m8w8BYq.d.ts} +29 -2
- package/dist/withdraw.cjs +3 -3
- package/dist/withdraw.d.cts +2 -2
- package/dist/withdraw.d.ts +2 -2
- package/dist/withdraw.mjs +2 -2
- package/package.json +9 -8
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
|
-
isUnsupportedChainSwitchError
|
|
3
|
-
|
|
2
|
+
isUnsupportedChainSwitchError,
|
|
3
|
+
rpcUrlFor
|
|
4
|
+
} from "./chunk-4YLVKTSU.mjs";
|
|
4
5
|
import {
|
|
5
6
|
SUPPORTED_CHAINS,
|
|
6
7
|
getChainName
|
|
@@ -23,6 +24,7 @@ import {
|
|
|
23
24
|
} from "@reown/appkit/react";
|
|
24
25
|
import { solana } from "@reown/appkit/networks";
|
|
25
26
|
import { useWalletClient, usePublicClient, useSwitchChain } from "wagmi";
|
|
27
|
+
import { http } from "viem";
|
|
26
28
|
|
|
27
29
|
// src/core/reown-networks.ts
|
|
28
30
|
import {
|
|
@@ -70,6 +72,20 @@ function getAppKitNetwork(chainId) {
|
|
|
70
72
|
|
|
71
73
|
// src/core/reown.tsx
|
|
72
74
|
import { jsx } from "react/jsx-runtime";
|
|
75
|
+
function buildTransports(rpcUrls) {
|
|
76
|
+
const transports = {};
|
|
77
|
+
for (const network of EVM_NETWORKS) {
|
|
78
|
+
const id = Number(network.id);
|
|
79
|
+
transports[id] = http(rpcUrlFor(rpcUrls, id));
|
|
80
|
+
}
|
|
81
|
+
return transports;
|
|
82
|
+
}
|
|
83
|
+
function getEvmRpcFingerprint(rpcUrls) {
|
|
84
|
+
return EVM_NETWORKS.map((network) => {
|
|
85
|
+
const id = Number(network.id);
|
|
86
|
+
return `${id}=${rpcUrlFor(rpcUrls, id) ?? ""}`;
|
|
87
|
+
}).join("|");
|
|
88
|
+
}
|
|
73
89
|
var cachedAdapter = null;
|
|
74
90
|
var cachedAdapterKey = null;
|
|
75
91
|
function mapTheme(theme) {
|
|
@@ -80,12 +96,17 @@ function mapTheme(theme) {
|
|
|
80
96
|
}
|
|
81
97
|
return { themeMode, themeVariables };
|
|
82
98
|
}
|
|
83
|
-
function getOrCreateAdapter(projectId, enableSolana, theme) {
|
|
84
|
-
const adapterKey =
|
|
99
|
+
function getOrCreateAdapter(projectId, enableSolana, theme, rpcUrls) {
|
|
100
|
+
const adapterKey = [
|
|
101
|
+
projectId,
|
|
102
|
+
enableSolana ? "solana" : "evm",
|
|
103
|
+
getEvmRpcFingerprint(rpcUrls)
|
|
104
|
+
].join(":");
|
|
85
105
|
if (cachedAdapter && cachedAdapterKey === adapterKey) return cachedAdapter;
|
|
86
106
|
cachedAdapter = new WagmiAdapter({
|
|
87
107
|
networks: EVM_NETWORKS,
|
|
88
|
-
projectId
|
|
108
|
+
projectId,
|
|
109
|
+
transports: buildTransports(rpcUrls)
|
|
89
110
|
});
|
|
90
111
|
cachedAdapterKey = adapterKey;
|
|
91
112
|
const { themeMode, themeVariables } = mapTheme(theme);
|
|
@@ -110,10 +131,11 @@ function ReownWalletProvider({
|
|
|
110
131
|
projectId,
|
|
111
132
|
theme,
|
|
112
133
|
enableSolana = true,
|
|
134
|
+
rpcUrls,
|
|
113
135
|
children
|
|
114
136
|
}) {
|
|
115
137
|
const [queryClient] = useState(() => new QueryClient());
|
|
116
|
-
const adapter = getOrCreateAdapter(projectId, enableSolana, theme);
|
|
138
|
+
const adapter = getOrCreateAdapter(projectId, enableSolana, theme, rpcUrls);
|
|
117
139
|
const config = adapter.wagmiConfig;
|
|
118
140
|
return /* @__PURE__ */ jsx(WagmiProvider, { config, children: /* @__PURE__ */ jsx(QueryClientProvider, { client: queryClient, children }) });
|
|
119
141
|
}
|
|
@@ -30,7 +30,10 @@
|
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
var _chunkPDFLALUTcjs = require('./chunk-PDFLALUT.cjs');
|
|
34
37
|
|
|
35
38
|
|
|
36
39
|
|
|
@@ -261,7 +264,7 @@ function WithdrawFormStep({
|
|
|
261
264
|
setIsSwitching(true);
|
|
262
265
|
switchChain(asset.chainId).catch((err) => {
|
|
263
266
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
264
|
-
setError(
|
|
267
|
+
setError(_chunkPDFLALUTcjs.formatUserError.call(void 0, raw));
|
|
265
268
|
}).finally(() => {
|
|
266
269
|
setIsSwitching(false);
|
|
267
270
|
});
|
|
@@ -281,7 +284,7 @@ function WithdrawFormStep({
|
|
|
281
284
|
return;
|
|
282
285
|
}
|
|
283
286
|
try {
|
|
284
|
-
const bal =
|
|
287
|
+
const bal = _chunkPDFLALUTcjs.isNativeAsset.call(void 0, asset) ? await publicClient.getBalance({ address: safeAddress }) : await publicClient.readContract({
|
|
285
288
|
address: asset.token,
|
|
286
289
|
abi: _viem.erc20Abi,
|
|
287
290
|
functionName: "balanceOf",
|
|
@@ -392,7 +395,7 @@ function WithdrawFormStep({
|
|
|
392
395
|
await onSubmit(recipient, amount);
|
|
393
396
|
} catch (err) {
|
|
394
397
|
const raw = err instanceof Error ? err.message : "Withdrawal failed";
|
|
395
|
-
setError(
|
|
398
|
+
setError(_chunkPDFLALUTcjs.formatUserError.call(void 0, raw));
|
|
396
399
|
} finally {
|
|
397
400
|
setIsSubmitting(false);
|
|
398
401
|
}
|
|
@@ -408,16 +411,16 @@ function WithdrawFormStep({
|
|
|
408
411
|
if (isBalanceLoading) {
|
|
409
412
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
410
413
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-withdraw-loading", children: [
|
|
411
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
414
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.Spinner, { className: "rs-spinner--lg" }),
|
|
412
415
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-withdraw-loading-title", children: "Loading on-chain balance" }),
|
|
413
416
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-withdraw-loading-subtitle", children: chainMismatch ? `Switch to ${_chunkABVRVW3Pcjs.getChainName.call(void 0, asset.chainId)} to continue.` : "Please wait before withdrawing." })
|
|
414
417
|
] }),
|
|
415
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
418
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.PoweredBy, {})
|
|
416
419
|
] });
|
|
417
420
|
}
|
|
418
421
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
419
422
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
420
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
423
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.CircleArrowOutUpLeftIcon, {}), title: "Withdraw" }),
|
|
421
424
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-section", children: [
|
|
422
425
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
423
426
|
"label",
|
|
@@ -463,7 +466,7 @@ function WithdrawFormStep({
|
|
|
463
466
|
),
|
|
464
467
|
isRecipientConnected ? null : "Use connected"
|
|
465
468
|
] }) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
466
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
469
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.WalletIcon, { className: "rs-withdraw-use-connected-icon" }),
|
|
467
470
|
isRecipientConnected ? null : "Use connected"
|
|
468
471
|
] })
|
|
469
472
|
}
|
|
@@ -503,7 +506,7 @@ function WithdrawFormStep({
|
|
|
503
506
|
) })
|
|
504
507
|
] }),
|
|
505
508
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-amount-info", children: [
|
|
506
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-withdraw-usd", children: amountUsd !== null ?
|
|
509
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-withdraw-usd", children: amountUsd !== null ? _chunkPDFLALUTcjs.currencyFormatter.format(amountUsd) : "$0.00" }),
|
|
507
510
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-withdraw-balance", children: [
|
|
508
511
|
"Balance: ",
|
|
509
512
|
formattedBalance,
|
|
@@ -544,7 +547,7 @@ function WithdrawFormStep({
|
|
|
544
547
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: targetChainName })
|
|
545
548
|
] }),
|
|
546
549
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
547
|
-
|
|
550
|
+
_chunkPDFLALUTcjs.ChevronDownIcon,
|
|
548
551
|
{
|
|
549
552
|
className: "rs-withdraw-dropdown-arrow",
|
|
550
553
|
style: {
|
|
@@ -613,7 +616,7 @@ function WithdrawFormStep({
|
|
|
613
616
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: targetSymbol })
|
|
614
617
|
] }),
|
|
615
618
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
616
|
-
|
|
619
|
+
_chunkPDFLALUTcjs.ChevronDownIcon,
|
|
617
620
|
{
|
|
618
621
|
className: "rs-withdraw-dropdown-arrow",
|
|
619
622
|
style: {
|
|
@@ -653,10 +656,10 @@ function WithdrawFormStep({
|
|
|
653
656
|
] })
|
|
654
657
|
] }),
|
|
655
658
|
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 ${_chunkABVRVW3Pcjs.getChainName.call(void 0, asset.chainId)}...` : `Switch to ${_chunkABVRVW3Pcjs.getChainName.call(void 0, asset.chainId)} to continue.` }) }),
|
|
656
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
657
|
-
!error && registrationError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
659
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.Callout, { variant: "error", children: error }),
|
|
660
|
+
!error && registrationError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.Callout, { variant: "error", children: registrationError }),
|
|
658
661
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
659
|
-
|
|
662
|
+
_chunkPDFLALUTcjs.Button,
|
|
660
663
|
{
|
|
661
664
|
onClick: handleWithdraw,
|
|
662
665
|
fullWidth: true,
|
|
@@ -666,7 +669,7 @@ function WithdrawFormStep({
|
|
|
666
669
|
}
|
|
667
670
|
)
|
|
668
671
|
] }),
|
|
669
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
672
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.PoweredBy, {})
|
|
670
673
|
] });
|
|
671
674
|
}
|
|
672
675
|
WithdrawFormStep.displayName = "WithdrawFormStep";
|
|
@@ -701,9 +704,9 @@ function WithdrawReviewStep({
|
|
|
701
704
|
const sourceTokenIcon = _chunkABVRVW3Pcjs.getTokenIcon.call(void 0, sourceSymbol);
|
|
702
705
|
const targetTokenIcon = _chunkABVRVW3Pcjs.getTokenIcon.call(void 0, targetSymbol);
|
|
703
706
|
const amountNumber = Number(amount);
|
|
704
|
-
const formattedSendAmount = _nullishCoalesce(
|
|
705
|
-
const prices =
|
|
706
|
-
const receiveDisplay = _nullishCoalesce(
|
|
707
|
+
const formattedSendAmount = _nullishCoalesce(_chunkPDFLALUTcjs.formatTokenAmount.call(void 0, amountNumber, sourceSymbol), () => ( amount));
|
|
708
|
+
const prices = _chunkPDFLALUTcjs.useTokenPrices.call(void 0, service, [sourceSymbol, targetSymbol]);
|
|
709
|
+
const receiveDisplay = _nullishCoalesce(_chunkPDFLALUTcjs.formatReceiveEstimate.call(void 0, {
|
|
707
710
|
sourceAmount: Number.isFinite(amountNumber) ? amountNumber : void 0,
|
|
708
711
|
sourceSymbol,
|
|
709
712
|
targetSymbol,
|
|
@@ -717,7 +720,7 @@ function WithdrawReviewStep({
|
|
|
717
720
|
await onConfirm();
|
|
718
721
|
} catch (err) {
|
|
719
722
|
const raw = err instanceof Error ? err.message : "Withdraw failed";
|
|
720
|
-
const message =
|
|
723
|
+
const message = _chunkPDFLALUTcjs.formatUserError.call(void 0, raw);
|
|
721
724
|
setError(message);
|
|
722
725
|
_optionalChain([onError, 'optionalCall', _10 => _10(message, "WITHDRAW_REVIEW_ERROR")]);
|
|
723
726
|
} finally {
|
|
@@ -728,9 +731,9 @@ function WithdrawReviewStep({
|
|
|
728
731
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
729
732
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
730
733
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
731
|
-
|
|
734
|
+
_chunkPDFLALUTcjs.BodyHeader,
|
|
732
735
|
{
|
|
733
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
736
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.CircleArrowOutUpLeftIcon, {}),
|
|
734
737
|
title: "Review withdrawal"
|
|
735
738
|
}
|
|
736
739
|
),
|
|
@@ -776,10 +779,10 @@ function WithdrawReviewStep({
|
|
|
776
779
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-value", children: estimatedTime })
|
|
777
780
|
] })
|
|
778
781
|
] }),
|
|
779
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
780
|
-
!error && registrationError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
782
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.Callout, { variant: "error", children: error }),
|
|
783
|
+
!error && registrationError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.Callout, { variant: "error", children: registrationError }),
|
|
781
784
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
782
|
-
|
|
785
|
+
_chunkPDFLALUTcjs.Button,
|
|
783
786
|
{
|
|
784
787
|
onClick: handleConfirm,
|
|
785
788
|
loading: isSubmitting,
|
|
@@ -790,7 +793,7 @@ function WithdrawReviewStep({
|
|
|
790
793
|
}
|
|
791
794
|
)
|
|
792
795
|
] }),
|
|
793
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
796
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.PoweredBy, {})
|
|
794
797
|
] });
|
|
795
798
|
}
|
|
796
799
|
WithdrawReviewStep.displayName = "WithdrawReviewStep";
|
|
@@ -802,15 +805,15 @@ var ADDR_REGEX = /^0x[a-fA-F0-9]{40}$/;
|
|
|
802
805
|
var REGISTRATION_DEBOUNCE_MS = 600;
|
|
803
806
|
var WITHDRAW_INDEXING_DELAY_MS = 2e3;
|
|
804
807
|
function resolveSessionOwner(eoaAddress) {
|
|
805
|
-
const localOwner =
|
|
808
|
+
const localOwner = _chunkPDFLALUTcjs.loadSessionOwnerFromStorage.call(void 0, eoaAddress);
|
|
806
809
|
if (localOwner) {
|
|
807
810
|
return {
|
|
808
|
-
account:
|
|
811
|
+
account: _chunkPDFLALUTcjs.accountFromPrivateKey.call(void 0, localOwner.privateKey),
|
|
809
812
|
address: localOwner.address
|
|
810
813
|
};
|
|
811
814
|
}
|
|
812
|
-
const created =
|
|
813
|
-
|
|
815
|
+
const created = _chunkPDFLALUTcjs.createSessionOwnerKey.call(void 0, );
|
|
816
|
+
_chunkPDFLALUTcjs.saveSessionOwnerToStorage.call(void 0, eoaAddress, created.privateKey, created.address);
|
|
814
817
|
return { account: created.account, address: created.address };
|
|
815
818
|
}
|
|
816
819
|
function targetsEqual(a, b) {
|
|
@@ -845,10 +848,11 @@ function WithdrawFlow({
|
|
|
845
848
|
onError,
|
|
846
849
|
debug
|
|
847
850
|
}) {
|
|
848
|
-
const
|
|
849
|
-
const
|
|
850
|
-
const
|
|
851
|
-
const
|
|
851
|
+
const rpcUrls = _chunkPDFLALUTcjs.useRpcUrls.call(void 0, );
|
|
852
|
+
const onStepChangeRef = _chunkPDFLALUTcjs.useLatestRef.call(void 0, onStepChange);
|
|
853
|
+
const onEventRef = _chunkPDFLALUTcjs.useLatestRef.call(void 0, onEvent);
|
|
854
|
+
const onLifecycleRef = _chunkPDFLALUTcjs.useLatestRef.call(void 0, onLifecycle);
|
|
855
|
+
const onErrorRef = _chunkPDFLALUTcjs.useLatestRef.call(void 0, onError);
|
|
852
856
|
const isFlowActiveRef = _react.useRef.call(void 0, true);
|
|
853
857
|
const submitGenerationRef = _react.useRef.call(void 0, 0);
|
|
854
858
|
_react.useEffect.call(void 0, () => {
|
|
@@ -859,13 +863,13 @@ function WithdrawFlow({
|
|
|
859
863
|
}, []);
|
|
860
864
|
const logFlow = _react.useCallback.call(void 0,
|
|
861
865
|
(message, data) => {
|
|
862
|
-
|
|
866
|
+
_chunkPDFLALUTcjs.debugLog.call(void 0, debug, "withdraw-flow", message, data);
|
|
863
867
|
},
|
|
864
868
|
[debug]
|
|
865
869
|
);
|
|
866
870
|
const logFlowError = _react.useCallback.call(void 0,
|
|
867
871
|
(message, error, data) => {
|
|
868
|
-
|
|
872
|
+
_chunkPDFLALUTcjs.debugError.call(void 0, debug, "withdraw-flow", message, error, data);
|
|
869
873
|
},
|
|
870
874
|
[debug]
|
|
871
875
|
);
|
|
@@ -941,14 +945,14 @@ function WithdrawFlow({
|
|
|
941
945
|
return {
|
|
942
946
|
ownerAddress: dappAddress,
|
|
943
947
|
walletClient: _nullishCoalesce(dappWalletClient, () => ( void 0)),
|
|
944
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
948
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkPDFLALUTcjs.getPublicClient.call(void 0, sourceChain, rpcUrls))),
|
|
945
949
|
switchChain: dappSwitchChain
|
|
946
950
|
};
|
|
947
951
|
}
|
|
948
952
|
return {
|
|
949
953
|
ownerAddress: dappWalletClient.account.address,
|
|
950
954
|
walletClient: dappWalletClient,
|
|
951
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
955
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkPDFLALUTcjs.getPublicClient.call(void 0, sourceChain, rpcUrls))),
|
|
952
956
|
switchChain: dappSwitchChain
|
|
953
957
|
};
|
|
954
958
|
}
|
|
@@ -959,7 +963,7 @@ function WithdrawFlow({
|
|
|
959
963
|
return {
|
|
960
964
|
ownerAddress: dappWalletClient.account.address,
|
|
961
965
|
walletClient: dappWalletClient,
|
|
962
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
966
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkPDFLALUTcjs.getPublicClient.call(void 0, sourceChain, rpcUrls))),
|
|
963
967
|
switchChain: dappSwitchChain
|
|
964
968
|
};
|
|
965
969
|
}
|
|
@@ -983,7 +987,8 @@ function WithdrawFlow({
|
|
|
983
987
|
dappSwitchChain,
|
|
984
988
|
dappAddress,
|
|
985
989
|
reownWallet,
|
|
986
|
-
sourceChain
|
|
990
|
+
sourceChain,
|
|
991
|
+
rpcUrls
|
|
987
992
|
]);
|
|
988
993
|
const ownerAddress = _optionalChain([signerContext, 'optionalAccess', _32 => _32.ownerAddress]);
|
|
989
994
|
const recipientForRegistration = _react.useMemo.call(void 0, () => {
|
|
@@ -1041,7 +1046,7 @@ function WithdrawFlow({
|
|
|
1041
1046
|
message: typedData.message
|
|
1042
1047
|
});
|
|
1043
1048
|
if (cancelled) return;
|
|
1044
|
-
const sessionDetails =
|
|
1049
|
+
const sessionDetails = _chunkPDFLALUTcjs.buildSessionDetails.call(void 0,
|
|
1045
1050
|
setup.sessionDetailsUnsigned,
|
|
1046
1051
|
signature
|
|
1047
1052
|
);
|
|
@@ -1078,7 +1083,7 @@ function WithdrawFlow({
|
|
|
1078
1083
|
} catch (err) {
|
|
1079
1084
|
if (cancelled) return;
|
|
1080
1085
|
const raw = err instanceof Error ? err.message : "Registration failed";
|
|
1081
|
-
const message =
|
|
1086
|
+
const message = _chunkPDFLALUTcjs.formatUserError.call(void 0, raw);
|
|
1082
1087
|
logFlowError("auto-register:failed", err, {
|
|
1083
1088
|
ownerAddress,
|
|
1084
1089
|
targetChain,
|
|
@@ -1114,7 +1119,7 @@ function WithdrawFlow({
|
|
|
1114
1119
|
const symbol = _chunkABVRVW3Pcjs.getTokenSymbol.call(void 0, sourceToken, sourceChain);
|
|
1115
1120
|
const decimals = _chunkABVRVW3Pcjs.getTokenDecimalsByAddress.call(void 0, sourceToken, sourceChain);
|
|
1116
1121
|
return {
|
|
1117
|
-
id:
|
|
1122
|
+
id: _chunkPDFLALUTcjs.getAssetId.call(void 0, { chainId: sourceChain, token: sourceToken }),
|
|
1118
1123
|
chainId: sourceChain,
|
|
1119
1124
|
token: sourceToken,
|
|
1120
1125
|
symbol,
|
|
@@ -1254,7 +1259,7 @@ function WithdrawFlow({
|
|
|
1254
1259
|
targetToken
|
|
1255
1260
|
});
|
|
1256
1261
|
const amountUnits = _viem.parseUnits.call(void 0, amountValue, asset.decimals);
|
|
1257
|
-
const pc = _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess', _46 => _46.publicClient]), () => (
|
|
1262
|
+
const pc = _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess', _46 => _46.publicClient]), () => ( _chunkPDFLALUTcjs.getPublicClient.call(void 0, sourceChain, rpcUrls)));
|
|
1258
1263
|
let result;
|
|
1259
1264
|
if (onSignTransaction) {
|
|
1260
1265
|
const transferTarget = isSameRoute ? recipient : smartAccount;
|
|
@@ -1342,7 +1347,7 @@ function WithdrawFlow({
|
|
|
1342
1347
|
targetChain,
|
|
1343
1348
|
targetToken
|
|
1344
1349
|
});
|
|
1345
|
-
handleError(
|
|
1350
|
+
handleError(_chunkPDFLALUTcjs.formatUserError.call(void 0, raw), "WITHDRAW_FLOW_ERROR");
|
|
1346
1351
|
throw err;
|
|
1347
1352
|
}
|
|
1348
1353
|
},
|
|
@@ -1362,7 +1367,8 @@ function WithdrawFlow({
|
|
|
1362
1367
|
logFlow,
|
|
1363
1368
|
logFlowError,
|
|
1364
1369
|
onLifecycleRef,
|
|
1365
|
-
storeApi
|
|
1370
|
+
storeApi,
|
|
1371
|
+
rpcUrls
|
|
1366
1372
|
]
|
|
1367
1373
|
);
|
|
1368
1374
|
const handleWithdrawComplete = _react.useCallback.call(void 0,
|
|
@@ -1481,7 +1487,7 @@ function WithdrawFlow({
|
|
|
1481
1487
|
state: "ready"
|
|
1482
1488
|
}));
|
|
1483
1489
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1484
|
-
|
|
1490
|
+
_chunkPDFLALUTcjs.ConnectStep,
|
|
1485
1491
|
{
|
|
1486
1492
|
walletRows: withdrawRows,
|
|
1487
1493
|
onConfirmWallet: (walletId) => {
|
|
@@ -1499,7 +1505,7 @@ function WithdrawFlow({
|
|
|
1499
1505
|
if (!signerContext) return null;
|
|
1500
1506
|
if (!onSignTransaction && !signerContext.walletClient) return null;
|
|
1501
1507
|
const resolvedConnectedRecipient = _optionalChain([selectedWalletOption, 'optionalAccess', _63 => _63.kind]) === "external" ? selectedWalletOption.address : void 0;
|
|
1502
|
-
const formPublicClient = _nullishCoalesce(signerContext.publicClient, () => (
|
|
1508
|
+
const formPublicClient = _nullishCoalesce(signerContext.publicClient, () => ( _chunkPDFLALUTcjs.getPublicClient.call(void 0, sourceChain, rpcUrls)));
|
|
1503
1509
|
const depositAddress = registration.kind === "ready" || registration.kind === "stale" ? registration.smartAccount : void 0;
|
|
1504
1510
|
const stepView = deriveStepView(flowStep, registration);
|
|
1505
1511
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
@@ -1546,7 +1552,7 @@ function WithdrawFlow({
|
|
|
1546
1552
|
}
|
|
1547
1553
|
),
|
|
1548
1554
|
stepView === "processing" && registration.kind !== "idle" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1549
|
-
|
|
1555
|
+
_chunkPDFLALUTcjs.ProcessingStep,
|
|
1550
1556
|
{
|
|
1551
1557
|
smartAccount: registration.kind === "ready" || registration.kind === "stale" ? registration.smartAccount : "0x0",
|
|
1552
1558
|
txHash: _nullishCoalesce(storeApi.getState().txHash, () => ( "0x0")),
|
|
@@ -1588,7 +1594,7 @@ function deriveStepView(step, _registration) {
|
|
|
1588
1594
|
// src/WithdrawModal.tsx
|
|
1589
1595
|
|
|
1590
1596
|
var ReownWithdrawInner = _react.lazy.call(void 0,
|
|
1591
|
-
() => Promise.resolve().then(() => _interopRequireWildcard(require("./WithdrawModalReown-
|
|
1597
|
+
() => Promise.resolve().then(() => _interopRequireWildcard(require("./WithdrawModalReown-USNQEAEM.cjs"))).then((m) => ({
|
|
1592
1598
|
default: m.WithdrawModalReown
|
|
1593
1599
|
}))
|
|
1594
1600
|
);
|
|
@@ -1617,6 +1623,7 @@ function WithdrawModalInner({
|
|
|
1617
1623
|
closeOnOverlayClick,
|
|
1618
1624
|
allowedRoutes,
|
|
1619
1625
|
backendUrl = _chunkABVRVW3Pcjs.DEFAULT_BACKEND_URL,
|
|
1626
|
+
rpcUrls: rpcUrlsProp,
|
|
1620
1627
|
signerAddress = _chunkABVRVW3Pcjs.DEFAULT_SIGNER_ADDRESS,
|
|
1621
1628
|
sessionChainIds,
|
|
1622
1629
|
forceRegister = false,
|
|
@@ -1635,18 +1642,19 @@ function WithdrawModalInner({
|
|
|
1635
1642
|
debug
|
|
1636
1643
|
}) {
|
|
1637
1644
|
const modalRef = _react.useRef.call(void 0, null);
|
|
1638
|
-
const onReadyRef =
|
|
1645
|
+
const onReadyRef = _chunkPDFLALUTcjs.useLatestRef.call(void 0, onReady);
|
|
1639
1646
|
const [backHandler, setBackHandler] = _react.useState.call(void 0,
|
|
1640
1647
|
void 0
|
|
1641
1648
|
);
|
|
1642
1649
|
const targetChain = _chunkABVRVW3Pcjs.getChainId.call(void 0, targetChainProp);
|
|
1643
1650
|
const sourceChain = _chunkABVRVW3Pcjs.getChainId.call(void 0, sourceChainProp);
|
|
1651
|
+
const rpcUrls = _chunkPDFLALUTcjs.useStableRpcUrls.call(void 0, rpcUrlsProp);
|
|
1644
1652
|
const service = _react.useMemo.call(void 0,
|
|
1645
|
-
() =>
|
|
1653
|
+
() => _chunkPDFLALUTcjs.createDepositService.call(void 0, backendUrl, { debug, debugScope: "service:withdraw" }),
|
|
1646
1654
|
[backendUrl, debug]
|
|
1647
1655
|
);
|
|
1648
1656
|
const store = _react.useMemo.call(void 0, () => createWithdrawStore(), []);
|
|
1649
|
-
const onErrorRef =
|
|
1657
|
+
const onErrorRef = _chunkPDFLALUTcjs.useLatestRef.call(void 0, onError);
|
|
1650
1658
|
_react.useEffect.call(void 0, () => {
|
|
1651
1659
|
if (isOpen && onSignTransaction && !dappAddress) {
|
|
1652
1660
|
_optionalChain([onErrorRef, 'access', _64 => _64.current, 'optionalCall', _65 => _65({
|
|
@@ -1657,7 +1665,7 @@ function WithdrawModalInner({
|
|
|
1657
1665
|
}, [isOpen, onSignTransaction, dappAddress, onErrorRef]);
|
|
1658
1666
|
_react.useEffect.call(void 0, () => {
|
|
1659
1667
|
if (isOpen && modalRef.current) {
|
|
1660
|
-
|
|
1668
|
+
_chunkPDFLALUTcjs.applyTheme.call(void 0, modalRef.current, theme);
|
|
1661
1669
|
}
|
|
1662
1670
|
}, [isOpen, theme]);
|
|
1663
1671
|
_react.useEffect.call(void 0, () => {
|
|
@@ -1675,8 +1683,8 @@ function WithdrawModalInner({
|
|
|
1675
1683
|
}, []);
|
|
1676
1684
|
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _68 => _68.showBackButton]), () => ( true));
|
|
1677
1685
|
const canGoBack = backHandler !== void 0;
|
|
1678
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, WithdrawStoreProvider, { store, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1679
|
-
|
|
1686
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.RpcUrlsProvider, { value: rpcUrls, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, WithdrawStoreProvider, { store, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1687
|
+
_chunkPDFLALUTcjs.Modal,
|
|
1680
1688
|
{
|
|
1681
1689
|
isOpen,
|
|
1682
1690
|
onClose,
|
|
@@ -1692,7 +1700,7 @@ function WithdrawModalInner({
|
|
|
1692
1700
|
className: "rs-modal-header-back",
|
|
1693
1701
|
"aria-label": "Go back",
|
|
1694
1702
|
onClick: backHandler,
|
|
1695
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1703
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.ChevronLeftIcon, {})
|
|
1696
1704
|
}
|
|
1697
1705
|
) }),
|
|
1698
1706
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-header-nav-right", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -1702,7 +1710,7 @@ function WithdrawModalInner({
|
|
|
1702
1710
|
onClick: onClose,
|
|
1703
1711
|
className: "rs-modal-close",
|
|
1704
1712
|
"aria-label": "Close",
|
|
1705
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1713
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPDFLALUTcjs.CloseIcon, {})
|
|
1706
1714
|
}
|
|
1707
1715
|
) })
|
|
1708
1716
|
] }),
|
|
@@ -1739,7 +1747,7 @@ function WithdrawModalInner({
|
|
|
1739
1747
|
)
|
|
1740
1748
|
] })
|
|
1741
1749
|
}
|
|
1742
|
-
) });
|
|
1750
|
+
) }) });
|
|
1743
1751
|
}
|
|
1744
1752
|
|
|
1745
1753
|
|