@rhinestone/deposit-modal 0.8.0 → 0.8.2
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-J5YFZKFS.cjs → DepositModalReown-A2W6R27Q.cjs} +9 -9
- package/dist/{DepositModalReown-RZ6VSMKP.mjs → DepositModalReown-IB5WUXVT.mjs} +6 -6
- package/dist/{WithdrawModalReown-4YUV2WWV.mjs → WithdrawModalReown-A4S4BJHG.mjs} +5 -5
- package/dist/{WithdrawModalReown-B6BGY52S.cjs → WithdrawModalReown-KUWNNA2X.cjs} +8 -8
- package/dist/{chunk-SX52FXKH.mjs → chunk-2O2FJYRY.mjs} +8 -1
- package/dist/{chunk-JRFPKFL6.cjs → chunk-3WIHTUQ6.cjs} +105 -98
- package/dist/{chunk-XLXJW44N.cjs → chunk-46BRQZ2P.cjs} +500 -458
- package/dist/{chunk-LXTAAHPC.mjs → chunk-4BLOPOVO.mjs} +2 -2
- package/dist/{chunk-VURI4G2Z.cjs → chunk-5E67UM3V.cjs} +7 -7
- package/dist/{chunk-IRI34U6N.cjs → chunk-DSXMWQYB.cjs} +262 -139
- package/dist/{chunk-5S5BQ2GM.mjs → chunk-KGZU3BL2.mjs} +59 -17
- package/dist/{chunk-4IOQIWDY.cjs → chunk-ORKEBFMR.cjs} +4 -4
- package/dist/{chunk-PUMTR35E.cjs → chunk-P5T4XSN2.cjs} +9 -2
- package/dist/{chunk-YLIPI3NU.mjs → chunk-RARNNVZO.mjs} +1 -1
- package/dist/{chunk-TYB6AA6D.mjs → chunk-RH6XQHMA.mjs} +1 -1
- package/dist/{chunk-RXWJ267K.mjs → chunk-TUSEN26M.mjs} +172 -49
- package/dist/{chunk-WL7AXYQ4.cjs → chunk-UNVVUULP.cjs} +3 -3
- package/dist/{chunk-7JJ4EFDY.mjs → chunk-XK5RH4FZ.mjs} +12 -5
- package/dist/constants.cjs +2 -2
- package/dist/constants.mjs +1 -1
- package/dist/deposit.cjs +6 -6
- package/dist/deposit.mjs +5 -5
- package/dist/index.cjs +7 -7
- package/dist/index.mjs +6 -6
- package/dist/polymarket.cjs +6 -6
- package/dist/polymarket.mjs +3 -3
- package/dist/styles.css +147 -1
- package/dist/withdraw.cjs +5 -5
- package/dist/withdraw.mjs +4 -4
- package/package.json +1 -1
|
@@ -34,13 +34,13 @@
|
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
|
|
37
|
-
var _chunkIRI34U6Ncjs = require('./chunk-IRI34U6N.cjs');
|
|
38
37
|
|
|
38
|
+
var _chunkDSXMWQYBcjs = require('./chunk-DSXMWQYB.cjs');
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
|
|
42
|
-
var _chunkWL7AXYQ4cjs = require('./chunk-WL7AXYQ4.cjs');
|
|
43
42
|
|
|
43
|
+
var _chunkUNVVUULPcjs = require('./chunk-UNVVUULP.cjs');
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
|
|
@@ -52,7 +52,8 @@ var _chunkWL7AXYQ4cjs = require('./chunk-WL7AXYQ4.cjs');
|
|
|
52
52
|
|
|
53
53
|
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
|
|
56
|
+
var _chunkP5T4XSN2cjs = require('./chunk-P5T4XSN2.cjs');
|
|
56
57
|
|
|
57
58
|
// src/WithdrawModal.tsx
|
|
58
59
|
|
|
@@ -244,8 +245,8 @@ function WithdrawFormStep({
|
|
|
244
245
|
const chainMismatch = Boolean(
|
|
245
246
|
_optionalChain([walletClient, 'optionalAccess', _3 => _3.chain, 'optionalAccess', _4 => _4.id]) && walletClient.chain.id !== asset.chainId
|
|
246
247
|
);
|
|
247
|
-
const targetSymbol =
|
|
248
|
-
const targetChainName =
|
|
248
|
+
const targetSymbol = _chunkP5T4XSN2cjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
249
|
+
const targetChainName = _chunkP5T4XSN2cjs.getChainName.call(void 0, targetChain);
|
|
249
250
|
const isBusy = submitting || isSubmitting;
|
|
250
251
|
const seededRecipientRef = _react.useRef.call(void 0, _nullishCoalesce(defaultRecipient, () => ( "")));
|
|
251
252
|
_react.useEffect.call(void 0, () => {
|
|
@@ -264,7 +265,7 @@ function WithdrawFormStep({
|
|
|
264
265
|
setIsSwitching(true);
|
|
265
266
|
switchChain(asset.chainId).catch((err) => {
|
|
266
267
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
267
|
-
setError(
|
|
268
|
+
setError(_chunkDSXMWQYBcjs.formatUserError.call(void 0, raw));
|
|
268
269
|
}).finally(() => {
|
|
269
270
|
setIsSwitching(false);
|
|
270
271
|
});
|
|
@@ -284,7 +285,7 @@ function WithdrawFormStep({
|
|
|
284
285
|
return;
|
|
285
286
|
}
|
|
286
287
|
try {
|
|
287
|
-
const bal =
|
|
288
|
+
const bal = _chunkDSXMWQYBcjs.isNativeAsset.call(void 0, asset) ? await publicClient.getBalance({ address: safeAddress }) : await publicClient.readContract({
|
|
288
289
|
address: asset.token,
|
|
289
290
|
abi: _viem.erc20Abi,
|
|
290
291
|
functionName: "balanceOf",
|
|
@@ -395,7 +396,7 @@ function WithdrawFormStep({
|
|
|
395
396
|
await onSubmit(recipient, amount);
|
|
396
397
|
} catch (err) {
|
|
397
398
|
const raw = err instanceof Error ? err.message : "Withdrawal failed";
|
|
398
|
-
setError(
|
|
399
|
+
setError(_chunkDSXMWQYBcjs.formatUserError.call(void 0, raw));
|
|
399
400
|
} finally {
|
|
400
401
|
setIsSubmitting(false);
|
|
401
402
|
}
|
|
@@ -411,16 +412,16 @@ function WithdrawFormStep({
|
|
|
411
412
|
if (isBalanceLoading) {
|
|
412
413
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
413
414
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-withdraw-loading", children: [
|
|
414
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
415
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDSXMWQYBcjs.Spinner, { className: "rs-spinner--lg" }),
|
|
415
416
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-withdraw-loading-title", children: "Loading on-chain balance" }),
|
|
416
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-withdraw-loading-subtitle", children: chainMismatch ? `Switch to ${
|
|
417
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-withdraw-loading-subtitle", children: chainMismatch ? `Switch to ${_chunkP5T4XSN2cjs.getChainName.call(void 0, asset.chainId)} to continue.` : "Please wait before withdrawing." })
|
|
417
418
|
] }),
|
|
418
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
419
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDSXMWQYBcjs.PoweredBy, {})
|
|
419
420
|
] });
|
|
420
421
|
}
|
|
421
422
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
422
423
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
423
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
424
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDSXMWQYBcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDSXMWQYBcjs.CircleArrowOutUpLeftIcon, {}), title: "Withdraw" }),
|
|
424
425
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-section", children: [
|
|
425
426
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
426
427
|
"label",
|
|
@@ -466,7 +467,7 @@ function WithdrawFormStep({
|
|
|
466
467
|
),
|
|
467
468
|
isRecipientConnected ? null : "Use connected"
|
|
468
469
|
] }) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
469
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
470
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDSXMWQYBcjs.WalletIcon, { className: "rs-withdraw-use-connected-icon" }),
|
|
470
471
|
isRecipientConnected ? null : "Use connected"
|
|
471
472
|
] })
|
|
472
473
|
}
|
|
@@ -506,7 +507,7 @@ function WithdrawFormStep({
|
|
|
506
507
|
) })
|
|
507
508
|
] }),
|
|
508
509
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-amount-info", children: [
|
|
509
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-withdraw-usd", children: amountUsd !== null ?
|
|
510
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-withdraw-usd", children: amountUsd !== null ? _chunkDSXMWQYBcjs.currencyFormatter.format(amountUsd) : "$0.00" }),
|
|
510
511
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-withdraw-balance", children: [
|
|
511
512
|
"Balance: ",
|
|
512
513
|
formattedBalance,
|
|
@@ -536,10 +537,10 @@ function WithdrawFormStep({
|
|
|
536
537
|
},
|
|
537
538
|
children: [
|
|
538
539
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-dropdown-value", children: [
|
|
539
|
-
|
|
540
|
+
_chunkP5T4XSN2cjs.getChainIcon.call(void 0, targetChain) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
540
541
|
"img",
|
|
541
542
|
{
|
|
542
|
-
src:
|
|
543
|
+
src: _chunkP5T4XSN2cjs.getChainIcon.call(void 0, targetChain),
|
|
543
544
|
alt: targetChainName,
|
|
544
545
|
className: "rs-withdraw-dropdown-icon"
|
|
545
546
|
}
|
|
@@ -547,7 +548,7 @@ function WithdrawFormStep({
|
|
|
547
548
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: targetChainName })
|
|
548
549
|
] }),
|
|
549
550
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
550
|
-
|
|
551
|
+
_chunkDSXMWQYBcjs.ChevronDownIcon,
|
|
551
552
|
{
|
|
552
553
|
className: "rs-withdraw-dropdown-arrow",
|
|
553
554
|
style: {
|
|
@@ -568,10 +569,10 @@ function WithdrawFormStep({
|
|
|
568
569
|
setShowChainDropdown(false);
|
|
569
570
|
},
|
|
570
571
|
children: [
|
|
571
|
-
|
|
572
|
+
_chunkP5T4XSN2cjs.getChainIcon.call(void 0, chain.id) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
572
573
|
"img",
|
|
573
574
|
{
|
|
574
|
-
src:
|
|
575
|
+
src: _chunkP5T4XSN2cjs.getChainIcon.call(void 0, chain.id),
|
|
575
576
|
alt: chain.name,
|
|
576
577
|
className: "rs-withdraw-dropdown-icon"
|
|
577
578
|
}
|
|
@@ -606,7 +607,7 @@ function WithdrawFormStep({
|
|
|
606
607
|
children: [
|
|
607
608
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-dropdown-value", children: [
|
|
608
609
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
609
|
-
|
|
610
|
+
_chunkDSXMWQYBcjs.TokenIcon,
|
|
610
611
|
{
|
|
611
612
|
symbol: targetSymbol,
|
|
612
613
|
className: "rs-withdraw-dropdown-icon"
|
|
@@ -615,7 +616,7 @@ function WithdrawFormStep({
|
|
|
615
616
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: targetSymbol })
|
|
616
617
|
] }),
|
|
617
618
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
618
|
-
|
|
619
|
+
_chunkDSXMWQYBcjs.ChevronDownIcon,
|
|
619
620
|
{
|
|
620
621
|
className: "rs-withdraw-dropdown-arrow",
|
|
621
622
|
style: {
|
|
@@ -637,7 +638,7 @@ function WithdrawFormStep({
|
|
|
637
638
|
},
|
|
638
639
|
children: [
|
|
639
640
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
640
|
-
|
|
641
|
+
_chunkDSXMWQYBcjs.TokenIcon,
|
|
641
642
|
{
|
|
642
643
|
symbol: option.symbol,
|
|
643
644
|
className: "rs-withdraw-dropdown-icon"
|
|
@@ -653,11 +654,11 @@ function WithdrawFormStep({
|
|
|
653
654
|
)
|
|
654
655
|
] })
|
|
655
656
|
] }),
|
|
656
|
-
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 ${
|
|
657
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
658
|
-
!error && registrationError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
657
|
+
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 ${_chunkP5T4XSN2cjs.getChainName.call(void 0, asset.chainId)}...` : `Switch to ${_chunkP5T4XSN2cjs.getChainName.call(void 0, asset.chainId)} to continue.` }) }),
|
|
658
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDSXMWQYBcjs.Callout, { variant: "error", children: error }),
|
|
659
|
+
!error && registrationError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDSXMWQYBcjs.Callout, { variant: "error", children: registrationError }),
|
|
659
660
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
660
|
-
|
|
661
|
+
_chunkDSXMWQYBcjs.Button,
|
|
661
662
|
{
|
|
662
663
|
onClick: handleWithdraw,
|
|
663
664
|
fullWidth: true,
|
|
@@ -667,7 +668,7 @@ function WithdrawFormStep({
|
|
|
667
668
|
}
|
|
668
669
|
)
|
|
669
670
|
] }),
|
|
670
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
671
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDSXMWQYBcjs.PoweredBy, {})
|
|
671
672
|
] });
|
|
672
673
|
}
|
|
673
674
|
WithdrawFormStep.displayName = "WithdrawFormStep";
|
|
@@ -681,6 +682,7 @@ function shortenAddress(addr) {
|
|
|
681
682
|
function WithdrawReviewStep({
|
|
682
683
|
sourceChain,
|
|
683
684
|
sourceSymbol,
|
|
685
|
+
sourceToken,
|
|
684
686
|
targetChain,
|
|
685
687
|
targetToken,
|
|
686
688
|
amount,
|
|
@@ -694,18 +696,22 @@ function WithdrawReviewStep({
|
|
|
694
696
|
}) {
|
|
695
697
|
const [isSubmitting, setIsSubmitting] = _react.useState.call(void 0, false);
|
|
696
698
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
697
|
-
const sourceChainName =
|
|
698
|
-
const sourceChainIcon =
|
|
699
|
-
const targetSymbol =
|
|
700
|
-
const targetChainName =
|
|
701
|
-
const targetChainIcon =
|
|
699
|
+
const sourceChainName = _chunkP5T4XSN2cjs.getChainName.call(void 0, sourceChain);
|
|
700
|
+
const sourceChainIcon = _chunkP5T4XSN2cjs.getChainIcon.call(void 0, sourceChain);
|
|
701
|
+
const targetSymbol = _chunkP5T4XSN2cjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
702
|
+
const targetChainName = _chunkP5T4XSN2cjs.getChainName.call(void 0, targetChain);
|
|
703
|
+
const targetChainIcon = _chunkP5T4XSN2cjs.getChainIcon.call(void 0, targetChain);
|
|
702
704
|
const amountNumber = Number(amount);
|
|
703
|
-
const formattedSendAmount = _nullishCoalesce(
|
|
704
|
-
const prices =
|
|
705
|
-
|
|
705
|
+
const formattedSendAmount = _nullishCoalesce(_chunkDSXMWQYBcjs.formatTokenAmount.call(void 0, amountNumber, sourceSymbol), () => ( amount));
|
|
706
|
+
const prices = _chunkDSXMWQYBcjs.useTokenPrices.call(void 0, service, [
|
|
707
|
+
{ chainId: sourceChain, address: sourceToken, symbol: sourceSymbol },
|
|
708
|
+
{ chainId: targetChain, address: targetToken, symbol: targetSymbol }
|
|
709
|
+
]);
|
|
710
|
+
const receiveDisplay = _nullishCoalesce(_chunkDSXMWQYBcjs.formatReceiveEstimate.call(void 0, {
|
|
706
711
|
sourceAmount: Number.isFinite(amountNumber) ? amountNumber : void 0,
|
|
707
712
|
sourceSymbol,
|
|
708
713
|
targetSymbol,
|
|
714
|
+
sourceTrusted: _chunkDSXMWQYBcjs.isRecognizedToken.call(void 0, sourceToken, sourceChain),
|
|
709
715
|
prices
|
|
710
716
|
}), () => ( // No price for the target token — an honest dash beats a wrong number.
|
|
711
717
|
"\u2014"));
|
|
@@ -716,7 +722,7 @@ function WithdrawReviewStep({
|
|
|
716
722
|
await onConfirm();
|
|
717
723
|
} catch (err) {
|
|
718
724
|
const raw = err instanceof Error ? err.message : "Withdraw failed";
|
|
719
|
-
const message =
|
|
725
|
+
const message = _chunkDSXMWQYBcjs.formatUserError.call(void 0, raw);
|
|
720
726
|
setError(message);
|
|
721
727
|
_optionalChain([onError, 'optionalCall', _10 => _10(message, "WITHDRAW_REVIEW_ERROR")]);
|
|
722
728
|
} finally {
|
|
@@ -727,9 +733,9 @@ function WithdrawReviewStep({
|
|
|
727
733
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
728
734
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
729
735
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
730
|
-
|
|
736
|
+
_chunkDSXMWQYBcjs.BodyHeader,
|
|
731
737
|
{
|
|
732
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
738
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDSXMWQYBcjs.CircleArrowOutUpLeftIcon, {}),
|
|
733
739
|
title: "Review withdrawal"
|
|
734
740
|
}
|
|
735
741
|
),
|
|
@@ -742,7 +748,7 @@ function WithdrawReviewStep({
|
|
|
742
748
|
" ",
|
|
743
749
|
sourceSymbol
|
|
744
750
|
] }),
|
|
745
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
751
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDSXMWQYBcjs.TokenIcon, { symbol: sourceSymbol }) })
|
|
746
752
|
] })
|
|
747
753
|
] }),
|
|
748
754
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
@@ -760,7 +766,7 @@ function WithdrawReviewStep({
|
|
|
760
766
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Receive" }),
|
|
761
767
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
762
768
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: receiveDisplay }),
|
|
763
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
769
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDSXMWQYBcjs.TokenIcon, { symbol: targetSymbol }) })
|
|
764
770
|
] })
|
|
765
771
|
] }),
|
|
766
772
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
@@ -775,10 +781,10 @@ function WithdrawReviewStep({
|
|
|
775
781
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-value", children: estimatedTime })
|
|
776
782
|
] })
|
|
777
783
|
] }),
|
|
778
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
779
|
-
!error && registrationError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
784
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDSXMWQYBcjs.Callout, { variant: "error", children: error }),
|
|
785
|
+
!error && registrationError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDSXMWQYBcjs.Callout, { variant: "error", children: registrationError }),
|
|
780
786
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
781
|
-
|
|
787
|
+
_chunkDSXMWQYBcjs.Button,
|
|
782
788
|
{
|
|
783
789
|
onClick: handleConfirm,
|
|
784
790
|
loading: isSubmitting,
|
|
@@ -789,7 +795,7 @@ function WithdrawReviewStep({
|
|
|
789
795
|
}
|
|
790
796
|
)
|
|
791
797
|
] }),
|
|
792
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
798
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDSXMWQYBcjs.PoweredBy, {})
|
|
793
799
|
] });
|
|
794
800
|
}
|
|
795
801
|
WithdrawReviewStep.displayName = "WithdrawReviewStep";
|
|
@@ -801,15 +807,15 @@ var ADDR_REGEX = /^0x[a-fA-F0-9]{40}$/;
|
|
|
801
807
|
var REGISTRATION_DEBOUNCE_MS = 600;
|
|
802
808
|
var WITHDRAW_INDEXING_DELAY_MS = 2e3;
|
|
803
809
|
function resolveSessionOwner(eoaAddress) {
|
|
804
|
-
const localOwner =
|
|
810
|
+
const localOwner = _chunkDSXMWQYBcjs.loadSessionOwnerFromStorage.call(void 0, eoaAddress);
|
|
805
811
|
if (localOwner) {
|
|
806
812
|
return {
|
|
807
|
-
account:
|
|
813
|
+
account: _chunkDSXMWQYBcjs.accountFromPrivateKey.call(void 0, localOwner.privateKey),
|
|
808
814
|
address: localOwner.address
|
|
809
815
|
};
|
|
810
816
|
}
|
|
811
|
-
const created =
|
|
812
|
-
|
|
817
|
+
const created = _chunkDSXMWQYBcjs.createSessionOwnerKey.call(void 0, );
|
|
818
|
+
_chunkDSXMWQYBcjs.saveSessionOwnerToStorage.call(void 0, eoaAddress, created.privateKey, created.address);
|
|
813
819
|
return { account: created.account, address: created.address };
|
|
814
820
|
}
|
|
815
821
|
function targetsEqual(a, b) {
|
|
@@ -829,7 +835,7 @@ function WithdrawFlow({
|
|
|
829
835
|
amount: defaultAmount,
|
|
830
836
|
service,
|
|
831
837
|
allowedRoutes,
|
|
832
|
-
signerAddress =
|
|
838
|
+
signerAddress = _chunkP5T4XSN2cjs.DEFAULT_SIGNER_ADDRESS,
|
|
833
839
|
sessionChainIds,
|
|
834
840
|
forceRegister = false,
|
|
835
841
|
reownWallet,
|
|
@@ -844,11 +850,11 @@ function WithdrawFlow({
|
|
|
844
850
|
onError,
|
|
845
851
|
debug
|
|
846
852
|
}) {
|
|
847
|
-
const rpcUrls =
|
|
848
|
-
const onStepChangeRef =
|
|
849
|
-
const onEventRef =
|
|
850
|
-
const onLifecycleRef =
|
|
851
|
-
const onErrorRef =
|
|
853
|
+
const rpcUrls = _chunkDSXMWQYBcjs.useRpcUrls.call(void 0, );
|
|
854
|
+
const onStepChangeRef = _chunkDSXMWQYBcjs.useLatestRef.call(void 0, onStepChange);
|
|
855
|
+
const onEventRef = _chunkDSXMWQYBcjs.useLatestRef.call(void 0, onEvent);
|
|
856
|
+
const onLifecycleRef = _chunkDSXMWQYBcjs.useLatestRef.call(void 0, onLifecycle);
|
|
857
|
+
const onErrorRef = _chunkDSXMWQYBcjs.useLatestRef.call(void 0, onError);
|
|
852
858
|
const isFlowActiveRef = _react.useRef.call(void 0, true);
|
|
853
859
|
const submitGenerationRef = _react.useRef.call(void 0, 0);
|
|
854
860
|
_react.useEffect.call(void 0, () => {
|
|
@@ -859,13 +865,13 @@ function WithdrawFlow({
|
|
|
859
865
|
}, []);
|
|
860
866
|
const logFlow = _react.useCallback.call(void 0,
|
|
861
867
|
(message, data) => {
|
|
862
|
-
|
|
868
|
+
_chunkDSXMWQYBcjs.debugLog.call(void 0, debug, "withdraw-flow", message, data);
|
|
863
869
|
},
|
|
864
870
|
[debug]
|
|
865
871
|
);
|
|
866
872
|
const logFlowError = _react.useCallback.call(void 0,
|
|
867
873
|
(message, error, data) => {
|
|
868
|
-
|
|
874
|
+
_chunkDSXMWQYBcjs.debugError.call(void 0, debug, "withdraw-flow", message, error, data);
|
|
869
875
|
},
|
|
870
876
|
[debug]
|
|
871
877
|
);
|
|
@@ -941,14 +947,14 @@ function WithdrawFlow({
|
|
|
941
947
|
return {
|
|
942
948
|
ownerAddress: dappAddress,
|
|
943
949
|
walletClient: _nullishCoalesce(dappWalletClient, () => ( void 0)),
|
|
944
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
950
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkDSXMWQYBcjs.getPublicClient.call(void 0, sourceChain, rpcUrls))),
|
|
945
951
|
switchChain: dappSwitchChain
|
|
946
952
|
};
|
|
947
953
|
}
|
|
948
954
|
return {
|
|
949
955
|
ownerAddress: dappWalletClient.account.address,
|
|
950
956
|
walletClient: dappWalletClient,
|
|
951
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
957
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkDSXMWQYBcjs.getPublicClient.call(void 0, sourceChain, rpcUrls))),
|
|
952
958
|
switchChain: dappSwitchChain
|
|
953
959
|
};
|
|
954
960
|
}
|
|
@@ -959,7 +965,7 @@ function WithdrawFlow({
|
|
|
959
965
|
return {
|
|
960
966
|
ownerAddress: dappWalletClient.account.address,
|
|
961
967
|
walletClient: dappWalletClient,
|
|
962
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
968
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkDSXMWQYBcjs.getPublicClient.call(void 0, sourceChain, rpcUrls))),
|
|
963
969
|
switchChain: dappSwitchChain
|
|
964
970
|
};
|
|
965
971
|
}
|
|
@@ -1017,7 +1023,7 @@ function WithdrawFlow({
|
|
|
1017
1023
|
const setup = await service.setupAccount({
|
|
1018
1024
|
ownerAddress,
|
|
1019
1025
|
sessionOwnerAddress: sessionOwner.address,
|
|
1020
|
-
targetChain:
|
|
1026
|
+
targetChain: _chunkP5T4XSN2cjs.toEvmCaip2.call(void 0, targetChain),
|
|
1021
1027
|
targetToken,
|
|
1022
1028
|
recipient: recipientForRegistration,
|
|
1023
1029
|
signerAddress,
|
|
@@ -1042,7 +1048,7 @@ function WithdrawFlow({
|
|
|
1042
1048
|
message: typedData.message
|
|
1043
1049
|
});
|
|
1044
1050
|
if (cancelled) return;
|
|
1045
|
-
const sessionDetails =
|
|
1051
|
+
const sessionDetails = _chunkDSXMWQYBcjs.buildSessionDetails.call(void 0,
|
|
1046
1052
|
setup.sessionDetailsUnsigned,
|
|
1047
1053
|
signature
|
|
1048
1054
|
);
|
|
@@ -1056,7 +1062,7 @@ function WithdrawFlow({
|
|
|
1056
1062
|
eoaAddress: ownerAddress,
|
|
1057
1063
|
sessionOwner: sessionOwner.address,
|
|
1058
1064
|
target: {
|
|
1059
|
-
chain:
|
|
1065
|
+
chain: _chunkP5T4XSN2cjs.toEvmCaip2.call(void 0, targetChain),
|
|
1060
1066
|
token: targetToken,
|
|
1061
1067
|
recipient: recipientForRegistration
|
|
1062
1068
|
}
|
|
@@ -1079,7 +1085,7 @@ function WithdrawFlow({
|
|
|
1079
1085
|
} catch (err) {
|
|
1080
1086
|
if (cancelled) return;
|
|
1081
1087
|
const raw = err instanceof Error ? err.message : "Registration failed";
|
|
1082
|
-
const message =
|
|
1088
|
+
const message = _chunkDSXMWQYBcjs.formatUserError.call(void 0, raw);
|
|
1083
1089
|
logFlowError("auto-register:failed", err, {
|
|
1084
1090
|
ownerAddress,
|
|
1085
1091
|
targetChain,
|
|
@@ -1112,10 +1118,10 @@ function WithdrawFlow({
|
|
|
1112
1118
|
onErrorRef
|
|
1113
1119
|
]);
|
|
1114
1120
|
const asset = _react.useMemo.call(void 0, () => {
|
|
1115
|
-
const symbol =
|
|
1116
|
-
const decimals =
|
|
1121
|
+
const symbol = _chunkP5T4XSN2cjs.getTokenSymbol.call(void 0, sourceToken, sourceChain);
|
|
1122
|
+
const decimals = _chunkP5T4XSN2cjs.getTokenDecimalsByAddress.call(void 0, sourceToken, sourceChain);
|
|
1117
1123
|
return {
|
|
1118
|
-
id:
|
|
1124
|
+
id: _chunkDSXMWQYBcjs.getAssetId.call(void 0, { chainId: sourceChain, token: sourceToken }),
|
|
1119
1125
|
chainId: sourceChain,
|
|
1120
1126
|
token: sourceToken,
|
|
1121
1127
|
symbol,
|
|
@@ -1123,7 +1129,7 @@ function WithdrawFlow({
|
|
|
1123
1129
|
decimals
|
|
1124
1130
|
};
|
|
1125
1131
|
}, [sourceChain, sourceToken]);
|
|
1126
|
-
const isSourceNative = sourceToken.toLowerCase() ===
|
|
1132
|
+
const isSourceNative = sourceToken.toLowerCase() === _chunkP5T4XSN2cjs.NATIVE_TOKEN_ADDRESS.toLowerCase();
|
|
1127
1133
|
const isSameRoute = targetChain === sourceChain && targetToken.toLowerCase() === sourceToken.toLowerCase();
|
|
1128
1134
|
const reviewedTarget = reviewedRecipient ? {
|
|
1129
1135
|
chain: targetChain,
|
|
@@ -1148,8 +1154,8 @@ function WithdrawFlow({
|
|
|
1148
1154
|
}
|
|
1149
1155
|
if (lastStepOpenEventKeyRef.current === "form") return;
|
|
1150
1156
|
lastStepOpenEventKeyRef.current = "form";
|
|
1151
|
-
const tokenSymbol =
|
|
1152
|
-
const chainName =
|
|
1157
|
+
const tokenSymbol = _chunkP5T4XSN2cjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
1158
|
+
const chainName = _chunkP5T4XSN2cjs.getChainName.call(void 0, targetChain);
|
|
1153
1159
|
_optionalChain([onEventRef, 'access', _39 => _39.current, 'optionalCall', _40 => _40({
|
|
1154
1160
|
type: "withdraw_modal_select_amount_open",
|
|
1155
1161
|
pred_balance: totalBalanceUsd,
|
|
@@ -1186,8 +1192,8 @@ function WithdrawFlow({
|
|
|
1186
1192
|
);
|
|
1187
1193
|
const handleFormContinue = _react.useCallback.call(void 0,
|
|
1188
1194
|
(recipient, amountValue) => {
|
|
1189
|
-
const tokenSymbol =
|
|
1190
|
-
const chainName =
|
|
1195
|
+
const tokenSymbol = _chunkP5T4XSN2cjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
1196
|
+
const chainName = _chunkP5T4XSN2cjs.getChainName.call(void 0, targetChain);
|
|
1191
1197
|
_optionalChain([onEventRef, 'access', _43 => _43.current, 'optionalCall', _44 => _44({
|
|
1192
1198
|
type: "withdraw_modal_select_amount_cta_click",
|
|
1193
1199
|
pred_balance: totalBalanceUsd,
|
|
@@ -1255,7 +1261,7 @@ function WithdrawFlow({
|
|
|
1255
1261
|
targetToken
|
|
1256
1262
|
});
|
|
1257
1263
|
const amountUnits = _viem.parseUnits.call(void 0, amountValue, asset.decimals);
|
|
1258
|
-
const pc = _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess', _46 => _46.publicClient]), () => (
|
|
1264
|
+
const pc = _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess', _46 => _46.publicClient]), () => ( _chunkDSXMWQYBcjs.getPublicClient.call(void 0, sourceChain, rpcUrls)));
|
|
1259
1265
|
let result;
|
|
1260
1266
|
if (onSignTransaction) {
|
|
1261
1267
|
const transferTarget = isSameRoute ? recipient : smartAccount;
|
|
@@ -1268,7 +1274,7 @@ function WithdrawFlow({
|
|
|
1268
1274
|
args: [transferTarget, amountUnits]
|
|
1269
1275
|
})
|
|
1270
1276
|
};
|
|
1271
|
-
const request = await
|
|
1277
|
+
const request = await _chunkUNVVUULPcjs.buildSafeTransaction.call(void 0, {
|
|
1272
1278
|
publicClient: pc,
|
|
1273
1279
|
safeAddress,
|
|
1274
1280
|
to: transferData.to,
|
|
@@ -1284,7 +1290,7 @@ function WithdrawFlow({
|
|
|
1284
1290
|
}
|
|
1285
1291
|
const relayResult = await service.relayWithdraw({
|
|
1286
1292
|
smartAccount,
|
|
1287
|
-
chainId:
|
|
1293
|
+
chainId: _chunkP5T4XSN2cjs.toEvmCaip2.call(void 0, sourceChain),
|
|
1288
1294
|
safeAddress,
|
|
1289
1295
|
safeTransaction: request.typedData.message,
|
|
1290
1296
|
signature
|
|
@@ -1297,7 +1303,7 @@ function WithdrawFlow({
|
|
|
1297
1303
|
if (!getMatchingRegistration()) {
|
|
1298
1304
|
throw new Error("Withdrawal target changed before submission");
|
|
1299
1305
|
}
|
|
1300
|
-
result = await
|
|
1306
|
+
result = await _chunkUNVVUULPcjs.executeSafeEthTransfer.call(void 0, {
|
|
1301
1307
|
walletClient: signerContext.walletClient,
|
|
1302
1308
|
publicClient: pc,
|
|
1303
1309
|
safeAddress,
|
|
@@ -1309,7 +1315,7 @@ function WithdrawFlow({
|
|
|
1309
1315
|
if (!getMatchingRegistration()) {
|
|
1310
1316
|
throw new Error("Withdrawal target changed before submission");
|
|
1311
1317
|
}
|
|
1312
|
-
result = await
|
|
1318
|
+
result = await _chunkUNVVUULPcjs.executeSafeErc20Transfer.call(void 0, {
|
|
1313
1319
|
walletClient: signerContext.walletClient,
|
|
1314
1320
|
publicClient: pc,
|
|
1315
1321
|
safeAddress,
|
|
@@ -1343,7 +1349,7 @@ function WithdrawFlow({
|
|
|
1343
1349
|
targetChain,
|
|
1344
1350
|
targetToken
|
|
1345
1351
|
});
|
|
1346
|
-
handleError(
|
|
1352
|
+
handleError(_chunkDSXMWQYBcjs.formatUserError.call(void 0, raw), "WITHDRAW_FLOW_ERROR");
|
|
1347
1353
|
throw err;
|
|
1348
1354
|
}
|
|
1349
1355
|
},
|
|
@@ -1409,9 +1415,9 @@ function WithdrawFlow({
|
|
|
1409
1415
|
[_optionalChain([allowedRoutes, 'optionalAccess', _56 => _56.sourceTokens])]
|
|
1410
1416
|
);
|
|
1411
1417
|
const targetChainOptions = _react.useMemo.call(void 0, () => {
|
|
1412
|
-
return
|
|
1418
|
+
return _chunkP5T4XSN2cjs.SOURCE_CHAINS.filter((chain) => {
|
|
1413
1419
|
if (allowedChainSet && !allowedChainSet.has(chain.id)) return false;
|
|
1414
|
-
const tokens =
|
|
1420
|
+
const tokens = _chunkP5T4XSN2cjs.getSupportedTargetTokens.call(void 0, chain.id);
|
|
1415
1421
|
if (allowedTokenSet) {
|
|
1416
1422
|
return tokens.some((t) => allowedTokenSet.has(t.symbol.toUpperCase()));
|
|
1417
1423
|
}
|
|
@@ -1419,7 +1425,7 @@ function WithdrawFlow({
|
|
|
1419
1425
|
});
|
|
1420
1426
|
}, [allowedChainSet, allowedTokenSet]);
|
|
1421
1427
|
const targetTokenOptions = _react.useMemo.call(void 0, () => {
|
|
1422
|
-
const tokens =
|
|
1428
|
+
const tokens = _chunkP5T4XSN2cjs.getSupportedTargetTokens.call(void 0, targetChain);
|
|
1423
1429
|
if (!allowedTokenSet) return tokens;
|
|
1424
1430
|
return tokens.filter((t) => allowedTokenSet.has(t.symbol.toUpperCase()));
|
|
1425
1431
|
}, [targetChain, allowedTokenSet]);
|
|
@@ -1433,7 +1439,7 @@ function WithdrawFlow({
|
|
|
1433
1439
|
const handleTargetChainChange = _react.useCallback.call(void 0,
|
|
1434
1440
|
(chainId) => {
|
|
1435
1441
|
setTargetChain(chainId);
|
|
1436
|
-
let options =
|
|
1442
|
+
let options = _chunkP5T4XSN2cjs.getSupportedTargetTokens.call(void 0, chainId);
|
|
1437
1443
|
if (allowedTokenSet) {
|
|
1438
1444
|
options = options.filter(
|
|
1439
1445
|
(t) => allowedTokenSet.has(t.symbol.toUpperCase())
|
|
@@ -1483,7 +1489,7 @@ function WithdrawFlow({
|
|
|
1483
1489
|
state: "ready"
|
|
1484
1490
|
}));
|
|
1485
1491
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1486
|
-
|
|
1492
|
+
_chunkDSXMWQYBcjs.ConnectStep,
|
|
1487
1493
|
{
|
|
1488
1494
|
walletRows: withdrawRows,
|
|
1489
1495
|
onConfirmWallet: (walletId) => {
|
|
@@ -1501,7 +1507,7 @@ function WithdrawFlow({
|
|
|
1501
1507
|
if (!signerContext) return null;
|
|
1502
1508
|
if (!onSignTransaction && !signerContext.walletClient) return null;
|
|
1503
1509
|
const resolvedConnectedRecipient = _optionalChain([selectedWalletOption, 'optionalAccess', _63 => _63.kind]) === "external" ? selectedWalletOption.address : void 0;
|
|
1504
|
-
const formPublicClient = _nullishCoalesce(signerContext.publicClient, () => (
|
|
1510
|
+
const formPublicClient = _nullishCoalesce(signerContext.publicClient, () => ( _chunkDSXMWQYBcjs.getPublicClient.call(void 0, sourceChain, rpcUrls)));
|
|
1505
1511
|
const depositAddress = registration.kind === "ready" || registration.kind === "stale" ? registration.smartAccount : void 0;
|
|
1506
1512
|
const stepView = deriveStepView(flowStep, registration);
|
|
1507
1513
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
@@ -1536,6 +1542,7 @@ function WithdrawFlow({
|
|
|
1536
1542
|
{
|
|
1537
1543
|
sourceChain,
|
|
1538
1544
|
sourceSymbol: asset.symbol,
|
|
1545
|
+
sourceToken,
|
|
1539
1546
|
targetChain,
|
|
1540
1547
|
targetToken,
|
|
1541
1548
|
amount: _nullishCoalesce(storeApi.getState().amount, () => ( "0")),
|
|
@@ -1548,7 +1555,7 @@ function WithdrawFlow({
|
|
|
1548
1555
|
}
|
|
1549
1556
|
),
|
|
1550
1557
|
stepView === "processing" && registration.kind !== "idle" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1551
|
-
|
|
1558
|
+
_chunkDSXMWQYBcjs.ProcessingStep,
|
|
1552
1559
|
{
|
|
1553
1560
|
smartAccount: registration.kind === "ready" || registration.kind === "stale" ? registration.smartAccount : "0x0",
|
|
1554
1561
|
txHash: _nullishCoalesce(storeApi.getState().txHash, () => ( "0x0")),
|
|
@@ -1590,7 +1597,7 @@ function deriveStepView(step, _registration) {
|
|
|
1590
1597
|
// src/WithdrawModal.tsx
|
|
1591
1598
|
|
|
1592
1599
|
var ReownWithdrawInner = _react.lazy.call(void 0,
|
|
1593
|
-
() => Promise.resolve().then(() => _interopRequireWildcard(require("./WithdrawModalReown-
|
|
1600
|
+
() => Promise.resolve().then(() => _interopRequireWildcard(require("./WithdrawModalReown-KUWNNA2X.cjs"))).then((m) => ({
|
|
1594
1601
|
default: m.WithdrawModalReown
|
|
1595
1602
|
}))
|
|
1596
1603
|
);
|
|
@@ -1618,9 +1625,9 @@ function WithdrawModalInner({
|
|
|
1618
1625
|
inline,
|
|
1619
1626
|
closeOnOverlayClick,
|
|
1620
1627
|
allowedRoutes,
|
|
1621
|
-
backendUrl =
|
|
1628
|
+
backendUrl = _chunkP5T4XSN2cjs.DEFAULT_BACKEND_URL,
|
|
1622
1629
|
rpcUrls: rpcUrlsProp,
|
|
1623
|
-
signerAddress =
|
|
1630
|
+
signerAddress = _chunkP5T4XSN2cjs.DEFAULT_SIGNER_ADDRESS,
|
|
1624
1631
|
sessionChainIds,
|
|
1625
1632
|
forceRegister = false,
|
|
1626
1633
|
reownWallet,
|
|
@@ -1638,19 +1645,19 @@ function WithdrawModalInner({
|
|
|
1638
1645
|
debug
|
|
1639
1646
|
}) {
|
|
1640
1647
|
const modalRef = _react.useRef.call(void 0, null);
|
|
1641
|
-
const onReadyRef =
|
|
1648
|
+
const onReadyRef = _chunkDSXMWQYBcjs.useLatestRef.call(void 0, onReady);
|
|
1642
1649
|
const [backHandler, setBackHandler] = _react.useState.call(void 0,
|
|
1643
1650
|
void 0
|
|
1644
1651
|
);
|
|
1645
|
-
const targetChain =
|
|
1646
|
-
const sourceChain =
|
|
1647
|
-
const rpcUrls =
|
|
1652
|
+
const targetChain = _chunkP5T4XSN2cjs.getChainId.call(void 0, targetChainProp);
|
|
1653
|
+
const sourceChain = _chunkP5T4XSN2cjs.getChainId.call(void 0, sourceChainProp);
|
|
1654
|
+
const rpcUrls = _chunkDSXMWQYBcjs.useStableRpcUrls.call(void 0, rpcUrlsProp);
|
|
1648
1655
|
const service = _react.useMemo.call(void 0,
|
|
1649
|
-
() =>
|
|
1656
|
+
() => _chunkDSXMWQYBcjs.createDepositService.call(void 0, backendUrl, { debug, debugScope: "service:withdraw" }),
|
|
1650
1657
|
[backendUrl, debug]
|
|
1651
1658
|
);
|
|
1652
1659
|
const store = _react.useMemo.call(void 0, () => createWithdrawStore(), []);
|
|
1653
|
-
const onErrorRef =
|
|
1660
|
+
const onErrorRef = _chunkDSXMWQYBcjs.useLatestRef.call(void 0, onError);
|
|
1654
1661
|
_react.useEffect.call(void 0, () => {
|
|
1655
1662
|
if (isOpen && onSignTransaction && !dappAddress) {
|
|
1656
1663
|
_optionalChain([onErrorRef, 'access', _64 => _64.current, 'optionalCall', _65 => _65({
|
|
@@ -1661,7 +1668,7 @@ function WithdrawModalInner({
|
|
|
1661
1668
|
}, [isOpen, onSignTransaction, dappAddress, onErrorRef]);
|
|
1662
1669
|
_react.useEffect.call(void 0, () => {
|
|
1663
1670
|
if (isOpen && modalRef.current) {
|
|
1664
|
-
|
|
1671
|
+
_chunkDSXMWQYBcjs.applyTheme.call(void 0, modalRef.current, theme);
|
|
1665
1672
|
}
|
|
1666
1673
|
}, [isOpen, theme]);
|
|
1667
1674
|
_react.useEffect.call(void 0, () => {
|
|
@@ -1679,8 +1686,8 @@ function WithdrawModalInner({
|
|
|
1679
1686
|
}, []);
|
|
1680
1687
|
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _68 => _68.showBackButton]), () => ( true));
|
|
1681
1688
|
const canGoBack = backHandler !== void 0;
|
|
1682
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1683
|
-
|
|
1689
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDSXMWQYBcjs.RpcUrlsProvider, { value: rpcUrls, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, WithdrawStoreProvider, { store, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1690
|
+
_chunkDSXMWQYBcjs.Modal,
|
|
1684
1691
|
{
|
|
1685
1692
|
isOpen,
|
|
1686
1693
|
onClose,
|
|
@@ -1696,7 +1703,7 @@ function WithdrawModalInner({
|
|
|
1696
1703
|
className: "rs-modal-header-back",
|
|
1697
1704
|
"aria-label": "Go back",
|
|
1698
1705
|
onClick: backHandler,
|
|
1699
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1706
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDSXMWQYBcjs.ChevronLeftIcon, {})
|
|
1700
1707
|
}
|
|
1701
1708
|
) }),
|
|
1702
1709
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-header-nav-right", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -1706,7 +1713,7 @@ function WithdrawModalInner({
|
|
|
1706
1713
|
onClick: onClose,
|
|
1707
1714
|
className: "rs-modal-close",
|
|
1708
1715
|
"aria-label": "Close",
|
|
1709
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1716
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDSXMWQYBcjs.CloseIcon, {})
|
|
1710
1717
|
}
|
|
1711
1718
|
) })
|
|
1712
1719
|
] }),
|