From: Chris Duncan Date: Thu, 3 Oct 2024 09:18:38 +0000 (-0700) Subject: Fix optional parameter typing in overloaded functions. Fix dependency in package... X-Git-Tag: v0.0.1~2 X-Git-Url: https://zoso.dev/?a=commitdiff_plain;h=a0fca7e63b3d444ff2af37680169e84d1989d3f6;p=libnemo.git Fix optional parameter typing in overloaded functions. Fix dependency in package lockfile. --- diff --git a/package-lock.json b/package-lock.json index 0b8d14f..63c2227 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,6 @@ "version": "0.0.1", "license": "(GPL-3.0-or-later AND MIT)", "dependencies": { - "@ledgerhq/hw-transport-webusb": "6.29.4", "blakejs": "^1.2.1" }, "devDependencies": { diff --git a/src/lib/wallet.ts b/src/lib/wallet.ts index f998a5a..7a7ae26 100644 --- a/src/lib/wallet.ts +++ b/src/lib/wallet.ts @@ -253,7 +253,7 @@ export class Bip44Wallet extends Wallet { * @param {string} [salt=''] - Used when generating the final seed * @returns {Bip44Wallet} A newly instantiated Bip44Wallet */ - static async create (password: string, salt: string): Promise + static async create (password: string, salt?: string): Promise /** * Creates a new HD wallet by using an entropy value generated using a * cryptographically strong pseudorandom number generator. @@ -262,7 +262,7 @@ export class Bip44Wallet extends Wallet { * @param {string} [salt=''] - Used when generating the final seed * @returns {Bip44Wallet} A newly instantiated Bip44Wallet */ - static async create (key: CryptoKey, salt: string): Promise + static async create (key: CryptoKey, salt?: string): Promise static async create (passkey: string | CryptoKey, salt: string = ''): Promise { Bip44Wallet.#isInternal = true try { @@ -282,7 +282,7 @@ export class Bip44Wallet extends Wallet { * @param {string} [salt=''] - Used when generating the final seed * @returns {Bip44Wallet} A newly instantiated Bip44Wallet */ - static async fromEntropy (password: string, entropy: string, salt: string): Promise + static async fromEntropy (password: string, entropy: string, salt?: string): Promise /** * Creates a new HD wallet by using a pregenerated entropy value. The user * must ensure that it is cryptographically strongly random. @@ -292,7 +292,7 @@ export class Bip44Wallet extends Wallet { * @param {string} [salt=''] - Used when generating the final seed * @returns {Bip44Wallet} A newly instantiated Bip44Wallet */ - static async fromEntropy (key: CryptoKey, entropy: string, salt: string): Promise + static async fromEntropy (key: CryptoKey, entropy: string, salt?: string): Promise static async fromEntropy (passkey: string | CryptoKey, entropy: string, salt: string = ''): Promise { Bip44Wallet.#isInternal = true try { @@ -315,7 +315,7 @@ export class Bip44Wallet extends Wallet { * @param {string} [salt=''] - Used when generating the final seed * @returns {Bip44Wallet} A newly instantiated Bip44Wallet */ - static async fromMnemonic (password: string, mnemonic: string, salt: string): Promise + static async fromMnemonic (password: string, mnemonic: string, salt?: string): Promise /** * Creates a new HD wallet by using a pregenerated mnemonic phrase. * @@ -324,7 +324,7 @@ export class Bip44Wallet extends Wallet { * @param {string} [salt=''] - Used when generating the final seed * @returns {Bip44Wallet} A newly instantiated Bip44Wallet */ - static async fromMnemonic (key: CryptoKey, mnemonic: string, salt: string): Promise + static async fromMnemonic (key: CryptoKey, mnemonic: string, salt?: string): Promise static async fromMnemonic (passkey: string | CryptoKey, mnemonic: string, salt: string = ''): Promise { Bip44Wallet.#isInternal = true try {