@onekeyfe/hd-core 0.3.40-alpha.2 → 0.3.40-alpha.3

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
@@ -23544,7 +23544,7 @@ const getDeviceType = (features) => {
23544
23544
  case 'TOUCH':
23545
23545
  return 'touch';
23546
23546
  case 'TOUCH_PRO':
23547
- return 'pro';
23547
+ return 'touch';
23548
23548
  }
23549
23549
  if (!features.serial_no)
23550
23550
  return 'classic';
@@ -23564,6 +23564,8 @@ const getDeviceTypeByBleName = (name) => {
23564
23564
  return 'mini';
23565
23565
  if (name.startsWith('T'))
23566
23566
  return 'touch';
23567
+ if (name.startsWith('P'))
23568
+ return 'touch';
23567
23569
  return 'classic';
23568
23570
  };
23569
23571
  const getDeviceTypeByDeviceId = (deviceId) => {
@@ -25712,12 +25714,6 @@ const getBinary = ({ features, updateType, version, isUpdateBootloader, }) => __
25712
25714
  if (!releaseInfo) {
25713
25715
  throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.RuntimeError, 'no firmware found for this device');
25714
25716
  }
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
25717
  const url = updateType === 'ble'
25722
25718
  ?
25723
25719
  releaseInfo.webUpdate
@@ -1 +1 @@
1
- {"version":3,"file":"deviceFeaturesUtils.d.ts","sourceRoot":"","sources":["../../src/utils/deviceFeaturesUtils.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,KAAK,EACV,QAAQ,EACR,YAAY,EACZ,WAAW,EACX,aAAa,EACb,kBAAkB,EACnB,MAAM,UAAU,CAAC;AAElB,OAAoB,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAEzF,OAAO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AM,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.3",
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.3",
29
+ "@onekeyfe/hd-transport": "^0.3.40-alpha.3",
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": "90037549836946f2d2422dd39a349b23edcd8aa6"
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
@@ -46,7 +46,7 @@ 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
50
  default:
51
51
  // other
52
52
  }
@@ -67,6 +67,7 @@ export const getDeviceTypeByBleName = (name?: string): IDeviceType | null => {
67
67
  if (!name) return 'classic';
68
68
  if (name.startsWith('MI')) return 'mini';
69
69
  if (name.startsWith('T')) return 'touch';
70
+ if (name.startsWith('P')) return 'touch';
70
71
  return 'classic';
71
72
  };
72
73