chore: Stage all remaining changes before merge

This commit is contained in:
LC mac
2026-02-07 13:47:52 +08:00
parent cf3412b235
commit 008406ef59
7 changed files with 22 additions and 421 deletions

View File

@@ -161,7 +161,6 @@ export function SeedBlender({ onDirtyStateChange, setMnemonicForBackup, requestT
const handleScanSuccess = useCallback(async (scannedData: string | Uint8Array) => {
if (scanTargetIndex === null) return;
// Convert binary data to hex string if necessary
const scannedText = typeof scannedData === 'string'
? scannedData
: Array.from(scannedData).map(b => b.toString(16).padStart(2, '0')).join('');

View File

@@ -2,6 +2,7 @@ import * as openpgp from "openpgp";
import { base45Encode, base45Decode } from "./base45";
import { crc16CcittFalse } from "./crc16";
import { encryptToKrux, decryptFromKrux } from "./krux";
import { decodeSeedQR } from './seedqr';
import type {
SeedPgpPlaintext,
ParsedSeedPgpFrame,
@@ -302,6 +303,25 @@ export async function decryptFromSeed(params: DecryptionParams): Promise<SeedPgp
throw error;
}
}
if (mode === 'seedqr') {
try {
const mnemonic = await decodeSeedQR(params.frameText);
// Convert to SeedPgpPlaintext format for consistency
return {
v: 1,
t: "bip39",
w: mnemonic,
l: "en",
pp: 0,
};
} catch (error) {
if (error instanceof Error) {
throw new Error(`SeedQR decoding failed: ${error.message}`);
}
throw error;
}
}
// Default to PGP mode
return decryptSeedPgp({