@lumiapassport/ui-kit 1.14.22 → 1.14.23
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 +298 -223
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +236 -161
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -3822,28 +3822,32 @@ async function sendUserOperation(session, callTarget, amountWei, innerData = "0x
|
|
|
3822
3822
|
try {
|
|
3823
3823
|
const envCaps = typeof import_meta !== "undefined" && import_meta.env || {};
|
|
3824
3824
|
const maxBundlerVerifGas = envCaps.VITE_MAX_VERIFICATION_GAS ? BigInt(envCaps.VITE_MAX_VERIFICATION_GAS) : MAX_BUNDLER_VERIFICATION_GAS;
|
|
3825
|
-
const maxCallGas = envCaps.VITE_MAX_CALL_GAS_LIMIT ? BigInt(envCaps.VITE_MAX_CALL_GAS_LIMIT) :
|
|
3825
|
+
const maxCallGas = envCaps.VITE_MAX_CALL_GAS_LIMIT ? BigInt(envCaps.VITE_MAX_CALL_GAS_LIMIT) : null;
|
|
3826
3826
|
const toHex2 = (v) => `0x${v.toString(16)}`;
|
|
3827
3827
|
const maxAccountVerifGas = usePaymaster ? maxBundlerVerifGas - PAYMASTER_VERIFICATION_GAS : maxBundlerVerifGas;
|
|
3828
3828
|
const verGas = BigInt(userOp.verificationGasLimit || "0x0");
|
|
3829
3829
|
if (verGas > maxAccountVerifGas) userOp.verificationGasLimit = toHex2(maxAccountVerifGas);
|
|
3830
3830
|
const callGas = BigInt(userOp.callGasLimit || "0x0");
|
|
3831
|
-
if (callGas > maxCallGas) userOp.callGasLimit = toHex2(maxCallGas);
|
|
3831
|
+
if (maxCallGas && callGas > maxCallGas) userOp.callGasLimit = toHex2(maxCallGas);
|
|
3832
3832
|
} catch {
|
|
3833
3833
|
}
|
|
3834
3834
|
};
|
|
3835
3835
|
let estimated = false;
|
|
3836
3836
|
try {
|
|
3837
3837
|
const gasEst = await (0, import_bundler.estimateUserOperationGas)({ ...userOp, signature: `0x${"00".repeat(65)}` });
|
|
3838
|
+
console.log("[Account] Gas estimation from bundler:", { callGasLimit: gasEst.callGasLimit, verificationGasLimit: gasEst.verificationGasLimit, preVerificationGas: gasEst.preVerificationGas });
|
|
3838
3839
|
userOp.callGasLimit = gasEst.callGasLimit;
|
|
3839
3840
|
userOp.verificationGasLimit = gasEst.verificationGasLimit;
|
|
3840
3841
|
userOp.preVerificationGas = gasEst.preVerificationGas;
|
|
3841
3842
|
ensureGenerousDefaults();
|
|
3842
3843
|
enforceCaps(session.usePaymaster);
|
|
3843
3844
|
estimated = true;
|
|
3844
|
-
|
|
3845
|
+
console.log("[Account] Gas after caps:", { callGasLimit: userOp.callGasLimit, verificationGasLimit: userOp.verificationGasLimit, preVerificationGas: userOp.preVerificationGas });
|
|
3846
|
+
} catch (e) {
|
|
3847
|
+
console.log("[Account] Gas estimation failed, using defaults:", e);
|
|
3845
3848
|
ensureGenerousDefaults();
|
|
3846
3849
|
enforceCaps(session.usePaymaster);
|
|
3850
|
+
console.log("[Account] Gas after defaults:", { callGasLimit: userOp.callGasLimit, verificationGasLimit: userOp.verificationGasLimit, preVerificationGas: userOp.preVerificationGas });
|
|
3847
3851
|
}
|
|
3848
3852
|
try {
|
|
3849
3853
|
const toHex2 = (v) => `0x${v.toString(16)}`;
|
|
@@ -4007,28 +4011,32 @@ async function prepareUserOperation(session, callTarget, amountWei, innerData =
|
|
|
4007
4011
|
try {
|
|
4008
4012
|
const envCaps = typeof import_meta !== "undefined" && import_meta.env || {};
|
|
4009
4013
|
const maxBundlerVerifGas = envCaps.VITE_MAX_VERIFICATION_GAS ? BigInt(envCaps.VITE_MAX_VERIFICATION_GAS) : MAX_BUNDLER_VERIFICATION_GAS;
|
|
4010
|
-
const maxCallGas = envCaps.VITE_MAX_CALL_GAS_LIMIT ? BigInt(envCaps.VITE_MAX_CALL_GAS_LIMIT) :
|
|
4014
|
+
const maxCallGas = envCaps.VITE_MAX_CALL_GAS_LIMIT ? BigInt(envCaps.VITE_MAX_CALL_GAS_LIMIT) : null;
|
|
4011
4015
|
const toHex2 = (v) => `0x${v.toString(16)}`;
|
|
4012
4016
|
const maxAccountVerifGas = usePaymaster ? maxBundlerVerifGas - PAYMASTER_VERIFICATION_GAS : maxBundlerVerifGas;
|
|
4013
4017
|
const verGas = BigInt(userOp.verificationGasLimit || "0x0");
|
|
4014
4018
|
if (verGas > maxAccountVerifGas) userOp.verificationGasLimit = toHex2(maxAccountVerifGas);
|
|
4015
4019
|
const callGas = BigInt(userOp.callGasLimit || "0x0");
|
|
4016
|
-
if (callGas > maxCallGas) userOp.callGasLimit = toHex2(maxCallGas);
|
|
4020
|
+
if (maxCallGas && callGas > maxCallGas) userOp.callGasLimit = toHex2(maxCallGas);
|
|
4017
4021
|
} catch {
|
|
4018
4022
|
}
|
|
4019
4023
|
};
|
|
4020
4024
|
let estimated = false;
|
|
4021
4025
|
try {
|
|
4022
4026
|
const gasEst = await (0, import_bundler.estimateUserOperationGas)({ ...userOp, signature: `0x${"00".repeat(65)}` });
|
|
4027
|
+
console.log("[Account] Gas estimation from bundler:", { callGasLimit: gasEst.callGasLimit, verificationGasLimit: gasEst.verificationGasLimit, preVerificationGas: gasEst.preVerificationGas });
|
|
4023
4028
|
userOp.callGasLimit = gasEst.callGasLimit;
|
|
4024
4029
|
userOp.verificationGasLimit = gasEst.verificationGasLimit;
|
|
4025
4030
|
userOp.preVerificationGas = gasEst.preVerificationGas;
|
|
4026
4031
|
ensureGenerousDefaults();
|
|
4027
4032
|
enforceCaps(session.usePaymaster);
|
|
4028
4033
|
estimated = true;
|
|
4029
|
-
|
|
4034
|
+
console.log("[Account] Gas after caps:", { callGasLimit: userOp.callGasLimit, verificationGasLimit: userOp.verificationGasLimit, preVerificationGas: userOp.preVerificationGas });
|
|
4035
|
+
} catch (e) {
|
|
4036
|
+
console.log("[Account] Gas estimation failed, using defaults:", e);
|
|
4030
4037
|
ensureGenerousDefaults();
|
|
4031
4038
|
enforceCaps(session.usePaymaster);
|
|
4039
|
+
console.log("[Account] Gas after defaults:", { callGasLimit: userOp.callGasLimit, verificationGasLimit: userOp.verificationGasLimit, preVerificationGas: userOp.preVerificationGas });
|
|
4032
4040
|
}
|
|
4033
4041
|
try {
|
|
4034
4042
|
const toHex2 = (v) => `0x${v.toString(16)}`;
|
|
@@ -4444,12 +4452,12 @@ var built_default = '.container{width:100%}@media (min-width:640px){.container{m
|
|
|
4444
4452
|
// src/context/LumiaPassportContext.tsx
|
|
4445
4453
|
var import_error_tracking4 = require("@lumiapassport/core/internal/error-tracking");
|
|
4446
4454
|
var import_lodash_es4 = require("lodash-es");
|
|
4447
|
-
var
|
|
4455
|
+
var import_react61 = require("react");
|
|
4448
4456
|
init_lumiaPassport();
|
|
4449
4457
|
init_iframe_manager();
|
|
4450
4458
|
|
|
4451
4459
|
// src/context/LumiaPassportSessionContext.tsx
|
|
4452
|
-
var
|
|
4460
|
+
var import_react60 = require("react");
|
|
4453
4461
|
var import_zustand6 = require("zustand");
|
|
4454
4462
|
|
|
4455
4463
|
// src/internal/components/BalanceFeedProvider/BalanceFeedProvider.tsx
|
|
@@ -4627,7 +4635,7 @@ function BalanceFeedProvider() {
|
|
|
4627
4635
|
|
|
4628
4636
|
// src/internal/components/Dialog/LumiaPassportDialog.tsx
|
|
4629
4637
|
var import_framer_motion3 = require("framer-motion");
|
|
4630
|
-
var
|
|
4638
|
+
var import_react57 = require("react");
|
|
4631
4639
|
|
|
4632
4640
|
// src/internal/components/Footer/Footer.tsx
|
|
4633
4641
|
var import_react_query2 = require("@tanstack/react-query");
|
|
@@ -4688,6 +4696,35 @@ var LumiaLogo = (0, import_react2.forwardRef)(({ size = 24, className = "" }, re
|
|
|
4688
4696
|
init_auth();
|
|
4689
4697
|
init_base();
|
|
4690
4698
|
|
|
4699
|
+
// src/internal/hooks/useLayoutStore.ts
|
|
4700
|
+
var import_zustand2 = require("zustand");
|
|
4701
|
+
var useLayoutStore = (0, import_zustand2.create)((set) => ({
|
|
4702
|
+
colorMode: "light",
|
|
4703
|
+
// layoutView: 'desktop',
|
|
4704
|
+
// deviceType: 'non-touch',
|
|
4705
|
+
isMobileView: false,
|
|
4706
|
+
maxScrollHeight: MAX_CONTENT_HEIGHT,
|
|
4707
|
+
isDialogClosing: false,
|
|
4708
|
+
isDialogOpen: false,
|
|
4709
|
+
isDialogForced: false,
|
|
4710
|
+
dialogTitle: null,
|
|
4711
|
+
dialogDescription: null,
|
|
4712
|
+
dialogContent: null,
|
|
4713
|
+
isSettings: false,
|
|
4714
|
+
setColorMode: (colorMode) => set({ colorMode }),
|
|
4715
|
+
// setLayoutView: (layoutView) => set(() => ({ layoutView })),
|
|
4716
|
+
// setDeviceType: (deviceType) => set(() => ({ deviceType })),
|
|
4717
|
+
setIsMobileView: (isMobileView) => set({ isMobileView }),
|
|
4718
|
+
setMaxScrollHeight: (maxScrollHeight) => set({ maxScrollHeight }),
|
|
4719
|
+
setIsDialogClosing: (isDialogClosing) => set({ isDialogClosing }),
|
|
4720
|
+
setIsDialogOpen: (isDialogOpen) => set({ isDialogOpen }),
|
|
4721
|
+
setIsDialogForced: (isDialogForced) => set({ isDialogForced }),
|
|
4722
|
+
setDialogTitle: (dialogTitle) => set({ dialogTitle }),
|
|
4723
|
+
setDialogDescription: (dialogDescription) => set({ dialogDescription }),
|
|
4724
|
+
setDialogContent: (dialogContent) => set({ dialogContent }),
|
|
4725
|
+
setIsSettings: (isSettings) => set({ isSettings })
|
|
4726
|
+
}));
|
|
4727
|
+
|
|
4691
4728
|
// src/internal/lib/utils.ts
|
|
4692
4729
|
var import_clsx = require("clsx");
|
|
4693
4730
|
var import_tailwind_merge = require("tailwind-merge");
|
|
@@ -4780,9 +4817,11 @@ function Footer() {
|
|
|
4780
4817
|
const { callbacks } = useLumiaPassportConfig();
|
|
4781
4818
|
const { address, setSession, setAddress, setStatus, setError, setIsLoading } = useLumiaPassportSession();
|
|
4782
4819
|
const setPage = useLayoutDataStore((st) => st.setPage);
|
|
4820
|
+
const setIsDialogForced = useLayoutStore((st) => st.setIsDialogForced);
|
|
4783
4821
|
const { mutate: disconnect, isPending: isDisconnecting } = (0, import_react_query2.useMutation)({
|
|
4784
4822
|
mutationFn: async (disconnectAddress) => {
|
|
4785
4823
|
if (!disconnectAddress) throw new Error("No address to disconnect");
|
|
4824
|
+
setIsDialogForced(true);
|
|
4786
4825
|
setError(null);
|
|
4787
4826
|
setStatus("disconnecting");
|
|
4788
4827
|
setIsLoading(true);
|
|
@@ -4799,12 +4838,16 @@ function Footer() {
|
|
|
4799
4838
|
setStatus("idle");
|
|
4800
4839
|
setIsLoading(false);
|
|
4801
4840
|
callbacks?.onLumiaPassportDisconnect?.({ address: disconnectAddress, userId: disconnectedUserId });
|
|
4802
|
-
setTimeout(() =>
|
|
4841
|
+
setTimeout(() => {
|
|
4842
|
+
setPage("auth" /* AUTH */);
|
|
4843
|
+
setIsDialogForced(false);
|
|
4844
|
+
}, 200);
|
|
4803
4845
|
},
|
|
4804
4846
|
onError: (err) => {
|
|
4805
4847
|
setError(err.message || "An unknown error occurred during sign out");
|
|
4806
4848
|
setStatus("idle");
|
|
4807
4849
|
setIsLoading(false);
|
|
4850
|
+
setIsDialogForced(false);
|
|
4808
4851
|
}
|
|
4809
4852
|
});
|
|
4810
4853
|
const { name, logo, logoDataUri } = lumiaBeam;
|
|
@@ -4990,35 +5033,6 @@ function BalanceView(props) {
|
|
|
4990
5033
|
// src/internal/components/KYC/KycMenu.tsx
|
|
4991
5034
|
var import_lucide_react5 = require("lucide-react");
|
|
4992
5035
|
|
|
4993
|
-
// src/internal/hooks/useLayoutStore.ts
|
|
4994
|
-
var import_zustand2 = require("zustand");
|
|
4995
|
-
var useLayoutStore = (0, import_zustand2.create)((set) => ({
|
|
4996
|
-
colorMode: "light",
|
|
4997
|
-
// layoutView: 'desktop',
|
|
4998
|
-
// deviceType: 'non-touch',
|
|
4999
|
-
isMobileView: false,
|
|
5000
|
-
maxScrollHeight: MAX_CONTENT_HEIGHT,
|
|
5001
|
-
isDialogClosing: false,
|
|
5002
|
-
isDialogOpen: false,
|
|
5003
|
-
isDialogForced: false,
|
|
5004
|
-
dialogTitle: null,
|
|
5005
|
-
dialogDescription: null,
|
|
5006
|
-
dialogContent: null,
|
|
5007
|
-
isSettings: false,
|
|
5008
|
-
setColorMode: (colorMode) => set({ colorMode }),
|
|
5009
|
-
// setLayoutView: (layoutView) => set(() => ({ layoutView })),
|
|
5010
|
-
// setDeviceType: (deviceType) => set(() => ({ deviceType })),
|
|
5011
|
-
setIsMobileView: (isMobileView) => set({ isMobileView }),
|
|
5012
|
-
setMaxScrollHeight: (maxScrollHeight) => set({ maxScrollHeight }),
|
|
5013
|
-
setIsDialogClosing: (isDialogClosing) => set({ isDialogClosing }),
|
|
5014
|
-
setIsDialogOpen: (isDialogOpen) => set({ isDialogOpen }),
|
|
5015
|
-
setIsDialogForced: (isDialogForced) => set({ isDialogForced }),
|
|
5016
|
-
setDialogTitle: (dialogTitle) => set({ dialogTitle }),
|
|
5017
|
-
setDialogDescription: (dialogDescription) => set({ dialogDescription }),
|
|
5018
|
-
setDialogContent: (dialogContent) => set({ dialogContent }),
|
|
5019
|
-
setIsSettings: (isSettings) => set({ isSettings })
|
|
5020
|
-
}));
|
|
5021
|
-
|
|
5022
5036
|
// src/internal/components/KYC/SumsubIframe.tsx
|
|
5023
5037
|
var import_lucide_react4 = require("lucide-react");
|
|
5024
5038
|
|
|
@@ -5401,7 +5415,7 @@ function Header() {
|
|
|
5401
5415
|
// package.json
|
|
5402
5416
|
var package_default = {
|
|
5403
5417
|
name: "@lumiapassport/ui-kit",
|
|
5404
|
-
version: "1.14.
|
|
5418
|
+
version: "1.14.23",
|
|
5405
5419
|
description: "React UI components and hooks for Lumia Passport authentication and Account Abstraction",
|
|
5406
5420
|
type: "module",
|
|
5407
5421
|
main: "./dist/index.cjs",
|
|
@@ -5530,8 +5544,9 @@ var CONTENT_BG_SETUP = {
|
|
|
5530
5544
|
boxShadow: "0px 4px 10px var(--l-pass-shadow-c)"
|
|
5531
5545
|
};
|
|
5532
5546
|
var DialogContent = (0, import_react6.forwardRef)(
|
|
5533
|
-
({ className, children,
|
|
5547
|
+
({ className, children, colorMode, ...props }, ref) => {
|
|
5534
5548
|
const isSettings = useLayoutStore((st) => st.isSettings);
|
|
5549
|
+
const isDialogForced = useLayoutStore((st) => st.isDialogForced);
|
|
5535
5550
|
const setPage = useLayoutDataStore((st) => st.setPage);
|
|
5536
5551
|
const settingsNotifications = useLayoutDataStore((st) => st.settingsNotifications);
|
|
5537
5552
|
const { isMobileView, isClosing, style } = useDecideContentStyles();
|
|
@@ -5562,7 +5577,7 @@ var DialogContent = (0, import_react6.forwardRef)(
|
|
|
5562
5577
|
...props,
|
|
5563
5578
|
children: [
|
|
5564
5579
|
children,
|
|
5565
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
5580
|
+
!isDialogForced && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
5566
5581
|
"div",
|
|
5567
5582
|
{
|
|
5568
5583
|
className: cn(
|
|
@@ -5595,7 +5610,7 @@ var DialogContent = (0, import_react6.forwardRef)(
|
|
|
5595
5610
|
]
|
|
5596
5611
|
}
|
|
5597
5612
|
),
|
|
5598
|
-
|
|
5613
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(DialogPrimitive.Close, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Button, { variant: "ghost", size: "icon", className: "w-4 h-4", children: [
|
|
5599
5614
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react8.X, { className: "h-4 w-4" }),
|
|
5600
5615
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "sr-only", children: "Close" })
|
|
5601
5616
|
] }) })
|
|
@@ -5868,23 +5883,25 @@ function useBackupStatusChanges() {
|
|
|
5868
5883
|
|
|
5869
5884
|
// src/internal/hooks/useBackupWarning.ts
|
|
5870
5885
|
var import_react10 = require("react");
|
|
5871
|
-
var WARNING_TIMEOUT_MS =
|
|
5886
|
+
var WARNING_TIMEOUT_MS = 4500;
|
|
5872
5887
|
function useBackupWarning() {
|
|
5873
|
-
const config = useLumiaPassportConfig().config;
|
|
5874
5888
|
const address = useLumiaPassportSession((st) => st.address);
|
|
5875
5889
|
const hasServerVault = useLumiaPassportSession((st) => st.hasServerVault);
|
|
5876
5890
|
const page = useLayoutDataStore((st) => st.page);
|
|
5877
5891
|
const setPage = useLayoutDataStore((st) => st.setPage);
|
|
5878
5892
|
const timeoutRef = (0, import_react10.useRef)(null);
|
|
5893
|
+
const touchedRef = (0, import_react10.useRef)(false);
|
|
5879
5894
|
(0, import_react10.useEffect)(() => {
|
|
5895
|
+
if (touchedRef.current) return;
|
|
5880
5896
|
if (timeoutRef.current) {
|
|
5881
5897
|
clearTimeout(timeoutRef.current);
|
|
5882
5898
|
timeoutRef.current = null;
|
|
5883
5899
|
}
|
|
5884
|
-
|
|
5885
|
-
if (!address || !isShown || page === "keysare-backup" /* KEYSARE_BACKUP */) return;
|
|
5900
|
+
if (!address || !!hasServerVault || page === "keysare-backup" /* KEYSARE_BACKUP */) return;
|
|
5886
5901
|
timeoutRef.current = setTimeout(() => {
|
|
5887
5902
|
setPage("keysare-backup" /* KEYSARE_BACKUP */);
|
|
5903
|
+
touchedRef.current = true;
|
|
5904
|
+
timeoutRef.current = null;
|
|
5888
5905
|
}, WARNING_TIMEOUT_MS);
|
|
5889
5906
|
return () => {
|
|
5890
5907
|
if (timeoutRef.current) {
|
|
@@ -5949,7 +5966,7 @@ function useDetectMaxScrollHeight() {
|
|
|
5949
5966
|
}
|
|
5950
5967
|
|
|
5951
5968
|
// src/internal/hooks/usePageMapper.tsx
|
|
5952
|
-
var
|
|
5969
|
+
var import_react54 = require("react");
|
|
5953
5970
|
|
|
5954
5971
|
// src/internal/components/AuthMenu/AuthMenu.tsx
|
|
5955
5972
|
var import_framer_motion = require("framer-motion");
|
|
@@ -7186,8 +7203,18 @@ function useAuthMenuHandlers() {
|
|
|
7186
7203
|
const qc = (0, import_react_query8.useQueryClient)();
|
|
7187
7204
|
const pendingLoginResponseRef = (0, import_react20.useRef)(null);
|
|
7188
7205
|
const setPage = useLayoutDataStore((st) => st.setPage);
|
|
7206
|
+
const setIsDialogForced = useLayoutStore((st) => st.setIsDialogForced);
|
|
7189
7207
|
const [telegramCleanup, setTelegramCleanup] = (0, import_react20.useState)(null);
|
|
7190
|
-
const {
|
|
7208
|
+
const {
|
|
7209
|
+
usePaymaster,
|
|
7210
|
+
setError,
|
|
7211
|
+
setStatus,
|
|
7212
|
+
setSession,
|
|
7213
|
+
setAddress,
|
|
7214
|
+
setRecoveryUserId,
|
|
7215
|
+
setHasServerVault,
|
|
7216
|
+
setIsLoading
|
|
7217
|
+
} = useLumiaPassportSession();
|
|
7191
7218
|
const setStep = useAuthStore((st) => st.setStep);
|
|
7192
7219
|
const setAlert = useAuthStore((st) => st.setAlert);
|
|
7193
7220
|
const createSessionWithKeyshare = (0, import_react20.useCallback)(
|
|
@@ -7225,6 +7252,7 @@ function useAuthMenuHandlers() {
|
|
|
7225
7252
|
[setStatus, callbacks, usePaymaster]
|
|
7226
7253
|
);
|
|
7227
7254
|
const onAuthSuccess = (0, import_react20.useCallback)(async () => {
|
|
7255
|
+
setIsLoading(true);
|
|
7228
7256
|
const loginResponse = pendingLoginResponseRef.current;
|
|
7229
7257
|
if (!loginResponse || !loginResponse.userId) {
|
|
7230
7258
|
setError("Authentication failed - no login data available");
|
|
@@ -7253,10 +7281,6 @@ function useAuthMenuHandlers() {
|
|
|
7253
7281
|
);
|
|
7254
7282
|
setError(null);
|
|
7255
7283
|
setAlert(null);
|
|
7256
|
-
setSession(sess);
|
|
7257
|
-
setAddress(addr);
|
|
7258
|
-
setStatus("ready");
|
|
7259
|
-
setPage(null);
|
|
7260
7284
|
try {
|
|
7261
7285
|
callbacks?.onLumiaPassportConnect?.({ address: addr, session: sess });
|
|
7262
7286
|
callbacks?.onLumiaPassportAccount?.({ userId, address: addr, session: sess, hasKeyshare: hasServerKeyshare });
|
|
@@ -7277,6 +7301,16 @@ function useAuthMenuHandlers() {
|
|
|
7277
7301
|
} catch (e) {
|
|
7278
7302
|
console.warn("[UI-KIT] Vault status check failed:", e);
|
|
7279
7303
|
}
|
|
7304
|
+
setSession(sess);
|
|
7305
|
+
setAddress(addr);
|
|
7306
|
+
setStatus("ready");
|
|
7307
|
+
if (jwt?.isNewUser) {
|
|
7308
|
+
console.log("[AuthMenu] New user detected - forcing backup flow");
|
|
7309
|
+
setIsDialogForced(true);
|
|
7310
|
+
setPage("keysare-backup" /* KEYSARE_BACKUP */);
|
|
7311
|
+
} else {
|
|
7312
|
+
setPage(null);
|
|
7313
|
+
}
|
|
7280
7314
|
} catch (error) {
|
|
7281
7315
|
if (error?.code === "KEYSHARE_RECOVERY_NEEDED") {
|
|
7282
7316
|
console.warn("[AuthMenu] Keyshare recovery needed for user:", userId);
|
|
@@ -7296,6 +7330,8 @@ function useAuthMenuHandlers() {
|
|
|
7296
7330
|
});
|
|
7297
7331
|
setStep("failed");
|
|
7298
7332
|
}
|
|
7333
|
+
} finally {
|
|
7334
|
+
setIsLoading(false);
|
|
7299
7335
|
}
|
|
7300
7336
|
}, [
|
|
7301
7337
|
// config.projectId,
|
|
@@ -7309,6 +7345,7 @@ function useAuthMenuHandlers() {
|
|
|
7309
7345
|
setAddress,
|
|
7310
7346
|
setRecoveryUserId,
|
|
7311
7347
|
setHasServerVault,
|
|
7348
|
+
setIsDialogForced,
|
|
7312
7349
|
createSessionWithKeyshare
|
|
7313
7350
|
]);
|
|
7314
7351
|
const checkDisplayNameRequired = (0, import_react20.useCallback)(async (loginResponse) => {
|
|
@@ -7682,20 +7719,28 @@ function VerifyStep(props) {
|
|
|
7682
7719
|
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
7683
7720
|
var AuthMenu = () => {
|
|
7684
7721
|
const isIframeReady = useLumiaPassportSession((st) => st.isIframeReady);
|
|
7685
|
-
const [isMenuReady, setIsMenuReady] = (0, import_react22.useState)(false);
|
|
7686
7722
|
const mainPageHeight = useLayoutDataStore((st) => st.mainPageHeight);
|
|
7687
7723
|
const setMainPageHeight = useLayoutDataStore((st) => st.setMainPageHeight);
|
|
7688
7724
|
const { step, alert: alert2, setStep, setPasskeyStatus, setEmail, setAlert } = useAuthStore();
|
|
7689
7725
|
const { pendingLoginResponseRef, onAuthSuccess, goBackToSignIn, checkDisplayNameRequired } = useAuthMenuHandlers();
|
|
7726
|
+
const [isAlertShowReady, setIsAlertShowReady] = (0, import_react22.useState)(false);
|
|
7727
|
+
const readyTimeout = (0, import_react22.useRef)(null);
|
|
7728
|
+
(0, import_react22.useEffect)(() => {
|
|
7729
|
+
if (readyTimeout.current) {
|
|
7730
|
+
clearTimeout(readyTimeout.current);
|
|
7731
|
+
readyTimeout.current = null;
|
|
7732
|
+
}
|
|
7733
|
+
setIsAlertShowReady(false);
|
|
7734
|
+
readyTimeout.current = setTimeout(() => setIsAlertShowReady(true), 750);
|
|
7735
|
+
}, [step]);
|
|
7690
7736
|
(0, import_react22.useEffect)(() => {
|
|
7691
7737
|
setMainPageHeight(DEFAULT_AUTH_MENU_HEIGHT);
|
|
7692
|
-
setTimeout(() => setIsMenuReady(true), 500);
|
|
7693
7738
|
return () => {
|
|
7694
7739
|
setStep("signin");
|
|
7695
7740
|
setEmail("");
|
|
7696
7741
|
setPasskeyStatus("idle");
|
|
7697
7742
|
setAlert(null);
|
|
7698
|
-
|
|
7743
|
+
setIsAlertShowReady(false);
|
|
7699
7744
|
};
|
|
7700
7745
|
}, []);
|
|
7701
7746
|
if (!isIframeReady) {
|
|
@@ -7749,12 +7794,12 @@ var AuthMenu = () => {
|
|
|
7749
7794
|
},
|
|
7750
7795
|
step
|
|
7751
7796
|
) }),
|
|
7752
|
-
|
|
7797
|
+
isAlertShowReady && /* --------------------------------------------------------------------------------------------------------------- */
|
|
7753
7798
|
/* -------- EXPANDABLE is designed to adjust its height automatically whenever ANY 1ST LEVEL CHILD changes! ------ */
|
|
7754
7799
|
/* In order to ensure smooth expand animation consistency do not use 2nd (or 3rd etc) nested conditional rendering */
|
|
7755
7800
|
/* elements, cause it might outcome Expandable not reacting to deeply nested elements' height changes ------------ */
|
|
7756
7801
|
/* --------------------------------------------------------------------------------------------------------------- */
|
|
7757
|
-
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Expandable, { isExpanded: !!alert2 &&
|
|
7802
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Expandable, { isExpanded: !!alert2 && isAlertShowReady, contentClassName: "px-[var(--l-pass-pd)]", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Highlight, { type: "error", className: "w-full flex gap-[var(--l-pass-gap)] ", children: [
|
|
7758
7803
|
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react15.AlertTriangle, { className: "w-5 h-5 text-[var(--l-pass-error)]" }),
|
|
7759
7804
|
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("span", { className: "block w-full flex flex-col gap-1 flex-1", children: [
|
|
7760
7805
|
alert2?.title && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "block font-bold leading-5", children: alert2.title }),
|
|
@@ -8442,12 +8487,12 @@ function BuyMenu() {
|
|
|
8442
8487
|
// src/internal/components/KeyshareRestoreMenu/KeyshareRestoreMenu.tsx
|
|
8443
8488
|
var import_react_query17 = require("@tanstack/react-query");
|
|
8444
8489
|
var import_lucide_react26 = require("lucide-react");
|
|
8445
|
-
var
|
|
8490
|
+
var import_react36 = require("react");
|
|
8446
8491
|
init_vaultClient();
|
|
8447
8492
|
|
|
8448
8493
|
// src/internal/components/KeyshareRestoreMenu/components/MethodSelector.tsx
|
|
8449
8494
|
var import_lucide_react19 = require("lucide-react");
|
|
8450
|
-
var
|
|
8495
|
+
var import_react31 = require("react");
|
|
8451
8496
|
|
|
8452
8497
|
// src/internal/components/KeyshareRestoreMenu/hooks/useCheckBackupAvailability.ts
|
|
8453
8498
|
var import_react_query12 = require("@tanstack/react-query");
|
|
@@ -8631,12 +8676,21 @@ function useOnRestoreSuccess() {
|
|
|
8631
8676
|
|
|
8632
8677
|
// src/internal/components/KeyshareRestoreMenu/hooks/useCreateBackup.ts
|
|
8633
8678
|
var import_react_query13 = require("@tanstack/react-query");
|
|
8679
|
+
var import_react29 = require("react");
|
|
8634
8680
|
init_iframe_manager();
|
|
8635
8681
|
function useCreateBackup() {
|
|
8636
8682
|
const qc = (0, import_react_query13.useQueryClient)();
|
|
8637
8683
|
const session = useLumiaPassportSession((st) => st.session);
|
|
8638
8684
|
const address = useLumiaPassportSession((st) => st.address);
|
|
8639
|
-
const
|
|
8685
|
+
const hasServerVault = useLumiaPassportSession((st) => st.hasServerVault);
|
|
8686
|
+
const setIsDialogForced = useLayoutStore((st) => st.setIsDialogForced);
|
|
8687
|
+
const { usePasskey, restorePassword, selectedCloudProvider, setSuccess, setError, setMethod } = useRestoreStore();
|
|
8688
|
+
(0, import_react29.useEffect)(() => {
|
|
8689
|
+
if (!hasServerVault) {
|
|
8690
|
+
setMethod("server");
|
|
8691
|
+
setIsDialogForced(true);
|
|
8692
|
+
}
|
|
8693
|
+
}, [hasServerVault, setIsDialogForced, setMethod]);
|
|
8640
8694
|
const passportUserId = session?.mpcUserId || "";
|
|
8641
8695
|
const onBackupSuccess = () => console.log("[ConnectWalletButton] Backup created successfully");
|
|
8642
8696
|
const { mutate: createPasswordBackup, isPending: isPasswordBackupCreating } = (0, import_react_query13.useMutation)({
|
|
@@ -8666,7 +8720,7 @@ function useCreateBackup() {
|
|
|
8666
8720
|
})
|
|
8667
8721
|
);
|
|
8668
8722
|
}
|
|
8669
|
-
onBackupSuccess
|
|
8723
|
+
onBackupSuccess();
|
|
8670
8724
|
} else {
|
|
8671
8725
|
setError(response.error || "Server backup failed");
|
|
8672
8726
|
}
|
|
@@ -8703,7 +8757,7 @@ function useCreateBackup() {
|
|
|
8703
8757
|
})
|
|
8704
8758
|
);
|
|
8705
8759
|
}
|
|
8706
|
-
onBackupSuccess
|
|
8760
|
+
onBackupSuccess();
|
|
8707
8761
|
},
|
|
8708
8762
|
onError: async (error) => {
|
|
8709
8763
|
setError(error?.message || "Backup creation failed");
|
|
@@ -8743,7 +8797,7 @@ function useCreateBackup() {
|
|
|
8743
8797
|
})
|
|
8744
8798
|
);
|
|
8745
8799
|
}
|
|
8746
|
-
onBackupSuccess
|
|
8800
|
+
onBackupSuccess();
|
|
8747
8801
|
},
|
|
8748
8802
|
onError: async (error) => {
|
|
8749
8803
|
setError(error?.message || "Backup creation failed");
|
|
@@ -8873,7 +8927,7 @@ function useRestoreAccount() {
|
|
|
8873
8927
|
}
|
|
8874
8928
|
|
|
8875
8929
|
// src/internal/components/KeyshareRestoreMenu/hooks/useValidateFileBackup.ts
|
|
8876
|
-
var
|
|
8930
|
+
var import_react30 = require("react");
|
|
8877
8931
|
function validateRestoreFileFormat(parsedData) {
|
|
8878
8932
|
if (typeof parsedData !== "object" || parsedData === null) return false;
|
|
8879
8933
|
const data = parsedData;
|
|
@@ -8883,7 +8937,7 @@ function useValidateFileBackup() {
|
|
|
8883
8937
|
const restoreFile = useRestoreStore((st) => st.restoreFile);
|
|
8884
8938
|
const setError = useRestoreStore((st) => st.setError);
|
|
8885
8939
|
const setUsePasskey = useRestoreStore((st) => st.setUsePasskey);
|
|
8886
|
-
(0,
|
|
8940
|
+
(0, import_react30.useEffect)(() => {
|
|
8887
8941
|
if (!restoreFile) {
|
|
8888
8942
|
return;
|
|
8889
8943
|
}
|
|
@@ -8923,7 +8977,7 @@ function MethodSelector(props) {
|
|
|
8923
8977
|
setError,
|
|
8924
8978
|
setSuccess
|
|
8925
8979
|
} = useRestoreStore();
|
|
8926
|
-
const recoveryRenderMethods = (0,
|
|
8980
|
+
const recoveryRenderMethods = (0, import_react31.useMemo)(() => {
|
|
8927
8981
|
const methodsWithBackupData = getRecoveryRenderMethods(mode).map((mt) => {
|
|
8928
8982
|
let data = null;
|
|
8929
8983
|
switch (true) {
|
|
@@ -8938,7 +8992,7 @@ function MethodSelector(props) {
|
|
|
8938
8992
|
return methodsWithBackupData;
|
|
8939
8993
|
}, [mode, serverRecoveryStatus]);
|
|
8940
8994
|
if (!!selectedRecoveryMethod) return null;
|
|
8941
|
-
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
8995
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_react31.Fragment, { children: [
|
|
8942
8996
|
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "block w-full text-xs font-semibold text-center leading-8 text-[var(--l-pass-fg-muted)]", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "leading-8", children: mode === "restore" ? "Choose restore method" : "Create or Update Backup via" }) }),
|
|
8943
8997
|
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
8944
8998
|
"div",
|
|
@@ -8965,7 +9019,7 @@ function MethodSelector(props) {
|
|
|
8965
9019
|
},
|
|
8966
9020
|
children: [
|
|
8967
9021
|
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Icon2, { className: "w-5 h-5 md:w-8 md:h-8" }),
|
|
8968
|
-
!!data?.lastBackup && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "w-6 h-6 absolute -top-2 -right-2 flex items-center justify-center bg-
|
|
9022
|
+
!!data?.lastBackup && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "w-6 h-6 absolute -top-2 -right-2 flex items-center justify-center bg-transparent", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(PositiveIcon, { className: "w-4 h-4" }) })
|
|
8969
9023
|
]
|
|
8970
9024
|
}
|
|
8971
9025
|
),
|
|
@@ -8981,7 +9035,7 @@ var import_lucide_react21 = require("lucide-react");
|
|
|
8981
9035
|
|
|
8982
9036
|
// src/internal/components/KeyshareRestoreMenu/components/PasswordPasskey.tsx
|
|
8983
9037
|
var import_lucide_react20 = require("lucide-react");
|
|
8984
|
-
var
|
|
9038
|
+
var import_react32 = require("react");
|
|
8985
9039
|
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
8986
9040
|
function PasswordPasskey(props) {
|
|
8987
9041
|
const {
|
|
@@ -8993,9 +9047,15 @@ function PasswordPasskey(props) {
|
|
|
8993
9047
|
isEncryptionMethod,
|
|
8994
9048
|
actionHandler
|
|
8995
9049
|
} = props;
|
|
8996
|
-
const
|
|
9050
|
+
const hasServerVault = useLumiaPassportSession((st) => st.hasServerVault);
|
|
9051
|
+
const actionRef = (0, import_react32.useRef)(null);
|
|
8997
9052
|
const { showPassword, restorePassword, usePasskey, error, setRestorePassword, setShowPassword } = useRestoreStore();
|
|
8998
9053
|
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_jsx_runtime39.Fragment, { children: [
|
|
9054
|
+
!hasServerVault && /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("span", { className: "block w-full text-[10px] leading-4 px-[var(--l-pass-pd)] truncate", children: [
|
|
9055
|
+
"Use your ",
|
|
9056
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("strong", { children: usePasskey ? "Passkey" : "Password" }),
|
|
9057
|
+
" to complete account security setup."
|
|
9058
|
+
] }),
|
|
8999
9059
|
!usePasskey ? /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "w-full flex gap-[var(--l-pass-gap)]", children: [
|
|
9000
9060
|
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
9001
9061
|
Input,
|
|
@@ -9037,7 +9097,7 @@ function PasswordPasskey(props) {
|
|
|
9037
9097
|
title: actionCaption,
|
|
9038
9098
|
disabled: isLoading || disabled || error?.includes("Invalid backup file") || !usePasskey && !restorePassword,
|
|
9039
9099
|
className: "w-full w-12 h-12 flex-shrink-0 rounded-[var(--l-pass-el-bdrs)]",
|
|
9040
|
-
children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react20.Loader, { className: "animate-spin h-4 w-4" }) : /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
9100
|
+
children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react20.Loader, { className: "animate-spin h-4 w-4" }) : /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react20.ChevronRight, { className: "h-4 w-4" })
|
|
9041
9101
|
}
|
|
9042
9102
|
)
|
|
9043
9103
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
@@ -9056,12 +9116,12 @@ function PasswordPasskey(props) {
|
|
|
9056
9116
|
]
|
|
9057
9117
|
}
|
|
9058
9118
|
),
|
|
9059
|
-
!isEncryptionMethod && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Highlight, { type: "info", className: "w-full flex flex-col gap-[var(--l-pass-gap)] text-[10px]", children: mode === "backup" && /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex gap-[var(--l-pass-gap)]", children: [
|
|
9119
|
+
!isEncryptionMethod && !!usePasskey && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Highlight, { type: "info", className: "w-full flex flex-col gap-[var(--l-pass-gap)] text-[10px]", children: mode === "backup" && /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex gap-[var(--l-pass-gap)]", children: [
|
|
9060
9120
|
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react20.Info, { className: "h-4 w-4 flex-shrink-0" }),
|
|
9061
9121
|
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("span", { className: "text-[var(--l-pass-fg-muted)] block flex-1", children: [
|
|
9062
9122
|
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "block mb-1", children: "Your Backup must be encrypted with a password or a passkey, so only you can decrypt it no matter where backup is stored." }),
|
|
9063
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("span", { children: [
|
|
9064
|
-
"
|
|
9123
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("span", { className: "block", children: [
|
|
9124
|
+
" Passkeys are a password-free alternative. ",
|
|
9065
9125
|
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
9066
9126
|
"a",
|
|
9067
9127
|
{
|
|
@@ -9096,7 +9156,7 @@ function NoBackupFound(props) {
|
|
|
9096
9156
|
!restoreFile && /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(Highlight, { type: "warning", className: "animate-glow-warning flex gap-[var(--l-pass-gap)]", children: [
|
|
9097
9157
|
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_lucide_react21.AlertCircle, { className: "h-4 w-4 flex-0" }),
|
|
9098
9158
|
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "w-full flex-1 flex flex-col gap-2", children: [
|
|
9099
|
-
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "block w-full text-
|
|
9159
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "block w-full text-sm leading-4 font-bold", children: "No Backup Found" }),
|
|
9100
9160
|
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("span", { className: "block w-full text-xs", children: [
|
|
9101
9161
|
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "block mb-1", children: "This device doesn't have access to your wallet keyshare, and no backup was found." }),
|
|
9102
9162
|
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "block w-full", children: "If you're using a different device, please return to the one where you created your account to create a backup, then restore access on this device." })
|
|
@@ -9153,12 +9213,12 @@ function NoBackupFound(props) {
|
|
|
9153
9213
|
var import_lucide_react22 = require("lucide-react");
|
|
9154
9214
|
|
|
9155
9215
|
// src/internal/components/ui/switch.tsx
|
|
9156
|
-
var
|
|
9216
|
+
var import_react33 = require("react");
|
|
9157
9217
|
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
9158
|
-
var Switch = (0,
|
|
9218
|
+
var Switch = (0, import_react33.forwardRef)((props, ref) => {
|
|
9159
9219
|
const { className, labels, ...inputProps } = props;
|
|
9160
9220
|
const colorMode = useLayoutStore((st) => st.colorMode);
|
|
9161
|
-
const [labelW, setLabelW] = (0,
|
|
9221
|
+
const [labelW, setLabelW] = (0, import_react33.useState)(0);
|
|
9162
9222
|
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
9163
9223
|
"div",
|
|
9164
9224
|
{
|
|
@@ -9166,7 +9226,7 @@ var Switch = (0, import_react32.forwardRef)((props, ref) => {
|
|
|
9166
9226
|
"aria-checked": inputProps.checked,
|
|
9167
9227
|
className: cn(
|
|
9168
9228
|
"block rounded-full w-fit h-7 p-1 outline-none flex-none",
|
|
9169
|
-
inputProps.checked ? "bg-[var(--l-pass-bg-success)]" : "bg-[var(--l-pass-
|
|
9229
|
+
inputProps.checked ? "bg-[var(--l-pass-bg-success)]" : "bg-[var(--l-pass-bg-info)]",
|
|
9170
9230
|
className
|
|
9171
9231
|
),
|
|
9172
9232
|
children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
@@ -9188,7 +9248,7 @@ var Switch = (0, import_react32.forwardRef)((props, ref) => {
|
|
|
9188
9248
|
},
|
|
9189
9249
|
style: {
|
|
9190
9250
|
left: inputProps.checked ? "0px" : "20px",
|
|
9191
|
-
color: inputProps.checked ? colorMode === "dark" ? "var(--l-pass-fg-inverted)" : "var(--l-pass-fg)" : "var(--l-pass-fg
|
|
9251
|
+
color: inputProps.checked ? colorMode === "dark" ? "var(--l-pass-fg-inverted)" : "var(--l-pass-fg)" : "var(--l-pass-fg)",
|
|
9192
9252
|
transition: "left 200ms ease"
|
|
9193
9253
|
},
|
|
9194
9254
|
className: "absolute top-0 px-2 text-xs leading-5 font-semibold min-w-5 select-none",
|
|
@@ -9202,7 +9262,10 @@ var Switch = (0, import_react32.forwardRef)((props, ref) => {
|
|
|
9202
9262
|
left: inputProps.checked ? `${labelW}px` : "0px",
|
|
9203
9263
|
transition: "left 200ms ease"
|
|
9204
9264
|
},
|
|
9205
|
-
className: "absolute top-0 w-5 h-5 bg-[var(--l-pass-fg
|
|
9265
|
+
className: cn("absolute top-0 w-5 h-5 rounded-full bg-[var(--l-pass-fg)]", {
|
|
9266
|
+
// 'bg-[var(--l-pass-fg-inverted)]': inputProps.checked,
|
|
9267
|
+
// 'bg-[var(--l-pass-fg)]': !inputProps.checked
|
|
9268
|
+
})
|
|
9206
9269
|
}
|
|
9207
9270
|
)
|
|
9208
9271
|
]
|
|
@@ -9312,23 +9375,24 @@ function File2(props) {
|
|
|
9312
9375
|
var import_react_query15 = require("@tanstack/react-query");
|
|
9313
9376
|
var import_dayjs = __toESM(require("dayjs"), 1);
|
|
9314
9377
|
var import_lucide_react23 = require("lucide-react");
|
|
9315
|
-
var
|
|
9378
|
+
var import_react34 = require("react");
|
|
9316
9379
|
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
9317
9380
|
function Server(props) {
|
|
9318
9381
|
const { isLoading, mode = "restore", serverHandler } = props;
|
|
9319
9382
|
const qc = (0, import_react_query15.useQueryClient)();
|
|
9320
9383
|
const address = useLumiaPassportSession((st) => st.address);
|
|
9384
|
+
const hasServerVault = useLumiaPassportSession((st) => st.hasServerVault);
|
|
9321
9385
|
const { usePasskey, error, setUsePasskey, setRestorePassword, setShowPassword, setMethod, setError, setSuccess } = useRestoreStore();
|
|
9322
9386
|
const serverRecoveryStatus = qc.getQueryData([CHECK_BACKUP_QUERY_KEY, address]);
|
|
9323
|
-
(0,
|
|
9387
|
+
(0, import_react34.useEffect)(() => {
|
|
9324
9388
|
if (mode === "backup" || !serverRecoveryStatus?.created?.encryptionMethod) return;
|
|
9325
9389
|
setUsePasskey(serverRecoveryStatus.created.encryptionMethod === "passkey");
|
|
9326
9390
|
}, [mode, serverRecoveryStatus, setUsePasskey]);
|
|
9327
9391
|
const isEncryptionMethod = mode === "restore" && !!serverRecoveryStatus?.created?.encryptionMethod;
|
|
9328
9392
|
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_jsx_runtime43.Fragment, { children: [
|
|
9329
|
-
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
9393
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: cn("flex items-center justify-between", { "px-[var(--l-pass-pd)]": !hasServerVault }), children: [
|
|
9330
9394
|
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "flex items-center gap-[var(--l-pass-gap)]", children: [
|
|
9331
|
-
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
9395
|
+
!!hasServerVault && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
9332
9396
|
Button,
|
|
9333
9397
|
{
|
|
9334
9398
|
variant: "ghost",
|
|
@@ -9353,9 +9417,10 @@ function Server(props) {
|
|
|
9353
9417
|
{
|
|
9354
9418
|
name: "password-passkey-toggle",
|
|
9355
9419
|
labels: { checked: "Password", unchecked: "Passkey" },
|
|
9356
|
-
disabled: isLoading
|
|
9420
|
+
disabled: isLoading,
|
|
9357
9421
|
checked: !usePasskey,
|
|
9358
9422
|
onChange: (e) => {
|
|
9423
|
+
if (!!error) setError(null);
|
|
9359
9424
|
if (!!e.target.checked) setRestorePassword("");
|
|
9360
9425
|
setUsePasskey(!e.target.checked);
|
|
9361
9426
|
}
|
|
@@ -9390,7 +9455,7 @@ function Server(props) {
|
|
|
9390
9455
|
// src/internal/components/KeyshareRestoreMenu/methods/Cloud.tsx
|
|
9391
9456
|
var import_react_query16 = require("@tanstack/react-query");
|
|
9392
9457
|
var import_lucide_react25 = require("lucide-react");
|
|
9393
|
-
var
|
|
9458
|
+
var import_react35 = require("react");
|
|
9394
9459
|
|
|
9395
9460
|
// src/internal/components/ui/select.tsx
|
|
9396
9461
|
var SelectPrimitive = __toESM(require("@radix-ui/react-select"), 1);
|
|
@@ -9538,7 +9603,7 @@ function Cloud2(props) {
|
|
|
9538
9603
|
return availableProviders.map((p) => ({ id: p.id, name: p.name, available: p.isAvailable() }));
|
|
9539
9604
|
}
|
|
9540
9605
|
});
|
|
9541
|
-
(0,
|
|
9606
|
+
(0, import_react35.useEffect)(() => {
|
|
9542
9607
|
if (isCloudProvidersLoading) return;
|
|
9543
9608
|
if (!!cloudProvidersError) {
|
|
9544
9609
|
console.error("[KeyshareBackup] Failed to load cloud providers:", cloudProvidersError);
|
|
@@ -9622,7 +9687,7 @@ var KeyshareRestoreMenu = () => {
|
|
|
9622
9687
|
const maxScrollHeight = useLayoutStore((st) => st.maxScrollHeight);
|
|
9623
9688
|
const setIsDialogForced = useLayoutStore((st) => st.setIsDialogForced);
|
|
9624
9689
|
const setPage = useLayoutDataStore((st) => st.setPage);
|
|
9625
|
-
(0,
|
|
9690
|
+
(0, import_react36.useEffect)(() => setIsDialogForced(true), []);
|
|
9626
9691
|
useCheckBackupAvailability();
|
|
9627
9692
|
const {
|
|
9628
9693
|
method: currentRestoreMethod,
|
|
@@ -9754,7 +9819,7 @@ var KeyshareRestoreMenu = () => {
|
|
|
9754
9819
|
// src/internal/components/KeyshareRestoreMenu/KeyshareBackupMenu.tsx
|
|
9755
9820
|
var import_react_query18 = require("@tanstack/react-query");
|
|
9756
9821
|
var import_lucide_react27 = require("lucide-react");
|
|
9757
|
-
var
|
|
9822
|
+
var import_react37 = require("react");
|
|
9758
9823
|
init_vaultClient();
|
|
9759
9824
|
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
9760
9825
|
var COMPONENTS = {
|
|
@@ -9764,10 +9829,10 @@ var COMPONENTS = {
|
|
|
9764
9829
|
};
|
|
9765
9830
|
function KeyshareBackupMenu() {
|
|
9766
9831
|
const address = useLumiaPassportSession((st) => st.address);
|
|
9832
|
+
const hasServerVault = useLumiaPassportSession((st) => st.hasServerVault);
|
|
9767
9833
|
const setPage = useLayoutDataStore((st) => st.setPage);
|
|
9768
9834
|
const setMainPageHeight = useLayoutDataStore((st) => st.setMainPageHeight);
|
|
9769
9835
|
const maxScrollHeight = useLayoutStore((st) => st.maxScrollHeight);
|
|
9770
|
-
(0, import_react36.useEffect)(() => setMainPageHeight(DEFAULT_SETTINGS_MENU_HEIGHT), [setMainPageHeight]);
|
|
9771
9836
|
const {
|
|
9772
9837
|
method: currentBackupMethod,
|
|
9773
9838
|
error,
|
|
@@ -9778,8 +9843,15 @@ function KeyshareBackupMenu() {
|
|
|
9778
9843
|
setRestorePassword,
|
|
9779
9844
|
setRestoreFile,
|
|
9780
9845
|
setShowPassword,
|
|
9781
|
-
setUsePasskey
|
|
9846
|
+
setUsePasskey,
|
|
9847
|
+
setMethod
|
|
9782
9848
|
} = useRestoreStore();
|
|
9849
|
+
(0, import_react37.useEffect)(() => {
|
|
9850
|
+
setMainPageHeight(DEFAULT_SETTINGS_MENU_HEIGHT);
|
|
9851
|
+
return () => {
|
|
9852
|
+
setMethod(null);
|
|
9853
|
+
};
|
|
9854
|
+
}, []);
|
|
9783
9855
|
const { data: serverRecoveryStatus } = (0, import_react_query18.useQuery)({
|
|
9784
9856
|
retry: false,
|
|
9785
9857
|
queryKey: [CHECK_BACKUP_QUERY_KEY, address],
|
|
@@ -9801,7 +9873,11 @@ function KeyshareBackupMenu() {
|
|
|
9801
9873
|
style: { "--l-pass-scrollbar-mah": `${maxScrollHeight}px` },
|
|
9802
9874
|
className: "list-scrollbar-y w-full",
|
|
9803
9875
|
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(Expandable, { isExpanded: true, contentClassName: "w-full flex flex-col gap-[var(--l-pass-gap)] p-[var(--l-pass-pd)]", children: [
|
|
9804
|
-
!
|
|
9876
|
+
!hasServerVault && /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "flex items-center justify-center gap-2 px-5 pt-3 pb-6", children: [
|
|
9877
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_lucide_react27.LockIcon, { className: "w-6 h-6" }),
|
|
9878
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "font-bold text-xl leading-6", children: "Secure Account" })
|
|
9879
|
+
] }),
|
|
9880
|
+
!!hasServerVault && !currentBackupMethod && /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "flex items-center gap-[var(--l-pass-gap)]", children: [
|
|
9805
9881
|
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
9806
9882
|
Button,
|
|
9807
9883
|
{
|
|
@@ -9816,14 +9892,15 @@ function KeyshareBackupMenu() {
|
|
|
9816
9892
|
setUsePasskey(false);
|
|
9817
9893
|
setError(null);
|
|
9818
9894
|
setSuccess(null);
|
|
9895
|
+
setMethod(null);
|
|
9819
9896
|
setPage("settings" /* SETTINGS */);
|
|
9820
9897
|
},
|
|
9821
9898
|
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_lucide_react27.ArrowLeft, { className: "h-4 w-4" })
|
|
9822
9899
|
}
|
|
9823
9900
|
),
|
|
9824
|
-
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "text-xl font-semibold", children: "Create Backup" })
|
|
9901
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "text-xl font-semibold leading-8", children: "Create Backup" })
|
|
9825
9902
|
] }),
|
|
9826
|
-
!currentBackupMethod && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(MethodSelector, { mode: "backup", serverRecoveryStatus }),
|
|
9903
|
+
!!hasServerVault && !currentBackupMethod && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(MethodSelector, { mode: "backup", serverRecoveryStatus }),
|
|
9827
9904
|
!!currentBackupMethod && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_jsx_runtime47.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
9828
9905
|
BackupComponent,
|
|
9829
9906
|
{
|
|
@@ -9859,7 +9936,7 @@ function KeyshareBackupMenu() {
|
|
|
9859
9936
|
|
|
9860
9937
|
// src/internal/components/MainMenu/MainMenu.tsx
|
|
9861
9938
|
var import_lucide_react28 = require("lucide-react");
|
|
9862
|
-
var
|
|
9939
|
+
var import_react38 = require("react");
|
|
9863
9940
|
|
|
9864
9941
|
// src/internal/components/ManageWalletMenu/hooks/useProvidersList.ts
|
|
9865
9942
|
var import_react_query19 = require("@tanstack/react-query");
|
|
@@ -9889,7 +9966,7 @@ function MainMenu() {
|
|
|
9889
9966
|
const address = useLumiaPassportSession((st) => st.address);
|
|
9890
9967
|
const setPage = useLayoutDataStore((st) => st.setPage);
|
|
9891
9968
|
const setMainPageHeight = useLayoutDataStore((st) => st.setMainPageHeight);
|
|
9892
|
-
(0,
|
|
9969
|
+
(0, import_react38.useEffect)(() => setMainPageHeight(DEFAULT_MAIN_MENU_HEIGHT), [setMainPageHeight]);
|
|
9893
9970
|
useProvidersList();
|
|
9894
9971
|
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "w-full p-[var(--l-pass-pd)] flex flex-col gap-[var(--l-pass-gap)]", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "w-full grid grid-cols-4 gap-0 md:gap-[var(--l-pass-gap)] py-[10px] md:py-1", children: MAIN_MENU_BUTTONS.map(({ id, label, icon: Icon2 }) => /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
9895
9972
|
Button,
|
|
@@ -9911,11 +9988,11 @@ function MainMenu() {
|
|
|
9911
9988
|
// src/internal/components/ManageWalletMenu/ManageWallet.tsx
|
|
9912
9989
|
var import_lodash_es3 = require("lodash-es");
|
|
9913
9990
|
var import_lucide_react32 = require("lucide-react");
|
|
9914
|
-
var
|
|
9991
|
+
var import_react42 = require("react");
|
|
9915
9992
|
|
|
9916
9993
|
// src/modules/linkedProfiles.ts
|
|
9917
9994
|
var import_react_query20 = require("@tanstack/react-query");
|
|
9918
|
-
var
|
|
9995
|
+
var import_react39 = require("react");
|
|
9919
9996
|
init_auth();
|
|
9920
9997
|
init_common();
|
|
9921
9998
|
init_types();
|
|
@@ -9948,7 +10025,7 @@ function useLumiaPassportLinkedProfiles() {
|
|
|
9948
10025
|
queryFn: getLinkProfilesData
|
|
9949
10026
|
});
|
|
9950
10027
|
const { profiles = [], avatar = null } = data || {};
|
|
9951
|
-
const refresh = (0,
|
|
10028
|
+
const refresh = (0, import_react39.useCallback)(async () => {
|
|
9952
10029
|
await qc.invalidateQueries({ queryKey: [LINKED_PROFILES_QUERY_KEY, address] });
|
|
9953
10030
|
}, [qc, address]);
|
|
9954
10031
|
return { profiles, avatar, isLoading, error, refresh };
|
|
@@ -10328,7 +10405,7 @@ function EmailNotConnectedWarning() {
|
|
|
10328
10405
|
|
|
10329
10406
|
// src/internal/components/ManageWalletMenu/hooks/useLinkSocial.ts
|
|
10330
10407
|
var import_react_query25 = require("@tanstack/react-query");
|
|
10331
|
-
var
|
|
10408
|
+
var import_react40 = __toESM(require("react"), 1);
|
|
10332
10409
|
init_auth();
|
|
10333
10410
|
function useLinkSocial() {
|
|
10334
10411
|
const qc = (0, import_react_query25.useQueryClient)();
|
|
@@ -10340,7 +10417,7 @@ function useLinkSocial() {
|
|
|
10340
10417
|
const setPage = useLayoutDataStore((st) => st.setPage);
|
|
10341
10418
|
const isWalletLinking = useLayoutDataStore((st) => st.isWalletLinking);
|
|
10342
10419
|
const { providerType, linkIsLoading, setProviderType, setAlert, setLinkIsLoading } = useManageWalletStore();
|
|
10343
|
-
const handleLinkSocialProvider =
|
|
10420
|
+
const handleLinkSocialProvider = import_react40.default.useCallback(
|
|
10344
10421
|
async (providerIdRaw) => {
|
|
10345
10422
|
const providerKey = providerIdRaw.toLowerCase();
|
|
10346
10423
|
const normalizedKey = providerKey === "twitter" ? "x" : providerKey;
|
|
@@ -10392,8 +10469,8 @@ function useLinkSocial() {
|
|
|
10392
10469
|
},
|
|
10393
10470
|
[config.social?.providers, callbacks]
|
|
10394
10471
|
);
|
|
10395
|
-
const [socialLinkStarted, setSocialLinkStarted] =
|
|
10396
|
-
(0,
|
|
10472
|
+
const [socialLinkStarted, setSocialLinkStarted] = import_react40.default.useState(false);
|
|
10473
|
+
(0, import_react40.useEffect)(() => {
|
|
10397
10474
|
const key = providerType?.toLowerCase();
|
|
10398
10475
|
console.log("[useLinkSocial] Effect triggered:", { key, linkIsLoading, socialLinkStarted, isWalletLinking });
|
|
10399
10476
|
if (isWalletLinking) {
|
|
@@ -10414,7 +10491,7 @@ function useLinkSocial() {
|
|
|
10414
10491
|
|
|
10415
10492
|
// src/internal/components/ManageWalletMenu/hooks/useLinkTelegram.ts
|
|
10416
10493
|
var import_react_query26 = require("@tanstack/react-query");
|
|
10417
|
-
var
|
|
10494
|
+
var import_react41 = require("react");
|
|
10418
10495
|
init_telegram2();
|
|
10419
10496
|
function useLinkTelegram() {
|
|
10420
10497
|
const {
|
|
@@ -10426,7 +10503,7 @@ function useLinkTelegram() {
|
|
|
10426
10503
|
const isWalletLinking = useLayoutDataStore((st) => st.isWalletLinking);
|
|
10427
10504
|
const { providerType, linkIsLoading, setLinkIsLoading, setProviderType, setAlert } = useManageWalletStore();
|
|
10428
10505
|
const setPage = useLayoutDataStore((st) => st.setPage);
|
|
10429
|
-
const handleLinkTelegram = (0,
|
|
10506
|
+
const handleLinkTelegram = (0, import_react41.useCallback)(async () => {
|
|
10430
10507
|
try {
|
|
10431
10508
|
setLinkIsLoading(true);
|
|
10432
10509
|
setAlert(null);
|
|
@@ -10468,8 +10545,8 @@ function useLinkTelegram() {
|
|
|
10468
10545
|
setLinkIsLoading(false);
|
|
10469
10546
|
}
|
|
10470
10547
|
}, [config.social?.providers, callbacks]);
|
|
10471
|
-
const [telegramLinkStarted, setTelegramLinkStarted] = (0,
|
|
10472
|
-
(0,
|
|
10548
|
+
const [telegramLinkStarted, setTelegramLinkStarted] = (0, import_react41.useState)(false);
|
|
10549
|
+
(0, import_react41.useEffect)(() => {
|
|
10473
10550
|
console.log("[useLinkTelegram] Effect triggered:", {
|
|
10474
10551
|
providerType,
|
|
10475
10552
|
linkIsLoading,
|
|
@@ -10486,7 +10563,7 @@ function useLinkTelegram() {
|
|
|
10486
10563
|
handleLinkTelegram();
|
|
10487
10564
|
}
|
|
10488
10565
|
}, [providerType, handleLinkTelegram, linkIsLoading, telegramLinkStarted, isWalletLinking]);
|
|
10489
|
-
(0,
|
|
10566
|
+
(0, import_react41.useEffect)(() => {
|
|
10490
10567
|
if (providerType !== "telegram") {
|
|
10491
10568
|
setTelegramLinkStarted(false);
|
|
10492
10569
|
}
|
|
@@ -10595,7 +10672,7 @@ function ManageWalletMenu() {
|
|
|
10595
10672
|
} = useManageWalletStore();
|
|
10596
10673
|
const configuredProviders = getConfiguredProviders(config);
|
|
10597
10674
|
const { data: providers = [], isLoading: isProvidersLoading, error: providersError } = useProvidersList();
|
|
10598
|
-
const renderProviders = (0,
|
|
10675
|
+
const renderProviders = (0, import_react42.useMemo)(() => {
|
|
10599
10676
|
const normalizeProviderName = (name) => {
|
|
10600
10677
|
if (name === "x") return "twitter";
|
|
10601
10678
|
return name;
|
|
@@ -10715,7 +10792,7 @@ function ManageWalletMenu() {
|
|
|
10715
10792
|
// src/internal/components/ManageWalletMenu/UnlinkProviderMenu.tsx
|
|
10716
10793
|
var import_react_query27 = require("@tanstack/react-query");
|
|
10717
10794
|
var import_lucide_react33 = require("lucide-react");
|
|
10718
|
-
var
|
|
10795
|
+
var import_react43 = require("react");
|
|
10719
10796
|
init_auth();
|
|
10720
10797
|
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
10721
10798
|
function UnlinkProviderMenu() {
|
|
@@ -10724,7 +10801,7 @@ function UnlinkProviderMenu() {
|
|
|
10724
10801
|
const { callbacks } = useLumiaPassportConfig();
|
|
10725
10802
|
const setPage = useLayoutDataStore((st) => st.setPage);
|
|
10726
10803
|
const { confirmUnlink, setConfirmUnlink, setAlert } = useManageWalletStore();
|
|
10727
|
-
const [confirmInput, setConfirmInput] = (0,
|
|
10804
|
+
const [confirmInput, setConfirmInput] = (0, import_react43.useState)("");
|
|
10728
10805
|
const { mutate: handleUnlinkProvider, isPending: isProviderUnlinking } = (0, import_react_query27.useMutation)({
|
|
10729
10806
|
mutationFn: async () => {
|
|
10730
10807
|
if (!confirmUnlink) {
|
|
@@ -10800,10 +10877,10 @@ function UnlinkProviderMenu() {
|
|
|
10800
10877
|
// src/internal/components/PortfolioMenu/PortfolioMenu.tsx
|
|
10801
10878
|
var import_react_query30 = require("@tanstack/react-query");
|
|
10802
10879
|
var import_lucide_react35 = require("lucide-react");
|
|
10803
|
-
var
|
|
10880
|
+
var import_react46 = require("react");
|
|
10804
10881
|
|
|
10805
10882
|
// src/internal/hooks/useBlockscoutAssets.ts
|
|
10806
|
-
var
|
|
10883
|
+
var import_react44 = require("react");
|
|
10807
10884
|
var import_react_query28 = require("@tanstack/react-query");
|
|
10808
10885
|
var import_wagmi2 = require("wagmi");
|
|
10809
10886
|
var import_viem5 = require("viem");
|
|
@@ -10946,12 +11023,12 @@ function createError(error) {
|
|
|
10946
11023
|
function useBlockscoutAssets(options) {
|
|
10947
11024
|
const { address, enabled = true, detectSecurityTokens = true } = options;
|
|
10948
11025
|
const blockscoutApiUrl = getBlockscoutApiUrl();
|
|
10949
|
-
const blockscoutClient = (0,
|
|
11026
|
+
const blockscoutClient = (0, import_react44.useMemo)(
|
|
10950
11027
|
() => (0, import_clients2.createBlockscoutClient)({ baseUrl: blockscoutApiUrl }),
|
|
10951
11028
|
[blockscoutApiUrl]
|
|
10952
11029
|
);
|
|
10953
11030
|
const publicClient2 = (0, import_wagmi2.usePublicClient)({ chainId: lumiaBeam.id });
|
|
10954
|
-
const lastRefreshRef = (0,
|
|
11031
|
+
const lastRefreshRef = (0, import_react44.useRef)(0);
|
|
10955
11032
|
const {
|
|
10956
11033
|
data: nativeBalanceData,
|
|
10957
11034
|
isLoading: nativeLoading,
|
|
@@ -10991,7 +11068,7 @@ function useBlockscoutAssets(options) {
|
|
|
10991
11068
|
retry: 2,
|
|
10992
11069
|
retryDelay: 1e3
|
|
10993
11070
|
});
|
|
10994
|
-
const erc20TokenAddresses = (0,
|
|
11071
|
+
const erc20TokenAddresses = (0, import_react44.useMemo)(() => {
|
|
10995
11072
|
if (!tokenBalances) return [];
|
|
10996
11073
|
return tokenBalances.filter((tb) => tb.token.type === "ERC-20").map((tb) => tb.token.address);
|
|
10997
11074
|
}, [tokenBalances]);
|
|
@@ -11035,7 +11112,7 @@ function useBlockscoutAssets(options) {
|
|
|
11035
11112
|
gcTime: BLOCKSCOUT_QUERY_GC_TIME,
|
|
11036
11113
|
retry: 1
|
|
11037
11114
|
});
|
|
11038
|
-
const assets = (0,
|
|
11115
|
+
const assets = (0, import_react44.useMemo)(() => {
|
|
11039
11116
|
const result = [];
|
|
11040
11117
|
if (nativeBalanceData) {
|
|
11041
11118
|
result.push({
|
|
@@ -11071,7 +11148,7 @@ function useBlockscoutAssets(options) {
|
|
|
11071
11148
|
}
|
|
11072
11149
|
return result;
|
|
11073
11150
|
}, [nativeBalanceData, tokenBalances, nftItems, erc3643Results]);
|
|
11074
|
-
const nativeBalance = (0,
|
|
11151
|
+
const nativeBalance = (0, import_react44.useMemo)(() => {
|
|
11075
11152
|
if (!nativeBalanceData) return null;
|
|
11076
11153
|
return {
|
|
11077
11154
|
value: nativeBalanceData.value,
|
|
@@ -11079,11 +11156,11 @@ function useBlockscoutAssets(options) {
|
|
|
11079
11156
|
symbol: "LUMIA"
|
|
11080
11157
|
};
|
|
11081
11158
|
}, [nativeBalanceData]);
|
|
11082
|
-
const error = (0,
|
|
11159
|
+
const error = (0, import_react44.useMemo)(() => {
|
|
11083
11160
|
if (!tokensError) return null;
|
|
11084
11161
|
return createError(tokensError);
|
|
11085
11162
|
}, [tokensError]);
|
|
11086
|
-
const refreshBalances = (0,
|
|
11163
|
+
const refreshBalances = (0, import_react44.useCallback)(async () => {
|
|
11087
11164
|
const now = Date.now();
|
|
11088
11165
|
if (now - lastRefreshRef.current < BLOCKSCOUT_REFRESH_DEBOUNCE) {
|
|
11089
11166
|
return;
|
|
@@ -11091,7 +11168,7 @@ function useBlockscoutAssets(options) {
|
|
|
11091
11168
|
lastRefreshRef.current = now;
|
|
11092
11169
|
await Promise.all([refetchNative(), refetchTokens(), refetchNfts()]);
|
|
11093
11170
|
}, [refetchNative, refetchTokens, refetchNfts]);
|
|
11094
|
-
const getTokenBalance = (0,
|
|
11171
|
+
const getTokenBalance = (0, import_react44.useCallback)(
|
|
11095
11172
|
(tokenAddress) => {
|
|
11096
11173
|
return assets.find((a) => a.address?.toLowerCase() === tokenAddress.toLowerCase()) || null;
|
|
11097
11174
|
},
|
|
@@ -11113,7 +11190,7 @@ function useBlockscoutAssets(options) {
|
|
|
11113
11190
|
// src/internal/components/PortfolioMenu/PortfolioItem.tsx
|
|
11114
11191
|
var import_react_query29 = require("@tanstack/react-query");
|
|
11115
11192
|
var import_lucide_react34 = require("lucide-react");
|
|
11116
|
-
var
|
|
11193
|
+
var import_react45 = require("react");
|
|
11117
11194
|
var import_viem6 = require("viem");
|
|
11118
11195
|
init_base();
|
|
11119
11196
|
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
@@ -11151,8 +11228,8 @@ async function getAssetRate2(symbol) {
|
|
|
11151
11228
|
var ASSETS_RATES_QUERY_KEY = "lumia-passport-assets-rates-query-key";
|
|
11152
11229
|
function PortfolioItem(props) {
|
|
11153
11230
|
const { address, asset, isProjectAsset } = props;
|
|
11154
|
-
const [nftImageError, setNftImageError] = (0,
|
|
11155
|
-
const [logoError, setLogoError] = (0,
|
|
11231
|
+
const [nftImageError, setNftImageError] = (0, import_react45.useState)(false);
|
|
11232
|
+
const [logoError, setLogoError] = (0, import_react45.useState)(false);
|
|
11156
11233
|
const { assets: projectAssets, showBalanceAs: showBalanceAsSymbol } = useLumiaPassportConfig().config.current.projectAssets || {};
|
|
11157
11234
|
const qc = (0, import_react_query29.useQueryClient)();
|
|
11158
11235
|
const { balanceQueryKey } = projectAssets?.find((a) => a.symbol === showBalanceAsSymbol) || {};
|
|
@@ -11278,7 +11355,7 @@ function PortfolioMenu() {
|
|
|
11278
11355
|
} = useBlockscoutAssets({
|
|
11279
11356
|
address
|
|
11280
11357
|
});
|
|
11281
|
-
const refreshAllAssetsBalances = (0,
|
|
11358
|
+
const refreshAllAssetsBalances = (0, import_react46.useCallback)(() => {
|
|
11282
11359
|
Promise.all(projectAssets.map((asset) => qc.invalidateQueries({ queryKey: asset.balanceQueryKey })));
|
|
11283
11360
|
refreshBlockscoutBalances();
|
|
11284
11361
|
}, [qc, projectAssets, refreshBlockscoutBalances]);
|
|
@@ -11331,8 +11408,9 @@ function PortfolioMenu() {
|
|
|
11331
11408
|
|
|
11332
11409
|
// src/internal/components/SecurityMenu/SecurityMenu.tsx
|
|
11333
11410
|
var import_react_query31 = require("@tanstack/react-query");
|
|
11411
|
+
var import_dayjs3 = __toESM(require("dayjs"), 1);
|
|
11334
11412
|
var import_lucide_react39 = require("lucide-react");
|
|
11335
|
-
var
|
|
11413
|
+
var import_react47 = require("react");
|
|
11336
11414
|
init_auth();
|
|
11337
11415
|
init_keyshare();
|
|
11338
11416
|
init_iframe_manager();
|
|
@@ -11524,8 +11602,8 @@ function SecurityMenu() {
|
|
|
11524
11602
|
const setPage = useLayoutDataStore((st) => st.setPage);
|
|
11525
11603
|
const userId = import_auth3.jwtTokenManager.getUserId();
|
|
11526
11604
|
const serverHasKeyshare = import_auth3.jwtTokenManager.getHasKeyshare() ?? false;
|
|
11527
|
-
const [isRemoving, setIsRemoving] = (0,
|
|
11528
|
-
const [appToRemove, setAppToRemove] = (0,
|
|
11605
|
+
const [isRemoving, setIsRemoving] = (0, import_react47.useState)(false);
|
|
11606
|
+
const [appToRemove, setAppToRemove] = (0, import_react47.useState)(null);
|
|
11529
11607
|
const { data: recoveryData, isFetching: isRecoveryLoading } = (0, import_react_query31.useQuery)({
|
|
11530
11608
|
enabled: !!userId,
|
|
11531
11609
|
queryKey: [KEYSHARE_RECOVERY_STATS_QUERY, userId],
|
|
@@ -11609,15 +11687,22 @@ function SecurityMenu() {
|
|
|
11609
11687
|
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "w-full space-y-1", children: trustedApps.map((app, index) => /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(
|
|
11610
11688
|
"div",
|
|
11611
11689
|
{
|
|
11612
|
-
className: "text-[10px] leading-tight p-2 rounded flex items-center gap-
|
|
11690
|
+
className: "text-[10px] leading-tight p-2 rounded-[var(--l-pass-el-bdrs)] flex items-center gap-[var(--l-pass-gap)] bg-[var(--l-pass-bg-info)]",
|
|
11613
11691
|
children: [
|
|
11614
|
-
app.appLogo ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
11692
|
+
app.appLogo ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
11693
|
+
"img",
|
|
11694
|
+
{
|
|
11695
|
+
src: app.appLogo,
|
|
11696
|
+
alt: app.appName,
|
|
11697
|
+
className: "w-8 h-8 rounded-[var(--l-pass-el-bdrs)] object-cover flex-shrink-0"
|
|
11698
|
+
}
|
|
11699
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "w-8 h-8 rounded-[var(--l-pass-el-bdrs)] bg-[var(--l-pass-bg-muted)] flex items-center justify-center flex-shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("span", { className: "text-sm", children: "\u{1F517}" }) }),
|
|
11615
11700
|
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "flex-1 min-w-0", children: [
|
|
11616
|
-
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "font-
|
|
11701
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "font-semibold truncate", children: app.appName || new URL(app.origin).hostname }),
|
|
11617
11702
|
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "text-[var(--l-pass-fg-muted)] truncate", children: new URL(app.origin).hostname }),
|
|
11618
|
-
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "text-[var(--l-pass-fg-muted)]", children: [
|
|
11703
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "text-[var(--l-pass-fg-muted)] truncate", children: [
|
|
11619
11704
|
"Trusted: ",
|
|
11620
|
-
|
|
11705
|
+
(0, import_dayjs3.default)(app.trustedAt).format("MMM D, YYYY HH:mm")
|
|
11621
11706
|
] })
|
|
11622
11707
|
] }),
|
|
11623
11708
|
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
@@ -11626,7 +11711,7 @@ function SecurityMenu() {
|
|
|
11626
11711
|
variant: "ghost",
|
|
11627
11712
|
size: "icon",
|
|
11628
11713
|
title: "Remove from trusted",
|
|
11629
|
-
className: "text-[var(--l-pass-error)] flex-shrink-0",
|
|
11714
|
+
className: "text-[var(--l-pass-bg-error)] flex-shrink-0",
|
|
11630
11715
|
onClick: () => setAppToRemove({
|
|
11631
11716
|
projectId: app.projectId,
|
|
11632
11717
|
origin: app.origin,
|
|
@@ -11634,7 +11719,7 @@ function SecurityMenu() {
|
|
|
11634
11719
|
appName: app.appName,
|
|
11635
11720
|
appLogo: app.appLogo
|
|
11636
11721
|
}),
|
|
11637
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_lucide_react39.Trash2, { className: "h-
|
|
11722
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_lucide_react39.Trash2, { className: "h-4 w-4" })
|
|
11638
11723
|
}
|
|
11639
11724
|
)
|
|
11640
11725
|
]
|
|
@@ -11684,21 +11769,21 @@ function SecurityMenu() {
|
|
|
11684
11769
|
|
|
11685
11770
|
// src/internal/components/SendRecieveMenu/SendLumiaMenu.tsx
|
|
11686
11771
|
var import_lucide_react40 = require("lucide-react");
|
|
11687
|
-
var
|
|
11772
|
+
var import_react50 = require("react");
|
|
11688
11773
|
var import_viem9 = require("viem");
|
|
11689
11774
|
var import_wagmi4 = require("wagmi");
|
|
11690
11775
|
|
|
11691
11776
|
// src/hooks/useSendTransaction.ts
|
|
11692
|
-
var
|
|
11777
|
+
var import_react48 = require("react");
|
|
11693
11778
|
var import_viem7 = require("viem");
|
|
11694
11779
|
init_account();
|
|
11695
11780
|
function useSendTransaction() {
|
|
11696
11781
|
const session = useLumiaPassportSession((st) => st.session);
|
|
11697
11782
|
const address = useLumiaPassportSession((st) => st.address);
|
|
11698
|
-
const [isLoading, setIsLoading] = (0,
|
|
11699
|
-
const [error, setError] = (0,
|
|
11700
|
-
const [userOpHash, setUserOpHash] = (0,
|
|
11701
|
-
const sendTransaction = (0,
|
|
11783
|
+
const [isLoading, setIsLoading] = (0, import_react48.useState)(false);
|
|
11784
|
+
const [error, setError] = (0, import_react48.useState)(null);
|
|
11785
|
+
const [userOpHash, setUserOpHash] = (0, import_react48.useState)(null);
|
|
11786
|
+
const sendTransaction = (0, import_react48.useCallback)(
|
|
11702
11787
|
async (params) => {
|
|
11703
11788
|
if (!session || !address) {
|
|
11704
11789
|
setError("No active session");
|
|
@@ -11738,7 +11823,7 @@ function useSendTransaction() {
|
|
|
11738
11823
|
},
|
|
11739
11824
|
[session, address]
|
|
11740
11825
|
);
|
|
11741
|
-
const reset = (0,
|
|
11826
|
+
const reset = (0, import_react48.useCallback)(() => {
|
|
11742
11827
|
setError(null);
|
|
11743
11828
|
setUserOpHash(null);
|
|
11744
11829
|
setIsLoading(false);
|
|
@@ -11753,7 +11838,7 @@ function useSendTransaction() {
|
|
|
11753
11838
|
}
|
|
11754
11839
|
|
|
11755
11840
|
// src/modules/assets.ts
|
|
11756
|
-
var
|
|
11841
|
+
var import_react49 = __toESM(require("react"), 1);
|
|
11757
11842
|
var import_wagmi3 = require("wagmi");
|
|
11758
11843
|
var import_viem8 = require("viem");
|
|
11759
11844
|
init_base();
|
|
@@ -11900,7 +11985,7 @@ function useTokenBalance(tokenAddress, userAddress) {
|
|
|
11900
11985
|
}
|
|
11901
11986
|
});
|
|
11902
11987
|
const { tokenInfo } = useTokenInfo(tokenAddress);
|
|
11903
|
-
const formattedBalance =
|
|
11988
|
+
const formattedBalance = import_react49.default.useMemo(() => {
|
|
11904
11989
|
if (!balance || !tokenInfo) return "0";
|
|
11905
11990
|
return (0, import_viem8.formatUnits)(balance, tokenInfo.decimals);
|
|
11906
11991
|
}, [balance, tokenInfo]);
|
|
@@ -11927,13 +12012,13 @@ function SendLumiaMenu() {
|
|
|
11927
12012
|
address,
|
|
11928
12013
|
chainId: lumiaBeam.id
|
|
11929
12014
|
});
|
|
11930
|
-
const [recipient, setRecipient] = (0,
|
|
11931
|
-
const [amount, setAmount] = (0,
|
|
11932
|
-
const [txStep, setTxStep] = (0,
|
|
11933
|
-
const [validationError, setValidationError] = (0,
|
|
12015
|
+
const [recipient, setRecipient] = (0, import_react50.useState)("");
|
|
12016
|
+
const [amount, setAmount] = (0, import_react50.useState)("");
|
|
12017
|
+
const [txStep, setTxStep] = (0, import_react50.useState)("input");
|
|
12018
|
+
const [validationError, setValidationError] = (0, import_react50.useState)(null);
|
|
11934
12019
|
const nativeAsset = assets.find((a) => a.type === "native");
|
|
11935
12020
|
const balance = nativeAsset ? parseFloat(nativeAsset.formattedBalance) : 0;
|
|
11936
|
-
(0,
|
|
12021
|
+
(0, import_react50.useEffect)(() => {
|
|
11937
12022
|
if (open) {
|
|
11938
12023
|
setTxStep("input");
|
|
11939
12024
|
setValidationError(null);
|
|
@@ -12097,7 +12182,7 @@ function SendLumiaMenu() {
|
|
|
12097
12182
|
// src/internal/components/SendRecieveMenu/ReceiveLumiaMenu.tsx
|
|
12098
12183
|
var import_lucide_react41 = require("lucide-react");
|
|
12099
12184
|
var import_qrcode = __toESM(require("qrcode"), 1);
|
|
12100
|
-
var
|
|
12185
|
+
var import_react51 = require("react");
|
|
12101
12186
|
init_clients();
|
|
12102
12187
|
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
12103
12188
|
function ReceiveLumiaMenu() {
|
|
@@ -12106,9 +12191,9 @@ function ReceiveLumiaMenu() {
|
|
|
12106
12191
|
const setPage = useLayoutDataStore((st) => st.setPage);
|
|
12107
12192
|
const maxScrollHeight = useLayoutStore((st) => st.maxScrollHeight);
|
|
12108
12193
|
const open = page === "receive";
|
|
12109
|
-
const [qrCodeUrl, setQrCodeUrl] = (0,
|
|
12110
|
-
const [copied, setCopied] = (0,
|
|
12111
|
-
(0,
|
|
12194
|
+
const [qrCodeUrl, setQrCodeUrl] = (0, import_react51.useState)("");
|
|
12195
|
+
const [copied, setCopied] = (0, import_react51.useState)(false);
|
|
12196
|
+
(0, import_react51.useEffect)(() => {
|
|
12112
12197
|
if (open && address) {
|
|
12113
12198
|
import_qrcode.default.toDataURL(address, {
|
|
12114
12199
|
width: 200,
|
|
@@ -12121,7 +12206,7 @@ function ReceiveLumiaMenu() {
|
|
|
12121
12206
|
});
|
|
12122
12207
|
}
|
|
12123
12208
|
}, [open, address]);
|
|
12124
|
-
const handleCopy = (0,
|
|
12209
|
+
const handleCopy = (0, import_react51.useCallback)(async () => {
|
|
12125
12210
|
if (!address) return;
|
|
12126
12211
|
try {
|
|
12127
12212
|
await navigator.clipboard.writeText(address);
|
|
@@ -12151,7 +12236,7 @@ function ReceiveLumiaMenu() {
|
|
|
12151
12236
|
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "flex items-center justify-center p-[var(--l-pass-pd)]", style: { minHeight: "216px" }, children: qrCodeUrl ? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("img", { src: qrCodeUrl, alt: "Wallet QR Code", className: "w-48 h-48" }) : /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_lucide_react41.Loader, { className: "w-5 h-5 animate-spin text-[var(--l-pass-fg-muted)]" }) }),
|
|
12152
12237
|
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(Highlight, { type: "info", children: [
|
|
12153
12238
|
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: "block w-full text-center font-mono text-[10px] break-all mb-2", children: address }),
|
|
12154
|
-
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Button, { onClick: handleCopy, className: "w-full", size: "
|
|
12239
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Button, { onClick: handleCopy, className: "w-full", size: "large", children: copied ? /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(import_jsx_runtime63.Fragment, { children: [
|
|
12155
12240
|
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_lucide_react41.CheckCircle2, { className: "h-4 w-4" }),
|
|
12156
12241
|
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { children: "Copied!" })
|
|
12157
12242
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(import_jsx_runtime63.Fragment, { children: [
|
|
@@ -12167,7 +12252,7 @@ function ReceiveLumiaMenu() {
|
|
|
12167
12252
|
|
|
12168
12253
|
// src/internal/components/SettingsMenu/SettingsMenu.tsx
|
|
12169
12254
|
var import_lucide_react43 = require("lucide-react");
|
|
12170
|
-
var
|
|
12255
|
+
var import_react52 = require("react");
|
|
12171
12256
|
|
|
12172
12257
|
// src/internal/components/SettingsMenu/constants.ts
|
|
12173
12258
|
var import_lucide_react42 = require("lucide-react");
|
|
@@ -12201,7 +12286,7 @@ function SettingsMenu() {
|
|
|
12201
12286
|
const setPage = useLayoutDataStore((st) => st.setPage);
|
|
12202
12287
|
const settingsNotifications = useLayoutDataStore((st) => st.settingsNotifications);
|
|
12203
12288
|
const setMainPageHeight = useLayoutDataStore((st) => st.setMainPageHeight);
|
|
12204
|
-
(0,
|
|
12289
|
+
(0, import_react52.useEffect)(() => setMainPageHeight(DEFAULT_SETTINGS_MENU_HEIGHT), [setMainPageHeight]);
|
|
12205
12290
|
useProvidersList();
|
|
12206
12291
|
const navItems = NAV_BUTTONS.map((el) => ({ ...el, onClick: () => setPage(el.id) }));
|
|
12207
12292
|
const highlightedKeys = settingsNotifications.map((n) => n.target);
|
|
@@ -12262,7 +12347,7 @@ function TermsOfService() {
|
|
|
12262
12347
|
// src/internal/components/TransactionsMenu/TransactionsMenu.tsx
|
|
12263
12348
|
var import_react_query32 = require("@tanstack/react-query");
|
|
12264
12349
|
var import_lucide_react46 = require("lucide-react");
|
|
12265
|
-
var
|
|
12350
|
+
var import_react53 = require("react");
|
|
12266
12351
|
|
|
12267
12352
|
// src/internal/components/TransactionsMenu/api.ts
|
|
12268
12353
|
init_base();
|
|
@@ -12732,7 +12817,7 @@ function TransactionsMenu() {
|
|
|
12732
12817
|
const page = useLayoutDataStore((st) => st.page);
|
|
12733
12818
|
const setPage = useLayoutDataStore((st) => st.setPage);
|
|
12734
12819
|
const maxScrollHeight = useLayoutStore((st) => st.maxScrollHeight);
|
|
12735
|
-
const [expandedGroups, setExpandedGroups] = (0,
|
|
12820
|
+
const [expandedGroups, setExpandedGroups] = (0, import_react53.useState)({});
|
|
12736
12821
|
const {
|
|
12737
12822
|
data: txHistoryGroups = [],
|
|
12738
12823
|
isLoading: isTxHistoryLoading,
|
|
@@ -12744,7 +12829,7 @@ function TransactionsMenu() {
|
|
|
12744
12829
|
queryKey: [TRANSACTIONS_HISTORY_QUERY_KEY, address],
|
|
12745
12830
|
queryFn: () => getTransactionsListQuery(address)
|
|
12746
12831
|
});
|
|
12747
|
-
const refreshTxHistory = (0,
|
|
12832
|
+
const refreshTxHistory = (0, import_react53.useCallback)(
|
|
12748
12833
|
() => qc.invalidateQueries({ queryKey: [TRANSACTIONS_HISTORY_QUERY_KEY, address] }),
|
|
12749
12834
|
[qc, address]
|
|
12750
12835
|
);
|
|
@@ -12778,7 +12863,7 @@ function TransactionsMenu() {
|
|
|
12778
12863
|
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_lucide_react46.XCircle, { className: "w-4 h-4 flex-none" }),
|
|
12779
12864
|
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "block w-full flex-1 text-center text-xs", children: txHistoryResolvedError })
|
|
12780
12865
|
] }),
|
|
12781
|
-
!isTxHistoryLoading && !txHistoryResolvedError && txHistoryGroups.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(Highlight, { type: "warning", children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { children: "No transactions found.
|
|
12866
|
+
!isTxHistoryLoading && !txHistoryResolvedError && txHistoryGroups.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(Highlight, { type: "warning", children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { children: "No transactions found." }) }),
|
|
12782
12867
|
!isTxHistoryLoading && !txHistoryResolvedError && txHistoryGroups.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "w-full flex flex-col gap-[var(--l-pass-gap)]", children: txHistoryGroups.map((group) => /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
12783
12868
|
TransactionsGroup,
|
|
12784
12869
|
{
|
|
@@ -12902,7 +12987,7 @@ function usePageMapper() {
|
|
|
12902
12987
|
setIsDialogOpen,
|
|
12903
12988
|
setIsDialogClosing
|
|
12904
12989
|
} = useLayoutStore();
|
|
12905
|
-
const closeDialog = (0,
|
|
12990
|
+
const closeDialog = (0, import_react54.useCallback)(() => {
|
|
12906
12991
|
setIsDialogClosing(true);
|
|
12907
12992
|
setTimeout(() => {
|
|
12908
12993
|
setDialogContent(null);
|
|
@@ -12913,7 +12998,7 @@ function usePageMapper() {
|
|
|
12913
12998
|
setIsDialogOpen(false);
|
|
12914
12999
|
}, CLEAR_DIALOG_TIMEOUT);
|
|
12915
13000
|
}, [setDialogContent, setDialogDescription, setDialogTitle, setIsDialogForced, setIsDialogOpen, setIsDialogClosing]);
|
|
12916
|
-
const openDialog = (0,
|
|
13001
|
+
const openDialog = (0, import_react54.useCallback)(
|
|
12917
13002
|
(pageItem) => {
|
|
12918
13003
|
const PageContentComponent = pageItem.component;
|
|
12919
13004
|
setDialogTitle(pageItem.title);
|
|
@@ -12923,7 +13008,7 @@ function usePageMapper() {
|
|
|
12923
13008
|
},
|
|
12924
13009
|
[setDialogContent, setDialogDescription, setDialogTitle, setIsDialogOpen]
|
|
12925
13010
|
);
|
|
12926
|
-
(0,
|
|
13011
|
+
(0, import_react54.useEffect)(() => {
|
|
12927
13012
|
if (page === null) return closeDialog();
|
|
12928
13013
|
const pageItem = protectedRoutes[page];
|
|
12929
13014
|
if (!pageItem) {
|
|
@@ -12936,30 +13021,18 @@ function usePageMapper() {
|
|
|
12936
13021
|
}
|
|
12937
13022
|
|
|
12938
13023
|
// src/internal/hooks/useSettingsNotifications.ts
|
|
12939
|
-
var
|
|
13024
|
+
var import_react55 = require("react");
|
|
12940
13025
|
init_auth();
|
|
12941
13026
|
var EMAIL_NOT_CONNECTED_NOTIFICATION = {
|
|
12942
13027
|
id: "email-not-connected",
|
|
12943
13028
|
target: "manage-wallet" /* MANAGE_WALLET */,
|
|
12944
13029
|
message: "Email is not connected"
|
|
12945
13030
|
};
|
|
12946
|
-
var BACKUP_IS_NOT_CREATED_NOTIFICATION = {
|
|
12947
|
-
id: "backup-is-not-created",
|
|
12948
|
-
target: "keysare-backup" /* KEYSARE_BACKUP */,
|
|
12949
|
-
message: "Backup is not created"
|
|
12950
|
-
};
|
|
12951
13031
|
function useSettingsNotifications() {
|
|
12952
|
-
const hasServerVault = useLumiaPassportSession((st) => st.hasServerVault);
|
|
12953
13032
|
const setSettingsNotifications = useLayoutDataStore((st) => st.setSettingsNotifications);
|
|
12954
13033
|
const providers = import_auth3.jwtTokenManager.getProviders();
|
|
12955
13034
|
const hasEmail = providers.includes("email");
|
|
12956
|
-
(0,
|
|
12957
|
-
setSettingsNotifications({
|
|
12958
|
-
...BACKUP_IS_NOT_CREATED_NOTIFICATION,
|
|
12959
|
-
status: hasServerVault ? "resolved" : "active"
|
|
12960
|
-
});
|
|
12961
|
-
}, [hasServerVault, setSettingsNotifications]);
|
|
12962
|
-
(0, import_react54.useEffect)(() => {
|
|
13035
|
+
(0, import_react55.useEffect)(() => {
|
|
12963
13036
|
setSettingsNotifications({
|
|
12964
13037
|
...EMAIL_NOT_CONNECTED_NOTIFICATION,
|
|
12965
13038
|
status: hasEmail ? "resolved" : "active"
|
|
@@ -12968,7 +13041,7 @@ function useSettingsNotifications() {
|
|
|
12968
13041
|
}
|
|
12969
13042
|
|
|
12970
13043
|
// src/internal/hooks/useWalletStatus.ts
|
|
12971
|
-
var
|
|
13044
|
+
var import_react56 = require("react");
|
|
12972
13045
|
init_auth();
|
|
12973
13046
|
function useWalletStatus() {
|
|
12974
13047
|
const isIframeReady = useLumiaPassportSession((st) => st.isIframeReady);
|
|
@@ -12978,7 +13051,7 @@ function useWalletStatus() {
|
|
|
12978
13051
|
config: { current: config },
|
|
12979
13052
|
callbacks
|
|
12980
13053
|
} = useLumiaPassportConfig();
|
|
12981
|
-
(0,
|
|
13054
|
+
(0, import_react56.useEffect)(() => {
|
|
12982
13055
|
if (!isIframeReady || !config.projectId || !callbacks?.onWalletReady) return;
|
|
12983
13056
|
const userId = import_auth3.jwtTokenManager.getUserId();
|
|
12984
13057
|
const hasKeyshare = import_auth3.jwtTokenManager.getHasKeyshare();
|
|
@@ -13003,11 +13076,12 @@ function LumiaPassportDialog() {
|
|
|
13003
13076
|
const config = useLumiaPassportConfig().config;
|
|
13004
13077
|
const className = config.current?.ui?.dialogClassName;
|
|
13005
13078
|
const session = useLumiaPassportSession((st) => st.session);
|
|
13079
|
+
const hasServerVault = useLumiaPassportSession((st) => st.hasServerVault);
|
|
13006
13080
|
const page = useLayoutDataStore((st) => st.page);
|
|
13007
13081
|
const mainPageHeight = useLayoutDataStore((st) => st.mainPageHeight);
|
|
13008
13082
|
const setPage = useLayoutDataStore((st) => st.setPage);
|
|
13009
13083
|
const { colorMode, isDialogOpen, dialogTitle, dialogDescription, dialogContent, isDialogForced, setIsSettings } = useLayoutStore();
|
|
13010
|
-
(0,
|
|
13084
|
+
(0, import_react57.useEffect)(() => setIsSettings(!!session), [session, setIsSettings]);
|
|
13011
13085
|
usePageMapper();
|
|
13012
13086
|
useAutoConnect();
|
|
13013
13087
|
useCheckVaultStatus();
|
|
@@ -13017,6 +13091,7 @@ function LumiaPassportDialog() {
|
|
|
13017
13091
|
useListenIframeAuthEvents();
|
|
13018
13092
|
useBackupWarning();
|
|
13019
13093
|
useWalletStatus();
|
|
13094
|
+
const isHeaderHidden = !session || page === "keysare-backup" /* KEYSARE_BACKUP */ && !hasServerVault;
|
|
13020
13095
|
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
13021
13096
|
Dialog,
|
|
13022
13097
|
{
|
|
@@ -13025,10 +13100,10 @@ function LumiaPassportDialog() {
|
|
|
13025
13100
|
if (isDialogForced) return;
|
|
13026
13101
|
if (!open) setPage(null);
|
|
13027
13102
|
},
|
|
13028
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(DialogContent, { colorMode,
|
|
13103
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(DialogContent, { colorMode, className, children: [
|
|
13029
13104
|
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(VisuallyHidden, { children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(DialogTitle, { children: dialogTitle }) }),
|
|
13030
13105
|
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(DialogDescription, { className: "sr-only", children: dialogDescription }),
|
|
13031
|
-
|
|
13106
|
+
!isHeaderHidden && /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(Header, {}),
|
|
13032
13107
|
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_framer_motion3.AnimatePresence, { mode: "wait", initial: false, children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
13033
13108
|
import_framer_motion3.motion.div,
|
|
13034
13109
|
{
|
|
@@ -13048,23 +13123,23 @@ function LumiaPassportDialog() {
|
|
|
13048
13123
|
}
|
|
13049
13124
|
|
|
13050
13125
|
// src/internal/components/TssManager.tsx
|
|
13051
|
-
var
|
|
13126
|
+
var import_react58 = __toESM(require("react"), 1);
|
|
13052
13127
|
init_auth();
|
|
13053
13128
|
init_clients();
|
|
13054
|
-
var TssManagerWithRef =
|
|
13129
|
+
var TssManagerWithRef = import_react58.default.forwardRef((props, ref) => {
|
|
13055
13130
|
const { mpcPin } = props;
|
|
13056
13131
|
const usePaymaster = useLumiaPassportSession((st) => st.usePaymaster);
|
|
13057
13132
|
const setStatus = useLumiaPassportSession((st) => st.setStatus);
|
|
13058
13133
|
const setSession = useLumiaPassportSession((st) => st.setSession);
|
|
13059
13134
|
const setAddress = useLumiaPassportSession((st) => st.setAddress);
|
|
13060
|
-
const onSessionCreated = (0,
|
|
13135
|
+
const onSessionCreated = (0, import_react58.useCallback)(
|
|
13061
13136
|
(session, address) => {
|
|
13062
13137
|
setSession(session);
|
|
13063
13138
|
setAddress(address);
|
|
13064
13139
|
},
|
|
13065
13140
|
[setSession, setAddress]
|
|
13066
13141
|
);
|
|
13067
|
-
const createSessionWithKeyshare =
|
|
13142
|
+
const createSessionWithKeyshare = import_react58.default.useCallback(
|
|
13068
13143
|
async (userId, hasServerKeyshare, isNewUser) => {
|
|
13069
13144
|
setStatus("checking key management setup...");
|
|
13070
13145
|
await ensureKeyshare(userId, hasServerKeyshare, setStatus, isNewUser);
|
|
@@ -13085,14 +13160,14 @@ var TssManagerWithRef = import_react57.default.forwardRef((props, ref) => {
|
|
|
13085
13160
|
},
|
|
13086
13161
|
[setStatus, usePaymaster, mpcPin]
|
|
13087
13162
|
);
|
|
13088
|
-
|
|
13163
|
+
import_react58.default.useImperativeHandle(ref, () => ({ createSessionWithKeyshare }), [createSessionWithKeyshare]);
|
|
13089
13164
|
return null;
|
|
13090
13165
|
});
|
|
13091
13166
|
|
|
13092
13167
|
// src/internal/components/WalletConnectHandler.tsx
|
|
13093
13168
|
var import_rainbowkit = require("@rainbow-me/rainbowkit");
|
|
13094
13169
|
var import_react_query33 = require("@tanstack/react-query");
|
|
13095
|
-
var
|
|
13170
|
+
var import_react59 = __toESM(require("react"), 1);
|
|
13096
13171
|
var import_wagmi5 = require("wagmi");
|
|
13097
13172
|
init_wallet();
|
|
13098
13173
|
function WalletConnectHandler() {
|
|
@@ -13110,7 +13185,7 @@ function WalletConnectHandler() {
|
|
|
13110
13185
|
const setManageWalletLinkError = useManageWalletStore((st) => st.setLinkError);
|
|
13111
13186
|
const setLinkIsLoading = useManageWalletStore((st) => st.setLinkIsLoading);
|
|
13112
13187
|
const setProviderType = useManageWalletStore((st) => st.setProviderType);
|
|
13113
|
-
const onLinkingComplete = (0,
|
|
13188
|
+
const onLinkingComplete = (0, import_react59.useCallback)(
|
|
13114
13189
|
async (success) => {
|
|
13115
13190
|
setIsWalletLinking(false);
|
|
13116
13191
|
if (!success && !passportWalletAddress) {
|
|
@@ -13137,8 +13212,8 @@ function WalletConnectHandler() {
|
|
|
13137
13212
|
},
|
|
13138
13213
|
[qc, passportWalletAddress, callbacks, setProviderType, setPage, setIsWalletLinking]
|
|
13139
13214
|
);
|
|
13140
|
-
const [hasStartedLinking, setHasStartedLinking] =
|
|
13141
|
-
(0,
|
|
13215
|
+
const [hasStartedLinking, setHasStartedLinking] = import_react59.default.useState(false);
|
|
13216
|
+
(0, import_react59.useEffect)(() => {
|
|
13142
13217
|
if (isWalletLinking && !hasStartedLinking) {
|
|
13143
13218
|
setHasStartedLinking(true);
|
|
13144
13219
|
setProviderType(null);
|
|
@@ -13158,7 +13233,7 @@ function WalletConnectHandler() {
|
|
|
13158
13233
|
if (isConnected) disconnect();
|
|
13159
13234
|
}
|
|
13160
13235
|
}, [isWalletLinking, hasStartedLinking, isConnected, openConnectModal, disconnect, setPage, setProviderType]);
|
|
13161
|
-
(0,
|
|
13236
|
+
(0, import_react59.useEffect)(() => {
|
|
13162
13237
|
if (hasStartedLinking && !connectModalOpen && !isConnected && isWalletLinking) {
|
|
13163
13238
|
console.log("[WalletConnectHandler] Modal closed without connecting");
|
|
13164
13239
|
onLinkingComplete(false);
|
|
@@ -13234,7 +13309,7 @@ function WalletConnectHandler() {
|
|
|
13234
13309
|
setPage(passportWalletAddress ? "manage-wallet" /* MANAGE_WALLET */ : "auth" /* AUTH */);
|
|
13235
13310
|
}
|
|
13236
13311
|
});
|
|
13237
|
-
(0,
|
|
13312
|
+
(0, import_react59.useEffect)(() => {
|
|
13238
13313
|
if (!!chain?.id && isConnected && walletAddress && isWalletLinking && hasStartedLinking) {
|
|
13239
13314
|
console.log("[WalletConnectHandler] handleWalletSign triggered");
|
|
13240
13315
|
handleWalletSign({ chainId: chain.id, signingWalletAddress: walletAddress });
|
|
@@ -13270,7 +13345,7 @@ var useLumiaPassportSession = (0, import_zustand6.create)((set) => ({
|
|
|
13270
13345
|
}));
|
|
13271
13346
|
function LumiaPassportSessionProvider({ children }) {
|
|
13272
13347
|
const config = useLumiaPassportConfig().config;
|
|
13273
|
-
return /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(
|
|
13348
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(import_react60.Fragment, { children: [
|
|
13274
13349
|
children,
|
|
13275
13350
|
config.current?.wallet?.enabled && /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(WalletConnectHandler, {}),
|
|
13276
13351
|
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(BalanceFeedProvider, {}),
|
|
@@ -13322,14 +13397,14 @@ var LumiaWagmiProvider = ({ children }) => {
|
|
|
13322
13397
|
|
|
13323
13398
|
// src/context/LumiaPassportContext.tsx
|
|
13324
13399
|
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
13325
|
-
var LumiaPassportContext = (0,
|
|
13400
|
+
var LumiaPassportContext = (0, import_react61.createContext)(void 0);
|
|
13326
13401
|
function LumiaPassportProvider(props) {
|
|
13327
13402
|
const { children, projectId, initialConfig = {}, callbacks } = props;
|
|
13328
13403
|
const setIsIframeReady = useLumiaPassportSession((st) => st.setIsIframeReady);
|
|
13329
13404
|
const setWalletReadyStatus = useLumiaPassportSession((st) => st.setWalletReadyStatus);
|
|
13330
|
-
(0,
|
|
13331
|
-
const config = (0,
|
|
13332
|
-
const updateConfig = (0,
|
|
13405
|
+
(0, import_react61.useEffect)(() => notifyNoProjetctId(projectId), [projectId]);
|
|
13406
|
+
const config = (0, import_react61.useRef)({ projectId, ...DEFAULT_LUMIA_PASSPORT_CONFIG });
|
|
13407
|
+
const updateConfig = (0, import_react61.useCallback)((updates) => {
|
|
13333
13408
|
const prev = config.current;
|
|
13334
13409
|
const next = { ...prev };
|
|
13335
13410
|
if (updates.projectId !== void 0) next.projectId = updates.projectId;
|
|
@@ -13364,7 +13439,7 @@ function LumiaPassportProvider(props) {
|
|
|
13364
13439
|
}
|
|
13365
13440
|
config.current = next;
|
|
13366
13441
|
}, []);
|
|
13367
|
-
(0,
|
|
13442
|
+
(0, import_react61.useEffect)(() => {
|
|
13368
13443
|
if (typeof window === "undefined" || !projectId) return;
|
|
13369
13444
|
const mergedConfig = (0, import_lodash_es4.merge)(DEFAULT_LUMIA_PASSPORT_CONFIG, initialConfig);
|
|
13370
13445
|
updateConfig(mergedConfig);
|
|
@@ -13409,18 +13484,18 @@ function LumiaPassportProvider(props) {
|
|
|
13409
13484
|
console.error("[LumiaPassport] Error setting up iframe manager:", error);
|
|
13410
13485
|
}
|
|
13411
13486
|
}, [projectId, initialConfig, callbacks, updateConfig, setIsIframeReady, setWalletReadyStatus]);
|
|
13412
|
-
const contextValue = (0,
|
|
13487
|
+
const contextValue = (0, import_react61.useMemo)(() => ({ config, updateConfig, callbacks }), [config, updateConfig, callbacks]);
|
|
13413
13488
|
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(LumiaWagmiProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(LumiaPassportContext.Provider, { value: contextValue, children }) });
|
|
13414
13489
|
}
|
|
13415
13490
|
var useLumiaPassportConfig = () => {
|
|
13416
|
-
const ctx = (0,
|
|
13491
|
+
const ctx = (0, import_react61.useContext)(LumiaPassportContext);
|
|
13417
13492
|
if (!ctx) throw new Error("useLumiaPassportConfig must be used within a LumiaPassportProvider");
|
|
13418
13493
|
return ctx;
|
|
13419
13494
|
};
|
|
13420
13495
|
|
|
13421
13496
|
// src/components/ConnectWalletButton.tsx
|
|
13422
13497
|
var import_lucide_react47 = require("lucide-react");
|
|
13423
|
-
var
|
|
13498
|
+
var import_react62 = require("react");
|
|
13424
13499
|
init_auth();
|
|
13425
13500
|
var import_jsx_runtime74 = (
|
|
13426
13501
|
/** external Buttons can be provided */
|
|
@@ -13444,10 +13519,10 @@ function ConnectWalletButton(props) {
|
|
|
13444
13519
|
const colorMode = useLayoutStore((st) => st.colorMode);
|
|
13445
13520
|
const { session, address, hasServerVault, isLoading, isIframeReady, status, setUsePaymaster } = useLumiaPassportSession();
|
|
13446
13521
|
const connectButtonLabel = getFormattedStatus(label || "Connect", status, isIframeReady);
|
|
13447
|
-
(0,
|
|
13522
|
+
(0, import_react62.useEffect)(() => setUsePaymaster(usePaymaster), [setUsePaymaster, usePaymaster]);
|
|
13448
13523
|
const avatar = import_auth3.jwtTokenManager.getAvatar();
|
|
13449
13524
|
const displayName = import_auth3.jwtTokenManager.getDisplayName();
|
|
13450
|
-
const indicators = (0,
|
|
13525
|
+
const indicators = (0, import_react62.useMemo)(() => {
|
|
13451
13526
|
const userId = import_auth3.jwtTokenManager.getUserId();
|
|
13452
13527
|
if (!userId) return { server: false, local: false, backup: false };
|
|
13453
13528
|
const server = import_auth3.jwtTokenManager.getHasKeyshare() ?? false;
|
|
@@ -13617,13 +13692,13 @@ var useLumiaPassportRecoveryUserId = () => useLumiaPassportSession((st) => st.re
|
|
|
13617
13692
|
var useLumiaPassportHasServerVault = () => useLumiaPassportSession((st) => st.hasServerVault);
|
|
13618
13693
|
|
|
13619
13694
|
// src/hooks/useLumiaPassportOpen.ts
|
|
13620
|
-
var
|
|
13695
|
+
var import_react63 = require("react");
|
|
13621
13696
|
function useLumiaPassportOpen() {
|
|
13622
13697
|
const page = useLayoutDataStore((st) => st.page);
|
|
13623
13698
|
const setPage = useLayoutDataStore((st) => st.setPage);
|
|
13624
13699
|
const setPageParams = useLayoutDataStore((st) => st.setPageParams);
|
|
13625
13700
|
const address = useLumiaPassportSession((st) => st.address);
|
|
13626
|
-
const open = (0,
|
|
13701
|
+
const open = (0, import_react63.useCallback)(
|
|
13627
13702
|
(passportPage, params) => {
|
|
13628
13703
|
if (!address) return setPage("auth" /* AUTH */);
|
|
13629
13704
|
if (!!address && passportPage === "auth" /* AUTH */) return setPage("manage-wallet" /* MANAGE_WALLET */);
|
|
@@ -13632,12 +13707,12 @@ function useLumiaPassportOpen() {
|
|
|
13632
13707
|
},
|
|
13633
13708
|
[setPage, setPageParams, address]
|
|
13634
13709
|
);
|
|
13635
|
-
const close = (0,
|
|
13710
|
+
const close = (0, import_react63.useCallback)(() => setPage(null), [setPage]);
|
|
13636
13711
|
return { open, close, isOpen: page !== null };
|
|
13637
13712
|
}
|
|
13638
13713
|
|
|
13639
13714
|
// src/hooks/useLumiaPassportColorMode.ts
|
|
13640
|
-
var
|
|
13715
|
+
var import_react64 = require("react");
|
|
13641
13716
|
function useLumiaPassportColorMode() {
|
|
13642
13717
|
const {
|
|
13643
13718
|
config: { current: config }
|
|
@@ -13645,14 +13720,14 @@ function useLumiaPassportColorMode() {
|
|
|
13645
13720
|
const preferedColorMode = config?.preferedColorMode;
|
|
13646
13721
|
const colorMode = useLayoutStore((st) => st.colorMode);
|
|
13647
13722
|
const handleStoreColorMode = useLayoutStore((st) => st.setColorMode);
|
|
13648
|
-
const setColorMode = (0,
|
|
13723
|
+
const setColorMode = (0, import_react64.useCallback)(
|
|
13649
13724
|
(mode) => {
|
|
13650
13725
|
localStorage.setItem(LOCAL_COLOR_MODE_KEY, mode);
|
|
13651
13726
|
handleStoreColorMode(mode);
|
|
13652
13727
|
},
|
|
13653
13728
|
[handleStoreColorMode]
|
|
13654
13729
|
);
|
|
13655
|
-
(0,
|
|
13730
|
+
(0, import_react64.useEffect)(() => {
|
|
13656
13731
|
let targetColorMode = localStorage.getItem(LOCAL_COLOR_MODE_KEY);
|
|
13657
13732
|
if (!targetColorMode && !preferedColorMode) {
|
|
13658
13733
|
const systemMode = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
@@ -13695,7 +13770,7 @@ function ThemeToggle(props) {
|
|
|
13695
13770
|
|
|
13696
13771
|
// src/context/RainbowKitContext.tsx
|
|
13697
13772
|
var import_rainbowkit3 = require("@rainbow-me/rainbowkit");
|
|
13698
|
-
var
|
|
13773
|
+
var import_react65 = require("react");
|
|
13699
13774
|
var import_wagmi9 = require("wagmi");
|
|
13700
13775
|
|
|
13701
13776
|
// src/config/rainbowkit.ts
|
|
@@ -13927,8 +14002,8 @@ var import_jsx_runtime76 = require("react/jsx-runtime");
|
|
|
13927
14002
|
function LumiaRainbowKitProvider({ children }) {
|
|
13928
14003
|
const config = useLumiaPassportConfig().config;
|
|
13929
14004
|
const colorMode = useLayoutStore((st) => st.colorMode);
|
|
13930
|
-
const rainbowConfig2 = (0,
|
|
13931
|
-
const customTheme = (0,
|
|
14005
|
+
const rainbowConfig2 = (0, import_react65.useMemo)(() => createRainbowConfig(config.current?.wallet?.walletConnectProjectId), [config]);
|
|
14006
|
+
const customTheme = (0, import_react65.useMemo)(
|
|
13932
14007
|
() => colorMode === "dark" ? {
|
|
13933
14008
|
...(0, import_rainbowkit3.darkTheme)(),
|
|
13934
14009
|
colors: { ...(0, import_rainbowkit3.darkTheme)().colors, ...rainbowTheme.darkMode.colors },
|
|
@@ -14380,14 +14455,14 @@ var Hash = ({
|
|
|
14380
14455
|
};
|
|
14381
14456
|
|
|
14382
14457
|
// src/internal/components/TransactionsMenu/TransactionsList.tsx
|
|
14383
|
-
var
|
|
14458
|
+
var import_react66 = require("react");
|
|
14384
14459
|
init_base();
|
|
14385
14460
|
var import_jsx_runtime81 = require("react/jsx-runtime");
|
|
14386
14461
|
var TransactionsList = ({ address, itemsCount = 10 }) => {
|
|
14387
|
-
const [transactions, setTransactions] = (0,
|
|
14388
|
-
const [loading, setLoading] = (0,
|
|
14389
|
-
const [error, setError] = (0,
|
|
14390
|
-
(0,
|
|
14462
|
+
const [transactions, setTransactions] = (0, import_react66.useState)([]);
|
|
14463
|
+
const [loading, setLoading] = (0, import_react66.useState)(true);
|
|
14464
|
+
const [error, setError] = (0, import_react66.useState)(null);
|
|
14465
|
+
(0, import_react66.useEffect)(() => {
|
|
14391
14466
|
const fetchTransactions = async () => {
|
|
14392
14467
|
try {
|
|
14393
14468
|
setLoading(true);
|
|
@@ -14689,11 +14764,11 @@ function useUserOpStatus(options = {}) {
|
|
|
14689
14764
|
|
|
14690
14765
|
// src/hooks/useLogout.ts
|
|
14691
14766
|
var import_auth20 = require("@lumiapassport/core/auth");
|
|
14692
|
-
var
|
|
14767
|
+
var import_react67 = require("react");
|
|
14693
14768
|
function useLogout() {
|
|
14694
14769
|
const { setSession, setIsLoading, setAddress, setStatus, setError, address } = useLumiaPassportSession();
|
|
14695
14770
|
const { callbacks } = useLumiaPassportConfig();
|
|
14696
|
-
const logout2 = (0,
|
|
14771
|
+
const logout2 = (0, import_react67.useCallback)(async () => {
|
|
14697
14772
|
const prevAddress = address;
|
|
14698
14773
|
let userId = null;
|
|
14699
14774
|
setIsLoading(true);
|