@onekeyfe/hd-transport-lowlevel 0.3.23-alpha.0 → 0.3.23-alpha.2

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 CHANGED
@@ -16,7 +16,9 @@ declare class LowlevelTransport {
16
16
  configure(signedData: any): void;
17
17
  listen(): void;
18
18
  enumerate(): Promise<_onekeyfe_hd_transport.LowLevelDevice[]>;
19
- acquire(input: LowLevelAcquireInput): Promise<void>;
19
+ acquire(input: LowLevelAcquireInput): Promise<{
20
+ uuid: string;
21
+ }>;
20
22
  release(uuid: string): Promise<boolean>;
21
23
  call(uuid: string, name: string, data: Record<string, unknown>): Promise<_onekeyfe_hd_transport.MessageFromOneKey>;
22
24
  cancel(): void;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,SAAS,MAAM,wBAAwB,CAAC;AAC/C,OAAO,KAAK,YAAY,MAAM,QAAQ,CAAC;AACvC,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,wBAAwB,CAAC;AAC5E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAIpD,MAAM,CAAC,OAAO,OAAO,iBAAiB;IACpC,SAAS,EAAE,UAAU,CAAC,OAAO,SAAS,CAAC,cAAc,CAAC,GAAG,SAAS,CAAC;IAEnE,UAAU,UAAS;IAEnB,GAAG,CAAC,EAAE,GAAG,CAAC;IAEV,OAAO,CAAC,EAAE,YAAY,CAAC;IAEvB,MAAM,EAAE,6BAA6B,CAAuC;IAE5E,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,6BAA6B;IAO9E,SAAS,CAAC,UAAU,EAAE,GAAG;IAMzB,MAAM;IAIN,SAAS;IAIH,OAAO,CAAC,KAAK,EAAE,oBAAoB;IAYnC,OAAO,CAAC,IAAI,EAAE,MAAM;IAUpB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAmCpE,MAAM;CAGP"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,SAAS,MAAM,wBAAwB,CAAC;AAC/C,OAAO,KAAK,YAAY,MAAM,QAAQ,CAAC;AACvC,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,wBAAwB,CAAC;AAC5E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAIpD,MAAM,CAAC,OAAO,OAAO,iBAAiB;IACpC,SAAS,EAAE,UAAU,CAAC,OAAO,SAAS,CAAC,cAAc,CAAC,GAAG,SAAS,CAAC;IAEnE,UAAU,UAAS;IAEnB,GAAG,CAAC,EAAE,GAAG,CAAC;IAEV,OAAO,CAAC,EAAE,YAAY,CAAC;IAEvB,MAAM,EAAE,6BAA6B,CAAuC;IAE5E,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,6BAA6B;IAO9E,SAAS,CAAC,UAAU,EAAE,GAAG;IAMzB,MAAM;IAIN,SAAS;IAIH,OAAO,CAAC,KAAK,EAAE,oBAAoB;;;IAanC,OAAO,CAAC,IAAI,EAAE,MAAM;IAUpB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAmCpE,MAAM;CAGP"}
package/dist/index.js CHANGED
@@ -59,6 +59,7 @@ class LowlevelTransport {
59
59
  return __awaiter(this, void 0, void 0, function* () {
60
60
  try {
61
61
  yield this.plugin.connect(input.uuid);
62
+ return { uuid: input.uuid };
62
63
  }
63
64
  catch (error) {
64
65
  this.Log.debug('lowlelvel transport connect error: ', error);
@@ -87,8 +88,8 @@ class LowlevelTransport {
87
88
  this.Log.debug('lowlevel-transport', 'call-', ' name: ', name, ' data: ', data);
88
89
  const buffers = buildBuffers(messages, name, data);
89
90
  for (const o of buffers) {
90
- const outData = o.toString('base64');
91
- this.Log.debug('send hex strting: ', o.toString('hex'));
91
+ const outData = o.toString('hex');
92
+ this.Log.debug('send hex strting: ', outData);
92
93
  try {
93
94
  yield this.plugin.send(uuid, outData);
94
95
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onekeyfe/hd-transport-lowlevel",
3
- "version": "0.3.23-alpha.0",
3
+ "version": "0.3.23-alpha.2",
4
4
  "homepage": "https://github.com/OneKeyHQ/hardware-js-sdk#readme",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -19,8 +19,8 @@
19
19
  "lint:fix": "eslint . --fix"
20
20
  },
21
21
  "dependencies": {
22
- "@onekeyfe/hd-shared": "^0.3.23-alpha.0",
23
- "@onekeyfe/hd-transport": "^0.3.23-alpha.0"
22
+ "@onekeyfe/hd-shared": "^0.3.23-alpha.2",
23
+ "@onekeyfe/hd-transport": "^0.3.23-alpha.2"
24
24
  },
25
- "gitHead": "da0fd219f855c9883ad308fa839cf379b6107c93"
25
+ "gitHead": "7a478457bc53ecab2231f20e3a702e2998c9c94a"
26
26
  }
package/src/index.ts CHANGED
@@ -41,6 +41,7 @@ export default class LowlevelTransport {
41
41
  async acquire(input: LowLevelAcquireInput) {
42
42
  try {
43
43
  await this.plugin.connect(input.uuid);
44
+ return { uuid: input.uuid };
44
45
  } catch (error) {
45
46
  this.Log.debug('lowlelvel transport connect error: ', error);
46
47
  throw ERRORS.TypedError(
@@ -70,9 +71,9 @@ export default class LowlevelTransport {
70
71
 
71
72
  const buffers = buildBuffers(messages, name, data);
72
73
  for (const o of buffers) {
73
- const outData = o.toString('base64');
74
+ const outData = o.toString('hex');
74
75
  // Upload resources on low-end phones may OOM
75
- this.Log.debug('send hex strting: ', o.toString('hex'));
76
+ this.Log.debug('send hex strting: ', outData);
76
77
  try {
77
78
  await this.plugin.send(uuid, outData);
78
79
  } catch (e) {