@onekeyfe/hd-shared 1.1.27-alpha.35 → 1.1.27-alpha.4
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/constants.d.ts +0 -5
- package/dist/constants.d.ts.map +1 -1
- package/dist/deviceType.d.ts +1 -2
- package/dist/deviceType.d.ts.map +1 -1
- package/dist/index.d.ts +2 -8
- package/dist/index.js +1 -7
- package/package.json +2 -2
- package/src/constants.ts +3 -11
- package/src/deviceType.ts +0 -1
package/dist/constants.d.ts
CHANGED
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
export declare const HARDWARE_CONNECT_PROTOCOL: {
|
|
3
|
-
readonly V1: "V1";
|
|
4
|
-
readonly V2: "V2";
|
|
5
|
-
};
|
|
6
|
-
export type HardwareConnectProtocol = (typeof HARDWARE_CONNECT_PROTOCOL)[keyof typeof HARDWARE_CONNECT_PROTOCOL];
|
|
7
2
|
export declare const ONEKEY_WEBUSB_FILTER: {
|
|
8
3
|
vendorId: number;
|
|
9
4
|
productId: number;
|
package/dist/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";AAEA,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";AAEA,eAAO,MAAM,oBAAoB;;;GAOhC,CAAC;AAMF,eAAO,MAAM,2BAA2B,mDAS9B,CAAC;AAMX,eAAO,MAAM,8BAA8B,qBAGjC,CAAC;AAGX,oBAAY,qBAAqB;IAE/B,UAAU,uBAAuB;IACjC,iBAAiB,8BAA8B;IAC/C,aAAa,0BAA0B;IACvC,kBAAkB,+BAA+B;IACjD,cAAc,2BAA2B;IACzC,oBAAoB,iCAAiC;IAGrD,mBAAmB,gCAAgC;IACnD,oBAAoB,iCAAiC;IAGrD,aAAa,0BAA0B;IACvC,oBAAoB,iCAAiC;IAGrD,uBAAuB,oCAAoC;IAC3D,sBAAsB,mCAAmC;IAGzD,mBAAmB,gCAAgC;IACnD,mBAAmB,gCAAgC;IACnD,oBAAoB,iCAAiC;IACrD,iBAAiB,8BAA8B;IAC/C,oBAAoB,iCAAiC;IACrD,eAAe,4BAA4B;IAC3C,mBAAmB,gCAAgC;IACnD,qBAAqB,kCAAkC;IACvD,sBAAsB,mCAAmC;IACzD,wBAAwB,qCAAqC;CAC9D;AAED,eAAO,MAAM,mBAAmB,yCAAyC,CAAC;AAC1E,eAAO,MAAM,gCAAgC,yCAAyC,CAAC;AACvF,eAAO,MAAM,iCAAiC,yCAAyC,CAAC;AAIxF,eAAO,MAAM,aAAa,UAAW,MAAM,GAAG,UAAU,KAAG,OAa1D,CAAC;AAEF,eAAO,MAAM,cAAc,SAAU,MAAM,GAAG,IAAI,OAAO,MAAM,KAAG,OAYjE,CAAC"}
|
package/dist/deviceType.d.ts
CHANGED
package/dist/deviceType.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deviceType.d.ts","sourceRoot":"","sources":["../src/deviceType.ts"],"names":[],"mappings":"AAAA,oBAAY,WAAW;IACrB,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,SAAS,cAAc;IACvB,WAAW,gBAAgB;IAC3B,IAAI,SAAS;IACb,KAAK,UAAU;IACf,GAAG,QAAQ;
|
|
1
|
+
{"version":3,"file":"deviceType.d.ts","sourceRoot":"","sources":["../src/deviceType.ts"],"names":[],"mappings":"AAAA,oBAAY,WAAW;IACrB,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,SAAS,cAAc;IACvB,WAAW,gBAAgB;IAC3B,IAAI,SAAS;IACb,KAAK,UAAU;IACf,GAAG,QAAQ;CACZ"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
declare const HARDWARE_CONNECT_PROTOCOL: {
|
|
2
|
-
readonly V1: "V1";
|
|
3
|
-
readonly V2: "V2";
|
|
4
|
-
};
|
|
5
|
-
type HardwareConnectProtocol = (typeof HARDWARE_CONNECT_PROTOCOL)[keyof typeof HARDWARE_CONNECT_PROTOCOL];
|
|
6
1
|
declare const ONEKEY_WEBUSB_FILTER: {
|
|
7
2
|
vendorId: number;
|
|
8
3
|
productId: number;
|
|
@@ -241,8 +236,7 @@ declare enum EDeviceType {
|
|
|
241
236
|
ClassicPure = "classicpure",
|
|
242
237
|
Mini = "mini",
|
|
243
238
|
Touch = "touch",
|
|
244
|
-
Pro = "pro"
|
|
245
|
-
Pro2 = "pro2"
|
|
239
|
+
Pro = "pro"
|
|
246
240
|
}
|
|
247
241
|
|
|
248
|
-
export { CreateErrorByMessage, CreateHardwareErrorByBridgeError, Deferred, EDeviceType, EFirmwareType, EOneKeyBleMessageKeys, HardwareError$1 as ERRORS, ERROR_CODES_REQUIRE_DISCONNECT, ERROR_CODES_REQUIRE_RELEASE,
|
|
242
|
+
export { CreateErrorByMessage, CreateHardwareErrorByBridgeError, Deferred, EDeviceType, EFirmwareType, EOneKeyBleMessageKeys, HardwareError$1 as ERRORS, ERROR_CODES_REQUIRE_DISCONNECT, ERROR_CODES_REQUIRE_RELEASE, HardwareError, HardwareErrorCode, HardwareErrorCodeMessage, IHardwareError, ONEKEY_NOTIFY_CHARACTERISTIC_UUID, ONEKEY_SERVICE_UUID, ONEKEY_WEBUSB_FILTER, ONEKEY_WRITE_CHARACTERISTIC_UUID, TypedError, createDefectiveFirmwareError, createDeferred, createDeprecatedHardwareError, createDeviceNotSupportMethodError, createNeedUpgradeFirmwareHardwareError, createNewFirmwareForceUpdateHardwareError, createNewFirmwareUnReleaseHardwareError, isHeaderChunk, isOnekeyDevice, serializeError, wait };
|
package/dist/index.js
CHANGED
|
@@ -380,10 +380,6 @@ var HardwareError$1 = /*#__PURE__*/Object.freeze({
|
|
|
380
380
|
createDeviceNotSupportMethodError: createDeviceNotSupportMethodError
|
|
381
381
|
});
|
|
382
382
|
|
|
383
|
-
const HARDWARE_CONNECT_PROTOCOL = {
|
|
384
|
-
V1: 'V1',
|
|
385
|
-
V2: 'V2',
|
|
386
|
-
};
|
|
387
383
|
const ONEKEY_WEBUSB_FILTER = [
|
|
388
384
|
{ vendorId: 0x1209, productId: 0x53c0 },
|
|
389
385
|
{ vendorId: 0x1209, productId: 0x53c1 },
|
|
@@ -450,7 +446,7 @@ const isOnekeyDevice = (name, id) => {
|
|
|
450
446
|
if ((_a = id === null || id === void 0 ? void 0 : id.startsWith) === null || _a === void 0 ? void 0 : _a.call(id, 'MI')) {
|
|
451
447
|
return true;
|
|
452
448
|
}
|
|
453
|
-
const re = /(BixinKey\d{10})|(K\d{4})|(T\d{4})|(Touch\s\w{4})|(Pro\s\w{4})
|
|
449
|
+
const re = /(BixinKey\d{10})|(K\d{4})|(T\d{4})|(Touch\s\w{4})|(Pro\s\w{4})/i;
|
|
454
450
|
if (name && re.exec(name)) {
|
|
455
451
|
return true;
|
|
456
452
|
}
|
|
@@ -527,7 +523,6 @@ exports.EDeviceType = void 0;
|
|
|
527
523
|
EDeviceType["Mini"] = "mini";
|
|
528
524
|
EDeviceType["Touch"] = "touch";
|
|
529
525
|
EDeviceType["Pro"] = "pro";
|
|
530
|
-
EDeviceType["Pro2"] = "pro2";
|
|
531
526
|
})(exports.EDeviceType || (exports.EDeviceType = {}));
|
|
532
527
|
|
|
533
528
|
exports.CreateErrorByMessage = CreateErrorByMessage;
|
|
@@ -535,7 +530,6 @@ exports.CreateHardwareErrorByBridgeError = CreateHardwareErrorByBridgeError;
|
|
|
535
530
|
exports.ERRORS = HardwareError$1;
|
|
536
531
|
exports.ERROR_CODES_REQUIRE_DISCONNECT = ERROR_CODES_REQUIRE_DISCONNECT;
|
|
537
532
|
exports.ERROR_CODES_REQUIRE_RELEASE = ERROR_CODES_REQUIRE_RELEASE;
|
|
538
|
-
exports.HARDWARE_CONNECT_PROTOCOL = HARDWARE_CONNECT_PROTOCOL;
|
|
539
533
|
exports.HardwareError = HardwareError;
|
|
540
534
|
exports.HardwareErrorCode = HardwareErrorCode;
|
|
541
535
|
exports.HardwareErrorCodeMessage = HardwareErrorCodeMessage;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onekeyfe/hd-shared",
|
|
3
|
-
"version": "1.1.27-alpha.
|
|
3
|
+
"version": "1.1.27-alpha.4",
|
|
4
4
|
"description": "Hardware SDK's shared tool library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Hardware-SDK",
|
|
@@ -25,5 +25,5 @@
|
|
|
25
25
|
"lint": "eslint .",
|
|
26
26
|
"lint:fix": "eslint . --fix"
|
|
27
27
|
},
|
|
28
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "93d0e7734f8c3a6380be10f74de203f0ba785bb8"
|
|
29
29
|
}
|
package/src/constants.ts
CHANGED
|
@@ -1,16 +1,8 @@
|
|
|
1
1
|
import { HardwareErrorCode } from './HardwareError';
|
|
2
2
|
|
|
3
|
-
export const HARDWARE_CONNECT_PROTOCOL = {
|
|
4
|
-
V1: 'V1',
|
|
5
|
-
V2: 'V2',
|
|
6
|
-
} as const;
|
|
7
|
-
|
|
8
|
-
export type HardwareConnectProtocol =
|
|
9
|
-
(typeof HARDWARE_CONNECT_PROTOCOL)[keyof typeof HARDWARE_CONNECT_PROTOCOL];
|
|
10
|
-
|
|
11
3
|
export const ONEKEY_WEBUSB_FILTER = [
|
|
12
4
|
{ vendorId: 0x1209, productId: 0x53c0 }, // Classic Boot、Classic1s Boot、Mini Boot
|
|
13
|
-
{ vendorId: 0x1209, productId: 0x53c1 }, // Classic Firmware、Classic1s Firmware、Mini Firmware、Pro
|
|
5
|
+
{ vendorId: 0x1209, productId: 0x53c1 }, // Classic Firmware、Classic1s Firmware、Mini Firmware、Pro Firmware、Touch Firmware
|
|
14
6
|
{ vendorId: 0x1209, productId: 0x4f4a }, // Pro Boot、Touch Boot
|
|
15
7
|
{ vendorId: 0x1209, productId: 0x4f4b }, // Pro Firmware、Touch Firmware(Not implemented Trezor)
|
|
16
8
|
// { vendorId: 0x1209, productId: 0x4f4c }, // Pro Board
|
|
@@ -102,9 +94,9 @@ export const isOnekeyDevice = (name: string | null, id?: string): boolean => {
|
|
|
102
94
|
return true;
|
|
103
95
|
}
|
|
104
96
|
|
|
105
|
-
// 过滤 BixinKeyxxx 和 Kxxxx 和 Txxxx
|
|
97
|
+
// 过滤 BixinKeyxxx 和 Kxxxx 和 Txxxx
|
|
106
98
|
// i 忽略大小写模式
|
|
107
|
-
const re = /(BixinKey\d{10})|(K\d{4})|(T\d{4})|(Touch\s\w{4})|(Pro\s\w{4})
|
|
99
|
+
const re = /(BixinKey\d{10})|(K\d{4})|(T\d{4})|(Touch\s\w{4})|(Pro\s\w{4})/i;
|
|
108
100
|
if (name && re.exec(name)) {
|
|
109
101
|
return true;
|
|
110
102
|
}
|