@rhinestone/deposit-modal 0.0.0-dev-20260610110740 → 0.0.0-dev-20260611141108
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-G7UX4IBZ.mjs → DepositModalReown-O4VWVJYG.mjs} +3 -3
- package/dist/{DepositModalReown-MECHBE6P.cjs → DepositModalReown-QVVFHL2N.cjs} +6 -6
- package/dist/{WithdrawModalReown-WJ6VBZKK.cjs → WithdrawModalReown-3GK2F2AF.cjs} +6 -6
- package/dist/{WithdrawModalReown-CUJAFUQM.mjs → WithdrawModalReown-GLOHYSUG.mjs} +3 -3
- package/dist/{chunk-LEL6GMEQ.cjs → chunk-7AADPL52.cjs} +51 -51
- package/dist/{chunk-ULEAK63T.cjs → chunk-7KHWMSID.cjs} +2 -2
- package/dist/{chunk-3C35DVPE.mjs → chunk-E25DOT37.mjs} +695 -336
- package/dist/{chunk-MQIJZNTP.cjs → chunk-GQCEQZGF.cjs} +541 -182
- package/dist/{chunk-R5WDHHVM.mjs → chunk-KAYBLYUS.mjs} +1 -1
- package/dist/{chunk-SPUZLWQS.cjs → chunk-MMPRPDLS.cjs} +359 -216
- package/dist/{chunk-QYSCCX4K.mjs → chunk-NWCRGZG3.mjs} +506 -363
- package/dist/{chunk-DZQD3DAV.mjs → chunk-RVBLNCWE.mjs} +2 -2
- 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 +218 -9
- package/dist/{types-RzfAD14B.d.cts → types-CFRuisqK.d.cts} +1 -1
- package/dist/{types-RzfAD14B.d.ts → types-CFRuisqK.d.ts} +1 -1
- 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 +1 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DepositModalInner
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-NWCRGZG3.mjs";
|
|
4
4
|
import "./chunk-BAEB5AFZ.mjs";
|
|
5
5
|
import {
|
|
6
6
|
ReownWalletProvider,
|
|
7
7
|
useReownWallet
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-KAYBLYUS.mjs";
|
|
9
|
+
import "./chunk-E25DOT37.mjs";
|
|
10
10
|
import "./chunk-TQ2AYMWS.mjs";
|
|
11
11
|
import "./chunk-6YRDD462.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 _chunkMMPRPDLScjs = require('./chunk-MMPRPDLS.cjs');
|
|
4
4
|
require('./chunk-R5CPOBCF.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
9
|
-
require('./chunk-
|
|
8
|
+
var _chunk7KHWMSIDcjs = require('./chunk-7KHWMSID.cjs');
|
|
9
|
+
require('./chunk-GQCEQZGF.cjs');
|
|
10
10
|
require('./chunk-AJHFNHG3.cjs');
|
|
11
11
|
require('./chunk-MILJQWPT.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 = _chunk7KHWMSIDcjs.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
|
+
_chunkMMPRPDLScjs.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
|
+
_chunk7KHWMSIDcjs.ReownWalletProvider,
|
|
52
52
|
{
|
|
53
53
|
projectId: props.reownAppId,
|
|
54
54
|
theme: props.theme,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunk7AADPL52cjs = require('./chunk-7AADPL52.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
8
|
-
require('./chunk-
|
|
7
|
+
var _chunk7KHWMSIDcjs = require('./chunk-7KHWMSID.cjs');
|
|
8
|
+
require('./chunk-GQCEQZGF.cjs');
|
|
9
9
|
require('./chunk-AJHFNHG3.cjs');
|
|
10
10
|
require('./chunk-MILJQWPT.cjs');
|
|
11
11
|
|
|
@@ -13,7 +13,7 @@ require('./chunk-MILJQWPT.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 = _chunk7KHWMSIDcjs.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
|
+
_chunk7AADPL52cjs.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, _chunk7KHWMSIDcjs.ReownWalletProvider, { projectId: props.reownAppId, theme: props.theme, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, WithdrawModalWithReown, { ...props }) });
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
WithdrawModalInner
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-RVBLNCWE.mjs";
|
|
4
4
|
import {
|
|
5
5
|
ReownWalletProvider,
|
|
6
6
|
useReownWallet
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-KAYBLYUS.mjs";
|
|
8
|
+
import "./chunk-E25DOT37.mjs";
|
|
9
9
|
import "./chunk-TQ2AYMWS.mjs";
|
|
10
10
|
import "./chunk-6YRDD462.mjs";
|
|
11
11
|
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
|
|
30
|
-
var
|
|
30
|
+
var _chunkGQCEQZGFcjs = require('./chunk-GQCEQZGF.cjs');
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
|
|
@@ -257,7 +257,7 @@ function WithdrawFormStep({
|
|
|
257
257
|
setIsSwitching(true);
|
|
258
258
|
switchChain(asset.chainId).catch((err) => {
|
|
259
259
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
260
|
-
setError(
|
|
260
|
+
setError(_chunkGQCEQZGFcjs.formatUserError.call(void 0, raw));
|
|
261
261
|
}).finally(() => {
|
|
262
262
|
setIsSwitching(false);
|
|
263
263
|
});
|
|
@@ -277,7 +277,7 @@ function WithdrawFormStep({
|
|
|
277
277
|
return;
|
|
278
278
|
}
|
|
279
279
|
try {
|
|
280
|
-
const bal =
|
|
280
|
+
const bal = _chunkGQCEQZGFcjs.isNativeAsset.call(void 0, asset) ? await publicClient.getBalance({ address: safeAddress }) : await publicClient.readContract({
|
|
281
281
|
address: asset.token,
|
|
282
282
|
abi: _viem.erc20Abi,
|
|
283
283
|
functionName: "balanceOf",
|
|
@@ -381,7 +381,7 @@ function WithdrawFormStep({
|
|
|
381
381
|
await onSubmit(recipient, amount);
|
|
382
382
|
} catch (err) {
|
|
383
383
|
const raw = err instanceof Error ? err.message : "Withdrawal failed";
|
|
384
|
-
setError(
|
|
384
|
+
setError(_chunkGQCEQZGFcjs.formatUserError.call(void 0, raw));
|
|
385
385
|
} finally {
|
|
386
386
|
setIsSubmitting(false);
|
|
387
387
|
}
|
|
@@ -389,16 +389,16 @@ function WithdrawFormStep({
|
|
|
389
389
|
if (isBalanceLoading) {
|
|
390
390
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
391
391
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-withdraw-loading", children: [
|
|
392
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
392
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGQCEQZGFcjs.Spinner, { className: "rs-spinner--lg" }),
|
|
393
393
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-withdraw-loading-title", children: "Loading on-chain balance" }),
|
|
394
394
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-withdraw-loading-subtitle", children: chainMismatch ? `Switch to ${_chunkMILJQWPTcjs.getChainName.call(void 0, asset.chainId)} to continue.` : "Please wait before withdrawing." })
|
|
395
395
|
] }),
|
|
396
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
396
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGQCEQZGFcjs.PoweredBy, {})
|
|
397
397
|
] });
|
|
398
398
|
}
|
|
399
399
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
400
400
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
401
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
401
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGQCEQZGFcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGQCEQZGFcjs.CircleArrowOutUpLeftIcon, {}), title: "Withdraw" }),
|
|
402
402
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-section", children: [
|
|
403
403
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
404
404
|
"label",
|
|
@@ -444,7 +444,7 @@ function WithdrawFormStep({
|
|
|
444
444
|
),
|
|
445
445
|
isRecipientConnected ? null : "Use connected"
|
|
446
446
|
] }) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
447
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
447
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGQCEQZGFcjs.WalletIcon, { className: "rs-withdraw-use-connected-icon" }),
|
|
448
448
|
isRecipientConnected ? null : "Use connected"
|
|
449
449
|
] })
|
|
450
450
|
}
|
|
@@ -484,7 +484,7 @@ function WithdrawFormStep({
|
|
|
484
484
|
) })
|
|
485
485
|
] }),
|
|
486
486
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-amount-info", children: [
|
|
487
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-withdraw-usd", children: amountUsd !== null ?
|
|
487
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-withdraw-usd", children: amountUsd !== null ? _chunkGQCEQZGFcjs.currencyFormatter.format(amountUsd) : "$0.00" }),
|
|
488
488
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-withdraw-balance", children: [
|
|
489
489
|
"Balance: ",
|
|
490
490
|
formattedBalance,
|
|
@@ -525,7 +525,7 @@ function WithdrawFormStep({
|
|
|
525
525
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: targetChainName })
|
|
526
526
|
] }),
|
|
527
527
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
528
|
-
|
|
528
|
+
_chunkGQCEQZGFcjs.ChevronDownIcon,
|
|
529
529
|
{
|
|
530
530
|
className: "rs-withdraw-dropdown-arrow",
|
|
531
531
|
style: {
|
|
@@ -594,7 +594,7 @@ function WithdrawFormStep({
|
|
|
594
594
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: targetSymbol })
|
|
595
595
|
] }),
|
|
596
596
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
597
|
-
|
|
597
|
+
_chunkGQCEQZGFcjs.ChevronDownIcon,
|
|
598
598
|
{
|
|
599
599
|
className: "rs-withdraw-dropdown-arrow",
|
|
600
600
|
style: {
|
|
@@ -634,10 +634,10 @@ function WithdrawFormStep({
|
|
|
634
634
|
] })
|
|
635
635
|
] }),
|
|
636
636
|
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 ${_chunkMILJQWPTcjs.getChainName.call(void 0, asset.chainId)}...` : `Switch to ${_chunkMILJQWPTcjs.getChainName.call(void 0, asset.chainId)} to continue.` }) }),
|
|
637
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
638
|
-
!error && registrationError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
637
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGQCEQZGFcjs.Callout, { variant: "error", children: error }),
|
|
638
|
+
!error && registrationError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGQCEQZGFcjs.Callout, { variant: "error", children: registrationError }),
|
|
639
639
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
640
|
-
|
|
640
|
+
_chunkGQCEQZGFcjs.Button,
|
|
641
641
|
{
|
|
642
642
|
onClick: handleWithdraw,
|
|
643
643
|
fullWidth: true,
|
|
@@ -647,7 +647,7 @@ function WithdrawFormStep({
|
|
|
647
647
|
}
|
|
648
648
|
)
|
|
649
649
|
] }),
|
|
650
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
650
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGQCEQZGFcjs.PoweredBy, {})
|
|
651
651
|
] });
|
|
652
652
|
}
|
|
653
653
|
WithdrawFormStep.displayName = "WithdrawFormStep";
|
|
@@ -687,7 +687,7 @@ function WithdrawReviewStep({
|
|
|
687
687
|
await onConfirm();
|
|
688
688
|
} catch (err) {
|
|
689
689
|
const raw = err instanceof Error ? err.message : "Withdraw failed";
|
|
690
|
-
const message =
|
|
690
|
+
const message = _chunkGQCEQZGFcjs.formatUserError.call(void 0, raw);
|
|
691
691
|
setError(message);
|
|
692
692
|
_optionalChain([onError, 'optionalCall', _8 => _8(message, "WITHDRAW_REVIEW_ERROR")]);
|
|
693
693
|
} finally {
|
|
@@ -698,9 +698,9 @@ function WithdrawReviewStep({
|
|
|
698
698
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
699
699
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
700
700
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
701
|
-
|
|
701
|
+
_chunkGQCEQZGFcjs.BodyHeader,
|
|
702
702
|
{
|
|
703
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
703
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGQCEQZGFcjs.CircleArrowOutUpLeftIcon, {}),
|
|
704
704
|
title: "Review withdrawal"
|
|
705
705
|
}
|
|
706
706
|
),
|
|
@@ -750,10 +750,10 @@ function WithdrawReviewStep({
|
|
|
750
750
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-value", children: estimatedTime })
|
|
751
751
|
] })
|
|
752
752
|
] }),
|
|
753
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
754
|
-
!error && registrationError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
753
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGQCEQZGFcjs.Callout, { variant: "error", children: error }),
|
|
754
|
+
!error && registrationError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGQCEQZGFcjs.Callout, { variant: "error", children: registrationError }),
|
|
755
755
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
756
|
-
|
|
756
|
+
_chunkGQCEQZGFcjs.Button,
|
|
757
757
|
{
|
|
758
758
|
onClick: handleConfirm,
|
|
759
759
|
loading: isSubmitting,
|
|
@@ -764,7 +764,7 @@ function WithdrawReviewStep({
|
|
|
764
764
|
}
|
|
765
765
|
)
|
|
766
766
|
] }),
|
|
767
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
767
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGQCEQZGFcjs.PoweredBy, {})
|
|
768
768
|
] });
|
|
769
769
|
}
|
|
770
770
|
WithdrawReviewStep.displayName = "WithdrawReviewStep";
|
|
@@ -775,15 +775,15 @@ WithdrawReviewStep.displayName = "WithdrawReviewStep";
|
|
|
775
775
|
var ADDR_REGEX = /^0x[a-fA-F0-9]{40}$/;
|
|
776
776
|
var REGISTRATION_DEBOUNCE_MS = 600;
|
|
777
777
|
function resolveSessionOwner(eoaAddress) {
|
|
778
|
-
const localOwner =
|
|
778
|
+
const localOwner = _chunkGQCEQZGFcjs.loadSessionOwnerFromStorage.call(void 0, eoaAddress);
|
|
779
779
|
if (localOwner) {
|
|
780
780
|
return {
|
|
781
|
-
account:
|
|
781
|
+
account: _chunkGQCEQZGFcjs.accountFromPrivateKey.call(void 0, localOwner.privateKey),
|
|
782
782
|
address: localOwner.address
|
|
783
783
|
};
|
|
784
784
|
}
|
|
785
|
-
const created =
|
|
786
|
-
|
|
785
|
+
const created = _chunkGQCEQZGFcjs.createSessionOwnerKey.call(void 0, );
|
|
786
|
+
_chunkGQCEQZGFcjs.saveSessionOwnerToStorage.call(void 0, eoaAddress, created.privateKey, created.address);
|
|
787
787
|
return { account: created.account, address: created.address };
|
|
788
788
|
}
|
|
789
789
|
function targetsEqual(a, b) {
|
|
@@ -818,19 +818,19 @@ function WithdrawFlow({
|
|
|
818
818
|
onError,
|
|
819
819
|
debug
|
|
820
820
|
}) {
|
|
821
|
-
const onStepChangeRef =
|
|
822
|
-
const onEventRef =
|
|
823
|
-
const onLifecycleRef =
|
|
824
|
-
const onErrorRef =
|
|
821
|
+
const onStepChangeRef = _chunkGQCEQZGFcjs.useLatestRef.call(void 0, onStepChange);
|
|
822
|
+
const onEventRef = _chunkGQCEQZGFcjs.useLatestRef.call(void 0, onEvent);
|
|
823
|
+
const onLifecycleRef = _chunkGQCEQZGFcjs.useLatestRef.call(void 0, onLifecycle);
|
|
824
|
+
const onErrorRef = _chunkGQCEQZGFcjs.useLatestRef.call(void 0, onError);
|
|
825
825
|
const logFlow = _react.useCallback.call(void 0,
|
|
826
826
|
(message, data) => {
|
|
827
|
-
|
|
827
|
+
_chunkGQCEQZGFcjs.debugLog.call(void 0, debug, "withdraw-flow", message, data);
|
|
828
828
|
},
|
|
829
829
|
[debug]
|
|
830
830
|
);
|
|
831
831
|
const logFlowError = _react.useCallback.call(void 0,
|
|
832
832
|
(message, error, data) => {
|
|
833
|
-
|
|
833
|
+
_chunkGQCEQZGFcjs.debugError.call(void 0, debug, "withdraw-flow", message, error, data);
|
|
834
834
|
},
|
|
835
835
|
[debug]
|
|
836
836
|
);
|
|
@@ -905,14 +905,14 @@ function WithdrawFlow({
|
|
|
905
905
|
return {
|
|
906
906
|
ownerAddress: dappAddress,
|
|
907
907
|
walletClient: _nullishCoalesce(dappWalletClient, () => ( void 0)),
|
|
908
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
908
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkGQCEQZGFcjs.getPublicClient.call(void 0, sourceChain))),
|
|
909
909
|
switchChain: dappSwitchChain
|
|
910
910
|
};
|
|
911
911
|
}
|
|
912
912
|
return {
|
|
913
913
|
ownerAddress: dappWalletClient.account.address,
|
|
914
914
|
walletClient: dappWalletClient,
|
|
915
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
915
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkGQCEQZGFcjs.getPublicClient.call(void 0, sourceChain))),
|
|
916
916
|
switchChain: dappSwitchChain
|
|
917
917
|
};
|
|
918
918
|
}
|
|
@@ -923,7 +923,7 @@ function WithdrawFlow({
|
|
|
923
923
|
return {
|
|
924
924
|
ownerAddress: dappWalletClient.account.address,
|
|
925
925
|
walletClient: dappWalletClient,
|
|
926
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
926
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkGQCEQZGFcjs.getPublicClient.call(void 0, sourceChain))),
|
|
927
927
|
switchChain: dappSwitchChain
|
|
928
928
|
};
|
|
929
929
|
}
|
|
@@ -1005,7 +1005,7 @@ function WithdrawFlow({
|
|
|
1005
1005
|
message: typedData.message
|
|
1006
1006
|
});
|
|
1007
1007
|
if (cancelled) return;
|
|
1008
|
-
const sessionDetails =
|
|
1008
|
+
const sessionDetails = _chunkGQCEQZGFcjs.buildSessionDetails.call(void 0,
|
|
1009
1009
|
setup.sessionDetailsUnsigned,
|
|
1010
1010
|
signature
|
|
1011
1011
|
);
|
|
@@ -1042,7 +1042,7 @@ function WithdrawFlow({
|
|
|
1042
1042
|
} catch (err) {
|
|
1043
1043
|
if (cancelled) return;
|
|
1044
1044
|
const raw = err instanceof Error ? err.message : "Registration failed";
|
|
1045
|
-
const message =
|
|
1045
|
+
const message = _chunkGQCEQZGFcjs.formatUserError.call(void 0, raw);
|
|
1046
1046
|
logFlowError("auto-register:failed", err, {
|
|
1047
1047
|
ownerAddress,
|
|
1048
1048
|
targetChain,
|
|
@@ -1078,7 +1078,7 @@ function WithdrawFlow({
|
|
|
1078
1078
|
const symbol = _chunkMILJQWPTcjs.getTokenSymbol.call(void 0, sourceToken, sourceChain);
|
|
1079
1079
|
const decimals = _chunkMILJQWPTcjs.getTokenDecimalsByAddress.call(void 0, sourceToken, sourceChain);
|
|
1080
1080
|
return {
|
|
1081
|
-
id:
|
|
1081
|
+
id: _chunkGQCEQZGFcjs.getAssetId.call(void 0, { chainId: sourceChain, token: sourceToken }),
|
|
1082
1082
|
chainId: sourceChain,
|
|
1083
1083
|
token: sourceToken,
|
|
1084
1084
|
symbol,
|
|
@@ -1186,7 +1186,7 @@ function WithdrawFlow({
|
|
|
1186
1186
|
targetToken
|
|
1187
1187
|
});
|
|
1188
1188
|
const amountUnits = _viem.parseUnits.call(void 0, amountValue, asset.decimals);
|
|
1189
|
-
const pc = _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess', _44 => _44.publicClient]), () => (
|
|
1189
|
+
const pc = _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess', _44 => _44.publicClient]), () => ( _chunkGQCEQZGFcjs.getPublicClient.call(void 0, sourceChain)));
|
|
1190
1190
|
let result;
|
|
1191
1191
|
if (onSignTransaction) {
|
|
1192
1192
|
const transferTarget = isSameRoute ? recipient : smartAccount;
|
|
@@ -1262,7 +1262,7 @@ function WithdrawFlow({
|
|
|
1262
1262
|
targetChain,
|
|
1263
1263
|
targetToken
|
|
1264
1264
|
});
|
|
1265
|
-
handleError(
|
|
1265
|
+
handleError(_chunkGQCEQZGFcjs.formatUserError.call(void 0, raw), "WITHDRAW_FLOW_ERROR");
|
|
1266
1266
|
throw err;
|
|
1267
1267
|
}
|
|
1268
1268
|
},
|
|
@@ -1401,7 +1401,7 @@ function WithdrawFlow({
|
|
|
1401
1401
|
state: "ready"
|
|
1402
1402
|
}));
|
|
1403
1403
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1404
|
-
|
|
1404
|
+
_chunkGQCEQZGFcjs.ConnectStep,
|
|
1405
1405
|
{
|
|
1406
1406
|
walletRows: withdrawRows,
|
|
1407
1407
|
onConfirmWallet: (walletId) => {
|
|
@@ -1419,7 +1419,7 @@ function WithdrawFlow({
|
|
|
1419
1419
|
if (!signerContext) return null;
|
|
1420
1420
|
if (!onSignTransaction && !signerContext.walletClient) return null;
|
|
1421
1421
|
const resolvedConnectedRecipient = _optionalChain([selectedWalletOption, 'optionalAccess', _61 => _61.kind]) === "external" ? selectedWalletOption.address : void 0;
|
|
1422
|
-
const formPublicClient = _nullishCoalesce(signerContext.publicClient, () => (
|
|
1422
|
+
const formPublicClient = _nullishCoalesce(signerContext.publicClient, () => ( _chunkGQCEQZGFcjs.getPublicClient.call(void 0, sourceChain)));
|
|
1423
1423
|
const stepView = deriveStepView(flowStep, registration);
|
|
1424
1424
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
1425
1425
|
stepView === "form" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -1463,7 +1463,7 @@ function WithdrawFlow({
|
|
|
1463
1463
|
}
|
|
1464
1464
|
),
|
|
1465
1465
|
stepView === "processing" && registration.kind !== "idle" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1466
|
-
|
|
1466
|
+
_chunkGQCEQZGFcjs.ProcessingStep,
|
|
1467
1467
|
{
|
|
1468
1468
|
smartAccount: registration.kind === "ready" || registration.kind === "stale" ? registration.smartAccount : "0x0",
|
|
1469
1469
|
txHash: _nullishCoalesce(storeApi.getState().txHash, () => ( "0x0")),
|
|
@@ -1496,7 +1496,7 @@ function deriveStepView(step, _registration) {
|
|
|
1496
1496
|
// src/WithdrawModal.tsx
|
|
1497
1497
|
|
|
1498
1498
|
var ReownWithdrawInner = _react.lazy.call(void 0,
|
|
1499
|
-
() => Promise.resolve().then(() => _interopRequireWildcard(require("./WithdrawModalReown-
|
|
1499
|
+
() => Promise.resolve().then(() => _interopRequireWildcard(require("./WithdrawModalReown-3GK2F2AF.cjs"))).then((m) => ({
|
|
1500
1500
|
default: m.WithdrawModalReown
|
|
1501
1501
|
}))
|
|
1502
1502
|
);
|
|
@@ -1543,18 +1543,18 @@ function WithdrawModalInner({
|
|
|
1543
1543
|
debug
|
|
1544
1544
|
}) {
|
|
1545
1545
|
const modalRef = _react.useRef.call(void 0, null);
|
|
1546
|
-
const onReadyRef =
|
|
1546
|
+
const onReadyRef = _chunkGQCEQZGFcjs.useLatestRef.call(void 0, onReady);
|
|
1547
1547
|
const [backHandler, setBackHandler] = _react.useState.call(void 0,
|
|
1548
1548
|
void 0
|
|
1549
1549
|
);
|
|
1550
1550
|
const targetChain = _chunkMILJQWPTcjs.getChainId.call(void 0, targetChainProp);
|
|
1551
1551
|
const sourceChain = _chunkMILJQWPTcjs.getChainId.call(void 0, sourceChainProp);
|
|
1552
1552
|
const service = _react.useMemo.call(void 0,
|
|
1553
|
-
() =>
|
|
1553
|
+
() => _chunkGQCEQZGFcjs.createDepositService.call(void 0, backendUrl, { debug, debugScope: "service:withdraw" }),
|
|
1554
1554
|
[backendUrl, debug]
|
|
1555
1555
|
);
|
|
1556
1556
|
const store = _react.useMemo.call(void 0, () => createWithdrawStore(), []);
|
|
1557
|
-
const onErrorRef =
|
|
1557
|
+
const onErrorRef = _chunkGQCEQZGFcjs.useLatestRef.call(void 0, onError);
|
|
1558
1558
|
_react.useEffect.call(void 0, () => {
|
|
1559
1559
|
if (isOpen && onSignTransaction && !dappAddress) {
|
|
1560
1560
|
_optionalChain([onErrorRef, 'access', _62 => _62.current, 'optionalCall', _63 => _63({
|
|
@@ -1565,7 +1565,7 @@ function WithdrawModalInner({
|
|
|
1565
1565
|
}, [isOpen, onSignTransaction, dappAddress, onErrorRef]);
|
|
1566
1566
|
_react.useEffect.call(void 0, () => {
|
|
1567
1567
|
if (isOpen && modalRef.current) {
|
|
1568
|
-
|
|
1568
|
+
_chunkGQCEQZGFcjs.applyTheme.call(void 0, modalRef.current, theme);
|
|
1569
1569
|
}
|
|
1570
1570
|
}, [isOpen, theme]);
|
|
1571
1571
|
_react.useEffect.call(void 0, () => {
|
|
@@ -1584,7 +1584,7 @@ function WithdrawModalInner({
|
|
|
1584
1584
|
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _66 => _66.showBackButton]), () => ( true));
|
|
1585
1585
|
const canGoBack = backHandler !== void 0;
|
|
1586
1586
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, WithdrawStoreProvider, { store, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1587
|
-
|
|
1587
|
+
_chunkGQCEQZGFcjs.Modal,
|
|
1588
1588
|
{
|
|
1589
1589
|
isOpen,
|
|
1590
1590
|
onClose,
|
|
@@ -1600,7 +1600,7 @@ function WithdrawModalInner({
|
|
|
1600
1600
|
className: "rs-modal-header-back",
|
|
1601
1601
|
"aria-label": "Go back",
|
|
1602
1602
|
onClick: backHandler,
|
|
1603
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1603
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGQCEQZGFcjs.ChevronLeftIcon, {})
|
|
1604
1604
|
}
|
|
1605
1605
|
) }),
|
|
1606
1606
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-header-nav-right", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -1610,7 +1610,7 @@ function WithdrawModalInner({
|
|
|
1610
1610
|
onClick: onClose,
|
|
1611
1611
|
className: "rs-modal-close",
|
|
1612
1612
|
"aria-label": "Close",
|
|
1613
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1613
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkGQCEQZGFcjs.CloseIcon, {})
|
|
1614
1614
|
}
|
|
1615
1615
|
) })
|
|
1616
1616
|
] }),
|
|
@@ -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 _chunkGQCEQZGFcjs = require('./chunk-GQCEQZGF.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
@@ -145,7 +145,7 @@ function useReownWallet() {
|
|
|
145
145
|
await switchChainAsync({ chainId });
|
|
146
146
|
}
|
|
147
147
|
} catch (err) {
|
|
148
|
-
if (
|
|
148
|
+
if (_chunkGQCEQZGFcjs.isUnsupportedChainSwitchError.call(void 0, err)) {
|
|
149
149
|
throw new Error(
|
|
150
150
|
`Switch to ${_chunkMILJQWPTcjs.getChainName.call(void 0, chainId)} in your wallet to continue`
|
|
151
151
|
);
|