@onekeyfe/hd-core 0.2.29 → 0.2.30

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":"DeviceUpdateBootloader.d.ts","sourceRoot":"","sources":["../../../src/api/device/DeviceUpdateBootloader.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6B,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE1E,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAQ3C,MAAM,CAAC,OAAO,OAAO,sBAAuB,SAAQ,UAAU;IAC5D,YAAY,EAAE,QAAQ,CAAC,GAAG,CAAC,GAAG,IAAI,CAAQ;IAE1C,IAAI;IAMJ,cAAc,YAAa,MAAM,UAS/B;IAEI,GAAG;CAqCV"}
1
+ {"version":3,"file":"DeviceUpdateBootloader.d.ts","sourceRoot":"","sources":["../../../src/api/device/DeviceUpdateBootloader.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6B,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE1E,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAQ3C,MAAM,CAAC,OAAO,OAAO,sBAAuB,SAAQ,UAAU;IAC5D,YAAY,EAAE,QAAQ,CAAC,GAAG,CAAC,GAAG,IAAI,CAAQ;IAE1C,IAAI;IAMJ,cAAc,YAAa,MAAM,UAS/B;IAEI,GAAG;CA4BV"}
package/dist/index.d.ts CHANGED
@@ -361,7 +361,7 @@ declare type DeviceFlagsParams = {
361
361
  };
362
362
  declare function deviceFlags(connectId: string, params: CommonParams & DeviceFlagsParams): Response<Success$1>;
363
363
 
364
- declare function deviceUpdateReboot(connectId: string): Response<Success$1>;
364
+ declare function deviceUpdateReboot(connectId: string): Response<boolean>;
365
365
 
366
366
  declare type DeviceUploadResourceParams = {
367
367
  suffix: string;
package/dist/index.js CHANGED
@@ -13493,13 +13493,8 @@ class DeviceUpdateBootloader extends BaseMethod {
13493
13493
  const resource = yield getSysResourceBinary(resourceUrl);
13494
13494
  this.postTipMessage('DownloadLatestBootloaderResourceSuccess');
13495
13495
  if (resource) {
13496
- try {
13497
- yield updateBootloader(this.device.getCommands().typedCall.bind(this.device.getCommands()), this.postMessage, device, resource.binary);
13498
- return yield Promise.resolve(true);
13499
- }
13500
- catch (e) {
13501
- return Promise.reject(hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.RuntimeError, `update bootloader error, err: ${e}`));
13502
- }
13496
+ yield updateBootloader(this.device.getCommands().typedCall.bind(this.device.getCommands()), this.postMessage, device, resource.binary);
13497
+ return Promise.resolve(true);
13503
13498
  }
13504
13499
  }
13505
13500
  }
@@ -1,4 +1,3 @@
1
- import { Success } from '@onekeyfe/hd-transport';
2
1
  import type { Response } from '../params';
3
- export declare function deviceUpdateReboot(connectId: string): Response<Success>;
2
+ export declare function deviceUpdateReboot(connectId: string): Response<boolean>;
4
3
  //# sourceMappingURL=deviceUpdateReboot.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"deviceUpdateReboot.d.ts","sourceRoot":"","sources":["../../../src/types/api/deviceUpdateReboot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAE1C,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC"}
1
+ {"version":3,"file":"deviceUpdateReboot.d.ts","sourceRoot":"","sources":["../../../src/types/api/deviceUpdateReboot.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAE1C,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onekeyfe/hd-core",
3
- "version": "0.2.29",
3
+ "version": "0.2.30",
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.29",
28
- "@onekeyfe/hd-transport": "^0.2.29",
27
+ "@onekeyfe/hd-shared": "^0.2.30",
28
+ "@onekeyfe/hd-transport": "^0.2.30",
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": "fe8cb7c73571d43ef6db56af728ee69ac3fa731e"
45
+ "gitHead": "ef7e66f72ac394b8c4faa35d65a3d3d9f6cd4846"
46
46
  }
@@ -42,22 +42,13 @@ export default class DeviceUpdateBootloader extends BaseMethod {
42
42
  const resource = await getSysResourceBinary(resourceUrl);
43
43
  this.postTipMessage('DownloadLatestBootloaderResourceSuccess');
44
44
  if (resource) {
45
- try {
46
- await updateBootloader(
47
- this.device.getCommands().typedCall.bind(this.device.getCommands()),
48
- this.postMessage,
49
- device,
50
- resource.binary
51
- );
52
- return await Promise.resolve(true);
53
- } catch (e) {
54
- return Promise.reject(
55
- ERRORS.TypedError(
56
- HardwareErrorCode.RuntimeError,
57
- `update bootloader error, err: ${e}`
58
- )
59
- );
60
- }
45
+ await updateBootloader(
46
+ this.device.getCommands().typedCall.bind(this.device.getCommands()),
47
+ this.postMessage,
48
+ device,
49
+ resource.binary
50
+ );
51
+ return Promise.resolve(true);
61
52
  }
62
53
  }
63
54
  }
@@ -1,4 +1,3 @@
1
- import { Success } from '@onekeyfe/hd-transport';
2
1
  import type { Response } from '../params';
3
2
 
4
- export declare function deviceUpdateReboot(connectId: string): Response<Success>;
3
+ export declare function deviceUpdateReboot(connectId: string): Response<boolean>;