@onekeyfe/hd-core 0.2.20 → 0.2.22

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.
@@ -8,6 +8,9 @@ export default class CosmosGetAddress extends BaseMethod<HardwareCosmosGetAddres
8
8
  model_mini: {
9
9
  min: string;
10
10
  };
11
+ model_touch: {
12
+ min: string;
13
+ };
11
14
  };
12
15
  run(): Promise<CosmosAddress | CosmosAddress[]>;
13
16
  }
@@ -1 +1 @@
1
- {"version":3,"file":"CosmosGetAddress.d.ts","sourceRoot":"","sources":["../../../src/api/cosmos/CosmosGetAddress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,IAAI,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAGtF,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,aAAa,EAA0B,MAAM,aAAa,CAAC;AAEpE,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,UAAU,CAAC,wBAAwB,EAAE,CAAC;IAClF,SAAS,UAAS;IAElB,IAAI;IAgCJ,eAAe;;;;;IAQT,GAAG;CAoBV"}
1
+ {"version":3,"file":"CosmosGetAddress.d.ts","sourceRoot":"","sources":["../../../src/api/cosmos/CosmosGetAddress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,IAAI,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAGtF,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,aAAa,EAA0B,MAAM,aAAa,CAAC;AAEpE,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,UAAU,CAAC,wBAAwB,EAAE,CAAC;IAClF,SAAS,UAAS;IAElB,IAAI;IAgCJ,eAAe;;;;;;;;IAWT,GAAG;CAoBV"}
@@ -6,6 +6,9 @@ export default class CosmosGetPublicKey extends BaseMethod<any> {
6
6
  model_mini: {
7
7
  min: string;
8
8
  };
9
+ model_touch: {
10
+ min: string;
11
+ };
9
12
  };
10
13
  run(): Promise<{
11
14
  path: string;
@@ -1 +1 @@
1
- {"version":3,"file":"CosmosGetPublicKey.d.ts","sourceRoot":"","sources":["../../../src/api/cosmos/CosmosGetPublicKey.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAI3C,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,UAAU,CAAC,GAAG,CAAC;IAC7D,SAAS,UAAS;IAElB,IAAI;IAwCJ,eAAe;;;;;IAQT,GAAG;;;;;;;CAaV"}
1
+ {"version":3,"file":"CosmosGetPublicKey.d.ts","sourceRoot":"","sources":["../../../src/api/cosmos/CosmosGetPublicKey.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAI3C,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,UAAU,CAAC,GAAG,CAAC;IAC7D,SAAS,UAAS;IAElB,IAAI;IAwCJ,eAAe;;;;;;;;IAWT,GAAG;;;;;;;CAaV"}
@@ -7,6 +7,9 @@ export default class CosmosSignTransaction extends BaseMethod<HardwareCosmosSign
7
7
  model_mini: {
8
8
  min: string;
9
9
  };
10
+ model_touch: {
11
+ min: string;
12
+ };
10
13
  };
11
14
  run(): Promise<{
12
15
  path: string;
@@ -1 +1 @@
1
- {"version":3,"file":"CosmosSignTransaction.d.ts","sourceRoot":"","sources":["../../../src/api/cosmos/CosmosSignTransaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,IAAI,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9E,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAK3C,MAAM,CAAC,OAAO,OAAO,qBAAsB,SAAQ,UAAU,CAAC,oBAAoB,CAAC;IACjF,SAAS,UAAS;IAElB,IAAI;IAoBJ,eAAe;;;;;IAQT,GAAG;;;;CAYV"}
1
+ {"version":3,"file":"CosmosSignTransaction.d.ts","sourceRoot":"","sources":["../../../src/api/cosmos/CosmosSignTransaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,IAAI,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9E,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAK3C,MAAM,CAAC,OAAO,OAAO,qBAAsB,SAAQ,UAAU,CAAC,oBAAoB,CAAC;IACjF,SAAS,UAAS;IAElB,IAAI;IAoBJ,eAAe;;;;;;;;IAWT,GAAG;;;;CAYV"}
@@ -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;
@@ -16465,7 +16468,10 @@ class CosmosGetAddress extends BaseMethod {
16465
16468
  getVersionRange() {
16466
16469
  return {
16467
16470
  model_mini: {
16468
- min: '2.6.0',
16471
+ min: '2.10.0',
16472
+ },
16473
+ model_touch: {
16474
+ min: '4.0.0',
16469
16475
  },
16470
16476
  };
16471
16477
  }
@@ -16525,7 +16531,10 @@ class CosmosGetPublicKey extends BaseMethod {
16525
16531
  getVersionRange() {
16526
16532
  return {
16527
16533
  model_mini: {
16528
- min: '2.6.0',
16534
+ min: '2.10.0',
16535
+ },
16536
+ model_touch: {
16537
+ min: '4.0.0',
16529
16538
  },
16530
16539
  };
16531
16540
  }
@@ -16566,7 +16575,10 @@ class CosmosSignTransaction extends BaseMethod {
16566
16575
  getVersionRange() {
16567
16576
  return {
16568
16577
  model_mini: {
16569
- min: '2.6.0',
16578
+ min: '2.10.0',
16579
+ },
16580
+ model_touch: {
16581
+ min: '4.0.0',
16570
16582
  },
16571
16583
  };
16572
16584
  }
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.22",
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.22",
28
+ "@onekeyfe/hd-transport": "^0.2.22",
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": "720fa3b25f4fd9de7d1f426a4e42af347476ef8f"
46
46
  }
@@ -43,7 +43,10 @@ export default class CosmosGetAddress extends BaseMethod<HardwareCosmosGetAddres
43
43
  getVersionRange() {
44
44
  return {
45
45
  model_mini: {
46
- min: '2.6.0',
46
+ min: '2.10.0',
47
+ },
48
+ model_touch: {
49
+ min: '4.0.0',
47
50
  },
48
51
  };
49
52
  }
@@ -50,7 +50,10 @@ export default class CosmosGetPublicKey extends BaseMethod<any> {
50
50
  getVersionRange() {
51
51
  return {
52
52
  model_mini: {
53
- min: '2.6.0',
53
+ min: '2.10.0',
54
+ },
55
+ model_touch: {
56
+ min: '4.0.0',
54
57
  },
55
58
  };
56
59
  }
@@ -31,7 +31,10 @@ export default class CosmosSignTransaction extends BaseMethod<HardwareCosmosSign
31
31
  getVersionRange() {
32
32
  return {
33
33
  model_mini: {
34
- min: '2.6.0',
34
+ min: '2.10.0',
35
+ },
36
+ model_touch: {
37
+ min: '4.0.0',
35
38
  },
36
39
  };
37
40
  }
@@ -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