@rhinestone/deposit-modal 0.3.0-alpha.9 → 0.3.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/README.md +76 -0
- package/dist/{DepositModalReown-I7I3KLD2.mjs → DepositModalReown-6SUEC5IU.mjs} +4 -4
- package/dist/{DepositModalReown-XUA47RYZ.cjs → DepositModalReown-DNW4GH6L.cjs} +7 -7
- package/dist/{QRCode-KG47KTGX.cjs → QRCode-5DXFNKI2.cjs} +1 -1
- package/dist/{QRCode-YJ3EGWQS.mjs → QRCode-WUC652SH.mjs} +1 -1
- package/dist/{WithdrawModalReown-KN2DGOXR.mjs → WithdrawModalReown-7UAGSOSU.mjs} +4 -4
- package/dist/{WithdrawModalReown-JATYMQYP.cjs → WithdrawModalReown-OUWBSKSM.cjs} +7 -7
- package/dist/{constants-DqVn968d.d.ts → caip-CrQ2KKU-.d.cts} +11 -1
- package/dist/{constants-DqVn968d.d.cts → caip-CrQ2KKU-.d.ts} +11 -1
- package/dist/{chunk-G5Q4QBWX.cjs → chunk-2SMS542Q.cjs} +109 -102
- package/dist/{chunk-KIPKYPNF.cjs → chunk-33H6O5UU.cjs} +6 -16
- package/dist/{chunk-SZIYS42B.mjs → chunk-6YRDD462.mjs} +63 -3
- package/dist/{chunk-OISMGA2L.mjs → chunk-GPSBM66J.mjs} +2 -12
- package/dist/{chunk-TJG2AFPS.mjs → chunk-KAWJABTW.mjs} +1048 -540
- package/dist/{chunk-4BUMVXPS.mjs → chunk-KJ2RR2D4.mjs} +1829 -584
- package/dist/{chunk-7JIDIX27.cjs → chunk-MILJQWPT.cjs} +73 -13
- package/dist/{chunk-MMXUBBGK.cjs → chunk-RABZINV3.cjs} +1032 -524
- package/dist/{chunk-KE4MRCFN.mjs → chunk-TKQYTBU6.mjs} +21 -14
- package/dist/{chunk-ZVG4JDKZ.cjs → chunk-VVJAIMKB.cjs} +1881 -636
- package/dist/constants.cjs +6 -2
- package/dist/constants.d.cts +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.mjs +5 -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 +19 -6
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +20 -7
- package/dist/styles.css +685 -75
- package/dist/{types-D8Q4TMk7.d.cts → types-BMcGO5k_.d.cts} +56 -2
- package/dist/{types-D8Q4TMk7.d.ts → types-BMcGO5k_.d.ts} +56 -2
- 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 +41 -17
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
|
|
33
|
+
var _chunkRABZINV3cjs = require('./chunk-RABZINV3.cjs');
|
|
33
34
|
|
|
34
|
-
var _chunkMMXUBBGKcjs = require('./chunk-MMXUBBGK.cjs');
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
|
|
@@ -44,7 +44,7 @@ var _chunkMMXUBBGKcjs = require('./chunk-MMXUBBGK.cjs');
|
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
|
|
47
|
-
var
|
|
47
|
+
var _chunkMILJQWPTcjs = require('./chunk-MILJQWPT.cjs');
|
|
48
48
|
|
|
49
49
|
// src/WithdrawModal.tsx
|
|
50
50
|
|
|
@@ -60,7 +60,7 @@ var _react = require('react');
|
|
|
60
60
|
// src/WithdrawFlow.tsx
|
|
61
61
|
|
|
62
62
|
|
|
63
|
-
// src/store/withdraw.
|
|
63
|
+
// src/store/withdraw.ts
|
|
64
64
|
|
|
65
65
|
var _zustand = require('zustand');
|
|
66
66
|
var _vanilla = require('zustand/vanilla');
|
|
@@ -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 = _chunkMILJQWPTcjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
239
|
+
const targetChainName = _chunkMILJQWPTcjs.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(_chunkRABZINV3cjs.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 = _chunkRABZINV3cjs.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(_chunkRABZINV3cjs.formatUserError.call(void 0, raw));
|
|
383
383
|
} finally {
|
|
384
384
|
setIsSubmitting(false);
|
|
385
385
|
}
|
|
@@ -387,22 +387,30 @@ 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, _chunkRABZINV3cjs.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 ${_chunkMILJQWPTcjs.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, _chunkRABZINV3cjs.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, _chunkRABZINV3cjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRABZINV3cjs.CircleArrowOutUpLeftIcon, {}), title: "Withdraw" }),
|
|
400
400
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-section", children: [
|
|
401
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
401
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
402
|
+
"label",
|
|
403
|
+
{
|
|
404
|
+
className: "rs-withdraw-label",
|
|
405
|
+
htmlFor: "rs-withdraw-recipient",
|
|
406
|
+
children: "Recipient address"
|
|
407
|
+
}
|
|
408
|
+
),
|
|
402
409
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-input-row", children: [
|
|
403
410
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
404
411
|
"input",
|
|
405
412
|
{
|
|
413
|
+
id: "rs-withdraw-recipient",
|
|
406
414
|
type: "text",
|
|
407
415
|
className: "rs-withdraw-input rs-withdraw-input--address",
|
|
408
416
|
placeholder: "0x...",
|
|
@@ -434,7 +442,7 @@ function WithdrawFormStep({
|
|
|
434
442
|
),
|
|
435
443
|
isRecipientConnected ? null : "Use connected"
|
|
436
444
|
] }) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
437
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
445
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRABZINV3cjs.WalletIcon, { className: "rs-withdraw-use-connected-icon" }),
|
|
438
446
|
isRecipientConnected ? null : "Use connected"
|
|
439
447
|
] })
|
|
440
448
|
}
|
|
@@ -442,11 +450,12 @@ function WithdrawFormStep({
|
|
|
442
450
|
] })
|
|
443
451
|
] }),
|
|
444
452
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-section", children: [
|
|
445
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "label", { className: "rs-withdraw-label", children: "Amount" }),
|
|
453
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "label", { className: "rs-withdraw-label", htmlFor: "rs-withdraw-amount", children: "Amount" }),
|
|
446
454
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-input-row", children: [
|
|
447
455
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
448
456
|
"input",
|
|
449
457
|
{
|
|
458
|
+
id: "rs-withdraw-amount",
|
|
450
459
|
type: "text",
|
|
451
460
|
inputMode: "decimal",
|
|
452
461
|
className: "rs-withdraw-input rs-withdraw-input--amount",
|
|
@@ -473,7 +482,7 @@ function WithdrawFormStep({
|
|
|
473
482
|
) })
|
|
474
483
|
] }),
|
|
475
484
|
/* @__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 ?
|
|
485
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-withdraw-usd", children: amountUsd !== null ? _chunkRABZINV3cjs.currencyFormatter.format(amountUsd) : "$0.00" }),
|
|
477
486
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-withdraw-balance", children: [
|
|
478
487
|
"Balance: ",
|
|
479
488
|
formattedBalance,
|
|
@@ -484,7 +493,7 @@ function WithdrawFormStep({
|
|
|
484
493
|
] }),
|
|
485
494
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-receive-row", children: [
|
|
486
495
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-receive-col", children: [
|
|
487
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "
|
|
496
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-withdraw-label rs-withdraw-label--sm", children: "Receive chain" }),
|
|
488
497
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
489
498
|
"div",
|
|
490
499
|
{
|
|
@@ -495,6 +504,7 @@ function WithdrawFormStep({
|
|
|
495
504
|
"button",
|
|
496
505
|
{
|
|
497
506
|
type: "button",
|
|
507
|
+
"aria-label": "Receive chain",
|
|
498
508
|
className: "rs-withdraw-dropdown",
|
|
499
509
|
onClick: () => {
|
|
500
510
|
setShowChainDropdown(!showChainDropdown);
|
|
@@ -502,10 +512,10 @@ function WithdrawFormStep({
|
|
|
502
512
|
},
|
|
503
513
|
children: [
|
|
504
514
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-dropdown-value", children: [
|
|
505
|
-
|
|
515
|
+
_chunkMILJQWPTcjs.getChainIcon.call(void 0, targetChain) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
506
516
|
"img",
|
|
507
517
|
{
|
|
508
|
-
src:
|
|
518
|
+
src: _chunkMILJQWPTcjs.getChainIcon.call(void 0, targetChain),
|
|
509
519
|
alt: targetChainName,
|
|
510
520
|
className: "rs-withdraw-dropdown-icon"
|
|
511
521
|
}
|
|
@@ -513,7 +523,7 @@ function WithdrawFormStep({
|
|
|
513
523
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: targetChainName })
|
|
514
524
|
] }),
|
|
515
525
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
516
|
-
|
|
526
|
+
_chunkRABZINV3cjs.ChevronDownIcon,
|
|
517
527
|
{
|
|
518
528
|
className: "rs-withdraw-dropdown-arrow",
|
|
519
529
|
style: {
|
|
@@ -534,10 +544,10 @@ function WithdrawFormStep({
|
|
|
534
544
|
setShowChainDropdown(false);
|
|
535
545
|
},
|
|
536
546
|
children: [
|
|
537
|
-
|
|
547
|
+
_chunkMILJQWPTcjs.getChainIcon.call(void 0, chain.id) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
538
548
|
"img",
|
|
539
549
|
{
|
|
540
|
-
src:
|
|
550
|
+
src: _chunkMILJQWPTcjs.getChainIcon.call(void 0, chain.id),
|
|
541
551
|
alt: chain.name,
|
|
542
552
|
className: "rs-withdraw-dropdown-icon"
|
|
543
553
|
}
|
|
@@ -552,7 +562,7 @@ function WithdrawFormStep({
|
|
|
552
562
|
)
|
|
553
563
|
] }),
|
|
554
564
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-receive-col", children: [
|
|
555
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "
|
|
565
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-withdraw-label rs-withdraw-label--sm", children: "Receive token" }),
|
|
556
566
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
557
567
|
"div",
|
|
558
568
|
{
|
|
@@ -563,6 +573,7 @@ function WithdrawFormStep({
|
|
|
563
573
|
"button",
|
|
564
574
|
{
|
|
565
575
|
type: "button",
|
|
576
|
+
"aria-label": "Receive token",
|
|
566
577
|
className: "rs-withdraw-dropdown",
|
|
567
578
|
onClick: () => {
|
|
568
579
|
setShowTokenDropdown(!showTokenDropdown);
|
|
@@ -570,10 +581,10 @@ function WithdrawFormStep({
|
|
|
570
581
|
},
|
|
571
582
|
children: [
|
|
572
583
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-dropdown-value", children: [
|
|
573
|
-
|
|
584
|
+
_chunkMILJQWPTcjs.getTokenIcon.call(void 0, targetSymbol) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
574
585
|
"img",
|
|
575
586
|
{
|
|
576
|
-
src:
|
|
587
|
+
src: _chunkMILJQWPTcjs.getTokenIcon.call(void 0, targetSymbol),
|
|
577
588
|
alt: targetSymbol,
|
|
578
589
|
className: "rs-withdraw-dropdown-icon"
|
|
579
590
|
}
|
|
@@ -581,7 +592,7 @@ function WithdrawFormStep({
|
|
|
581
592
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: targetSymbol })
|
|
582
593
|
] }),
|
|
583
594
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
584
|
-
|
|
595
|
+
_chunkRABZINV3cjs.ChevronDownIcon,
|
|
585
596
|
{
|
|
586
597
|
className: "rs-withdraw-dropdown-arrow",
|
|
587
598
|
style: {
|
|
@@ -602,10 +613,10 @@ function WithdrawFormStep({
|
|
|
602
613
|
setShowTokenDropdown(false);
|
|
603
614
|
},
|
|
604
615
|
children: [
|
|
605
|
-
|
|
616
|
+
_chunkMILJQWPTcjs.getTokenIcon.call(void 0, option.symbol) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
606
617
|
"img",
|
|
607
618
|
{
|
|
608
|
-
src:
|
|
619
|
+
src: _chunkMILJQWPTcjs.getTokenIcon.call(void 0, option.symbol),
|
|
609
620
|
alt: option.symbol,
|
|
610
621
|
className: "rs-withdraw-dropdown-icon"
|
|
611
622
|
}
|
|
@@ -620,11 +631,11 @@ function WithdrawFormStep({
|
|
|
620
631
|
)
|
|
621
632
|
] })
|
|
622
633
|
] }),
|
|
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 ${
|
|
624
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
625
|
-
!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 ${_chunkMILJQWPTcjs.getChainName.call(void 0, asset.chainId)}...` : `Switch to ${_chunkMILJQWPTcjs.getChainName.call(void 0, asset.chainId)} to continue.` }) }),
|
|
635
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRABZINV3cjs.Callout, { variant: "error", children: error }),
|
|
636
|
+
!error && registrationError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRABZINV3cjs.Callout, { variant: "error", children: registrationError }),
|
|
626
637
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
627
|
-
|
|
638
|
+
_chunkRABZINV3cjs.Button,
|
|
628
639
|
{
|
|
629
640
|
onClick: handleWithdraw,
|
|
630
641
|
fullWidth: true,
|
|
@@ -634,7 +645,7 @@ function WithdrawFormStep({
|
|
|
634
645
|
}
|
|
635
646
|
)
|
|
636
647
|
] }),
|
|
637
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
648
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRABZINV3cjs.PoweredBy, {})
|
|
638
649
|
] });
|
|
639
650
|
}
|
|
640
651
|
WithdrawFormStep.displayName = "WithdrawFormStep";
|
|
@@ -660,13 +671,13 @@ function WithdrawReviewStep({
|
|
|
660
671
|
}) {
|
|
661
672
|
const [isSubmitting, setIsSubmitting] = _react.useState.call(void 0, false);
|
|
662
673
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
663
|
-
const sourceChainName =
|
|
664
|
-
const sourceChainIcon =
|
|
665
|
-
const targetSymbol =
|
|
666
|
-
const targetChainName =
|
|
667
|
-
const targetChainIcon =
|
|
668
|
-
const sourceTokenIcon =
|
|
669
|
-
const targetTokenIcon =
|
|
674
|
+
const sourceChainName = _chunkMILJQWPTcjs.getChainName.call(void 0, sourceChain);
|
|
675
|
+
const sourceChainIcon = _chunkMILJQWPTcjs.getChainIcon.call(void 0, sourceChain);
|
|
676
|
+
const targetSymbol = _chunkMILJQWPTcjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
677
|
+
const targetChainName = _chunkMILJQWPTcjs.getChainName.call(void 0, targetChain);
|
|
678
|
+
const targetChainIcon = _chunkMILJQWPTcjs.getChainIcon.call(void 0, targetChain);
|
|
679
|
+
const sourceTokenIcon = _chunkMILJQWPTcjs.getTokenIcon.call(void 0, sourceSymbol);
|
|
680
|
+
const targetTokenIcon = _chunkMILJQWPTcjs.getTokenIcon.call(void 0, targetSymbol);
|
|
670
681
|
const handleConfirm = async () => {
|
|
671
682
|
setError(null);
|
|
672
683
|
setIsSubmitting(true);
|
|
@@ -674,7 +685,7 @@ function WithdrawReviewStep({
|
|
|
674
685
|
await onConfirm();
|
|
675
686
|
} catch (err) {
|
|
676
687
|
const raw = err instanceof Error ? err.message : "Withdraw failed";
|
|
677
|
-
const message =
|
|
688
|
+
const message = _chunkRABZINV3cjs.formatUserError.call(void 0, raw);
|
|
678
689
|
setError(message);
|
|
679
690
|
_optionalChain([onError, 'optionalCall', _8 => _8(message, "WITHDRAW_REVIEW_ERROR")]);
|
|
680
691
|
} finally {
|
|
@@ -685,9 +696,9 @@ function WithdrawReviewStep({
|
|
|
685
696
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
686
697
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
687
698
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
688
|
-
|
|
699
|
+
_chunkRABZINV3cjs.BodyHeader,
|
|
689
700
|
{
|
|
690
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
701
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRABZINV3cjs.CircleArrowOutUpLeftIcon, {}),
|
|
691
702
|
title: "Review withdrawal"
|
|
692
703
|
}
|
|
693
704
|
),
|
|
@@ -737,10 +748,10 @@ function WithdrawReviewStep({
|
|
|
737
748
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-value", children: estimatedTime })
|
|
738
749
|
] })
|
|
739
750
|
] }),
|
|
740
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
741
|
-
!error && registrationError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
751
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRABZINV3cjs.Callout, { variant: "error", children: error }),
|
|
752
|
+
!error && registrationError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRABZINV3cjs.Callout, { variant: "error", children: registrationError }),
|
|
742
753
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
743
|
-
|
|
754
|
+
_chunkRABZINV3cjs.Button,
|
|
744
755
|
{
|
|
745
756
|
onClick: handleConfirm,
|
|
746
757
|
loading: isSubmitting,
|
|
@@ -751,7 +762,7 @@ function WithdrawReviewStep({
|
|
|
751
762
|
}
|
|
752
763
|
)
|
|
753
764
|
] }),
|
|
754
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
765
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRABZINV3cjs.PoweredBy, {})
|
|
755
766
|
] });
|
|
756
767
|
}
|
|
757
768
|
WithdrawReviewStep.displayName = "WithdrawReviewStep";
|
|
@@ -762,15 +773,15 @@ WithdrawReviewStep.displayName = "WithdrawReviewStep";
|
|
|
762
773
|
var ADDR_REGEX = /^0x[a-fA-F0-9]{40}$/;
|
|
763
774
|
var REGISTRATION_DEBOUNCE_MS = 600;
|
|
764
775
|
function resolveSessionOwner(eoaAddress) {
|
|
765
|
-
const localOwner =
|
|
776
|
+
const localOwner = _chunkRABZINV3cjs.loadSessionOwnerFromStorage.call(void 0, eoaAddress);
|
|
766
777
|
if (localOwner) {
|
|
767
778
|
return {
|
|
768
|
-
account:
|
|
779
|
+
account: _chunkRABZINV3cjs.accountFromPrivateKey.call(void 0, localOwner.privateKey),
|
|
769
780
|
address: localOwner.address
|
|
770
781
|
};
|
|
771
782
|
}
|
|
772
|
-
const created =
|
|
773
|
-
|
|
783
|
+
const created = _chunkRABZINV3cjs.createSessionOwnerKey.call(void 0, );
|
|
784
|
+
_chunkRABZINV3cjs.saveSessionOwnerToStorage.call(void 0, eoaAddress, created.privateKey, created.address);
|
|
774
785
|
return { account: created.account, address: created.address };
|
|
775
786
|
}
|
|
776
787
|
function targetsEqual(a, b) {
|
|
@@ -790,10 +801,9 @@ function WithdrawFlow({
|
|
|
790
801
|
amount: defaultAmount,
|
|
791
802
|
service,
|
|
792
803
|
allowedRoutes,
|
|
793
|
-
signerAddress =
|
|
804
|
+
signerAddress = _chunkMILJQWPTcjs.DEFAULT_SIGNER_ADDRESS,
|
|
794
805
|
sessionChainIds,
|
|
795
806
|
forceRegister = false,
|
|
796
|
-
waitForFinalTx = true,
|
|
797
807
|
reownWallet,
|
|
798
808
|
onConnect,
|
|
799
809
|
onDisconnect,
|
|
@@ -806,19 +816,19 @@ function WithdrawFlow({
|
|
|
806
816
|
onError,
|
|
807
817
|
debug
|
|
808
818
|
}) {
|
|
809
|
-
const onStepChangeRef =
|
|
810
|
-
const onEventRef =
|
|
811
|
-
const onLifecycleRef =
|
|
812
|
-
const onErrorRef =
|
|
819
|
+
const onStepChangeRef = _chunkRABZINV3cjs.useLatestRef.call(void 0, onStepChange);
|
|
820
|
+
const onEventRef = _chunkRABZINV3cjs.useLatestRef.call(void 0, onEvent);
|
|
821
|
+
const onLifecycleRef = _chunkRABZINV3cjs.useLatestRef.call(void 0, onLifecycle);
|
|
822
|
+
const onErrorRef = _chunkRABZINV3cjs.useLatestRef.call(void 0, onError);
|
|
813
823
|
const logFlow = _react.useCallback.call(void 0,
|
|
814
824
|
(message, data) => {
|
|
815
|
-
|
|
825
|
+
_chunkRABZINV3cjs.debugLog.call(void 0, debug, "withdraw-flow", message, data);
|
|
816
826
|
},
|
|
817
827
|
[debug]
|
|
818
828
|
);
|
|
819
829
|
const logFlowError = _react.useCallback.call(void 0,
|
|
820
830
|
(message, error, data) => {
|
|
821
|
-
|
|
831
|
+
_chunkRABZINV3cjs.debugError.call(void 0, debug, "withdraw-flow", message, error, data);
|
|
822
832
|
},
|
|
823
833
|
[debug]
|
|
824
834
|
);
|
|
@@ -893,14 +903,14 @@ function WithdrawFlow({
|
|
|
893
903
|
return {
|
|
894
904
|
ownerAddress: dappAddress,
|
|
895
905
|
walletClient: _nullishCoalesce(dappWalletClient, () => ( void 0)),
|
|
896
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
906
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkRABZINV3cjs.getPublicClient.call(void 0, sourceChain))),
|
|
897
907
|
switchChain: dappSwitchChain
|
|
898
908
|
};
|
|
899
909
|
}
|
|
900
910
|
return {
|
|
901
911
|
ownerAddress: dappWalletClient.account.address,
|
|
902
912
|
walletClient: dappWalletClient,
|
|
903
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
913
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkRABZINV3cjs.getPublicClient.call(void 0, sourceChain))),
|
|
904
914
|
switchChain: dappSwitchChain
|
|
905
915
|
};
|
|
906
916
|
}
|
|
@@ -911,7 +921,7 @@ function WithdrawFlow({
|
|
|
911
921
|
return {
|
|
912
922
|
ownerAddress: dappWalletClient.account.address,
|
|
913
923
|
walletClient: dappWalletClient,
|
|
914
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
924
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkRABZINV3cjs.getPublicClient.call(void 0, sourceChain))),
|
|
915
925
|
switchChain: dappSwitchChain
|
|
916
926
|
};
|
|
917
927
|
}
|
|
@@ -968,7 +978,7 @@ function WithdrawFlow({
|
|
|
968
978
|
const setup = await service.setupAccount({
|
|
969
979
|
ownerAddress,
|
|
970
980
|
sessionOwnerAddress: sessionOwner.address,
|
|
971
|
-
targetChain:
|
|
981
|
+
targetChain: _chunkMILJQWPTcjs.toEvmCaip2.call(void 0, targetChain),
|
|
972
982
|
targetToken,
|
|
973
983
|
recipient: recipientForRegistration,
|
|
974
984
|
signerAddress,
|
|
@@ -993,7 +1003,7 @@ function WithdrawFlow({
|
|
|
993
1003
|
message: typedData.message
|
|
994
1004
|
});
|
|
995
1005
|
if (cancelled) return;
|
|
996
|
-
const sessionDetails =
|
|
1006
|
+
const sessionDetails = _chunkRABZINV3cjs.buildSessionDetails.call(void 0,
|
|
997
1007
|
setup.sessionDetailsUnsigned,
|
|
998
1008
|
signature
|
|
999
1009
|
);
|
|
@@ -1007,7 +1017,7 @@ function WithdrawFlow({
|
|
|
1007
1017
|
eoaAddress: ownerAddress,
|
|
1008
1018
|
sessionOwner: sessionOwner.address,
|
|
1009
1019
|
target: {
|
|
1010
|
-
chain:
|
|
1020
|
+
chain: _chunkMILJQWPTcjs.toEvmCaip2.call(void 0, targetChain),
|
|
1011
1021
|
token: targetToken,
|
|
1012
1022
|
recipient: recipientForRegistration
|
|
1013
1023
|
}
|
|
@@ -1030,7 +1040,7 @@ function WithdrawFlow({
|
|
|
1030
1040
|
} catch (err) {
|
|
1031
1041
|
if (cancelled) return;
|
|
1032
1042
|
const raw = err instanceof Error ? err.message : "Registration failed";
|
|
1033
|
-
const message =
|
|
1043
|
+
const message = _chunkRABZINV3cjs.formatUserError.call(void 0, raw);
|
|
1034
1044
|
logFlowError("auto-register:failed", err, {
|
|
1035
1045
|
ownerAddress,
|
|
1036
1046
|
targetChain,
|
|
@@ -1063,10 +1073,10 @@ function WithdrawFlow({
|
|
|
1063
1073
|
onErrorRef
|
|
1064
1074
|
]);
|
|
1065
1075
|
const asset = _react.useMemo.call(void 0, () => {
|
|
1066
|
-
const symbol =
|
|
1067
|
-
const decimals =
|
|
1076
|
+
const symbol = _chunkMILJQWPTcjs.getTokenSymbol.call(void 0, sourceToken, sourceChain);
|
|
1077
|
+
const decimals = _chunkMILJQWPTcjs.getTokenDecimalsByAddress.call(void 0, sourceToken, sourceChain);
|
|
1068
1078
|
return {
|
|
1069
|
-
id:
|
|
1079
|
+
id: _chunkRABZINV3cjs.getAssetId.call(void 0, { chainId: sourceChain, token: sourceToken }),
|
|
1070
1080
|
chainId: sourceChain,
|
|
1071
1081
|
token: sourceToken,
|
|
1072
1082
|
symbol,
|
|
@@ -1074,7 +1084,7 @@ function WithdrawFlow({
|
|
|
1074
1084
|
decimals
|
|
1075
1085
|
};
|
|
1076
1086
|
}, [sourceChain, sourceToken]);
|
|
1077
|
-
const isSourceNative = sourceToken.toLowerCase() ===
|
|
1087
|
+
const isSourceNative = sourceToken.toLowerCase() === _chunkMILJQWPTcjs.NATIVE_TOKEN_ADDRESS.toLowerCase();
|
|
1078
1088
|
const isSameRoute = targetChain === sourceChain && targetToken.toLowerCase() === sourceToken.toLowerCase();
|
|
1079
1089
|
const reviewBackHandler = _react.useCallback.call(void 0, () => {
|
|
1080
1090
|
storeApi.dispatch({ type: "review/back" });
|
|
@@ -1092,8 +1102,8 @@ function WithdrawFlow({
|
|
|
1092
1102
|
}
|
|
1093
1103
|
if (lastStepOpenEventKeyRef.current === "form") return;
|
|
1094
1104
|
lastStepOpenEventKeyRef.current = "form";
|
|
1095
|
-
const tokenSymbol =
|
|
1096
|
-
const chainName =
|
|
1105
|
+
const tokenSymbol = _chunkMILJQWPTcjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
1106
|
+
const chainName = _chunkMILJQWPTcjs.getChainName.call(void 0, targetChain);
|
|
1097
1107
|
_optionalChain([onEventRef, 'access', _37 => _37.current, 'optionalCall', _38 => _38({
|
|
1098
1108
|
type: "withdraw_modal_select_amount_open",
|
|
1099
1109
|
pred_balance: totalBalanceUsd,
|
|
@@ -1130,8 +1140,8 @@ function WithdrawFlow({
|
|
|
1130
1140
|
);
|
|
1131
1141
|
const handleFormContinue = _react.useCallback.call(void 0,
|
|
1132
1142
|
(recipient, amountValue) => {
|
|
1133
|
-
const tokenSymbol =
|
|
1134
|
-
const chainName =
|
|
1143
|
+
const tokenSymbol = _chunkMILJQWPTcjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
1144
|
+
const chainName = _chunkMILJQWPTcjs.getChainName.call(void 0, targetChain);
|
|
1135
1145
|
_optionalChain([onEventRef, 'access', _41 => _41.current, 'optionalCall', _42 => _42({
|
|
1136
1146
|
type: "withdraw_modal_select_amount_cta_click",
|
|
1137
1147
|
pred_balance: totalBalanceUsd,
|
|
@@ -1174,7 +1184,7 @@ function WithdrawFlow({
|
|
|
1174
1184
|
targetToken
|
|
1175
1185
|
});
|
|
1176
1186
|
const amountUnits = _viem.parseUnits.call(void 0, amountValue, asset.decimals);
|
|
1177
|
-
const pc = _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess', _44 => _44.publicClient]), () => (
|
|
1187
|
+
const pc = _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess', _44 => _44.publicClient]), () => ( _chunkRABZINV3cjs.getPublicClient.call(void 0, sourceChain)));
|
|
1178
1188
|
let result;
|
|
1179
1189
|
if (onSignTransaction) {
|
|
1180
1190
|
const transferTarget = isSameRoute ? recipient : smartAccount;
|
|
@@ -1187,7 +1197,7 @@ function WithdrawFlow({
|
|
|
1187
1197
|
args: [transferTarget, amountUnits]
|
|
1188
1198
|
})
|
|
1189
1199
|
};
|
|
1190
|
-
const request = await
|
|
1200
|
+
const request = await _chunkRABZINV3cjs.buildSafeTransaction.call(void 0, {
|
|
1191
1201
|
publicClient: pc,
|
|
1192
1202
|
safeAddress,
|
|
1193
1203
|
to: transferData.to,
|
|
@@ -1198,7 +1208,7 @@ function WithdrawFlow({
|
|
|
1198
1208
|
const { signature } = await onSignTransaction(request);
|
|
1199
1209
|
const relayResult = await service.relayWithdraw({
|
|
1200
1210
|
smartAccount,
|
|
1201
|
-
chainId:
|
|
1211
|
+
chainId: _chunkMILJQWPTcjs.toEvmCaip2.call(void 0, sourceChain),
|
|
1202
1212
|
safeAddress,
|
|
1203
1213
|
safeTransaction: request.typedData.message,
|
|
1204
1214
|
signature
|
|
@@ -1208,7 +1218,7 @@ function WithdrawFlow({
|
|
|
1208
1218
|
}
|
|
1209
1219
|
result = { txHash: relayResult.txHash };
|
|
1210
1220
|
} else if (isSourceNative) {
|
|
1211
|
-
result = await
|
|
1221
|
+
result = await _chunkRABZINV3cjs.executeSafeEthTransfer.call(void 0, {
|
|
1212
1222
|
walletClient: signerContext.walletClient,
|
|
1213
1223
|
publicClient: pc,
|
|
1214
1224
|
safeAddress,
|
|
@@ -1217,7 +1227,7 @@ function WithdrawFlow({
|
|
|
1217
1227
|
chainId: sourceChain
|
|
1218
1228
|
});
|
|
1219
1229
|
} else {
|
|
1220
|
-
result = await
|
|
1230
|
+
result = await _chunkRABZINV3cjs.executeSafeErc20Transfer.call(void 0, {
|
|
1221
1231
|
walletClient: signerContext.walletClient,
|
|
1222
1232
|
publicClient: pc,
|
|
1223
1233
|
safeAddress,
|
|
@@ -1250,7 +1260,7 @@ function WithdrawFlow({
|
|
|
1250
1260
|
targetChain,
|
|
1251
1261
|
targetToken
|
|
1252
1262
|
});
|
|
1253
|
-
handleError(
|
|
1263
|
+
handleError(_chunkRABZINV3cjs.formatUserError.call(void 0, raw), "WITHDRAW_FLOW_ERROR");
|
|
1254
1264
|
throw err;
|
|
1255
1265
|
}
|
|
1256
1266
|
},
|
|
@@ -1315,9 +1325,9 @@ function WithdrawFlow({
|
|
|
1315
1325
|
[_optionalChain([allowedRoutes, 'optionalAccess', _54 => _54.sourceTokens])]
|
|
1316
1326
|
);
|
|
1317
1327
|
const targetChainOptions = _react.useMemo.call(void 0, () => {
|
|
1318
|
-
return
|
|
1328
|
+
return _chunkMILJQWPTcjs.SOURCE_CHAINS.filter((chain) => {
|
|
1319
1329
|
if (allowedChainSet && !allowedChainSet.has(chain.id)) return false;
|
|
1320
|
-
const tokens =
|
|
1330
|
+
const tokens = _chunkMILJQWPTcjs.getSupportedTargetTokens.call(void 0, chain.id);
|
|
1321
1331
|
if (allowedTokenSet) {
|
|
1322
1332
|
return tokens.some((t) => allowedTokenSet.has(t.symbol.toUpperCase()));
|
|
1323
1333
|
}
|
|
@@ -1325,7 +1335,7 @@ function WithdrawFlow({
|
|
|
1325
1335
|
});
|
|
1326
1336
|
}, [allowedChainSet, allowedTokenSet]);
|
|
1327
1337
|
const targetTokenOptions = _react.useMemo.call(void 0, () => {
|
|
1328
|
-
const tokens =
|
|
1338
|
+
const tokens = _chunkMILJQWPTcjs.getSupportedTargetTokens.call(void 0, targetChain);
|
|
1329
1339
|
if (!allowedTokenSet) return tokens;
|
|
1330
1340
|
return tokens.filter((t) => allowedTokenSet.has(t.symbol.toUpperCase()));
|
|
1331
1341
|
}, [targetChain, allowedTokenSet]);
|
|
@@ -1339,7 +1349,7 @@ function WithdrawFlow({
|
|
|
1339
1349
|
const handleTargetChainChange = _react.useCallback.call(void 0,
|
|
1340
1350
|
(chainId) => {
|
|
1341
1351
|
setTargetChain(chainId);
|
|
1342
|
-
let options =
|
|
1352
|
+
let options = _chunkMILJQWPTcjs.getSupportedTargetTokens.call(void 0, chainId);
|
|
1343
1353
|
if (allowedTokenSet) {
|
|
1344
1354
|
options = options.filter(
|
|
1345
1355
|
(t) => allowedTokenSet.has(t.symbol.toUpperCase())
|
|
@@ -1389,7 +1399,7 @@ function WithdrawFlow({
|
|
|
1389
1399
|
state: "ready"
|
|
1390
1400
|
}));
|
|
1391
1401
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1392
|
-
|
|
1402
|
+
_chunkRABZINV3cjs.ConnectStep,
|
|
1393
1403
|
{
|
|
1394
1404
|
walletRows: withdrawRows,
|
|
1395
1405
|
onConfirmWallet: (walletId) => {
|
|
@@ -1407,7 +1417,7 @@ function WithdrawFlow({
|
|
|
1407
1417
|
if (!signerContext) return null;
|
|
1408
1418
|
if (!onSignTransaction && !signerContext.walletClient) return null;
|
|
1409
1419
|
const resolvedConnectedRecipient = _optionalChain([selectedWalletOption, 'optionalAccess', _61 => _61.kind]) === "external" ? selectedWalletOption.address : void 0;
|
|
1410
|
-
const formPublicClient = _nullishCoalesce(signerContext.publicClient, () => (
|
|
1420
|
+
const formPublicClient = _nullishCoalesce(signerContext.publicClient, () => ( _chunkRABZINV3cjs.getPublicClient.call(void 0, sourceChain)));
|
|
1411
1421
|
const stepView = deriveStepView(flowStep, registration);
|
|
1412
1422
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
1413
1423
|
stepView === "form" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -1451,7 +1461,7 @@ function WithdrawFlow({
|
|
|
1451
1461
|
}
|
|
1452
1462
|
),
|
|
1453
1463
|
stepView === "processing" && registration.kind !== "idle" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1454
|
-
|
|
1464
|
+
_chunkRABZINV3cjs.ProcessingStep,
|
|
1455
1465
|
{
|
|
1456
1466
|
smartAccount: registration.kind === "ready" || registration.kind === "stale" ? registration.smartAccount : "0x0",
|
|
1457
1467
|
txHash: _nullishCoalesce(storeApi.getState().txHash, () => ( "0x0")),
|
|
@@ -1461,7 +1471,6 @@ function WithdrawFlow({
|
|
|
1461
1471
|
targetToken,
|
|
1462
1472
|
amount: _nullishCoalesce(storeApi.getState().amount, () => ( "0")),
|
|
1463
1473
|
directTransfer: isSameRoute,
|
|
1464
|
-
waitForFinalTx,
|
|
1465
1474
|
service,
|
|
1466
1475
|
flowLabel: "withdraw",
|
|
1467
1476
|
onClose,
|
|
@@ -1485,7 +1494,7 @@ function deriveStepView(step, _registration) {
|
|
|
1485
1494
|
// src/WithdrawModal.tsx
|
|
1486
1495
|
|
|
1487
1496
|
var ReownWithdrawInner = _react.lazy.call(void 0,
|
|
1488
|
-
() => Promise.resolve().then(() => _interopRequireWildcard(require("./WithdrawModalReown-
|
|
1497
|
+
() => Promise.resolve().then(() => _interopRequireWildcard(require("./WithdrawModalReown-OUWBSKSM.cjs"))).then((m) => ({
|
|
1489
1498
|
default: m.WithdrawModalReown
|
|
1490
1499
|
}))
|
|
1491
1500
|
);
|
|
@@ -1513,11 +1522,10 @@ function WithdrawModalInner({
|
|
|
1513
1522
|
inline,
|
|
1514
1523
|
closeOnOverlayClick,
|
|
1515
1524
|
allowedRoutes,
|
|
1516
|
-
backendUrl =
|
|
1517
|
-
signerAddress =
|
|
1525
|
+
backendUrl = _chunkMILJQWPTcjs.DEFAULT_BACKEND_URL,
|
|
1526
|
+
signerAddress = _chunkMILJQWPTcjs.DEFAULT_SIGNER_ADDRESS,
|
|
1518
1527
|
sessionChainIds,
|
|
1519
1528
|
forceRegister = false,
|
|
1520
|
-
waitForFinalTx = true,
|
|
1521
1529
|
reownWallet,
|
|
1522
1530
|
onConnect,
|
|
1523
1531
|
onDisconnect,
|
|
@@ -1533,18 +1541,18 @@ function WithdrawModalInner({
|
|
|
1533
1541
|
debug
|
|
1534
1542
|
}) {
|
|
1535
1543
|
const modalRef = _react.useRef.call(void 0, null);
|
|
1536
|
-
const onReadyRef =
|
|
1544
|
+
const onReadyRef = _chunkRABZINV3cjs.useLatestRef.call(void 0, onReady);
|
|
1537
1545
|
const [backHandler, setBackHandler] = _react.useState.call(void 0,
|
|
1538
1546
|
void 0
|
|
1539
1547
|
);
|
|
1540
|
-
const targetChain =
|
|
1541
|
-
const sourceChain =
|
|
1548
|
+
const targetChain = _chunkMILJQWPTcjs.getChainId.call(void 0, targetChainProp);
|
|
1549
|
+
const sourceChain = _chunkMILJQWPTcjs.getChainId.call(void 0, sourceChainProp);
|
|
1542
1550
|
const service = _react.useMemo.call(void 0,
|
|
1543
|
-
() =>
|
|
1551
|
+
() => _chunkRABZINV3cjs.createDepositService.call(void 0, backendUrl, { debug, debugScope: "service:withdraw" }),
|
|
1544
1552
|
[backendUrl, debug]
|
|
1545
1553
|
);
|
|
1546
1554
|
const store = _react.useMemo.call(void 0, () => createWithdrawStore(), []);
|
|
1547
|
-
const onErrorRef =
|
|
1555
|
+
const onErrorRef = _chunkRABZINV3cjs.useLatestRef.call(void 0, onError);
|
|
1548
1556
|
_react.useEffect.call(void 0, () => {
|
|
1549
1557
|
if (isOpen && onSignTransaction && !dappAddress) {
|
|
1550
1558
|
_optionalChain([onErrorRef, 'access', _62 => _62.current, 'optionalCall', _63 => _63({
|
|
@@ -1555,7 +1563,7 @@ function WithdrawModalInner({
|
|
|
1555
1563
|
}, [isOpen, onSignTransaction, dappAddress, onErrorRef]);
|
|
1556
1564
|
_react.useEffect.call(void 0, () => {
|
|
1557
1565
|
if (isOpen && modalRef.current) {
|
|
1558
|
-
|
|
1566
|
+
_chunkRABZINV3cjs.applyTheme.call(void 0, modalRef.current, theme);
|
|
1559
1567
|
}
|
|
1560
1568
|
}, [isOpen, theme]);
|
|
1561
1569
|
_react.useEffect.call(void 0, () => {
|
|
@@ -1574,7 +1582,7 @@ function WithdrawModalInner({
|
|
|
1574
1582
|
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _66 => _66.showBackButton]), () => ( true));
|
|
1575
1583
|
const canGoBack = backHandler !== void 0;
|
|
1576
1584
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, WithdrawStoreProvider, { store, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1577
|
-
|
|
1585
|
+
_chunkRABZINV3cjs.Modal,
|
|
1578
1586
|
{
|
|
1579
1587
|
isOpen,
|
|
1580
1588
|
onClose,
|
|
@@ -1590,7 +1598,7 @@ function WithdrawModalInner({
|
|
|
1590
1598
|
className: "rs-modal-header-back",
|
|
1591
1599
|
"aria-label": "Go back",
|
|
1592
1600
|
onClick: backHandler,
|
|
1593
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1601
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRABZINV3cjs.ChevronLeftIcon, {})
|
|
1594
1602
|
}
|
|
1595
1603
|
) }),
|
|
1596
1604
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-header-nav-right", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -1600,7 +1608,7 @@ function WithdrawModalInner({
|
|
|
1600
1608
|
onClick: onClose,
|
|
1601
1609
|
className: "rs-modal-close",
|
|
1602
1610
|
"aria-label": "Close",
|
|
1603
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1611
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkRABZINV3cjs.CloseIcon, {})
|
|
1604
1612
|
}
|
|
1605
1613
|
) })
|
|
1606
1614
|
] }),
|
|
@@ -1622,7 +1630,6 @@ function WithdrawModalInner({
|
|
|
1622
1630
|
signerAddress,
|
|
1623
1631
|
sessionChainIds,
|
|
1624
1632
|
forceRegister,
|
|
1625
|
-
waitForFinalTx,
|
|
1626
1633
|
reownWallet,
|
|
1627
1634
|
onConnect,
|
|
1628
1635
|
onDisconnect,
|