]> git.codecow.com Git - libnemo.git/commitdiff
Narrow allowed wallet types since Ledger never requests unlock.
authorChris Duncan <chris@codecow.com>
Wed, 5 Aug 2026 05:28:48 +0000 (22:28 -0700)
committerChris Duncan <chris@codecow.com>
Wed, 5 Aug 2026 05:28:48 +0000 (22:28 -0700)
src/lib/vault/vault-worker.ts

index d7d78ee09638becd49ae85744fb649215c41086a..fd69f785f7c06b01ebd4acc8b4a634504d65d8f2 100644 (file)
@@ -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')
        }