@onekeyfe/hd-core 0.3.40-alpha.2 → 0.3.40-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.
@@ -1 +1 @@
1
- {"version":3,"file":"getBinary.d.ts","sourceRoot":"","sources":["../../../src/api/firmware/getBinary.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAOvC,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,QAAQ,CAAC;IACnB,UAAU,EAAE,UAAU,GAAG,KAAK,CAAC;IAC/B,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,UAAU,cAAe,SAAQ,YAAY;IAC3C,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,eAAO,MAAM,SAAS,2DAKnB,cAAc;;;;;;;;;;;;;;;;;;;;EAiChB,CAAC;AAEF,eAAO,MAAM,oBAAoB,QAAe,MAAM;;EAWrD,CAAC;AAEF,eAAO,MAAM,OAAO,4CAA6C,YAAY,2DAY5E,CAAC"}
1
+ {"version":3,"file":"getBinary.d.ts","sourceRoot":"","sources":["../../../src/api/firmware/getBinary.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAOvC,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,QAAQ,CAAC;IACnB,UAAU,EAAE,UAAU,GAAG,KAAK,CAAC;IAC/B,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,UAAU,cAAe,SAAQ,YAAY;IAC3C,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,eAAO,MAAM,SAAS,2DAKnB,cAAc;;;;;;;;;;;;;;;;;;;;EAkChB,CAAC;AAEF,eAAO,MAAM,oBAAoB,QAAe,MAAM;;EAWrD,CAAC;AAEF,eAAO,MAAM,OAAO,4CAA6C,YAAY,2DAY5E,CAAC"}
package/dist/index.js CHANGED
@@ -6615,7 +6615,8 @@ var nested$1 = {
6615
6615
  CLASSIC1S: 1,
6616
6616
  MINI: 2,
6617
6617
  TOUCH: 3,
6618
- TOUCH_PRO: 4
6618
+ TOUCH_PRO: 4,
6619
+ PRO: 5
6619
6620
  }
6620
6621
  },
6621
6622
  OneKeySeType: {
@@ -23544,7 +23545,9 @@ const getDeviceType = (features) => {
23544
23545
  case 'TOUCH':
23545
23546
  return 'touch';
23546
23547
  case 'TOUCH_PRO':
23547
- return 'pro';
23548
+ return 'touch';
23549
+ case 'PRO':
23550
+ return 'touch';
23548
23551
  }
23549
23552
  if (!features.serial_no)
23550
23553
  return 'classic';
@@ -23564,6 +23567,8 @@ const getDeviceTypeByBleName = (name) => {
23564
23567
  return 'mini';
23565
23568
  if (name.startsWith('T'))
23566
23569
  return 'touch';
23570
+ if (name.startsWith('P'))
23571
+ return 'touch';
23567
23572
  return 'classic';
23568
23573
  };
23569
23574
  const getDeviceTypeByDeviceId = (deviceId) => {
@@ -25712,12 +25717,6 @@ const getBinary = ({ features, updateType, version, isUpdateBootloader, }) => __
25712
25717
  if (!releaseInfo) {
25713
25718
  throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.RuntimeError, 'no firmware found for this device');
25714
25719
  }
25715
- if (version && !semver__default["default"].eq(releaseInfo.version.join('.'), version.join('.'))) {
25716
- const touchWithoutVersion = getDeviceType(features) === 'touch' && !features.onekey_version;
25717
- if (!touchWithoutVersion) {
25718
- throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.RuntimeError, 'firmware version mismatch');
25719
- }
25720
- }
25721
25720
  const url = updateType === 'ble'
25722
25721
  ?
25723
25722
  releaseInfo.webUpdate
@@ -1 +1 @@
1
- {"version":3,"file":"deviceFeaturesUtils.d.ts","sourceRoot":"","sources":["../../src/utils/deviceFeaturesUtils.ts"],"names":[],"mappings":"AAG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G,SAAS,KAC7B;IAAE,QAAQ,EAAE,IAAI,CAAC;IAAC,cAAc,EAAE,cAAc,CAAA;CAiClD,CAAC;AAEF,eAAO,MAAM,yBAAyB,aAAc,QAAQ,KAAG,kBAU9D,CAAC;AAEF,eAAO,MAAM,oBAAoB,cAAe,QAAQ,KAAG,kBAW1D,CAAC;AAEF,eAAO,MAAM,uCAAuC,WAAkB,MAAM,4BAY3E,CAAC;AAEF,eAAO,MAAM,kBAAkB,aACnB,QAAQ,GAAG,SAAS,YACpB,cAAc,4BAgBzB,CAAC;AAEF,eAAO,MAAM,qBAAqB,cAAe,QAAQ,KAAG,OAU3D,CAAC;AAEF,eAAO,MAAM,uBAAuB,cAAe,QAAQ,KAAG,kBAU7D,CAAC;AAKF,eAAO,MAAM,sBAAsB;cAKvB,QAAQ;gBACN,UAAU,GAAG,KAAK;;MAE5B,KAAK,GAAG,aAsBX,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onekeyfe/hd-core",
3
- "version": "0.3.40-alpha.2",
3
+ "version": "0.3.40-alpha.4",
4
4
  "description": "> TODO: description",
5
5
  "author": "OneKey",
6
6
  "homepage": "https://github.com/OneKeyHQ/hardware-js-sdk#readme",
@@ -25,8 +25,8 @@
25
25
  "url": "https://github.com/OneKeyHQ/hardware-js-sdk/issues"
26
26
  },
27
27
  "dependencies": {
28
- "@onekeyfe/hd-shared": "^0.3.40-alpha.2",
29
- "@onekeyfe/hd-transport": "^0.3.40-alpha.2",
28
+ "@onekeyfe/hd-shared": "^0.3.40-alpha.4",
29
+ "@onekeyfe/hd-transport": "^0.3.40-alpha.4",
30
30
  "axios": "^0.27.2",
31
31
  "bignumber.js": "^9.0.2",
32
32
  "bytebuffer": "^5.0.1",
@@ -44,5 +44,5 @@
44
44
  "@types/semver": "^7.3.9",
45
45
  "ripple-keypairs": "^1.1.4"
46
46
  },
47
- "gitHead": "d8f28d911d6acf1dcc0d6bfdae53aee23ee9f4de"
47
+ "gitHead": "ca121236c3c500bf59b8ee1908268410e40bc135"
48
48
  }
