@onekeyfe/hd-transport-lowlevel 1.2.11-alpha.4 → 1.2.11-alpha.6
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 +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -4
- package/package.json +4 -4
- package/src/index.ts +6 -6
package/dist/index.d.ts
CHANGED
|
@@ -19,8 +19,8 @@ declare function getProtocolV1SendOptions(name: string): {
|
|
|
19
19
|
} | undefined;
|
|
20
20
|
declare function resolveLowlevelProtocolV2PacketCapacity(capacity?: number | null): number;
|
|
21
21
|
declare class LowlevelTransport {
|
|
22
|
-
_messages: ReturnType<typeof transport__default.
|
|
23
|
-
_messagesV2: ReturnType<typeof transport__default.
|
|
22
|
+
_messages: ReturnType<typeof transport__default.parseTransportConfigure> | undefined;
|
|
23
|
+
_messagesV2: ReturnType<typeof transport__default.parseTransportConfigure> | undefined;
|
|
24
24
|
configured: boolean;
|
|
25
25
|
Log?: any;
|
|
26
26
|
emitter?: EventEmitter;
|
|
@@ -63,7 +63,7 @@ declare class LowlevelTransport {
|
|
|
63
63
|
private callProtocolV2;
|
|
64
64
|
private createProtocolV2Adapter;
|
|
65
65
|
private advanceProtocolV2Generation;
|
|
66
|
-
cancel(
|
|
66
|
+
cancel(): void;
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
export { LowlevelTransport as default, getProtocolV1SendOptions, resolveLowlevelProtocolV2PacketCapacity, shouldLogFirmwareUploadProgress };
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,SAYN,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,YAAY,MAAM,QAAQ,CAAC;AACvC,OAAO,KAAK,EACV,6BAA6B,EAC7B,YAAY,EAEZ,oBAAoB,EACrB,MAAM,wBAAwB,CAAC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AAkB;YAMZ,cAAc;YA2Cd,yBAAyB;YAkCzB,eAAe;YAgBf,eAAe;YA6Bf,UAAU;YAUV,qBAAqB;YAmBrB,mBAAmB;YAqBnB,oBAAoB;YAkBpB,+BAA+B;YAgB/B,cAAc;IAwB5B,OAAO,CAAC,uBAAuB;IAgC/B,OAAO,CAAC,2BAA2B;IAMnC,MAAM;CAGP"}
|
package/dist/index.js
CHANGED
|
@@ -39,7 +39,7 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
|
|
|
39
39
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
40
40
|
};
|
|
41
41
|
|
|
42
|
-
const { check, ProtocolV1,
|
|
42
|
+
const { check, ProtocolV1, parseTransportConfigure } = transport__default["default"];
|
|
43
43
|
const PROTOCOL_PROBE_TIMEOUT_MS = 1000;
|
|
44
44
|
const PROTOCOL_V2_PROBE_TIMEOUT_MS = 5000;
|
|
45
45
|
const LOWLEVEL_PROTOCOL_V2_PACKET_LENGTH_FALLBACK = 192;
|
|
@@ -118,7 +118,7 @@ class LowlevelTransport {
|
|
|
118
118
|
this.plugin.init();
|
|
119
119
|
}
|
|
120
120
|
configure(signedData) {
|
|
121
|
-
const messages =
|
|
121
|
+
const messages = parseTransportConfigure(signedData);
|
|
122
122
|
this.configured = true;
|
|
123
123
|
this._messages = messages;
|
|
124
124
|
}
|
|
@@ -128,7 +128,7 @@ class LowlevelTransport {
|
|
|
128
128
|
return;
|
|
129
129
|
}
|
|
130
130
|
const isReconfiguration = this.protocolV2SchemaConfiguration !== undefined;
|
|
131
|
-
this._messagesV2 =
|
|
131
|
+
this._messagesV2 = parseTransportConfigure(signedData);
|
|
132
132
|
this.protocolV2SchemaConfiguration = configuration;
|
|
133
133
|
if (isReconfiguration) {
|
|
134
134
|
this.protocolV2Links
|
|
@@ -549,7 +549,7 @@ class LowlevelTransport {
|
|
|
549
549
|
this.protocolV2Generations.set(uuid, nextGeneration);
|
|
550
550
|
return nextGeneration;
|
|
551
551
|
}
|
|
552
|
-
cancel(
|
|
552
|
+
cancel() {
|
|
553
553
|
this.Log.debug('lowlevel-transport', 'cancel');
|
|
554
554
|
}
|
|
555
555
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onekeyfe/hd-transport-lowlevel",
|
|
3
|
-
"version": "1.2.11-alpha.
|
|
3
|
+
"version": "1.2.11-alpha.6",
|
|
4
4
|
"homepage": "https://github.com/OneKeyHQ/hardware-js-sdk#readme",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
"lint:fix": "eslint . --fix"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@onekeyfe/hd-shared": "1.2.11-alpha.
|
|
24
|
-
"@onekeyfe/hd-transport": "1.2.11-alpha.
|
|
23
|
+
"@onekeyfe/hd-shared": "1.2.11-alpha.6",
|
|
24
|
+
"@onekeyfe/hd-transport": "1.2.11-alpha.6"
|
|
25
25
|
},
|
|
26
|
-
"gitHead": "
|
|
26
|
+
"gitHead": "fe0e726cdb7de7d9889e26af1db227d9bed32369"
|
|
27
27
|
}
|
package/src/index.ts
CHANGED
|
@@ -22,7 +22,7 @@ import type {
|
|
|
22
22
|
} from '@onekeyfe/hd-transport';
|
|
23
23
|
import type { LowLevelAcquireInput } from './types';
|
|
24
24
|
|
|
25
|
-
const { check, ProtocolV1,
|
|
25
|
+
const { check, ProtocolV1, parseTransportConfigure } = transport;
|
|
26
26
|
|
|
27
27
|
const PROTOCOL_PROBE_TIMEOUT_MS = 1000;
|
|
28
28
|
const PROTOCOL_V2_PROBE_TIMEOUT_MS = 5000;
|
|
@@ -69,9 +69,9 @@ function readProtocolV1PayloadLength(data: Uint8Array) {
|
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
export default class LowlevelTransport {
|
|
72
|
-
_messages: ReturnType<typeof transport.
|
|
72
|
+
_messages: ReturnType<typeof transport.parseTransportConfigure> | undefined;
|
|
73
73
|
|
|
74
|
-
_messagesV2: ReturnType<typeof transport.
|
|
74
|
+
_messagesV2: ReturnType<typeof transport.parseTransportConfigure> | undefined;
|
|
75
75
|
|
|
76
76
|
configured = false;
|
|
77
77
|
|
|
@@ -139,7 +139,7 @@ export default class LowlevelTransport {
|
|
|
139
139
|
}
|
|
140
140
|
|
|
141
141
|
configure(signedData: any) {
|
|
142
|
-
const messages =
|
|
142
|
+
const messages = parseTransportConfigure(signedData);
|
|
143
143
|
this.configured = true;
|
|
144
144
|
this._messages = messages;
|
|
145
145
|
}
|
|
@@ -151,7 +151,7 @@ export default class LowlevelTransport {
|
|
|
151
151
|
}
|
|
152
152
|
|
|
153
153
|
const isReconfiguration = this.protocolV2SchemaConfiguration !== undefined;
|
|
154
|
-
this._messagesV2 =
|
|
154
|
+
this._messagesV2 = parseTransportConfigure(signedData);
|
|
155
155
|
this.protocolV2SchemaConfiguration = configuration;
|
|
156
156
|
|
|
157
157
|
if (isReconfiguration) {
|
|
@@ -644,7 +644,7 @@ export default class LowlevelTransport {
|
|
|
644
644
|
return nextGeneration;
|
|
645
645
|
}
|
|
646
646
|
|
|
647
|
-
cancel(
|
|
647
|
+
cancel() {
|
|
648
648
|
this.Log.debug('lowlevel-transport', 'cancel');
|
|
649
649
|
}
|
|
650
650
|
}
|