Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion packages/hdwallet-keepkey-nodewebusb/src/adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,14 @@
return devices.filter((x) => x.vendorId === VENDOR_ID && [WEBUSB_PRODUCT_ID, HID_PRODUCT_ID].includes(x.productId));
},
async getDevice(serialNumber?: string): Promise<Device> {
// Only match the WebUSB PID (0x0002). The TransportDelegate ctor rejects any
// other PID with FirmwareUpdateRequired, so matching legacy 0x0001 here just
// produced a doomed pair attempt + a misleading "Firmware 6.1.0 required"
// before the caller's HID fallback. Old (PID 0x0001) devices now skip WebUSB
// cleanly and pair over HID. (getDevices() still lists 0x0001 for detection.)
const out = await webusb.requestDevice({
filters: [

Check failure on line 19 in packages/hdwallet-keepkey-nodewebusb/src/adapter.ts

View workflow job for this annotation

GitHub Actions / build (18)

Replace `⏎········{·vendorId:·VENDOR_ID,·productId:·WEBUSB_PRODUCT_ID,·serialNumber·},⏎······` with `{·vendorId:·VENDOR_ID,·productId:·WEBUSB_PRODUCT_ID,·serialNumber·}`
{ vendorId: VENDOR_ID, productId: WEBUSB_PRODUCT_ID, serialNumber },
{ vendorId: VENDOR_ID, productId: HID_PRODUCT_ID, serialNumber },
],
});
if (out.serialNumber === undefined) throw new Error("expected serial number");
Expand Down
Loading