@rhinestone/deposit-modal 0.4.1 → 0.4.3
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-FMAPWBQM.cjs → DepositModalReown-MCDIOJLT.cjs} +6 -6
- package/dist/{DepositModalReown-EXI7MW65.mjs → DepositModalReown-ORSBSEMO.mjs} +3 -3
- package/dist/{WithdrawModalReown-CTT3EXMG.cjs → WithdrawModalReown-KKGW62YO.cjs} +6 -6
- package/dist/{WithdrawModalReown-G7EM6HXO.mjs → WithdrawModalReown-XPB53FKZ.mjs} +3 -3
- package/dist/{chunk-BTDRUAPJ.cjs → chunk-36R7XKXP.cjs} +396 -418
- package/dist/{chunk-JHT2MJ42.cjs → chunk-3NZUMDST.cjs} +116 -92
- package/dist/{chunk-A33QFRKD.mjs → chunk-7EQQD7B4.mjs} +18 -0
- package/dist/{chunk-RTAIW3WW.mjs → chunk-ANPDY6NJ.mjs} +40 -62
- package/dist/{chunk-LJJCPDZO.cjs → chunk-EDUWRMQI.cjs} +22 -4
- package/dist/{chunk-3GLQC2KQ.mjs → chunk-IDJBMNV2.mjs} +27 -3
- package/dist/{chunk-ULCCXH2A.cjs → chunk-PQDHZZ2B.cjs} +2 -2
- package/dist/{chunk-43RTPRQY.mjs → chunk-V72YVCR6.mjs} +1 -1
- package/dist/deposit.cjs +3 -3
- package/dist/deposit.d.cts +2 -2
- package/dist/deposit.d.ts +2 -2
- package/dist/deposit.mjs +2 -2
- package/dist/index.cjs +4 -4
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +3 -3
- package/dist/{types-CFRuisqK.d.cts → types-CUOqIIvZ.d.cts} +7 -0
- package/dist/{types-CFRuisqK.d.ts → types-CUOqIIvZ.d.ts} +7 -0
- package/dist/withdraw.cjs +3 -3
- package/dist/withdraw.d.cts +2 -2
- package/dist/withdraw.d.ts +2 -2
- package/dist/withdraw.mjs +2 -2
- package/package.json +1 -1
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
|
|
33
|
-
var
|
|
33
|
+
var _chunkEDUWRMQIcjs = require('./chunk-EDUWRMQI.cjs');
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
|
|
@@ -200,6 +200,7 @@ function WithdrawFormStep({
|
|
|
200
200
|
publicClient,
|
|
201
201
|
connectedRecipient,
|
|
202
202
|
safeAddress,
|
|
203
|
+
depositAddress,
|
|
203
204
|
asset,
|
|
204
205
|
defaultRecipient,
|
|
205
206
|
defaultAmount,
|
|
@@ -260,7 +261,7 @@ function WithdrawFormStep({
|
|
|
260
261
|
setIsSwitching(true);
|
|
261
262
|
switchChain(asset.chainId).catch((err) => {
|
|
262
263
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
263
|
-
setError(
|
|
264
|
+
setError(_chunkEDUWRMQIcjs.formatUserError.call(void 0, raw));
|
|
264
265
|
}).finally(() => {
|
|
265
266
|
setIsSwitching(false);
|
|
266
267
|
});
|
|
@@ -280,7 +281,7 @@ function WithdrawFormStep({
|
|
|
280
281
|
return;
|
|
281
282
|
}
|
|
282
283
|
try {
|
|
283
|
-
const bal =
|
|
284
|
+
const bal = _chunkEDUWRMQIcjs.isNativeAsset.call(void 0, asset) ? await publicClient.getBalance({ address: safeAddress }) : await publicClient.readContract({
|
|
284
285
|
address: asset.token,
|
|
285
286
|
abi: _viem.erc20Abi,
|
|
286
287
|
functionName: "balanceOf",
|
|
@@ -361,6 +362,13 @@ function WithdrawFormStep({
|
|
|
361
362
|
setError("Enter a valid recipient address");
|
|
362
363
|
return;
|
|
363
364
|
}
|
|
365
|
+
const lowerRecipient = recipient.toLowerCase();
|
|
366
|
+
if (lowerRecipient === safeAddress.toLowerCase() || lowerRecipient === _optionalChain([depositAddress, 'optionalAccess', _7 => _7.toLowerCase, 'call', _8 => _8()])) {
|
|
367
|
+
setError(
|
|
368
|
+
"Recipient can't be your own account. Send to a different wallet."
|
|
369
|
+
);
|
|
370
|
+
return;
|
|
371
|
+
}
|
|
364
372
|
const parsed = Number(amount);
|
|
365
373
|
if (!amount || !Number.isFinite(parsed) || parsed <= 0) {
|
|
366
374
|
setError("Enter a valid amount");
|
|
@@ -384,24 +392,32 @@ function WithdrawFormStep({
|
|
|
384
392
|
await onSubmit(recipient, amount);
|
|
385
393
|
} catch (err) {
|
|
386
394
|
const raw = err instanceof Error ? err.message : "Withdrawal failed";
|
|
387
|
-
setError(
|
|
395
|
+
setError(_chunkEDUWRMQIcjs.formatUserError.call(void 0, raw));
|
|
388
396
|
} finally {
|
|
389
397
|
setIsSubmitting(false);
|
|
390
398
|
}
|
|
391
|
-
}, [
|
|
399
|
+
}, [
|
|
400
|
+
recipient,
|
|
401
|
+
amount,
|
|
402
|
+
balance,
|
|
403
|
+
asset.decimals,
|
|
404
|
+
safeAddress,
|
|
405
|
+
depositAddress,
|
|
406
|
+
onSubmit
|
|
407
|
+
]);
|
|
392
408
|
if (isBalanceLoading) {
|
|
393
409
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
394
410
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-withdraw-loading", children: [
|
|
395
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
411
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEDUWRMQIcjs.Spinner, { className: "rs-spinner--lg" }),
|
|
396
412
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-withdraw-loading-title", children: "Loading on-chain balance" }),
|
|
397
413
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-withdraw-loading-subtitle", children: chainMismatch ? `Switch to ${_chunkABVRVW3Pcjs.getChainName.call(void 0, asset.chainId)} to continue.` : "Please wait before withdrawing." })
|
|
398
414
|
] }),
|
|
399
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
415
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEDUWRMQIcjs.PoweredBy, {})
|
|
400
416
|
] });
|
|
401
417
|
}
|
|
402
418
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
403
419
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
404
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
420
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEDUWRMQIcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEDUWRMQIcjs.CircleArrowOutUpLeftIcon, {}), title: "Withdraw" }),
|
|
405
421
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-section", children: [
|
|
406
422
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
407
423
|
"label",
|
|
@@ -423,7 +439,7 @@ function WithdrawFormStep({
|
|
|
423
439
|
onChange: (e) => {
|
|
424
440
|
const next = e.target.value.trim();
|
|
425
441
|
setRecipient(next);
|
|
426
|
-
_optionalChain([onRecipientChange, 'optionalCall',
|
|
442
|
+
_optionalChain([onRecipientChange, 'optionalCall', _9 => _9(next)]);
|
|
427
443
|
if (error) setError(null);
|
|
428
444
|
}
|
|
429
445
|
}
|
|
@@ -447,7 +463,7 @@ function WithdrawFormStep({
|
|
|
447
463
|
),
|
|
448
464
|
isRecipientConnected ? null : "Use connected"
|
|
449
465
|
] }) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
450
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
466
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEDUWRMQIcjs.WalletIcon, { className: "rs-withdraw-use-connected-icon" }),
|
|
451
467
|
isRecipientConnected ? null : "Use connected"
|
|
452
468
|
] })
|
|
453
469
|
}
|
|
@@ -487,7 +503,7 @@ function WithdrawFormStep({
|
|
|
487
503
|
) })
|
|
488
504
|
] }),
|
|
489
505
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-amount-info", children: [
|
|
490
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-withdraw-usd", children: amountUsd !== null ?
|
|
506
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-withdraw-usd", children: amountUsd !== null ? _chunkEDUWRMQIcjs.currencyFormatter.format(amountUsd) : "$0.00" }),
|
|
491
507
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-withdraw-balance", children: [
|
|
492
508
|
"Balance: ",
|
|
493
509
|
formattedBalance,
|
|
@@ -528,7 +544,7 @@ function WithdrawFormStep({
|
|
|
528
544
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: targetChainName })
|
|
529
545
|
] }),
|
|
530
546
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
531
|
-
|
|
547
|
+
_chunkEDUWRMQIcjs.ChevronDownIcon,
|
|
532
548
|
{
|
|
533
549
|
className: "rs-withdraw-dropdown-arrow",
|
|
534
550
|
style: {
|
|
@@ -597,7 +613,7 @@ function WithdrawFormStep({
|
|
|
597
613
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: targetSymbol })
|
|
598
614
|
] }),
|
|
599
615
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
600
|
-
|
|
616
|
+
_chunkEDUWRMQIcjs.ChevronDownIcon,
|
|
601
617
|
{
|
|
602
618
|
className: "rs-withdraw-dropdown-arrow",
|
|
603
619
|
style: {
|
|
@@ -637,10 +653,10 @@ function WithdrawFormStep({
|
|
|
637
653
|
] })
|
|
638
654
|
] }),
|
|
639
655
|
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 ${_chunkABVRVW3Pcjs.getChainName.call(void 0, asset.chainId)}...` : `Switch to ${_chunkABVRVW3Pcjs.getChainName.call(void 0, asset.chainId)} to continue.` }) }),
|
|
640
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
641
|
-
!error && registrationError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
656
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEDUWRMQIcjs.Callout, { variant: "error", children: error }),
|
|
657
|
+
!error && registrationError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEDUWRMQIcjs.Callout, { variant: "error", children: registrationError }),
|
|
642
658
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
643
|
-
|
|
659
|
+
_chunkEDUWRMQIcjs.Button,
|
|
644
660
|
{
|
|
645
661
|
onClick: handleWithdraw,
|
|
646
662
|
fullWidth: true,
|
|
@@ -650,7 +666,7 @@ function WithdrawFormStep({
|
|
|
650
666
|
}
|
|
651
667
|
)
|
|
652
668
|
] }),
|
|
653
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
669
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEDUWRMQIcjs.PoweredBy, {})
|
|
654
670
|
] });
|
|
655
671
|
}
|
|
656
672
|
WithdrawFormStep.displayName = "WithdrawFormStep";
|
|
@@ -685,9 +701,9 @@ function WithdrawReviewStep({
|
|
|
685
701
|
const sourceTokenIcon = _chunkABVRVW3Pcjs.getTokenIcon.call(void 0, sourceSymbol);
|
|
686
702
|
const targetTokenIcon = _chunkABVRVW3Pcjs.getTokenIcon.call(void 0, targetSymbol);
|
|
687
703
|
const amountNumber = Number(amount);
|
|
688
|
-
const formattedSendAmount = _nullishCoalesce(
|
|
689
|
-
const prices =
|
|
690
|
-
const receiveDisplay = _nullishCoalesce(
|
|
704
|
+
const formattedSendAmount = _nullishCoalesce(_chunkEDUWRMQIcjs.formatTokenAmount.call(void 0, amountNumber, sourceSymbol), () => ( amount));
|
|
705
|
+
const prices = _chunkEDUWRMQIcjs.useTokenPrices.call(void 0, service, [sourceSymbol, targetSymbol]);
|
|
706
|
+
const receiveDisplay = _nullishCoalesce(_chunkEDUWRMQIcjs.formatReceiveEstimate.call(void 0, {
|
|
691
707
|
sourceAmount: Number.isFinite(amountNumber) ? amountNumber : void 0,
|
|
692
708
|
sourceSymbol,
|
|
693
709
|
targetSymbol,
|
|
@@ -701,9 +717,9 @@ function WithdrawReviewStep({
|
|
|
701
717
|
await onConfirm();
|
|
702
718
|
} catch (err) {
|
|
703
719
|
const raw = err instanceof Error ? err.message : "Withdraw failed";
|
|
704
|
-
const message =
|
|
720
|
+
const message = _chunkEDUWRMQIcjs.formatUserError.call(void 0, raw);
|
|
705
721
|
setError(message);
|
|
706
|
-
_optionalChain([onError, 'optionalCall',
|
|
722
|
+
_optionalChain([onError, 'optionalCall', _10 => _10(message, "WITHDRAW_REVIEW_ERROR")]);
|
|
707
723
|
} finally {
|
|
708
724
|
setIsSubmitting(false);
|
|
709
725
|
}
|
|
@@ -712,9 +728,9 @@ function WithdrawReviewStep({
|
|
|
712
728
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
713
729
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
714
730
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
715
|
-
|
|
731
|
+
_chunkEDUWRMQIcjs.BodyHeader,
|
|
716
732
|
{
|
|
717
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
733
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEDUWRMQIcjs.CircleArrowOutUpLeftIcon, {}),
|
|
718
734
|
title: "Review withdrawal"
|
|
719
735
|
}
|
|
720
736
|
),
|
|
@@ -760,10 +776,10 @@ function WithdrawReviewStep({
|
|
|
760
776
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-value", children: estimatedTime })
|
|
761
777
|
] })
|
|
762
778
|
] }),
|
|
763
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
764
|
-
!error && registrationError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
779
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEDUWRMQIcjs.Callout, { variant: "error", children: error }),
|
|
780
|
+
!error && registrationError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEDUWRMQIcjs.Callout, { variant: "error", children: registrationError }),
|
|
765
781
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
766
|
-
|
|
782
|
+
_chunkEDUWRMQIcjs.Button,
|
|
767
783
|
{
|
|
768
784
|
onClick: handleConfirm,
|
|
769
785
|
loading: isSubmitting,
|
|
@@ -774,7 +790,7 @@ function WithdrawReviewStep({
|
|
|
774
790
|
}
|
|
775
791
|
)
|
|
776
792
|
] }),
|
|
777
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
793
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEDUWRMQIcjs.PoweredBy, {})
|
|
778
794
|
] });
|
|
779
795
|
}
|
|
780
796
|
WithdrawReviewStep.displayName = "WithdrawReviewStep";
|
|
@@ -786,20 +802,20 @@ var ADDR_REGEX = /^0x[a-fA-F0-9]{40}$/;
|
|
|
786
802
|
var REGISTRATION_DEBOUNCE_MS = 600;
|
|
787
803
|
var WITHDRAW_INDEXING_DELAY_MS = 2e3;
|
|
788
804
|
function resolveSessionOwner(eoaAddress) {
|
|
789
|
-
const localOwner =
|
|
805
|
+
const localOwner = _chunkEDUWRMQIcjs.loadSessionOwnerFromStorage.call(void 0, eoaAddress);
|
|
790
806
|
if (localOwner) {
|
|
791
807
|
return {
|
|
792
|
-
account:
|
|
808
|
+
account: _chunkEDUWRMQIcjs.accountFromPrivateKey.call(void 0, localOwner.privateKey),
|
|
793
809
|
address: localOwner.address
|
|
794
810
|
};
|
|
795
811
|
}
|
|
796
|
-
const created =
|
|
797
|
-
|
|
812
|
+
const created = _chunkEDUWRMQIcjs.createSessionOwnerKey.call(void 0, );
|
|
813
|
+
_chunkEDUWRMQIcjs.saveSessionOwnerToStorage.call(void 0, eoaAddress, created.privateKey, created.address);
|
|
798
814
|
return { account: created.account, address: created.address };
|
|
799
815
|
}
|
|
800
816
|
function targetsEqual(a, b) {
|
|
801
817
|
if (!a) return false;
|
|
802
|
-
return a.chain === b.chain && a.token.toLowerCase() === b.token.toLowerCase() && (_nullishCoalesce(_optionalChain([a, 'access',
|
|
818
|
+
return a.chain === b.chain && a.token.toLowerCase() === b.token.toLowerCase() && (_nullishCoalesce(_optionalChain([a, 'access', _11 => _11.recipient, 'optionalAccess', _12 => _12.toLowerCase, 'call', _13 => _13()]), () => ( ""))) === (_nullishCoalesce(_optionalChain([b, 'access', _14 => _14.recipient, 'optionalAccess', _15 => _15.toLowerCase, 'call', _16 => _16()]), () => ( "")));
|
|
803
819
|
}
|
|
804
820
|
function WithdrawFlow({
|
|
805
821
|
dappWalletClient,
|
|
@@ -829,10 +845,10 @@ function WithdrawFlow({
|
|
|
829
845
|
onError,
|
|
830
846
|
debug
|
|
831
847
|
}) {
|
|
832
|
-
const onStepChangeRef =
|
|
833
|
-
const onEventRef =
|
|
834
|
-
const onLifecycleRef =
|
|
835
|
-
const onErrorRef =
|
|
848
|
+
const onStepChangeRef = _chunkEDUWRMQIcjs.useLatestRef.call(void 0, onStepChange);
|
|
849
|
+
const onEventRef = _chunkEDUWRMQIcjs.useLatestRef.call(void 0, onEvent);
|
|
850
|
+
const onLifecycleRef = _chunkEDUWRMQIcjs.useLatestRef.call(void 0, onLifecycle);
|
|
851
|
+
const onErrorRef = _chunkEDUWRMQIcjs.useLatestRef.call(void 0, onError);
|
|
836
852
|
const isFlowActiveRef = _react.useRef.call(void 0, true);
|
|
837
853
|
const submitGenerationRef = _react.useRef.call(void 0, 0);
|
|
838
854
|
_react.useEffect.call(void 0, () => {
|
|
@@ -843,13 +859,13 @@ function WithdrawFlow({
|
|
|
843
859
|
}, []);
|
|
844
860
|
const logFlow = _react.useCallback.call(void 0,
|
|
845
861
|
(message, data) => {
|
|
846
|
-
|
|
862
|
+
_chunkEDUWRMQIcjs.debugLog.call(void 0, debug, "withdraw-flow", message, data);
|
|
847
863
|
},
|
|
848
864
|
[debug]
|
|
849
865
|
);
|
|
850
866
|
const logFlowError = _react.useCallback.call(void 0,
|
|
851
867
|
(message, error, data) => {
|
|
852
|
-
|
|
868
|
+
_chunkEDUWRMQIcjs.debugError.call(void 0, debug, "withdraw-flow", message, error, data);
|
|
853
869
|
},
|
|
854
870
|
[debug]
|
|
855
871
|
);
|
|
@@ -869,15 +885,15 @@ function WithdrawFlow({
|
|
|
869
885
|
}, [defaultRecipient]);
|
|
870
886
|
const hasCustomSigner = Boolean(dappAddress && onSignTransaction);
|
|
871
887
|
const dappSwitchChain = _react.useMemo.call(void 0, () => {
|
|
872
|
-
if (!_optionalChain([dappWalletClient, 'optionalAccess',
|
|
888
|
+
if (!_optionalChain([dappWalletClient, 'optionalAccess', _17 => _17.switchChain])) return void 0;
|
|
873
889
|
return async (chainId) => {
|
|
874
|
-
await _optionalChain([dappWalletClient, 'access',
|
|
890
|
+
await _optionalChain([dappWalletClient, 'access', _18 => _18.switchChain, 'optionalCall', _19 => _19({ id: chainId })]);
|
|
875
891
|
};
|
|
876
892
|
}, [dappWalletClient]);
|
|
877
893
|
const walletOptions = _react.useMemo.call(void 0, () => {
|
|
878
894
|
const options = [];
|
|
879
895
|
const seen = /* @__PURE__ */ new Set();
|
|
880
|
-
if (_optionalChain([dappWalletClient, 'optionalAccess',
|
|
896
|
+
if (_optionalChain([dappWalletClient, 'optionalAccess', _20 => _20.account]) && dappAddress) {
|
|
881
897
|
const id = `evm:${dappWalletClient.account.address.toLowerCase()}`;
|
|
882
898
|
options.push({
|
|
883
899
|
id,
|
|
@@ -887,7 +903,7 @@ function WithdrawFlow({
|
|
|
887
903
|
});
|
|
888
904
|
seen.add(id);
|
|
889
905
|
}
|
|
890
|
-
if (_optionalChain([reownWallet, 'optionalAccess',
|
|
906
|
+
if (_optionalChain([reownWallet, 'optionalAccess', _21 => _21.address]) && reownWallet.isConnected && reownWallet.walletClient && reownWallet.publicClient) {
|
|
891
907
|
const id = `evm:${reownWallet.address.toLowerCase()}`;
|
|
892
908
|
if (!seen.has(id)) {
|
|
893
909
|
options.push({
|
|
@@ -903,13 +919,13 @@ function WithdrawFlow({
|
|
|
903
919
|
}, [
|
|
904
920
|
dappWalletClient,
|
|
905
921
|
dappAddress,
|
|
906
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
907
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
908
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
909
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
910
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
922
|
+
_optionalChain([reownWallet, 'optionalAccess', _22 => _22.address]),
|
|
923
|
+
_optionalChain([reownWallet, 'optionalAccess', _23 => _23.isConnected]),
|
|
924
|
+
_optionalChain([reownWallet, 'optionalAccess', _24 => _24.walletClient]),
|
|
925
|
+
_optionalChain([reownWallet, 'optionalAccess', _25 => _25.publicClient]),
|
|
926
|
+
_optionalChain([reownWallet, 'optionalAccess', _26 => _26.icon])
|
|
911
927
|
]);
|
|
912
|
-
const canAutoLock = hasCustomSigner || Boolean(_optionalChain([dappWalletClient, 'optionalAccess',
|
|
928
|
+
const canAutoLock = hasCustomSigner || Boolean(_optionalChain([dappWalletClient, 'optionalAccess', _27 => _27.account]) && dappAddress) && !reownWallet;
|
|
913
929
|
const storeApi = useWithdrawStoreApi();
|
|
914
930
|
const selectedWalletId = useWithdrawStore((s) => s.selectedWalletId);
|
|
915
931
|
const registration = useWithdrawStore((s) => s.registration);
|
|
@@ -925,29 +941,29 @@ function WithdrawFlow({
|
|
|
925
941
|
return {
|
|
926
942
|
ownerAddress: dappAddress,
|
|
927
943
|
walletClient: _nullishCoalesce(dappWalletClient, () => ( void 0)),
|
|
928
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
944
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkEDUWRMQIcjs.getPublicClient.call(void 0, sourceChain))),
|
|
929
945
|
switchChain: dappSwitchChain
|
|
930
946
|
};
|
|
931
947
|
}
|
|
932
948
|
return {
|
|
933
949
|
ownerAddress: dappWalletClient.account.address,
|
|
934
950
|
walletClient: dappWalletClient,
|
|
935
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
951
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkEDUWRMQIcjs.getPublicClient.call(void 0, sourceChain))),
|
|
936
952
|
switchChain: dappSwitchChain
|
|
937
953
|
};
|
|
938
954
|
}
|
|
939
955
|
if (!isConnectSelectionConfirmed || !selectedWalletId) return null;
|
|
940
956
|
const selectedOption = walletOptions.find((o) => o.id === selectedWalletId);
|
|
941
957
|
if (!selectedOption || !selectedOption.address) return null;
|
|
942
|
-
if (selectedOption.kind === "connected" && _optionalChain([dappWalletClient, 'optionalAccess',
|
|
958
|
+
if (selectedOption.kind === "connected" && _optionalChain([dappWalletClient, 'optionalAccess', _28 => _28.account]) && dappWalletClient.account.address.toLowerCase() === selectedOption.address.toLowerCase()) {
|
|
943
959
|
return {
|
|
944
960
|
ownerAddress: dappWalletClient.account.address,
|
|
945
961
|
walletClient: dappWalletClient,
|
|
946
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
962
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkEDUWRMQIcjs.getPublicClient.call(void 0, sourceChain))),
|
|
947
963
|
switchChain: dappSwitchChain
|
|
948
964
|
};
|
|
949
965
|
}
|
|
950
|
-
if (selectedOption.kind === "external" && _optionalChain([reownWallet, 'optionalAccess',
|
|
966
|
+
if (selectedOption.kind === "external" && _optionalChain([reownWallet, 'optionalAccess', _29 => _29.address, 'optionalAccess', _30 => _30.toLowerCase, 'call', _31 => _31()]) === selectedOption.address.toLowerCase() && reownWallet.walletClient && reownWallet.publicClient) {
|
|
951
967
|
return {
|
|
952
968
|
ownerAddress: reownWallet.address,
|
|
953
969
|
walletClient: reownWallet.walletClient,
|
|
@@ -969,7 +985,7 @@ function WithdrawFlow({
|
|
|
969
985
|
reownWallet,
|
|
970
986
|
sourceChain
|
|
971
987
|
]);
|
|
972
|
-
const ownerAddress = _optionalChain([signerContext, 'optionalAccess',
|
|
988
|
+
const ownerAddress = _optionalChain([signerContext, 'optionalAccess', _32 => _32.ownerAddress]);
|
|
973
989
|
const recipientForRegistration = _react.useMemo.call(void 0, () => {
|
|
974
990
|
if (!recipientInput) return void 0;
|
|
975
991
|
return ADDR_REGEX.test(recipientInput) ? recipientInput : void 0;
|
|
@@ -1025,7 +1041,7 @@ function WithdrawFlow({
|
|
|
1025
1041
|
message: typedData.message
|
|
1026
1042
|
});
|
|
1027
1043
|
if (cancelled) return;
|
|
1028
|
-
const sessionDetails =
|
|
1044
|
+
const sessionDetails = _chunkEDUWRMQIcjs.buildSessionDetails.call(void 0,
|
|
1029
1045
|
setup.sessionDetailsUnsigned,
|
|
1030
1046
|
signature
|
|
1031
1047
|
);
|
|
@@ -1054,7 +1070,7 @@ function WithdrawFlow({
|
|
|
1054
1070
|
smartAccount: setup.smartAccount,
|
|
1055
1071
|
registeredTarget: desiredTarget
|
|
1056
1072
|
});
|
|
1057
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
1073
|
+
_optionalChain([onLifecycleRef, 'access', _33 => _33.current, 'optionalCall', _34 => _34({
|
|
1058
1074
|
type: "connected",
|
|
1059
1075
|
address: ownerAddress,
|
|
1060
1076
|
smartAccount: setup.smartAccount
|
|
@@ -1062,7 +1078,7 @@ function WithdrawFlow({
|
|
|
1062
1078
|
} catch (err) {
|
|
1063
1079
|
if (cancelled) return;
|
|
1064
1080
|
const raw = err instanceof Error ? err.message : "Registration failed";
|
|
1065
|
-
const message =
|
|
1081
|
+
const message = _chunkEDUWRMQIcjs.formatUserError.call(void 0, raw);
|
|
1066
1082
|
logFlowError("auto-register:failed", err, {
|
|
1067
1083
|
ownerAddress,
|
|
1068
1084
|
targetChain,
|
|
@@ -1072,7 +1088,7 @@ function WithdrawFlow({
|
|
|
1072
1088
|
type: "registration/failed",
|
|
1073
1089
|
error: message
|
|
1074
1090
|
});
|
|
1075
|
-
_optionalChain([onErrorRef, 'access',
|
|
1091
|
+
_optionalChain([onErrorRef, 'access', _35 => _35.current, 'optionalCall', _36 => _36({ message, code: "WITHDRAW_REGISTER_FAILED" })]);
|
|
1076
1092
|
}
|
|
1077
1093
|
}, REGISTRATION_DEBOUNCE_MS);
|
|
1078
1094
|
return () => {
|
|
@@ -1098,7 +1114,7 @@ function WithdrawFlow({
|
|
|
1098
1114
|
const symbol = _chunkABVRVW3Pcjs.getTokenSymbol.call(void 0, sourceToken, sourceChain);
|
|
1099
1115
|
const decimals = _chunkABVRVW3Pcjs.getTokenDecimalsByAddress.call(void 0, sourceToken, sourceChain);
|
|
1100
1116
|
return {
|
|
1101
|
-
id:
|
|
1117
|
+
id: _chunkEDUWRMQIcjs.getAssetId.call(void 0, { chainId: sourceChain, token: sourceToken }),
|
|
1102
1118
|
chainId: sourceChain,
|
|
1103
1119
|
token: sourceToken,
|
|
1104
1120
|
symbol,
|
|
@@ -1119,7 +1135,7 @@ function WithdrawFlow({
|
|
|
1119
1135
|
storeApi.dispatch({ type: "review/back" });
|
|
1120
1136
|
}, [storeApi]);
|
|
1121
1137
|
_react.useEffect.call(void 0, () => {
|
|
1122
|
-
_optionalChain([onStepChangeRef, 'access',
|
|
1138
|
+
_optionalChain([onStepChangeRef, 'access', _37 => _37.current, 'optionalCall', _38 => _38(
|
|
1123
1139
|
flowStep === "review" ? reviewBackHandler : void 0
|
|
1124
1140
|
)]);
|
|
1125
1141
|
}, [flowStep, reviewBackHandler, onStepChangeRef]);
|
|
@@ -1133,7 +1149,7 @@ function WithdrawFlow({
|
|
|
1133
1149
|
lastStepOpenEventKeyRef.current = "form";
|
|
1134
1150
|
const tokenSymbol = _chunkABVRVW3Pcjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
1135
1151
|
const chainName = _chunkABVRVW3Pcjs.getChainName.call(void 0, targetChain);
|
|
1136
|
-
_optionalChain([onEventRef, 'access',
|
|
1152
|
+
_optionalChain([onEventRef, 'access', _39 => _39.current, 'optionalCall', _40 => _40({
|
|
1137
1153
|
type: "withdraw_modal_select_amount_open",
|
|
1138
1154
|
pred_balance: totalBalanceUsd,
|
|
1139
1155
|
default_token: tokenSymbol,
|
|
@@ -1163,7 +1179,7 @@ function WithdrawFlow({
|
|
|
1163
1179
|
const handleError = _react.useCallback.call(void 0,
|
|
1164
1180
|
(message, code) => {
|
|
1165
1181
|
logFlowError("flow:error", message, { code });
|
|
1166
|
-
_optionalChain([onErrorRef, 'access',
|
|
1182
|
+
_optionalChain([onErrorRef, 'access', _41 => _41.current, 'optionalCall', _42 => _42({ message, code })]);
|
|
1167
1183
|
},
|
|
1168
1184
|
[logFlowError, onErrorRef]
|
|
1169
1185
|
);
|
|
@@ -1171,7 +1187,7 @@ function WithdrawFlow({
|
|
|
1171
1187
|
(recipient, amountValue) => {
|
|
1172
1188
|
const tokenSymbol = _chunkABVRVW3Pcjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
1173
1189
|
const chainName = _chunkABVRVW3Pcjs.getChainName.call(void 0, targetChain);
|
|
1174
|
-
_optionalChain([onEventRef, 'access',
|
|
1190
|
+
_optionalChain([onEventRef, 'access', _43 => _43.current, 'optionalCall', _44 => _44({
|
|
1175
1191
|
type: "withdraw_modal_select_amount_cta_click",
|
|
1176
1192
|
pred_balance: totalBalanceUsd,
|
|
1177
1193
|
selected_token: tokenSymbol,
|
|
@@ -1209,7 +1225,13 @@ function WithdrawFlow({
|
|
|
1209
1225
|
throw new Error("Withdrawal target is still being prepared");
|
|
1210
1226
|
}
|
|
1211
1227
|
const smartAccount = matchingRegistration.smartAccount;
|
|
1212
|
-
|
|
1228
|
+
const lowerRecipient = recipient.toLowerCase();
|
|
1229
|
+
if (lowerRecipient === safeAddress.toLowerCase() || lowerRecipient === smartAccount.toLowerCase()) {
|
|
1230
|
+
throw new Error(
|
|
1231
|
+
"Recipient can't be your own account. Send to a different wallet."
|
|
1232
|
+
);
|
|
1233
|
+
}
|
|
1234
|
+
if (!onSignTransaction && !_optionalChain([signerContext, 'optionalAccess', _45 => _45.walletClient])) {
|
|
1213
1235
|
throw new Error("Wallet not connected");
|
|
1214
1236
|
}
|
|
1215
1237
|
const submitGeneration = submitGenerationRef.current += 1;
|
|
@@ -1232,7 +1254,7 @@ function WithdrawFlow({
|
|
|
1232
1254
|
targetToken
|
|
1233
1255
|
});
|
|
1234
1256
|
const amountUnits = _viem.parseUnits.call(void 0, amountValue, asset.decimals);
|
|
1235
|
-
const pc = _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess',
|
|
1257
|
+
const pc = _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess', _46 => _46.publicClient]), () => ( _chunkEDUWRMQIcjs.getPublicClient.call(void 0, sourceChain)));
|
|
1236
1258
|
let result;
|
|
1237
1259
|
if (onSignTransaction) {
|
|
1238
1260
|
const transferTarget = isSameRoute ? recipient : smartAccount;
|
|
@@ -1304,7 +1326,7 @@ function WithdrawFlow({
|
|
|
1304
1326
|
sourceChain,
|
|
1305
1327
|
sourceToken
|
|
1306
1328
|
});
|
|
1307
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
1329
|
+
_optionalChain([onLifecycleRef, 'access', _47 => _47.current, 'optionalCall', _48 => _48({
|
|
1308
1330
|
type: "submitted",
|
|
1309
1331
|
txHash: result.txHash,
|
|
1310
1332
|
sourceChain,
|
|
@@ -1320,7 +1342,7 @@ function WithdrawFlow({
|
|
|
1320
1342
|
targetChain,
|
|
1321
1343
|
targetToken
|
|
1322
1344
|
});
|
|
1323
|
-
handleError(
|
|
1345
|
+
handleError(_chunkEDUWRMQIcjs.formatUserError.call(void 0, raw), "WITHDRAW_FLOW_ERROR");
|
|
1324
1346
|
throw err;
|
|
1325
1347
|
}
|
|
1326
1348
|
},
|
|
@@ -1346,7 +1368,7 @@ function WithdrawFlow({
|
|
|
1346
1368
|
const handleWithdrawComplete = _react.useCallback.call(void 0,
|
|
1347
1369
|
(txHash, destinationTxHash, context) => {
|
|
1348
1370
|
logFlow("withdraw:complete", { txHash, destinationTxHash, ...context });
|
|
1349
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
1371
|
+
_optionalChain([onLifecycleRef, 'access', _49 => _49.current, 'optionalCall', _50 => _50({
|
|
1350
1372
|
type: "complete",
|
|
1351
1373
|
txHash,
|
|
1352
1374
|
destinationTxHash,
|
|
@@ -1367,7 +1389,7 @@ function WithdrawFlow({
|
|
|
1367
1389
|
const handleWithdrawFailed = _react.useCallback.call(void 0,
|
|
1368
1390
|
(txHash, error) => {
|
|
1369
1391
|
logFlowError("withdraw:failed", error, { txHash });
|
|
1370
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
1392
|
+
_optionalChain([onLifecycleRef, 'access', _51 => _51.current, 'optionalCall', _52 => _52({
|
|
1371
1393
|
type: "failed",
|
|
1372
1394
|
txHash,
|
|
1373
1395
|
error
|
|
@@ -1377,12 +1399,12 @@ function WithdrawFlow({
|
|
|
1377
1399
|
[logFlowError, onLifecycleRef, storeApi]
|
|
1378
1400
|
);
|
|
1379
1401
|
const allowedChainSet = _react.useMemo.call(void 0,
|
|
1380
|
-
() => _optionalChain([allowedRoutes, 'optionalAccess',
|
|
1381
|
-
[_optionalChain([allowedRoutes, 'optionalAccess',
|
|
1402
|
+
() => _optionalChain([allowedRoutes, 'optionalAccess', _53 => _53.sourceChains]) ? new Set(allowedRoutes.sourceChains) : null,
|
|
1403
|
+
[_optionalChain([allowedRoutes, 'optionalAccess', _54 => _54.sourceChains])]
|
|
1382
1404
|
);
|
|
1383
1405
|
const allowedTokenSet = _react.useMemo.call(void 0,
|
|
1384
|
-
() => _optionalChain([allowedRoutes, 'optionalAccess',
|
|
1385
|
-
[_optionalChain([allowedRoutes, 'optionalAccess',
|
|
1406
|
+
() => _optionalChain([allowedRoutes, 'optionalAccess', _55 => _55.sourceTokens]) ? new Set(allowedRoutes.sourceTokens.map((s) => s.toUpperCase())) : null,
|
|
1407
|
+
[_optionalChain([allowedRoutes, 'optionalAccess', _56 => _56.sourceTokens])]
|
|
1386
1408
|
);
|
|
1387
1409
|
const targetChainOptions = _react.useMemo.call(void 0, () => {
|
|
1388
1410
|
return _chunkABVRVW3Pcjs.SOURCE_CHAINS.filter((chain) => {
|
|
@@ -1445,10 +1467,10 @@ function WithdrawFlow({
|
|
|
1445
1467
|
const selectedWalletIcon = _react.useMemo.call(void 0, () => {
|
|
1446
1468
|
if (!ownerAddress) return void 0;
|
|
1447
1469
|
const selected = walletOptions.find(
|
|
1448
|
-
(o) => _optionalChain([o, 'access',
|
|
1470
|
+
(o) => _optionalChain([o, 'access', _57 => _57.address, 'optionalAccess', _58 => _58.toLowerCase, 'call', _59 => _59()]) === ownerAddress.toLowerCase()
|
|
1449
1471
|
);
|
|
1450
|
-
return _optionalChain([selected, 'optionalAccess',
|
|
1451
|
-
}, [walletOptions, ownerAddress, _optionalChain([reownWallet, 'optionalAccess',
|
|
1472
|
+
return _optionalChain([selected, 'optionalAccess', _60 => _60.kind]) === "external" ? _nullishCoalesce(selected.icon, () => ( _optionalChain([reownWallet, 'optionalAccess', _61 => _61.icon]))) : void 0;
|
|
1473
|
+
}, [walletOptions, ownerAddress, _optionalChain([reownWallet, 'optionalAccess', _62 => _62.icon])]);
|
|
1452
1474
|
if (showConnectStep) {
|
|
1453
1475
|
const withdrawRows = walletOptions.map((option) => ({
|
|
1454
1476
|
id: option.id,
|
|
@@ -1459,7 +1481,7 @@ function WithdrawFlow({
|
|
|
1459
1481
|
state: "ready"
|
|
1460
1482
|
}));
|
|
1461
1483
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1462
|
-
|
|
1484
|
+
_chunkEDUWRMQIcjs.ConnectStep,
|
|
1463
1485
|
{
|
|
1464
1486
|
walletRows: withdrawRows,
|
|
1465
1487
|
onConfirmWallet: (walletId) => {
|
|
@@ -1476,8 +1498,9 @@ function WithdrawFlow({
|
|
|
1476
1498
|
}
|
|
1477
1499
|
if (!signerContext) return null;
|
|
1478
1500
|
if (!onSignTransaction && !signerContext.walletClient) return null;
|
|
1479
|
-
const resolvedConnectedRecipient = _optionalChain([selectedWalletOption, 'optionalAccess',
|
|
1480
|
-
const formPublicClient = _nullishCoalesce(signerContext.publicClient, () => (
|
|
1501
|
+
const resolvedConnectedRecipient = _optionalChain([selectedWalletOption, 'optionalAccess', _63 => _63.kind]) === "external" ? selectedWalletOption.address : void 0;
|
|
1502
|
+
const formPublicClient = _nullishCoalesce(signerContext.publicClient, () => ( _chunkEDUWRMQIcjs.getPublicClient.call(void 0, sourceChain)));
|
|
1503
|
+
const depositAddress = registration.kind === "ready" || registration.kind === "stale" ? registration.smartAccount : void 0;
|
|
1481
1504
|
const stepView = deriveStepView(flowStep, registration);
|
|
1482
1505
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
1483
1506
|
stepView === "form" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -1487,6 +1510,7 @@ function WithdrawFlow({
|
|
|
1487
1510
|
publicClient: formPublicClient,
|
|
1488
1511
|
connectedRecipient: resolvedConnectedRecipient,
|
|
1489
1512
|
safeAddress,
|
|
1513
|
+
depositAddress,
|
|
1490
1514
|
asset,
|
|
1491
1515
|
defaultRecipient,
|
|
1492
1516
|
defaultAmount,
|
|
@@ -1522,7 +1546,7 @@ function WithdrawFlow({
|
|
|
1522
1546
|
}
|
|
1523
1547
|
),
|
|
1524
1548
|
stepView === "processing" && registration.kind !== "idle" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1525
|
-
|
|
1549
|
+
_chunkEDUWRMQIcjs.ProcessingStep,
|
|
1526
1550
|
{
|
|
1527
1551
|
smartAccount: registration.kind === "ready" || registration.kind === "stale" ? registration.smartAccount : "0x0",
|
|
1528
1552
|
txHash: _nullishCoalesce(storeApi.getState().txHash, () => ( "0x0")),
|
|
@@ -1564,7 +1588,7 @@ function deriveStepView(step, _registration) {
|
|
|
1564
1588
|
// src/WithdrawModal.tsx
|
|
1565
1589
|
|
|
1566
1590
|
var ReownWithdrawInner = _react.lazy.call(void 0,
|
|
1567
|
-
() => Promise.resolve().then(() => _interopRequireWildcard(require("./WithdrawModalReown-
|
|
1591
|
+
() => Promise.resolve().then(() => _interopRequireWildcard(require("./WithdrawModalReown-KKGW62YO.cjs"))).then((m) => ({
|
|
1568
1592
|
default: m.WithdrawModalReown
|
|
1569
1593
|
}))
|
|
1570
1594
|
);
|
|
@@ -1611,21 +1635,21 @@ function WithdrawModalInner({
|
|
|
1611
1635
|
debug
|
|
1612
1636
|
}) {
|
|
1613
1637
|
const modalRef = _react.useRef.call(void 0, null);
|
|
1614
|
-
const onReadyRef =
|
|
1638
|
+
const onReadyRef = _chunkEDUWRMQIcjs.useLatestRef.call(void 0, onReady);
|
|
1615
1639
|
const [backHandler, setBackHandler] = _react.useState.call(void 0,
|
|
1616
1640
|
void 0
|
|
1617
1641
|
);
|
|
1618
1642
|
const targetChain = _chunkABVRVW3Pcjs.getChainId.call(void 0, targetChainProp);
|
|
1619
1643
|
const sourceChain = _chunkABVRVW3Pcjs.getChainId.call(void 0, sourceChainProp);
|
|
1620
1644
|
const service = _react.useMemo.call(void 0,
|
|
1621
|
-
() =>
|
|
1645
|
+
() => _chunkEDUWRMQIcjs.createDepositService.call(void 0, backendUrl, { debug, debugScope: "service:withdraw" }),
|
|
1622
1646
|
[backendUrl, debug]
|
|
1623
1647
|
);
|
|
1624
1648
|
const store = _react.useMemo.call(void 0, () => createWithdrawStore(), []);
|
|
1625
|
-
const onErrorRef =
|
|
1649
|
+
const onErrorRef = _chunkEDUWRMQIcjs.useLatestRef.call(void 0, onError);
|
|
1626
1650
|
_react.useEffect.call(void 0, () => {
|
|
1627
1651
|
if (isOpen && onSignTransaction && !dappAddress) {
|
|
1628
|
-
_optionalChain([onErrorRef, 'access',
|
|
1652
|
+
_optionalChain([onErrorRef, 'access', _64 => _64.current, 'optionalCall', _65 => _65({
|
|
1629
1653
|
message: "WithdrawModal requires `dappAddress` when `onSignTransaction` is provided.",
|
|
1630
1654
|
code: "WITHDRAW_MISSING_DAPP_ADDRESS"
|
|
1631
1655
|
})]);
|
|
@@ -1633,12 +1657,12 @@ function WithdrawModalInner({
|
|
|
1633
1657
|
}, [isOpen, onSignTransaction, dappAddress, onErrorRef]);
|
|
1634
1658
|
_react.useEffect.call(void 0, () => {
|
|
1635
1659
|
if (isOpen && modalRef.current) {
|
|
1636
|
-
|
|
1660
|
+
_chunkEDUWRMQIcjs.applyTheme.call(void 0, modalRef.current, theme);
|
|
1637
1661
|
}
|
|
1638
1662
|
}, [isOpen, theme]);
|
|
1639
1663
|
_react.useEffect.call(void 0, () => {
|
|
1640
1664
|
if (isOpen) {
|
|
1641
|
-
_optionalChain([onReadyRef, 'access',
|
|
1665
|
+
_optionalChain([onReadyRef, 'access', _66 => _66.current, 'optionalCall', _67 => _67()]);
|
|
1642
1666
|
}
|
|
1643
1667
|
}, [isOpen, onReadyRef]);
|
|
1644
1668
|
_react.useEffect.call(void 0, () => {
|
|
@@ -1649,10 +1673,10 @@ function WithdrawModalInner({
|
|
|
1649
1673
|
const handleStepChange = _react.useCallback.call(void 0, (onBack) => {
|
|
1650
1674
|
setBackHandler(() => onBack);
|
|
1651
1675
|
}, []);
|
|
1652
|
-
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
1676
|
+
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _68 => _68.showBackButton]), () => ( true));
|
|
1653
1677
|
const canGoBack = backHandler !== void 0;
|
|
1654
1678
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, WithdrawStoreProvider, { store, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1655
|
-
|
|
1679
|
+
_chunkEDUWRMQIcjs.Modal,
|
|
1656
1680
|
{
|
|
1657
1681
|
isOpen,
|
|
1658
1682
|
onClose,
|
|
@@ -1668,7 +1692,7 @@ function WithdrawModalInner({
|
|
|
1668
1692
|
className: "rs-modal-header-back",
|
|
1669
1693
|
"aria-label": "Go back",
|
|
1670
1694
|
onClick: backHandler,
|
|
1671
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1695
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEDUWRMQIcjs.ChevronLeftIcon, {})
|
|
1672
1696
|
}
|
|
1673
1697
|
) }),
|
|
1674
1698
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-header-nav-right", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -1678,7 +1702,7 @@ function WithdrawModalInner({
|
|
|
1678
1702
|
onClick: onClose,
|
|
1679
1703
|
className: "rs-modal-close",
|
|
1680
1704
|
"aria-label": "Close",
|
|
1681
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1705
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEDUWRMQIcjs.CloseIcon, {})
|
|
1682
1706
|
}
|
|
1683
1707
|
) })
|
|
1684
1708
|
] }),
|