@onekeyfe/hd-core 0.2.20 → 0.2.21

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;AAMvC,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,QAAQ,CAAC;IACnB,UAAU,EAAE,UAAU,GAAG,KAAK,CAAC;CAChC;AAED,UAAU,cAAe,SAAQ,YAAY;IAC3C,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,eAAO,MAAM,SAAS,sCAA6C,cAAc;;;;;;;;;;;;;EAwBhF,CAAC;AAEF,eAAO,MAAM,oBAAoB,QAAe,MAAM;;EAWrD,CAAC;AAEF,eAAO,MAAM,OAAO,6BAA8B,YAAY,2DAO7D,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;AAMvC,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,QAAQ,CAAC;IACnB,UAAU,EAAE,UAAU,GAAG,KAAK,CAAC;CAChC;AAED,UAAU,cAAe,SAAQ,YAAY;IAC3C,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,eAAO,MAAM,SAAS,sCAA6C,cAAc;;;;;;;;;;;;;EA2BhF,CAAC;AAEF,eAAO,MAAM,oBAAoB,QAAe,MAAM;;EAWrD,CAAC;AAEF,eAAO,MAAM,OAAO,6BAA8B,YAAY,2DAO7D,CAAC"}
package/dist/index.js CHANGED
@@ -13148,7 +13148,10 @@ const getBinary = ({ features, updateType, version }) => __awaiter(void 0, void
13148
13148
  throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.RuntimeError, 'no firmware found for this device');
13149
13149
  }
13150
13150
  if (version && !semver__default["default"].eq(releaseInfo.version.join('.'), version.join('.'))) {
13151
- throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.RuntimeError, 'firmware version mismatch');
13151
+ const touchWithoutVersion = getDeviceType(features) === 'touch' && !features.onekey_version;
13152
+ if (!touchWithoutVersion) {
13153
+ throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.RuntimeError, 'firmware version mismatch');
13154
+ }
13152
13155
  }
13153
13156
  const url = updateType === 'ble' ? releaseInfo.webUpdate : releaseInfo.url;
13154
13157
  let fw;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onekeyfe/hd-core",
3
- "version": "0.2.20",
3
+ "version": "0.2.21",
4
4
  "description": "> TODO: description",
5
5
  "author": "OneKey",
6
6
  "homepage": "https://github.com/OneKeyHQ/hardware-js-sdk#readme",
@@ -24,8 +24,8 @@
24
24
  "url": "https://github.com/OneKeyHQ/hardware-js-sdk/issues"
25
25
  },
26
26
  "dependencies": {
27
- "@onekeyfe/hd-shared": "^0.2.20",
28
- "@onekeyfe/hd-transport": "^0.2.20",
27
+ "@onekeyfe/hd-shared": "^0.2.21",
28
+ "@onekeyfe/hd-transport": "^0.2.21",
29
29
  "axios": "^0.27.2",
30
30
  "bignumber.js": "^9.0.2",
31
31
  "jszip": "^3.10.1",
@@ -42,5 +42,5 @@
42
42
  "@types/semver": "^7.3.9",
43
43
  "ripple-keypairs": "^1.1.4"
44
44
  },
45
- "gitHead": "268a6af24128b3db9c74c7c1da122d28845a34ef"
45
+ "gitHead": "9c6e7dbad51e7133b18c8fcb5ff6bd1427bf1765"
46
46
  }
@@ -23,7 +23,10 @@ export const getBinary = async ({ features, updateType, version }: GetBinaryProp
23
23
  }
24
24
 
25
25
  if (version && !semver.eq(releaseInfo.version.join('.'), version.join('.'))) {
26
- throw ERRORS.TypedError(HardwareErrorCode.RuntimeError, 'firmware version mismatch');
26
+ const touchWithoutVersion = getDeviceType(features) === 'touch' && !features.onekey_version;
27
+ if (!touchWithoutVersion) {
28
+ throw ERRORS.TypedError(HardwareErrorCode.RuntimeError, 'firmware version mismatch');
29
+ }
27
30
  }
28
31
 
29
32
  // @ts-expect-error