From: Chris Duncan Date: Wed, 5 Aug 2026 05:28:48 +0000 (-0700) Subject: Narrow allowed wallet types since Ledger never requests unlock. X-Git-Url: https://git.codecow.com/?a=commitdiff_plain;h=43bef8044252e9870bd3032b1229ab5645dd7a91;p=libnemo.git Narrow allowed wallet types since Ledger never requests unlock. --- diff --git a/src/lib/vault/vault-worker.ts b/src/lib/vault/vault-worker.ts index d7d78ee..fd69f78 100644 --- a/src/lib/vault/vault-worker.ts +++ b/src/lib/vault/vault-worker.ts @@ -267,13 +267,12 @@ function unlock (type?: WalletType, id?: UUID, key?: CryptoKey, iv?: ArrayBuffer if (type == null) { throw new TypeError('Wallet type is required') } + if (!['BIP-44', 'BLAKE2b', 'Exodus'].includes(type)) { + throw new TypeError('Invalid wallet type', { cause: type }) + } if (id == null) { throw new TypeError('Wallet ID is required') } - if (type === 'Ledger') { - _locked = false - return Promise.resolve({ isLocked: false }) - } if (key == null) { throw new TypeError('Wallet password is required') }