@rhinestone/deposit-modal 0.6.0 → 0.6.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/dist/{DepositModalReown-J3KYAOD3.cjs → DepositModalReown-ICBGUVAA.cjs} +6 -6
- package/dist/{DepositModalReown-YD7TLEAA.mjs → DepositModalReown-IVRDXQAA.mjs} +3 -3
- package/dist/{WithdrawModalReown-QSQUV6HX.cjs → WithdrawModalReown-6XWURPFZ.cjs} +6 -6
- package/dist/{WithdrawModalReown-ZPDMX47Z.mjs → WithdrawModalReown-O7PR343Z.mjs} +3 -3
- package/dist/{chunk-DXGM6YET.mjs → chunk-7Q26RR6J.mjs} +1 -1
- package/dist/{chunk-GQDVHMOT.mjs → chunk-GBOCV2LQ.mjs} +112 -9
- package/dist/{chunk-7LVI3VAL.cjs → chunk-IZPUHIIN.cjs} +214 -204
- package/dist/{chunk-3JVGI7FC.mjs → chunk-N73D3WN4.mjs} +2 -2
- package/dist/{chunk-DASS33PJ.cjs → chunk-SITLCMTI.cjs} +57 -57
- package/dist/{chunk-NSAODZSS.mjs → chunk-TCLBFO3S.mjs} +20 -10
- package/dist/{chunk-ZDYV536Q.cjs → chunk-VPWWFWZT.cjs} +136 -33
- package/dist/{chunk-YYIE5U5K.cjs → chunk-VVKJRGX3.cjs} +4 -4
- package/dist/deposit.cjs +3 -3
- package/dist/deposit.mjs +2 -2
- package/dist/index.cjs +4 -4
- package/dist/index.mjs +3 -3
- package/dist/styles.css +20 -22
- package/dist/withdraw.cjs +3 -3
- package/dist/withdraw.mjs +2 -2
- package/package.json +1 -1
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
useRpcUrls,
|
|
34
34
|
useStableRpcUrls,
|
|
35
35
|
useTokenPrices
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-GBOCV2LQ.mjs";
|
|
37
37
|
import {
|
|
38
38
|
buildSafeTransaction,
|
|
39
39
|
executeSafeErc20Transfer,
|
|
@@ -1594,7 +1594,7 @@ function deriveStepView(step, _registration) {
|
|
|
1594
1594
|
// src/WithdrawModal.tsx
|
|
1595
1595
|
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1596
1596
|
var ReownWithdrawInner = lazy(
|
|
1597
|
-
() => import("./WithdrawModalReown-
|
|
1597
|
+
() => import("./WithdrawModalReown-O7PR343Z.mjs").then((m) => ({
|
|
1598
1598
|
default: m.WithdrawModalReown
|
|
1599
1599
|
}))
|
|
1600
1600
|
);
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
|
|
36
|
-
var
|
|
36
|
+
var _chunkVPWWFWZTcjs = require('./chunk-VPWWFWZT.cjs');
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
|
|
@@ -264,7 +264,7 @@ function WithdrawFormStep({
|
|
|
264
264
|
setIsSwitching(true);
|
|
265
265
|
switchChain(asset.chainId).catch((err) => {
|
|
266
266
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
267
|
-
setError(
|
|
267
|
+
setError(_chunkVPWWFWZTcjs.formatUserError.call(void 0, raw));
|
|
268
268
|
}).finally(() => {
|
|
269
269
|
setIsSwitching(false);
|
|
270
270
|
});
|
|
@@ -284,7 +284,7 @@ function WithdrawFormStep({
|
|
|
284
284
|
return;
|
|
285
285
|
}
|
|
286
286
|
try {
|
|
287
|
-
const bal =
|
|
287
|
+
const bal = _chunkVPWWFWZTcjs.isNativeAsset.call(void 0, asset) ? await publicClient.getBalance({ address: safeAddress }) : await publicClient.readContract({
|
|
288
288
|
address: asset.token,
|
|
289
289
|
abi: _viem.erc20Abi,
|
|
290
290
|
functionName: "balanceOf",
|
|
@@ -395,7 +395,7 @@ function WithdrawFormStep({
|
|
|
395
395
|
await onSubmit(recipient, amount);
|
|
396
396
|
} catch (err) {
|
|
397
397
|
const raw = err instanceof Error ? err.message : "Withdrawal failed";
|
|
398
|
-
setError(
|
|
398
|
+
setError(_chunkVPWWFWZTcjs.formatUserError.call(void 0, raw));
|
|
399
399
|
} finally {
|
|
400
400
|
setIsSubmitting(false);
|
|
401
401
|
}
|
|
@@ -411,16 +411,16 @@ function WithdrawFormStep({
|
|
|
411
411
|
if (isBalanceLoading) {
|
|
412
412
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
413
413
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-withdraw-loading", children: [
|
|
414
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
414
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.Spinner, { className: "rs-spinner--lg" }),
|
|
415
415
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-withdraw-loading-title", children: "Loading on-chain balance" }),
|
|
416
416
|
/* @__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." })
|
|
417
417
|
] }),
|
|
418
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
418
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.PoweredBy, {})
|
|
419
419
|
] });
|
|
420
420
|
}
|
|
421
421
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
422
422
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
423
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
423
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.CircleArrowOutUpLeftIcon, {}), title: "Withdraw" }),
|
|
424
424
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-section", children: [
|
|
425
425
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
426
426
|
"label",
|
|
@@ -466,7 +466,7 @@ function WithdrawFormStep({
|
|
|
466
466
|
),
|
|
467
467
|
isRecipientConnected ? null : "Use connected"
|
|
468
468
|
] }) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
469
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
469
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.WalletIcon, { className: "rs-withdraw-use-connected-icon" }),
|
|
470
470
|
isRecipientConnected ? null : "Use connected"
|
|
471
471
|
] })
|
|
472
472
|
}
|
|
@@ -506,7 +506,7 @@ function WithdrawFormStep({
|
|
|
506
506
|
) })
|
|
507
507
|
] }),
|
|
508
508
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-amount-info", children: [
|
|
509
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-withdraw-usd", children: amountUsd !== null ?
|
|
509
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-withdraw-usd", children: amountUsd !== null ? _chunkVPWWFWZTcjs.currencyFormatter.format(amountUsd) : "$0.00" }),
|
|
510
510
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-withdraw-balance", children: [
|
|
511
511
|
"Balance: ",
|
|
512
512
|
formattedBalance,
|
|
@@ -547,7 +547,7 @@ function WithdrawFormStep({
|
|
|
547
547
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: targetChainName })
|
|
548
548
|
] }),
|
|
549
549
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
550
|
-
|
|
550
|
+
_chunkVPWWFWZTcjs.ChevronDownIcon,
|
|
551
551
|
{
|
|
552
552
|
className: "rs-withdraw-dropdown-arrow",
|
|
553
553
|
style: {
|
|
@@ -616,7 +616,7 @@ function WithdrawFormStep({
|
|
|
616
616
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: targetSymbol })
|
|
617
617
|
] }),
|
|
618
618
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
619
|
-
|
|
619
|
+
_chunkVPWWFWZTcjs.ChevronDownIcon,
|
|
620
620
|
{
|
|
621
621
|
className: "rs-withdraw-dropdown-arrow",
|
|
622
622
|
style: {
|
|
@@ -656,10 +656,10 @@ function WithdrawFormStep({
|
|
|
656
656
|
] })
|
|
657
657
|
] }),
|
|
658
658
|
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.` }) }),
|
|
659
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
660
|
-
!error && registrationError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
659
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.Callout, { variant: "error", children: error }),
|
|
660
|
+
!error && registrationError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.Callout, { variant: "error", children: registrationError }),
|
|
661
661
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
662
|
-
|
|
662
|
+
_chunkVPWWFWZTcjs.Button,
|
|
663
663
|
{
|
|
664
664
|
onClick: handleWithdraw,
|
|
665
665
|
fullWidth: true,
|
|
@@ -669,7 +669,7 @@ function WithdrawFormStep({
|
|
|
669
669
|
}
|
|
670
670
|
)
|
|
671
671
|
] }),
|
|
672
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
672
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.PoweredBy, {})
|
|
673
673
|
] });
|
|
674
674
|
}
|
|
675
675
|
WithdrawFormStep.displayName = "WithdrawFormStep";
|
|
@@ -704,9 +704,9 @@ function WithdrawReviewStep({
|
|
|
704
704
|
const sourceTokenIcon = _chunkABVRVW3Pcjs.getTokenIcon.call(void 0, sourceSymbol);
|
|
705
705
|
const targetTokenIcon = _chunkABVRVW3Pcjs.getTokenIcon.call(void 0, targetSymbol);
|
|
706
706
|
const amountNumber = Number(amount);
|
|
707
|
-
const formattedSendAmount = _nullishCoalesce(
|
|
708
|
-
const prices =
|
|
709
|
-
const receiveDisplay = _nullishCoalesce(
|
|
707
|
+
const formattedSendAmount = _nullishCoalesce(_chunkVPWWFWZTcjs.formatTokenAmount.call(void 0, amountNumber, sourceSymbol), () => ( amount));
|
|
708
|
+
const prices = _chunkVPWWFWZTcjs.useTokenPrices.call(void 0, service, [sourceSymbol, targetSymbol]);
|
|
709
|
+
const receiveDisplay = _nullishCoalesce(_chunkVPWWFWZTcjs.formatReceiveEstimate.call(void 0, {
|
|
710
710
|
sourceAmount: Number.isFinite(amountNumber) ? amountNumber : void 0,
|
|
711
711
|
sourceSymbol,
|
|
712
712
|
targetSymbol,
|
|
@@ -720,7 +720,7 @@ function WithdrawReviewStep({
|
|
|
720
720
|
await onConfirm();
|
|
721
721
|
} catch (err) {
|
|
722
722
|
const raw = err instanceof Error ? err.message : "Withdraw failed";
|
|
723
|
-
const message =
|
|
723
|
+
const message = _chunkVPWWFWZTcjs.formatUserError.call(void 0, raw);
|
|
724
724
|
setError(message);
|
|
725
725
|
_optionalChain([onError, 'optionalCall', _10 => _10(message, "WITHDRAW_REVIEW_ERROR")]);
|
|
726
726
|
} finally {
|
|
@@ -731,9 +731,9 @@ function WithdrawReviewStep({
|
|
|
731
731
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
732
732
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
733
733
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
734
|
-
|
|
734
|
+
_chunkVPWWFWZTcjs.BodyHeader,
|
|
735
735
|
{
|
|
736
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
736
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.CircleArrowOutUpLeftIcon, {}),
|
|
737
737
|
title: "Review withdrawal"
|
|
738
738
|
}
|
|
739
739
|
),
|
|
@@ -779,10 +779,10 @@ function WithdrawReviewStep({
|
|
|
779
779
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-value", children: estimatedTime })
|
|
780
780
|
] })
|
|
781
781
|
] }),
|
|
782
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
783
|
-
!error && registrationError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
782
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.Callout, { variant: "error", children: error }),
|
|
783
|
+
!error && registrationError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.Callout, { variant: "error", children: registrationError }),
|
|
784
784
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
785
|
-
|
|
785
|
+
_chunkVPWWFWZTcjs.Button,
|
|
786
786
|
{
|
|
787
787
|
onClick: handleConfirm,
|
|
788
788
|
loading: isSubmitting,
|
|
@@ -793,7 +793,7 @@ function WithdrawReviewStep({
|
|
|
793
793
|
}
|
|
794
794
|
)
|
|
795
795
|
] }),
|
|
796
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
796
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.PoweredBy, {})
|
|
797
797
|
] });
|
|
798
798
|
}
|
|
799
799
|
WithdrawReviewStep.displayName = "WithdrawReviewStep";
|
|
@@ -805,15 +805,15 @@ var ADDR_REGEX = /^0x[a-fA-F0-9]{40}$/;
|
|
|
805
805
|
var REGISTRATION_DEBOUNCE_MS = 600;
|
|
806
806
|
var WITHDRAW_INDEXING_DELAY_MS = 2e3;
|
|
807
807
|
function resolveSessionOwner(eoaAddress) {
|
|
808
|
-
const localOwner =
|
|
808
|
+
const localOwner = _chunkVPWWFWZTcjs.loadSessionOwnerFromStorage.call(void 0, eoaAddress);
|
|
809
809
|
if (localOwner) {
|
|
810
810
|
return {
|
|
811
|
-
account:
|
|
811
|
+
account: _chunkVPWWFWZTcjs.accountFromPrivateKey.call(void 0, localOwner.privateKey),
|
|
812
812
|
address: localOwner.address
|
|
813
813
|
};
|
|
814
814
|
}
|
|
815
|
-
const created =
|
|
816
|
-
|
|
815
|
+
const created = _chunkVPWWFWZTcjs.createSessionOwnerKey.call(void 0, );
|
|
816
|
+
_chunkVPWWFWZTcjs.saveSessionOwnerToStorage.call(void 0, eoaAddress, created.privateKey, created.address);
|
|
817
817
|
return { account: created.account, address: created.address };
|
|
818
818
|
}
|
|
819
819
|
function targetsEqual(a, b) {
|
|
@@ -848,11 +848,11 @@ function WithdrawFlow({
|
|
|
848
848
|
onError,
|
|
849
849
|
debug
|
|
850
850
|
}) {
|
|
851
|
-
const rpcUrls =
|
|
852
|
-
const onStepChangeRef =
|
|
853
|
-
const onEventRef =
|
|
854
|
-
const onLifecycleRef =
|
|
855
|
-
const onErrorRef =
|
|
851
|
+
const rpcUrls = _chunkVPWWFWZTcjs.useRpcUrls.call(void 0, );
|
|
852
|
+
const onStepChangeRef = _chunkVPWWFWZTcjs.useLatestRef.call(void 0, onStepChange);
|
|
853
|
+
const onEventRef = _chunkVPWWFWZTcjs.useLatestRef.call(void 0, onEvent);
|
|
854
|
+
const onLifecycleRef = _chunkVPWWFWZTcjs.useLatestRef.call(void 0, onLifecycle);
|
|
855
|
+
const onErrorRef = _chunkVPWWFWZTcjs.useLatestRef.call(void 0, onError);
|
|
856
856
|
const isFlowActiveRef = _react.useRef.call(void 0, true);
|
|
857
857
|
const submitGenerationRef = _react.useRef.call(void 0, 0);
|
|
858
858
|
_react.useEffect.call(void 0, () => {
|
|
@@ -863,13 +863,13 @@ function WithdrawFlow({
|
|
|
863
863
|
}, []);
|
|
864
864
|
const logFlow = _react.useCallback.call(void 0,
|
|
865
865
|
(message, data) => {
|
|
866
|
-
|
|
866
|
+
_chunkVPWWFWZTcjs.debugLog.call(void 0, debug, "withdraw-flow", message, data);
|
|
867
867
|
},
|
|
868
868
|
[debug]
|
|
869
869
|
);
|
|
870
870
|
const logFlowError = _react.useCallback.call(void 0,
|
|
871
871
|
(message, error, data) => {
|
|
872
|
-
|
|
872
|
+
_chunkVPWWFWZTcjs.debugError.call(void 0, debug, "withdraw-flow", message, error, data);
|
|
873
873
|
},
|
|
874
874
|
[debug]
|
|
875
875
|
);
|
|
@@ -945,14 +945,14 @@ function WithdrawFlow({
|
|
|
945
945
|
return {
|
|
946
946
|
ownerAddress: dappAddress,
|
|
947
947
|
walletClient: _nullishCoalesce(dappWalletClient, () => ( void 0)),
|
|
948
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
948
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkVPWWFWZTcjs.getPublicClient.call(void 0, sourceChain, rpcUrls))),
|
|
949
949
|
switchChain: dappSwitchChain
|
|
950
950
|
};
|
|
951
951
|
}
|
|
952
952
|
return {
|
|
953
953
|
ownerAddress: dappWalletClient.account.address,
|
|
954
954
|
walletClient: dappWalletClient,
|
|
955
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
955
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkVPWWFWZTcjs.getPublicClient.call(void 0, sourceChain, rpcUrls))),
|
|
956
956
|
switchChain: dappSwitchChain
|
|
957
957
|
};
|
|
958
958
|
}
|
|
@@ -963,7 +963,7 @@ function WithdrawFlow({
|
|
|
963
963
|
return {
|
|
964
964
|
ownerAddress: dappWalletClient.account.address,
|
|
965
965
|
walletClient: dappWalletClient,
|
|
966
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
966
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkVPWWFWZTcjs.getPublicClient.call(void 0, sourceChain, rpcUrls))),
|
|
967
967
|
switchChain: dappSwitchChain
|
|
968
968
|
};
|
|
969
969
|
}
|
|
@@ -1046,7 +1046,7 @@ function WithdrawFlow({
|
|
|
1046
1046
|
message: typedData.message
|
|
1047
1047
|
});
|
|
1048
1048
|
if (cancelled) return;
|
|
1049
|
-
const sessionDetails =
|
|
1049
|
+
const sessionDetails = _chunkVPWWFWZTcjs.buildSessionDetails.call(void 0,
|
|
1050
1050
|
setup.sessionDetailsUnsigned,
|
|
1051
1051
|
signature
|
|
1052
1052
|
);
|
|
@@ -1083,7 +1083,7 @@ function WithdrawFlow({
|
|
|
1083
1083
|
} catch (err) {
|
|
1084
1084
|
if (cancelled) return;
|
|
1085
1085
|
const raw = err instanceof Error ? err.message : "Registration failed";
|
|
1086
|
-
const message =
|
|
1086
|
+
const message = _chunkVPWWFWZTcjs.formatUserError.call(void 0, raw);
|
|
1087
1087
|
logFlowError("auto-register:failed", err, {
|
|
1088
1088
|
ownerAddress,
|
|
1089
1089
|
targetChain,
|
|
@@ -1119,7 +1119,7 @@ function WithdrawFlow({
|
|
|
1119
1119
|
const symbol = _chunkABVRVW3Pcjs.getTokenSymbol.call(void 0, sourceToken, sourceChain);
|
|
1120
1120
|
const decimals = _chunkABVRVW3Pcjs.getTokenDecimalsByAddress.call(void 0, sourceToken, sourceChain);
|
|
1121
1121
|
return {
|
|
1122
|
-
id:
|
|
1122
|
+
id: _chunkVPWWFWZTcjs.getAssetId.call(void 0, { chainId: sourceChain, token: sourceToken }),
|
|
1123
1123
|
chainId: sourceChain,
|
|
1124
1124
|
token: sourceToken,
|
|
1125
1125
|
symbol,
|
|
@@ -1259,7 +1259,7 @@ function WithdrawFlow({
|
|
|
1259
1259
|
targetToken
|
|
1260
1260
|
});
|
|
1261
1261
|
const amountUnits = _viem.parseUnits.call(void 0, amountValue, asset.decimals);
|
|
1262
|
-
const pc = _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess', _46 => _46.publicClient]), () => (
|
|
1262
|
+
const pc = _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess', _46 => _46.publicClient]), () => ( _chunkVPWWFWZTcjs.getPublicClient.call(void 0, sourceChain, rpcUrls)));
|
|
1263
1263
|
let result;
|
|
1264
1264
|
if (onSignTransaction) {
|
|
1265
1265
|
const transferTarget = isSameRoute ? recipient : smartAccount;
|
|
@@ -1347,7 +1347,7 @@ function WithdrawFlow({
|
|
|
1347
1347
|
targetChain,
|
|
1348
1348
|
targetToken
|
|
1349
1349
|
});
|
|
1350
|
-
handleError(
|
|
1350
|
+
handleError(_chunkVPWWFWZTcjs.formatUserError.call(void 0, raw), "WITHDRAW_FLOW_ERROR");
|
|
1351
1351
|
throw err;
|
|
1352
1352
|
}
|
|
1353
1353
|
},
|
|
@@ -1487,7 +1487,7 @@ function WithdrawFlow({
|
|
|
1487
1487
|
state: "ready"
|
|
1488
1488
|
}));
|
|
1489
1489
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1490
|
-
|
|
1490
|
+
_chunkVPWWFWZTcjs.ConnectStep,
|
|
1491
1491
|
{
|
|
1492
1492
|
walletRows: withdrawRows,
|
|
1493
1493
|
onConfirmWallet: (walletId) => {
|
|
@@ -1505,7 +1505,7 @@ function WithdrawFlow({
|
|
|
1505
1505
|
if (!signerContext) return null;
|
|
1506
1506
|
if (!onSignTransaction && !signerContext.walletClient) return null;
|
|
1507
1507
|
const resolvedConnectedRecipient = _optionalChain([selectedWalletOption, 'optionalAccess', _63 => _63.kind]) === "external" ? selectedWalletOption.address : void 0;
|
|
1508
|
-
const formPublicClient = _nullishCoalesce(signerContext.publicClient, () => (
|
|
1508
|
+
const formPublicClient = _nullishCoalesce(signerContext.publicClient, () => ( _chunkVPWWFWZTcjs.getPublicClient.call(void 0, sourceChain, rpcUrls)));
|
|
1509
1509
|
const depositAddress = registration.kind === "ready" || registration.kind === "stale" ? registration.smartAccount : void 0;
|
|
1510
1510
|
const stepView = deriveStepView(flowStep, registration);
|
|
1511
1511
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
@@ -1552,7 +1552,7 @@ function WithdrawFlow({
|
|
|
1552
1552
|
}
|
|
1553
1553
|
),
|
|
1554
1554
|
stepView === "processing" && registration.kind !== "idle" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1555
|
-
|
|
1555
|
+
_chunkVPWWFWZTcjs.ProcessingStep,
|
|
1556
1556
|
{
|
|
1557
1557
|
smartAccount: registration.kind === "ready" || registration.kind === "stale" ? registration.smartAccount : "0x0",
|
|
1558
1558
|
txHash: _nullishCoalesce(storeApi.getState().txHash, () => ( "0x0")),
|
|
@@ -1594,7 +1594,7 @@ function deriveStepView(step, _registration) {
|
|
|
1594
1594
|
// src/WithdrawModal.tsx
|
|
1595
1595
|
|
|
1596
1596
|
var ReownWithdrawInner = _react.lazy.call(void 0,
|
|
1597
|
-
() => Promise.resolve().then(() => _interopRequireWildcard(require("./WithdrawModalReown-
|
|
1597
|
+
() => Promise.resolve().then(() => _interopRequireWildcard(require("./WithdrawModalReown-6XWURPFZ.cjs"))).then((m) => ({
|
|
1598
1598
|
default: m.WithdrawModalReown
|
|
1599
1599
|
}))
|
|
1600
1600
|
);
|
|
@@ -1642,19 +1642,19 @@ function WithdrawModalInner({
|
|
|
1642
1642
|
debug
|
|
1643
1643
|
}) {
|
|
1644
1644
|
const modalRef = _react.useRef.call(void 0, null);
|
|
1645
|
-
const onReadyRef =
|
|
1645
|
+
const onReadyRef = _chunkVPWWFWZTcjs.useLatestRef.call(void 0, onReady);
|
|
1646
1646
|
const [backHandler, setBackHandler] = _react.useState.call(void 0,
|
|
1647
1647
|
void 0
|
|
1648
1648
|
);
|
|
1649
1649
|
const targetChain = _chunkABVRVW3Pcjs.getChainId.call(void 0, targetChainProp);
|
|
1650
1650
|
const sourceChain = _chunkABVRVW3Pcjs.getChainId.call(void 0, sourceChainProp);
|
|
1651
|
-
const rpcUrls =
|
|
1651
|
+
const rpcUrls = _chunkVPWWFWZTcjs.useStableRpcUrls.call(void 0, rpcUrlsProp);
|
|
1652
1652
|
const service = _react.useMemo.call(void 0,
|
|
1653
|
-
() =>
|
|
1653
|
+
() => _chunkVPWWFWZTcjs.createDepositService.call(void 0, backendUrl, { debug, debugScope: "service:withdraw" }),
|
|
1654
1654
|
[backendUrl, debug]
|
|
1655
1655
|
);
|
|
1656
1656
|
const store = _react.useMemo.call(void 0, () => createWithdrawStore(), []);
|
|
1657
|
-
const onErrorRef =
|
|
1657
|
+
const onErrorRef = _chunkVPWWFWZTcjs.useLatestRef.call(void 0, onError);
|
|
1658
1658
|
_react.useEffect.call(void 0, () => {
|
|
1659
1659
|
if (isOpen && onSignTransaction && !dappAddress) {
|
|
1660
1660
|
_optionalChain([onErrorRef, 'access', _64 => _64.current, 'optionalCall', _65 => _65({
|
|
@@ -1665,7 +1665,7 @@ function WithdrawModalInner({
|
|
|
1665
1665
|
}, [isOpen, onSignTransaction, dappAddress, onErrorRef]);
|
|
1666
1666
|
_react.useEffect.call(void 0, () => {
|
|
1667
1667
|
if (isOpen && modalRef.current) {
|
|
1668
|
-
|
|
1668
|
+
_chunkVPWWFWZTcjs.applyTheme.call(void 0, modalRef.current, theme);
|
|
1669
1669
|
}
|
|
1670
1670
|
}, [isOpen, theme]);
|
|
1671
1671
|
_react.useEffect.call(void 0, () => {
|
|
@@ -1683,8 +1683,8 @@ function WithdrawModalInner({
|
|
|
1683
1683
|
}, []);
|
|
1684
1684
|
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _68 => _68.showBackButton]), () => ( true));
|
|
1685
1685
|
const canGoBack = backHandler !== void 0;
|
|
1686
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1687
|
-
|
|
1686
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.RpcUrlsProvider, { value: rpcUrls, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, WithdrawStoreProvider, { store, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1687
|
+
_chunkVPWWFWZTcjs.Modal,
|
|
1688
1688
|
{
|
|
1689
1689
|
isOpen,
|
|
1690
1690
|
onClose,
|
|
@@ -1700,7 +1700,7 @@ function WithdrawModalInner({
|
|
|
1700
1700
|
className: "rs-modal-header-back",
|
|
1701
1701
|
"aria-label": "Go back",
|
|
1702
1702
|
onClick: backHandler,
|
|
1703
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1703
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.ChevronLeftIcon, {})
|
|
1704
1704
|
}
|
|
1705
1705
|
) }),
|
|
1706
1706
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-header-nav-right", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -1710,7 +1710,7 @@ function WithdrawModalInner({
|
|
|
1710
1710
|
onClick: onClose,
|
|
1711
1711
|
className: "rs-modal-close",
|
|
1712
1712
|
"aria-label": "Close",
|
|
1713
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1713
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.CloseIcon, {})
|
|
1714
1714
|
}
|
|
1715
1715
|
) })
|
|
1716
1716
|
] }),
|
|
@@ -68,7 +68,7 @@ import {
|
|
|
68
68
|
useLatestRef,
|
|
69
69
|
useRpcUrls,
|
|
70
70
|
useStableRpcUrls
|
|
71
|
-
} from "./chunk-
|
|
71
|
+
} from "./chunk-GBOCV2LQ.mjs";
|
|
72
72
|
import {
|
|
73
73
|
SAFE_ABI
|
|
74
74
|
} from "./chunk-F7P4MV72.mjs";
|
|
@@ -2412,10 +2412,10 @@ function SwappedIframeStep({
|
|
|
2412
2412
|
return () => window.removeEventListener("message", onMessage);
|
|
2413
2413
|
}, []);
|
|
2414
2414
|
useEffect6(() => {
|
|
2415
|
-
if (phase === "iframe" && orderState !== null) {
|
|
2415
|
+
if (phase === "iframe" && (orderState !== null || latestEvent !== null)) {
|
|
2416
2416
|
setPhase("tracker");
|
|
2417
2417
|
}
|
|
2418
|
-
}, [phase, orderState]);
|
|
2418
|
+
}, [phase, orderState, latestEvent]);
|
|
2419
2419
|
const stepStates = useMemo4(
|
|
2420
2420
|
() => deriveStepStates(orderState?.status ?? null, latestEvent),
|
|
2421
2421
|
[orderState, latestEvent]
|
|
@@ -2446,7 +2446,8 @@ function SwappedIframeStep({
|
|
|
2446
2446
|
orderCrypto: orderState?.orderCrypto ?? null,
|
|
2447
2447
|
// Base-unit source amount from the deposit row/event, consistent with the
|
|
2448
2448
|
// wallet/QR path. ProcessingStep + onLifecycle expect base units.
|
|
2449
|
-
amount: getEventSourceDetails(latestEvent ?? void 0).amount ?? null
|
|
2449
|
+
amount: getEventSourceDetails(latestEvent ?? void 0).amount ?? null,
|
|
2450
|
+
initialEvent: latestEvent ?? void 0
|
|
2450
2451
|
});
|
|
2451
2452
|
}, [latestEvent, orderState]);
|
|
2452
2453
|
useEffect6(() => {
|
|
@@ -4180,7 +4181,8 @@ function createInitialState(overrides) {
|
|
|
4180
4181
|
processing: {
|
|
4181
4182
|
txHash: null,
|
|
4182
4183
|
directTransfer: false,
|
|
4183
|
-
swappedContext: null
|
|
4184
|
+
swappedContext: null,
|
|
4185
|
+
initialEvent: null
|
|
4184
4186
|
},
|
|
4185
4187
|
dappImport: {
|
|
4186
4188
|
activeProviderId: null,
|
|
@@ -4789,7 +4791,8 @@ function applyAction(state, action) {
|
|
|
4789
4791
|
...state.processing,
|
|
4790
4792
|
txHash: action.txHash,
|
|
4791
4793
|
directTransfer: action.directTransfer ?? false,
|
|
4792
|
-
swappedContext: action.swappedContext ?? null
|
|
4794
|
+
swappedContext: action.swappedContext ?? null,
|
|
4795
|
+
initialEvent: action.initialEvent ?? null
|
|
4793
4796
|
},
|
|
4794
4797
|
flow: { ...state.flow, step: "processing" }
|
|
4795
4798
|
};
|
|
@@ -4959,7 +4962,8 @@ function applyAction(state, action) {
|
|
|
4959
4962
|
processing: {
|
|
4960
4963
|
txHash: null,
|
|
4961
4964
|
directTransfer: false,
|
|
4962
|
-
swappedContext: null
|
|
4965
|
+
swappedContext: null,
|
|
4966
|
+
initialEvent: null
|
|
4963
4967
|
},
|
|
4964
4968
|
// Drop fetched availability wholesale. The fetch effect refetches
|
|
4965
4969
|
// unconditionally on remount (so keeping the map saves nothing),
|
|
@@ -5455,7 +5459,8 @@ function deriveStep(flow, d, p, activeEntry, fiat, exchange) {
|
|
|
5455
5459
|
sourceDecimals: d.sourceDecimals ?? void 0,
|
|
5456
5460
|
inputAmountUsd: d.inputAmountUsd ?? void 0,
|
|
5457
5461
|
directTransfer: p.directTransfer,
|
|
5458
|
-
swappedContext: p.swappedContext ?? void 0
|
|
5462
|
+
swappedContext: p.swappedContext ?? void 0,
|
|
5463
|
+
initialEvent: p.initialEvent ?? void 0
|
|
5459
5464
|
};
|
|
5460
5465
|
}
|
|
5461
5466
|
}
|
|
@@ -6678,7 +6683,8 @@ function DepositFlow({
|
|
|
6678
6683
|
amount,
|
|
6679
6684
|
sourceSymbol: info.orderCrypto ?? "USDC",
|
|
6680
6685
|
sourceDecimals: SWAPPED_SOURCE_DECIMALS,
|
|
6681
|
-
swappedContext
|
|
6686
|
+
swappedContext,
|
|
6687
|
+
initialEvent: info.initialEvent
|
|
6682
6688
|
});
|
|
6683
6689
|
onLifecycleRef.current?.({
|
|
6684
6690
|
type: "submitted",
|
|
@@ -6950,6 +6956,7 @@ function DepositFlow({
|
|
|
6950
6956
|
swappedContext: step.swappedContext,
|
|
6951
6957
|
service,
|
|
6952
6958
|
directTransfer: step.directTransfer,
|
|
6959
|
+
initialEvent: step.initialEvent,
|
|
6953
6960
|
isSwappedOrder: true,
|
|
6954
6961
|
onClose,
|
|
6955
6962
|
onNewDeposit: handleNewDeposit,
|
|
@@ -7018,6 +7025,7 @@ function DepositFlow({
|
|
|
7018
7025
|
swappedContext: step.swappedContext,
|
|
7019
7026
|
service,
|
|
7020
7027
|
directTransfer: step.directTransfer,
|
|
7028
|
+
initialEvent: step.initialEvent,
|
|
7021
7029
|
isSwappedOrder: true,
|
|
7022
7030
|
onClose,
|
|
7023
7031
|
onNewDeposit: handleNewDeposit,
|
|
@@ -7147,6 +7155,7 @@ function DepositFlow({
|
|
|
7147
7155
|
amountUsd: effectiveStep.inputAmountUsd,
|
|
7148
7156
|
service,
|
|
7149
7157
|
directTransfer: effectiveStep.directTransfer,
|
|
7158
|
+
initialEvent: effectiveStep.initialEvent,
|
|
7150
7159
|
onClose,
|
|
7151
7160
|
onNewDeposit: handleNewDeposit,
|
|
7152
7161
|
onDepositComplete: handleDepositComplete,
|
|
@@ -7308,6 +7317,7 @@ function DepositFlow({
|
|
|
7308
7317
|
amountUsd: effectiveStep.inputAmountUsd,
|
|
7309
7318
|
service,
|
|
7310
7319
|
directTransfer: effectiveStep.directTransfer,
|
|
7320
|
+
initialEvent: effectiveStep.initialEvent,
|
|
7311
7321
|
uiConfig,
|
|
7312
7322
|
onClose,
|
|
7313
7323
|
onNewDeposit: handleNewDeposit,
|
|
@@ -7608,7 +7618,7 @@ DepositHistoryPanel.displayName = "DepositHistoryPanel";
|
|
|
7608
7618
|
// src/DepositModal.tsx
|
|
7609
7619
|
import { jsx as jsx21, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
7610
7620
|
var ReownDepositInner = lazy2(
|
|
7611
|
-
() => import("./DepositModalReown-
|
|
7621
|
+
() => import("./DepositModalReown-IVRDXQAA.mjs").then((m) => ({ default: m.DepositModalReown }))
|
|
7612
7622
|
);
|
|
7613
7623
|
function sortByCreatedAtDesc(items) {
|
|
7614
7624
|
return [...items].sort((a, b) => {
|