@rhinestone/deposit-modal 0.16.0 → 0.17.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-IFN6YLZJ.cjs → DepositModalReown-6CXXGQ7X.cjs} +16 -16
- package/dist/{DepositModalReown-R7UROJPJ.mjs → DepositModalReown-ELDSTIME.mjs} +3 -3
- package/dist/WithdrawModal-QB2U756L.cjs +11 -0
- package/dist/{WithdrawModal-XKSSHVEJ.mjs → WithdrawModal-QRMDR5T4.mjs} +3 -3
- package/dist/{chunk-24N4KMJX.cjs → chunk-2W4BJ5I3.cjs} +71 -71
- package/dist/{chunk-F6ROQ6RJ.mjs → chunk-H66WM5AO.mjs} +7 -4
- package/dist/{chunk-5CM3ZQ5U.cjs → chunk-JCWJ6HW7.cjs} +1 -1
- package/dist/{chunk-H4O22O7Y.cjs → chunk-QGNJFDEO.cjs} +362 -181
- package/dist/{chunk-EA5CE2UZ.mjs → chunk-QMGEK623.mjs} +210 -29
- package/dist/{chunk-3HCCR54R.mjs → chunk-XCBDJPBD.mjs} +1 -1
- package/dist/{chunk-V466XQSG.cjs → chunk-XJMDCBHS.cjs} +444 -441
- package/dist/{chunk-HMB2XQGD.mjs → chunk-ZHX4QROC.mjs} +1 -1
- 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 +4 -4
- package/dist/deposit.mjs +3 -3
- package/dist/embed.cjs +14 -14
- package/dist/embed.mjs +4 -4
- package/dist/index.cjs +5 -5
- package/dist/index.mjs +4 -4
- package/dist/styles.css +22 -0
- package/dist/withdraw.cjs +4 -4
- package/dist/withdraw.mjs +3 -3
- package/package.json +4 -4
- package/dist/WithdrawModal-SZEAI473.cjs +0 -11
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
|
|
47
|
-
var
|
|
47
|
+
var _chunkQGNJFDEOcjs = require('./chunk-QGNJFDEO.cjs');
|
|
48
48
|
|
|
49
49
|
|
|
50
50
|
|
|
@@ -238,7 +238,7 @@ function WithdrawFormStep({
|
|
|
238
238
|
const chainDropdownRef = _react.useRef.call(void 0, null);
|
|
239
239
|
const tokenDropdownRef = _react.useRef.call(void 0, null);
|
|
240
240
|
const publicClientChainId = _optionalChain([publicClient, 'access', _ => _.chain, 'optionalAccess', _2 => _2.id]);
|
|
241
|
-
const onFrictionRef =
|
|
241
|
+
const onFrictionRef = _chunkQGNJFDEOcjs.useLatestRef.call(void 0, onFriction);
|
|
242
242
|
useClickOutside(chainDropdownRef, () => setShowChainDropdown(false));
|
|
243
243
|
useClickOutside(tokenDropdownRef, () => setShowTokenDropdown(false));
|
|
244
244
|
const targetSymbol = _chunkOY5N3E6Lcjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
@@ -266,7 +266,7 @@ function WithdrawFormStep({
|
|
|
266
266
|
return;
|
|
267
267
|
}
|
|
268
268
|
try {
|
|
269
|
-
const bal =
|
|
269
|
+
const bal = _chunkQGNJFDEOcjs.isNativeAsset.call(void 0, asset) ? await publicClient.getBalance({ address: accountAddress }) : await publicClient.readContract({
|
|
270
270
|
address: asset.token,
|
|
271
271
|
abi: _viem.erc20Abi,
|
|
272
272
|
functionName: "balanceOf",
|
|
@@ -368,7 +368,7 @@ function WithdrawFormStep({
|
|
|
368
368
|
await onSubmit(recipient, amount);
|
|
369
369
|
} catch (err) {
|
|
370
370
|
const raw = err instanceof Error ? err.message : "Withdrawal failed";
|
|
371
|
-
setError(
|
|
371
|
+
setError(_chunkQGNJFDEOcjs.formatUserError.call(void 0, raw));
|
|
372
372
|
} finally {
|
|
373
373
|
setIsSubmitting(false);
|
|
374
374
|
}
|
|
@@ -385,16 +385,16 @@ function WithdrawFormStep({
|
|
|
385
385
|
if (isBalanceLoading) {
|
|
386
386
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
387
387
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-withdraw-loading", children: [
|
|
388
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
388
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.Spinner, { className: "rs-spinner--lg" }),
|
|
389
389
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-withdraw-loading-title", children: "Loading on-chain balance" }),
|
|
390
390
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-withdraw-loading-subtitle", children: "Please wait before withdrawing." })
|
|
391
391
|
] }),
|
|
392
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
392
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.PoweredBy, {})
|
|
393
393
|
] });
|
|
394
394
|
}
|
|
395
395
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
396
396
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
397
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
397
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.CircleArrowOutUpLeftIcon, {}), title: "Withdraw" }),
|
|
398
398
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-section", children: [
|
|
399
399
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
400
400
|
"label",
|
|
@@ -454,7 +454,7 @@ function WithdrawFormStep({
|
|
|
454
454
|
) })
|
|
455
455
|
] }),
|
|
456
456
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-amount-info", children: [
|
|
457
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-withdraw-usd", children: amountUsd !== null ? `~${
|
|
457
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-withdraw-usd", children: amountUsd !== null ? `~${_chunkQGNJFDEOcjs.currencyFormatter.format(amountUsd)}` : "$0.00" }),
|
|
458
458
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-withdraw-balance", children: [
|
|
459
459
|
"Balance: ",
|
|
460
460
|
formattedBalance,
|
|
@@ -485,7 +485,7 @@ function WithdrawFormStep({
|
|
|
485
485
|
children: [
|
|
486
486
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-dropdown-value", children: [
|
|
487
487
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
488
|
-
|
|
488
|
+
_chunkQGNJFDEOcjs.CdnIcon,
|
|
489
489
|
{
|
|
490
490
|
src: _chunkOY5N3E6Lcjs.getChainIcon.call(void 0, targetChain),
|
|
491
491
|
alt: targetChainName,
|
|
@@ -495,7 +495,7 @@ function WithdrawFormStep({
|
|
|
495
495
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: targetChainName })
|
|
496
496
|
] }),
|
|
497
497
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
498
|
-
|
|
498
|
+
_chunkQGNJFDEOcjs.ChevronDownIcon,
|
|
499
499
|
{
|
|
500
500
|
className: "rs-withdraw-dropdown-arrow",
|
|
501
501
|
style: {
|
|
@@ -517,7 +517,7 @@ function WithdrawFormStep({
|
|
|
517
517
|
},
|
|
518
518
|
children: [
|
|
519
519
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
520
|
-
|
|
520
|
+
_chunkQGNJFDEOcjs.CdnIcon,
|
|
521
521
|
{
|
|
522
522
|
src: _chunkOY5N3E6Lcjs.getChainIcon.call(void 0, chain.id),
|
|
523
523
|
alt: chain.name,
|
|
@@ -554,7 +554,7 @@ function WithdrawFormStep({
|
|
|
554
554
|
children: [
|
|
555
555
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-dropdown-value", children: [
|
|
556
556
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
557
|
-
|
|
557
|
+
_chunkQGNJFDEOcjs.TokenIcon,
|
|
558
558
|
{
|
|
559
559
|
symbol: targetSymbol,
|
|
560
560
|
className: "rs-withdraw-dropdown-icon"
|
|
@@ -563,7 +563,7 @@ function WithdrawFormStep({
|
|
|
563
563
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: targetSymbol })
|
|
564
564
|
] }),
|
|
565
565
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
566
|
-
|
|
566
|
+
_chunkQGNJFDEOcjs.ChevronDownIcon,
|
|
567
567
|
{
|
|
568
568
|
className: "rs-withdraw-dropdown-arrow",
|
|
569
569
|
style: {
|
|
@@ -585,7 +585,7 @@ function WithdrawFormStep({
|
|
|
585
585
|
},
|
|
586
586
|
children: [
|
|
587
587
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
588
|
-
|
|
588
|
+
_chunkQGNJFDEOcjs.TokenIcon,
|
|
589
589
|
{
|
|
590
590
|
symbol: option.symbol,
|
|
591
591
|
className: "rs-withdraw-dropdown-icon"
|
|
@@ -601,10 +601,10 @@ function WithdrawFormStep({
|
|
|
601
601
|
)
|
|
602
602
|
] })
|
|
603
603
|
] }),
|
|
604
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
605
|
-
!error && registrationError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
604
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.Callout, { variant: "error", children: error }),
|
|
605
|
+
!error && registrationError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.Callout, { variant: "error", children: registrationError }),
|
|
606
606
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
607
|
-
|
|
607
|
+
_chunkQGNJFDEOcjs.Button,
|
|
608
608
|
{
|
|
609
609
|
onClick: handleWithdraw,
|
|
610
610
|
fullWidth: true,
|
|
@@ -619,7 +619,7 @@ function WithdrawFormStep({
|
|
|
619
619
|
}
|
|
620
620
|
)
|
|
621
621
|
] }),
|
|
622
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
622
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.PoweredBy, {})
|
|
623
623
|
] });
|
|
624
624
|
}
|
|
625
625
|
WithdrawFormStep.displayName = "WithdrawFormStep";
|
|
@@ -660,16 +660,16 @@ function WithdrawReviewStep({
|
|
|
660
660
|
const targetChainName = _chunkOY5N3E6Lcjs.getChainName.call(void 0, targetChain);
|
|
661
661
|
const targetChainIcon = _chunkOY5N3E6Lcjs.getChainIcon.call(void 0, targetChain);
|
|
662
662
|
const amountNumber = Number(amount);
|
|
663
|
-
const formattedSendAmount = _nullishCoalesce(
|
|
664
|
-
const prices =
|
|
663
|
+
const formattedSendAmount = _nullishCoalesce(_chunkQGNJFDEOcjs.formatTokenAmount.call(void 0, amountNumber, sourceSymbol), () => ( amount));
|
|
664
|
+
const prices = _chunkQGNJFDEOcjs.useTokenPrices.call(void 0, service, [
|
|
665
665
|
{ chainId: sourceChain, address: sourceToken, symbol: sourceSymbol },
|
|
666
666
|
{ chainId: targetChain, address: targetToken, symbol: targetSymbol }
|
|
667
667
|
]);
|
|
668
|
-
const receiveDisplay = _nullishCoalesce(
|
|
668
|
+
const receiveDisplay = _nullishCoalesce(_chunkQGNJFDEOcjs.formatReceiveEstimate.call(void 0, {
|
|
669
669
|
sourceAmount: Number.isFinite(amountNumber) ? amountNumber : void 0,
|
|
670
670
|
sourceSymbol,
|
|
671
671
|
targetSymbol,
|
|
672
|
-
sourceTrusted:
|
|
672
|
+
sourceTrusted: _chunkQGNJFDEOcjs.isRecognizedToken.call(void 0, sourceToken, sourceChain),
|
|
673
673
|
prices
|
|
674
674
|
}), () => ( // No price for the target token — an honest dash beats a wrong number.
|
|
675
675
|
"\u2014"));
|
|
@@ -681,8 +681,8 @@ function WithdrawReviewStep({
|
|
|
681
681
|
await onConfirm();
|
|
682
682
|
} catch (err) {
|
|
683
683
|
const raw = err instanceof Error ? err.message : "Withdraw failed";
|
|
684
|
-
const uncertain =
|
|
685
|
-
const message = uncertain ? "Withdrawal status is uncertain. Check your activity before trying again." :
|
|
684
|
+
const uncertain = _chunkQGNJFDEOcjs.isSubmissionUncertain.call(void 0, err);
|
|
685
|
+
const message = uncertain ? "Withdrawal status is uncertain. Check your activity before trying again." : _chunkQGNJFDEOcjs.formatUserError.call(void 0, raw);
|
|
686
686
|
if (uncertain) setSubmissionUncertain(true);
|
|
687
687
|
setError(message);
|
|
688
688
|
_optionalChain([onError, 'optionalCall', _19 => _19(message, "WITHDRAW_REVIEW_ERROR", raw)]);
|
|
@@ -694,9 +694,9 @@ function WithdrawReviewStep({
|
|
|
694
694
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
695
695
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
696
696
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
697
|
-
|
|
697
|
+
_chunkQGNJFDEOcjs.BodyHeader,
|
|
698
698
|
{
|
|
699
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
699
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.CircleArrowOutUpLeftIcon, {}),
|
|
700
700
|
title: "Review withdrawal"
|
|
701
701
|
}
|
|
702
702
|
),
|
|
@@ -709,14 +709,14 @@ function WithdrawReviewStep({
|
|
|
709
709
|
" ",
|
|
710
710
|
sourceSymbol
|
|
711
711
|
] }),
|
|
712
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
712
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.TokenIcon, { symbol: sourceSymbol }) })
|
|
713
713
|
] })
|
|
714
714
|
] }),
|
|
715
715
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
716
716
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Source chain" }),
|
|
717
717
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
718
718
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: sourceChainName }),
|
|
719
|
-
sourceChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
719
|
+
sourceChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.CdnIcon, { src: sourceChainIcon }) })
|
|
720
720
|
] })
|
|
721
721
|
] }),
|
|
722
722
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
@@ -727,14 +727,14 @@ function WithdrawReviewStep({
|
|
|
727
727
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Receive" }),
|
|
728
728
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
729
729
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: receiveDisplay }),
|
|
730
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
730
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.TokenIcon, { symbol: targetSymbol }) })
|
|
731
731
|
] })
|
|
732
732
|
] }),
|
|
733
733
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
734
734
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Destination chain" }),
|
|
735
735
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
736
736
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: targetChainName }),
|
|
737
|
-
targetChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
737
|
+
targetChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.CdnIcon, { src: targetChainIcon }) })
|
|
738
738
|
] })
|
|
739
739
|
] }),
|
|
740
740
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
@@ -742,10 +742,10 @@ function WithdrawReviewStep({
|
|
|
742
742
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-value", children: estimatedTime })
|
|
743
743
|
] })
|
|
744
744
|
] }),
|
|
745
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
746
|
-
!error && registrationError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
745
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.Callout, { variant: "error", children: error }),
|
|
746
|
+
!error && registrationError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.Callout, { variant: "error", children: registrationError }),
|
|
747
747
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
748
|
-
|
|
748
|
+
_chunkQGNJFDEOcjs.Button,
|
|
749
749
|
{
|
|
750
750
|
onClick: handleConfirm,
|
|
751
751
|
loading: isSubmitting,
|
|
@@ -756,7 +756,7 @@ function WithdrawReviewStep({
|
|
|
756
756
|
}
|
|
757
757
|
)
|
|
758
758
|
] }),
|
|
759
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
759
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.PoweredBy, {})
|
|
760
760
|
] });
|
|
761
761
|
}
|
|
762
762
|
WithdrawReviewStep.displayName = "WithdrawReviewStep";
|
|
@@ -772,7 +772,7 @@ WithdrawReviewStep.displayName = "WithdrawReviewStep";
|
|
|
772
772
|
|
|
773
773
|
|
|
774
774
|
function withdrawFailureReasonForError(error) {
|
|
775
|
-
if (
|
|
775
|
+
if (_chunkQGNJFDEOcjs.isSubmissionUncertain.call(void 0, error)) return "submission_uncertain";
|
|
776
776
|
const message = (error instanceof Error ? error.message : String(_nullishCoalesce(error, () => ( "")))).toLowerCase();
|
|
777
777
|
if (message.includes("changed before submission")) {
|
|
778
778
|
return "registration_target_changed";
|
|
@@ -931,7 +931,7 @@ function WithdrawAnalyticsControllerProvider({
|
|
|
931
931
|
children,
|
|
932
932
|
controllerRef
|
|
933
933
|
}) {
|
|
934
|
-
const emit =
|
|
934
|
+
const emit = _chunkQGNJFDEOcjs.useWithdrawAnalyticsEmitter.call(void 0, );
|
|
935
935
|
const controller = _react.useMemo.call(void 0,
|
|
936
936
|
() => createWithdrawAnalyticsController(emit),
|
|
937
937
|
[emit]
|
|
@@ -971,11 +971,11 @@ function WithdrawFlow({
|
|
|
971
971
|
onError,
|
|
972
972
|
debug
|
|
973
973
|
}) {
|
|
974
|
-
const rpcUrls =
|
|
975
|
-
const onStepChangeRef =
|
|
974
|
+
const rpcUrls = _chunkQGNJFDEOcjs.useRpcUrls.call(void 0, );
|
|
975
|
+
const onStepChangeRef = _chunkQGNJFDEOcjs.useLatestRef.call(void 0, onStepChange);
|
|
976
976
|
const analytics = useWithdrawAnalyticsController();
|
|
977
|
-
const onLifecycleRef =
|
|
978
|
-
const onErrorRef =
|
|
977
|
+
const onLifecycleRef = _chunkQGNJFDEOcjs.useLatestRef.call(void 0, onLifecycle);
|
|
978
|
+
const onErrorRef = _chunkQGNJFDEOcjs.useLatestRef.call(void 0, onError);
|
|
979
979
|
const isFlowActiveRef = _react.useRef.call(void 0, true);
|
|
980
980
|
const submitGenerationRef = _react.useRef.call(void 0, 0);
|
|
981
981
|
const lastSubmitFailureRef = _react.useRef.call(void 0,
|
|
@@ -989,13 +989,13 @@ function WithdrawFlow({
|
|
|
989
989
|
}, []);
|
|
990
990
|
const logFlow = _react.useCallback.call(void 0,
|
|
991
991
|
(message, data) => {
|
|
992
|
-
|
|
992
|
+
_chunkQGNJFDEOcjs.debugLog.call(void 0, debug, "withdraw-flow", message, data);
|
|
993
993
|
},
|
|
994
994
|
[debug]
|
|
995
995
|
);
|
|
996
996
|
const logFlowError = _react.useCallback.call(void 0,
|
|
997
997
|
(message, error, data) => {
|
|
998
|
-
|
|
998
|
+
_chunkQGNJFDEOcjs.debugError.call(void 0, debug, "withdraw-flow", message, error, data);
|
|
999
999
|
},
|
|
1000
1000
|
[debug]
|
|
1001
1001
|
);
|
|
@@ -1017,12 +1017,12 @@ function WithdrawFlow({
|
|
|
1017
1017
|
const registration = useWithdrawStore((s) => s.registration);
|
|
1018
1018
|
const flowStep = useWithdrawStore((s) => s.step);
|
|
1019
1019
|
const reviewedRecipient = useWithdrawStore((s) => s.recipient);
|
|
1020
|
-
const publicClient =
|
|
1020
|
+
const publicClient = _chunkQGNJFDEOcjs.useReadClient.call(void 0, sourceChain, rpcUrls);
|
|
1021
1021
|
const recipientForRegistration = _react.useMemo.call(void 0, () => {
|
|
1022
1022
|
if (!recipientInput) return void 0;
|
|
1023
1023
|
return ADDR_REGEX.test(recipientInput) ? recipientInput : void 0;
|
|
1024
1024
|
}, [recipientInput]);
|
|
1025
|
-
const onDestinationChangeRef =
|
|
1025
|
+
const onDestinationChangeRef = _chunkQGNJFDEOcjs.useLatestRef.call(void 0, onDestinationChange);
|
|
1026
1026
|
const reportedDestinationRef = _react.useRef.call(void 0, void 0);
|
|
1027
1027
|
_react.useEffect.call(void 0, () => {
|
|
1028
1028
|
if (reportedDestinationRef.current === recipientForRegistration) return;
|
|
@@ -1058,7 +1058,7 @@ function WithdrawFlow({
|
|
|
1058
1058
|
targetToken,
|
|
1059
1059
|
recipient: recipientForRegistration
|
|
1060
1060
|
});
|
|
1061
|
-
const salt =
|
|
1061
|
+
const salt = _chunkQGNJFDEOcjs.deriveAccountSalt.call(void 0, {
|
|
1062
1062
|
recipient: recipientForRegistration,
|
|
1063
1063
|
targetChain,
|
|
1064
1064
|
targetToken
|
|
@@ -1088,7 +1088,7 @@ function WithdrawFlow({
|
|
|
1088
1088
|
} catch (err) {
|
|
1089
1089
|
if (cancelled) return;
|
|
1090
1090
|
const raw = err instanceof Error ? err.message : "Registration failed";
|
|
1091
|
-
const message =
|
|
1091
|
+
const message = _chunkQGNJFDEOcjs.formatUserError.call(void 0, raw);
|
|
1092
1092
|
logFlowError("auto-register:failed", err, {
|
|
1093
1093
|
accountAddress,
|
|
1094
1094
|
targetChain,
|
|
@@ -1122,7 +1122,7 @@ function WithdrawFlow({
|
|
|
1122
1122
|
const symbol = _chunkOY5N3E6Lcjs.getTokenSymbol.call(void 0, sourceToken, sourceChain);
|
|
1123
1123
|
const decimals = _chunkOY5N3E6Lcjs.getTokenDecimalsByAddress.call(void 0, sourceToken, sourceChain);
|
|
1124
1124
|
return {
|
|
1125
|
-
id:
|
|
1125
|
+
id: _chunkQGNJFDEOcjs.getAssetId.call(void 0, { chainId: sourceChain, token: sourceToken }),
|
|
1126
1126
|
chainId: sourceChain,
|
|
1127
1127
|
token: sourceToken,
|
|
1128
1128
|
symbol,
|
|
@@ -1320,7 +1320,7 @@ function WithdrawFlow({
|
|
|
1320
1320
|
targetChain,
|
|
1321
1321
|
targetToken
|
|
1322
1322
|
});
|
|
1323
|
-
handleError(
|
|
1323
|
+
handleError(_chunkQGNJFDEOcjs.formatUserError.call(void 0, raw), "WITHDRAW_FLOW_ERROR");
|
|
1324
1324
|
throw err;
|
|
1325
1325
|
}
|
|
1326
1326
|
},
|
|
@@ -1379,8 +1379,8 @@ function WithdrawFlow({
|
|
|
1379
1379
|
},
|
|
1380
1380
|
[analytics, logFlowError, onLifecycleRef, storeApi]
|
|
1381
1381
|
);
|
|
1382
|
-
const targetChainOptions =
|
|
1383
|
-
const targetTokensFor =
|
|
1382
|
+
const targetChainOptions = _chunkQGNJFDEOcjs.useDestinationChains.call(void 0, );
|
|
1383
|
+
const targetTokensFor = _chunkQGNJFDEOcjs.useTargetTokens.call(void 0, );
|
|
1384
1384
|
const targetTokenOptions = _react.useMemo.call(void 0,
|
|
1385
1385
|
() => targetTokensFor(targetChain),
|
|
1386
1386
|
[targetChain, targetTokensFor]
|
|
@@ -1459,7 +1459,7 @@ function WithdrawFlow({
|
|
|
1459
1459
|
}
|
|
1460
1460
|
),
|
|
1461
1461
|
stepView === "processing" && registration.kind !== "idle" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1462
|
-
|
|
1462
|
+
_chunkQGNJFDEOcjs.ProcessingStep,
|
|
1463
1463
|
{
|
|
1464
1464
|
smartAccount: _nullishCoalesce(storeApi.getState().processingSmartAccount, () => ( (registration.kind === "ready" || registration.kind === "stale" ? registration.smartAccount : "0x0"))),
|
|
1465
1465
|
txHash: _nullishCoalesce(storeApi.getState().txHash, () => ( "0x0")),
|
|
@@ -1529,7 +1529,7 @@ function buildWithdrawAnalyticsSessionProperties({
|
|
|
1529
1529
|
recipient: recipient !== void 0,
|
|
1530
1530
|
amount: defaultAmount !== void 0
|
|
1531
1531
|
},
|
|
1532
|
-
...
|
|
1532
|
+
..._chunkQGNJFDEOcjs.analyticsTargetProperties.call(void 0, {
|
|
1533
1533
|
targetChain: seedTargetChain,
|
|
1534
1534
|
targetToken: seedTargetToken
|
|
1535
1535
|
})
|
|
@@ -1570,10 +1570,10 @@ function WithdrawModal({
|
|
|
1570
1570
|
onUiState,
|
|
1571
1571
|
...removedProps
|
|
1572
1572
|
}) {
|
|
1573
|
-
|
|
1574
|
-
|
|
1573
|
+
_chunkQGNJFDEOcjs.warnRemovedProps.call(void 0, "WithdrawModal", removedProps);
|
|
1574
|
+
_chunkQGNJFDEOcjs.checkBackendUrl.call(void 0, "WithdrawModal", backendUrl);
|
|
1575
1575
|
const modalRef = _react.useRef.call(void 0, null);
|
|
1576
|
-
const onReadyRef =
|
|
1576
|
+
const onReadyRef = _chunkQGNJFDEOcjs.useLatestRef.call(void 0, onReady);
|
|
1577
1577
|
const analyticsControllerRef = _react.useRef.call(void 0,
|
|
1578
1578
|
null
|
|
1579
1579
|
);
|
|
@@ -1587,23 +1587,23 @@ function WithdrawModal({
|
|
|
1587
1587
|
const [historyRecipient, setHistoryRecipient] = _react.useState.call(void 0,
|
|
1588
1588
|
recipient
|
|
1589
1589
|
);
|
|
1590
|
-
const onUiStateRef =
|
|
1590
|
+
const onUiStateRef = _chunkQGNJFDEOcjs.useLatestRef.call(void 0, onUiState);
|
|
1591
1591
|
const targetChain = _chunkOY5N3E6Lcjs.getChainId.call(void 0, _nullishCoalesce(targetChainProp, () => ( sourceChainProp)));
|
|
1592
1592
|
const sourceChain = _chunkOY5N3E6Lcjs.getChainId.call(void 0, sourceChainProp);
|
|
1593
|
-
const rpcUrls =
|
|
1593
|
+
const rpcUrls = _chunkQGNJFDEOcjs.useStableRpcUrls.call(void 0, rpcUrlsProp);
|
|
1594
1594
|
const service = _react.useMemo.call(void 0,
|
|
1595
|
-
() =>
|
|
1595
|
+
() => _chunkQGNJFDEOcjs.createDepositService.call(void 0, backendUrl, { debug, debugScope: "service:withdraw" }),
|
|
1596
1596
|
[backendUrl, debug]
|
|
1597
1597
|
);
|
|
1598
1598
|
const historyAnalytics = _react.useMemo.call(void 0,
|
|
1599
|
-
() =>
|
|
1599
|
+
() => _chunkQGNJFDEOcjs.createHistoryAnalytics.call(void 0, {
|
|
1600
1600
|
modal: "withdraw",
|
|
1601
1601
|
controllerRef: analyticsControllerRef,
|
|
1602
1602
|
sessionIdRef: analyticsSessionIdRef
|
|
1603
1603
|
}),
|
|
1604
1604
|
[]
|
|
1605
1605
|
);
|
|
1606
|
-
const history =
|
|
1606
|
+
const history = _chunkQGNJFDEOcjs.useHistoryPanel.call(void 0, {
|
|
1607
1607
|
isOpen,
|
|
1608
1608
|
recipient: historyRecipient,
|
|
1609
1609
|
service,
|
|
@@ -1611,13 +1611,13 @@ function WithdrawModal({
|
|
|
1611
1611
|
analytics: historyAnalytics
|
|
1612
1612
|
});
|
|
1613
1613
|
const { markStale: markHistoryStale, recoverySubmitting } = history;
|
|
1614
|
-
const historyButtonVisible =
|
|
1614
|
+
const historyButtonVisible = _chunkQGNJFDEOcjs.isHistoryEntryVisible.call(void 0, {
|
|
1615
1615
|
screen,
|
|
1616
1616
|
submitting,
|
|
1617
1617
|
settled: false
|
|
1618
1618
|
});
|
|
1619
1619
|
const store = _react.useMemo.call(void 0, () => createWithdrawStore(), []);
|
|
1620
|
-
const onErrorRef =
|
|
1620
|
+
const onErrorRef = _chunkQGNJFDEOcjs.useLatestRef.call(void 0, onError);
|
|
1621
1621
|
_react.useEffect.call(void 0, () => {
|
|
1622
1622
|
if (isOpen && typeof onSendTransaction !== "function") {
|
|
1623
1623
|
_optionalChain([onErrorRef, 'access', _43 => _43.current, 'optionalCall', _44 => _44({
|
|
@@ -1659,7 +1659,7 @@ function WithdrawModal({
|
|
|
1659
1659
|
}, [isOpen]);
|
|
1660
1660
|
_react.useEffect.call(void 0, () => {
|
|
1661
1661
|
if (!isOpen || !modalRef.current) return;
|
|
1662
|
-
return
|
|
1662
|
+
return _chunkQGNJFDEOcjs.applyTheme.call(void 0, modalRef.current, theme);
|
|
1663
1663
|
}, [isOpen, theme]);
|
|
1664
1664
|
_react.useEffect.call(void 0, () => {
|
|
1665
1665
|
if (isOpen) {
|
|
@@ -1685,7 +1685,7 @@ function WithdrawModal({
|
|
|
1685
1685
|
submitting: submitting || recoverySubmitting
|
|
1686
1686
|
})]);
|
|
1687
1687
|
}, [screen, backHandler, submitting, recoverySubmitting, onUiStateRef]);
|
|
1688
|
-
const onLifecycleRef =
|
|
1688
|
+
const onLifecycleRef = _chunkQGNJFDEOcjs.useLatestRef.call(void 0, onLifecycle);
|
|
1689
1689
|
const handleLifecycle = _react.useCallback.call(void 0,
|
|
1690
1690
|
(event) => {
|
|
1691
1691
|
_optionalChain([onLifecycleRef, 'access', _60 => _60.current, 'optionalCall', _61 => _61(event)]);
|
|
@@ -1707,8 +1707,8 @@ function WithdrawModal({
|
|
|
1707
1707
|
});
|
|
1708
1708
|
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _62 => _62.showBackButton]), () => ( true));
|
|
1709
1709
|
const canGoBack = backHandler !== void 0 && !submitting;
|
|
1710
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1711
|
-
|
|
1710
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.RpcUrlsProvider, { value: rpcUrls, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.ChainCatalogProvider, { service, rpcUrls, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, WithdrawStoreProvider, { store, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1711
|
+
_chunkQGNJFDEOcjs.Modal,
|
|
1712
1712
|
{
|
|
1713
1713
|
isOpen,
|
|
1714
1714
|
onClose: handleModalDismiss,
|
|
@@ -1717,7 +1717,7 @@ function WithdrawModal({
|
|
|
1717
1717
|
closeOnOverlayClick,
|
|
1718
1718
|
ariaLabel: "Withdraw",
|
|
1719
1719
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1720
|
-
|
|
1720
|
+
_chunkQGNJFDEOcjs.AnalyticsSession,
|
|
1721
1721
|
{
|
|
1722
1722
|
modal: "withdraw",
|
|
1723
1723
|
sessionProperties: analyticsSessionProperties,
|
|
@@ -1739,12 +1739,12 @@ function WithdrawModal({
|
|
|
1739
1739
|
className: "rs-modal-header-back",
|
|
1740
1740
|
"aria-label": "Go back",
|
|
1741
1741
|
onClick: backHandler,
|
|
1742
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1742
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.ChevronLeftIcon, {})
|
|
1743
1743
|
}
|
|
1744
1744
|
) }),
|
|
1745
1745
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-header-nav-right", children: [
|
|
1746
1746
|
historyButtonVisible && historyRecipient && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1747
|
-
|
|
1747
|
+
_chunkQGNJFDEOcjs.HistoryEntryButton,
|
|
1748
1748
|
{
|
|
1749
1749
|
badge: history.badge,
|
|
1750
1750
|
onClick: history.openPanel
|
|
@@ -1757,7 +1757,7 @@ function WithdrawModal({
|
|
|
1757
1757
|
onClick: () => closeWithSource("header_button"),
|
|
1758
1758
|
className: "rs-modal-close",
|
|
1759
1759
|
"aria-label": "Close",
|
|
1760
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1760
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.CloseIcon, {})
|
|
1761
1761
|
}
|
|
1762
1762
|
)
|
|
1763
1763
|
] })
|
|
@@ -1785,7 +1785,7 @@ function WithdrawModal({
|
|
|
1785
1785
|
}
|
|
1786
1786
|
),
|
|
1787
1787
|
history.isPanelOpen && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1788
|
-
|
|
1788
|
+
_chunkQGNJFDEOcjs.HistoryOverlay,
|
|
1789
1789
|
{
|
|
1790
1790
|
controller: history,
|
|
1791
1791
|
backLabel: "Withdraw",
|
|
@@ -49,6 +49,7 @@ import {
|
|
|
49
49
|
debugLog,
|
|
50
50
|
failureMessageForEvent,
|
|
51
51
|
fetchTokenPriceUsd,
|
|
52
|
+
formatExpectedDuration,
|
|
52
53
|
formatQuotedReceive,
|
|
53
54
|
formatReceiveEstimate,
|
|
54
55
|
formatTokenAmount,
|
|
@@ -86,7 +87,7 @@ import {
|
|
|
86
87
|
useRpcUrls,
|
|
87
88
|
useStableRpcUrls,
|
|
88
89
|
warnRemovedProps
|
|
89
|
-
} from "./chunk-
|
|
90
|
+
} from "./chunk-QMGEK623.mjs";
|
|
90
91
|
import {
|
|
91
92
|
MULTICALL3_ADDRESS,
|
|
92
93
|
POLYMARKET_COLLATERAL_OFFRAMP_ADDRESS,
|
|
@@ -1722,7 +1723,8 @@ function ConfirmStep({
|
|
|
1722
1723
|
if (estimate !== void 0) return estimate;
|
|
1723
1724
|
return targetSymbol;
|
|
1724
1725
|
})();
|
|
1725
|
-
const
|
|
1726
|
+
const servedExpectedSeconds = quote?.timing?.expectedSeconds ?? (quote && Number.isFinite(quote.estimatedFillTimeSeconds) ? quote.estimatedFillTimeSeconds : void 0);
|
|
1727
|
+
const estimatedTimeDisplay = servedExpectedSeconds !== void 0 ? formatExpectedDuration(servedExpectedSeconds) : estimatedTime;
|
|
1726
1728
|
useEffect4(() => {
|
|
1727
1729
|
if (chainMismatch && switchChain && !hasAttemptedSwitch.current) {
|
|
1728
1730
|
hasAttemptedSwitch.current = true;
|
|
@@ -2095,7 +2097,8 @@ function QrReviewStep({
|
|
|
2095
2097
|
});
|
|
2096
2098
|
return estimate ?? targetSymbol;
|
|
2097
2099
|
})();
|
|
2098
|
-
const
|
|
2100
|
+
const expectedSeconds = quote.value?.timing?.expectedSeconds ?? (quote.value && Number.isFinite(quote.value.estimatedFillTimeSeconds) ? quote.value.estimatedFillTimeSeconds : void 0);
|
|
2101
|
+
const estimatedTime = expectedSeconds !== void 0 ? formatExpectedDuration(expectedSeconds) : quote.state === "loading" ? "\u2026" : "\u2014";
|
|
2099
2102
|
const { display: quotedFee, struck } = quoteFeeRow(quote.value?.fees);
|
|
2100
2103
|
const feeDisplay = quote.state === "unavailable" ? "\u2014" : quotedFee;
|
|
2101
2104
|
return /* @__PURE__ */ jsxs9("div", { className: "rs-screen", children: [
|
|
@@ -9643,7 +9646,7 @@ function DepositFlow({
|
|
|
9643
9646
|
import { jsx as jsx29, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
9644
9647
|
var ReownDepositInner = lazy2(async () => {
|
|
9645
9648
|
await loadReownDependencies();
|
|
9646
|
-
const module = await import("./DepositModalReown-
|
|
9649
|
+
const module = await import("./DepositModalReown-ELDSTIME.mjs");
|
|
9647
9650
|
return { default: module.DepositModalReown };
|
|
9648
9651
|
});
|
|
9649
9652
|
function buildDepositAnalyticsSessionProperties({
|
|
@@ -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.
|
|
2
|
+
var MODAL_VERSION = "0.17.0";
|
|
3
3
|
var SERVICE_HEADERS = {
|
|
4
4
|
"Content-Type": "application/json",
|
|
5
5
|
"x-deposit-modal-version": MODAL_VERSION
|