mirror of
https://github.com/kccleoc/seedpgp-web.git
synced 2026-03-07 09:57:50 +08:00
chore: Stage all remaining changes before merge
This commit is contained in:
@@ -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('');
|
||||
|
||||
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user