@lumiapassport/ui-kit 1.14.11 → 1.14.12
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 +36 -30
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +61 -55
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5267,7 +5267,7 @@ function Header() {
|
|
|
5267
5267
|
// package.json
|
|
5268
5268
|
var package_default = {
|
|
5269
5269
|
name: "@lumiapassport/ui-kit",
|
|
5270
|
-
version: "1.14.
|
|
5270
|
+
version: "1.14.12",
|
|
5271
5271
|
description: "React UI components and hooks for Lumia Passport authentication and Account Abstraction",
|
|
5272
5272
|
type: "module",
|
|
5273
5273
|
main: "./dist/index.cjs",
|
|
@@ -8286,7 +8286,7 @@ function BuyMenu() {
|
|
|
8286
8286
|
}
|
|
8287
8287
|
|
|
8288
8288
|
// src/internal/components/KeyshareRestoreMenu/KeyshareRestoreMenu.tsx
|
|
8289
|
-
import { useMutation as useMutation10, useQuery as
|
|
8289
|
+
import { useMutation as useMutation10, useQuery as useQuery7, useQueryClient as useQueryClient8 } from "@tanstack/react-query";
|
|
8290
8290
|
import { AlertCircle as AlertCircle2, CheckCircle2, CloudDownload as CloudDownload2, Loader as Loader8, UserCircle as UserCircle2 } from "lucide-react";
|
|
8291
8291
|
import { useEffect as useEffect20 } from "react";
|
|
8292
8292
|
init_vaultClient();
|
|
@@ -9127,21 +9127,17 @@ function File2(props) {
|
|
|
9127
9127
|
}
|
|
9128
9128
|
|
|
9129
9129
|
// src/internal/components/KeyshareRestoreMenu/methods/Server.tsx
|
|
9130
|
-
|
|
9131
|
-
import { useQuery as useQuery6 } from "@tanstack/react-query";
|
|
9130
|
+
import { useQueryClient as useQueryClient7 } from "@tanstack/react-query";
|
|
9132
9131
|
import dayjs from "dayjs";
|
|
9133
9132
|
import { ArrowLeft as ArrowLeft7, Download, Key as Key4, Upload as Upload2 } from "lucide-react";
|
|
9134
9133
|
import { useEffect as useEffect18 } from "react";
|
|
9135
9134
|
import { Fragment as Fragment10, jsx as jsx42, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
9136
9135
|
function Server(props) {
|
|
9137
9136
|
const { isLoading, mode = "restore", serverHandler } = props;
|
|
9137
|
+
const qc = useQueryClient7();
|
|
9138
9138
|
const address = useLumiaPassportSession((st) => st.address);
|
|
9139
9139
|
const { usePasskey, setUsePasskey, setRestorePassword, setShowPassword, setMethod, setError, setSuccess } = useRestoreStore();
|
|
9140
|
-
const
|
|
9141
|
-
retry: false,
|
|
9142
|
-
queryKey: [CHECK_BACKUP_QUERY_KEY, address],
|
|
9143
|
-
queryFn: async () => await getShareRecoveryStats()
|
|
9144
|
-
});
|
|
9140
|
+
const serverRecoveryStatus = qc.getQueryData([CHECK_BACKUP_QUERY_KEY, address]);
|
|
9145
9141
|
useEffect18(() => {
|
|
9146
9142
|
if (mode === "backup" || !serverRecoveryStatus?.created?.encryptionMethod) return;
|
|
9147
9143
|
setUsePasskey(serverRecoveryStatus.created.encryptionMethod === "passkey");
|
|
@@ -9194,7 +9190,7 @@ function Server(props) {
|
|
|
9194
9190
|
}
|
|
9195
9191
|
|
|
9196
9192
|
// src/internal/components/KeyshareRestoreMenu/methods/Cloud.tsx
|
|
9197
|
-
import { useQuery as
|
|
9193
|
+
import { useQuery as useQuery6 } from "@tanstack/react-query";
|
|
9198
9194
|
import { ArrowLeft as ArrowLeft8, CloudDownload, CloudUpload, Loader as Loader7 } from "lucide-react";
|
|
9199
9195
|
import { useEffect as useEffect19 } from "react";
|
|
9200
9196
|
|
|
@@ -9334,7 +9330,7 @@ function Cloud2(props) {
|
|
|
9334
9330
|
data: cloudProviders = [],
|
|
9335
9331
|
isLoading: isCloudProvidersLoading,
|
|
9336
9332
|
error: cloudProvidersError
|
|
9337
|
-
} =
|
|
9333
|
+
} = useQuery6({
|
|
9338
9334
|
retry: false,
|
|
9339
9335
|
enabled: !!passportUserId,
|
|
9340
9336
|
queryKey: [AVAILABLE_CLOUD_PROVIDERS_QUERY_KEY, passportUserId],
|
|
@@ -9417,10 +9413,10 @@ var RESTORE_COMPONENTS = {
|
|
|
9417
9413
|
file: File2
|
|
9418
9414
|
};
|
|
9419
9415
|
var KeyshareRestoreMenu = () => {
|
|
9420
|
-
const qc =
|
|
9416
|
+
const qc = useQueryClient8();
|
|
9421
9417
|
const callbacks = useLumiaPassportConfig().callbacks;
|
|
9422
9418
|
const { address, setSession, setAddress, setStatus, setIsLoading } = useLumiaPassportSession();
|
|
9423
|
-
const { data: serverRecoveryStatus,
|
|
9419
|
+
const { data: serverRecoveryStatus, isLoading: isBackupStatusLoading } = useQuery7({
|
|
9424
9420
|
retry: false,
|
|
9425
9421
|
queryKey: [CHECK_BACKUP_QUERY_KEY, address],
|
|
9426
9422
|
queryFn: async () => await getShareRecoveryStats()
|
|
@@ -9558,7 +9554,7 @@ var KeyshareRestoreMenu = () => {
|
|
|
9558
9554
|
};
|
|
9559
9555
|
|
|
9560
9556
|
// src/internal/components/KeyshareRestoreMenu/KeyshareBackupMenu.tsx
|
|
9561
|
-
import { useQuery as
|
|
9557
|
+
import { useQuery as useQuery8 } from "@tanstack/react-query";
|
|
9562
9558
|
import { AlertCircle as AlertCircle3, ArrowLeft as ArrowLeft9, CheckCircle2 as CheckCircle22 } from "lucide-react";
|
|
9563
9559
|
import { useEffect as useEffect21 } from "react";
|
|
9564
9560
|
init_vaultClient();
|
|
@@ -9586,7 +9582,7 @@ function KeyshareBackupMenu() {
|
|
|
9586
9582
|
setShowPassword,
|
|
9587
9583
|
setUsePasskey
|
|
9588
9584
|
} = useRestoreStore();
|
|
9589
|
-
const { data: serverRecoveryStatus } =
|
|
9585
|
+
const { data: serverRecoveryStatus } = useQuery8({
|
|
9590
9586
|
retry: false,
|
|
9591
9587
|
queryKey: [CHECK_BACKUP_QUERY_KEY, address],
|
|
9592
9588
|
queryFn: async () => await getShareRecoveryStats()
|
|
@@ -9669,12 +9665,12 @@ import { useEffect as useEffect22 } from "react";
|
|
|
9669
9665
|
|
|
9670
9666
|
// src/internal/components/ManageWalletMenu/hooks/useProvidersList.ts
|
|
9671
9667
|
init_common();
|
|
9672
|
-
import { useQuery as
|
|
9668
|
+
import { useQuery as useQuery9 } from "@tanstack/react-query";
|
|
9673
9669
|
var PROVIDERS_QUERY_KEY = "lumia-passport-providers-query";
|
|
9674
9670
|
function useProvidersList() {
|
|
9675
9671
|
const address = useLumiaPassportSession((st) => st.address);
|
|
9676
9672
|
const page = useLayoutDataStore((st) => st.page);
|
|
9677
|
-
return
|
|
9673
|
+
return useQuery9({
|
|
9678
9674
|
retry: false,
|
|
9679
9675
|
// hook is invoked on multiple pages to preload cache
|
|
9680
9676
|
enabled: !!address && (page === "manage-wallet" /* MANAGE_WALLET */ || page === "settings" /* SETTINGS */ || page === "main-menu" /* MAIN_MENU */),
|
|
@@ -9720,7 +9716,7 @@ import { AlertTriangle as AlertTriangle3, ArrowLeft as ArrowLeft10, Loader as Lo
|
|
|
9720
9716
|
import { useMemo as useMemo3 } from "react";
|
|
9721
9717
|
|
|
9722
9718
|
// src/modules/linkedProfiles.ts
|
|
9723
|
-
import { useQuery as
|
|
9719
|
+
import { useQuery as useQuery10, useQueryClient as useQueryClient9 } from "@tanstack/react-query";
|
|
9724
9720
|
import { useCallback as useCallback10 } from "react";
|
|
9725
9721
|
init_auth();
|
|
9726
9722
|
init_common();
|
|
@@ -9741,13 +9737,13 @@ async function getLinkProfilesData() {
|
|
|
9741
9737
|
return { profiles: loadedProfiles, avatar };
|
|
9742
9738
|
}
|
|
9743
9739
|
function useLumiaPassportLinkedProfiles() {
|
|
9744
|
-
const qc =
|
|
9740
|
+
const qc = useQueryClient9();
|
|
9745
9741
|
const address = useLumiaPassportSession((st) => st.address);
|
|
9746
9742
|
const {
|
|
9747
9743
|
data,
|
|
9748
9744
|
isFetching: isLoading,
|
|
9749
9745
|
error
|
|
9750
|
-
} =
|
|
9746
|
+
} = useQuery10({
|
|
9751
9747
|
retry: false,
|
|
9752
9748
|
enabled: !!address,
|
|
9753
9749
|
queryKey: [LINKED_PROFILES_QUERY_KEY, address],
|
|
@@ -9761,7 +9757,7 @@ function useLumiaPassportLinkedProfiles() {
|
|
|
9761
9757
|
}
|
|
9762
9758
|
|
|
9763
9759
|
// src/internal/components/ManageWalletMenu/AddProvider.tsx
|
|
9764
|
-
import { useQueryClient as
|
|
9760
|
+
import { useQueryClient as useQueryClient11 } from "@tanstack/react-query";
|
|
9765
9761
|
init_passkey2();
|
|
9766
9762
|
|
|
9767
9763
|
// src/internal/components/ManageWalletMenu/EmailForm.tsx
|
|
@@ -9917,11 +9913,11 @@ function useSendVerificationCode() {
|
|
|
9917
9913
|
}
|
|
9918
9914
|
|
|
9919
9915
|
// src/internal/components/ManageWalletMenu/hooks/useVerifyCode.ts
|
|
9920
|
-
import { useMutation as useMutation13, useQueryClient as
|
|
9916
|
+
import { useMutation as useMutation13, useQueryClient as useQueryClient10 } from "@tanstack/react-query";
|
|
9921
9917
|
init_email();
|
|
9922
9918
|
function useVerifyCode() {
|
|
9923
9919
|
const { callbacks } = useLumiaPassportConfig();
|
|
9924
|
-
const qc =
|
|
9920
|
+
const qc = useQueryClient10();
|
|
9925
9921
|
const address = useLumiaPassportSession((st) => st.address);
|
|
9926
9922
|
const setIsLoading = useLumiaPassportSession((st) => st.setIsLoading);
|
|
9927
9923
|
const { email, emailCode, setEmail, setEmailStep, setEmailCode, setProviderType, setLinkIsLoading, setAlert } = useManageWalletStore();
|
|
@@ -9973,7 +9969,7 @@ function normalizePasskeyLinkError(msg) {
|
|
|
9973
9969
|
return msg;
|
|
9974
9970
|
}
|
|
9975
9971
|
function AddProvider() {
|
|
9976
|
-
const qc =
|
|
9972
|
+
const qc = useQueryClient11();
|
|
9977
9973
|
const callbacks = useLumiaPassportConfig().callbacks;
|
|
9978
9974
|
const address = useLumiaPassportSession((st) => st.address);
|
|
9979
9975
|
const {
|
|
@@ -10133,11 +10129,11 @@ function EmailNotConnectedWarning() {
|
|
|
10133
10129
|
}
|
|
10134
10130
|
|
|
10135
10131
|
// src/internal/components/ManageWalletMenu/hooks/useLinkSocial.ts
|
|
10136
|
-
import { useQueryClient as
|
|
10132
|
+
import { useQueryClient as useQueryClient12 } from "@tanstack/react-query";
|
|
10137
10133
|
import React6, { useEffect as useEffect23 } from "react";
|
|
10138
10134
|
init_auth();
|
|
10139
10135
|
function useLinkSocial() {
|
|
10140
|
-
const qc =
|
|
10136
|
+
const qc = useQueryClient12();
|
|
10141
10137
|
const address = useLumiaPassportSession((st) => st.address);
|
|
10142
10138
|
const {
|
|
10143
10139
|
config: { current: config },
|
|
@@ -10220,14 +10216,14 @@ function useLinkSocial() {
|
|
|
10220
10216
|
|
|
10221
10217
|
// src/internal/components/ManageWalletMenu/hooks/useLinkTelegram.ts
|
|
10222
10218
|
init_telegram2();
|
|
10223
|
-
import { useQueryClient as
|
|
10219
|
+
import { useQueryClient as useQueryClient13 } from "@tanstack/react-query";
|
|
10224
10220
|
import { useCallback as useCallback11, useEffect as useEffect24, useState as useState10 } from "react";
|
|
10225
10221
|
function useLinkTelegram() {
|
|
10226
10222
|
const {
|
|
10227
10223
|
config: { current: config },
|
|
10228
10224
|
callbacks
|
|
10229
10225
|
} = useLumiaPassportConfig();
|
|
10230
|
-
const qc =
|
|
10226
|
+
const qc = useQueryClient13();
|
|
10231
10227
|
const address = useLumiaPassportSession((st) => st.address);
|
|
10232
10228
|
const isWalletLinking = useLayoutDataStore((st) => st.isWalletLinking);
|
|
10233
10229
|
const { providerType, linkIsLoading, setLinkIsLoading, setProviderType, setAlert } = useManageWalletStore();
|
|
@@ -10521,13 +10517,13 @@ function ManageWalletMenu() {
|
|
|
10521
10517
|
}
|
|
10522
10518
|
|
|
10523
10519
|
// src/internal/components/ManageWalletMenu/UnlinkProviderMenu.tsx
|
|
10524
|
-
import { useMutation as useMutation14, useQueryClient as
|
|
10520
|
+
import { useMutation as useMutation14, useQueryClient as useQueryClient14 } from "@tanstack/react-query";
|
|
10525
10521
|
import { Key as Key5, Loader as Loader11 } from "lucide-react";
|
|
10526
10522
|
import { useState as useState11 } from "react";
|
|
10527
10523
|
init_auth();
|
|
10528
10524
|
import { jsx as jsx53, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
10529
10525
|
function UnlinkProviderMenu() {
|
|
10530
|
-
const qc =
|
|
10526
|
+
const qc = useQueryClient14();
|
|
10531
10527
|
const address = useLumiaPassportSession((st) => st.address);
|
|
10532
10528
|
const { callbacks } = useLumiaPassportConfig();
|
|
10533
10529
|
const setPage = useLayoutDataStore((st) => st.setPage);
|
|
@@ -10606,7 +10602,7 @@ function UnlinkProviderMenu() {
|
|
|
10606
10602
|
}
|
|
10607
10603
|
|
|
10608
10604
|
// src/internal/components/PortfolioMenu/PortfolioMenu.tsx
|
|
10609
|
-
import { useQueryClient as
|
|
10605
|
+
import { useQueryClient as useQueryClient16 } from "@tanstack/react-query";
|
|
10610
10606
|
import { AlertCircle as AlertCircle4, ArrowLeft as ArrowLeft11, Gem, Loader as Loader13, RefreshCw } from "lucide-react";
|
|
10611
10607
|
import { useCallback as useCallback13 } from "react";
|
|
10612
10608
|
|
|
@@ -10614,7 +10610,7 @@ import { useCallback as useCallback13 } from "react";
|
|
|
10614
10610
|
init_lumiaPassport();
|
|
10615
10611
|
init_base();
|
|
10616
10612
|
import { useCallback as useCallback12, useMemo as useMemo4, useRef as useRef12 } from "react";
|
|
10617
|
-
import { useQuery as
|
|
10613
|
+
import { useQuery as useQuery11 } from "@tanstack/react-query";
|
|
10618
10614
|
import { useBalance as useBalance2, usePublicClient } from "wagmi";
|
|
10619
10615
|
import { formatUnits } from "viem";
|
|
10620
10616
|
import {
|
|
@@ -10779,7 +10775,7 @@ function useBlockscoutAssets(options) {
|
|
|
10779
10775
|
error: tokensError,
|
|
10780
10776
|
refetch: refetchTokens,
|
|
10781
10777
|
dataUpdatedAt
|
|
10782
|
-
} =
|
|
10778
|
+
} = useQuery11({
|
|
10783
10779
|
queryKey: [BLOCKSCOUT_QUERY_KEY, address, blockscoutApiUrl],
|
|
10784
10780
|
queryFn: () => blockscoutClient.getTokenBalances(address),
|
|
10785
10781
|
enabled: !!address && enabled,
|
|
@@ -10792,7 +10788,7 @@ function useBlockscoutAssets(options) {
|
|
|
10792
10788
|
data: nftItems,
|
|
10793
10789
|
isLoading: nftsLoading,
|
|
10794
10790
|
refetch: refetchNfts
|
|
10795
|
-
} =
|
|
10791
|
+
} = useQuery11({
|
|
10796
10792
|
queryKey: [BLOCKSCOUT_QUERY_KEY, "nfts", address, blockscoutApiUrl],
|
|
10797
10793
|
queryFn: () => blockscoutClient.getNfts(address),
|
|
10798
10794
|
enabled: !!address && enabled,
|
|
@@ -10805,7 +10801,7 @@ function useBlockscoutAssets(options) {
|
|
|
10805
10801
|
if (!tokenBalances) return [];
|
|
10806
10802
|
return tokenBalances.filter((tb) => tb.token.type === "ERC-20").map((tb) => tb.token.address);
|
|
10807
10803
|
}, [tokenBalances]);
|
|
10808
|
-
const { data: erc3643Results } =
|
|
10804
|
+
const { data: erc3643Results } = useQuery11({
|
|
10809
10805
|
queryKey: [ERC3643_DETECTION_QUERY_KEY, address, erc20TokenAddresses],
|
|
10810
10806
|
queryFn: async () => {
|
|
10811
10807
|
if (!publicClient2 || erc20TokenAddresses.length === 0) {
|
|
@@ -10922,12 +10918,16 @@ function useBlockscoutAssets(options) {
|
|
|
10922
10918
|
|
|
10923
10919
|
// src/internal/components/PortfolioMenu/PortfolioItem.tsx
|
|
10924
10920
|
init_base();
|
|
10925
|
-
import { useQuery as
|
|
10921
|
+
import { useQuery as useQuery12, useQueryClient as useQueryClient15 } from "@tanstack/react-query";
|
|
10926
10922
|
import { Image as ImageIcon, Loader as Loader12, Shield, Sparkles } from "lucide-react";
|
|
10927
10923
|
import { useState as useState12 } from "react";
|
|
10924
|
+
import { formatUnits as formatUnits2 } from "viem";
|
|
10928
10925
|
import { Fragment as Fragment16, jsx as jsx54, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
10929
10926
|
var price16 = Intl.NumberFormat("en-US", { minimumFractionDigits: 16, maximumFractionDigits: 16 });
|
|
10927
|
+
var price2 = Intl.NumberFormat("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 });
|
|
10928
|
+
var price0 = Intl.NumberFormat("en-US", { minimumFractionDigits: 0, maximumFractionDigits: 0 });
|
|
10930
10929
|
function formatValue(price) {
|
|
10930
|
+
console.log("[formatValue]", price);
|
|
10931
10931
|
if (!price) return /* @__PURE__ */ jsx54(Fragment16, { children: `0.00` });
|
|
10932
10932
|
if (price < 0.01) {
|
|
10933
10933
|
const strigified = price16.format(price);
|
|
@@ -10939,7 +10939,15 @@ function formatValue(price) {
|
|
|
10939
10939
|
absValue
|
|
10940
10940
|
] });
|
|
10941
10941
|
}
|
|
10942
|
-
return /* @__PURE__ */
|
|
10942
|
+
if (price > 1e9) return /* @__PURE__ */ jsxs45(Fragment16, { children: [
|
|
10943
|
+
price0.format(price / 1e9),
|
|
10944
|
+
" B"
|
|
10945
|
+
] });
|
|
10946
|
+
if (price > 1e6) return /* @__PURE__ */ jsxs45(Fragment16, { children: [
|
|
10947
|
+
price0.format(price / 1e6),
|
|
10948
|
+
" M"
|
|
10949
|
+
] });
|
|
10950
|
+
return /* @__PURE__ */ jsx54(Fragment16, { children: price2.format(price) });
|
|
10943
10951
|
}
|
|
10944
10952
|
function openInExplorer(address) {
|
|
10945
10953
|
window.open(`${LUMIA_EXPLORER_URL}/address/${address}`, "_blank");
|
|
@@ -10967,20 +10975,20 @@ function PortfolioItem(props) {
|
|
|
10967
10975
|
const [nftImageError, setNftImageError] = useState12(false);
|
|
10968
10976
|
const [logoError, setLogoError] = useState12(false);
|
|
10969
10977
|
const { assets: projectAssets, showBalanceAs: showBalanceAsSymbol } = useLumiaPassportConfig().config.current.projectAssets || {};
|
|
10970
|
-
const qc =
|
|
10978
|
+
const qc = useQueryClient15();
|
|
10971
10979
|
const { balanceQueryKey } = projectAssets?.find((a) => a.symbol === showBalanceAsSymbol) || {};
|
|
10972
10980
|
const projectAssetBalance = !!balanceQueryKey ? qc.getQueryData(balanceQueryKey) : null;
|
|
10973
10981
|
const isNft = isNftAsset(asset);
|
|
10974
10982
|
const nftImage = getNftImage(asset);
|
|
10975
10983
|
const isSecurity = isSecurityToken(asset);
|
|
10976
|
-
const { data: assetRate, isLoading: isRateLoading } =
|
|
10984
|
+
const { data: assetRate, isLoading: isRateLoading } = useQuery12({
|
|
10977
10985
|
retry: false,
|
|
10978
10986
|
staleTime: 4 * 60 * 1e3,
|
|
10979
10987
|
enabled: !!address && !!asset.symbol && !isProjectAsset && !isNft && !isSecurity,
|
|
10980
10988
|
queryKey: [ASSETS_RATES_QUERY_KEY, address, asset.symbol],
|
|
10981
10989
|
queryFn: async () => await getAssetRate2(asset.symbol)
|
|
10982
10990
|
});
|
|
10983
|
-
const renderBalance = isProjectAsset && projectAssetBalance?.fiatFormatted ? projectAssetBalance.fiatFormatted : asset
|
|
10991
|
+
const renderBalance = isProjectAsset && projectAssetBalance?.fiatFormatted ? projectAssetBalance.fiatFormatted : formatUnits2(BigInt(asset?.balance || "0"), asset?.decimals || 18);
|
|
10984
10992
|
return /* @__PURE__ */ jsxs45(
|
|
10985
10993
|
"div",
|
|
10986
10994
|
{
|
|
@@ -11073,14 +11081,12 @@ function PortfolioItem(props) {
|
|
|
11073
11081
|
}
|
|
11074
11082
|
);
|
|
11075
11083
|
}
|
|
11076
|
-
{
|
|
11077
|
-
}
|
|
11078
11084
|
|
|
11079
11085
|
// src/internal/components/PortfolioMenu/PortfolioMenu.tsx
|
|
11080
11086
|
import { jsx as jsx55, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
11081
11087
|
function PortfolioMenu() {
|
|
11082
11088
|
const { assets: projectAssets = [] } = useLumiaPassportConfig().config.current?.projectAssets || {};
|
|
11083
|
-
const qc =
|
|
11089
|
+
const qc = useQueryClient16();
|
|
11084
11090
|
const setPage = useLayoutDataStore((st) => st.setPage);
|
|
11085
11091
|
const maxScrollHeight = useLayoutStore((st) => st.maxScrollHeight);
|
|
11086
11092
|
const address = useLumiaPassportSession((st) => st.address);
|
|
@@ -11146,7 +11152,7 @@ function PortfolioMenu() {
|
|
|
11146
11152
|
// src/internal/components/SecurityMenu/SecurityMenu.tsx
|
|
11147
11153
|
init_auth();
|
|
11148
11154
|
init_keyshare();
|
|
11149
|
-
import { useQuery as
|
|
11155
|
+
import { useQuery as useQuery13, useQueryClient as useQueryClient17 } from "@tanstack/react-query";
|
|
11150
11156
|
import { ArrowLeft as ArrowLeft12, Loader as Loader16, Trash2 as Trash22 } from "lucide-react";
|
|
11151
11157
|
import { useState as useState13 } from "react";
|
|
11152
11158
|
init_iframe_manager();
|
|
@@ -11334,14 +11340,14 @@ function Keyshare(props) {
|
|
|
11334
11340
|
// src/internal/components/SecurityMenu/SecurityMenu.tsx
|
|
11335
11341
|
import { Fragment as Fragment19, jsx as jsx60, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
11336
11342
|
function SecurityMenu() {
|
|
11337
|
-
const qc =
|
|
11343
|
+
const qc = useQueryClient17();
|
|
11338
11344
|
const maxScrollHeight = useLayoutStore((st) => st.maxScrollHeight);
|
|
11339
11345
|
const setPage = useLayoutDataStore((st) => st.setPage);
|
|
11340
11346
|
const userId = jwtTokenManager2.getUserId();
|
|
11341
11347
|
const serverHasKeyshare = jwtTokenManager2.getHasKeyshare() ?? false;
|
|
11342
11348
|
const [isRemoving, setIsRemoving] = useState13(false);
|
|
11343
11349
|
const [appToRemove, setAppToRemove] = useState13(null);
|
|
11344
|
-
const { data: recoveryData, isFetching: isRecoveryLoading } =
|
|
11350
|
+
const { data: recoveryData, isFetching: isRecoveryLoading } = useQuery13({
|
|
11345
11351
|
enabled: !!userId,
|
|
11346
11352
|
queryKey: [KEYSHARE_RECOVERY_STATS_QUERY, userId],
|
|
11347
11353
|
queryFn: async () => {
|
|
@@ -11583,7 +11589,7 @@ function useSendTransaction() {
|
|
|
11583
11589
|
init_base();
|
|
11584
11590
|
import React7 from "react";
|
|
11585
11591
|
import { useBalance as useBalance3, useReadContract, useReadContracts } from "wagmi";
|
|
11586
|
-
import { formatUnits as
|
|
11592
|
+
import { formatUnits as formatUnits3, erc20Abi } from "viem";
|
|
11587
11593
|
var COMMON_TOKENS = [
|
|
11588
11594
|
// Add real token addresses here when available
|
|
11589
11595
|
// {
|
|
@@ -11633,7 +11639,7 @@ function useAssets(address) {
|
|
|
11633
11639
|
const token = COMMON_TOKENS[index];
|
|
11634
11640
|
if (balance.status === "success" && balance.result) {
|
|
11635
11641
|
const balanceValue = balance.result;
|
|
11636
|
-
const formattedBalance =
|
|
11642
|
+
const formattedBalance = formatUnits3(balanceValue, token.decimals);
|
|
11637
11643
|
assets.push({
|
|
11638
11644
|
type: "erc20",
|
|
11639
11645
|
address: token.address,
|
|
@@ -11660,7 +11666,7 @@ function useAssets(address) {
|
|
|
11660
11666
|
const token = COMMON_TOKENS[tokenIndex];
|
|
11661
11667
|
if (balance.status === "success" && balance.result) {
|
|
11662
11668
|
const balanceValue = balance.result;
|
|
11663
|
-
const formattedBalance =
|
|
11669
|
+
const formattedBalance = formatUnits3(balanceValue, token.decimals);
|
|
11664
11670
|
return {
|
|
11665
11671
|
address: token.address,
|
|
11666
11672
|
name: token.name,
|
|
@@ -11729,7 +11735,7 @@ function useTokenBalance(tokenAddress, userAddress) {
|
|
|
11729
11735
|
const { tokenInfo } = useTokenInfo(tokenAddress);
|
|
11730
11736
|
const formattedBalance = React7.useMemo(() => {
|
|
11731
11737
|
if (!balance || !tokenInfo) return "0";
|
|
11732
|
-
return
|
|
11738
|
+
return formatUnits3(balance, tokenInfo.decimals);
|
|
11733
11739
|
}, [balance, tokenInfo]);
|
|
11734
11740
|
return {
|
|
11735
11741
|
balance,
|
|
@@ -12087,7 +12093,7 @@ function TermsOfService() {
|
|
|
12087
12093
|
}
|
|
12088
12094
|
|
|
12089
12095
|
// src/internal/components/TransactionsMenu/TransactionsMenu.tsx
|
|
12090
|
-
import { useQuery as
|
|
12096
|
+
import { useQuery as useQuery14, useQueryClient as useQueryClient18 } from "@tanstack/react-query";
|
|
12091
12097
|
import { ArrowLeft as ArrowLeft17, Loader as Loader19, RefreshCw as RefreshCw3, XCircle as XCircle2 } from "lucide-react";
|
|
12092
12098
|
import { useCallback as useCallback16, useState as useState17 } from "react";
|
|
12093
12099
|
|
|
@@ -12554,7 +12560,7 @@ function TransactionsGroup(props) {
|
|
|
12554
12560
|
// src/internal/components/TransactionsMenu/TransactionsMenu.tsx
|
|
12555
12561
|
import { jsx as jsx67, jsxs as jsxs57 } from "react/jsx-runtime";
|
|
12556
12562
|
function TransactionsMenu() {
|
|
12557
|
-
const qc =
|
|
12563
|
+
const qc = useQueryClient18();
|
|
12558
12564
|
const address = useLumiaPassportSession((st) => st.address);
|
|
12559
12565
|
const page = useLayoutDataStore((st) => st.page);
|
|
12560
12566
|
const setPage = useLayoutDataStore((st) => st.setPage);
|
|
@@ -12565,7 +12571,7 @@ function TransactionsMenu() {
|
|
|
12565
12571
|
isLoading: isTxHistoryLoading,
|
|
12566
12572
|
isFetching: isTxHistoryFetching,
|
|
12567
12573
|
error: txHistoryError
|
|
12568
|
-
} =
|
|
12574
|
+
} = useQuery14({
|
|
12569
12575
|
retry: false,
|
|
12570
12576
|
enabled: !!address && page === "transactions",
|
|
12571
12577
|
queryKey: [TRANSACTIONS_HISTORY_QUERY_KEY, address],
|
|
@@ -12921,11 +12927,11 @@ var TssManagerWithRef = React9.forwardRef((props, ref) => {
|
|
|
12921
12927
|
// src/internal/components/WalletConnectHandler.tsx
|
|
12922
12928
|
init_wallet();
|
|
12923
12929
|
import { useConnectModal } from "@rainbow-me/rainbowkit";
|
|
12924
|
-
import { useMutation as useMutation15, useQueryClient as
|
|
12930
|
+
import { useMutation as useMutation15, useQueryClient as useQueryClient19 } from "@tanstack/react-query";
|
|
12925
12931
|
import React10, { useCallback as useCallback19, useEffect as useEffect32 } from "react";
|
|
12926
12932
|
import { useAccount, useDisconnect, useSignMessage } from "wagmi";
|
|
12927
12933
|
function WalletConnectHandler() {
|
|
12928
|
-
const qc =
|
|
12934
|
+
const qc = useQueryClient19();
|
|
12929
12935
|
const callbacks = useLumiaPassportConfig().callbacks;
|
|
12930
12936
|
const passportWalletAddress = useLumiaPassportSession((st) => st.address);
|
|
12931
12937
|
const { address: walletAddress, isConnected, chain, connector } = useAccount();
|