@rhinestone/deposit-modal 0.3.0-alpha.14 → 0.3.0-alpha.15
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-DIUIB3MU.mjs → DepositModalReown-CAX35NN2.mjs} +4 -4
- package/dist/{DepositModalReown-4I47KSPN.cjs → DepositModalReown-P4QGKQRZ.cjs} +7 -7
- package/dist/{WithdrawModalReown-WRUEALDP.mjs → WithdrawModalReown-V4YYPNBE.mjs} +4 -4
- package/dist/{WithdrawModalReown-Y3NRAKXJ.cjs → WithdrawModalReown-ZSFALZOB.cjs} +7 -7
- package/dist/{chunk-JTULAFMU.cjs → chunk-6O4NGY2N.cjs} +5 -5
- package/dist/{chunk-SZIYS42B.mjs → chunk-7C4SPVM5.mjs} +6 -2
- package/dist/{chunk-2NUXDEEO.cjs → chunk-7LJYEGZZ.cjs} +93 -93
- package/dist/{chunk-N4XRQPVA.cjs → chunk-7NO7WVJV.cjs} +33 -24
- package/dist/{chunk-3CYGTYMY.cjs → chunk-AAQPYKBA.cjs} +354 -318
- package/dist/{chunk-7JIDIX27.cjs → chunk-DZ2RPLBM.cjs} +7 -3
- package/dist/{chunk-JTMGFWXO.mjs → chunk-H2WSFD53.mjs} +2 -2
- package/dist/{chunk-4ZN726P5.mjs → chunk-IZMF2WHM.mjs} +10 -1
- package/dist/{chunk-XG474KUR.mjs → chunk-KDJS56TQ.mjs} +53 -17
- package/dist/{chunk-VD4WTEHP.mjs → chunk-LDMY67HP.mjs} +3 -3
- package/dist/constants.cjs +2 -2
- package/dist/constants.mjs +1 -1
- package/dist/deposit.cjs +4 -4
- package/dist/deposit.d.cts +2 -2
- package/dist/deposit.d.ts +2 -2
- package/dist/deposit.mjs +3 -3
- package/dist/index.cjs +5 -5
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +4 -4
- package/dist/{types-C8i2ebY1.d.cts → types-cXr3j4NV.d.cts} +26 -0
- package/dist/{types-C8i2ebY1.d.ts → types-cXr3j4NV.d.ts} +26 -0
- package/dist/withdraw.cjs +4 -4
- package/dist/withdraw.d.cts +2 -2
- package/dist/withdraw.d.ts +2 -2
- package/dist/withdraw.mjs +3 -3
- package/package.json +1 -1
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
|
|
34
|
-
var
|
|
34
|
+
var _chunk7NO7WVJVcjs = require('./chunk-7NO7WVJV.cjs');
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
|
|
@@ -44,7 +44,7 @@ var _chunkN4XRQPVAcjs = require('./chunk-N4XRQPVA.cjs');
|
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
|
|
47
|
-
var
|
|
47
|
+
var _chunkDZ2RPLBMcjs = require('./chunk-DZ2RPLBM.cjs');
|
|
48
48
|
|
|
49
49
|
// src/WithdrawModal.tsx
|
|
50
50
|
|
|
@@ -235,8 +235,8 @@ function WithdrawFormStep({
|
|
|
235
235
|
const chainMismatch = Boolean(
|
|
236
236
|
_optionalChain([walletClient, 'optionalAccess', _3 => _3.chain, 'optionalAccess', _4 => _4.id]) && walletClient.chain.id !== asset.chainId
|
|
237
237
|
);
|
|
238
|
-
const targetSymbol =
|
|
239
|
-
const targetChainName =
|
|
238
|
+
const targetSymbol = _chunkDZ2RPLBMcjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
239
|
+
const targetChainName = _chunkDZ2RPLBMcjs.getChainName.call(void 0, targetChain);
|
|
240
240
|
const isBusy = submitting || isSubmitting;
|
|
241
241
|
const seededRecipientRef = _react.useRef.call(void 0, _nullishCoalesce(defaultRecipient, () => ( "")));
|
|
242
242
|
_react.useEffect.call(void 0, () => {
|
|
@@ -255,7 +255,7 @@ function WithdrawFormStep({
|
|
|
255
255
|
setIsSwitching(true);
|
|
256
256
|
switchChain(asset.chainId).catch((err) => {
|
|
257
257
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
258
|
-
setError(
|
|
258
|
+
setError(_chunk7NO7WVJVcjs.formatUserError.call(void 0, raw));
|
|
259
259
|
}).finally(() => {
|
|
260
260
|
setIsSwitching(false);
|
|
261
261
|
});
|
|
@@ -275,7 +275,7 @@ function WithdrawFormStep({
|
|
|
275
275
|
return;
|
|
276
276
|
}
|
|
277
277
|
try {
|
|
278
|
-
const bal =
|
|
278
|
+
const bal = _chunk7NO7WVJVcjs.isNativeAsset.call(void 0, asset) ? await publicClient.getBalance({ address: safeAddress }) : await publicClient.readContract({
|
|
279
279
|
address: asset.token,
|
|
280
280
|
abi: _viem.erc20Abi,
|
|
281
281
|
functionName: "balanceOf",
|
|
@@ -379,7 +379,7 @@ function WithdrawFormStep({
|
|
|
379
379
|
await onSubmit(recipient, amount);
|
|
380
380
|
} catch (err) {
|
|
381
381
|
const raw = err instanceof Error ? err.message : "Withdrawal failed";
|
|
382
|
-
setError(
|
|
382
|
+
setError(_chunk7NO7WVJVcjs.formatUserError.call(void 0, raw));
|
|
383
383
|
} finally {
|
|
384
384
|
setIsSubmitting(false);
|
|
385
385
|
}
|
|
@@ -387,16 +387,16 @@ function WithdrawFormStep({
|
|
|
387
387
|
if (isBalanceLoading) {
|
|
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 rs-withdraw-loading", children: [
|
|
390
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
390
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.Spinner, { className: "rs-spinner--lg" }),
|
|
391
391
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-withdraw-loading-title", children: "Loading on-chain balance" }),
|
|
392
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-withdraw-loading-subtitle", children: chainMismatch ? `Switch to ${
|
|
392
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-withdraw-loading-subtitle", children: chainMismatch ? `Switch to ${_chunkDZ2RPLBMcjs.getChainName.call(void 0, asset.chainId)} to continue.` : "Please wait before withdrawing." })
|
|
393
393
|
] }),
|
|
394
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
394
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.PoweredBy, {})
|
|
395
395
|
] });
|
|
396
396
|
}
|
|
397
397
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
398
398
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
399
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
399
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.CircleArrowOutUpLeftIcon, {}), title: "Withdraw" }),
|
|
400
400
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-section", children: [
|
|
401
401
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
402
402
|
"label",
|
|
@@ -442,7 +442,7 @@ function WithdrawFormStep({
|
|
|
442
442
|
),
|
|
443
443
|
isRecipientConnected ? null : "Use connected"
|
|
444
444
|
] }) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
445
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
445
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.WalletIcon, { className: "rs-withdraw-use-connected-icon" }),
|
|
446
446
|
isRecipientConnected ? null : "Use connected"
|
|
447
447
|
] })
|
|
448
448
|
}
|
|
@@ -482,7 +482,7 @@ function WithdrawFormStep({
|
|
|
482
482
|
) })
|
|
483
483
|
] }),
|
|
484
484
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-amount-info", children: [
|
|
485
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-withdraw-usd", children: amountUsd !== null ?
|
|
485
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-withdraw-usd", children: amountUsd !== null ? _chunk7NO7WVJVcjs.currencyFormatter.format(amountUsd) : "$0.00" }),
|
|
486
486
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-withdraw-balance", children: [
|
|
487
487
|
"Balance: ",
|
|
488
488
|
formattedBalance,
|
|
@@ -512,10 +512,10 @@ function WithdrawFormStep({
|
|
|
512
512
|
},
|
|
513
513
|
children: [
|
|
514
514
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-dropdown-value", children: [
|
|
515
|
-
|
|
515
|
+
_chunkDZ2RPLBMcjs.getChainIcon.call(void 0, targetChain) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
516
516
|
"img",
|
|
517
517
|
{
|
|
518
|
-
src:
|
|
518
|
+
src: _chunkDZ2RPLBMcjs.getChainIcon.call(void 0, targetChain),
|
|
519
519
|
alt: targetChainName,
|
|
520
520
|
className: "rs-withdraw-dropdown-icon"
|
|
521
521
|
}
|
|
@@ -523,7 +523,7 @@ function WithdrawFormStep({
|
|
|
523
523
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: targetChainName })
|
|
524
524
|
] }),
|
|
525
525
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
526
|
-
|
|
526
|
+
_chunk7NO7WVJVcjs.ChevronDownIcon,
|
|
527
527
|
{
|
|
528
528
|
className: "rs-withdraw-dropdown-arrow",
|
|
529
529
|
style: {
|
|
@@ -544,10 +544,10 @@ function WithdrawFormStep({
|
|
|
544
544
|
setShowChainDropdown(false);
|
|
545
545
|
},
|
|
546
546
|
children: [
|
|
547
|
-
|
|
547
|
+
_chunkDZ2RPLBMcjs.getChainIcon.call(void 0, chain.id) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
548
548
|
"img",
|
|
549
549
|
{
|
|
550
|
-
src:
|
|
550
|
+
src: _chunkDZ2RPLBMcjs.getChainIcon.call(void 0, chain.id),
|
|
551
551
|
alt: chain.name,
|
|
552
552
|
className: "rs-withdraw-dropdown-icon"
|
|
553
553
|
}
|
|
@@ -581,10 +581,10 @@ function WithdrawFormStep({
|
|
|
581
581
|
},
|
|
582
582
|
children: [
|
|
583
583
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-dropdown-value", children: [
|
|
584
|
-
|
|
584
|
+
_chunkDZ2RPLBMcjs.getTokenIcon.call(void 0, targetSymbol) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
585
585
|
"img",
|
|
586
586
|
{
|
|
587
|
-
src:
|
|
587
|
+
src: _chunkDZ2RPLBMcjs.getTokenIcon.call(void 0, targetSymbol),
|
|
588
588
|
alt: targetSymbol,
|
|
589
589
|
className: "rs-withdraw-dropdown-icon"
|
|
590
590
|
}
|
|
@@ -592,7 +592,7 @@ function WithdrawFormStep({
|
|
|
592
592
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: targetSymbol })
|
|
593
593
|
] }),
|
|
594
594
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
595
|
-
|
|
595
|
+
_chunk7NO7WVJVcjs.ChevronDownIcon,
|
|
596
596
|
{
|
|
597
597
|
className: "rs-withdraw-dropdown-arrow",
|
|
598
598
|
style: {
|
|
@@ -613,10 +613,10 @@ function WithdrawFormStep({
|
|
|
613
613
|
setShowTokenDropdown(false);
|
|
614
614
|
},
|
|
615
615
|
children: [
|
|
616
|
-
|
|
616
|
+
_chunkDZ2RPLBMcjs.getTokenIcon.call(void 0, option.symbol) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
617
617
|
"img",
|
|
618
618
|
{
|
|
619
|
-
src:
|
|
619
|
+
src: _chunkDZ2RPLBMcjs.getTokenIcon.call(void 0, option.symbol),
|
|
620
620
|
alt: option.symbol,
|
|
621
621
|
className: "rs-withdraw-dropdown-icon"
|
|
622
622
|
}
|
|
@@ -631,11 +631,11 @@ function WithdrawFormStep({
|
|
|
631
631
|
)
|
|
632
632
|
] })
|
|
633
633
|
] }),
|
|
634
|
-
chainMismatch && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-chain-switch", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-chain-switch-text", children: isSwitching ? `Switching to ${
|
|
635
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
636
|
-
!error && registrationError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
634
|
+
chainMismatch && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-chain-switch", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-chain-switch-text", children: isSwitching ? `Switching to ${_chunkDZ2RPLBMcjs.getChainName.call(void 0, asset.chainId)}...` : `Switch to ${_chunkDZ2RPLBMcjs.getChainName.call(void 0, asset.chainId)} to continue.` }) }),
|
|
635
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.Callout, { variant: "error", children: error }),
|
|
636
|
+
!error && registrationError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.Callout, { variant: "error", children: registrationError }),
|
|
637
637
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
638
|
-
|
|
638
|
+
_chunk7NO7WVJVcjs.Button,
|
|
639
639
|
{
|
|
640
640
|
onClick: handleWithdraw,
|
|
641
641
|
fullWidth: true,
|
|
@@ -645,7 +645,7 @@ function WithdrawFormStep({
|
|
|
645
645
|
}
|
|
646
646
|
)
|
|
647
647
|
] }),
|
|
648
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
648
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.PoweredBy, {})
|
|
649
649
|
] });
|
|
650
650
|
}
|
|
651
651
|
WithdrawFormStep.displayName = "WithdrawFormStep";
|
|
@@ -671,13 +671,13 @@ function WithdrawReviewStep({
|
|
|
671
671
|
}) {
|
|
672
672
|
const [isSubmitting, setIsSubmitting] = _react.useState.call(void 0, false);
|
|
673
673
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
674
|
-
const sourceChainName =
|
|
675
|
-
const sourceChainIcon =
|
|
676
|
-
const targetSymbol =
|
|
677
|
-
const targetChainName =
|
|
678
|
-
const targetChainIcon =
|
|
679
|
-
const sourceTokenIcon =
|
|
680
|
-
const targetTokenIcon =
|
|
674
|
+
const sourceChainName = _chunkDZ2RPLBMcjs.getChainName.call(void 0, sourceChain);
|
|
675
|
+
const sourceChainIcon = _chunkDZ2RPLBMcjs.getChainIcon.call(void 0, sourceChain);
|
|
676
|
+
const targetSymbol = _chunkDZ2RPLBMcjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
677
|
+
const targetChainName = _chunkDZ2RPLBMcjs.getChainName.call(void 0, targetChain);
|
|
678
|
+
const targetChainIcon = _chunkDZ2RPLBMcjs.getChainIcon.call(void 0, targetChain);
|
|
679
|
+
const sourceTokenIcon = _chunkDZ2RPLBMcjs.getTokenIcon.call(void 0, sourceSymbol);
|
|
680
|
+
const targetTokenIcon = _chunkDZ2RPLBMcjs.getTokenIcon.call(void 0, targetSymbol);
|
|
681
681
|
const handleConfirm = async () => {
|
|
682
682
|
setError(null);
|
|
683
683
|
setIsSubmitting(true);
|
|
@@ -685,7 +685,7 @@ function WithdrawReviewStep({
|
|
|
685
685
|
await onConfirm();
|
|
686
686
|
} catch (err) {
|
|
687
687
|
const raw = err instanceof Error ? err.message : "Withdraw failed";
|
|
688
|
-
const message =
|
|
688
|
+
const message = _chunk7NO7WVJVcjs.formatUserError.call(void 0, raw);
|
|
689
689
|
setError(message);
|
|
690
690
|
_optionalChain([onError, 'optionalCall', _8 => _8(message, "WITHDRAW_REVIEW_ERROR")]);
|
|
691
691
|
} finally {
|
|
@@ -696,9 +696,9 @@ function WithdrawReviewStep({
|
|
|
696
696
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
697
697
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
698
698
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
699
|
-
|
|
699
|
+
_chunk7NO7WVJVcjs.BodyHeader,
|
|
700
700
|
{
|
|
701
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
701
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.CircleArrowOutUpLeftIcon, {}),
|
|
702
702
|
title: "Review withdrawal"
|
|
703
703
|
}
|
|
704
704
|
),
|
|
@@ -748,10 +748,10 @@ function WithdrawReviewStep({
|
|
|
748
748
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-value", children: estimatedTime })
|
|
749
749
|
] })
|
|
750
750
|
] }),
|
|
751
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
752
|
-
!error && registrationError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
751
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.Callout, { variant: "error", children: error }),
|
|
752
|
+
!error && registrationError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.Callout, { variant: "error", children: registrationError }),
|
|
753
753
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
754
|
-
|
|
754
|
+
_chunk7NO7WVJVcjs.Button,
|
|
755
755
|
{
|
|
756
756
|
onClick: handleConfirm,
|
|
757
757
|
loading: isSubmitting,
|
|
@@ -762,7 +762,7 @@ function WithdrawReviewStep({
|
|
|
762
762
|
}
|
|
763
763
|
)
|
|
764
764
|
] }),
|
|
765
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
765
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.PoweredBy, {})
|
|
766
766
|
] });
|
|
767
767
|
}
|
|
768
768
|
WithdrawReviewStep.displayName = "WithdrawReviewStep";
|
|
@@ -773,15 +773,15 @@ WithdrawReviewStep.displayName = "WithdrawReviewStep";
|
|
|
773
773
|
var ADDR_REGEX = /^0x[a-fA-F0-9]{40}$/;
|
|
774
774
|
var REGISTRATION_DEBOUNCE_MS = 600;
|
|
775
775
|
function resolveSessionOwner(eoaAddress) {
|
|
776
|
-
const localOwner =
|
|
776
|
+
const localOwner = _chunk7NO7WVJVcjs.loadSessionOwnerFromStorage.call(void 0, eoaAddress);
|
|
777
777
|
if (localOwner) {
|
|
778
778
|
return {
|
|
779
|
-
account:
|
|
779
|
+
account: _chunk7NO7WVJVcjs.accountFromPrivateKey.call(void 0, localOwner.privateKey),
|
|
780
780
|
address: localOwner.address
|
|
781
781
|
};
|
|
782
782
|
}
|
|
783
|
-
const created =
|
|
784
|
-
|
|
783
|
+
const created = _chunk7NO7WVJVcjs.createSessionOwnerKey.call(void 0, );
|
|
784
|
+
_chunk7NO7WVJVcjs.saveSessionOwnerToStorage.call(void 0, eoaAddress, created.privateKey, created.address);
|
|
785
785
|
return { account: created.account, address: created.address };
|
|
786
786
|
}
|
|
787
787
|
function targetsEqual(a, b) {
|
|
@@ -801,7 +801,7 @@ function WithdrawFlow({
|
|
|
801
801
|
amount: defaultAmount,
|
|
802
802
|
service,
|
|
803
803
|
allowedRoutes,
|
|
804
|
-
signerAddress =
|
|
804
|
+
signerAddress = _chunkDZ2RPLBMcjs.DEFAULT_SIGNER_ADDRESS,
|
|
805
805
|
sessionChainIds,
|
|
806
806
|
forceRegister = false,
|
|
807
807
|
reownWallet,
|
|
@@ -816,19 +816,19 @@ function WithdrawFlow({
|
|
|
816
816
|
onError,
|
|
817
817
|
debug
|
|
818
818
|
}) {
|
|
819
|
-
const onStepChangeRef =
|
|
820
|
-
const onEventRef =
|
|
821
|
-
const onLifecycleRef =
|
|
822
|
-
const onErrorRef =
|
|
819
|
+
const onStepChangeRef = _chunk7NO7WVJVcjs.useLatestRef.call(void 0, onStepChange);
|
|
820
|
+
const onEventRef = _chunk7NO7WVJVcjs.useLatestRef.call(void 0, onEvent);
|
|
821
|
+
const onLifecycleRef = _chunk7NO7WVJVcjs.useLatestRef.call(void 0, onLifecycle);
|
|
822
|
+
const onErrorRef = _chunk7NO7WVJVcjs.useLatestRef.call(void 0, onError);
|
|
823
823
|
const logFlow = _react.useCallback.call(void 0,
|
|
824
824
|
(message, data) => {
|
|
825
|
-
|
|
825
|
+
_chunk7NO7WVJVcjs.debugLog.call(void 0, debug, "withdraw-flow", message, data);
|
|
826
826
|
},
|
|
827
827
|
[debug]
|
|
828
828
|
);
|
|
829
829
|
const logFlowError = _react.useCallback.call(void 0,
|
|
830
830
|
(message, error, data) => {
|
|
831
|
-
|
|
831
|
+
_chunk7NO7WVJVcjs.debugError.call(void 0, debug, "withdraw-flow", message, error, data);
|
|
832
832
|
},
|
|
833
833
|
[debug]
|
|
834
834
|
);
|
|
@@ -903,14 +903,14 @@ function WithdrawFlow({
|
|
|
903
903
|
return {
|
|
904
904
|
ownerAddress: dappAddress,
|
|
905
905
|
walletClient: _nullishCoalesce(dappWalletClient, () => ( void 0)),
|
|
906
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
906
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunk7NO7WVJVcjs.getPublicClient.call(void 0, sourceChain))),
|
|
907
907
|
switchChain: dappSwitchChain
|
|
908
908
|
};
|
|
909
909
|
}
|
|
910
910
|
return {
|
|
911
911
|
ownerAddress: dappWalletClient.account.address,
|
|
912
912
|
walletClient: dappWalletClient,
|
|
913
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
913
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunk7NO7WVJVcjs.getPublicClient.call(void 0, sourceChain))),
|
|
914
914
|
switchChain: dappSwitchChain
|
|
915
915
|
};
|
|
916
916
|
}
|
|
@@ -921,7 +921,7 @@ function WithdrawFlow({
|
|
|
921
921
|
return {
|
|
922
922
|
ownerAddress: dappWalletClient.account.address,
|
|
923
923
|
walletClient: dappWalletClient,
|
|
924
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
924
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunk7NO7WVJVcjs.getPublicClient.call(void 0, sourceChain))),
|
|
925
925
|
switchChain: dappSwitchChain
|
|
926
926
|
};
|
|
927
927
|
}
|
|
@@ -978,7 +978,7 @@ function WithdrawFlow({
|
|
|
978
978
|
const setup = await service.setupAccount({
|
|
979
979
|
ownerAddress,
|
|
980
980
|
sessionOwnerAddress: sessionOwner.address,
|
|
981
|
-
targetChain:
|
|
981
|
+
targetChain: _chunk7NO7WVJVcjs.toEvmCaip2.call(void 0, targetChain),
|
|
982
982
|
targetToken,
|
|
983
983
|
recipient: recipientForRegistration,
|
|
984
984
|
signerAddress,
|
|
@@ -1003,7 +1003,7 @@ function WithdrawFlow({
|
|
|
1003
1003
|
message: typedData.message
|
|
1004
1004
|
});
|
|
1005
1005
|
if (cancelled) return;
|
|
1006
|
-
const sessionDetails =
|
|
1006
|
+
const sessionDetails = _chunk7NO7WVJVcjs.buildSessionDetails.call(void 0,
|
|
1007
1007
|
setup.sessionDetailsUnsigned,
|
|
1008
1008
|
signature
|
|
1009
1009
|
);
|
|
@@ -1017,7 +1017,7 @@ function WithdrawFlow({
|
|
|
1017
1017
|
eoaAddress: ownerAddress,
|
|
1018
1018
|
sessionOwner: sessionOwner.address,
|
|
1019
1019
|
target: {
|
|
1020
|
-
chain:
|
|
1020
|
+
chain: _chunk7NO7WVJVcjs.toEvmCaip2.call(void 0, targetChain),
|
|
1021
1021
|
token: targetToken,
|
|
1022
1022
|
recipient: recipientForRegistration
|
|
1023
1023
|
}
|
|
@@ -1040,7 +1040,7 @@ function WithdrawFlow({
|
|
|
1040
1040
|
} catch (err) {
|
|
1041
1041
|
if (cancelled) return;
|
|
1042
1042
|
const raw = err instanceof Error ? err.message : "Registration failed";
|
|
1043
|
-
const message =
|
|
1043
|
+
const message = _chunk7NO7WVJVcjs.formatUserError.call(void 0, raw);
|
|
1044
1044
|
logFlowError("auto-register:failed", err, {
|
|
1045
1045
|
ownerAddress,
|
|
1046
1046
|
targetChain,
|
|
@@ -1073,10 +1073,10 @@ function WithdrawFlow({
|
|
|
1073
1073
|
onErrorRef
|
|
1074
1074
|
]);
|
|
1075
1075
|
const asset = _react.useMemo.call(void 0, () => {
|
|
1076
|
-
const symbol =
|
|
1077
|
-
const decimals =
|
|
1076
|
+
const symbol = _chunkDZ2RPLBMcjs.getTokenSymbol.call(void 0, sourceToken, sourceChain);
|
|
1077
|
+
const decimals = _chunkDZ2RPLBMcjs.getTokenDecimalsByAddress.call(void 0, sourceToken, sourceChain);
|
|
1078
1078
|
return {
|
|
1079
|
-
id:
|
|
1079
|
+
id: _chunk7NO7WVJVcjs.getAssetId.call(void 0, { chainId: sourceChain, token: sourceToken }),
|
|
1080
1080
|
chainId: sourceChain,
|
|
1081
1081
|
token: sourceToken,
|
|
1082
1082
|
symbol,
|
|
@@ -1084,7 +1084,7 @@ function WithdrawFlow({
|
|
|
1084
1084
|
decimals
|
|
1085
1085
|
};
|
|
1086
1086
|
}, [sourceChain, sourceToken]);
|
|
1087
|
-
const isSourceNative = sourceToken.toLowerCase() ===
|
|
1087
|
+
const isSourceNative = sourceToken.toLowerCase() === _chunkDZ2RPLBMcjs.NATIVE_TOKEN_ADDRESS.toLowerCase();
|
|
1088
1088
|
const isSameRoute = targetChain === sourceChain && targetToken.toLowerCase() === sourceToken.toLowerCase();
|
|
1089
1089
|
const reviewBackHandler = _react.useCallback.call(void 0, () => {
|
|
1090
1090
|
storeApi.dispatch({ type: "review/back" });
|
|
@@ -1102,8 +1102,8 @@ function WithdrawFlow({
|
|
|
1102
1102
|
}
|
|
1103
1103
|
if (lastStepOpenEventKeyRef.current === "form") return;
|
|
1104
1104
|
lastStepOpenEventKeyRef.current = "form";
|
|
1105
|
-
const tokenSymbol =
|
|
1106
|
-
const chainName =
|
|
1105
|
+
const tokenSymbol = _chunkDZ2RPLBMcjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
1106
|
+
const chainName = _chunkDZ2RPLBMcjs.getChainName.call(void 0, targetChain);
|
|
1107
1107
|
_optionalChain([onEventRef, 'access', _37 => _37.current, 'optionalCall', _38 => _38({
|
|
1108
1108
|
type: "withdraw_modal_select_amount_open",
|
|
1109
1109
|
pred_balance: totalBalanceUsd,
|
|
@@ -1140,8 +1140,8 @@ function WithdrawFlow({
|
|
|
1140
1140
|
);
|
|
1141
1141
|
const handleFormContinue = _react.useCallback.call(void 0,
|
|
1142
1142
|
(recipient, amountValue) => {
|
|
1143
|
-
const tokenSymbol =
|
|
1144
|
-
const chainName =
|
|
1143
|
+
const tokenSymbol = _chunkDZ2RPLBMcjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
1144
|
+
const chainName = _chunkDZ2RPLBMcjs.getChainName.call(void 0, targetChain);
|
|
1145
1145
|
_optionalChain([onEventRef, 'access', _41 => _41.current, 'optionalCall', _42 => _42({
|
|
1146
1146
|
type: "withdraw_modal_select_amount_cta_click",
|
|
1147
1147
|
pred_balance: totalBalanceUsd,
|
|
@@ -1184,7 +1184,7 @@ function WithdrawFlow({
|
|
|
1184
1184
|
targetToken
|
|
1185
1185
|
});
|
|
1186
1186
|
const amountUnits = _viem.parseUnits.call(void 0, amountValue, asset.decimals);
|
|
1187
|
-
const pc = _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess', _44 => _44.publicClient]), () => (
|
|
1187
|
+
const pc = _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess', _44 => _44.publicClient]), () => ( _chunk7NO7WVJVcjs.getPublicClient.call(void 0, sourceChain)));
|
|
1188
1188
|
let result;
|
|
1189
1189
|
if (onSignTransaction) {
|
|
1190
1190
|
const transferTarget = isSameRoute ? recipient : smartAccount;
|
|
@@ -1197,7 +1197,7 @@ function WithdrawFlow({
|
|
|
1197
1197
|
args: [transferTarget, amountUnits]
|
|
1198
1198
|
})
|
|
1199
1199
|
};
|
|
1200
|
-
const request = await
|
|
1200
|
+
const request = await _chunk7NO7WVJVcjs.buildSafeTransaction.call(void 0, {
|
|
1201
1201
|
publicClient: pc,
|
|
1202
1202
|
safeAddress,
|
|
1203
1203
|
to: transferData.to,
|
|
@@ -1208,7 +1208,7 @@ function WithdrawFlow({
|
|
|
1208
1208
|
const { signature } = await onSignTransaction(request);
|
|
1209
1209
|
const relayResult = await service.relayWithdraw({
|
|
1210
1210
|
smartAccount,
|
|
1211
|
-
chainId:
|
|
1211
|
+
chainId: _chunk7NO7WVJVcjs.toEvmCaip2.call(void 0, sourceChain),
|
|
1212
1212
|
safeAddress,
|
|
1213
1213
|
safeTransaction: request.typedData.message,
|
|
1214
1214
|
signature
|
|
@@ -1218,7 +1218,7 @@ function WithdrawFlow({
|
|
|
1218
1218
|
}
|
|
1219
1219
|
result = { txHash: relayResult.txHash };
|
|
1220
1220
|
} else if (isSourceNative) {
|
|
1221
|
-
result = await
|
|
1221
|
+
result = await _chunk7NO7WVJVcjs.executeSafeEthTransfer.call(void 0, {
|
|
1222
1222
|
walletClient: signerContext.walletClient,
|
|
1223
1223
|
publicClient: pc,
|
|
1224
1224
|
safeAddress,
|
|
@@ -1227,7 +1227,7 @@ function WithdrawFlow({
|
|
|
1227
1227
|
chainId: sourceChain
|
|
1228
1228
|
});
|
|
1229
1229
|
} else {
|
|
1230
|
-
result = await
|
|
1230
|
+
result = await _chunk7NO7WVJVcjs.executeSafeErc20Transfer.call(void 0, {
|
|
1231
1231
|
walletClient: signerContext.walletClient,
|
|
1232
1232
|
publicClient: pc,
|
|
1233
1233
|
safeAddress,
|
|
@@ -1260,7 +1260,7 @@ function WithdrawFlow({
|
|
|
1260
1260
|
targetChain,
|
|
1261
1261
|
targetToken
|
|
1262
1262
|
});
|
|
1263
|
-
handleError(
|
|
1263
|
+
handleError(_chunk7NO7WVJVcjs.formatUserError.call(void 0, raw), "WITHDRAW_FLOW_ERROR");
|
|
1264
1264
|
throw err;
|
|
1265
1265
|
}
|
|
1266
1266
|
},
|
|
@@ -1325,9 +1325,9 @@ function WithdrawFlow({
|
|
|
1325
1325
|
[_optionalChain([allowedRoutes, 'optionalAccess', _54 => _54.sourceTokens])]
|
|
1326
1326
|
);
|
|
1327
1327
|
const targetChainOptions = _react.useMemo.call(void 0, () => {
|
|
1328
|
-
return
|
|
1328
|
+
return _chunkDZ2RPLBMcjs.SOURCE_CHAINS.filter((chain) => {
|
|
1329
1329
|
if (allowedChainSet && !allowedChainSet.has(chain.id)) return false;
|
|
1330
|
-
const tokens =
|
|
1330
|
+
const tokens = _chunkDZ2RPLBMcjs.getSupportedTargetTokens.call(void 0, chain.id);
|
|
1331
1331
|
if (allowedTokenSet) {
|
|
1332
1332
|
return tokens.some((t) => allowedTokenSet.has(t.symbol.toUpperCase()));
|
|
1333
1333
|
}
|
|
@@ -1335,7 +1335,7 @@ function WithdrawFlow({
|
|
|
1335
1335
|
});
|
|
1336
1336
|
}, [allowedChainSet, allowedTokenSet]);
|
|
1337
1337
|
const targetTokenOptions = _react.useMemo.call(void 0, () => {
|
|
1338
|
-
const tokens =
|
|
1338
|
+
const tokens = _chunkDZ2RPLBMcjs.getSupportedTargetTokens.call(void 0, targetChain);
|
|
1339
1339
|
if (!allowedTokenSet) return tokens;
|
|
1340
1340
|
return tokens.filter((t) => allowedTokenSet.has(t.symbol.toUpperCase()));
|
|
1341
1341
|
}, [targetChain, allowedTokenSet]);
|
|
@@ -1349,7 +1349,7 @@ function WithdrawFlow({
|
|
|
1349
1349
|
const handleTargetChainChange = _react.useCallback.call(void 0,
|
|
1350
1350
|
(chainId) => {
|
|
1351
1351
|
setTargetChain(chainId);
|
|
1352
|
-
let options =
|
|
1352
|
+
let options = _chunkDZ2RPLBMcjs.getSupportedTargetTokens.call(void 0, chainId);
|
|
1353
1353
|
if (allowedTokenSet) {
|
|
1354
1354
|
options = options.filter(
|
|
1355
1355
|
(t) => allowedTokenSet.has(t.symbol.toUpperCase())
|
|
@@ -1399,7 +1399,7 @@ function WithdrawFlow({
|
|
|
1399
1399
|
state: "ready"
|
|
1400
1400
|
}));
|
|
1401
1401
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1402
|
-
|
|
1402
|
+
_chunk7NO7WVJVcjs.ConnectStep,
|
|
1403
1403
|
{
|
|
1404
1404
|
walletRows: withdrawRows,
|
|
1405
1405
|
onConfirmWallet: (walletId) => {
|
|
@@ -1417,7 +1417,7 @@ function WithdrawFlow({
|
|
|
1417
1417
|
if (!signerContext) return null;
|
|
1418
1418
|
if (!onSignTransaction && !signerContext.walletClient) return null;
|
|
1419
1419
|
const resolvedConnectedRecipient = _optionalChain([selectedWalletOption, 'optionalAccess', _61 => _61.kind]) === "external" ? selectedWalletOption.address : void 0;
|
|
1420
|
-
const formPublicClient = _nullishCoalesce(signerContext.publicClient, () => (
|
|
1420
|
+
const formPublicClient = _nullishCoalesce(signerContext.publicClient, () => ( _chunk7NO7WVJVcjs.getPublicClient.call(void 0, sourceChain)));
|
|
1421
1421
|
const stepView = deriveStepView(flowStep, registration);
|
|
1422
1422
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
1423
1423
|
stepView === "form" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -1461,7 +1461,7 @@ function WithdrawFlow({
|
|
|
1461
1461
|
}
|
|
1462
1462
|
),
|
|
1463
1463
|
stepView === "processing" && registration.kind !== "idle" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1464
|
-
|
|
1464
|
+
_chunk7NO7WVJVcjs.ProcessingStep,
|
|
1465
1465
|
{
|
|
1466
1466
|
smartAccount: registration.kind === "ready" || registration.kind === "stale" ? registration.smartAccount : "0x0",
|
|
1467
1467
|
txHash: _nullishCoalesce(storeApi.getState().txHash, () => ( "0x0")),
|
|
@@ -1494,7 +1494,7 @@ function deriveStepView(step, _registration) {
|
|
|
1494
1494
|
// src/WithdrawModal.tsx
|
|
1495
1495
|
|
|
1496
1496
|
var ReownWithdrawInner = _react.lazy.call(void 0,
|
|
1497
|
-
() => Promise.resolve().then(() => _interopRequireWildcard(require("./WithdrawModalReown-
|
|
1497
|
+
() => Promise.resolve().then(() => _interopRequireWildcard(require("./WithdrawModalReown-ZSFALZOB.cjs"))).then((m) => ({
|
|
1498
1498
|
default: m.WithdrawModalReown
|
|
1499
1499
|
}))
|
|
1500
1500
|
);
|
|
@@ -1522,8 +1522,8 @@ function WithdrawModalInner({
|
|
|
1522
1522
|
inline,
|
|
1523
1523
|
closeOnOverlayClick,
|
|
1524
1524
|
allowedRoutes,
|
|
1525
|
-
backendUrl =
|
|
1526
|
-
signerAddress =
|
|
1525
|
+
backendUrl = _chunkDZ2RPLBMcjs.DEFAULT_BACKEND_URL,
|
|
1526
|
+
signerAddress = _chunkDZ2RPLBMcjs.DEFAULT_SIGNER_ADDRESS,
|
|
1527
1527
|
sessionChainIds,
|
|
1528
1528
|
forceRegister = false,
|
|
1529
1529
|
reownWallet,
|
|
@@ -1541,18 +1541,18 @@ function WithdrawModalInner({
|
|
|
1541
1541
|
debug
|
|
1542
1542
|
}) {
|
|
1543
1543
|
const modalRef = _react.useRef.call(void 0, null);
|
|
1544
|
-
const onReadyRef =
|
|
1544
|
+
const onReadyRef = _chunk7NO7WVJVcjs.useLatestRef.call(void 0, onReady);
|
|
1545
1545
|
const [backHandler, setBackHandler] = _react.useState.call(void 0,
|
|
1546
1546
|
void 0
|
|
1547
1547
|
);
|
|
1548
|
-
const targetChain =
|
|
1549
|
-
const sourceChain =
|
|
1548
|
+
const targetChain = _chunkDZ2RPLBMcjs.getChainId.call(void 0, targetChainProp);
|
|
1549
|
+
const sourceChain = _chunkDZ2RPLBMcjs.getChainId.call(void 0, sourceChainProp);
|
|
1550
1550
|
const service = _react.useMemo.call(void 0,
|
|
1551
|
-
() =>
|
|
1551
|
+
() => _chunk7NO7WVJVcjs.createDepositService.call(void 0, backendUrl, { debug, debugScope: "service:withdraw" }),
|
|
1552
1552
|
[backendUrl, debug]
|
|
1553
1553
|
);
|
|
1554
1554
|
const store = _react.useMemo.call(void 0, () => createWithdrawStore(), []);
|
|
1555
|
-
const onErrorRef =
|
|
1555
|
+
const onErrorRef = _chunk7NO7WVJVcjs.useLatestRef.call(void 0, onError);
|
|
1556
1556
|
_react.useEffect.call(void 0, () => {
|
|
1557
1557
|
if (isOpen && onSignTransaction && !dappAddress) {
|
|
1558
1558
|
_optionalChain([onErrorRef, 'access', _62 => _62.current, 'optionalCall', _63 => _63({
|
|
@@ -1563,7 +1563,7 @@ function WithdrawModalInner({
|
|
|
1563
1563
|
}, [isOpen, onSignTransaction, dappAddress, onErrorRef]);
|
|
1564
1564
|
_react.useEffect.call(void 0, () => {
|
|
1565
1565
|
if (isOpen && modalRef.current) {
|
|
1566
|
-
|
|
1566
|
+
_chunk7NO7WVJVcjs.applyTheme.call(void 0, modalRef.current, theme);
|
|
1567
1567
|
}
|
|
1568
1568
|
}, [isOpen, theme]);
|
|
1569
1569
|
_react.useEffect.call(void 0, () => {
|
|
@@ -1582,7 +1582,7 @@ function WithdrawModalInner({
|
|
|
1582
1582
|
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _66 => _66.showBackButton]), () => ( true));
|
|
1583
1583
|
const canGoBack = backHandler !== void 0;
|
|
1584
1584
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, WithdrawStoreProvider, { store, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1585
|
-
|
|
1585
|
+
_chunk7NO7WVJVcjs.Modal,
|
|
1586
1586
|
{
|
|
1587
1587
|
isOpen,
|
|
1588
1588
|
onClose,
|
|
@@ -1598,7 +1598,7 @@ function WithdrawModalInner({
|
|
|
1598
1598
|
className: "rs-modal-header-back",
|
|
1599
1599
|
"aria-label": "Go back",
|
|
1600
1600
|
onClick: backHandler,
|
|
1601
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1601
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.ChevronLeftIcon, {})
|
|
1602
1602
|
}
|
|
1603
1603
|
) }),
|
|
1604
1604
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-header-nav-right", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -1608,7 +1608,7 @@ function WithdrawModalInner({
|
|
|
1608
1608
|
onClick: onClose,
|
|
1609
1609
|
className: "rs-modal-close",
|
|
1610
1610
|
"aria-label": "Close",
|
|
1611
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1611
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.CloseIcon, {})
|
|
1612
1612
|
}
|
|
1613
1613
|
) })
|
|
1614
1614
|
] }),
|