@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.
Files changed (235) hide show
  1. package/dist/api/CipherKeyValue.d.ts +1 -1
  2. package/dist/api/CipherKeyValue.d.ts.map +1 -1
  3. package/dist/api/FirmwareUpdate.d.ts +1 -3
  4. package/dist/api/FirmwareUpdate.d.ts.map +1 -1
  5. package/dist/api/GetFeatures.d.ts +1 -47
  6. package/dist/api/GetFeatures.d.ts.map +1 -1
  7. package/dist/api/btc/BTCGetAddress.d.ts +1 -1
  8. package/dist/api/btc/BTCGetAddress.d.ts.map +1 -1
  9. package/dist/api/btc/BTCGetPublicKey.d.ts +1 -1
  10. package/dist/api/btc/BTCGetPublicKey.d.ts.map +1 -1
  11. package/dist/api/btc/BTCSignMessage.d.ts +2 -5
  12. package/dist/api/btc/BTCSignMessage.d.ts.map +1 -1
  13. package/dist/api/btc/BTCSignTransaction.d.ts +1 -1
  14. package/dist/api/btc/BTCSignTransaction.d.ts.map +1 -1
  15. package/dist/api/btc/BTCVerifyMessage.d.ts +2 -4
  16. package/dist/api/btc/BTCVerifyMessage.d.ts.map +1 -1
  17. package/dist/api/btc/helpers/signtx.d.ts +1 -1
  18. package/dist/api/btc/helpers/signtx.d.ts.map +1 -1
  19. package/dist/api/btc/helpers/signtxLegacy.d.ts +1 -1
  20. package/dist/api/btc/helpers/signtxLegacy.d.ts.map +1 -1
  21. package/dist/api/device/DeviceBackup.d.ts +2 -4
  22. package/dist/api/device/DeviceBackup.d.ts.map +1 -1
  23. package/dist/api/device/DeviceChangePin.d.ts +2 -4
  24. package/dist/api/device/DeviceChangePin.d.ts.map +1 -1
  25. package/dist/api/device/DeviceFlags.d.ts +2 -4
  26. package/dist/api/device/DeviceFlags.d.ts.map +1 -1
  27. package/dist/api/device/DeviceRebootToBootloader.d.ts +2 -4
  28. package/dist/api/device/DeviceRebootToBootloader.d.ts.map +1 -1
  29. package/dist/api/device/DeviceRecovery.d.ts +2 -4
  30. package/dist/api/device/DeviceRecovery.d.ts.map +1 -1
  31. package/dist/api/device/DeviceReset.d.ts +2 -4
  32. package/dist/api/device/DeviceReset.d.ts.map +1 -1
  33. package/dist/api/device/DeviceSettings.d.ts +2 -4
  34. package/dist/api/device/DeviceSettings.d.ts.map +1 -1
  35. package/dist/api/device/DeviceUpdateReboot.d.ts +2 -4
  36. package/dist/api/device/DeviceUpdateReboot.d.ts.map +1 -1
  37. package/dist/api/device/DeviceVerify.d.ts +8 -0
  38. package/dist/api/device/DeviceVerify.d.ts.map +1 -0
  39. package/dist/api/device/DeviceWipe.d.ts +2 -4
  40. package/dist/api/device/DeviceWipe.d.ts.map +1 -1
  41. package/dist/api/evm/EVMGetAddress.d.ts +1 -1
  42. package/dist/api/evm/EVMGetAddress.d.ts.map +1 -1
  43. package/dist/api/evm/EVMGetPublicKey.d.ts +1 -1
  44. package/dist/api/evm/EVMGetPublicKey.d.ts.map +1 -1
  45. package/dist/api/evm/EVMSignMessage.d.ts +2 -5
  46. package/dist/api/evm/EVMSignMessage.d.ts.map +1 -1
  47. package/dist/api/evm/EVMSignMessageEIP712.d.ts +2 -5
  48. package/dist/api/evm/EVMSignMessageEIP712.d.ts.map +1 -1
  49. package/dist/api/evm/EVMSignTransaction.d.ts +1 -1
  50. package/dist/api/evm/EVMSignTransaction.d.ts.map +1 -1
  51. package/dist/api/evm/EVMSignTypedData.d.ts +6 -5
  52. package/dist/api/evm/EVMSignTypedData.d.ts.map +1 -1
  53. package/dist/api/evm/EVMVerifyMessage.d.ts +2 -4
  54. package/dist/api/evm/EVMVerifyMessage.d.ts.map +1 -1
  55. package/dist/api/firmware/uploadFirmware.d.ts +1 -3
  56. package/dist/api/firmware/uploadFirmware.d.ts.map +1 -1
  57. package/dist/api/helpers/pathUtils.d.ts +1 -1
  58. package/dist/api/helpers/pathUtils.d.ts.map +1 -1
  59. package/dist/api/helpers/typeNameUtils.d.ts +1 -1
  60. package/dist/api/helpers/typeNameUtils.d.ts.map +1 -1
  61. package/dist/api/index.d.ts +1 -0
  62. package/dist/api/index.d.ts.map +1 -1
  63. package/dist/api/nem/NEMGetAddress.d.ts +1 -1
  64. package/dist/api/nem/NEMGetAddress.d.ts.map +1 -1
  65. package/dist/api/nem/NEMSignTransaction.d.ts +1 -1
  66. package/dist/api/nem/NEMSignTransaction.d.ts.map +1 -1
  67. package/dist/api/solana/SolGetAddress.d.ts +1 -1
  68. package/dist/api/solana/SolGetAddress.d.ts.map +1 -1
  69. package/dist/api/solana/SolSignTransaction.d.ts +1 -1
  70. package/dist/api/solana/SolSignTransaction.d.ts.map +1 -1
  71. package/dist/api/starcoin/StarcoinGetAddress.d.ts +1 -1
  72. package/dist/api/starcoin/StarcoinGetAddress.d.ts.map +1 -1
  73. package/dist/api/starcoin/StarcoinGetPublicKey.d.ts +1 -1
  74. package/dist/api/starcoin/StarcoinGetPublicKey.d.ts.map +1 -1
  75. package/dist/api/starcoin/StarcoinSignMessage.d.ts +2 -5
  76. package/dist/api/starcoin/StarcoinSignMessage.d.ts.map +1 -1
  77. package/dist/api/starcoin/StarcoinSignTransaction.d.ts +2 -5
  78. package/dist/api/starcoin/StarcoinSignTransaction.d.ts.map +1 -1
  79. package/dist/api/starcoin/StarcoinVerifyMessage.d.ts +2 -4
  80. package/dist/api/starcoin/StarcoinVerifyMessage.d.ts.map +1 -1
  81. package/dist/api/stellar/StellarGetAddress.d.ts +1 -1
  82. package/dist/api/stellar/StellarGetAddress.d.ts.map +1 -1
  83. package/dist/api/stellar/StellarSignTransaction.d.ts +1 -1
  84. package/dist/api/stellar/StellarSignTransaction.d.ts.map +1 -1
  85. package/dist/device/Device.d.ts.map +1 -1
  86. package/dist/index.d.ts +14 -50
  87. package/dist/index.js +240 -2
  88. package/dist/inject.d.ts.map +1 -1
  89. package/dist/types/api/btcGetAddress.d.ts +1 -1
  90. package/dist/types/api/btcGetAddress.d.ts.map +1 -1
  91. package/dist/types/api/btcGetPublicKey.d.ts +1 -1
  92. package/dist/types/api/btcGetPublicKey.d.ts.map +1 -1
  93. package/dist/types/api/btcSignMessage.d.ts +1 -1
  94. package/dist/types/api/btcSignMessage.d.ts.map +1 -1
  95. package/dist/types/api/btcSignTransaction.d.ts +1 -1
  96. package/dist/types/api/btcSignTransaction.d.ts.map +1 -1
  97. package/dist/types/api/btcVerifyMessage.d.ts +1 -1
  98. package/dist/types/api/btcVerifyMessage.d.ts.map +1 -1
  99. package/dist/types/api/cipherKeyValue.d.ts +1 -1
  100. package/dist/types/api/cipherKeyValue.d.ts.map +1 -1
  101. package/dist/types/api/deviceBackup.d.ts +1 -1
  102. package/dist/types/api/deviceBackup.d.ts.map +1 -1
  103. package/dist/types/api/deviceChangePin.d.ts +1 -1
  104. package/dist/types/api/deviceChangePin.d.ts.map +1 -1
  105. package/dist/types/api/deviceFlags.d.ts +1 -1
  106. package/dist/types/api/deviceFlags.d.ts.map +1 -1
  107. package/dist/types/api/deviceRebootToBootloader.d.ts +1 -1
  108. package/dist/types/api/deviceRebootToBootloader.d.ts.map +1 -1
  109. package/dist/types/api/deviceRecovery.d.ts +1 -1
  110. package/dist/types/api/deviceRecovery.d.ts.map +1 -1
  111. package/dist/types/api/deviceReset.d.ts +1 -1
  112. package/dist/types/api/deviceReset.d.ts.map +1 -1
  113. package/dist/types/api/deviceSettings.d.ts +1 -1
  114. package/dist/types/api/deviceSettings.d.ts.map +1 -1
  115. package/dist/types/api/deviceUpdateReboot.d.ts +1 -1
  116. package/dist/types/api/deviceUpdateReboot.d.ts.map +1 -1
  117. package/dist/types/api/deviceVerify.d.ts +11 -0
  118. package/dist/types/api/deviceVerify.d.ts.map +1 -0
  119. package/dist/types/api/deviceWipe.d.ts +1 -1
  120. package/dist/types/api/deviceWipe.d.ts.map +1 -1
  121. package/dist/types/api/evmGetPublicKey.d.ts +1 -1
  122. package/dist/types/api/evmGetPublicKey.d.ts.map +1 -1
  123. package/dist/types/api/evmSignMessage.d.ts +1 -1
  124. package/dist/types/api/evmSignMessage.d.ts.map +1 -1
  125. package/dist/types/api/evmSignMessageEIP712.d.ts +1 -1
  126. package/dist/types/api/evmSignMessageEIP712.d.ts.map +1 -1
  127. package/dist/types/api/evmSignTypedData.d.ts +1 -1
  128. package/dist/types/api/evmSignTypedData.d.ts.map +1 -1
  129. package/dist/types/api/evmVerifyMessage.d.ts +1 -1
  130. package/dist/types/api/evmVerifyMessage.d.ts.map +1 -1
  131. package/dist/types/api/export.d.ts +1 -0
  132. package/dist/types/api/export.d.ts.map +1 -1
  133. package/dist/types/api/index.d.ts +2 -0
  134. package/dist/types/api/index.d.ts.map +1 -1
  135. package/dist/types/api/nemGetAddress.d.ts +1 -1
  136. package/dist/types/api/nemGetAddress.d.ts.map +1 -1
  137. package/dist/types/api/nemSignTransaction.d.ts +1 -1
  138. package/dist/types/api/nemSignTransaction.d.ts.map +1 -1
  139. package/dist/types/api/solGetAddress.d.ts +1 -1
  140. package/dist/types/api/solGetAddress.d.ts.map +1 -1
  141. package/dist/types/api/solSignTransaction.d.ts +1 -1
  142. package/dist/types/api/solSignTransaction.d.ts.map +1 -1
  143. package/dist/types/api/starcoinGetAddress.d.ts +1 -1
  144. package/dist/types/api/starcoinGetAddress.d.ts.map +1 -1
  145. package/dist/types/api/starcoinGetPublicKey.d.ts +1 -1
  146. package/dist/types/api/starcoinGetPublicKey.d.ts.map +1 -1
  147. package/dist/types/api/starcoinSignMessage.d.ts +1 -1
  148. package/dist/types/api/starcoinSignMessage.d.ts.map +1 -1
  149. package/dist/types/api/starcoinSignTransaction.d.ts +1 -1
  150. package/dist/types/api/starcoinSignTransaction.d.ts.map +1 -1
  151. package/dist/types/api/starcoinVerifyMessage.d.ts +1 -1
  152. package/dist/types/api/starcoinVerifyMessage.d.ts.map +1 -1
  153. package/dist/types/api/stellarGetAddress.d.ts +1 -1
  154. package/dist/types/api/stellarGetAddress.d.ts.map +1 -1
  155. package/dist/types/api/stellarSignTransaction.d.ts +1 -1
  156. package/dist/types/api/stellarSignTransaction.d.ts.map +1 -1
  157. package/dist/utils/deviceFeaturesUtils.d.ts +3 -94
  158. package/dist/utils/deviceFeaturesUtils.d.ts.map +1 -1
  159. package/package.json +4 -4
  160. package/src/api/CipherKeyValue.ts +1 -1
  161. package/src/api/btc/BTCGetAddress.ts +1 -1
  162. package/src/api/btc/BTCGetPublicKey.ts +1 -1
  163. package/src/api/btc/BTCSignMessage.ts +1 -1
  164. package/src/api/btc/BTCSignTransaction.ts +1 -1
  165. package/src/api/btc/BTCVerifyMessage.ts +1 -1
  166. package/src/api/btc/helpers/signtx.ts +1 -1
  167. package/src/api/btc/helpers/signtxLegacy.ts +1 -1
  168. package/src/api/device/DeviceBackup.ts +1 -1
  169. package/src/api/device/DeviceChangePin.ts +1 -1
  170. package/src/api/device/DeviceFlags.ts +1 -1
  171. package/src/api/device/DeviceRebootToBootloader.ts +1 -1
  172. package/src/api/device/DeviceRecovery.ts +1 -1
  173. package/src/api/device/DeviceReset.ts +1 -1
  174. package/src/api/device/DeviceSettings.ts +1 -1
  175. package/src/api/device/DeviceUpdateReboot.ts +1 -1
  176. package/src/api/device/DeviceVerify.ts +55 -0
  177. package/src/api/device/DeviceWipe.ts +1 -1
  178. package/src/api/evm/EVMGetAddress.ts +1 -1
  179. package/src/api/evm/EVMGetPublicKey.ts +1 -1
  180. package/src/api/evm/EVMSignMessage.ts +1 -1
  181. package/src/api/evm/EVMSignMessageEIP712.ts +1 -1
  182. package/src/api/evm/EVMSignTransaction.ts +1 -5
  183. package/src/api/evm/EVMSignTypedData.ts +119 -124
  184. package/src/api/evm/EVMVerifyMessage.ts +1 -1
  185. package/src/api/helpers/pathUtils.ts +1 -1
  186. package/src/api/helpers/typeNameUtils.ts +1 -1
  187. package/src/api/index.ts +1 -0
  188. package/src/api/nem/NEMGetAddress.ts +1 -1
  189. package/src/api/nem/NEMSignTransaction.ts +1 -1
  190. package/src/api/solana/SolGetAddress.ts +3 -1
  191. package/src/api/solana/SolSignTransaction.ts +3 -1
  192. package/src/api/starcoin/StarcoinGetAddress.ts +1 -1
  193. package/src/api/starcoin/StarcoinGetPublicKey.ts +1 -1
  194. package/src/api/starcoin/StarcoinSignMessage.ts +1 -1
  195. package/src/api/starcoin/StarcoinSignTransaction.ts +1 -1
  196. package/src/api/starcoin/StarcoinVerifyMessage.ts +1 -1
  197. package/src/api/stellar/StellarGetAddress.ts +1 -1
  198. package/src/api/stellar/StellarSignTransaction.ts +1 -1
  199. package/src/device/Device.ts +4 -1
  200. package/src/inject.ts +1 -0
  201. package/src/types/api/btcGetAddress.ts +1 -1
  202. package/src/types/api/btcGetPublicKey.ts +1 -1
  203. package/src/types/api/btcSignMessage.ts +1 -1
  204. package/src/types/api/btcSignTransaction.ts +1 -1
  205. package/src/types/api/btcVerifyMessage.ts +1 -1
  206. package/src/types/api/cipherKeyValue.ts +1 -1
  207. package/src/types/api/deviceBackup.ts +1 -1
  208. package/src/types/api/deviceChangePin.ts +1 -1
  209. package/src/types/api/deviceFlags.ts +1 -1
  210. package/src/types/api/deviceRebootToBootloader.ts +1 -1
  211. package/src/types/api/deviceRecovery.ts +1 -1
  212. package/src/types/api/deviceReset.ts +1 -1
  213. package/src/types/api/deviceSettings.ts +1 -1
  214. package/src/types/api/deviceUpdateReboot.ts +1 -1
  215. package/src/types/api/deviceVerify.ts +15 -0
  216. package/src/types/api/deviceWipe.ts +1 -1
  217. package/src/types/api/evmGetPublicKey.ts +1 -1
  218. package/src/types/api/evmSignMessage.ts +1 -1
  219. package/src/types/api/evmSignMessageEIP712.ts +1 -1
  220. package/src/types/api/evmSignTypedData.ts +1 -1
  221. package/src/types/api/evmVerifyMessage.ts +1 -1
  222. package/src/types/api/export.ts +1 -0
  223. package/src/types/api/index.ts +2 -0
  224. package/src/types/api/nemGetAddress.ts +1 -1
  225. package/src/types/api/nemSignTransaction.ts +1 -1
  226. package/src/types/api/solGetAddress.ts +1 -1
  227. package/src/types/api/solSignTransaction.ts +1 -1
  228. package/src/types/api/starcoinGetAddress.ts +1 -1
  229. package/src/types/api/starcoinGetPublicKey.ts +1 -1
  230. package/src/types/api/starcoinSignMessage.ts +1 -1
  231. package/src/types/api/starcoinSignTransaction.ts +1 -1
  232. package/src/types/api/starcoinVerifyMessage.ts +1 -1
  233. package/src/types/api/stellarGetAddress.ts +1 -1
  234. package/src/types/api/stellarSignTransaction.ts +1 -1
  235. 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/src/types/messages';
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/src/types/messages';
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/src/types/messages';
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/src/types/messages';
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/src/types/messages';
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/src/types/messages';
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/src/types/messages';
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/src/types/messages';
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/src/types/messages';
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/src/types/messages';
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/src/types/messages';
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/src/types/messages';
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/src/types/messages';
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';
@@ -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: getDeviceType(this.features),
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' }),
@@ -2,7 +2,7 @@ import {
2
2
  Address,
3
3
  InputScriptType,
4
4
  MultisigRedeemScriptType,
5
- } from '@onekeyfe/hd-transport/src/types/messages';
5
+ } from '@onekeyfe/hd-transport';
6
6
  import type { CommonParams, Response } from '../params';
