@onekeyfe/hd-core 0.3.41 → 0.3.42

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":"FirmwareUpdate.d.ts","sourceRoot":"","sources":["../../src/api/FirmwareUpdate.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAa1C,KAAK,MAAM,GAAG;IACZ,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,UAAU,EAAE,UAAU,GAAG,KAAK,CAAC;CAChC,CAAC;AAIF,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,UAAU,CAAC,MAAM,CAAC;IAC5D,IAAI;IAqCJ,cAAc,YAAa,MAAM,UAS/B;IAEF,uBAAuB,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS;IAwD/C,GAAG;CA2EV"}
1
+ {"version":3,"file":"FirmwareUpdate.d.ts","sourceRoot":"","sources":["../../src/api/FirmwareUpdate.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAa1C,KAAK,MAAM,GAAG;IACZ,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,UAAU,EAAE,UAAU,GAAG,KAAK,CAAC;CAChC,CAAC;AAIF,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,UAAU,CAAC,MAAM,CAAC;IAC5D,IAAI;IAqCJ,cAAc,YAAa,MAAM,UAS/B;IAEF,uBAAuB,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS;IAwD/C,GAAG;CA4EV"}
@@ -1 +1 @@
1
- {"version":3,"file":"FirmwareUpdateV2.d.ts","sourceRoot":"","sources":["../../src/api/FirmwareUpdateV2.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EAIT,M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E,OAAO,CAAC;CAC9B,CAAC;AAIF,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,UAAU,CAAC,MAAM,CAAC;IAC9D,YAAY,EAAE,QAAQ,CAAC,GAAG,CAAC,GAAG,IAAI,CAAQ;IAE1C,IAAI;IA2CJ,cAAc,YAAa,MAAM,UAS/B;IAEF,uBAAuB,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS;IAsDrD,qBAAqB,CAAC,QAAQ,EAAE,QAAQ;IAUxC,uBAAuB,CAAC,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM;IAc9D,gCAAgC,CAAC,QAAQ,CAAC,EAAE,QAAQ;IAwB9C,GAAG;CA0GV"}
package/dist/index.js CHANGED
@@ -25154,7 +25154,7 @@ class CheckBridgeRelease extends BaseMethod {
25154
25154
  const currentFirmwareVersion = getDeviceFirmwareVersion(features).join('.');
25155
25155
  const isOldVersionBridge = semver__default["default"].lt(version, BridgeVersion);
25156
25156
  let shouldUpdate = false;
25157
- if (deviceType === 'touch') {
25157
+ if (DeviceModelToTypes.model_touch.includes(deviceType)) {
25158
25158
  if (semver__default["default"].gte(willUpdateFirmwareVersion, TouchNeedUpdateVersion) && isOldVersionBridge) {
25159
25159
  shouldUpdate = true;
25160
25160
  }
@@ -26222,7 +26222,8 @@ class FirmwareUpdate extends BaseMethod {
26222
26222
  }
26223
26223
  delete DevicePool.devicesCache[''];
26224
26224
  yield (checkPromise === null || checkPromise === void 0 ? void 0 : checkPromise.promise);
26225
- yield wait(deviceType === 'touch' ? 3000 : 1500);
26225
+ const isTouch = DeviceModelToTypes.model_touch.includes(deviceType);
26226
+ yield wait(isTouch ? 3000 : 1500);
26226
26227
  }
26227
26228
  catch (e) {
26228
26229
  if (e instanceof hdShared.HardwareError) {
@@ -26414,7 +26415,8 @@ class FirmwareUpdateV2 extends BaseMethod {
26414
26415
  delete DevicePool.devicesCache[''];
26415
26416
  yield ((_a = this.checkPromise) === null || _a === void 0 ? void 0 : _a.promise);
26416
26417
  this.checkPromise = null;
26417
- yield wait(deviceType === 'touch' ? 3000 : 1500);
26418
+ const isTouch = DeviceModelToTypes.model_touch.includes(deviceType);
26419
+ yield wait(isTouch ? 3000 : 1500);
26418
26420
  }
26419
26421
  catch (e) {
26420
26422
  if (e instanceof hdShared.HardwareError) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onekeyfe/hd-core",
3
- "version": "0.3.41",
3
+ "version": "0.3.42",
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.41",
29
- "@onekeyfe/hd-transport": "^0.3.41",
28
+ "@onekeyfe/hd-shared": "^0.3.42",
29
+ "@onekeyfe/hd-transport": "^0.3.42",
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": "8efa4cb513d00dce51d86e50ef8245d789f15cb0"
47
+ "gitHead": "aa8d10be2fb710e2b3bc0b30973a039abde2a8f3"
48
48
  }
@@ -38,7 +38,7 @@ export default class CheckBridgeRelease extends BaseMethod {
38
38
  const isOldVersionBridge = semver.lt(version, BridgeVersion);
39
39
 
40
40
  let shouldUpdate = false;
41
- if (deviceType === 'touch') {
41
+ if (DeviceModelToTypes.model_touch.includes(deviceType)) {
42
42
  if (semver.gte(willUpdateFirmwareVersion, TouchNeedUpdateVersion) && isOldVersionBridge) {
43
43
  shouldUpdate = true;
44
44
  }
@@ -159,7 +159,8 @@ export default class FirmwareUpdate extends BaseMethod<Params> {
159
159
  /**
160
160
  * Touch 1 with bootloader v2.5.0 issue: BLE chip need more time for looking up name, here change the delay time to 3000ms after rebooting.
161
161
  */
162
- await wait(deviceType === 'touch' ? 3000 : 1500);
162
+ const isTouch = DeviceModelToTypes.model_touch.includes(deviceType);
163
+ await wait(isTouch ? 3000 : 1500);
163
164
  } catch (e) {
164
165
  if (e instanceof HardwareError) {
165
166
  return Promise.reject(e);
@@ -246,7 +246,8 @@ export default class FirmwareUpdateV2 extends BaseMethod<Params> {
246
246
  /**
247
247
  * Touch 1 with bootloader v2.5.0 issue: BLE chip need more time for looking up name, here change the delay time to 3000ms after rebooting.
248
248
  */
249
- await wait(deviceType === 'touch' ? 3000 : 1500);
249
+ const isTouch = DeviceModelToTypes.model_touch.includes(deviceType);
250
+ await wait(isTouch ? 3000 : 1500);
250
251
  } catch (e) {
251
252
  if (e instanceof HardwareError) {
252
253
  return Promise.reject(e);