@onekeyfe/hd-core 1.0.34-alpha.1 → 1.0.35

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.
Files changed (58) hide show
  1. package/dist/api/GetPassphraseState.d.ts +1 -1
  2. package/dist/api/GetPassphraseState.d.ts.map +1 -1
  3. package/dist/api/allnetwork/AllNetworkGetAddress.d.ts +1 -3
  4. package/dist/api/allnetwork/AllNetworkGetAddress.d.ts.map +1 -1
  5. package/dist/api/btc/BTCGetPublicKey.d.ts.map +1 -1
  6. package/dist/api/btc/helpers/xpubUtils.d.ts +1 -0
  7. package/dist/api/btc/helpers/xpubUtils.d.ts.map +1 -1
  8. package/dist/api/helpers/hexUtils.d.ts +1 -0
  9. package/dist/api/helpers/hexUtils.d.ts.map +1 -1
  10. package/dist/api/index.d.ts +0 -1
  11. package/dist/api/index.d.ts.map +1 -1
  12. package/dist/core/index.d.ts.map +1 -1
  13. package/dist/device/Device.d.ts +3 -9
  14. package/dist/device/Device.d.ts.map +1 -1
  15. package/dist/device/DeviceCommands.d.ts +5 -7
  16. package/dist/device/DeviceCommands.d.ts.map +1 -1
  17. package/dist/events/device.d.ts +0 -3
  18. package/dist/events/device.d.ts.map +1 -1
  19. package/dist/events/ui-request.d.ts +1 -2
  20. package/dist/events/ui-request.d.ts.map +1 -1
  21. package/dist/events/ui-response.d.ts +0 -1
  22. package/dist/events/ui-response.d.ts.map +1 -1
  23. package/dist/index.d.ts +10 -26
  24. package/dist/index.js +97 -219
  25. package/dist/inject.d.ts.map +1 -1
  26. package/dist/types/api/firmwareUpdate.d.ts +1 -1
  27. package/dist/types/api/firmwareUpdate.d.ts.map +1 -1
  28. package/dist/types/api/index.d.ts +0 -2
  29. package/dist/types/api/index.d.ts.map +1 -1
  30. package/dist/utils/deviceFeaturesUtils.d.ts +2 -16
  31. package/dist/utils/deviceFeaturesUtils.d.ts.map +1 -1
  32. package/dist/utils/patch.d.ts +1 -1
  33. package/dist/utils/patch.d.ts.map +1 -1
  34. package/package.json +4 -4
  35. package/src/api/GetPassphraseState.ts +3 -19
  36. package/src/api/allnetwork/AllNetworkGetAddress.ts +20 -18
  37. package/src/api/btc/BTCGetPublicKey.ts +10 -1
  38. package/src/api/btc/helpers/xpubUtils.ts +37 -10
  39. package/src/api/evm/EVMSignTypedData.ts +2 -2
  40. package/src/api/helpers/hexUtils.ts +29 -0
  41. package/src/api/index.ts +0 -1
  42. package/src/core/index.ts +7 -12
  43. package/src/data/messages/messages.json +2 -57
  44. package/src/device/Device.ts +7 -75
  45. package/src/device/DeviceCommands.ts +4 -15
  46. package/src/events/device.ts +0 -4
  47. package/src/events/ui-request.ts +1 -2
  48. package/src/events/ui-response.ts +0 -1
  49. package/src/inject.ts +0 -2
  50. package/src/types/api/firmwareUpdate.ts +1 -1
  51. package/src/types/api/index.ts +0 -2
  52. package/src/utils/deviceFeaturesUtils.ts +7 -71
  53. package/dist/api/device/DeviceUnlock.d.ts +0 -7
  54. package/dist/api/device/DeviceUnlock.d.ts.map +0 -1
  55. package/dist/types/api/deviceUnlock.d.ts +0 -4
  56. package/dist/types/api/deviceUnlock.d.ts.map +0 -1
  57. package/src/api/device/DeviceUnlock.ts +0 -26
  58. package/src/types/api/deviceUnlock.ts +0 -4
@@ -1 +0,0 @@
1
- {"version":3,"file":"DeviceUnlock.d.ts","sourceRoot":"","sources":["../../../src/api/device/DeviceUnlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAG3C,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,UAAU,CAAC,UAAU,CAAC;IAC9D,IAAI;IAIE,GAAG;CAeV"}
@@ -1,4 +0,0 @@
1
- import { Features } from '@onekeyfe/hd-transport';
2
- import type { CommonParams, Response } from '../params';
3
- export declare function deviceUnlock(connectId: string, params?: CommonParams): Response<Features>;
4
- //# sourceMappingURL=deviceUnlock.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"deviceUnlock.d.ts","sourceRoot":"","sources":["../../../src/types/api/deviceUnlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAExD,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,YAAY,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAAC"}
@@ -1,26 +0,0 @@
1
- import { LockDevice } from '@onekeyfe/hd-transport';
2
- import { ERRORS, HardwareErrorCode } from '@onekeyfe/hd-shared';
3
- import { BaseMethod } from '../BaseMethod';
4
- import { toHardened } from '../helpers/pathUtils';
5
-
6
- export default class DeviceUnlock extends BaseMethod<LockDevice> {
7
- init() {
8
- this.useDevicePassphraseState = false;
9
- }
10
-
11
- async run() {
12
- const { type } = await this.device.commands.typedCall('GetAddress', 'Address', {
13
- address_n: [toHardened(44), toHardened(1), toHardened(0), 0, 0],
14
- coin_name: 'Testnet',
15
- script_type: 'SPENDADDRESS',
16
- show_display: false,
17
- });
18
-
19
- // @ts-expect-error
20
- if (type === 'CallMethodError') {
21
- throw ERRORS.TypedError(HardwareErrorCode.RuntimeError, 'Get the passphrase state error');
22
- }
23
- const res = await this.device.commands.typedCall('GetFeatures', 'Features');
24
- return Promise.resolve(res.message);
25
- }
26
- }
@@ -1,4 +0,0 @@
1
- import { Features } from '@onekeyfe/hd-transport';
2
- import type { CommonParams, Response } from '../params';
3
-
4
- export declare function deviceUnlock(connectId: string, params?: CommonParams): Response<Features>;