@onekeyfe/hd-core 1.1.16 → 1.1.17

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":"EVMSignTypedData.d.ts","sourceRoot":"","sources":["../../../src/api/evm/EVMSignTypedData.ts"],"names":[],"mappings":"AAIA,OAAO,EAGL,UAAU,EACV,eAAe,EACf,SAAS,EAEV,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAK3C,OAAO,EAEL,KAAK,4BAA4B,EACjC,KAAK,0BAA0B,EAChC,MAAM,aAAa,CAAC;AAQrB,MAAM,MAAM,sBAAsB,GAAG;IACnC,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,IAAI,EAAE,4BAA4B,CAAC,0BAA0B,CAAC,CAAC;IAC/D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,UAAU,CAAC,sBAAsB,CAAC;IAC9E,IAAI;IAqCE,mBAAmB,CAAC,EACxB,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,aAAa,GACd,EAAE;QACD,SAAS,EAAE,SAAS,CAAC;QACrB,QAAQ,EAAE,4BAA4B,CAAC,0BAA0B,CAAC,CAAC;QACnE,QAAQ,EAAE,eAAe,CAAC,UAAU,CAAC,CAAC;QACtC,aAAa,EAAE,OAAO,CAAC;KACxB;;;;IA+JK,aAAa;;;;IAsCnB,aAAa,CAAC,EACZ,SAAS,EACT,QAAQ,EACR,OAAO,EACP,UAAU,EACV,WAAW,GACZ,EAAE;QACD,SAAS,EAAE,SAAS,CAAC;QACrB,QAAQ,EAAE,MAAM,EAAE,CAAC;QACnB,OAAO,EAAE,MAAM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AS,EACT,QAAQ,EACR,OAAO,EACP,UAAU,EACV,WAAW,GACZ,EAAE;QACD,SAAS,EAAE,SAAS,CAAC;QACrB,QAAQ,EAAE,MAAM,EAAE,CAAC;QACnB,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;QAC5B,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;QAC/B,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;KACjC;IA2BD,eAAe;;;;;IAQf,aAAa,CAAC,IAAI,EAAE,4BAA4B,CAAC,0BAA0B,CAAC;IAuB5E,eAAe,CAAC,IAAI,EAAE,GAAG,GAAG,OAAO;IA8BnC,gBAAgB;IAcV,GAAG;CA2EV"}
package/dist/index.js CHANGED
@@ -33030,8 +33030,12 @@ class EVMSignTypedData extends BaseMethod {
33030
33030
  return false;
33031
33031
  let biggerLimit = 1024;
33032
33032
  const currentVersion = getDeviceFirmwareVersion(this.device.features).join('.');
33033
+ const currentDeviceType = getDeviceType(this.device.features);
33033
33034
  const supportBiggerDataVersion = '4.4.0';
33034
- if (semver__default["default"].gte(currentVersion, supportBiggerDataVersion)) {
33035
+ const supportBiggerData = DeviceModelToTypes.model_classic1s.includes(currentDeviceType) ||
33036
+ (DeviceModelToTypes.model_touch.includes(currentDeviceType) &&
33037
+ semver__default["default"].gte(currentVersion, supportBiggerDataVersion));
33038
+ if (supportBiggerData) {
33035
33039
  biggerLimit = 1536;
33036
33040
  }
33037
33041
  const startIndex = data.startsWith('0x') ? 2 : 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onekeyfe/hd-core",
3
- "version": "1.1.16",
3
+ "version": "1.1.17",
4
4
  "description": "Core processes and APIs for communicating with OneKey hardware devices.",
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": "1.1.16",
29
- "@onekeyfe/hd-transport": "1.1.16",
28
+ "@onekeyfe/hd-shared": "1.1.17",
29
+ "@onekeyfe/hd-transport": "1.1.17",
30
30
  "axios": "1.12.2",
31
31
  "bignumber.js": "^9.0.2",
32
32
  "bytebuffer": "^5.0.1",
@@ -46,5 +46,5 @@
46
46
  "@types/web-bluetooth": "^0.0.21",
47
47
  "ripple-keypairs": "^1.3.1"
48
48
  },
49
- "gitHead": "9c63b9bac888ffc9f14a05c6431a072bd65e41d2"
49
+ "gitHead": "fc9276c5fdefe528e32f463446759ac74065e680"
50
50
  }
@@ -1,7 +1,7 @@
1
1
  import semver from 'semver';
2
2
  import { get } from 'lodash';
3
3
  import BigNumber from 'bignumber.js';
4
- import { ERRORS, HardwareErrorCode, EDeviceType } from '@onekeyfe/hd-shared';
4
+ import { ERRORS, HardwareErrorCode } from '@onekeyfe/hd-shared';
5
5
  import {
6
6
  EthereumTypedDataSignature,
7
7
  EthereumTypedDataStructAck,
@@ -337,9 +337,15 @@ export default class EVMSignTypedData extends BaseMethod<EVMSignTypedDataParams>
337
337
  let biggerLimit = 1024; // 1k
338
338
 
339
339
  const currentVersion = getDeviceFirmwareVersion(this.device.features).join('.');
340
+ const currentDeviceType = getDeviceType(this.device.features);
340
341
  const supportBiggerDataVersion = '4.4.0';
341
342
 
342
- if (semver.gte(currentVersion, supportBiggerDataVersion)) {
343
+ const supportBiggerData =
344
+ DeviceModelToTypes.model_classic1s.includes(currentDeviceType) ||
345
+ (DeviceModelToTypes.model_touch.includes(currentDeviceType) &&
346
+ semver.gte(currentVersion, supportBiggerDataVersion));
347
+
348
+ if (supportBiggerData) {
343
349
  biggerLimit = 1536; // 1.5k
344
350
  }
345
351