@onekeyfe/hd-transport-lowlevel 1.2.0-alpha.3 → 1.2.0-alpha.5

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.
@@ -29,21 +29,25 @@ const protocolV1Schema = {
29
29
 
30
30
  const protocolV2Schema = {
31
31
  nested: {
32
- GetProtoVersion: {
32
+ ProtocolInfoRequest: {
33
33
  fields: {},
34
34
  },
35
- ProtoVersion: {
35
+ ProtocolInfo: {
36
36
  fields: {
37
- major_version: {
37
+ version: {
38
38
  type: 'uint32',
39
39
  id: 1,
40
40
  },
41
- minor_version: {
41
+ supported_messages: {
42
+ rule: 'repeated',
42
43
  type: 'uint32',
43
44
  id: 2,
45
+ options: {
46
+ packed: false,
47
+ },
44
48
  },
45
- patch_version: {
46
- type: 'uint32',
49
+ protobuf_definition: {
50
+ type: 'string',
47
51
  id: 3,
48
52
  },
49
53
  },
@@ -66,8 +70,8 @@ const protocolV2Schema = {
66
70
  },
67
71
  MessageType: {
68
72
  values: {
69
- MessageType_GetProtoVersion: 60200,
70
- MessageType_ProtoVersion: 60201,
73
+ MessageType_ProtocolInfoRequest: 60200,
74
+ MessageType_ProtocolInfo: 60201,
71
75
  MessageType_Ping: 60206,
72
76
  MessageType_Success: 60207,
73
77
  },
@@ -162,11 +166,11 @@ describe('LowlevelTransport protocol framing', () => {
162
166
  );
163
167
  const callResponse = ProtocolV2.encodeFrame(
164
168
  schemas,
165
- 'ProtoVersion',
169
+ 'ProtocolInfo',
166
170
  {
167
- major_version: 2,
168
- minor_version: 1,
169
- patch_version: 3,
171
+ version: 1,
172
+ supported_messages: [60200, 60201, 60206, 60207],
173
+ protobuf_definition: 'onekey-protocol-v2',
170
174
  },
171
175
  { router: PROTOCOL_V2_CHANNEL_BLE_UART }
172
176
  );
@@ -183,12 +187,12 @@ describe('LowlevelTransport protocol framing', () => {
183
187
  uuid: 'pro2-id',
184
188
  protocolType: 'V2',
185
189
  });
186
- await expect(lowlevel.call('pro2-id', 'GetProtoVersion', {})).resolves.toEqual({
187
- type: 'ProtoVersion',
190
+ await expect(lowlevel.call('pro2-id', 'ProtocolInfoRequest', {})).resolves.toEqual({
191
+ type: 'ProtocolInfo',
188
192
  message: {
189
- major_version: 2,
190
- minor_version: 1,
191
- patch_version: 3,
193
+ version: 1,
194
+ supported_messages: [60200, 60201, 60206, 60207],
195
+ protobuf_definition: 'onekey-protocol-v2',
192
196
  },
193
197
  });
194
198
  expect(plugin.send).toHaveBeenCalled();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onekeyfe/hd-transport-lowlevel",
3
- "version": "1.2.0-alpha.3",
3
+ "version": "1.2.0-alpha.5",
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.0-alpha.3",
24
- "@onekeyfe/hd-transport": "1.2.0-alpha.3"
23
+ "@onekeyfe/hd-shared": "1.2.0-alpha.5",
24
+ "@onekeyfe/hd-transport": "1.2.0-alpha.5"
25
25
  },
26
- "gitHead": "54a4a40baee7e376b9a810dade60007d2c9b00c9"
26
+ "gitHead": "703cfb4e17c6f9315afcb0522ee23ea016ede659"
27
27
  }