@embarkai/ui-kit 0.4.108 → 0.4.110
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/iframe/index.html +1 -1
- package/dist/iframe/main.js +1 -1
- package/dist/index.cjs +539 -510
- package/dist/index.js +176 -147
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6031,6 +6031,32 @@ var init_ChainSync2 = __esm({
|
|
|
6031
6031
|
}
|
|
6032
6032
|
});
|
|
6033
6033
|
|
|
6034
|
+
// src/internal/hooks/useAllowExternalModalsScroll.ts
|
|
6035
|
+
import { useEffect as useEffect4 } from "react";
|
|
6036
|
+
function isFromExternalModal(event) {
|
|
6037
|
+
return event.composedPath().some((node) => node instanceof Element && EXTERNAL_MODAL_TAGS.has(node.tagName));
|
|
6038
|
+
}
|
|
6039
|
+
function stopExternalModalScrollEvent(event) {
|
|
6040
|
+
if (isFromExternalModal(event)) event.stopPropagation();
|
|
6041
|
+
}
|
|
6042
|
+
function useAllowExternalModalsScroll(enabled) {
|
|
6043
|
+
useEffect4(() => {
|
|
6044
|
+
if (!enabled || typeof document === "undefined") return;
|
|
6045
|
+
const body = document.body;
|
|
6046
|
+
SCROLL_EVENTS.forEach((type) => body.addEventListener(type, stopExternalModalScrollEvent, { passive: true }));
|
|
6047
|
+
return () => {
|
|
6048
|
+
SCROLL_EVENTS.forEach((type) => body.removeEventListener(type, stopExternalModalScrollEvent));
|
|
6049
|
+
};
|
|
6050
|
+
}, [enabled]);
|
|
6051
|
+
}
|
|
6052
|
+
var EXTERNAL_MODAL_TAGS, SCROLL_EVENTS;
|
|
6053
|
+
var init_useAllowExternalModalsScroll = __esm({
|
|
6054
|
+
"src/internal/hooks/useAllowExternalModalsScroll.ts"() {
|
|
6055
|
+
EXTERNAL_MODAL_TAGS = /* @__PURE__ */ new Set(["W3M-MODAL", "APPKIT-MODAL", "WCM-MODAL"]);
|
|
6056
|
+
SCROLL_EVENTS = ["wheel", "touchmove"];
|
|
6057
|
+
}
|
|
6058
|
+
});
|
|
6059
|
+
|
|
6034
6060
|
// src/internal/clients/account/register-smart-account-address.ts
|
|
6035
6061
|
async function registerSmartAccountAddress(chainId, smartAccountAddress, factoryAddress) {
|
|
6036
6062
|
const accessToken = jwtTokenManager2.getAccessToken();
|
|
@@ -6959,7 +6985,7 @@ var init_clients = __esm({
|
|
|
6959
6985
|
});
|
|
6960
6986
|
|
|
6961
6987
|
// src/internal/hooks/useAutoConnect.ts
|
|
6962
|
-
import { useCallback as useCallback3, useEffect as
|
|
6988
|
+
import { useCallback as useCallback3, useEffect as useEffect5, useRef as useRef2 } from "react";
|
|
6963
6989
|
function useAutoConnect() {
|
|
6964
6990
|
const {
|
|
6965
6991
|
config: { current: config },
|
|
@@ -7021,7 +7047,7 @@ function useAutoConnect() {
|
|
|
7021
7047
|
[usePaymaster, setStatus, activeChainId]
|
|
7022
7048
|
);
|
|
7023
7049
|
const autoConnectAttemptedRef = useRef2(false);
|
|
7024
|
-
|
|
7050
|
+
useEffect5(() => {
|
|
7025
7051
|
if (!hasHydrated) return;
|
|
7026
7052
|
if (autoConnectAttemptedRef.current) return;
|
|
7027
7053
|
setIsLoading(true);
|
|
@@ -7160,7 +7186,7 @@ var init_useAutoConnect = __esm({
|
|
|
7160
7186
|
});
|
|
7161
7187
|
|
|
7162
7188
|
// src/hooks/useOpenPage.ts
|
|
7163
|
-
import { useCallback as useCallback4, useEffect as
|
|
7189
|
+
import { useCallback as useCallback4, useEffect as useEffect6, useRef as useRef3 } from "react";
|
|
7164
7190
|
function useOpenPage() {
|
|
7165
7191
|
const page = useLayoutDataStore((st) => st.page);
|
|
7166
7192
|
const setPage = useLayoutDataStore((st) => st.setPage);
|
|
@@ -7190,7 +7216,7 @@ function useOpenPage() {
|
|
|
7190
7216
|
}
|
|
7191
7217
|
function usePageParams() {
|
|
7192
7218
|
const currentParams = useRef3({});
|
|
7193
|
-
|
|
7219
|
+
useEffect6(() => {
|
|
7194
7220
|
const { pageParams, setPageParams } = useLayoutDataStore.getState();
|
|
7195
7221
|
if (!pageParams) return;
|
|
7196
7222
|
currentParams.current = pageParams;
|
|
@@ -7206,13 +7232,13 @@ var init_useOpenPage = __esm({
|
|
|
7206
7232
|
});
|
|
7207
7233
|
|
|
7208
7234
|
// src/internal/hooks/useBackupStatusChanges.ts
|
|
7209
|
-
import { useEffect as
|
|
7235
|
+
import { useEffect as useEffect7, useRef as useRef4 } from "react";
|
|
7210
7236
|
function useBackupStatusChanges() {
|
|
7211
7237
|
const { open: openPage } = useOpenPage();
|
|
7212
7238
|
const requestSeqRef = useRef4(0);
|
|
7213
7239
|
const openPageRef = useRef4(openPage);
|
|
7214
7240
|
openPageRef.current = openPage;
|
|
7215
|
-
|
|
7241
|
+
useEffect7(() => {
|
|
7216
7242
|
async function handleBackupStatusChanged(event) {
|
|
7217
7243
|
const detail = event?.detail;
|
|
7218
7244
|
console.log("[BACKUP STATUS] changed:", detail);
|
|
@@ -7254,7 +7280,7 @@ var init_useBackupStatusChanges = __esm({
|
|
|
7254
7280
|
|
|
7255
7281
|
// src/internal/hooks/useDetectMaxScrollHeight.ts
|
|
7256
7282
|
import { debounce } from "lodash-es";
|
|
7257
|
-
import { useCallback as useCallback5, useEffect as
|
|
7283
|
+
import { useCallback as useCallback5, useEffect as useEffect8 } from "react";
|
|
7258
7284
|
function useDetectMaxScrollHeight() {
|
|
7259
7285
|
const page = useLayoutDataStore((state) => state.page);
|
|
7260
7286
|
const setIsMobileView = useLayoutStore((state) => state.setIsMobileView);
|
|
@@ -7268,7 +7294,7 @@ function useDetectMaxScrollHeight() {
|
|
|
7268
7294
|
}, DEBOUNCE_DELAY),
|
|
7269
7295
|
[page, setMaxScrollHeight, setIsMobileView]
|
|
7270
7296
|
);
|
|
7271
|
-
|
|
7297
|
+
useEffect8(() => {
|
|
7272
7298
|
const obs = new ResizeObserver(([entry]) => onResize(entry.contentRect));
|
|
7273
7299
|
const doc = window.document.getElementsByTagName("html")[0];
|
|
7274
7300
|
if (doc) obs.observe(doc);
|
|
@@ -7286,7 +7312,7 @@ var init_useDetectMaxScrollHeight = __esm({
|
|
|
7286
7312
|
});
|
|
7287
7313
|
|
|
7288
7314
|
// src/internal/hooks/useListenIframeAuthEvents.ts
|
|
7289
|
-
import { useCallback as useCallback6, useEffect as
|
|
7315
|
+
import { useCallback as useCallback6, useEffect as useEffect9 } from "react";
|
|
7290
7316
|
function useListenIframeAuthEvents() {
|
|
7291
7317
|
const setPage = useLayoutDataStore((state) => state.setPage);
|
|
7292
7318
|
const setIsIframeReady = useSession((state) => state.setIsIframeReady);
|
|
@@ -7306,7 +7332,7 @@ function useListenIframeAuthEvents() {
|
|
|
7306
7332
|
},
|
|
7307
7333
|
[setPage, setIsIframeReady]
|
|
7308
7334
|
);
|
|
7309
|
-
|
|
7335
|
+
useEffect9(() => {
|
|
7310
7336
|
window.addEventListener("message", handleIframeMessage);
|
|
7311
7337
|
return () => window.removeEventListener("message", handleIframeMessage);
|
|
7312
7338
|
}, [handleIframeMessage]);
|
|
@@ -7319,7 +7345,7 @@ var init_useListenIframeAuthEvents = __esm({
|
|
|
7319
7345
|
});
|
|
7320
7346
|
|
|
7321
7347
|
// src/internal/components/Expandable/hooks/useExpandable.ts
|
|
7322
|
-
import { useCallback as useCallback7, useEffect as
|
|
7348
|
+
import { useCallback as useCallback7, useEffect as useEffect10, useRef as useRef5 } from "react";
|
|
7323
7349
|
var DEFERRED_DELAY, useExpandable;
|
|
7324
7350
|
var init_useExpandable = __esm({
|
|
7325
7351
|
"src/internal/components/Expandable/hooks/useExpandable.ts"() {
|
|
@@ -7328,7 +7354,7 @@ var init_useExpandable = __esm({
|
|
|
7328
7354
|
const { isExpanded = false, initHeight = 0, minHeight = 0 } = props;
|
|
7329
7355
|
const expandableRef = useRef5(null);
|
|
7330
7356
|
const contentRef = useRef5(null);
|
|
7331
|
-
|
|
7357
|
+
useEffect10(() => {
|
|
7332
7358
|
if (!expandableRef.current) return;
|
|
7333
7359
|
expandableRef.current.style.setProperty("--ui-kit-expandable-h", `${initHeight}px )`);
|
|
7334
7360
|
}, []);
|
|
@@ -7344,7 +7370,7 @@ var init_useExpandable = __esm({
|
|
|
7344
7370
|
expandableHeightTimerRef.current = null;
|
|
7345
7371
|
}, DEFERRED_DELAY);
|
|
7346
7372
|
}, []);
|
|
7347
|
-
|
|
7373
|
+
useEffect10(() => {
|
|
7348
7374
|
if (!contentRef.current || !expandableRef.current) return;
|
|
7349
7375
|
const resizeObs = new ResizeObserver(() => setExpandableHeight(minHeight, isExpanded));
|
|
7350
7376
|
const domMutationObs = new MutationObserver(() => setExpandableHeight(minHeight, isExpanded));
|
|
@@ -9610,9 +9636,9 @@ var init_useActivityLog = __esm({
|
|
|
9610
9636
|
|
|
9611
9637
|
// src/internal/components/ActivityLogMenu/useActivityLogMenuParams.ts
|
|
9612
9638
|
import { keys } from "lodash-es";
|
|
9613
|
-
import { useEffect as
|
|
9639
|
+
import { useEffect as useEffect11 } from "react";
|
|
9614
9640
|
function useActivityLogMenuParams() {
|
|
9615
|
-
|
|
9641
|
+
useEffect11(() => {
|
|
9616
9642
|
const { pageParams, setPageParams } = useLayoutDataStore.getState();
|
|
9617
9643
|
if (!pageParams || !keys(pageParams).length) return;
|
|
9618
9644
|
setTimeout(() => useActivityLogFilters.setState(pageParams), 0);
|
|
@@ -10184,7 +10210,7 @@ var init_emailChallenge = __esm({
|
|
|
10184
10210
|
// src/internal/components/AuthMenu/SignInStep/Email.tsx
|
|
10185
10211
|
import { useMutation as useMutation2 } from "@tanstack/react-query";
|
|
10186
10212
|
import { ChevronRight, Loader as Loader2, Mail as Mail2 } from "lucide-react";
|
|
10187
|
-
import { useEffect as
|
|
10213
|
+
import { useEffect as useEffect12, useRef as useRef7 } from "react";
|
|
10188
10214
|
import { jsx as jsx20, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
10189
10215
|
function Email() {
|
|
10190
10216
|
const { callbacksRef } = useProviderConfig();
|
|
@@ -10255,7 +10281,7 @@ function Email() {
|
|
|
10255
10281
|
}
|
|
10256
10282
|
onSendVerificationCode(email);
|
|
10257
10283
|
};
|
|
10258
|
-
|
|
10284
|
+
useEffect12(() => {
|
|
10259
10285
|
if (!focusRef.current || !isMobileView) return;
|
|
10260
10286
|
focusRef.current?.focus();
|
|
10261
10287
|
setTimeout(() => {
|
|
@@ -11178,7 +11204,7 @@ var init_useAuthMenuHanders = __esm({
|
|
|
11178
11204
|
});
|
|
11179
11205
|
|
|
11180
11206
|
// src/internal/components/AuthMenu/VerifyStep/VerificationCodeInput.tsx
|
|
11181
|
-
import { useEffect as
|
|
11207
|
+
import { useEffect as useEffect13, useRef as useRef9, useState as useState4 } from "react";
|
|
11182
11208
|
import { Fragment as Fragment8, jsx as jsx24, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
11183
11209
|
var getRemainingSeconds, VerificationCodeInput;
|
|
11184
11210
|
var init_VerificationCodeInput = __esm({
|
|
@@ -11193,7 +11219,7 @@ var init_VerificationCodeInput = __esm({
|
|
|
11193
11219
|
const { t } = useT();
|
|
11194
11220
|
const setAlert = useAuthStore((st) => st.setAlert);
|
|
11195
11221
|
const [timeLeft, setTimeLeft] = useState4(() => getRemainingSeconds(expiresAt));
|
|
11196
|
-
|
|
11222
|
+
useEffect13(() => {
|
|
11197
11223
|
let intervalId;
|
|
11198
11224
|
const syncTimeLeft = () => {
|
|
11199
11225
|
const remaining = getRemainingSeconds(expiresAt);
|
|
@@ -11217,7 +11243,7 @@ var init_VerificationCodeInput = __esm({
|
|
|
11217
11243
|
const lastSubmittedRef = useRef9(null);
|
|
11218
11244
|
const inputsRef = useRef9([]);
|
|
11219
11245
|
const [digits, setDigits] = useState4(["", "", "", "", "", ""]);
|
|
11220
|
-
|
|
11246
|
+
useEffect13(() => {
|
|
11221
11247
|
const code = digits.join("");
|
|
11222
11248
|
if (code.length === 6 && digits.every((d) => d !== "") && !isLoading) {
|
|
11223
11249
|
if (lastSubmittedRef.current !== code) {
|
|
@@ -11226,7 +11252,7 @@ var init_VerificationCodeInput = __esm({
|
|
|
11226
11252
|
}
|
|
11227
11253
|
}
|
|
11228
11254
|
}, [digits, isLoading, onVerifyCode]);
|
|
11229
|
-
|
|
11255
|
+
useEffect13(() => {
|
|
11230
11256
|
const t2 = setTimeout(() => {
|
|
11231
11257
|
inputsRef.current[0]?.focus();
|
|
11232
11258
|
}, 0);
|
|
@@ -11531,7 +11557,7 @@ var init_VerifyStep2 = __esm({
|
|
|
11531
11557
|
|
|
11532
11558
|
// src/internal/components/AuthMenu/AuthMenu.tsx
|
|
11533
11559
|
import { Loader as Loader4 } from "lucide-react";
|
|
11534
|
-
import { useEffect as
|
|
11560
|
+
import { useEffect as useEffect14, useMemo as useMemo2 } from "react";
|
|
11535
11561
|
import { jsx as jsx26, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
11536
11562
|
var AuthMenu;
|
|
11537
11563
|
var init_AuthMenu = __esm({
|
|
@@ -11558,7 +11584,7 @@ var init_AuthMenu = __esm({
|
|
|
11558
11584
|
const step = useAuthStore((st) => st.step);
|
|
11559
11585
|
const alert2 = useAuthStore((st) => st.alert);
|
|
11560
11586
|
const { pendingLoginResponseRef, onAuthSuccess, goBackToSignIn } = useAuthMenuHandlers();
|
|
11561
|
-
|
|
11587
|
+
useEffect14(() => {
|
|
11562
11588
|
if (!pendingWalletLogin) return;
|
|
11563
11589
|
const loginResponse = pendingWalletLogin;
|
|
11564
11590
|
useLayoutDataStore.getState().setPendingWalletLogin(null);
|
|
@@ -11568,7 +11594,7 @@ var init_AuthMenu = __esm({
|
|
|
11568
11594
|
onAuthSuccess();
|
|
11569
11595
|
});
|
|
11570
11596
|
}, [pendingWalletLogin]);
|
|
11571
|
-
|
|
11597
|
+
useEffect14(() => {
|
|
11572
11598
|
useLayoutDataStore.getState().setTransitionPageHeight(DEFAULT_AUTH_MENU_HEIGHT);
|
|
11573
11599
|
return () => {
|
|
11574
11600
|
const { setStep, setPasskeyStatus, setEmail, setEmailChallenge, setAlert } = useAuthStore.getState();
|
|
@@ -11760,7 +11786,7 @@ var init_onboarder = __esm({
|
|
|
11760
11786
|
|
|
11761
11787
|
// src/internal/components/Onboarding/OnboardingOverlay.tsx
|
|
11762
11788
|
import { ChevronRightIcon, LoaderIcon as LoaderIcon2, XIcon } from "lucide-react";
|
|
11763
|
-
import { useEffect as
|
|
11789
|
+
import { useEffect as useEffect15, useMemo as useMemo3, useState as useState6 } from "react";
|
|
11764
11790
|
import { createPortal as createPortal2 } from "react-dom";
|
|
11765
11791
|
import { jsx as jsx27, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
11766
11792
|
function getTooltipXPos(params) {
|
|
@@ -11786,7 +11812,7 @@ function getTooltipYPos(params) {
|
|
|
11786
11812
|
function OnboardingOverlay() {
|
|
11787
11813
|
const { t } = useT();
|
|
11788
11814
|
const page = useLayoutDataStore((st) => st.page);
|
|
11789
|
-
|
|
11815
|
+
useEffect15(() => {
|
|
11790
11816
|
setTimeout(() => {
|
|
11791
11817
|
if (!page) {
|
|
11792
11818
|
useOnboardingStore.getState().setMountIntoNode(document.body);
|
|
@@ -11822,7 +11848,7 @@ function OnboardingOverlay() {
|
|
|
11822
11848
|
};
|
|
11823
11849
|
return { ...getTooltipXPos(posParams), ...getTooltipYPos(posParams) };
|
|
11824
11850
|
}, [elRect, isMobileView]);
|
|
11825
|
-
|
|
11851
|
+
useEffect15(() => {
|
|
11826
11852
|
if (!waitSecs) return;
|
|
11827
11853
|
setContinueCountdown(waitSecs);
|
|
11828
11854
|
const countdownInterval = setInterval(() => {
|
|
@@ -11981,9 +12007,9 @@ var init_OnboardingOverlay = __esm({
|
|
|
11981
12007
|
});
|
|
11982
12008
|
|
|
11983
12009
|
// src/internal/components/Onboarding/useOnboardingTouirAvailable.ts
|
|
11984
|
-
import { useEffect as
|
|
12010
|
+
import { useEffect as useEffect16 } from "react";
|
|
11985
12011
|
function useOnboardingTourAvailable(isAvailable) {
|
|
11986
|
-
|
|
12012
|
+
useEffect16(() => {
|
|
11987
12013
|
useOnboardingStore.getState().setIsTourAvailable(isAvailable);
|
|
11988
12014
|
return () => useOnboardingStore.getState().setIsTourAvailable(false);
|
|
11989
12015
|
}, [isAvailable]);
|
|
@@ -12553,11 +12579,11 @@ var init_priceFormatter = __esm({
|
|
|
12553
12579
|
|
|
12554
12580
|
// src/internal/components/BuyMenu/useBuyMenuStore.ts
|
|
12555
12581
|
import { keys as keys2, noop } from "lodash-es";
|
|
12556
|
-
import { useEffect as
|
|
12582
|
+
import { useEffect as useEffect17 } from "react";
|
|
12557
12583
|
import { create as create7 } from "zustand";
|
|
12558
12584
|
import { persist as persist2 } from "zustand/middleware";
|
|
12559
12585
|
function useBuyMenuParams() {
|
|
12560
|
-
|
|
12586
|
+
useEffect17(() => {
|
|
12561
12587
|
const { pageParams, setPageParams } = useLayoutDataStore.getState();
|
|
12562
12588
|
if (!pageParams || !keys2(pageParams).length) return;
|
|
12563
12589
|
const { amount, crypto: crypto2, onRampWidgetRedirected } = pageParams || {};
|
|
@@ -13732,11 +13758,11 @@ var init_BinanceTxHistory = __esm({
|
|
|
13732
13758
|
|
|
13733
13759
|
// src/internal/components/BuyMenu/binance/useBinanceSseTracing.ts
|
|
13734
13760
|
import { useQueryClient as useQueryClient4 } from "@tanstack/react-query";
|
|
13735
|
-
import { useEffect as
|
|
13761
|
+
import { useEffect as useEffect19, useRef as useRef10 } from "react";
|
|
13736
13762
|
function useBinanceSseTxTracing(walletAddress) {
|
|
13737
13763
|
const qc = useQueryClient4();
|
|
13738
13764
|
const debounceRef = useRef10(null);
|
|
13739
|
-
|
|
13765
|
+
useEffect19(() => {
|
|
13740
13766
|
if (!walletAddress) return;
|
|
13741
13767
|
const iframeManager = getIframeManager();
|
|
13742
13768
|
if (!iframeManager) return;
|
|
@@ -13778,7 +13804,7 @@ var init_utils7 = __esm({
|
|
|
13778
13804
|
// src/internal/components/BuyMenu/binance/Binance.tsx
|
|
13779
13805
|
import { useMutation as useMutation5, useQuery as useQuery4, useQueryClient as useQueryClient5 } from "@tanstack/react-query";
|
|
13780
13806
|
import { LoaderIcon as LoaderIcon5 } from "lucide-react";
|
|
13781
|
-
import { useEffect as
|
|
13807
|
+
import { useEffect as useEffect20 } from "react";
|
|
13782
13808
|
import { Fragment as Fragment13, jsx as jsx47, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
13783
13809
|
function Binance() {
|
|
13784
13810
|
const qc = useQueryClient5();
|
|
@@ -13831,7 +13857,7 @@ function Binance() {
|
|
|
13831
13857
|
});
|
|
13832
13858
|
const paymentModes = paymentModesData?.data?.paymentMethods || [];
|
|
13833
13859
|
const selectedPaymentMode = paymentModes?.find((el) => getPayMethodID(el) === paymentMode) || null;
|
|
13834
|
-
|
|
13860
|
+
useEffect20(() => {
|
|
13835
13861
|
useBuyMenuStore.getState().setMinAmount(Number(selectedPaymentMode?.fiatMinLimit || "0"));
|
|
13836
13862
|
}, [selectedPaymentMode]);
|
|
13837
13863
|
const { mutate: estimateQuote, isPending: isQuoteEstimating } = useMutation5({
|
|
@@ -13859,22 +13885,22 @@ function Binance() {
|
|
|
13859
13885
|
}
|
|
13860
13886
|
});
|
|
13861
13887
|
const availableFiats = (tradingPairsData?.data?.fiatCurrencies || []).map((ticker) => ({ ticker }));
|
|
13862
|
-
|
|
13888
|
+
useEffect20(() => {
|
|
13863
13889
|
if (!!selectedFiat || !availableFiats?.length) return;
|
|
13864
13890
|
const targetFiat = availableFiats.find((item) => PREFERRED_FIATS.includes(item.ticker)) || availableFiats[0];
|
|
13865
13891
|
useBuyMenuStore.getState().setSelectedFiat(targetFiat.ticker);
|
|
13866
13892
|
}, [availableFiats, selectedFiat]);
|
|
13867
|
-
|
|
13893
|
+
useEffect20(() => {
|
|
13868
13894
|
if (!!selectedCrypto || !networkAvailableCryptoList?.length) return;
|
|
13869
13895
|
const targetCrypto = networkAvailableCryptoList.find((item) => PREFERRED_CRYPTOS.includes(item.cryptoCurrency)) || networkAvailableCryptoList[0];
|
|
13870
13896
|
useBuyMenuStore.getState().setSelectedCrypto(targetCrypto.cryptoCurrency);
|
|
13871
13897
|
}, [networkAvailableCryptoList, selectedCrypto]);
|
|
13872
|
-
|
|
13898
|
+
useEffect20(() => {
|
|
13873
13899
|
if (!!paymentMode || !paymentModes.length) return;
|
|
13874
13900
|
const targetPaymentMode = paymentModes.find((item) => item.payMethodCode === PREFERRED_PAYMENT_METHOD) || paymentModes[0];
|
|
13875
13901
|
useBinanceStore.getState().setPaymentMode(getPayMethodID(targetPaymentMode));
|
|
13876
13902
|
}, [paymentModes]);
|
|
13877
|
-
|
|
13903
|
+
useEffect20(() => {
|
|
13878
13904
|
return () => {
|
|
13879
13905
|
useBinanceStore.getState().setPaymentMode(null);
|
|
13880
13906
|
qc.resetQueries({ queryKey: [QUERY_KEYS2.binanceTradingPairs] });
|
|
@@ -14393,11 +14419,11 @@ var init_networks = __esm({
|
|
|
14393
14419
|
|
|
14394
14420
|
// src/internal/components/BuyMenu/finchpay/useFinchpaySseTxTracing.ts
|
|
14395
14421
|
import { useQueryClient as useQueryClient6 } from "@tanstack/react-query";
|
|
14396
|
-
import { useEffect as
|
|
14422
|
+
import { useEffect as useEffect21, useRef as useRef11 } from "react";
|
|
14397
14423
|
function useFinchpaySseTxTracing(walletAddress) {
|
|
14398
14424
|
const qc = useQueryClient6();
|
|
14399
14425
|
const debounceRef = useRef11(null);
|
|
14400
|
-
|
|
14426
|
+
useEffect21(() => {
|
|
14401
14427
|
if (!walletAddress) return;
|
|
14402
14428
|
const iframeManager = getIframeManager();
|
|
14403
14429
|
if (!iframeManager) return;
|
|
@@ -14446,7 +14472,7 @@ var init_utils8 = __esm({
|
|
|
14446
14472
|
// src/internal/components/BuyMenu/finchpay/FinchPay.tsx
|
|
14447
14473
|
import { useQuery as useQuery5, useQueryClient as useQueryClient7 } from "@tanstack/react-query";
|
|
14448
14474
|
import { DollarSign, LoaderIcon as LoaderIcon7 } from "lucide-react";
|
|
14449
|
-
import { useEffect as
|
|
14475
|
+
import { useEffect as useEffect22 } from "react";
|
|
14450
14476
|
import { Fragment as Fragment14, jsx as jsx50, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
14451
14477
|
function FinchPay() {
|
|
14452
14478
|
const qc = useQueryClient7();
|
|
@@ -14522,7 +14548,7 @@ function FinchPay() {
|
|
|
14522
14548
|
})
|
|
14523
14549
|
});
|
|
14524
14550
|
const minimum = Number(limitsData?.min_amount || "0");
|
|
14525
|
-
|
|
14551
|
+
useEffect22(() => {
|
|
14526
14552
|
if (minimum <= 0) return;
|
|
14527
14553
|
useBuyMenuStore.getState().setMinAmount(minimum);
|
|
14528
14554
|
}, [minimum]);
|
|
@@ -14550,23 +14576,23 @@ function FinchPay() {
|
|
|
14550
14576
|
// defaults to CARD estimation, widgetUrl
|
|
14551
14577
|
})
|
|
14552
14578
|
});
|
|
14553
|
-
|
|
14579
|
+
useEffect22(() => {
|
|
14554
14580
|
const { error: errorTitle, message: errorMessage } = handleErrors([currenciesError, limitsError, estimateError]);
|
|
14555
14581
|
if (!errorTitle && !errorMessage) return;
|
|
14556
14582
|
console.error(`[BuyModal][Binance] ${errorTitle}: ${errorMessage}`);
|
|
14557
14583
|
useBuyMenuStore.getState().setError(errorMessage);
|
|
14558
14584
|
}, [currenciesError, limitsError, estimateError]);
|
|
14559
|
-
|
|
14585
|
+
useEffect22(() => {
|
|
14560
14586
|
if (!!selectedFiat || currenciesData.fiats.length === 0) return;
|
|
14561
14587
|
const fallbackFiat = currenciesData.fiats[0];
|
|
14562
14588
|
const targetFiat = currenciesData.fiats.find((f) => f.ticker.toUpperCase() === "USD") || fallbackFiat;
|
|
14563
14589
|
useBuyMenuStore.getState().setSelectedFiat(targetFiat.ticker);
|
|
14564
14590
|
}, [currenciesData, selectedFiat]);
|
|
14565
|
-
|
|
14591
|
+
useEffect22(() => {
|
|
14566
14592
|
if (!!selectedCrypto || currenciesData.currentNetworkCoins.length === 0) return;
|
|
14567
14593
|
useBuyMenuStore.getState().setSelectedCrypto(currenciesData.currentNetworkCoins[0].ticker);
|
|
14568
14594
|
}, [currenciesData, selectedCrypto]);
|
|
14569
|
-
|
|
14595
|
+
useEffect22(() => {
|
|
14570
14596
|
return () => {
|
|
14571
14597
|
qc.resetQueries({ queryKey: [QUERY_KEYS2.finchPayCurrencies] });
|
|
14572
14598
|
qc.resetQueries({ queryKey: [QUERY_KEYS2.finchPayLimits] });
|
|
@@ -14820,7 +14846,7 @@ var init_ProviderSelector = __esm({
|
|
|
14820
14846
|
});
|
|
14821
14847
|
|
|
14822
14848
|
// src/internal/components/BuyMenu/useHandleInputAmount.ts
|
|
14823
|
-
import { useEffect as
|
|
14849
|
+
import { useEffect as useEffect23, useRef as useRef12 } from "react";
|
|
14824
14850
|
var ON_INPUT_QUERY_DELAY, useHandleInputAmount;
|
|
14825
14851
|
var init_useHandleInputAmount = __esm({
|
|
14826
14852
|
"src/internal/components/BuyMenu/useHandleInputAmount.ts"() {
|
|
@@ -14833,7 +14859,7 @@ var init_useHandleInputAmount = __esm({
|
|
|
14833
14859
|
const srcInputAmount = useBuyMenuStore((st) => st.srcInputAmount);
|
|
14834
14860
|
const minAmount = useBuyMenuStore((st) => st.minAmount);
|
|
14835
14861
|
const queryAmountTimer = useRef12(null);
|
|
14836
|
-
|
|
14862
|
+
useEffect23(() => {
|
|
14837
14863
|
if (queryAmountTimer.current) clearTimeout(queryAmountTimer.current);
|
|
14838
14864
|
queryAmountTimer.current = setTimeout(() => {
|
|
14839
14865
|
const checkedValue = Math.ceil(Math.max(Number(srcInputAmount), Number(minAmount)));
|
|
@@ -14841,7 +14867,7 @@ var init_useHandleInputAmount = __esm({
|
|
|
14841
14867
|
useBuyMenuStore.getState().setSrcQueryAmount(checkedValue);
|
|
14842
14868
|
}, ON_INPUT_QUERY_DELAY);
|
|
14843
14869
|
}, [minAmount, srcInputAmount]);
|
|
14844
|
-
|
|
14870
|
+
useEffect23(() => {
|
|
14845
14871
|
if (lastRampProviderRef.current === rampProvider) return;
|
|
14846
14872
|
const {
|
|
14847
14873
|
setIsProviderSummary,
|
|
@@ -15676,10 +15702,11 @@ function someInErrorChain(error, predicate) {
|
|
|
15676
15702
|
}
|
|
15677
15703
|
return false;
|
|
15678
15704
|
}
|
|
15679
|
-
function dropFailedConnectorSession(error, connector, wagmiConfig3) {
|
|
15705
|
+
async function dropFailedConnectorSession(error, connector, wagmiConfig3) {
|
|
15706
|
+
if (connector.type !== "walletConnect") return;
|
|
15680
15707
|
if (isRequestPendingError(error) || isUserRejectedError(error)) return;
|
|
15681
15708
|
if (wagmiConfig3.state.connections.has(connector.uid)) return;
|
|
15682
|
-
connector.disconnect().catch(() => {
|
|
15709
|
+
await connector.disconnect().catch(() => {
|
|
15683
15710
|
});
|
|
15684
15711
|
}
|
|
15685
15712
|
var REQUEST_PENDING_ERROR_CODE, USER_REJECTED_ERROR_CODE, isRequestPendingError, isUserRejectedError, isUnsupportedChainError;
|
|
@@ -16525,7 +16552,7 @@ var init_EmailNotConnectedWarning = __esm({
|
|
|
16525
16552
|
|
|
16526
16553
|
// src/internal/components/ManageWalletMenu/hooks/useLinkSocial.ts
|
|
16527
16554
|
import { useQueryClient as useQueryClient11 } from "@tanstack/react-query";
|
|
16528
|
-
import React29, { useEffect as
|
|
16555
|
+
import React29, { useEffect as useEffect24 } from "react";
|
|
16529
16556
|
function normalizeSocialLinkError(message) {
|
|
16530
16557
|
if (message === "X_ALREADY_LINKED") {
|
|
16531
16558
|
return "This X account is already linked to another account";
|
|
@@ -16600,7 +16627,7 @@ function useLinkSocial() {
|
|
|
16600
16627
|
[config.social?.providers]
|
|
16601
16628
|
);
|
|
16602
16629
|
const [socialLinkStarted, setSocialLinkStarted] = React29.useState(false);
|
|
16603
|
-
|
|
16630
|
+
useEffect24(() => {
|
|
16604
16631
|
const key = providerType?.toLowerCase();
|
|
16605
16632
|
console.log("[useLinkSocial] Effect triggered:", { key, linkIsLoading, socialLinkStarted });
|
|
16606
16633
|
if (key && key !== "telegram" && key !== "email" && key !== "passkey" && key !== "wallet") {
|
|
@@ -16679,7 +16706,7 @@ var init_telegram2 = __esm({
|
|
|
16679
16706
|
|
|
16680
16707
|
// src/internal/components/ManageWalletMenu/hooks/useLinkTelegram.ts
|
|
16681
16708
|
import { useQueryClient as useQueryClient12 } from "@tanstack/react-query";
|
|
16682
|
-
import { useCallback as useCallback16, useEffect as
|
|
16709
|
+
import { useCallback as useCallback16, useEffect as useEffect25, useState as useState12 } from "react";
|
|
16683
16710
|
function useLinkTelegram() {
|
|
16684
16711
|
const {
|
|
16685
16712
|
config: { current: config },
|
|
@@ -16737,7 +16764,7 @@ function useLinkTelegram() {
|
|
|
16737
16764
|
}
|
|
16738
16765
|
}, [config.social?.providers]);
|
|
16739
16766
|
const [telegramLinkStarted, setTelegramLinkStarted] = useState12(false);
|
|
16740
|
-
|
|
16767
|
+
useEffect25(() => {
|
|
16741
16768
|
console.log("[useLinkTelegram] Effect triggered:", { providerType, linkIsLoading, telegramLinkStarted });
|
|
16742
16769
|
if (providerType === "telegram" && !linkIsLoading && !telegramLinkStarted) {
|
|
16743
16770
|
console.log("[useLinkTelegram] Starting Telegram link flow");
|
|
@@ -16745,7 +16772,7 @@ function useLinkTelegram() {
|
|
|
16745
16772
|
handleLinkTelegram();
|
|
16746
16773
|
}
|
|
16747
16774
|
}, [providerType, handleLinkTelegram, linkIsLoading, telegramLinkStarted]);
|
|
16748
|
-
|
|
16775
|
+
useEffect25(() => {
|
|
16749
16776
|
if (providerType !== "telegram") {
|
|
16750
16777
|
setTelegramLinkStarted(false);
|
|
16751
16778
|
}
|
|
@@ -17258,10 +17285,10 @@ var init_ManageWalletMenu = __esm({
|
|
|
17258
17285
|
|
|
17259
17286
|
// src/internal/components/ConnectExternalWalletMenu/useConnectExternalWalletMenuParams.ts
|
|
17260
17287
|
import { keys as keys3 } from "lodash-es";
|
|
17261
|
-
import { useEffect as
|
|
17288
|
+
import { useEffect as useEffect26, useRef as useRef13 } from "react";
|
|
17262
17289
|
function useConnectExternalWalletMenuParams() {
|
|
17263
17290
|
const paramsRef = useRef13(null);
|
|
17264
|
-
|
|
17291
|
+
useEffect26(() => {
|
|
17265
17292
|
const { pageParams, setPageParams } = useLayoutDataStore.getState();
|
|
17266
17293
|
if (!pageParams || !keys3(pageParams).length) return;
|
|
17267
17294
|
paramsRef.current = pageParams;
|
|
@@ -17482,7 +17509,7 @@ function ConnectExternalWalletMenu() {
|
|
|
17482
17509
|
onError: (error, { connector }) => reportConnectError(error, connector)
|
|
17483
17510
|
}
|
|
17484
17511
|
});
|
|
17485
|
-
function reportConnectError(error, connector) {
|
|
17512
|
+
async function reportConnectError(error, connector) {
|
|
17486
17513
|
const connectFlowType = getConnectFlowType({
|
|
17487
17514
|
isEmbarkAI: !!embarkAiAddress,
|
|
17488
17515
|
connectFlow: menuParams.current?.connectFlowType || "auth"
|
|
@@ -17491,7 +17518,6 @@ function ConnectExternalWalletMenu() {
|
|
|
17491
17518
|
if (!isRequestPending && connectFlowType !== "connect" && wagmiConfig3.state.connections.has(connector.uid)) {
|
|
17492
17519
|
disconnect({ connector });
|
|
17493
17520
|
}
|
|
17494
|
-
dropFailedConnectorSession(error, connector, wagmiConfig3);
|
|
17495
17521
|
const errorMessage = isRequestPending ? (
|
|
17496
17522
|
// @ts-expect-error i18n typing
|
|
17497
17523
|
t("passport:connectMenu.requestPending", { wallet: connector.name })
|
|
@@ -17514,6 +17540,7 @@ function ConnectExternalWalletMenu() {
|
|
|
17514
17540
|
}
|
|
17515
17541
|
useLayoutStore.getState().setIsDialogForced(false);
|
|
17516
17542
|
}, 100);
|
|
17543
|
+
await dropFailedConnectorSession(error, connector, wagmiConfig3);
|
|
17517
17544
|
}
|
|
17518
17545
|
const visibleConnectors = useMemo9(() => {
|
|
17519
17546
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -17592,7 +17619,7 @@ function ConnectExternalWalletMenu() {
|
|
|
17592
17619
|
await disconnectAsync({ connector: connectedConnector });
|
|
17593
17620
|
}
|
|
17594
17621
|
} catch (error) {
|
|
17595
|
-
reportConnectError(error, connector);
|
|
17622
|
+
await reportConnectError(error, connector);
|
|
17596
17623
|
return;
|
|
17597
17624
|
} finally {
|
|
17598
17625
|
setIsPreparingConnect(false);
|
|
@@ -17696,8 +17723,8 @@ function useExternalWalletConnnect(options) {
|
|
|
17696
17723
|
onSuccess?.({ connected: true, address: signingWalletAddress });
|
|
17697
17724
|
useLayoutStore.getState().setIsDialogForced(false);
|
|
17698
17725
|
},
|
|
17699
|
-
onError: (error, { connector }) => {
|
|
17700
|
-
dropFailedConnectorSession(error, connector, wagmiConfig3);
|
|
17726
|
+
onError: async (error, { connector }) => {
|
|
17727
|
+
await dropFailedConnectorSession(error, connector, wagmiConfig3);
|
|
17701
17728
|
onError?.({
|
|
17702
17729
|
connected: false,
|
|
17703
17730
|
connector: connector?.name || "Unknown Wallet",
|
|
@@ -18408,7 +18435,7 @@ var init_guardian_backup = __esm({
|
|
|
18408
18435
|
|
|
18409
18436
|
// src/internal/components/DevicesMenu/DeviceManageScreen.tsx
|
|
18410
18437
|
import { ArrowLeft as ArrowLeft10, Cpu, Download, HardDrive, Loader2 as Loader23, Trash2, Upload } from "lucide-react";
|
|
18411
|
-
import { useCallback as useCallback19, useEffect as
|
|
18438
|
+
import { useCallback as useCallback19, useEffect as useEffect27, useRef as useRef14, useState as useState16 } from "react";
|
|
18412
18439
|
import { Fragment as Fragment20, jsx as jsx76, jsxs as jsxs67 } from "react/jsx-runtime";
|
|
18413
18440
|
function formatSize(bytes) {
|
|
18414
18441
|
if (bytes < 1024) return `${bytes} B`;
|
|
@@ -18428,12 +18455,12 @@ function DeviceManageScreen() {
|
|
|
18428
18455
|
const [statusMessage, setStatusMessage] = useState16(null);
|
|
18429
18456
|
const [errorMessage, setErrorMessage] = useState16(null);
|
|
18430
18457
|
const [waitingConfirm, setWaitingConfirm] = useState16(false);
|
|
18431
|
-
|
|
18458
|
+
useEffect27(() => {
|
|
18432
18459
|
if (!statusMessage) return;
|
|
18433
18460
|
const t = setTimeout(() => setStatusMessage(null), 3e3);
|
|
18434
18461
|
return () => clearTimeout(t);
|
|
18435
18462
|
}, [statusMessage]);
|
|
18436
|
-
|
|
18463
|
+
useEffect27(() => {
|
|
18437
18464
|
if (!deviceId || !isWebSerialAvailable()) {
|
|
18438
18465
|
setScreen({ step: "error", message: "WebSerial not available" });
|
|
18439
18466
|
return;
|
|
@@ -19365,7 +19392,7 @@ var init_cloudStorage = __esm({
|
|
|
19365
19392
|
|
|
19366
19393
|
// src/internal/components/KeyshareRestoreMenu/hooks/useCreateBackup.ts
|
|
19367
19394
|
import { useMutation as useMutation12, useQueryClient as useQueryClient16 } from "@tanstack/react-query";
|
|
19368
|
-
import { useCallback as useCallback22, useEffect as
|
|
19395
|
+
import { useCallback as useCallback22, useEffect as useEffect28 } from "react";
|
|
19369
19396
|
function useCreateBackup() {
|
|
19370
19397
|
const qc = useQueryClient16();
|
|
19371
19398
|
const session = useSession((st) => st.session);
|
|
@@ -19374,7 +19401,7 @@ function useCreateBackup() {
|
|
|
19374
19401
|
const usePasskey = useRestoreStore((st) => st.usePasskey);
|
|
19375
19402
|
const restorePassword = useRestoreStore((st) => st.restorePassword);
|
|
19376
19403
|
const selectedCloudProvider = useRestoreStore((st) => st.selectedCloudProvider);
|
|
19377
|
-
|
|
19404
|
+
useEffect28(() => {
|
|
19378
19405
|
if (!hasServerVault) {
|
|
19379
19406
|
useRestoreStore.getState().setMethod("server");
|
|
19380
19407
|
useLayoutStore.getState().setIsDialogForced(true);
|
|
@@ -19684,7 +19711,7 @@ var init_useRestoreAccount = __esm({
|
|
|
19684
19711
|
});
|
|
19685
19712
|
|
|
19686
19713
|
// src/internal/components/KeyshareRestoreMenu/hooks/useValidateFileBackup.ts
|
|
19687
|
-
import { useEffect as
|
|
19714
|
+
import { useEffect as useEffect29 } from "react";
|
|
19688
19715
|
function validateRestoreFileFormat(parsedData) {
|
|
19689
19716
|
if (typeof parsedData !== "object" || parsedData === null) return false;
|
|
19690
19717
|
const data = parsedData;
|
|
@@ -19694,7 +19721,7 @@ function useValidateFileBackup() {
|
|
|
19694
19721
|
const restoreFile = useRestoreStore((st) => st.restoreFile);
|
|
19695
19722
|
const setError = useRestoreStore((st) => st.setError);
|
|
19696
19723
|
const setUsePasskey = useRestoreStore((st) => st.setUsePasskey);
|
|
19697
|
-
|
|
19724
|
+
useEffect29(() => {
|
|
19698
19725
|
if (!restoreFile) {
|
|
19699
19726
|
return;
|
|
19700
19727
|
}
|
|
@@ -19922,7 +19949,7 @@ var init_onboarding_setup4 = __esm({
|
|
|
19922
19949
|
|
|
19923
19950
|
// src/internal/components/KeyshareRestoreMenu/components/PasswordPasskey.tsx
|
|
19924
19951
|
import { ChevronRight as ChevronRight3, Eye, EyeOff, Info as Info3, Key as Key5, Loader as Loader12, Plus } from "lucide-react";
|
|
19925
|
-
import { useEffect as
|
|
19952
|
+
import { useEffect as useEffect30, useRef as useRef15 } from "react";
|
|
19926
19953
|
import { Fragment as Fragment23, jsx as jsx80, jsxs as jsxs71 } from "react/jsx-runtime";
|
|
19927
19954
|
function PasswordPasskey(props) {
|
|
19928
19955
|
const { t } = useT();
|
|
@@ -19951,7 +19978,7 @@ function PasswordPasskey(props) {
|
|
|
19951
19978
|
} = useRestoreStore();
|
|
19952
19979
|
const { config } = useProviderConfig();
|
|
19953
19980
|
const isPasskeyEnabled = config.current.passkey.enabled;
|
|
19954
|
-
|
|
19981
|
+
useEffect30(() => {
|
|
19955
19982
|
if (!isPasskeyEnabled && usePasskey) setUsePasskey(false);
|
|
19956
19983
|
}, [isPasskeyEnabled, usePasskey]);
|
|
19957
19984
|
return /* @__PURE__ */ jsxs71(Fragment23, { children: [
|
|
@@ -20289,7 +20316,7 @@ var init_File = __esm({
|
|
|
20289
20316
|
import { useQueryClient as useQueryClient17 } from "@tanstack/react-query";
|
|
20290
20317
|
import dayjs4 from "dayjs";
|
|
20291
20318
|
import { Download as Download3, Key as Key6, Upload as Upload3 } from "lucide-react";
|
|
20292
|
-
import { useEffect as
|
|
20319
|
+
import { useEffect as useEffect31 } from "react";
|
|
20293
20320
|
import { Fragment as Fragment26, jsx as jsx83, jsxs as jsxs74 } from "react/jsx-runtime";
|
|
20294
20321
|
function Server(props) {
|
|
20295
20322
|
const { isLoading, mode = "restore", serverHandler, createPasskeyHandler } = props;
|
|
@@ -20299,7 +20326,7 @@ function Server(props) {
|
|
|
20299
20326
|
const usePasskey = useRestoreStore((st) => st.usePasskey);
|
|
20300
20327
|
const setUsePasskey = useRestoreStore((st) => st.setUsePasskey);
|
|
20301
20328
|
const serverRecoveryStatus = qc.getQueryData([CHECK_BACKUP_QUERY_KEY, address]);
|
|
20302
|
-
|
|
20329
|
+
useEffect31(() => {
|
|
20303
20330
|
if (mode === "backup" || !serverRecoveryStatus?.created?.encryptionMethod) return;
|
|
20304
20331
|
setUsePasskey(serverRecoveryStatus.created.encryptionMethod === "passkey");
|
|
20305
20332
|
}, [mode, serverRecoveryStatus, setUsePasskey]);
|
|
@@ -20491,7 +20518,7 @@ var init_select = __esm({
|
|
|
20491
20518
|
// src/internal/components/KeyshareRestoreMenu/methods/Cloud.tsx
|
|
20492
20519
|
import { useQuery as useQuery11 } from "@tanstack/react-query";
|
|
20493
20520
|
import { ArrowLeft as ArrowLeft13, CloudDownload, CloudUpload, Loader as Loader13 } from "lucide-react";
|
|
20494
|
-
import { useEffect as
|
|
20521
|
+
import { useEffect as useEffect32 } from "react";
|
|
20495
20522
|
import { Fragment as Fragment27, jsx as jsx85, jsxs as jsxs76 } from "react/jsx-runtime";
|
|
20496
20523
|
function Cloud2(props) {
|
|
20497
20524
|
const { isLoading, mode = "restore", cloudHandler } = props;
|
|
@@ -20512,7 +20539,7 @@ function Cloud2(props) {
|
|
|
20512
20539
|
return availableProviders.map((p) => ({ id: p.id, name: p.name, available: p.isAvailable() }));
|
|
20513
20540
|
}
|
|
20514
20541
|
});
|
|
20515
|
-
|
|
20542
|
+
useEffect32(() => {
|
|
20516
20543
|
if (isCloudProvidersLoading) return;
|
|
20517
20544
|
if (!!cloudProvidersError) {
|
|
20518
20545
|
console.error("[KeyshareBackup] Failed to load cloud providers:", cloudProvidersError);
|
|
@@ -20752,7 +20779,7 @@ var init_methods = __esm({
|
|
|
20752
20779
|
// src/internal/components/KeyshareRestoreMenu/KeyshareRestoreMenu.tsx
|
|
20753
20780
|
import { useMutation as useMutation14, useQuery as useQuery12, useQueryClient as useQueryClient18 } from "@tanstack/react-query";
|
|
20754
20781
|
import { AlertCircle as AlertCircle2, CheckCircle2 as CheckCircle22, CloudDownload as CloudDownload2, Loader as Loader14, UserCircle as UserCircle2 } from "lucide-react";
|
|
20755
|
-
import { useEffect as
|
|
20782
|
+
import { useEffect as useEffect33 } from "react";
|
|
20756
20783
|
import { useDisconnect as useDisconnect4 } from "wagmi";
|
|
20757
20784
|
import { Fragment as Fragment29, jsx as jsx87, jsxs as jsxs78 } from "react/jsx-runtime";
|
|
20758
20785
|
var RESTORE_COMPONENTS, KeyshareRestoreMenu;
|
|
@@ -20788,7 +20815,7 @@ var init_KeyshareRestoreMenu = __esm({
|
|
|
20788
20815
|
const error = useRestoreStore((st) => st.error);
|
|
20789
20816
|
const success = useRestoreStore((st) => st.success);
|
|
20790
20817
|
const currentRestoreMethod = useRestoreStore((st) => st.method);
|
|
20791
|
-
|
|
20818
|
+
useEffect33(() => {
|
|
20792
20819
|
const { setIsDialogForced } = useLayoutStore.getState();
|
|
20793
20820
|
const { setRestorePassword, setRestoreFile, setShowPassword, setUsePasskey, setMethod } = useRestoreStore.getState();
|
|
20794
20821
|
setIsDialogForced(true);
|
|
@@ -20827,7 +20854,7 @@ var init_KeyshareRestoreMenu = __esm({
|
|
|
20827
20854
|
queryFn: async () => await getShareRecoveryStats()
|
|
20828
20855
|
});
|
|
20829
20856
|
const hasServerBackup = serverRecoveryStatus?.created || serverRecoveryStatus?.devices?.length > 0;
|
|
20830
|
-
|
|
20857
|
+
useEffect33(() => {
|
|
20831
20858
|
if (!!hasServerBackup) useRestoreStore.getState().setMethod("server");
|
|
20832
20859
|
}, [hasServerBackup]);
|
|
20833
20860
|
const { mutate: disconnect, isPending: isDisconnecting } = useMutation14({
|
|
@@ -20967,7 +20994,7 @@ var init_KeyshareRestoreMenu = __esm({
|
|
|
20967
20994
|
// src/internal/components/KeyshareRestoreMenu/KeyshareBackupMenu.tsx
|
|
20968
20995
|
import { useQuery as useQuery13 } from "@tanstack/react-query";
|
|
20969
20996
|
import { AlertCircle as AlertCircle3, ArrowLeft as ArrowLeft14, CheckCircle2 as CheckCircle23, Loader as Loader15, LockIcon } from "lucide-react";
|
|
20970
|
-
import { useEffect as
|
|
20997
|
+
import { useEffect as useEffect34 } from "react";
|
|
20971
20998
|
import { Fragment as Fragment30, jsx as jsx88, jsxs as jsxs79 } from "react/jsx-runtime";
|
|
20972
20999
|
function KeyshareBackupMenu() {
|
|
20973
21000
|
const address = useSession((st) => st.address);
|
|
@@ -20978,7 +21005,7 @@ function KeyshareBackupMenu() {
|
|
|
20978
21005
|
const usePasskey = useRestoreStore((st) => st.usePasskey);
|
|
20979
21006
|
const error = useRestoreStore((st) => st.error);
|
|
20980
21007
|
const success = useRestoreStore((st) => st.success);
|
|
20981
|
-
|
|
21008
|
+
useEffect34(() => {
|
|
20982
21009
|
const { setSuccess, setError, setRestorePassword, setRestoreFile, setShowPassword, setUsePasskey, setMethod } = useRestoreStore.getState();
|
|
20983
21010
|
return () => {
|
|
20984
21011
|
setSuccess(null);
|
|
@@ -20998,7 +21025,7 @@ function KeyshareBackupMenu() {
|
|
|
20998
21025
|
});
|
|
20999
21026
|
useOnboardingTourAvailable(!isRecoveryLoading && currentBackupMethod === "server" && !usePasskey);
|
|
21000
21027
|
const hasRecoveryData2 = serverRecoveryStatus?.created || serverRecoveryStatus?.devices?.length > 0;
|
|
21001
|
-
|
|
21028
|
+
useEffect34(() => {
|
|
21002
21029
|
if (!!hasRecoveryData2) useRestoreStore.getState().setMethod("server");
|
|
21003
21030
|
}, [hasRecoveryData2]);
|
|
21004
21031
|
const {
|
|
@@ -21245,7 +21272,7 @@ var init_SumsubIframeManager = __esm({
|
|
|
21245
21272
|
});
|
|
21246
21273
|
|
|
21247
21274
|
// src/internal/components/KYC/useSumsubIframe.ts
|
|
21248
|
-
import { useEffect as
|
|
21275
|
+
import { useEffect as useEffect35, useRef as useRef16, useState as useState21 } from "react";
|
|
21249
21276
|
function useSumsubIframe({ iframeUrl }) {
|
|
21250
21277
|
const config = useProviderConfig().config;
|
|
21251
21278
|
const { colorMode } = useColorMode();
|
|
@@ -21255,7 +21282,7 @@ function useSumsubIframe({ iframeUrl }) {
|
|
|
21255
21282
|
const [height, setHeight] = useState21(0);
|
|
21256
21283
|
const [status, setStatus] = useState21("");
|
|
21257
21284
|
const levelName = config.current?.kyc?.options?.levelName;
|
|
21258
|
-
|
|
21285
|
+
useEffect35(() => {
|
|
21259
21286
|
setError(null);
|
|
21260
21287
|
setIsLoading(true);
|
|
21261
21288
|
setStatus("Preparing verification...");
|
|
@@ -22757,11 +22784,11 @@ var init_useNicknameStore = __esm({
|
|
|
22757
22784
|
// src/internal/components/NicknameMenu/useNicknameAvailability.ts
|
|
22758
22785
|
import { useMutation as useMutation15 } from "@tanstack/react-query";
|
|
22759
22786
|
import { debounce as debounce4 } from "lodash-es";
|
|
22760
|
-
import { useCallback as useCallback25, useEffect as
|
|
22787
|
+
import { useCallback as useCallback25, useEffect as useEffect36 } from "react";
|
|
22761
22788
|
function useNicknameAvailability(currentNickname) {
|
|
22762
22789
|
const { t } = useT();
|
|
22763
22790
|
const nicknameValue = useNicknameStore((st) => st.nicknameValue);
|
|
22764
|
-
|
|
22791
|
+
useEffect36(() => {
|
|
22765
22792
|
if (!currentNickname) return;
|
|
22766
22793
|
useNicknameStore.getState().setNicknameValue(currentNickname);
|
|
22767
22794
|
}, [currentNickname]);
|
|
@@ -22783,7 +22810,7 @@ function useNicknameAvailability(currentNickname) {
|
|
|
22783
22810
|
}
|
|
22784
22811
|
});
|
|
22785
22812
|
const debouncedCheckAvailability = useCallback25(debounce4(checkAvailability, DEBOUNCE_MS), [checkAvailability]);
|
|
22786
|
-
|
|
22813
|
+
useEffect36(() => {
|
|
22787
22814
|
if (!currentNickname) return;
|
|
22788
22815
|
const normalizedInputValue = normalizeNickname(nicknameValue);
|
|
22789
22816
|
const { valid: isNicknameValid } = validateNickname(nicknameValue);
|
|
@@ -22812,7 +22839,7 @@ var init_useNicknameAvailability = __esm({
|
|
|
22812
22839
|
// src/internal/components/NicknameMenu/NicknameEditForm.tsx
|
|
22813
22840
|
import { useMutation as useMutation16, useQueryClient as useQueryClient21 } from "@tanstack/react-query";
|
|
22814
22841
|
import { AtSignIcon, CopyIcon as CopyIcon2, LoaderIcon as LoaderIcon12, SaveIcon } from "lucide-react";
|
|
22815
|
-
import { useCallback as useCallback26, useEffect as
|
|
22842
|
+
import { useCallback as useCallback26, useEffect as useEffect37, useRef as useRef18, useState as useState23 } from "react";
|
|
22816
22843
|
import { Fragment as Fragment34, jsx as jsx98, jsxs as jsxs89 } from "react/jsx-runtime";
|
|
22817
22844
|
function NicknameEditForm(props) {
|
|
22818
22845
|
const { isInitialUser, nicknameInfo } = props;
|
|
@@ -22827,7 +22854,7 @@ function NicknameEditForm(props) {
|
|
|
22827
22854
|
const { isCheckingAvailability } = useNicknameAvailability(nicknameInfo ? nicknameInfo.handle : "");
|
|
22828
22855
|
const [isNicknameCopied, setIsNicknameCopied] = useState23(false);
|
|
22829
22856
|
const exitTimerRef = useRef18(null);
|
|
22830
|
-
|
|
22857
|
+
useEffect37(() => () => {
|
|
22831
22858
|
if (exitTimerRef.current) clearTimeout(exitTimerRef.current);
|
|
22832
22859
|
}, []);
|
|
22833
22860
|
const { mutate: changeNickname2, isPending: isNicknameChanging } = useMutation16({
|
|
@@ -22991,7 +23018,7 @@ var init_NicknameEditForm = __esm({
|
|
|
22991
23018
|
import { useQuery as useQuery19 } from "@tanstack/react-query";
|
|
22992
23019
|
import dayjs5 from "dayjs";
|
|
22993
23020
|
import { ArrowLeft as ArrowLeft18, Loader as Loader18 } from "lucide-react";
|
|
22994
|
-
import { useEffect as
|
|
23021
|
+
import { useEffect as useEffect38 } from "react";
|
|
22995
23022
|
import { jsx as jsx99, jsxs as jsxs90 } from "react/jsx-runtime";
|
|
22996
23023
|
function NicknameMenu() {
|
|
22997
23024
|
const { isInitialUser } = usePageParams().current;
|
|
@@ -23011,7 +23038,7 @@ function NicknameMenu() {
|
|
|
23011
23038
|
queryFn: async () => await getNicknameInfo()
|
|
23012
23039
|
});
|
|
23013
23040
|
const resolvedError = nicknameError || nicknameInfoError?.message || null;
|
|
23014
|
-
|
|
23041
|
+
useEffect38(() => () => useNicknameStore.getState().reset(), []);
|
|
23015
23042
|
return /* @__PURE__ */ jsxs90(Expandable, { isExpanded: true, contentClassName: "w-full flex flex-col gap-[var(--ui-kit-gap)]", children: [
|
|
23016
23043
|
/* @__PURE__ */ jsxs90("div", { className: "flex items-center gap-[var(--ui-kit-gap)] ", children: [
|
|
23017
23044
|
/* @__PURE__ */ jsx99(
|
|
@@ -23203,7 +23230,7 @@ var init_nickname_fingerprint = __esm({
|
|
|
23203
23230
|
import { useQuery as useQuery20 } from "@tanstack/react-query";
|
|
23204
23231
|
import { ArrowLeft as ArrowLeft19, AtSignIcon as AtSignIcon2, CheckCircle2 as CheckCircle24, Copy as Copy2, FingerprintIcon, LoaderIcon as LoaderIcon13, Wallet2Icon as Wallet2Icon4 } from "lucide-react";
|
|
23205
23232
|
import QRCode from "qrcode";
|
|
23206
|
-
import { useEffect as
|
|
23233
|
+
import { useEffect as useEffect39, useMemo as useMemo15, useState as useState24 } from "react";
|
|
23207
23234
|
import { Fragment as Fragment35, jsx as jsx100, jsxs as jsxs91 } from "react/jsx-runtime";
|
|
23208
23235
|
function ReceiveMenu() {
|
|
23209
23236
|
const { t } = useT();
|
|
@@ -23229,7 +23256,7 @@ function ReceiveMenu() {
|
|
|
23229
23256
|
return null;
|
|
23230
23257
|
}
|
|
23231
23258
|
}, [session?.ownerAddress]);
|
|
23232
|
-
|
|
23259
|
+
useEffect39(() => {
|
|
23233
23260
|
if (!address) return;
|
|
23234
23261
|
QRCode.toDataURL(address, {
|
|
23235
23262
|
width: 200,
|
|
@@ -24031,7 +24058,7 @@ var init_utils10 = __esm({
|
|
|
24031
24058
|
});
|
|
24032
24059
|
|
|
24033
24060
|
// src/internal/components/SecurityMenu/UserPolicies/usePolicyForm.ts
|
|
24034
|
-
import { useEffect as
|
|
24061
|
+
import { useEffect as useEffect40, useState as useState25 } from "react";
|
|
24035
24062
|
import { create as create14 } from "zustand";
|
|
24036
24063
|
function updateDestinations(patch) {
|
|
24037
24064
|
usePolicyForm.setState((st) => ({ ...st, destinations: { ...st?.destinations, ...patch } }));
|
|
@@ -24043,7 +24070,7 @@ function useWatchFormData() {
|
|
|
24043
24070
|
const [showFormErrors, setShowFormErrors] = useState25(false);
|
|
24044
24071
|
const formData = usePolicyForm();
|
|
24045
24072
|
const formState = usePolicyFormValidation();
|
|
24046
|
-
|
|
24073
|
+
useEffect40(() => {
|
|
24047
24074
|
if (!formData) return;
|
|
24048
24075
|
setShowFormErrors(false);
|
|
24049
24076
|
const errors = {};
|
|
@@ -24070,7 +24097,7 @@ function useWatchFormData() {
|
|
|
24070
24097
|
}
|
|
24071
24098
|
usePolicyFormValidation.setState(errors, true);
|
|
24072
24099
|
}, [formData]);
|
|
24073
|
-
|
|
24100
|
+
useEffect40(() => () => usePolicyFormValidation.setState({}, true), []);
|
|
24074
24101
|
const formErrorItem = Object.entries(formState).find(([_, value]) => value?.error);
|
|
24075
24102
|
const formErrorMessage = formErrorItem ? `${formErrorItem[0].toUpperCase()}: ${formErrorItem[1]?.error}` : "";
|
|
24076
24103
|
return {
|
|
@@ -24577,9 +24604,9 @@ var init_UserPolicies2 = __esm({
|
|
|
24577
24604
|
|
|
24578
24605
|
// src/internal/components/SecurityMenu/useSecurityMenuParams.ts
|
|
24579
24606
|
import { keys as keys4 } from "lodash-es";
|
|
24580
|
-
import { useEffect as
|
|
24607
|
+
import { useEffect as useEffect41 } from "react";
|
|
24581
24608
|
function useSecurityMenuParams() {
|
|
24582
|
-
|
|
24609
|
+
useEffect41(() => {
|
|
24583
24610
|
const { pageParams, setPageParams } = useLayoutDataStore.getState();
|
|
24584
24611
|
if (!pageParams || !keys4(pageParams).length) return;
|
|
24585
24612
|
const { submenu } = pageParams;
|
|
@@ -24613,7 +24640,7 @@ var init_useSecurityMenuParams = __esm({
|
|
|
24613
24640
|
|
|
24614
24641
|
// src/internal/components/SecurityMenu/SecurityMenu.tsx
|
|
24615
24642
|
import { ArrowLeft as ArrowLeft20, LayoutGridIcon, ShieldCogIcon } from "lucide-react";
|
|
24616
|
-
import { useEffect as
|
|
24643
|
+
import { useEffect as useEffect42 } from "react";
|
|
24617
24644
|
import { Fragment as Fragment38, jsx as jsx108, jsxs as jsxs99 } from "react/jsx-runtime";
|
|
24618
24645
|
function SecurityMenuContent() {
|
|
24619
24646
|
const { t } = useT();
|
|
@@ -24622,7 +24649,7 @@ function SecurityMenuContent() {
|
|
|
24622
24649
|
const { appToUntrust, showConnectedApps, showAssetsPolicies } = useSecurityStore();
|
|
24623
24650
|
const policyForm = usePolicyForm();
|
|
24624
24651
|
useOnboardingTourAvailable(!showConnectedApps && !showAssetsPolicies);
|
|
24625
|
-
|
|
24652
|
+
useEffect42(() => {
|
|
24626
24653
|
let securityTitle = "";
|
|
24627
24654
|
switch (true) {
|
|
24628
24655
|
case showConnectedApps:
|
|
@@ -24643,7 +24670,7 @@ function SecurityMenuContent() {
|
|
|
24643
24670
|
return () => {
|
|
24644
24671
|
};
|
|
24645
24672
|
}, [t, showConnectedApps, showAssetsPolicies, policyForm]);
|
|
24646
|
-
|
|
24673
|
+
useEffect42(
|
|
24647
24674
|
() => () => {
|
|
24648
24675
|
usePolicyForm.setState(null, true);
|
|
24649
24676
|
useSecurityStore.setState(
|
|
@@ -24939,12 +24966,12 @@ var init_SenderSelector = __esm({
|
|
|
24939
24966
|
});
|
|
24940
24967
|
|
|
24941
24968
|
// src/internal/components/SendMenu/hyperbridge/hooks/useAvailableSenders.ts
|
|
24942
|
-
import { useEffect as
|
|
24969
|
+
import { useEffect as useEffect43, useRef as useRef19 } from "react";
|
|
24943
24970
|
function useAvailableSenders() {
|
|
24944
24971
|
const address = useSession((st) => st.address);
|
|
24945
24972
|
const { profiles } = useLinkedProfiles();
|
|
24946
24973
|
const lastCalcedSenders = useRef19([]);
|
|
24947
|
-
|
|
24974
|
+
useEffect43(() => {
|
|
24948
24975
|
const sendersAccumulator = [
|
|
24949
24976
|
{
|
|
24950
24977
|
type: "embarkai-wallet",
|
|
@@ -25647,7 +25674,7 @@ var init_useBridge = __esm({
|
|
|
25647
25674
|
|
|
25648
25675
|
// src/internal/components/SendMenu/hyperbridge/hooks/useHyperlaneRoutes.ts
|
|
25649
25676
|
import { useQuery as useQuery24 } from "@tanstack/react-query";
|
|
25650
|
-
import { useEffect as
|
|
25677
|
+
import { useEffect as useEffect44 } from "react";
|
|
25651
25678
|
function useHyperlaneRoutes() {
|
|
25652
25679
|
const address = useSession((st) => st.address);
|
|
25653
25680
|
const page = useLayoutDataStore((st) => st.page);
|
|
@@ -25663,7 +25690,7 @@ function useHyperlaneRoutes() {
|
|
|
25663
25690
|
queryKey: [HYPERLANE_WARP_ROUTES_QUERY_KEY, address],
|
|
25664
25691
|
queryFn: async () => await getHyperlaneWarpRoutes()
|
|
25665
25692
|
});
|
|
25666
|
-
|
|
25693
|
+
useEffect44(() => {
|
|
25667
25694
|
if (!errorWarpRoutes) return;
|
|
25668
25695
|
useFlowSelectorStore.getState().setError(errorWarpRoutes.message);
|
|
25669
25696
|
const { resetSelections, setRecipient, setOriginChain, setDestinationChain } = useBridgeStore.getState();
|
|
@@ -25672,7 +25699,7 @@ function useHyperlaneRoutes() {
|
|
|
25672
25699
|
setOriginChain(null);
|
|
25673
25700
|
setDestinationChain(null);
|
|
25674
25701
|
}, [errorWarpRoutes]);
|
|
25675
|
-
|
|
25702
|
+
useEffect44(() => {
|
|
25676
25703
|
if (!!hyperRoute || !hyperlaneWarpRoutes.length) return;
|
|
25677
25704
|
let targetHyperRouteToSelect = hyperlaneWarpRoutes.find((route) => route.routeId === hyperRoute);
|
|
25678
25705
|
if (!targetHyperRouteToSelect) {
|
|
@@ -25711,13 +25738,13 @@ var init_useHyperlaneRoutes = __esm({
|
|
|
25711
25738
|
});
|
|
25712
25739
|
|
|
25713
25740
|
// src/internal/components/SendMenu/hyperbridge/hooks/useMenuTitle.ts
|
|
25714
|
-
import { useEffect as
|
|
25741
|
+
import { useEffect as useEffect45 } from "react";
|
|
25715
25742
|
function useMenuTitle(warpRoutes) {
|
|
25716
25743
|
const { t } = useT();
|
|
25717
25744
|
const bridgeStep = useBridgeStore((st) => st.bridgeStep);
|
|
25718
25745
|
const hyperRoute = useBridgeStore((st) => st.hyperRoute);
|
|
25719
25746
|
const hyperRouteMeta = warpRoutes?.length ? warpRoutes.find((route) => route.routeId === hyperRoute) : null;
|
|
25720
|
-
|
|
25747
|
+
useEffect45(() => {
|
|
25721
25748
|
const updateMenuTitle = useFlowSelectorStore.getState().setMenuTitle;
|
|
25722
25749
|
switch (true) {
|
|
25723
25750
|
case bridgeStep === "sender-selector":
|
|
@@ -25911,7 +25938,7 @@ var init_ResolveChainIcon = __esm({
|
|
|
25911
25938
|
// src/internal/components/SendMenu/hyperbridge/hooks/useBridgeBalance.ts
|
|
25912
25939
|
import { CHAINS_BROWSERS_TRANSPORTS as CHAINS_BROWSERS_TRANSPORTS2 } from "@embarkai/core";
|
|
25913
25940
|
import { useQuery as useQuery25, useQueryClient as useQueryClient26 } from "@tanstack/react-query";
|
|
25914
|
-
import { useCallback as useCallback29, useEffect as
|
|
25941
|
+
import { useCallback as useCallback29, useEffect as useEffect46 } from "react";
|
|
25915
25942
|
import { createPublicClient as createPublicClient2, erc20Abi as erc20Abi3, formatUnits as formatUnits9, http as http3 } from "viem";
|
|
25916
25943
|
import { useSwitchChain as useSwitchChain3 } from "wagmi";
|
|
25917
25944
|
function useBridgeBalance(isLoadingWarpRoutes, hyperlaneWarpRoutes) {
|
|
@@ -26017,7 +26044,7 @@ function useBridgeBalance(isLoadingWarpRoutes, hyperlaneWarpRoutes) {
|
|
|
26017
26044
|
},
|
|
26018
26045
|
[refreshBalances, qc]
|
|
26019
26046
|
);
|
|
26020
|
-
|
|
26047
|
+
useEffect46(() => {
|
|
26021
26048
|
if (!!isLoadingWarpRoutes || !bridgeSender || !originChain) return;
|
|
26022
26049
|
switch (bridgeSender) {
|
|
26023
26050
|
case "embarkai-wallet":
|
|
@@ -26980,7 +27007,7 @@ var init_steps = __esm({
|
|
|
26980
27007
|
});
|
|
26981
27008
|
|
|
26982
27009
|
// src/internal/components/SendMenu/hyperbridge/HyperlaneBridge.tsx
|
|
26983
|
-
import { useEffect as
|
|
27010
|
+
import { useEffect as useEffect47 } from "react";
|
|
26984
27011
|
import { jsx as jsx117, jsxs as jsxs106 } from "react/jsx-runtime";
|
|
26985
27012
|
function HyperlaneBridge() {
|
|
26986
27013
|
const bridgeStep = useBridgeStore((st) => st.bridgeStep);
|
|
@@ -26988,7 +27015,7 @@ function HyperlaneBridge() {
|
|
|
26988
27015
|
const { hyperlaneWarpRoutes, isLoadingWarpRoutes } = useHyperlaneRoutes();
|
|
26989
27016
|
const { directWalletProfiles } = useAvailableSenders();
|
|
26990
27017
|
useMenuTitle(hyperlaneWarpRoutes);
|
|
26991
|
-
|
|
27018
|
+
useEffect47(() => {
|
|
26992
27019
|
return () => {
|
|
26993
27020
|
useBridgeStore.getState().resetSelections();
|
|
26994
27021
|
};
|
|
@@ -27143,7 +27170,7 @@ var init_useErc3643Compliance = __esm({
|
|
|
27143
27170
|
|
|
27144
27171
|
// src/hooks/useNicknameResolve.ts
|
|
27145
27172
|
import { useQuery as useQuery26 } from "@tanstack/react-query";
|
|
27146
|
-
import { useEffect as
|
|
27173
|
+
import { useEffect as useEffect48, useMemo as useMemo18, useState as useState29 } from "react";
|
|
27147
27174
|
function looksLikeNickname(input) {
|
|
27148
27175
|
if (!input) return false;
|
|
27149
27176
|
if (input.startsWith("0x")) return false;
|
|
@@ -27157,7 +27184,7 @@ function useNicknameResolve(input, options) {
|
|
|
27157
27184
|
const [isDebouncing, setIsDebouncing] = useState29(false);
|
|
27158
27185
|
const normalized = normalizeNickname(input);
|
|
27159
27186
|
const isNicknameInput = looksLikeNickname(input) && normalized.length >= 3;
|
|
27160
|
-
|
|
27187
|
+
useEffect48(() => {
|
|
27161
27188
|
if (!isNicknameInput || !enabled) {
|
|
27162
27189
|
setDebouncedInput("");
|
|
27163
27190
|
setIsDebouncing(false);
|
|
@@ -27625,7 +27652,7 @@ var init_AssetList = __esm({
|
|
|
27625
27652
|
|
|
27626
27653
|
// src/internal/components/SendMenu/send/components/NicknameData.tsx
|
|
27627
27654
|
import { AtSign, CheckCircle2 as CheckCircle25, ShieldAlert, ShieldCheck as ShieldCheck2 } from "lucide-react";
|
|
27628
|
-
import { useEffect as
|
|
27655
|
+
import { useEffect as useEffect49 } from "react";
|
|
27629
27656
|
import { jsx as jsx122, jsxs as jsxs110 } from "react/jsx-runtime";
|
|
27630
27657
|
function NicknameData(props) {
|
|
27631
27658
|
const { resolvedNicknameData, isNicknameInput } = props;
|
|
@@ -27638,7 +27665,7 @@ function NicknameData(props) {
|
|
|
27638
27665
|
isWalletNotSetup,
|
|
27639
27666
|
isFrozen
|
|
27640
27667
|
} = resolvedNicknameData;
|
|
27641
|
-
|
|
27668
|
+
useEffect49(() => {
|
|
27642
27669
|
if (isResolving) return;
|
|
27643
27670
|
let errMessage = null;
|
|
27644
27671
|
switch (true) {
|
|
@@ -28207,7 +28234,7 @@ var init_sendSteps = __esm({
|
|
|
28207
28234
|
|
|
28208
28235
|
// src/internal/components/SendMenu/send/SendMenu.tsx
|
|
28209
28236
|
import { CheckCircle2 as CheckCircle27, Loader as Loader28 } from "lucide-react";
|
|
28210
|
-
import { useEffect as
|
|
28237
|
+
import { useEffect as useEffect50, useMemo as useMemo19 } from "react";
|
|
28211
28238
|
import { parseUnits as parseUnits2 } from "viem";
|
|
28212
28239
|
import { Fragment as Fragment44, jsx as jsx125, jsxs as jsxs113 } from "react/jsx-runtime";
|
|
28213
28240
|
function SendMenu() {
|
|
@@ -28228,16 +28255,16 @@ function SendMenu() {
|
|
|
28228
28255
|
userOpHash,
|
|
28229
28256
|
reset
|
|
28230
28257
|
} = useSendTransaction();
|
|
28231
|
-
|
|
28258
|
+
useEffect50(() => {
|
|
28232
28259
|
useFlowSelectorStore.getState().setIsUiLocked(isAssetsLoading || isTransactionPending);
|
|
28233
28260
|
}, [isAssetsLoading, isTransactionPending]);
|
|
28234
|
-
|
|
28261
|
+
useEffect50(() => {
|
|
28235
28262
|
useFlowSelectorStore.getState().setError(sendTransactionError || null);
|
|
28236
28263
|
}, [sendTransactionError]);
|
|
28237
28264
|
const { txStep, recipient, amount, selectedAsset, setSelectedAsset } = useSendStore();
|
|
28238
28265
|
const isNft = isNftAsset3(selectedAsset);
|
|
28239
28266
|
const isSecurity = isSecurityToken2(selectedAsset);
|
|
28240
|
-
|
|
28267
|
+
useEffect50(() => {
|
|
28241
28268
|
const shouldDefaultAsset = assets.length > 0 && !selectedAsset;
|
|
28242
28269
|
if (!shouldDefaultAsset) return;
|
|
28243
28270
|
const chainNativeCurrency = useSession.getState().chainConfig?.nativeCurrency;
|
|
@@ -28247,7 +28274,7 @@ function SendMenu() {
|
|
|
28247
28274
|
if (isBalance(erc20)) return setSelectedAsset(erc20);
|
|
28248
28275
|
setSelectedAsset(assets[0]);
|
|
28249
28276
|
}, [assets, selectedAsset]);
|
|
28250
|
-
|
|
28277
|
+
useEffect50(
|
|
28251
28278
|
() => () => {
|
|
28252
28279
|
useSendStore.getState().reset();
|
|
28253
28280
|
reset();
|
|
@@ -28272,7 +28299,7 @@ function SendMenu() {
|
|
|
28272
28299
|
enabled: isSecurity && !!effectiveAddress && !!complianceAmount,
|
|
28273
28300
|
chainId: activeChainId
|
|
28274
28301
|
});
|
|
28275
|
-
|
|
28302
|
+
useEffect50(() => {
|
|
28276
28303
|
const updateMenuTitle = useFlowSelectorStore.getState().setMenuTitle;
|
|
28277
28304
|
switch (true) {
|
|
28278
28305
|
case txStep === "select-asset":
|
|
@@ -28371,10 +28398,10 @@ var init_send = __esm({
|
|
|
28371
28398
|
|
|
28372
28399
|
// src/internal/components/SendMenu/useSendMenuParams.ts
|
|
28373
28400
|
import { keys as keys5 } from "lodash-es";
|
|
28374
|
-
import { useEffect as
|
|
28401
|
+
import { useEffect as useEffect51 } from "react";
|
|
28375
28402
|
function useSendMenuParams() {
|
|
28376
28403
|
const { config } = useProviderConfig();
|
|
28377
|
-
|
|
28404
|
+
useEffect51(() => {
|
|
28378
28405
|
const { pageParams, setPageParams } = useLayoutDataStore.getState();
|
|
28379
28406
|
if (!pageParams || !keys5(pageParams).length) return;
|
|
28380
28407
|
const { sendFlow, send, bridge } = pageParams || {};
|
|
@@ -28439,7 +28466,7 @@ var init_useSendMenuParams = __esm({
|
|
|
28439
28466
|
|
|
28440
28467
|
// src/internal/components/SendMenu/SendFlowSelector.tsx
|
|
28441
28468
|
import { ArrowLeft as ArrowLeft21, ArrowRightIcon as ArrowRightIcon2, ArrowRightLeftIcon as ArrowRightLeftIcon3 } from "lucide-react";
|
|
28442
|
-
import { useEffect as
|
|
28469
|
+
import { useEffect as useEffect52, useMemo as useMemo20 } from "react";
|
|
28443
28470
|
import { jsx as jsx126, jsxs as jsxs114 } from "react/jsx-runtime";
|
|
28444
28471
|
function SelectorFlowButtons() {
|
|
28445
28472
|
const { t } = useT();
|
|
@@ -28500,13 +28527,13 @@ function SendFlowSelector() {
|
|
|
28500
28527
|
const sendStep = useSendStore((st) => st.txStep);
|
|
28501
28528
|
const bridgeStep = useBridgeStore((st) => st.bridgeStep);
|
|
28502
28529
|
useOnboardingTourAvailable(sendStep === "input" && bridgeStep === "select");
|
|
28503
|
-
|
|
28530
|
+
useEffect52(
|
|
28504
28531
|
() => () => {
|
|
28505
28532
|
useFlowSelectorStore.getState().setError(null);
|
|
28506
28533
|
},
|
|
28507
28534
|
[]
|
|
28508
28535
|
);
|
|
28509
|
-
|
|
28536
|
+
useEffect52(() => {
|
|
28510
28537
|
if (!!config?.current?.features?.showAssetBridge) return;
|
|
28511
28538
|
if (selectorFlow === "bridge") useFlowSelectorStore.getState().setFlow("send");
|
|
28512
28539
|
}, [selectorFlow]);
|
|
@@ -29851,7 +29878,7 @@ var init_PageMap = __esm({
|
|
|
29851
29878
|
});
|
|
29852
29879
|
|
|
29853
29880
|
// src/internal/hooks/usePageMapper.tsx
|
|
29854
|
-
import { useCallback as useCallback32, useEffect as
|
|
29881
|
+
import { useCallback as useCallback32, useEffect as useEffect53 } from "react";
|
|
29855
29882
|
import { jsx as jsx130 } from "react/jsx-runtime";
|
|
29856
29883
|
function usePageMapper() {
|
|
29857
29884
|
const page = useLayoutDataStore((st) => st.page);
|
|
@@ -29874,7 +29901,7 @@ function usePageMapper() {
|
|
|
29874
29901
|
// isDialogAnimating: true
|
|
29875
29902
|
});
|
|
29876
29903
|
}, []);
|
|
29877
|
-
|
|
29904
|
+
useEffect53(() => {
|
|
29878
29905
|
if (page === null) return closeDialog();
|
|
29879
29906
|
const pageItem = PAGE_MAP[page];
|
|
29880
29907
|
if (!pageItem) {
|
|
@@ -29897,20 +29924,20 @@ var init_usePageMapper = __esm({
|
|
|
29897
29924
|
});
|
|
29898
29925
|
|
|
29899
29926
|
// src/internal/hooks/useSettingsNotifications.ts
|
|
29900
|
-
import { useEffect as
|
|
29927
|
+
import { useEffect as useEffect54 } from "react";
|
|
29901
29928
|
function useSettingsNotifications() {
|
|
29902
29929
|
const setSettingsNotifications = useLayoutDataStore((st) => st.setSettingsNotifications);
|
|
29903
29930
|
const providers = jwtTokenManager2.getProviders();
|
|
29904
29931
|
const hasEmail = providers.includes("email");
|
|
29905
29932
|
const { data: userProfile = null } = useUserProfile();
|
|
29906
|
-
|
|
29933
|
+
useEffect54(() => {
|
|
29907
29934
|
const isKYCVerified = userProfile?.kycDetails?.kycStatus === "verified";
|
|
29908
29935
|
setSettingsNotifications({
|
|
29909
29936
|
...COMPLETE_KYC_PROGRESS,
|
|
29910
29937
|
status: isKYCVerified ? "resolved" : "active"
|
|
29911
29938
|
});
|
|
29912
29939
|
}, [userProfile, setSettingsNotifications]);
|
|
29913
|
-
|
|
29940
|
+
useEffect54(() => {
|
|
29914
29941
|
setSettingsNotifications({
|
|
29915
29942
|
...EMAIL_NOT_CONNECTED_NOTIFICATION,
|
|
29916
29943
|
status: hasEmail ? "resolved" : "active"
|
|
@@ -29942,7 +29969,7 @@ var init_package = __esm({
|
|
|
29942
29969
|
"package.json"() {
|
|
29943
29970
|
package_default = {
|
|
29944
29971
|
name: "@embarkai/ui-kit",
|
|
29945
|
-
version: "0.4.
|
|
29972
|
+
version: "0.4.110",
|
|
29946
29973
|
description: "React UI components and hooks for EmbarkAI authentication and Account Abstraction",
|
|
29947
29974
|
type: "module",
|
|
29948
29975
|
main: "./dist/index.cjs",
|
|
@@ -30603,7 +30630,7 @@ var init_visually_hidden = __esm({
|
|
|
30603
30630
|
|
|
30604
30631
|
// src/internal/components/Dialog/Dialog.tsx
|
|
30605
30632
|
import { AnimatePresence, motion } from "motion/react";
|
|
30606
|
-
import { useEffect as
|
|
30633
|
+
import { useEffect as useEffect55 } from "react";
|
|
30607
30634
|
import { jsx as jsx135, jsxs as jsxs121 } from "react/jsx-runtime";
|
|
30608
30635
|
function Dialog2() {
|
|
30609
30636
|
const config = useProviderConfig().config;
|
|
@@ -30613,13 +30640,14 @@ function Dialog2() {
|
|
|
30613
30640
|
const { colorMode, maxScrollHeight, isDialogOpen, dialogContent, isDialogForced } = useLayoutStore();
|
|
30614
30641
|
const page = useLayoutDataStore((st) => st.page);
|
|
30615
30642
|
const transitionPageHeight = useLayoutDataStore((st) => st.transitionPageHeight);
|
|
30616
|
-
|
|
30643
|
+
useEffect55(() => useLayoutStore.setState({ isSettings: !!session }), [session]);
|
|
30617
30644
|
usePageMapper();
|
|
30618
30645
|
useAutoConnect();
|
|
30619
30646
|
useBackupStatusChanges();
|
|
30620
30647
|
useDetectMaxScrollHeight();
|
|
30621
30648
|
useSettingsNotifications();
|
|
30622
30649
|
useListenIframeAuthEvents();
|
|
30650
|
+
useAllowExternalModalsScroll(isDialogOpen);
|
|
30623
30651
|
const isHeaderHidden = !session || page === "keysare-backup" /* KEYSARE_BACKUP */ && !hasServerVault;
|
|
30624
30652
|
return /* @__PURE__ */ jsx135(
|
|
30625
30653
|
Dialog,
|
|
@@ -30678,6 +30706,7 @@ var init_Dialog = __esm({
|
|
|
30678
30706
|
init_ProviderContext();
|
|
30679
30707
|
init_SessionContext();
|
|
30680
30708
|
init_constants();
|
|
30709
|
+
init_useAllowExternalModalsScroll();
|
|
30681
30710
|
init_useAutoConnect();
|
|
30682
30711
|
init_useBackupStatusChanges();
|
|
30683
30712
|
init_useDetectMaxScrollHeight();
|
|
@@ -30702,19 +30731,19 @@ var init_Dialog2 = __esm({
|
|
|
30702
30731
|
});
|
|
30703
30732
|
|
|
30704
30733
|
// src/internal/components/DirectWalletHandler.tsx
|
|
30705
|
-
import { useEffect as
|
|
30734
|
+
import { useEffect as useEffect56 } from "react";
|
|
30706
30735
|
import { useConnection } from "wagmi";
|
|
30707
30736
|
function DirectWalletHandler() {
|
|
30708
30737
|
const walletMode = useProviderConfig().config.current?.wallet?.mode || "both";
|
|
30709
30738
|
const externalAddress = useExternalWalletStore((st) => st.externalAddress);
|
|
30710
30739
|
const isExternalConnected = useExternalWalletStore((st) => st.isExternalConnected);
|
|
30711
30740
|
const { address, isConnected, chain, connector } = useConnection();
|
|
30712
|
-
|
|
30741
|
+
useEffect56(() => {
|
|
30713
30742
|
const { setConfigMode, setActiveMode } = useExternalWalletStore.getState();
|
|
30714
30743
|
setConfigMode(walletMode);
|
|
30715
30744
|
if (walletMode !== "both") setActiveMode(walletMode);
|
|
30716
30745
|
}, [walletMode]);
|
|
30717
|
-
|
|
30746
|
+
useEffect56(() => {
|
|
30718
30747
|
if ((!!externalAddress || isExternalConnected) && !isConnected) {
|
|
30719
30748
|
useExternalWalletStore.getState().clearExternalWallet();
|
|
30720
30749
|
return;
|
|
@@ -33298,7 +33327,7 @@ import {
|
|
|
33298
33327
|
createContext,
|
|
33299
33328
|
useCallback as useCallback35,
|
|
33300
33329
|
useContext,
|
|
33301
|
-
useEffect as
|
|
33330
|
+
useEffect as useEffect57,
|
|
33302
33331
|
useMemo as useMemo21,
|
|
33303
33332
|
useRef as useRef22
|
|
33304
33333
|
} from "react";
|
|
@@ -33322,7 +33351,7 @@ function clearLegacyWagmiStorage() {
|
|
|
33322
33351
|
function Provider(props) {
|
|
33323
33352
|
const { children, projectId, initialConfig = {}, callbacks } = props;
|
|
33324
33353
|
const callbacksRef = useRef22(callbacks);
|
|
33325
|
-
|
|
33354
|
+
useEffect57(() => notifyNoProjetctId(projectId), [projectId]);
|
|
33326
33355
|
const config = useRef22(merge3({}, DEFAULT_PROVIDER_CONFIG, { projectId }, initialConfig));
|
|
33327
33356
|
const wagmiConfig3 = useRef22(getWagmiConfig(config.current?.wallet?.walletConnectId || null));
|
|
33328
33357
|
const updateConfig = useCallback35((updates) => {
|
|
@@ -33364,7 +33393,7 @@ function Provider(props) {
|
|
|
33364
33393
|
const next = updates ? { ...prev, ...updates } : void 0;
|
|
33365
33394
|
callbacksRef.current = next;
|
|
33366
33395
|
}, []);
|
|
33367
|
-
|
|
33396
|
+
useEffect57(() => {
|
|
33368
33397
|
if (typeof window === "undefined" || !projectId) return;
|
|
33369
33398
|
const mergedConfig = merge3(DEFAULT_PROVIDER_CONFIG, initialConfig);
|
|
33370
33399
|
updateConfig(mergedConfig);
|
|
@@ -33384,7 +33413,7 @@ function Provider(props) {
|
|
|
33384
33413
|
useSession.getState().setActiveChainId(mergedConfig.network.chainId);
|
|
33385
33414
|
}
|
|
33386
33415
|
}, [projectId, initialConfig]);
|
|
33387
|
-
|
|
33416
|
+
useEffect57(() => {
|
|
33388
33417
|
if (typeof window === "undefined" || !projectId) return;
|
|
33389
33418
|
try {
|
|
33390
33419
|
initSdkErrorTracking();
|
|
@@ -33464,7 +33493,7 @@ init_useUserProfile();
|
|
|
33464
33493
|
init_pro_mode();
|
|
33465
33494
|
init_utils();
|
|
33466
33495
|
import { Cloud as Cloud4, Laptop as Laptop2, Loader as Loader32, Shield as Shield2 } from "lucide-react";
|
|
33467
|
-
import { useEffect as
|
|
33496
|
+
import { useEffect as useEffect58, useMemo as useMemo22 } from "react";
|
|
33468
33497
|
import { Fragment as Fragment48, jsx as jsx138, jsxs as jsxs123 } from "react/jsx-runtime";
|
|
33469
33498
|
function getFormattedStatus(label, status, showStatus) {
|
|
33470
33499
|
const isStatus = showStatus && status && status !== "idle" && status !== "ready";
|
|
@@ -33484,7 +33513,7 @@ function ConnectWalletButton(props) {
|
|
|
33484
33513
|
const colorMode = useLayoutStore((st) => st.colorMode);
|
|
33485
33514
|
const { session, address, hasServerVault, isLoading, isIframeReady, status, setUsePaymaster } = useSession();
|
|
33486
33515
|
const connectButtonLabel = getFormattedStatus(label || "Connect", status, isIframeReady);
|
|
33487
|
-
|
|
33516
|
+
useEffect58(() => setUsePaymaster(usePaymaster), [setUsePaymaster, usePaymaster]);
|
|
33488
33517
|
const { data: profile, isLoading: isProfileLoading } = useUserProfile();
|
|
33489
33518
|
const displayName = profile?.nicknameDisplay || profile?.displayName || jwtTokenManager2.getDisplayName();
|
|
33490
33519
|
const indicators = useMemo22(() => {
|
|
@@ -34130,13 +34159,13 @@ var Hash = ({
|
|
|
34130
34159
|
|
|
34131
34160
|
// src/internal/components/TransactionsMenu/TransactionsList.tsx
|
|
34132
34161
|
init_base3();
|
|
34133
|
-
import { useEffect as
|
|
34162
|
+
import { useEffect as useEffect60, useState as useState37 } from "react";
|
|
34134
34163
|
import { jsx as jsx144, jsxs as jsxs127 } from "react/jsx-runtime";
|
|
34135
34164
|
var TransactionsList = ({ address, itemsCount = 10 }) => {
|
|
34136
34165
|
const [transactions, setTransactions] = useState37([]);
|
|
34137
34166
|
const [loading, setLoading] = useState37(true);
|
|
34138
34167
|
const [error, setError] = useState37(null);
|
|
34139
|
-
|
|
34168
|
+
useEffect60(() => {
|
|
34140
34169
|
const fetchTransactions2 = async () => {
|
|
34141
34170
|
try {
|
|
34142
34171
|
setLoading(true);
|