@@ -30,12 +30,13 @@ export const getBinary = async ({
30
30
  throw ERRORS.TypedError(HardwareErrorCode.RuntimeError, 'no firmware found for this device');
31
31
  }
32
32
 
33
- if (version && !semver.eq(releaseInfo.version.join('.'), version.join('.'))) {
34
- const touchWithoutVersion = getDeviceType(features) === 'touch' && !features.onekey_version;
35
- if (!touchWithoutVersion) {
36
- throw ERRORS.TypedError(HardwareErrorCode.RuntimeError, 'firmware version mismatch');
37
- }
38
- }
33
+ // temporary disable version check
34
+ // if (version && !semver.eq(releaseInfo.version.join('.'), version.join('.'))) {
35
+ // const touchWithoutVersion = getDeviceType(features) === 'touch' && !features.onekey_version;
36
+ // if (!touchWithoutVersion) {
37
+ // throw ERRORS.TypedError(HardwareErrorCode.RuntimeError, 'firmware version mismatch');
38
+ // }
39
+ // }
39
40
 
40
41
  const url =
41
42
  // eslint-disable-next-line no-nested-ternary
@@ -5766,7 +5766,8 @@
5766
5766
  "CLASSIC1S": 1,
5767
5767
  "MINI": 2,
5768
5768
  "TOUCH": 3,
5769
- "TOUCH_PRO": 4
5769
+ "TOUCH_PRO": 4,
5770
+ "PRO": 5
5770
5771
  }
5771
5772
  },
5772
5773
  "OneKeySeType": {
@@ -46,7 +46,9 @@ export const getDeviceType = (features?: Features): IDeviceType => {
46
46
  case 'TOUCH':
47
47
  return 'touch';
48
48
  case 'TOUCH_PRO':
49
- return 'pro';
49
+ return 'touch';
50
+ case 'PRO':
51
+ return 'touch';
50
52
  default:
51
53
  // other
52
54
  }
@@ -67,6 +69,7 @@ export const getDeviceTypeByBleName = (name?: string): IDeviceType | null => {
67
69
  if (!name) return 'classic';
68
70
  if (name.startsWith('MI')) return 'mini';
69
71
  if (name.startsWith('T')) return 'touch';
72
+ if (name.startsWith('P')) return 'touch';
70
73
  return 'classic';
71
74
  };
72
75