From: Chris Duncan Date: Mon, 11 Aug 2025 15:26:41 +0000 (-0700) Subject: Publicize ledger support getter again so it can be used in test flow control. X-Git-Tag: v0.10.5~41^2~117 X-Git-Url: https://git.codecow.com/?a=commitdiff_plain;h=66f88abe8a4333721bd8657575753bb3699fa573;p=libnemo.git Publicize ledger support getter again so it can be used in test flow control. --- diff --git a/src/lib/wallet/ledger.ts b/src/lib/wallet/ledger.ts index b337bb9..4378c24 100644 --- a/src/lib/wallet/ledger.ts +++ b/src/lib/wallet/ledger.ts @@ -62,7 +62,7 @@ export class Ledger extends Wallet { * Check which transport protocols are supported by the browser and return the * transport type according to the following priorities: USB, Bluetooth, HID. */ - static get #isUnsupported (): boolean { + static get isUnsupported (): boolean { console.log('Checking browser Ledger support...') if (typeof globalThis.navigator?.usb?.getDevices === 'function') { this.DynamicTransport = TransportUSB @@ -87,7 +87,7 @@ export class Ledger extends Wallet { */ static async create (): Promise { try { - if (this.#isUnsupported) throw new Error('Browser is unsupported') + if (this.isUnsupported) throw new Error('Browser is unsupported') this.#isInternal = true const self = new this() await Database.add({ [self.id]: { id: self.id, type: 'Ledger' } }, Wallet.DB_NAME) diff --git a/src/types.d.ts b/src/types.d.ts index 1a96520..6ac21e5 100644 --- a/src/types.d.ts +++ b/src/types.d.ts @@ -740,6 +740,11 @@ export declare class Ledger extends Wallet { static DynamicTransport: typeof TransportBLE | typeof TransportUSB | typeof TransportHID static SYMBOL: Symbol /** + * Check which transport protocols are supported by the browser and return the + * transport type according to the following priorities: USB, Bluetooth, HID. + */ + static get isUnsupported (): boolean + /** * Creates a new Ledger hardware wallet communication layer by dynamically * importing the ledger.js service. *