Skip to content

Commit

Permalink
Fix mnemonicToSeed password arg to optional
Browse files Browse the repository at this point in the history
  • Loading branch information
junderw committed Apr 11, 2019
1 parent d5fb1ed commit c8dcd01
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions ts_src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -54,7 +57,7 @@ export function mnemonicToSeedSync(mnemonic: string, password: string): Buffer {

export function mnemonicToSeed(
mnemonic: string,
password: string,
password?: string,
): Promise<Buffer> {
return new Promise(
(resolve, reject): void => {
Expand Down
4 changes: 2 additions & 2 deletions types/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// <reference types="node" />
export declare function mnemonicToSeedSync(mnemonic: string, password: string): Buffer;
export declare function mnemonicToSeed(mnemonic: string, password: string): Promise<Buffer>;
export declare function mnemonicToSeedSync(mnemonic: string, password?: string): Buffer;
export declare function mnemonicToSeed(mnemonic: string, password?: string): Promise<Buffer>;
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;
Expand Down

0 comments on commit c8dcd01

Please sign in to comment.