From 66f88abe8a4333721bd8657575753bb3699fa573 Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Mon, 11 Aug 2025 08:26:41 -0700 Subject: [PATCH] Publicize ledger support getter again so it can be used in test flow control. --- src/lib/wallet/ledger.ts | 4 ++-- src/types.d.ts | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) 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. * -- 2.47.3