From b96acec930606422e1e3e4dc82a8270df8f9d9c7 Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Sat, 20 Sep 2025 15:09:53 -0700 Subject: [PATCH] Fix private property access. --- src/lib/account/index.ts | 4 ++-- src/lib/ledger.ts | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lib/account/index.ts b/src/lib/account/index.ts index 2bfb6fc..f6b70b3 100644 --- a/src/lib/account/index.ts +++ b/src/lib/account/index.ts @@ -113,10 +113,10 @@ export class Account { set weight (v: bigint | number | string) { this.#weight = BigInt(v) } private constructor (address: Address, publicKey: Uint8Array, index?: number) { - if (!this.constructor.prototype.#isInternal) { + if (!Account.#isInternal) { throw new Error('Account cannot be instantiated directly. Use `load()` instead.') } - this.constructor.prototype.#isInternal = false + Account.#isInternal = false this.#address = address this.#publicKey = publicKey this.#index = index diff --git a/src/lib/ledger.ts b/src/lib/ledger.ts index 7c49045..8c83c5f 100644 --- a/src/lib/ledger.ts +++ b/src/lib/ledger.ts @@ -219,10 +219,10 @@ export class Ledger { */ static disconnect (): void { setTimeout(async () => { - const hidDevices = (await navigator?.hid?.getDevices?.()) + const hidDevices = (await navigator?.hid?.getDevices?.() ?? []) .filter(device => device.vendorId === this.ledgerVendorId) .map(device => device.close()) - const usbDevices = (await navigator?.usb?.getDevices?.()) + const usbDevices = (await navigator?.usb?.getDevices?.() ?? []) .filter(device => device.vendorId === this.ledgerVendorId) .map(device => device.close()) this.#status = 'DISCONNECTED' @@ -471,9 +471,9 @@ export class Ledger { */ static async #poll (): Promise { try { - const isHidPaired = (await navigator.hid?.getDevices()) + const isHidPaired = (await navigator.hid?.getDevices?.() ?? []) .some(device => device.vendorId === this.ledgerVendorId) - const isUsbPaired = (await navigator.usb?.getDevices()) + const isUsbPaired = (await navigator.usb?.getDevices?.() ?? []) .some(device => device.vendorId === this.ledgerVendorId) if (this.#transport === TransportHID && isHidPaired) { await this.connect() -- 2.47.3