@onekeyfe/hd-core 1.1.27-patch.1 → 1.2.0-alpha.0

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 (377) hide show
  1. package/__tests__/evmLedgerLegacySafety.test.ts +15 -4
  2. package/__tests__/evmSignTransaction.test.ts +1 -1
  3. package/__tests__/evmSignTypedData.test.ts +1 -1
  4. package/__tests__/logBlockEvent.test.ts +37 -0
  5. package/__tests__/protocol-v2.test.ts +3025 -0
  6. package/dist/api/BaseMethod.d.ts +1 -0
  7. package/dist/api/BaseMethod.d.ts.map +1 -1
  8. package/dist/api/DirList.d.ts +10 -0
  9. package/dist/api/DirList.d.ts.map +1 -0
  10. package/dist/api/DirMake.d.ts +9 -0
  11. package/dist/api/DirMake.d.ts.map +1 -0
  12. package/dist/api/DirRemove.d.ts +9 -0
  13. package/dist/api/DirRemove.d.ts.map +1 -0
  14. package/dist/api/FileDelete.d.ts +9 -0
  15. package/dist/api/FileDelete.d.ts.map +1 -0
  16. package/dist/api/FileRead.d.ts +19 -0
  17. package/dist/api/FileRead.d.ts.map +1 -0
  18. package/dist/api/FileWrite.d.ts +24 -0
  19. package/dist/api/FileWrite.d.ts.map +1 -0
  20. package/dist/api/FirmwareUpdate.d.ts.map +1 -1
  21. package/dist/api/FirmwareUpdateV2.d.ts.map +1 -1
  22. package/dist/api/FirmwareUpdateV3.d.ts +1 -0
  23. package/dist/api/FirmwareUpdateV3.d.ts.map +1 -1
  24. package/dist/api/FirmwareUpdateV4.d.ts +35 -0
  25. package/dist/api/FirmwareUpdateV4.d.ts.map +1 -0
  26. package/dist/api/GetDeviceInfo.d.ts +9 -0
  27. package/dist/api/GetDeviceInfo.d.ts.map +1 -0
  28. package/dist/api/GetFeatures.d.ts.map +1 -1
  29. package/dist/api/GetOnekeyFeatures.d.ts.map +1 -1
  30. package/dist/api/GetPassphraseState.d.ts +6 -1
  31. package/dist/api/GetPassphraseState.d.ts.map +1 -1
  32. package/dist/api/PathInfo.d.ts +10 -0
  33. package/dist/api/PathInfo.d.ts.map +1 -0
  34. package/dist/api/PromptWebDeviceAccess.d.ts.map +1 -1
  35. package/dist/api/SearchDevices.d.ts +2 -1
  36. package/dist/api/SearchDevices.d.ts.map +1 -1
  37. package/dist/api/alephium/AlephiumGetAddress.d.ts +2 -6
  38. package/dist/api/alephium/AlephiumGetAddress.d.ts.map +1 -1
  39. package/dist/api/alephium/AlephiumSignMessage.d.ts +2 -5
  40. package/dist/api/alephium/AlephiumSignMessage.d.ts.map +1 -1
  41. package/dist/api/alephium/AlephiumSignTransaction.d.ts +5 -8
  42. package/dist/api/alephium/AlephiumSignTransaction.d.ts.map +1 -1
  43. package/dist/api/aptos/AptosGetAddress.d.ts.map +1 -1
  44. package/dist/api/benfen/BenfenGetAddress.d.ts +2 -9
  45. package/dist/api/benfen/BenfenGetAddress.d.ts.map +1 -1
  46. package/dist/api/benfen/BenfenGetPublicKey.d.ts +2 -9
  47. package/dist/api/benfen/BenfenGetPublicKey.d.ts.map +1 -1
  48. package/dist/api/benfen/BenfenSignMessage.d.ts +2 -8
  49. package/dist/api/benfen/BenfenSignMessage.d.ts.map +1 -1
  50. package/dist/api/benfen/BenfenSignTransaction.d.ts +2 -8
  51. package/dist/api/benfen/BenfenSignTransaction.d.ts.map +1 -1
  52. package/dist/api/btc/BTCGetAddress.d.ts +1 -11
  53. package/dist/api/btc/BTCGetAddress.d.ts.map +1 -1
  54. package/dist/api/btc/BTCGetPublicKey.d.ts +1 -11
  55. package/dist/api/btc/BTCGetPublicKey.d.ts.map +1 -1
  56. package/dist/api/btc/BTCSignMessage.d.ts +1 -15
  57. package/dist/api/btc/BTCSignMessage.d.ts.map +1 -1
  58. package/dist/api/btc/BTCSignPsbt.d.ts.map +1 -1
  59. package/dist/api/btc/BTCSignTransaction.d.ts +1 -11
  60. package/dist/api/btc/BTCSignTransaction.d.ts.map +1 -1
  61. package/dist/api/btc/BTCVerifyMessage.d.ts +1 -11
  62. package/dist/api/btc/BTCVerifyMessage.d.ts.map +1 -1
  63. package/dist/api/btc/helpers/versionLimit.d.ts +2 -11
  64. package/dist/api/btc/helpers/versionLimit.d.ts.map +1 -1
  65. package/dist/api/cardano/CardanoSignTransaction.d.ts.map +1 -1
  66. package/dist/api/conflux/ConfluxSignTransaction.d.ts.map +1 -1
  67. package/dist/api/device/DeviceLock.d.ts.map +1 -1
  68. package/dist/api/device/DeviceRebootToBoardloader.d.ts +1 -1
  69. package/dist/api/device/DeviceRebootToBoardloader.d.ts.map +1 -1
  70. package/dist/api/device/DeviceRebootToBootloader.d.ts.map +1 -1
  71. package/dist/api/device/DeviceSupportFeatures.d.ts.map +1 -1
  72. package/dist/api/device/DeviceUploadResource.d.ts.map +1 -1
  73. package/dist/api/device/DeviceVerify.d.ts.map +1 -1
  74. package/dist/api/dynex/DnxGetAddress.d.ts.map +1 -1
  75. package/dist/api/dynex/DnxSignTransaction.d.ts.map +1 -1
  76. package/dist/api/evm/EVMGetPublicKey.d.ts.map +1 -1
  77. package/dist/api/evm/EVMSignMessageEIP712.d.ts +2 -8
  78. package/dist/api/evm/EVMSignMessageEIP712.d.ts.map +1 -1
  79. package/dist/api/evm/EVMSignTypedData.d.ts.map +1 -1
  80. package/dist/api/evm/latest/signTypedData.d.ts +1 -1
  81. package/dist/api/evm/latest/signTypedData.d.ts.map +1 -1
  82. package/dist/api/evm/latest/signTypedHash.d.ts.map +1 -1
  83. package/dist/api/evm/legacyV1/getAddress.d.ts.map +1 -1
  84. package/dist/api/evm/legacyV1/getPublicKey.d.ts.map +1 -1
  85. package/dist/api/evm/legacyV1/signMessage.d.ts.map +1 -1
  86. package/dist/api/evm/legacyV1/signTypedData.d.ts +1 -1
  87. package/dist/api/evm/legacyV1/signTypedData.d.ts.map +1 -1
  88. package/dist/api/evm/legacyV1/signTypedHash.d.ts.map +1 -1
  89. package/dist/api/evm/legacyV1/verifyMessage.d.ts.map +1 -1
  90. package/dist/api/firmware/uploadFirmware.d.ts.map +1 -1
  91. package/dist/api/helpers/batchGetPublickeys.d.ts +3 -0
  92. package/dist/api/helpers/batchGetPublickeys.d.ts.map +1 -1
  93. package/dist/api/helpers/filesystemValidation.d.ts +7 -0
  94. package/dist/api/helpers/filesystemValidation.d.ts.map +1 -0
  95. package/dist/api/index.d.ts +32 -0
  96. package/dist/api/index.d.ts.map +1 -1
  97. package/dist/api/kaspa/KaspaSignTransaction.d.ts.map +1 -1
  98. package/dist/api/lightning/LnurlAuth.d.ts +4 -0
  99. package/dist/api/lightning/LnurlAuth.d.ts.map +1 -1
  100. package/dist/api/neo/NeoGetAddress.d.ts +2 -8
  101. package/dist/api/neo/NeoGetAddress.d.ts.map +1 -1
  102. package/dist/api/neo/NeoSignTransaction.d.ts +2 -8
  103. package/dist/api/neo/NeoSignTransaction.d.ts.map +1 -1
  104. package/dist/api/nervos/NervosGetAddress.d.ts +2 -9
  105. package/dist/api/nervos/NervosGetAddress.d.ts.map +1 -1
  106. package/dist/api/nervos/NervosSignTransaction.d.ts +9 -12
  107. package/dist/api/nervos/NervosSignTransaction.d.ts.map +1 -1
  108. package/dist/api/nexa/NexaGetAddress.d.ts +2 -8
  109. package/dist/api/nexa/NexaGetAddress.d.ts.map +1 -1
  110. package/dist/api/nexa/NexaSignTransaction.d.ts +2 -9
  111. package/dist/api/nexa/NexaSignTransaction.d.ts.map +1 -1
  112. package/dist/api/polkadot/PolkadotGetAddress.d.ts +3 -0
  113. package/dist/api/polkadot/PolkadotGetAddress.d.ts.map +1 -1
  114. package/dist/api/polkadot/networks.d.ts +3 -0
  115. package/dist/api/polkadot/networks.d.ts.map +1 -1
  116. package/dist/api/protocol-v2/DevReboot.d.ts +7 -0
  117. package/dist/api/protocol-v2/DevReboot.d.ts.map +1 -0
  118. package/dist/api/protocol-v2/DeviceFirmwareUpdate.d.ts +7 -0
  119. package/dist/api/protocol-v2/DeviceFirmwareUpdate.d.ts.map +1 -0
  120. package/dist/api/protocol-v2/DeviceGetDeviceInfo.d.ts +29 -0
  121. package/dist/api/protocol-v2/DeviceGetDeviceInfo.d.ts.map +1 -0
  122. package/dist/api/protocol-v2/DeviceGetFirmwareUpdateStatus.d.ts +6 -0
  123. package/dist/api/protocol-v2/DeviceGetFirmwareUpdateStatus.d.ts.map +1 -0
  124. package/dist/api/protocol-v2/DeviceGetOnboardingStatus.d.ts +6 -0
  125. package/dist/api/protocol-v2/DeviceGetOnboardingStatus.d.ts.map +1 -0
  126. package/dist/api/protocol-v2/DeviceReboot.d.ts +7 -0
  127. package/dist/api/protocol-v2/DeviceReboot.d.ts.map +1 -0
  128. package/dist/api/protocol-v2/FactoryDeviceInfoSettings.d.ts +7 -0
  129. package/dist/api/protocol-v2/FactoryDeviceInfoSettings.d.ts.map +1 -0
  130. package/dist/api/protocol-v2/FactoryGetDeviceInfo.d.ts +6 -0
  131. package/dist/api/protocol-v2/FactoryGetDeviceInfo.d.ts.map +1 -0
  132. package/dist/api/protocol-v2/FilesystemDiskControl.d.ts +13 -0
  133. package/dist/api/protocol-v2/FilesystemDiskControl.d.ts.map +1 -0
  134. package/dist/api/protocol-v2/FilesystemFixPermission.d.ts +6 -0
  135. package/dist/api/protocol-v2/FilesystemFixPermission.d.ts.map +1 -0
  136. package/dist/api/protocol-v2/FilesystemFormat.d.ts +6 -0
  137. package/dist/api/protocol-v2/FilesystemFormat.d.ts.map +1 -0
  138. package/dist/api/protocol-v2/GetProtoVersion.d.ts +6 -0
  139. package/dist/api/protocol-v2/GetProtoVersion.d.ts.map +1 -0
  140. package/dist/api/protocol-v2/Ping.d.ts +8 -0
  141. package/dist/api/protocol-v2/Ping.d.ts.map +1 -0
  142. package/dist/api/protocol-v2/helpers.d.ts +34 -0
  143. package/dist/api/protocol-v2/helpers.d.ts.map +1 -0
  144. package/dist/api/scdo/ScdoGetAddress.d.ts +2 -6
  145. package/dist/api/scdo/ScdoGetAddress.d.ts.map +1 -1
  146. package/dist/api/scdo/ScdoSignMessage.d.ts +2 -5
  147. package/dist/api/scdo/ScdoSignMessage.d.ts.map +1 -1
  148. package/dist/api/scdo/ScdoSignTransaction.d.ts +2 -5
  149. package/dist/api/scdo/ScdoSignTransaction.d.ts.map +1 -1
  150. package/dist/api/solana/SolGetAddress.d.ts +1 -0
  151. package/dist/api/solana/SolGetAddress.d.ts.map +1 -1
  152. package/dist/api/solana/SolSignMessage.d.ts +3 -0
  153. package/dist/api/solana/SolSignMessage.d.ts.map +1 -1
  154. package/dist/api/solana/SolSignOffchainMessage.d.ts +3 -0
  155. package/dist/api/solana/SolSignOffchainMessage.d.ts.map +1 -1
  156. package/dist/api/solana/SolSignTransaction.d.ts +6 -0
  157. package/dist/api/solana/SolSignTransaction.d.ts.map +1 -1
  158. package/dist/api/stellar/StellarGetAddress.d.ts +2 -1
  159. package/dist/api/stellar/StellarGetAddress.d.ts.map +1 -1
  160. package/dist/api/stellar/StellarSignTransaction.d.ts +3 -2
  161. package/dist/api/stellar/StellarSignTransaction.d.ts.map +1 -1
  162. package/dist/api/sui/SuiGetAddress.d.ts +3 -0
  163. package/dist/api/sui/SuiGetAddress.d.ts.map +1 -1
  164. package/dist/api/sui/SuiGetPublicKey.d.ts +3 -0
  165. package/dist/api/sui/SuiGetPublicKey.d.ts.map +1 -1
  166. package/dist/api/sui/SuiSignMessage.d.ts +3 -0
  167. package/dist/api/sui/SuiSignMessage.d.ts.map +1 -1
  168. package/dist/api/sui/SuiSignTransaction.d.ts +5 -2
  169. package/dist/api/sui/SuiSignTransaction.d.ts.map +1 -1
  170. package/dist/api/ton/TonGetAddress.d.ts +3 -0
  171. package/dist/api/ton/TonGetAddress.d.ts.map +1 -1
  172. package/dist/api/ton/TonSignData.d.ts +5 -0
  173. package/dist/api/ton/TonSignData.d.ts.map +1 -1
  174. package/dist/api/ton/TonSignMessage.d.ts +3 -0
  175. package/dist/api/ton/TonSignMessage.d.ts.map +1 -1
  176. package/dist/api/ton/TonSignProof.d.ts +3 -0
  177. package/dist/api/ton/TonSignProof.d.ts.map +1 -1
  178. package/dist/api/tron/TronSignMessage.d.ts +4 -0
  179. package/dist/api/tron/TronSignMessage.d.ts.map +1 -1
  180. package/dist/api/tron/TronSignTransaction.d.ts +4 -0
  181. package/dist/api/tron/TronSignTransaction.d.ts.map +1 -1
  182. package/dist/core/index.d.ts.map +1 -1
  183. package/dist/data-manager/DataManager.d.ts +7 -4
  184. package/dist/data-manager/DataManager.d.ts.map +1 -1
  185. package/dist/data-manager/MessagesConfig.d.ts +2 -2
  186. package/dist/data-manager/MessagesConfig.d.ts.map +1 -1
  187. package/dist/data-manager/TransportManager.d.ts +5 -4
  188. package/dist/data-manager/TransportManager.d.ts.map +1 -1
  189. package/dist/device/Device.d.ts +36 -10
  190. package/dist/device/Device.d.ts.map +1 -1
  191. package/dist/device/DeviceCommands.d.ts +9 -9
  192. package/dist/device/DeviceCommands.d.ts.map +1 -1
  193. package/dist/device/DeviceConnector.d.ts +2 -1
  194. package/dist/device/DeviceConnector.d.ts.map +1 -1
  195. package/dist/deviceProfile/buildDeviceProfile.d.ts +22 -0
  196. package/dist/deviceProfile/buildDeviceProfile.d.ts.map +1 -0
  197. package/dist/deviceProfile/index.d.ts +3 -0
  198. package/dist/deviceProfile/index.d.ts.map +1 -0
  199. package/dist/deviceProfile/legacyFeaturesView.d.ts +5 -0
  200. package/dist/deviceProfile/legacyFeaturesView.d.ts.map +1 -0
  201. package/dist/events/logBlockEvent.d.ts +1 -0
  202. package/dist/events/logBlockEvent.d.ts.map +1 -1
  203. package/dist/events/ui-request.d.ts +8 -0
  204. package/dist/events/ui-request.d.ts.map +1 -1
  205. package/dist/index.d.ts +720 -382
  206. package/dist/index.js +17634 -1201
  207. package/dist/inject.d.ts.map +1 -1
  208. package/dist/protocols/protocol-v2/features.d.ts +93 -0
  209. package/dist/protocols/protocol-v2/features.d.ts.map +1 -0
  210. package/dist/protocols/protocol-v2/firmware.d.ts +13 -0
  211. package/dist/protocols/protocol-v2/firmware.d.ts.map +1 -0
  212. package/dist/protocols/protocol-v2/index.d.ts +4 -0
  213. package/dist/protocols/protocol-v2/index.d.ts.map +1 -0
  214. package/dist/types/api/export.d.ts +1 -1
  215. package/dist/types/api/export.d.ts.map +1 -1
  216. package/dist/types/api/firmwareUpdate.d.ts +27 -0
  217. package/dist/types/api/firmwareUpdate.d.ts.map +1 -1
  218. package/dist/types/api/getDeviceInfo.d.ts +85 -0
  219. package/dist/types/api/getDeviceInfo.d.ts.map +1 -0
  220. package/dist/types/api/getPassphraseState.d.ts +10 -1
  221. package/dist/types/api/getPassphraseState.d.ts.map +1 -1
  222. package/dist/types/api/index.d.ts +37 -1
  223. package/dist/types/api/index.d.ts.map +1 -1
  224. package/dist/types/api/protocolV2.d.ts +103 -0
  225. package/dist/types/api/protocolV2.d.ts.map +1 -0
  226. package/dist/types/api/searchDevices.d.ts +2 -2
  227. package/dist/types/api/searchDevices.d.ts.map +1 -1
  228. package/dist/types/device.d.ts +10 -3
  229. package/dist/types/device.d.ts.map +1 -1
  230. package/dist/types/params.d.ts +2 -0
  231. package/dist/types/params.d.ts.map +1 -1
  232. package/dist/types/settings.d.ts +1 -1
  233. package/dist/types/settings.d.ts.map +1 -1
  234. package/dist/utils/deviceFeaturesUtils.d.ts +6 -8
  235. package/dist/utils/deviceFeaturesUtils.d.ts.map +1 -1
  236. package/dist/utils/deviceInfoUtils.d.ts +1 -0
  237. package/dist/utils/deviceInfoUtils.d.ts.map +1 -1
  238. package/dist/utils/index.d.ts +1 -1
  239. package/dist/utils/index.d.ts.map +1 -1
  240. package/dist/utils/patch.d.ts +1 -1
  241. package/dist/utils/patch.d.ts.map +1 -1
  242. package/package.json +4 -4
  243. package/src/api/BaseMethod.ts +26 -22
  244. package/src/api/DirList.ts +31 -0
  245. package/src/api/DirMake.ts +23 -0
  246. package/src/api/DirRemove.ts +23 -0
  247. package/src/api/FileDelete.ts +23 -0
  248. package/src/api/FileRead.ts +167 -0
  249. package/src/api/FileWrite.ts +216 -0
  250. package/src/api/FirmwareUpdate.ts +13 -5
  251. package/src/api/FirmwareUpdateV2.ts +21 -25
  252. package/src/api/FirmwareUpdateV3.ts +17 -4
  253. package/src/api/FirmwareUpdateV4.ts +827 -0
  254. package/src/api/GetDeviceInfo.ts +152 -0
  255. package/src/api/GetFeatures.ts +5 -2
  256. package/src/api/GetOnekeyFeatures.ts +95 -3
  257. package/src/api/GetPassphraseState.ts +16 -10
  258. package/src/api/PathInfo.ts +39 -0
  259. package/src/api/PromptWebDeviceAccess.ts +11 -1
  260. package/src/api/SearchDevices.ts +7 -2
  261. package/src/api/alephium/AlephiumGetAddress.ts +6 -2
  262. package/src/api/alephium/AlephiumSignMessage.ts +6 -1
  263. package/src/api/alephium/AlephiumSignTransaction.ts +15 -4
  264. package/src/api/allnetwork/AllNetworkGetAddressBase.ts +21 -13
  265. package/src/api/aptos/AptosGetAddress.ts +2 -3
  266. package/src/api/benfen/BenfenGetAddress.ts +11 -7
  267. package/src/api/benfen/BenfenGetPublicKey.ts +6 -2
  268. package/src/api/benfen/BenfenSignMessage.ts +6 -1
  269. package/src/api/benfen/BenfenSignTransaction.ts +6 -1
  270. package/src/api/btc/BTCGetPublicKey.ts +3 -2
  271. package/src/api/btc/BTCSignPsbt.ts +1 -2
  272. package/src/api/btc/helpers/versionLimit.ts +7 -1
  273. package/src/api/cardano/CardanoSignTransaction.ts +2 -4
  274. package/src/api/conflux/ConfluxSignTransaction.ts +5 -2
  275. package/src/api/device/DeviceFullyUploadResource.ts +3 -3
  276. package/src/api/device/DeviceLock.ts +1 -3
  277. package/src/api/device/DeviceRebootToBoardloader.ts +10 -1
  278. package/src/api/device/DeviceRebootToBootloader.ts +10 -1
  279. package/src/api/device/DeviceSupportFeatures.ts +2 -13
  280. package/src/api/device/DeviceUpdateBootloader.ts +4 -4
  281. package/src/api/device/DeviceUploadResource.ts +4 -5
  282. package/src/api/device/DeviceVerify.ts +1 -2
  283. package/src/api/dynex/DnxGetAddress.ts +6 -0
  284. package/src/api/dynex/DnxSignTransaction.ts +6 -0
  285. package/src/api/evm/EVMGetAddress.ts +1 -1
  286. package/src/api/evm/EVMGetPublicKey.ts +3 -4
  287. package/src/api/evm/EVMSignMessage.ts +1 -1
  288. package/src/api/evm/EVMSignMessageEIP712.ts +14 -1
  289. package/src/api/evm/EVMSignTransaction.ts +1 -1
  290. package/src/api/evm/EVMSignTypedData.ts +32 -18
  291. package/src/api/evm/EVMVerifyMessage.ts +1 -1
  292. package/src/api/evm/latest/signTypedHash.ts +2 -4
  293. package/src/api/evm/legacyV1/getAddress.ts +5 -3
  294. package/src/api/evm/legacyV1/getPublicKey.ts +5 -3
  295. package/src/api/evm/legacyV1/signMessage.ts +5 -3
  296. package/src/api/evm/legacyV1/signTypedData.ts +9 -8
  297. package/src/api/evm/legacyV1/signTypedHash.ts +7 -7
  298. package/src/api/evm/legacyV1/verifyMessage.ts +5 -3
  299. package/src/api/firmware/FirmwareUpdateBaseMethod.ts +8 -8
  300. package/src/api/firmware/uploadFirmware.ts +3 -10
  301. package/src/api/helpers/batchGetPublickeys.ts +51 -6
  302. package/src/api/helpers/filesystemValidation.ts +51 -0
  303. package/src/api/index.ts +34 -0
  304. package/src/api/kaspa/KaspaSignTransaction.ts +4 -5
  305. package/src/api/lightning/LnurlAuth.ts +4 -0
  306. package/src/api/neo/NeoGetAddress.ts +6 -1
  307. package/src/api/neo/NeoSignTransaction.ts +6 -1
  308. package/src/api/nervos/NervosGetAddress.ts +6 -2
  309. package/src/api/nervos/NervosSignTransaction.ts +14 -4
  310. package/src/api/nexa/NexaGetAddress.ts +6 -2
  311. package/src/api/nexa/NexaSignTransaction.ts +11 -12
  312. package/src/api/polkadot/networks.ts +9 -0
  313. package/src/api/protocol-v2/DevReboot.ts +24 -0
  314. package/src/api/protocol-v2/DeviceFirmwareUpdate.ts +63 -0
  315. package/src/api/protocol-v2/DeviceGetDeviceInfo.ts +118 -0
  316. package/src/api/protocol-v2/DeviceGetFirmwareUpdateStatus.ts +20 -0
  317. package/src/api/protocol-v2/DeviceGetOnboardingStatus.ts +16 -0
  318. package/src/api/protocol-v2/DeviceReboot.ts +24 -0
  319. package/src/api/protocol-v2/FactoryDeviceInfoSettings.ts +29 -0
  320. package/src/api/protocol-v2/FactoryGetDeviceInfo.ts +20 -0
  321. package/src/api/protocol-v2/FilesystemDiskControl.ts +50 -0
  322. package/src/api/protocol-v2/FilesystemFixPermission.ts +16 -0
  323. package/src/api/protocol-v2/FilesystemFormat.ts +16 -0
  324. package/src/api/protocol-v2/GetProtoVersion.ts +16 -0
  325. package/src/api/protocol-v2/Ping.ts +18 -0
  326. package/src/api/protocol-v2/helpers.ts +207 -0
  327. package/src/api/scdo/ScdoGetAddress.ts +6 -2
  328. package/src/api/scdo/ScdoSignMessage.ts +6 -1
  329. package/src/api/scdo/ScdoSignTransaction.ts +6 -2
  330. package/src/api/solana/SolGetAddress.ts +4 -0
  331. package/src/api/solana/SolSignMessage.ts +3 -0
  332. package/src/api/solana/SolSignOffchainMessage.ts +3 -0
  333. package/src/api/solana/SolSignTransaction.ts +6 -0
  334. package/src/api/stellar/StellarGetAddress.ts +10 -1
  335. package/src/api/stellar/StellarSignTransaction.ts +14 -1
  336. package/src/api/sui/SuiGetAddress.ts +5 -3
  337. package/src/api/sui/SuiGetPublicKey.ts +3 -0
  338. package/src/api/sui/SuiSignMessage.ts +3 -0
  339. package/src/api/sui/SuiSignTransaction.ts +14 -12
  340. package/src/api/ton/TonGetAddress.ts +3 -0
  341. package/src/api/ton/TonSignData.ts +10 -3
  342. package/src/api/ton/TonSignMessage.ts +6 -5
  343. package/src/api/ton/TonSignProof.ts +3 -0
  344. package/src/api/tron/TronSignMessage.ts +5 -1
  345. package/src/api/tron/TronSignTransaction.ts +4 -0
  346. package/src/api/xrp/XrpSignTransaction.ts +1 -1
  347. package/src/core/index.ts +87 -55
  348. package/src/data/messages/messages-protocol-v2.json +13369 -0
  349. package/src/data-manager/DataManager.ts +12 -7
  350. package/src/data-manager/MessagesConfig.ts +14 -14
  351. package/src/data-manager/TransportManager.ts +38 -12
  352. package/src/device/Device.ts +538 -61
  353. package/src/device/DeviceCommands.ts +195 -29
  354. package/src/device/DeviceConnector.ts +29 -4
  355. package/src/device/DevicePool.ts +7 -7
  356. package/src/deviceProfile/buildDeviceProfile.ts +387 -0
  357. package/src/deviceProfile/index.ts +2 -0
  358. package/src/deviceProfile/legacyFeaturesView.ts +123 -0
  359. package/src/events/logBlockEvent.ts +23 -0
  360. package/src/events/ui-request.ts +8 -0
  361. package/src/inject.ts +52 -1
  362. package/src/protocols/protocol-v2/features.ts +180 -0
  363. package/src/protocols/protocol-v2/firmware.ts +43 -0
  364. package/src/protocols/protocol-v2/index.ts +16 -0
  365. package/src/types/api/export.ts +1 -0
  366. package/src/types/api/firmwareUpdate.ts +49 -0
  367. package/src/types/api/getDeviceInfo.ts +99 -0
  368. package/src/types/api/getPassphraseState.ts +13 -2
  369. package/src/types/api/index.ts +88 -1
  370. package/src/types/api/protocolV2.ts +201 -0
  371. package/src/types/api/searchDevices.ts +2 -2
  372. package/src/types/device.ts +37 -3
  373. package/src/types/params.ts +7 -0
  374. package/src/types/settings.ts +1 -1
  375. package/src/utils/deviceFeaturesUtils.ts +70 -70
  376. package/src/utils/deviceInfoUtils.ts +15 -8
  377. package/src/utils/index.ts +1 -0
