diff --git a/src/backend/accounts/crypto.ts b/src/backend/accounts/crypto.ts index 9fe51380..9e099bf2 100644 --- a/src/backend/accounts/crypto.ts +++ b/src/backend/accounts/crypto.ts @@ -21,9 +21,7 @@ export function verifyValidMnemonic(mnemonic: string) { return validateMnemonic(mnemonic, wordlist); } -export async function keysFromMnemonic(mnemonic: string): Promise { - const seed = await seedFromMnemonic(mnemonic); - +export async function keysFromSeed(seed: Uint8Array): Promise { const { privateKey, publicKey } = forge.pki.ed25519.generateKeyPair({ seed, }); @@ -35,6 +33,12 @@ export async function keysFromMnemonic(mnemonic: string): Promise { }; } +export async function keysFromMnemonic(mnemonic: string): Promise { + const seed = await seedFromMnemonic(mnemonic); + + return keysFromSeed(seed); +} + export function genMnemonic(): string { return generateMnemonic(wordlist); }