diff --git a/frontend/src/lib/backendType.ts b/frontend/src/lib/backendType.ts index ee1c9f77e..c429a022a 100644 --- a/frontend/src/lib/backendType.ts +++ b/frontend/src/lib/backendType.ts @@ -33,7 +33,7 @@ export const backendTypeConfigs: Record = { hasNodeBackup: false, }, CASHU: { - hasMnemonic: false, + hasMnemonic: true, hasChannelManagement: false, hasNodeBackup: false, }, diff --git a/frontend/src/screens/BackupMnemonic.tsx b/frontend/src/screens/BackupMnemonic.tsx index f086ed6ed..939a784e1 100644 --- a/frontend/src/screens/BackupMnemonic.tsx +++ b/frontend/src/screens/BackupMnemonic.tsx @@ -3,14 +3,17 @@ import { LifeBuoy, ShieldAlert, ShieldCheck, + TriangleAlertIcon, } from "lucide-react"; import React, { useState } from "react"; import { useNavigate } from "react-router-dom"; import Container from "src/components/Container"; import ExternalLink from "src/components/ExternalLink"; +import Loading from "src/components/Loading"; import MnemonicInputs from "src/components/MnemonicInputs"; import SettingsHeader from "src/components/SettingsHeader"; +import { Alert, AlertDescription, AlertTitle } from "src/components/ui/alert"; import { Button } from "src/components/ui/button"; import { Checkbox } from "src/components/ui/checkbox"; import { Input } from "src/components/ui/input"; @@ -95,6 +98,7 @@ export function BackupMnemonic() { title="Backup Your Keys" description="Make sure to your backup somewhere safe" /> + {info?.backendType === "CASHU" && } {!decryptedMnemonic ? (

Please confirm it's you

@@ -217,3 +221,53 @@ export function BackupMnemonic() { ); } + +// TODO: remove after 2026-01-01 +function CashuMnemonicWarning() { + const [mnemonicMatches, setMnemonicMatches] = React.useState(); + + React.useEffect(() => { + (async () => { + try { + const result: { matches: boolean } | undefined = await request( + "/api/command", + { + method: "POST", + body: JSON.stringify({ command: "checkmnemonic" }), + headers: { + "Content-Type": "application/json", + }, + } + ); + setMnemonicMatches(result?.matches); + } catch (error) { + console.error(error); + } + })(); + }, []); + + if (mnemonicMatches === undefined) { + return ; + } + + if (mnemonicMatches) { + return null; + } + + return ( + + + + Your Cashu wallet uses a different recovery phrase + + +

+ Please send your funds to a different wallet, then go to settings{" "} + {"->"} debug tools {"->"} execute node command {"->"}{" "} + reset. You will then receive a + fresh cashu wallet with the correct recovery phrase. +

+
+
+ ); +} diff --git a/frontend/src/screens/settings/DebugTools.tsx b/frontend/src/screens/settings/DebugTools.tsx index 061f72408..48a02f474 100644 --- a/frontend/src/screens/settings/DebugTools.tsx +++ b/frontend/src/screens/settings/DebugTools.tsx @@ -306,7 +306,7 @@ export default function DebugTools() { Get Network Graph - {info?.backendType === "LDK" && ( + {(info?.backendType === "LDK" || info?.backendType === "CASHU") && (