7
7
 
8
8
  export type BTCAddress = {
@@ -1,4 +1,4 @@
1
- import { InputScriptType, PublicKey } from '@onekeyfe/hd-transport/src/types/messages';
1
+ import { InputScriptType, PublicKey } from '@onekeyfe/hd-transport';
2
2
  import type { CommonParams, Response } from '../params';
3
3
 
4
4
  export type BTCPublicKey = {
@@ -1,4 +1,4 @@
1
- import { MessageSignature } from '@onekeyfe/hd-transport/src/types/messages';
1
+ import { MessageSignature } from '@onekeyfe/hd-transport';
2
2
  import type { CommonParams, Response } from '../params';
3
3
 
4
4
  export type BTCSignMessageParams = {
@@ -4,7 +4,7 @@ import {
4
4
  TxOutputBinType,
5
5
  TxOutputType,
6
6
  TxInputType,
7
- } from '@onekeyfe/hd-transport/src/types/messages';
7
+ } from '@onekeyfe/hd-transport';
8
8
  import type { CommonParams, Response } from '../params';
9
9
 
10
10
  export type SignedTransaction = {
@@ -1,4 +1,4 @@
1
- import { Success } from '@onekeyfe/hd-transport/src/types/messages';
1
+ import { Success } from '@onekeyfe/hd-transport';
2
2
  import type { CommonParams, Response } from '../params';
3
3
 
4
4
  export type BTCVerifyMessageParams = {
@@ -1,4 +1,4 @@
1
- import { CipheredKeyValue as HardwareCipheredKeyValue } from '@onekeyfe/hd-transport/src/types/messages';
1
+ import { CipheredKeyValue as HardwareCipheredKeyValue } from '@onekeyfe/hd-transport';
2
2
  import type { CommonParams, Response } from '../params';
3
3
 
4
4
  export type CipheredKeyValue = {
@@ -1,4 +1,4 @@
1
- import { Success } from '@onekeyfe/hd-transport/src/types/messages';
1
+ import { Success } from '@onekeyfe/hd-transport';
2
2
  import type { Response } from '../params';
3
3
 
4
4
  export declare function deviceBackup(connectId: string): Response<Success>;
@@ -1,4 +1,4 @@
1
- import { Success } from '@onekeyfe/hd-transport/src/types/messages';
1
+ import { Success } from '@onekeyfe/hd-transport';
2
2
  import type { CommonParams, Response } from '../params';
3
3
 
4
4
  export type DeviceChangePinParams = {
@@ -1,4 +1,4 @@
1
- import { Success } from '@onekeyfe/hd-transport/src/types/messages';
1
+ import { Success } from '@onekeyfe/hd-transport';
2
2
  import type { CommonParams, Response } from '../params';
3
3
 
4
4
  export type DeviceFlagsParams = {
@@ -1,4 +1,4 @@
1
- import { Success } from '@onekeyfe/hd-transport/src/types/messages';
1
+ import { Success } from '@onekeyfe/hd-transport';
2
2
  import type { Response } from '../params';
3
3
 
4
4
  export declare function deviceRebootToBootloader(connectId: string): Response<Success>;
@@ -1,4 +1,4 @@
1
- import { RecoveryDeviceType, Success } from '@onekeyfe/hd-transport/src/types/messages';
1
+ import { RecoveryDeviceType, Success } from '@onekeyfe/hd-transport';
2
2
  import type { CommonParams, Response } from '../params';
3
3
 
4
4
  export type DeviceRecoveryParams = {
@@ -1,4 +1,4 @@
1
- import { Success } from '@onekeyfe/hd-transport/src/types/messages';
1
+ import { Success } from '@onekeyfe/hd-transport';
2
2
  import type { CommonParams, Response } from '../params';
3
3
 
4
4
  export type DeviceResetParams = {
@@ -1,4 +1,4 @@
1
- import { SafetyCheckLevel, Success } from '@onekeyfe/hd-transport/src/types/messages';
1
+ import { SafetyCheckLevel, Success } from '@onekeyfe/hd-transport';
2
2
  import type { CommonParams, Response } from '../params';
3
3
 
4
4
  export type DeviceSettingsParams = {
@@ -1,4 +1,4 @@
1
- import { Success } from '@onekeyfe/hd-transport/src/types/messages';
1
+ import { Success } from '@onekeyfe/hd-transport';
2
2
  import type { Response } from '../params';
3
3
 
4
4
  export declare function deviceUpdateReboot(connectId: string): Response<Success>;
@@ -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>;
@@ -1,4 +1,4 @@
1
- import { Success } from '@onekeyfe/hd-transport/src/types/messages';
1
+ import { Success } from '@onekeyfe/hd-transport';
2
2
  import type { Response } from '../params';
3
3
 
4
4
  export declare function deviceWipe(connectId: string): Response<Success>;
@@ -1,4 +1,4 @@
1
- import { EthereumPublicKey } from '@onekeyfe/hd-transport/src/types/messages';
1
+ import { EthereumPublicKey } from '@onekeyfe/hd-transport';
2
2
  import type { CommonParams, Response } from '../params';
3
3
 
4
4
  export type EVMPublicKey = {
@@ -1,4 +1,4 @@
1
- import { EthereumMessageSignature } from '@onekeyfe/hd-transport/src/types/messages';
1
+ import { EthereumMessageSignature } from '@onekeyfe/hd-transport';
2
2
  import type { CommonParams, Response } from '../params';
3
3
 
4
4
  export type EVMSignMessageParams = {
@@ -1,4 +1,4 @@
1
- import { EthereumMessageSignature } from '@onekeyfe/hd-transport/src/types/messages';
1
+ import { EthereumMessageSignature } from '@onekeyfe/hd-transport';
2
2
  import type { CommonParams, Response } from '../params';
3
3
 
4
4
  export type EVMSignMessageEIP712Params = {
@@ -1,4 +1,4 @@
1
- import { EthereumMessageSignature } from '@onekeyfe/hd-transport/src/types/messages';
1
+ import { EthereumMessageSignature } from '@onekeyfe/hd-transport';
2
2
  import type { CommonParams, Response } from '../params';
3
3
 
4
4
  export type EthereumSignTypedDataTypeProperty = {
@@ -1,4 +1,4 @@
1
- import { Success } from '@onekeyfe/hd-transport/src/types/messages';
1
+ import { Success } from '@onekeyfe/hd-transport';
2
2
  import type { CommonParams, Response } from '../params';
3
3
 
4
4
  export type EVMVerifyMessageParams = {
@@ -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';
@@ -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 { NEMAddress as HardwareNEMAddress } from '@onekeyfe/hd-transport/src/types/messages';
1
+ import { NEMAddress as HardwareNEMAddress } from '@onekeyfe/hd-transport';
2
2
  import type { CommonParams, Response } from '../params';
3
3
 
4
4
  export type NEMAddress = {
@@ -1,4 +1,4 @@
1
- import { NEMSignedTx } from '@onekeyfe/hd-transport/src/types/messages';
1
+ import { NEMSignedTx } from '@onekeyfe/hd-transport';
2
2
  import type { CommonParams, Response } from '../params';
3
3
 
4
4
  type MosaicID = {
@@ -1,4 +1,4 @@
1
- import { SolanaAddress as HardwareSolanaAddress } from '@onekeyfe/hd-transport/src/types/messages';
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/src/types/messages';
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/src/types/messages';
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/src/types/messages';
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 { StarcoinMessageSignature } from '@onekeyfe/hd-transport/src/types/messages';
1
+ import { StarcoinMessageSignature } from '@onekeyfe/hd-transport';
2
2
  import type { CommonParams, Response } from '../params';
3
3
 
4
4
  export type StarcoinSignMessageParams = {
@@ -1,4 +1,4 @@
1
- import { StarcoinSignedTx } from '@onekeyfe/hd-transport/src/types/messages';
1
+ import { StarcoinSignedTx } from '@onekeyfe/hd-transport';
2
2
  import type { CommonParams, Response } from '../params';
3
3
 
4
4
  export type StarcoinSignTransactionParams = {
@@ -1,4 +1,4 @@
1
- import { Success } from '@onekeyfe/hd-transport/src/types/messages';
1
+ import { Success } from '@onekeyfe/hd-transport';
2
2
  import type { CommonParams, Response } from '../params';
3
3
 
4
4
  export type StarcoinVerifyMessageParams = {
@@ -1,4 +1,4 @@
1
- import { StellarAddress as HardwareStellarAddress } from '@onekeyfe/hd-transport/src/types/messages';
1
+ import { StellarAddress as HardwareStellarAddress } from '@onekeyfe/hd-transport';
2
2
  import type { CommonParams, Response } from '../params';
3
3
 
4
4
  export type StellarAddress = {
@@ -1,4 +1,4 @@
1
- import { StellarSignedTx } from '@onekeyfe/hd-transport/src/types/messages';
1
+ import { StellarSignedTx } from '@onekeyfe/hd-transport';
2
2
  import { CommonParams, Response } from '../params';
3
3
 
4
4
  export type StellarAsset = {
@@ -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';