@embarkai/ui-kit 0.4.116 → 0.4.118
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/kyc/sumsub.js +3 -2
- package/dist/iframe/main.js +1 -1
- package/dist/index.cjs +256 -159
- package/dist/index.d.cts +18 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.js +167 -70
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -7396,6 +7396,7 @@ var init_useExpandable = __esm({
|
|
|
7396
7396
|
const resizeObs = new ResizeObserver(() => setExpandableHeight(minHeight, isExpanded));
|
|
7397
7397
|
const domMutationObs = new MutationObserver(() => setExpandableHeight(minHeight, isExpanded));
|
|
7398
7398
|
resizeObs.observe(expandableRef.current);
|
|
7399
|
+
resizeObs.observe(contentRef.current);
|
|
7399
7400
|
domMutationObs.observe(expandableRef.current, { childList: true, subtree: true });
|
|
7400
7401
|
return () => {
|
|
7401
7402
|
resizeObs.disconnect();
|
|
@@ -7813,7 +7814,13 @@ var init_en = __esm({
|
|
|
7813
7814
|
}
|
|
7814
7815
|
},
|
|
7815
7816
|
kycMenu: {
|
|
7816
|
-
title: "KYC"
|
|
7817
|
+
title: "KYC",
|
|
7818
|
+
preparing: "Preparing verification...",
|
|
7819
|
+
authenticating: "Authenticating...",
|
|
7820
|
+
loadingForm: "Loading verification form...",
|
|
7821
|
+
loading: "Loading KYC verification...",
|
|
7822
|
+
comingSoon: "KYC verification coming soon\u2026",
|
|
7823
|
+
providerComingSoon: "KYC provider coming soon"
|
|
7817
7824
|
},
|
|
7818
7825
|
nicknameMenu: {
|
|
7819
7826
|
title: "Nickname",
|
|
@@ -8407,7 +8414,13 @@ var init_ru = __esm({
|
|
|
8407
8414
|
}
|
|
8408
8415
|
},
|
|
8409
8416
|
kycMenu: {
|
|
8410
|
-
title: "KYC"
|
|
8417
|
+
title: "KYC",
|
|
8418
|
+
preparing: "\u041F\u043E\u0434\u0433\u043E\u0442\u043E\u0432\u043A\u0430 \u0432\u0435\u0440\u0438\u0444\u0438\u043A\u0430\u0446\u0438\u0438...",
|
|
8419
|
+
authenticating: "\u0410\u0432\u0442\u043E\u0440\u0438\u0437\u0430\u0446\u0438\u044F...",
|
|
8420
|
+
loadingForm: "\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430 \u0444\u043E\u0440\u043C\u044B \u0432\u0435\u0440\u0438\u0444\u0438\u043A\u0430\u0446\u0438\u0438...",
|
|
8421
|
+
loading: "\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430 KYC-\u0432\u0435\u0440\u0438\u0444\u0438\u043A\u0430\u0446\u0438\u0438...",
|
|
8422
|
+
comingSoon: "KYC-\u0432\u0435\u0440\u0438\u0444\u0438\u043A\u0430\u0446\u0438\u044F \u0441\u043A\u043E\u0440\u043E \u043F\u043E\u044F\u0432\u0438\u0442\u0441\u044F\u2026",
|
|
8423
|
+
providerComingSoon: "KYC-\u043F\u0440\u043E\u0432\u0430\u0439\u0434\u0435\u0440 \u0441\u043A\u043E\u0440\u043E \u043F\u043E\u044F\u0432\u0438\u0442\u0441\u044F"
|
|
8411
8424
|
},
|
|
8412
8425
|
nicknameMenu: {
|
|
8413
8426
|
title: "\u041D\u0438\u043A\u043D\u0435\u0439\u043C",
|
|
@@ -9001,7 +9014,13 @@ var init_zh = __esm({
|
|
|
9001
9014
|
}
|
|
9002
9015
|
},
|
|
9003
9016
|
kycMenu: {
|
|
9004
|
-
title: "KYC"
|
|
9017
|
+
title: "KYC",
|
|
9018
|
+
preparing: "\u6B63\u5728\u51C6\u5907\u9A8C\u8BC1...",
|
|
9019
|
+
authenticating: "\u6B63\u5728\u8BA4\u8BC1...",
|
|
9020
|
+
loadingForm: "\u6B63\u5728\u52A0\u8F7D\u9A8C\u8BC1\u8868\u5355...",
|
|
9021
|
+
loading: "\u6B63\u5728\u52A0\u8F7D KYC \u9A8C\u8BC1...",
|
|
9022
|
+
comingSoon: "KYC \u9A8C\u8BC1\u5373\u5C06\u63A8\u51FA\u2026",
|
|
9023
|
+
providerComingSoon: "KYC \u63D0\u4F9B\u5546\u5373\u5C06\u63A8\u51FA"
|
|
9005
9024
|
},
|
|
9006
9025
|
nicknameMenu: {
|
|
9007
9026
|
title: "\u6635\u79F0",
|
|
@@ -17448,6 +17467,63 @@ var init_useHasInjectedWallet = __esm({
|
|
|
17448
17467
|
}
|
|
17449
17468
|
});
|
|
17450
17469
|
|
|
17470
|
+
// src/internal/components/ConnectExternalWalletMenu/walletProviders.ts
|
|
17471
|
+
function isConnectorAllowedByProject(connector, walletProviders) {
|
|
17472
|
+
if (!walletProviders) return true;
|
|
17473
|
+
const connectorId = connector.id.toLowerCase();
|
|
17474
|
+
return walletProviders.some((provider) => {
|
|
17475
|
+
const id = provider.toLowerCase();
|
|
17476
|
+
if (id === OTHER_BROWSER_WALLETS) return !KNOWN_CONNECTOR_IDS.has(connectorId);
|
|
17477
|
+
return PROVIDER_CONNECTOR_IDS[id]?.includes(connectorId) ?? false;
|
|
17478
|
+
});
|
|
17479
|
+
}
|
|
17480
|
+
function parseWalletProviders(metadata) {
|
|
17481
|
+
const value = metadata?.walletProviders;
|
|
17482
|
+
return Array.isArray(value) ? value.filter((item) => typeof item === "string") : null;
|
|
17483
|
+
}
|
|
17484
|
+
var PROVIDER_CONNECTOR_IDS, OTHER_BROWSER_WALLETS, KNOWN_CONNECTOR_IDS;
|
|
17485
|
+
var init_walletProviders = __esm({
|
|
17486
|
+
"src/internal/components/ConnectExternalWalletMenu/walletProviders.ts"() {
|
|
17487
|
+
PROVIDER_CONNECTOR_IDS = {
|
|
17488
|
+
metamask: ["metamasksdk", "metamask", "io.metamask", "io.metamask.flask", "io.metamask.mobile"],
|
|
17489
|
+
walletconnect: ["walletconnect"],
|
|
17490
|
+
coinbase: ["coinbasewalletsdk", "coinbasewallet", "com.coinbase.wallet"],
|
|
17491
|
+
phantom: ["app.phantom"],
|
|
17492
|
+
trust: ["com.trustwallet.app"],
|
|
17493
|
+
rabby: ["io.rabby"]
|
|
17494
|
+
};
|
|
17495
|
+
OTHER_BROWSER_WALLETS = "injected";
|
|
17496
|
+
KNOWN_CONNECTOR_IDS = new Set(Object.values(PROVIDER_CONNECTOR_IDS).flat());
|
|
17497
|
+
}
|
|
17498
|
+
});
|
|
17499
|
+
|
|
17500
|
+
// src/internal/components/ConnectExternalWalletMenu/useProjectWalletProviders.ts
|
|
17501
|
+
async function fetchProjectWalletProviders(projectId) {
|
|
17502
|
+
const dashboardUrl = (getServiceUrls().dashboardUrl || DEFAULT_DASHBOARD_URL).replace(/\/+$/, "");
|
|
17503
|
+
const response = await fetch(`${dashboardUrl}/api/public/project/${encodeURIComponent(projectId)}/metadata`);
|
|
17504
|
+
if (!response.ok) throw new Error(`Project metadata request failed with status ${response.status}`);
|
|
17505
|
+
return parseWalletProviders(await response.json());
|
|
17506
|
+
}
|
|
17507
|
+
function useProjectWalletProviders(projectId) {
|
|
17508
|
+
const query = (0, import_react_query25.useQuery)({
|
|
17509
|
+
queryKey: ["embarkai", "project-wallet-providers", projectId],
|
|
17510
|
+
queryFn: () => fetchProjectWalletProviders(projectId),
|
|
17511
|
+
enabled: !!projectId,
|
|
17512
|
+
staleTime: 6e4,
|
|
17513
|
+
retry: 1
|
|
17514
|
+
});
|
|
17515
|
+
return { walletProviders: query.data ?? null, isLoading: query.isLoading };
|
|
17516
|
+
}
|
|
17517
|
+
var import_react_query25, DEFAULT_DASHBOARD_URL;
|
|
17518
|
+
var init_useProjectWalletProviders = __esm({
|
|
17519
|
+
"src/internal/components/ConnectExternalWalletMenu/useProjectWalletProviders.ts"() {
|
|
17520
|
+
init_initial();
|
|
17521
|
+
import_react_query25 = require("@tanstack/react-query");
|
|
17522
|
+
init_walletProviders();
|
|
17523
|
+
DEFAULT_DASHBOARD_URL = "https://dashboard.embarkai.io";
|
|
17524
|
+
}
|
|
17525
|
+
});
|
|
17526
|
+
|
|
17451
17527
|
// src/internal/components/ConnectExternalWalletMenu/ConnectExternalWalletMenu.tsx
|
|
17452
17528
|
function getConnectFlowType(params) {
|
|
17453
17529
|
const { isEmbarkAI, connectFlow } = params;
|
|
@@ -17458,13 +17534,14 @@ function ConnectExternalWalletMenu() {
|
|
|
17458
17534
|
const { config, callbacksRef } = useProviderConfig();
|
|
17459
17535
|
const allowedWallets = config.current?.wallet?.allowedWallets;
|
|
17460
17536
|
const walletMode = config.current?.wallet?.mode || "both";
|
|
17461
|
-
const qc = (0,
|
|
17537
|
+
const qc = (0, import_react_query26.useQueryClient)();
|
|
17462
17538
|
const { t } = useT();
|
|
17463
17539
|
const embarkAiAddress = useSession((st) => st.address);
|
|
17464
17540
|
const { close: closeEmbarkAI } = useOpenPage();
|
|
17465
17541
|
const menuParams = useConnectExternalWalletMenuParams();
|
|
17466
17542
|
const connectors = (0, import_wagmi3.useConnectors)();
|
|
17467
17543
|
const hasInjectedWallet2 = useHasInjectedWallet();
|
|
17544
|
+
const { walletProviders, isLoading: isLoadingWalletProviders } = useProjectWalletProviders(config.current?.projectId);
|
|
17468
17545
|
const wagmiConfig3 = (0, import_wagmi3.useConfig)();
|
|
17469
17546
|
const chains = (0, import_wagmi3.useChains)();
|
|
17470
17547
|
const connections = (0, import_wagmi3.useConnections)();
|
|
@@ -17493,14 +17570,14 @@ function ConnectExternalWalletMenu() {
|
|
|
17493
17570
|
}
|
|
17494
17571
|
};
|
|
17495
17572
|
const walletMenuOpenedFrom = useLayoutDataStore((st) => st.walletMenuOpenedFrom);
|
|
17496
|
-
const { data: providers = [] } = (0,
|
|
17573
|
+
const { data: providers = [] } = (0, import_react_query26.useQuery)({
|
|
17497
17574
|
retry: false,
|
|
17498
17575
|
enabled: !!embarkAiAddress,
|
|
17499
17576
|
queryKey: [PROVIDERS_QUERY_KEY, embarkAiAddress],
|
|
17500
17577
|
queryFn: async () => getLinkedProviders()
|
|
17501
17578
|
});
|
|
17502
17579
|
const [connectError, setConnectError] = (0, import_react48.useState)(null);
|
|
17503
|
-
const { mutateAsync: onLinkingComplete } = (0,
|
|
17580
|
+
const { mutateAsync: onLinkingComplete } = (0, import_react_query26.useMutation)({
|
|
17504
17581
|
mutationFn: async (success) => {
|
|
17505
17582
|
useManageWalletStore.getState().setProviderType(null);
|
|
17506
17583
|
useLayoutDataStore.getState().setPage(walletMenuOpenedFrom || "manage-wallet" /* MANAGE_WALLET */);
|
|
@@ -17528,7 +17605,7 @@ function ConnectExternalWalletMenu() {
|
|
|
17528
17605
|
useLayoutDataStore.getState().setPage(walletMenuOpenedFrom || "manage-wallet" /* MANAGE_WALLET */);
|
|
17529
17606
|
keepOrReleaseExternalWallet(connector, address, chainId);
|
|
17530
17607
|
};
|
|
17531
|
-
const { mutateAsync: loginOrLinkWallet, isPending: isLoginOrLinkWallet } = (0,
|
|
17608
|
+
const { mutateAsync: loginOrLinkWallet, isPending: isLoginOrLinkWallet } = (0, import_react_query26.useMutation)({
|
|
17532
17609
|
mutationFn: async (payload) => {
|
|
17533
17610
|
const { walletData, connectFlowType } = payload;
|
|
17534
17611
|
switch (connectFlowType) {
|
|
@@ -17665,14 +17742,14 @@ function ConnectExternalWalletMenu() {
|
|
|
17665
17742
|
return false;
|
|
17666
17743
|
}
|
|
17667
17744
|
seen.add(connector.uid);
|
|
17668
|
-
return
|
|
17745
|
+
return isConnectorAllowedByProject(connector, walletProviders);
|
|
17669
17746
|
});
|
|
17670
17747
|
if (!allowedWallets?.length) return unique;
|
|
17671
17748
|
const allowed = allowedWallets.map((id) => id.toLowerCase());
|
|
17672
17749
|
return unique.filter(
|
|
17673
17750
|
(connector) => allowed.includes(connector.id.toLowerCase()) || allowed.includes(connector.name.toLowerCase())
|
|
17674
17751
|
);
|
|
17675
|
-
}, [connectors, allowedWallets, hasInjectedWallet2]);
|
|
17752
|
+
}, [connectors, allowedWallets, hasInjectedWallet2, walletProviders]);
|
|
17676
17753
|
const getInstructionSteps = (0, import_react48.useCallback)(() => {
|
|
17677
17754
|
const connectFlowType = getConnectFlowType({
|
|
17678
17755
|
isEmbarkAI: !!embarkAiAddress,
|
|
@@ -17701,7 +17778,8 @@ function ConnectExternalWalletMenu() {
|
|
|
17701
17778
|
),
|
|
17702
17779
|
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("span", { className: "text-xl font-semibold", children: t("passport:connectMenu.connectWallet") })
|
|
17703
17780
|
] }),
|
|
17704
|
-
|
|
17781
|
+
isLoadingWalletProviders && /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: "flex items-center justify-center py-[var(--ui-kit-gap)]", children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_lucide_react33.Loader, { className: "w-4 h-4 animate-spin" }) }),
|
|
17782
|
+
(isLoadingWalletProviders ? [] : visibleConnectors).map((connector) => {
|
|
17705
17783
|
const isConnectingThis = isConnectingExternalWallet && //@ts-expect-error uid exists
|
|
17706
17784
|
pendingConnectVariables?.connector?.uid === connector.uid;
|
|
17707
17785
|
const WalletIcon = WALLET_ICONS[connector.id] || import_lucide_react33.Wallet2Icon;
|
|
@@ -17759,7 +17837,7 @@ function ConnectExternalWalletMenu() {
|
|
|
17759
17837
|
steps: getInstructionSteps()
|
|
17760
17838
|
})
|
|
17761
17839
|
}),
|
|
17762
|
-
visibleConnectors.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Highlight, { type: "info", children: t("passport:connectMenu.noWallets") }),
|
|
17840
|
+
!isLoadingWalletProviders && visibleConnectors.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Highlight, { type: "info", children: t("passport:connectMenu.noWallets") }),
|
|
17763
17841
|
connectError && /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(Highlight, { type: "error", className: "flex flex-col gap-[var(--ui-kit-gap)]", children: [
|
|
17764
17842
|
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("p", { children: connectError }),
|
|
17765
17843
|
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
@@ -17781,7 +17859,7 @@ function ConnectExternalWalletMenu() {
|
|
|
17781
17859
|
] })
|
|
17782
17860
|
] });
|
|
17783
17861
|
}
|
|
17784
|
-
var
|
|
17862
|
+
var import_react_query26, import_lucide_react33, import_react48, import_wagmi3, import_chains, import_jsx_runtime74, SIGN_FALLBACK_CHAIN_ID;
|
|
17785
17863
|
var init_ConnectExternalWalletMenu = __esm({
|
|
17786
17864
|
"src/internal/components/ConnectExternalWalletMenu/ConnectExternalWalletMenu.tsx"() {
|
|
17787
17865
|
init_ProviderContext();
|
|
@@ -17792,7 +17870,7 @@ var init_ConnectExternalWalletMenu = __esm({
|
|
|
17792
17870
|
init_useSafeDisconnect();
|
|
17793
17871
|
init_connect_errors();
|
|
17794
17872
|
init_linkedProfiles();
|
|
17795
|
-
|
|
17873
|
+
import_react_query26 = require("@tanstack/react-query");
|
|
17796
17874
|
import_lucide_react33 = require("lucide-react");
|
|
17797
17875
|
import_react48 = require("react");
|
|
17798
17876
|
import_wagmi3 = require("wagmi");
|
|
@@ -17808,6 +17886,8 @@ var init_ConnectExternalWalletMenu = __esm({
|
|
|
17808
17886
|
init_highlight();
|
|
17809
17887
|
init_useConnectExternalWalletMenuParams();
|
|
17810
17888
|
init_useHasInjectedWallet();
|
|
17889
|
+
init_useProjectWalletProviders();
|
|
17890
|
+
init_walletProviders();
|
|
17811
17891
|
import_jsx_runtime74 = require("react/jsx-runtime");
|
|
17812
17892
|
SIGN_FALLBACK_CHAIN_ID = import_chains.mainnet.id;
|
|
17813
17893
|
}
|
|
@@ -17930,14 +18010,14 @@ async function unlinkDevice(deviceId) {
|
|
|
17930
18010
|
}
|
|
17931
18011
|
}
|
|
17932
18012
|
function useDevices() {
|
|
17933
|
-
return (0,
|
|
18013
|
+
return (0, import_react_query27.useQuery)({
|
|
17934
18014
|
queryKey: [DEVICES_QUERY_KEY],
|
|
17935
18015
|
queryFn: getDevices
|
|
17936
18016
|
});
|
|
17937
18017
|
}
|
|
17938
18018
|
function useLinkDevice() {
|
|
17939
|
-
const qc = (0,
|
|
17940
|
-
return (0,
|
|
18019
|
+
const qc = (0, import_react_query27.useQueryClient)();
|
|
18020
|
+
return (0, import_react_query27.useMutation)({
|
|
17941
18021
|
mutationFn: (code) => linkDevice(code),
|
|
17942
18022
|
onSuccess: () => {
|
|
17943
18023
|
qc.invalidateQueries({ queryKey: [DEVICES_QUERY_KEY] });
|
|
@@ -17945,18 +18025,18 @@ function useLinkDevice() {
|
|
|
17945
18025
|
});
|
|
17946
18026
|
}
|
|
17947
18027
|
function useUnlinkDevice() {
|
|
17948
|
-
const qc = (0,
|
|
17949
|
-
return (0,
|
|
18028
|
+
const qc = (0, import_react_query27.useQueryClient)();
|
|
18029
|
+
return (0, import_react_query27.useMutation)({
|
|
17950
18030
|
mutationFn: (deviceId) => unlinkDevice(deviceId),
|
|
17951
18031
|
onSuccess: () => {
|
|
17952
18032
|
qc.invalidateQueries({ queryKey: [DEVICES_QUERY_KEY] });
|
|
17953
18033
|
}
|
|
17954
18034
|
});
|
|
17955
18035
|
}
|
|
17956
|
-
var
|
|
18036
|
+
var import_react_query27, DEVICES_QUERY_KEY;
|
|
17957
18037
|
var init_devices = __esm({
|
|
17958
18038
|
"src/internal/clients/devices.ts"() {
|
|
17959
|
-
|
|
18039
|
+
import_react_query27 = require("@tanstack/react-query");
|
|
17960
18040
|
init_httpClient();
|
|
17961
18041
|
DEVICES_QUERY_KEY = "devices";
|
|
17962
18042
|
}
|
|
@@ -19518,7 +19598,7 @@ var init_cloudStorage = __esm({
|
|
|
19518
19598
|
|
|
19519
19599
|
// src/internal/components/KeyshareRestoreMenu/hooks/useCreateBackup.ts
|
|
19520
19600
|
function useCreateBackup() {
|
|
19521
|
-
const qc = (0,
|
|
19601
|
+
const qc = (0, import_react_query28.useQueryClient)();
|
|
19522
19602
|
const session = useSession((st) => st.session);
|
|
19523
19603
|
const address = useSession((st) => st.address);
|
|
19524
19604
|
const hasServerVault = useSession((st) => st.hasServerVault);
|
|
@@ -19549,7 +19629,7 @@ function useCreateBackup() {
|
|
|
19549
19629
|
if (openPostAuthNavigation()) return;
|
|
19550
19630
|
if (isNewUserFlow()) setPage(null);
|
|
19551
19631
|
}, []);
|
|
19552
|
-
const { mutate: createPasswordBackup, isPending: isPasswordBackupCreating } = (0,
|
|
19632
|
+
const { mutate: createPasswordBackup, isPending: isPasswordBackupCreating } = (0, import_react_query28.useMutation)({
|
|
19553
19633
|
mutationFn: async () => {
|
|
19554
19634
|
const iframeManager = getIframeManager();
|
|
19555
19635
|
if (!iframeManager) {
|
|
@@ -19594,7 +19674,7 @@ function useCreateBackup() {
|
|
|
19594
19674
|
qc.invalidateQueries({ queryKey: [CHECK_BACKUP_QUERY_KEY, address] });
|
|
19595
19675
|
}
|
|
19596
19676
|
});
|
|
19597
|
-
const { mutate: createLocalBackup, isPending: isLocalBackupCreating } = (0,
|
|
19677
|
+
const { mutate: createLocalBackup, isPending: isLocalBackupCreating } = (0, import_react_query28.useMutation)({
|
|
19598
19678
|
mutationFn: async () => {
|
|
19599
19679
|
const iframeManager = getIframeManager();
|
|
19600
19680
|
if (!usePasskey && !restorePassword) {
|
|
@@ -19628,7 +19708,7 @@ function useCreateBackup() {
|
|
|
19628
19708
|
qc.invalidateQueries({ queryKey: [CHECK_BACKUP_QUERY_KEY, address] });
|
|
19629
19709
|
}
|
|
19630
19710
|
});
|
|
19631
|
-
const { mutate: createPasskey, isPending: isPasskeyCreating } = (0,
|
|
19711
|
+
const { mutate: createPasskey, isPending: isPasskeyCreating } = (0, import_react_query28.useMutation)({
|
|
19632
19712
|
mutationFn: async () => {
|
|
19633
19713
|
useRestoreStore.getState().setIsCreatingPasskey(true);
|
|
19634
19714
|
const { linkPasskeyWithWebAuthn: linkPasskeyWithWebAuthn2 } = await Promise.resolve().then(() => (init_passkey2(), passkey_exports2));
|
|
@@ -19655,7 +19735,7 @@ function useCreateBackup() {
|
|
|
19655
19735
|
}
|
|
19656
19736
|
}
|
|
19657
19737
|
});
|
|
19658
|
-
const { mutate: createCloudBackup, isPending: isCloudBackupCreating } = (0,
|
|
19738
|
+
const { mutate: createCloudBackup, isPending: isCloudBackupCreating } = (0, import_react_query28.useMutation)({
|
|
19659
19739
|
mutationFn: async () => {
|
|
19660
19740
|
const iframeManager = getIframeManager();
|
|
19661
19741
|
const encryptedData = await iframeManager.encryptBackupData(passportUserId);
|
|
@@ -19706,11 +19786,11 @@ function useCreateBackup() {
|
|
|
19706
19786
|
createPasskey
|
|
19707
19787
|
};
|
|
19708
19788
|
}
|
|
19709
|
-
var
|
|
19789
|
+
var import_react_query28, import_react55;
|
|
19710
19790
|
var init_useCreateBackup = __esm({
|
|
19711
19791
|
"src/internal/components/KeyshareRestoreMenu/hooks/useCreateBackup.ts"() {
|
|
19712
19792
|
init_SessionContext();
|
|
19713
|
-
|
|
19793
|
+
import_react_query28 = require("@tanstack/react-query");
|
|
19714
19794
|
import_react55 = require("react");
|
|
19715
19795
|
init_auth();
|
|
19716
19796
|
init_useLayoutDataStore();
|
|
@@ -19736,7 +19816,7 @@ function useRestoreAccount() {
|
|
|
19736
19816
|
setRestoreFile
|
|
19737
19817
|
} = useRestoreStore();
|
|
19738
19818
|
const { onRestoreSuccess } = useOnRestoreSuccess();
|
|
19739
|
-
const { mutate: restoreFromServer2, isPending: isRestoringFromServer } = (0,
|
|
19819
|
+
const { mutate: restoreFromServer2, isPending: isRestoringFromServer } = (0, import_react_query29.useMutation)({
|
|
19740
19820
|
mutationFn: async () => {
|
|
19741
19821
|
setError(null);
|
|
19742
19822
|
setSuccess(null);
|
|
@@ -19775,7 +19855,7 @@ function useRestoreAccount() {
|
|
|
19775
19855
|
setError(errorMsg);
|
|
19776
19856
|
}
|
|
19777
19857
|
});
|
|
19778
|
-
const { mutate: restoreFromFile, isPending: isRestoringFromFile } = (0,
|
|
19858
|
+
const { mutate: restoreFromFile, isPending: isRestoringFromFile } = (0, import_react_query29.useMutation)({
|
|
19779
19859
|
mutationFn: async () => {
|
|
19780
19860
|
if (!restoreFile) {
|
|
19781
19861
|
throw new Error("Please select a backup file");
|
|
@@ -19809,7 +19889,7 @@ function useRestoreAccount() {
|
|
|
19809
19889
|
setError(errorMsg);
|
|
19810
19890
|
}
|
|
19811
19891
|
});
|
|
19812
|
-
const { mutate: restoreFromCloud, isPending: isRestoringFromCloud } = (0,
|
|
19892
|
+
const { mutate: restoreFromCloud, isPending: isRestoringFromCloud } = (0, import_react_query29.useMutation)({
|
|
19813
19893
|
mutationFn: async () => {
|
|
19814
19894
|
alert("Cloud restore not implemented yet");
|
|
19815
19895
|
return null;
|
|
@@ -19828,11 +19908,11 @@ function useRestoreAccount() {
|
|
|
19828
19908
|
isRestoringFromCloud
|
|
19829
19909
|
};
|
|
19830
19910
|
}
|
|
19831
|
-
var
|
|
19911
|
+
var import_react_query29;
|
|
19832
19912
|
var init_useRestoreAccount = __esm({
|
|
19833
19913
|
"src/internal/components/KeyshareRestoreMenu/hooks/useRestoreAccount.ts"() {
|
|
19834
19914
|
init_SessionContext();
|
|
19835
|
-
|
|
19915
|
+
import_react_query29 = require("@tanstack/react-query");
|
|
19836
19916
|
init_useOnRestoreSuccess();
|
|
19837
19917
|
init_useRestoreStore();
|
|
19838
19918
|
}
|
|
@@ -20448,7 +20528,7 @@ var init_File = __esm({
|
|
|
20448
20528
|
function Server(props) {
|
|
20449
20529
|
const { isLoading, mode = "restore", serverHandler, createPasskeyHandler } = props;
|
|
20450
20530
|
const address = useSession((st) => st.address);
|
|
20451
|
-
const qc = (0,
|
|
20531
|
+
const qc = (0, import_react_query30.useQueryClient)();
|
|
20452
20532
|
const { t } = useT();
|
|
20453
20533
|
const usePasskey = useRestoreStore((st) => st.usePasskey);
|
|
20454
20534
|
const setUsePasskey = useRestoreStore((st) => st.setUsePasskey);
|
|
@@ -20496,13 +20576,13 @@ function Server(props) {
|
|
|
20496
20576
|
)
|
|
20497
20577
|
] });
|
|
20498
20578
|
}
|
|
20499
|
-
var
|
|
20579
|
+
var import_react_query30, import_dayjs4, import_lucide_react42, import_react59, import_jsx_runtime83;
|
|
20500
20580
|
var init_Server = __esm({
|
|
20501
20581
|
"src/internal/components/KeyshareRestoreMenu/methods/Server.tsx"() {
|
|
20502
20582
|
init_SessionContext();
|
|
20503
20583
|
init_useT();
|
|
20504
20584
|
init_icons();
|
|
20505
|
-
|
|
20585
|
+
import_react_query30 = require("@tanstack/react-query");
|
|
20506
20586
|
import_dayjs4 = __toESM(require("dayjs"), 1);
|
|
20507
20587
|
import_lucide_react42 = require("lucide-react");
|
|
20508
20588
|
import_react59 = require("react");
|
|
@@ -20659,7 +20739,7 @@ function Cloud2(props) {
|
|
|
20659
20739
|
data: cloudProviders = [],
|
|
20660
20740
|
isLoading: isCloudProvidersLoading,
|
|
20661
20741
|
error: cloudProvidersError
|
|
20662
|
-
} = (0,
|
|
20742
|
+
} = (0, import_react_query31.useQuery)({
|
|
20663
20743
|
retry: false,
|
|
20664
20744
|
enabled: !!passportUserId,
|
|
20665
20745
|
queryKey: [AVAILABLE_CLOUD_PROVIDERS_QUERY_KEY, passportUserId],
|
|
@@ -20733,11 +20813,11 @@ function Cloud2(props) {
|
|
|
20733
20813
|
)
|
|
20734
20814
|
] });
|
|
20735
20815
|
}
|
|
20736
|
-
var
|
|
20816
|
+
var import_react_query31, import_lucide_react44, import_react60, import_jsx_runtime85;
|
|
20737
20817
|
var init_Cloud = __esm({
|
|
20738
20818
|
"src/internal/components/KeyshareRestoreMenu/methods/Cloud.tsx"() {
|
|
20739
20819
|
init_SessionContext();
|
|
20740
|
-
|
|
20820
|
+
import_react_query31 = require("@tanstack/react-query");
|
|
20741
20821
|
import_lucide_react44 = require("lucide-react");
|
|
20742
20822
|
import_react60 = require("react");
|
|
20743
20823
|
init_button();
|
|
@@ -20913,14 +20993,14 @@ var init_methods = __esm({
|
|
|
20913
20993
|
});
|
|
20914
20994
|
|
|
20915
20995
|
// src/internal/components/KeyshareRestoreMenu/KeyshareRestoreMenu.tsx
|
|
20916
|
-
var
|
|
20996
|
+
var import_react_query32, import_lucide_react46, import_react62, import_jsx_runtime87, RESTORE_COMPONENTS, KeyshareRestoreMenu;
|
|
20917
20997
|
var init_KeyshareRestoreMenu = __esm({
|
|
20918
20998
|
"src/internal/components/KeyshareRestoreMenu/KeyshareRestoreMenu.tsx"() {
|
|
20919
20999
|
init_ProviderContext();
|
|
20920
21000
|
init_SessionContext();
|
|
20921
21001
|
init_i18n();
|
|
20922
21002
|
init_useSafeDisconnect();
|
|
20923
|
-
|
|
21003
|
+
import_react_query32 = require("@tanstack/react-query");
|
|
20924
21004
|
import_lucide_react46 = require("lucide-react");
|
|
20925
21005
|
import_react62 = require("react");
|
|
20926
21006
|
init_useLayoutDataStore();
|
|
@@ -20944,7 +21024,7 @@ var init_KeyshareRestoreMenu = __esm({
|
|
|
20944
21024
|
guardian: Guardian
|
|
20945
21025
|
};
|
|
20946
21026
|
KeyshareRestoreMenu = () => {
|
|
20947
|
-
const qc = (0,
|
|
21027
|
+
const qc = (0, import_react_query32.useQueryClient)();
|
|
20948
21028
|
const { callbacksRef } = useProviderConfig();
|
|
20949
21029
|
const { t } = useT();
|
|
20950
21030
|
const address = useSession((st) => st.address);
|
|
@@ -20984,7 +21064,7 @@ var init_KeyshareRestoreMenu = __esm({
|
|
|
20984
21064
|
restoreFromCloud,
|
|
20985
21065
|
isRestoringFromCloud
|
|
20986
21066
|
} = useRestoreAccount();
|
|
20987
|
-
const { data: serverRecoveryStatus, isLoading: isBackupStatusLoading } = (0,
|
|
21067
|
+
const { data: serverRecoveryStatus, isLoading: isBackupStatusLoading } = (0, import_react_query32.useQuery)({
|
|
20988
21068
|
retry: false,
|
|
20989
21069
|
queryKey: [CHECK_BACKUP_QUERY_KEY, address],
|
|
20990
21070
|
queryFn: async () => await getShareRecoveryStats()
|
|
@@ -20993,7 +21073,7 @@ var init_KeyshareRestoreMenu = __esm({
|
|
|
20993
21073
|
(0, import_react62.useEffect)(() => {
|
|
20994
21074
|
if (!!hasServerBackup) useRestoreStore.getState().setMethod("server");
|
|
20995
21075
|
}, [hasServerBackup]);
|
|
20996
|
-
const { mutate: disconnect, isPending: isDisconnecting } = (0,
|
|
21076
|
+
const { mutate: disconnect, isPending: isDisconnecting } = (0, import_react_query32.useMutation)({
|
|
20997
21077
|
mutationFn: async () => {
|
|
20998
21078
|
const { setStatus, setIsLoading } = useSession.getState();
|
|
20999
21079
|
const { setError, setMethod } = useRestoreStore.getState();
|
|
@@ -21149,7 +21229,7 @@ function KeyshareBackupMenu() {
|
|
|
21149
21229
|
setMethod(null);
|
|
21150
21230
|
};
|
|
21151
21231
|
}, []);
|
|
21152
|
-
const { data: serverRecoveryStatus, isLoading: isRecoveryLoading } = (0,
|
|
21232
|
+
const { data: serverRecoveryStatus, isLoading: isRecoveryLoading } = (0, import_react_query33.useQuery)({
|
|
21153
21233
|
retry: false,
|
|
21154
21234
|
enabled: !!address,
|
|
21155
21235
|
queryKey: [CHECK_BACKUP_QUERY_KEY, address],
|
|
@@ -21276,12 +21356,12 @@ function KeyshareBackupMenu() {
|
|
|
21276
21356
|
] })
|
|
21277
21357
|
] });
|
|
21278
21358
|
}
|
|
21279
|
-
var
|
|
21359
|
+
var import_react_query33, import_lucide_react47, import_react63, import_jsx_runtime88, COMPONENTS;
|
|
21280
21360
|
var init_KeyshareBackupMenu = __esm({
|
|
21281
21361
|
"src/internal/components/KeyshareRestoreMenu/KeyshareBackupMenu.tsx"() {
|
|
21282
21362
|
init_SessionContext();
|
|
21283
21363
|
init_i18n();
|
|
21284
|
-
|
|
21364
|
+
import_react_query33 = require("@tanstack/react-query");
|
|
21285
21365
|
import_lucide_react47 = require("lucide-react");
|
|
21286
21366
|
import_react63 = require("react");
|
|
21287
21367
|
init_useLayoutDataStore();
|
|
@@ -21339,10 +21419,15 @@ var init_sumsub = __esm({
|
|
|
21339
21419
|
});
|
|
21340
21420
|
|
|
21341
21421
|
// src/internal/components/KYC/SumsubIframeManager.ts
|
|
21342
|
-
|
|
21422
|
+
function toSumsubLang(lang) {
|
|
21423
|
+
if (!lang) return "en";
|
|
21424
|
+
return SUMSUB_LANG_OVERRIDES[lang] ?? lang;
|
|
21425
|
+
}
|
|
21426
|
+
var DEFAULT_THEME_NAME, SUMSUB_LANG_OVERRIDES, SumsubIframeManager;
|
|
21343
21427
|
var init_SumsubIframeManager = __esm({
|
|
21344
21428
|
"src/internal/components/KYC/SumsubIframeManager.ts"() {
|
|
21345
21429
|
DEFAULT_THEME_NAME = "Lumia Hub KYC Preset V2";
|
|
21430
|
+
SUMSUB_LANG_OVERRIDES = { tl: "fl" };
|
|
21346
21431
|
SumsubIframeManager = class {
|
|
21347
21432
|
config;
|
|
21348
21433
|
boundMessageHandler;
|
|
@@ -21367,7 +21452,8 @@ var init_SumsubIframeManager = __esm({
|
|
|
21367
21452
|
data: {
|
|
21368
21453
|
accessToken: token,
|
|
21369
21454
|
theme: this.config.options.theme,
|
|
21370
|
-
customizationName: this.config.options.customizationName
|
|
21455
|
+
customizationName: this.config.options.customizationName,
|
|
21456
|
+
lang: this.config.options.lang
|
|
21371
21457
|
}
|
|
21372
21458
|
});
|
|
21373
21459
|
} catch (err) {
|
|
@@ -21411,6 +21497,8 @@ var init_SumsubIframeManager = __esm({
|
|
|
21411
21497
|
function useSumsubIframe({ iframeUrl }) {
|
|
21412
21498
|
const config = useProviderConfig().config;
|
|
21413
21499
|
const { colorMode } = useColorMode();
|
|
21500
|
+
const { t, i18n } = useT();
|
|
21501
|
+
const lang = toSumsubLang(i18n.resolvedLanguage);
|
|
21414
21502
|
const iframeRef = (0, import_react64.useRef)(null);
|
|
21415
21503
|
const [isLoading, setIsLoading] = (0, import_react64.useState)(true);
|
|
21416
21504
|
const [error, setError] = (0, import_react64.useState)(null);
|
|
@@ -21420,20 +21508,21 @@ function useSumsubIframe({ iframeUrl }) {
|
|
|
21420
21508
|
(0, import_react64.useEffect)(() => {
|
|
21421
21509
|
setError(null);
|
|
21422
21510
|
setIsLoading(true);
|
|
21423
|
-
setStatus("
|
|
21511
|
+
setStatus(t("passport:kycMenu.preparing"));
|
|
21424
21512
|
const iframeOrigin = new URL(iframeUrl).origin;
|
|
21425
21513
|
const manager = new SumsubIframeManager({
|
|
21426
21514
|
options: {
|
|
21427
21515
|
theme: colorMode === "dark" ? "dark" : "light",
|
|
21428
|
-
customizationName: DEFAULT_THEME_NAME
|
|
21516
|
+
customizationName: DEFAULT_THEME_NAME,
|
|
21517
|
+
lang
|
|
21429
21518
|
},
|
|
21430
21519
|
iframeOrigin,
|
|
21431
21520
|
getToken: () => {
|
|
21432
|
-
setStatus("
|
|
21521
|
+
setStatus(t("passport:kycMenu.authenticating"));
|
|
21433
21522
|
return fetchToken({ levelName });
|
|
21434
21523
|
},
|
|
21435
21524
|
refreshToken: () => fetchToken({ levelName }),
|
|
21436
|
-
onSdkBuilt: () => setStatus("
|
|
21525
|
+
onSdkBuilt: () => setStatus(t("passport:kycMenu.loadingForm")),
|
|
21437
21526
|
sendMessage: (msg) => iframeRef.current?.contentWindow?.postMessage(msg, iframeOrigin),
|
|
21438
21527
|
onReady: () => {
|
|
21439
21528
|
setIsLoading(false);
|
|
@@ -21449,13 +21538,14 @@ function useSumsubIframe({ iframeUrl }) {
|
|
|
21449
21538
|
return () => {
|
|
21450
21539
|
manager.destroy();
|
|
21451
21540
|
};
|
|
21452
|
-
}, [iframeUrl, levelName]);
|
|
21541
|
+
}, [iframeUrl, levelName, lang]);
|
|
21453
21542
|
return {
|
|
21454
21543
|
iframeRef,
|
|
21455
21544
|
isLoading,
|
|
21456
21545
|
error,
|
|
21457
21546
|
height,
|
|
21458
|
-
status
|
|
21547
|
+
status,
|
|
21548
|
+
lang
|
|
21459
21549
|
};
|
|
21460
21550
|
}
|
|
21461
21551
|
var import_react64;
|
|
@@ -21463,6 +21553,7 @@ var init_useSumsubIframe = __esm({
|
|
|
21463
21553
|
"src/internal/components/KYC/useSumsubIframe.ts"() {
|
|
21464
21554
|
init_ProviderContext();
|
|
21465
21555
|
init_useColorMode();
|
|
21556
|
+
init_i18n();
|
|
21466
21557
|
import_react64 = require("react");
|
|
21467
21558
|
init_sumsub();
|
|
21468
21559
|
init_SumsubIframeManager();
|
|
@@ -21474,17 +21565,19 @@ var import_lucide_react48, import_jsx_runtime89, SumsubIframe;
|
|
|
21474
21565
|
var init_SumsubIframe = __esm({
|
|
21475
21566
|
"src/internal/components/KYC/SumsubIframe.tsx"() {
|
|
21476
21567
|
init_ProviderContext();
|
|
21568
|
+
init_i18n();
|
|
21477
21569
|
import_lucide_react48 = require("lucide-react");
|
|
21478
21570
|
init_useSumsubIframe();
|
|
21479
21571
|
import_jsx_runtime89 = require("react/jsx-runtime");
|
|
21480
21572
|
SumsubIframe = () => {
|
|
21481
21573
|
const config = useProviderConfig().config;
|
|
21574
|
+
const { t } = useT();
|
|
21482
21575
|
const iframeUrl = `${config.current.services.iframeUrl}/kyc/sumsub.html`;
|
|
21483
|
-
const { iframeRef, isLoading, error, height, status } = useSumsubIframe({ iframeUrl });
|
|
21576
|
+
const { iframeRef, isLoading, error, height, status, lang } = useSumsubIframe({ iframeUrl });
|
|
21484
21577
|
return /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(import_jsx_runtime89.Fragment, { children: [
|
|
21485
21578
|
isLoading && /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: "rounded-[10px] p-6 text-center", children: [
|
|
21486
21579
|
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_lucide_react48.LoaderIcon, { className: "w-4 h-4 animate-spin mx-auto" }),
|
|
21487
|
-
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)("p", { className: "text-sm text-[var(--ui-kit-text-secondary)] mt-2", children: status || "
|
|
21580
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)("p", { className: "text-sm text-[var(--ui-kit-text-secondary)] mt-2", children: status || t("passport:kycMenu.loading") })
|
|
21488
21581
|
] }),
|
|
21489
21582
|
error && /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("div", { className: "rounded-[10px] p-4 text-center bg-[var(--ui-kit-bg-error)] border border-[var(--ui-kit-error)]", children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("div", { className: "text-sm text-[var(--ui-kit-error)]", children: error }) }),
|
|
21490
21583
|
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)("div", { className: " w-full h-full relative", children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
@@ -21497,7 +21590,8 @@ var init_SumsubIframe = __esm({
|
|
|
21497
21590
|
sandbox: "allow-scripts allow-same-origin allow-forms allow-popups",
|
|
21498
21591
|
allow: "camera; microphone; geolocation; clipboard-write",
|
|
21499
21592
|
style: { height: isLoading || error ? 0 : height }
|
|
21500
|
-
}
|
|
21593
|
+
},
|
|
21594
|
+
lang
|
|
21501
21595
|
) })
|
|
21502
21596
|
] });
|
|
21503
21597
|
};
|
|
@@ -21507,10 +21601,11 @@ var init_SumsubIframe = __esm({
|
|
|
21507
21601
|
// src/internal/components/KYC/KycMenu.tsx
|
|
21508
21602
|
function KycMenu() {
|
|
21509
21603
|
const setPage = useLayoutDataStore((st) => st.setPage);
|
|
21604
|
+
const { t } = useT();
|
|
21510
21605
|
return /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(Expandable, { isExpanded: true, contentClassName: "w-full flex flex-col gap-[var(--ui-kit-gap)]", children: [
|
|
21511
21606
|
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "flex items-center gap-[var(--ui-kit-gap)]", children: [
|
|
21512
|
-
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(Button, { variant: "ghost", size: "icon", title: "
|
|
21513
|
-
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { className: "text-xl font-semibold", children: "
|
|
21607
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(Button, { variant: "ghost", size: "icon", title: t("passport:common.back"), onClick: () => setPage("settings" /* SETTINGS */), children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(import_lucide_react49.ArrowLeft, { className: "h-4 w-4" }) }),
|
|
21608
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { className: "text-xl font-semibold", children: t("passport:kycMenu.title") })
|
|
21514
21609
|
] }),
|
|
21515
21610
|
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(KycContent, {})
|
|
21516
21611
|
] });
|
|
@@ -21519,6 +21614,7 @@ var import_lucide_react49, import_jsx_runtime90, KycContent;
|
|
|
21519
21614
|
var init_KycMenu = __esm({
|
|
21520
21615
|
"src/internal/components/KYC/KycMenu.tsx"() {
|
|
21521
21616
|
init_ProviderContext();
|
|
21617
|
+
init_i18n();
|
|
21522
21618
|
import_lucide_react49 = require("lucide-react");
|
|
21523
21619
|
init_useLayoutDataStore();
|
|
21524
21620
|
init_Expandable2();
|
|
@@ -21527,12 +21623,13 @@ var init_KycMenu = __esm({
|
|
|
21527
21623
|
import_jsx_runtime90 = require("react/jsx-runtime");
|
|
21528
21624
|
KycContent = () => {
|
|
21529
21625
|
const config = useProviderConfig().config;
|
|
21626
|
+
const { t } = useT();
|
|
21530
21627
|
const provider = config.current.kyc?.provider;
|
|
21531
21628
|
switch (provider) {
|
|
21532
21629
|
case "sumsub":
|
|
21533
21630
|
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(SumsubIframe, {});
|
|
21534
21631
|
default:
|
|
21535
|
-
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className: "rounded-xl p-[var(--ui-kit-pd)] text-center bg-[var(--ui-kit-secondary)]", children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className: "text-sm", children: provider ?
|
|
21632
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className: "rounded-xl p-[var(--ui-kit-pd)] text-center bg-[var(--ui-kit-secondary)]", children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className: "text-sm", children: provider ? `${t("passport:kycMenu.providerComingSoon")}: ${provider}` : t("passport:kycMenu.comingSoon") }) });
|
|
21536
21633
|
}
|
|
21537
21634
|
};
|
|
21538
21635
|
}
|
|
@@ -21541,18 +21638,18 @@ var init_KycMenu = __esm({
|
|
|
21541
21638
|
// src/internal/hooks/useUserProfile.ts
|
|
21542
21639
|
function useUserProfile() {
|
|
21543
21640
|
const address = useSession((st) => st.address);
|
|
21544
|
-
return (0,
|
|
21641
|
+
return (0, import_react_query34.useQuery)({
|
|
21545
21642
|
queryKey: [QUERY_KEYS.userProfile, address],
|
|
21546
21643
|
queryFn: getUserProfile,
|
|
21547
21644
|
enabled: !!address,
|
|
21548
21645
|
retry: false
|
|
21549
21646
|
});
|
|
21550
21647
|
}
|
|
21551
|
-
var
|
|
21648
|
+
var import_react_query34;
|
|
21552
21649
|
var init_useUserProfile = __esm({
|
|
21553
21650
|
"src/internal/hooks/useUserProfile.ts"() {
|
|
21554
21651
|
init_SessionContext();
|
|
21555
|
-
|
|
21652
|
+
import_react_query34 = require("@tanstack/react-query");
|
|
21556
21653
|
init_profile();
|
|
21557
21654
|
}
|
|
21558
21655
|
});
|
|
@@ -21733,7 +21830,7 @@ var init_constants6 = __esm({
|
|
|
21733
21830
|
// src/internal/hooks/useBlockscoutAssets/useNativeBalance.ts
|
|
21734
21831
|
function useNativeBalance(options) {
|
|
21735
21832
|
const { enabled, address, chainId, publicClient, nativeCurrency } = options;
|
|
21736
|
-
return (0,
|
|
21833
|
+
return (0, import_react_query35.useQuery)({
|
|
21737
21834
|
enabled: enabled && !!address && !!publicClient && !!nativeCurrency?.symbol,
|
|
21738
21835
|
...BALANCE_DEFAULT_QUERY_CFG,
|
|
21739
21836
|
queryKey: [NATIVE_BALANCE_QUERY_KEY2, chainId, address],
|
|
@@ -21748,10 +21845,10 @@ function useNativeBalance(options) {
|
|
|
21748
21845
|
}
|
|
21749
21846
|
});
|
|
21750
21847
|
}
|
|
21751
|
-
var
|
|
21848
|
+
var import_react_query35, import_viem7;
|
|
21752
21849
|
var init_useNativeBalance = __esm({
|
|
21753
21850
|
"src/internal/hooks/useBlockscoutAssets/useNativeBalance.ts"() {
|
|
21754
|
-
|
|
21851
|
+
import_react_query35 = require("@tanstack/react-query");
|
|
21755
21852
|
import_viem7 = require("viem");
|
|
21756
21853
|
init_constants6();
|
|
21757
21854
|
}
|
|
@@ -21766,7 +21863,7 @@ function useWatchTokens(options) {
|
|
|
21766
21863
|
const tokensForChain = chainId ? allWatchTokens?.[chainId] || [] : [];
|
|
21767
21864
|
return tokensForChain;
|
|
21768
21865
|
}, [config, chainId]);
|
|
21769
|
-
return (0,
|
|
21866
|
+
return (0, import_react_query36.useQuery)({
|
|
21770
21867
|
enabled: !!publicClient && !!address && enabled && watchTokens.length > 0,
|
|
21771
21868
|
...BALANCE_DEFAULT_QUERY_CFG,
|
|
21772
21869
|
queryKey: [WATCH_TOKENS_QUERY_KEY, chainId, address, watchTokens.map((t) => t.address).join(",")],
|
|
@@ -21829,11 +21926,11 @@ function useWatchTokens(options) {
|
|
|
21829
21926
|
}
|
|
21830
21927
|
});
|
|
21831
21928
|
}
|
|
21832
|
-
var
|
|
21929
|
+
var import_react_query36, import_react66, import_viem8;
|
|
21833
21930
|
var init_useWatchTokens = __esm({
|
|
21834
21931
|
"src/internal/hooks/useBlockscoutAssets/useWatchTokens.ts"() {
|
|
21835
21932
|
init_ProviderContext();
|
|
21836
|
-
|
|
21933
|
+
import_react_query36 = require("@tanstack/react-query");
|
|
21837
21934
|
import_react66 = require("react");
|
|
21838
21935
|
import_viem8 = require("viem");
|
|
21839
21936
|
init_constants6();
|
|
@@ -21975,7 +22072,7 @@ var init_utils9 = __esm({
|
|
|
21975
22072
|
// src/internal/hooks/useBlockscoutAssets/useBlockscoutAssets.ts
|
|
21976
22073
|
function useBlockscoutAssets(options) {
|
|
21977
22074
|
const { address, chainId, enabled = true, detectSecurityTokens = true } = options;
|
|
21978
|
-
const qc = (0,
|
|
22075
|
+
const qc = (0, import_react_query37.useQueryClient)();
|
|
21979
22076
|
const { chainConfig, publicClient, resolvedChainId } = useResolvedPublicClient(chainId, "useBlockscoutAssets");
|
|
21980
22077
|
const {
|
|
21981
22078
|
//
|
|
@@ -22013,7 +22110,7 @@ function useBlockscoutAssets(options) {
|
|
|
22013
22110
|
data: coreTokenBalances = [],
|
|
22014
22111
|
isLoading: coreTokensLoading,
|
|
22015
22112
|
isFetching: coreTokensFetching
|
|
22016
|
-
} = (0,
|
|
22113
|
+
} = (0, import_react_query37.useQuery)({
|
|
22017
22114
|
enabled: !!address && enabled && !blockscoutClient && !customTokenBalancesQuery && !customTokenBalancesQueryKey,
|
|
22018
22115
|
...BALANCE_DEFAULT_QUERY_CFG,
|
|
22019
22116
|
queryKey: [`NON-${BLOCKSCOUT_QUERY_KEY}`, resolvedChainId, address],
|
|
@@ -22029,7 +22126,7 @@ function useBlockscoutAssets(options) {
|
|
|
22029
22126
|
data: customItems = [],
|
|
22030
22127
|
isLoading: customLoading,
|
|
22031
22128
|
isFetching: customFetching
|
|
22032
|
-
} = (0,
|
|
22129
|
+
} = (0, import_react_query37.useQuery)({
|
|
22033
22130
|
enabled: !!address && enabled && !blockscoutClient && !!customTokenBalancesQuery && !!customTokenBalancesQueryKey,
|
|
22034
22131
|
...BALANCE_DEFAULT_QUERY_CFG,
|
|
22035
22132
|
queryKey: customTokenBalancesQueryKey,
|
|
@@ -22042,7 +22139,7 @@ function useBlockscoutAssets(options) {
|
|
|
22042
22139
|
isFetching: blockscoutFetching,
|
|
22043
22140
|
error: blockscoutError,
|
|
22044
22141
|
dataUpdatedAt
|
|
22045
|
-
} = (0,
|
|
22142
|
+
} = (0, import_react_query37.useQuery)({
|
|
22046
22143
|
enabled: !!address && enabled && !!blockscoutClient && !customTokenBalancesQuery && !customTokenBalancesQueryKey,
|
|
22047
22144
|
...BALANCE_DEFAULT_QUERY_CFG,
|
|
22048
22145
|
queryKey: [BLOCKSCOUT_QUERY_KEY, resolvedChainId, blockscoutApiUrl, address],
|
|
@@ -22053,7 +22150,7 @@ function useBlockscoutAssets(options) {
|
|
|
22053
22150
|
data: nftItems,
|
|
22054
22151
|
isLoading: nftsLoading,
|
|
22055
22152
|
isFetching: nftsFetching
|
|
22056
|
-
} = (0,
|
|
22153
|
+
} = (0, import_react_query37.useQuery)({
|
|
22057
22154
|
enabled: !!address && enabled && !!blockscoutClient,
|
|
22058
22155
|
...BALANCE_DEFAULT_QUERY_CFG,
|
|
22059
22156
|
queryKey: [BLOCKSCOUT_QUERY_KEY, "nfts", resolvedChainId, blockscoutApiUrl, address],
|
|
@@ -22063,7 +22160,7 @@ function useBlockscoutAssets(options) {
|
|
|
22063
22160
|
if (!blockscoutItems) return [];
|
|
22064
22161
|
return blockscoutItems.filter((tb) => tb.token.type === "ERC-20").map((tb) => tb.token.address_hash);
|
|
22065
22162
|
}, [blockscoutItems]);
|
|
22066
|
-
const { data: erc3643Results } = (0,
|
|
22163
|
+
const { data: erc3643Results } = (0, import_react_query37.useQuery)({
|
|
22067
22164
|
queryKey: [ERC3643_DETECTION_QUERY_KEY, resolvedChainId, address, erc20TokenAddresses],
|
|
22068
22165
|
queryFn: async () => {
|
|
22069
22166
|
if (!publicClient || erc20TokenAddresses.length === 0) {
|
|
@@ -22245,12 +22342,12 @@ function useBlockscoutAssets(options) {
|
|
|
22245
22342
|
lastUpdated: dataUpdatedAt || null
|
|
22246
22343
|
};
|
|
22247
22344
|
}
|
|
22248
|
-
var import_core4,
|
|
22345
|
+
var import_core4, import_react_query37, import_react67;
|
|
22249
22346
|
var init_useBlockscoutAssets = __esm({
|
|
22250
22347
|
"src/internal/hooks/useBlockscoutAssets/useBlockscoutAssets.ts"() {
|
|
22251
22348
|
init_ProviderContext();
|
|
22252
22349
|
import_core4 = require("@embarkai/core");
|
|
22253
|
-
|
|
22350
|
+
import_react_query37 = require("@tanstack/react-query");
|
|
22254
22351
|
import_react67 = require("react");
|
|
22255
22352
|
init_initial();
|
|
22256
22353
|
init_constants();
|
|
@@ -22445,7 +22542,7 @@ function PortfolioItem(props) {
|
|
|
22445
22542
|
queryKey: asset.balanceQueryKey,
|
|
22446
22543
|
queryFn: asset.balanceQuery
|
|
22447
22544
|
} : void 0;
|
|
22448
|
-
const { data: projectAssetBalance } = (0,
|
|
22545
|
+
const { data: projectAssetBalance } = (0, import_react_query38.useQuery)({
|
|
22449
22546
|
enabled: !!projectAssetQuery,
|
|
22450
22547
|
retry: false,
|
|
22451
22548
|
queryKey: projectAssetQuery?.queryKey ?? ["project-asset-balance-disabled", asset.symbol],
|
|
@@ -22455,7 +22552,7 @@ function PortfolioItem(props) {
|
|
|
22455
22552
|
const isSecurity = isSecurityToken(asset);
|
|
22456
22553
|
const embeddedRate = Number(asset.exchangeRateUsd || 0);
|
|
22457
22554
|
const hasEmbeddedRate = Number.isFinite(embeddedRate) && embeddedRate > 0;
|
|
22458
|
-
const { data: assetRate, isLoading: isRateLoading } = (0,
|
|
22555
|
+
const { data: assetRate, isLoading: isRateLoading } = (0, import_react_query38.useQuery)({
|
|
22459
22556
|
enabled: !!address && !hasEmbeddedRate && !isProjectAsset && !isNft && !isSecurity,
|
|
22460
22557
|
// (!!customAssetRateQuery || !!isAssetRateAvailable(asset.symbol)),
|
|
22461
22558
|
retry: false,
|
|
@@ -22528,11 +22625,11 @@ function PortfolioItem(props) {
|
|
|
22528
22625
|
}
|
|
22529
22626
|
);
|
|
22530
22627
|
}
|
|
22531
|
-
var
|
|
22628
|
+
var import_react_query38, import_lucide_react51, import_react68, import_viem11, import_jsx_runtime94, PORTFOLIO_ASSET_RATE_QUERY_KEY;
|
|
22532
22629
|
var init_PortfolioItem = __esm({
|
|
22533
22630
|
"src/internal/components/PortfolioMenu/PortfolioItem.tsx"() {
|
|
22534
22631
|
init_ProviderContext();
|
|
22535
|
-
|
|
22632
|
+
import_react_query38 = require("@tanstack/react-query");
|
|
22536
22633
|
import_lucide_react51 = require("lucide-react");
|
|
22537
22634
|
import_react68 = require("react");
|
|
22538
22635
|
import_viem11 = require("viem");
|
|
@@ -22552,7 +22649,7 @@ var init_PortfolioItem = __esm({
|
|
|
22552
22649
|
function PortfolioMenu() {
|
|
22553
22650
|
const { assets: projectAssets = [] } = useProviderConfig().config.current?.projectAssets || {};
|
|
22554
22651
|
const { t } = useT();
|
|
22555
|
-
const qc = (0,
|
|
22652
|
+
const qc = (0, import_react_query39.useQueryClient)();
|
|
22556
22653
|
const address = useSession((st) => st.address);
|
|
22557
22654
|
const {
|
|
22558
22655
|
assets: blockscoutAssets,
|
|
@@ -22612,13 +22709,13 @@ function PortfolioMenu() {
|
|
|
22612
22709
|
blockscoutError && /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(Highlight, { type: "error", children: blockscoutError?.message })
|
|
22613
22710
|
] });
|
|
22614
22711
|
}
|
|
22615
|
-
var
|
|
22712
|
+
var import_react_query39, import_lucide_react52, import_react69, import_jsx_runtime95;
|
|
22616
22713
|
var init_PortfolioMenu = __esm({
|
|
22617
22714
|
"src/internal/components/PortfolioMenu/PortfolioMenu.tsx"() {
|
|
22618
22715
|
init_ProviderContext();
|
|
22619
22716
|
init_SessionContext();
|
|
22620
22717
|
init_i18n();
|
|
22621
|
-
|
|
22718
|
+
import_react_query39 = require("@tanstack/react-query");
|
|
22622
22719
|
import_lucide_react52 = require("lucide-react");
|
|
22623
22720
|
import_react69 = require("react");
|
|
22624
22721
|
init_useBlockscoutAssets2();
|
|
@@ -22935,7 +23032,7 @@ function useNicknameAvailability(currentNickname) {
|
|
|
22935
23032
|
if (!currentNickname) return;
|
|
22936
23033
|
useNicknameStore.getState().setNicknameValue(currentNickname);
|
|
22937
23034
|
}, [currentNickname]);
|
|
22938
|
-
const { mutate: checkAvailability, isPending: isCheckingAvailability } = (0,
|
|
23035
|
+
const { mutate: checkAvailability, isPending: isCheckingAvailability } = (0, import_react_query40.useMutation)({
|
|
22939
23036
|
mutationFn: async (newNickname) => {
|
|
22940
23037
|
useNicknameStore.getState().setError(null);
|
|
22941
23038
|
useNicknameStore.getState().setAvailability(null);
|
|
@@ -22967,11 +23064,11 @@ function useNicknameAvailability(currentNickname) {
|
|
|
22967
23064
|
}, [nicknameValue, currentNickname, debouncedCheckAvailability]);
|
|
22968
23065
|
return { isCheckingAvailability };
|
|
22969
23066
|
}
|
|
22970
|
-
var
|
|
23067
|
+
var import_react_query40, import_lodash_es14, import_react70, DEBOUNCE_MS;
|
|
22971
23068
|
var init_useNicknameAvailability = __esm({
|
|
22972
23069
|
"src/internal/components/NicknameMenu/useNicknameAvailability.ts"() {
|
|
22973
23070
|
init_i18n();
|
|
22974
|
-
|
|
23071
|
+
import_react_query40 = require("@tanstack/react-query");
|
|
22975
23072
|
import_lodash_es14 = require("lodash-es");
|
|
22976
23073
|
import_react70 = require("react");
|
|
22977
23074
|
init_nickname();
|
|
@@ -22986,7 +23083,7 @@ var init_useNicknameAvailability = __esm({
|
|
|
22986
23083
|
function NicknameEditForm(props) {
|
|
22987
23084
|
const { isInitialUser, nicknameInfo } = props;
|
|
22988
23085
|
const { handle: currentNickname, canChange } = nicknameInfo || { handle: "", canChange: false };
|
|
22989
|
-
const qc = (0,
|
|
23086
|
+
const qc = (0, import_react_query41.useQueryClient)();
|
|
22990
23087
|
const { t } = useT();
|
|
22991
23088
|
const address = useSession((st) => st.address);
|
|
22992
23089
|
const { callbacksRef } = useProviderConfig();
|
|
@@ -22999,7 +23096,7 @@ function NicknameEditForm(props) {
|
|
|
22999
23096
|
(0, import_react71.useEffect)(() => () => {
|
|
23000
23097
|
if (exitTimerRef.current) clearTimeout(exitTimerRef.current);
|
|
23001
23098
|
}, []);
|
|
23002
|
-
const { mutate: changeNickname2, isPending: isNicknameChanging } = (0,
|
|
23099
|
+
const { mutate: changeNickname2, isPending: isNicknameChanging } = (0, import_react_query41.useMutation)({
|
|
23003
23100
|
mutationFn: (handle) => changeNickname(handle),
|
|
23004
23101
|
onSuccess: () => {
|
|
23005
23102
|
qc.invalidateQueries({ queryKey: [QUERY_KEYS.nicknameInfo] });
|
|
@@ -23136,13 +23233,13 @@ function NicknameEditForm(props) {
|
|
|
23136
23233
|
!!canChange && /* @__PURE__ */ (0, import_jsx_runtime98.jsx)("span", { className: "w-full flex items-center leadding-4 text-[10px] text-[var(--ui-kit-fg-muted)]", children: t("passport:nicknameMenu.hint") })
|
|
23137
23234
|
] });
|
|
23138
23235
|
}
|
|
23139
|
-
var
|
|
23236
|
+
var import_react_query41, import_lucide_react55, import_react71, import_jsx_runtime98;
|
|
23140
23237
|
var init_NicknameEditForm = __esm({
|
|
23141
23238
|
"src/internal/components/NicknameMenu/NicknameEditForm.tsx"() {
|
|
23142
23239
|
init_ProviderContext();
|
|
23143
23240
|
init_SessionContext();
|
|
23144
23241
|
init_i18n();
|
|
23145
|
-
|
|
23242
|
+
import_react_query41 = require("@tanstack/react-query");
|
|
23146
23243
|
import_lucide_react55 = require("lucide-react");
|
|
23147
23244
|
import_react71 = require("react");
|
|
23148
23245
|
init_icons();
|
|
@@ -23173,7 +23270,7 @@ function NicknameMenu() {
|
|
|
23173
23270
|
data: nicknameInfo,
|
|
23174
23271
|
isLoading: isNicknameInfoLoading,
|
|
23175
23272
|
error: nicknameInfoError
|
|
23176
|
-
} = (0,
|
|
23273
|
+
} = (0, import_react_query42.useQuery)({
|
|
23177
23274
|
retry: 1,
|
|
23178
23275
|
enabled: !!address,
|
|
23179
23276
|
queryKey: [QUERY_KEYS.nicknameInfo, address],
|
|
@@ -23247,13 +23344,13 @@ function NicknameMenu() {
|
|
|
23247
23344
|
!!resolvedError?.length && /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(Highlight, { type: "error", children: resolvedError })
|
|
23248
23345
|
] });
|
|
23249
23346
|
}
|
|
23250
|
-
var
|
|
23347
|
+
var import_react_query42, import_dayjs5, import_lucide_react56, import_react72, import_jsx_runtime99;
|
|
23251
23348
|
var init_NicknameMenu = __esm({
|
|
23252
23349
|
"src/internal/components/NicknameMenu/NicknameMenu.tsx"() {
|
|
23253
23350
|
init_SessionContext();
|
|
23254
23351
|
init_useOpenPage();
|
|
23255
23352
|
init_i18n();
|
|
23256
|
-
|
|
23353
|
+
import_react_query42 = require("@tanstack/react-query");
|
|
23257
23354
|
import_dayjs5 = __toESM(require("dayjs"), 1);
|
|
23258
23355
|
import_lucide_react56 = require("lucide-react");
|
|
23259
23356
|
import_react72 = require("react");
|
|
@@ -23380,7 +23477,7 @@ function ReceiveMenu() {
|
|
|
23380
23477
|
const session = useSession((st) => st.session);
|
|
23381
23478
|
const chainConfig = useSession((st) => st.chainConfig);
|
|
23382
23479
|
const address = session?.smartAccountAddress ?? null;
|
|
23383
|
-
const { data: nicknameInfo, isLoading: isNicknameInfoLoading } = (0,
|
|
23480
|
+
const { data: nicknameInfo, isLoading: isNicknameInfoLoading } = (0, import_react_query43.useQuery)({
|
|
23384
23481
|
retry: 1,
|
|
23385
23482
|
enabled: !!address,
|
|
23386
23483
|
queryKey: [QUERY_KEYS.nicknameInfo, address],
|
|
@@ -23498,12 +23595,12 @@ function ReceiveMenu() {
|
|
|
23498
23595
|
] })
|
|
23499
23596
|
] });
|
|
23500
23597
|
}
|
|
23501
|
-
var
|
|
23598
|
+
var import_react_query43, import_lucide_react57, import_qrcode, import_react73, import_jsx_runtime100;
|
|
23502
23599
|
var init_ReceiveMenu = __esm({
|
|
23503
23600
|
"src/internal/components/ReceiveMenu/ReceiveMenu.tsx"() {
|
|
23504
23601
|
init_SessionContext();
|
|
23505
23602
|
init_i18n();
|
|
23506
|
-
|
|
23603
|
+
import_react_query43 = require("@tanstack/react-query");
|
|
23507
23604
|
import_lucide_react57 = require("lucide-react");
|
|
23508
23605
|
import_qrcode = __toESM(require("qrcode"), 1);
|
|
23509
23606
|
import_react73 = require("react");
|
|
@@ -23625,7 +23722,7 @@ var init_constants7 = __esm({
|
|
|
23625
23722
|
function useConnectedApps() {
|
|
23626
23723
|
const session = useSession((st) => st.session);
|
|
23627
23724
|
const userId = session?.mpcUserId || null;
|
|
23628
|
-
return (0,
|
|
23725
|
+
return (0, import_react_query44.useQuery)({
|
|
23629
23726
|
retry: false,
|
|
23630
23727
|
enabled: !!userId,
|
|
23631
23728
|
queryKey: [CONNECTED_TRUSTED_APPS_QUERY, userId],
|
|
@@ -23638,11 +23735,11 @@ function useConnectedApps() {
|
|
|
23638
23735
|
}
|
|
23639
23736
|
});
|
|
23640
23737
|
}
|
|
23641
|
-
var
|
|
23738
|
+
var import_react_query44;
|
|
23642
23739
|
var init_useConnectedApps = __esm({
|
|
23643
23740
|
"src/internal/components/SecurityMenu/ConnectedApps/useConnectedApps.ts"() {
|
|
23644
23741
|
init_SessionContext();
|
|
23645
|
-
|
|
23742
|
+
import_react_query44 = require("@tanstack/react-query");
|
|
23646
23743
|
init_httpClient();
|
|
23647
23744
|
init_constants7();
|
|
23648
23745
|
}
|
|
@@ -23781,10 +23878,10 @@ var init_ConnectedApps = __esm({
|
|
|
23781
23878
|
// src/internal/components/SecurityMenu/ConnectedApps/UntrustApplication.tsx
|
|
23782
23879
|
function UntrustApplication() {
|
|
23783
23880
|
const { t } = useT();
|
|
23784
|
-
const qc = (0,
|
|
23881
|
+
const qc = (0, import_react_query45.useQueryClient)();
|
|
23785
23882
|
const userId = useSession((st) => st?.session?.mpcUserId);
|
|
23786
23883
|
const appToUntrust = useSecurityStore((st) => st.appToUntrust);
|
|
23787
|
-
const { mutate: handleUntrustApp, isPending: isUntrustingApp } = (0,
|
|
23884
|
+
const { mutate: handleUntrustApp, isPending: isUntrustingApp } = (0, import_react_query45.useMutation)({
|
|
23788
23885
|
mutationFn: async () => {
|
|
23789
23886
|
if (!userId || !appToUntrust) return;
|
|
23790
23887
|
const iframeManager = getIframeManager();
|
|
@@ -23860,12 +23957,12 @@ function UntrustApplication() {
|
|
|
23860
23957
|
] })
|
|
23861
23958
|
] });
|
|
23862
23959
|
}
|
|
23863
|
-
var
|
|
23960
|
+
var import_react_query45, import_lucide_react59, import_jsx_runtime102;
|
|
23864
23961
|
var init_UntrustApplication = __esm({
|
|
23865
23962
|
"src/internal/components/SecurityMenu/ConnectedApps/UntrustApplication.tsx"() {
|
|
23866
23963
|
init_SessionContext();
|
|
23867
23964
|
init_i18n();
|
|
23868
|
-
|
|
23965
|
+
import_react_query45 = require("@tanstack/react-query");
|
|
23869
23966
|
import_lucide_react59 = require("lucide-react");
|
|
23870
23967
|
init_iframe_manager();
|
|
23871
23968
|
init_button();
|
|
@@ -24004,7 +24101,7 @@ var init_LastBackup = __esm({
|
|
|
24004
24101
|
function useKeyshareRecoveryStats() {
|
|
24005
24102
|
const session = useSession((st) => st.session);
|
|
24006
24103
|
const userId = session?.mpcUserId || null;
|
|
24007
|
-
return (0,
|
|
24104
|
+
return (0, import_react_query46.useQuery)({
|
|
24008
24105
|
enabled: !!userId,
|
|
24009
24106
|
queryKey: [KEYSHARE_RECOVERY_STATS_QUERY, userId],
|
|
24010
24107
|
queryFn: async () => {
|
|
@@ -24021,11 +24118,11 @@ function useKeyshareRecoveryStats() {
|
|
|
24021
24118
|
}
|
|
24022
24119
|
});
|
|
24023
24120
|
}
|
|
24024
|
-
var
|
|
24121
|
+
var import_react_query46;
|
|
24025
24122
|
var init_useKeyshareRecoveryStats = __esm({
|
|
24026
24123
|
"src/internal/components/SecurityMenu/Keyshare/useKeyshareRecoveryStats.ts"() {
|
|
24027
24124
|
init_SessionContext();
|
|
24028
|
-
|
|
24125
|
+
import_react_query46 = require("@tanstack/react-query");
|
|
24029
24126
|
init_keyshare();
|
|
24030
24127
|
init_iframe_manager();
|
|
24031
24128
|
init_vaultClient();
|
|
@@ -24275,18 +24372,18 @@ var init_usePolicyForm = __esm({
|
|
|
24275
24372
|
// src/internal/components/SecurityMenu/UserPolicies/useUserAssetsPolicies.ts
|
|
24276
24373
|
function useUserAssetsPolicies(activeChainId) {
|
|
24277
24374
|
const mpcUserId = useSession((st) => st.session?.mpcUserId);
|
|
24278
|
-
return (0,
|
|
24375
|
+
return (0, import_react_query47.useQuery)({
|
|
24279
24376
|
retry: 1,
|
|
24280
24377
|
enabled: !!mpcUserId && !!activeChainId,
|
|
24281
24378
|
queryKey: [USER_POLICIES_QUERY_KEY, mpcUserId, activeChainId],
|
|
24282
24379
|
queryFn: async () => USER_ASSETS_POLICIES_API.getUserPolicy(mpcUserId, activeChainId)
|
|
24283
24380
|
});
|
|
24284
24381
|
}
|
|
24285
|
-
var
|
|
24382
|
+
var import_react_query47, USER_POLICIES_QUERY_KEY;
|
|
24286
24383
|
var init_useUserAssetsPolicies = __esm({
|
|
24287
24384
|
"src/internal/components/SecurityMenu/UserPolicies/useUserAssetsPolicies.ts"() {
|
|
24288
24385
|
init_SessionContext();
|
|
24289
|
-
|
|
24386
|
+
import_react_query47 = require("@tanstack/react-query");
|
|
24290
24387
|
init_api4();
|
|
24291
24388
|
USER_POLICIES_QUERY_KEY = "user-custom-policies-query";
|
|
24292
24389
|
}
|
|
@@ -24403,7 +24500,7 @@ function AddressListEditor(props) {
|
|
|
24403
24500
|
}
|
|
24404
24501
|
function PolicyForm() {
|
|
24405
24502
|
const { t } = useT();
|
|
24406
|
-
const qc = (0,
|
|
24503
|
+
const qc = (0, import_react_query48.useQueryClient)();
|
|
24407
24504
|
const activeChainId = useSession((st) => st.activeChainId);
|
|
24408
24505
|
const mpcUserId = useSession((st) => st.session?.mpcUserId);
|
|
24409
24506
|
const isAssetsLoading = false;
|
|
@@ -24415,7 +24512,7 @@ function PolicyForm() {
|
|
|
24415
24512
|
showFormErrors,
|
|
24416
24513
|
setShowFormErrors
|
|
24417
24514
|
} = useWatchFormData();
|
|
24418
|
-
const { mutate: submitPolicy, isPending: isPolicySubmitting } = (0,
|
|
24515
|
+
const { mutate: submitPolicy, isPending: isPolicySubmitting } = (0, import_react_query48.useMutation)({
|
|
24419
24516
|
mutationFn: async () => {
|
|
24420
24517
|
if (!mpcUserId || !activeChainId) {
|
|
24421
24518
|
throw new Error("User or active chain is not available");
|
|
@@ -24525,12 +24622,12 @@ function PolicyForm() {
|
|
|
24525
24622
|
showFormErrors && formErrorMessage && /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(Highlight, { type: "error", children: formErrorMessage })
|
|
24526
24623
|
] });
|
|
24527
24624
|
}
|
|
24528
|
-
var
|
|
24625
|
+
var import_react_query48, import_lucide_react63, import_react76, import_jsx_runtime106;
|
|
24529
24626
|
var init_PolicyForm = __esm({
|
|
24530
24627
|
"src/internal/components/SecurityMenu/UserPolicies/PolicyForm.tsx"() {
|
|
24531
24628
|
init_SessionContext();
|
|
24532
24629
|
init_useT();
|
|
24533
|
-
|
|
24630
|
+
import_react_query48 = require("@tanstack/react-query");
|
|
24534
24631
|
import_lucide_react63 = require("lucide-react");
|
|
24535
24632
|
import_react76 = require("react");
|
|
24536
24633
|
init_button();
|
|
@@ -24610,13 +24707,13 @@ function RulesSummary(props) {
|
|
|
24610
24707
|
}
|
|
24611
24708
|
function UserPolicies() {
|
|
24612
24709
|
const { t } = useT();
|
|
24613
|
-
const qc = (0,
|
|
24710
|
+
const qc = (0, import_react_query49.useQueryClient)();
|
|
24614
24711
|
const config = useProviderConfig().config;
|
|
24615
24712
|
const mpcUserId = useSession((st) => st.session?.mpcUserId);
|
|
24616
24713
|
const activeChainId = useSession((st) => st.activeChainId);
|
|
24617
24714
|
const [isConfirmingDelete, setIsConfirmingDelete] = (0, import_react77.useState)(false);
|
|
24618
24715
|
const { data: policyView, isLoading: isPolicyLoading } = useUserAssetsPolicies(activeChainId);
|
|
24619
|
-
const { mutate: cancelPending, isPending: isCancellingPending } = (0,
|
|
24716
|
+
const { mutate: cancelPending, isPending: isCancellingPending } = (0, import_react_query49.useMutation)({
|
|
24620
24717
|
mutationFn: async () => {
|
|
24621
24718
|
if (!mpcUserId || !activeChainId) {
|
|
24622
24719
|
throw new Error("User or active chain is not available");
|
|
@@ -24627,7 +24724,7 @@ function UserPolicies() {
|
|
|
24627
24724
|
await qc.invalidateQueries({ queryKey: [USER_POLICIES_QUERY_KEY] });
|
|
24628
24725
|
}
|
|
24629
24726
|
});
|
|
24630
|
-
const { mutate: deletePolicy, isPending: isDeletingPolicy } = (0,
|
|
24727
|
+
const { mutate: deletePolicy, isPending: isDeletingPolicy } = (0, import_react_query49.useMutation)({
|
|
24631
24728
|
mutationFn: async () => {
|
|
24632
24729
|
if (!mpcUserId || !activeChainId) {
|
|
24633
24730
|
throw new Error("User or active chain is not available");
|
|
@@ -24727,13 +24824,13 @@ function UserPolicies() {
|
|
|
24727
24824
|
] })
|
|
24728
24825
|
] });
|
|
24729
24826
|
}
|
|
24730
|
-
var
|
|
24827
|
+
var import_react_query49, import_clsx3, import_lucide_react64, import_react77, import_jsx_runtime107;
|
|
24731
24828
|
var init_UserPolicies = __esm({
|
|
24732
24829
|
"src/internal/components/SecurityMenu/UserPolicies/UserPolicies.tsx"() {
|
|
24733
24830
|
init_ProviderContext();
|
|
24734
24831
|
init_SessionContext();
|
|
24735
24832
|
init_useT();
|
|
24736
|
-
|
|
24833
|
+
import_react_query49 = require("@tanstack/react-query");
|
|
24737
24834
|
import_clsx3 = __toESM(require("clsx"), 1);
|
|
24738
24835
|
import_lucide_react64 = require("lucide-react");
|
|
24739
24836
|
import_react77 = require("react");
|
|
@@ -25576,7 +25673,7 @@ function useHyperlaneHistory() {
|
|
|
25576
25673
|
const page = useLayoutDataStore((st) => st.page);
|
|
25577
25674
|
const flow = useFlowSelectorStore((st) => st.flow);
|
|
25578
25675
|
const bridgeStep = useBridgeStore((st) => st.bridgeStep);
|
|
25579
|
-
const query = (0,
|
|
25676
|
+
const query = (0, import_react_query50.useInfiniteQuery)({
|
|
25580
25677
|
retry: false,
|
|
25581
25678
|
initialPageParam: 1,
|
|
25582
25679
|
refetchInterval: TX_HISTORY_POLLING_INTERVAL,
|
|
@@ -25591,11 +25688,11 @@ function useHyperlaneHistory() {
|
|
|
25591
25688
|
);
|
|
25592
25689
|
return { query, txList };
|
|
25593
25690
|
}
|
|
25594
|
-
var
|
|
25691
|
+
var import_react_query50, import_react81, HYPERLANE_HISTORY_QUERY_KEY, TX_HISTORY_PAGE_SIZE, TX_HISTORY_POLLING_INTERVAL;
|
|
25595
25692
|
var init_useHyperlaneHistory = __esm({
|
|
25596
25693
|
"src/internal/components/SendMenu/hyperbridge/hooks/useHyperlaneHistory.ts"() {
|
|
25597
25694
|
init_SessionContext();
|
|
25598
|
-
|
|
25695
|
+
import_react_query50 = require("@tanstack/react-query");
|
|
25599
25696
|
import_react81 = require("react");
|
|
25600
25697
|
init_useLayoutDataStore();
|
|
25601
25698
|
init_useFlowSelector();
|
|
@@ -25623,7 +25720,7 @@ var init_useOperationHashesStore = __esm({
|
|
|
25623
25720
|
|
|
25624
25721
|
// src/internal/components/SendMenu/hyperbridge/hooks/useBridge.ts
|
|
25625
25722
|
function useBridge() {
|
|
25626
|
-
const qc = (0,
|
|
25723
|
+
const qc = (0, import_react_query51.useQueryClient)();
|
|
25627
25724
|
const { t } = useT();
|
|
25628
25725
|
const address = useSession((st) => st.address);
|
|
25629
25726
|
const { data: walletClient } = (0, import_wagmi5.useWalletClient)();
|
|
@@ -25641,7 +25738,7 @@ function useBridge() {
|
|
|
25641
25738
|
setOriginChain(destinationChain);
|
|
25642
25739
|
setDestinationChain(originChain);
|
|
25643
25740
|
}, []);
|
|
25644
|
-
const { mutate: estimateQuote } = (0,
|
|
25741
|
+
const { mutate: estimateQuote } = (0, import_react_query51.useMutation)({
|
|
25645
25742
|
mutationFn: async (amountToBridge) => {
|
|
25646
25743
|
useFlowSelectorStore.getState().setError(null);
|
|
25647
25744
|
useFlowSelectorStore.getState().setIsUiLocked(true);
|
|
@@ -25708,7 +25805,7 @@ function useBridge() {
|
|
|
25708
25805
|
})
|
|
25709
25806
|
);
|
|
25710
25807
|
}, []);
|
|
25711
|
-
const { mutate: bridgeAsset, isPending: isAssetBridging } = (0,
|
|
25808
|
+
const { mutate: bridgeAsset, isPending: isAssetBridging } = (0, import_react_query51.useMutation)({
|
|
25712
25809
|
mutationFn: async () => {
|
|
25713
25810
|
const directWalletAddress = useExternalWalletStore.getState().externalAddress;
|
|
25714
25811
|
const directWalletChainId = useExternalWalletStore.getState().externalChainId;
|
|
@@ -25814,12 +25911,12 @@ function useBridge() {
|
|
|
25814
25911
|
isAssetBridging
|
|
25815
25912
|
};
|
|
25816
25913
|
}
|
|
25817
|
-
var
|
|
25914
|
+
var import_react_query51, import_react82, import_wagmi5;
|
|
25818
25915
|
var init_useBridge = __esm({
|
|
25819
25916
|
"src/internal/components/SendMenu/hyperbridge/hooks/useBridge.ts"() {
|
|
25820
25917
|
init_SessionContext();
|
|
25821
25918
|
init_i18n();
|
|
25822
|
-
|
|
25919
|
+
import_react_query51 = require("@tanstack/react-query");
|
|
25823
25920
|
import_react82 = require("react");
|
|
25824
25921
|
import_wagmi5 = require("wagmi");
|
|
25825
25922
|
init_useLayoutStore();
|
|
@@ -25845,7 +25942,7 @@ function useHyperlaneRoutes() {
|
|
|
25845
25942
|
data: hyperlaneWarpRoutes = [],
|
|
25846
25943
|
isLoading: isLoadingWarpRoutes,
|
|
25847
25944
|
error: errorWarpRoutes
|
|
25848
|
-
} = (0,
|
|
25945
|
+
} = (0, import_react_query52.useQuery)({
|
|
25849
25946
|
retry: false,
|
|
25850
25947
|
enabled: !!address && page === "send" /* SEND */ && flow === "bridge",
|
|
25851
25948
|
queryKey: [HYPERLANE_WARP_ROUTES_QUERY_KEY, address],
|
|
@@ -25885,11 +25982,11 @@ function useHyperlaneRoutes() {
|
|
|
25885
25982
|
}, [hyperRoute, hyperlaneWarpRoutes]);
|
|
25886
25983
|
return { hyperlaneWarpRoutes, isLoadingWarpRoutes };
|
|
25887
25984
|
}
|
|
25888
|
-
var
|
|
25985
|
+
var import_react_query52, import_react83, HYPERLANE_WARP_ROUTES_QUERY_KEY;
|
|
25889
25986
|
var init_useHyperlaneRoutes = __esm({
|
|
25890
25987
|
"src/internal/components/SendMenu/hyperbridge/hooks/useHyperlaneRoutes.ts"() {
|
|
25891
25988
|
init_SessionContext();
|
|
25892
|
-
|
|
25989
|
+
import_react_query52 = require("@tanstack/react-query");
|
|
25893
25990
|
import_react83 = require("react");
|
|
25894
25991
|
init_useLayoutDataStore();
|
|
25895
25992
|
init_useFlowSelector();
|
|
@@ -26102,7 +26199,7 @@ var init_ResolveChainIcon = __esm({
|
|
|
26102
26199
|
|
|
26103
26200
|
// src/internal/components/SendMenu/hyperbridge/hooks/useBridgeBalance.ts
|
|
26104
26201
|
function useBridgeBalance(isLoadingWarpRoutes, hyperlaneWarpRoutes) {
|
|
26105
|
-
const qc = (0,
|
|
26202
|
+
const qc = (0, import_react_query53.useQueryClient)();
|
|
26106
26203
|
const { t } = useT();
|
|
26107
26204
|
const address = useSession((st) => st.address);
|
|
26108
26205
|
const activeChainId = useSession((st) => st.activeChainId);
|
|
@@ -26130,7 +26227,7 @@ function useBridgeBalance(isLoadingWarpRoutes, hyperlaneWarpRoutes) {
|
|
|
26130
26227
|
const embarkTokenBalanace = assets.find((a) => selectedWarpRoute?.symbol === checkWrapedTokenSymbol(a.symbol));
|
|
26131
26228
|
const originChainMeta = CHAINS_UI_META[originChain];
|
|
26132
26229
|
const isSelectedTokenNative = selectedWarpRoute?.symbol?.toUpperCase() === originChainMeta?.chain?.nativeCurrency?.symbol?.toUpperCase();
|
|
26133
|
-
const { data: externalBalanceData, isLoading: isExternalBalanceLoading } = (0,
|
|
26230
|
+
const { data: externalBalanceData, isLoading: isExternalBalanceLoading } = (0, import_react_query53.useQuery)({
|
|
26134
26231
|
retry: false,
|
|
26135
26232
|
enabled: bridgeSender === "direct-wallet" && !isSelectedTokenNative && !!directWalletAddress && !!routeTokenAddress && !!originChain,
|
|
26136
26233
|
queryKey: [EXTERNAL_WALLET_BRIDGING_BALANCE_QUERY, originChain, directWalletAddress, routeTokenAddress],
|
|
@@ -26173,7 +26270,7 @@ function useBridgeBalance(isLoadingWarpRoutes, hyperlaneWarpRoutes) {
|
|
|
26173
26270
|
return { value, decimals, symbol, formatted };
|
|
26174
26271
|
}
|
|
26175
26272
|
});
|
|
26176
|
-
const { data: externalNativeBalanceData, isLoading: isExternalNativeBalanceLoading } = (0,
|
|
26273
|
+
const { data: externalNativeBalanceData, isLoading: isExternalNativeBalanceLoading } = (0, import_react_query53.useQuery)({
|
|
26177
26274
|
retry: false,
|
|
26178
26275
|
enabled: bridgeSender === "direct-wallet" && isSelectedTokenNative && !!directWalletAddress && !!originChain,
|
|
26179
26276
|
queryKey: [EXTERNAL_WALLET_BRIDGING_NATIVE_BALANCE_QUERY, originChain, directWalletAddress],
|
|
@@ -26235,13 +26332,13 @@ function useBridgeBalance(isLoadingWarpRoutes, hyperlaneWarpRoutes) {
|
|
|
26235
26332
|
isRouteTokenBalanceLoading: isAssetsLoading || isExternalBalanceLoading || isExternalNativeBalanceLoading
|
|
26236
26333
|
};
|
|
26237
26334
|
}
|
|
26238
|
-
var import_core8,
|
|
26335
|
+
var import_core8, import_react_query53, import_react85, import_viem15, import_wagmi6, EXTERNAL_WALLET_BRIDGING_BALANCE_QUERY, EXTERNAL_WALLET_BRIDGING_NATIVE_BALANCE_QUERY;
|
|
26239
26336
|
var init_useBridgeBalance = __esm({
|
|
26240
26337
|
"src/internal/components/SendMenu/hyperbridge/hooks/useBridgeBalance.ts"() {
|
|
26241
26338
|
init_SessionContext();
|
|
26242
26339
|
init_i18n();
|
|
26243
26340
|
import_core8 = require("@embarkai/core");
|
|
26244
|
-
|
|
26341
|
+
import_react_query53 = require("@tanstack/react-query");
|
|
26245
26342
|
import_react85 = require("react");
|
|
26246
26343
|
import_viem15 = require("viem");
|
|
26247
26344
|
import_wagmi6 = require("wagmi");
|
|
@@ -26916,7 +27013,7 @@ function HistoryItem(props) {
|
|
|
26916
27013
|
txStatus
|
|
26917
27014
|
} = props;
|
|
26918
27015
|
const { t } = useT();
|
|
26919
|
-
const qc = (0,
|
|
27016
|
+
const qc = (0, import_react_query54.useQueryClient)();
|
|
26920
27017
|
const address = useSession((st) => st.address);
|
|
26921
27018
|
const warpRoutes = qc.getQueryData([HYPERLANE_WARP_ROUTES_QUERY_KEY, address]);
|
|
26922
27019
|
const assetWarpRoute = warpRoutes?.find((route) => {
|
|
@@ -27042,12 +27139,12 @@ function HistoryStep() {
|
|
|
27042
27139
|
)
|
|
27043
27140
|
] });
|
|
27044
27141
|
}
|
|
27045
|
-
var
|
|
27142
|
+
var import_react_query54, import_dayjs8, import_lucide_react70, import_jsx_runtime115, P_CN3;
|
|
27046
27143
|
var init_HistoryStep = __esm({
|
|
27047
27144
|
"src/internal/components/SendMenu/hyperbridge/steps/HistoryStep.tsx"() {
|
|
27048
27145
|
init_SessionContext();
|
|
27049
27146
|
init_i18n();
|
|
27050
|
-
|
|
27147
|
+
import_react_query54 = require("@tanstack/react-query");
|
|
27051
27148
|
import_dayjs8 = __toESM(require("dayjs"), 1);
|
|
27052
27149
|
import_lucide_react70 = require("lucide-react");
|
|
27053
27150
|
init_tokens();
|
|
@@ -27367,7 +27464,7 @@ function useNicknameResolve(input, options) {
|
|
|
27367
27464
|
clearTimeout(timer);
|
|
27368
27465
|
};
|
|
27369
27466
|
}, [normalized, isNicknameInput, enabled]);
|
|
27370
|
-
const query = (0,
|
|
27467
|
+
const query = (0, import_react_query55.useQuery)({
|
|
27371
27468
|
queryKey: [...QUERY_KEYS.nicknameResolve(debouncedInput), chainId],
|
|
27372
27469
|
queryFn: async () => await resolveNickname(debouncedInput, chainId),
|
|
27373
27470
|
enabled: enabled && isNicknameInput && debouncedInput.length > 0,
|
|
@@ -27400,10 +27497,10 @@ function useNicknameResolve(input, options) {
|
|
|
27400
27497
|
resolvedAddress
|
|
27401
27498
|
};
|
|
27402
27499
|
}
|
|
27403
|
-
var
|
|
27500
|
+
var import_react_query55, import_react91, DEBOUNCE_MS2;
|
|
27404
27501
|
var init_useNicknameResolve = __esm({
|
|
27405
27502
|
"src/hooks/useNicknameResolve.ts"() {
|
|
27406
|
-
|
|
27503
|
+
import_react_query55 = require("@tanstack/react-query");
|
|
27407
27504
|
import_react91 = require("react");
|
|
27408
27505
|
init_nickname();
|
|
27409
27506
|
init_profile();
|
|
@@ -27921,7 +28018,7 @@ function isNftAsset4(asset) {
|
|
|
27921
28018
|
function useTokenBalance(asset) {
|
|
27922
28019
|
const address = useSession((st) => st.address);
|
|
27923
28020
|
const chainConfig = useSession((st) => st.chainConfig);
|
|
27924
|
-
return (0,
|
|
28021
|
+
return (0, import_react_query56.useQuery)({
|
|
27925
28022
|
retry: false,
|
|
27926
28023
|
enabled: !!address && !!chainConfig?.id && !!asset?.symbol,
|
|
27927
28024
|
refetchInterval: 5e3,
|
|
@@ -27985,11 +28082,11 @@ function useTokenBalance(asset) {
|
|
|
27985
28082
|
}
|
|
27986
28083
|
});
|
|
27987
28084
|
}
|
|
27988
|
-
var
|
|
28085
|
+
var import_react_query56, import_viem19, SEND_TOKEN_BALANCE_QUERY_KEY;
|
|
27989
28086
|
var init_useTokenBalance = __esm({
|
|
27990
28087
|
"src/internal/components/SendMenu/send/useTokenBalance.ts"() {
|
|
27991
28088
|
init_SessionContext();
|
|
27992
|
-
|
|
28089
|
+
import_react_query56 = require("@tanstack/react-query");
|
|
27993
28090
|
import_viem19 = require("viem");
|
|
27994
28091
|
SEND_TOKEN_BALANCE_QUERY_KEY = "current-chain-send-token-balance-query";
|
|
27995
28092
|
}
|
|
@@ -28221,7 +28318,7 @@ function ConfirmSendStep(props) {
|
|
|
28221
28318
|
const isNft = isNftAsset3(selectedAsset);
|
|
28222
28319
|
const isSecurity = isSecurityToken2(selectedAsset);
|
|
28223
28320
|
const effectiveAddress = isNicknameInput ? resolvedAddress : recipient;
|
|
28224
|
-
const { mutate: handleConfirm, isPending: isTransactionPending } = (0,
|
|
28321
|
+
const { mutate: handleConfirm, isPending: isTransactionPending } = (0, import_react_query57.useMutation)({
|
|
28225
28322
|
mutationFn: async () => {
|
|
28226
28323
|
if (!effectiveAddress || !selectedAsset) return;
|
|
28227
28324
|
setTxStep("pending");
|
|
@@ -28382,12 +28479,12 @@ function ConfirmSendStep(props) {
|
|
|
28382
28479
|
}
|
|
28383
28480
|
);
|
|
28384
28481
|
}
|
|
28385
|
-
var
|
|
28482
|
+
var import_react_query57, import_lucide_react76, import_jsx_runtime124;
|
|
28386
28483
|
var init_ConfirmSendStep = __esm({
|
|
28387
28484
|
"src/internal/components/SendMenu/send/sendSteps/ConfirmSendStep.tsx"() {
|
|
28388
28485
|
init_SessionContext();
|
|
28389
28486
|
init_i18n();
|
|
28390
|
-
|
|
28487
|
+
import_react_query57 = require("@tanstack/react-query");
|
|
28391
28488
|
import_lucide_react76 = require("lucide-react");
|
|
28392
28489
|
init_priceFormatter();
|
|
28393
28490
|
init_utils();
|
|
@@ -29652,7 +29749,7 @@ var init_TransactionsGroup = __esm({
|
|
|
29652
29749
|
|
|
29653
29750
|
// src/internal/components/TransactionsMenu/TransactionsMenu.tsx
|
|
29654
29751
|
function TransactionsMenu() {
|
|
29655
|
-
const qc = (0,
|
|
29752
|
+
const qc = (0, import_react_query58.useQueryClient)();
|
|
29656
29753
|
const address = useSession((st) => st.address);
|
|
29657
29754
|
const chainConfig = useSession((st) => st.chainConfig);
|
|
29658
29755
|
const { t } = useT();
|
|
@@ -29665,7 +29762,7 @@ function TransactionsMenu() {
|
|
|
29665
29762
|
isLoading: isTxHistoryLoading,
|
|
29666
29763
|
isFetching: isTxHistoryFetching,
|
|
29667
29764
|
error: txHistoryError
|
|
29668
|
-
} = (0,
|
|
29765
|
+
} = (0, import_react_query58.useQuery)({
|
|
29669
29766
|
retry: false,
|
|
29670
29767
|
enabled: !!address && !!chainConfig?.id && historySupported,
|
|
29671
29768
|
queryKey: [TRANSACTIONS_HISTORY_QUERY_KEY, chainConfig.id, address],
|
|
@@ -29710,12 +29807,12 @@ function TransactionsMenu() {
|
|
|
29710
29807
|
)) })
|
|
29711
29808
|
] });
|
|
29712
29809
|
}
|
|
29713
|
-
var
|
|
29810
|
+
var import_react_query58, import_lucide_react80, import_react99, import_jsx_runtime128;
|
|
29714
29811
|
var init_TransactionsMenu = __esm({
|
|
29715
29812
|
"src/internal/components/TransactionsMenu/TransactionsMenu.tsx"() {
|
|
29716
29813
|
init_SessionContext();
|
|
29717
29814
|
init_i18n();
|
|
29718
|
-
|
|
29815
|
+
import_react_query58 = require("@tanstack/react-query");
|
|
29719
29816
|
import_lucide_react80 = require("lucide-react");
|
|
29720
29817
|
import_react99 = require("react");
|
|
29721
29818
|
init_useLayoutDataStore();
|
|
@@ -29802,7 +29899,7 @@ function SettingsMenu() {
|
|
|
29802
29899
|
const setPage = useLayoutDataStore((st) => st.setPage);
|
|
29803
29900
|
const settingsButtons = useSettingsButtons(activeChainId);
|
|
29804
29901
|
useProvidersList();
|
|
29805
|
-
(0,
|
|
29902
|
+
(0, import_react_query59.useQuery)({
|
|
29806
29903
|
retry: 1,
|
|
29807
29904
|
enabled: !!address,
|
|
29808
29905
|
queryKey: [QUERY_KEYS.nicknameInfo, address],
|
|
@@ -29834,13 +29931,13 @@ function SettingsMenu() {
|
|
|
29834
29931
|
)) })
|
|
29835
29932
|
] });
|
|
29836
29933
|
}
|
|
29837
|
-
var
|
|
29934
|
+
var import_react_query59, import_lucide_react82, import_jsx_runtime129;
|
|
29838
29935
|
var init_SettingsMenu = __esm({
|
|
29839
29936
|
"src/internal/components/SettingsMenu/SettingsMenu.tsx"() {
|
|
29840
29937
|
init_ProviderContext();
|
|
29841
29938
|
init_SessionContext();
|
|
29842
29939
|
init_i18n();
|
|
29843
|
-
|
|
29940
|
+
import_react_query59 = require("@tanstack/react-query");
|
|
29844
29941
|
import_lucide_react82 = require("lucide-react");
|
|
29845
29942
|
init_nickname();
|
|
29846
29943
|
init_profile();
|
|
@@ -30146,7 +30243,7 @@ var init_package = __esm({
|
|
|
30146
30243
|
"package.json"() {
|
|
30147
30244
|
package_default = {
|
|
30148
30245
|
name: "@embarkai/ui-kit",
|
|
30149
|
-
version: "0.4.
|
|
30246
|
+
version: "0.4.118",
|
|
30150
30247
|
description: "React UI components and hooks for EmbarkAI authentication and Account Abstraction",
|
|
30151
30248
|
type: "module",
|
|
30152
30249
|
main: "./dist/index.cjs",
|
|
@@ -30251,7 +30348,7 @@ var init_package = __esm({
|
|
|
30251
30348
|
|
|
30252
30349
|
// src/internal/components/Footer/Footer.tsx
|
|
30253
30350
|
function Footer() {
|
|
30254
|
-
const qc = (0,
|
|
30351
|
+
const qc = (0, import_react_query60.useQueryClient)();
|
|
30255
30352
|
const { callbacksRef, config } = useProviderConfig();
|
|
30256
30353
|
const { t } = useT();
|
|
30257
30354
|
const address = useSession((st) => st.address);
|
|
@@ -30268,7 +30365,7 @@ function Footer() {
|
|
|
30268
30365
|
}
|
|
30269
30366
|
}
|
|
30270
30367
|
});
|
|
30271
|
-
const { mutate: disconnect, isPending: isDisconnecting } = (0,
|
|
30368
|
+
const { mutate: disconnect, isPending: isDisconnecting } = (0, import_react_query60.useMutation)({
|
|
30272
30369
|
mutationFn: async (disconnectAddress) => {
|
|
30273
30370
|
if (!disconnectAddress) throw new Error("No address to disconnect");
|
|
30274
30371
|
const { setError, setStatus, setIsLoading } = useSession.getState();
|
|
@@ -30363,7 +30460,7 @@ function Footer() {
|
|
|
30363
30460
|
}
|
|
30364
30461
|
);
|
|
30365
30462
|
}
|
|
30366
|
-
var
|
|
30463
|
+
var import_react_query60, import_lucide_react83, import_jsx_runtime131, FOOTER_ONBOARDING_CHAIN_BUTTON, FOOTER_ONBOARDING_LOGOUT_BUTTON, FOOTER_TOUR;
|
|
30367
30464
|
var init_Footer = __esm({
|
|
30368
30465
|
"src/internal/components/Footer/Footer.tsx"() {
|
|
30369
30466
|
init_package();
|
|
@@ -30372,7 +30469,7 @@ var init_Footer = __esm({
|
|
|
30372
30469
|
init_SessionContext();
|
|
30373
30470
|
init_i18n();
|
|
30374
30471
|
init_useSafeDisconnect();
|
|
30375
|
-
|
|
30472
|
+
import_react_query60 = require("@tanstack/react-query");
|
|
30376
30473
|
import_lucide_react83 = require("lucide-react");
|
|
30377
30474
|
init_auth();
|
|
30378
30475
|
init_base3();
|