@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.
- package/dist/api/GetPassphraseState.d.ts +1 -1
- package/dist/api/GetPassphraseState.d.ts.map +1 -1
- package/dist/api/allnetwork/AllNetworkGetAddress.d.ts +1 -3
- package/dist/api/allnetwork/AllNetworkGetAddress.d.ts.map +1 -1
- package/dist/api/btc/BTCGetPublicKey.d.ts.map +1 -1
- package/dist/api/btc/helpers/xpubUtils.d.ts +1 -0
- package/dist/api/btc/helpers/xpubUtils.d.ts.map +1 -1
- package/dist/api/helpers/hexUtils.d.ts +1 -0
- package/dist/api/helpers/hexUtils.d.ts.map +1 -1
- package/dist/api/index.d.ts +0 -1
- package/dist/api/index.d.ts.map +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/device/Device.d.ts +3 -9
- package/dist/device/Device.d.ts.map +1 -1
- package/dist/device/DeviceCommands.d.ts +5 -7
- package/dist/device/DeviceCommands.d.ts.map +1 -1
- package/dist/events/device.d.ts +0 -3
- package/dist/events/device.d.ts.map +1 -1
- package/dist/events/ui-request.d.ts +1 -2
- package/dist/events/ui-request.d.ts.map +1 -1
- package/dist/events/ui-response.d.ts +0 -1
- package/dist/events/ui-response.d.ts.map +1 -1
- package/dist/index.d.ts +10 -26
- package/dist/index.js +97 -219
- package/dist/inject.d.ts.map +1 -1
- package/dist/types/api/firmwareUpdate.d.ts +1 -1
- package/dist/types/api/firmwareUpdate.d.ts.map +1 -1
- package/dist/types/api/index.d.ts +0 -2
- package/dist/types/api/index.d.ts.map +1 -1
- package/dist/utils/deviceFeaturesUtils.d.ts +2 -16
- package/dist/utils/deviceFeaturesUtils.d.ts.map +1 -1
- package/dist/utils/patch.d.ts +1 -1
- package/dist/utils/patch.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/api/GetPassphraseState.ts +3 -19
- package/src/api/allnetwork/AllNetworkGetAddress.ts +20 -18
- package/src/api/btc/BTCGetPublicKey.ts +10 -1
- package/src/api/btc/helpers/xpubUtils.ts +37 -10
- package/src/api/evm/EVMSignTypedData.ts +2 -2
- package/src/api/helpers/hexUtils.ts +29 -0
- package/src/api/index.ts +0 -1
- package/src/core/index.ts +7 -12
- package/src/data/messages/messages.json +2 -57
- package/src/device/Device.ts +7 -75
- package/src/device/DeviceCommands.ts +4 -15
- package/src/events/device.ts +0 -4
- package/src/events/ui-request.ts +1 -2
- package/src/events/ui-response.ts +0 -1
- package/src/inject.ts +0 -2
- package/src/types/api/firmwareUpdate.ts +1 -1
- package/src/types/api/index.ts +0 -2
- package/src/utils/deviceFeaturesUtils.ts +7 -71
- package/dist/api/device/DeviceUnlock.d.ts +0 -7
- package/dist/api/device/DeviceUnlock.d.ts.map +0 -1
- package/dist/types/api/deviceUnlock.d.ts +0 -4
- package/dist/types/api/deviceUnlock.d.ts.map +0 -1
- package/src/api/device/DeviceUnlock.ts +0 -26
- 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 +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
|
-
}
|