@onekeyfe/hd-core 0.2.51 → 0.2.52

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":"FirmwareUpdateV2.d.ts","sourceRoot":"","sources":["../../src/api/FirmwareUpdateV2.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EAIT,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAO1C,OAAO,KAAK,EAAe,QAAQ,EAAE,MAAM,UAAU,CAAC;AAItD,aAAK,MAAM,GAAG;IACZ,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,UAAU,EAAE,UAAU,GAAG,KAAK,CAAC;IAC/B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,kBAAkB,CAAC,EAAE,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;CAkGV"}
1
+ {"version":3,"file":"FirmwareUpdateV2.d.ts","sourceRoot":"","sources":["../../src/api/FirmwareUpdateV2.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EAIT,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAO1C,OAAO,KAAK,EAAe,QAAQ,EAAE,MAAM,UAAU,CAAC;AAItD,aAAK,MAAM,GAAG;IACZ,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,UAAU,EAAE,UAAU,GAAG,KAAK,CAAC;IAC/B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,kBAAkB,CAAC,EAAE,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;CAsGV"}
package/dist/index.d.ts CHANGED
@@ -177,6 +177,7 @@ declare type IBLEFirmwareReleaseInfo = {
177
177
  declare type DeviceTypeMap = {
178
178
  [k in IDeviceType]: {
179
179
  firmware: IFirmwareReleaseInfo[];
180
+ 'firmware-v2'?: IFirmwareReleaseInfo[];
180
181
  'firmware-v3'?: IFirmwareReleaseInfo[];
181
182
  ble: IBLEFirmwareReleaseInfo[];
182
183
  };
@@ -2148,7 +2149,7 @@ declare const getDeviceTypeByDeviceId: (deviceId?: string | undefined) => IDevic
2148
2149
  declare const getDeviceUUID: (features: Features) => string;
2149
2150
  declare const getDeviceLabel: (features: Features) => string;
2150
2151
  declare const supportInputPinOnSoftware: (features: Features) => SupportFeatureType;
2151
- declare const getFirmwareUpdateField: (features: Features, updateType: 'firmware' | 'ble') => "firmware" | "ble" | "firmware-v3";
2152
+ declare const getFirmwareUpdateField: (features: Features, updateType: 'firmware' | 'ble') => "firmware" | "ble" | "firmware-v2" | "firmware-v3";
2152
2153
 
2153
2154
  declare const getHDPath: (path: string) => Array<number>;
2154
2155
  declare const getScriptType: (path: Array<number>) => InputScriptType;
package/dist/index.js CHANGED
@@ -914,6 +914,9 @@ const getFirmwareUpdateField = (features, updateType) => {
914
914
  if (updateType === 'ble') {
915
915
  return 'ble';
916
916
  }
917
+ if (deviceType === 'classic') {
918
+ return 'firmware-v2';
919
+ }
917
920
  if (deviceType === 'touch') {
918
921
  if (semver__default["default"].lt(deviceFirmwareVersion.join('.'), '3.4.0'))
919
922
  return 'firmware';
@@ -11807,7 +11810,6 @@ class DevicePool extends events.exports {
11807
11810
  var descriptorList_1, descriptorList_1_1;
11808
11811
  var e_1, _a;
11809
11812
  return __awaiter(this, void 0, void 0, function* () {
11810
- Log$8.debug('get device list: connectId: ', connectId);
11811
11813
  const devices = {};
11812
11814
  const deviceList = [];
11813
11815
  if (connectId) {
@@ -11815,7 +11817,6 @@ class DevicePool extends events.exports {
11815
11817
  if (device) {
11816
11818
  const exist = descriptorList.find(d => d.path === device.originalDescriptor.path);
11817
11819
  if (exist) {
11818
- Log$8.debug('find existed Device: ', connectId);
11819
11820
  device.updateDescriptor(exist, true);
11820
11821
  devices[connectId] = device;
11821
11822
  deviceList.push(device);
@@ -11848,15 +11849,11 @@ class DevicePool extends events.exports {
11848
11849
  }
11849
11850
  finally { if (e_1) throw e_1.error; }
11850
11851
  }
11851
- console.log('device poll -> connected: ', this.connectedPool);
11852
- console.log('device poll -> disconnected: ', this.disconnectPool);
11853
11852
  yield this._checkDevicePool(initOptions);
11854
11853
  return { devices, deviceList };
11855
11854
  });
11856
11855
  }
11857
11856
  static clearDeviceCache(connectId) {
11858
- Log$8.debug('clear device pool cache: connectId', connectId);
11859
- Log$8.debug('clear device pool cache: ', this.devicesCache);
11860
11857
  if (connectId) {
11861
11858
  delete this.devicesCache[connectId];
11862
11859
  }
@@ -13981,7 +13978,10 @@ class FirmwareUpdateV2 extends BaseMethod {
13981
13978
  }
13982
13979
  try {
13983
13980
  this.postTipMessage('AutoRebootToBootloader');
13984
- yield commands.typedCall('DeviceBackToBoot', 'Success');
13981
+ const bootRes = yield commands.typedCall('DeviceBackToBoot', 'Success');
13982
+ if (bootRes.type === 'CallMethodError') {
13983
+ throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.FirmwareUpdateAutoEnterBootFailure);
13984
+ }
13985
13985
  this.postTipMessage('GoToBootloaderSuccess');
13986
13986
  this.checkDeviceToBootloader(this.payload.connectId);
13987
13987
  if (deviceType === 'classic') {
@@ -51,6 +51,7 @@ export declare type IBLEFirmwareReleaseInfo = {
51
51
  export declare type DeviceTypeMap = {
52
52
  [k in IDeviceType]: {
53
53
  firmware: IFirmwareReleaseInfo[];
54
+ 'firmware-v2'?: IFirmwareReleaseInfo[];
54
55
  'firmware-v3'?: IFirmwareReleaseInfo[];
55
56
  ble: IBLEFirmwareReleaseInfo[];
56
57
  };
@@ -1 +1 @@
1
- {"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../src/types/settings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5C,oBAAY,eAAe,GAAG;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,OAAO,CAAC;IACrB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,GAAG,EAAE,MAAM,GAAG,KAA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,GAAG,EAAE,uBAAuB,EAAE,CAAC;KAChC;CACF,CAAC;AAEF,oBAAY,SAAS,GAAG;IACtB,MAAM,EAAE;QACN,OAAO,EAAE,aAAa,CAAC;QACvB,UAAU,EAAE,MAAM,CAAC;QACnB,UAAU,EAAE,MAAM,CAAC;QACnB,UAAU,EAAE,MAAM,CAAC;QACnB,UAAU,EAAE,MAAM,CAAC;QACnB,GAAG,EAAE,MAAM,CAAC;QACZ,GAAG,EAAE,MAAM,CAAC;QACZ,YAAY,EAAE,MAAM,CAAC;QACrB,SAAS,EAAE;aACR,CAAC,IAAI,OAAO,GAAG,MAAM;SACvB,CAAC;KACH,CAAC;CACH,CAAC;AAEF,oBAAY,oBAAoB,GAAG;IACjC,MAAM,EAAE,SAAS,CAAC,QAAQ,CAAC,CAAC;CAC7B,GAAG,aAAa,CAAC"}
@@ -15,5 +15,5 @@ export declare const supportNewPassphrase: (features?: import("packages/hd-trans
15
15
  export declare const getPassphraseState: (features: Features, commands: DeviceCommands) => Promise<string | false>;
16
16
  export declare const supportBatchPublicKey: (features?: import("packages/hd-transport/dist").Features | undefined) => boolean;
17
17
  export declare const supportModifyHomescreen: (features?: import("packages/hd-transport/dist").Features | undefined) => SupportFeatureType;
18
- export declare const getFirmwareUpdateField: (features: Features, updateType: 'firmware' | 'ble') => "firmware" | "ble" | "firmware-v3";
18
+ export declare const getFirmwareUpdateField: (features: Features, updateType: 'firmware' | 'ble') => "firmware" | "ble" | "firmware-v2" | "firmware-v3";
19
19
  //# sourceMappingURL=deviceFeaturesUtils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"deviceFeaturesUtils.d.ts","sourceRoot":"","sources":["../../src/utils/deviceFeaturesUtils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,KAAK,EACV,QAAQ,EACR,aAAa,EACb,WAAW,EACX,YAAY,EACZ,kBAAkB,EACnB,MAAM,UAAU,CAAC;AAElB,e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,eAAO,MAAM,yBAAyB,4EAA0B,WACvC,CAAC;AAE1B,eAAO,MAAM,sBAAsB,iCAAoB,WAAW,GAAG,IAKpE,CAAC;AAEF,eAAO,MAAM,uBAAuB,qCAAwB,WAQ3D,CAAC;AAEF,eAAO,MAAM,aAAa,aAAc,QAAQ,WAM/C,CAAC;AAEF,eAAO,MAAM,cAAc,aAAc,QAAQ,WAOhD,CAAC;AAKF,eAAO,MAAM,wBAAwB,aAAc,QAAQ,GAAG,SAAS,kBAOtE,CAAC;AAKF,eAAO,MAAM,2BAA2B,aAAc,QAAQ,KAAG,aAAa,GAAG,IAQhF,CAAC;AAEF,eAAO,MAAM,0BAA0B,aAAc,QAAQ,kBAY5D,CAAC;AAEF,eAAO,MAAM,yBAAyB,aAAc,QAAQ,KAAG,kBAU9D,CAAC;AAEF,eAAO,MAAM,oBAAoB,4EAA0B,kBAW1D,CAAC;AAEF,eAAO,MAAM,kBAAkB,aAAoB,QAAQ,YAAY,cAAc,4BAUpF,CAAC;AAEF,eAAO,MAAM,qBAAqB,4EAA0B,OAU3D,CAAC;AAEF,eAAO,MAAM,uBAAuB,4EAA0B,kBAU7D,CAAC;AAKF,eAAO,MAAM,sBAAsB,aAAc,QAAQ,cAAc,UAAU,GAAG,KAAK,uDAgBxF,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onekeyfe/hd-core",
3
- "version": "0.2.51",
3
+ "version": "0.2.52",
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.51",
28
- "@onekeyfe/hd-transport": "^0.2.51",
27
+ "@onekeyfe/hd-shared": "^0.2.52",
28
+ "@onekeyfe/hd-transport": "^0.2.52",
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": "38873db4d18b60e2a330e26deb155210860b9e54"
46
+ "gitHead": "a19c24024d7a51271cc02da3681b04f274d641c5"
47
47
  }
@@ -226,7 +226,11 @@ export default class FirmwareUpdateV2 extends BaseMethod<Params> {
226
226
  // auto go to bootloader mode
227
227
  try {
228
228
  this.postTipMessage('AutoRebootToBootloader');
229
- await commands.typedCall('DeviceBackToBoot', 'Success');
229
+ const bootRes = await commands.typedCall('DeviceBackToBoot', 'Success');
230
+ // @ts-expect-error
231
+ if (bootRes.type === 'CallMethodError') {
232
+ throw ERRORS.TypedError(HardwareErrorCode.FirmwareUpdateAutoEnterBootFailure);
233
+ }
230
234
  this.postTipMessage('GoToBootloaderSuccess');
231
235
  this.checkDeviceToBootloader(this.payload.connectId);
232
236
 
@@ -22,7 +22,7 @@ import type {
22
22
  } from '../types';
23
23
  import { getReleaseChangelog, getReleaseStatus, findLatestRelease } from '../utils/release';
24
24
 
25
- type FirmwareField = 'firmware' | 'firmware-v3';
25
+ type FirmwareField = 'firmware' | 'firmware-v2' | 'firmware-v3';
26
26
 
27
27
  export default class DataManager {
28
28
  static deviceMap: DeviceTypeMap = {
@@ -89,7 +89,7 @@ export class DevicePool extends EventEmitter {
89
89
  connectId?: string,
90
90
  initOptions?: InitOptions
91
91
  ) {
92
- Log.debug('get device list: connectId: ', connectId);
92
+ // Log.debug('get device list: connectId: ', connectId);
93
93
 
94
94
  const devices: Record<string, Device> = {};
95
95
  const deviceList = [];
@@ -101,7 +101,7 @@ export class DevicePool extends EventEmitter {
101
101
  if (device) {
102
102
  const exist = descriptorList.find(d => d.path === device.originalDescriptor.path);
103
103
  if (exist) {
104
- Log.debug('find existed Device: ', connectId);
104
+ // Log.debug('find existed Device: ', connectId);
105
105
  device.updateDescriptor(exist, true);
106
106
  devices[connectId] = device;
107
107
  deviceList.push(device);
@@ -128,15 +128,15 @@ export class DevicePool extends EventEmitter {
128
128
  deviceList.push(device);
129
129
  }
130
130
  // Log.debug('get devices result : ', devices, deviceList);
131
- console.log('device poll -> connected: ', this.connectedPool);
132
- console.log('device poll -> disconnected: ', this.disconnectPool);
131
+ // console.log('device poll -> connected: ', this.connectedPool);
132
+ // console.log('device poll -> disconnected: ', this.disconnectPool);
133
133
  await this._checkDevicePool(initOptions);
134
134
  return { devices, deviceList };
135
135
  }
136
136
 
137
137
  static clearDeviceCache(connectId?: string) {
138
- Log.debug('clear device pool cache: connectId', connectId);
139
- Log.debug('clear device pool cache: ', this.devicesCache);
138
+ // Log.debug('clear device pool cache: connectId', connectId);
139
+ // Log.debug('clear device pool cache: ', this.devicesCache);
140
140
  if (connectId) {
141
141
  delete this.devicesCache[connectId];
142
142
  }
@@ -64,6 +64,7 @@ export type IBLEFirmwareReleaseInfo = {
64
64
  export type DeviceTypeMap = {
65
65
  [k in IDeviceType]: {
66
66
  firmware: IFirmwareReleaseInfo[];
67
+ 'firmware-v2'?: IFirmwareReleaseInfo[];
67
68
  'firmware-v3'?: IFirmwareReleaseInfo[];
68
69
  ble: IBLEFirmwareReleaseInfo[];
69
70
  };
@@ -180,6 +180,10 @@ export const getFirmwareUpdateField = (features: Features, updateType: 'firmware
180
180
  return 'ble';
181
181
  }
182
182
 
183
+ if (deviceType === 'classic') {
184
+ return 'firmware-v2';
185
+ }
186
+
183
187
  if (deviceType === 'touch') {
184
188
  if (semver.lt(deviceFirmwareVersion.join('.'), '3.4.0')) return 'firmware';
185
189
  return 'firmware-v3';