@onekeyfe/hd-transport-usb 1.2.0-alpha.34 → 1.2.0-alpha.35
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.js +2 -10
- package/dist/transportLog.d.ts +1 -6
- package/dist/transportLog.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/index.ts +1 -1
- package/src/transportLog.ts +1 -11
package/dist/index.js
CHANGED
|
@@ -59,14 +59,6 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
|
|
|
59
59
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
60
60
|
};
|
|
61
61
|
|
|
62
|
-
const HIGH_VOLUME_CALLS = new Set(['FileWrite', 'FilesystemFileWrite', 'EmmcFileWrite']);
|
|
63
|
-
function shouldSuppressHighVolumeCallLog(name) {
|
|
64
|
-
return HIGH_VOLUME_CALLS.has(name);
|
|
65
|
-
}
|
|
66
|
-
function createTransportCallLog(name, protocol) {
|
|
67
|
-
return { name, protocol };
|
|
68
|
-
}
|
|
69
|
-
|
|
70
62
|
const { parseConfigure, ProtocolV1, check } = transport__default["default"];
|
|
71
63
|
const PACKET_SIZE = transport.PROTOCOL_V1_USB_PACKET_SIZE;
|
|
72
64
|
const REPORT_ID = transport.PROTOCOL_V1_REPORT_ID;
|
|
@@ -407,8 +399,8 @@ class NodeUsbTransport extends transport.ProtocolV2UsbTransportBase {
|
|
|
407
399
|
if (!protocol) {
|
|
408
400
|
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.RuntimeError, `Device protocol has not been detected for ${path}`);
|
|
409
401
|
}
|
|
410
|
-
if (!shouldSuppressHighVolumeCallLog(name)) {
|
|
411
|
-
(_a = this.Log) === null || _a === void 0 ? void 0 : _a.debug('transport call', createTransportCallLog(name, protocol));
|
|
402
|
+
if (!transport.shouldSuppressHighVolumeCallLog(name)) {
|
|
403
|
+
(_a = this.Log) === null || _a === void 0 ? void 0 : _a.debug('transport call', transport.createTransportCallLog(name, protocol, data));
|
|
412
404
|
}
|
|
413
405
|
if (protocol === 'V2') {
|
|
414
406
|
return this.callProtocolV2(path, name, data, options);
|
package/dist/transportLog.d.ts
CHANGED
|
@@ -1,7 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function shouldSuppressHighVolumeCallLog(name: string): boolean;
|
|
3
|
-
export declare function createTransportCallLog(name: string, protocol: ProtocolType): {
|
|
4
|
-
name: string;
|
|
5
|
-
protocol: ProtocolType;
|
|
6
|
-
};
|
|
1
|
+
export { createTransportCallLog, shouldSuppressHighVolumeCallLog } from '@onekeyfe/hd-transport';
|
|
7
2
|
//# sourceMappingURL=transportLog.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transportLog.d.ts","sourceRoot":"","sources":["../src/transportLog.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"transportLog.d.ts","sourceRoot":"","sources":["../src/transportLog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,+BAA+B,EAAE,MAAM,wBAAwB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onekeyfe/hd-transport-usb",
|
|
3
|
-
"version": "1.2.0-alpha.
|
|
3
|
+
"version": "1.2.0-alpha.35",
|
|
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",
|
|
@@ -21,10 +21,10 @@
|
|
|
21
21
|
"lint:fix": "eslint . --fix"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@onekeyfe/hd-shared": "1.2.0-alpha.
|
|
25
|
-
"@onekeyfe/hd-transport": "1.2.0-alpha.
|
|
24
|
+
"@onekeyfe/hd-shared": "1.2.0-alpha.35",
|
|
25
|
+
"@onekeyfe/hd-transport": "1.2.0-alpha.35",
|
|
26
26
|
"bytebuffer": "^5.0.1",
|
|
27
27
|
"usb": "^2.14.0"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "638bd33030686c4a3321e4feb4924c3f9f5c81a8"
|
|
30
30
|
}
|
package/src/index.ts
CHANGED
|
@@ -503,7 +503,7 @@ export default class NodeUsbTransport extends ProtocolV2UsbTransportBase<string>
|
|
|
503
503
|
);
|
|
504
504
|
}
|
|
505
505
|
if (!shouldSuppressHighVolumeCallLog(name)) {
|
|
506
|
-
this.Log?.debug('transport call', createTransportCallLog(name, protocol));
|
|
506
|
+
this.Log?.debug('transport call', createTransportCallLog(name, protocol, data));
|
|
507
507
|
}
|
|
508
508
|
|
|
509
509
|
if (protocol === 'V2') {
|
package/src/transportLog.ts
CHANGED
|
@@ -1,11 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const HIGH_VOLUME_CALLS = new Set(['FileWrite', 'FilesystemFileWrite', 'EmmcFileWrite']);
|
|
4
|
-
|
|
5
|
-
export function shouldSuppressHighVolumeCallLog(name: string) {
|
|
6
|
-
return HIGH_VOLUME_CALLS.has(name);
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export function createTransportCallLog(name: string, protocol: ProtocolType) {
|
|
10
|
-
return { name, protocol };
|
|
11
|
-
}
|
|
1
|
+
export { createTransportCallLog, shouldSuppressHighVolumeCallLog } from '@onekeyfe/hd-transport';
|