@rhinestone/deposit-modal 0.3.1 → 0.4.0
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-MECHBE6P.cjs → DepositModalReown-KFTMS2WX.cjs} +9 -9
- package/dist/{DepositModalReown-G7UX4IBZ.mjs → DepositModalReown-PC7EX5VK.mjs} +6 -6
- package/dist/{WithdrawModalReown-CUJAFUQM.mjs → WithdrawModalReown-BE23LUMT.mjs} +5 -5
- package/dist/{WithdrawModalReown-WJ6VBZKK.cjs → WithdrawModalReown-Z2YF2FSJ.cjs} +8 -8
- package/dist/{chunk-ULEAK63T.cjs → chunk-3MXWIYAT.cjs} +16 -6
- package/dist/{chunk-QYSCCX4K.mjs → chunk-3PVDRSJ7.mjs} +539 -412
- package/dist/{chunk-SPUZLWQS.cjs → chunk-7MP2UWIQ.cjs} +519 -392
- package/dist/{chunk-MILJQWPT.cjs → chunk-ABVRVW3P.cjs} +133 -8
- package/dist/{chunk-LEL6GMEQ.cjs → chunk-AE5LHTPM.cjs} +121 -101
- package/dist/{chunk-TQ2AYMWS.mjs → chunk-F7P4MV72.mjs} +1 -1
- package/dist/{chunk-BAEB5AFZ.mjs → chunk-FJWLC4AM.mjs} +1 -1
- package/dist/{chunk-3C35DVPE.mjs → chunk-GKC22JC4.mjs} +901 -428
- package/dist/{chunk-R5CPOBCF.cjs → chunk-NRNJAQUA.cjs} +4 -4
- package/dist/{chunk-MQIJZNTP.cjs → chunk-OQVLEVNR.cjs} +760 -287
- package/dist/{chunk-AJHFNHG3.cjs → chunk-UEKPBRBY.cjs} +3 -3
- package/dist/{chunk-R5WDHHVM.mjs → chunk-UFKFSGT3.mjs} +14 -4
- package/dist/{chunk-DZQD3DAV.mjs → chunk-WCIGOV34.mjs} +32 -12
- package/dist/{chunk-6YRDD462.mjs → chunk-WJX3TJFK.mjs} +135 -10
- package/dist/constants.cjs +2 -2
- package/dist/constants.mjs +1 -1
- package/dist/deposit.cjs +6 -6
- package/dist/deposit.d.cts +2 -2
- package/dist/deposit.d.ts +2 -2
- package/dist/deposit.mjs +5 -5
- package/dist/index.cjs +7 -7
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +6 -6
- package/dist/polymarket.cjs +6 -6
- package/dist/polymarket.mjs +3 -3
- package/dist/styles.css +218 -9
- package/dist/{types-RzfAD14B.d.ts → types-CFRuisqK.d.cts} +1 -1
- package/dist/{types-RzfAD14B.d.cts → types-CFRuisqK.d.ts} +1 -1
- package/dist/withdraw.cjs +5 -5
- package/dist/withdraw.d.cts +2 -2
- package/dist/withdraw.d.ts +2 -2
- package/dist/withdraw.mjs +4 -4
- package/package.json +1 -1
|
@@ -27,15 +27,15 @@
|
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
|
|
30
|
-
var _chunkMQIJZNTPcjs = require('./chunk-MQIJZNTP.cjs');
|
|
31
30
|
|
|
32
31
|
|
|
33
32
|
|
|
33
|
+
var _chunkOQVLEVNRcjs = require('./chunk-OQVLEVNR.cjs');
|
|
34
34
|
|
|
35
|
-
var _chunkAJHFNHG3cjs = require('./chunk-AJHFNHG3.cjs');
|
|
36
35
|
|
|
37
36
|
|
|
38
37
|
|
|
38
|
+
var _chunkUEKPBRBYcjs = require('./chunk-UEKPBRBY.cjs');
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
|
|
@@ -46,7 +46,10 @@ var _chunkAJHFNHG3cjs = require('./chunk-AJHFNHG3.cjs');
|
|
|
46
46
|
|
|
47
47
|
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
var _chunkABVRVW3Pcjs = require('./chunk-ABVRVW3P.cjs');
|
|
50
53
|
|
|
51
54
|
// src/WithdrawModal.tsx
|
|
52
55
|
|
|
@@ -237,8 +240,8 @@ function WithdrawFormStep({
|
|
|
237
240
|
const chainMismatch = Boolean(
|
|
238
241
|
_optionalChain([walletClient, 'optionalAccess', _3 => _3.chain, 'optionalAccess', _4 => _4.id]) && walletClient.chain.id !== asset.chainId
|
|
239
242
|
);
|
|
240
|
-
const targetSymbol =
|
|
241
|
-
const targetChainName =
|
|
243
|
+
const targetSymbol = _chunkABVRVW3Pcjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
244
|
+
const targetChainName = _chunkABVRVW3Pcjs.getChainName.call(void 0, targetChain);
|
|
242
245
|
const isBusy = submitting || isSubmitting;
|
|
243
246
|
const seededRecipientRef = _react.useRef.call(void 0, _nullishCoalesce(defaultRecipient, () => ( "")));
|
|
244
247
|
_react.useEffect.call(void 0, () => {
|
|
@@ -257,7 +260,7 @@ function WithdrawFormStep({
|
|
|
257
260
|
setIsSwitching(true);
|
|
258
261
|
switchChain(asset.chainId).catch((err) => {
|
|
259
262
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
260
|
-
setError(
|
|
263
|
+
setError(_chunkOQVLEVNRcjs.formatUserError.call(void 0, raw));
|
|
261
264
|
}).finally(() => {
|
|
262
265
|
setIsSwitching(false);
|
|
263
266
|
});
|
|
@@ -277,7 +280,7 @@ function WithdrawFormStep({
|
|
|
277
280
|
return;
|
|
278
281
|
}
|
|
279
282
|
try {
|
|
280
|
-
const bal =
|
|
283
|
+
const bal = _chunkOQVLEVNRcjs.isNativeAsset.call(void 0, asset) ? await publicClient.getBalance({ address: safeAddress }) : await publicClient.readContract({
|
|
281
284
|
address: asset.token,
|
|
282
285
|
abi: _viem.erc20Abi,
|
|
283
286
|
functionName: "balanceOf",
|
|
@@ -381,7 +384,7 @@ function WithdrawFormStep({
|
|
|
381
384
|
await onSubmit(recipient, amount);
|
|
382
385
|
} catch (err) {
|
|
383
386
|
const raw = err instanceof Error ? err.message : "Withdrawal failed";
|
|
384
|
-
setError(
|
|
387
|
+
setError(_chunkOQVLEVNRcjs.formatUserError.call(void 0, raw));
|
|
385
388
|
} finally {
|
|
386
389
|
setIsSubmitting(false);
|
|
387
390
|
}
|
|
@@ -389,16 +392,16 @@ function WithdrawFormStep({
|
|
|
389
392
|
if (isBalanceLoading) {
|
|
390
393
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
391
394
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-withdraw-loading", children: [
|
|
392
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
395
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.Spinner, { className: "rs-spinner--lg" }),
|
|
393
396
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-withdraw-loading-title", children: "Loading on-chain balance" }),
|
|
394
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-withdraw-loading-subtitle", children: chainMismatch ? `Switch to ${
|
|
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." })
|
|
395
398
|
] }),
|
|
396
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
399
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.PoweredBy, {})
|
|
397
400
|
] });
|
|
398
401
|
}
|
|
399
402
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
400
403
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
401
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
404
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.CircleArrowOutUpLeftIcon, {}), title: "Withdraw" }),
|
|
402
405
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-section", children: [
|
|
403
406
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
404
407
|
"label",
|
|
@@ -444,7 +447,7 @@ function WithdrawFormStep({
|
|
|
444
447
|
),
|
|
445
448
|
isRecipientConnected ? null : "Use connected"
|
|
446
449
|
] }) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
447
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
450
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.WalletIcon, { className: "rs-withdraw-use-connected-icon" }),
|
|
448
451
|
isRecipientConnected ? null : "Use connected"
|
|
449
452
|
] })
|
|
450
453
|
}
|
|
@@ -484,7 +487,7 @@ function WithdrawFormStep({
|
|
|
484
487
|
) })
|
|
485
488
|
] }),
|
|
486
489
|
/* @__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 ?
|
|
490
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-withdraw-usd", children: amountUsd !== null ? _chunkOQVLEVNRcjs.currencyFormatter.format(amountUsd) : "$0.00" }),
|
|
488
491
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-withdraw-balance", children: [
|
|
489
492
|
"Balance: ",
|
|
490
493
|
formattedBalance,
|
|
@@ -514,10 +517,10 @@ function WithdrawFormStep({
|
|
|
514
517
|
},
|
|
515
518
|
children: [
|
|
516
519
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-dropdown-value", children: [
|
|
517
|
-
|
|
520
|
+
_chunkABVRVW3Pcjs.getChainIcon.call(void 0, targetChain) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
518
521
|
"img",
|
|
519
522
|
{
|
|
520
|
-
src:
|
|
523
|
+
src: _chunkABVRVW3Pcjs.getChainIcon.call(void 0, targetChain),
|
|
521
524
|
alt: targetChainName,
|
|
522
525
|
className: "rs-withdraw-dropdown-icon"
|
|
523
526
|
}
|
|
@@ -525,7 +528,7 @@ function WithdrawFormStep({
|
|
|
525
528
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: targetChainName })
|
|
526
529
|
] }),
|
|
527
530
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
528
|
-
|
|
531
|
+
_chunkOQVLEVNRcjs.ChevronDownIcon,
|
|
529
532
|
{
|
|
530
533
|
className: "rs-withdraw-dropdown-arrow",
|
|
531
534
|
style: {
|
|
@@ -546,10 +549,10 @@ function WithdrawFormStep({
|
|
|
546
549
|
setShowChainDropdown(false);
|
|
547
550
|
},
|
|
548
551
|
children: [
|
|
549
|
-
|
|
552
|
+
_chunkABVRVW3Pcjs.getChainIcon.call(void 0, chain.id) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
550
553
|
"img",
|
|
551
554
|
{
|
|
552
|
-
src:
|
|
555
|
+
src: _chunkABVRVW3Pcjs.getChainIcon.call(void 0, chain.id),
|
|
553
556
|
alt: chain.name,
|
|
554
557
|
className: "rs-withdraw-dropdown-icon"
|
|
555
558
|
}
|
|
@@ -583,10 +586,10 @@ function WithdrawFormStep({
|
|
|
583
586
|
},
|
|
584
587
|
children: [
|
|
585
588
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-dropdown-value", children: [
|
|
586
|
-
|
|
589
|
+
_chunkABVRVW3Pcjs.getTokenIcon.call(void 0, targetSymbol) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
587
590
|
"img",
|
|
588
591
|
{
|
|
589
|
-
src:
|
|
592
|
+
src: _chunkABVRVW3Pcjs.getTokenIcon.call(void 0, targetSymbol),
|
|
590
593
|
alt: targetSymbol,
|
|
591
594
|
className: "rs-withdraw-dropdown-icon"
|
|
592
595
|
}
|
|
@@ -594,7 +597,7 @@ function WithdrawFormStep({
|
|
|
594
597
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: targetSymbol })
|
|
595
598
|
] }),
|
|
596
599
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
597
|
-
|
|
600
|
+
_chunkOQVLEVNRcjs.ChevronDownIcon,
|
|
598
601
|
{
|
|
599
602
|
className: "rs-withdraw-dropdown-arrow",
|
|
600
603
|
style: {
|
|
@@ -615,10 +618,10 @@ function WithdrawFormStep({
|
|
|
615
618
|
setShowTokenDropdown(false);
|
|
616
619
|
},
|
|
617
620
|
children: [
|
|
618
|
-
|
|
621
|
+
_chunkABVRVW3Pcjs.getTokenIcon.call(void 0, option.symbol) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
619
622
|
"img",
|
|
620
623
|
{
|
|
621
|
-
src:
|
|
624
|
+
src: _chunkABVRVW3Pcjs.getTokenIcon.call(void 0, option.symbol),
|
|
622
625
|
alt: option.symbol,
|
|
623
626
|
className: "rs-withdraw-dropdown-icon"
|
|
624
627
|
}
|
|
@@ -633,11 +636,11 @@ function WithdrawFormStep({
|
|
|
633
636
|
)
|
|
634
637
|
] })
|
|
635
638
|
] }),
|
|
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 ${
|
|
637
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
638
|
-
!error && registrationError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
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, _chunkOQVLEVNRcjs.Callout, { variant: "error", children: error }),
|
|
641
|
+
!error && registrationError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.Callout, { variant: "error", children: registrationError }),
|
|
639
642
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
640
|
-
|
|
643
|
+
_chunkOQVLEVNRcjs.Button,
|
|
641
644
|
{
|
|
642
645
|
onClick: handleWithdraw,
|
|
643
646
|
fullWidth: true,
|
|
@@ -647,7 +650,7 @@ function WithdrawFormStep({
|
|
|
647
650
|
}
|
|
648
651
|
)
|
|
649
652
|
] }),
|
|
650
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
653
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.PoweredBy, {})
|
|
651
654
|
] });
|
|
652
655
|
}
|
|
653
656
|
WithdrawFormStep.displayName = "WithdrawFormStep";
|
|
@@ -668,18 +671,29 @@ function WithdrawReviewStep({
|
|
|
668
671
|
estimatedTime = "< 1 min",
|
|
669
672
|
registrationPending = false,
|
|
670
673
|
registrationError = null,
|
|
674
|
+
service,
|
|
671
675
|
onConfirm,
|
|
672
676
|
onError
|
|
673
677
|
}) {
|
|
674
678
|
const [isSubmitting, setIsSubmitting] = _react.useState.call(void 0, false);
|
|
675
679
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
676
|
-
const sourceChainName =
|
|
677
|
-
const sourceChainIcon =
|
|
678
|
-
const targetSymbol =
|
|
679
|
-
const targetChainName =
|
|
680
|
-
const targetChainIcon =
|
|
681
|
-
const sourceTokenIcon =
|
|
682
|
-
const targetTokenIcon =
|
|
680
|
+
const sourceChainName = _chunkABVRVW3Pcjs.getChainName.call(void 0, sourceChain);
|
|
681
|
+
const sourceChainIcon = _chunkABVRVW3Pcjs.getChainIcon.call(void 0, sourceChain);
|
|
682
|
+
const targetSymbol = _chunkABVRVW3Pcjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
683
|
+
const targetChainName = _chunkABVRVW3Pcjs.getChainName.call(void 0, targetChain);
|
|
684
|
+
const targetChainIcon = _chunkABVRVW3Pcjs.getChainIcon.call(void 0, targetChain);
|
|
685
|
+
const sourceTokenIcon = _chunkABVRVW3Pcjs.getTokenIcon.call(void 0, sourceSymbol);
|
|
686
|
+
const targetTokenIcon = _chunkABVRVW3Pcjs.getTokenIcon.call(void 0, targetSymbol);
|
|
687
|
+
const amountNumber = Number(amount);
|
|
688
|
+
const formattedSendAmount = _nullishCoalesce(_chunkOQVLEVNRcjs.formatTokenAmount.call(void 0, amountNumber, sourceSymbol), () => ( amount));
|
|
689
|
+
const prices = _chunkOQVLEVNRcjs.useTokenPrices.call(void 0, service, [sourceSymbol, targetSymbol]);
|
|
690
|
+
const receiveDisplay = _nullishCoalesce(_chunkOQVLEVNRcjs.formatReceiveEstimate.call(void 0, {
|
|
691
|
+
sourceAmount: Number.isFinite(amountNumber) ? amountNumber : void 0,
|
|
692
|
+
sourceSymbol,
|
|
693
|
+
targetSymbol,
|
|
694
|
+
prices
|
|
695
|
+
}), () => ( // No price for the target token — an honest dash beats a wrong number.
|
|
696
|
+
"\u2014"));
|
|
683
697
|
const handleConfirm = async () => {
|
|
684
698
|
setError(null);
|
|
685
699
|
setIsSubmitting(true);
|
|
@@ -687,7 +701,7 @@ function WithdrawReviewStep({
|
|
|
687
701
|
await onConfirm();
|
|
688
702
|
} catch (err) {
|
|
689
703
|
const raw = err instanceof Error ? err.message : "Withdraw failed";
|
|
690
|
-
const message =
|
|
704
|
+
const message = _chunkOQVLEVNRcjs.formatUserError.call(void 0, raw);
|
|
691
705
|
setError(message);
|
|
692
706
|
_optionalChain([onError, 'optionalCall', _8 => _8(message, "WITHDRAW_REVIEW_ERROR")]);
|
|
693
707
|
} finally {
|
|
@@ -698,9 +712,9 @@ function WithdrawReviewStep({
|
|
|
698
712
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
699
713
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
700
714
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
701
|
-
|
|
715
|
+
_chunkOQVLEVNRcjs.BodyHeader,
|
|
702
716
|
{
|
|
703
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
717
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.CircleArrowOutUpLeftIcon, {}),
|
|
704
718
|
title: "Review withdrawal"
|
|
705
719
|
}
|
|
706
720
|
),
|
|
@@ -709,7 +723,7 @@ function WithdrawReviewStep({
|
|
|
709
723
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "You send" }),
|
|
710
724
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
711
725
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { children: [
|
|
712
|
-
|
|
726
|
+
formattedSendAmount,
|
|
713
727
|
" ",
|
|
714
728
|
sourceSymbol
|
|
715
729
|
] }),
|
|
@@ -730,11 +744,7 @@ function WithdrawReviewStep({
|
|
|
730
744
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
731
745
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Receive" }),
|
|
732
746
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
733
|
-
/* @__PURE__ */ _jsxruntime.
|
|
734
|
-
amount,
|
|
735
|
-
" ",
|
|
736
|
-
targetSymbol
|
|
737
|
-
] }),
|
|
747
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: receiveDisplay }),
|
|
738
748
|
targetTokenIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "img", { src: targetTokenIcon, alt: "" }) })
|
|
739
749
|
] })
|
|
740
750
|
] }),
|
|
@@ -750,10 +760,10 @@ function WithdrawReviewStep({
|
|
|
750
760
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-value", children: estimatedTime })
|
|
751
761
|
] })
|
|
752
762
|
] }),
|
|
753
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
754
|
-
!error && registrationError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
763
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.Callout, { variant: "error", children: error }),
|
|
764
|
+
!error && registrationError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.Callout, { variant: "error", children: registrationError }),
|
|
755
765
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
756
|
-
|
|
766
|
+
_chunkOQVLEVNRcjs.Button,
|
|
757
767
|
{
|
|
758
768
|
onClick: handleConfirm,
|
|
759
769
|
loading: isSubmitting,
|
|
@@ -764,7 +774,7 @@ function WithdrawReviewStep({
|
|
|
764
774
|
}
|
|
765
775
|
)
|
|
766
776
|
] }),
|
|
767
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
777
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.PoweredBy, {})
|
|
768
778
|
] });
|
|
769
779
|
}
|
|
770
780
|
WithdrawReviewStep.displayName = "WithdrawReviewStep";
|
|
@@ -775,15 +785,15 @@ WithdrawReviewStep.displayName = "WithdrawReviewStep";
|
|
|
775
785
|
var ADDR_REGEX = /^0x[a-fA-F0-9]{40}$/;
|
|
776
786
|
var REGISTRATION_DEBOUNCE_MS = 600;
|
|
777
787
|
function resolveSessionOwner(eoaAddress) {
|
|
778
|
-
const localOwner =
|
|
788
|
+
const localOwner = _chunkOQVLEVNRcjs.loadSessionOwnerFromStorage.call(void 0, eoaAddress);
|
|
779
789
|
if (localOwner) {
|
|
780
790
|
return {
|
|
781
|
-
account:
|
|
791
|
+
account: _chunkOQVLEVNRcjs.accountFromPrivateKey.call(void 0, localOwner.privateKey),
|
|
782
792
|
address: localOwner.address
|
|
783
793
|
};
|
|
784
794
|
}
|
|
785
|
-
const created =
|
|
786
|
-
|
|
795
|
+
const created = _chunkOQVLEVNRcjs.createSessionOwnerKey.call(void 0, );
|
|
796
|
+
_chunkOQVLEVNRcjs.saveSessionOwnerToStorage.call(void 0, eoaAddress, created.privateKey, created.address);
|
|
787
797
|
return { account: created.account, address: created.address };
|
|
788
798
|
}
|
|
789
799
|
function targetsEqual(a, b) {
|
|
@@ -803,7 +813,7 @@ function WithdrawFlow({
|
|
|
803
813
|
amount: defaultAmount,
|
|
804
814
|
service,
|
|
805
815
|
allowedRoutes,
|
|
806
|
-
signerAddress =
|
|
816
|
+
signerAddress = _chunkABVRVW3Pcjs.DEFAULT_SIGNER_ADDRESS,
|
|
807
817
|
sessionChainIds,
|
|
808
818
|
forceRegister = false,
|
|
809
819
|
reownWallet,
|
|
@@ -818,19 +828,19 @@ function WithdrawFlow({
|
|
|
818
828
|
onError,
|
|
819
829
|
debug
|
|
820
830
|
}) {
|
|
821
|
-
const onStepChangeRef =
|
|
822
|
-
const onEventRef =
|
|
823
|
-
const onLifecycleRef =
|
|
824
|
-
const onErrorRef =
|
|
831
|
+
const onStepChangeRef = _chunkOQVLEVNRcjs.useLatestRef.call(void 0, onStepChange);
|
|
832
|
+
const onEventRef = _chunkOQVLEVNRcjs.useLatestRef.call(void 0, onEvent);
|
|
833
|
+
const onLifecycleRef = _chunkOQVLEVNRcjs.useLatestRef.call(void 0, onLifecycle);
|
|
834
|
+
const onErrorRef = _chunkOQVLEVNRcjs.useLatestRef.call(void 0, onError);
|
|
825
835
|
const logFlow = _react.useCallback.call(void 0,
|
|
826
836
|
(message, data) => {
|
|
827
|
-
|
|
837
|
+
_chunkOQVLEVNRcjs.debugLog.call(void 0, debug, "withdraw-flow", message, data);
|
|
828
838
|
},
|
|
829
839
|
[debug]
|
|
830
840
|
);
|
|
831
841
|
const logFlowError = _react.useCallback.call(void 0,
|
|
832
842
|
(message, error, data) => {
|
|
833
|
-
|
|
843
|
+
_chunkOQVLEVNRcjs.debugError.call(void 0, debug, "withdraw-flow", message, error, data);
|
|
834
844
|
},
|
|
835
845
|
[debug]
|
|
836
846
|
);
|
|
@@ -905,14 +915,14 @@ function WithdrawFlow({
|
|
|
905
915
|
return {
|
|
906
916
|
ownerAddress: dappAddress,
|
|
907
917
|
walletClient: _nullishCoalesce(dappWalletClient, () => ( void 0)),
|
|
908
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
918
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkOQVLEVNRcjs.getPublicClient.call(void 0, sourceChain))),
|
|
909
919
|
switchChain: dappSwitchChain
|
|
910
920
|
};
|
|
911
921
|
}
|
|
912
922
|
return {
|
|
913
923
|
ownerAddress: dappWalletClient.account.address,
|
|
914
924
|
walletClient: dappWalletClient,
|
|
915
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
925
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkOQVLEVNRcjs.getPublicClient.call(void 0, sourceChain))),
|
|
916
926
|
switchChain: dappSwitchChain
|
|
917
927
|
};
|
|
918
928
|
}
|
|
@@ -923,7 +933,7 @@ function WithdrawFlow({
|
|
|
923
933
|
return {
|
|
924
934
|
ownerAddress: dappWalletClient.account.address,
|
|
925
935
|
walletClient: dappWalletClient,
|
|
926
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
936
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkOQVLEVNRcjs.getPublicClient.call(void 0, sourceChain))),
|
|
927
937
|
switchChain: dappSwitchChain
|
|
928
938
|
};
|
|
929
939
|
}
|
|
@@ -980,7 +990,7 @@ function WithdrawFlow({
|
|
|
980
990
|
const setup = await service.setupAccount({
|
|
981
991
|
ownerAddress,
|
|
982
992
|
sessionOwnerAddress: sessionOwner.address,
|
|
983
|
-
targetChain:
|
|
993
|
+
targetChain: _chunkABVRVW3Pcjs.toEvmCaip2.call(void 0, targetChain),
|
|
984
994
|
targetToken,
|
|
985
995
|
recipient: recipientForRegistration,
|
|
986
996
|
signerAddress,
|
|
@@ -1005,7 +1015,7 @@ function WithdrawFlow({
|
|
|
1005
1015
|
message: typedData.message
|
|
1006
1016
|
});
|
|
1007
1017
|
if (cancelled) return;
|
|
1008
|
-
const sessionDetails =
|
|
1018
|
+
const sessionDetails = _chunkOQVLEVNRcjs.buildSessionDetails.call(void 0,
|
|
1009
1019
|
setup.sessionDetailsUnsigned,
|
|
1010
1020
|
signature
|
|
1011
1021
|
);
|
|
@@ -1019,7 +1029,7 @@ function WithdrawFlow({
|
|
|
1019
1029
|
eoaAddress: ownerAddress,
|
|
1020
1030
|
sessionOwner: sessionOwner.address,
|
|
1021
1031
|
target: {
|
|
1022
|
-
chain:
|
|
1032
|
+
chain: _chunkABVRVW3Pcjs.toEvmCaip2.call(void 0, targetChain),
|
|
1023
1033
|
token: targetToken,
|
|
1024
1034
|
recipient: recipientForRegistration
|
|
1025
1035
|
}
|
|
@@ -1042,7 +1052,7 @@ function WithdrawFlow({
|
|
|
1042
1052
|
} catch (err) {
|
|
1043
1053
|
if (cancelled) return;
|
|
1044
1054
|
const raw = err instanceof Error ? err.message : "Registration failed";
|
|
1045
|
-
const message =
|
|
1055
|
+
const message = _chunkOQVLEVNRcjs.formatUserError.call(void 0, raw);
|
|
1046
1056
|
logFlowError("auto-register:failed", err, {
|
|
1047
1057
|
ownerAddress,
|
|
1048
1058
|
targetChain,
|
|
@@ -1075,10 +1085,10 @@ function WithdrawFlow({
|
|
|
1075
1085
|
onErrorRef
|
|
1076
1086
|
]);
|
|
1077
1087
|
const asset = _react.useMemo.call(void 0, () => {
|
|
1078
|
-
const symbol =
|
|
1079
|
-
const decimals =
|
|
1088
|
+
const symbol = _chunkABVRVW3Pcjs.getTokenSymbol.call(void 0, sourceToken, sourceChain);
|
|
1089
|
+
const decimals = _chunkABVRVW3Pcjs.getTokenDecimalsByAddress.call(void 0, sourceToken, sourceChain);
|
|
1080
1090
|
return {
|
|
1081
|
-
id:
|
|
1091
|
+
id: _chunkOQVLEVNRcjs.getAssetId.call(void 0, { chainId: sourceChain, token: sourceToken }),
|
|
1082
1092
|
chainId: sourceChain,
|
|
1083
1093
|
token: sourceToken,
|
|
1084
1094
|
symbol,
|
|
@@ -1086,7 +1096,7 @@ function WithdrawFlow({
|
|
|
1086
1096
|
decimals
|
|
1087
1097
|
};
|
|
1088
1098
|
}, [sourceChain, sourceToken]);
|
|
1089
|
-
const isSourceNative = sourceToken.toLowerCase() ===
|
|
1099
|
+
const isSourceNative = sourceToken.toLowerCase() === _chunkABVRVW3Pcjs.NATIVE_TOKEN_ADDRESS.toLowerCase();
|
|
1090
1100
|
const isSameRoute = targetChain === sourceChain && targetToken.toLowerCase() === sourceToken.toLowerCase();
|
|
1091
1101
|
const reviewBackHandler = _react.useCallback.call(void 0, () => {
|
|
1092
1102
|
storeApi.dispatch({ type: "review/back" });
|
|
@@ -1104,8 +1114,8 @@ function WithdrawFlow({
|
|
|
1104
1114
|
}
|
|
1105
1115
|
if (lastStepOpenEventKeyRef.current === "form") return;
|
|
1106
1116
|
lastStepOpenEventKeyRef.current = "form";
|
|
1107
|
-
const tokenSymbol =
|
|
1108
|
-
const chainName =
|
|
1117
|
+
const tokenSymbol = _chunkABVRVW3Pcjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
1118
|
+
const chainName = _chunkABVRVW3Pcjs.getChainName.call(void 0, targetChain);
|
|
1109
1119
|
_optionalChain([onEventRef, 'access', _37 => _37.current, 'optionalCall', _38 => _38({
|
|
1110
1120
|
type: "withdraw_modal_select_amount_open",
|
|
1111
1121
|
pred_balance: totalBalanceUsd,
|
|
@@ -1142,8 +1152,8 @@ function WithdrawFlow({
|
|
|
1142
1152
|
);
|
|
1143
1153
|
const handleFormContinue = _react.useCallback.call(void 0,
|
|
1144
1154
|
(recipient, amountValue) => {
|
|
1145
|
-
const tokenSymbol =
|
|
1146
|
-
const chainName =
|
|
1155
|
+
const tokenSymbol = _chunkABVRVW3Pcjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
1156
|
+
const chainName = _chunkABVRVW3Pcjs.getChainName.call(void 0, targetChain);
|
|
1147
1157
|
_optionalChain([onEventRef, 'access', _41 => _41.current, 'optionalCall', _42 => _42({
|
|
1148
1158
|
type: "withdraw_modal_select_amount_cta_click",
|
|
1149
1159
|
pred_balance: totalBalanceUsd,
|
|
@@ -1186,7 +1196,7 @@ function WithdrawFlow({
|
|
|
1186
1196
|
targetToken
|
|
1187
1197
|
});
|
|
1188
1198
|
const amountUnits = _viem.parseUnits.call(void 0, amountValue, asset.decimals);
|
|
1189
|
-
const pc = _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess', _44 => _44.publicClient]), () => (
|
|
1199
|
+
const pc = _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess', _44 => _44.publicClient]), () => ( _chunkOQVLEVNRcjs.getPublicClient.call(void 0, sourceChain)));
|
|
1190
1200
|
let result;
|
|
1191
1201
|
if (onSignTransaction) {
|
|
1192
1202
|
const transferTarget = isSameRoute ? recipient : smartAccount;
|
|
@@ -1199,7 +1209,7 @@ function WithdrawFlow({
|
|
|
1199
1209
|
args: [transferTarget, amountUnits]
|
|
1200
1210
|
})
|
|
1201
1211
|
};
|
|
1202
|
-
const request = await
|
|
1212
|
+
const request = await _chunkUEKPBRBYcjs.buildSafeTransaction.call(void 0, {
|
|
1203
1213
|
publicClient: pc,
|
|
1204
1214
|
safeAddress,
|
|
1205
1215
|
to: transferData.to,
|
|
@@ -1210,7 +1220,7 @@ function WithdrawFlow({
|
|
|
1210
1220
|
const { signature } = await onSignTransaction(request);
|
|
1211
1221
|
const relayResult = await service.relayWithdraw({
|
|
1212
1222
|
smartAccount,
|
|
1213
|
-
chainId:
|
|
1223
|
+
chainId: _chunkABVRVW3Pcjs.toEvmCaip2.call(void 0, sourceChain),
|
|
1214
1224
|
safeAddress,
|
|
1215
1225
|
safeTransaction: request.typedData.message,
|
|
1216
1226
|
signature
|
|
@@ -1220,7 +1230,7 @@ function WithdrawFlow({
|
|
|
1220
1230
|
}
|
|
1221
1231
|
result = { txHash: relayResult.txHash };
|
|
1222
1232
|
} else if (isSourceNative) {
|
|
1223
|
-
result = await
|
|
1233
|
+
result = await _chunkUEKPBRBYcjs.executeSafeEthTransfer.call(void 0, {
|
|
1224
1234
|
walletClient: signerContext.walletClient,
|
|
1225
1235
|
publicClient: pc,
|
|
1226
1236
|
safeAddress,
|
|
@@ -1229,7 +1239,7 @@ function WithdrawFlow({
|
|
|
1229
1239
|
chainId: sourceChain
|
|
1230
1240
|
});
|
|
1231
1241
|
} else {
|
|
1232
|
-
result = await
|
|
1242
|
+
result = await _chunkUEKPBRBYcjs.executeSafeErc20Transfer.call(void 0, {
|
|
1233
1243
|
walletClient: signerContext.walletClient,
|
|
1234
1244
|
publicClient: pc,
|
|
1235
1245
|
safeAddress,
|
|
@@ -1262,7 +1272,7 @@ function WithdrawFlow({
|
|
|
1262
1272
|
targetChain,
|
|
1263
1273
|
targetToken
|
|
1264
1274
|
});
|
|
1265
|
-
handleError(
|
|
1275
|
+
handleError(_chunkOQVLEVNRcjs.formatUserError.call(void 0, raw), "WITHDRAW_FLOW_ERROR");
|
|
1266
1276
|
throw err;
|
|
1267
1277
|
}
|
|
1268
1278
|
},
|
|
@@ -1327,9 +1337,9 @@ function WithdrawFlow({
|
|
|
1327
1337
|
[_optionalChain([allowedRoutes, 'optionalAccess', _54 => _54.sourceTokens])]
|
|
1328
1338
|
);
|
|
1329
1339
|
const targetChainOptions = _react.useMemo.call(void 0, () => {
|
|
1330
|
-
return
|
|
1340
|
+
return _chunkABVRVW3Pcjs.SOURCE_CHAINS.filter((chain) => {
|
|
1331
1341
|
if (allowedChainSet && !allowedChainSet.has(chain.id)) return false;
|
|
1332
|
-
const tokens =
|
|
1342
|
+
const tokens = _chunkABVRVW3Pcjs.getSupportedTargetTokens.call(void 0, chain.id);
|
|
1333
1343
|
if (allowedTokenSet) {
|
|
1334
1344
|
return tokens.some((t) => allowedTokenSet.has(t.symbol.toUpperCase()));
|
|
1335
1345
|
}
|
|
@@ -1337,7 +1347,7 @@ function WithdrawFlow({
|
|
|
1337
1347
|
});
|
|
1338
1348
|
}, [allowedChainSet, allowedTokenSet]);
|
|
1339
1349
|
const targetTokenOptions = _react.useMemo.call(void 0, () => {
|
|
1340
|
-
const tokens =
|
|
1350
|
+
const tokens = _chunkABVRVW3Pcjs.getSupportedTargetTokens.call(void 0, targetChain);
|
|
1341
1351
|
if (!allowedTokenSet) return tokens;
|
|
1342
1352
|
return tokens.filter((t) => allowedTokenSet.has(t.symbol.toUpperCase()));
|
|
1343
1353
|
}, [targetChain, allowedTokenSet]);
|
|
@@ -1351,7 +1361,7 @@ function WithdrawFlow({
|
|
|
1351
1361
|
const handleTargetChainChange = _react.useCallback.call(void 0,
|
|
1352
1362
|
(chainId) => {
|
|
1353
1363
|
setTargetChain(chainId);
|
|
1354
|
-
let options =
|
|
1364
|
+
let options = _chunkABVRVW3Pcjs.getSupportedTargetTokens.call(void 0, chainId);
|
|
1355
1365
|
if (allowedTokenSet) {
|
|
1356
1366
|
options = options.filter(
|
|
1357
1367
|
(t) => allowedTokenSet.has(t.symbol.toUpperCase())
|
|
@@ -1401,7 +1411,7 @@ function WithdrawFlow({
|
|
|
1401
1411
|
state: "ready"
|
|
1402
1412
|
}));
|
|
1403
1413
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1404
|
-
|
|
1414
|
+
_chunkOQVLEVNRcjs.ConnectStep,
|
|
1405
1415
|
{
|
|
1406
1416
|
walletRows: withdrawRows,
|
|
1407
1417
|
onConfirmWallet: (walletId) => {
|
|
@@ -1419,7 +1429,7 @@ function WithdrawFlow({
|
|
|
1419
1429
|
if (!signerContext) return null;
|
|
1420
1430
|
if (!onSignTransaction && !signerContext.walletClient) return null;
|
|
1421
1431
|
const resolvedConnectedRecipient = _optionalChain([selectedWalletOption, 'optionalAccess', _61 => _61.kind]) === "external" ? selectedWalletOption.address : void 0;
|
|
1422
|
-
const formPublicClient = _nullishCoalesce(signerContext.publicClient, () => (
|
|
1432
|
+
const formPublicClient = _nullishCoalesce(signerContext.publicClient, () => ( _chunkOQVLEVNRcjs.getPublicClient.call(void 0, sourceChain)));
|
|
1423
1433
|
const stepView = deriveStepView(flowStep, registration);
|
|
1424
1434
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
1425
1435
|
stepView === "form" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -1456,6 +1466,7 @@ function WithdrawFlow({
|
|
|
1456
1466
|
targetToken,
|
|
1457
1467
|
amount: _nullishCoalesce(storeApi.getState().amount, () => ( "0")),
|
|
1458
1468
|
recipient: _nullishCoalesce(_nullishCoalesce(storeApi.getState().recipient, () => ( recipientForRegistration)), () => ( "0x0")),
|
|
1469
|
+
service,
|
|
1459
1470
|
registrationPending: registration.kind === "pending" || registration.kind === "stale",
|
|
1460
1471
|
registrationError: registration.kind === "failed" ? registration.error : null,
|
|
1461
1472
|
onConfirm: handleReviewConfirm,
|
|
@@ -1463,7 +1474,7 @@ function WithdrawFlow({
|
|
|
1463
1474
|
}
|
|
1464
1475
|
),
|
|
1465
1476
|
stepView === "processing" && registration.kind !== "idle" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1466
|
-
|
|
1477
|
+
_chunkOQVLEVNRcjs.ProcessingStep,
|
|
1467
1478
|
{
|
|
1468
1479
|
smartAccount: registration.kind === "ready" || registration.kind === "stale" ? registration.smartAccount : "0x0",
|
|
1469
1480
|
txHash: _nullishCoalesce(storeApi.getState().txHash, () => ( "0x0")),
|
|
@@ -1471,7 +1482,9 @@ function WithdrawFlow({
|
|
|
1471
1482
|
sourceToken,
|
|
1472
1483
|
targetChain,
|
|
1473
1484
|
targetToken,
|
|
1474
|
-
amount: _nullishCoalesce(storeApi.getState().amount, () => ( "0")),
|
|
1485
|
+
amount: toBaseUnits(_nullishCoalesce(storeApi.getState().amount, () => ( "0")), asset.decimals),
|
|
1486
|
+
sourceSymbol: asset.symbol,
|
|
1487
|
+
sourceDecimals: asset.decimals,
|
|
1475
1488
|
directTransfer: isSameRoute,
|
|
1476
1489
|
service,
|
|
1477
1490
|
flowLabel: "withdraw",
|
|
@@ -1485,6 +1498,13 @@ function WithdrawFlow({
|
|
|
1485
1498
|
)
|
|
1486
1499
|
] });
|
|
1487
1500
|
}
|
|
1501
|
+
function toBaseUnits(amount, decimals) {
|
|
1502
|
+
try {
|
|
1503
|
+
return _viem.parseUnits.call(void 0, amount, decimals).toString();
|
|
1504
|
+
} catch (e6) {
|
|
1505
|
+
return "0";
|
|
1506
|
+
}
|
|
1507
|
+
}
|
|
1488
1508
|
function deriveStepView(step, _registration) {
|
|
1489
1509
|
if (step === "review") return "review";
|
|
1490
1510
|
if (step === "processing" || step === "complete" || step === "failed") {
|
|
@@ -1496,7 +1516,7 @@ function deriveStepView(step, _registration) {
|
|
|
1496
1516
|
// src/WithdrawModal.tsx
|
|
1497
1517
|
|
|
1498
1518
|
var ReownWithdrawInner = _react.lazy.call(void 0,
|
|
1499
|
-
() => Promise.resolve().then(() => _interopRequireWildcard(require("./WithdrawModalReown-
|
|
1519
|
+
() => Promise.resolve().then(() => _interopRequireWildcard(require("./WithdrawModalReown-Z2YF2FSJ.cjs"))).then((m) => ({
|
|
1500
1520
|
default: m.WithdrawModalReown
|
|
1501
1521
|
}))
|
|
1502
1522
|
);
|
|
@@ -1524,8 +1544,8 @@ function WithdrawModalInner({
|
|
|
1524
1544
|
inline,
|
|
1525
1545
|
closeOnOverlayClick,
|
|
1526
1546
|
allowedRoutes,
|
|
1527
|
-
backendUrl =
|
|
1528
|
-
signerAddress =
|
|
1547
|
+
backendUrl = _chunkABVRVW3Pcjs.DEFAULT_BACKEND_URL,
|
|
1548
|
+
signerAddress = _chunkABVRVW3Pcjs.DEFAULT_SIGNER_ADDRESS,
|
|
1529
1549
|
sessionChainIds,
|
|
1530
1550
|
forceRegister = false,
|
|
1531
1551
|
reownWallet,
|
|
@@ -1543,18 +1563,18 @@ function WithdrawModalInner({
|
|
|
1543
1563
|
debug
|
|
1544
1564
|
}) {
|
|
1545
1565
|
const modalRef = _react.useRef.call(void 0, null);
|
|
1546
|
-
const onReadyRef =
|
|
1566
|
+
const onReadyRef = _chunkOQVLEVNRcjs.useLatestRef.call(void 0, onReady);
|
|
1547
1567
|
const [backHandler, setBackHandler] = _react.useState.call(void 0,
|
|
1548
1568
|
void 0
|
|
1549
1569
|
);
|
|
1550
|
-
const targetChain =
|
|
1551
|
-
const sourceChain =
|
|
1570
|
+
const targetChain = _chunkABVRVW3Pcjs.getChainId.call(void 0, targetChainProp);
|
|
1571
|
+
const sourceChain = _chunkABVRVW3Pcjs.getChainId.call(void 0, sourceChainProp);
|
|
1552
1572
|
const service = _react.useMemo.call(void 0,
|
|
1553
|
-
() =>
|
|
1573
|
+
() => _chunkOQVLEVNRcjs.createDepositService.call(void 0, backendUrl, { debug, debugScope: "service:withdraw" }),
|
|
1554
1574
|
[backendUrl, debug]
|
|
1555
1575
|
);
|
|
1556
1576
|
const store = _react.useMemo.call(void 0, () => createWithdrawStore(), []);
|
|
1557
|
-
const onErrorRef =
|
|
1577
|
+
const onErrorRef = _chunkOQVLEVNRcjs.useLatestRef.call(void 0, onError);
|
|
1558
1578
|
_react.useEffect.call(void 0, () => {
|
|
1559
1579
|
if (isOpen && onSignTransaction && !dappAddress) {
|
|
1560
1580
|
_optionalChain([onErrorRef, 'access', _62 => _62.current, 'optionalCall', _63 => _63({
|
|
@@ -1565,7 +1585,7 @@ function WithdrawModalInner({
|
|
|
1565
1585
|
}, [isOpen, onSignTransaction, dappAddress, onErrorRef]);
|
|
1566
1586
|
_react.useEffect.call(void 0, () => {
|
|
1567
1587
|
if (isOpen && modalRef.current) {
|
|
1568
|
-
|
|
1588
|
+
_chunkOQVLEVNRcjs.applyTheme.call(void 0, modalRef.current, theme);
|
|
1569
1589
|
}
|
|
1570
1590
|
}, [isOpen, theme]);
|
|
1571
1591
|
_react.useEffect.call(void 0, () => {
|
|
@@ -1584,7 +1604,7 @@ function WithdrawModalInner({
|
|
|
1584
1604
|
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _66 => _66.showBackButton]), () => ( true));
|
|
1585
1605
|
const canGoBack = backHandler !== void 0;
|
|
1586
1606
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, WithdrawStoreProvider, { store, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1587
|
-
|
|
1607
|
+
_chunkOQVLEVNRcjs.Modal,
|
|
1588
1608
|
{
|
|
1589
1609
|
isOpen,
|
|
1590
1610
|
onClose,
|
|
@@ -1600,7 +1620,7 @@ function WithdrawModalInner({
|
|
|
1600
1620
|
className: "rs-modal-header-back",
|
|
1601
1621
|
"aria-label": "Go back",
|
|
1602
1622
|
onClick: backHandler,
|
|
1603
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1623
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.ChevronLeftIcon, {})
|
|
1604
1624
|
}
|
|
1605
1625
|
) }),
|
|
1606
1626
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-header-nav-right", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -1610,7 +1630,7 @@ function WithdrawModalInner({
|
|
|
1610
1630
|
onClick: onClose,
|
|
1611
1631
|
className: "rs-modal-close",
|
|
1612
1632
|
"aria-label": "Close",
|
|
1613
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1633
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.CloseIcon, {})
|
|
1614
1634
|
}
|
|
1615
1635
|
) })
|
|
1616
1636
|
] }),
|