@onekeyfe/hd-transport-usb 1.1.25-alpha.0 → 1.1.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -23
- package/package.json +4 -4
- package/src/index.ts +5 -26
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAkB,6BAA6B,EAAE,MAAM,wBAAwB,CAAC;AAoG5F,eAAO,MAAM,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAkB,6BAA6B,EAAE,MAAM,wBAAwB,CAAC;AAoG5F,eAAO,MAAM,SAAS,EAAE,6BA+JvB,CAAC;AAEF,eAAe,SAAS,CAAC;AACzB,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -122,29 +122,11 @@ const UsbPlugin = {
|
|
|
122
122
|
const { idVendor, idProduct } = d.deviceDescriptor;
|
|
123
123
|
return hdShared.ONEKEY_WEBUSB_FILTER.some(f => idVendor === f.vendorId && idProduct === f.productId);
|
|
124
124
|
});
|
|
125
|
-
return onekeyDevices.map(d => {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
if (iface && iface.descriptor.bInterfaceClass === 255) {
|
|
131
|
-
name = 'OneKey';
|
|
132
|
-
}
|
|
133
|
-
d.close();
|
|
134
|
-
}
|
|
135
|
-
catch (_a) {
|
|
136
|
-
try {
|
|
137
|
-
d.close();
|
|
138
|
-
}
|
|
139
|
-
catch (_b) {
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
return {
|
|
143
|
-
id: getDeviceId(d),
|
|
144
|
-
name,
|
|
145
|
-
commType: 'usb',
|
|
146
|
-
};
|
|
147
|
-
});
|
|
125
|
+
return onekeyDevices.map(d => ({
|
|
126
|
+
id: getDeviceId(d),
|
|
127
|
+
name: 'OneKey',
|
|
128
|
+
commType: 'usb',
|
|
129
|
+
}));
|
|
148
130
|
});
|
|
149
131
|
},
|
|
150
132
|
connect(uuid) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onekeyfe/hd-transport-usb",
|
|
3
|
-
"version": "1.1.25
|
|
3
|
+
"version": "1.1.25",
|
|
4
4
|
"description": "OneKey hardware wallet direct USB transport plugin (libusb)",
|
|
5
5
|
"homepage": "https://github.com/OneKeyHQ/hardware-js-sdk#readme",
|
|
6
6
|
"license": "MIT",
|
|
@@ -20,10 +20,10 @@
|
|
|
20
20
|
"lint:fix": "eslint . --fix"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@onekeyfe/hd-shared": "1.1.25
|
|
24
|
-
"@onekeyfe/hd-transport": "1.1.25
|
|
23
|
+
"@onekeyfe/hd-shared": "1.1.25",
|
|
24
|
+
"@onekeyfe/hd-transport": "1.1.25",
|
|
25
25
|
"bytebuffer": "^5.0.1",
|
|
26
26
|
"usb": "^2.14.0"
|
|
27
27
|
},
|
|
28
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "6110417c47363db38190076610ea4de0e8508924"
|
|
29
29
|
}
|
package/src/index.ts
CHANGED
|
@@ -121,32 +121,11 @@ export const UsbPlugin: LowlevelTransportSharedPlugin = {
|
|
|
121
121
|
return ONEKEY_WEBUSB_FILTER.some(f => idVendor === f.vendorId && idProduct === f.productId);
|
|
122
122
|
});
|
|
123
123
|
|
|
124
|
-
return onekeyDevices.map(d => {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
const iface = d.interface(INTERFACE_NUMBER);
|
|
130
|
-
// Check interface class is 255 (vendor-specific) — the communication interface
|
|
131
|
-
if (iface && iface.descriptor.bInterfaceClass === 255) {
|
|
132
|
-
name = 'OneKey';
|
|
133
|
-
}
|
|
134
|
-
d.close();
|
|
135
|
-
} catch {
|
|
136
|
-
// Can't open — might be in use, just return basic info
|
|
137
|
-
try {
|
|
138
|
-
d.close();
|
|
139
|
-
} catch {
|
|
140
|
-
/* ignore */
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
return {
|
|
145
|
-
id: getDeviceId(d),
|
|
146
|
-
name,
|
|
147
|
-
commType: 'usb' as const,
|
|
148
|
-
};
|
|
149
|
-
});
|
|
124
|
+
return onekeyDevices.map(d => ({
|
|
125
|
+
id: getDeviceId(d),
|
|
126
|
+
name: 'OneKey',
|
|
127
|
+
commType: 'usb' as const,
|
|
128
|
+
}));
|
|
150
129
|
},
|
|
151
130
|
|
|
152
131
|
// eslint-disable-next-line @typescript-eslint/require-await
|