@rhinestone/deposit-modal 0.0.0-dev-20260617120607 → 0.0.0-dev-20260617160708
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-PC7EX5VK.mjs → DepositModalReown-45FGNMM2.mjs} +3 -3
- package/dist/{DepositModalReown-KFTMS2WX.cjs → DepositModalReown-TE5QXBVM.cjs} +6 -6
- package/dist/{WithdrawModalReown-BE23LUMT.mjs → WithdrawModalReown-C4K77TIT.mjs} +3 -3
- package/dist/{WithdrawModalReown-Z2YF2FSJ.cjs → WithdrawModalReown-XAJJNJDV.cjs} +6 -6
- package/dist/{chunk-AE5LHTPM.cjs → chunk-33WCLK5U.cjs} +54 -54
- package/dist/{chunk-WCIGOV34.mjs → chunk-5UWBHOFH.mjs} +2 -2
- package/dist/{chunk-3MXWIYAT.cjs → chunk-AVZSVC6E.cjs} +2 -2
- package/dist/{chunk-OQVLEVNR.cjs → chunk-FF27W35D.cjs} +76 -57
- package/dist/{chunk-3PVDRSJ7.mjs → chunk-KNP4QWHF.mjs} +334 -447
- package/dist/{chunk-GKC22JC4.mjs → chunk-O754ZFAA.mjs} +276 -257
- package/dist/{chunk-UFKFSGT3.mjs → chunk-X44MBJJM.mjs} +1 -1
- package/dist/{chunk-7MP2UWIQ.cjs → chunk-XOXF3RIG.cjs} +217 -330
- package/dist/deposit.cjs +3 -3
- package/dist/deposit.mjs +2 -2
- package/dist/index.cjs +4 -4
- package/dist/index.mjs +3 -3
- package/dist/styles.css +84 -32
- package/dist/withdraw.cjs +3 -3
- package/dist/withdraw.mjs +2 -2
- package/package.json +1 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DepositModalInner
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-KNP4QWHF.mjs";
|
|
4
4
|
import "./chunk-FJWLC4AM.mjs";
|
|
5
5
|
import {
|
|
6
6
|
ReownWalletProvider,
|
|
7
7
|
useReownWallet
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-X44MBJJM.mjs";
|
|
9
|
+
import "./chunk-O754ZFAA.mjs";
|
|
10
10
|
import "./chunk-F7P4MV72.mjs";
|
|
11
11
|
import "./chunk-WJX3TJFK.mjs";
|
|
12
12
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkXOXF3RIGcjs = require('./chunk-XOXF3RIG.cjs');
|
|
4
4
|
require('./chunk-NRNJAQUA.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
9
|
-
require('./chunk-
|
|
8
|
+
var _chunkAVZSVC6Ecjs = require('./chunk-AVZSVC6E.cjs');
|
|
9
|
+
require('./chunk-FF27W35D.cjs');
|
|
10
10
|
require('./chunk-UEKPBRBY.cjs');
|
|
11
11
|
require('./chunk-ABVRVW3P.cjs');
|
|
12
12
|
|
|
@@ -16,7 +16,7 @@ var _react3 = require('@reown/appkit/react');
|
|
|
16
16
|
var _react5 = require('@reown/appkit-adapter-solana/react');
|
|
17
17
|
var _jsxruntime = require('react/jsx-runtime');
|
|
18
18
|
function DepositModalWithReown(props) {
|
|
19
|
-
const reown =
|
|
19
|
+
const reown = _chunkAVZSVC6Ecjs.useReownWallet.call(void 0, );
|
|
20
20
|
const enableSolana = _nullishCoalesce(props.enableSolana, () => ( true));
|
|
21
21
|
const { walletProvider: solanaWalletProvider } = _react3.useAppKitProvider.call(void 0,
|
|
22
22
|
enableSolana ? "solana" : "eip155"
|
|
@@ -37,7 +37,7 @@ function DepositModalWithReown(props) {
|
|
|
37
37
|
reown.disconnect();
|
|
38
38
|
}, [reown.disconnect]);
|
|
39
39
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
40
|
-
|
|
40
|
+
_chunkXOXF3RIGcjs.DepositModalInner,
|
|
41
41
|
{
|
|
42
42
|
...props,
|
|
43
43
|
reownWallet: reownWithSolana,
|
|
@@ -48,7 +48,7 @@ function DepositModalWithReown(props) {
|
|
|
48
48
|
}
|
|
49
49
|
function DepositModalReown(props) {
|
|
50
50
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
51
|
-
|
|
51
|
+
_chunkAVZSVC6Ecjs.ReownWalletProvider,
|
|
52
52
|
{
|
|
53
53
|
projectId: props.reownAppId,
|
|
54
54
|
theme: props.theme,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
WithdrawModalInner
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-5UWBHOFH.mjs";
|
|
4
4
|
import {
|
|
5
5
|
ReownWalletProvider,
|
|
6
6
|
useReownWallet
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-X44MBJJM.mjs";
|
|
8
|
+
import "./chunk-O754ZFAA.mjs";
|
|
9
9
|
import "./chunk-F7P4MV72.mjs";
|
|
10
10
|
import "./chunk-WJX3TJFK.mjs";
|
|
11
11
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunk33WCLK5Ucjs = require('./chunk-33WCLK5U.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
8
|
-
require('./chunk-
|
|
7
|
+
var _chunkAVZSVC6Ecjs = require('./chunk-AVZSVC6E.cjs');
|
|
8
|
+
require('./chunk-FF27W35D.cjs');
|
|
9
9
|
require('./chunk-UEKPBRBY.cjs');
|
|
10
10
|
require('./chunk-ABVRVW3P.cjs');
|
|
11
11
|
|
|
@@ -13,7 +13,7 @@ require('./chunk-ABVRVW3P.cjs');
|
|
|
13
13
|
var _react = require('react');
|
|
14
14
|
var _jsxruntime = require('react/jsx-runtime');
|
|
15
15
|
function WithdrawModalWithReown(props) {
|
|
16
|
-
const reown =
|
|
16
|
+
const reown = _chunkAVZSVC6Ecjs.useReownWallet.call(void 0, );
|
|
17
17
|
const handleConnect = _react.useCallback.call(void 0, () => {
|
|
18
18
|
reown.openConnect();
|
|
19
19
|
}, [reown.openConnect]);
|
|
@@ -21,7 +21,7 @@ function WithdrawModalWithReown(props) {
|
|
|
21
21
|
reown.disconnect();
|
|
22
22
|
}, [reown.disconnect]);
|
|
23
23
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
24
|
-
|
|
24
|
+
_chunk33WCLK5Ucjs.WithdrawModalInner,
|
|
25
25
|
{
|
|
26
26
|
...props,
|
|
27
27
|
reownWallet: reown,
|
|
@@ -31,7 +31,7 @@ function WithdrawModalWithReown(props) {
|
|
|
31
31
|
);
|
|
32
32
|
}
|
|
33
33
|
function WithdrawModalReown(props) {
|
|
34
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
34
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkAVZSVC6Ecjs.ReownWalletProvider, { projectId: props.reownAppId, theme: props.theme, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, WithdrawModalWithReown, { ...props }) });
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
|
|
33
|
-
var
|
|
33
|
+
var _chunkFF27W35Dcjs = require('./chunk-FF27W35D.cjs');
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
|
|
@@ -260,7 +260,7 @@ function WithdrawFormStep({
|
|
|
260
260
|
setIsSwitching(true);
|
|
261
261
|
switchChain(asset.chainId).catch((err) => {
|
|
262
262
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
263
|
-
setError(
|
|
263
|
+
setError(_chunkFF27W35Dcjs.formatUserError.call(void 0, raw));
|
|
264
264
|
}).finally(() => {
|
|
265
265
|
setIsSwitching(false);
|
|
266
266
|
});
|
|
@@ -280,7 +280,7 @@ function WithdrawFormStep({
|
|
|
280
280
|
return;
|
|
281
281
|
}
|
|
282
282
|
try {
|
|
283
|
-
const bal =
|
|
283
|
+
const bal = _chunkFF27W35Dcjs.isNativeAsset.call(void 0, asset) ? await publicClient.getBalance({ address: safeAddress }) : await publicClient.readContract({
|
|
284
284
|
address: asset.token,
|
|
285
285
|
abi: _viem.erc20Abi,
|
|
286
286
|
functionName: "balanceOf",
|
|
@@ -384,7 +384,7 @@ function WithdrawFormStep({
|
|
|
384
384
|
await onSubmit(recipient, amount);
|
|
385
385
|
} catch (err) {
|
|
386
386
|
const raw = err instanceof Error ? err.message : "Withdrawal failed";
|
|
387
|
-
setError(
|
|
387
|
+
setError(_chunkFF27W35Dcjs.formatUserError.call(void 0, raw));
|
|
388
388
|
} finally {
|
|
389
389
|
setIsSubmitting(false);
|
|
390
390
|
}
|
|
@@ -392,16 +392,16 @@ function WithdrawFormStep({
|
|
|
392
392
|
if (isBalanceLoading) {
|
|
393
393
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
394
394
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-withdraw-loading", children: [
|
|
395
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
395
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFF27W35Dcjs.Spinner, { className: "rs-spinner--lg" }),
|
|
396
396
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-withdraw-loading-title", children: "Loading on-chain balance" }),
|
|
397
397
|
/* @__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." })
|
|
398
398
|
] }),
|
|
399
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
399
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFF27W35Dcjs.PoweredBy, {})
|
|
400
400
|
] });
|
|
401
401
|
}
|
|
402
402
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
403
403
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
404
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
404
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFF27W35Dcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFF27W35Dcjs.CircleArrowOutUpLeftIcon, {}), title: "Withdraw" }),
|
|
405
405
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-section", children: [
|
|
406
406
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
407
407
|
"label",
|
|
@@ -447,7 +447,7 @@ function WithdrawFormStep({
|
|
|
447
447
|
),
|
|
448
448
|
isRecipientConnected ? null : "Use connected"
|
|
449
449
|
] }) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
450
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
450
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFF27W35Dcjs.WalletIcon, { className: "rs-withdraw-use-connected-icon" }),
|
|
451
451
|
isRecipientConnected ? null : "Use connected"
|
|
452
452
|
] })
|
|
453
453
|
}
|
|
@@ -487,7 +487,7 @@ function WithdrawFormStep({
|
|
|
487
487
|
) })
|
|
488
488
|
] }),
|
|
489
489
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-amount-info", children: [
|
|
490
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-withdraw-usd", children: amountUsd !== null ?
|
|
490
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-withdraw-usd", children: amountUsd !== null ? _chunkFF27W35Dcjs.currencyFormatter.format(amountUsd) : "$0.00" }),
|
|
491
491
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-withdraw-balance", children: [
|
|
492
492
|
"Balance: ",
|
|
493
493
|
formattedBalance,
|
|
@@ -528,7 +528,7 @@ function WithdrawFormStep({
|
|
|
528
528
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: targetChainName })
|
|
529
529
|
] }),
|
|
530
530
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
531
|
-
|
|
531
|
+
_chunkFF27W35Dcjs.ChevronDownIcon,
|
|
532
532
|
{
|
|
533
533
|
className: "rs-withdraw-dropdown-arrow",
|
|
534
534
|
style: {
|
|
@@ -597,7 +597,7 @@ function WithdrawFormStep({
|
|
|
597
597
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: targetSymbol })
|
|
598
598
|
] }),
|
|
599
599
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
600
|
-
|
|
600
|
+
_chunkFF27W35Dcjs.ChevronDownIcon,
|
|
601
601
|
{
|
|
602
602
|
className: "rs-withdraw-dropdown-arrow",
|
|
603
603
|
style: {
|
|
@@ -637,10 +637,10 @@ function WithdrawFormStep({
|
|
|
637
637
|
] })
|
|
638
638
|
] }),
|
|
639
639
|
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.` }) }),
|
|
640
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
641
|
-
!error && registrationError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
640
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFF27W35Dcjs.Callout, { variant: "error", children: error }),
|
|
641
|
+
!error && registrationError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFF27W35Dcjs.Callout, { variant: "error", children: registrationError }),
|
|
642
642
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
643
|
-
|
|
643
|
+
_chunkFF27W35Dcjs.Button,
|
|
644
644
|
{
|
|
645
645
|
onClick: handleWithdraw,
|
|
646
646
|
fullWidth: true,
|
|
@@ -650,7 +650,7 @@ function WithdrawFormStep({
|
|
|
650
650
|
}
|
|
651
651
|
)
|
|
652
652
|
] }),
|
|
653
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
653
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFF27W35Dcjs.PoweredBy, {})
|
|
654
654
|
] });
|
|
655
655
|
}
|
|
656
656
|
WithdrawFormStep.displayName = "WithdrawFormStep";
|
|
@@ -685,9 +685,9 @@ function WithdrawReviewStep({
|
|
|
685
685
|
const sourceTokenIcon = _chunkABVRVW3Pcjs.getTokenIcon.call(void 0, sourceSymbol);
|
|
686
686
|
const targetTokenIcon = _chunkABVRVW3Pcjs.getTokenIcon.call(void 0, targetSymbol);
|
|
687
687
|
const amountNumber = Number(amount);
|
|
688
|
-
const formattedSendAmount = _nullishCoalesce(
|
|
689
|
-
const prices =
|
|
690
|
-
const receiveDisplay = _nullishCoalesce(
|
|
688
|
+
const formattedSendAmount = _nullishCoalesce(_chunkFF27W35Dcjs.formatTokenAmount.call(void 0, amountNumber, sourceSymbol), () => ( amount));
|
|
689
|
+
const prices = _chunkFF27W35Dcjs.useTokenPrices.call(void 0, service, [sourceSymbol, targetSymbol]);
|
|
690
|
+
const receiveDisplay = _nullishCoalesce(_chunkFF27W35Dcjs.formatReceiveEstimate.call(void 0, {
|
|
691
691
|
sourceAmount: Number.isFinite(amountNumber) ? amountNumber : void 0,
|
|
692
692
|
sourceSymbol,
|
|
693
693
|
targetSymbol,
|
|
@@ -701,7 +701,7 @@ function WithdrawReviewStep({
|
|
|
701
701
|
await onConfirm();
|
|
702
702
|
} catch (err) {
|
|
703
703
|
const raw = err instanceof Error ? err.message : "Withdraw failed";
|
|
704
|
-
const message =
|
|
704
|
+
const message = _chunkFF27W35Dcjs.formatUserError.call(void 0, raw);
|
|
705
705
|
setError(message);
|
|
706
706
|
_optionalChain([onError, 'optionalCall', _8 => _8(message, "WITHDRAW_REVIEW_ERROR")]);
|
|
707
707
|
} finally {
|
|
@@ -712,9 +712,9 @@ function WithdrawReviewStep({
|
|
|
712
712
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
713
713
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
714
714
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
715
|
-
|
|
715
|
+
_chunkFF27W35Dcjs.BodyHeader,
|
|
716
716
|
{
|
|
717
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
717
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFF27W35Dcjs.CircleArrowOutUpLeftIcon, {}),
|
|
718
718
|
title: "Review withdrawal"
|
|
719
719
|
}
|
|
720
720
|
),
|
|
@@ -760,10 +760,10 @@ function WithdrawReviewStep({
|
|
|
760
760
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-value", children: estimatedTime })
|
|
761
761
|
] })
|
|
762
762
|
] }),
|
|
763
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
764
|
-
!error && registrationError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
763
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFF27W35Dcjs.Callout, { variant: "error", children: error }),
|
|
764
|
+
!error && registrationError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFF27W35Dcjs.Callout, { variant: "error", children: registrationError }),
|
|
765
765
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
766
|
-
|
|
766
|
+
_chunkFF27W35Dcjs.Button,
|
|
767
767
|
{
|
|
768
768
|
onClick: handleConfirm,
|
|
769
769
|
loading: isSubmitting,
|
|
@@ -774,7 +774,7 @@ function WithdrawReviewStep({
|
|
|
774
774
|
}
|
|
775
775
|
)
|
|
776
776
|
] }),
|
|
777
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
777
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFF27W35Dcjs.PoweredBy, {})
|
|
778
778
|
] });
|
|
779
779
|
}
|
|
780
780
|
WithdrawReviewStep.displayName = "WithdrawReviewStep";
|
|
@@ -785,15 +785,15 @@ WithdrawReviewStep.displayName = "WithdrawReviewStep";
|
|
|
785
785
|
var ADDR_REGEX = /^0x[a-fA-F0-9]{40}$/;
|
|
786
786
|
var REGISTRATION_DEBOUNCE_MS = 600;
|
|
787
787
|
function resolveSessionOwner(eoaAddress) {
|
|
788
|
-
const localOwner =
|
|
788
|
+
const localOwner = _chunkFF27W35Dcjs.loadSessionOwnerFromStorage.call(void 0, eoaAddress);
|
|
789
789
|
if (localOwner) {
|
|
790
790
|
return {
|
|
791
|
-
account:
|
|
791
|
+
account: _chunkFF27W35Dcjs.accountFromPrivateKey.call(void 0, localOwner.privateKey),
|
|
792
792
|
address: localOwner.address
|
|
793
793
|
};
|
|
794
794
|
}
|
|
795
|
-
const created =
|
|
796
|
-
|
|
795
|
+
const created = _chunkFF27W35Dcjs.createSessionOwnerKey.call(void 0, );
|
|
796
|
+
_chunkFF27W35Dcjs.saveSessionOwnerToStorage.call(void 0, eoaAddress, created.privateKey, created.address);
|
|
797
797
|
return { account: created.account, address: created.address };
|
|
798
798
|
}
|
|
799
799
|
function targetsEqual(a, b) {
|
|
@@ -828,19 +828,19 @@ function WithdrawFlow({
|
|
|
828
828
|
onError,
|
|
829
829
|
debug
|
|
830
830
|
}) {
|
|
831
|
-
const onStepChangeRef =
|
|
832
|
-
const onEventRef =
|
|
833
|
-
const onLifecycleRef =
|
|
834
|
-
const onErrorRef =
|
|
831
|
+
const onStepChangeRef = _chunkFF27W35Dcjs.useLatestRef.call(void 0, onStepChange);
|
|
832
|
+
const onEventRef = _chunkFF27W35Dcjs.useLatestRef.call(void 0, onEvent);
|
|
833
|
+
const onLifecycleRef = _chunkFF27W35Dcjs.useLatestRef.call(void 0, onLifecycle);
|
|
834
|
+
const onErrorRef = _chunkFF27W35Dcjs.useLatestRef.call(void 0, onError);
|
|
835
835
|
const logFlow = _react.useCallback.call(void 0,
|
|
836
836
|
(message, data) => {
|
|
837
|
-
|
|
837
|
+
_chunkFF27W35Dcjs.debugLog.call(void 0, debug, "withdraw-flow", message, data);
|
|
838
838
|
},
|
|
839
839
|
[debug]
|
|
840
840
|
);
|
|
841
841
|
const logFlowError = _react.useCallback.call(void 0,
|
|
842
842
|
(message, error, data) => {
|
|
843
|
-
|
|
843
|
+
_chunkFF27W35Dcjs.debugError.call(void 0, debug, "withdraw-flow", message, error, data);
|
|
844
844
|
},
|
|
845
845
|
[debug]
|
|
846
846
|
);
|
|
@@ -915,14 +915,14 @@ function WithdrawFlow({
|
|
|
915
915
|
return {
|
|
916
916
|
ownerAddress: dappAddress,
|
|
917
917
|
walletClient: _nullishCoalesce(dappWalletClient, () => ( void 0)),
|
|
918
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
918
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkFF27W35Dcjs.getPublicClient.call(void 0, sourceChain))),
|
|
919
919
|
switchChain: dappSwitchChain
|
|
920
920
|
};
|
|
921
921
|
}
|
|
922
922
|
return {
|
|
923
923
|
ownerAddress: dappWalletClient.account.address,
|
|
924
924
|
walletClient: dappWalletClient,
|
|
925
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
925
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkFF27W35Dcjs.getPublicClient.call(void 0, sourceChain))),
|
|
926
926
|
switchChain: dappSwitchChain
|
|
927
927
|
};
|
|
928
928
|
}
|
|
@@ -933,7 +933,7 @@ function WithdrawFlow({
|
|
|
933
933
|
return {
|
|
934
934
|
ownerAddress: dappWalletClient.account.address,
|
|
935
935
|
walletClient: dappWalletClient,
|
|
936
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
936
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkFF27W35Dcjs.getPublicClient.call(void 0, sourceChain))),
|
|
937
937
|
switchChain: dappSwitchChain
|
|
938
938
|
};
|
|
939
939
|
}
|
|
@@ -1015,7 +1015,7 @@ function WithdrawFlow({
|
|
|
1015
1015
|
message: typedData.message
|
|
1016
1016
|
});
|
|
1017
1017
|
if (cancelled) return;
|
|
1018
|
-
const sessionDetails =
|
|
1018
|
+
const sessionDetails = _chunkFF27W35Dcjs.buildSessionDetails.call(void 0,
|
|
1019
1019
|
setup.sessionDetailsUnsigned,
|
|
1020
1020
|
signature
|
|
1021
1021
|
);
|
|
@@ -1052,7 +1052,7 @@ function WithdrawFlow({
|
|
|
1052
1052
|
} catch (err) {
|
|
1053
1053
|
if (cancelled) return;
|
|
1054
1054
|
const raw = err instanceof Error ? err.message : "Registration failed";
|
|
1055
|
-
const message =
|
|
1055
|
+
const message = _chunkFF27W35Dcjs.formatUserError.call(void 0, raw);
|
|
1056
1056
|
logFlowError("auto-register:failed", err, {
|
|
1057
1057
|
ownerAddress,
|
|
1058
1058
|
targetChain,
|
|
@@ -1088,7 +1088,7 @@ function WithdrawFlow({
|
|
|
1088
1088
|
const symbol = _chunkABVRVW3Pcjs.getTokenSymbol.call(void 0, sourceToken, sourceChain);
|
|
1089
1089
|
const decimals = _chunkABVRVW3Pcjs.getTokenDecimalsByAddress.call(void 0, sourceToken, sourceChain);
|
|
1090
1090
|
return {
|
|
1091
|
-
id:
|
|
1091
|
+
id: _chunkFF27W35Dcjs.getAssetId.call(void 0, { chainId: sourceChain, token: sourceToken }),
|
|
1092
1092
|
chainId: sourceChain,
|
|
1093
1093
|
token: sourceToken,
|
|
1094
1094
|
symbol,
|
|
@@ -1196,7 +1196,7 @@ function WithdrawFlow({
|
|
|
1196
1196
|
targetToken
|
|
1197
1197
|
});
|
|
1198
1198
|
const amountUnits = _viem.parseUnits.call(void 0, amountValue, asset.decimals);
|
|
1199
|
-
const pc = _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess', _44 => _44.publicClient]), () => (
|
|
1199
|
+
const pc = _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess', _44 => _44.publicClient]), () => ( _chunkFF27W35Dcjs.getPublicClient.call(void 0, sourceChain)));
|
|
1200
1200
|
let result;
|
|
1201
1201
|
if (onSignTransaction) {
|
|
1202
1202
|
const transferTarget = isSameRoute ? recipient : smartAccount;
|
|
@@ -1272,7 +1272,7 @@ function WithdrawFlow({
|
|
|
1272
1272
|
targetChain,
|
|
1273
1273
|
targetToken
|
|
1274
1274
|
});
|
|
1275
|
-
handleError(
|
|
1275
|
+
handleError(_chunkFF27W35Dcjs.formatUserError.call(void 0, raw), "WITHDRAW_FLOW_ERROR");
|
|
1276
1276
|
throw err;
|
|
1277
1277
|
}
|
|
1278
1278
|
},
|
|
@@ -1411,7 +1411,7 @@ function WithdrawFlow({
|
|
|
1411
1411
|
state: "ready"
|
|
1412
1412
|
}));
|
|
1413
1413
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1414
|
-
|
|
1414
|
+
_chunkFF27W35Dcjs.ConnectStep,
|
|
1415
1415
|
{
|
|
1416
1416
|
walletRows: withdrawRows,
|
|
1417
1417
|
onConfirmWallet: (walletId) => {
|
|
@@ -1429,7 +1429,7 @@ function WithdrawFlow({
|
|
|
1429
1429
|
if (!signerContext) return null;
|
|
1430
1430
|
if (!onSignTransaction && !signerContext.walletClient) return null;
|
|
1431
1431
|
const resolvedConnectedRecipient = _optionalChain([selectedWalletOption, 'optionalAccess', _61 => _61.kind]) === "external" ? selectedWalletOption.address : void 0;
|
|
1432
|
-
const formPublicClient = _nullishCoalesce(signerContext.publicClient, () => (
|
|
1432
|
+
const formPublicClient = _nullishCoalesce(signerContext.publicClient, () => ( _chunkFF27W35Dcjs.getPublicClient.call(void 0, sourceChain)));
|
|
1433
1433
|
const stepView = deriveStepView(flowStep, registration);
|
|
1434
1434
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
1435
1435
|
stepView === "form" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -1474,7 +1474,7 @@ function WithdrawFlow({
|
|
|
1474
1474
|
}
|
|
1475
1475
|
),
|
|
1476
1476
|
stepView === "processing" && registration.kind !== "idle" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1477
|
-
|
|
1477
|
+
_chunkFF27W35Dcjs.ProcessingStep,
|
|
1478
1478
|
{
|
|
1479
1479
|
smartAccount: registration.kind === "ready" || registration.kind === "stale" ? registration.smartAccount : "0x0",
|
|
1480
1480
|
txHash: _nullishCoalesce(storeApi.getState().txHash, () => ( "0x0")),
|
|
@@ -1516,7 +1516,7 @@ function deriveStepView(step, _registration) {
|
|
|
1516
1516
|
// src/WithdrawModal.tsx
|
|
1517
1517
|
|
|
1518
1518
|
var ReownWithdrawInner = _react.lazy.call(void 0,
|
|
1519
|
-
() => Promise.resolve().then(() => _interopRequireWildcard(require("./WithdrawModalReown-
|
|
1519
|
+
() => Promise.resolve().then(() => _interopRequireWildcard(require("./WithdrawModalReown-XAJJNJDV.cjs"))).then((m) => ({
|
|
1520
1520
|
default: m.WithdrawModalReown
|
|
1521
1521
|
}))
|
|
1522
1522
|
);
|
|
@@ -1563,18 +1563,18 @@ function WithdrawModalInner({
|
|
|
1563
1563
|
debug
|
|
1564
1564
|
}) {
|
|
1565
1565
|
const modalRef = _react.useRef.call(void 0, null);
|
|
1566
|
-
const onReadyRef =
|
|
1566
|
+
const onReadyRef = _chunkFF27W35Dcjs.useLatestRef.call(void 0, onReady);
|
|
1567
1567
|
const [backHandler, setBackHandler] = _react.useState.call(void 0,
|
|
1568
1568
|
void 0
|
|
1569
1569
|
);
|
|
1570
1570
|
const targetChain = _chunkABVRVW3Pcjs.getChainId.call(void 0, targetChainProp);
|
|
1571
1571
|
const sourceChain = _chunkABVRVW3Pcjs.getChainId.call(void 0, sourceChainProp);
|
|
1572
1572
|
const service = _react.useMemo.call(void 0,
|
|
1573
|
-
() =>
|
|
1573
|
+
() => _chunkFF27W35Dcjs.createDepositService.call(void 0, backendUrl, { debug, debugScope: "service:withdraw" }),
|
|
1574
1574
|
[backendUrl, debug]
|
|
1575
1575
|
);
|
|
1576
1576
|
const store = _react.useMemo.call(void 0, () => createWithdrawStore(), []);
|
|
1577
|
-
const onErrorRef =
|
|
1577
|
+
const onErrorRef = _chunkFF27W35Dcjs.useLatestRef.call(void 0, onError);
|
|
1578
1578
|
_react.useEffect.call(void 0, () => {
|
|
1579
1579
|
if (isOpen && onSignTransaction && !dappAddress) {
|
|
1580
1580
|
_optionalChain([onErrorRef, 'access', _62 => _62.current, 'optionalCall', _63 => _63({
|
|
@@ -1585,7 +1585,7 @@ function WithdrawModalInner({
|
|
|
1585
1585
|
}, [isOpen, onSignTransaction, dappAddress, onErrorRef]);
|
|
1586
1586
|
_react.useEffect.call(void 0, () => {
|
|
1587
1587
|
if (isOpen && modalRef.current) {
|
|
1588
|
-
|
|
1588
|
+
_chunkFF27W35Dcjs.applyTheme.call(void 0, modalRef.current, theme);
|
|
1589
1589
|
}
|
|
1590
1590
|
}, [isOpen, theme]);
|
|
1591
1591
|
_react.useEffect.call(void 0, () => {
|
|
@@ -1604,7 +1604,7 @@ function WithdrawModalInner({
|
|
|
1604
1604
|
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _66 => _66.showBackButton]), () => ( true));
|
|
1605
1605
|
const canGoBack = backHandler !== void 0;
|
|
1606
1606
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, WithdrawStoreProvider, { store, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1607
|
-
|
|
1607
|
+
_chunkFF27W35Dcjs.Modal,
|
|
1608
1608
|
{
|
|
1609
1609
|
isOpen,
|
|
1610
1610
|
onClose,
|
|
@@ -1620,7 +1620,7 @@ function WithdrawModalInner({
|
|
|
1620
1620
|
className: "rs-modal-header-back",
|
|
1621
1621
|
"aria-label": "Go back",
|
|
1622
1622
|
onClick: backHandler,
|
|
1623
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1623
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFF27W35Dcjs.ChevronLeftIcon, {})
|
|
1624
1624
|
}
|
|
1625
1625
|
) }),
|
|
1626
1626
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-header-nav-right", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -1630,7 +1630,7 @@ function WithdrawModalInner({
|
|
|
1630
1630
|
onClick: onClose,
|
|
1631
1631
|
className: "rs-modal-close",
|
|
1632
1632
|
"aria-label": "Close",
|
|
1633
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1633
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFF27W35Dcjs.CloseIcon, {})
|
|
1634
1634
|
}
|
|
1635
1635
|
) })
|
|
1636
1636
|
] }),
|
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
saveSessionOwnerToStorage,
|
|
31
31
|
useLatestRef,
|
|
32
32
|
useTokenPrices
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-O754ZFAA.mjs";
|
|
34
34
|
import {
|
|
35
35
|
buildSafeTransaction,
|
|
36
36
|
executeSafeErc20Transfer,
|
|
@@ -1516,7 +1516,7 @@ function deriveStepView(step, _registration) {
|
|
|
1516
1516
|
// src/WithdrawModal.tsx
|
|
1517
1517
|
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1518
1518
|
var ReownWithdrawInner = lazy(
|
|
1519
|
-
() => import("./WithdrawModalReown-
|
|
1519
|
+
() => import("./WithdrawModalReown-C4K77TIT.mjs").then((m) => ({
|
|
1520
1520
|
default: m.WithdrawModalReown
|
|
1521
1521
|
}))
|
|
1522
1522
|
);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkFF27W35Dcjs = require('./chunk-FF27W35D.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
@@ -155,7 +155,7 @@ function useReownWallet() {
|
|
|
155
155
|
await switchChainAsync({ chainId });
|
|
156
156
|
}
|
|
157
157
|
} catch (err) {
|
|
158
|
-
if (
|
|
158
|
+
if (_chunkFF27W35Dcjs.isUnsupportedChainSwitchError.call(void 0, err)) {
|
|
159
159
|
throw new Error(
|
|
160
160
|
`Switch to ${_chunkABVRVW3Pcjs.getChainName.call(void 0, chainId)} in your wallet to continue`
|
|
161
161
|
);
|