@rhinestone/deposit-modal 0.3.0-alpha.9 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +76 -0
- package/dist/{DepositModalReown-I7I3KLD2.mjs → DepositModalReown-G7UX4IBZ.mjs} +6 -4
- package/dist/{DepositModalReown-XUA47RYZ.cjs → DepositModalReown-MECHBE6P.cjs} +9 -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-CUJAFUQM.mjs} +5 -4
- package/dist/{WithdrawModalReown-JATYMQYP.cjs → WithdrawModalReown-WJ6VBZKK.cjs} +8 -7
- package/dist/{constants-DqVn968d.d.ts → caip-CsslyHGL.d.cts} +11 -1
- package/dist/{constants-DqVn968d.d.cts → caip-CsslyHGL.d.ts} +11 -1
- package/dist/{chunk-TJG2AFPS.mjs → chunk-3C35DVPE.mjs} +1048 -829
- package/dist/{chunk-SZIYS42B.mjs → chunk-6YRDD462.mjs} +63 -3
- package/dist/chunk-AJHFNHG3.cjs +295 -0
- package/dist/chunk-BAEB5AFZ.mjs +212 -0
- package/dist/{chunk-KE4MRCFN.mjs → chunk-DZQD3DAV.mjs} +26 -17
- package/dist/{chunk-G5Q4QBWX.cjs → chunk-LEL6GMEQ.cjs} +111 -102
- package/dist/{chunk-7JIDIX27.cjs → chunk-MILJQWPT.cjs} +73 -13
- package/dist/{chunk-MMXUBBGK.cjs → chunk-MQIJZNTP.cjs} +1026 -807
- package/dist/{chunk-4BUMVXPS.mjs → chunk-QYSCCX4K.mjs} +2237 -871
- package/dist/chunk-R5CPOBCF.cjs +212 -0
- package/dist/{chunk-OISMGA2L.mjs → chunk-R5WDHHVM.mjs} +2 -12
- package/dist/{chunk-ZVG4JDKZ.cjs → chunk-SPUZLWQS.cjs} +2285 -919
- package/dist/chunk-TQ2AYMWS.mjs +295 -0
- package/dist/{chunk-KIPKYPNF.cjs → chunk-ULEAK63T.cjs} +6 -16
- 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 +6 -4
- package/dist/deposit.d.cts +4 -4
- package/dist/deposit.d.ts +4 -4
- package/dist/deposit.mjs +5 -3
- package/dist/index.cjs +21 -6
- package/dist/index.d.cts +4 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.mjs +22 -7
- package/dist/polymarket.cjs +64 -0
- package/dist/polymarket.d.cts +57 -0
- package/dist/polymarket.d.ts +57 -0
- package/dist/polymarket.mjs +64 -0
- package/dist/styles.css +719 -75
- package/dist/{types-D8Q4TMk7.d.cts → types-RzfAD14B.d.cts} +65 -2
- package/dist/{types-D8Q4TMk7.d.ts → types-RzfAD14B.d.ts} +65 -2
- package/dist/withdraw.cjs +5 -4
- package/dist/withdraw.d.cts +4 -4
- package/dist/withdraw.d.ts +4 -4
- package/dist/withdraw.mjs +4 -3
- package/package.json +55 -18
|
@@ -27,11 +27,12 @@
|
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
|
|
30
|
+
var _chunkMQIJZNTPcjs = require('./chunk-MQIJZNTP.cjs');
|
|
30
31
|
|
|
31
32
|
|
|
32
33
|
|
|
33
34
|
|
|
34
|
-
var
|
|
35
|
+
var _chunkAJHFNHG3cjs = require('./chunk-AJHFNHG3.cjs');
|
|
35
36
|
|
|
36
37
|
|
|
37
38
|
|
|
@@ -44,7 +45,8 @@ var _chunkMMXUBBGKcjs = require('./chunk-MMXUBBGK.cjs');
|
|
|
44
45
|
|
|
45
46
|
|
|
46
47
|
|
|
47
|
-
|
|
48
|
+
|
|
49
|
+
var _chunkMILJQWPTcjs = require('./chunk-MILJQWPT.cjs');
|
|
48
50
|
|
|
49
51
|
// src/WithdrawModal.tsx
|
|
50
52
|
|
|
@@ -60,7 +62,7 @@ var _react = require('react');
|
|
|
60
62
|
// src/WithdrawFlow.tsx
|
|
61
63
|
|
|
62
64
|
|
|
63
|
-
// src/store/withdraw.
|
|
65
|
+
// src/store/withdraw.ts
|
|
64
66
|
|
|
65
67
|
var _zustand = require('zustand');
|
|
66
68
|
var _vanilla = require('zustand/vanilla');
|
|
@@ -235,8 +237,8 @@ function WithdrawFormStep({
|
|
|
235
237
|
const chainMismatch = Boolean(
|
|
236
238
|
_optionalChain([walletClient, 'optionalAccess', _3 => _3.chain, 'optionalAccess', _4 => _4.id]) && walletClient.chain.id !== asset.chainId
|
|
237
239
|
);
|
|
238
|
-
const targetSymbol =
|
|
239
|
-
const targetChainName =
|
|
240
|
+
const targetSymbol = _chunkMILJQWPTcjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
241
|
+
const targetChainName = _chunkMILJQWPTcjs.getChainName.call(void 0, targetChain);
|
|
240
242
|
const isBusy = submitting || isSubmitting;
|
|
241
243
|
const seededRecipientRef = _react.useRef.call(void 0, _nullishCoalesce(defaultRecipient, () => ( "")));
|
|
242
244
|
_react.useEffect.call(void 0, () => {
|
|
@@ -255,7 +257,7 @@ function WithdrawFormStep({
|
|
|
255
257
|
setIsSwitching(true);
|
|
256
258
|
switchChain(asset.chainId).catch((err) => {
|
|
257
259
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
258
|
-
setError(
|
|
260
|
+
setError(_chunkMQIJZNTPcjs.formatUserError.call(void 0, raw));
|
|
259
261
|
}).finally(() => {
|
|
260
262
|
setIsSwitching(false);
|
|
261
263
|
});
|
|
@@ -275,7 +277,7 @@ function WithdrawFormStep({
|
|
|
275
277
|
return;
|
|
276
278
|
}
|
|
277
279
|
try {
|
|
278
|
-
const bal =
|
|
280
|
+
const bal = _chunkMQIJZNTPcjs.isNativeAsset.call(void 0, asset) ? await publicClient.getBalance({ address: safeAddress }) : await publicClient.readContract({
|
|
279
281
|
address: asset.token,
|
|
280
282
|
abi: _viem.erc20Abi,
|
|
281
283
|
functionName: "balanceOf",
|
|
@@ -379,7 +381,7 @@ function WithdrawFormStep({
|
|
|
379
381
|
await onSubmit(recipient, amount);
|
|
380
382
|
} catch (err) {
|
|
381
383
|
const raw = err instanceof Error ? err.message : "Withdrawal failed";
|
|
382
|
-
setError(
|
|
384
|
+
setError(_chunkMQIJZNTPcjs.formatUserError.call(void 0, raw));
|
|
383
385
|
} finally {
|
|
384
386
|
setIsSubmitting(false);
|
|
385
387
|
}
|
|
@@ -387,22 +389,30 @@ function WithdrawFormStep({
|
|
|
387
389
|
if (isBalanceLoading) {
|
|
388
390
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
389
391
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-withdraw-loading", children: [
|
|
390
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
392
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.Spinner, { className: "rs-spinner--lg" }),
|
|
391
393
|
/* @__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 ${
|
|
394
|
+
/* @__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
395
|
] }),
|
|
394
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
396
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.PoweredBy, {})
|
|
395
397
|
] });
|
|
396
398
|
}
|
|
397
399
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
398
400
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
399
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
401
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.CircleArrowOutUpLeftIcon, {}), title: "Withdraw" }),
|
|
400
402
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-section", children: [
|
|
401
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
403
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
404
|
+
"label",
|
|
405
|
+
{
|
|
406
|
+
className: "rs-withdraw-label",
|
|
407
|
+
htmlFor: "rs-withdraw-recipient",
|
|
408
|
+
children: "Recipient address"
|
|
409
|
+
}
|
|
410
|
+
),
|
|
402
411
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-input-row", children: [
|
|
403
412
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
404
413
|
"input",
|
|
405
414
|
{
|
|
415
|
+
id: "rs-withdraw-recipient",
|
|
406
416
|
type: "text",
|
|
407
417
|
className: "rs-withdraw-input rs-withdraw-input--address",
|
|
408
418
|
placeholder: "0x...",
|
|
@@ -434,7 +444,7 @@ function WithdrawFormStep({
|
|
|
434
444
|
),
|
|
435
445
|
isRecipientConnected ? null : "Use connected"
|
|
436
446
|
] }) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
437
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
447
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.WalletIcon, { className: "rs-withdraw-use-connected-icon" }),
|
|
438
448
|
isRecipientConnected ? null : "Use connected"
|
|
439
449
|
] })
|
|
440
450
|
}
|
|
@@ -442,11 +452,12 @@ function WithdrawFormStep({
|
|
|
442
452
|
] })
|
|
443
453
|
] }),
|
|
444
454
|
/* @__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" }),
|
|
455
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "label", { className: "rs-withdraw-label", htmlFor: "rs-withdraw-amount", children: "Amount" }),
|
|
446
456
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-input-row", children: [
|
|
447
457
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
448
458
|
"input",
|
|
449
459
|
{
|
|
460
|
+
id: "rs-withdraw-amount",
|
|
450
461
|
type: "text",
|
|
451
462
|
inputMode: "decimal",
|
|
452
463
|
className: "rs-withdraw-input rs-withdraw-input--amount",
|
|
@@ -473,7 +484,7 @@ function WithdrawFormStep({
|
|
|
473
484
|
) })
|
|
474
485
|
] }),
|
|
475
486
|
/* @__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 ?
|
|
487
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-withdraw-usd", children: amountUsd !== null ? _chunkMQIJZNTPcjs.currencyFormatter.format(amountUsd) : "$0.00" }),
|
|
477
488
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-withdraw-balance", children: [
|
|
478
489
|
"Balance: ",
|
|
479
490
|
formattedBalance,
|
|
@@ -484,7 +495,7 @@ function WithdrawFormStep({
|
|
|
484
495
|
] }),
|
|
485
496
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-receive-row", children: [
|
|
486
497
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-receive-col", children: [
|
|
487
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "
|
|
498
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-withdraw-label rs-withdraw-label--sm", children: "Receive chain" }),
|
|
488
499
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
489
500
|
"div",
|
|
490
501
|
{
|
|
@@ -495,6 +506,7 @@ function WithdrawFormStep({
|
|
|
495
506
|
"button",
|
|
496
507
|
{
|
|
497
508
|
type: "button",
|
|
509
|
+
"aria-label": "Receive chain",
|
|
498
510
|
className: "rs-withdraw-dropdown",
|
|
499
511
|
onClick: () => {
|
|
500
512
|
setShowChainDropdown(!showChainDropdown);
|
|
@@ -502,10 +514,10 @@ function WithdrawFormStep({
|
|
|
502
514
|
},
|
|
503
515
|
children: [
|
|
504
516
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-dropdown-value", children: [
|
|
505
|
-
|
|
517
|
+
_chunkMILJQWPTcjs.getChainIcon.call(void 0, targetChain) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
506
518
|
"img",
|
|
507
519
|
{
|
|
508
|
-
src:
|
|
520
|
+
src: _chunkMILJQWPTcjs.getChainIcon.call(void 0, targetChain),
|
|
509
521
|
alt: targetChainName,
|
|
510
522
|
className: "rs-withdraw-dropdown-icon"
|
|
511
523
|
}
|
|
@@ -513,7 +525,7 @@ function WithdrawFormStep({
|
|
|
513
525
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: targetChainName })
|
|
514
526
|
] }),
|
|
515
527
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
516
|
-
|
|
528
|
+
_chunkMQIJZNTPcjs.ChevronDownIcon,
|
|
517
529
|
{
|
|
518
530
|
className: "rs-withdraw-dropdown-arrow",
|
|
519
531
|
style: {
|
|
@@ -534,10 +546,10 @@ function WithdrawFormStep({
|
|
|
534
546
|
setShowChainDropdown(false);
|
|
535
547
|
},
|
|
536
548
|
children: [
|
|
537
|
-
|
|
549
|
+
_chunkMILJQWPTcjs.getChainIcon.call(void 0, chain.id) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
538
550
|
"img",
|
|
539
551
|
{
|
|
540
|
-
src:
|
|
552
|
+
src: _chunkMILJQWPTcjs.getChainIcon.call(void 0, chain.id),
|
|
541
553
|
alt: chain.name,
|
|
542
554
|
className: "rs-withdraw-dropdown-icon"
|
|
543
555
|
}
|
|
@@ -552,7 +564,7 @@ function WithdrawFormStep({
|
|
|
552
564
|
)
|
|
553
565
|
] }),
|
|
554
566
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-receive-col", children: [
|
|
555
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "
|
|
567
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-withdraw-label rs-withdraw-label--sm", children: "Receive token" }),
|
|
556
568
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
557
569
|
"div",
|
|
558
570
|
{
|
|
@@ -563,6 +575,7 @@ function WithdrawFormStep({
|
|
|
563
575
|
"button",
|
|
564
576
|
{
|
|
565
577
|
type: "button",
|
|
578
|
+
"aria-label": "Receive token",
|
|
566
579
|
className: "rs-withdraw-dropdown",
|
|
567
580
|
onClick: () => {
|
|
568
581
|
setShowTokenDropdown(!showTokenDropdown);
|
|
@@ -570,10 +583,10 @@ function WithdrawFormStep({
|
|
|
570
583
|
},
|
|
571
584
|
children: [
|
|
572
585
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-dropdown-value", children: [
|
|
573
|
-
|
|
586
|
+
_chunkMILJQWPTcjs.getTokenIcon.call(void 0, targetSymbol) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
574
587
|
"img",
|
|
575
588
|
{
|
|
576
|
-
src:
|
|
589
|
+
src: _chunkMILJQWPTcjs.getTokenIcon.call(void 0, targetSymbol),
|
|
577
590
|
alt: targetSymbol,
|
|
578
591
|
className: "rs-withdraw-dropdown-icon"
|
|
579
592
|
}
|
|
@@ -581,7 +594,7 @@ function WithdrawFormStep({
|
|
|
581
594
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: targetSymbol })
|
|
582
595
|
] }),
|
|
583
596
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
584
|
-
|
|
597
|
+
_chunkMQIJZNTPcjs.ChevronDownIcon,
|
|
585
598
|
{
|
|
586
599
|
className: "rs-withdraw-dropdown-arrow",
|
|
587
600
|
style: {
|
|
@@ -602,10 +615,10 @@ function WithdrawFormStep({
|
|
|
602
615
|
setShowTokenDropdown(false);
|
|
603
616
|
},
|
|
604
617
|
children: [
|
|
605
|
-
|
|
618
|
+
_chunkMILJQWPTcjs.getTokenIcon.call(void 0, option.symbol) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
606
619
|
"img",
|
|
607
620
|
{
|
|
608
|
-
src:
|
|
621
|
+
src: _chunkMILJQWPTcjs.getTokenIcon.call(void 0, option.symbol),
|
|
609
622
|
alt: option.symbol,
|
|
610
623
|
className: "rs-withdraw-dropdown-icon"
|
|
611
624
|
}
|
|
@@ -620,11 +633,11 @@ function WithdrawFormStep({
|
|
|
620
633
|
)
|
|
621
634
|
] })
|
|
622
635
|
] }),
|
|
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,
|
|
636
|
+
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.` }) }),
|
|
637
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.Callout, { variant: "error", children: error }),
|
|
638
|
+
!error && registrationError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.Callout, { variant: "error", children: registrationError }),
|
|
626
639
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
627
|
-
|
|
640
|
+
_chunkMQIJZNTPcjs.Button,
|
|
628
641
|
{
|
|
629
642
|
onClick: handleWithdraw,
|
|
630
643
|
fullWidth: true,
|
|
@@ -634,7 +647,7 @@ function WithdrawFormStep({
|
|
|
634
647
|
}
|
|
635
648
|
)
|
|
636
649
|
] }),
|
|
637
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
650
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.PoweredBy, {})
|
|
638
651
|
] });
|
|
639
652
|
}
|
|
640
653
|
WithdrawFormStep.displayName = "WithdrawFormStep";
|
|
@@ -660,13 +673,13 @@ function WithdrawReviewStep({
|
|
|
660
673
|
}) {
|
|
661
674
|
const [isSubmitting, setIsSubmitting] = _react.useState.call(void 0, false);
|
|
662
675
|
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 =
|
|
676
|
+
const sourceChainName = _chunkMILJQWPTcjs.getChainName.call(void 0, sourceChain);
|
|
677
|
+
const sourceChainIcon = _chunkMILJQWPTcjs.getChainIcon.call(void 0, sourceChain);
|
|
678
|
+
const targetSymbol = _chunkMILJQWPTcjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
679
|
+
const targetChainName = _chunkMILJQWPTcjs.getChainName.call(void 0, targetChain);
|
|
680
|
+
const targetChainIcon = _chunkMILJQWPTcjs.getChainIcon.call(void 0, targetChain);
|
|
681
|
+
const sourceTokenIcon = _chunkMILJQWPTcjs.getTokenIcon.call(void 0, sourceSymbol);
|
|
682
|
+
const targetTokenIcon = _chunkMILJQWPTcjs.getTokenIcon.call(void 0, targetSymbol);
|
|
670
683
|
const handleConfirm = async () => {
|
|
671
684
|
setError(null);
|
|
672
685
|
setIsSubmitting(true);
|
|
@@ -674,7 +687,7 @@ function WithdrawReviewStep({
|
|
|
674
687
|
await onConfirm();
|
|
675
688
|
} catch (err) {
|
|
676
689
|
const raw = err instanceof Error ? err.message : "Withdraw failed";
|
|
677
|
-
const message =
|
|
690
|
+
const message = _chunkMQIJZNTPcjs.formatUserError.call(void 0, raw);
|
|
678
691
|
setError(message);
|
|
679
692
|
_optionalChain([onError, 'optionalCall', _8 => _8(message, "WITHDRAW_REVIEW_ERROR")]);
|
|
680
693
|
} finally {
|
|
@@ -685,9 +698,9 @@ function WithdrawReviewStep({
|
|
|
685
698
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
686
699
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
687
700
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
688
|
-
|
|
701
|
+
_chunkMQIJZNTPcjs.BodyHeader,
|
|
689
702
|
{
|
|
690
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
703
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.CircleArrowOutUpLeftIcon, {}),
|
|
691
704
|
title: "Review withdrawal"
|
|
692
705
|
}
|
|
693
706
|
),
|
|
@@ -737,10 +750,10 @@ function WithdrawReviewStep({
|
|
|
737
750
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-value", children: estimatedTime })
|
|
738
751
|
] })
|
|
739
752
|
] }),
|
|
740
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
741
|
-
!error && registrationError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
753
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.Callout, { variant: "error", children: error }),
|
|
754
|
+
!error && registrationError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.Callout, { variant: "error", children: registrationError }),
|
|
742
755
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
743
|
-
|
|
756
|
+
_chunkMQIJZNTPcjs.Button,
|
|
744
757
|
{
|
|
745
758
|
onClick: handleConfirm,
|
|
746
759
|
loading: isSubmitting,
|
|
@@ -751,7 +764,7 @@ function WithdrawReviewStep({
|
|
|
751
764
|
}
|
|
752
765
|
)
|
|
753
766
|
] }),
|
|
754
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
767
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.PoweredBy, {})
|
|
755
768
|
] });
|
|
756
769
|
}
|
|
757
770
|
WithdrawReviewStep.displayName = "WithdrawReviewStep";
|
|
@@ -762,15 +775,15 @@ WithdrawReviewStep.displayName = "WithdrawReviewStep";
|
|
|
762
775
|
var ADDR_REGEX = /^0x[a-fA-F0-9]{40}$/;
|
|
763
776
|
var REGISTRATION_DEBOUNCE_MS = 600;
|
|
764
777
|
function resolveSessionOwner(eoaAddress) {
|
|
765
|
-
const localOwner =
|
|
778
|
+
const localOwner = _chunkMQIJZNTPcjs.loadSessionOwnerFromStorage.call(void 0, eoaAddress);
|
|
766
779
|
if (localOwner) {
|
|
767
780
|
return {
|
|
768
|
-
account:
|
|
781
|
+
account: _chunkMQIJZNTPcjs.accountFromPrivateKey.call(void 0, localOwner.privateKey),
|
|
769
782
|
address: localOwner.address
|
|
770
783
|
};
|
|
771
784
|
}
|
|
772
|
-
const created =
|
|
773
|
-
|
|
785
|
+
const created = _chunkMQIJZNTPcjs.createSessionOwnerKey.call(void 0, );
|
|
786
|
+
_chunkMQIJZNTPcjs.saveSessionOwnerToStorage.call(void 0, eoaAddress, created.privateKey, created.address);
|
|
774
787
|
return { account: created.account, address: created.address };
|
|
775
788
|
}
|
|
776
789
|
function targetsEqual(a, b) {
|
|
@@ -790,10 +803,9 @@ function WithdrawFlow({
|
|
|
790
803
|
amount: defaultAmount,
|
|
791
804
|
service,
|
|
792
805
|
allowedRoutes,
|
|
793
|
-
signerAddress =
|
|
806
|
+
signerAddress = _chunkMILJQWPTcjs.DEFAULT_SIGNER_ADDRESS,
|
|
794
807
|
sessionChainIds,
|
|
795
808
|
forceRegister = false,
|
|
796
|
-
waitForFinalTx = true,
|
|
797
809
|
reownWallet,
|
|
798
810
|
onConnect,
|
|
799
811
|
onDisconnect,
|
|
@@ -806,19 +818,19 @@ function WithdrawFlow({
|
|
|
806
818
|
onError,
|
|
807
819
|
debug
|
|
808
820
|
}) {
|
|
809
|
-
const onStepChangeRef =
|
|
810
|
-
const onEventRef =
|
|
811
|
-
const onLifecycleRef =
|
|
812
|
-
const onErrorRef =
|
|
821
|
+
const onStepChangeRef = _chunkMQIJZNTPcjs.useLatestRef.call(void 0, onStepChange);
|
|
822
|
+
const onEventRef = _chunkMQIJZNTPcjs.useLatestRef.call(void 0, onEvent);
|
|
823
|
+
const onLifecycleRef = _chunkMQIJZNTPcjs.useLatestRef.call(void 0, onLifecycle);
|
|
824
|
+
const onErrorRef = _chunkMQIJZNTPcjs.useLatestRef.call(void 0, onError);
|
|
813
825
|
const logFlow = _react.useCallback.call(void 0,
|
|
814
826
|
(message, data) => {
|
|
815
|
-
|
|
827
|
+
_chunkMQIJZNTPcjs.debugLog.call(void 0, debug, "withdraw-flow", message, data);
|
|
816
828
|
},
|
|
817
829
|
[debug]
|
|
818
830
|
);
|
|
819
831
|
const logFlowError = _react.useCallback.call(void 0,
|
|
820
832
|
(message, error, data) => {
|
|
821
|
-
|
|
833
|
+
_chunkMQIJZNTPcjs.debugError.call(void 0, debug, "withdraw-flow", message, error, data);
|
|
822
834
|
},
|
|
823
835
|
[debug]
|
|
824
836
|
);
|
|
@@ -893,14 +905,14 @@ function WithdrawFlow({
|
|
|
893
905
|
return {
|
|
894
906
|
ownerAddress: dappAddress,
|
|
895
907
|
walletClient: _nullishCoalesce(dappWalletClient, () => ( void 0)),
|
|
896
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
908
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkMQIJZNTPcjs.getPublicClient.call(void 0, sourceChain))),
|
|
897
909
|
switchChain: dappSwitchChain
|
|
898
910
|
};
|
|
899
911
|
}
|
|
900
912
|
return {
|
|
901
913
|
ownerAddress: dappWalletClient.account.address,
|
|
902
914
|
walletClient: dappWalletClient,
|
|
903
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
915
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkMQIJZNTPcjs.getPublicClient.call(void 0, sourceChain))),
|
|
904
916
|
switchChain: dappSwitchChain
|
|
905
917
|
};
|
|
906
918
|
}
|
|
@@ -911,7 +923,7 @@ function WithdrawFlow({
|
|
|
911
923
|
return {
|
|
912
924
|
ownerAddress: dappWalletClient.account.address,
|
|
913
925
|
walletClient: dappWalletClient,
|
|
914
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
926
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkMQIJZNTPcjs.getPublicClient.call(void 0, sourceChain))),
|
|
915
927
|
switchChain: dappSwitchChain
|
|
916
928
|
};
|
|
917
929
|
}
|
|
@@ -968,7 +980,7 @@ function WithdrawFlow({
|
|
|
968
980
|
const setup = await service.setupAccount({
|
|
969
981
|
ownerAddress,
|
|
970
982
|
sessionOwnerAddress: sessionOwner.address,
|
|
971
|
-
targetChain:
|
|
983
|
+
targetChain: _chunkMILJQWPTcjs.toEvmCaip2.call(void 0, targetChain),
|
|
972
984
|
targetToken,
|
|
973
985
|
recipient: recipientForRegistration,
|
|
974
986
|
signerAddress,
|
|
@@ -993,7 +1005,7 @@ function WithdrawFlow({
|
|
|
993
1005
|
message: typedData.message
|
|
994
1006
|
});
|
|
995
1007
|
if (cancelled) return;
|
|
996
|
-
const sessionDetails =
|
|
1008
|
+
const sessionDetails = _chunkMQIJZNTPcjs.buildSessionDetails.call(void 0,
|
|
997
1009
|
setup.sessionDetailsUnsigned,
|
|
998
1010
|
signature
|
|
999
1011
|
);
|
|
@@ -1007,7 +1019,7 @@ function WithdrawFlow({
|
|
|
1007
1019
|
eoaAddress: ownerAddress,
|
|
1008
1020
|
sessionOwner: sessionOwner.address,
|
|
1009
1021
|
target: {
|
|
1010
|
-
chain:
|
|
1022
|
+
chain: _chunkMILJQWPTcjs.toEvmCaip2.call(void 0, targetChain),
|
|
1011
1023
|
token: targetToken,
|
|
1012
1024
|
recipient: recipientForRegistration
|
|
1013
1025
|
}
|
|
@@ -1030,7 +1042,7 @@ function WithdrawFlow({
|
|
|
1030
1042
|
} catch (err) {
|
|
1031
1043
|
if (cancelled) return;
|
|
1032
1044
|
const raw = err instanceof Error ? err.message : "Registration failed";
|
|
1033
|
-
const message =
|
|
1045
|
+
const message = _chunkMQIJZNTPcjs.formatUserError.call(void 0, raw);
|
|
1034
1046
|
logFlowError("auto-register:failed", err, {
|
|
1035
1047
|
ownerAddress,
|
|
1036
1048
|
targetChain,
|
|
@@ -1063,10 +1075,10 @@ function WithdrawFlow({
|
|
|
1063
1075
|
onErrorRef
|
|
1064
1076
|
]);
|
|
1065
1077
|
const asset = _react.useMemo.call(void 0, () => {
|
|
1066
|
-
const symbol =
|
|
1067
|
-
const decimals =
|
|
1078
|
+
const symbol = _chunkMILJQWPTcjs.getTokenSymbol.call(void 0, sourceToken, sourceChain);
|
|
1079
|
+
const decimals = _chunkMILJQWPTcjs.getTokenDecimalsByAddress.call(void 0, sourceToken, sourceChain);
|
|
1068
1080
|
return {
|
|
1069
|
-
id:
|
|
1081
|
+
id: _chunkMQIJZNTPcjs.getAssetId.call(void 0, { chainId: sourceChain, token: sourceToken }),
|
|
1070
1082
|
chainId: sourceChain,
|
|
1071
1083
|
token: sourceToken,
|
|
1072
1084
|
symbol,
|
|
@@ -1074,7 +1086,7 @@ function WithdrawFlow({
|
|
|
1074
1086
|
decimals
|
|
1075
1087
|
};
|
|
1076
1088
|
}, [sourceChain, sourceToken]);
|
|
1077
|
-
const isSourceNative = sourceToken.toLowerCase() ===
|
|
1089
|
+
const isSourceNative = sourceToken.toLowerCase() === _chunkMILJQWPTcjs.NATIVE_TOKEN_ADDRESS.toLowerCase();
|
|
1078
1090
|
const isSameRoute = targetChain === sourceChain && targetToken.toLowerCase() === sourceToken.toLowerCase();
|
|
1079
1091
|
const reviewBackHandler = _react.useCallback.call(void 0, () => {
|
|
1080
1092
|
storeApi.dispatch({ type: "review/back" });
|
|
@@ -1092,8 +1104,8 @@ function WithdrawFlow({
|
|
|
1092
1104
|
}
|
|
1093
1105
|
if (lastStepOpenEventKeyRef.current === "form") return;
|
|
1094
1106
|
lastStepOpenEventKeyRef.current = "form";
|
|
1095
|
-
const tokenSymbol =
|
|
1096
|
-
const chainName =
|
|
1107
|
+
const tokenSymbol = _chunkMILJQWPTcjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
1108
|
+
const chainName = _chunkMILJQWPTcjs.getChainName.call(void 0, targetChain);
|
|
1097
1109
|
_optionalChain([onEventRef, 'access', _37 => _37.current, 'optionalCall', _38 => _38({
|
|
1098
1110
|
type: "withdraw_modal_select_amount_open",
|
|
1099
1111
|
pred_balance: totalBalanceUsd,
|
|
@@ -1130,8 +1142,8 @@ function WithdrawFlow({
|
|
|
1130
1142
|
);
|
|
1131
1143
|
const handleFormContinue = _react.useCallback.call(void 0,
|
|
1132
1144
|
(recipient, amountValue) => {
|
|
1133
|
-
const tokenSymbol =
|
|
1134
|
-
const chainName =
|
|
1145
|
+
const tokenSymbol = _chunkMILJQWPTcjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
1146
|
+
const chainName = _chunkMILJQWPTcjs.getChainName.call(void 0, targetChain);
|
|
1135
1147
|
_optionalChain([onEventRef, 'access', _41 => _41.current, 'optionalCall', _42 => _42({
|
|
1136
1148
|
type: "withdraw_modal_select_amount_cta_click",
|
|
1137
1149
|
pred_balance: totalBalanceUsd,
|
|
@@ -1174,7 +1186,7 @@ function WithdrawFlow({
|
|
|
1174
1186
|
targetToken
|
|
1175
1187
|
});
|
|
1176
1188
|
const amountUnits = _viem.parseUnits.call(void 0, amountValue, asset.decimals);
|
|
1177
|
-
const pc = _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess', _44 => _44.publicClient]), () => (
|
|
1189
|
+
const pc = _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess', _44 => _44.publicClient]), () => ( _chunkMQIJZNTPcjs.getPublicClient.call(void 0, sourceChain)));
|
|
1178
1190
|
let result;
|
|
1179
1191
|
if (onSignTransaction) {
|
|
1180
1192
|
const transferTarget = isSameRoute ? recipient : smartAccount;
|
|
@@ -1187,7 +1199,7 @@ function WithdrawFlow({
|
|
|
1187
1199
|
args: [transferTarget, amountUnits]
|
|
1188
1200
|
})
|
|
1189
1201
|
};
|
|
1190
|
-
const request = await
|
|
1202
|
+
const request = await _chunkAJHFNHG3cjs.buildSafeTransaction.call(void 0, {
|
|
1191
1203
|
publicClient: pc,
|
|
1192
1204
|
safeAddress,
|
|
1193
1205
|
to: transferData.to,
|
|
@@ -1198,7 +1210,7 @@ function WithdrawFlow({
|
|
|
1198
1210
|
const { signature } = await onSignTransaction(request);
|
|
1199
1211
|
const relayResult = await service.relayWithdraw({
|
|
1200
1212
|
smartAccount,
|
|
1201
|
-
chainId:
|
|
1213
|
+
chainId: _chunkMILJQWPTcjs.toEvmCaip2.call(void 0, sourceChain),
|
|
1202
1214
|
safeAddress,
|
|
1203
1215
|
safeTransaction: request.typedData.message,
|
|
1204
1216
|
signature
|
|
@@ -1208,7 +1220,7 @@ function WithdrawFlow({
|
|
|
1208
1220
|
}
|
|
1209
1221
|
result = { txHash: relayResult.txHash };
|
|
1210
1222
|
} else if (isSourceNative) {
|
|
1211
|
-
result = await
|
|
1223
|
+
result = await _chunkAJHFNHG3cjs.executeSafeEthTransfer.call(void 0, {
|
|
1212
1224
|
walletClient: signerContext.walletClient,
|
|
1213
1225
|
publicClient: pc,
|
|
1214
1226
|
safeAddress,
|
|
@@ -1217,7 +1229,7 @@ function WithdrawFlow({
|
|
|
1217
1229
|
chainId: sourceChain
|
|
1218
1230
|
});
|
|
1219
1231
|
} else {
|
|
1220
|
-
result = await
|
|
1232
|
+
result = await _chunkAJHFNHG3cjs.executeSafeErc20Transfer.call(void 0, {
|
|
1221
1233
|
walletClient: signerContext.walletClient,
|
|
1222
1234
|
publicClient: pc,
|
|
1223
1235
|
safeAddress,
|
|
@@ -1250,7 +1262,7 @@ function WithdrawFlow({
|
|
|
1250
1262
|
targetChain,
|
|
1251
1263
|
targetToken
|
|
1252
1264
|
});
|
|
1253
|
-
handleError(
|
|
1265
|
+
handleError(_chunkMQIJZNTPcjs.formatUserError.call(void 0, raw), "WITHDRAW_FLOW_ERROR");
|
|
1254
1266
|
throw err;
|
|
1255
1267
|
}
|
|
1256
1268
|
},
|
|
@@ -1315,9 +1327,9 @@ function WithdrawFlow({
|
|
|
1315
1327
|
[_optionalChain([allowedRoutes, 'optionalAccess', _54 => _54.sourceTokens])]
|
|
1316
1328
|
);
|
|
1317
1329
|
const targetChainOptions = _react.useMemo.call(void 0, () => {
|
|
1318
|
-
return
|
|
1330
|
+
return _chunkMILJQWPTcjs.SOURCE_CHAINS.filter((chain) => {
|
|
1319
1331
|
if (allowedChainSet && !allowedChainSet.has(chain.id)) return false;
|
|
1320
|
-
const tokens =
|
|
1332
|
+
const tokens = _chunkMILJQWPTcjs.getSupportedTargetTokens.call(void 0, chain.id);
|
|
1321
1333
|
if (allowedTokenSet) {
|
|
1322
1334
|
return tokens.some((t) => allowedTokenSet.has(t.symbol.toUpperCase()));
|
|
1323
1335
|
}
|
|
@@ -1325,7 +1337,7 @@ function WithdrawFlow({
|
|
|
1325
1337
|
});
|
|
1326
1338
|
}, [allowedChainSet, allowedTokenSet]);
|
|
1327
1339
|
const targetTokenOptions = _react.useMemo.call(void 0, () => {
|
|
1328
|
-
const tokens =
|
|
1340
|
+
const tokens = _chunkMILJQWPTcjs.getSupportedTargetTokens.call(void 0, targetChain);
|
|
1329
1341
|
if (!allowedTokenSet) return tokens;
|
|
1330
1342
|
return tokens.filter((t) => allowedTokenSet.has(t.symbol.toUpperCase()));
|
|
1331
1343
|
}, [targetChain, allowedTokenSet]);
|
|
@@ -1339,7 +1351,7 @@ function WithdrawFlow({
|
|
|
1339
1351
|
const handleTargetChainChange = _react.useCallback.call(void 0,
|
|
1340
1352
|
(chainId) => {
|
|
1341
1353
|
setTargetChain(chainId);
|
|
1342
|
-
let options =
|
|
1354
|
+
let options = _chunkMILJQWPTcjs.getSupportedTargetTokens.call(void 0, chainId);
|
|
1343
1355
|
if (allowedTokenSet) {
|
|
1344
1356
|
options = options.filter(
|
|
1345
1357
|
(t) => allowedTokenSet.has(t.symbol.toUpperCase())
|
|
@@ -1389,7 +1401,7 @@ function WithdrawFlow({
|
|
|
1389
1401
|
state: "ready"
|
|
1390
1402
|
}));
|
|
1391
1403
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1392
|
-
|
|
1404
|
+
_chunkMQIJZNTPcjs.ConnectStep,
|
|
1393
1405
|
{
|
|
1394
1406
|
walletRows: withdrawRows,
|
|
1395
1407
|
onConfirmWallet: (walletId) => {
|
|
@@ -1407,7 +1419,7 @@ function WithdrawFlow({
|
|
|
1407
1419
|
if (!signerContext) return null;
|
|
1408
1420
|
if (!onSignTransaction && !signerContext.walletClient) return null;
|
|
1409
1421
|
const resolvedConnectedRecipient = _optionalChain([selectedWalletOption, 'optionalAccess', _61 => _61.kind]) === "external" ? selectedWalletOption.address : void 0;
|
|
1410
|
-
const formPublicClient = _nullishCoalesce(signerContext.publicClient, () => (
|
|
1422
|
+
const formPublicClient = _nullishCoalesce(signerContext.publicClient, () => ( _chunkMQIJZNTPcjs.getPublicClient.call(void 0, sourceChain)));
|
|
1411
1423
|
const stepView = deriveStepView(flowStep, registration);
|
|
1412
1424
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
1413
1425
|
stepView === "form" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -1451,7 +1463,7 @@ function WithdrawFlow({
|
|
|
1451
1463
|
}
|
|
1452
1464
|
),
|
|
1453
1465
|
stepView === "processing" && registration.kind !== "idle" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1454
|
-
|
|
1466
|
+
_chunkMQIJZNTPcjs.ProcessingStep,
|
|
1455
1467
|
{
|
|
1456
1468
|
smartAccount: registration.kind === "ready" || registration.kind === "stale" ? registration.smartAccount : "0x0",
|
|
1457
1469
|
txHash: _nullishCoalesce(storeApi.getState().txHash, () => ( "0x0")),
|
|
@@ -1461,7 +1473,6 @@ function WithdrawFlow({
|
|
|
1461
1473
|
targetToken,
|
|
1462
1474
|
amount: _nullishCoalesce(storeApi.getState().amount, () => ( "0")),
|
|
1463
1475
|
directTransfer: isSameRoute,
|
|
1464
|
-
waitForFinalTx,
|
|
1465
1476
|
service,
|
|
1466
1477
|
flowLabel: "withdraw",
|
|
1467
1478
|
onClose,
|
|
@@ -1485,7 +1496,7 @@ function deriveStepView(step, _registration) {
|
|
|
1485
1496
|
// src/WithdrawModal.tsx
|
|
1486
1497
|
|
|
1487
1498
|
var ReownWithdrawInner = _react.lazy.call(void 0,
|
|
1488
|
-
() => Promise.resolve().then(() => _interopRequireWildcard(require("./WithdrawModalReown-
|
|
1499
|
+
() => Promise.resolve().then(() => _interopRequireWildcard(require("./WithdrawModalReown-WJ6VBZKK.cjs"))).then((m) => ({
|
|
1489
1500
|
default: m.WithdrawModalReown
|
|
1490
1501
|
}))
|
|
1491
1502
|
);
|
|
@@ -1513,11 +1524,10 @@ function WithdrawModalInner({
|
|
|
1513
1524
|
inline,
|
|
1514
1525
|
closeOnOverlayClick,
|
|
1515
1526
|
allowedRoutes,
|
|
1516
|
-
backendUrl =
|
|
1517
|
-
signerAddress =
|
|
1527
|
+
backendUrl = _chunkMILJQWPTcjs.DEFAULT_BACKEND_URL,
|
|
1528
|
+
signerAddress = _chunkMILJQWPTcjs.DEFAULT_SIGNER_ADDRESS,
|
|
1518
1529
|
sessionChainIds,
|
|
1519
1530
|
forceRegister = false,
|
|
1520
|
-
waitForFinalTx = true,
|
|
1521
1531
|
reownWallet,
|
|
1522
1532
|
onConnect,
|
|
1523
1533
|
onDisconnect,
|
|
@@ -1533,18 +1543,18 @@ function WithdrawModalInner({
|
|
|
1533
1543
|
debug
|
|
1534
1544
|
}) {
|
|
1535
1545
|
const modalRef = _react.useRef.call(void 0, null);
|
|
1536
|
-
const onReadyRef =
|
|
1546
|
+
const onReadyRef = _chunkMQIJZNTPcjs.useLatestRef.call(void 0, onReady);
|
|
1537
1547
|
const [backHandler, setBackHandler] = _react.useState.call(void 0,
|
|
1538
1548
|
void 0
|
|
1539
1549
|
);
|
|
1540
|
-
const targetChain =
|
|
1541
|
-
const sourceChain =
|
|
1550
|
+
const targetChain = _chunkMILJQWPTcjs.getChainId.call(void 0, targetChainProp);
|
|
1551
|
+
const sourceChain = _chunkMILJQWPTcjs.getChainId.call(void 0, sourceChainProp);
|
|
1542
1552
|
const service = _react.useMemo.call(void 0,
|
|
1543
|
-
() =>
|
|
1553
|
+
() => _chunkMQIJZNTPcjs.createDepositService.call(void 0, backendUrl, { debug, debugScope: "service:withdraw" }),
|
|
1544
1554
|
[backendUrl, debug]
|
|
1545
1555
|
);
|
|
1546
1556
|
const store = _react.useMemo.call(void 0, () => createWithdrawStore(), []);
|
|
1547
|
-
const onErrorRef =
|
|
1557
|
+
const onErrorRef = _chunkMQIJZNTPcjs.useLatestRef.call(void 0, onError);
|
|
1548
1558
|
_react.useEffect.call(void 0, () => {
|
|
1549
1559
|
if (isOpen && onSignTransaction && !dappAddress) {
|
|
1550
1560
|
_optionalChain([onErrorRef, 'access', _62 => _62.current, 'optionalCall', _63 => _63({
|
|
@@ -1555,7 +1565,7 @@ function WithdrawModalInner({
|
|
|
1555
1565
|
}, [isOpen, onSignTransaction, dappAddress, onErrorRef]);
|
|
1556
1566
|
_react.useEffect.call(void 0, () => {
|
|
1557
1567
|
if (isOpen && modalRef.current) {
|
|
1558
|
-
|
|
1568
|
+
_chunkMQIJZNTPcjs.applyTheme.call(void 0, modalRef.current, theme);
|
|
1559
1569
|
}
|
|
1560
1570
|
}, [isOpen, theme]);
|
|
1561
1571
|
_react.useEffect.call(void 0, () => {
|
|
@@ -1574,7 +1584,7 @@ function WithdrawModalInner({
|
|
|
1574
1584
|
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _66 => _66.showBackButton]), () => ( true));
|
|
1575
1585
|
const canGoBack = backHandler !== void 0;
|
|
1576
1586
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, WithdrawStoreProvider, { store, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1577
|
-
|
|
1587
|
+
_chunkMQIJZNTPcjs.Modal,
|
|
1578
1588
|
{
|
|
1579
1589
|
isOpen,
|
|
1580
1590
|
onClose,
|
|
@@ -1590,7 +1600,7 @@ function WithdrawModalInner({
|
|
|
1590
1600
|
className: "rs-modal-header-back",
|
|
1591
1601
|
"aria-label": "Go back",
|
|
1592
1602
|
onClick: backHandler,
|
|
1593
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1603
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.ChevronLeftIcon, {})
|
|
1594
1604
|
}
|
|
1595
1605
|
) }),
|
|
1596
1606
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-header-nav-right", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -1600,7 +1610,7 @@ function WithdrawModalInner({
|
|
|
1600
1610
|
onClick: onClose,
|
|
1601
1611
|
className: "rs-modal-close",
|
|
1602
1612
|
"aria-label": "Close",
|
|
1603
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1613
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.CloseIcon, {})
|
|
1604
1614
|
}
|
|
1605
1615
|
) })
|
|
1606
1616
|
] }),
|
|
@@ -1622,7 +1632,6 @@ function WithdrawModalInner({
|
|
|
1622
1632
|
signerAddress,
|
|
1623
1633
|
sessionChainIds,
|
|
1624
1634
|
forceRegister,
|
|
1625
|
-
waitForFinalTx,
|
|
1626
1635
|
reownWallet,
|
|
1627
1636
|
onConnect,
|
|
1628
1637
|
onDisconnect,
|