@onekeyfe/hd-core 0.3.0 → 0.3.2

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":"BaseMethod.d.ts","sourceRoot":"","sources":["../../src/api/BaseMethod.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,eAAe,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAe,MAAM,UAAU,CAAC;AAC5D,OAAO,EAAE,WAAW,EAA4D,MAAM,WAAW,CAAC;AAMlG,8BAAsB,UAAU,CAAC,MAAM,GAAG,SAAS;IACjD,UAAU,EAAE,MAAM,CAAC;IAGnB,MAAM,EAAE,MAAM,CAAC;IAGf,MAAM,EAAE,MAAM,CAAC;IAOf,SAAS,CAAC,EAAE,MAAM,CAAC;IAKnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,WAAW,CAAC,EAAE,MAAM,CAAC;IAKrB,IAAI,EAAE,MAAM,CAAC;IAKb,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAE7B,SAAS,CAAC,EAAE,eAAe,CAAC;IAK5B,SAAS,EAAE,OAAO,CAAC;IAKnB,kBAAkB,EAAE,MAAM,EAAE,CAAC;IAK7B,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAK5B,qBAAqB,UAAQ;IAK7B,aAAa,UAAS;IAKtB,wBAAwB,UAAQ;IAMhC,oBAAoB,UAAS;IAG7B,WAAW,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;gBAEhC,OAAO,EAAE;QAAE,EAAE,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,GAAG,CAAA;KAAE;IAYlD,QAAQ,CAAC,IAAI,IAAI,IAAI;IAErB,QAAQ,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC;IAE5B,eA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AYlD,QAAQ,CAAC,IAAI,IAAI,IAAI;IAErB,QAAQ,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC;IAE5B,eAAe,IAAI,mBAAmB;IAItC,SAAS,CAAC,MAAM,EAAE,MAAM;IAKxB,oBAAoB;IAkBpB,yBAAyB;IAiBnB,yBAAyB;IAgB/B,OAAO;IAGP,0BAA0B,SAAU;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,UAOrE;CACH"}
package/dist/index.js CHANGED
@@ -47,7 +47,7 @@ const createCoreApi = (call) => ({
47
47
  checkBLEFirmwareRelease: connectId => call({ connectId, method: 'checkBLEFirmwareRelease' }),
48
48
  checkTransportRelease: () => call({ method: 'checkTransportRelease' }),
49
49
  checkBridgeStatus: () => call({ method: 'checkBridgeStatus' }),
50
- checkBootloaderRelease: connectId => call({ connectId, method: 'checkBootloaderRelease' }),
50
+ checkBootloaderRelease: (connectId, params) => call(Object.assign(Object.assign({}, params), { connectId, method: 'checkBootloaderRelease' })),
51
51
  cipherKeyValue: (connectId, deviceId, params) => call(Object.assign(Object.assign({}, params), { connectId, deviceId, method: 'cipherKeyValue' })),
52
52
  deviceBackup: connectId => call({ connectId, method: 'deviceBackup' }),
53
53
  deviceChangePin: (connectId, params) => call(Object.assign(Object.assign({}, params), { connectId, method: 'deviceChangePin' })),
@@ -950,7 +950,7 @@ const getFirmwareUpdateField = (features, updateType) => {
950
950
  if (updateType === 'ble') {
951
951
  return 'ble';
952
952
  }
953
- if (deviceType === 'classic') {
953
+ if (deviceType === 'classic' || deviceType === 'mini') {
954
954
  return 'firmware-v2';
955
955
  }
956
956
  if (deviceType === 'touch') {
@@ -11030,7 +11030,7 @@ function checkNeedUpdateBootForTouch(features) {
11030
11030
  }
11031
11031
  function checkNeedUpdateBootForClassicAndMini(features, willUpdateFirmware) {
11032
11032
  const deviceType = getDeviceType(features);
11033
- if (deviceType !== 'classic')
11033
+ if (deviceType !== 'classic' && deviceType !== 'mini')
11034
11034
  return false;
11035
11035
  if (!willUpdateFirmware)
11036
11036
  return false;
@@ -13019,7 +13019,7 @@ class CheckBootloaderRelease extends BaseMethod {
13019
13019
  const { features } = this.device;
13020
13020
  const deviceType = getDeviceType(features);
13021
13021
  let shouldUpdate = false;
13022
- if (deviceType === 'classic') {
13022
+ if (deviceType === 'classic' || deviceType === 'mini') {
13023
13023
  shouldUpdate = !!checkNeedUpdateBootForClassicAndMini(features, this.payload.willUpdateFirmwareVersion);
13024
13024
  }
13025
13025
  else if (deviceType === 'touch') {
@@ -1 +1 @@
1
- {"version":3,"file":"inject.d.ts","sourceRoot":"","sources":["../src/inject.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,UAAU,CAAC;IACjB,YAAY,EAAE,YAAY,CAAC;IAC3B,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IACtB,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAC5B,UAAU,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IAClC,MAAM,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;CAC3B;AAED,eAAO,MAAM,MAAM,+DAOhB,SAAS,KAAG,OA6Bd,CAAC;AAEF,eAAO,MAAM,aAAa,SAClB,OAAO,CAAC,MAAM,CAAC,KACpB,KACD,OAAO,EACL,IAAI,GACJ,KAAK,GACL,MAAM,GACN,oBAAoB,GACpB,MAAM,GACN,MAAM,GACN,SAAS,GACT,YAAY,GACZ,QAAQ,CA+LV,CAAC"}
1
+ {"version":3,"file":"inject.d.ts","sourceRoot":"","sources":["../src/inject.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,UAAU,CAAC;IACjB,YAAY,EAAE,YAAY,CAAC;IAC3B,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IACtB,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAC5B,UAAU,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IAClC,MAAM,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;CAC3B;AAED,eAAO,MAAM,MAAM,+DAOhB,SAAS,KAAG,OA6Bd,CAAC;AAEF,eAAO,MAAM,aAAa,SAClB,OAAO,CAAC,MAAM,CAAC,KACpB,KACD,OAAO,EACL,IAAI,GACJ,KAAK,GACL,MAAM,GACN,oBAAoB,GACpB,MAAM,GACN,MAAM,GACN,SAAS,GACT,YAAY,GACZ,QAAQ,CAgMV,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onekeyfe/hd-core",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
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.3.0",
28
- "@onekeyfe/hd-transport": "^0.3.0",
27
+ "@onekeyfe/hd-shared": "^0.3.2",
28
+ "@onekeyfe/hd-transport": "^0.3.2",
29
29
  "axios": "^0.27.2",
30
30
  "bignumber.js": "^9.0.2",
31
31
  "bytebuffer": "^5.0.1",
@@ -43,5 +43,5 @@
43
43
  "@types/semver": "^7.3.9",
44
44
  "ripple-keypairs": "^1.1.4"
45
45
  },
46
- "gitHead": "41ef1a55f5e420e4ca997a2d14052d4132681bf9"
46
+ "gitHead": "3bad01980ef1ebb134dc5b276d7d0d21e8abb7cd"
47
47
  }
@@ -1,8 +1,4 @@
1
- import {
2
- supportInputPinOnSoftware,
3
- supportModifyHomescreen,
4
- getDeviceType,
5
- } from '../utils/deviceFeaturesUtils';
1
+ import { supportInputPinOnSoftware, supportModifyHomescreen } from '../utils/deviceFeaturesUtils';
6
2
  import { createDeviceMessage } from '../events/device';
7
3
  import { UI_REQUEST } from '../constants/ui-request';
8
4
  import { Device } from '../device/Device';
@@ -23,7 +23,7 @@ export default class CheckBootloaderRelease extends BaseMethod {
23
23
  const { features } = this.device;
24
24
  const deviceType = getDeviceType(features);
25
25
  let shouldUpdate = false;
26
- if (deviceType === 'classic') {
26
+ if (deviceType === 'classic' || deviceType === 'mini') {
27
27
  shouldUpdate = !!checkNeedUpdateBootForClassicAndMini(
28
28
  features,
29
29
  this.payload.willUpdateFirmwareVersion
@@ -31,7 +31,7 @@ export function checkNeedUpdateBootForClassicAndMini(
31
31
  willUpdateFirmware: string
32
32
  ) {
33
33
  const deviceType = getDeviceType(features);
34
- if (deviceType !== 'classic') return false;
34
+ if (deviceType !== 'classic' && deviceType !== 'mini') return false;
35
35
  if (!willUpdateFirmware) return false;
36
36
  const currentVersion = getDeviceFirmwareVersion(features).join('.');
37
37
  const bootloaderVersion = getDeviceBootloaderVersion(features).join('.');
package/src/inject.ts CHANGED
@@ -94,7 +94,8 @@ export const createCoreApi = (
94
94
  */
95
95
  checkBridgeStatus: () => call({ method: 'checkBridgeStatus' }),
96
96
 
97
- checkBootloaderRelease: connectId => call({ connectId, method: 'checkBootloaderRelease' }),
97
+ checkBootloaderRelease: (connectId, params) =>
98
+ call({ ...params, connectId, method: 'checkBootloaderRelease' }),
98
99
 
99
100
  cipherKeyValue: (connectId, deviceId, params) =>
100
101
  call({ ...params, connectId, deviceId, method: 'cipherKeyValue' }),
@@ -184,7 +184,7 @@ export const getFirmwareUpdateField = (features: Features, updateType: 'firmware
184
184
  return 'ble';
185
185
  }
186
186
 
187
- if (deviceType === 'classic') {
187
+ if (deviceType === 'classic' || deviceType === 'mini') {
188
188
  return 'firmware-v2';
189
189
  }
190
190