@rhinestone/deposit-modal 0.9.1 → 0.11.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-JUJI7UHE.mjs → DepositModalReown-6RVLEM3B.mjs} +96 -26
- package/dist/{DepositModalReown-YQSO4SVY.cjs → DepositModalReown-TXTLVZIQ.cjs} +97 -27
- package/dist/caip-D8aRWdEY.d.cts +40 -0
- package/dist/caip-D8aRWdEY.d.ts +40 -0
- package/dist/{chunk-A223BLVC.mjs → chunk-53IFZGSF.mjs} +177 -21
- package/dist/{chunk-VQJHYWAE.cjs → chunk-7RNEYPI4.cjs} +836 -579
- package/dist/{chunk-ITFRTPGF.cjs → chunk-BLJMYCBF.cjs} +92 -90
- package/dist/{chunk-AYWEWI47.mjs → chunk-DYTRG4C7.mjs} +1 -1
- package/dist/{chunk-QGXAAFHU.mjs → chunk-G4FVZQOM.mjs} +23 -21
- package/dist/{chunk-SQOEHQNT.cjs → chunk-GWA6GFTI.cjs} +66 -63
- package/dist/{chunk-EEEQZOTJ.cjs → chunk-HCQWFL3A.cjs} +84 -101
- package/dist/{chunk-WUQZYQRK.mjs → chunk-ITAYM7SB.mjs} +784 -167
- package/dist/{chunk-YEBXUUH3.cjs → chunk-JPRV36DT.cjs} +2 -2
- package/dist/{chunk-EAUF7SGM.cjs → chunk-JYKMR6QI.cjs} +3 -3
- package/dist/{chunk-ILT2PITN.mjs → chunk-MZ53PDIX.mjs} +1 -1
- package/dist/{chunk-6U2H3R3T.cjs → chunk-NPSC5R22.cjs} +862 -245
- package/dist/{chunk-QLZ5RZTA.mjs → chunk-QRR3Y7EK.mjs} +1 -1
- package/dist/{chunk-H577RJN5.cjs → chunk-TENL4H64.cjs} +186 -30
- package/dist/{chunk-N3OHR3T2.mjs → chunk-TRD2FCAR.mjs} +363 -106
- package/dist/{chunk-7OQO6JDC.mjs → chunk-VRNRRN2U.mjs} +12 -9
- package/dist/{chunk-GYEUZSQP.mjs → chunk-WLDTBKRA.mjs} +14 -31
- package/dist/{chunk-XJE5MRY4.cjs → chunk-XVKBCDZI.cjs} +1 -1
- package/dist/claim.cjs +6 -6
- package/dist/claim.d.cts +3 -2
- package/dist/claim.d.ts +3 -2
- package/dist/claim.mjs +5 -5
- package/dist/{caip-523Zrc3r.d.cts → constants-FuzG3h4m.d.cts} +1 -18
- package/dist/{caip-523Zrc3r.d.ts → constants-FuzG3h4m.d.ts} +1 -18
- package/dist/constants.cjs +5 -3
- package/dist/constants.d.cts +3 -2
- package/dist/constants.d.ts +3 -2
- package/dist/constants.mjs +4 -2
- package/dist/deposit.cjs +8 -8
- package/dist/deposit.d.cts +3 -2
- package/dist/deposit.d.ts +3 -2
- package/dist/deposit.mjs +7 -7
- package/dist/index.cjs +12 -10
- package/dist/index.d.cts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.mjs +11 -9
- package/dist/polymarket.cjs +5 -5
- package/dist/polymarket.mjs +2 -2
- package/dist/styles.css +14 -0
- package/dist/{types-C0SGf-21.d.cts → types-C7wag_iL.d.cts} +4 -3
- package/dist/{types-C0SGf-21.d.ts → types-D4b6Cjox.d.ts} +4 -3
- package/dist/withdraw.cjs +6 -6
- package/dist/withdraw.d.cts +3 -2
- package/dist/withdraw.d.ts +3 -2
- package/dist/withdraw.mjs +5 -5
- package/package.json +1 -1
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
+
var _chunkHCQWFL3Acjs = require('./chunk-HCQWFL3A.cjs');
|
|
6
7
|
|
|
7
|
-
var _chunkEEEQZOTJcjs = require('./chunk-EEEQZOTJ.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
@@ -34,10 +34,10 @@ var _chunkEEEQZOTJcjs = require('./chunk-EEEQZOTJ.cjs');
|
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
|
|
37
|
-
var _chunk6U2H3R3Tcjs = require('./chunk-6U2H3R3T.cjs');
|
|
38
37
|
|
|
39
38
|
|
|
40
39
|
|
|
40
|
+
var _chunkNPSC5R22cjs = require('./chunk-NPSC5R22.cjs');
|
|
41
41
|
|
|
42
42
|
|
|
43
43
|
|
|
@@ -45,7 +45,8 @@ var _chunk6U2H3R3Tcjs = require('./chunk-6U2H3R3T.cjs');
|
|
|
45
45
|
|
|
46
46
|
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
|
|
49
|
+
var _chunkTENL4H64cjs = require('./chunk-TENL4H64.cjs');
|
|
49
50
|
|
|
50
51
|
// src/WithdrawModal.tsx
|
|
51
52
|
var _react = require('react');
|
|
@@ -232,8 +233,8 @@ function WithdrawFormStep({
|
|
|
232
233
|
const publicClientChainId = _optionalChain([publicClient, 'access', _ => _.chain, 'optionalAccess', _2 => _2.id]);
|
|
233
234
|
useClickOutside(chainDropdownRef, () => setShowChainDropdown(false));
|
|
234
235
|
useClickOutside(tokenDropdownRef, () => setShowTokenDropdown(false));
|
|
235
|
-
const targetSymbol =
|
|
236
|
-
const targetChainName =
|
|
236
|
+
const targetSymbol = _chunkTENL4H64cjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
237
|
+
const targetChainName = _chunkTENL4H64cjs.getChainName.call(void 0, targetChain);
|
|
237
238
|
const isBusy = submitting || isSubmitting;
|
|
238
239
|
const seededRecipientRef = _react.useRef.call(void 0, _nullishCoalesce(defaultRecipient, () => ( "")));
|
|
239
240
|
_react.useEffect.call(void 0, () => {
|
|
@@ -257,7 +258,7 @@ function WithdrawFormStep({
|
|
|
257
258
|
return;
|
|
258
259
|
}
|
|
259
260
|
try {
|
|
260
|
-
const bal =
|
|
261
|
+
const bal = _chunkNPSC5R22cjs.isNativeAsset.call(void 0, asset) ? await publicClient.getBalance({ address: accountAddress }) : await publicClient.readContract({
|
|
261
262
|
address: asset.token,
|
|
262
263
|
abi: _viem.erc20Abi,
|
|
263
264
|
functionName: "balanceOf",
|
|
@@ -362,7 +363,7 @@ function WithdrawFormStep({
|
|
|
362
363
|
await onSubmit(recipient, amount);
|
|
363
364
|
} catch (err) {
|
|
364
365
|
const raw = err instanceof Error ? err.message : "Withdrawal failed";
|
|
365
|
-
setError(
|
|
366
|
+
setError(_chunkNPSC5R22cjs.formatUserError.call(void 0, raw));
|
|
366
367
|
} finally {
|
|
367
368
|
setIsSubmitting(false);
|
|
368
369
|
}
|
|
@@ -378,16 +379,16 @@ function WithdrawFormStep({
|
|
|
378
379
|
if (isBalanceLoading) {
|
|
379
380
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
380
381
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-withdraw-loading", children: [
|
|
381
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
382
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.Spinner, { className: "rs-spinner--lg" }),
|
|
382
383
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-withdraw-loading-title", children: "Loading on-chain balance" }),
|
|
383
384
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-withdraw-loading-subtitle", children: "Please wait before withdrawing." })
|
|
384
385
|
] }),
|
|
385
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
386
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.PoweredBy, {})
|
|
386
387
|
] });
|
|
387
388
|
}
|
|
388
389
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
389
390
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
390
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
391
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.CircleArrowOutUpLeftIcon, {}), title: "Withdraw" }),
|
|
391
392
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-section", children: [
|
|
392
393
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
393
394
|
"label",
|
|
@@ -447,7 +448,7 @@ function WithdrawFormStep({
|
|
|
447
448
|
) })
|
|
448
449
|
] }),
|
|
449
450
|
/* @__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 ? `~${
|
|
451
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-withdraw-usd", children: amountUsd !== null ? `~${_chunkNPSC5R22cjs.currencyFormatter.format(amountUsd)}` : "$0.00" }),
|
|
451
452
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-withdraw-balance", children: [
|
|
452
453
|
"Balance: ",
|
|
453
454
|
formattedBalance,
|
|
@@ -478,9 +479,9 @@ function WithdrawFormStep({
|
|
|
478
479
|
children: [
|
|
479
480
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-dropdown-value", children: [
|
|
480
481
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
481
|
-
|
|
482
|
+
_chunkNPSC5R22cjs.CdnIcon,
|
|
482
483
|
{
|
|
483
|
-
src:
|
|
484
|
+
src: _chunkTENL4H64cjs.getChainIcon.call(void 0, targetChain),
|
|
484
485
|
alt: targetChainName,
|
|
485
486
|
className: "rs-withdraw-dropdown-icon"
|
|
486
487
|
}
|
|
@@ -488,7 +489,7 @@ function WithdrawFormStep({
|
|
|
488
489
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: targetChainName })
|
|
489
490
|
] }),
|
|
490
491
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
491
|
-
|
|
492
|
+
_chunkNPSC5R22cjs.ChevronDownIcon,
|
|
492
493
|
{
|
|
493
494
|
className: "rs-withdraw-dropdown-arrow",
|
|
494
495
|
style: {
|
|
@@ -510,9 +511,9 @@ function WithdrawFormStep({
|
|
|
510
511
|
},
|
|
511
512
|
children: [
|
|
512
513
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
513
|
-
|
|
514
|
+
_chunkNPSC5R22cjs.CdnIcon,
|
|
514
515
|
{
|
|
515
|
-
src:
|
|
516
|
+
src: _chunkTENL4H64cjs.getChainIcon.call(void 0, chain.id),
|
|
516
517
|
alt: chain.name,
|
|
517
518
|
className: "rs-withdraw-dropdown-icon"
|
|
518
519
|
}
|
|
@@ -547,7 +548,7 @@ function WithdrawFormStep({
|
|
|
547
548
|
children: [
|
|
548
549
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-dropdown-value", children: [
|
|
549
550
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
550
|
-
|
|
551
|
+
_chunkNPSC5R22cjs.TokenIcon,
|
|
551
552
|
{
|
|
552
553
|
symbol: targetSymbol,
|
|
553
554
|
className: "rs-withdraw-dropdown-icon"
|
|
@@ -556,7 +557,7 @@ function WithdrawFormStep({
|
|
|
556
557
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: targetSymbol })
|
|
557
558
|
] }),
|
|
558
559
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
559
|
-
|
|
560
|
+
_chunkNPSC5R22cjs.ChevronDownIcon,
|
|
560
561
|
{
|
|
561
562
|
className: "rs-withdraw-dropdown-arrow",
|
|
562
563
|
style: {
|
|
@@ -578,7 +579,7 @@ function WithdrawFormStep({
|
|
|
578
579
|
},
|
|
579
580
|
children: [
|
|
580
581
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
581
|
-
|
|
582
|
+
_chunkNPSC5R22cjs.TokenIcon,
|
|
582
583
|
{
|
|
583
584
|
symbol: option.symbol,
|
|
584
585
|
className: "rs-withdraw-dropdown-icon"
|
|
@@ -594,20 +595,25 @@ function WithdrawFormStep({
|
|
|
594
595
|
)
|
|
595
596
|
] })
|
|
596
597
|
] }),
|
|
597
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
598
|
-
!error && registrationError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
598
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.Callout, { variant: "error", children: error }),
|
|
599
|
+
!error && registrationError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.Callout, { variant: "error", children: registrationError }),
|
|
599
600
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
600
|
-
|
|
601
|
+
_chunkNPSC5R22cjs.Button,
|
|
601
602
|
{
|
|
602
603
|
onClick: handleWithdraw,
|
|
603
604
|
fullWidth: true,
|
|
604
605
|
loading: isBusy,
|
|
605
|
-
disabled: !recipient || !amount || isBusy || Boolean(registrationError)
|
|
606
|
-
|
|
606
|
+
disabled: !recipient || !amount || isBusy || Boolean(registrationError) || // No token list for the selected chain yet. A destination published
|
|
607
|
+
// at runtime becomes selectable as soon as `/chains` resolves, which
|
|
608
|
+
// can precede its addresses; submitting in that window would send
|
|
609
|
+
// the previously selected chain's token address to a chain it does
|
|
610
|
+
// not exist on.
|
|
611
|
+
targetTokenOptions.length === 0,
|
|
612
|
+
children: isBusy ? "Preparing..." : registrationPending ? "Preparing session..." : targetTokenOptions.length === 0 ? "Loading tokens..." : !recipient ? "Enter Recipient Address" : !amount ? "Enter Withdraw Amount" : "Withdraw"
|
|
607
613
|
}
|
|
608
614
|
)
|
|
609
615
|
] }),
|
|
610
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
616
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.PoweredBy, {})
|
|
611
617
|
] });
|
|
612
618
|
}
|
|
613
619
|
WithdrawFormStep.displayName = "WithdrawFormStep";
|
|
@@ -635,22 +641,22 @@ function WithdrawReviewStep({
|
|
|
635
641
|
}) {
|
|
636
642
|
const [isSubmitting, setIsSubmitting] = _react.useState.call(void 0, false);
|
|
637
643
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
638
|
-
const sourceChainName =
|
|
639
|
-
const sourceChainIcon =
|
|
640
|
-
const targetSymbol =
|
|
641
|
-
const targetChainName =
|
|
642
|
-
const targetChainIcon =
|
|
644
|
+
const sourceChainName = _chunkTENL4H64cjs.getChainName.call(void 0, sourceChain);
|
|
645
|
+
const sourceChainIcon = _chunkTENL4H64cjs.getChainIcon.call(void 0, sourceChain);
|
|
646
|
+
const targetSymbol = _chunkTENL4H64cjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
647
|
+
const targetChainName = _chunkTENL4H64cjs.getChainName.call(void 0, targetChain);
|
|
648
|
+
const targetChainIcon = _chunkTENL4H64cjs.getChainIcon.call(void 0, targetChain);
|
|
643
649
|
const amountNumber = Number(amount);
|
|
644
|
-
const formattedSendAmount = _nullishCoalesce(
|
|
645
|
-
const prices =
|
|
650
|
+
const formattedSendAmount = _nullishCoalesce(_chunkNPSC5R22cjs.formatTokenAmount.call(void 0, amountNumber, sourceSymbol), () => ( amount));
|
|
651
|
+
const prices = _chunkHCQWFL3Acjs.useTokenPrices.call(void 0, service, [
|
|
646
652
|
{ chainId: sourceChain, address: sourceToken, symbol: sourceSymbol },
|
|
647
653
|
{ chainId: targetChain, address: targetToken, symbol: targetSymbol }
|
|
648
654
|
]);
|
|
649
|
-
const receiveDisplay = _nullishCoalesce(
|
|
655
|
+
const receiveDisplay = _nullishCoalesce(_chunkNPSC5R22cjs.formatReceiveEstimate.call(void 0, {
|
|
650
656
|
sourceAmount: Number.isFinite(amountNumber) ? amountNumber : void 0,
|
|
651
657
|
sourceSymbol,
|
|
652
658
|
targetSymbol,
|
|
653
|
-
sourceTrusted:
|
|
659
|
+
sourceTrusted: _chunkNPSC5R22cjs.isRecognizedToken.call(void 0, sourceToken, sourceChain),
|
|
654
660
|
prices
|
|
655
661
|
}), () => ( // No price for the target token — an honest dash beats a wrong number.
|
|
656
662
|
"\u2014"));
|
|
@@ -661,7 +667,7 @@ function WithdrawReviewStep({
|
|
|
661
667
|
await onConfirm();
|
|
662
668
|
} catch (err) {
|
|
663
669
|
const raw = err instanceof Error ? err.message : "Withdraw failed";
|
|
664
|
-
const message =
|
|
670
|
+
const message = _chunkNPSC5R22cjs.formatUserError.call(void 0, raw);
|
|
665
671
|
setError(message);
|
|
666
672
|
_optionalChain([onError, 'optionalCall', _7 => _7(message, "WITHDRAW_REVIEW_ERROR")]);
|
|
667
673
|
} finally {
|
|
@@ -672,9 +678,9 @@ function WithdrawReviewStep({
|
|
|
672
678
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
673
679
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
674
680
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
675
|
-
|
|
681
|
+
_chunkNPSC5R22cjs.BodyHeader,
|
|
676
682
|
{
|
|
677
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
683
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.CircleArrowOutUpLeftIcon, {}),
|
|
678
684
|
title: "Review withdrawal"
|
|
679
685
|
}
|
|
680
686
|
),
|
|
@@ -687,14 +693,14 @@ function WithdrawReviewStep({
|
|
|
687
693
|
" ",
|
|
688
694
|
sourceSymbol
|
|
689
695
|
] }),
|
|
690
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
696
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.TokenIcon, { symbol: sourceSymbol }) })
|
|
691
697
|
] })
|
|
692
698
|
] }),
|
|
693
699
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
694
700
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Source chain" }),
|
|
695
701
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
696
702
|
/* @__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,
|
|
703
|
+
sourceChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.CdnIcon, { src: sourceChainIcon }) })
|
|
698
704
|
] })
|
|
699
705
|
] }),
|
|
700
706
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
@@ -705,14 +711,14 @@ function WithdrawReviewStep({
|
|
|
705
711
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Receive" }),
|
|
706
712
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
707
713
|
/* @__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,
|
|
714
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.TokenIcon, { symbol: targetSymbol }) })
|
|
709
715
|
] })
|
|
710
716
|
] }),
|
|
711
717
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
712
718
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Destination chain" }),
|
|
713
719
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
714
720
|
/* @__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,
|
|
721
|
+
targetChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.CdnIcon, { src: targetChainIcon }) })
|
|
716
722
|
] })
|
|
717
723
|
] }),
|
|
718
724
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
@@ -720,10 +726,10 @@ function WithdrawReviewStep({
|
|
|
720
726
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-value", children: estimatedTime })
|
|
721
727
|
] })
|
|
722
728
|
] }),
|
|
723
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
724
|
-
!error && registrationError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
729
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.Callout, { variant: "error", children: error }),
|
|
730
|
+
!error && registrationError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.Callout, { variant: "error", children: registrationError }),
|
|
725
731
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
726
|
-
|
|
732
|
+
_chunkNPSC5R22cjs.Button,
|
|
727
733
|
{
|
|
728
734
|
onClick: handleConfirm,
|
|
729
735
|
loading: isSubmitting,
|
|
@@ -734,7 +740,7 @@ function WithdrawReviewStep({
|
|
|
734
740
|
}
|
|
735
741
|
)
|
|
736
742
|
] }),
|
|
737
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
743
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.PoweredBy, {})
|
|
738
744
|
] });
|
|
739
745
|
}
|
|
740
746
|
WithdrawReviewStep.displayName = "WithdrawReviewStep";
|
|
@@ -767,11 +773,11 @@ function WithdrawFlow({
|
|
|
767
773
|
onError,
|
|
768
774
|
debug
|
|
769
775
|
}) {
|
|
770
|
-
const rpcUrls =
|
|
771
|
-
const onStepChangeRef =
|
|
772
|
-
const onEventRef =
|
|
773
|
-
const onLifecycleRef =
|
|
774
|
-
const onErrorRef =
|
|
776
|
+
const rpcUrls = _chunkNPSC5R22cjs.useRpcUrls.call(void 0, );
|
|
777
|
+
const onStepChangeRef = _chunkNPSC5R22cjs.useLatestRef.call(void 0, onStepChange);
|
|
778
|
+
const onEventRef = _chunkNPSC5R22cjs.useLatestRef.call(void 0, onEvent);
|
|
779
|
+
const onLifecycleRef = _chunkNPSC5R22cjs.useLatestRef.call(void 0, onLifecycle);
|
|
780
|
+
const onErrorRef = _chunkNPSC5R22cjs.useLatestRef.call(void 0, onError);
|
|
775
781
|
const isFlowActiveRef = _react.useRef.call(void 0, true);
|
|
776
782
|
const submitGenerationRef = _react.useRef.call(void 0, 0);
|
|
777
783
|
_react.useEffect.call(void 0, () => {
|
|
@@ -782,13 +788,13 @@ function WithdrawFlow({
|
|
|
782
788
|
}, []);
|
|
783
789
|
const logFlow = _react.useCallback.call(void 0,
|
|
784
790
|
(message, data) => {
|
|
785
|
-
|
|
791
|
+
_chunkNPSC5R22cjs.debugLog.call(void 0, debug, "withdraw-flow", message, data);
|
|
786
792
|
},
|
|
787
793
|
[debug]
|
|
788
794
|
);
|
|
789
795
|
const logFlowError = _react.useCallback.call(void 0,
|
|
790
796
|
(message, error, data) => {
|
|
791
|
-
|
|
797
|
+
_chunkNPSC5R22cjs.debugError.call(void 0, debug, "withdraw-flow", message, error, data);
|
|
792
798
|
},
|
|
793
799
|
[debug]
|
|
794
800
|
);
|
|
@@ -812,7 +818,7 @@ function WithdrawFlow({
|
|
|
812
818
|
const flowStep = useWithdrawStore((s) => s.step);
|
|
813
819
|
const reviewedRecipient = useWithdrawStore((s) => s.recipient);
|
|
814
820
|
const publicClient = _react.useMemo.call(void 0,
|
|
815
|
-
() =>
|
|
821
|
+
() => _chunkNPSC5R22cjs.getPublicClient.call(void 0, sourceChain, rpcUrls),
|
|
816
822
|
[sourceChain, rpcUrls]
|
|
817
823
|
);
|
|
818
824
|
const recipientForRegistration = _react.useMemo.call(void 0, () => {
|
|
@@ -840,7 +846,7 @@ function WithdrawFlow({
|
|
|
840
846
|
targetToken,
|
|
841
847
|
recipient: recipientForRegistration
|
|
842
848
|
});
|
|
843
|
-
const salt =
|
|
849
|
+
const salt = _chunkHCQWFL3Acjs.deriveAccountSalt.call(void 0, {
|
|
844
850
|
recipient: recipientForRegistration,
|
|
845
851
|
targetChain,
|
|
846
852
|
targetToken
|
|
@@ -848,7 +854,7 @@ function WithdrawFlow({
|
|
|
848
854
|
const { evmDepositAddress } = await service.registerManagedAccount({
|
|
849
855
|
salt,
|
|
850
856
|
target: {
|
|
851
|
-
chain:
|
|
857
|
+
chain: _chunkTENL4H64cjs.targetChainToCaip2.call(void 0, targetChain),
|
|
852
858
|
token: targetToken,
|
|
853
859
|
recipient: recipientForRegistration
|
|
854
860
|
}
|
|
@@ -870,7 +876,7 @@ function WithdrawFlow({
|
|
|
870
876
|
} catch (err) {
|
|
871
877
|
if (cancelled) return;
|
|
872
878
|
const raw = err instanceof Error ? err.message : "Registration failed";
|
|
873
|
-
const message =
|
|
879
|
+
const message = _chunkNPSC5R22cjs.formatUserError.call(void 0, raw);
|
|
874
880
|
logFlowError("auto-register:failed", err, {
|
|
875
881
|
accountAddress,
|
|
876
882
|
targetChain,
|
|
@@ -901,10 +907,10 @@ function WithdrawFlow({
|
|
|
901
907
|
onErrorRef
|
|
902
908
|
]);
|
|
903
909
|
const asset = _react.useMemo.call(void 0, () => {
|
|
904
|
-
const symbol =
|
|
905
|
-
const decimals =
|
|
910
|
+
const symbol = _chunkTENL4H64cjs.getTokenSymbol.call(void 0, sourceToken, sourceChain);
|
|
911
|
+
const decimals = _chunkTENL4H64cjs.getTokenDecimalsByAddress.call(void 0, sourceToken, sourceChain);
|
|
906
912
|
return {
|
|
907
|
-
id:
|
|
913
|
+
id: _chunkNPSC5R22cjs.getAssetId.call(void 0, { chainId: sourceChain, token: sourceToken }),
|
|
908
914
|
chainId: sourceChain,
|
|
909
915
|
token: sourceToken,
|
|
910
916
|
symbol,
|
|
@@ -912,7 +918,7 @@ function WithdrawFlow({
|
|
|
912
918
|
decimals
|
|
913
919
|
};
|
|
914
920
|
}, [sourceChain, sourceToken]);
|
|
915
|
-
const isSourceNative = sourceToken.toLowerCase() ===
|
|
921
|
+
const isSourceNative = sourceToken.toLowerCase() === _chunkTENL4H64cjs.NATIVE_TOKEN_ADDRESS.toLowerCase();
|
|
916
922
|
const isSameRoute = targetChain === sourceChain && targetToken.toLowerCase() === sourceToken.toLowerCase();
|
|
917
923
|
const reviewedTarget = reviewedRecipient ? {
|
|
918
924
|
chain: targetChain,
|
|
@@ -937,8 +943,8 @@ function WithdrawFlow({
|
|
|
937
943
|
}
|
|
938
944
|
if (lastStepOpenEventKeyRef.current === "form") return;
|
|
939
945
|
lastStepOpenEventKeyRef.current = "form";
|
|
940
|
-
const tokenSymbol =
|
|
941
|
-
const chainName =
|
|
946
|
+
const tokenSymbol = _chunkTENL4H64cjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
947
|
+
const chainName = _chunkTENL4H64cjs.getChainName.call(void 0, targetChain);
|
|
942
948
|
_optionalChain([onEventRef, 'access', _20 => _20.current, 'optionalCall', _21 => _21({
|
|
943
949
|
type: "withdraw_modal_select_amount_open",
|
|
944
950
|
pred_balance: totalBalanceUsd,
|
|
@@ -973,8 +979,8 @@ function WithdrawFlow({
|
|
|
973
979
|
);
|
|
974
980
|
const handleFormContinue = _react.useCallback.call(void 0,
|
|
975
981
|
(recipient, amountValue) => {
|
|
976
|
-
const tokenSymbol =
|
|
977
|
-
const chainName =
|
|
982
|
+
const tokenSymbol = _chunkTENL4H64cjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
983
|
+
const chainName = _chunkTENL4H64cjs.getChainName.call(void 0, targetChain);
|
|
978
984
|
_optionalChain([onEventRef, 'access', _24 => _24.current, 'optionalCall', _25 => _25({
|
|
979
985
|
type: "withdraw_modal_select_amount_cta_click",
|
|
980
986
|
pred_balance: totalBalanceUsd,
|
|
@@ -1084,7 +1090,7 @@ function WithdrawFlow({
|
|
|
1084
1090
|
targetChain,
|
|
1085
1091
|
targetToken
|
|
1086
1092
|
});
|
|
1087
|
-
handleError(
|
|
1093
|
+
handleError(_chunkNPSC5R22cjs.formatUserError.call(void 0, raw), "WITHDRAW_FLOW_ERROR");
|
|
1088
1094
|
throw err;
|
|
1089
1095
|
}
|
|
1090
1096
|
},
|
|
@@ -1137,15 +1143,11 @@ function WithdrawFlow({
|
|
|
1137
1143
|
},
|
|
1138
1144
|
[logFlowError, onLifecycleRef, storeApi]
|
|
1139
1145
|
);
|
|
1140
|
-
const targetChainOptions =
|
|
1141
|
-
|
|
1142
|
-
(chain) => _chunkH577RJN5cjs.getSupportedTargetTokens.call(void 0, chain.id).length > 0
|
|
1143
|
-
),
|
|
1144
|
-
[]
|
|
1145
|
-
);
|
|
1146
|
+
const targetChainOptions = _chunkNPSC5R22cjs.useDestinationChains.call(void 0, );
|
|
1147
|
+
const targetTokensFor = _chunkNPSC5R22cjs.useTargetTokens.call(void 0, );
|
|
1146
1148
|
const targetTokenOptions = _react.useMemo.call(void 0,
|
|
1147
|
-
() =>
|
|
1148
|
-
[targetChain]
|
|
1149
|
+
() => targetTokensFor(targetChain),
|
|
1150
|
+
[targetChain, targetTokensFor]
|
|
1149
1151
|
);
|
|
1150
1152
|
_react.useEffect.call(void 0, () => {
|
|
1151
1153
|
if (targetTokenOptions.length === 0) return;
|
|
@@ -1157,7 +1159,7 @@ function WithdrawFlow({
|
|
|
1157
1159
|
const handleTargetChainChange = _react.useCallback.call(void 0,
|
|
1158
1160
|
(chainId) => {
|
|
1159
1161
|
setTargetChain(chainId);
|
|
1160
|
-
const options =
|
|
1162
|
+
const options = targetTokensFor(chainId);
|
|
1161
1163
|
if (options.length === 0) return;
|
|
1162
1164
|
const currentlySupported = options.some(
|
|
1163
1165
|
(option) => option.address.toLowerCase() === targetToken.toLowerCase()
|
|
@@ -1166,7 +1168,7 @@ function WithdrawFlow({
|
|
|
1166
1168
|
currentlySupported ? targetToken : options[0].address
|
|
1167
1169
|
);
|
|
1168
1170
|
},
|
|
1169
|
-
[targetToken]
|
|
1171
|
+
[targetToken, targetTokensFor]
|
|
1170
1172
|
);
|
|
1171
1173
|
const handleTargetTokenChange = _react.useCallback.call(void 0, (token) => {
|
|
1172
1174
|
setTargetToken(token);
|
|
@@ -1214,7 +1216,7 @@ function WithdrawFlow({
|
|
|
1214
1216
|
}
|
|
1215
1217
|
),
|
|
1216
1218
|
stepView === "processing" && registration.kind !== "idle" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1217
|
-
|
|
1219
|
+
_chunkHCQWFL3Acjs.ProcessingStep,
|
|
1218
1220
|
{
|
|
1219
1221
|
smartAccount: _nullishCoalesce(storeApi.getState().processingSmartAccount, () => ( (registration.kind === "ready" || registration.kind === "stale" ? registration.smartAccount : "0x0"))),
|
|
1220
1222
|
txHash: _nullishCoalesce(storeApi.getState().txHash, () => ( "0x0")),
|
|
@@ -1284,22 +1286,22 @@ function WithdrawModal({
|
|
|
1284
1286
|
// one only ever applied to the deposit flow.
|
|
1285
1287
|
...removedProps
|
|
1286
1288
|
}) {
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
+
_chunkHCQWFL3Acjs.warnRemovedProps.call(void 0, "WithdrawModal", removedProps);
|
|
1290
|
+
_chunkNPSC5R22cjs.checkBackendUrl.call(void 0, "WithdrawModal", backendUrl);
|
|
1289
1291
|
const modalRef = _react.useRef.call(void 0, null);
|
|
1290
|
-
const onReadyRef =
|
|
1292
|
+
const onReadyRef = _chunkNPSC5R22cjs.useLatestRef.call(void 0, onReady);
|
|
1291
1293
|
const [backHandler, setBackHandler] = _react.useState.call(void 0,
|
|
1292
1294
|
void 0
|
|
1293
1295
|
);
|
|
1294
|
-
const targetChain =
|
|
1295
|
-
const sourceChain =
|
|
1296
|
-
const rpcUrls =
|
|
1296
|
+
const targetChain = _chunkTENL4H64cjs.getChainId.call(void 0, _nullishCoalesce(targetChainProp, () => ( sourceChainProp)));
|
|
1297
|
+
const sourceChain = _chunkTENL4H64cjs.getChainId.call(void 0, sourceChainProp);
|
|
1298
|
+
const rpcUrls = _chunkNPSC5R22cjs.useStableRpcUrls.call(void 0, rpcUrlsProp);
|
|
1297
1299
|
const service = _react.useMemo.call(void 0,
|
|
1298
|
-
() =>
|
|
1300
|
+
() => _chunkNPSC5R22cjs.createDepositService.call(void 0, backendUrl, { debug, debugScope: "service:withdraw" }),
|
|
1299
1301
|
[backendUrl, debug]
|
|
1300
1302
|
);
|
|
1301
1303
|
const store = _react.useMemo.call(void 0, () => createWithdrawStore(), []);
|
|
1302
|
-
const onErrorRef =
|
|
1304
|
+
const onErrorRef = _chunkNPSC5R22cjs.useLatestRef.call(void 0, onError);
|
|
1303
1305
|
_react.useEffect.call(void 0, () => {
|
|
1304
1306
|
if (isOpen && typeof onSendTransaction !== "function") {
|
|
1305
1307
|
_optionalChain([onErrorRef, 'access', _33 => _33.current, 'optionalCall', _34 => _34({
|
|
@@ -1310,7 +1312,7 @@ function WithdrawModal({
|
|
|
1310
1312
|
}, [isOpen, onSendTransaction, onErrorRef]);
|
|
1311
1313
|
_react.useEffect.call(void 0, () => {
|
|
1312
1314
|
if (isOpen && modalRef.current) {
|
|
1313
|
-
|
|
1315
|
+
_chunkNPSC5R22cjs.applyTheme.call(void 0, modalRef.current, theme);
|
|
1314
1316
|
}
|
|
1315
1317
|
}, [isOpen, theme]);
|
|
1316
1318
|
_react.useEffect.call(void 0, () => {
|
|
@@ -1328,8 +1330,8 @@ function WithdrawModal({
|
|
|
1328
1330
|
}, []);
|
|
1329
1331
|
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _37 => _37.showBackButton]), () => ( true));
|
|
1330
1332
|
const canGoBack = backHandler !== void 0;
|
|
1331
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1332
|
-
|
|
1333
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.RpcUrlsProvider, { value: rpcUrls, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.ChainCatalogProvider, { service, rpcUrls, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, WithdrawStoreProvider, { store, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1334
|
+
_chunkNPSC5R22cjs.Modal,
|
|
1333
1335
|
{
|
|
1334
1336
|
isOpen,
|
|
1335
1337
|
onClose,
|
|
@@ -1345,7 +1347,7 @@ function WithdrawModal({
|
|
|
1345
1347
|
className: "rs-modal-header-back",
|
|
1346
1348
|
"aria-label": "Go back",
|
|
1347
1349
|
onClick: backHandler,
|
|
1348
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1350
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.ChevronLeftIcon, {})
|
|
1349
1351
|
}
|
|
1350
1352
|
) }),
|
|
1351
1353
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-header-nav-right", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -1355,7 +1357,7 @@ function WithdrawModal({
|
|
|
1355
1357
|
onClick: onClose,
|
|
1356
1358
|
className: "rs-modal-close",
|
|
1357
1359
|
"aria-label": "Close",
|
|
1358
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1360
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.CloseIcon, {})
|
|
1359
1361
|
}
|
|
1360
1362
|
) })
|
|
1361
1363
|
] }),
|
|
@@ -1382,7 +1384,7 @@ function WithdrawModal({
|
|
|
1382
1384
|
)
|
|
1383
1385
|
] })
|
|
1384
1386
|
}
|
|
1385
|
-
) }) });
|
|
1387
|
+
) }) }) });
|
|
1386
1388
|
}
|
|
1387
1389
|
|
|
1388
1390
|
|