@onekeyfe/hd-transport-web-device 1.1.20-alpha.0 → 1.1.20-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
@@ -1,10 +1,10 @@
1
1
  import * as transport from '@onekeyfe/hd-transport';
2
- import transport__default, { AcquireInput } from '@onekeyfe/hd-transport';
2
+ import transport__default, { AcquireInput, OneKeyDeviceInfoBase } from '@onekeyfe/hd-transport';
3
3
  import { Deferred } from '@onekeyfe/hd-shared';
4
4
  import EventEmitter from 'events';
5
5
  import { DesktopAPI } from '@onekeyfe/hd-transport-electron';
6
6
 
7
- interface DeviceInfo {
7
+ interface DeviceInfo extends OneKeyDeviceInfoBase {
8
8
  path: string;
9
9
  device: USBDevice;
10
10
  }
package/dist/index.js CHANGED
@@ -103,6 +103,7 @@ class WebUsbTransport {
103
103
  this.deviceList = onekeyDevices.map(device => ({
104
104
  path: device.serialNumber,
105
105
  device,
106
+ commType: 'webusb',
106
107
  }));
107
108
  return this.deviceList;
108
109
  });
package/dist/webusb.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  /// <reference types="w3c-web-usb" />
2
- import transport, { AcquireInput } from '@onekeyfe/hd-transport';
3
- interface DeviceInfo {
2
+ import transport from '@onekeyfe/hd-transport';
3
+ import type { AcquireInput, OneKeyDeviceInfoBase } from '@onekeyfe/hd-transport';
4
+ export interface DeviceInfo extends OneKeyDeviceInfoBase {
4
5
  path: string;
5
6
  device: USBDevice;
6
7
  }
@@ -29,5 +30,4 @@ export default class WebUsbTransport {
29
30
  receiveData(path: string): Promise<string>;
30
31
  release(path: string): Promise<void>;
31
32
  }
32
- export {};
33
33
  //# sourceMappingURL=webusb.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"webusb.d.ts","sourceRoot":"","sources":["../src/webusb.ts"],"names":[],"mappings":";AACA,OAAO,SAAS,EAAE,EAAE,YAAY,EAAmB,MAAM,wBAAwB,CAAC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"1.1.20-alpha.2",
4
4
  "author": "OneKey",
5
5
  "homepage": "https://github.com/OneKeyHQ/hardware-js-sdk#readme",
6
6
  "license": "MIT",
@@ -20,13 +20,13 @@
20
20
  "lint:fix": "eslint . --fix"
21
21
  },
22
22
  "dependencies": {
23
- "@onekeyfe/hd-shared": "1.1.20-alpha.0",
24
- "@onekeyfe/hd-transport": "1.1.20-alpha.0"
23
+ "@onekeyfe/hd-shared": "1.1.20-alpha.2",
24
+ "@onekeyfe/hd-transport": "1.1.20-alpha.2"
25
25
  },
26
26
  "devDependencies": {
27
- "@onekeyfe/hd-transport-electron": "1.1.20-alpha.0",
27
+ "@onekeyfe/hd-transport-electron": "1.1.20-alpha.2",
28
28
  "@types/w3c-web-usb": "^1.0.6",
29
29
  "@types/web-bluetooth": "^0.0.17"
30
30
  },
31
- "gitHead": "bff28f2906ab17d7843f4e0d634bf4acf6b375b4"
31
+ "gitHead": "dbf71f2cde0679e6f0bc84441ff0d0f905b054c0"
32
32
  }
package/src/webusb.ts CHANGED
@@ -1,8 +1,10 @@
1
1
  /* eslint-disable no-undef */
2
- import transport, { AcquireInput, LogBlockCommand } from '@onekeyfe/hd-transport';
2
+ import transport, { LogBlockCommand } from '@onekeyfe/hd-transport';
3
3
  import { ERRORS, HardwareErrorCode, ONEKEY_WEBUSB_FILTER, wait } from '@onekeyfe/hd-shared';
4
4
  import ByteBuffer from 'bytebuffer';
5
5
 
6
+ import type { AcquireInput, OneKeyDeviceInfoBase } from '@onekeyfe/hd-transport';
7
+
6
8
  const { parseConfigure, buildEncodeBuffers, decodeProtocol, receiveOne, check } = transport;
7
9
 
8
10
  const CONFIGURATION_ID = 1;
@@ -14,7 +16,7 @@ const HEADER_LENGTH = 6;
14
16
  /**
15
17
  * Device information with path and WebUSB device instance
16
18
  */
17
- interface DeviceInfo {
19
+ export interface DeviceInfo extends OneKeyDeviceInfoBase {
18
20
  path: string;
19
21
  device: USBDevice;
20
22
  }
@@ -113,6 +115,7 @@ export default class WebUsbTransport {
113
115
  this.deviceList = onekeyDevices.map(device => ({
114
116
  path: device.serialNumber as string,
115
117
  device,
118
+ commType: 'webusb',
116
119
  }));
117
120
 
118
121
  return this.deviceList;