diff --git a/ts_src/index.ts b/ts_src/index.ts index d51b7d4..849d1b0 100644 --- a/ts_src/index.ts +++ b/ts_src/index.ts @@ -39,7 +39,10 @@ function salt(password?: string): string { return 'mnemonic' + (password || ''); } -export function mnemonicToSeedSync(mnemonic: string, password: string): Buffer { +export function mnemonicToSeedSync( + mnemonic: string, + password?: string, +): Buffer { const mnemonicBuffer = Buffer.from( (mnemonic || '').normalize('NFKD'), 'utf8', @@ -54,7 +57,7 @@ export function mnemonicToSeedSync(mnemonic: string, password: string): Buffer { export function mnemonicToSeed( mnemonic: string, - password: string, + password?: string, ): Promise { return new Promise( (resolve, reject): void => { diff --git a/types/index.d.ts b/types/index.d.ts index 69e0381..5c34d76 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -1,6 +1,6 @@ /// -export declare function mnemonicToSeedSync(mnemonic: string, password: string): Buffer; -export declare function mnemonicToSeed(mnemonic: string, password: string): Promise; +export declare function mnemonicToSeedSync(mnemonic: string, password?: string): Buffer; +export declare function mnemonicToSeed(mnemonic: string, password?: string): Promise; export declare function mnemonicToEntropy(mnemonic: string, wordlist?: string[]): string; export declare function entropyToMnemonic(entropy: Buffer | string, wordlist?: string[]): string; export declare function generateMnemonic(strength?: number, rng?: (size: number) => Buffer, wordlist?: string[]): string;