@rhinestone/deposit-modal 0.14.1 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -0
- package/bridge-transcript.json +14 -0
- package/dist/ClaimModal-GFDBVCN5.cjs +11 -0
- package/dist/ClaimModal-VQS3AKEL.mjs +11 -0
- package/dist/{DepositModalReown-2EVV64OA.mjs → DepositModalReown-KOJ7VEY7.mjs} +6 -7
- package/dist/{DepositModalReown-GAD45GIC.cjs → DepositModalReown-R37SSHUF.cjs} +21 -22
- package/dist/WithdrawModal-QVXHMH43.mjs +12 -0
- package/dist/WithdrawModal-RY2NMFLE.cjs +12 -0
- package/dist/{caip-D8aRWdEY.d.cts → caip-BMi-9t09.d.cts} +27 -3
- package/dist/{caip-D8aRWdEY.d.ts → caip-BMi-9t09.d.ts} +27 -3
- package/dist/{chunk-HAQOFI3D.cjs → chunk-3OOY67VJ.cjs} +1046 -226
- package/dist/{chunk-AQVJUXSG.cjs → chunk-5P2PVLS4.cjs} +1 -1
- package/dist/{chunk-UX35GYLM.mjs → chunk-5VONFVQN.mjs} +918 -98
- package/dist/chunk-6HUHVXCY.cjs +704 -0
- package/dist/{chunk-GZ4GQ5MC.mjs → chunk-7UQ6OUEE.mjs} +166 -45
- package/dist/{chunk-LMG46EP2.mjs → chunk-CXBMIZUF.mjs} +1 -1
- package/dist/{chunk-A6JPBMYY.cjs → chunk-DTVZUBHI.cjs} +236 -115
- package/dist/{chunk-VUATPOWJ.mjs → chunk-EAGMY3QE.mjs} +74 -17
- package/dist/{chunk-RN5VKWI6.mjs → chunk-FTWKAJGN.mjs} +1 -1
- package/dist/{chunk-5Q5CSVKF.mjs → chunk-IKUYZA7A.mjs} +195 -495
- package/dist/{chunk-DW2EQA2U.cjs → chunk-LVCD6RHF.cjs} +2 -2
- package/dist/{chunk-4KCSH4T3.cjs → chunk-OY5N3E6L.cjs} +86 -29
- package/dist/chunk-QJ7RCCU7.mjs +704 -0
- package/dist/{chunk-XCTRKCNM.mjs → chunk-UCBUCX2W.mjs} +1515 -194
- package/dist/{chunk-NQMC5VKQ.cjs → chunk-VPDCGD2D.cjs} +552 -852
- package/dist/{chunk-4J5ADVIN.cjs → chunk-X4D52IZK.cjs} +1496 -175
- package/dist/claim.cjs +5 -7
- package/dist/claim.d.cts +3 -3
- package/dist/claim.d.ts +3 -3
- package/dist/claim.mjs +4 -6
- package/dist/{constants-DBrWhJWE.d.cts → constants-BT4ctuHo.d.cts} +7 -6
- package/dist/{constants-DBrWhJWE.d.ts → constants-D21ZdNOP.d.ts} +7 -6
- package/dist/constants.cjs +3 -3
- package/dist/constants.d.cts +3 -3
- package/dist/constants.d.ts +3 -3
- package/dist/constants.mjs +2 -2
- package/dist/deposit.cjs +7 -8
- package/dist/deposit.d.cts +3 -3
- package/dist/deposit.d.ts +3 -3
- package/dist/deposit.mjs +6 -7
- package/dist/embed.cjs +135 -44
- package/dist/embed.d.cts +2 -2
- package/dist/embed.d.ts +2 -2
- package/dist/embed.mjs +116 -25
- package/dist/index.cjs +13 -11
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.mjs +12 -10
- package/dist/polymarket.cjs +6 -6
- package/dist/polymarket.mjs +2 -2
- package/dist/styles.css +132 -100
- package/dist/{types-DP_3KwlD.d.cts → types-CQ0NHqCy.d.ts} +146 -11
- package/dist/{types-Bho4OA03.d.ts → types-CxiLX5sv.d.cts} +146 -11
- package/dist/withdraw.cjs +6 -6
- package/dist/withdraw.d.cts +4 -4
- package/dist/withdraw.d.ts +4 -4
- package/dist/withdraw.mjs +5 -5
- package/package.json +6 -6
- package/dist/ClaimModal-GDFENSLV.mjs +0 -13
- package/dist/ClaimModal-L3FUBI5U.cjs +0 -13
- package/dist/WithdrawModal-FAQH35NG.cjs +0 -12
- package/dist/WithdrawModal-IKUHF5CF.mjs +0 -12
- package/dist/chunk-62UCV2LG.cjs +0 -81
- package/dist/chunk-7AZFT2MV.cjs +0 -163
- package/dist/chunk-QACOOLOE.mjs +0 -1062
- package/dist/chunk-R5UQ3TN4.mjs +0 -81
- package/dist/chunk-VALXN5IO.mjs +0 -163
- package/dist/chunk-YP7QVKQ6.cjs +0 -1062
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
|
+
HistoryEntryButton,
|
|
3
|
+
HistoryOverlay,
|
|
2
4
|
ProcessingStep,
|
|
3
5
|
SetupError,
|
|
4
6
|
Tooltip,
|
|
@@ -6,6 +8,7 @@ import {
|
|
|
6
8
|
computeCacheKey,
|
|
7
9
|
computeIsCacheable,
|
|
8
10
|
computeRequestKey,
|
|
11
|
+
createHistoryAnalytics,
|
|
9
12
|
failureMessageForEvent,
|
|
10
13
|
fetchTokenPriceUsd,
|
|
11
14
|
getEventSourceDetails,
|
|
@@ -14,20 +17,17 @@ import {
|
|
|
14
17
|
getExchangeLogoSrc,
|
|
15
18
|
isDepositEvent,
|
|
16
19
|
isFailedEvent,
|
|
20
|
+
isHistoryEntryVisible,
|
|
17
21
|
isSubmissionUncertain,
|
|
18
22
|
readDedupedAccountSetupResult,
|
|
19
23
|
runAccountSetupDeduped,
|
|
20
24
|
txRefsMatch,
|
|
25
|
+
useHistoryPanel,
|
|
21
26
|
warnRemovedProps
|
|
22
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-UCBUCX2W.mjs";
|
|
23
28
|
import {
|
|
24
|
-
ListRow
|
|
25
|
-
} from "./chunk-R5UQ3TN4.mjs";
|
|
26
|
-
import {
|
|
27
|
-
AlertTriangleIcon,
|
|
28
29
|
AnalyticsSession,
|
|
29
30
|
AppleIcon,
|
|
30
|
-
ArrowUpRightIcon,
|
|
31
31
|
BankIcon,
|
|
32
32
|
BodyHeader,
|
|
33
33
|
Button,
|
|
@@ -42,8 +42,8 @@ import {
|
|
|
42
42
|
CopyIcon,
|
|
43
43
|
ExternalLinkIcon,
|
|
44
44
|
HandCoinsIcon,
|
|
45
|
-
HistoryIcon,
|
|
46
45
|
InfoIcon,
|
|
46
|
+
ListRow,
|
|
47
47
|
MigrateAssetsIcon,
|
|
48
48
|
Modal,
|
|
49
49
|
PermitDepositSubmitError,
|
|
@@ -88,7 +88,7 @@ import {
|
|
|
88
88
|
useLatestRef,
|
|
89
89
|
useRpcUrls,
|
|
90
90
|
useStableRpcUrls
|
|
91
|
-
} from "./chunk-
|
|
91
|
+
} from "./chunk-5VONFVQN.mjs";
|
|
92
92
|
import {
|
|
93
93
|
MULTICALL3_ADDRESS,
|
|
94
94
|
POLYMARKET_COLLATERAL_OFFRAMP_ADDRESS,
|
|
@@ -100,7 +100,7 @@ import {
|
|
|
100
100
|
executePolymarketSafeTransfer,
|
|
101
101
|
fetchPolymarketProxyWallet,
|
|
102
102
|
readPolymarketBalances
|
|
103
|
-
} from "./chunk-
|
|
103
|
+
} from "./chunk-FTWKAJGN.mjs";
|
|
104
104
|
import {
|
|
105
105
|
HYPERCORE_CHAIN_ID,
|
|
106
106
|
HYPERCORE_MIN_DEPOSIT_USD,
|
|
@@ -119,19 +119,15 @@ import {
|
|
|
119
119
|
getSupportedChainIds,
|
|
120
120
|
getTargetTokenSymbol,
|
|
121
121
|
getTargetTokenSymbolsForChain,
|
|
122
|
-
getTokenDecimalsByAddress,
|
|
123
|
-
getTokenSymbol,
|
|
124
|
-
isHyperCoreCaip2,
|
|
125
122
|
isHyperCoreDestination,
|
|
126
123
|
isNativeSol,
|
|
127
|
-
isSolanaCaip2,
|
|
128
124
|
isStablecoinSymbol,
|
|
129
125
|
isVirtualDestination,
|
|
130
126
|
parseEvmChainId,
|
|
131
127
|
publishShortlistTokens,
|
|
132
128
|
targetChainToChainId,
|
|
133
129
|
toEvmCaip2
|
|
134
|
-
} from "./chunk-
|
|
130
|
+
} from "./chunk-EAGMY3QE.mjs";
|
|
135
131
|
|
|
136
132
|
// src/core/reown-dependencies.ts
|
|
137
133
|
var dependencies;
|
|
@@ -163,11 +159,11 @@ function getReownDependencies() {
|
|
|
163
159
|
|
|
164
160
|
// src/DepositModal.tsx
|
|
165
161
|
import {
|
|
166
|
-
useMemo as
|
|
167
|
-
useEffect as
|
|
168
|
-
useRef as
|
|
169
|
-
useState as
|
|
170
|
-
useCallback as
|
|
162
|
+
useMemo as useMemo9,
|
|
163
|
+
useEffect as useEffect14,
|
|
164
|
+
useRef as useRef10,
|
|
165
|
+
useState as useState14,
|
|
166
|
+
useCallback as useCallback8,
|
|
171
167
|
lazy as lazy2,
|
|
172
168
|
Suspense as Suspense2
|
|
173
169
|
} from "react";
|
|
@@ -177,9 +173,9 @@ import {
|
|
|
177
173
|
useState as useState13,
|
|
178
174
|
useCallback as useCallback7,
|
|
179
175
|
useMemo as useMemo8,
|
|
180
|
-
useEffect as
|
|
176
|
+
useEffect as useEffect13,
|
|
181
177
|
useLayoutEffect as useLayoutEffect2,
|
|
182
|
-
useRef as
|
|
178
|
+
useRef as useRef9
|
|
183
179
|
} from "react";
|
|
184
180
|
|
|
185
181
|
// src/components/steps/ConnectStep.tsx
|
|
@@ -4704,7 +4700,7 @@ function SolanaAmountStep({
|
|
|
4704
4700
|
}
|
|
4705
4701
|
|
|
4706
4702
|
// src/components/steps/SolanaConfirmStep.tsx
|
|
4707
|
-
import { useState as useState12 } from "react";
|
|
4703
|
+
import { useEffect as useEffect12, useRef as useRef8, useState as useState12 } from "react";
|
|
4708
4704
|
import { parseUnits as parseUnits5 } from "viem";
|
|
4709
4705
|
|
|
4710
4706
|
// src/core/solana.ts
|
|
@@ -4836,11 +4832,18 @@ function SolanaConfirmStep({
|
|
|
4836
4832
|
estimatedTime = "< 1 min",
|
|
4837
4833
|
onConfirm,
|
|
4838
4834
|
onError,
|
|
4835
|
+
onSubmittingChange,
|
|
4839
4836
|
debug
|
|
4840
4837
|
}) {
|
|
4841
4838
|
const rpcUrls = useRpcUrls();
|
|
4842
4839
|
const [isSubmitting, setIsSubmitting] = useState12(false);
|
|
4843
4840
|
const [error, setError] = useState12(null);
|
|
4841
|
+
const onSubmittingChangeRef = useRef8(onSubmittingChange);
|
|
4842
|
+
onSubmittingChangeRef.current = onSubmittingChange;
|
|
4843
|
+
useEffect12(() => {
|
|
4844
|
+
onSubmittingChangeRef.current?.(isSubmitting);
|
|
4845
|
+
return () => onSubmittingChangeRef.current?.(false);
|
|
4846
|
+
}, [isSubmitting]);
|
|
4844
4847
|
const targetChainId = targetChainToChainId(targetChain);
|
|
4845
4848
|
const targetSymbol = getTargetTokenSymbol(targetToken, targetChainId);
|
|
4846
4849
|
const sourceChainName = getChainName("solana");
|
|
@@ -5910,6 +5913,10 @@ function createDepositAnalyticsController(emit) {
|
|
|
5910
5913
|
dedupe.add(key);
|
|
5911
5914
|
emit(...args);
|
|
5912
5915
|
};
|
|
5916
|
+
const sendHistory = (type, detail) => {
|
|
5917
|
+
controller.openSession();
|
|
5918
|
+
emit(...[{ type, ...detail }, method]);
|
|
5919
|
+
};
|
|
5913
5920
|
const controller = {
|
|
5914
5921
|
emit,
|
|
5915
5922
|
openSession() {
|
|
@@ -5917,6 +5924,21 @@ function createDepositAnalyticsController(emit) {
|
|
|
5917
5924
|
opened = true;
|
|
5918
5925
|
emit({ type: "deposit_modal_open" }, null);
|
|
5919
5926
|
},
|
|
5927
|
+
historyOpened(detail) {
|
|
5928
|
+
sendHistory("deposit_modal_history_open", detail);
|
|
5929
|
+
},
|
|
5930
|
+
historyRowViewed(detail) {
|
|
5931
|
+
sendHistory("deposit_modal_history_row_view", detail);
|
|
5932
|
+
},
|
|
5933
|
+
historyLoadMore(detail) {
|
|
5934
|
+
sendHistory("deposit_modal_history_load_more", detail);
|
|
5935
|
+
},
|
|
5936
|
+
historyFallbackOpened(detail) {
|
|
5937
|
+
sendHistory("deposit_modal_history_fallback_open", detail);
|
|
5938
|
+
},
|
|
5939
|
+
historyRecoveryStarted(detail) {
|
|
5940
|
+
sendHistory("deposit_modal_history_recovery_start", detail);
|
|
5941
|
+
},
|
|
5920
5942
|
selectMethod(...args) {
|
|
5921
5943
|
const [nextMethod, entrySource, identifiers] = args;
|
|
5922
5944
|
controller.openSession();
|
|
@@ -7394,6 +7416,7 @@ function DepositFlow({
|
|
|
7394
7416
|
onSwappedImmersiveChange,
|
|
7395
7417
|
openExternally,
|
|
7396
7418
|
onSubmittingChange,
|
|
7419
|
+
onProcessingSettledChange,
|
|
7397
7420
|
onClose,
|
|
7398
7421
|
onLifecycle,
|
|
7399
7422
|
onError,
|
|
@@ -7416,8 +7439,8 @@ function DepositFlow({
|
|
|
7416
7439
|
const isConnectSelectionConfirmed = flowSlice.isConnectSelectionConfirmed;
|
|
7417
7440
|
const selectedWalletId = useDepositStore(selectedWalletIdSelector);
|
|
7418
7441
|
const [totalBalanceUsd, setTotalBalanceUsd] = useState13(0);
|
|
7419
|
-
const stableWalletSignerRef =
|
|
7420
|
-
const stableWalletSelectionKeyRef =
|
|
7442
|
+
const stableWalletSignerRef = useRef9(null);
|
|
7443
|
+
const stableWalletSelectionKeyRef = useRef9(null);
|
|
7421
7444
|
const logFlow = useCallback7(
|
|
7422
7445
|
(message, data) => {
|
|
7423
7446
|
debugLog(debug, "deposit-flow", message, data);
|
|
@@ -7431,7 +7454,7 @@ function DepositFlow({
|
|
|
7431
7454
|
[debug]
|
|
7432
7455
|
);
|
|
7433
7456
|
const enableSwappedPreconnect = enableFiatOnramp || enableExchangeConnect;
|
|
7434
|
-
|
|
7457
|
+
useEffect13(() => {
|
|
7435
7458
|
if (!enableSwappedPreconnect) return;
|
|
7436
7459
|
if (typeof document === "undefined") return;
|
|
7437
7460
|
const links = [];
|
|
@@ -7551,8 +7574,8 @@ function DepositFlow({
|
|
|
7551
7574
|
const targetChainId = targetChainToChainId(targetChain);
|
|
7552
7575
|
const targetSymbol = getTargetTokenSymbol(targetToken, targetChainId);
|
|
7553
7576
|
const isTargetStablecoin = isStablecoinSymbol(targetSymbol);
|
|
7554
|
-
const targetMarketPriceRef =
|
|
7555
|
-
|
|
7577
|
+
const targetMarketPriceRef = useRef9(null);
|
|
7578
|
+
useEffect13(() => {
|
|
7556
7579
|
targetMarketPriceRef.current = null;
|
|
7557
7580
|
if (isTargetStablecoin || targetSymbol === "Token") {
|
|
7558
7581
|
return;
|
|
@@ -7630,7 +7653,7 @@ function DepositFlow({
|
|
|
7630
7653
|
setupChainId,
|
|
7631
7654
|
rpcUrls
|
|
7632
7655
|
]);
|
|
7633
|
-
|
|
7656
|
+
useEffect13(() => {
|
|
7634
7657
|
if (flowMode !== "wallet" && flowMode !== "dapp-import") {
|
|
7635
7658
|
stableWalletSelectionKeyRef.current = null;
|
|
7636
7659
|
stableWalletSignerRef.current = null;
|
|
@@ -7702,8 +7725,8 @@ function DepositFlow({
|
|
|
7702
7725
|
]
|
|
7703
7726
|
);
|
|
7704
7727
|
const activeEntry = setupSlice;
|
|
7705
|
-
const lastSmartAccountLifecycleKeyRef =
|
|
7706
|
-
|
|
7728
|
+
const lastSmartAccountLifecycleKeyRef = useRef9(null);
|
|
7729
|
+
useEffect13(() => {
|
|
7707
7730
|
if (activeEntry.status !== "ready" || !activeEntry.smartAccount) return;
|
|
7708
7731
|
const lifecycleKey = [
|
|
7709
7732
|
activeEntry.smartAccount.toLowerCase(),
|
|
@@ -7722,8 +7745,8 @@ function DepositFlow({
|
|
|
7722
7745
|
activeEntry.solanaDepositAddress,
|
|
7723
7746
|
onLifecycleRef
|
|
7724
7747
|
]);
|
|
7725
|
-
const lastConnectedLifecycleKeyRef =
|
|
7726
|
-
|
|
7748
|
+
const lastConnectedLifecycleKeyRef = useRef9(null);
|
|
7749
|
+
useEffect13(() => {
|
|
7727
7750
|
if (!flowMode || !isConnectSelectionConfirmed) {
|
|
7728
7751
|
lastConnectedLifecycleKeyRef.current = null;
|
|
7729
7752
|
return;
|
|
@@ -7821,7 +7844,7 @@ function DepositFlow({
|
|
|
7821
7844
|
const qrSourceAsset = effectiveStep.type === "qr-amount" ? effectiveStep.asset : null;
|
|
7822
7845
|
const qrSourceKey = qrSourceAsset ? `${qrSourceAsset.chainId}:${qrSourceAsset.token}` : null;
|
|
7823
7846
|
const [qrSourcePrice, setQrSourcePrice] = useState13({ resolved: false, usd: null });
|
|
7824
|
-
|
|
7847
|
+
useEffect13(() => {
|
|
7825
7848
|
setQrSourcePrice({ resolved: false, usd: null });
|
|
7826
7849
|
if (!qrSourceAsset) return;
|
|
7827
7850
|
let cancelled = false;
|
|
@@ -7847,12 +7870,12 @@ function DepositFlow({
|
|
|
7847
7870
|
effectiveStep.type === "dapp-import-resolving" && flowMode === "dapp-import" || effectiveStep.type === "dapp-import-select" || effectiveStep.type === "dapp-import-asset-select" || effectiveStep.type === "fiat-onramp" || effectiveStep.type === "exchange-select" || effectiveStep.type === "exchange-connect" || effectiveStep.type === "select-asset" && signerContext && !canAutoLock;
|
|
7848
7871
|
const currentBackHandler = canGoBackFromHere ? handleBack : void 0;
|
|
7849
7872
|
const currentScreen = showConnectStep ? "connect" : effectiveStep.type;
|
|
7850
|
-
|
|
7873
|
+
useEffect13(() => {
|
|
7851
7874
|
onStepChangeRef.current?.(currentBackHandler, currentScreen);
|
|
7852
7875
|
}, [currentBackHandler, currentScreen, onStepChangeRef]);
|
|
7853
|
-
const lastModalHeightRef =
|
|
7854
|
-
const modalContentElRef =
|
|
7855
|
-
|
|
7876
|
+
const lastModalHeightRef = useRef9(0);
|
|
7877
|
+
const modalContentElRef = useRef9(null);
|
|
7878
|
+
useEffect13(() => {
|
|
7856
7879
|
const mc = document.querySelector(".rs-modal-content");
|
|
7857
7880
|
if (!mc) return;
|
|
7858
7881
|
modalContentElRef.current = mc;
|
|
@@ -7869,7 +7892,7 @@ function DepositFlow({
|
|
|
7869
7892
|
};
|
|
7870
7893
|
}, []);
|
|
7871
7894
|
const stepPinKey = `${flowMode ?? "none"}:${step.type}`;
|
|
7872
|
-
const prevStepPinKeyRef =
|
|
7895
|
+
const prevStepPinKeyRef = useRef9(stepPinKey);
|
|
7873
7896
|
useLayoutEffect2(() => {
|
|
7874
7897
|
if (prevStepPinKeyRef.current === stepPinKey) return;
|
|
7875
7898
|
prevStepPinKeyRef.current = stepPinKey;
|
|
@@ -7891,18 +7914,18 @@ function DepositFlow({
|
|
|
7891
7914
|
analyticsMethod,
|
|
7892
7915
|
showConnectStep ? "connect" : effectiveStep.type
|
|
7893
7916
|
);
|
|
7894
|
-
|
|
7917
|
+
useEffect13(() => {
|
|
7895
7918
|
analytics.openSession();
|
|
7896
7919
|
analytics.openStep(analyticsStep);
|
|
7897
7920
|
}, [analytics, analyticsStep]);
|
|
7898
|
-
|
|
7921
|
+
useEffect13(() => {
|
|
7899
7922
|
if (setupSlice.status === "loading") {
|
|
7900
7923
|
analytics.friction("account_setup_pending", "account_setup");
|
|
7901
7924
|
} else if (setupSlice.status === "error") {
|
|
7902
7925
|
analytics.failure("account_setup_failed", true, "account_setup");
|
|
7903
7926
|
}
|
|
7904
7927
|
}, [analytics, setupSlice.status]);
|
|
7905
|
-
|
|
7928
|
+
useEffect13(() => {
|
|
7906
7929
|
logFlow("state:changed", {
|
|
7907
7930
|
step: effectiveStep.type,
|
|
7908
7931
|
flowMode,
|
|
@@ -7918,7 +7941,7 @@ function DepositFlow({
|
|
|
7918
7941
|
targetChain,
|
|
7919
7942
|
targetToken
|
|
7920
7943
|
]);
|
|
7921
|
-
|
|
7944
|
+
useEffect13(() => {
|
|
7922
7945
|
onLifecycleRef.current?.({
|
|
7923
7946
|
type: "balance-changed",
|
|
7924
7947
|
totalUsd: totalBalanceUsd
|
|
@@ -7995,7 +8018,7 @@ function DepositFlow({
|
|
|
7995
8018
|
const dappImportAttemptNonce = useDepositStore(
|
|
7996
8019
|
(s) => s.dappImport.attemptNonce
|
|
7997
8020
|
);
|
|
7998
|
-
|
|
8021
|
+
useEffect13(() => {
|
|
7999
8022
|
if (!dappImportOwner || enabledDappImportProviders.length === 0) {
|
|
8000
8023
|
storeApi.dispatch({ type: "dapp-import/availability-cleared" });
|
|
8001
8024
|
return;
|
|
@@ -8128,7 +8151,7 @@ function DepositFlow({
|
|
|
8128
8151
|
]);
|
|
8129
8152
|
const isBootResolving = isDappImportMode && flowSlice.step === "dapp-import-resolving";
|
|
8130
8153
|
const [hasResolveDeadlinePassed, setHasResolveDeadlinePassed] = useState13(false);
|
|
8131
|
-
|
|
8154
|
+
useEffect13(() => {
|
|
8132
8155
|
setHasResolveDeadlinePassed(false);
|
|
8133
8156
|
if (!isBootResolving || dappImportBootError) return;
|
|
8134
8157
|
const timeout = window.setTimeout(() => {
|
|
@@ -8136,7 +8159,7 @@ function DepositFlow({
|
|
|
8136
8159
|
}, DAPP_IMPORT_RESOLVE_TIMEOUT_MS);
|
|
8137
8160
|
return () => window.clearTimeout(timeout);
|
|
8138
8161
|
}, [isBootResolving, dappImportBootError]);
|
|
8139
|
-
|
|
8162
|
+
useEffect13(() => {
|
|
8140
8163
|
if (!isBootResolving || dappImportBootError) return;
|
|
8141
8164
|
const providerId = activeDappImportProviderId;
|
|
8142
8165
|
if (!providerId) return;
|
|
@@ -8241,7 +8264,7 @@ function DepositFlow({
|
|
|
8241
8264
|
analytics.selectMethod("exchange_connect", "user");
|
|
8242
8265
|
storeApi.dispatch({ type: "connect/exchange-selected" });
|
|
8243
8266
|
}, [analytics, storeApi]);
|
|
8244
|
-
const swappedAnalyticsCorrelatorRef =
|
|
8267
|
+
const swappedAnalyticsCorrelatorRef = useRef9(null);
|
|
8245
8268
|
const handleSwappedAttemptConsumed = useCallback7((externalCustomerId) => {
|
|
8246
8269
|
swappedAnalyticsCorrelatorRef.current = externalCustomerId;
|
|
8247
8270
|
}, []);
|
|
@@ -8261,8 +8284,8 @@ function DepositFlow({
|
|
|
8261
8284
|
);
|
|
8262
8285
|
swappedAnalyticsCorrelatorRef.current = null;
|
|
8263
8286
|
}, [analytics, flowMode]);
|
|
8264
|
-
const swappedConnectUrlRef =
|
|
8265
|
-
const acknowledgedConnectFeeRef =
|
|
8287
|
+
const swappedConnectUrlRef = useRef9(/* @__PURE__ */ new Map());
|
|
8288
|
+
const acknowledgedConnectFeeRef = useRef9(/* @__PURE__ */ new Map());
|
|
8266
8289
|
const handleSelectExchangeConnection = useCallback7(
|
|
8267
8290
|
async (connection, disclosedFeeBps) => {
|
|
8268
8291
|
if (setupSlice.status !== "ready" || !setupSlice.smartAccount) {
|
|
@@ -8338,7 +8361,7 @@ function DepositFlow({
|
|
|
8338
8361
|
},
|
|
8339
8362
|
[service]
|
|
8340
8363
|
);
|
|
8341
|
-
const swappedUrlPrefetchRef =
|
|
8364
|
+
const swappedUrlPrefetchRef = useRef9(/* @__PURE__ */ new Map());
|
|
8342
8365
|
const prefetchSwappedWidgetUrl = useCallback7(
|
|
8343
8366
|
(smartAccount, method, methodSelectionSource) => {
|
|
8344
8367
|
const cache = swappedUrlPrefetchRef.current;
|
|
@@ -8390,7 +8413,7 @@ function DepositFlow({
|
|
|
8390
8413
|
prefetchSwappedWidgetUrl
|
|
8391
8414
|
]
|
|
8392
8415
|
);
|
|
8393
|
-
|
|
8416
|
+
useEffect13(() => {
|
|
8394
8417
|
swappedUrlPrefetchRef.current.clear();
|
|
8395
8418
|
swappedConnectUrlRef.current.clear();
|
|
8396
8419
|
acknowledgedConnectFeeRef.current.clear();
|
|
@@ -8402,7 +8425,7 @@ function DepositFlow({
|
|
|
8402
8425
|
methods: [],
|
|
8403
8426
|
recommendedMethod: null
|
|
8404
8427
|
});
|
|
8405
|
-
|
|
8428
|
+
useEffect13(() => {
|
|
8406
8429
|
if (!fiatEnabled || hasConfiguredFiatMethods) return;
|
|
8407
8430
|
let cancelled = false;
|
|
8408
8431
|
setRegionalMethods({
|
|
@@ -8460,7 +8483,7 @@ function DepositFlow({
|
|
|
8460
8483
|
offeredFiatMethods,
|
|
8461
8484
|
regionalMethods
|
|
8462
8485
|
]);
|
|
8463
|
-
|
|
8486
|
+
useEffect13(() => {
|
|
8464
8487
|
if (cashDisplay.kind === "hidden" && fiatEnabled) {
|
|
8465
8488
|
analytics.friction(
|
|
8466
8489
|
"regional_methods_empty",
|
|
@@ -8524,7 +8547,7 @@ function DepositFlow({
|
|
|
8524
8547
|
);
|
|
8525
8548
|
const desiredSetupRequestKey = computeRequestKey(setupInput);
|
|
8526
8549
|
const setupReady = setupSlice.status === "ready" && setupSlice.requestKey === desiredSetupRequestKey;
|
|
8527
|
-
|
|
8550
|
+
useEffect13(() => {
|
|
8528
8551
|
void (async () => {
|
|
8529
8552
|
const requestKey = computeRequestKey(setupInput);
|
|
8530
8553
|
const cacheKey = computeCacheKey(setupInput);
|
|
@@ -8595,7 +8618,7 @@ function DepositFlow({
|
|
|
8595
8618
|
// eslint-disable-next-line react-hooks/exhaustive-deps -- keyed on the stable id-join, not the walletOptions array identity
|
|
8596
8619
|
[walletOptionsKey]
|
|
8597
8620
|
);
|
|
8598
|
-
|
|
8621
|
+
useEffect13(() => {
|
|
8599
8622
|
storeApi.dispatch({
|
|
8600
8623
|
type: "portfolio/reconciled",
|
|
8601
8624
|
wallets: desiredPortfolios
|
|
@@ -8942,7 +8965,7 @@ function DepositFlow({
|
|
|
8942
8965
|
const handleTotalBalanceComputed = useCallback7((total) => {
|
|
8943
8966
|
setTotalBalanceUsd(total);
|
|
8944
8967
|
}, []);
|
|
8945
|
-
|
|
8968
|
+
useEffect13(() => {
|
|
8946
8969
|
if (storeApi.getState().flow.mode) {
|
|
8947
8970
|
return;
|
|
8948
8971
|
}
|
|
@@ -8952,7 +8975,7 @@ function DepositFlow({
|
|
|
8952
8975
|
storeApi.dispatch({ type: "flow/step-set", step: "connect" });
|
|
8953
8976
|
}
|
|
8954
8977
|
}, [walletOptionsKey]);
|
|
8955
|
-
|
|
8978
|
+
useEffect13(() => {
|
|
8956
8979
|
if (!showConnectStep && isConnectSelectionConfirmed && (flowMode === "wallet" || flowMode === "dapp-import") && flowSlice.step !== "dapp-import-resolving" && flowSlice.step !== "dapp-import-select" && !signerContext) {
|
|
8957
8980
|
storeApi.dispatch({ type: "wallet/cleared" });
|
|
8958
8981
|
}
|
|
@@ -9207,7 +9230,8 @@ function DepositFlow({
|
|
|
9207
9230
|
onDepositComplete: handleDepositComplete,
|
|
9208
9231
|
onDepositFailed: handleDepositFailed,
|
|
9209
9232
|
onError: handleError,
|
|
9210
|
-
debug
|
|
9233
|
+
debug,
|
|
9234
|
+
onSettledChange: onProcessingSettledChange
|
|
9211
9235
|
}
|
|
9212
9236
|
)
|
|
9213
9237
|
]
|
|
@@ -9286,7 +9310,8 @@ function DepositFlow({
|
|
|
9286
9310
|
onDepositComplete: handleDepositComplete,
|
|
9287
9311
|
onDepositFailed: handleDepositFailed,
|
|
9288
9312
|
onError: handleError,
|
|
9289
|
-
debug
|
|
9313
|
+
debug,
|
|
9314
|
+
onSettledChange: onProcessingSettledChange
|
|
9290
9315
|
}
|
|
9291
9316
|
)
|
|
9292
9317
|
]
|
|
@@ -9350,7 +9375,8 @@ function DepositFlow({
|
|
|
9350
9375
|
uiConfig,
|
|
9351
9376
|
onConfirm: handleSolanaConfirmed,
|
|
9352
9377
|
onError: handleError,
|
|
9353
|
-
debug
|
|
9378
|
+
debug,
|
|
9379
|
+
onSubmittingChange
|
|
9354
9380
|
}
|
|
9355
9381
|
) : effectiveStep.type === "solana-confirm" ? /* @__PURE__ */ jsxs23("div", { className: "rs-step", children: [
|
|
9356
9382
|
/* @__PURE__ */ jsxs23("div", { className: "rs-loading-state", children: [
|
|
@@ -9410,7 +9436,8 @@ function DepositFlow({
|
|
|
9410
9436
|
onDepositComplete: handleDepositComplete,
|
|
9411
9437
|
onDepositFailed: handleDepositFailed,
|
|
9412
9438
|
onError: handleError,
|
|
9413
|
-
debug
|
|
9439
|
+
debug,
|
|
9440
|
+
onSettledChange: onProcessingSettledChange
|
|
9414
9441
|
}
|
|
9415
9442
|
)
|
|
9416
9443
|
] });
|
|
@@ -9607,308 +9634,20 @@ function DepositFlow({
|
|
|
9607
9634
|
onDepositComplete: handleDepositComplete,
|
|
9608
9635
|
onDepositFailed: handleDepositFailed,
|
|
9609
9636
|
onError: handleError,
|
|
9610
|
-
debug
|
|
9637
|
+
debug,
|
|
9638
|
+
onSettledChange: onProcessingSettledChange
|
|
9611
9639
|
}
|
|
9612
9640
|
)
|
|
9613
9641
|
] });
|
|
9614
9642
|
}
|
|
9615
9643
|
|
|
9616
|
-
// src/components/history/DepositHistoryPanel.tsx
|
|
9617
|
-
import { useCallback as useCallback8, useMemo as useMemo9, useState as useState14 } from "react";
|
|
9618
|
-
import { jsx as jsx29, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
9619
|
-
function shortenHash(hash) {
|
|
9620
|
-
if (hash.length <= 14) return hash;
|
|
9621
|
-
return `${hash.slice(0, 6)}\u2026${hash.slice(-4)}`;
|
|
9622
|
-
}
|
|
9623
|
-
function formatDate(iso) {
|
|
9624
|
-
try {
|
|
9625
|
-
const date = new Date(iso);
|
|
9626
|
-
if (Number.isNaN(date.getTime())) return iso;
|
|
9627
|
-
return date.toLocaleDateString("en-US", {
|
|
9628
|
-
day: "numeric",
|
|
9629
|
-
month: "short",
|
|
9630
|
-
year: "numeric"
|
|
9631
|
-
});
|
|
9632
|
-
} catch {
|
|
9633
|
-
return iso;
|
|
9634
|
-
}
|
|
9635
|
-
}
|
|
9636
|
-
function resolveChainId(value) {
|
|
9637
|
-
if (value === void 0 || value === null) return null;
|
|
9638
|
-
if (typeof value === "number") return value;
|
|
9639
|
-
if (isSolanaCaip2(value) || value === "solana") return "solana";
|
|
9640
|
-
if (isHyperCoreCaip2(value) || value === "hypercore") return "hypercore";
|
|
9641
|
-
const parsed = parseEvmChainId(value);
|
|
9642
|
-
if (parsed !== null) return parsed;
|
|
9643
|
-
const num = Number(value);
|
|
9644
|
-
return Number.isFinite(num) ? num : null;
|
|
9645
|
-
}
|
|
9646
|
-
function resolveTokenSymbol(token, chainId) {
|
|
9647
|
-
if (!token) return "";
|
|
9648
|
-
if (chainId === "solana") {
|
|
9649
|
-
const normalized = token.toLowerCase();
|
|
9650
|
-
const matched = SOLANA_TOKENS.find(
|
|
9651
|
-
(entry) => entry.mint.toLowerCase() === normalized
|
|
9652
|
-
);
|
|
9653
|
-
if (matched) return matched.symbol;
|
|
9654
|
-
if (normalized === "native" || normalized === "11111111111111111111111111111111" || normalized === "so11111111111111111111111111111111111111112") {
|
|
9655
|
-
return "SOL";
|
|
9656
|
-
}
|
|
9657
|
-
}
|
|
9658
|
-
if (chainId !== null && chainId !== void 0 && chainId !== "solana" && /^0x[a-fA-F0-9]{40}$/.test(token)) {
|
|
9659
|
-
const evmChainId = chainId === "hypercore" ? HYPERCORE_CHAIN_ID : chainId;
|
|
9660
|
-
const sym = getTokenSymbol(token, evmChainId);
|
|
9661
|
-
if (sym !== "Token") return sym;
|
|
9662
|
-
}
|
|
9663
|
-
return shortenHash(token);
|
|
9664
|
-
}
|
|
9665
|
-
function formatAmount(rawAmount, token, chainId) {
|
|
9666
|
-
if (!rawAmount) return "";
|
|
9667
|
-
let decimals = 18;
|
|
9668
|
-
if (token && chainId !== null && chainId !== void 0) {
|
|
9669
|
-
if (chainId === "solana") {
|
|
9670
|
-
const normalized = token.toLowerCase();
|
|
9671
|
-
const matched = SOLANA_TOKENS.find(
|
|
9672
|
-
(entry) => entry.mint.toLowerCase() === normalized
|
|
9673
|
-
);
|
|
9674
|
-
if (matched) {
|
|
9675
|
-
decimals = matched.decimals;
|
|
9676
|
-
} else if (normalized === "native" || normalized === "11111111111111111111111111111111" || normalized === "so11111111111111111111111111111111111111112") {
|
|
9677
|
-
decimals = 9;
|
|
9678
|
-
}
|
|
9679
|
-
} else if (/^0x[a-fA-F0-9]{40}$/.test(token)) {
|
|
9680
|
-
const evmChainId = chainId === "hypercore" ? HYPERCORE_CHAIN_ID : chainId;
|
|
9681
|
-
decimals = getTokenDecimalsByAddress(token, evmChainId);
|
|
9682
|
-
}
|
|
9683
|
-
}
|
|
9684
|
-
try {
|
|
9685
|
-
const raw = BigInt(rawAmount);
|
|
9686
|
-
const divisor = 10n ** BigInt(decimals);
|
|
9687
|
-
const whole = raw / divisor;
|
|
9688
|
-
const remainder = raw % divisor;
|
|
9689
|
-
const fracStr = remainder.toString().padStart(decimals, "0");
|
|
9690
|
-
let frac = fracStr.slice(0, 5).replace(/0+$/, "");
|
|
9691
|
-
if (frac.length < 2) frac = frac.padEnd(2, "0");
|
|
9692
|
-
return `${whole}.${frac}`;
|
|
9693
|
-
} catch {
|
|
9694
|
-
return rawAmount;
|
|
9695
|
-
}
|
|
9696
|
-
}
|
|
9697
|
-
function normalizeStatus(raw, isSpam) {
|
|
9698
|
-
const lower = raw.toLowerCase();
|
|
9699
|
-
if (lower === "completed" || lower === "complete" || lower === "bridge-complete" || lower === "processed")
|
|
9700
|
-
return "completed";
|
|
9701
|
-
if (lower === "failed" || lower === "error" || lower === "bridge-failed") {
|
|
9702
|
-
return isSpam ? "spam" : "failed";
|
|
9703
|
-
}
|
|
9704
|
-
if (lower === "processing" || lower === "submitted" || lower === "bridging")
|
|
9705
|
-
return "processing";
|
|
9706
|
-
return "pending";
|
|
9707
|
-
}
|
|
9708
|
-
var STATUS_LABEL = {
|
|
9709
|
-
pending: "Pending",
|
|
9710
|
-
processing: "Processing",
|
|
9711
|
-
completed: "Completed",
|
|
9712
|
-
failed: "Failed",
|
|
9713
|
-
spam: "Spam token"
|
|
9714
|
-
};
|
|
9715
|
-
function DepositHistoryPanel({
|
|
9716
|
-
deposits,
|
|
9717
|
-
isLoading,
|
|
9718
|
-
error,
|
|
9719
|
-
hasMore,
|
|
9720
|
-
isLoadingMore,
|
|
9721
|
-
onLoadMore,
|
|
9722
|
-
onClose,
|
|
9723
|
-
onCloseModal
|
|
9724
|
-
}) {
|
|
9725
|
-
const handleKeyDown = useCallback8(
|
|
9726
|
-
(e) => {
|
|
9727
|
-
if (e.key === "Escape") {
|
|
9728
|
-
e.stopPropagation();
|
|
9729
|
-
onClose();
|
|
9730
|
-
}
|
|
9731
|
-
},
|
|
9732
|
-
[onClose]
|
|
9733
|
-
);
|
|
9734
|
-
const visibleDeposits = useMemo9(() => {
|
|
9735
|
-
const sourceHashes = new Set(
|
|
9736
|
-
deposits.map((d) => d.sourceTxHash?.toLowerCase()).filter((h) => Boolean(h))
|
|
9737
|
-
);
|
|
9738
|
-
return deposits.filter(
|
|
9739
|
-
(d) => !(d.txHash && sourceHashes.has(d.txHash.toLowerCase()))
|
|
9740
|
-
);
|
|
9741
|
-
}, [deposits]);
|
|
9742
|
-
return /* @__PURE__ */ jsxs24(
|
|
9743
|
-
"div",
|
|
9744
|
-
{
|
|
9745
|
-
className: "rs-history-panel",
|
|
9746
|
-
role: "dialog",
|
|
9747
|
-
"aria-label": "Deposit history",
|
|
9748
|
-
onKeyDown: handleKeyDown,
|
|
9749
|
-
children: [
|
|
9750
|
-
/* @__PURE__ */ jsxs24("div", { className: "rs-modal-header--redesigned", children: [
|
|
9751
|
-
/* @__PURE__ */ jsx29("div", { className: "rs-modal-header-nav-left", children: /* @__PURE__ */ jsx29(
|
|
9752
|
-
"button",
|
|
9753
|
-
{
|
|
9754
|
-
type: "button",
|
|
9755
|
-
className: "rs-modal-header-back",
|
|
9756
|
-
"aria-label": "Back",
|
|
9757
|
-
onClick: onClose,
|
|
9758
|
-
children: /* @__PURE__ */ jsx29(ChevronLeftIcon, {})
|
|
9759
|
-
}
|
|
9760
|
-
) }),
|
|
9761
|
-
/* @__PURE__ */ jsx29("div", { className: "rs-modal-header-nav-right", children: onCloseModal && /* @__PURE__ */ jsx29(
|
|
9762
|
-
"button",
|
|
9763
|
-
{
|
|
9764
|
-
type: "button",
|
|
9765
|
-
className: "rs-modal-close",
|
|
9766
|
-
"aria-label": "Close",
|
|
9767
|
-
onClick: onCloseModal,
|
|
9768
|
-
children: /* @__PURE__ */ jsx29(CloseIcon, {})
|
|
9769
|
-
}
|
|
9770
|
-
) })
|
|
9771
|
-
] }),
|
|
9772
|
-
/* @__PURE__ */ jsxs24("div", { className: "rs-history-screen", children: [
|
|
9773
|
-
/* @__PURE__ */ jsxs24("div", { className: "rs-history-screen-body", children: [
|
|
9774
|
-
/* @__PURE__ */ jsx29(BodyHeader, { icon: /* @__PURE__ */ jsx29(HistoryIcon, {}), title: "History" }),
|
|
9775
|
-
isLoading && deposits.length === 0 && /* @__PURE__ */ jsxs24("div", { className: "rs-history-empty", children: [
|
|
9776
|
-
/* @__PURE__ */ jsx29("span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ jsx29(HistoryIcon, {}) }),
|
|
9777
|
-
/* @__PURE__ */ jsxs24("div", { className: "rs-history-empty-text", children: [
|
|
9778
|
-
/* @__PURE__ */ jsx29(Spinner, { className: "rs-spinner--sm" }),
|
|
9779
|
-
/* @__PURE__ */ jsx29("span", { className: "rs-history-empty-hint", children: "Loading history\u2026" })
|
|
9780
|
-
] })
|
|
9781
|
-
] }),
|
|
9782
|
-
error && !isLoading && /* @__PURE__ */ jsxs24("div", { className: "rs-history-empty", children: [
|
|
9783
|
-
/* @__PURE__ */ jsx29("span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ jsx29(AlertTriangleIcon, {}) }),
|
|
9784
|
-
/* @__PURE__ */ jsxs24("div", { className: "rs-history-empty-text", children: [
|
|
9785
|
-
/* @__PURE__ */ jsx29("span", { className: "rs-history-empty-title", children: "Couldn't load history" }),
|
|
9786
|
-
/* @__PURE__ */ jsx29("span", { className: "rs-history-empty-hint", children: error })
|
|
9787
|
-
] })
|
|
9788
|
-
] }),
|
|
9789
|
-
!isLoading && !error && visibleDeposits.length === 0 && /* @__PURE__ */ jsxs24("div", { className: "rs-history-empty", children: [
|
|
9790
|
-
/* @__PURE__ */ jsx29("span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ jsx29(HistoryIcon, {}) }),
|
|
9791
|
-
/* @__PURE__ */ jsxs24("div", { className: "rs-history-empty-text", children: [
|
|
9792
|
-
/* @__PURE__ */ jsx29("span", { className: "rs-history-empty-title", children: "No deposits yet" }),
|
|
9793
|
-
/* @__PURE__ */ jsx29("span", { className: "rs-history-empty-hint", children: "Your deposit history will appear here" })
|
|
9794
|
-
] })
|
|
9795
|
-
] }),
|
|
9796
|
-
visibleDeposits.length > 0 && /* @__PURE__ */ jsxs24("div", { className: "rs-history-list", children: [
|
|
9797
|
-
visibleDeposits.map((deposit, i) => /* @__PURE__ */ jsx29(HistoryCard, { deposit }, deposit.txHash || i)),
|
|
9798
|
-
hasMore && /* @__PURE__ */ jsx29(
|
|
9799
|
-
"button",
|
|
9800
|
-
{
|
|
9801
|
-
type: "button",
|
|
9802
|
-
className: "rs-history-load-more",
|
|
9803
|
-
onClick: onLoadMore,
|
|
9804
|
-
disabled: isLoadingMore,
|
|
9805
|
-
children: isLoadingMore ? "Loading\u2026" : "Load more"
|
|
9806
|
-
}
|
|
9807
|
-
)
|
|
9808
|
-
] })
|
|
9809
|
-
] }),
|
|
9810
|
-
/* @__PURE__ */ jsx29(PoweredBy, {})
|
|
9811
|
-
] })
|
|
9812
|
-
]
|
|
9813
|
-
}
|
|
9814
|
-
);
|
|
9815
|
-
}
|
|
9816
|
-
function HistoryCard({ deposit }) {
|
|
9817
|
-
const explorerTxUrl = useExplorerTxUrl();
|
|
9818
|
-
const [expanded, setExpanded] = useState14(false);
|
|
9819
|
-
const status = normalizeStatus(deposit.status, deposit.isSpam);
|
|
9820
|
-
const sourceChainId = resolveChainId(deposit.chain);
|
|
9821
|
-
const targetChainId = resolveChainId(deposit.targetChain);
|
|
9822
|
-
const sourceChainName = sourceChainId ? getChainName(sourceChainId) : null;
|
|
9823
|
-
const targetChainName = targetChainId ? getChainName(targetChainId) : null;
|
|
9824
|
-
const sourceChainIcon = sourceChainId ? getChainIcon(sourceChainId) : void 0;
|
|
9825
|
-
const targetChainIcon = targetChainId ? getChainIcon(targetChainId) : void 0;
|
|
9826
|
-
const sourceSymbol = resolveTokenSymbol(deposit.token, sourceChainId);
|
|
9827
|
-
const rawAmount = deposit.sourceAmount && deposit.sourceAmount !== "0" ? deposit.sourceAmount : deposit.amount;
|
|
9828
|
-
const formattedAmount = rawAmount ? formatAmount(rawAmount, deposit.token, sourceChainId) : null;
|
|
9829
|
-
const displayAmount = formattedAmount ? sourceSymbol && /^USD/.test(sourceSymbol) ? `$${Number(formattedAmount).toLocaleString("en-US", {
|
|
9830
|
-
minimumFractionDigits: 2,
|
|
9831
|
-
maximumFractionDigits: 2
|
|
9832
|
-
})}` : `${formattedAmount} ${sourceSymbol}` : "\u2014";
|
|
9833
|
-
const date = deposit.createdAt ? formatDate(deposit.createdAt) : null;
|
|
9834
|
-
const txTypeLabel = `Deposit${sourceSymbol ? ` ${sourceSymbol}` : ""}`;
|
|
9835
|
-
const srcTxHash = sourceChainId === "hypercore" ? deposit.txHash : deposit.sourceTxHash;
|
|
9836
|
-
const srcTxUrl = srcTxHash && sourceChainId ? explorerTxUrl(sourceChainId, srcTxHash) : null;
|
|
9837
|
-
return /* @__PURE__ */ jsxs24(
|
|
9838
|
-
"button",
|
|
9839
|
-
{
|
|
9840
|
-
type: "button",
|
|
9841
|
-
className: `rs-history-card ${expanded ? "rs-history-card--expanded" : ""}`,
|
|
9842
|
-
onClick: () => setExpanded((v) => !v),
|
|
9843
|
-
"aria-expanded": expanded,
|
|
9844
|
-
children: [
|
|
9845
|
-
/* @__PURE__ */ jsxs24("div", { className: "rs-history-card-row", children: [
|
|
9846
|
-
/* @__PURE__ */ jsxs24("div", { className: "rs-history-card-icons", children: [
|
|
9847
|
-
/* @__PURE__ */ jsx29("span", { className: "rs-history-card-token", children: /* @__PURE__ */ jsx29(TokenIcon, { symbol: sourceSymbol, fallback: sourceSymbol.slice(0, 2) }) }),
|
|
9848
|
-
sourceChainIcon && /* @__PURE__ */ jsx29("span", { className: "rs-history-card-chain", children: /* @__PURE__ */ jsx29(CdnIcon, { src: sourceChainIcon }) })
|
|
9849
|
-
] }),
|
|
9850
|
-
/* @__PURE__ */ jsxs24("div", { className: "rs-history-card-text", children: [
|
|
9851
|
-
/* @__PURE__ */ jsx29("span", { className: "rs-history-card-title", children: txTypeLabel }),
|
|
9852
|
-
date && /* @__PURE__ */ jsx29("span", { className: "rs-history-card-date", children: date })
|
|
9853
|
-
] }),
|
|
9854
|
-
/* @__PURE__ */ jsxs24("div", { className: "rs-history-card-side", children: [
|
|
9855
|
-
/* @__PURE__ */ jsx29("span", { className: "rs-history-card-amount", children: displayAmount }),
|
|
9856
|
-
/* @__PURE__ */ jsx29("span", { className: `rs-history-badge rs-history-badge--${status}`, children: STATUS_LABEL[status] })
|
|
9857
|
-
] })
|
|
9858
|
-
] }),
|
|
9859
|
-
/* @__PURE__ */ jsx29("div", { className: "rs-history-card-panel", children: /* @__PURE__ */ jsx29("div", { className: "rs-history-card-panel-inner", children: /* @__PURE__ */ jsxs24("div", { className: "rs-history-card-details", children: [
|
|
9860
|
-
sourceChainName && /* @__PURE__ */ jsxs24("div", { className: "rs-amount-detail-row", children: [
|
|
9861
|
-
/* @__PURE__ */ jsx29("span", { children: "Source chain" }),
|
|
9862
|
-
/* @__PURE__ */ jsxs24("span", { className: "rs-amount-detail-value", children: [
|
|
9863
|
-
/* @__PURE__ */ jsx29("span", { children: sourceChainName }),
|
|
9864
|
-
sourceChainIcon && /* @__PURE__ */ jsx29("span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ jsx29(CdnIcon, { src: sourceChainIcon }) })
|
|
9865
|
-
] })
|
|
9866
|
-
] }),
|
|
9867
|
-
targetChainName && /* @__PURE__ */ jsxs24("div", { className: "rs-amount-detail-row", children: [
|
|
9868
|
-
/* @__PURE__ */ jsx29("span", { children: "Destination chain" }),
|
|
9869
|
-
/* @__PURE__ */ jsxs24("span", { className: "rs-amount-detail-value", children: [
|
|
9870
|
-
/* @__PURE__ */ jsx29("span", { children: targetChainName }),
|
|
9871
|
-
targetChainIcon && /* @__PURE__ */ jsx29("span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ jsx29(CdnIcon, { src: targetChainIcon }) })
|
|
9872
|
-
] })
|
|
9873
|
-
] }),
|
|
9874
|
-
srcTxUrl && srcTxHash && /* @__PURE__ */ jsxs24("div", { className: "rs-amount-detail-row", children: [
|
|
9875
|
-
/* @__PURE__ */ jsx29("span", { children: "Transaction details" }),
|
|
9876
|
-
/* @__PURE__ */ jsxs24(
|
|
9877
|
-
"a",
|
|
9878
|
-
{
|
|
9879
|
-
href: srcTxUrl,
|
|
9880
|
-
target: "_blank",
|
|
9881
|
-
rel: "noopener noreferrer",
|
|
9882
|
-
className: "rs-history-card-link",
|
|
9883
|
-
onClick: (e) => e.stopPropagation(),
|
|
9884
|
-
children: [
|
|
9885
|
-
/* @__PURE__ */ jsx29("span", { children: shortenHash(srcTxHash) }),
|
|
9886
|
-
/* @__PURE__ */ jsx29(ArrowUpRightIcon, {})
|
|
9887
|
-
]
|
|
9888
|
-
}
|
|
9889
|
-
)
|
|
9890
|
-
] })
|
|
9891
|
-
] }) }) })
|
|
9892
|
-
]
|
|
9893
|
-
}
|
|
9894
|
-
);
|
|
9895
|
-
}
|
|
9896
|
-
DepositHistoryPanel.displayName = "DepositHistoryPanel";
|
|
9897
|
-
|
|
9898
9644
|
// src/DepositModal.tsx
|
|
9899
|
-
import { jsx as
|
|
9645
|
+
import { jsx as jsx29, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
9900
9646
|
var ReownDepositInner = lazy2(async () => {
|
|
9901
9647
|
await loadReownDependencies();
|
|
9902
|
-
const module = await import("./DepositModalReown-
|
|
9648
|
+
const module = await import("./DepositModalReown-KOJ7VEY7.mjs");
|
|
9903
9649
|
return { default: module.DepositModalReown };
|
|
9904
9650
|
});
|
|
9905
|
-
function sortByCreatedAtDesc(items) {
|
|
9906
|
-
return [...items].sort((a, b) => {
|
|
9907
|
-
const at = a.createdAt ? Date.parse(a.createdAt) : 0;
|
|
9908
|
-
const bt = b.createdAt ? Date.parse(b.createdAt) : 0;
|
|
9909
|
-
return bt - at;
|
|
9910
|
-
});
|
|
9911
|
-
}
|
|
9912
9651
|
function buildDepositAnalyticsSessionProperties({
|
|
9913
9652
|
enableWallet = true,
|
|
9914
9653
|
enableFiatOnramp = false,
|
|
@@ -9968,7 +9707,7 @@ function DepositModal(props) {
|
|
|
9968
9707
|
const needsReown = !!props.reownAppId;
|
|
9969
9708
|
const hasWalletClientProp = hasSuppliedWalletClient(props);
|
|
9970
9709
|
if (needsReown) {
|
|
9971
|
-
return /* @__PURE__ */
|
|
9710
|
+
return /* @__PURE__ */ jsx29(Suspense2, { fallback: null, children: /* @__PURE__ */ jsx29(
|
|
9972
9711
|
ReownDepositInner,
|
|
9973
9712
|
{
|
|
9974
9713
|
...props,
|
|
@@ -9976,7 +9715,7 @@ function DepositModal(props) {
|
|
|
9976
9715
|
}
|
|
9977
9716
|
) });
|
|
9978
9717
|
}
|
|
9979
|
-
return /* @__PURE__ */
|
|
9718
|
+
return /* @__PURE__ */ jsx29(
|
|
9980
9719
|
DepositModalInner,
|
|
9981
9720
|
{
|
|
9982
9721
|
...props,
|
|
@@ -10029,43 +9768,61 @@ function DepositModalInner({
|
|
|
10029
9768
|
onUiState,
|
|
10030
9769
|
openExternally,
|
|
10031
9770
|
walletIntegration: walletIntegrationProp,
|
|
9771
|
+
signRecovery,
|
|
10032
9772
|
debug
|
|
10033
9773
|
}) {
|
|
10034
|
-
const modalRef =
|
|
10035
|
-
const analyticsControllerRef =
|
|
10036
|
-
const
|
|
9774
|
+
const modalRef = useRef10(null);
|
|
9775
|
+
const analyticsControllerRef = useRef10(null);
|
|
9776
|
+
const analyticsSessionIdRef = useRef10(null);
|
|
9777
|
+
const previousOpenRef = useRef10(isOpen);
|
|
10037
9778
|
const onReadyRef = useLatestRef(onReady);
|
|
10038
9779
|
const onUiStateRef = useLatestRef(onUiState);
|
|
10039
|
-
const [currentScreen, setCurrentScreen] =
|
|
10040
|
-
const [swappedImmersive, setSwappedImmersive] =
|
|
10041
|
-
const [submitting, setSubmitting] =
|
|
10042
|
-
const [backHandler, setBackHandler] =
|
|
9780
|
+
const [currentScreen, setCurrentScreen] = useState14("connect");
|
|
9781
|
+
const [swappedImmersive, setSwappedImmersive] = useState14(false);
|
|
9782
|
+
const [submitting, setSubmitting] = useState14(false);
|
|
9783
|
+
const [backHandler, setBackHandler] = useState14(
|
|
10043
9784
|
void 0
|
|
10044
9785
|
);
|
|
10045
|
-
const
|
|
10046
|
-
const
|
|
10047
|
-
|
|
10048
|
-
|
|
10049
|
-
|
|
10050
|
-
|
|
10051
|
-
const
|
|
10052
|
-
const cursorRef = useRef9(null);
|
|
10053
|
-
const historyStaleRef = useRef9(false);
|
|
10054
|
-
const historyLoadedRef = useRef9(false);
|
|
10055
|
-
const targetChain = targetChainProp === "solana" || targetChainProp === HYPERCORE_SPOT_CAIP2 ? targetChainProp : getChainId(targetChainProp);
|
|
9786
|
+
const [processingSettled, setProcessingSettled] = useState14(false);
|
|
9787
|
+
const historyButtonVisible = isHistoryEntryVisible({
|
|
9788
|
+
screen: currentScreen,
|
|
9789
|
+
submitting,
|
|
9790
|
+
settled: processingSettled
|
|
9791
|
+
});
|
|
9792
|
+
const targetChain = typeof targetChainProp === "string" ? targetChainProp : getChainId(targetChainProp);
|
|
10056
9793
|
const sourceChain = sourceChainProp ? getChainId(sourceChainProp) : void 0;
|
|
10057
9794
|
const rpcUrls = useStableRpcUrls(rpcUrlsProp);
|
|
10058
|
-
const service =
|
|
9795
|
+
const service = useMemo9(
|
|
10059
9796
|
() => createDepositService(backendUrl, {
|
|
10060
9797
|
debug,
|
|
10061
9798
|
debugScope: "service:deposit"
|
|
10062
9799
|
}),
|
|
10063
9800
|
[backendUrl, debug]
|
|
10064
9801
|
);
|
|
10065
|
-
const
|
|
9802
|
+
const historyAnalytics = useMemo9(
|
|
9803
|
+
() => createHistoryAnalytics({
|
|
9804
|
+
modal: "deposit",
|
|
9805
|
+
controllerRef: analyticsControllerRef,
|
|
9806
|
+
sessionIdRef: analyticsSessionIdRef
|
|
9807
|
+
}),
|
|
9808
|
+
[]
|
|
9809
|
+
);
|
|
9810
|
+
const history = useHistoryPanel({
|
|
9811
|
+
isOpen,
|
|
9812
|
+
recipient,
|
|
9813
|
+
service,
|
|
9814
|
+
canRecover: Boolean(signRecovery),
|
|
9815
|
+
analytics: historyAnalytics
|
|
9816
|
+
});
|
|
9817
|
+
const {
|
|
9818
|
+
markStale: markHistoryStale,
|
|
9819
|
+
invalidate: invalidateHistory,
|
|
9820
|
+
recoverySubmitting
|
|
9821
|
+
} = history;
|
|
9822
|
+
const [clientSetup, setClientSetup] = useState14(
|
|
10066
9823
|
null
|
|
10067
9824
|
);
|
|
10068
|
-
|
|
9825
|
+
useEffect14(() => {
|
|
10069
9826
|
if (!isOpen) return;
|
|
10070
9827
|
let active = true;
|
|
10071
9828
|
service.getSetup().then((config) => {
|
|
@@ -10075,131 +9832,74 @@ function DepositModalInner({
|
|
|
10075
9832
|
active = false;
|
|
10076
9833
|
};
|
|
10077
9834
|
}, [isOpen, service]);
|
|
10078
|
-
|
|
9835
|
+
useEffect14(() => {
|
|
10079
9836
|
if (debug && clientSetup) {
|
|
10080
9837
|
console.debug("[deposit] client setup config (not shown yet)", clientSetup);
|
|
10081
9838
|
}
|
|
10082
9839
|
}, [debug, clientSetup]);
|
|
10083
|
-
const store =
|
|
9840
|
+
const store = useMemo9(
|
|
10084
9841
|
() => createDepositStore({ targetChain, targetToken }),
|
|
10085
9842
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
10086
9843
|
[]
|
|
10087
9844
|
);
|
|
10088
|
-
|
|
9845
|
+
useEffect14(() => {
|
|
10089
9846
|
store.dispatch({ type: "target/changed", targetChain, targetToken });
|
|
10090
9847
|
}, [store, targetChain, targetToken]);
|
|
10091
|
-
|
|
9848
|
+
useEffect14(() => {
|
|
10092
9849
|
if (!isOpen || !modalRef.current) return;
|
|
10093
9850
|
return applyTheme(modalRef.current, theme);
|
|
10094
9851
|
}, [isOpen, theme]);
|
|
10095
|
-
|
|
9852
|
+
useEffect14(() => {
|
|
10096
9853
|
if (isOpen) {
|
|
10097
9854
|
onReadyRef.current?.();
|
|
10098
9855
|
}
|
|
10099
9856
|
}, [isOpen, onReadyRef]);
|
|
10100
|
-
|
|
9857
|
+
useEffect14(() => {
|
|
10101
9858
|
onUiStateRef.current?.({
|
|
10102
9859
|
screen: currentScreen,
|
|
10103
9860
|
back: backHandler,
|
|
10104
|
-
|
|
9861
|
+
// A recovery in flight is a submission whose outcome is unknown, so a
|
|
9862
|
+
// native host's dismissal lock has to hold through it too.
|
|
9863
|
+
submitting: submitting || recoverySubmitting
|
|
10105
9864
|
});
|
|
10106
|
-
}, [
|
|
10107
|
-
|
|
9865
|
+
}, [
|
|
9866
|
+
currentScreen,
|
|
9867
|
+
backHandler,
|
|
9868
|
+
submitting,
|
|
9869
|
+
recoverySubmitting,
|
|
9870
|
+
onUiStateRef
|
|
9871
|
+
]);
|
|
9872
|
+
const handleStepChange = useCallback8(
|
|
10108
9873
|
(onBack, screen) => {
|
|
10109
9874
|
setBackHandler(() => onBack);
|
|
10110
9875
|
if (screen) setCurrentScreen(screen);
|
|
10111
9876
|
},
|
|
10112
9877
|
[]
|
|
10113
9878
|
);
|
|
10114
|
-
const fetchHistory = useCallback9(
|
|
10115
|
-
async (mode = "initial") => {
|
|
10116
|
-
if (!recipient) return;
|
|
10117
|
-
const isInitial = mode === "initial";
|
|
10118
|
-
if (isInitial) {
|
|
10119
|
-
setHistoryLoading(true);
|
|
10120
|
-
} else {
|
|
10121
|
-
setHistoryLoadingMore(true);
|
|
10122
|
-
}
|
|
10123
|
-
setHistoryError(null);
|
|
10124
|
-
try {
|
|
10125
|
-
const cursor = isInitial ? null : cursorRef.current;
|
|
10126
|
-
if (!isInitial && !cursor) {
|
|
10127
|
-
setHasMoreHistory(false);
|
|
10128
|
-
return;
|
|
10129
|
-
}
|
|
10130
|
-
const result = await service.fetchDepositHistory({
|
|
10131
|
-
recipient,
|
|
10132
|
-
limit: 20,
|
|
10133
|
-
cursor: cursor ?? void 0
|
|
10134
|
-
});
|
|
10135
|
-
const incoming = result.deposits;
|
|
10136
|
-
const nextCursor = result.nextCursor ?? null;
|
|
10137
|
-
if (isInitial) {
|
|
10138
|
-
setHistoryDeposits(sortByCreatedAtDesc(incoming));
|
|
10139
|
-
} else {
|
|
10140
|
-
setHistoryDeposits(
|
|
10141
|
-
(prev) => sortByCreatedAtDesc([...prev, ...incoming])
|
|
10142
|
-
);
|
|
10143
|
-
}
|
|
10144
|
-
cursorRef.current = nextCursor;
|
|
10145
|
-
setHasMoreHistory(Boolean(nextCursor));
|
|
10146
|
-
historyStaleRef.current = false;
|
|
10147
|
-
historyLoadedRef.current = true;
|
|
10148
|
-
} catch (err) {
|
|
10149
|
-
setHistoryError(
|
|
10150
|
-
err instanceof Error ? err.message : "Failed to load history"
|
|
10151
|
-
);
|
|
10152
|
-
} finally {
|
|
10153
|
-
if (isInitial) {
|
|
10154
|
-
setHistoryLoading(false);
|
|
10155
|
-
} else {
|
|
10156
|
-
setHistoryLoadingMore(false);
|
|
10157
|
-
}
|
|
10158
|
-
}
|
|
10159
|
-
},
|
|
10160
|
-
[recipient, service]
|
|
10161
|
-
);
|
|
10162
|
-
const handleHistoryOpen = useCallback9(() => {
|
|
10163
|
-
setHistoryOpen(true);
|
|
10164
|
-
if (!historyLoadedRef.current || historyStaleRef.current) {
|
|
10165
|
-
fetchHistory("initial");
|
|
10166
|
-
}
|
|
10167
|
-
}, [fetchHistory]);
|
|
10168
|
-
const handleHistoryClose = useCallback9(() => {
|
|
10169
|
-
setHistoryOpen(false);
|
|
10170
|
-
}, []);
|
|
10171
|
-
const handleHistoryLoadMore = useCallback9(() => {
|
|
10172
|
-
fetchHistory("more");
|
|
10173
|
-
}, [fetchHistory]);
|
|
10174
|
-
const markHistoryStale = useCallback9(() => {
|
|
10175
|
-
historyStaleRef.current = true;
|
|
10176
|
-
if (historyOpen) {
|
|
10177
|
-
fetchHistory("initial");
|
|
10178
|
-
}
|
|
10179
|
-
}, [historyOpen, fetchHistory]);
|
|
10180
9879
|
const onLifecycleRef = useLatestRef(onLifecycle);
|
|
10181
|
-
const handleLifecycle =
|
|
9880
|
+
const handleLifecycle = useCallback8(
|
|
10182
9881
|
(event) => {
|
|
10183
9882
|
onLifecycleRef.current?.(event);
|
|
10184
9883
|
if (event.type === "smart-account-changed" && !event.evm && !event.solana) {
|
|
10185
|
-
|
|
9884
|
+
invalidateHistory();
|
|
10186
9885
|
}
|
|
10187
9886
|
if (event.type === "submitted" || event.type === "complete" || event.type === "failed") {
|
|
10188
9887
|
markHistoryStale();
|
|
10189
9888
|
}
|
|
10190
9889
|
},
|
|
10191
|
-
[onLifecycleRef, markHistoryStale]
|
|
9890
|
+
[onLifecycleRef, markHistoryStale, invalidateHistory]
|
|
10192
9891
|
);
|
|
10193
|
-
const closeWithSource =
|
|
9892
|
+
const closeWithSource = useCallback8(
|
|
10194
9893
|
(source) => {
|
|
9894
|
+
if (recoverySubmitting) return;
|
|
10195
9895
|
const analytics = analyticsControllerRef.current;
|
|
10196
9896
|
analytics?.abandon(source === "provider_back" ? "provider_back" : "modal_close");
|
|
10197
9897
|
analytics?.close(source);
|
|
10198
9898
|
onClose();
|
|
10199
9899
|
},
|
|
10200
|
-
[onClose]
|
|
9900
|
+
[onClose, recoverySubmitting]
|
|
10201
9901
|
);
|
|
10202
|
-
const handleModalDismiss =
|
|
9902
|
+
const handleModalDismiss = useCallback8(
|
|
10203
9903
|
(reason) => {
|
|
10204
9904
|
closeWithSource(
|
|
10205
9905
|
reason === "escape" ? "escape" : reason === "overlay" ? "overlay" : "header_button"
|
|
@@ -10207,7 +9907,7 @@ function DepositModalInner({
|
|
|
10207
9907
|
},
|
|
10208
9908
|
[closeWithSource]
|
|
10209
9909
|
);
|
|
10210
|
-
|
|
9910
|
+
useEffect14(() => {
|
|
10211
9911
|
if (previousOpenRef.current && !isOpen) {
|
|
10212
9912
|
const analytics = analyticsControllerRef.current;
|
|
10213
9913
|
analytics?.abandon("modal_close");
|
|
@@ -10215,22 +9915,16 @@ function DepositModalInner({
|
|
|
10215
9915
|
}
|
|
10216
9916
|
previousOpenRef.current = isOpen;
|
|
10217
9917
|
}, [isOpen]);
|
|
10218
|
-
|
|
9918
|
+
useEffect14(() => {
|
|
10219
9919
|
if (!isOpen) {
|
|
10220
|
-
setHistoryOpen(false);
|
|
10221
|
-
setHistoryDeposits([]);
|
|
10222
|
-
setHasMoreHistory(false);
|
|
10223
|
-
setHistoryError(null);
|
|
10224
|
-
cursorRef.current = null;
|
|
10225
|
-
historyStaleRef.current = false;
|
|
10226
|
-
historyLoadedRef.current = false;
|
|
10227
9920
|
setCurrentScreen("connect");
|
|
10228
9921
|
setBackHandler(void 0);
|
|
10229
9922
|
setSwappedImmersive(false);
|
|
10230
9923
|
setSubmitting(false);
|
|
9924
|
+
setProcessingSettled(false);
|
|
10231
9925
|
}
|
|
10232
9926
|
}, [isOpen]);
|
|
10233
|
-
|
|
9927
|
+
useEffect14(() => {
|
|
10234
9928
|
if (!isOpen) {
|
|
10235
9929
|
store.dispatch({ type: "flow/reset" });
|
|
10236
9930
|
}
|
|
@@ -10258,7 +9952,7 @@ function DepositModalInner({
|
|
|
10258
9952
|
const canGoBack = backHandler !== void 0;
|
|
10259
9953
|
const hideHeaderChrome = swappedImmersive;
|
|
10260
9954
|
const modalClassName = `rs-modal${hideHeaderChrome ? " rs-modal--swapped-iframe" : ""}`;
|
|
10261
|
-
return /* @__PURE__ */
|
|
9955
|
+
return /* @__PURE__ */ jsx29(RpcUrlsProvider, { value: rpcUrls, children: /* @__PURE__ */ jsx29(ChainCatalogProvider, { service, rpcUrls, children: /* @__PURE__ */ jsx29(DepositStoreProvider, { store, children: /* @__PURE__ */ jsx29(
|
|
10262
9956
|
Modal,
|
|
10263
9957
|
{
|
|
10264
9958
|
isOpen,
|
|
@@ -10266,7 +9960,8 @@ function DepositModalInner({
|
|
|
10266
9960
|
className,
|
|
10267
9961
|
inline,
|
|
10268
9962
|
closeOnOverlayClick,
|
|
10269
|
-
|
|
9963
|
+
ariaLabel: "Deposit",
|
|
9964
|
+
children: /* @__PURE__ */ jsx29(
|
|
10270
9965
|
AnalyticsSession,
|
|
10271
9966
|
{
|
|
10272
9967
|
modal: "deposit",
|
|
@@ -10275,47 +9970,45 @@ function DepositModalInner({
|
|
|
10275
9970
|
backendUrl,
|
|
10276
9971
|
enableIngest: enableAnalyticsIngest,
|
|
10277
9972
|
ingestUrl: analyticsIngestUrl,
|
|
10278
|
-
|
|
9973
|
+
sessionIdRef: analyticsSessionIdRef,
|
|
9974
|
+
children: /* @__PURE__ */ jsx29(
|
|
10279
9975
|
DepositAnalyticsControllerProvider,
|
|
10280
9976
|
{
|
|
10281
9977
|
controllerRef: analyticsControllerRef,
|
|
10282
|
-
children: /* @__PURE__ */
|
|
10283
|
-
!hideHeaderChrome && /* @__PURE__ */
|
|
10284
|
-
/* @__PURE__ */
|
|
9978
|
+
children: /* @__PURE__ */ jsxs24("div", { ref: modalRef, className: modalClassName, children: [
|
|
9979
|
+
!hideHeaderChrome && /* @__PURE__ */ jsxs24("div", { className: "rs-modal-header--redesigned", children: [
|
|
9980
|
+
/* @__PURE__ */ jsx29("div", { className: "rs-modal-header-nav-left", children: showBackButton && canGoBack && backHandler && /* @__PURE__ */ jsx29(
|
|
10285
9981
|
"button",
|
|
10286
9982
|
{
|
|
10287
9983
|
type: "button",
|
|
10288
9984
|
className: "rs-modal-header-back",
|
|
10289
9985
|
"aria-label": "Go back",
|
|
10290
9986
|
onClick: backHandler,
|
|
10291
|
-
children: /* @__PURE__ */
|
|
9987
|
+
children: /* @__PURE__ */ jsx29(ChevronLeftIcon, {})
|
|
10292
9988
|
}
|
|
10293
9989
|
) }),
|
|
10294
|
-
/* @__PURE__ */
|
|
10295
|
-
historyButtonVisible && /* @__PURE__ */
|
|
10296
|
-
|
|
9990
|
+
/* @__PURE__ */ jsxs24("div", { className: "rs-modal-header-nav-right", children: [
|
|
9991
|
+
historyButtonVisible && /* @__PURE__ */ jsx29(
|
|
9992
|
+
HistoryEntryButton,
|
|
10297
9993
|
{
|
|
10298
|
-
|
|
10299
|
-
|
|
10300
|
-
|
|
10301
|
-
onClick: handleHistoryOpen,
|
|
10302
|
-
disabled: !recipient,
|
|
10303
|
-
children: /* @__PURE__ */ jsx30(HistoryIcon, {})
|
|
9994
|
+
badge: history.badge,
|
|
9995
|
+
onClick: history.openPanel,
|
|
9996
|
+
disabled: !recipient
|
|
10304
9997
|
}
|
|
10305
9998
|
),
|
|
10306
|
-
/* @__PURE__ */
|
|
9999
|
+
/* @__PURE__ */ jsx29(
|
|
10307
10000
|
"button",
|
|
10308
10001
|
{
|
|
10309
10002
|
type: "button",
|
|
10310
10003
|
onClick: () => closeWithSource("header_button"),
|
|
10311
10004
|
className: "rs-modal-close",
|
|
10312
10005
|
"aria-label": "Close",
|
|
10313
|
-
children: /* @__PURE__ */
|
|
10006
|
+
children: /* @__PURE__ */ jsx29(CloseIcon, {})
|
|
10314
10007
|
}
|
|
10315
10008
|
)
|
|
10316
10009
|
] })
|
|
10317
10010
|
] }),
|
|
10318
|
-
/* @__PURE__ */
|
|
10011
|
+
/* @__PURE__ */ jsx29(
|
|
10319
10012
|
DepositFlow,
|
|
10320
10013
|
{
|
|
10321
10014
|
walletClientProp,
|
|
@@ -10352,23 +10045,30 @@ function DepositModalInner({
|
|
|
10352
10045
|
onSwappedImmersiveChange: setSwappedImmersive,
|
|
10353
10046
|
openExternally,
|
|
10354
10047
|
onSubmittingChange: setSubmitting,
|
|
10048
|
+
onProcessingSettledChange: setProcessingSettled,
|
|
10355
10049
|
onClose: (source) => closeWithSource(source ?? "header_button"),
|
|
10356
10050
|
onLifecycle: handleLifecycle,
|
|
10357
10051
|
onError,
|
|
10358
10052
|
debug
|
|
10359
10053
|
}
|
|
10360
10054
|
),
|
|
10361
|
-
|
|
10362
|
-
|
|
10055
|
+
history.isPanelOpen && /* @__PURE__ */ jsx29(
|
|
10056
|
+
HistoryOverlay,
|
|
10363
10057
|
{
|
|
10364
|
-
|
|
10365
|
-
|
|
10366
|
-
|
|
10367
|
-
|
|
10368
|
-
|
|
10369
|
-
|
|
10370
|
-
|
|
10371
|
-
onCloseModal: () => closeWithSource("header_button")
|
|
10058
|
+
controller: history,
|
|
10059
|
+
backLabel: "Deposit",
|
|
10060
|
+
recipient,
|
|
10061
|
+
backendUrl,
|
|
10062
|
+
service,
|
|
10063
|
+
signRecovery,
|
|
10064
|
+
debug,
|
|
10065
|
+
onCloseModal: () => closeWithSource("header_button"),
|
|
10066
|
+
analytics: historyAnalytics,
|
|
10067
|
+
inline,
|
|
10068
|
+
closeOnOverlayClick,
|
|
10069
|
+
enableAnalyticsIngest,
|
|
10070
|
+
analyticsIngestUrl,
|
|
10071
|
+
onEvent
|
|
10372
10072
|
}
|
|
10373
10073
|
)
|
|
10374
10074
|
] })
|