@onekeyfe/hd-core 0.1.8 → 0.1.9
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/CipherKeyValue.d.ts +1 -1
- package/dist/api/CipherKeyValue.d.ts.map +1 -1
- package/dist/api/FirmwareUpdate.d.ts +1 -3
- package/dist/api/FirmwareUpdate.d.ts.map +1 -1
- package/dist/api/GetFeatures.d.ts +1 -47
- package/dist/api/GetFeatures.d.ts.map +1 -1
- package/dist/api/btc/BTCGetAddress.d.ts +1 -1
- package/dist/api/btc/BTCGetAddress.d.ts.map +1 -1
- package/dist/api/btc/BTCGetPublicKey.d.ts +1 -1
- package/dist/api/btc/BTCGetPublicKey.d.ts.map +1 -1
- package/dist/api/btc/BTCSignMessage.d.ts +2 -5
- package/dist/api/btc/BTCSignMessage.d.ts.map +1 -1
- package/dist/api/btc/BTCSignTransaction.d.ts +1 -1
- package/dist/api/btc/BTCSignTransaction.d.ts.map +1 -1
- package/dist/api/btc/BTCVerifyMessage.d.ts +2 -4
- package/dist/api/btc/BTCVerifyMessage.d.ts.map +1 -1
- package/dist/api/btc/helpers/signtx.d.ts +1 -1
- package/dist/api/btc/helpers/signtx.d.ts.map +1 -1
- package/dist/api/btc/helpers/signtxLegacy.d.ts +1 -1
- package/dist/api/btc/helpers/signtxLegacy.d.ts.map +1 -1
- package/dist/api/device/DeviceBackup.d.ts +2 -4
- package/dist/api/device/DeviceBackup.d.ts.map +1 -1
- package/dist/api/device/DeviceChangePin.d.ts +2 -4
- package/dist/api/device/DeviceChangePin.d.ts.map +1 -1
- package/dist/api/device/DeviceFlags.d.ts +2 -4
- package/dist/api/device/DeviceFlags.d.ts.map +1 -1
- package/dist/api/device/DeviceRebootToBootloader.d.ts +2 -4
- package/dist/api/device/DeviceRebootToBootloader.d.ts.map +1 -1
- package/dist/api/device/DeviceRecovery.d.ts +2 -4
- package/dist/api/device/DeviceRecovery.d.ts.map +1 -1
- package/dist/api/device/DeviceReset.d.ts +2 -4
- package/dist/api/device/DeviceReset.d.ts.map +1 -1
- package/dist/api/device/DeviceSettings.d.ts +2 -4
- package/dist/api/device/DeviceSettings.d.ts.map +1 -1
- package/dist/api/device/DeviceUpdateReboot.d.ts +2 -4
- package/dist/api/device/DeviceUpdateReboot.d.ts.map +1 -1
- package/dist/api/device/DeviceVerify.d.ts +8 -0
- package/dist/api/device/DeviceVerify.d.ts.map +1 -0
- package/dist/api/device/DeviceWipe.d.ts +2 -4
- package/dist/api/device/DeviceWipe.d.ts.map +1 -1
- package/dist/api/evm/EVMGetAddress.d.ts +1 -1
- package/dist/api/evm/EVMGetAddress.d.ts.map +1 -1
- package/dist/api/evm/EVMGetPublicKey.d.ts +1 -1
- package/dist/api/evm/EVMGetPublicKey.d.ts.map +1 -1
- package/dist/api/evm/EVMSignMessage.d.ts +2 -5
- package/dist/api/evm/EVMSignMessage.d.ts.map +1 -1
- package/dist/api/evm/EVMSignMessageEIP712.d.ts +2 -5
- package/dist/api/evm/EVMSignMessageEIP712.d.ts.map +1 -1
- package/dist/api/evm/EVMSignTransaction.d.ts +1 -1
- package/dist/api/evm/EVMSignTransaction.d.ts.map +1 -1
- package/dist/api/evm/EVMSignTypedData.d.ts +6 -5
- package/dist/api/evm/EVMSignTypedData.d.ts.map +1 -1
- package/dist/api/evm/EVMVerifyMessage.d.ts +2 -4
- package/dist/api/evm/EVMVerifyMessage.d.ts.map +1 -1
- package/dist/api/firmware/uploadFirmware.d.ts +1 -3
- package/dist/api/firmware/uploadFirmware.d.ts.map +1 -1
- package/dist/api/helpers/pathUtils.d.ts +1 -1
- package/dist/api/helpers/pathUtils.d.ts.map +1 -1
- package/dist/api/helpers/typeNameUtils.d.ts +1 -1
- package/dist/api/helpers/typeNameUtils.d.ts.map +1 -1
- package/dist/api/index.d.ts +1 -0
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/nem/NEMGetAddress.d.ts +1 -1
- package/dist/api/nem/NEMGetAddress.d.ts.map +1 -1
- package/dist/api/nem/NEMSignTransaction.d.ts +1 -1
- package/dist/api/nem/NEMSignTransaction.d.ts.map +1 -1
- package/dist/api/solana/SolGetAddress.d.ts +1 -1
- package/dist/api/solana/SolGetAddress.d.ts.map +1 -1
- package/dist/api/solana/SolSignTransaction.d.ts +1 -1
- package/dist/api/solana/SolSignTransaction.d.ts.map +1 -1
- package/dist/api/starcoin/StarcoinGetAddress.d.ts +1 -1
- package/dist/api/starcoin/StarcoinGetAddress.d.ts.map +1 -1
- package/dist/api/starcoin/StarcoinGetPublicKey.d.ts +1 -1
- package/dist/api/starcoin/StarcoinGetPublicKey.d.ts.map +1 -1
- package/dist/api/starcoin/StarcoinSignMessage.d.ts +2 -5
- package/dist/api/starcoin/StarcoinSignMessage.d.ts.map +1 -1
- package/dist/api/starcoin/StarcoinSignTransaction.d.ts +2 -5
- package/dist/api/starcoin/StarcoinSignTransaction.d.ts.map +1 -1
- package/dist/api/starcoin/StarcoinVerifyMessage.d.ts +2 -4
- package/dist/api/starcoin/StarcoinVerifyMessage.d.ts.map +1 -1
- package/dist/api/stellar/StellarGetAddress.d.ts +1 -1
- package/dist/api/stellar/StellarGetAddress.d.ts.map +1 -1
- package/dist/api/stellar/StellarSignTransaction.d.ts +1 -1
- package/dist/api/stellar/StellarSignTransaction.d.ts.map +1 -1
- package/dist/device/Device.d.ts.map +1 -1
- package/dist/index.d.ts +14 -50
- package/dist/index.js +240 -2
- package/dist/inject.d.ts.map +1 -1
- package/dist/types/api/btcGetAddress.d.ts +1 -1
- package/dist/types/api/btcGetAddress.d.ts.map +1 -1
- package/dist/types/api/btcGetPublicKey.d.ts +1 -1
- package/dist/types/api/btcGetPublicKey.d.ts.map +1 -1
- package/dist/types/api/btcSignMessage.d.ts +1 -1
- package/dist/types/api/btcSignMessage.d.ts.map +1 -1
- package/dist/types/api/btcSignTransaction.d.ts +1 -1
- package/dist/types/api/btcSignTransaction.d.ts.map +1 -1
- package/dist/types/api/btcVerifyMessage.d.ts +1 -1
- package/dist/types/api/btcVerifyMessage.d.ts.map +1 -1
- package/dist/types/api/cipherKeyValue.d.ts +1 -1
- package/dist/types/api/cipherKeyValue.d.ts.map +1 -1
- package/dist/types/api/deviceBackup.d.ts +1 -1
- package/dist/types/api/deviceBackup.d.ts.map +1 -1
- package/dist/types/api/deviceChangePin.d.ts +1 -1
- package/dist/types/api/deviceChangePin.d.ts.map +1 -1
- package/dist/types/api/deviceFlags.d.ts +1 -1
- package/dist/types/api/deviceFlags.d.ts.map +1 -1
- package/dist/types/api/deviceRebootToBootloader.d.ts +1 -1
- package/dist/types/api/deviceRebootToBootloader.d.ts.map +1 -1
- package/dist/types/api/deviceRecovery.d.ts +1 -1
- package/dist/types/api/deviceRecovery.d.ts.map +1 -1
- package/dist/types/api/deviceReset.d.ts +1 -1
- package/dist/types/api/deviceReset.d.ts.map +1 -1
- package/dist/types/api/deviceSettings.d.ts +1 -1
- package/dist/types/api/deviceSettings.d.ts.map +1 -1
- package/dist/types/api/deviceUpdateReboot.d.ts +1 -1
- package/dist/types/api/deviceUpdateReboot.d.ts.map +1 -1
- package/dist/types/api/deviceVerify.d.ts +11 -0
- package/dist/types/api/deviceVerify.d.ts.map +1 -0
- package/dist/types/api/deviceWipe.d.ts +1 -1
- package/dist/types/api/deviceWipe.d.ts.map +1 -1
- package/dist/types/api/evmGetPublicKey.d.ts +1 -1
- package/dist/types/api/evmGetPublicKey.d.ts.map +1 -1
- package/dist/types/api/evmSignMessage.d.ts +1 -1
- package/dist/types/api/evmSignMessage.d.ts.map +1 -1
- package/dist/types/api/evmSignMessageEIP712.d.ts +1 -1
- package/dist/types/api/evmSignMessageEIP712.d.ts.map +1 -1
- package/dist/types/api/evmSignTypedData.d.ts +1 -1
- package/dist/types/api/evmSignTypedData.d.ts.map +1 -1
- package/dist/types/api/evmVerifyMessage.d.ts +1 -1
- package/dist/types/api/evmVerifyMessage.d.ts.map +1 -1
- package/dist/types/api/export.d.ts +1 -0
- package/dist/types/api/export.d.ts.map +1 -1
- package/dist/types/api/index.d.ts +2 -0
- package/dist/types/api/index.d.ts.map +1 -1
- package/dist/types/api/nemGetAddress.d.ts +1 -1
- package/dist/types/api/nemGetAddress.d.ts.map +1 -1
- package/dist/types/api/nemSignTransaction.d.ts +1 -1
- package/dist/types/api/nemSignTransaction.d.ts.map +1 -1
- package/dist/types/api/solGetAddress.d.ts +1 -1
- package/dist/types/api/solGetAddress.d.ts.map +1 -1
- package/dist/types/api/solSignTransaction.d.ts +1 -1
- package/dist/types/api/solSignTransaction.d.ts.map +1 -1
- package/dist/types/api/starcoinGetAddress.d.ts +1 -1
- package/dist/types/api/starcoinGetAddress.d.ts.map +1 -1
- package/dist/types/api/starcoinGetPublicKey.d.ts +1 -1
- package/dist/types/api/starcoinGetPublicKey.d.ts.map +1 -1
- package/dist/types/api/starcoinSignMessage.d.ts +1 -1
- package/dist/types/api/starcoinSignMessage.d.ts.map +1 -1
- package/dist/types/api/starcoinSignTransaction.d.ts +1 -1
- package/dist/types/api/starcoinSignTransaction.d.ts.map +1 -1
- package/dist/types/api/starcoinVerifyMessage.d.ts +1 -1
- package/dist/types/api/starcoinVerifyMessage.d.ts.map +1 -1
- package/dist/types/api/stellarGetAddress.d.ts +1 -1
- package/dist/types/api/stellarGetAddress.d.ts.map +1 -1
- package/dist/types/api/stellarSignTransaction.d.ts +1 -1
- package/dist/types/api/stellarSignTransaction.d.ts.map +1 -1
- package/dist/utils/deviceFeaturesUtils.d.ts +3 -94
- package/dist/utils/deviceFeaturesUtils.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/api/CipherKeyValue.ts +1 -1
- package/src/api/btc/BTCGetAddress.ts +1 -1
- package/src/api/btc/BTCGetPublicKey.ts +1 -1
- package/src/api/btc/BTCSignMessage.ts +1 -1
- package/src/api/btc/BTCSignTransaction.ts +1 -1
- package/src/api/btc/BTCVerifyMessage.ts +1 -1
- package/src/api/btc/helpers/signtx.ts +1 -1
- package/src/api/btc/helpers/signtxLegacy.ts +1 -1
- package/src/api/device/DeviceBackup.ts +1 -1
- package/src/api/device/DeviceChangePin.ts +1 -1
- package/src/api/device/DeviceFlags.ts +1 -1
- package/src/api/device/DeviceRebootToBootloader.ts +1 -1
- package/src/api/device/DeviceRecovery.ts +1 -1
- package/src/api/device/DeviceReset.ts +1 -1
- package/src/api/device/DeviceSettings.ts +1 -1
- package/src/api/device/DeviceUpdateReboot.ts +1 -1
- package/src/api/device/DeviceVerify.ts +55 -0
- package/src/api/device/DeviceWipe.ts +1 -1
- package/src/api/evm/EVMGetAddress.ts +1 -1
- package/src/api/evm/EVMGetPublicKey.ts +1 -1
- package/src/api/evm/EVMSignMessage.ts +1 -1
- package/src/api/evm/EVMSignMessageEIP712.ts +1 -1
- package/src/api/evm/EVMSignTransaction.ts +1 -5
- package/src/api/evm/EVMSignTypedData.ts +119 -124
- package/src/api/evm/EVMVerifyMessage.ts +1 -1
- package/src/api/helpers/pathUtils.ts +1 -1
- package/src/api/helpers/typeNameUtils.ts +1 -1
- package/src/api/index.ts +1 -0
- package/src/api/nem/NEMGetAddress.ts +1 -1
- package/src/api/nem/NEMSignTransaction.ts +1 -1
- package/src/api/solana/SolGetAddress.ts +3 -1
- package/src/api/solana/SolSignTransaction.ts +3 -1
- package/src/api/starcoin/StarcoinGetAddress.ts +1 -1
- package/src/api/starcoin/StarcoinGetPublicKey.ts +1 -1
- package/src/api/starcoin/StarcoinSignMessage.ts +1 -1
- package/src/api/starcoin/StarcoinSignTransaction.ts +1 -1
- package/src/api/starcoin/StarcoinVerifyMessage.ts +1 -1
- package/src/api/stellar/StellarGetAddress.ts +1 -1
- package/src/api/stellar/StellarSignTransaction.ts +1 -1
- package/src/device/Device.ts +4 -1
- package/src/inject.ts +1 -0
- package/src/types/api/btcGetAddress.ts +1 -1
- package/src/types/api/btcGetPublicKey.ts +1 -1
- package/src/types/api/btcSignMessage.ts +1 -1
- package/src/types/api/btcSignTransaction.ts +1 -1
- package/src/types/api/btcVerifyMessage.ts +1 -1
- package/src/types/api/cipherKeyValue.ts +1 -1
- package/src/types/api/deviceBackup.ts +1 -1
- package/src/types/api/deviceChangePin.ts +1 -1
- package/src/types/api/deviceFlags.ts +1 -1
- package/src/types/api/deviceRebootToBootloader.ts +1 -1
- package/src/types/api/deviceRecovery.ts +1 -1
- package/src/types/api/deviceReset.ts +1 -1
- package/src/types/api/deviceSettings.ts +1 -1
- package/src/types/api/deviceUpdateReboot.ts +1 -1
- package/src/types/api/deviceVerify.ts +15 -0
- package/src/types/api/deviceWipe.ts +1 -1
- package/src/types/api/evmGetPublicKey.ts +1 -1
- package/src/types/api/evmSignMessage.ts +1 -1
- package/src/types/api/evmSignMessageEIP712.ts +1 -1
- package/src/types/api/evmSignTypedData.ts +1 -1
- package/src/types/api/evmVerifyMessage.ts +1 -1
- package/src/types/api/export.ts +1 -0
- package/src/types/api/index.ts +2 -0
- package/src/types/api/nemGetAddress.ts +1 -1
- package/src/types/api/nemSignTransaction.ts +1 -1
- package/src/types/api/solGetAddress.ts +1 -1
- package/src/types/api/solSignTransaction.ts +1 -1
- package/src/types/api/starcoinGetAddress.ts +1 -1
- package/src/types/api/starcoinGetPublicKey.ts +1 -1
- package/src/types/api/starcoinSignMessage.ts +1 -1
- package/src/types/api/starcoinSignTransaction.ts +1 -1
- package/src/types/api/starcoinVerifyMessage.ts +1 -1
- package/src/types/api/stellarGetAddress.ts +1 -1
- package/src/types/api/stellarSignTransaction.ts +1 -1
- package/src/utils/deviceFeaturesUtils.ts +11 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint-disable no-bitwise */
|
|
2
2
|
|
|
3
|
-
import { ChangeOutputScriptType, InputScriptType } from '@onekeyfe/hd-transport
|
|
3
|
+
import { ChangeOutputScriptType, InputScriptType } from '@onekeyfe/hd-transport';
|
|
4
4
|
import { ERRORS, HardwareErrorCode } from '@onekeyfe/hd-shared';
|
|
5
5
|
|
|
6
6
|
const HD_HARDENED = 0x80000000;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint-disable prefer-regex-literals */
|
|
2
2
|
|
|
3
|
-
import { EthereumDataType, EthereumFieldType } from '@onekeyfe/hd-transport
|
|
3
|
+
import { EthereumDataType, EthereumFieldType } from '@onekeyfe/hd-transport';
|
|
4
4
|
|
|
5
5
|
import { ERRORS, HardwareErrorCode } from '@onekeyfe/hd-shared';
|
|
6
6
|
import { EthereumSignTypedDataTypes } from '../../types/api/evmSignTypedData';
|
package/src/api/index.ts
CHANGED
|
@@ -17,6 +17,7 @@ export { default as deviceRecovery } from './device/DeviceRecovery';
|
|
|
17
17
|
export { default as deviceReset } from './device/DeviceReset';
|
|
18
18
|
export { default as deviceSettings } from './device/DeviceSettings';
|
|
19
19
|
export { default as deviceUpdateReboot } from './device/DeviceUpdateReboot';
|
|
20
|
+
export { default as deviceVerify } from './device/DeviceVerify';
|
|
20
21
|
export { default as deviceWipe } from './device/DeviceWipe';
|
|
21
22
|
export { default as evmGetAddress } from './evm/EVMGetAddress';
|
|
22
23
|
export { default as evmGetPublicKey } from './evm/EVMGetPublicKey';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NEMGetAddress as HardwareNEMGetAddress } from '@onekeyfe/hd-transport
|
|
1
|
+
import { NEMGetAddress as HardwareNEMGetAddress } from '@onekeyfe/hd-transport';
|
|
2
2
|
import { UI_REQUEST } from '../../constants/ui-request';
|
|
3
3
|
import { validatePath, serializedPath } from '../helpers/pathUtils';
|
|
4
4
|
import { BaseMethod } from '../BaseMethod';
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
NEMSignTx,
|
|
9
9
|
NEMTransactionCommon,
|
|
10
10
|
NEMTransfer,
|
|
11
|
-
} from '@onekeyfe/hd-transport
|
|
11
|
+
} from '@onekeyfe/hd-transport';
|
|
12
12
|
|
|
13
13
|
import { ERRORS, HardwareErrorCode } from '@onekeyfe/hd-shared';
|
|
14
14
|
import { UI_REQUEST } from '../../constants/ui-request';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SolanaGetAddress } from '@onekeyfe/hd-transport
|
|
1
|
+
import { SolanaGetAddress } from '@onekeyfe/hd-transport';
|
|
2
2
|
import { UI_REQUEST } from '../../constants/ui-request';
|
|
3
3
|
import { serializedPath, validatePath } from '../helpers/pathUtils';
|
|
4
4
|
import { BaseMethod } from '../BaseMethod';
|
|
@@ -42,10 +42,12 @@ export default class SolGetAddress extends BaseMethod<SolanaGetAddress[]> {
|
|
|
42
42
|
for (let i = 0; i < this.params.length; i++) {
|
|
43
43
|
const param = this.params[i];
|
|
44
44
|
|
|
45
|
+
// @ts-expect-error
|
|
45
46
|
const res = await this.device.commands.typedCall('SolanaGetAddress', 'SolanaAddress', {
|
|
46
47
|
...param,
|
|
47
48
|
});
|
|
48
49
|
|
|
50
|
+
// @ts-expect-error
|
|
49
51
|
const { address } = res.message;
|
|
50
52
|
|
|
51
53
|
responses.push({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SolanaSignTx as HardwareSolanaSignTx } from '@onekeyfe/hd-transport
|
|
1
|
+
import { SolanaSignTx as HardwareSolanaSignTx } from '@onekeyfe/hd-transport';
|
|
2
2
|
import { UI_REQUEST } from '../../constants/ui-request';
|
|
3
3
|
import { serializedPath, validatePath } from '../helpers/pathUtils';
|
|
4
4
|
import { BaseMethod } from '../BaseMethod';
|
|
@@ -52,10 +52,12 @@ export default class SolSignTransaction extends BaseMethod<HardwareSolanaSignTx[
|
|
|
52
52
|
for (let i = 0; i < this.params.length; i++) {
|
|
53
53
|
const param = this.params[i];
|
|
54
54
|
|
|
55
|
+
// @ts-expect-error
|
|
55
56
|
const res = await this.device.commands.typedCall('SolanaSignTx', 'SolanaSignedTx', {
|
|
56
57
|
...param,
|
|
57
58
|
});
|
|
58
59
|
|
|
60
|
+
// @ts-expect-error
|
|
59
61
|
const { signature } = res.message;
|
|
60
62
|
|
|
61
63
|
responses.push({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { StarcoinGetAddress as HardwareStarcoinGetAddress } from '@onekeyfe/hd-transport
|
|
1
|
+
import { StarcoinGetAddress as HardwareStarcoinGetAddress } from '@onekeyfe/hd-transport';
|
|
2
2
|
import { UI_REQUEST } from '../../constants/ui-request';
|
|
3
3
|
import { validatePath, serializedPath } from '../helpers/pathUtils';
|
|
4
4
|
import { BaseMethod } from '../BaseMethod';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { StarcoinGetPublicKey as HardwareStarcoinGetPublicKey } from '@onekeyfe/hd-transport
|
|
1
|
+
import { StarcoinGetPublicKey as HardwareStarcoinGetPublicKey } from '@onekeyfe/hd-transport';
|
|
2
2
|
import { UI_REQUEST } from '../../constants/ui-request';
|
|
3
3
|
import { validatePath, serializedPath } from '../helpers/pathUtils';
|
|
4
4
|
import { BaseMethod } from '../BaseMethod';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { StarcoinSignMessage as HardwareStarcoinSignMessage } from '@onekeyfe/hd-transport
|
|
1
|
+
import { StarcoinSignMessage as HardwareStarcoinSignMessage } from '@onekeyfe/hd-transport';
|
|
2
2
|
import { UI_REQUEST } from '../../constants/ui-request';
|
|
3
3
|
import { validatePath } from '../helpers/pathUtils';
|
|
4
4
|
import { BaseMethod } from '../BaseMethod';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { StarcoinSignTx } from '@onekeyfe/hd-transport
|
|
1
|
+
import { StarcoinSignTx } from '@onekeyfe/hd-transport';
|
|
2
2
|
import { UI_REQUEST } from '../../constants/ui-request';
|
|
3
3
|
import { validatePath } from '../helpers/pathUtils';
|
|
4
4
|
import { BaseMethod } from '../BaseMethod';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { StarcoinVerifyMessage as HardwareStarcoinVerifyMessage } from '@onekeyfe/hd-transport
|
|
1
|
+
import { StarcoinVerifyMessage as HardwareStarcoinVerifyMessage } from '@onekeyfe/hd-transport';
|
|
2
2
|
import { UI_REQUEST } from '../../constants/ui-request';
|
|
3
3
|
import { BaseMethod } from '../BaseMethod';
|
|
4
4
|
import { validateParams } from '../helpers/paramsValidator';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { StellarGetAddress as HardwareStellarGetAddress } from '@onekeyfe/hd-transport
|
|
1
|
+
import { StellarGetAddress as HardwareStellarGetAddress } from '@onekeyfe/hd-transport';
|
|
2
2
|
import { UI_REQUEST } from '../../constants/ui-request';
|
|
3
3
|
import { serializedPath, validatePath } from '../helpers/pathUtils';
|
|
4
4
|
import { BaseMethod } from '../BaseMethod';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
StellarSignedTx,
|
|
3
3
|
StellarSignTx as HardwareStellarSignTx,
|
|
4
|
-
} from '@onekeyfe/hd-transport
|
|
4
|
+
} from '@onekeyfe/hd-transport';
|
|
5
5
|
import { UI_REQUEST } from '../../constants/ui-request';
|
|
6
6
|
import { validatePath } from '../helpers/pathUtils';
|
|
7
7
|
import { BaseMethod } from '../BaseMethod';
|
package/src/device/Device.ts
CHANGED
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
getDeviceType,
|
|
13
13
|
getDeviceUUID,
|
|
14
14
|
getDeviceBLEFirmwareVersion,
|
|
15
|
+
getDeviceTypeOnBootloader,
|
|
15
16
|
} from '../utils/deviceFeaturesUtils';
|
|
16
17
|
import type { Features, Device as DeviceTyped, UnavailableCapabilities } from '../types';
|
|
17
18
|
import { DEVICE, DeviceButtonRequestPayload } from '../events';
|
|
@@ -114,7 +115,9 @@ export class Device extends EventEmitter {
|
|
|
114
115
|
connectId: env === 'react-native' ? this.mainId || null : getDeviceUUID(this.features),
|
|
115
116
|
/** Hardware ID, will not change at any time */
|
|
116
117
|
uuid: getDeviceUUID(this.features),
|
|
117
|
-
deviceType:
|
|
118
|
+
deviceType: this.features.bootloader_mode
|
|
119
|
+
? getDeviceTypeOnBootloader(this.features)
|
|
120
|
+
: getDeviceType(this.features),
|
|
118
121
|
/** ID for current seeds, will clear after replace a new seed at device */
|
|
119
122
|
deviceId: this.features.device_id || null,
|
|
120
123
|
path: this.originalDescriptor.path,
|
package/src/inject.ts
CHANGED
|
@@ -77,6 +77,7 @@ export const inject = ({
|
|
|
77
77
|
deviceReset: (connectId, params) => call({ ...params, connectId, method: 'deviceReset' }),
|
|
78
78
|
deviceSettings: (connectId, params) => call({ ...params, connectId, method: 'deviceSettings' }),
|
|
79
79
|
deviceUpdateReboot: connectId => call({ connectId, method: 'deviceUpdateReboot' }),
|
|
80
|
+
deviceVerify: (connectId, params) => call({ ...params, connectId, method: 'deviceVerify' }),
|
|
80
81
|
deviceWipe: connectId => call({ connectId, method: 'deviceWipe' }),
|
|
81
82
|
|
|
82
83
|
evmGetAddress: (connectId, params) => call({ ...params, connectId, method: 'evmGetAddress' }),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CipheredKeyValue as HardwareCipheredKeyValue } from '@onekeyfe/hd-transport
|
|
1
|
+
import { CipheredKeyValue as HardwareCipheredKeyValue } from '@onekeyfe/hd-transport';
|
|
2
2
|
import type { CommonParams, Response } from '../params';
|
|
3
3
|
|
|
4
4
|
export type CipheredKeyValue = {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { CommonParams, Response } from '../params';
|
|
2
|
+
|
|
3
|
+
export type DeviceVerifyParams = {
|
|
4
|
+
dataHex: string;
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export type DeviceVerifySignature = {
|
|
8
|
+
cert: Buffer;
|
|
9
|
+
signature: Buffer;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export declare function deviceVerify(
|
|
13
|
+
connectId: string,
|
|
14
|
+
params: CommonParams & DeviceVerifyParams
|
|
15
|
+
): Response<DeviceVerifySignature>;
|
package/src/types/api/export.ts
CHANGED
|
@@ -18,6 +18,7 @@ export type { DeviceFlagsParams } from './deviceFlags';
|
|
|
18
18
|
export type { DeviceRecoveryParams } from './deviceRecovery';
|
|
19
19
|
export type { DeviceResetParams } from './deviceReset';
|
|
20
20
|
export type { DeviceSettingsParams } from './deviceSettings';
|
|
21
|
+
export type { DeviceVerifyParams, DeviceVerifySignature } from './deviceVerify';
|
|
21
22
|
|
|
22
23
|
export type { EVMAddress, EVMGetAddressParams } from './evmGetAddress';
|
|
23
24
|
export type { EVMPublicKey, EVMGetPublicKeyParams } from './evmGetPublicKey';
|
package/src/types/api/index.ts
CHANGED
|
@@ -20,6 +20,7 @@ import { btcVerifyMessage } from './btcVerifyMessage';
|
|
|
20
20
|
import { uiResponse } from './uiResponse';
|
|
21
21
|
import { deviceReset } from './deviceReset';
|
|
22
22
|
import { deviceRecovery } from './deviceRecovery';
|
|
23
|
+
import { deviceVerify } from './deviceVerify';
|
|
23
24
|
import { deviceWipe } from './deviceWipe';
|
|
24
25
|
import { deviceRebootToBootloader } from './deviceRebootToBootloader';
|
|
25
26
|
import { deviceBackup } from './deviceBackup';
|
|
@@ -79,6 +80,7 @@ export type CoreApi = {
|
|
|
79
80
|
deviceReset: typeof deviceReset;
|
|
80
81
|
deviceSettings: typeof deviceSettings;
|
|
81
82
|
deviceUpdateReboot: typeof deviceUpdateReboot;
|
|
83
|
+
deviceVerify: typeof deviceVerify;
|
|
82
84
|
deviceWipe: typeof deviceWipe;
|
|
83
85
|
|
|
84
86
|
evmGetAddress: typeof evmGetAddress;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SolanaAddress as HardwareSolanaAddress } from '@onekeyfe/hd-transport
|
|
1
|
+
import { SolanaAddress as HardwareSolanaAddress } from '@onekeyfe/hd-transport';
|
|
2
2
|
import type { CommonParams, Response } from '../params';
|
|
3
3
|
|
|
4
4
|
export type SolanaAddress = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SolanaSignedTx as HardwareSolanaSignedTx } from '@onekeyfe/hd-transport
|
|
1
|
+
import { SolanaSignedTx as HardwareSolanaSignedTx } from '@onekeyfe/hd-transport';
|
|
2
2
|
import type { CommonParams, Response } from '../params';
|
|
3
3
|
|
|
4
4
|
export type SolanaSignedTx = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { StarcoinAddress as HardwareStarcoinAddress } from '@onekeyfe/hd-transport
|
|
1
|
+
import { StarcoinAddress as HardwareStarcoinAddress } from '@onekeyfe/hd-transport';
|
|
2
2
|
import type { CommonParams, Response } from '../params';
|
|
3
3
|
|
|
4
4
|
export type StarcoinAddress = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { StarcoinPublicKey as HardwareStarcoinPublicKey } from '@onekeyfe/hd-transport
|
|
1
|
+
import { StarcoinPublicKey as HardwareStarcoinPublicKey } from '@onekeyfe/hd-transport';
|
|
2
2
|
import type { CommonParams, Response } from '../params';
|
|
3
3
|
|
|
4
4
|
export type StarcoinPublicKey = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { StellarAddress as HardwareStellarAddress } from '@onekeyfe/hd-transport
|
|
1
|
+
import { StellarAddress as HardwareStellarAddress } from '@onekeyfe/hd-transport';
|
|
2
2
|
import type { CommonParams, Response } from '../params';
|
|
3
3
|
|
|
4
4
|
export type StellarAddress = {
|
|
@@ -24,6 +24,17 @@ export const getDeviceType = (features?: Features): IDeviceType => {
|
|
|
24
24
|
return 'classic';
|
|
25
25
|
};
|
|
26
26
|
|
|
27
|
+
export const getDeviceTypeOnBootloader = (features?: Features): IDeviceType => {
|
|
28
|
+
if (!features || typeof features !== 'object') {
|
|
29
|
+
return 'classic';
|
|
30
|
+
}
|
|
31
|
+
if (features.model === 'T') {
|
|
32
|
+
return 'touch';
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return getDeviceType(features);
|
|
36
|
+
};
|
|
37
|
+
|
|
27
38
|
export const getDeviceTypeByBleName = (name?: string): IDeviceType | null => {
|
|
28
39
|
if (!name) return 'classic';
|
|
29
40
|
if (name.startsWith('MI')) return 'mini';
|