@rhinestone/deposit-modal 0.9.0 → 0.9.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/dist/{DepositModalReown-6KUAO5ZC.mjs → DepositModalReown-JUJI7UHE.mjs} +5 -5
- package/dist/{DepositModalReown-XC5RIU7Z.cjs → DepositModalReown-YQSO4SVY.cjs} +9 -9
- package/dist/{chunk-VN4BLZYC.cjs → chunk-6U2H3R3T.cjs} +21 -21
- package/dist/{chunk-4WB2FHGC.mjs → chunk-7OQO6JDC.mjs} +3 -3
- package/dist/{chunk-LGVJWVSS.mjs → chunk-AYWEWI47.mjs} +2 -2
- package/dist/{chunk-T7LGQFP3.cjs → chunk-EAUF7SGM.cjs} +3 -3
- package/dist/{chunk-NMIMRASD.cjs → chunk-EEEQZOTJ.cjs} +66 -66
- package/dist/{chunk-WYXBY2MQ.mjs → chunk-GYEUZSQP.mjs} +1 -1
- package/dist/{chunk-DIX7M3SP.cjs → chunk-ITFRTPGF.cjs} +57 -57
- package/dist/{chunk-KKHLNFSA.mjs → chunk-N3OHR3T2.mjs} +58 -99
- package/dist/{chunk-E4G5BOZP.mjs → chunk-QGXAAFHU.mjs} +2 -2
- package/dist/{chunk-OSI2CFGL.mjs → chunk-QLZ5RZTA.mjs} +1 -1
- package/dist/{chunk-PAGMU4RQ.cjs → chunk-SQOEHQNT.cjs} +52 -52
- package/dist/{chunk-22RV33LK.cjs → chunk-VQJHYWAE.cjs} +309 -350
- package/dist/{chunk-VOGZAZB2.mjs → chunk-WUQZYQRK.mjs} +1 -1
- package/dist/{chunk-NEXUCY4B.cjs → chunk-XJE5MRY4.cjs} +1 -1
- package/dist/claim.cjs +5 -5
- package/dist/claim.mjs +4 -4
- 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/index.cjs +8 -8
- package/dist/index.mjs +7 -7
- package/dist/withdraw.cjs +5 -5
- package/dist/withdraw.mjs +4 -4
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkEEEQZOTJcjs = require('./chunk-EEEQZOTJ.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
@@ -34,7 +34,7 @@ var _chunkNMIMRASDcjs = require('./chunk-NMIMRASD.cjs');
|
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
|
|
37
|
-
var
|
|
37
|
+
var _chunk6U2H3R3Tcjs = require('./chunk-6U2H3R3T.cjs');
|
|
38
38
|
|
|
39
39
|
|
|
40
40
|
|
|
@@ -257,7 +257,7 @@ function WithdrawFormStep({
|
|
|
257
257
|
return;
|
|
258
258
|
}
|
|
259
259
|
try {
|
|
260
|
-
const bal =
|
|
260
|
+
const bal = _chunk6U2H3R3Tcjs.isNativeAsset.call(void 0, asset) ? await publicClient.getBalance({ address: accountAddress }) : await publicClient.readContract({
|
|
261
261
|
address: asset.token,
|
|
262
262
|
abi: _viem.erc20Abi,
|
|
263
263
|
functionName: "balanceOf",
|
|
@@ -362,7 +362,7 @@ function WithdrawFormStep({
|
|
|
362
362
|
await onSubmit(recipient, amount);
|
|
363
363
|
} catch (err) {
|
|
364
364
|
const raw = err instanceof Error ? err.message : "Withdrawal failed";
|
|
365
|
-
setError(
|
|
365
|
+
setError(_chunk6U2H3R3Tcjs.formatUserError.call(void 0, raw));
|
|
366
366
|
} finally {
|
|
367
367
|
setIsSubmitting(false);
|
|
368
368
|
}
|
|
@@ -378,16 +378,16 @@ function WithdrawFormStep({
|
|
|
378
378
|
if (isBalanceLoading) {
|
|
379
379
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
380
380
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-withdraw-loading", children: [
|
|
381
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
381
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6U2H3R3Tcjs.Spinner, { className: "rs-spinner--lg" }),
|
|
382
382
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-withdraw-loading-title", children: "Loading on-chain balance" }),
|
|
383
383
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-withdraw-loading-subtitle", children: "Please wait before withdrawing." })
|
|
384
384
|
] }),
|
|
385
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
385
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6U2H3R3Tcjs.PoweredBy, {})
|
|
386
386
|
] });
|
|
387
387
|
}
|
|
388
388
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
389
389
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
390
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
390
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6U2H3R3Tcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6U2H3R3Tcjs.CircleArrowOutUpLeftIcon, {}), title: "Withdraw" }),
|
|
391
391
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-section", children: [
|
|
392
392
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
393
393
|
"label",
|
|
@@ -447,7 +447,7 @@ function WithdrawFormStep({
|
|
|
447
447
|
) })
|
|
448
448
|
] }),
|
|
449
449
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-amount-info", children: [
|
|
450
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-withdraw-usd", children: amountUsd !== null ? `~${
|
|
450
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-withdraw-usd", children: amountUsd !== null ? `~${_chunk6U2H3R3Tcjs.currencyFormatter.format(amountUsd)}` : "$0.00" }),
|
|
451
451
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-withdraw-balance", children: [
|
|
452
452
|
"Balance: ",
|
|
453
453
|
formattedBalance,
|
|
@@ -478,7 +478,7 @@ function WithdrawFormStep({
|
|
|
478
478
|
children: [
|
|
479
479
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-dropdown-value", children: [
|
|
480
480
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
481
|
-
|
|
481
|
+
_chunk6U2H3R3Tcjs.CdnIcon,
|
|
482
482
|
{
|
|
483
483
|
src: _chunkH577RJN5cjs.getChainIcon.call(void 0, targetChain),
|
|
484
484
|
alt: targetChainName,
|
|
@@ -488,7 +488,7 @@ function WithdrawFormStep({
|
|
|
488
488
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: targetChainName })
|
|
489
489
|
] }),
|
|
490
490
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
491
|
-
|
|
491
|
+
_chunk6U2H3R3Tcjs.ChevronDownIcon,
|
|
492
492
|
{
|
|
493
493
|
className: "rs-withdraw-dropdown-arrow",
|
|
494
494
|
style: {
|
|
@@ -510,7 +510,7 @@ function WithdrawFormStep({
|
|
|
510
510
|
},
|
|
511
511
|
children: [
|
|
512
512
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
513
|
-
|
|
513
|
+
_chunk6U2H3R3Tcjs.CdnIcon,
|
|
514
514
|
{
|
|
515
515
|
src: _chunkH577RJN5cjs.getChainIcon.call(void 0, chain.id),
|
|
516
516
|
alt: chain.name,
|
|
@@ -547,7 +547,7 @@ function WithdrawFormStep({
|
|
|
547
547
|
children: [
|
|
548
548
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-dropdown-value", children: [
|
|
549
549
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
550
|
-
|
|
550
|
+
_chunk6U2H3R3Tcjs.TokenIcon,
|
|
551
551
|
{
|
|
552
552
|
symbol: targetSymbol,
|
|
553
553
|
className: "rs-withdraw-dropdown-icon"
|
|
@@ -556,7 +556,7 @@ function WithdrawFormStep({
|
|
|
556
556
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: targetSymbol })
|
|
557
557
|
] }),
|
|
558
558
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
559
|
-
|
|
559
|
+
_chunk6U2H3R3Tcjs.ChevronDownIcon,
|
|
560
560
|
{
|
|
561
561
|
className: "rs-withdraw-dropdown-arrow",
|
|
562
562
|
style: {
|
|
@@ -578,7 +578,7 @@ function WithdrawFormStep({
|
|
|
578
578
|
},
|
|
579
579
|
children: [
|
|
580
580
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
581
|
-
|
|
581
|
+
_chunk6U2H3R3Tcjs.TokenIcon,
|
|
582
582
|
{
|
|
583
583
|
symbol: option.symbol,
|
|
584
584
|
className: "rs-withdraw-dropdown-icon"
|
|
@@ -594,10 +594,10 @@ function WithdrawFormStep({
|
|
|
594
594
|
)
|
|
595
595
|
] })
|
|
596
596
|
] }),
|
|
597
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
598
|
-
!error && registrationError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
597
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6U2H3R3Tcjs.Callout, { variant: "error", children: error }),
|
|
598
|
+
!error && registrationError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6U2H3R3Tcjs.Callout, { variant: "error", children: registrationError }),
|
|
599
599
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
600
|
-
|
|
600
|
+
_chunk6U2H3R3Tcjs.Button,
|
|
601
601
|
{
|
|
602
602
|
onClick: handleWithdraw,
|
|
603
603
|
fullWidth: true,
|
|
@@ -607,7 +607,7 @@ function WithdrawFormStep({
|
|
|
607
607
|
}
|
|
608
608
|
)
|
|
609
609
|
] }),
|
|
610
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
610
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6U2H3R3Tcjs.PoweredBy, {})
|
|
611
611
|
] });
|
|
612
612
|
}
|
|
613
613
|
WithdrawFormStep.displayName = "WithdrawFormStep";
|
|
@@ -641,16 +641,16 @@ function WithdrawReviewStep({
|
|
|
641
641
|
const targetChainName = _chunkH577RJN5cjs.getChainName.call(void 0, targetChain);
|
|
642
642
|
const targetChainIcon = _chunkH577RJN5cjs.getChainIcon.call(void 0, targetChain);
|
|
643
643
|
const amountNumber = Number(amount);
|
|
644
|
-
const formattedSendAmount = _nullishCoalesce(
|
|
645
|
-
const prices =
|
|
644
|
+
const formattedSendAmount = _nullishCoalesce(_chunk6U2H3R3Tcjs.formatTokenAmount.call(void 0, amountNumber, sourceSymbol), () => ( amount));
|
|
645
|
+
const prices = _chunkEEEQZOTJcjs.useTokenPrices.call(void 0, service, [
|
|
646
646
|
{ chainId: sourceChain, address: sourceToken, symbol: sourceSymbol },
|
|
647
647
|
{ chainId: targetChain, address: targetToken, symbol: targetSymbol }
|
|
648
648
|
]);
|
|
649
|
-
const receiveDisplay = _nullishCoalesce(
|
|
649
|
+
const receiveDisplay = _nullishCoalesce(_chunk6U2H3R3Tcjs.formatReceiveEstimate.call(void 0, {
|
|
650
650
|
sourceAmount: Number.isFinite(amountNumber) ? amountNumber : void 0,
|
|
651
651
|
sourceSymbol,
|
|
652
652
|
targetSymbol,
|
|
653
|
-
sourceTrusted:
|
|
653
|
+
sourceTrusted: _chunk6U2H3R3Tcjs.isRecognizedToken.call(void 0, sourceToken, sourceChain),
|
|
654
654
|
prices
|
|
655
655
|
}), () => ( // No price for the target token — an honest dash beats a wrong number.
|
|
656
656
|
"\u2014"));
|
|
@@ -661,7 +661,7 @@ function WithdrawReviewStep({
|
|
|
661
661
|
await onConfirm();
|
|
662
662
|
} catch (err) {
|
|
663
663
|
const raw = err instanceof Error ? err.message : "Withdraw failed";
|
|
664
|
-
const message =
|
|
664
|
+
const message = _chunk6U2H3R3Tcjs.formatUserError.call(void 0, raw);
|
|
665
665
|
setError(message);
|
|
666
666
|
_optionalChain([onError, 'optionalCall', _7 => _7(message, "WITHDRAW_REVIEW_ERROR")]);
|
|
667
667
|
} finally {
|
|
@@ -672,9 +672,9 @@ function WithdrawReviewStep({
|
|
|
672
672
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
673
673
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
674
674
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
675
|
-
|
|
675
|
+
_chunk6U2H3R3Tcjs.BodyHeader,
|
|
676
676
|
{
|
|
677
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
677
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6U2H3R3Tcjs.CircleArrowOutUpLeftIcon, {}),
|
|
678
678
|
title: "Review withdrawal"
|
|
679
679
|
}
|
|
680
680
|
),
|
|
@@ -687,14 +687,14 @@ function WithdrawReviewStep({
|
|
|
687
687
|
" ",
|
|
688
688
|
sourceSymbol
|
|
689
689
|
] }),
|
|
690
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
690
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6U2H3R3Tcjs.TokenIcon, { symbol: sourceSymbol }) })
|
|
691
691
|
] })
|
|
692
692
|
] }),
|
|
693
693
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
694
694
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Source chain" }),
|
|
695
695
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
696
696
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: sourceChainName }),
|
|
697
|
-
sourceChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
697
|
+
sourceChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6U2H3R3Tcjs.CdnIcon, { src: sourceChainIcon }) })
|
|
698
698
|
] })
|
|
699
699
|
] }),
|
|
700
700
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
@@ -705,14 +705,14 @@ function WithdrawReviewStep({
|
|
|
705
705
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Receive" }),
|
|
706
706
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
707
707
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: receiveDisplay }),
|
|
708
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
708
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6U2H3R3Tcjs.TokenIcon, { symbol: targetSymbol }) })
|
|
709
709
|
] })
|
|
710
710
|
] }),
|
|
711
711
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
712
712
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Destination chain" }),
|
|
713
713
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
714
714
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: targetChainName }),
|
|
715
|
-
targetChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
715
|
+
targetChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6U2H3R3Tcjs.CdnIcon, { src: targetChainIcon }) })
|
|
716
716
|
] })
|
|
717
717
|
] }),
|
|
718
718
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
@@ -720,10 +720,10 @@ function WithdrawReviewStep({
|
|
|
720
720
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-value", children: estimatedTime })
|
|
721
721
|
] })
|
|
722
722
|
] }),
|
|
723
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
724
|
-
!error && registrationError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
723
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6U2H3R3Tcjs.Callout, { variant: "error", children: error }),
|
|
724
|
+
!error && registrationError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6U2H3R3Tcjs.Callout, { variant: "error", children: registrationError }),
|
|
725
725
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
726
|
-
|
|
726
|
+
_chunk6U2H3R3Tcjs.Button,
|
|
727
727
|
{
|
|
728
728
|
onClick: handleConfirm,
|
|
729
729
|
loading: isSubmitting,
|
|
@@ -734,7 +734,7 @@ function WithdrawReviewStep({
|
|
|
734
734
|
}
|
|
735
735
|
)
|
|
736
736
|
] }),
|
|
737
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
737
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6U2H3R3Tcjs.PoweredBy, {})
|
|
738
738
|
] });
|
|
739
739
|
}
|
|
740
740
|
WithdrawReviewStep.displayName = "WithdrawReviewStep";
|
|
@@ -767,11 +767,11 @@ function WithdrawFlow({
|
|
|
767
767
|
onError,
|
|
768
768
|
debug
|
|
769
769
|
}) {
|
|
770
|
-
const rpcUrls =
|
|
771
|
-
const onStepChangeRef =
|
|
772
|
-
const onEventRef =
|
|
773
|
-
const onLifecycleRef =
|
|
774
|
-
const onErrorRef =
|
|
770
|
+
const rpcUrls = _chunk6U2H3R3Tcjs.useRpcUrls.call(void 0, );
|
|
771
|
+
const onStepChangeRef = _chunk6U2H3R3Tcjs.useLatestRef.call(void 0, onStepChange);
|
|
772
|
+
const onEventRef = _chunk6U2H3R3Tcjs.useLatestRef.call(void 0, onEvent);
|
|
773
|
+
const onLifecycleRef = _chunk6U2H3R3Tcjs.useLatestRef.call(void 0, onLifecycle);
|
|
774
|
+
const onErrorRef = _chunk6U2H3R3Tcjs.useLatestRef.call(void 0, onError);
|
|
775
775
|
const isFlowActiveRef = _react.useRef.call(void 0, true);
|
|
776
776
|
const submitGenerationRef = _react.useRef.call(void 0, 0);
|
|
777
777
|
_react.useEffect.call(void 0, () => {
|
|
@@ -782,13 +782,13 @@ function WithdrawFlow({
|
|
|
782
782
|
}, []);
|
|
783
783
|
const logFlow = _react.useCallback.call(void 0,
|
|
784
784
|
(message, data) => {
|
|
785
|
-
|
|
785
|
+
_chunk6U2H3R3Tcjs.debugLog.call(void 0, debug, "withdraw-flow", message, data);
|
|
786
786
|
},
|
|
787
787
|
[debug]
|
|
788
788
|
);
|
|
789
789
|
const logFlowError = _react.useCallback.call(void 0,
|
|
790
790
|
(message, error, data) => {
|
|
791
|
-
|
|
791
|
+
_chunk6U2H3R3Tcjs.debugError.call(void 0, debug, "withdraw-flow", message, error, data);
|
|
792
792
|
},
|
|
793
793
|
[debug]
|
|
794
794
|
);
|
|
@@ -812,7 +812,7 @@ function WithdrawFlow({
|
|
|
812
812
|
const flowStep = useWithdrawStore((s) => s.step);
|
|
813
813
|
const reviewedRecipient = useWithdrawStore((s) => s.recipient);
|
|
814
814
|
const publicClient = _react.useMemo.call(void 0,
|
|
815
|
-
() =>
|
|
815
|
+
() => _chunkEEEQZOTJcjs.getPublicClient.call(void 0, sourceChain, rpcUrls),
|
|
816
816
|
[sourceChain, rpcUrls]
|
|
817
817
|
);
|
|
818
818
|
const recipientForRegistration = _react.useMemo.call(void 0, () => {
|
|
@@ -840,7 +840,7 @@ function WithdrawFlow({
|
|
|
840
840
|
targetToken,
|
|
841
841
|
recipient: recipientForRegistration
|
|
842
842
|
});
|
|
843
|
-
const salt =
|
|
843
|
+
const salt = _chunkEEEQZOTJcjs.deriveAccountSalt.call(void 0, {
|
|
844
844
|
recipient: recipientForRegistration,
|
|
845
845
|
targetChain,
|
|
846
846
|
targetToken
|
|
@@ -870,7 +870,7 @@ function WithdrawFlow({
|
|
|
870
870
|
} catch (err) {
|
|
871
871
|
if (cancelled) return;
|
|
872
872
|
const raw = err instanceof Error ? err.message : "Registration failed";
|
|
873
|
-
const message =
|
|
873
|
+
const message = _chunk6U2H3R3Tcjs.formatUserError.call(void 0, raw);
|
|
874
874
|
logFlowError("auto-register:failed", err, {
|
|
875
875
|
accountAddress,
|
|
876
876
|
targetChain,
|
|
@@ -904,7 +904,7 @@ function WithdrawFlow({
|
|
|
904
904
|
const symbol = _chunkH577RJN5cjs.getTokenSymbol.call(void 0, sourceToken, sourceChain);
|
|
905
905
|
const decimals = _chunkH577RJN5cjs.getTokenDecimalsByAddress.call(void 0, sourceToken, sourceChain);
|
|
906
906
|
return {
|
|
907
|
-
id:
|
|
907
|
+
id: _chunk6U2H3R3Tcjs.getAssetId.call(void 0, { chainId: sourceChain, token: sourceToken }),
|
|
908
908
|
chainId: sourceChain,
|
|
909
909
|
token: sourceToken,
|
|
910
910
|
symbol,
|
|
@@ -1084,7 +1084,7 @@ function WithdrawFlow({
|
|
|
1084
1084
|
targetChain,
|
|
1085
1085
|
targetToken
|
|
1086
1086
|
});
|
|
1087
|
-
handleError(
|
|
1087
|
+
handleError(_chunk6U2H3R3Tcjs.formatUserError.call(void 0, raw), "WITHDRAW_FLOW_ERROR");
|
|
1088
1088
|
throw err;
|
|
1089
1089
|
}
|
|
1090
1090
|
},
|
|
@@ -1214,7 +1214,7 @@ function WithdrawFlow({
|
|
|
1214
1214
|
}
|
|
1215
1215
|
),
|
|
1216
1216
|
stepView === "processing" && registration.kind !== "idle" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1217
|
-
|
|
1217
|
+
_chunkEEEQZOTJcjs.ProcessingStep,
|
|
1218
1218
|
{
|
|
1219
1219
|
smartAccount: _nullishCoalesce(storeApi.getState().processingSmartAccount, () => ( (registration.kind === "ready" || registration.kind === "stale" ? registration.smartAccount : "0x0"))),
|
|
1220
1220
|
txHash: _nullishCoalesce(storeApi.getState().txHash, () => ( "0x0")),
|
|
@@ -1284,22 +1284,22 @@ function WithdrawModal({
|
|
|
1284
1284
|
// one only ever applied to the deposit flow.
|
|
1285
1285
|
...removedProps
|
|
1286
1286
|
}) {
|
|
1287
|
-
|
|
1288
|
-
|
|
1287
|
+
_chunkEEEQZOTJcjs.warnRemovedProps.call(void 0, "WithdrawModal", removedProps);
|
|
1288
|
+
_chunk6U2H3R3Tcjs.checkBackendUrl.call(void 0, "WithdrawModal", backendUrl);
|
|
1289
1289
|
const modalRef = _react.useRef.call(void 0, null);
|
|
1290
|
-
const onReadyRef =
|
|
1290
|
+
const onReadyRef = _chunk6U2H3R3Tcjs.useLatestRef.call(void 0, onReady);
|
|
1291
1291
|
const [backHandler, setBackHandler] = _react.useState.call(void 0,
|
|
1292
1292
|
void 0
|
|
1293
1293
|
);
|
|
1294
1294
|
const targetChain = _chunkH577RJN5cjs.getChainId.call(void 0, _nullishCoalesce(targetChainProp, () => ( sourceChainProp)));
|
|
1295
1295
|
const sourceChain = _chunkH577RJN5cjs.getChainId.call(void 0, sourceChainProp);
|
|
1296
|
-
const rpcUrls =
|
|
1296
|
+
const rpcUrls = _chunk6U2H3R3Tcjs.useStableRpcUrls.call(void 0, rpcUrlsProp);
|
|
1297
1297
|
const service = _react.useMemo.call(void 0,
|
|
1298
|
-
() =>
|
|
1298
|
+
() => _chunk6U2H3R3Tcjs.createDepositService.call(void 0, backendUrl, { debug, debugScope: "service:withdraw" }),
|
|
1299
1299
|
[backendUrl, debug]
|
|
1300
1300
|
);
|
|
1301
1301
|
const store = _react.useMemo.call(void 0, () => createWithdrawStore(), []);
|
|
1302
|
-
const onErrorRef =
|
|
1302
|
+
const onErrorRef = _chunk6U2H3R3Tcjs.useLatestRef.call(void 0, onError);
|
|
1303
1303
|
_react.useEffect.call(void 0, () => {
|
|
1304
1304
|
if (isOpen && typeof onSendTransaction !== "function") {
|
|
1305
1305
|
_optionalChain([onErrorRef, 'access', _33 => _33.current, 'optionalCall', _34 => _34({
|
|
@@ -1310,7 +1310,7 @@ function WithdrawModal({
|
|
|
1310
1310
|
}, [isOpen, onSendTransaction, onErrorRef]);
|
|
1311
1311
|
_react.useEffect.call(void 0, () => {
|
|
1312
1312
|
if (isOpen && modalRef.current) {
|
|
1313
|
-
|
|
1313
|
+
_chunk6U2H3R3Tcjs.applyTheme.call(void 0, modalRef.current, theme);
|
|
1314
1314
|
}
|
|
1315
1315
|
}, [isOpen, theme]);
|
|
1316
1316
|
_react.useEffect.call(void 0, () => {
|
|
@@ -1328,8 +1328,8 @@ function WithdrawModal({
|
|
|
1328
1328
|
}, []);
|
|
1329
1329
|
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _37 => _37.showBackButton]), () => ( true));
|
|
1330
1330
|
const canGoBack = backHandler !== void 0;
|
|
1331
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1332
|
-
|
|
1331
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6U2H3R3Tcjs.RpcUrlsProvider, { value: rpcUrls, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, WithdrawStoreProvider, { store, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1332
|
+
_chunk6U2H3R3Tcjs.Modal,
|
|
1333
1333
|
{
|
|
1334
1334
|
isOpen,
|
|
1335
1335
|
onClose,
|
|
@@ -1345,7 +1345,7 @@ function WithdrawModal({
|
|
|
1345
1345
|
className: "rs-modal-header-back",
|
|
1346
1346
|
"aria-label": "Go back",
|
|
1347
1347
|
onClick: backHandler,
|
|
1348
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1348
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6U2H3R3Tcjs.ChevronLeftIcon, {})
|
|
1349
1349
|
}
|
|
1350
1350
|
) }),
|
|
1351
1351
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-header-nav-right", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -1355,7 +1355,7 @@ function WithdrawModal({
|
|
|
1355
1355
|
onClick: onClose,
|
|
1356
1356
|
className: "rs-modal-close",
|
|
1357
1357
|
"aria-label": "Close",
|
|
1358
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1358
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6U2H3R3Tcjs.CloseIcon, {})
|
|
1359
1359
|
}
|
|
1360
1360
|
) })
|
|
1361
1361
|
] }),
|
|
@@ -18,10 +18,10 @@ import {
|
|
|
18
18
|
runAccountSetupDeduped,
|
|
19
19
|
txRefsMatch,
|
|
20
20
|
warnRemovedProps
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-GYEUZSQP.mjs";
|
|
22
22
|
import {
|
|
23
23
|
ListRow
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-AYWEWI47.mjs";
|
|
25
25
|
import {
|
|
26
26
|
AlertTriangleIcon,
|
|
27
27
|
AppleIcon,
|
|
@@ -77,7 +77,7 @@ import {
|
|
|
77
77
|
useLatestRef,
|
|
78
78
|
useRpcUrls,
|
|
79
79
|
useStableRpcUrls
|
|
80
|
-
} from "./chunk-
|
|
80
|
+
} from "./chunk-WUQZYQRK.mjs";
|
|
81
81
|
import {
|
|
82
82
|
POLYMARKET_COLLATERAL_OFFRAMP_ADDRESS,
|
|
83
83
|
POLYMARKET_ICON_URL,
|
|
@@ -474,8 +474,7 @@ function ConnectStep({
|
|
|
474
474
|
title = "Deposit",
|
|
475
475
|
subtitle,
|
|
476
476
|
defaultMethodTab = "crypto",
|
|
477
|
-
onMethodTabChange
|
|
478
|
-
onInteract
|
|
477
|
+
onMethodTabChange
|
|
479
478
|
}) {
|
|
480
479
|
const rows = walletRows ?? [];
|
|
481
480
|
const handleConnect = onConnect ?? onRequestConnect;
|
|
@@ -617,58 +616,49 @@ function ConnectStep({
|
|
|
617
616
|
}
|
|
618
617
|
onPrefetchFiatMethod(recommendedMethod);
|
|
619
618
|
}, [activeTab, onPrefetchFiatMethod, recommendedMethod]);
|
|
620
|
-
return /* @__PURE__ */ jsxs4(
|
|
621
|
-
"div",
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
BodyHeader,
|
|
631
|
-
{
|
|
632
|
-
icon: /* @__PURE__ */ jsx5(HandCoinsIcon, {}),
|
|
633
|
-
title,
|
|
634
|
-
subtitle: subtitle ?? defaultSubtitle,
|
|
635
|
-
aside: showToggle ? /* @__PURE__ */ jsx5(
|
|
636
|
-
SegmentedToggle,
|
|
637
|
-
{
|
|
638
|
-
ariaLabel: "Deposit method type",
|
|
639
|
-
value: activeTab,
|
|
640
|
-
onChange: handleTabChange,
|
|
641
|
-
options: [
|
|
642
|
-
{ value: "crypto", label: "Crypto" },
|
|
643
|
-
{ value: "cash", label: "Cash" }
|
|
644
|
-
]
|
|
645
|
-
}
|
|
646
|
-
) : void 0
|
|
647
|
-
}
|
|
648
|
-
),
|
|
649
|
-
/* @__PURE__ */ jsx5(
|
|
650
|
-
"div",
|
|
619
|
+
return /* @__PURE__ */ jsxs4("div", { className: "rs-screen", children: [
|
|
620
|
+
/* @__PURE__ */ jsxs4("div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
621
|
+
/* @__PURE__ */ jsx5(
|
|
622
|
+
BodyHeader,
|
|
623
|
+
{
|
|
624
|
+
icon: /* @__PURE__ */ jsx5(HandCoinsIcon, {}),
|
|
625
|
+
title,
|
|
626
|
+
subtitle: subtitle ?? defaultSubtitle,
|
|
627
|
+
aside: showToggle ? /* @__PURE__ */ jsx5(
|
|
628
|
+
SegmentedToggle,
|
|
651
629
|
{
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
630
|
+
ariaLabel: "Deposit method type",
|
|
631
|
+
value: activeTab,
|
|
632
|
+
onChange: handleTabChange,
|
|
633
|
+
options: [
|
|
634
|
+
{ value: "crypto", label: "Crypto" },
|
|
635
|
+
{ value: "cash", label: "Cash" }
|
|
636
|
+
]
|
|
656
637
|
}
|
|
657
|
-
)
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
638
|
+
) : void 0
|
|
639
|
+
}
|
|
640
|
+
),
|
|
641
|
+
/* @__PURE__ */ jsx5(
|
|
642
|
+
"div",
|
|
643
|
+
{
|
|
644
|
+
className: "rs-list",
|
|
645
|
+
"aria-live": activeTab === "cash" ? "polite" : void 0,
|
|
646
|
+
"aria-busy": activeTab === "cash" && fiatLoading ? true : void 0,
|
|
647
|
+
children: activeRows
|
|
648
|
+
}
|
|
649
|
+
)
|
|
650
|
+
] }),
|
|
651
|
+
onDisconnect && hasReownWallet && /* @__PURE__ */ jsx5("div", { className: "rs-screen-tight-row", children: /* @__PURE__ */ jsx5(
|
|
652
|
+
"button",
|
|
653
|
+
{
|
|
654
|
+
type: "button",
|
|
655
|
+
className: "rs-connect-wallet-manage",
|
|
656
|
+
onClick: onDisconnect,
|
|
657
|
+
children: "Disconnect wallet"
|
|
658
|
+
}
|
|
659
|
+
) }),
|
|
660
|
+
/* @__PURE__ */ jsx5(PoweredBy, {})
|
|
661
|
+
] });
|
|
672
662
|
}
|
|
673
663
|
ConnectStep.displayName = "ConnectStep";
|
|
674
664
|
|
|
@@ -4603,7 +4593,7 @@ function DappImportAssetSelectSkeleton({
|
|
|
4603
4593
|
DappImportAssetSelectSkeleton.displayName = "DappImportAssetSelectSkeleton";
|
|
4604
4594
|
|
|
4605
4595
|
// src/core/fiat-methods.ts
|
|
4606
|
-
var
|
|
4596
|
+
var REGIONAL_METHODS_TIMEOUT_MS = 3e3;
|
|
4607
4597
|
var BUILT_IN_ICON_METHODS = /* @__PURE__ */ new Set([
|
|
4608
4598
|
"creditcard",
|
|
4609
4599
|
"bank-transfer",
|
|
@@ -7106,9 +7096,6 @@ function DepositFlow({
|
|
|
7106
7096
|
acknowledgedConnectFeeRef.current.clear();
|
|
7107
7097
|
}, [setupSlice.smartAccount]);
|
|
7108
7098
|
const hasConfiguredFiatMethods = fiatMethods !== void 0;
|
|
7109
|
-
const regionalMethodsInteractedRef = useRef8(false);
|
|
7110
|
-
const regionalMethodsAppliedRef = useRef8(false);
|
|
7111
|
-
const [regionalMethodsLocked, setRegionalMethodsLocked] = useState12(false);
|
|
7112
7099
|
const [regionalMethods, setRegionalMethods] = useState12({
|
|
7113
7100
|
status: "loading",
|
|
7114
7101
|
country: null,
|
|
@@ -7118,17 +7105,16 @@ function DepositFlow({
|
|
|
7118
7105
|
useEffect11(() => {
|
|
7119
7106
|
if (!fiatEnabled || hasConfiguredFiatMethods) return;
|
|
7120
7107
|
let cancelled = false;
|
|
7121
|
-
regionalMethodsInteractedRef.current = false;
|
|
7122
|
-
regionalMethodsAppliedRef.current = false;
|
|
7123
|
-
setRegionalMethodsLocked(false);
|
|
7124
7108
|
setRegionalMethods({
|
|
7125
7109
|
status: "loading",
|
|
7126
7110
|
country: null,
|
|
7127
7111
|
methods: [],
|
|
7128
7112
|
recommendedMethod: null
|
|
7129
7113
|
});
|
|
7114
|
+
let settled = false;
|
|
7130
7115
|
const showFallback = () => {
|
|
7131
|
-
if (cancelled) return;
|
|
7116
|
+
if (cancelled || settled) return;
|
|
7117
|
+
settled = true;
|
|
7132
7118
|
setRegionalMethods({
|
|
7133
7119
|
status: "error",
|
|
7134
7120
|
country: null,
|
|
@@ -7136,33 +7122,22 @@ function DepositFlow({
|
|
|
7136
7122
|
recommendedMethod: null
|
|
7137
7123
|
});
|
|
7138
7124
|
};
|
|
7139
|
-
const
|
|
7140
|
-
showFallback,
|
|
7141
|
-
REGIONAL_METHODS_FALLBACK_DELAY_MS
|
|
7142
|
-
);
|
|
7125
|
+
const timeoutTimer = setTimeout(showFallback, REGIONAL_METHODS_TIMEOUT_MS);
|
|
7143
7126
|
service.getSwappedPaymentMethods().then((res) => {
|
|
7144
|
-
if (cancelled) return;
|
|
7145
|
-
|
|
7146
|
-
|
|
7147
|
-
showFallback();
|
|
7148
|
-
return;
|
|
7149
|
-
}
|
|
7127
|
+
if (cancelled || settled) return;
|
|
7128
|
+
settled = true;
|
|
7129
|
+
clearTimeout(timeoutTimer);
|
|
7150
7130
|
setRegionalMethods({ status: "ready", ...res });
|
|
7151
7131
|
}).catch(() => {
|
|
7152
7132
|
if (cancelled) return;
|
|
7153
|
-
clearTimeout(
|
|
7133
|
+
clearTimeout(timeoutTimer);
|
|
7154
7134
|
showFallback();
|
|
7155
7135
|
});
|
|
7156
7136
|
return () => {
|
|
7157
7137
|
cancelled = true;
|
|
7158
|
-
clearTimeout(
|
|
7138
|
+
clearTimeout(timeoutTimer);
|
|
7159
7139
|
};
|
|
7160
7140
|
}, [fiatEnabled, hasConfiguredFiatMethods, service]);
|
|
7161
|
-
useLayoutEffect2(() => {
|
|
7162
|
-
if (regionalMethods.status === "ready" && !regionalMethodsLocked) {
|
|
7163
|
-
regionalMethodsAppliedRef.current = true;
|
|
7164
|
-
}
|
|
7165
|
-
}, [regionalMethods.status, regionalMethodsLocked]);
|
|
7166
7141
|
const cashDisplay = useMemo7(() => {
|
|
7167
7142
|
if (!fiatEnabled) return { kind: "hidden" };
|
|
7168
7143
|
if (hasConfiguredFiatMethods) {
|
|
@@ -7174,22 +7149,12 @@ function DepositFlow({
|
|
|
7174
7149
|
source: "configured"
|
|
7175
7150
|
};
|
|
7176
7151
|
}
|
|
7177
|
-
|
|
7178
|
-
status: "error",
|
|
7179
|
-
country: null,
|
|
7180
|
-
methods: [],
|
|
7181
|
-
recommendedMethod: null
|
|
7182
|
-
} : regionalMethods;
|
|
7183
|
-
return composeFiatMethods(
|
|
7184
|
-
effectiveRegionalMethods,
|
|
7185
|
-
FIAT_ONRAMP_METHODS
|
|
7186
|
-
);
|
|
7152
|
+
return composeFiatMethods(regionalMethods, FIAT_ONRAMP_METHODS);
|
|
7187
7153
|
}, [
|
|
7188
7154
|
fiatEnabled,
|
|
7189
7155
|
hasConfiguredFiatMethods,
|
|
7190
7156
|
offeredFiatMethods,
|
|
7191
|
-
regionalMethods
|
|
7192
|
-
regionalMethodsLocked
|
|
7157
|
+
regionalMethods
|
|
7193
7158
|
]);
|
|
7194
7159
|
const lastFiatMethodsRenderedEventRef = useRef8(null);
|
|
7195
7160
|
useEffect11(() => {
|
|
@@ -7211,11 +7176,6 @@ function DepositFlow({
|
|
|
7211
7176
|
source: cashDisplay.source
|
|
7212
7177
|
});
|
|
7213
7178
|
}, [cashDisplay, onEvent, onEventRef]);
|
|
7214
|
-
const markRegionalMethodsInteracted = useCallback7(() => {
|
|
7215
|
-
if (regionalMethodsAppliedRef.current) return;
|
|
7216
|
-
regionalMethodsInteractedRef.current = true;
|
|
7217
|
-
setRegionalMethodsLocked(true);
|
|
7218
|
-
}, []);
|
|
7219
7179
|
const displayedFiatSource = cashDisplay.kind === "list" ? cashDisplay.source : void 0;
|
|
7220
7180
|
const displayedFiatCountry = cashDisplay.kind === "list" ? cashDisplay.country : null;
|
|
7221
7181
|
const handleSelectDisplayedFiatMethod = useCallback7(
|
|
@@ -7695,7 +7655,6 @@ function DepositFlow({
|
|
|
7695
7655
|
walletRows,
|
|
7696
7656
|
defaultMethodTab: flowSlice.methodTab,
|
|
7697
7657
|
onMethodTabChange: (tab) => storeApi.dispatch({ type: "connect/method-tab-changed", tab }),
|
|
7698
|
-
onInteract: fiatEnabled && !hasConfiguredFiatMethods ? markRegionalMethodsInteracted : void 0,
|
|
7699
7658
|
transferCryptoState,
|
|
7700
7659
|
transferCryptoErrorReason: transferCryptoEntry.message ?? void 0,
|
|
7701
7660
|
onSelectTransferCrypto: (
|
|
@@ -8533,7 +8492,7 @@ DepositHistoryPanel.displayName = "DepositHistoryPanel";
|
|
|
8533
8492
|
// src/DepositModal.tsx
|
|
8534
8493
|
import { jsx as jsx27, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
8535
8494
|
var ReownDepositInner = lazy2(
|
|
8536
|
-
() => import("./DepositModalReown-
|
|
8495
|
+
() => import("./DepositModalReown-JUJI7UHE.mjs").then((m) => ({ default: m.DepositModalReown }))
|
|
8537
8496
|
);
|
|
8538
8497
|
function sortByCreatedAtDesc(items) {
|
|
8539
8498
|
return [...items].sort((a, b) => {
|