]> git.codecow.com Git - libnemo.git/commitdiff
Fix BIP-39 seed overload.
authorChris Duncan <chris@zoso.dev>
Sat, 30 Aug 2025 05:00:29 +0000 (22:00 -0700)
committerChris Duncan <chris@zoso.dev>
Sat, 30 Aug 2025 05:00:29 +0000 (22:00 -0700)
src/lib/crypto/bip39.ts

index 1fae699f3365a8b0262946e3b22bc6ffd13dc9d1..de98d469e5b4d0adb481c8a4b28b081372def4e4 100644 (file)
@@ -192,7 +192,7 @@ export class Bip39 {
        * @param {string} [passphrase=''] - Used as the PBKDF2 salt. Default: ""\r
        * @returns {Promise<string>}  Promise for seed as hexadecimal string\r
        */\r
-       toBip39Seed (passphrase: string, format?: 'hex'): Promise<string>\r
+       toBip39Seed (passphrase: string, format: 'hex'): Promise<string>\r
        toBip39Seed (passphrase: unknown, format?: 'hex'): Promise<string | Uint8Array<ArrayBuffer>> {\r
                if (this.phrase == null) {\r
                        throw new Error('BIP-39 mnemonic phrase not found')\r
@@ -213,7 +213,7 @@ export class Bip39 {
                                        return crypto.subtle.deriveBits(algorithm, phraseKey, 512)\r
                                                .then(seed => {\r
                                                        this.#bip39Seed = new Uint8Array(seed)\r
-                                                       return this.toBip39Seed(salt, format)\r
+                                                       return this.toBip39Seed(salt, format as 'hex')\r
                                                })\r
                                })\r
                }\r