mirror of https://github.com/status-im/bip39.git
Fix mnemonicToSeed password arg to optional
This commit is contained in:
parent
d5fb1edc68
commit
c8dcd010fc
|
@ -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<Buffer> {
|
||||
return new Promise(
|
||||
(resolve, reject): void => {
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue