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