@rhinestone/deposit-modal 0.4.3 → 0.5.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/dist/{DepositModalReown-ORSBSEMO.mjs → DepositModalReown-6AO4QURQ.mjs} +4 -3
- package/dist/{DepositModalReown-MCDIOJLT.cjs → DepositModalReown-GHEUERDG.cjs} +7 -6
- package/dist/{WithdrawModalReown-XPB53FKZ.mjs → WithdrawModalReown-FRMD2ACH.mjs} +12 -4
- package/dist/{WithdrawModalReown-KKGW62YO.cjs → WithdrawModalReown-LIP6FHCB.cjs} +14 -6
- package/dist/{chunk-PQDHZZ2B.cjs → chunk-H7727ABX.cjs} +28 -6
- package/dist/{chunk-V72YVCR6.mjs → chunk-LCKO6C76.mjs} +28 -6
- package/dist/{chunk-36R7XKXP.cjs → chunk-MXFZ6Q7F.cjs} +365 -336
- package/dist/{chunk-EDUWRMQI.cjs → chunk-PPFG3VBD.cjs} +123 -88
- package/dist/{chunk-7EQQD7B4.mjs → chunk-PS7HJ62M.mjs} +51 -16
- package/dist/{chunk-IDJBMNV2.mjs → chunk-V6KJKRE7.mjs} +17 -11
- package/dist/{chunk-3NZUMDST.cjs → chunk-XQH2APMO.cjs} +64 -58
- package/dist/{chunk-ANPDY6NJ.mjs → chunk-ZYYLKWU2.mjs} +70 -41
- 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/styles.css +59 -31
- package/dist/{types-CUOqIIvZ.d.cts → types-_m8w8BYq.d.cts} +29 -2
- package/dist/{types-CUOqIIvZ.d.ts → types-_m8w8BYq.d.ts} +29 -2
- 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 +9 -8
|
@@ -30,7 +30,9 @@
|
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
var _chunkPPFG3VBDcjs = require('./chunk-PPFG3VBD.cjs');
|
|
34
36
|
|
|
35
37
|
|
|
36
38
|
|
|
@@ -261,7 +263,7 @@ function WithdrawFormStep({
|
|
|
261
263
|
setIsSwitching(true);
|
|
262
264
|
switchChain(asset.chainId).catch((err) => {
|
|
263
265
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
264
|
-
setError(
|
|
266
|
+
setError(_chunkPPFG3VBDcjs.formatUserError.call(void 0, raw));
|
|
265
267
|
}).finally(() => {
|
|
266
268
|
setIsSwitching(false);
|
|
267
269
|
});
|
|
@@ -281,7 +283,7 @@ function WithdrawFormStep({
|
|
|
281
283
|
return;
|
|
282
284
|
}
|
|
283
285
|
try {
|
|
284
|
-
const bal =
|
|
286
|
+
const bal = _chunkPPFG3VBDcjs.isNativeAsset.call(void 0, asset) ? await publicClient.getBalance({ address: safeAddress }) : await publicClient.readContract({
|
|
285
287
|
address: asset.token,
|
|
286
288
|
abi: _viem.erc20Abi,
|
|
287
289
|
functionName: "balanceOf",
|
|
@@ -392,7 +394,7 @@ function WithdrawFormStep({
|
|
|
392
394
|
await onSubmit(recipient, amount);
|
|
393
395
|
} catch (err) {
|
|
394
396
|
const raw = err instanceof Error ? err.message : "Withdrawal failed";
|
|
395
|
-
setError(
|
|
397
|
+
setError(_chunkPPFG3VBDcjs.formatUserError.call(void 0, raw));
|
|
396
398
|
} finally {
|
|
397
399
|
setIsSubmitting(false);
|
|
398
400
|
}
|
|
@@ -408,16 +410,16 @@ function WithdrawFormStep({
|
|
|
408
410
|
if (isBalanceLoading) {
|
|
409
411
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
410
412
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-withdraw-loading", children: [
|
|
411
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
413
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.Spinner, { className: "rs-spinner--lg" }),
|
|
412
414
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-withdraw-loading-title", children: "Loading on-chain balance" }),
|
|
413
415
|
/* @__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." })
|
|
414
416
|
] }),
|
|
415
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
417
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.PoweredBy, {})
|
|
416
418
|
] });
|
|
417
419
|
}
|
|
418
420
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
419
421
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
420
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
422
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.CircleArrowOutUpLeftIcon, {}), title: "Withdraw" }),
|
|
421
423
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-section", children: [
|
|
422
424
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
423
425
|
"label",
|
|
@@ -463,7 +465,7 @@ function WithdrawFormStep({
|
|
|
463
465
|
),
|
|
464
466
|
isRecipientConnected ? null : "Use connected"
|
|
465
467
|
] }) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
466
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
468
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.WalletIcon, { className: "rs-withdraw-use-connected-icon" }),
|
|
467
469
|
isRecipientConnected ? null : "Use connected"
|
|
468
470
|
] })
|
|
469
471
|
}
|
|
@@ -503,7 +505,7 @@ function WithdrawFormStep({
|
|
|
503
505
|
) })
|
|
504
506
|
] }),
|
|
505
507
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-amount-info", children: [
|
|
506
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-withdraw-usd", children: amountUsd !== null ?
|
|
508
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-withdraw-usd", children: amountUsd !== null ? _chunkPPFG3VBDcjs.currencyFormatter.format(amountUsd) : "$0.00" }),
|
|
507
509
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-withdraw-balance", children: [
|
|
508
510
|
"Balance: ",
|
|
509
511
|
formattedBalance,
|
|
@@ -544,7 +546,7 @@ function WithdrawFormStep({
|
|
|
544
546
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: targetChainName })
|
|
545
547
|
] }),
|
|
546
548
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
547
|
-
|
|
549
|
+
_chunkPPFG3VBDcjs.ChevronDownIcon,
|
|
548
550
|
{
|
|
549
551
|
className: "rs-withdraw-dropdown-arrow",
|
|
550
552
|
style: {
|
|
@@ -613,7 +615,7 @@ function WithdrawFormStep({
|
|
|
613
615
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: targetSymbol })
|
|
614
616
|
] }),
|
|
615
617
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
616
|
-
|
|
618
|
+
_chunkPPFG3VBDcjs.ChevronDownIcon,
|
|
617
619
|
{
|
|
618
620
|
className: "rs-withdraw-dropdown-arrow",
|
|
619
621
|
style: {
|
|
@@ -653,10 +655,10 @@ function WithdrawFormStep({
|
|
|
653
655
|
] })
|
|
654
656
|
] }),
|
|
655
657
|
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.` }) }),
|
|
656
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
657
|
-
!error && registrationError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
658
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.Callout, { variant: "error", children: error }),
|
|
659
|
+
!error && registrationError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.Callout, { variant: "error", children: registrationError }),
|
|
658
660
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
659
|
-
|
|
661
|
+
_chunkPPFG3VBDcjs.Button,
|
|
660
662
|
{
|
|
661
663
|
onClick: handleWithdraw,
|
|
662
664
|
fullWidth: true,
|
|
@@ -666,7 +668,7 @@ function WithdrawFormStep({
|
|
|
666
668
|
}
|
|
667
669
|
)
|
|
668
670
|
] }),
|
|
669
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
671
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.PoweredBy, {})
|
|
670
672
|
] });
|
|
671
673
|
}
|
|
672
674
|
WithdrawFormStep.displayName = "WithdrawFormStep";
|
|
@@ -701,9 +703,9 @@ function WithdrawReviewStep({
|
|
|
701
703
|
const sourceTokenIcon = _chunkABVRVW3Pcjs.getTokenIcon.call(void 0, sourceSymbol);
|
|
702
704
|
const targetTokenIcon = _chunkABVRVW3Pcjs.getTokenIcon.call(void 0, targetSymbol);
|
|
703
705
|
const amountNumber = Number(amount);
|
|
704
|
-
const formattedSendAmount = _nullishCoalesce(
|
|
705
|
-
const prices =
|
|
706
|
-
const receiveDisplay = _nullishCoalesce(
|
|
706
|
+
const formattedSendAmount = _nullishCoalesce(_chunkPPFG3VBDcjs.formatTokenAmount.call(void 0, amountNumber, sourceSymbol), () => ( amount));
|
|
707
|
+
const prices = _chunkPPFG3VBDcjs.useTokenPrices.call(void 0, service, [sourceSymbol, targetSymbol]);
|
|
708
|
+
const receiveDisplay = _nullishCoalesce(_chunkPPFG3VBDcjs.formatReceiveEstimate.call(void 0, {
|
|
707
709
|
sourceAmount: Number.isFinite(amountNumber) ? amountNumber : void 0,
|
|
708
710
|
sourceSymbol,
|
|
709
711
|
targetSymbol,
|
|
@@ -717,7 +719,7 @@ function WithdrawReviewStep({
|
|
|
717
719
|
await onConfirm();
|
|
718
720
|
} catch (err) {
|
|
719
721
|
const raw = err instanceof Error ? err.message : "Withdraw failed";
|
|
720
|
-
const message =
|
|
722
|
+
const message = _chunkPPFG3VBDcjs.formatUserError.call(void 0, raw);
|
|
721
723
|
setError(message);
|
|
722
724
|
_optionalChain([onError, 'optionalCall', _10 => _10(message, "WITHDRAW_REVIEW_ERROR")]);
|
|
723
725
|
} finally {
|
|
@@ -728,9 +730,9 @@ function WithdrawReviewStep({
|
|
|
728
730
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
729
731
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
730
732
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
731
|
-
|
|
733
|
+
_chunkPPFG3VBDcjs.BodyHeader,
|
|
732
734
|
{
|
|
733
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
735
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.CircleArrowOutUpLeftIcon, {}),
|
|
734
736
|
title: "Review withdrawal"
|
|
735
737
|
}
|
|
736
738
|
),
|
|
@@ -776,10 +778,10 @@ function WithdrawReviewStep({
|
|
|
776
778
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-value", children: estimatedTime })
|
|
777
779
|
] })
|
|
778
780
|
] }),
|
|
779
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
780
|
-
!error && registrationError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
781
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.Callout, { variant: "error", children: error }),
|
|
782
|
+
!error && registrationError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.Callout, { variant: "error", children: registrationError }),
|
|
781
783
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
782
|
-
|
|
784
|
+
_chunkPPFG3VBDcjs.Button,
|
|
783
785
|
{
|
|
784
786
|
onClick: handleConfirm,
|
|
785
787
|
loading: isSubmitting,
|
|
@@ -790,7 +792,7 @@ function WithdrawReviewStep({
|
|
|
790
792
|
}
|
|
791
793
|
)
|
|
792
794
|
] }),
|
|
793
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
795
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.PoweredBy, {})
|
|
794
796
|
] });
|
|
795
797
|
}
|
|
796
798
|
WithdrawReviewStep.displayName = "WithdrawReviewStep";
|
|
@@ -802,15 +804,15 @@ var ADDR_REGEX = /^0x[a-fA-F0-9]{40}$/;
|
|
|
802
804
|
var REGISTRATION_DEBOUNCE_MS = 600;
|
|
803
805
|
var WITHDRAW_INDEXING_DELAY_MS = 2e3;
|
|
804
806
|
function resolveSessionOwner(eoaAddress) {
|
|
805
|
-
const localOwner =
|
|
807
|
+
const localOwner = _chunkPPFG3VBDcjs.loadSessionOwnerFromStorage.call(void 0, eoaAddress);
|
|
806
808
|
if (localOwner) {
|
|
807
809
|
return {
|
|
808
|
-
account:
|
|
810
|
+
account: _chunkPPFG3VBDcjs.accountFromPrivateKey.call(void 0, localOwner.privateKey),
|
|
809
811
|
address: localOwner.address
|
|
810
812
|
};
|
|
811
813
|
}
|
|
812
|
-
const created =
|
|
813
|
-
|
|
814
|
+
const created = _chunkPPFG3VBDcjs.createSessionOwnerKey.call(void 0, );
|
|
815
|
+
_chunkPPFG3VBDcjs.saveSessionOwnerToStorage.call(void 0, eoaAddress, created.privateKey, created.address);
|
|
814
816
|
return { account: created.account, address: created.address };
|
|
815
817
|
}
|
|
816
818
|
function targetsEqual(a, b) {
|
|
@@ -845,10 +847,11 @@ function WithdrawFlow({
|
|
|
845
847
|
onError,
|
|
846
848
|
debug
|
|
847
849
|
}) {
|
|
848
|
-
const
|
|
849
|
-
const
|
|
850
|
-
const
|
|
851
|
-
const
|
|
850
|
+
const rpcUrls = _chunkPPFG3VBDcjs.useRpcUrls.call(void 0, );
|
|
851
|
+
const onStepChangeRef = _chunkPPFG3VBDcjs.useLatestRef.call(void 0, onStepChange);
|
|
852
|
+
const onEventRef = _chunkPPFG3VBDcjs.useLatestRef.call(void 0, onEvent);
|
|
853
|
+
const onLifecycleRef = _chunkPPFG3VBDcjs.useLatestRef.call(void 0, onLifecycle);
|
|
854
|
+
const onErrorRef = _chunkPPFG3VBDcjs.useLatestRef.call(void 0, onError);
|
|
852
855
|
const isFlowActiveRef = _react.useRef.call(void 0, true);
|
|
853
856
|
const submitGenerationRef = _react.useRef.call(void 0, 0);
|
|
854
857
|
_react.useEffect.call(void 0, () => {
|
|
@@ -859,13 +862,13 @@ function WithdrawFlow({
|
|
|
859
862
|
}, []);
|
|
860
863
|
const logFlow = _react.useCallback.call(void 0,
|
|
861
864
|
(message, data) => {
|
|
862
|
-
|
|
865
|
+
_chunkPPFG3VBDcjs.debugLog.call(void 0, debug, "withdraw-flow", message, data);
|
|
863
866
|
},
|
|
864
867
|
[debug]
|
|
865
868
|
);
|
|
866
869
|
const logFlowError = _react.useCallback.call(void 0,
|
|
867
870
|
(message, error, data) => {
|
|
868
|
-
|
|
871
|
+
_chunkPPFG3VBDcjs.debugError.call(void 0, debug, "withdraw-flow", message, error, data);
|
|
869
872
|
},
|
|
870
873
|
[debug]
|
|
871
874
|
);
|
|
@@ -941,14 +944,14 @@ function WithdrawFlow({
|
|
|
941
944
|
return {
|
|
942
945
|
ownerAddress: dappAddress,
|
|
943
946
|
walletClient: _nullishCoalesce(dappWalletClient, () => ( void 0)),
|
|
944
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
947
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkPPFG3VBDcjs.getPublicClient.call(void 0, sourceChain, rpcUrls))),
|
|
945
948
|
switchChain: dappSwitchChain
|
|
946
949
|
};
|
|
947
950
|
}
|
|
948
951
|
return {
|
|
949
952
|
ownerAddress: dappWalletClient.account.address,
|
|
950
953
|
walletClient: dappWalletClient,
|
|
951
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
954
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkPPFG3VBDcjs.getPublicClient.call(void 0, sourceChain, rpcUrls))),
|
|
952
955
|
switchChain: dappSwitchChain
|
|
953
956
|
};
|
|
954
957
|
}
|
|
@@ -959,7 +962,7 @@ function WithdrawFlow({
|
|
|
959
962
|
return {
|
|
960
963
|
ownerAddress: dappWalletClient.account.address,
|
|
961
964
|
walletClient: dappWalletClient,
|
|
962
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
965
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkPPFG3VBDcjs.getPublicClient.call(void 0, sourceChain, rpcUrls))),
|
|
963
966
|
switchChain: dappSwitchChain
|
|
964
967
|
};
|
|
965
968
|
}
|
|
@@ -983,7 +986,8 @@ function WithdrawFlow({
|
|
|
983
986
|
dappSwitchChain,
|
|
984
987
|
dappAddress,
|
|
985
988
|
reownWallet,
|
|
986
|
-
sourceChain
|
|
989
|
+
sourceChain,
|
|
990
|
+
rpcUrls
|
|
987
991
|
]);
|
|
988
992
|
const ownerAddress = _optionalChain([signerContext, 'optionalAccess', _32 => _32.ownerAddress]);
|
|
989
993
|
const recipientForRegistration = _react.useMemo.call(void 0, () => {
|
|
@@ -1041,7 +1045,7 @@ function WithdrawFlow({
|
|
|
1041
1045
|
message: typedData.message
|
|
1042
1046
|
});
|
|
1043
1047
|
if (cancelled) return;
|
|
1044
|
-
const sessionDetails =
|
|
1048
|
+
const sessionDetails = _chunkPPFG3VBDcjs.buildSessionDetails.call(void 0,
|
|
1045
1049
|
setup.sessionDetailsUnsigned,
|
|
1046
1050
|
signature
|
|
1047
1051
|
);
|
|
@@ -1078,7 +1082,7 @@ function WithdrawFlow({
|
|
|
1078
1082
|
} catch (err) {
|
|
1079
1083
|
if (cancelled) return;
|
|
1080
1084
|
const raw = err instanceof Error ? err.message : "Registration failed";
|
|
1081
|
-
const message =
|
|
1085
|
+
const message = _chunkPPFG3VBDcjs.formatUserError.call(void 0, raw);
|
|
1082
1086
|
logFlowError("auto-register:failed", err, {
|
|
1083
1087
|
ownerAddress,
|
|
1084
1088
|
targetChain,
|
|
@@ -1114,7 +1118,7 @@ function WithdrawFlow({
|
|
|
1114
1118
|
const symbol = _chunkABVRVW3Pcjs.getTokenSymbol.call(void 0, sourceToken, sourceChain);
|
|
1115
1119
|
const decimals = _chunkABVRVW3Pcjs.getTokenDecimalsByAddress.call(void 0, sourceToken, sourceChain);
|
|
1116
1120
|
return {
|
|
1117
|
-
id:
|
|
1121
|
+
id: _chunkPPFG3VBDcjs.getAssetId.call(void 0, { chainId: sourceChain, token: sourceToken }),
|
|
1118
1122
|
chainId: sourceChain,
|
|
1119
1123
|
token: sourceToken,
|
|
1120
1124
|
symbol,
|
|
@@ -1254,7 +1258,7 @@ function WithdrawFlow({
|
|
|
1254
1258
|
targetToken
|
|
1255
1259
|
});
|
|
1256
1260
|
const amountUnits = _viem.parseUnits.call(void 0, amountValue, asset.decimals);
|
|
1257
|
-
const pc = _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess', _46 => _46.publicClient]), () => (
|
|
1261
|
+
const pc = _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess', _46 => _46.publicClient]), () => ( _chunkPPFG3VBDcjs.getPublicClient.call(void 0, sourceChain, rpcUrls)));
|
|
1258
1262
|
let result;
|
|
1259
1263
|
if (onSignTransaction) {
|
|
1260
1264
|
const transferTarget = isSameRoute ? recipient : smartAccount;
|
|
@@ -1342,7 +1346,7 @@ function WithdrawFlow({
|
|
|
1342
1346
|
targetChain,
|
|
1343
1347
|
targetToken
|
|
1344
1348
|
});
|
|
1345
|
-
handleError(
|
|
1349
|
+
handleError(_chunkPPFG3VBDcjs.formatUserError.call(void 0, raw), "WITHDRAW_FLOW_ERROR");
|
|
1346
1350
|
throw err;
|
|
1347
1351
|
}
|
|
1348
1352
|
},
|
|
@@ -1362,7 +1366,8 @@ function WithdrawFlow({
|
|
|
1362
1366
|
logFlow,
|
|
1363
1367
|
logFlowError,
|
|
1364
1368
|
onLifecycleRef,
|
|
1365
|
-
storeApi
|
|
1369
|
+
storeApi,
|
|
1370
|
+
rpcUrls
|
|
1366
1371
|
]
|
|
1367
1372
|
);
|
|
1368
1373
|
const handleWithdrawComplete = _react.useCallback.call(void 0,
|
|
@@ -1481,7 +1486,7 @@ function WithdrawFlow({
|
|
|
1481
1486
|
state: "ready"
|
|
1482
1487
|
}));
|
|
1483
1488
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1484
|
-
|
|
1489
|
+
_chunkPPFG3VBDcjs.ConnectStep,
|
|
1485
1490
|
{
|
|
1486
1491
|
walletRows: withdrawRows,
|
|
1487
1492
|
onConfirmWallet: (walletId) => {
|
|
@@ -1499,7 +1504,7 @@ function WithdrawFlow({
|
|
|
1499
1504
|
if (!signerContext) return null;
|
|
1500
1505
|
if (!onSignTransaction && !signerContext.walletClient) return null;
|
|
1501
1506
|
const resolvedConnectedRecipient = _optionalChain([selectedWalletOption, 'optionalAccess', _63 => _63.kind]) === "external" ? selectedWalletOption.address : void 0;
|
|
1502
|
-
const formPublicClient = _nullishCoalesce(signerContext.publicClient, () => (
|
|
1507
|
+
const formPublicClient = _nullishCoalesce(signerContext.publicClient, () => ( _chunkPPFG3VBDcjs.getPublicClient.call(void 0, sourceChain, rpcUrls)));
|
|
1503
1508
|
const depositAddress = registration.kind === "ready" || registration.kind === "stale" ? registration.smartAccount : void 0;
|
|
1504
1509
|
const stepView = deriveStepView(flowStep, registration);
|
|
1505
1510
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
@@ -1546,7 +1551,7 @@ function WithdrawFlow({
|
|
|
1546
1551
|
}
|
|
1547
1552
|
),
|
|
1548
1553
|
stepView === "processing" && registration.kind !== "idle" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1549
|
-
|
|
1554
|
+
_chunkPPFG3VBDcjs.ProcessingStep,
|
|
1550
1555
|
{
|
|
1551
1556
|
smartAccount: registration.kind === "ready" || registration.kind === "stale" ? registration.smartAccount : "0x0",
|
|
1552
1557
|
txHash: _nullishCoalesce(storeApi.getState().txHash, () => ( "0x0")),
|
|
@@ -1588,7 +1593,7 @@ function deriveStepView(step, _registration) {
|
|
|
1588
1593
|
// src/WithdrawModal.tsx
|
|
1589
1594
|
|
|
1590
1595
|
var ReownWithdrawInner = _react.lazy.call(void 0,
|
|
1591
|
-
() => Promise.resolve().then(() => _interopRequireWildcard(require("./WithdrawModalReown-
|
|
1596
|
+
() => Promise.resolve().then(() => _interopRequireWildcard(require("./WithdrawModalReown-LIP6FHCB.cjs"))).then((m) => ({
|
|
1592
1597
|
default: m.WithdrawModalReown
|
|
1593
1598
|
}))
|
|
1594
1599
|
);
|
|
@@ -1617,6 +1622,7 @@ function WithdrawModalInner({
|
|
|
1617
1622
|
closeOnOverlayClick,
|
|
1618
1623
|
allowedRoutes,
|
|
1619
1624
|
backendUrl = _chunkABVRVW3Pcjs.DEFAULT_BACKEND_URL,
|
|
1625
|
+
rpcUrls,
|
|
1620
1626
|
signerAddress = _chunkABVRVW3Pcjs.DEFAULT_SIGNER_ADDRESS,
|
|
1621
1627
|
sessionChainIds,
|
|
1622
1628
|
forceRegister = false,
|
|
@@ -1635,18 +1641,18 @@ function WithdrawModalInner({
|
|
|
1635
1641
|
debug
|
|
1636
1642
|
}) {
|
|
1637
1643
|
const modalRef = _react.useRef.call(void 0, null);
|
|
1638
|
-
const onReadyRef =
|
|
1644
|
+
const onReadyRef = _chunkPPFG3VBDcjs.useLatestRef.call(void 0, onReady);
|
|
1639
1645
|
const [backHandler, setBackHandler] = _react.useState.call(void 0,
|
|
1640
1646
|
void 0
|
|
1641
1647
|
);
|
|
1642
1648
|
const targetChain = _chunkABVRVW3Pcjs.getChainId.call(void 0, targetChainProp);
|
|
1643
1649
|
const sourceChain = _chunkABVRVW3Pcjs.getChainId.call(void 0, sourceChainProp);
|
|
1644
1650
|
const service = _react.useMemo.call(void 0,
|
|
1645
|
-
() =>
|
|
1651
|
+
() => _chunkPPFG3VBDcjs.createDepositService.call(void 0, backendUrl, { debug, debugScope: "service:withdraw" }),
|
|
1646
1652
|
[backendUrl, debug]
|
|
1647
1653
|
);
|
|
1648
1654
|
const store = _react.useMemo.call(void 0, () => createWithdrawStore(), []);
|
|
1649
|
-
const onErrorRef =
|
|
1655
|
+
const onErrorRef = _chunkPPFG3VBDcjs.useLatestRef.call(void 0, onError);
|
|
1650
1656
|
_react.useEffect.call(void 0, () => {
|
|
1651
1657
|
if (isOpen && onSignTransaction && !dappAddress) {
|
|
1652
1658
|
_optionalChain([onErrorRef, 'access', _64 => _64.current, 'optionalCall', _65 => _65({
|
|
@@ -1657,7 +1663,7 @@ function WithdrawModalInner({
|
|
|
1657
1663
|
}, [isOpen, onSignTransaction, dappAddress, onErrorRef]);
|
|
1658
1664
|
_react.useEffect.call(void 0, () => {
|
|
1659
1665
|
if (isOpen && modalRef.current) {
|
|
1660
|
-
|
|
1666
|
+
_chunkPPFG3VBDcjs.applyTheme.call(void 0, modalRef.current, theme);
|
|
1661
1667
|
}
|
|
1662
1668
|
}, [isOpen, theme]);
|
|
1663
1669
|
_react.useEffect.call(void 0, () => {
|
|
@@ -1675,8 +1681,8 @@ function WithdrawModalInner({
|
|
|
1675
1681
|
}, []);
|
|
1676
1682
|
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _68 => _68.showBackButton]), () => ( true));
|
|
1677
1683
|
const canGoBack = backHandler !== void 0;
|
|
1678
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, WithdrawStoreProvider, { store, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1679
|
-
|
|
1684
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.RpcUrlsProvider, { value: rpcUrls, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, WithdrawStoreProvider, { store, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1685
|
+
_chunkPPFG3VBDcjs.Modal,
|
|
1680
1686
|
{
|
|
1681
1687
|
isOpen,
|
|
1682
1688
|
onClose,
|
|
@@ -1692,7 +1698,7 @@ function WithdrawModalInner({
|
|
|
1692
1698
|
className: "rs-modal-header-back",
|
|
1693
1699
|
"aria-label": "Go back",
|
|
1694
1700
|
onClick: backHandler,
|
|
1695
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1701
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.ChevronLeftIcon, {})
|
|
1696
1702
|
}
|
|
1697
1703
|
) }),
|
|
1698
1704
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-header-nav-right", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -1702,7 +1708,7 @@ function WithdrawModalInner({
|
|
|
1702
1708
|
onClick: onClose,
|
|
1703
1709
|
className: "rs-modal-close",
|
|
1704
1710
|
"aria-label": "Close",
|
|
1705
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1711
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPPFG3VBDcjs.CloseIcon, {})
|
|
1706
1712
|
}
|
|
1707
1713
|
) })
|
|
1708
1714
|
] }),
|
|
@@ -1739,7 +1745,7 @@ function WithdrawModalInner({
|
|
|
1739
1745
|
)
|
|
1740
1746
|
] })
|
|
1741
1747
|
}
|
|
1742
|
-
) });
|
|
1748
|
+
) }) });
|
|
1743
1749
|
}
|
|
1744
1750
|
|
|
1745
1751
|
|