@rhinestone/deposit-modal 0.3.0-alpha.4 → 0.3.0-alpha.6
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-A2E4QTSF.mjs → DepositModalReown-3N7YYGB4.mjs} +2 -2
- package/dist/{DepositModalReown-XV4BEUHT.cjs → DepositModalReown-SBSP5ZW2.cjs} +3 -3
- package/dist/{WithdrawModalReown-KGFCNAJP.cjs → WithdrawModalReown-4B6IMTBB.cjs} +3 -3
- package/dist/{WithdrawModalReown-UO7XCJ7K.mjs → WithdrawModalReown-BB3MZAIO.mjs} +2 -2
- package/dist/{chunk-UEYFJM5Y.cjs → chunk-BB6UVRAV.cjs} +74 -74
- package/dist/{chunk-TFXIQ7YH.mjs → chunk-CTYKQ4B4.mjs} +295 -171
- package/dist/{chunk-V6NJIPSS.cjs → chunk-DX2D2TRZ.cjs} +239 -115
- package/dist/{chunk-BNY4AL7P.mjs → chunk-EJH36TH2.mjs} +90 -102
- package/dist/{chunk-GE3TMZEL.mjs → chunk-QI6Q7V6O.mjs} +19 -19
- package/dist/{chunk-NSI4BCBV.cjs → chunk-UVIIWUWP.cjs} +272 -284
- package/dist/deposit.cjs +3 -3
- package/dist/deposit.mjs +2 -2
- package/dist/index.cjs +4 -4
- package/dist/index.mjs +3 -3
- package/dist/styles.css +401 -180
- package/dist/withdraw.cjs +3 -3
- package/dist/withdraw.mjs +2 -2
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DepositModalInner
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-EJH36TH2.mjs";
|
|
4
4
|
import {
|
|
5
5
|
ReownWalletProvider,
|
|
6
6
|
useReownWallet
|
|
7
7
|
} from "./chunk-5YXAQB6A.mjs";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-CTYKQ4B4.mjs";
|
|
9
9
|
import "./chunk-VA3ANS7D.mjs";
|
|
10
10
|
|
|
11
11
|
// src/DepositModalReown.tsx
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkUVIIWUWPcjs = require('./chunk-UVIIWUWP.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
var _chunkYQFH2WSWcjs = require('./chunk-YQFH2WSW.cjs');
|
|
8
|
-
require('./chunk-
|
|
8
|
+
require('./chunk-DX2D2TRZ.cjs');
|
|
9
9
|
require('./chunk-IVTXEYB2.cjs');
|
|
10
10
|
|
|
11
11
|
// src/DepositModalReown.tsx
|
|
@@ -32,7 +32,7 @@ function DepositModalWithReown(props) {
|
|
|
32
32
|
reown.disconnect();
|
|
33
33
|
}, [reown.disconnect]);
|
|
34
34
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
35
|
-
|
|
35
|
+
_chunkUVIIWUWPcjs.DepositModalInner,
|
|
36
36
|
{
|
|
37
37
|
...props,
|
|
38
38
|
reownWallet: reownWithSolana,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkBB6UVRAVcjs = require('./chunk-BB6UVRAV.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
var _chunkYQFH2WSWcjs = require('./chunk-YQFH2WSW.cjs');
|
|
8
|
-
require('./chunk-
|
|
8
|
+
require('./chunk-DX2D2TRZ.cjs');
|
|
9
9
|
require('./chunk-IVTXEYB2.cjs');
|
|
10
10
|
|
|
11
11
|
// src/WithdrawModalReown.tsx
|
|
@@ -20,7 +20,7 @@ function WithdrawModalWithReown(props) {
|
|
|
20
20
|
reown.disconnect();
|
|
21
21
|
}, [reown.disconnect]);
|
|
22
22
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
23
|
-
|
|
23
|
+
_chunkBB6UVRAVcjs.WithdrawModalInner,
|
|
24
24
|
{
|
|
25
25
|
...props,
|
|
26
26
|
reownWallet: reown,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
WithdrawModalInner
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-QI6Q7V6O.mjs";
|
|
4
4
|
import {
|
|
5
5
|
ReownWalletProvider,
|
|
6
6
|
useReownWallet
|
|
7
7
|
} from "./chunk-5YXAQB6A.mjs";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-CTYKQ4B4.mjs";
|
|
9
9
|
import "./chunk-VA3ANS7D.mjs";
|
|
10
10
|
|
|
11
11
|
// src/WithdrawModalReown.tsx
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
|
|
34
|
-
var
|
|
34
|
+
var _chunkDX2D2TRZcjs = require('./chunk-DX2D2TRZ.cjs');
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
|
|
@@ -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(_chunkDX2D2TRZcjs.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 = _chunkDX2D2TRZcjs.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(_chunkDX2D2TRZcjs.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-step", children: [
|
|
389
389
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-step-body rs-withdraw-loading", children: [
|
|
390
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
390
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDX2D2TRZcjs.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
392
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-withdraw-loading-subtitle", children: chainMismatch ? `Switch to ${_chunkIVTXEYB2cjs.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, _chunkDX2D2TRZcjs.PoweredBy, {})
|
|
395
395
|
] });
|
|
396
396
|
}
|
|
397
397
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-step", children: [
|
|
398
398
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-step-body rs-withdraw-form", children: [
|
|
399
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
399
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDX2D2TRZcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDX2D2TRZcjs.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, "label", { className: "rs-withdraw-label", children: "Recipient address" }),
|
|
402
402
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-input-row", children: [
|
|
@@ -434,7 +434,7 @@ function WithdrawFormStep({
|
|
|
434
434
|
),
|
|
435
435
|
isRecipientConnected ? null : "Use connected"
|
|
436
436
|
] }) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
437
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
437
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDX2D2TRZcjs.WalletIcon, { className: "rs-withdraw-use-connected-icon" }),
|
|
438
438
|
isRecipientConnected ? null : "Use connected"
|
|
439
439
|
] })
|
|
440
440
|
}
|
|
@@ -473,7 +473,7 @@ function WithdrawFormStep({
|
|
|
473
473
|
) })
|
|
474
474
|
] }),
|
|
475
475
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-amount-info", children: [
|
|
476
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-withdraw-usd", children: amountUsd !== null ?
|
|
476
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-withdraw-usd", children: amountUsd !== null ? _chunkDX2D2TRZcjs.currencyFormatter.format(amountUsd) : "$0.00" }),
|
|
477
477
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-withdraw-balance", children: [
|
|
478
478
|
"Balance: ",
|
|
479
479
|
formattedBalance,
|
|
@@ -513,7 +513,7 @@ function WithdrawFormStep({
|
|
|
513
513
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: targetChainName })
|
|
514
514
|
] }),
|
|
515
515
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
516
|
-
|
|
516
|
+
_chunkDX2D2TRZcjs.ChevronDownIcon,
|
|
517
517
|
{
|
|
518
518
|
className: "rs-withdraw-dropdown-arrow",
|
|
519
519
|
style: {
|
|
@@ -581,7 +581,7 @@ function WithdrawFormStep({
|
|
|
581
581
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: targetSymbol })
|
|
582
582
|
] }),
|
|
583
583
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
584
|
-
|
|
584
|
+
_chunkDX2D2TRZcjs.ChevronDownIcon,
|
|
585
585
|
{
|
|
586
586
|
className: "rs-withdraw-dropdown-arrow",
|
|
587
587
|
style: {
|
|
@@ -622,16 +622,16 @@ function WithdrawFormStep({
|
|
|
622
622
|
] }),
|
|
623
623
|
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 ${_chunkIVTXEYB2cjs.getChainName.call(void 0, asset.chainId)}...` : `Switch to ${_chunkIVTXEYB2cjs.getChainName.call(void 0, asset.chainId)} to continue.` }) }),
|
|
624
624
|
error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-error", children: [
|
|
625
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
625
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDX2D2TRZcjs.AlertTriangleIcon, {}),
|
|
626
626
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: error })
|
|
627
627
|
] }),
|
|
628
628
|
!error && registrationError && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-error", children: [
|
|
629
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
629
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDX2D2TRZcjs.AlertTriangleIcon, {}),
|
|
630
630
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: registrationError })
|
|
631
631
|
] })
|
|
632
632
|
] }),
|
|
633
633
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
634
|
-
|
|
634
|
+
_chunkDX2D2TRZcjs.Button,
|
|
635
635
|
{
|
|
636
636
|
onClick: handleWithdraw,
|
|
637
637
|
fullWidth: true,
|
|
@@ -640,7 +640,7 @@ function WithdrawFormStep({
|
|
|
640
640
|
children: isBusy ? "Preparing..." : registrationPending ? "Preparing session..." : !recipient ? "Enter Recipient Address" : !amount ? "Enter Withdraw Amount" : "Withdraw"
|
|
641
641
|
}
|
|
642
642
|
) }),
|
|
643
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
643
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDX2D2TRZcjs.PoweredBy, {})
|
|
644
644
|
] });
|
|
645
645
|
}
|
|
646
646
|
WithdrawFormStep.displayName = "WithdrawFormStep";
|
|
@@ -680,7 +680,7 @@ function WithdrawReviewStep({
|
|
|
680
680
|
await onConfirm();
|
|
681
681
|
} catch (err) {
|
|
682
682
|
const raw = err instanceof Error ? err.message : "Withdraw failed";
|
|
683
|
-
const message =
|
|
683
|
+
const message = _chunkDX2D2TRZcjs.formatUserError.call(void 0, raw);
|
|
684
684
|
setError(message);
|
|
685
685
|
_optionalChain([onError, 'optionalCall', _8 => _8(message, "WITHDRAW_REVIEW_ERROR")]);
|
|
686
686
|
} finally {
|
|
@@ -691,68 +691,68 @@ function WithdrawReviewStep({
|
|
|
691
691
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
692
692
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
693
693
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
694
|
-
|
|
694
|
+
_chunkDX2D2TRZcjs.BodyHeader,
|
|
695
695
|
{
|
|
696
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
696
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDX2D2TRZcjs.CircleArrowOutUpLeftIcon, {}),
|
|
697
697
|
title: "Review withdrawal"
|
|
698
698
|
}
|
|
699
699
|
),
|
|
700
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-
|
|
701
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-
|
|
700
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-details", children: [
|
|
701
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
702
702
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "You send" }),
|
|
703
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-
|
|
703
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
704
704
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { children: [
|
|
705
705
|
amount,
|
|
706
706
|
" ",
|
|
707
707
|
sourceSymbol
|
|
708
708
|
] }),
|
|
709
|
-
sourceTokenIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-
|
|
709
|
+
sourceTokenIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "img", { src: sourceTokenIcon, alt: "" }) })
|
|
710
710
|
] })
|
|
711
711
|
] }),
|
|
712
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-
|
|
712
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
713
713
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Source chain" }),
|
|
714
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-
|
|
714
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
715
715
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: sourceChainName }),
|
|
716
|
-
sourceChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-
|
|
716
|
+
sourceChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "img", { src: sourceChainIcon, alt: "" }) })
|
|
717
717
|
] })
|
|
718
718
|
] }),
|
|
719
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-
|
|
719
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
720
720
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Recipient" }),
|
|
721
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-
|
|
721
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-value", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: shortenAddress(recipient) }) })
|
|
722
722
|
] }),
|
|
723
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-
|
|
723
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
724
724
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Receive" }),
|
|
725
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-
|
|
725
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
726
726
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { children: [
|
|
727
727
|
amount,
|
|
728
728
|
" ",
|
|
729
729
|
targetSymbol
|
|
730
730
|
] }),
|
|
731
|
-
targetTokenIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-
|
|
731
|
+
targetTokenIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "img", { src: targetTokenIcon, alt: "" }) })
|
|
732
732
|
] })
|
|
733
733
|
] }),
|
|
734
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-
|
|
734
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
735
735
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Destination chain" }),
|
|
736
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-
|
|
736
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
737
737
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: targetChainName }),
|
|
738
|
-
targetChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-
|
|
738
|
+
targetChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "img", { src: targetChainIcon, alt: "" }) })
|
|
739
739
|
] })
|
|
740
740
|
] }),
|
|
741
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-
|
|
741
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
742
742
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Estimated time" }),
|
|
743
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-
|
|
743
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-value", children: estimatedTime })
|
|
744
744
|
] })
|
|
745
745
|
] }),
|
|
746
746
|
error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-error", role: "alert", children: [
|
|
747
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
747
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDX2D2TRZcjs.AlertTriangleIcon, { style: { width: 16, height: 16, flexShrink: 0 } }),
|
|
748
748
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: error })
|
|
749
749
|
] }),
|
|
750
750
|
!error && registrationError && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-error", role: "alert", children: [
|
|
751
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
751
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDX2D2TRZcjs.AlertTriangleIcon, { style: { width: 16, height: 16, flexShrink: 0 } }),
|
|
752
752
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: registrationError })
|
|
753
753
|
] }),
|
|
754
754
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
755
|
-
|
|
755
|
+
_chunkDX2D2TRZcjs.Button,
|
|
756
756
|
{
|
|
757
757
|
onClick: handleConfirm,
|
|
758
758
|
loading: isSubmitting,
|
|
@@ -763,7 +763,7 @@ function WithdrawReviewStep({
|
|
|
763
763
|
}
|
|
764
764
|
)
|
|
765
765
|
] }),
|
|
766
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
766
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDX2D2TRZcjs.PoweredBy, {})
|
|
767
767
|
] });
|
|
768
768
|
}
|
|
769
769
|
WithdrawReviewStep.displayName = "WithdrawReviewStep";
|
|
@@ -774,15 +774,15 @@ WithdrawReviewStep.displayName = "WithdrawReviewStep";
|
|
|
774
774
|
var ADDR_REGEX = /^0x[a-fA-F0-9]{40}$/;
|
|
775
775
|
var REGISTRATION_DEBOUNCE_MS = 600;
|
|
776
776
|
function resolveSessionOwner(eoaAddress) {
|
|
777
|
-
const localOwner =
|
|
777
|
+
const localOwner = _chunkDX2D2TRZcjs.loadSessionOwnerFromStorage.call(void 0, eoaAddress);
|
|
778
778
|
if (localOwner) {
|
|
779
779
|
return {
|
|
780
|
-
account:
|
|
780
|
+
account: _chunkDX2D2TRZcjs.accountFromPrivateKey.call(void 0, localOwner.privateKey),
|
|
781
781
|
address: localOwner.address
|
|
782
782
|
};
|
|
783
783
|
}
|
|
784
|
-
const created =
|
|
785
|
-
|
|
784
|
+
const created = _chunkDX2D2TRZcjs.createSessionOwnerKey.call(void 0, );
|
|
785
|
+
_chunkDX2D2TRZcjs.saveSessionOwnerToStorage.call(void 0, eoaAddress, created.privateKey, created.address);
|
|
786
786
|
return { account: created.account, address: created.address };
|
|
787
787
|
}
|
|
788
788
|
function targetsEqual(a, b) {
|
|
@@ -818,19 +818,19 @@ function WithdrawFlow({
|
|
|
818
818
|
onError,
|
|
819
819
|
debug
|
|
820
820
|
}) {
|
|
821
|
-
const onStepChangeRef =
|
|
822
|
-
const onEventRef =
|
|
823
|
-
const onLifecycleRef =
|
|
824
|
-
const onErrorRef =
|
|
821
|
+
const onStepChangeRef = _chunkDX2D2TRZcjs.useLatestRef.call(void 0, onStepChange);
|
|
822
|
+
const onEventRef = _chunkDX2D2TRZcjs.useLatestRef.call(void 0, onEvent);
|
|
823
|
+
const onLifecycleRef = _chunkDX2D2TRZcjs.useLatestRef.call(void 0, onLifecycle);
|
|
824
|
+
const onErrorRef = _chunkDX2D2TRZcjs.useLatestRef.call(void 0, onError);
|
|
825
825
|
const logFlow = _react.useCallback.call(void 0,
|
|
826
826
|
(message, data) => {
|
|
827
|
-
|
|
827
|
+
_chunkDX2D2TRZcjs.debugLog.call(void 0, debug, "withdraw-flow", message, data);
|
|
828
828
|
},
|
|
829
829
|
[debug]
|
|
830
830
|
);
|
|
831
831
|
const logFlowError = _react.useCallback.call(void 0,
|
|
832
832
|
(message, error, data) => {
|
|
833
|
-
|
|
833
|
+
_chunkDX2D2TRZcjs.debugError.call(void 0, debug, "withdraw-flow", message, error, data);
|
|
834
834
|
},
|
|
835
835
|
[debug]
|
|
836
836
|
);
|
|
@@ -905,14 +905,14 @@ function WithdrawFlow({
|
|
|
905
905
|
return {
|
|
906
906
|
ownerAddress: dappAddress,
|
|
907
907
|
walletClient: _nullishCoalesce(dappWalletClient, () => ( void 0)),
|
|
908
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
908
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkDX2D2TRZcjs.getPublicClient.call(void 0, sourceChain))),
|
|
909
909
|
switchChain: dappSwitchChain
|
|
910
910
|
};
|
|
911
911
|
}
|
|
912
912
|
return {
|
|
913
913
|
ownerAddress: dappWalletClient.account.address,
|
|
914
914
|
walletClient: dappWalletClient,
|
|
915
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
915
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkDX2D2TRZcjs.getPublicClient.call(void 0, sourceChain))),
|
|
916
916
|
switchChain: dappSwitchChain
|
|
917
917
|
};
|
|
918
918
|
}
|
|
@@ -923,7 +923,7 @@ function WithdrawFlow({
|
|
|
923
923
|
return {
|
|
924
924
|
ownerAddress: dappWalletClient.account.address,
|
|
925
925
|
walletClient: dappWalletClient,
|
|
926
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
926
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkDX2D2TRZcjs.getPublicClient.call(void 0, sourceChain))),
|
|
927
927
|
switchChain: dappSwitchChain
|
|
928
928
|
};
|
|
929
929
|
}
|
|
@@ -980,7 +980,7 @@ function WithdrawFlow({
|
|
|
980
980
|
const setup = await service.setupAccount({
|
|
981
981
|
ownerAddress,
|
|
982
982
|
sessionOwnerAddress: sessionOwner.address,
|
|
983
|
-
targetChain:
|
|
983
|
+
targetChain: _chunkDX2D2TRZcjs.toEvmCaip2.call(void 0, targetChain),
|
|
984
984
|
targetToken,
|
|
985
985
|
recipient: recipientForRegistration,
|
|
986
986
|
signerAddress,
|
|
@@ -1005,7 +1005,7 @@ function WithdrawFlow({
|
|
|
1005
1005
|
message: typedData.message
|
|
1006
1006
|
});
|
|
1007
1007
|
if (cancelled) return;
|
|
1008
|
-
const sessionDetails =
|
|
1008
|
+
const sessionDetails = _chunkDX2D2TRZcjs.buildSessionDetails.call(void 0,
|
|
1009
1009
|
setup.sessionDetailsUnsigned,
|
|
1010
1010
|
signature
|
|
1011
1011
|
);
|
|
@@ -1019,7 +1019,7 @@ function WithdrawFlow({
|
|
|
1019
1019
|
eoaAddress: ownerAddress,
|
|
1020
1020
|
sessionOwner: sessionOwner.address,
|
|
1021
1021
|
target: {
|
|
1022
|
-
chain:
|
|
1022
|
+
chain: _chunkDX2D2TRZcjs.toEvmCaip2.call(void 0, targetChain),
|
|
1023
1023
|
token: targetToken,
|
|
1024
1024
|
recipient: recipientForRegistration
|
|
1025
1025
|
}
|
|
@@ -1042,7 +1042,7 @@ function WithdrawFlow({
|
|
|
1042
1042
|
} catch (err) {
|
|
1043
1043
|
if (cancelled) return;
|
|
1044
1044
|
const raw = err instanceof Error ? err.message : "Registration failed";
|
|
1045
|
-
const message =
|
|
1045
|
+
const message = _chunkDX2D2TRZcjs.formatUserError.call(void 0, raw);
|
|
1046
1046
|
logFlowError("auto-register:failed", err, {
|
|
1047
1047
|
ownerAddress,
|
|
1048
1048
|
targetChain,
|
|
@@ -1078,7 +1078,7 @@ function WithdrawFlow({
|
|
|
1078
1078
|
const symbol = _chunkIVTXEYB2cjs.getTokenSymbol.call(void 0, sourceToken, sourceChain);
|
|
1079
1079
|
const decimals = _chunkIVTXEYB2cjs.getTokenDecimalsByAddress.call(void 0, sourceToken, sourceChain);
|
|
1080
1080
|
return {
|
|
1081
|
-
id:
|
|
1081
|
+
id: _chunkDX2D2TRZcjs.getAssetId.call(void 0, { chainId: sourceChain, token: sourceToken }),
|
|
1082
1082
|
chainId: sourceChain,
|
|
1083
1083
|
token: sourceToken,
|
|
1084
1084
|
symbol,
|
|
@@ -1186,7 +1186,7 @@ function WithdrawFlow({
|
|
|
1186
1186
|
targetToken
|
|
1187
1187
|
});
|
|
1188
1188
|
const amountUnits = _viem.parseUnits.call(void 0, amountValue, asset.decimals);
|
|
1189
|
-
const pc = _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess', _44 => _44.publicClient]), () => (
|
|
1189
|
+
const pc = _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess', _44 => _44.publicClient]), () => ( _chunkDX2D2TRZcjs.getPublicClient.call(void 0, sourceChain)));
|
|
1190
1190
|
let result;
|
|
1191
1191
|
if (onSignTransaction) {
|
|
1192
1192
|
const transferTarget = isSameRoute ? recipient : smartAccount;
|
|
@@ -1199,7 +1199,7 @@ function WithdrawFlow({
|
|
|
1199
1199
|
args: [transferTarget, amountUnits]
|
|
1200
1200
|
})
|
|
1201
1201
|
};
|
|
1202
|
-
const request = await
|
|
1202
|
+
const request = await _chunkDX2D2TRZcjs.buildSafeTransaction.call(void 0, {
|
|
1203
1203
|
publicClient: pc,
|
|
1204
1204
|
safeAddress,
|
|
1205
1205
|
to: transferData.to,
|
|
@@ -1210,7 +1210,7 @@ function WithdrawFlow({
|
|
|
1210
1210
|
const { signature } = await onSignTransaction(request);
|
|
1211
1211
|
const relayResult = await service.relayWithdraw({
|
|
1212
1212
|
smartAccount,
|
|
1213
|
-
chainId:
|
|
1213
|
+
chainId: _chunkDX2D2TRZcjs.toEvmCaip2.call(void 0, sourceChain),
|
|
1214
1214
|
safeAddress,
|
|
1215
1215
|
safeTransaction: request.typedData.message,
|
|
1216
1216
|
signature
|
|
@@ -1220,7 +1220,7 @@ function WithdrawFlow({
|
|
|
1220
1220
|
}
|
|
1221
1221
|
result = { txHash: relayResult.txHash };
|
|
1222
1222
|
} else if (isSourceNative) {
|
|
1223
|
-
result = await
|
|
1223
|
+
result = await _chunkDX2D2TRZcjs.executeSafeEthTransfer.call(void 0, {
|
|
1224
1224
|
walletClient: signerContext.walletClient,
|
|
1225
1225
|
publicClient: pc,
|
|
1226
1226
|
safeAddress,
|
|
@@ -1229,7 +1229,7 @@ function WithdrawFlow({
|
|
|
1229
1229
|
chainId: sourceChain
|
|
1230
1230
|
});
|
|
1231
1231
|
} else {
|
|
1232
|
-
result = await
|
|
1232
|
+
result = await _chunkDX2D2TRZcjs.executeSafeErc20Transfer.call(void 0, {
|
|
1233
1233
|
walletClient: signerContext.walletClient,
|
|
1234
1234
|
publicClient: pc,
|
|
1235
1235
|
safeAddress,
|
|
@@ -1262,7 +1262,7 @@ function WithdrawFlow({
|
|
|
1262
1262
|
targetChain,
|
|
1263
1263
|
targetToken
|
|
1264
1264
|
});
|
|
1265
|
-
handleError(
|
|
1265
|
+
handleError(_chunkDX2D2TRZcjs.formatUserError.call(void 0, raw), "WITHDRAW_FLOW_ERROR");
|
|
1266
1266
|
throw err;
|
|
1267
1267
|
}
|
|
1268
1268
|
},
|
|
@@ -1397,7 +1397,7 @@ function WithdrawFlow({
|
|
|
1397
1397
|
state: "ready"
|
|
1398
1398
|
}));
|
|
1399
1399
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1400
|
-
|
|
1400
|
+
_chunkDX2D2TRZcjs.ConnectStep,
|
|
1401
1401
|
{
|
|
1402
1402
|
walletRows: withdrawRows,
|
|
1403
1403
|
onConfirmWallet: (walletId) => {
|
|
@@ -1415,7 +1415,7 @@ function WithdrawFlow({
|
|
|
1415
1415
|
if (!signerContext) return null;
|
|
1416
1416
|
if (!onSignTransaction && !signerContext.walletClient) return null;
|
|
1417
1417
|
const resolvedConnectedRecipient = _optionalChain([selectedWalletOption, 'optionalAccess', _61 => _61.kind]) === "external" ? selectedWalletOption.address : void 0;
|
|
1418
|
-
const formPublicClient = _nullishCoalesce(signerContext.publicClient, () => (
|
|
1418
|
+
const formPublicClient = _nullishCoalesce(signerContext.publicClient, () => ( _chunkDX2D2TRZcjs.getPublicClient.call(void 0, sourceChain)));
|
|
1419
1419
|
const stepView = deriveStepView(flowStep, registration);
|
|
1420
1420
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
1421
1421
|
stepView === "form" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -1459,7 +1459,7 @@ function WithdrawFlow({
|
|
|
1459
1459
|
}
|
|
1460
1460
|
),
|
|
1461
1461
|
stepView === "processing" && registration.kind !== "idle" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1462
|
-
|
|
1462
|
+
_chunkDX2D2TRZcjs.ProcessingStep,
|
|
1463
1463
|
{
|
|
1464
1464
|
smartAccount: registration.kind === "ready" || registration.kind === "stale" ? registration.smartAccount : "0x0",
|
|
1465
1465
|
txHash: _nullishCoalesce(storeApi.getState().txHash, () => ( "0x0")),
|
|
@@ -1493,7 +1493,7 @@ function deriveStepView(step, _registration) {
|
|
|
1493
1493
|
// src/WithdrawModal.tsx
|
|
1494
1494
|
|
|
1495
1495
|
var ReownWithdrawInner = _react.lazy.call(void 0,
|
|
1496
|
-
() => Promise.resolve().then(() => _interopRequireWildcard(require("./WithdrawModalReown-
|
|
1496
|
+
() => Promise.resolve().then(() => _interopRequireWildcard(require("./WithdrawModalReown-4B6IMTBB.cjs"))).then((m) => ({
|
|
1497
1497
|
default: m.WithdrawModalReown
|
|
1498
1498
|
}))
|
|
1499
1499
|
);
|
|
@@ -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 = _chunkDX2D2TRZcjs.useLatestRef.call(void 0, onReady);
|
|
1545
1545
|
const [backHandler, setBackHandler] = _react.useState.call(void 0,
|
|
1546
1546
|
void 0
|
|
1547
1547
|
);
|
|
1548
1548
|
const targetChain = _chunkIVTXEYB2cjs.getChainId.call(void 0, targetChainProp);
|
|
1549
1549
|
const sourceChain = _chunkIVTXEYB2cjs.getChainId.call(void 0, sourceChainProp);
|
|
1550
1550
|
const service = _react.useMemo.call(void 0,
|
|
1551
|
-
() =>
|
|
1551
|
+
() => _chunkDX2D2TRZcjs.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 = _chunkDX2D2TRZcjs.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
|
+
_chunkDX2D2TRZcjs.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
|
+
_chunkDX2D2TRZcjs.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, _chunkDX2D2TRZcjs.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, _chunkDX2D2TRZcjs.CloseIcon, {})
|
|
1612
1612
|
}
|
|
1613
1613
|
) })
|
|
1614
1614
|
] }),
|