@rhinestone/deposit-modal 0.14.0 → 0.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -12
- package/dist/{ClaimModal-SEKNWRMA.mjs → ClaimModal-GDFENSLV.mjs} +5 -5
- package/dist/ClaimModal-L3FUBI5U.cjs +13 -0
- package/dist/{DepositModalReown-Q2JMLT47.mjs → DepositModalReown-2EVV64OA.mjs} +29 -27
- package/dist/{DepositModalReown-46LPVFB6.cjs → DepositModalReown-GAD45GIC.cjs} +76 -74
- package/dist/WithdrawModal-FAQH35NG.cjs +12 -0
- package/dist/{WithdrawModal-5ICGD4HJ.mjs → WithdrawModal-IKUHF5CF.mjs} +4 -4
- package/dist/{chunk-7ICSHJFE.cjs → chunk-4J5ADVIN.cjs} +71 -67
- package/dist/{chunk-KTUVSKR4.mjs → chunk-5Q5CSVKF.mjs} +74 -32
- package/dist/{chunk-LZFRL2AL.cjs → chunk-62UCV2LG.cjs} +3 -3
- package/dist/{chunk-X2IPAPXU.cjs → chunk-7AZFT2MV.cjs} +8 -8
- package/dist/{chunk-MTFJSE52.cjs → chunk-A6JPBMYY.cjs} +65 -65
- package/dist/{chunk-6KG642KH.cjs → chunk-AQVJUXSG.cjs} +1 -1
- package/dist/{chunk-PKML3XVS.mjs → chunk-GZ4GQ5MC.mjs} +2 -2
- package/dist/{chunk-V2OBGLJD.cjs → chunk-HAQOFI3D.cjs} +90 -60
- package/dist/{chunk-K4H6TGBE.mjs → chunk-LMG46EP2.mjs} +1 -1
- package/dist/{chunk-YCQZJQO6.cjs → chunk-NQMC5VKQ.cjs} +343 -301
- package/dist/{chunk-CFKC77SV.mjs → chunk-QACOOLOE.mjs} +3 -3
- package/dist/{chunk-WUJIKCFU.mjs → chunk-R5UQ3TN4.mjs} +1 -1
- package/dist/{chunk-IN77XSWO.mjs → chunk-UX35GYLM.mjs} +59 -29
- package/dist/{chunk-ZEO6ADM3.mjs → chunk-VALXN5IO.mjs} +2 -2
- package/dist/{chunk-7SR7ENVJ.mjs → chunk-XCTRKCNM.mjs} +6 -2
- package/dist/{chunk-YWMWI7PZ.cjs → chunk-YP7QVKQ6.cjs} +53 -53
- package/dist/claim.cjs +6 -6
- package/dist/claim.mjs +5 -5
- package/dist/constants.cjs +2 -2
- package/dist/constants.d.cts +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.mjs +1 -1
- package/dist/deposit.cjs +6 -6
- package/dist/deposit.mjs +5 -5
- package/dist/embed.cjs +18 -18
- package/dist/embed.mjs +8 -8
- package/dist/index.cjs +9 -9
- package/dist/index.mjs +8 -8
- package/dist/withdraw.cjs +5 -5
- package/dist/withdraw.mjs +4 -4
- package/package.json +7 -6
- package/dist/ClaimModal-IKTJU43Y.cjs +0 -13
- package/dist/WithdrawModal-VP6PMIRO.cjs +0 -12
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunk4J5ADVINcjs = require('./chunk-4J5ADVIN.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
@@ -41,7 +41,7 @@ var _chunk7ICSHJFEcjs = require('./chunk-7ICSHJFE.cjs');
|
|
|
41
41
|
|
|
42
42
|
|
|
43
43
|
|
|
44
|
-
var
|
|
44
|
+
var _chunkHAQOFI3Dcjs = require('./chunk-HAQOFI3D.cjs');
|
|
45
45
|
|
|
46
46
|
|
|
47
47
|
|
|
@@ -235,7 +235,7 @@ function WithdrawFormStep({
|
|
|
235
235
|
const chainDropdownRef = _react.useRef.call(void 0, null);
|
|
236
236
|
const tokenDropdownRef = _react.useRef.call(void 0, null);
|
|
237
237
|
const publicClientChainId = _optionalChain([publicClient, 'access', _ => _.chain, 'optionalAccess', _2 => _2.id]);
|
|
238
|
-
const onFrictionRef =
|
|
238
|
+
const onFrictionRef = _chunkHAQOFI3Dcjs.useLatestRef.call(void 0, onFriction);
|
|
239
239
|
useClickOutside(chainDropdownRef, () => setShowChainDropdown(false));
|
|
240
240
|
useClickOutside(tokenDropdownRef, () => setShowTokenDropdown(false));
|
|
241
241
|
const targetSymbol = _chunk4KCSH4T3cjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
@@ -263,7 +263,7 @@ function WithdrawFormStep({
|
|
|
263
263
|
return;
|
|
264
264
|
}
|
|
265
265
|
try {
|
|
266
|
-
const bal =
|
|
266
|
+
const bal = _chunkHAQOFI3Dcjs.isNativeAsset.call(void 0, asset) ? await publicClient.getBalance({ address: accountAddress }) : await publicClient.readContract({
|
|
267
267
|
address: asset.token,
|
|
268
268
|
abi: _viem.erc20Abi,
|
|
269
269
|
functionName: "balanceOf",
|
|
@@ -365,7 +365,7 @@ function WithdrawFormStep({
|
|
|
365
365
|
await onSubmit(recipient, amount);
|
|
366
366
|
} catch (err) {
|
|
367
367
|
const raw = err instanceof Error ? err.message : "Withdrawal failed";
|
|
368
|
-
setError(
|
|
368
|
+
setError(_chunkHAQOFI3Dcjs.formatUserError.call(void 0, raw));
|
|
369
369
|
} finally {
|
|
370
370
|
setIsSubmitting(false);
|
|
371
371
|
}
|
|
@@ -382,16 +382,16 @@ function WithdrawFormStep({
|
|
|
382
382
|
if (isBalanceLoading) {
|
|
383
383
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
384
384
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-withdraw-loading", children: [
|
|
385
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
385
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.Spinner, { className: "rs-spinner--lg" }),
|
|
386
386
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-withdraw-loading-title", children: "Loading on-chain balance" }),
|
|
387
387
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-withdraw-loading-subtitle", children: "Please wait before withdrawing." })
|
|
388
388
|
] }),
|
|
389
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
389
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.PoweredBy, {})
|
|
390
390
|
] });
|
|
391
391
|
}
|
|
392
392
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
393
393
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
394
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
394
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.CircleArrowOutUpLeftIcon, {}), title: "Withdraw" }),
|
|
395
395
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-section", children: [
|
|
396
396
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
397
397
|
"label",
|
|
@@ -451,7 +451,7 @@ function WithdrawFormStep({
|
|
|
451
451
|
) })
|
|
452
452
|
] }),
|
|
453
453
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-amount-info", children: [
|
|
454
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-withdraw-usd", children: amountUsd !== null ? `~${
|
|
454
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-withdraw-usd", children: amountUsd !== null ? `~${_chunkHAQOFI3Dcjs.currencyFormatter.format(amountUsd)}` : "$0.00" }),
|
|
455
455
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-withdraw-balance", children: [
|
|
456
456
|
"Balance: ",
|
|
457
457
|
formattedBalance,
|
|
@@ -482,7 +482,7 @@ function WithdrawFormStep({
|
|
|
482
482
|
children: [
|
|
483
483
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-dropdown-value", children: [
|
|
484
484
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
485
|
-
|
|
485
|
+
_chunkHAQOFI3Dcjs.CdnIcon,
|
|
486
486
|
{
|
|
487
487
|
src: _chunk4KCSH4T3cjs.getChainIcon.call(void 0, targetChain),
|
|
488
488
|
alt: targetChainName,
|
|
@@ -492,7 +492,7 @@ function WithdrawFormStep({
|
|
|
492
492
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: targetChainName })
|
|
493
493
|
] }),
|
|
494
494
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
495
|
-
|
|
495
|
+
_chunkHAQOFI3Dcjs.ChevronDownIcon,
|
|
496
496
|
{
|
|
497
497
|
className: "rs-withdraw-dropdown-arrow",
|
|
498
498
|
style: {
|
|
@@ -514,7 +514,7 @@ function WithdrawFormStep({
|
|
|
514
514
|
},
|
|
515
515
|
children: [
|
|
516
516
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
517
|
-
|
|
517
|
+
_chunkHAQOFI3Dcjs.CdnIcon,
|
|
518
518
|
{
|
|
519
519
|
src: _chunk4KCSH4T3cjs.getChainIcon.call(void 0, chain.id),
|
|
520
520
|
alt: chain.name,
|
|
@@ -551,7 +551,7 @@ function WithdrawFormStep({
|
|
|
551
551
|
children: [
|
|
552
552
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-dropdown-value", children: [
|
|
553
553
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
554
|
-
|
|
554
|
+
_chunkHAQOFI3Dcjs.TokenIcon,
|
|
555
555
|
{
|
|
556
556
|
symbol: targetSymbol,
|
|
557
557
|
className: "rs-withdraw-dropdown-icon"
|
|
@@ -560,7 +560,7 @@ function WithdrawFormStep({
|
|
|
560
560
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: targetSymbol })
|
|
561
561
|
] }),
|
|
562
562
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
563
|
-
|
|
563
|
+
_chunkHAQOFI3Dcjs.ChevronDownIcon,
|
|
564
564
|
{
|
|
565
565
|
className: "rs-withdraw-dropdown-arrow",
|
|
566
566
|
style: {
|
|
@@ -582,7 +582,7 @@ function WithdrawFormStep({
|
|
|
582
582
|
},
|
|
583
583
|
children: [
|
|
584
584
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
585
|
-
|
|
585
|
+
_chunkHAQOFI3Dcjs.TokenIcon,
|
|
586
586
|
{
|
|
587
587
|
symbol: option.symbol,
|
|
588
588
|
className: "rs-withdraw-dropdown-icon"
|
|
@@ -598,10 +598,10 @@ function WithdrawFormStep({
|
|
|
598
598
|
)
|
|
599
599
|
] })
|
|
600
600
|
] }),
|
|
601
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
602
|
-
!error && registrationError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
601
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.Callout, { variant: "error", children: error }),
|
|
602
|
+
!error && registrationError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.Callout, { variant: "error", children: registrationError }),
|
|
603
603
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
604
|
-
|
|
604
|
+
_chunkHAQOFI3Dcjs.Button,
|
|
605
605
|
{
|
|
606
606
|
onClick: handleWithdraw,
|
|
607
607
|
fullWidth: true,
|
|
@@ -616,7 +616,7 @@ function WithdrawFormStep({
|
|
|
616
616
|
}
|
|
617
617
|
)
|
|
618
618
|
] }),
|
|
619
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
619
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.PoweredBy, {})
|
|
620
620
|
] });
|
|
621
621
|
}
|
|
622
622
|
WithdrawFormStep.displayName = "WithdrawFormStep";
|
|
@@ -650,16 +650,16 @@ function WithdrawReviewStep({
|
|
|
650
650
|
const targetChainName = _chunk4KCSH4T3cjs.getChainName.call(void 0, targetChain);
|
|
651
651
|
const targetChainIcon = _chunk4KCSH4T3cjs.getChainIcon.call(void 0, targetChain);
|
|
652
652
|
const amountNumber = Number(amount);
|
|
653
|
-
const formattedSendAmount = _nullishCoalesce(
|
|
654
|
-
const prices =
|
|
653
|
+
const formattedSendAmount = _nullishCoalesce(_chunkHAQOFI3Dcjs.formatTokenAmount.call(void 0, amountNumber, sourceSymbol), () => ( amount));
|
|
654
|
+
const prices = _chunk4J5ADVINcjs.useTokenPrices.call(void 0, service, [
|
|
655
655
|
{ chainId: sourceChain, address: sourceToken, symbol: sourceSymbol },
|
|
656
656
|
{ chainId: targetChain, address: targetToken, symbol: targetSymbol }
|
|
657
657
|
]);
|
|
658
|
-
const receiveDisplay = _nullishCoalesce(
|
|
658
|
+
const receiveDisplay = _nullishCoalesce(_chunkHAQOFI3Dcjs.formatReceiveEstimate.call(void 0, {
|
|
659
659
|
sourceAmount: Number.isFinite(amountNumber) ? amountNumber : void 0,
|
|
660
660
|
sourceSymbol,
|
|
661
661
|
targetSymbol,
|
|
662
|
-
sourceTrusted:
|
|
662
|
+
sourceTrusted: _chunkHAQOFI3Dcjs.isRecognizedToken.call(void 0, sourceToken, sourceChain),
|
|
663
663
|
prices
|
|
664
664
|
}), () => ( // No price for the target token — an honest dash beats a wrong number.
|
|
665
665
|
"\u2014"));
|
|
@@ -671,8 +671,8 @@ function WithdrawReviewStep({
|
|
|
671
671
|
await onConfirm();
|
|
672
672
|
} catch (err) {
|
|
673
673
|
const raw = err instanceof Error ? err.message : "Withdraw failed";
|
|
674
|
-
const uncertain =
|
|
675
|
-
const message = uncertain ? "Withdrawal status is uncertain. Check your activity before trying again." :
|
|
674
|
+
const uncertain = _chunk4J5ADVINcjs.isSubmissionUncertain.call(void 0, err);
|
|
675
|
+
const message = uncertain ? "Withdrawal status is uncertain. Check your activity before trying again." : _chunkHAQOFI3Dcjs.formatUserError.call(void 0, raw);
|
|
676
676
|
if (uncertain) setSubmissionUncertain(true);
|
|
677
677
|
setError(message);
|
|
678
678
|
_optionalChain([onError, 'optionalCall', _15 => _15(message, "WITHDRAW_REVIEW_ERROR", raw)]);
|
|
@@ -684,9 +684,9 @@ function WithdrawReviewStep({
|
|
|
684
684
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
685
685
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
686
686
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
687
|
-
|
|
687
|
+
_chunkHAQOFI3Dcjs.BodyHeader,
|
|
688
688
|
{
|
|
689
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
689
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.CircleArrowOutUpLeftIcon, {}),
|
|
690
690
|
title: "Review withdrawal"
|
|
691
691
|
}
|
|
692
692
|
),
|
|
@@ -699,14 +699,14 @@ function WithdrawReviewStep({
|
|
|
699
699
|
" ",
|
|
700
700
|
sourceSymbol
|
|
701
701
|
] }),
|
|
702
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
702
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.TokenIcon, { symbol: sourceSymbol }) })
|
|
703
703
|
] })
|
|
704
704
|
] }),
|
|
705
705
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
706
706
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Source chain" }),
|
|
707
707
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
708
708
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: sourceChainName }),
|
|
709
|
-
sourceChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
709
|
+
sourceChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.CdnIcon, { src: sourceChainIcon }) })
|
|
710
710
|
] })
|
|
711
711
|
] }),
|
|
712
712
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
@@ -717,14 +717,14 @@ function WithdrawReviewStep({
|
|
|
717
717
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Receive" }),
|
|
718
718
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
719
719
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: receiveDisplay }),
|
|
720
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
720
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.TokenIcon, { symbol: targetSymbol }) })
|
|
721
721
|
] })
|
|
722
722
|
] }),
|
|
723
723
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
724
724
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Destination chain" }),
|
|
725
725
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
726
726
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: targetChainName }),
|
|
727
|
-
targetChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
727
|
+
targetChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.CdnIcon, { src: targetChainIcon }) })
|
|
728
728
|
] })
|
|
729
729
|
] }),
|
|
730
730
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
@@ -732,10 +732,10 @@ function WithdrawReviewStep({
|
|
|
732
732
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-value", children: estimatedTime })
|
|
733
733
|
] })
|
|
734
734
|
] }),
|
|
735
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
736
|
-
!error && registrationError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
735
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.Callout, { variant: "error", children: error }),
|
|
736
|
+
!error && registrationError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.Callout, { variant: "error", children: registrationError }),
|
|
737
737
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
738
|
-
|
|
738
|
+
_chunkHAQOFI3Dcjs.Button,
|
|
739
739
|
{
|
|
740
740
|
onClick: handleConfirm,
|
|
741
741
|
loading: isSubmitting,
|
|
@@ -746,7 +746,7 @@ function WithdrawReviewStep({
|
|
|
746
746
|
}
|
|
747
747
|
)
|
|
748
748
|
] }),
|
|
749
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
749
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.PoweredBy, {})
|
|
750
750
|
] });
|
|
751
751
|
}
|
|
752
752
|
WithdrawReviewStep.displayName = "WithdrawReviewStep";
|
|
@@ -762,7 +762,7 @@ WithdrawReviewStep.displayName = "WithdrawReviewStep";
|
|
|
762
762
|
|
|
763
763
|
|
|
764
764
|
function withdrawFailureReasonForError(error) {
|
|
765
|
-
if (
|
|
765
|
+
if (_chunk4J5ADVINcjs.isSubmissionUncertain.call(void 0, error)) return "submission_uncertain";
|
|
766
766
|
const message = (error instanceof Error ? error.message : String(_nullishCoalesce(error, () => ( "")))).toLowerCase();
|
|
767
767
|
if (message.includes("changed before submission")) {
|
|
768
768
|
return "registration_target_changed";
|
|
@@ -904,7 +904,7 @@ function WithdrawAnalyticsControllerProvider({
|
|
|
904
904
|
children,
|
|
905
905
|
controllerRef
|
|
906
906
|
}) {
|
|
907
|
-
const emit =
|
|
907
|
+
const emit = _chunkHAQOFI3Dcjs.useWithdrawAnalyticsEmitter.call(void 0, );
|
|
908
908
|
const controller = _react.useMemo.call(void 0,
|
|
909
909
|
() => createWithdrawAnalyticsController(emit),
|
|
910
910
|
[emit]
|
|
@@ -942,11 +942,11 @@ function WithdrawFlow({
|
|
|
942
942
|
onError,
|
|
943
943
|
debug
|
|
944
944
|
}) {
|
|
945
|
-
const rpcUrls =
|
|
946
|
-
const onStepChangeRef =
|
|
945
|
+
const rpcUrls = _chunkHAQOFI3Dcjs.useRpcUrls.call(void 0, );
|
|
946
|
+
const onStepChangeRef = _chunkHAQOFI3Dcjs.useLatestRef.call(void 0, onStepChange);
|
|
947
947
|
const analytics = useWithdrawAnalyticsController();
|
|
948
|
-
const onLifecycleRef =
|
|
949
|
-
const onErrorRef =
|
|
948
|
+
const onLifecycleRef = _chunkHAQOFI3Dcjs.useLatestRef.call(void 0, onLifecycle);
|
|
949
|
+
const onErrorRef = _chunkHAQOFI3Dcjs.useLatestRef.call(void 0, onError);
|
|
950
950
|
const isFlowActiveRef = _react.useRef.call(void 0, true);
|
|
951
951
|
const submitGenerationRef = _react.useRef.call(void 0, 0);
|
|
952
952
|
const lastSubmitFailureRef = _react.useRef.call(void 0,
|
|
@@ -960,13 +960,13 @@ function WithdrawFlow({
|
|
|
960
960
|
}, []);
|
|
961
961
|
const logFlow = _react.useCallback.call(void 0,
|
|
962
962
|
(message, data) => {
|
|
963
|
-
|
|
963
|
+
_chunkHAQOFI3Dcjs.debugLog.call(void 0, debug, "withdraw-flow", message, data);
|
|
964
964
|
},
|
|
965
965
|
[debug]
|
|
966
966
|
);
|
|
967
967
|
const logFlowError = _react.useCallback.call(void 0,
|
|
968
968
|
(message, error, data) => {
|
|
969
|
-
|
|
969
|
+
_chunkHAQOFI3Dcjs.debugError.call(void 0, debug, "withdraw-flow", message, error, data);
|
|
970
970
|
},
|
|
971
971
|
[debug]
|
|
972
972
|
);
|
|
@@ -988,7 +988,7 @@ function WithdrawFlow({
|
|
|
988
988
|
const registration = useWithdrawStore((s) => s.registration);
|
|
989
989
|
const flowStep = useWithdrawStore((s) => s.step);
|
|
990
990
|
const reviewedRecipient = useWithdrawStore((s) => s.recipient);
|
|
991
|
-
const publicClient =
|
|
991
|
+
const publicClient = _chunkHAQOFI3Dcjs.useReadClient.call(void 0, sourceChain, rpcUrls);
|
|
992
992
|
const recipientForRegistration = _react.useMemo.call(void 0, () => {
|
|
993
993
|
if (!recipientInput) return void 0;
|
|
994
994
|
return ADDR_REGEX.test(recipientInput) ? recipientInput : void 0;
|
|
@@ -1014,7 +1014,7 @@ function WithdrawFlow({
|
|
|
1014
1014
|
targetToken,
|
|
1015
1015
|
recipient: recipientForRegistration
|
|
1016
1016
|
});
|
|
1017
|
-
const salt =
|
|
1017
|
+
const salt = _chunk4J5ADVINcjs.deriveAccountSalt.call(void 0, {
|
|
1018
1018
|
recipient: recipientForRegistration,
|
|
1019
1019
|
targetChain,
|
|
1020
1020
|
targetToken
|
|
@@ -1044,7 +1044,7 @@ function WithdrawFlow({
|
|
|
1044
1044
|
} catch (err) {
|
|
1045
1045
|
if (cancelled) return;
|
|
1046
1046
|
const raw = err instanceof Error ? err.message : "Registration failed";
|
|
1047
|
-
const message =
|
|
1047
|
+
const message = _chunkHAQOFI3Dcjs.formatUserError.call(void 0, raw);
|
|
1048
1048
|
logFlowError("auto-register:failed", err, {
|
|
1049
1049
|
accountAddress,
|
|
1050
1050
|
targetChain,
|
|
@@ -1078,7 +1078,7 @@ function WithdrawFlow({
|
|
|
1078
1078
|
const symbol = _chunk4KCSH4T3cjs.getTokenSymbol.call(void 0, sourceToken, sourceChain);
|
|
1079
1079
|
const decimals = _chunk4KCSH4T3cjs.getTokenDecimalsByAddress.call(void 0, sourceToken, sourceChain);
|
|
1080
1080
|
return {
|
|
1081
|
-
id:
|
|
1081
|
+
id: _chunkHAQOFI3Dcjs.getAssetId.call(void 0, { chainId: sourceChain, token: sourceToken }),
|
|
1082
1082
|
chainId: sourceChain,
|
|
1083
1083
|
token: sourceToken,
|
|
1084
1084
|
symbol,
|
|
@@ -1276,7 +1276,7 @@ function WithdrawFlow({
|
|
|
1276
1276
|
targetChain,
|
|
1277
1277
|
targetToken
|
|
1278
1278
|
});
|
|
1279
|
-
handleError(
|
|
1279
|
+
handleError(_chunkHAQOFI3Dcjs.formatUserError.call(void 0, raw), "WITHDRAW_FLOW_ERROR");
|
|
1280
1280
|
throw err;
|
|
1281
1281
|
}
|
|
1282
1282
|
},
|
|
@@ -1335,8 +1335,8 @@ function WithdrawFlow({
|
|
|
1335
1335
|
},
|
|
1336
1336
|
[analytics, logFlowError, onLifecycleRef, storeApi]
|
|
1337
1337
|
);
|
|
1338
|
-
const targetChainOptions =
|
|
1339
|
-
const targetTokensFor =
|
|
1338
|
+
const targetChainOptions = _chunkHAQOFI3Dcjs.useDestinationChains.call(void 0, );
|
|
1339
|
+
const targetTokensFor = _chunkHAQOFI3Dcjs.useTargetTokens.call(void 0, );
|
|
1340
1340
|
const targetTokenOptions = _react.useMemo.call(void 0,
|
|
1341
1341
|
() => targetTokensFor(targetChain),
|
|
1342
1342
|
[targetChain, targetTokensFor]
|
|
@@ -1414,7 +1414,7 @@ function WithdrawFlow({
|
|
|
1414
1414
|
}
|
|
1415
1415
|
),
|
|
1416
1416
|
stepView === "processing" && registration.kind !== "idle" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1417
|
-
|
|
1417
|
+
_chunk4J5ADVINcjs.ProcessingStep,
|
|
1418
1418
|
{
|
|
1419
1419
|
smartAccount: _nullishCoalesce(storeApi.getState().processingSmartAccount, () => ( (registration.kind === "ready" || registration.kind === "stale" ? registration.smartAccount : "0x0"))),
|
|
1420
1420
|
txHash: _nullishCoalesce(storeApi.getState().txHash, () => ( "0x0")),
|
|
@@ -1484,7 +1484,7 @@ function buildWithdrawAnalyticsSessionProperties({
|
|
|
1484
1484
|
recipient: recipient !== void 0,
|
|
1485
1485
|
amount: defaultAmount !== void 0
|
|
1486
1486
|
},
|
|
1487
|
-
...
|
|
1487
|
+
..._chunk4J5ADVINcjs.analyticsTargetProperties.call(void 0, {
|
|
1488
1488
|
targetChain: seedTargetChain,
|
|
1489
1489
|
targetToken: seedTargetToken
|
|
1490
1490
|
})
|
|
@@ -1524,10 +1524,10 @@ function WithdrawModal({
|
|
|
1524
1524
|
onUiState,
|
|
1525
1525
|
...removedProps
|
|
1526
1526
|
}) {
|
|
1527
|
-
|
|
1528
|
-
|
|
1527
|
+
_chunk4J5ADVINcjs.warnRemovedProps.call(void 0, "WithdrawModal", removedProps);
|
|
1528
|
+
_chunkHAQOFI3Dcjs.checkBackendUrl.call(void 0, "WithdrawModal", backendUrl);
|
|
1529
1529
|
const modalRef = _react.useRef.call(void 0, null);
|
|
1530
|
-
const onReadyRef =
|
|
1530
|
+
const onReadyRef = _chunkHAQOFI3Dcjs.useLatestRef.call(void 0, onReady);
|
|
1531
1531
|
const analyticsControllerRef = _react.useRef.call(void 0,
|
|
1532
1532
|
null
|
|
1533
1533
|
);
|
|
@@ -1536,16 +1536,16 @@ function WithdrawModal({
|
|
|
1536
1536
|
void 0
|
|
1537
1537
|
);
|
|
1538
1538
|
const [screen, setScreen] = _react.useState.call(void 0, "form");
|
|
1539
|
-
const onUiStateRef =
|
|
1539
|
+
const onUiStateRef = _chunkHAQOFI3Dcjs.useLatestRef.call(void 0, onUiState);
|
|
1540
1540
|
const targetChain = _chunk4KCSH4T3cjs.getChainId.call(void 0, _nullishCoalesce(targetChainProp, () => ( sourceChainProp)));
|
|
1541
1541
|
const sourceChain = _chunk4KCSH4T3cjs.getChainId.call(void 0, sourceChainProp);
|
|
1542
|
-
const rpcUrls =
|
|
1542
|
+
const rpcUrls = _chunkHAQOFI3Dcjs.useStableRpcUrls.call(void 0, rpcUrlsProp);
|
|
1543
1543
|
const service = _react.useMemo.call(void 0,
|
|
1544
|
-
() =>
|
|
1544
|
+
() => _chunkHAQOFI3Dcjs.createDepositService.call(void 0, backendUrl, { debug, debugScope: "service:withdraw" }),
|
|
1545
1545
|
[backendUrl, debug]
|
|
1546
1546
|
);
|
|
1547
1547
|
const store = _react.useMemo.call(void 0, () => createWithdrawStore(), []);
|
|
1548
|
-
const onErrorRef =
|
|
1548
|
+
const onErrorRef = _chunkHAQOFI3Dcjs.useLatestRef.call(void 0, onError);
|
|
1549
1549
|
_react.useEffect.call(void 0, () => {
|
|
1550
1550
|
if (isOpen && typeof onSendTransaction !== "function") {
|
|
1551
1551
|
_optionalChain([onErrorRef, 'access', _37 => _37.current, 'optionalCall', _38 => _38({
|
|
@@ -1586,7 +1586,7 @@ function WithdrawModal({
|
|
|
1586
1586
|
}, [isOpen]);
|
|
1587
1587
|
_react.useEffect.call(void 0, () => {
|
|
1588
1588
|
if (!isOpen || !modalRef.current) return;
|
|
1589
|
-
return
|
|
1589
|
+
return _chunkHAQOFI3Dcjs.applyTheme.call(void 0, modalRef.current, theme);
|
|
1590
1590
|
}, [isOpen, theme]);
|
|
1591
1591
|
_react.useEffect.call(void 0, () => {
|
|
1592
1592
|
if (isOpen) {
|
|
@@ -1621,8 +1621,8 @@ function WithdrawModal({
|
|
|
1621
1621
|
});
|
|
1622
1622
|
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _54 => _54.showBackButton]), () => ( true));
|
|
1623
1623
|
const canGoBack = backHandler !== void 0;
|
|
1624
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1625
|
-
|
|
1624
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.RpcUrlsProvider, { value: rpcUrls, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.ChainCatalogProvider, { service, rpcUrls, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, WithdrawStoreProvider, { store, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1625
|
+
_chunkHAQOFI3Dcjs.Modal,
|
|
1626
1626
|
{
|
|
1627
1627
|
isOpen,
|
|
1628
1628
|
onClose: handleModalDismiss,
|
|
@@ -1630,7 +1630,7 @@ function WithdrawModal({
|
|
|
1630
1630
|
inline,
|
|
1631
1631
|
closeOnOverlayClick,
|
|
1632
1632
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1633
|
-
|
|
1633
|
+
_chunkHAQOFI3Dcjs.AnalyticsSession,
|
|
1634
1634
|
{
|
|
1635
1635
|
modal: "withdraw",
|
|
1636
1636
|
sessionProperties: analyticsSessionProperties,
|
|
@@ -1651,7 +1651,7 @@ function WithdrawModal({
|
|
|
1651
1651
|
className: "rs-modal-header-back",
|
|
1652
1652
|
"aria-label": "Go back",
|
|
1653
1653
|
onClick: backHandler,
|
|
1654
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1654
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.ChevronLeftIcon, {})
|
|
1655
1655
|
}
|
|
1656
1656
|
) }),
|
|
1657
1657
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-header-nav-right", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -1661,7 +1661,7 @@ function WithdrawModal({
|
|
|
1661
1661
|
onClick: () => closeWithSource("header_button"),
|
|
1662
1662
|
className: "rs-modal-close",
|
|
1663
1663
|
"aria-label": "Close",
|
|
1664
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1664
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.CloseIcon, {})
|
|
1665
1665
|
}
|
|
1666
1666
|
) })
|
|
1667
1667
|
] }),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }// src/core/version.ts
|
|
2
|
-
var MODAL_VERSION = "0.14.
|
|
2
|
+
var MODAL_VERSION = "0.14.1";
|
|
3
3
|
var SERVICE_HEADERS = {
|
|
4
4
|
"Content-Type": "application/json",
|
|
5
5
|
"x-deposit-modal-version": MODAL_VERSION
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
isSubmissionUncertain,
|
|
6
6
|
useTokenPrices,
|
|
7
7
|
warnRemovedProps
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-XCTRKCNM.mjs";
|
|
9
9
|
import {
|
|
10
10
|
AnalyticsSession,
|
|
11
11
|
BodyHeader,
|
|
@@ -41,7 +41,7 @@ import {
|
|
|
41
41
|
useStableRpcUrls,
|
|
42
42
|
useTargetTokens,
|
|
43
43
|
useWithdrawAnalyticsEmitter
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-UX35GYLM.mjs";
|
|
45
45
|
import {
|
|
46
46
|
NATIVE_TOKEN_ADDRESS,
|
|
47
47
|
getChainIcon,
|