@@ -2,7 +2,7 @@ import { ERRORS, HardwareError, HardwareErrorCode } from '@onekeyfe/hd-shared';
2
2
 
3
3
  import TransportManager from '../data-manager/TransportManager';
4
4
  import DataManager from '../data-manager/DataManager';
5
- import { LoggerNames, getDeviceType, getLogger, patchFeatures } from '../utils';
5
+ import { LoggerNames, getLogger, patchFeatures } from '../utils';
6
6
  import { DEVICE, type PassphraseRequestPayload } from '../events';
7
7
  import { DeviceModelToTypes } from '../types';
8
8
  import {
@@ -12,7 +12,12 @@ import {
12
12
  } from '../utils/tracing';
13
13
 
14
14
  import type { Device } from './Device';
15
- import type { FailureType, Messages, Transport } from '@onekeyfe/hd-transport';
15
+ import type {
16
+ FailureType,
17
+ Messages,
18
+ Transport,
19
+ TransportCallOptions,
20
+ } from '@onekeyfe/hd-transport';
16
21
 
17
22
  export type PassphrasePromptResponse = {
18
23
  passphrase?: string;
@@ -22,15 +27,132 @@ export type PassphrasePromptResponse = {
22
27
  };
23
28
 
24
29
  type MessageType = Messages.MessageType;
25
- type MessageKey = keyof MessageType;
30
+ type MessageKey = Extract<keyof MessageType, string>;
26
31
  export type TypedResponseMessage<T extends MessageKey> = {
27
32
  type: T;
28
33
  message: MessageType[T];
29
34
  };
30
35
  type TypedCallResponseMap = {
31
- [K in keyof MessageType]: TypedResponseMessage<K>;
36
+ [K in MessageKey]: TypedResponseMessage<K>;
37
+ };
38
+ export type DefaultMessageResponse = TypedCallResponseMap[MessageKey];
39
+
40
+ const MAX_DEBUG_ARRAY_ITEMS = 20;
41
+ const MAX_DEBUG_OBJECT_KEYS = 40;
42
+ const MAX_DEBUG_STRING_LENGTH = 512;
43
+ const MAX_DEBUG_DEPTH = 4;
44
+ const HIGH_VOLUME_DEBUG_CALLS = new Set([
45
+ 'FilesystemFileRead',
46
+ 'FilesystemFileWrite',
47
+ 'FileRead',
48
+ 'FileWrite',
49
+ 'EmmcFileRead',
50
+ 'EmmcFileWrite',
51
+ 'FirmwareUpload',
52
+ 'ResourceAck',
53
+ ]);
54
+
55
+ function shouldReduceDebugForCall(type: string) {
56
+ return HIGH_VOLUME_DEBUG_CALLS.has(type);
57
+ }
58
+
59
+ function getBinaryByteLength(value: unknown): number | undefined {
60
+ if (value instanceof ArrayBuffer) {
61
+ return value.byteLength;
62
+ }
63
+
64
+ if (ArrayBuffer.isView(value)) {
65
+ return value.byteLength;
66
+ }
67
+
68
+ if (typeof Blob !== 'undefined' && value instanceof Blob) {
69
+ return value.size;
70
+ }
71
+
72
+ return undefined;
73
+ }
74
+
75
+ function summarizeRedactedData(value: unknown): string {
76
+ const byteLength = getBinaryByteLength(value);
77
+ if (byteLength !== undefined) {
78
+ return `[redacted data: ${byteLength} bytes]`;
79
+ }
80
+
81
+ if (typeof value === 'string') {
82
+ return `[redacted data: string length=${value.length}]`;
83
+ }
84
+
85
+ if (Array.isArray(value)) {
86
+ return `[redacted data: array length=${value.length}]`;
87
+ }
88
+
89
+ if (value && typeof value === 'object') {
90
+ return `[redacted data: object keys=${Object.keys(value).length}]`;
91
+ }
92
+
93
+ return `[redacted data: ${typeof value}]`;
94
+ }
95
+
96
+ function sanitizeDebugPayload(value: unknown, key = '', depth = 0): unknown {
97
+ if (key === 'data' && value !== null && value !== undefined) {
98
+ return summarizeRedactedData(value);
99
+ }
100
+
101
+ const byteLength = getBinaryByteLength(value);
102
+ if (byteLength !== undefined) {
103
+ return `[binary: ${byteLength} bytes]`;
104
+ }
105
+
106
+ if (typeof value === 'string') {
107
+ return value.length > MAX_DEBUG_STRING_LENGTH
108
+ ? `${value.slice(0, MAX_DEBUG_STRING_LENGTH)}... (len=${value.length})`
109
+ : value;
110
+ }
111
+
112
+ if (!value || typeof value !== 'object') {
113
+ return value;
114
+ }
115
+
116
+ if (depth >= MAX_DEBUG_DEPTH) {
117
+ return Array.isArray(value)
118
+ ? `[array length=${value.length}]`
119
+ : `[object keys=${Object.keys(value).length}]`;
120
+ }
121
+
122
+ if (Array.isArray(value)) {
123
+ const items = value
124
+ .slice(0, MAX_DEBUG_ARRAY_ITEMS)
125
+ .map(item => sanitizeDebugPayload(item, key, depth + 1));
126
+ if (value.length > MAX_DEBUG_ARRAY_ITEMS) {
127
+ items.push(`... (${value.length - MAX_DEBUG_ARRAY_ITEMS} more)`);
128
+ }
129
+ return items;
130
+ }
131
+
132
+ const entries = Object.entries(value).slice(0, MAX_DEBUG_OBJECT_KEYS);
133
+ const sanitized: Record<string, unknown> = {};
134
+ entries.forEach(([entryKey, entryValue]) => {
135
+ sanitized[entryKey] = sanitizeDebugPayload(entryValue, entryKey, depth + 1);
136
+ });
137
+ if (Object.keys(value).length > MAX_DEBUG_OBJECT_KEYS) {
138
+ sanitized.__truncated__ = `${Object.keys(value).length - MAX_DEBUG_OBJECT_KEYS} more keys`;
139
+ }
140
+ return sanitized;
141
+ }
142
+
143
+ /**
144
+ * 交互式 Ack(ButtonAck / PinMatrixAck / PassphraseAck 等)不应继承原调用的
145
+ * timeoutMs:设备在等待用户操作(确认、输入 PIN/passphrase),思考时间不可预估,
146
+ * 沿用业务调用的超时会把用户操作截断。仅保留 expectedTypes / intermediateTypes
147
+ * 等与响应类型相关的选项。
148
+ */
149
+ const stripInteractiveAckTimeout = (
150
+ options?: TransportCallOptions
151
+ ): TransportCallOptions | undefined => {
152
+ if (!options) return options;
153
+ const { timeoutMs: _timeoutMs, ...rest } = options;
154
+ return rest;
32
155
  };
33
- export type DefaultMessageResponse = TypedCallResponseMap[keyof MessageType];
34
156
 
35
157
  const assertType = (res: DefaultMessageResponse, resType: string | string[]) => {
36
158
  const splitResTypes = Array.isArray(resType) ? resType : resType.split('|');
@@ -224,17 +346,21 @@ export class DeviceCommands {
224
346
  // Sends an async message to the opened device.
225
347
  async call(
226
348
  type: MessageKey,
227
- msg: DefaultMessageResponse['message'] = {}
349
+ msg?: DefaultMessageResponse['message'],
350
+ options?: TransportCallOptions
228
351
  ): Promise<DefaultMessageResponse> {
229
- Log.debug('[DeviceCommands] [call] Sending', type);
352
+ const shouldReduceDebug = shouldReduceDebugForCall(type);
353
+ if (!shouldReduceDebug) {
354
+ Log.debug('[DeviceCommands] [call] Sending', type);
355
+ }
230
356
 
231
357
  try {
232
- const promise = this.transport.call(this.mainId, type, msg) as any;
358
+ const promise = this.transport.call(this.mainId, type, msg ?? {}, options) as any;
233
359
  this.callPromise = promise;
234
360
  const res = await promise;
235
361
  if (res.type === 'Failure') {
236
362
  LogCore.debug('[DeviceCommands] [call] Received', res.type, res.message);
237
- } else {
363
+ } else if (!shouldReduceDebug) {
238
364
  LogCore.debug('[DeviceCommands] [call] Received', res.type);
239
365
  }
240
366
  return res;
@@ -283,19 +409,22 @@ export class DeviceCommands {
283
409
  typedCall<T extends MessageKey, R extends MessageKey[]>(
284
410
  type: T,
285
411
  resType: R,
286
- msg?: MessageType[T]
412
+ msg?: MessageType[T],
413
+ options?: TransportCallOptions
287
414
  ): Promise<TypedCallResponseMap[R[number]]>;
288
415
 
289
416
  typedCall<T extends MessageKey, R extends MessageKey>(
290
417
  type: T,
291
418
  resType: R,
292
- msg?: MessageType[T]
419
+ msg?: MessageType[T],
420
+ options?: TransportCallOptions
293
421
  ): Promise<TypedResponseMessage<R>>;
294
422
 
295
423
  async typedCall(
296
424
  type: MessageKey,
297
425
  resType: MessageKey | MessageKey[],
298
- msg?: DefaultMessageResponse['message']
426
+ msg?: DefaultMessageResponse['message'],
427
+ options?: TransportCallOptions
299
428
  ) {
300
429
  if (this.disposed) {
301
430
  throw ERRORS.TypedError(
@@ -312,16 +441,28 @@ export class DeviceCommands {
312
441
  'PassphraseAck',
313
442
  'Cancel',
314
443
  'BixinPinInputOnDevice',
444
+ 'FilesystemFileRead',
445
+ 'FilesystemFileWrite',
446
+ 'FileRead',
447
+ 'FileWrite',
448
+ 'EmmcFileRead',
449
+ 'EmmcFileWrite',
450
+ 'FirmwareUpload',
451
+ 'ResourceAck',
315
452
  ] as any;
316
453
  if (!skipTypes.includes(type) && msg) {
317
454
  // Use debug channel to avoid noise escalation
318
- Log.debug('[DeviceCommands] [typedCall] Sending payload', type, msg);
455
+ Log.debug('[DeviceCommands] [typedCall] Sending payload', type, sanitizeDebugPayload(msg));
319
456
  }
320
457
  } catch (e) {
321
458
  // ignore logging errors
322
459
  }
323
460
 
324
- const response = await this._commonCall(type, msg);
461
+ const expectedTypes = Array.isArray(resType) ? resType : resType.split('|');
462
+ const response = await this._commonCall(type, msg, {
463
+ ...options,
464
+ expectedTypes: options?.expectedTypes ?? expectedTypes,
465
+ });
325
466
  try {
326
467
  assertType(response, resType);
327
468
  } catch (error) {
@@ -334,6 +475,12 @@ export class DeviceCommands {
334
475
  // throw bridge network error
335
476
  if (error instanceof HardwareError) {
336
477
  if (error.errorCode === HardwareErrorCode.ResponseUnexpectTypeError) {
478
+ Log.debug('[DeviceCommands] [typedCall] Unexpected response type', {
479
+ request: type,
480
+ expected: resType,
481
+ received: response.type,
482
+ response: sanitizeDebugPayload(response.message),
483
+ });
337
484
  // Do not intercept CallMethodError
338
485
  // Do not intercept “assertType: Response of unexpected type” error
339
486
  // Blocking the above two messages will not know what the specific error message is, and the specific error should be handled by the subsequent business logic.
@@ -347,7 +494,7 @@ export class DeviceCommands {
347
494
  if (error.message.indexOf('BridgeDeviceDisconnected') > -1) {
348
495
  throw ERRORS.TypedError(HardwareErrorCode.BridgeDeviceDisconnected);
349
496
  }
350
- throw ERRORS.TypedError(HardwareErrorCode.ResponseUnexpectTypeError);
497
+ throw error;
351
498
  }
352
499
  } else {
353
500
  // throw error anyway, next call should be resolved properly// throw error anyway, next call should be resolved properly
@@ -357,20 +504,27 @@ export class DeviceCommands {
357
504
  return response;
358
505
  }
359
506
 
360
- async _commonCall(type: MessageKey, msg?: DefaultMessageResponse['message']) {
361
- const resp = await this.call(type, msg);
362
- return this._filterCommonTypes(resp, type);
507
+ async _commonCall(
508
+ type: MessageKey,
509
+ msg?: DefaultMessageResponse['message'],
510
+ options?: TransportCallOptions
511
+ ) {
512
+ const resp = await this.call(type, msg, options);
513
+ return this._filterCommonTypes(resp, type, options);
363
514
  }
364
515
 
365
516
  _filterCommonTypes(
366
517
  res: DefaultMessageResponse,
367
- callType: MessageKey
518
+ callType: MessageKey,
519
+ options?: TransportCallOptions
368
520
  ): Promise<DefaultMessageResponse> {
369
521
  try {
370
- if (DataManager.getSettings('env') === 'react-native') {
371
- Log.debug('_filterCommonTypes: ', JSON.stringify(res));
522
+ if (shouldReduceDebugForCall(callType)) {
523
+ // 高频文件写入每个 chunk 都会经过这里,避免 debug log 反向拖慢传输。
524
+ } else if (DataManager.getSettings('env') === 'react-native') {
525
+ Log.debug('_filterCommonTypes: ', JSON.stringify(sanitizeDebugPayload(res)));
372
526
  } else {
373
- Log.debug('_filterCommonTypes: ', res);
527
+ Log.debug('_filterCommonTypes: ', sanitizeDebugPayload(res));
374
528
  }
375
529
  } catch (error) {
376
530
  // ignore
@@ -461,7 +615,7 @@ export class DeviceCommands {
461
615
  }
462
616
 
463
617
  if (res.type === 'ButtonRequest') {
464
- const deviceType = getDeviceType(this.device.features);
618
+ const deviceType = this.device.getCurrentDeviceType();
465
619
  if (DeviceModelToTypes.model_mini.includes(deviceType)) {
466
620
  this.device.setCancelableAction(() => this.cancelDeviceOnOneKeyDevice());
467
621
  } else {
@@ -472,7 +626,7 @@ export class DeviceCommands {
472
626
  } else {
473
627
  this.device.emit(DEVICE.BUTTON, this.device, res.message);
474
628
  }
475
- return this._commonCall('ButtonAck', {});
629
+ return this._commonCall('ButtonAck', {}, stripInteractiveAckTimeout(options));
476
630
  }
477
631
 
478
632
  if (res.type === 'EntropyRequest') {
@@ -485,11 +639,15 @@ export class DeviceCommands {
485
639
  if (pin === '@@ONEKEY_INPUT_PIN_IN_DEVICE') {
486
640
  // only classic\1s\mini\pure
487
641
  this.device.setCancelableAction(() => this.cancelDeviceOnOneKeyDevice());
488
- return this._commonCall('BixinPinInputOnDevice').finally(() => {
642
+ return this._commonCall(
643
+ 'BixinPinInputOnDevice',
644
+ {},
645
+ stripInteractiveAckTimeout(options)
646
+ ).finally(() => {
489
647
  this.device.clearCancelableAction();
490
648
  });
491
649
  }
492
- return this._commonCall('PinMatrixAck', { pin });
650
+ return this._commonCall('PinMatrixAck', { pin }, stripInteractiveAckTimeout(options));
493
651
  },
494
652
  error => Promise.reject(error)
495
653
  );
@@ -504,12 +662,20 @@ export class DeviceCommands {
504
662
 
505
663
  // Attach PIN on device
506
664
  if (attachPinOnDevice && existsAttachPinUser) {
507
- return this._commonCall('PassphraseAck', { on_device_attach_pin: true });
665
+ return this._commonCall(
666
+ 'PassphraseAck',
667
+ { on_device_attach_pin: true },
668
+ stripInteractiveAckTimeout(options)
669
+ );
508
670
  }
509
671
 
510
672
  return !passphraseOnDevice
511
- ? this._commonCall('PassphraseAck', { passphrase })
512
- : this._commonCall('PassphraseAck', { on_device: true });
673
+ ? this._commonCall('PassphraseAck', { passphrase }, stripInteractiveAckTimeout(options))
674
+ : this._commonCall(
675
+ 'PassphraseAck',
676
+ { on_device: true },
677
+ stripInteractiveAckTimeout(options)
678
+ );
513
679
  });
514
680
  }
515
681
 
@@ -1,3 +1,5 @@
1
+ import { ERRORS, HardwareErrorCode } from '@onekeyfe/hd-shared';
2
+
1
3
  import { safeThrowError } from '../constants';
2
4
  import { DataManager } from '../data-manager';
3
5
  import TransportManager from '../data-manager/TransportManager';
@@ -6,6 +8,7 @@ import { resolveAfter } from '../utils/promiseUtils';
6
8
  import { LoggerNames, getLogger } from '../utils';
7
9
 
8
10
  import type { DeviceDescriptorDiff } from './DevicePool';
11
+ import type { HardwareConnectProtocol } from '@onekeyfe/hd-shared';
9
12
  import type { OneKeyDeviceInfo as DeviceDescriptor, Transport } from '@onekeyfe/hd-transport';
10
13
 
11
14
  const Log = getLogger(LoggerNames.DeviceConnector);
@@ -75,15 +78,37 @@ export default class DeviceConnector {
75
78
  this.listening = false;
76
79
  }
77
80
 
78
- async acquire(path: string, session?: string | null, forceCleanRunPromise?: boolean) {
79
- Log.debug('acquire', path, session);
81
+ async acquire(
82
+ path: string,
83
+ session?: string | null,
84
+ forceCleanRunPromise?: boolean,
85
+ connectProtocol?: HardwareConnectProtocol
86
+ ) {
87
+ Log.debug('acquire', path, session, connectProtocol);
80
88
  const env = DataManager.getSettings('env');
81
89
  try {
82
90
  let res;
83
91
  if (DataManager.isBleConnect(env)) {
84
- res = await this.transport.acquire({ uuid: path, forceCleanRunPromise });
92
+ res = await this.transport.acquire({
93
+ uuid: path,
94
+ forceCleanRunPromise,
95
+ expectedProtocol: connectProtocol,
96
+ });
85
97
  } else {
86
- res = await this.transport.acquire({ path, previous: session ?? null });
98
+ res = await this.transport.acquire({
99
+ path,
100
+ previous: session ?? null,
101
+ expectedProtocol: connectProtocol,
102
+ });
103
+ }
104
+ if (connectProtocol) {
105
+ const detectedProtocol = this.transport.getProtocolType(path);
106
+ if (detectedProtocol !== connectProtocol) {
107
+ throw ERRORS.TypedError(
108
+ HardwareErrorCode.RuntimeError,
109
+ `Device protocol mismatch: expected ${connectProtocol}, detected ${detectedProtocol}`
110
+ );
111
+ }
87
112
  }
88
113
  return res;
89
114
  } catch (error) {
@@ -3,7 +3,7 @@ import EventEmitter from 'events';
3
3
  // eslint-disable-next-line import/no-cycle
4
4
  import { Device } from './Device';
5
5
  import { DEVICE } from '../events';
6
- import { LoggerNames, getDeviceUUID, getLogger } from '../utils';
6
+ import { LoggerNames, getLogger } from '../utils';
7
7
 
8
8
  import type { InitOptions } from './Device';
9
9
  import type { OneKeyDeviceInfo as DeviceDescriptor } from '@onekeyfe/hd-transport';
@@ -118,8 +118,8 @@ export class DevicePool extends EventEmitter {
118
118
  for await (const descriptor of descriptorList) {
119
119
  const device = await this._createDevice(descriptor, initOptions);
120
120
 
121
- if (device.features) {
122
- const uuid = getDeviceUUID(device.features);
121
+ const uuid = device.getCurrentSerialNo();
122
+ if (uuid) {
123
123
  if (this.devicesCache[uuid]) {
124
124
  const cache = this.devicesCache[uuid];
125
125
  cache.updateDescriptor(descriptor, true);
@@ -150,7 +150,7 @@ export class DevicePool extends EventEmitter {
150
150
  if (!device) {
151
151
  device = Device.fromDescriptor(descriptor);
152
152
  device.deviceConnector = this.connector;
153
- await device.connect();
153
+ await device.connect(initOptions?.connectProtocol);
154
154
  await device.initialize(initOptions);
155
155
  await device.release();
156
156
  }
@@ -166,7 +166,7 @@ export class DevicePool extends EventEmitter {
166
166
  for (let i = this.connectedPool.length - 1; i >= 0; i--) {
167
167
  const descriptor = this.connectedPool[i];
168
168
  const device = await this._createDevice(descriptor, initOptions);
169
- Log.debug('emit DEVICE.CONNECT: ', device?.features);
169
+ Log.debug('emit DEVICE.CONNECT: ', device?.profile ?? device?.features);
170
170
  this.emitter.emit(DEVICE.CONNECT, device);
171
171
  this.connectedPool.splice(i, 1);
172
172
  }
@@ -203,7 +203,7 @@ export class DevicePool extends EventEmitter {
203
203
  this._addConnectedDeviceToPool(d);
204
204
  return;
205
205
  }
206
- Log.debug('emit DEVICE.CONNECT: ', device.features);
206
+ Log.debug('emit DEVICE.CONNECT: ', device.profile ?? device.features);
207
207
  this.emitter.emit(DEVICE.CONNECT, device);
208
208
  });
209
209
 
@@ -215,7 +215,7 @@ export class DevicePool extends EventEmitter {
215
215
  return;
216
216
  }
217
217
 
218
- Log.debug('emit DEVICE.DISCONNECT: ', device.features);
218
+ Log.debug('emit DEVICE.DISCONNECT: ', device.profile ?? device.features);
219
219
  this.emitter.emit(DEVICE.DISCONNECT, device);
220
220
  });
221
221
  }