@onekeyfe/hd-core 1.1.34-alpha.2 → 1.1.34-alpha.3

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 (613) hide show
  1. package/__tests__/AllNetworkGetAddressBase.tracing.test.ts +75 -0
  2. package/__tests__/DeviceCommands.test.ts +217 -0
  3. package/__tests__/RequestQueue.test.ts +140 -0
  4. package/__tests__/UploadPortfolio.test.ts +46 -0
  5. package/__tests__/connectSettings.test.ts +61 -0
  6. package/__tests__/device-lifecycle-events.test.ts +117 -0
  7. package/__tests__/device-pool-state.test.ts +132 -0
  8. package/__tests__/device-settings.test.ts +286 -0
  9. package/__tests__/device-state-mapper.test.ts +229 -0
  10. package/__tests__/device-utils.test.ts +106 -0
  11. package/__tests__/device-wallet-session-store.test.ts +191 -0
  12. package/__tests__/evmLedgerLegacySafety.test.ts +15 -4
  13. package/__tests__/evmSignTransaction.test.ts +1 -1
  14. package/__tests__/evmSignTypedData.test.ts +1 -1
  15. package/__tests__/filesystemValidation.test.ts +53 -0
  16. package/__tests__/firmware-update/firmware-artifact-source.test.ts +119 -0
  17. package/__tests__/firmware-update/firmware-checkpoint.test.ts +105 -0
  18. package/__tests__/firmware-update/firmware-host-binding.test.ts +73 -0
  19. package/__tests__/firmware-update/firmware-update-capabilities.test.ts +17 -0
  20. package/__tests__/firmware-update/firmware-update-plan.test.ts +358 -0
  21. package/__tests__/firmware-update/firmware-update-prepared-plan.test.ts +200 -0
  22. package/__tests__/firmware-update/firmware-update-recovery.test.ts +81 -0
  23. package/__tests__/firmware-update/firmware-update-v2-download-before-boot.test.ts +48 -31
  24. package/__tests__/firmware-update/firmware-upload-source.test.ts +70 -0
  25. package/__tests__/get-device-state.test.ts +403 -0
  26. package/__tests__/logBlockEvent.test.ts +61 -0
  27. package/__tests__/logger.test.ts +34 -0
  28. package/__tests__/open-wallet-session.test.ts +565 -0
  29. package/__tests__/preInitialize.test.ts +33 -0
  30. package/__tests__/pro2Wallpaper.test.ts +39 -0
  31. package/__tests__/protocol-v2-bootloader-mode.test.ts +37 -0
  32. package/__tests__/protocol-v2-firmware-targets.test.ts +19 -0
  33. package/__tests__/protocol-v2.test.ts +6008 -0
  34. package/__tests__/protocolV2FileWrite.test.ts +67 -0
  35. package/__tests__/public-pro2-api-boundary.test.ts +66 -0
  36. package/__tests__/search-devices.test.ts +136 -0
  37. package/dist/api/BaseMethod.d.ts +12 -0
  38. package/dist/api/BaseMethod.d.ts.map +1 -1
  39. package/dist/api/CheckAllFirmwareRelease.d.ts.map +1 -1
  40. package/dist/api/CheckBootloaderRelease.d.ts.map +1 -1
  41. package/dist/api/CheckFirmwareRelease.d.ts.map +1 -1
  42. package/dist/api/ClearSessionCache.d.ts +9 -0
  43. package/dist/api/ClearSessionCache.d.ts.map +1 -0
  44. package/dist/api/DirList.d.ts +10 -0
  45. package/dist/api/DirList.d.ts.map +1 -0
  46. package/dist/api/DirMake.d.ts +9 -0
  47. package/dist/api/DirMake.d.ts.map +1 -0
  48. package/dist/api/DirRemove.d.ts +9 -0
  49. package/dist/api/DirRemove.d.ts.map +1 -0
  50. package/dist/api/FileDelete.d.ts +9 -0
  51. package/dist/api/FileDelete.d.ts.map +1 -0
  52. package/dist/api/FileRead.d.ts +19 -0
  53. package/dist/api/FileRead.d.ts.map +1 -0
  54. package/dist/api/FileWrite.d.ts +25 -0
  55. package/dist/api/FileWrite.d.ts.map +1 -0
  56. package/dist/api/FirmwareUpdate.d.ts.map +1 -1
  57. package/dist/api/FirmwareUpdateV2.d.ts +14 -3
  58. package/dist/api/FirmwareUpdateV2.d.ts.map +1 -1
  59. package/dist/api/FirmwareUpdateV3.d.ts +10 -3
  60. package/dist/api/FirmwareUpdateV3.d.ts.map +1 -1
  61. package/dist/api/FirmwareUpdateV4.d.ts +75 -0
  62. package/dist/api/FirmwareUpdateV4.d.ts.map +1 -0
  63. package/dist/api/GetDeviceState.d.ts +7 -0
  64. package/dist/api/GetDeviceState.d.ts.map +1 -0
  65. package/dist/api/GetFeatures.d.ts +1 -1
  66. package/dist/api/GetFeatures.d.ts.map +1 -1
  67. package/dist/api/GetOnekeyFeatures.d.ts.map +1 -1
  68. package/dist/api/GetPassphraseState.d.ts.map +1 -1
  69. package/dist/api/OpenWalletSession.d.ts +14 -0
  70. package/dist/api/OpenWalletSession.d.ts.map +1 -0
  71. package/dist/api/PathInfo.d.ts +10 -0
  72. package/dist/api/PathInfo.d.ts.map +1 -0
  73. package/dist/api/PromptWebDeviceAccess.d.ts.map +1 -1
  74. package/dist/api/SearchDevices.d.ts +5 -1
  75. package/dist/api/SearchDevices.d.ts.map +1 -1
  76. package/dist/api/UploadPortfolio.d.ts +18 -0
  77. package/dist/api/UploadPortfolio.d.ts.map +1 -0
  78. package/dist/api/alephium/AlephiumGetAddress.d.ts +2 -6
  79. package/dist/api/alephium/AlephiumGetAddress.d.ts.map +1 -1
  80. package/dist/api/alephium/AlephiumSignMessage.d.ts +2 -5
  81. package/dist/api/alephium/AlephiumSignMessage.d.ts.map +1 -1
  82. package/dist/api/alephium/AlephiumSignTransaction.d.ts +5 -8
  83. package/dist/api/alephium/AlephiumSignTransaction.d.ts.map +1 -1
  84. package/dist/api/allnetwork/AllNetworkGetAddressBase.d.ts.map +1 -1
  85. package/dist/api/aptos/AptosGetAddress.d.ts.map +1 -1
  86. package/dist/api/benfen/BenfenGetAddress.d.ts +2 -9
  87. package/dist/api/benfen/BenfenGetAddress.d.ts.map +1 -1
  88. package/dist/api/benfen/BenfenGetPublicKey.d.ts +2 -9
  89. package/dist/api/benfen/BenfenGetPublicKey.d.ts.map +1 -1
  90. package/dist/api/benfen/BenfenSignMessage.d.ts +2 -8
  91. package/dist/api/benfen/BenfenSignMessage.d.ts.map +1 -1
  92. package/dist/api/benfen/BenfenSignTransaction.d.ts +2 -8
  93. package/dist/api/benfen/BenfenSignTransaction.d.ts.map +1 -1
  94. package/dist/api/btc/BTCGetAddress.d.ts +1 -11
  95. package/dist/api/btc/BTCGetAddress.d.ts.map +1 -1
  96. package/dist/api/btc/BTCGetPublicKey.d.ts +1 -11
  97. package/dist/api/btc/BTCGetPublicKey.d.ts.map +1 -1
  98. package/dist/api/btc/BTCSignMessage.d.ts +1 -15
  99. package/dist/api/btc/BTCSignMessage.d.ts.map +1 -1
  100. package/dist/api/btc/BTCSignPsbt.d.ts.map +1 -1
  101. package/dist/api/btc/BTCSignTransaction.d.ts +1 -11
  102. package/dist/api/btc/BTCSignTransaction.d.ts.map +1 -1
  103. package/dist/api/btc/BTCVerifyMessage.d.ts +1 -11
  104. package/dist/api/btc/BTCVerifyMessage.d.ts.map +1 -1
  105. package/dist/api/btc/helpers/versionLimit.d.ts +2 -11
  106. package/dist/api/btc/helpers/versionLimit.d.ts.map +1 -1
  107. package/dist/api/cardano/CardanoSignTransaction.d.ts.map +1 -1
  108. package/dist/api/conflux/ConfluxSignTransaction.d.ts.map +1 -1
  109. package/dist/api/device/DeviceCancel.d.ts.map +1 -1
  110. package/dist/api/device/DeviceChangePin.d.ts.map +1 -1
  111. package/dist/api/device/DeviceFullyUploadResource.d.ts +1 -2
  112. package/dist/api/device/DeviceFullyUploadResource.d.ts.map +1 -1
  113. package/dist/api/device/DeviceLock.d.ts.map +1 -1
  114. package/dist/api/device/DeviceRebootToBoardloader.d.ts +1 -1
  115. package/dist/api/device/DeviceRebootToBoardloader.d.ts.map +1 -1
  116. package/dist/api/device/DeviceRebootToBootloader.d.ts.map +1 -1
  117. package/dist/api/device/DeviceSettings.d.ts.map +1 -1
  118. package/dist/api/device/DeviceSupportFeatures.d.ts.map +1 -1
  119. package/dist/api/device/DeviceUnlock.d.ts +1 -1
  120. package/dist/api/device/DeviceUnlock.d.ts.map +1 -1
  121. package/dist/api/device/DeviceUpdateBootloader.d.ts +7 -1
  122. package/dist/api/device/DeviceUpdateBootloader.d.ts.map +1 -1
  123. package/dist/api/device/DeviceUploadResource.d.ts.map +1 -1
  124. package/dist/api/device/DeviceVerify.d.ts.map +1 -1
  125. package/dist/api/device/DeviceWipe.d.ts.map +1 -1
  126. package/dist/api/dynex/DnxGetAddress.d.ts.map +1 -1
  127. package/dist/api/dynex/DnxSignTransaction.d.ts.map +1 -1
  128. package/dist/api/evm/EVMGetPublicKey.d.ts.map +1 -1
  129. package/dist/api/evm/EVMSignMessageEIP712.d.ts +2 -8
  130. package/dist/api/evm/EVMSignMessageEIP712.d.ts.map +1 -1
  131. package/dist/api/evm/EVMSignTypedData.d.ts.map +1 -1
  132. package/dist/api/evm/latest/signTypedData.d.ts +1 -1
  133. package/dist/api/evm/latest/signTypedData.d.ts.map +1 -1
  134. package/dist/api/evm/latest/signTypedHash.d.ts.map +1 -1
  135. package/dist/api/evm/legacyV1/getAddress.d.ts.map +1 -1
  136. package/dist/api/evm/legacyV1/getPublicKey.d.ts.map +1 -1
  137. package/dist/api/evm/legacyV1/signMessage.d.ts.map +1 -1
  138. package/dist/api/evm/legacyV1/signTypedData.d.ts +1 -1
  139. package/dist/api/evm/legacyV1/signTypedData.d.ts.map +1 -1
  140. package/dist/api/evm/legacyV1/signTypedHash.d.ts.map +1 -1
  141. package/dist/api/evm/legacyV1/verifyMessage.d.ts.map +1 -1
  142. package/dist/api/firmware/FirmwareArtifactSource.d.ts +26 -0
  143. package/dist/api/firmware/FirmwareArtifactSource.d.ts.map +1 -0
  144. package/dist/api/firmware/FirmwareCheckpoint.d.ts +15 -0
  145. package/dist/api/firmware/FirmwareCheckpoint.d.ts.map +1 -0
  146. package/dist/api/firmware/FirmwareHostBinding.d.ts +6 -0
  147. package/dist/api/firmware/FirmwareHostBinding.d.ts.map +1 -0
  148. package/dist/api/firmware/FirmwareUpdateBaseMethod.d.ts +10 -1
  149. package/dist/api/firmware/FirmwareUpdateBaseMethod.d.ts.map +1 -1
  150. package/dist/api/firmware/FirmwareUpdateCapabilities.d.ts +3 -0
  151. package/dist/api/firmware/FirmwareUpdateCapabilities.d.ts.map +1 -0
  152. package/dist/api/firmware/FirmwareUpdatePlan.d.ts +29 -0
  153. package/dist/api/firmware/FirmwareUpdatePlan.d.ts.map +1 -0
  154. package/dist/api/firmware/FirmwareUpdatePreparedPlan.d.ts +25 -0
  155. package/dist/api/firmware/FirmwareUpdatePreparedPlan.d.ts.map +1 -0
  156. package/dist/api/firmware/bootloaderHelper.d.ts.map +1 -1
  157. package/dist/api/firmware/getBinary.d.ts +11 -0
  158. package/dist/api/firmware/getBinary.d.ts.map +1 -1
  159. package/dist/api/firmware/progressThrottle.d.ts +3 -0
  160. package/dist/api/firmware/progressThrottle.d.ts.map +1 -0
  161. package/dist/api/firmware/updateBootloader.d.ts +2 -0
  162. package/dist/api/firmware/updateBootloader.d.ts.map +1 -1
  163. package/dist/api/firmware/uploadFirmware.d.ts +9 -1
  164. package/dist/api/firmware/uploadFirmware.d.ts.map +1 -1
  165. package/dist/api/helpers/batchGetPublickeys.d.ts +3 -0
  166. package/dist/api/helpers/batchGetPublickeys.d.ts.map +1 -1
  167. package/dist/api/helpers/filesystemValidation.d.ts +10 -0
  168. package/dist/api/helpers/filesystemValidation.d.ts.map +1 -0
  169. package/dist/api/helpers/protocolV2FileWrite.d.ts +33 -0
  170. package/dist/api/helpers/protocolV2FileWrite.d.ts.map +1 -0
  171. package/dist/api/index.d.ts +29 -0
  172. package/dist/api/index.d.ts.map +1 -1
  173. package/dist/api/kaspa/KaspaSignTransaction.d.ts.map +1 -1
  174. package/dist/api/lightning/LnurlAuth.d.ts +4 -0
  175. package/dist/api/lightning/LnurlAuth.d.ts.map +1 -1
  176. package/dist/api/neo/NeoGetAddress.d.ts +2 -8
  177. package/dist/api/neo/NeoGetAddress.d.ts.map +1 -1
  178. package/dist/api/neo/NeoSignTransaction.d.ts +2 -8
  179. package/dist/api/neo/NeoSignTransaction.d.ts.map +1 -1
  180. package/dist/api/nervos/NervosGetAddress.d.ts +2 -9
  181. package/dist/api/nervos/NervosGetAddress.d.ts.map +1 -1
  182. package/dist/api/nervos/NervosSignTransaction.d.ts +9 -12
  183. package/dist/api/nervos/NervosSignTransaction.d.ts.map +1 -1
  184. package/dist/api/nexa/NexaGetAddress.d.ts +2 -8
  185. package/dist/api/nexa/NexaGetAddress.d.ts.map +1 -1
  186. package/dist/api/nexa/NexaSignTransaction.d.ts +2 -9
  187. package/dist/api/nexa/NexaSignTransaction.d.ts.map +1 -1
  188. package/dist/api/polkadot/PolkadotGetAddress.d.ts +3 -0
  189. package/dist/api/polkadot/PolkadotGetAddress.d.ts.map +1 -1
  190. package/dist/api/polkadot/networks.d.ts +3 -0
  191. package/dist/api/polkadot/networks.d.ts.map +1 -1
  192. package/dist/api/protocol-v2/DeviceFactoryInfoGet.d.ts +6 -0
  193. package/dist/api/protocol-v2/DeviceFactoryInfoGet.d.ts.map +1 -0
  194. package/dist/api/protocol-v2/DeviceFactoryInfoSet.d.ts +7 -0
  195. package/dist/api/protocol-v2/DeviceFactoryInfoSet.d.ts.map +1 -0
  196. package/dist/api/protocol-v2/DeviceFirmwareUpdate.d.ts +7 -0
  197. package/dist/api/protocol-v2/DeviceFirmwareUpdate.d.ts.map +1 -0
  198. package/dist/api/protocol-v2/DeviceGetFirmwareUpdateStatus.d.ts +7 -0
  199. package/dist/api/protocol-v2/DeviceGetFirmwareUpdateStatus.d.ts.map +1 -0
  200. package/dist/api/protocol-v2/DeviceGetOnboardingStatus.d.ts +6 -0
  201. package/dist/api/protocol-v2/DeviceGetOnboardingStatus.d.ts.map +1 -0
  202. package/dist/api/protocol-v2/DeviceInfoGet.d.ts +28 -0
  203. package/dist/api/protocol-v2/DeviceInfoGet.d.ts.map +1 -0
  204. package/dist/api/protocol-v2/DeviceReboot.d.ts +7 -0
  205. package/dist/api/protocol-v2/DeviceReboot.d.ts.map +1 -0
  206. package/dist/api/protocol-v2/DeviceSessionOpen.d.ts +28 -0
  207. package/dist/api/protocol-v2/DeviceSessionOpen.d.ts.map +1 -0
  208. package/dist/api/protocol-v2/DeviceSettingsGet.d.ts +6 -0
  209. package/dist/api/protocol-v2/DeviceSettingsGet.d.ts.map +1 -0
  210. package/dist/api/protocol-v2/DeviceSettingsPageShow.d.ts +16 -0
  211. package/dist/api/protocol-v2/DeviceSettingsPageShow.d.ts.map +1 -0
  212. package/dist/api/protocol-v2/DeviceSettingsSet.d.ts +12 -0
  213. package/dist/api/protocol-v2/DeviceSettingsSet.d.ts.map +1 -0
  214. package/dist/api/protocol-v2/DeviceStatusGet.d.ts +6 -0
  215. package/dist/api/protocol-v2/DeviceStatusGet.d.ts.map +1 -0
  216. package/dist/api/protocol-v2/DeviceUploadWallpaper.d.ts +26 -0
  217. package/dist/api/protocol-v2/DeviceUploadWallpaper.d.ts.map +1 -0
  218. package/dist/api/protocol-v2/FilesystemFormat.d.ts +6 -0
  219. package/dist/api/protocol-v2/FilesystemFormat.d.ts.map +1 -0
  220. package/dist/api/protocol-v2/FilesystemPermissionFix.d.ts +6 -0
  221. package/dist/api/protocol-v2/FilesystemPermissionFix.d.ts.map +1 -0
  222. package/dist/api/protocol-v2/Ping.d.ts +8 -0
  223. package/dist/api/protocol-v2/Ping.d.ts.map +1 -0
  224. package/dist/api/protocol-v2/ProtocolInfoRequest.d.ts +6 -0
  225. package/dist/api/protocol-v2/ProtocolInfoRequest.d.ts.map +1 -0
  226. package/dist/api/protocol-v2/helpers.d.ts +42 -0
  227. package/dist/api/protocol-v2/helpers.d.ts.map +1 -0
  228. package/dist/api/scdo/ScdoGetAddress.d.ts +2 -6
  229. package/dist/api/scdo/ScdoGetAddress.d.ts.map +1 -1
  230. package/dist/api/scdo/ScdoSignMessage.d.ts +2 -5
  231. package/dist/api/scdo/ScdoSignMessage.d.ts.map +1 -1
  232. package/dist/api/scdo/ScdoSignTransaction.d.ts +2 -5
  233. package/dist/api/scdo/ScdoSignTransaction.d.ts.map +1 -1
  234. package/dist/api/solana/SolGetAddress.d.ts +1 -0
  235. package/dist/api/solana/SolGetAddress.d.ts.map +1 -1
  236. package/dist/api/solana/SolSignMessage.d.ts +3 -0
  237. package/dist/api/solana/SolSignMessage.d.ts.map +1 -1
  238. package/dist/api/solana/SolSignOffchainMessage.d.ts +3 -0
  239. package/dist/api/solana/SolSignOffchainMessage.d.ts.map +1 -1
  240. package/dist/api/solana/SolSignTransaction.d.ts +6 -0
  241. package/dist/api/solana/SolSignTransaction.d.ts.map +1 -1
  242. package/dist/api/stellar/StellarGetAddress.d.ts +2 -1
  243. package/dist/api/stellar/StellarGetAddress.d.ts.map +1 -1
  244. package/dist/api/stellar/StellarSignTransaction.d.ts +3 -2
  245. package/dist/api/stellar/StellarSignTransaction.d.ts.map +1 -1
  246. package/dist/api/sui/SuiGetAddress.d.ts +3 -0
  247. package/dist/api/sui/SuiGetAddress.d.ts.map +1 -1
  248. package/dist/api/sui/SuiGetPublicKey.d.ts +3 -0
  249. package/dist/api/sui/SuiGetPublicKey.d.ts.map +1 -1
  250. package/dist/api/sui/SuiSignMessage.d.ts +3 -0
  251. package/dist/api/sui/SuiSignMessage.d.ts.map +1 -1
  252. package/dist/api/sui/SuiSignTransaction.d.ts +5 -2
  253. package/dist/api/sui/SuiSignTransaction.d.ts.map +1 -1
  254. package/dist/api/ton/TonGetAddress.d.ts +3 -0
  255. package/dist/api/ton/TonGetAddress.d.ts.map +1 -1
  256. package/dist/api/ton/TonSignData.d.ts +1 -0
  257. package/dist/api/ton/TonSignData.d.ts.map +1 -1
  258. package/dist/api/ton/TonSignMessage.d.ts +3 -0
  259. package/dist/api/ton/TonSignMessage.d.ts.map +1 -1
  260. package/dist/api/ton/TonSignProof.d.ts +3 -0
  261. package/dist/api/ton/TonSignProof.d.ts.map +1 -1
  262. package/dist/api/tron/TronSignMessage.d.ts +3 -0
  263. package/dist/api/tron/TronSignMessage.d.ts.map +1 -1
  264. package/dist/api/tron/TronSignTransaction.d.ts +3 -0
  265. package/dist/api/tron/TronSignTransaction.d.ts.map +1 -1
  266. package/dist/api/utils.d.ts +2 -1
  267. package/dist/api/utils.d.ts.map +1 -1
  268. package/dist/constants/index.d.ts +2 -1
  269. package/dist/constants/index.d.ts.map +1 -1
  270. package/dist/core/RequestQueue.d.ts +19 -1
  271. package/dist/core/RequestQueue.d.ts.map +1 -1
  272. package/dist/core/deviceEventRegistration.d.ts +11 -0
  273. package/dist/core/deviceEventRegistration.d.ts.map +1 -0
  274. package/dist/core/index.d.ts +4 -1
  275. package/dist/core/index.d.ts.map +1 -1
  276. package/dist/data-manager/DataManager.d.ts +9 -5
  277. package/dist/data-manager/DataManager.d.ts.map +1 -1
  278. package/dist/data-manager/MessagesConfig.d.ts +2 -2
  279. package/dist/data-manager/MessagesConfig.d.ts.map +1 -1
  280. package/dist/data-manager/TransportManager.d.ts +5 -4
  281. package/dist/data-manager/TransportManager.d.ts.map +1 -1
  282. package/dist/data-manager/connectSettings.d.ts.map +1 -1
  283. package/dist/device/Device.d.ts +60 -16
  284. package/dist/device/Device.d.ts.map +1 -1
  285. package/dist/device/DeviceCommands.d.ts +16 -14
  286. package/dist/device/DeviceCommands.d.ts.map +1 -1
  287. package/dist/device/DeviceConnector.d.ts +2 -1
  288. package/dist/device/DeviceConnector.d.ts.map +1 -1
  289. package/dist/device/DeviceFeaturesState.d.ts +4 -0
  290. package/dist/device/DeviceFeaturesState.d.ts.map +1 -0
  291. package/dist/device/DevicePool.d.ts +4 -2
  292. package/dist/device/DevicePool.d.ts.map +1 -1
  293. package/dist/device/DeviceStateMapper.d.ts +13 -0
  294. package/dist/device/DeviceStateMapper.d.ts.map +1 -0
  295. package/dist/device/DeviceStateProjector.d.ts +7 -0
  296. package/dist/device/DeviceStateProjector.d.ts.map +1 -0
  297. package/dist/device/DeviceStateStore.d.ts +21 -0
  298. package/dist/device/DeviceStateStore.d.ts.map +1 -0
  299. package/dist/device/DeviceWalletSessionStore.d.ts +15 -0
  300. package/dist/device/DeviceWalletSessionStore.d.ts.map +1 -0
  301. package/dist/device/cloneDeviceState.d.ts +2 -0
  302. package/dist/device/cloneDeviceState.d.ts.map +1 -0
  303. package/dist/device/deviceIdentity.d.ts +5 -0
  304. package/dist/device/deviceIdentity.d.ts.map +1 -0
  305. package/dist/deviceProfile/buildDeviceFeatures.d.ts +12 -0
  306. package/dist/deviceProfile/buildDeviceFeatures.d.ts.map +1 -0
  307. package/dist/deviceProfile/index.d.ts +2 -0
  308. package/dist/deviceProfile/index.d.ts.map +1 -0
  309. package/dist/events/call.d.ts +7 -0
  310. package/dist/events/call.d.ts.map +1 -1
  311. package/dist/events/core.d.ts +2 -2
  312. package/dist/events/core.d.ts.map +1 -1
  313. package/dist/events/device.d.ts +11 -2
  314. package/dist/events/device.d.ts.map +1 -1
  315. package/dist/events/iframe.d.ts +1 -0
  316. package/dist/events/iframe.d.ts.map +1 -1
  317. package/dist/events/logBlockEvent.d.ts +1 -0
  318. package/dist/events/logBlockEvent.d.ts.map +1 -1
  319. package/dist/events/ui-request.d.ts +26 -2
  320. package/dist/events/ui-request.d.ts.map +1 -1
  321. package/dist/index.d.ts +1797 -451
  322. package/dist/index.d.ts.map +1 -1
  323. package/dist/index.js +26905 -5611
  324. package/dist/inject.d.ts +3 -2
  325. package/dist/inject.d.ts.map +1 -1
  326. package/dist/lowLevelInject.d.ts +2 -1
  327. package/dist/lowLevelInject.d.ts.map +1 -1
  328. package/dist/protocols/protocol-v2/deviceSession.d.ts +7 -0
  329. package/dist/protocols/protocol-v2/deviceSession.d.ts.map +1 -0
  330. package/dist/protocols/protocol-v2/features.d.ts +88 -0
  331. package/dist/protocols/protocol-v2/features.d.ts.map +1 -0
  332. package/dist/protocols/protocol-v2/firmware.d.ts +15 -0
  333. package/dist/protocols/protocol-v2/firmware.d.ts.map +1 -0
  334. package/dist/protocols/protocol-v2/index.d.ts +5 -0
  335. package/dist/protocols/protocol-v2/index.d.ts.map +1 -0
  336. package/dist/protocols/protocol-v2/lockedError.d.ts +2 -0
  337. package/dist/protocols/protocol-v2/lockedError.d.ts.map +1 -0
  338. package/dist/protocols/protocol-v2/settingsUnlockPolicy.d.ts +16 -0
  339. package/dist/protocols/protocol-v2/settingsUnlockPolicy.d.ts.map +1 -0
  340. package/dist/protocols/protocol-v2/uiInteraction.d.ts +39 -0
  341. package/dist/protocols/protocol-v2/uiInteraction.d.ts.map +1 -0
  342. package/dist/protocols/protocol-v2/unlockRetry.d.ts +11 -0
  343. package/dist/protocols/protocol-v2/unlockRetry.d.ts.map +1 -0
  344. package/dist/protocols/protocol-v2/walletSession.d.ts +21 -0
  345. package/dist/protocols/protocol-v2/walletSession.d.ts.map +1 -0
  346. package/dist/topLevelInject.d.ts.map +1 -1
  347. package/dist/types/api/checkAllFirmwareRelease.d.ts +4 -2
  348. package/dist/types/api/checkAllFirmwareRelease.d.ts.map +1 -1
  349. package/dist/types/api/deviceSettings.d.ts +9 -0
  350. package/dist/types/api/deviceSettings.d.ts.map +1 -1
  351. package/dist/types/api/deviceUnlock.d.ts +1 -1
  352. package/dist/types/api/deviceUnlock.d.ts.map +1 -1
  353. package/dist/types/api/deviceUpdateBootloader.d.ts +6 -1
  354. package/dist/types/api/deviceUpdateBootloader.d.ts.map +1 -1
  355. package/dist/types/api/export.d.ts +4 -1
  356. package/dist/types/api/export.d.ts.map +1 -1
  357. package/dist/types/api/firmwareUpdate.d.ts +114 -1
  358. package/dist/types/api/firmwareUpdate.d.ts.map +1 -1
  359. package/dist/types/api/firmwareUpdateCapabilities.d.ts +13 -0
  360. package/dist/types/api/firmwareUpdateCapabilities.d.ts.map +1 -0
  361. package/dist/types/api/firmwareUpdatePlan.d.ts +35 -0
  362. package/dist/types/api/firmwareUpdatePlan.d.ts.map +1 -0
  363. package/dist/types/api/firmwareUpdatePreparedPlan.d.ts +43 -0
  364. package/dist/types/api/firmwareUpdatePreparedPlan.d.ts.map +1 -0
  365. package/dist/types/api/getDeviceState.d.ts +12 -0
  366. package/dist/types/api/getDeviceState.d.ts.map +1 -0
  367. package/dist/types/api/getFeatures.d.ts.map +1 -1
  368. package/dist/types/api/getOnekeyFeatures.d.ts.map +1 -1
  369. package/dist/types/api/getPassphraseState.d.ts +2 -1
  370. package/dist/types/api/getPassphraseState.d.ts.map +1 -1
  371. package/dist/types/api/index.d.ts +48 -2
  372. package/dist/types/api/index.d.ts.map +1 -1
  373. package/dist/types/api/openWalletSession.d.ts +35 -0
  374. package/dist/types/api/openWalletSession.d.ts.map +1 -0
  375. package/dist/types/api/protocolV2.d.ts +113 -0
  376. package/dist/types/api/protocolV2.d.ts.map +1 -0
  377. package/dist/types/api/searchDevices.d.ts +2 -2
  378. package/dist/types/api/searchDevices.d.ts.map +1 -1
  379. package/dist/types/api/sessionCache.d.ts +10 -0
  380. package/dist/types/api/sessionCache.d.ts.map +1 -0
  381. package/dist/types/device.d.ts +207 -5
  382. package/dist/types/device.d.ts.map +1 -1
  383. package/dist/types/params.d.ts +3 -0
  384. package/dist/types/params.d.ts.map +1 -1
  385. package/dist/types/settings.d.ts +33 -0
  386. package/dist/types/settings.d.ts.map +1 -1
  387. package/dist/utils/capabilitieUtils.d.ts.map +1 -1
  388. package/dist/utils/deviceFeaturesCompat.d.ts +13 -0
  389. package/dist/utils/deviceFeaturesCompat.d.ts.map +1 -0
  390. package/dist/utils/deviceFeaturesUtils.d.ts +17 -9
  391. package/dist/utils/deviceFeaturesUtils.d.ts.map +1 -1
  392. package/dist/utils/deviceInfoUtils.d.ts +10 -8
  393. package/dist/utils/deviceInfoUtils.d.ts.map +1 -1
  394. package/dist/utils/deviceSettings.d.ts +2 -0
  395. package/dist/utils/deviceSettings.d.ts.map +1 -1
  396. package/dist/utils/deviceVersionUtils.d.ts +6 -5
  397. package/dist/utils/deviceVersionUtils.d.ts.map +1 -1
  398. package/dist/utils/findDefectiveBatchDevice.d.ts +1 -1
  399. package/dist/utils/homescreen.d.ts.map +1 -1
  400. package/dist/utils/index.d.ts +3 -1
  401. package/dist/utils/index.d.ts.map +1 -1
  402. package/dist/utils/patch.d.ts +1 -1
  403. package/dist/utils/patch.d.ts.map +1 -1
  404. package/dist/utils/pro2Wallpaper.d.ts +12 -0
  405. package/dist/utils/pro2Wallpaper.d.ts.map +1 -0
  406. package/dist/utils/tracing.d.ts.map +1 -1
  407. package/dist/utils/versionUtils.d.ts +1 -1
  408. package/package.json +4 -4
  409. package/src/api/BaseMethod.ts +60 -23
  410. package/src/api/CheckAllFirmwareRelease.ts +16 -3
  411. package/src/api/CheckBootloaderRelease.ts +1 -2
  412. package/src/api/CheckFirmwareRelease.ts +1 -2
  413. package/src/api/ClearSessionCache.ts +28 -0
  414. package/src/api/DirList.ts +33 -0
  415. package/src/api/DirMake.ts +23 -0
  416. package/src/api/DirRemove.ts +23 -0
  417. package/src/api/FileDelete.ts +23 -0
  418. package/src/api/FileRead.ts +183 -0
  419. package/src/api/FileWrite.ts +71 -0
  420. package/src/api/FirmwareUpdate.ts +15 -7
  421. package/src/api/FirmwareUpdateV2.ts +354 -148
  422. package/src/api/FirmwareUpdateV3.ts +376 -62
  423. package/src/api/FirmwareUpdateV4.ts +2279 -0
  424. package/src/api/GetDeviceState.ts +55 -0
  425. package/src/api/GetFeatures.ts +12 -4
  426. package/src/api/GetOnekeyFeatures.ts +15 -3
  427. package/src/api/GetPassphraseState.ts +9 -10
  428. package/src/api/OpenWalletSession.ts +211 -0
  429. package/src/api/PathInfo.ts +41 -0
  430. package/src/api/PromptWebDeviceAccess.ts +10 -1
  431. package/src/api/SearchDevices.ts +33 -3
  432. package/src/api/UploadPortfolio.ts +50 -0
  433. package/src/api/alephium/AlephiumGetAddress.ts +6 -2
  434. package/src/api/alephium/AlephiumSignMessage.ts +6 -1
  435. package/src/api/alephium/AlephiumSignTransaction.ts +15 -4
  436. package/src/api/allnetwork/AllNetworkGetAddressBase.ts +25 -21
  437. package/src/api/aptos/AptosGetAddress.ts +2 -3
  438. package/src/api/benfen/BenfenGetAddress.ts +11 -7
  439. package/src/api/benfen/BenfenGetPublicKey.ts +6 -2
  440. package/src/api/benfen/BenfenSignMessage.ts +6 -1
  441. package/src/api/benfen/BenfenSignTransaction.ts +6 -1
  442. package/src/api/btc/BTCGetPublicKey.ts +3 -2
  443. package/src/api/btc/BTCSignPsbt.ts +1 -2
  444. package/src/api/btc/helpers/versionLimit.ts +7 -1
  445. package/src/api/cardano/CardanoSignTransaction.ts +2 -4
  446. package/src/api/conflux/ConfluxSignTransaction.ts +5 -2
  447. package/src/api/device/DeviceCancel.ts +1 -0
  448. package/src/api/device/DeviceChangePin.ts +24 -0
  449. package/src/api/device/DeviceFullyUploadResource.ts +6 -7
  450. package/src/api/device/DeviceLock.ts +2 -3
  451. package/src/api/device/DeviceRebootToBoardloader.ts +11 -1
  452. package/src/api/device/DeviceRebootToBootloader.ts +11 -1
  453. package/src/api/device/DeviceSettings.ts +121 -0
  454. package/src/api/device/DeviceSupportFeatures.ts +2 -13
  455. package/src/api/device/DeviceUnlock.ts +9 -0
  456. package/src/api/device/DeviceUpdateBootloader.ts +175 -11
  457. package/src/api/device/DeviceUploadResource.ts +4 -5
  458. package/src/api/device/DeviceVerify.ts +1 -2
  459. package/src/api/device/DeviceWipe.ts +19 -0
  460. package/src/api/dynex/DnxGetAddress.ts +6 -0
  461. package/src/api/dynex/DnxSignTransaction.ts +6 -0
  462. package/src/api/evm/EVMGetAddress.ts +1 -1
  463. package/src/api/evm/EVMGetPublicKey.ts +3 -4
  464. package/src/api/evm/EVMSignMessage.ts +1 -1
  465. package/src/api/evm/EVMSignMessageEIP712.ts +14 -1
  466. package/src/api/evm/EVMSignTransaction.ts +1 -1
  467. package/src/api/evm/EVMSignTypedData.ts +30 -18
  468. package/src/api/evm/EVMVerifyMessage.ts +1 -1
  469. package/src/api/evm/latest/signTypedHash.ts +2 -4
  470. package/src/api/evm/legacyV1/getAddress.ts +5 -3
  471. package/src/api/evm/legacyV1/getPublicKey.ts +5 -3
  472. package/src/api/evm/legacyV1/signMessage.ts +5 -3
  473. package/src/api/evm/legacyV1/signTypedData.ts +9 -8
  474. package/src/api/evm/legacyV1/signTypedHash.ts +7 -7
  475. package/src/api/evm/legacyV1/verifyMessage.ts +5 -3
  476. package/src/api/firmware/FirmwareArtifactSource.ts +278 -0
  477. package/src/api/firmware/FirmwareCheckpoint.ts +188 -0
  478. package/src/api/firmware/FirmwareHostBinding.ts +108 -0
  479. package/src/api/firmware/FirmwareUpdateBaseMethod.ts +83 -15
  480. package/src/api/firmware/FirmwareUpdateCapabilities.ts +13 -0
  481. package/src/api/firmware/FirmwareUpdatePlan.ts +729 -0
  482. package/src/api/firmware/FirmwareUpdatePreparedPlan.ts +403 -0
  483. package/src/api/firmware/bootloaderHelper.ts +3 -2
  484. package/src/api/firmware/getBinary.ts +1 -1
  485. package/src/api/firmware/progressThrottle.ts +44 -0
  486. package/src/api/firmware/releaseHelper.ts +3 -3
  487. package/src/api/firmware/updateBootloader.ts +19 -4
  488. package/src/api/firmware/uploadFirmware.ts +148 -34
  489. package/src/api/helpers/batchGetPublickeys.ts +51 -6
  490. package/src/api/helpers/filesystemValidation.ts +112 -0
  491. package/src/api/helpers/protocolV2FileWrite.ts +193 -0
  492. package/src/api/index.ts +32 -0
  493. package/src/api/kaspa/KaspaSignTransaction.ts +2 -3
  494. package/src/api/lightning/LnurlAuth.ts +4 -0
  495. package/src/api/neo/NeoGetAddress.ts +6 -1
  496. package/src/api/neo/NeoSignTransaction.ts +6 -1
  497. package/src/api/nervos/NervosGetAddress.ts +6 -2
  498. package/src/api/nervos/NervosSignTransaction.ts +14 -4
  499. package/src/api/nexa/NexaGetAddress.ts +6 -2
  500. package/src/api/nexa/NexaSignTransaction.ts +11 -12
  501. package/src/api/polkadot/networks.ts +9 -0
  502. package/src/api/protocol-v2/DeviceFactoryInfoGet.ts +20 -0
  503. package/src/api/protocol-v2/DeviceFactoryInfoSet.ts +32 -0
  504. package/src/api/protocol-v2/DeviceFirmwareUpdate.ts +61 -0
  505. package/src/api/protocol-v2/DeviceGetFirmwareUpdateStatus.ts +55 -0
  506. package/src/api/protocol-v2/DeviceGetOnboardingStatus.ts +18 -0
  507. package/src/api/protocol-v2/DeviceInfoGet.ts +145 -0
  508. package/src/api/protocol-v2/DeviceReboot.ts +26 -0
  509. package/src/api/protocol-v2/DeviceSessionOpen.ts +102 -0
  510. package/src/api/protocol-v2/DeviceSettingsGet.ts +18 -0
  511. package/src/api/protocol-v2/DeviceSettingsPageShow.ts +70 -0
  512. package/src/api/protocol-v2/DeviceSettingsSet.ts +44 -0
  513. package/src/api/protocol-v2/DeviceStatusGet.ts +16 -0
  514. package/src/api/protocol-v2/DeviceUploadWallpaper.ts +131 -0
  515. package/src/api/protocol-v2/FilesystemFormat.ts +19 -0
  516. package/src/api/protocol-v2/FilesystemPermissionFix.ts +16 -0
  517. package/src/api/protocol-v2/Ping.ts +18 -0
  518. package/src/api/protocol-v2/ProtocolInfoRequest.ts +16 -0
  519. package/src/api/protocol-v2/helpers.ts +203 -0
  520. package/src/api/scdo/ScdoGetAddress.ts +6 -2
  521. package/src/api/scdo/ScdoSignMessage.ts +6 -1
  522. package/src/api/scdo/ScdoSignTransaction.ts +6 -2
  523. package/src/api/solana/SolGetAddress.ts +4 -0
  524. package/src/api/solana/SolSignMessage.ts +3 -0
  525. package/src/api/solana/SolSignOffchainMessage.ts +3 -0
  526. package/src/api/solana/SolSignTransaction.ts +6 -0
  527. package/src/api/stellar/StellarGetAddress.ts +10 -1
  528. package/src/api/stellar/StellarSignTransaction.ts +14 -1
  529. package/src/api/sui/SuiGetAddress.ts +5 -3
  530. package/src/api/sui/SuiGetPublicKey.ts +3 -0
  531. package/src/api/sui/SuiSignMessage.ts +3 -0
  532. package/src/api/sui/SuiSignTransaction.ts +14 -12
  533. package/src/api/ton/TonGetAddress.ts +3 -0
  534. package/src/api/ton/TonSignData.ts +6 -3
  535. package/src/api/ton/TonSignMessage.ts +6 -5
  536. package/src/api/ton/TonSignProof.ts +3 -0
  537. package/src/api/tron/TronSignMessage.ts +4 -1
  538. package/src/api/tron/TronSignTransaction.ts +3 -0
  539. package/src/api/utils.ts +7 -3
  540. package/src/api/xrp/XrpSignTransaction.ts +1 -1
  541. package/src/constants/index.ts +7 -1
  542. package/src/core/RequestQueue.ts +124 -4
  543. package/src/core/deviceEventRegistration.ts +23 -0
  544. package/src/core/index.ts +253 -125
  545. package/src/data/messages/messages-protocol-v2.json +13544 -0
  546. package/src/data-manager/DataManager.ts +61 -49
  547. package/src/data-manager/MessagesConfig.ts +14 -14
  548. package/src/data-manager/TransportManager.ts +38 -12
  549. package/src/data-manager/connectSettings.ts +15 -0
  550. package/src/device/Device.ts +759 -164
  551. package/src/device/DeviceCommands.ts +245 -36
  552. package/src/device/DeviceConnector.ts +29 -4
  553. package/src/device/DeviceFeaturesState.ts +34 -0
  554. package/src/device/DevicePool.ts +69 -21
  555. package/src/device/DeviceStateMapper.ts +348 -0
  556. package/src/device/DeviceStateProjector.ts +95 -0
  557. package/src/device/DeviceStateStore.ts +201 -0
  558. package/src/device/DeviceWalletSessionStore.ts +78 -0
  559. package/src/device/cloneDeviceState.ts +39 -0
  560. package/src/device/deviceIdentity.ts +18 -0
  561. package/src/deviceProfile/buildDeviceFeatures.ts +391 -0
  562. package/src/deviceProfile/index.ts +4 -0
  563. package/src/events/call.ts +6 -0
  564. package/src/events/core.ts +2 -0
  565. package/src/events/device.ts +17 -1
  566. package/src/events/iframe.ts +1 -0
  567. package/src/events/logBlockEvent.ts +30 -0
  568. package/src/events/ui-request.ts +32 -2
  569. package/src/index.ts +9 -0
  570. package/src/inject.ts +75 -3
  571. package/src/lowLevelInject.ts +8 -1
  572. package/src/protocols/protocol-v2/deviceSession.ts +24 -0
  573. package/src/protocols/protocol-v2/features.ts +163 -0
  574. package/src/protocols/protocol-v2/firmware.ts +21 -0
  575. package/src/protocols/protocol-v2/index.ts +18 -0
  576. package/src/protocols/protocol-v2/lockedError.ts +10 -0
  577. package/src/protocols/protocol-v2/settingsUnlockPolicy.ts +61 -0
  578. package/src/protocols/protocol-v2/uiInteraction.ts +210 -0
  579. package/src/protocols/protocol-v2/unlockRetry.ts +76 -0
  580. package/src/protocols/protocol-v2/walletSession.ts +202 -0
  581. package/src/topLevelInject.ts +7 -1
  582. package/src/types/api/checkAllFirmwareRelease.ts +4 -2
  583. package/src/types/api/deviceSettings.ts +9 -0
  584. package/src/types/api/deviceUnlock.ts +1 -1
  585. package/src/types/api/deviceUpdateBootloader.ts +10 -1
  586. package/src/types/api/export.ts +25 -0
  587. package/src/types/api/firmwareUpdate.ts +163 -1
  588. package/src/types/api/firmwareUpdateCapabilities.ts +13 -0
  589. package/src/types/api/firmwareUpdatePlan.ts +52 -0
  590. package/src/types/api/firmwareUpdatePreparedPlan.ts +55 -0
  591. package/src/types/api/getDeviceState.ts +19 -0
  592. package/src/types/api/getFeatures.ts +3 -0
  593. package/src/types/api/getOnekeyFeatures.ts +3 -0
  594. package/src/types/api/getPassphraseState.ts +10 -2
  595. package/src/types/api/index.ts +89 -2
  596. package/src/types/api/openWalletSession.ts +54 -0
  597. package/src/types/api/protocolV2.ts +244 -0
  598. package/src/types/api/searchDevices.ts +2 -2
  599. package/src/types/api/sessionCache.ts +14 -0
  600. package/src/types/device.ts +266 -5
  601. package/src/types/params.ts +11 -0
  602. package/src/types/settings.ts +54 -29
  603. package/src/utils/capabilitieUtils.ts +1 -2
  604. package/src/utils/deviceFeaturesCompat.ts +173 -0
  605. package/src/utils/deviceFeaturesUtils.ts +122 -84
  606. package/src/utils/deviceInfoUtils.ts +38 -87
  607. package/src/utils/deviceSettings.ts +48 -0
  608. package/src/utils/deviceVersionUtils.ts +25 -62
  609. package/src/utils/findDefectiveBatchDevice.ts +8 -8
  610. package/src/utils/homescreen.ts +10 -0
  611. package/src/utils/index.ts +4 -0
  612. package/src/utils/pro2Wallpaper.ts +109 -0
  613. package/src/utils/tracing.ts +3 -1
package/dist/index.d.ts CHANGED
@@ -1,23 +1,64 @@
1
- import EventEmitter$1, { EventEmitter } from 'events';
2
- import * as _onekeyfe_hd_transport from '@onekeyfe/hd-transport';
3
- import { OneKeyDeviceCommType, Messages, LowlevelTransportSharedPlugin, Features as Features$1, Success as Success$1, RecoveryDeviceType, SafetyCheckLevel, ResourceType, NextU2FCounter, SetU2FCounter, CipheredKeyValue as CipheredKeyValue$1, UintType, EthereumPublicKey, EthereumMessageSignature, Address, MultisigRedeemScriptType, InputScriptType, PublicKey, MessageSignature, SignedPsbt, PrevInput, TxOutputBinType, TxInput, TxOutputType, TxInputType, StarcoinAddress as StarcoinAddress$1, StarcoinPublicKey as StarcoinPublicKey$1, StarcoinMessageSignature, StarcoinSignedTx, NEMAddress as NEMAddress$1, NEMSignedTx, SolanaAddress as SolanaAddress$1, SolanaSignedTx as SolanaSignedTx$1, SolanaTxExtraInfo, SolanaOffChainMessageVersion, SolanaOffChainMessageFormat, StellarAddress as StellarAddress$1, StellarSignedTx, TronAddress as TronAddress$1, TronResourceCode, TronSignedTx, TronMessageSignature, ConfluxAddress as ConfluxAddress$1, ConfluxMessageSignature, NearAddress as NearAddress$1, NearSignedTx, AptosAddress as AptosAddress$1, AptosMessageSignature as AptosMessageSignature$1, AptosSignedTx as AptosSignedTx$1, AlgorandAddress, AlgorandSignedTx, CosmosAddress as CosmosAddress$1, CosmosSignedTx as CosmosSignedTx$1, SuiAddress as SuiAddress$1, SuiMessageSignature, CardanoAddressParametersType, CardanoMessageSignature, FilecoinAddress as FilecoinAddress$1, FilecoinSignedTx as FilecoinSignedTx$1, PolkadotAddress as PolkadotAddress$1, PolkadotSignedTx as PolkadotSignedTx$1, KaspaAddress as KaspaAddress$1, NervosAddress as NervosAddress$1, NervosSignedTx as NervosSignedTx$1, DnxAddress as DnxAddress$1, TonWalletVersion, TonWorkChain, TonSignedMessage, TonSignedProof, TonSignDataType, TonSignedData, ScdoAddress as ScdoAddress$1, ScdoSignedMessage, ScdoSignedTx as ScdoSignedTx$1, AlephiumMessageSignature, AlephiumSignedTx as AlephiumSignedTx$1, BenfenAddress as BenfenAddress$1, BenfenMessageSignature, Transport, OneKeyDeviceInfo, ChangeOutputScriptType } from '@onekeyfe/hd-transport';
4
- export { Messages as PROTO, TonSignDataType } from '@onekeyfe/hd-transport';
5
- import { EDeviceType, EFirmwareType, Deferred } from '@onekeyfe/hd-shared';
1
+ import EventEmitter, { EventEmitter as EventEmitter$1 } from 'events';
2
+ import { DeviceFirmwareTargetType, DeviceFirmwareUpdateRecordFields, DeviceRebootType, DeviceFirmwareTarget, Messages, Transport, TransportCallOptions, OneKeyDeviceCommType, ProtocolV2DeviceInfo, DeviceStatus as DeviceStatus$1, OneKeyDeviceInfo, Success as Success$1, LowlevelTransportSharedPlugin, DeviceSessionResume, DeviceHostPassphrase, DevicePassphraseOnDevice, DeviceAttachPinOnDevice, DeviceSettings, DeviceSettingsPage, ProtocolInfo, DevOnboardingStatus, DeviceFirmwareUpdateStatus, DeviceFactoryInfo, RecoveryDeviceType, SafetyCheckLevel, ResourceType, NextU2FCounter, SetU2FCounter, CipheredKeyValue as CipheredKeyValue$1, UintType, EthereumPublicKey, EthereumMessageSignature, Address, MultisigRedeemScriptType, InputScriptType, PublicKey, MessageSignature, SignedPsbt, PrevInput, TxOutputBinType, TxInput, TxOutputType, TxInputType, StarcoinAddress as StarcoinAddress$1, StarcoinPublicKey as StarcoinPublicKey$1, StarcoinMessageSignature, StarcoinSignedTx, NEMAddress as NEMAddress$1, NEMSignedTx, SolanaAddress as SolanaAddress$1, SolanaSignedTx as SolanaSignedTx$1, SolanaTxExtraInfo, SolanaOffChainMessageVersion, SolanaOffChainMessageFormat, StellarAddress as StellarAddress$1, StellarSignedTx, TronAddress as TronAddress$1, TronResourceCode, TronSignedTx, TronMessageSignature, ConfluxAddress as ConfluxAddress$1, ConfluxMessageSignature, NearAddress as NearAddress$1, NearSignedTx, AptosAddress as AptosAddress$1, AptosMessageSignature as AptosMessageSignature$1, AptosSignedTx as AptosSignedTx$1, AlgorandAddress, AlgorandSignedTx, CosmosAddress as CosmosAddress$1, CosmosSignedTx as CosmosSignedTx$1, SuiAddress as SuiAddress$1, SuiMessageSignature, CardanoAddressParametersType, CardanoMessageSignature, FilecoinAddress as FilecoinAddress$1, FilecoinSignedTx as FilecoinSignedTx$1, PolkadotAddress as PolkadotAddress$1, PolkadotSignedTx as PolkadotSignedTx$1, KaspaAddress as KaspaAddress$1, NervosAddress as NervosAddress$1, NervosSignedTx as NervosSignedTx$1, DnxAddress as DnxAddress$1, TonWalletVersion, TonWorkChain, TonSignedMessage, TonSignedProof, TonSignDataType, TonSignedData, ScdoAddress as ScdoAddress$1, ScdoSignedMessage, ScdoSignedTx as ScdoSignedTx$1, AlephiumMessageSignature, AlephiumSignedTx as AlephiumSignedTx$1, BenfenAddress as BenfenAddress$1, BenfenMessageSignature, ChangeOutputScriptType } from '@onekeyfe/hd-transport';
3
+ export { Success as DeviceSuccess, HDNodeType, Messages as PROTO, ResourceType, TonSignDataType, TonWalletVersion } from '@onekeyfe/hd-transport';
4
+ import * as _onekeyfe_hd_shared from '@onekeyfe/hd-shared';
5
+ import { HardwareConnectProtocol, EFirmwareType, EDeviceType, Deferred } from '@onekeyfe/hd-shared';
6
6
 
7
7
  interface CommonParams {
8
8
  keepSession?: boolean;
9
+ /**
10
+ * polling connect max retry count
11
+ */
9
12
  retryCount?: number;
13
+ /**
14
+ * polling interval time
15
+ */
10
16
  pollIntervalTime?: number;
17
+ /**
18
+ * Timeout time for single polling
19
+ */
11
20
  timeout?: number;
21
+ /**
22
+ * DeviceInfoGet timeout during Protocol V2 initialization.
23
+ */
24
+ protocolV2DeviceInfoTimeoutMs?: number;
25
+ /**
26
+ * passphrase state
27
+ */
12
28
  passphraseState?: string;
29
+ /**
30
+ * Use empty passphrase
31
+ */
13
32
  useEmptyPassphrase?: boolean;
33
+ /**
34
+ * Every init session
35
+ */
14
36
  initSession?: boolean;
37
+ /**
38
+ * Use derive cardano
39
+ */
15
40
  deriveCardano?: boolean;
16
41
  detectBootloaderDevice?: boolean;
42
+ /**
43
+ * Skip web device prompt
44
+ */
17
45
  skipWebDevicePrompt?: boolean;
46
+ /**
47
+ * Skip passphrase check
48
+ */
18
49
  skipPassphraseCheck?: boolean;
50
+ /**
51
+ * Only connect device, not initialize device, only ble connect
52
+ */
19
53
  onlyConnectBleDevice?: boolean;
54
+ /**
55
+ * Use pre-initialized device state (BLE only)
56
+ */
20
57
  usePreInitialize?: boolean;
58
+ /**
59
+ * Expected transport protocol. If omitted, SDK probes Protocol V1 then Protocol V2.
60
+ */
61
+ connectProtocol?: HardwareConnectProtocol;
21
62
  }
22
63
  type Params<T> = CommonParams & T & {
23
64
  bundle?: undefined;
@@ -37,27 +78,258 @@ type Response<T> = Promise<Success<T> | Unsuccessful>;
37
78
 
38
79
  declare const safeThrowError: (error: any) => never;
39
80
 
40
- declare const on: <T extends string, P extends (...args: any[]) => any>(type: T, fn: P) => void;
41
- declare const off: (type: any, fn: any) => void;
42
- declare const removeAllListeners: (type: any) => void;
43
-
44
- declare function uiResponse(response: UiResponseEvent): void;
81
+ type RebootTypeInput = DeviceRebootType | keyof typeof DeviceRebootType | string | number;
82
+ type DeviceRebootParams = {
83
+ rebootType?: RebootTypeInput;
84
+ reboot_type?: RebootTypeInput;
85
+ };
86
+ type DeviceFirmwareTargetInput = DeviceFirmwareTarget | {
87
+ targetId?: DeviceFirmwareTargetType | string | number;
88
+ target_id?: DeviceFirmwareTargetType | string | number;
89
+ path: string;
90
+ };
91
+ type DeviceFirmwareUpdateParams = {
92
+ targets?: DeviceFirmwareTargetInput[];
93
+ targetId?: DeviceFirmwareTargetType | string | number;
94
+ target_id?: DeviceFirmwareTargetType | string | number;
95
+ path?: string;
96
+ };
97
+ type DeviceFirmwareUpdateStatusGetParams = {
98
+ fields?: DeviceFirmwareUpdateRecordFields;
99
+ };
100
+ type DeviceFactoryInfoSetParams = {
101
+ version?: number;
102
+ serial_number?: string;
103
+ burn_in_completed?: boolean;
104
+ factory_test_completed?: boolean;
105
+ manufacture_time?: {
106
+ year: number;
107
+ month: number;
108
+ day: number;
109
+ hour: number;
110
+ minute: number;
111
+ second: number;
112
+ };
113
+ };
45
114
 
46
- type IAddHardwareGlobalEventListener = (coreMessage: CoreMessage) => void;
47
- interface LowLevelInjectApi {
48
- call: CallMethod;
49
- eventEmitter: EventEmitter;
50
- init: CoreApi['init'];
51
- dispose: CoreApi['dispose'];
52
- uiResponse: CoreApi['uiResponse'];
53
- cancel: CoreApi['cancel'];
54
- updateSettings: CoreApi['updateSettings'];
55
- switchTransport: CoreApi['switchTransport'];
56
- addHardwareGlobalEventListener: (listener: IAddHardwareGlobalEventListener) => void;
115
+ type PassphrasePromptResponse = {
116
+ passphrase?: string;
117
+ passphraseOnDevice?: boolean;
118
+ attachPinOnDevice?: boolean;
119
+ cache?: boolean;
120
+ };
121
+ type MessageType = Messages.MessageType;
122
+ type MessageKey = Extract<keyof MessageType, string>;
123
+ type TypedResponseMessage<T extends MessageKey> = {
124
+ type: T;
125
+ message: MessageType[T];
126
+ };
127
+ type TypedCallResponseMap = {
128
+ [K in MessageKey]: TypedResponseMessage<K>;
129
+ };
130
+ type DefaultMessageResponse = TypedCallResponseMap[MessageKey];
131
+ /**
132
+ * The life cycle begins with the acquisition of the device and ends with the disposal device commands
133
+ * acquire device -> create DeviceCommands -> release device -> dispose DeviceCommands
134
+ */
135
+ declare class DeviceCommands {
136
+ instanceId: string;
137
+ currentResponseID?: number;
138
+ device: Device;
139
+ transport: Transport;
140
+ mainId: string;
141
+ disposed: boolean;
142
+ callPromise?: Promise<DefaultMessageResponse>;
143
+ constructor(device: Device, mainId: string);
144
+ dispose(_cancelRequest: boolean): Promise<void>;
145
+ checkDisposed(): void;
146
+ cancelDeviceOnOneKeyDevice(): Promise<{
147
+ readonly success: false;
148
+ readonly error: 800;
149
+ readonly payload: {
150
+ readonly message: "Device disconnected or acquired by someone else";
151
+ };
152
+ } | {
153
+ success: boolean;
154
+ error: null;
155
+ payload: {
156
+ message: string;
157
+ };
158
+ } | {
159
+ success: boolean;
160
+ error: 0 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 200 | 300 | 301 | 302 | 303 | 304 | 305 | 400 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 500 | 600 | 601 | 602 | 603 | 700 | 701 | 702 | 703 | 704 | 705 | 706 | 707 | 708 | 709 | 710 | 711 | 712 | 713 | 714 | 715 | 716 | 717 | 718 | 719 | 720 | 721 | 722 | 800 | 801 | 802 | 803 | 804 | 805 | 806 | 807 | 808 | 809 | 810 | 811 | 812 | 813 | 814 | 815 | 816 | 817 | 818 | 819 | 820 | 821 | 822 | 823 | 824 | 825 | 826 | 827 | 828 | 829 | 830 | 831 | 900 | 901 | 902;
161
+ payload: {
162
+ message: string;
163
+ };
164
+ } | undefined>;
165
+ cancelDevice(): Promise<{
166
+ readonly success: false;
167
+ readonly error: 800;
168
+ readonly payload: {
169
+ readonly message: "Device disconnected or acquired by someone else";
170
+ };
171
+ } | {
172
+ success: boolean;
173
+ error: null;
174
+ payload: {
175
+ message: string;
176
+ };
177
+ } | {
178
+ success: boolean;
179
+ error: 0 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 200 | 300 | 301 | 302 | 303 | 304 | 305 | 400 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 500 | 600 | 601 | 602 | 603 | 700 | 701 | 702 | 703 | 704 | 705 | 706 | 707 | 708 | 709 | 710 | 711 | 712 | 713 | 714 | 715 | 716 | 717 | 718 | 719 | 720 | 721 | 722 | 800 | 801 | 802 | 803 | 804 | 805 | 806 | 807 | 808 | 809 | 810 | 811 | 812 | 813 | 814 | 815 | 816 | 817 | 818 | 819 | 820 | 821 | 822 | 823 | 824 | 825 | 826 | 827 | 828 | 829 | 830 | 831 | 900 | 901 | 902;
180
+ payload: {
181
+ message: string;
182
+ };
183
+ } | undefined>;
184
+ cancel(): Promise<void>;
185
+ call(type: MessageKey, msg?: DefaultMessageResponse['message'], options?: TransportCallOptions): Promise<DefaultMessageResponse>;
186
+ typedCall<T extends MessageKey, R extends MessageKey[]>(type: T, resType: R, msg?: MessageType[T], options?: TransportCallOptions): Promise<TypedCallResponseMap[R[number]]>;
187
+ typedCall<T extends MessageKey, R extends MessageKey>(type: T, resType: R, msg?: MessageType[T], options?: TransportCallOptions): Promise<TypedResponseMessage<R>>;
188
+ _commonCall(type: MessageKey, msg?: DefaultMessageResponse['message'], options?: TransportCallOptions): Promise<DefaultMessageResponse>;
189
+ _filterCommonTypes(res: DefaultMessageResponse, callType: MessageKey, options?: TransportCallOptions): Promise<DefaultMessageResponse>;
190
+ _promptPin(type?: Messages.PinMatrixRequestType): Promise<string>;
191
+ promptPassphrase(options: PassphraseRequestPayload, promptOptions?: {
192
+ cancelDeviceOnReject?: boolean;
193
+ }): Promise<PassphrasePromptResponse>;
57
194
  }
58
- type LowLevelCoreApi = Omit<CoreApi, 'on' | 'off'> & {
59
- addHardwareGlobalEventListener: (listener: IAddHardwareGlobalEventListener) => void;
195
+
196
+ type ProtocolV2RuntimeMode = 'normal' | 'bootloader';
197
+
198
+ type transportEnv = 'node' | 'web' | 'webextension' | 'electron' | 'react-native' | 'webusb' | 'desktop-webusb' | 'desktop-web-ble' | 'emulator' | 'lowlevel' | 'node-usb';
199
+ type ConnectSettings = {
200
+ connectSrc?: string;
201
+ debug?: boolean;
202
+ transportReconnect?: boolean;
203
+ lazyLoad?: boolean;
204
+ origin?: string;
205
+ parentOrigin?: string;
206
+ configSrc: string;
207
+ iframeSrc: string;
208
+ version: string;
209
+ priority: number;
210
+ trustedHost: boolean;
211
+ supportedBrowser?: boolean;
212
+ env: transportEnv;
213
+ timestamp: number;
214
+ isFrame?: boolean;
215
+ preRelease?: boolean;
216
+ firmwareManifestMode?: 'sdk-managed' | 'external-only';
217
+ preloadedConfig?: RemoteConfigResponse;
218
+ fetchConfig?: boolean;
219
+ extension?: string;
220
+ configFetcher?: (url: string) => Promise<RemoteConfigResponse | null>;
221
+ };
222
+ type IVersionArray = [number, number, number];
223
+ type ILocale = 'zh-CN' | 'en-US';
224
+ type IProtocolV2FirmwareComponentTarget = 'ROMLOADER' | 'BOOTLOADER' | 'APPLICATION_P1' | 'APPLICATION_P2' | 'COPROCESSOR' | 'SE01' | 'SE02' | 'SE03' | 'SE04';
225
+ type IProtocolV2FirmwareComponent = {
226
+ target: IProtocolV2FirmwareComponentTarget;
227
+ url: string;
228
+ fingerprint?: string;
229
+ expectedSize?: number;
230
+ version?: IVersionArray;
231
+ };
232
+ /** Pro2 RESC bundle okpkg descriptor for incremental FileWrite synchronization. */
233
+ type IProtocolV2ResourceBundle = {
234
+ /** Bundle name, such as images, animation, translations, or fonts_roobert. */
235
+ name: string;
236
+ /** Download URL. */
237
+ url: string;
238
+ fingerprint?: string;
239
+ expectedSize?: number;
240
+ /** Device target path, such as vol0:/bundles/images/images.okpkg. */
241
+ devicePath: string;
242
+ /** okpkg payload_version used to skip matching content after FileRead. */
243
+ version?: IVersionArray;
244
+ /** okpkg payload_hash used for SHA3-512 comparison after FileRead. */
245
+ payloadHash?: string;
246
+ /** okpkg header_hash used for SHA3-512 comparison after FileRead. */
247
+ headerHash?: string;
248
+ };
249
+ /** STM32 firmware config */
250
+ type IFirmwareReleaseInfo = {
251
+ required: boolean;
252
+ url: string;
253
+ /**
254
+ * Firmware type (bitcoinonly or universal)
255
+ * This field is not present in the remote config, but will be inferred from the firmware field name
256
+ */
257
+ firmwareType?: EFirmwareType;
258
+ /** Firmware UI resource */
259
+ resource?: string;
260
+ resourceFingerprint?: string;
261
+ resourceExpectedSize?: number;
262
+ /** Firmware full UI resource */
263
+ fullResource?: string;
264
+ fullResourceFingerprint?: string;
265
+ fullResourceExpectedSize?: number;
266
+ fullResourceRange?: string[];
267
+ bootloaderResource?: string;
268
+ bootloaderFingerprint?: string;
269
+ bootloaderExpectedSize?: number;
270
+ bootloaderVersion?: IVersionArray;
271
+ displayBootloaderVersion?: IVersionArray;
272
+ bootloaderRelatedFirmwareVersion?: IVersionArray;
273
+ upgradeType?: 'payload-package-set' | string;
274
+ components?: Record<string, IProtocolV2FirmwareComponent>;
275
+ installOrder?: string[];
276
+ /** Pro2 RESC bundles for incremental direct FileWrite synchronization. */
277
+ resourceBundles?: IProtocolV2ResourceBundle[];
278
+ bootloaderChangelog?: {
279
+ [k in ILocale]: string;
280
+ };
281
+ fingerprint: string;
282
+ expectedSize?: number;
283
+ version: IVersionArray;
284
+ changelog: {
285
+ [k in ILocale]: string;
286
+ };
287
+ };
288
+ /** BLE firmware config */
289
+ type IBLEFirmwareReleaseInfo = {
290
+ required: boolean;
291
+ /** bluetooth dfu version */
292
+ url: string;
293
+ /** stm bluetooth update version */
294
+ webUpdate: string;
295
+ fingerprint: string;
296
+ fingerprintWeb: string;
297
+ expectedSize?: number;
298
+ version: IVersionArray;
299
+ changelog: {
300
+ [k in ILocale]: string;
301
+ };
302
+ };
303
+ type IKnownDevice = Exclude<IDeviceType, 'unknown'>;
304
+ type DeviceTypeMap = {
305
+ [k in IKnownDevice]: {
306
+ firmware: IFirmwareReleaseInfo[];
307
+ /** Pro2 Protocol V2 payload package set */
308
+ 'firmware-v1'?: IFirmwareReleaseInfo[];
309
+ 'firmware-v2'?: IFirmwareReleaseInfo[];
310
+ 'firmware-v8'?: IFirmwareReleaseInfo[];
311
+ 'firmware-btc-v8'?: IFirmwareReleaseInfo[];
312
+ ble: IBLEFirmwareReleaseInfo[];
313
+ };
314
+ };
315
+ type AssetsMap = {
316
+ bridge: {
317
+ version: IVersionArray;
318
+ linux32Rpm: string;
319
+ linux64Rpm: string;
320
+ linux32Deb: string;
321
+ linux64Deb: string;
322
+ win: string;
323
+ mac: string;
324
+ sha256sumAsc: string;
325
+ changelog: {
326
+ [k in ILocale]: string;
327
+ };
328
+ };
60
329
  };
330
+ type RemoteConfigResponse = {
331
+ bridge: AssetsMap['bridge'];
332
+ } & DeviceTypeMap;
61
333
 
62
334
  type DeviceStatus = 'available' | 'occupied' | 'used';
63
335
  declare enum EOneKeyDeviceMode {
@@ -72,6 +344,12 @@ type UnavailableCapabilities = {
72
344
  };
73
345
  type KnownDevice = {
74
346
  connectId: string | null;
347
+ /**
348
+ * Stable physical-device identity. Current SDK responses always include this
349
+ * value; it remains optional in the type during the uuid compatibility window.
350
+ */
351
+ serialNo?: string;
352
+ /** @deprecated Use serialNo instead. */
75
353
  uuid: string;
76
354
  deviceId: string | null;
77
355
  deviceType: IDeviceType | null;
@@ -82,7 +360,9 @@ type KnownDevice = {
82
360
  name: string;
83
361
  error?: typeof undefined;
84
362
  mode: EOneKeyDeviceMode;
85
- features: Messages.Features;
363
+ features?: Features;
364
+ /** Unified SDK device-state snapshot; features remains a legacy projection. */
365
+ state?: DeviceState;
86
366
  unavailableCapabilities: UnavailableCapabilities;
87
367
  bleFirmwareVersion: IVersionArray | null;
88
368
  firmwareVersion: IVersionArray | null;
@@ -92,6 +372,17 @@ type KnownDevice = {
92
372
  };
93
373
  type SearchDevice = {
94
374
  connectId: string | null;
375
+ /**
376
+ * Available after device initialization. BLE discovery does not connect to the
377
+ * device, so it returns null until a later initialized device response. Current
378
+ * SDK responses always include the field; it remains optional in the type during
379
+ * the uuid compatibility window.
380
+ */
381
+ serialNo?: string | null;
382
+ /**
383
+ * @deprecated Ambiguous legacy identifier. Use serialNo for hardware identity
384
+ * and connectId for transport routing.
385
+ */
95
386
  uuid: string;
96
387
  deviceId: string | null;
97
388
  deviceType: IDeviceType;
@@ -99,9 +390,214 @@ type SearchDevice = {
99
390
  commType: OneKeyDeviceCommType;
100
391
  };
101
392
  type Device$1 = KnownDevice;
102
- type Features = Messages.Features;
393
+ type DeviceFeaturesProtocol = 'V1' | 'V2' | 'unknown';
394
+ type DeviceFeaturesMode = 'normal' | 'bootloader' | 'romloader' | 'notInitialized' | 'backupMode' | 'unknown';
395
+ type DeviceFeaturesVerify = {
396
+ firmwareBuildId?: string;
397
+ firmwareHash?: string;
398
+ bootloaderBuildId?: string;
399
+ bootloaderHash?: string;
400
+ boardBuildId?: string;
401
+ boardHash?: string;
402
+ bleBuildId?: string;
403
+ bleHash?: string;
404
+ se01BuildId?: string;
405
+ se01Hash?: string;
406
+ se02BuildId?: string;
407
+ se02Hash?: string;
408
+ se03BuildId?: string;
409
+ se03Hash?: string;
410
+ se04BuildId?: string;
411
+ se04Hash?: string;
412
+ se01BootBuildId?: string;
413
+ se01BootHash?: string;
414
+ se02BootBuildId?: string;
415
+ se02BootHash?: string;
416
+ se03BootBuildId?: string;
417
+ se03BootHash?: string;
418
+ se04BootBuildId?: string;
419
+ se04BootHash?: string;
420
+ };
421
+ type DeviceFeaturesRaw = {
422
+ protocolV1Features?: Messages.Features;
423
+ protocolV1OneKeyFeatures?: OnekeyFeatures;
424
+ protocolV2DeviceInfo?: ProtocolV2DeviceInfo;
425
+ protocolV2DeviceStatus?: DeviceStatus$1;
426
+ };
427
+ type DeviceFeaturesRawPatch = {
428
+ [Key in keyof DeviceFeaturesRaw]?: DeviceFeaturesRaw[Key] | null;
429
+ };
430
+ type DeviceStateProtocol = DeviceFeaturesProtocol;
431
+ type DeviceStateMode = DeviceFeaturesMode;
432
+ type DeviceStateSection = 'identity' | 'status' | 'settings' | 'versions' | 'verification';
433
+ type DeviceStateUpdateSource = 'initialize' | 'device-info' | 'device-status' | 'apply-settings' | 'change-pin' | 'lock' | 'unlock' | 'passphrase' | 'session-clear' | 'firmware-update' | 'transport-reconnect' | 'compatibility';
434
+ type DeviceStateIdentity = {
435
+ deviceType: IDeviceType;
436
+ firmwareType: EFirmwareType;
437
+ model: string | null;
438
+ vendor: string | null;
439
+ deviceId: string | null;
440
+ serialNo: string;
441
+ label: string | null;
442
+ bleName: string | null;
443
+ };
444
+ type DeviceStateStatus = {
445
+ mode: DeviceStateMode;
446
+ initialized: boolean | null;
447
+ unlocked: boolean | null;
448
+ firmwarePresent: boolean | null;
449
+ backupRequired: boolean | null;
450
+ noBackup: boolean | null;
451
+ unfinishedBackup: boolean | null;
452
+ recoveryMode: boolean | null;
453
+ passphraseProtection: boolean | null;
454
+ pinProtection: boolean | null;
455
+ attachToPinEnabled: boolean | null;
456
+ unlockedAttachPin: boolean | null;
457
+ };
458
+ type DeviceStateSettings = {
459
+ language: string | null;
460
+ bleEnabled: boolean | null;
461
+ sdCardPresent: boolean | null;
462
+ sdProtection: boolean | null;
463
+ wipeCodeProtection: boolean | null;
464
+ passphraseAlwaysOnDevice: boolean | null;
465
+ safetyChecks: string | null;
466
+ autoLockDelayMs: number | null;
467
+ autoShutdownDelayMs: number | null;
468
+ displayRotation: number | null;
469
+ experimentalFeatures: boolean | null;
470
+ wallpaperPath: string | null;
471
+ brightness: number | null;
472
+ animationEnabled: boolean | null;
473
+ tapToWake: boolean | null;
474
+ hapticFeedback: boolean | null;
475
+ deviceNameDisplayEnabled: boolean | null;
476
+ airgapMode: boolean | null;
477
+ fidoEnabled: boolean | null;
478
+ usbLockEnabled: boolean | null;
479
+ randomKeypad: boolean | null;
480
+ };
481
+ type DeviceStateVersions = {
482
+ firmware: string | null;
483
+ bootloader: string | null;
484
+ board: string | null;
485
+ ble: string | null;
486
+ /** @deprecated Kept for legacy consumers; new code should read se01. */
487
+ se?: string | null;
488
+ se01?: string | null;
489
+ se02?: string | null;
490
+ se03?: string | null;
491
+ se04?: string | null;
492
+ se01Boot?: string | null;
493
+ se02Boot?: string | null;
494
+ se03Boot?: string | null;
495
+ se04Boot?: string | null;
496
+ };
497
+ type DeviceState = {
498
+ schemaVersion: 1;
499
+ revision: number;
500
+ updatedAt: number;
501
+ protocol: DeviceStateProtocol;
502
+ /** Device-message protocol version, independent of the SDK V1/V2 protocol family. */
503
+ protocolVersion: number | null;
504
+ identity: DeviceStateIdentity;
505
+ status: DeviceStateStatus;
506
+ settings: DeviceStateSettings;
507
+ versions: DeviceStateVersions;
508
+ capabilities: Array<number | string>;
509
+ verification?: Partial<DeviceFeaturesVerify>;
510
+ };
511
+ type DeviceStatePatch = {
512
+ protocol?: DeviceStateProtocol;
513
+ protocolVersion?: number | null;
514
+ identity?: Partial<DeviceStateIdentity>;
515
+ status?: Partial<DeviceStateStatus>;
516
+ settings?: Partial<DeviceStateSettings>;
517
+ versions?: Partial<DeviceStateVersions>;
518
+ capabilities?: Array<number | string>;
519
+ verification?: DeviceFeaturesVerify;
520
+ raw?: DeviceFeaturesRawPatch;
521
+ };
522
+ type DeviceStateEvent = {
523
+ connectId: string | null;
524
+ state: DeviceState;
525
+ revision: number;
526
+ source: DeviceStateUpdateSource;
527
+ changedKeys: string[];
528
+ };
529
+ type NormalizedFeatures = {
530
+ protocol: DeviceFeaturesProtocol;
531
+ protocolVersion?: number | null;
532
+ deviceType: IDeviceType;
533
+ firmwareType: EFirmwareType;
534
+ model: string | null;
535
+ vendor: string | null;
536
+ deviceId: string | null;
537
+ serialNo: string;
538
+ label: string | null;
539
+ bleName: string | null;
540
+ capabilities: Array<number | string>;
541
+ mode: DeviceFeaturesMode;
542
+ initialized: boolean | null;
543
+ bootloaderMode: boolean | null;
544
+ unlocked: boolean | null;
545
+ firmwarePresent: boolean | null;
546
+ passphraseProtection: boolean | null;
547
+ pinProtection: boolean | null;
548
+ backupRequired: boolean | null;
549
+ noBackup: boolean | null;
550
+ unfinishedBackup: boolean | null;
551
+ recoveryMode: boolean | null;
552
+ language: string | null;
553
+ bleEnabled: boolean | null;
554
+ sdCardPresent: boolean | null;
555
+ sdProtection: boolean | null;
556
+ wipeCodeProtection: boolean | null;
557
+ passphraseAlwaysOnDevice: boolean | null;
558
+ attachToPinEnabled?: boolean | null;
559
+ safetyChecks: string | null;
560
+ autoLockDelayMs: number | null;
561
+ autoShutdownDelayMs: number | null;
562
+ displayRotation: number | null;
563
+ experimentalFeatures: boolean | null;
564
+ wallpaperPath: string | null;
565
+ brightness: number | null;
566
+ animationEnabled: boolean | null;
567
+ tapToWake: boolean | null;
568
+ hapticFeedback: boolean | null;
569
+ deviceNameDisplayEnabled: boolean | null;
570
+ airgapMode: boolean | null;
571
+ fidoEnabled: boolean | null;
572
+ usbLockEnabled: boolean | null;
573
+ randomKeypad: boolean | null;
574
+ firmwareVersion: string | null;
575
+ bootloaderVersion: string | null;
576
+ boardVersion: string | null;
577
+ bleVersion: string | null;
578
+ se01Version?: string | null;
579
+ se02Version?: string | null;
580
+ se03Version?: string | null;
581
+ se04Version?: string | null;
582
+ se01BootVersion?: string | null;
583
+ se02BootVersion?: string | null;
584
+ se03BootVersion?: string | null;
585
+ se04BootVersion?: string | null;
586
+ seVersion?: string | null;
587
+ verify?: DeviceFeaturesVerify;
588
+ sessionId: string | null;
589
+ passphraseState?: string;
590
+ unlockedAttachPin?: boolean;
591
+ raw?: DeviceFeaturesRaw;
592
+ };
593
+ type Features = NormalizedFeatures & Partial<Omit<Messages.Features, keyof NormalizedFeatures>> & Partial<Omit<Messages.OnekeyFeatures, keyof NormalizedFeatures | keyof Messages.Features>>;
103
594
  type OnekeyFeatures = Messages.OnekeyFeatures;
104
- type IDeviceType = EDeviceType.Unknown | EDeviceType.Classic | EDeviceType.Classic1s | EDeviceType.ClassicPure | EDeviceType.Mini | EDeviceType.Touch | EDeviceType.Pro;
595
+ type IDeviceType = EDeviceType.Unknown | EDeviceType.Classic | EDeviceType.Classic1s | EDeviceType.ClassicPure | EDeviceType.Mini | EDeviceType.Touch | EDeviceType.Pro | EDeviceType.Pro2;
596
+ /**
597
+ * model_classic: 'classic' | 'classic1s' | 'classicpure'
598
+ * model_mini: 'classic' | 'classic1s' | 'classicpure' | 'mini'
599
+ * model_touch: 'touch' | 'pro'
600
+ */
105
601
  type IDeviceModel = 'model_classic' | 'model_mini' | 'model_touch' | 'model_classic1s';
106
602
  declare const DeviceModelToTypes: {
107
603
  [deviceModel in IDeviceModel]: IDeviceType[];
@@ -115,6 +611,7 @@ type ITransportStatus = 'valid' | 'outdated';
115
611
  type IVersionRange = {
116
612
  min: string;
117
613
  max?: string;
614
+ unsupported?: boolean;
118
615
  };
119
616
  type DeviceFirmwareRange = {
120
617
  [deviceType in IDeviceType | IDeviceModel]?: IVersionRange;
@@ -165,91 +662,593 @@ type SupportFeatures = {
165
662
  modifyHomescreen: SupportFeatureType;
166
663
  };
167
664
 
168
- type transportEnv = 'node' | 'web' | 'webextension' | 'electron' | 'react-native' | 'webusb' | 'desktop-webusb' | 'desktop-web-ble' | 'emulator' | 'lowlevel' | 'node-usb';
169
- type ConnectSettings = {
170
- connectSrc?: string;
171
- debug?: boolean;
172
- transportReconnect?: boolean;
173
- lazyLoad?: boolean;
174
- origin?: string;
175
- parentOrigin?: string;
176
- configSrc: string;
177
- iframeSrc: string;
178
- version: string;
179
- priority: number;
180
- trustedHost: boolean;
181
- supportedBrowser?: boolean;
182
- env: transportEnv;
183
- timestamp: number;
184
- isFrame?: boolean;
185
- preRelease?: boolean;
186
- fetchConfig?: boolean;
187
- extension?: string;
188
- configFetcher?: (url: string) => Promise<RemoteConfigResponse | null>;
665
+ type DeviceStateScope = 'runtime' | 'settings' | 'firmware';
666
+ type GetDeviceStateParams = CommonParams & {
667
+ scope?: DeviceStateScope;
189
668
  };
190
- type IVersionArray = [number, number, number];
191
- type ILocale = 'zh-CN' | 'en-US';
192
- type IFirmwareReleaseInfo = {
193
- required: boolean;
194
- url: string;
195
- firmwareType?: EFirmwareType;
196
- resource?: string;
197
- fullResource?: string;
198
- fullResourceRange?: string[];
199
- bootloaderResource?: string;
200
- bootloaderVersion?: IVersionArray;
201
- displayBootloaderVersion?: IVersionArray;
202
- bootloaderRelatedFirmwareVersion?: IVersionArray;
203
- bootloaderChangelog?: {
204
- [k in ILocale]: string;
205
- };
206
- fingerprint: string;
207
- version: IVersionArray;
208
- changelog: {
209
- [k in ILocale]: string;
210
- };
669
+ /** Internal state-read options, not part of the public CoreApi. */
670
+ type DeviceStateReadOptions = {
671
+ refreshSections?: DeviceStateSection[];
672
+ includeRaw?: boolean;
211
673
  };
212
- type IBLEFirmwareReleaseInfo = {
213
- required: boolean;
214
- url: string;
215
- webUpdate: string;
216
- fingerprint: string;
217
- fingerprintWeb: string;
218
- version: IVersionArray;
219
- changelog: {
220
- [k in ILocale]: string;
221
- };
674
+ declare function getDeviceState(connectId?: string, params?: GetDeviceStateParams): Response<DeviceState>;
675
+
676
+ type DeviceDescriptorDiff = {
677
+ didUpdate: boolean;
678
+ connected: OneKeyDeviceInfo[];
679
+ disconnected: OneKeyDeviceInfo[];
680
+ changedSessions: OneKeyDeviceInfo[];
681
+ changedDebugSessions: OneKeyDeviceInfo[];
682
+ acquired: OneKeyDeviceInfo[];
683
+ debugAcquired: OneKeyDeviceInfo[];
684
+ released: OneKeyDeviceInfo[];
685
+ debugReleased: OneKeyDeviceInfo[];
686
+ descriptors: OneKeyDeviceInfo[];
222
687
  };
223
- type IKnownDevice = Exclude<IDeviceType, 'unknown'>;
224
- type DeviceTypeMap = {
225
- [k in IKnownDevice]: {
226
- firmware: IFirmwareReleaseInfo[];
227
- 'firmware-v2'?: IFirmwareReleaseInfo[];
228
- 'firmware-v8'?: IFirmwareReleaseInfo[];
229
- 'firmware-btc-v8'?: IFirmwareReleaseInfo[];
230
- ble: IBLEFirmwareReleaseInfo[];
231
- };
688
+
689
+ declare class DeviceConnector {
690
+ transport: Transport;
691
+ listenTimestamp: number;
692
+ current: OneKeyDeviceInfo[] | null;
693
+ upcoming: OneKeyDeviceInfo[];
694
+ listening: boolean;
695
+ constructor();
696
+ enumerate(): Promise<DeviceDescriptorDiff | undefined>;
697
+ listen(): Promise<void>;
698
+ stop(): void;
699
+ acquire(path: string, session?: string | null, forceCleanRunPromise?: boolean, connectProtocol?: HardwareConnectProtocol): Promise<string | undefined>;
700
+ release(session: string, onclose: boolean): Promise<void>;
701
+ disconnect(session: string | undefined | null): Promise<void>;
702
+ promptDeviceAccess(): Promise<USBDevice | BluetoothDevice | null>;
703
+ _reportDevicesChange(): void;
704
+ }
705
+
706
+ type InitOptions = {
707
+ initSession?: boolean;
708
+ deviceId?: string;
709
+ passphraseState?: string;
710
+ deriveCardano?: boolean;
711
+ connectProtocol?: HardwareConnectProtocol;
712
+ protocolV2DeviceInfoTimeoutMs?: number;
713
+ /** Refresh Protocol V2 runtime state before returning discovery results. */
714
+ refreshRuntimeState?: boolean;
232
715
  };
233
- type AssetsMap = {
234
- bridge: {
235
- version: IVersionArray;
236
- linux32Rpm: string;
237
- linux64Rpm: string;
238
- linux32Deb: string;
239
- linux64Deb: string;
240
- win: string;
241
- mac: string;
242
- sha256sumAsc: string;
243
- changelog: {
244
- [k in ILocale]: string;
245
- };
716
+ type RunOptions = {
717
+ keepSession?: boolean;
718
+ skipInitialize?: boolean;
719
+ } & InitOptions;
720
+ interface DeviceEvents {
721
+ [DEVICE.PIN]: [Device, Messages.PinMatrixRequestType | undefined, (err: any, pin: string) => void];
722
+ [DEVICE.PASSPHRASE_ON_DEVICE]: [Device, PassphraseRequestPayload?];
723
+ [DEVICE.ATTACH_PIN_ON_DEVICE]: [Device, PassphraseRequestPayload?];
724
+ [DEVICE.BUTTON]: [Device, DeviceButtonRequestPayload];
725
+ [DEVICE.FEATURES]: [Device, DeviceFeaturesPayload];
726
+ [DEVICE.STATE]: [Device, DeviceStateEvent];
727
+ [DEVICE.PASSPHRASE]: [
728
+ Device,
729
+ PassphraseRequestPayload,
730
+ (response: PassphrasePromptResponse, error?: Error) => void
731
+ ];
732
+ [DEVICE.SELECT_DEVICE_IN_BOOTLOADER_FOR_WEB_DEVICE]: [
733
+ Device,
734
+ (err: any, deviceId: string) => void
735
+ ];
736
+ [DEVICE.SELECT_DEVICE_FOR_SWITCH_FIRMWARE_WEB_DEVICE]: [
737
+ Device,
738
+ (err: any, deviceId: string) => void
739
+ ];
740
+ }
741
+ /**
742
+ * Pre-populate the device session cache with a known session ID.
743
+ *
744
+ * This allows short-lived processes (e.g. CLI) to restore a previously
745
+ * obtained session, avoiding the need to re-enter passphrase on every
746
+ * invocation. The session must have been obtained from a prior
747
+ * getPassphraseState() call on the same device.
748
+ *
749
+ * @param deviceId - The device's device_id (from features)
750
+ * @param passphraseState - The passphrase state token
751
+ * @param sessionId - The session_id to cache (from features.session_id)
752
+ */
753
+ declare function preloadSessionCache(deviceId: string, passphraseState: string, sessionId: string): void;
754
+ interface Device {
755
+ on<K extends keyof DeviceEvents>(type: K, listener: (...event: DeviceEvents[K]) => void): this;
756
+ off<K extends keyof DeviceEvents>(type: K, listener: (...event: DeviceEvents[K]) => void): this;
757
+ emit<K extends keyof DeviceEvents>(type: K, ...args: DeviceEvents[K]): boolean;
758
+ }
759
+ declare class Device extends EventEmitter {
760
+ /**
761
+ * 设备标识对象
762
+ */
763
+ originalDescriptor: OneKeyDeviceInfo;
764
+ sdkInstanceId?: string;
765
+ /**
766
+ * 设备实例唯一标识
767
+ */
768
+ instanceId: string;
769
+ createdAt: number;
770
+ /**
771
+ * 设备主 ID
772
+ * 蓝牙连接时是设备的 UUID
773
+ * USB连接时是设备的 sessionID
774
+ */
775
+ mainId?: string | null;
776
+ /**
777
+ * 通信管道,向设备发送请求
778
+ */
779
+ deviceConnector?: DeviceConnector | null;
780
+ /**
781
+ * 固件命令
782
+ */
783
+ commands: DeviceCommands;
784
+ /**
785
+ * 可取消的操作
786
+ */
787
+ private cancelableAction?;
788
+ /**
789
+ * 设备是否被占用
790
+ */
791
+ private deviceAcquired;
792
+ /** Canonical device-state cache; legacy Features is a compatibility projection. */
793
+ private stateStore;
794
+ /** Force the next initialization to reload DeviceInfo after reconnect or reboot. */
795
+ private protocolV2StateNeedsReload;
796
+ get state(): (DeviceState & {
797
+ raw?: DeviceFeaturesRaw | undefined;
798
+ }) | undefined;
799
+ get features(): Features | undefined;
800
+ set features(features: Features | undefined);
801
+ runPromise?: Deferred<void> | null;
802
+ externalState: string[];
803
+ unavailableCapabilities: UnavailableCapabilities;
804
+ instance: number;
805
+ internalState: string[];
806
+ needReloadDevice: boolean;
807
+ /**
808
+ * 执行 API 方法后是否保留 SessionID
809
+ */
810
+ keepSession: boolean;
811
+ passphraseState: string | undefined;
812
+ pendingCallbackPromise?: Deferred<void>;
813
+ /** Pre-initialize timestamp (ms) */
814
+ private preInitializedAt?;
815
+ /** Pre-initialize context, used to verify state consistency before skipping */
816
+ private preInitializeMeta?;
817
+ /** Last Initialize duration (ms), reported as "saved" when a skip happens */
818
+ private lastInitializeDurationMs?;
819
+ constructor(descriptor: OneKeyDeviceInfo, sdkInstanceId?: string);
820
+ static fromDescriptor(originalDescriptor: OneKeyDeviceInfo, sdkInstanceId?: string): Device;
821
+ toMessageObject(): Device$1 | null;
822
+ /**
823
+ * Device connect
824
+ * @returns {Promise<boolean>}
825
+ */
826
+ connect(connectProtocol?: HardwareConnectProtocol): Promise<boolean>;
827
+ acquire(connectProtocol?: HardwareConnectProtocol, options?: {
828
+ throwOnRunPromiseError?: boolean;
829
+ }): Promise<void>;
830
+ release(): Promise<void>;
831
+ /**
832
+ * Pre-initialize: connect + Initialize ahead of the sign.
833
+ */
834
+ preInitialize(initOptions?: InitOptions): Promise<void>;
835
+ markPreInitialized(meta?: {
836
+ passphraseState?: string;
837
+ }): void;
838
+ clearPreInitialized(): void;
839
+ isPreInitializeMetaMatch(payload?: {
840
+ passphraseState?: string;
841
+ }): boolean;
842
+ isPreInitializedValid(ttlMs: number): boolean;
843
+ setLastInitializeDuration(durationMs: number): void;
844
+ getLastInitializeDuration(): number | undefined;
845
+ getCommands(): DeviceCommands;
846
+ /**
847
+ * Canonical protocol discriminator.
848
+ *
849
+ * descriptor.protocolType is established by active probing; V2 features are mapped
850
+ * from DeviceInfoGet. All protocol branches must use this method instead of reading
851
+ * originalDescriptor.protocolType directly or inferring a protocol from features.
852
+ */
853
+ getProtocol(): 'V1' | 'V2';
854
+ isProtocolV2(): boolean;
855
+ getCurrentDeviceType(): IDeviceType;
856
+ getCurrentDeviceId(): string | undefined;
857
+ getCurrentSerialNo(): string;
858
+ getConnectId(): string;
859
+ getCurrentBleName(): string | null;
860
+ getCurrentLabel(): string | null;
861
+ getCurrentPassphraseProtection(): boolean | null | undefined;
862
+ getCurrentFirmwareType(): _onekeyfe_hd_shared.EFirmwareType;
863
+ getCurrentFirmwareVersionString(): string;
864
+ getCurrentBLEFirmwareVersionString(): string | undefined;
865
+ getCurrentBootloaderVersionString(): string | undefined;
866
+ getCurrentSafetyChecks(): string | null | undefined;
867
+ getCurrentMethodVersionRange(getVersionRange: (deviceModel: IDeviceType | IDeviceModel) => IVersionRange | undefined): IVersionRange | undefined;
868
+ supportNewPassphrase(): SupportFeatureType;
869
+ supportInputPinOnSoftware(): SupportFeatureType;
870
+ supportModifyHomescreen(): SupportFeatureType;
871
+ private getSessionCacheDeviceKey;
872
+ getInternalState(_deviceId?: string): string | undefined;
873
+ updateInternalState(enablePassphrase: boolean, passphraseState: string | undefined, deviceId: string | undefined, sessionId?: string | null, featuresSessionId?: string | null): void;
874
+ private setInternalState;
875
+ clearInternalState(_deviceId?: string): void;
876
+ initialize(options?: InitOptions): Promise<void>;
877
+ /**
878
+ * Device initialization over Protocol V2.
879
+ *
880
+ * Protocol V2 bypasses legacy Initialize/GetFeatures and builds its canonical
881
+ * features state directly from DeviceInfoGet.
882
+ */
883
+ private _initializeProtocolV2;
884
+ getFeatures(): Promise<Features | undefined>;
885
+ getDeviceState(params?: DeviceStateReadOptions): Promise<DeviceState>;
886
+ _updateFeatures(protoFeatures: Messages.Features | Features, initSession?: boolean): void;
887
+ updateState(patch: DeviceStatePatch, source: DeviceStateUpdateSource): DeviceState & {
888
+ raw?: DeviceFeaturesRaw | undefined;
246
889
  };
890
+ updateFeaturesPatch(patch: Partial<Features>, source: DeviceStateUpdateSource): Features | undefined;
891
+ probeProtocolV2RuntimeState(deviceInfo: ProtocolV2DeviceInfo, timeoutMs?: number): Promise<Features>;
892
+ updateProtocolV2Features(deviceInfo?: ProtocolV2DeviceInfo, deviceStatus?: DeviceStatus$1 | null, runtimeMode?: ProtocolV2RuntimeMode): Features;
893
+ updateProtocolV2Status(status: DeviceStatus$1): Features;
894
+ markTransportDisconnected(): void;
895
+ markProtocolV2Reboot(rebootType: DeviceRebootType): void;
896
+ /**
897
+ * 暂时只在 acquire 后更新 Session ID
898
+ * 后续看是否有需要依据 listen 返回结果更新
899
+ * @param descriptor
900
+ */
901
+ updateDescriptor(descriptor: OneKeyDeviceInfo, forceUpdate?: boolean): void;
902
+ updateFromCache(device: Device): void;
903
+ run(fn?: () => Promise<void>, options?: RunOptions): Promise<void>;
904
+ _runInner<T>(fn: (() => Promise<T>) | undefined, options: RunOptions, runPromise: Deferred<void>): Promise<void>;
905
+ interruptionFromOutside(): Promise<void>;
906
+ interruptionFromUser(): Promise<void>;
907
+ setCancelableAction(callback: (err?: Error) => Promise<unknown>): void;
908
+ clearCancelableAction(): void;
909
+ getMode(): EOneKeyDeviceMode;
910
+ getFirmwareVersion(): IVersionArray | null;
911
+ getBLEFirmwareVersion(): IVersionArray | null;
912
+ isUsed(): boolean;
913
+ hasDeviceAcquire(): boolean;
914
+ isUsedHere(): boolean;
915
+ isUsedElsewhere(): boolean;
916
+ isBootloader(): boolean | undefined;
917
+ isInitialized(): boolean | undefined;
918
+ isSeedless(): boolean | undefined;
919
+ isUnacquired(): boolean;
920
+ hasUnexpectedMode(allow: string[], require: string[]): "ui-device_bootloader_mode" | "ui-device_not_in_bootloader_mode" | "ui-device_not_initialized" | "ui-device_seedless" | null;
921
+ hasUsePassphrase(): boolean;
922
+ checkDeviceId(deviceId: string): boolean;
923
+ lockDevice(): Promise<Success$1>;
924
+ supportUnlockVersionRange(): DeviceFirmwareRange;
925
+ unlockDevice(): Promise<Features | undefined>;
926
+ checkPassphraseStateSafety(passphraseState?: string, useEmptyPassphrase?: boolean, skipPassphraseCheck?: boolean): Promise<boolean>;
927
+ }
928
+
929
+ /**
930
+ * SDK Tracing Utilities
931
+ * Tracks object instances and request call chains across multiple SDK instances
932
+ */
933
+ /**
934
+ * Generate SDK instance ID
935
+ * @returns Format: "SDK-<number>-<timestamp>"
936
+ * @example "SDK-1-123456"
937
+ */
938
+ declare function generateSdkInstanceId(): string;
939
+ /**
940
+ * Generate globally unique instance ID
941
+ * @param type Instance type (Device, DeviceCommands, BaseMethod, etc.)
942
+ * @param sdkInstanceId SDK instance ID (optional)
943
+ * @returns Format: <SDK>.<type>-<number>-<timestamp>
944
+ * @example "SDK-1.Device-1-123456" or "Device-1-123456"
945
+ */
946
+ declare function generateInstanceId(type: string, sdkInstanceId?: string): string;
947
+ /**
948
+ * Request context information
949
+ */
950
+ interface RequestContext {
951
+ /** Request unique ID (reuses BaseMethod.responseID) */
952
+ responseID: number;
953
+ /** SDK instance ID */
954
+ sdkInstanceId?: string;
955
+ /** API method name */
956
+ methodName: string;
957
+ /** Device connection ID */
958
+ connectId?: string;
959
+ /** Device instance ID */
960
+ deviceInstanceId?: string;
961
+ /** DeviceCommands instance ID */
962
+ commandsInstanceId?: string;
963
+ /** Parent request ID (for nested calls like allNetworkGetAddress) */
964
+ parentResponseID?: number;
965
+ /** Request start time */
966
+ startTime: number;
967
+ /** Request end time */
968
+ endTime?: number;
969
+ /** Request status */
970
+ status?: 'pending' | 'running' | 'success' | 'error' | 'cancelled';
971
+ /** Error message */
972
+ error?: string;
973
+ }
974
+ /**
975
+ * SDK instance tracing context
976
+ */
977
+ interface SdkTracingContext {
978
+ /** SDK instance ID */
979
+ sdkInstanceId: string;
980
+ /** Creation timestamp */
981
+ createdAt: number;
982
+ /** Active requests */
983
+ activeRequests: Map<number, RequestContext>;
984
+ }
985
+ /**
986
+ * Create SDK instance tracing context
987
+ */
988
+ declare function createSdkTracingContext(): SdkTracingContext;
989
+ /**
990
+ * Create and register request context
991
+ * @param responseID Request ID (reuses BaseMethod.responseID)
992
+ * @param methodName API method name
993
+ * @param options Additional options
994
+ */
995
+ declare function createRequestContext(responseID: number, methodName: string, options?: {
996
+ sdkInstanceId?: string;
997
+ connectId?: string;
998
+ deviceInstanceId?: string;
999
+ commandsInstanceId?: string;
1000
+ parentResponseID?: number;
1001
+ }): RequestContext;
1002
+ /**
1003
+ * Update request context
1004
+ */
1005
+ declare function updateRequestContext(responseID: number, updates: Partial<RequestContext>): void;
1006
+ /**
1007
+ * Complete request context
1008
+ */
1009
+ declare function completeRequestContext(responseID: number, error?: Error): void;
1010
+ /**
1011
+ * Get active requests for specific Device instance
1012
+ */
1013
+ declare function getActiveRequestsByDeviceInstance(deviceInstanceId: string): RequestContext[];
1014
+ /**
1015
+ * Format request context for logging
1016
+ */
1017
+ declare function formatRequestContext(context: RequestContext): string;
1018
+ /**
1019
+ * Cleanup specific SDK instance
1020
+ */
1021
+ declare function cleanupSdkInstance(sdkInstanceId: string): void;
1022
+
1023
+ declare class Core extends EventEmitter {
1024
+ private tracingContext;
1025
+ readonly sdkInstanceId: string;
1026
+ private requestQueue;
1027
+ private disposePromise?;
1028
+ private prePendingCallPromise;
1029
+ private methodSynchronize;
1030
+ constructor();
1031
+ cancelOperation(operationId: string): void;
1032
+ private getCoreContext;
1033
+ handleMessage(message: CoreMessage): Promise<any>;
1034
+ dispose(): Promise<void>;
1035
+ private disposeResources;
1036
+ }
1037
+ declare const init$1: (settings: ConnectSettings, Transport: any, plugin?: LowlevelTransportSharedPlugin) => Promise<Core | undefined>;
1038
+ declare const switchTransport: ({ env, Transport, plugin, }: {
1039
+ env: ConnectSettings['env'];
1040
+ Transport: any;
1041
+ plugin?: LowlevelTransportSharedPlugin | undefined;
1042
+ }) => void;
1043
+
1044
+ type HiddenWalletSelection = {
1045
+ host_passphrase: DeviceHostPassphrase;
1046
+ passphrase_on_device?: never;
1047
+ attach_pin_on_device?: never;
1048
+ } | {
1049
+ host_passphrase?: never;
1050
+ passphrase_on_device: DevicePassphraseOnDevice;
1051
+ attach_pin_on_device?: never;
1052
+ } | {
1053
+ host_passphrase?: never;
1054
+ passphrase_on_device?: never;
1055
+ attach_pin_on_device: DeviceAttachPinOnDevice;
1056
+ };
1057
+ type DeviceSessionOpenParams = {
1058
+ resume: DeviceSessionResume;
1059
+ select?: never;
1060
+ } | {
1061
+ resume?: never;
1062
+ select: HiddenWalletSelection;
1063
+ };
1064
+
1065
+ type DeviceInfoGetTargets = {
1066
+ hw?: boolean;
1067
+ fw?: boolean;
1068
+ coprocessor?: boolean;
1069
+ se1?: boolean;
1070
+ se2?: boolean;
1071
+ se3?: boolean;
1072
+ se4?: boolean;
1073
+ };
1074
+ type DeviceInfoGetTypes = {
1075
+ version?: boolean;
1076
+ build_id?: boolean;
1077
+ hash?: boolean;
1078
+ specific?: boolean;
1079
+ };
1080
+ type DeviceInfoGetParams = {
1081
+ targets?: DeviceInfoGetTargets;
1082
+ types?: DeviceInfoGetTypes;
1083
+ };
1084
+
1085
+ type DeviceSettingsSetParams = {
1086
+ settings?: Omit<DeviceSettings, 'passphrase_enable' | 'airgap_mode'>;
1087
+ };
1088
+
1089
+ type SupportedDeviceSettingsPage = DeviceSettingsPage;
1090
+ type DeviceSettingsPageShowParams = {
1091
+ page?: SupportedDeviceSettingsPage | 'DeviceReset' | 'DevicePinChange' | 'DevicePassphrase' | 'DeviceAirgap';
1092
+ fieldName?: string;
1093
+ field_name?: string;
1094
+ };
1095
+
1096
+ declare const PRO2_WALLPAPER_WIDTH = 604;
1097
+ declare const PRO2_WALLPAPER_HEIGHT = 1024;
1098
+ type Pro2WallpaperColorFormat = 'RGB565' | 'RGB565A8';
1099
+ declare function encodePro2Wallpaper(options: {
1100
+ width: number;
1101
+ height: number;
1102
+ rgba: Uint8Array | ArrayBuffer;
1103
+ }): {
1104
+ data: Uint8Array;
1105
+ colorFormat: Pro2WallpaperColorFormat;
1106
+ };
1107
+
1108
+ type DeviceUploadWallpaperParams = {
1109
+ width: number;
1110
+ height: number;
1111
+ rgba: Uint8Array | ArrayBuffer;
1112
+ fileName?: string;
1113
+ chunkSize?: number;
1114
+ };
1115
+ type DeviceUploadWallpaperResponse = {
1116
+ path: string;
1117
+ size: number;
1118
+ colorFormat: Pro2WallpaperColorFormat;
1119
+ message?: string;
247
1120
  };
248
- type RemoteConfigResponse = {
249
- bridge: AssetsMap['bridge'];
250
- } & DeviceTypeMap;
251
1121
 
252
- declare function init$1(settings: Partial<ConnectSettings>, lowLevelApi?: LowLevelCoreApi, pulgin?: LowlevelTransportSharedPlugin): Promise<boolean>;
1122
+ type FileOpSuccess = {
1123
+ message?: string;
1124
+ };
1125
+ type FileInfo = {
1126
+ path: string;
1127
+ offset: number;
1128
+ total_size: number;
1129
+ data?: Uint8Array;
1130
+ data_hash?: number;
1131
+ processed_byte?: number;
1132
+ chunks?: number;
1133
+ };
1134
+ type DirInfo = {
1135
+ path: string;
1136
+ child_dirs?: string;
1137
+ child_files?: string;
1138
+ };
1139
+ type PathInfoResult = {
1140
+ exist: boolean;
1141
+ size: number;
1142
+ year: number;
1143
+ month: number;
1144
+ day: number;
1145
+ hour: number;
1146
+ minute: number;
1147
+ second: number;
1148
+ readonly: boolean;
1149
+ hidden: boolean;
1150
+ system: boolean;
1151
+ archive: boolean;
1152
+ directory: boolean;
1153
+ };
1154
+ type DeviceSessionOpenResponse = {
1155
+ session_id: string;
1156
+ btc_test_address: string;
1157
+ };
1158
+ /** @deprecated Development-only raw Protocol V2 command. Use `getDeviceState`. */
1159
+ declare function deviceInfoGet(connectId: string, params?: CommonParams & DeviceInfoGetParams): Response<ProtocolV2DeviceInfo>;
1160
+ /** @deprecated Development-only raw Protocol V2 command. Use `getDeviceState`. */
1161
+ declare function deviceStatusGet(connectId: string, params?: CommonParams): Response<DeviceStatus$1>;
1162
+ /** @deprecated Development-only raw Protocol V2 command. Use `getDeviceState`. */
1163
+ declare function deviceSettingsGet(connectId: string, params?: CommonParams): Response<DeviceSettings>;
1164
+ /** @deprecated Development-only raw Protocol V2 command. */
1165
+ declare function protocolInfoRequest(connectId: string, params?: CommonParams): Response<ProtocolInfo>;
1166
+ declare function ping(connectId: string, params?: CommonParams & {
1167
+ message?: string;
1168
+ }): Response<Success$1>;
1169
+ declare function deviceReboot(connectId: string, params: CommonParams & DeviceRebootParams): Response<Success$1>;
1170
+ declare function deviceGetOnboardingStatus(connectId: string, params?: CommonParams): Response<DevOnboardingStatus>;
1171
+ /**
1172
+ * @deprecated Use `openWalletSession` instead of the raw Protocol V2 command.
1173
+ */
1174
+ declare function deviceSessionOpen(connectId: string, params: CommonParams & DeviceSessionOpenParams): Response<DeviceSessionOpenResponse>;
1175
+ declare function deviceFirmwareUpdate(connectId: string, params: CommonParams & DeviceFirmwareUpdateParams): Response<Success$1 | DeviceFirmwareUpdateStatus>;
1176
+ declare function deviceGetFirmwareUpdateStatus(connectId: string, params?: CommonParams & DeviceFirmwareUpdateStatusGetParams): Response<DeviceFirmwareUpdateStatus>;
1177
+ declare function deviceFactoryInfoSet(connectId: string, params: CommonParams & DeviceFactoryInfoSetParams): Response<Success$1>;
1178
+ declare function deviceFactoryInfoGet(connectId: string, params?: CommonParams): Response<DeviceFactoryInfo>;
1179
+ declare function deviceSettingsSet(connectId: string, params: CommonParams & DeviceSettingsSetParams): Response<Success$1>;
1180
+ declare function deviceSettingsPageShow(connectId: string, params: CommonParams & DeviceSettingsPageShowParams): Response<Success$1>;
1181
+ declare function deviceUploadWallpaper(connectId: string, params: CommonParams & DeviceUploadWallpaperParams): Response<DeviceUploadWallpaperResponse>;
1182
+ declare function filesystemPermissionFix(connectId: string, params?: CommonParams): Response<Success$1>;
1183
+ declare function fileRead(connectId: string, params: {
1184
+ path: string;
1185
+ offset?: number;
1186
+ totalSize?: number;
1187
+ chunkLen?: number;
1188
+ uiPercentage?: number;
1189
+ }): Response<FileInfo>;
1190
+ declare function fileWrite(connectId: string, params: {
1191
+ path: string;
1192
+ offset?: number;
1193
+ totalSize?: number;
1194
+ chunkSize?: number;
1195
+ chunkLen?: number;
1196
+ data: ArrayBuffer | Uint8Array | Blob | string;
1197
+ overwrite?: boolean;
1198
+ append?: boolean;
1199
+ uiPercentage?: number;
1200
+ timeoutMs?: number | string;
1201
+ }): Response<FileInfo>;
1202
+ declare function fileDelete(connectId: string, params: {
1203
+ path: string;
1204
+ }): Response<FileOpSuccess>;
1205
+ declare function dirList(connectId: string, params: {
1206
+ path: string;
1207
+ depth?: number;
1208
+ }): Response<DirInfo>;
1209
+ declare function dirMake(connectId: string, params: {
1210
+ path: string;
1211
+ }): Response<FileOpSuccess>;
1212
+ declare function dirRemove(connectId: string, params: {
1213
+ path: string;
1214
+ }): Response<FileOpSuccess>;
1215
+ declare function pathInfo(connectId: string, params: {
1216
+ path: string;
1217
+ timeoutMs?: number | string;
1218
+ }): Response<PathInfoResult>;
1219
+ declare function uploadPortfolio(connectId: string, params: {
1220
+ operationId?: string;
1221
+ packageBytes: ArrayBuffer | Uint8Array | Blob;
1222
+ timeoutMs?: number | string;
1223
+ }): Response<FileInfo & {
1224
+ portfolioUpdated: true;
1225
+ }>;
1226
+ declare function filesystemFormat(connectId: string): Response<Success$1>;
1227
+
1228
+ declare const on: <T extends string, P extends (...args: any[]) => any>(type: T, fn: P) => void;
1229
+ declare const off: (type: any, fn: any) => void;
1230
+ declare const removeAllListeners: (type: any) => void;
1231
+
1232
+ declare function uiResponse(response: UiResponseEvent): void;
1233
+
1234
+ type IAddHardwareGlobalEventListener = (coreMessage: CoreMessage) => void;
1235
+ interface LowLevelInjectApi {
1236
+ call: CallMethod;
1237
+ eventEmitter: EventEmitter$1;
1238
+ init: CoreApi['init'];
1239
+ dispose: CoreApi['dispose'];
1240
+ uiResponse: CoreApi['uiResponse'];
1241
+ cancel: CoreApi['cancel'];
1242
+ cancelOperation: CoreApi['cancelOperation'];
1243
+ updateSettings: CoreApi['updateSettings'];
1244
+ switchTransport: CoreApi['switchTransport'];
1245
+ addHardwareGlobalEventListener: (listener: IAddHardwareGlobalEventListener) => void;
1246
+ }
1247
+ type LowLevelCoreApi = Omit<CoreApi, 'on' | 'off'> & {
1248
+ addHardwareGlobalEventListener: (listener: IAddHardwareGlobalEventListener) => void;
1249
+ };
1250
+
1251
+ declare function init(settings: Partial<ConnectSettings>, lowLevelApi?: LowLevelCoreApi, pulgin?: LowlevelTransportSharedPlugin): Promise<boolean>;
253
1252
  declare function updateSettings(settings: Partial<ConnectSettings>): Promise<boolean>;
254
1253
 
255
1254
  declare function testInitializeDeviceDuration(connectId?: string, params?: CommonParams): Response<number>;
@@ -258,6 +1257,15 @@ declare function preInitialize(connectId: string, params?: CommonParams): Respon
258
1257
 
259
1258
  declare function getLogs(): Response<string[]>;
260
1259
 
1260
+ type ClearSessionCacheParams = {
1261
+ deviceId?: string;
1262
+ passphraseState?: string;
1263
+ };
1264
+ type ClearSessionCachePayload = {
1265
+ cleared: true;
1266
+ };
1267
+ declare function clearSessionCache(params?: ClearSessionCacheParams): Response<ClearSessionCachePayload>;
1268
+
261
1269
  declare function checkBridgeStatus(): Response<boolean>;
262
1270
 
263
1271
  type CheckBridgeReleaseResponse = {
@@ -281,6 +1289,248 @@ type CheckBootloaderReleaseParams = {
281
1289
  };
282
1290
  declare function checkBootloaderRelease(connectId?: string, params?: CommonParams & CheckBootloaderReleaseParams): Response<CheckBootloaderReleaseResponse>;
283
1291
 
1292
+ interface FirmwareUpdatePreparedEntry {
1293
+ entryName: string;
1294
+ artifact: FirmwareArtifactReference;
1295
+ }
1296
+ interface FirmwareUpdatePreparedArtifactInput {
1297
+ artifactId: string;
1298
+ artifact: FirmwareArtifactReference;
1299
+ materializedEntries?: FirmwareUpdatePreparedEntry[];
1300
+ }
1301
+ interface FirmwareUpdatePreparedArtifact {
1302
+ artifactId: string;
1303
+ role: FirmwareUpdatePlanArtifactRole;
1304
+ target: FirmwareUpdatePlanTarget;
1305
+ container: 'raw' | 'zip';
1306
+ logicalName?: string;
1307
+ targetVersion?: string;
1308
+ artifact: FirmwareArtifactReference;
1309
+ materializedEntries?: FirmwareUpdatePreparedEntry[];
1310
+ }
1311
+ interface FirmwareUpdatePreparedPlan {
1312
+ schemaVersion: 1;
1313
+ preparedPlanDigest: string;
1314
+ planDigest: string;
1315
+ networkPolicy: 'forbid';
1316
+ executor: FirmwareUpdatePlan['executor'];
1317
+ deviceIdentity: string;
1318
+ deviceModel: string;
1319
+ firmwareType: FirmwareUpdatePlan['firmwareType'];
1320
+ platform: FirmwareUpdatePlan['platform'];
1321
+ leaseRef: string;
1322
+ artifacts: FirmwareUpdatePreparedArtifact[];
1323
+ epochs: FirmwareUpdatePlanEpoch[];
1324
+ targetsToUpdate: FirmwareUpdatePlanTarget[];
1325
+ }
1326
+ declare function prepareFirmwareUpdatePlan(input: {
1327
+ plan: FirmwareUpdatePlan;
1328
+ leaseRef: string;
1329
+ artifacts: FirmwareUpdatePreparedArtifactInput[];
1330
+ }): FirmwareUpdatePreparedPlan;
1331
+ declare function validateFirmwareUpdatePreparedPlan(value: unknown): FirmwareUpdatePreparedPlan;
1332
+
1333
+ type IUpdateType = 'firmware' | 'ble';
1334
+ interface FirmwareArtifactReference {
1335
+ artifactRef: string;
1336
+ size: number;
1337
+ sha256: string;
1338
+ }
1339
+ interface FirmwareArtifactReader {
1340
+ open(input: {
1341
+ artifactRef: string;
1342
+ }): Promise<{
1343
+ readerId: string;
1344
+ size: number;
1345
+ }>;
1346
+ read(input: {
1347
+ readerId: string;
1348
+ offset: number;
1349
+ length: number;
1350
+ }): Promise<{
1351
+ data: ArrayBuffer;
1352
+ bytesRead: number;
1353
+ eof: boolean;
1354
+ }>;
1355
+ close(input: {
1356
+ readerId: string;
1357
+ }): Promise<void>;
1358
+ }
1359
+ type FirmwareCheckpointStage = 'EPOCH_STARTED' | 'EPOCH_COMPLETED' | 'BEFORE_DEVICE_MODE_CHANGE' | 'FILE_TRANSFER_STARTED' | 'FILE_TRANSFER_COMPLETED' | 'INSTALL_REQUESTED' | 'INSTALL_ACCEPTED' | 'FINAL_VERIFIED';
1360
+ interface FirmwareCheckpoint {
1361
+ schemaVersion: 1;
1362
+ sequence: number;
1363
+ stage: FirmwareCheckpointStage;
1364
+ destructiveActionStarted: boolean;
1365
+ target?: string;
1366
+ epoch?: number;
1367
+ }
1368
+ interface FirmwareCheckpointSink {
1369
+ commit(checkpoint: FirmwareCheckpoint): Promise<void>;
1370
+ }
1371
+ interface FirmwareUpdateHostBinding {
1372
+ artifactReader: FirmwareArtifactReader;
1373
+ checkpointSink: FirmwareCheckpointSink;
1374
+ }
1375
+ interface FirmwareCheckpointParams {
1376
+ hostBindingGeneration?: number;
1377
+ checkpointSink?: FirmwareCheckpointSink;
1378
+ checkpointSequenceStart?: number;
1379
+ resumeCheckpoint?: FirmwareCheckpoint;
1380
+ }
1381
+ interface FirmwareUpdateBinaryParams {
1382
+ binary: ArrayBuffer;
1383
+ updateType: IUpdateType;
1384
+ }
1385
+ interface FirmwareUpdateArtifactParams extends FirmwareCheckpointParams {
1386
+ preparedPlan: FirmwareUpdatePreparedPlan;
1387
+ hostBindingGeneration: number;
1388
+ artifact: FirmwareArtifactReference;
1389
+ resourceArtifact?: FirmwareArtifactReference;
1390
+ resourceEntries?: Array<{
1391
+ entryName: string;
1392
+ artifact: FirmwareArtifactReference;
1393
+ }>;
1394
+ updateType: IUpdateType;
1395
+ forcedUpdateRes?: boolean;
1396
+ isUpdateBootloader?: boolean;
1397
+ firmwareType?: EFirmwareType;
1398
+ }
1399
+ interface FirmwareUpdateParams {
1400
+ version?: number[];
1401
+ updateType: IUpdateType;
1402
+ forcedUpdateRes?: boolean;
1403
+ isUpdateBootloader?: boolean;
1404
+ firmwareType?: EFirmwareType;
1405
+ }
1406
+ declare function firmwareUpdate(connectId: string | undefined, params: Params<FirmwareUpdateParams> & {
1407
+ rebootOnSuccess?: boolean;
1408
+ }): Response<Messages.Success>;
1409
+ declare function firmwareUpdate(connectId: string | undefined, params: Params<FirmwareUpdateBinaryParams> & {
1410
+ rebootOnSuccess?: boolean;
1411
+ }): Response<Messages.Success>;
1412
+ type IPlatform = 'native' | 'desktop' | 'ext' | 'web' | 'web-embed';
1413
+ type Platform = {
1414
+ platform: IPlatform;
1415
+ };
1416
+ declare function firmwareUpdateV2(connectId: string | undefined, params: Params<FirmwareUpdateParams & Platform>): Response<Messages.Success>;
1417
+ declare function firmwareUpdateV2(connectId: string | undefined, params: Params<FirmwareUpdateBinaryParams & Platform>): Response<Messages.Success>;
1418
+ declare function firmwareUpdateV2(connectId: string | undefined, params: Params<FirmwareUpdateArtifactParams & Platform>): Response<Messages.Success>;
1419
+ interface FirmwareUpdateV3Params extends FirmwareCheckpointParams {
1420
+ preparedPlan?: FirmwareUpdatePreparedPlan;
1421
+ bleVersion?: number[];
1422
+ bleBinary?: ArrayBuffer;
1423
+ chunkSize?: number;
1424
+ firmwareVersion?: number[];
1425
+ firmwareBinary?: ArrayBuffer;
1426
+ bootloaderVersion?: number[];
1427
+ bootloaderBinary?: ArrayBuffer;
1428
+ resourceBinary?: ArrayBuffer;
1429
+ forcedUpdateRes?: boolean;
1430
+ firmwareType?: EFirmwareType;
1431
+ platform: IPlatform;
1432
+ artifactReader?: FirmwareArtifactReader;
1433
+ artifacts?: {
1434
+ ble?: FirmwareArtifactReference;
1435
+ firmware?: FirmwareArtifactReference;
1436
+ bootloader?: FirmwareArtifactReference;
1437
+ resourceEntries?: Array<{
1438
+ entryName: string;
1439
+ artifact: FirmwareArtifactReference;
1440
+ }>;
1441
+ };
1442
+ }
1443
+ /**
1444
+ * firmwareUpdateV4 target binaries grouped by DeviceFirmwareTargetType.
1445
+ * Except for romloader, each field maps to a target accepted by bootloader.
1446
+ */
1447
+ type FirmwareUpdateV4Target = 'boot' | 'app_v1' | 'app_v2' | 'coprocessor' | 'resource' | 'se01' | 'se02' | 'se03' | 'se04';
1448
+ interface FirmwareUpdateV4Params extends FirmwareCheckpointParams {
1449
+ preparedPlan?: FirmwareUpdatePreparedPlan;
1450
+ platform: IPlatform;
1451
+ expectedDeviceId?: string;
1452
+ chunkSize?: number;
1453
+ firmwareType?: EFirmwareType;
1454
+ targetsToUpdate?: FirmwareUpdateV4Target[];
1455
+ expectedTargetVersions?: Partial<Record<FirmwareUpdateV4Target, string>>;
1456
+ /** FW_MGMT_TARGET_ROMLOADER = 2; Pro2 cannot install it through firmwareUpdateV4. */
1457
+ romloaderBinary?: ArrayBuffer;
1458
+ /** FW_MGMT_TARGET_BOOTLOADER = 3 */
1459
+ bootloaderBinary?: ArrayBuffer;
1460
+ /** FW_MGMT_TARGET_APPLICATION_P1 = 4 */
1461
+ applicationP1Binary?: ArrayBuffer;
1462
+ /** FW_MGMT_TARGET_APPLICATION_P2 = 5 */
1463
+ applicationP2Binary?: ArrayBuffer;
1464
+ /** FW_MGMT_TARGET_COPROCESSOR = 6 */
1465
+ coprocessorBinary?: ArrayBuffer;
1466
+ /** FW_MGMT_TARGET_SE01-04 = 7-10 */
1467
+ se01Binary?: ArrayBuffer;
1468
+ se02Binary?: ArrayBuffer;
1469
+ se03Binary?: ArrayBuffer;
1470
+ se04Binary?: ArrayBuffer;
1471
+ forcedUpdateRes?: boolean;
1472
+ /**
1473
+ * RESC bundle okpkg files written directly to devicePath through FilesystemFileWrite.
1474
+ * Manual mode installs them without version comparison.
1475
+ */
1476
+ resourceBundleFiles?: Array<{
1477
+ binary: ArrayBuffer;
1478
+ devicePath: string;
1479
+ }>;
1480
+ artifactReader?: FirmwareArtifactReader;
1481
+ componentArtifacts?: Partial<Record<Exclude<FirmwareUpdateV4Target, 'resource'>, FirmwareArtifactReference>>;
1482
+ resourceBundleArtifacts?: Array<{
1483
+ name: string;
1484
+ artifact: FirmwareArtifactReference;
1485
+ }>;
1486
+ }
1487
+ declare function registerFirmwareUpdateHostBinding$1(binding: FirmwareUpdateHostBinding): number;
1488
+ declare function unregisterFirmwareUpdateHostBinding$1(generation?: number): boolean;
1489
+ declare function getFirmwareUpdateHostBindingGeneration$1(): number;
1490
+ declare function firmwareUpdateV3(connectId: string | undefined, params: Params<FirmwareUpdateV3Params>): Response<{
1491
+ bleVersion: string;
1492
+ firmwareVersion: string;
1493
+ bootloaderVersion: string;
1494
+ }>;
1495
+ declare function firmwareUpdateV4(connectId: string | undefined, params: Params<FirmwareUpdateV4Params>): Response<{
1496
+ bleVersion: string;
1497
+ firmwareVersion: string;
1498
+ bootloaderVersion: string;
1499
+ }>;
1500
+
1501
+ type FirmwareUpdatePlanArtifactRole = 'firmware' | 'ble' | 'bootloader' | 'resource' | 'component' | 'resourceBundle';
1502
+ type FirmwareUpdatePlanTarget = 'firmware' | 'ble' | 'bootloader' | FirmwareUpdateV4Target;
1503
+ interface FirmwareUpdatePlanArtifact {
1504
+ artifactId: string;
1505
+ role: FirmwareUpdatePlanArtifactRole;
1506
+ target: FirmwareUpdatePlanTarget;
1507
+ url: string;
1508
+ container: 'raw' | 'zip';
1509
+ logicalName?: string;
1510
+ expectedSize?: number;
1511
+ expectedSha256?: string;
1512
+ targetVersion?: string;
1513
+ }
1514
+ type FirmwareUpdatePlanEpochKind = 'legacy-update' | 'resource-sync' | 'bootloader-install' | 'bootloader-verify' | 'component-install' | 'final-verify';
1515
+ interface FirmwareUpdatePlanEpoch {
1516
+ epoch: number;
1517
+ kind: FirmwareUpdatePlanEpochKind;
1518
+ artifactIds: string[];
1519
+ targets: FirmwareUpdatePlanTarget[];
1520
+ }
1521
+ interface FirmwareUpdatePlan {
1522
+ schemaVersion: 1;
1523
+ planDigest: string;
1524
+ executor: 'v2' | 'v3' | 'v4';
1525
+ deviceIdentity: string;
1526
+ deviceModel: string;
1527
+ firmwareType: EFirmwareType;
1528
+ platform: 'native' | 'desktop' | 'ext' | 'web' | 'web-embed';
1529
+ artifacts: FirmwareUpdatePlanArtifact[];
1530
+ epochs: FirmwareUpdatePlanEpoch[];
1531
+ targetsToUpdate: FirmwareUpdatePlanTarget[];
1532
+ }
1533
+
284
1534
  type FirmwareRelease$2 = {
285
1535
  shouldUpdate?: boolean;
286
1536
  status: IDeviceFirmwareStatus;
@@ -296,11 +1546,13 @@ type AllFirmwareRelease = {
296
1546
  ble: FirmwareRelease$2;
297
1547
  bootloader?: FirmwareRelease$2;
298
1548
  bridge?: FirmwareRelease$2;
299
- features?: Features$1;
1549
+ features?: Features;
1550
+ firmwareUpdatePlan?: FirmwareUpdatePlan;
300
1551
  };
301
1552
  type CheckAllFirmwareReleaseParams = {
302
1553
  checkBridgeRelease?: boolean;
303
1554
  firmwareType?: EFirmwareType;
1555
+ platform?: 'native' | 'desktop' | 'ext' | 'web' | 'web-embed';
304
1556
  };
305
1557
  declare function checkAllFirmwareRelease(connectId?: string, params?: CommonParams & CheckAllFirmwareReleaseParams): Response<AllFirmwareRelease>;
306
1558
 
@@ -310,13 +1562,70 @@ type CheckFirmwareTypeAvailableParams = {
310
1562
  };
311
1563
  declare function checkFirmwareTypeAvailable(params: CheckFirmwareTypeAvailableParams): Response<FirmwareRelease$2 | undefined>;
312
1564
 
313
- declare function searchDevices(): Response<SearchDevice[]>;
1565
+ declare function searchDevices(params?: CommonParams): Response<SearchDevice[]>;
314
1566
 
1567
+ /**
1568
+ * @deprecated Use `getDeviceState` for both Protocol V1 and Protocol V2 devices.
1569
+ */
315
1570
  declare function getFeatures(connectId?: string, params?: CommonParams): Response<Features>;
316
1571
 
1572
+ /**
1573
+ * @deprecated Use `getDeviceState(connectId, { scope: 'firmware' })`.
1574
+ */
317
1575
  declare function getOnekeyFeatures(connectId?: string, params?: CommonParams): Response<OnekeyFeatures>;
318
1576
 
319
- declare function getPassphraseState(connectId?: string, params?: CommonParams): Response<string>;
1577
+ type GetPassphraseStateParams = CommonParams;
1578
+ /**
1579
+ * Legacy Protocol V1 wallet API.
1580
+ *
1581
+ * This remains supported for Protocol V1 integrations. New cross-protocol integrations
1582
+ * and all Protocol V2 callers should use `openWalletSession`.
1583
+ */
1584
+ declare function getPassphraseState(connectId?: string, params?: GetPassphraseStateParams): Response<string | undefined>;
1585
+
1586
+ type OpenWalletSessionParams = {
1587
+ mode: 'standard';
1588
+ deviceId?: never;
1589
+ passphraseState?: never;
1590
+ useEmptyPassphrase?: never;
1591
+ initSession?: never;
1592
+ } | {
1593
+ mode: 'select-hidden';
1594
+ deviceId?: never;
1595
+ passphraseState?: never;
1596
+ useEmptyPassphrase?: never;
1597
+ initSession?: never;
1598
+ } | {
1599
+ mode: 'resume-hidden';
1600
+ deviceId: string;
1601
+ passphraseState: string;
1602
+ useEmptyPassphrase?: never;
1603
+ initSession?: never;
1604
+ } | {
1605
+ /**
1606
+ * Compatibility form. `useEmptyPassphrase: true` opens the standard wallet;
1607
+ * otherwise `initSession: true` starts a fresh hidden-wallet selection, a
1608
+ * complete wallet binding resumes a hidden wallet, and no binding starts the
1609
+ * hidden-wallet selection flow.
1610
+ */
1611
+ mode?: undefined;
1612
+ useEmptyPassphrase?: boolean;
1613
+ initSession?: boolean;
1614
+ deviceId?: string;
1615
+ passphraseState?: string;
1616
+ };
1617
+ type OpenWalletSessionPayload = {
1618
+ protocol: 'V1' | 'V2';
1619
+ walletType: 'standard' | 'hidden';
1620
+ deviceId: string;
1621
+ passphraseState: string | null;
1622
+ resumed: boolean;
1623
+ };
1624
+ /**
1625
+ * Opens the standard, hidden, or Attach-to-PIN wallet flow through a unified
1626
+ * Protocol V1/V2 API.
1627
+ */
1628
+ declare function openWalletSession(connectId: string, params: CommonParams & OpenWalletSessionParams): Response<OpenWalletSessionPayload>;
320
1629
 
321
1630
  type FirmwareRelease$1 = {
322
1631
  status: IDeviceFirmwareStatus;
@@ -343,47 +1652,18 @@ type BleFirmwareRelease = {
343
1652
  };
344
1653
  declare function checkBLEFirmwareRelease(connectId?: string): Response<BleFirmwareRelease>;
345
1654
 
346
- type IUpdateType = 'firmware' | 'ble';
347
- interface FirmwareUpdateBinaryParams {
348
- binary: ArrayBuffer;
349
- updateType: IUpdateType;
350
- }
351
- interface FirmwareUpdateParams {
352
- version?: number[];
353
- updateType: IUpdateType;
354
- forcedUpdateRes?: boolean;
355
- isUpdateBootloader?: boolean;
356
- firmwareType?: EFirmwareType;
357
- }
358
- declare function firmwareUpdate(connectId: string | undefined, params: Params<FirmwareUpdateParams> & {
359
- rebootOnSuccess?: boolean;
360
- }): Response<Messages.Success>;
361
- declare function firmwareUpdate(connectId: string | undefined, params: Params<FirmwareUpdateBinaryParams> & {
362
- rebootOnSuccess?: boolean;
363
- }): Response<Messages.Success>;
364
- type IPlatform = 'native' | 'desktop' | 'ext' | 'web' | 'web-embed';
365
- type Platform = {
366
- platform: IPlatform;
367
- };
368
- declare function firmwareUpdateV2(connectId: string | undefined, params: Params<FirmwareUpdateParams & Platform>): Response<Messages.Success>;
369
- declare function firmwareUpdateV2(connectId: string | undefined, params: Params<FirmwareUpdateBinaryParams & Platform>): Response<Messages.Success>;
370
- interface FirmwareUpdateV3Params {
371
- bleVersion?: number[];
372
- bleBinary?: ArrayBuffer;
373
- firmwareVersion?: number[];
374
- firmwareBinary?: ArrayBuffer;
375
- bootloaderVersion?: number[];
376
- bootloaderBinary?: ArrayBuffer;
377
- resourceBinary?: ArrayBuffer;
378
- forcedUpdateRes?: boolean;
379
- firmwareType?: EFirmwareType;
380
- platform: IPlatform;
1655
+ interface FirmwareUpdateCapabilities {
1656
+ planSchemaVersion: 1;
1657
+ preparedPlanSchemaVersion: 1;
1658
+ hostBindingProtocolVersion: 1;
1659
+ checkpointSchemaVersion: 1;
1660
+ manifestModes: Array<'external-only' | 'sdk-managed'>;
1661
+ supportsArtifactReader: true;
1662
+ supportsAwaitableCheckpoint: true;
1663
+ supportsResume: true;
1664
+ supportsReconciliation: true;
381
1665
  }
382
- declare function firmwareUpdateV3(connectId: string | undefined, params: Params<FirmwareUpdateV3Params>): Response<{
383
- bleVersion: string;
384
- firmwareVersion: string;
385
- bootloaderVersion: string;
386
- }>;
1666
+ declare function getFirmwareUpdateCapabilities(): FirmwareUpdateCapabilities;
387
1667
 
388
1668
  declare function promptWebDeviceAccess(options?: {
389
1669
  deviceSerialNumberFromUI?: string;
@@ -453,7 +1733,16 @@ type DeviceSettingsParams = {
453
1733
  experimentalFeatures?: boolean;
454
1734
  autoShutdownDelayMs?: number;
455
1735
  changeBrightness?: boolean;
1736
+ brightness?: number;
456
1737
  hapticFeedback?: boolean;
1738
+ bluetoothEnabled?: boolean;
1739
+ airgapMode?: boolean;
1740
+ animationEnabled?: boolean;
1741
+ tapToWake?: boolean;
1742
+ deviceNameDisplayEnabled?: boolean;
1743
+ fidoEnabled?: boolean;
1744
+ usbLockEnabled?: boolean;
1745
+ randomKeypad?: boolean;
457
1746
  };
458
1747
  declare function deviceSettings(connectId: string, params: CommonParams & DeviceSettingsParams): Response<Success$1>;
459
1748
 
@@ -487,15 +1776,18 @@ declare function deviceFullyUploadResource(connectId: string, params: CommonPara
487
1776
  binary?: ArrayBuffer;
488
1777
  }): Response<Success$1>;
489
1778
 
490
- type DeviceUpdateBootloaderParams = {
1779
+ type DeviceUpdateBootloaderParams = FirmwareCheckpointParams & {
1780
+ preparedPlan?: FirmwareUpdatePreparedPlan;
491
1781
  binary?: ArrayBuffer;
1782
+ artifact?: FirmwareArtifactReference;
1783
+ artifactReader?: FirmwareArtifactReader;
492
1784
  firmwareType?: EFirmwareType;
493
1785
  };
494
1786
  declare function deviceUpdateBootloader(connectId: string, params?: DeviceUpdateBootloaderParams): Response<Success$1>;
495
1787
 
496
1788
  declare function deviceLock(connectId: string, params: CommonParams): Response<Success$1>;
497
1789
 
498
- declare function deviceUnlock(connectId: string, params?: CommonParams): Response<Features$1>;
1790
+ declare function deviceUnlock(connectId: string, params?: CommonParams): Response<Features>;
499
1791
 
500
1792
  declare function deviceCancel(connectId: string, params: CommonParams): Response<Success$1>;
501
1793
 
@@ -699,6 +1991,9 @@ type AllNetworkAddressParams = {
699
1991
  type AllNetworkAddressPayload = {
700
1992
  address: string;
701
1993
  pub?: string;
1994
+ /**
1995
+ * @deprecated Use `pub` instead.
1996
+ */
702
1997
  publicKey?: string;
703
1998
  npub?: string;
704
1999
  } | {
@@ -764,6 +2059,9 @@ declare function evmGetAddress(connectId: string, deviceId: string, params: Comm
764
2059
  type EVMPublicKey = {
765
2060
  path: string;
766
2061
  pub: string;
2062
+ /**
2063
+ * @deprecated Use `pub` instead.
2064
+ */
767
2065
  publicKey?: string;
768
2066
  } & EthereumPublicKey;
769
2067
  type EVMGetPublicKeyParams = {
@@ -1547,6 +2845,9 @@ declare function nearSignTransaction(connectId: string, deviceId: string, params
1547
2845
  type AptosAddress = {
1548
2846
  path: string;
1549
2847
  pub?: string;
2848
+ /**
2849
+ * @deprecated Use `pub` instead.
2850
+ */
1550
2851
  publicKey?: string;
1551
2852
  } & AptosAddress$1;
1552
2853
  type AptosGetAddressParams = {
@@ -1561,6 +2862,9 @@ declare function aptosGetAddress(connectId: string, deviceId: string, params: Co
1561
2862
  type AptosPublicKey = {
1562
2863
  path: string;
1563
2864
  pub: string;
2865
+ /**
2866
+ * @deprecated Use `pub` instead.
2867
+ */
1564
2868
  publicKey?: string;
1565
2869
  };
1566
2870
  type AptosGetPublicKeyParams = {
@@ -1645,6 +2949,9 @@ declare function cosmosGetAddress(connectId: string, deviceId: string, params: C
1645
2949
  type CosmosPublicKey = {
1646
2950
  path: string;
1647
2951
  pub: string;
2952
+ /**
2953
+ * @deprecated Use `pub` instead.
2954
+ */
1648
2955
  publicKey?: string;
1649
2956
  };
1650
2957
  type CosmosGetPublicKeyParams = {
@@ -1669,6 +2976,9 @@ declare function cosmosSignTransaction(connectId: string, deviceId: string, para
1669
2976
  type XrpAddress = {
1670
2977
  path: string;
1671
2978
  pub?: string;
2979
+ /**
2980
+ * @deprecated Use `pub` instead.
2981
+ */
1672
2982
  publicKey?: string;
1673
2983
  address: string;
1674
2984
  };
@@ -1702,6 +3012,9 @@ declare function xrpSignTransaction(connectId: string, deviceId: string, params:
1702
3012
  type SuiAddress = {
1703
3013
  path: string;
1704
3014
  pub?: string;
3015
+ /**
3016
+ * @deprecated Use `pub` instead.
3017
+ */
1705
3018
  publicKey?: string;
1706
3019
  } & SuiAddress$1;
1707
3020
  type SuiGetAddressParams = {
@@ -1716,6 +3029,9 @@ declare function suiGetAddress(connectId: string, deviceId: string, params: Comm
1716
3029
  type SuiPublicKey = {
1717
3030
  path: string;
1718
3031
  pub: string;
3032
+ /**
3033
+ * @deprecated Use `pub` instead.
3034
+ */
1719
3035
  publicKey?: string;
1720
3036
  };
1721
3037
  type SuiGetPublicKeyParams = {
@@ -1745,6 +3061,10 @@ declare function suiSignTransaction(connectId: string, deviceId: string, params:
1745
3061
  type CardanoGetAddressMethodParams = {
1746
3062
  addressParameters: CardanoAddressParameters;
1747
3063
  networkId: number;
3064
+ /**
3065
+ * Testnet cip34:0-1097911063
3066
+ * Mainnet cip34:1-764824073
3067
+ */
1748
3068
  protocolMagic: number;
1749
3069
  derivationType: number;
1750
3070
  address?: string;
@@ -1806,6 +3126,10 @@ type CardanoSignMessageMethodParams = {
1806
3126
  derivationType: number;
1807
3127
  networkId: number;
1808
3128
  addressType?: Messages.CardanoAddressType;
3129
+ /**
3130
+ * Testnet cip34:0-1097911063
3131
+ * Mainnet cip34:1-764824073
3132
+ */
1809
3133
  protocolMagic?: number;
1810
3134
  };
1811
3135
  declare function cardanoSignMessage(connectId: string, deviceId: string, params: CommonParams & CardanoSignMessageMethodParams): Response<CardanoMessageSignature>;
@@ -1839,6 +3163,9 @@ declare function filecoinSignTransaction(connectId: string, deviceId: string, pa
1839
3163
  type PolkadotAddress = {
1840
3164
  path: string;
1841
3165
  pub: string;
3166
+ /**
3167
+ * @deprecated Use `pub` instead.
3168
+ */
1842
3169
  publicKey?: string;
1843
3170
  } & PolkadotAddress$1;
1844
3171
  type PolkadotGetAddressParams = {
@@ -1983,6 +3310,9 @@ declare function nexaSignTransaction(connectId: string, deviceId: string, params
1983
3310
  type NostrPublicKey = {
1984
3311
  npub?: string;
1985
3312
  pub?: string;
3313
+ /**
3314
+ * @deprecated Use `pub` instead.
3315
+ */
1986
3316
  publicKey?: string;
1987
3317
  path: string;
1988
3318
  };
@@ -2079,6 +3409,9 @@ declare function nostrSignSchnorr(connectId: string, deviceId: string, params: C
2079
3409
 
2080
3410
  interface LnurlAuth {
2081
3411
  pub?: string;
3412
+ /**
3413
+ * @deprecated Use `pub` instead.
3414
+ */
2082
3415
  publickey?: string;
2083
3416
  path?: string;
2084
3417
  signature?: string;
@@ -2155,6 +3488,9 @@ declare function dnxSignTransaction(connectId: string, deviceId: string, params:
2155
3488
  type TonAddress = {
2156
3489
  path: string;
2157
3490
  pub: string;
3491
+ /**
3492
+ * @deprecated Use `pub` instead.
3493
+ */
2158
3494
  publicKey?: string;
2159
3495
  address: string;
2160
3496
  };
@@ -2266,6 +3602,9 @@ declare function scdoSignTransaction(connectId: string, deviceId: string, params
2266
3602
 
2267
3603
  type AlephiumAddress = {
2268
3604
  path: string;
3605
+ /**
3606
+ * @deprecated Use `pub` instead.
3607
+ */
2269
3608
  publicKey?: string;
2270
3609
  pub?: string;
2271
3610
  address: string;
@@ -2368,32 +3707,48 @@ type NeoSignedTx = {
2368
3707
  declare function neoSignTransaction(connectId: string, deviceId: string, params: CommonParams & NeoUnsignedTx): Response<NeoSignedTx>;
2369
3708
 
2370
3709
  type CoreApi = {
2371
- init: typeof init$1;
3710
+ /**
3711
+ * Inject function
3712
+ */
3713
+ init: typeof init;
2372
3714
  on: typeof on;
2373
3715
  off: typeof off;
2374
3716
  emit: (event: string, ...args: any[]) => void;
2375
3717
  removeAllListeners: typeof removeAllListeners;
2376
- dispose: () => void;
3718
+ dispose: () => void | Promise<void>;
2377
3719
  call: (params: any) => Promise<any>;
2378
3720
  uiResponse: typeof uiResponse;
2379
3721
  cancel: (connectId?: string) => void;
3722
+ cancelOperation: (operationId: string) => void;
2380
3723
  updateSettings: typeof updateSettings;
2381
3724
  switchTransport: (env: ConnectSettings['env']) => Promise<{
2382
3725
  success: boolean;
2383
3726
  }>;
2384
3727
  getLogs: typeof getLogs;
3728
+ clearSessionCache: typeof clearSessionCache;
3729
+ /**
3730
+ * Test function
3731
+ */
2385
3732
  testInitializeDeviceDuration: typeof testInitializeDeviceDuration;
2386
3733
  preInitialize: typeof preInitialize;
3734
+ /**
3735
+ * Core function
3736
+ */
2387
3737
  checkAllFirmwareRelease: typeof checkAllFirmwareRelease;
2388
3738
  checkBridgeStatus: typeof checkBridgeStatus;
2389
3739
  checkBridgeRelease: typeof checkBridgeRelease;
2390
3740
  checkBootloaderRelease: typeof checkBootloaderRelease;
2391
3741
  checkFirmwareTypeAvailable: typeof checkFirmwareTypeAvailable;
3742
+ /**
3743
+ * Device function
3744
+ */
2392
3745
  searchDevices: typeof searchDevices;
2393
3746
  promptWebDeviceAccess: typeof promptWebDeviceAccess;
2394
3747
  getFeatures: typeof getFeatures;
3748
+ getDeviceState: typeof getDeviceState;
2395
3749
  getOnekeyFeatures: typeof getOnekeyFeatures;
2396
3750
  getPassphraseState: typeof getPassphraseState;
3751
+ openWalletSession: typeof openWalletSession;
2397
3752
  deviceBackup: typeof deviceBackup;
2398
3753
  deviceChangePin: typeof deviceChangePin;
2399
3754
  deviceFlags: typeof deviceFlags;
@@ -2419,9 +3774,50 @@ type CoreApi = {
2419
3774
  firmwareUpdate: typeof firmwareUpdate;
2420
3775
  firmwareUpdateV2: typeof firmwareUpdateV2;
2421
3776
  firmwareUpdateV3: typeof firmwareUpdateV3;
3777
+ firmwareUpdateV4: typeof firmwareUpdateV4;
3778
+ registerFirmwareUpdateHostBinding: typeof registerFirmwareUpdateHostBinding$1;
3779
+ unregisterFirmwareUpdateHostBinding: typeof unregisterFirmwareUpdateHostBinding$1;
3780
+ getFirmwareUpdateHostBindingGeneration: typeof getFirmwareUpdateHostBindingGeneration$1;
3781
+ getFirmwareUpdateCapabilities: typeof getFirmwareUpdateCapabilities;
3782
+ prepareFirmwareUpdatePlan: typeof prepareFirmwareUpdatePlan;
3783
+ validateFirmwareUpdatePreparedPlan: typeof validateFirmwareUpdatePreparedPlan;
2422
3784
  cipherKeyValue: typeof cipherKeyValue;
3785
+ /**
3786
+ * Pro2 business API
3787
+ */
3788
+ deviceReboot: typeof deviceReboot;
3789
+ deviceGetOnboardingStatus: typeof deviceGetOnboardingStatus;
3790
+ deviceUploadWallpaper: typeof deviceUploadWallpaper;
3791
+ deviceInfoGet: typeof deviceInfoGet;
3792
+ deviceStatusGet: typeof deviceStatusGet;
3793
+ deviceSettingsGet: typeof deviceSettingsGet;
3794
+ protocolInfoRequest: typeof protocolInfoRequest;
3795
+ ping: typeof ping;
3796
+ deviceSessionOpen: typeof deviceSessionOpen;
3797
+ deviceFirmwareUpdate: typeof deviceFirmwareUpdate;
3798
+ deviceGetFirmwareUpdateStatus: typeof deviceGetFirmwareUpdateStatus;
3799
+ deviceFactoryInfoSet: typeof deviceFactoryInfoSet;
3800
+ deviceFactoryInfoGet: typeof deviceFactoryInfoGet;
3801
+ deviceSettingsSet: typeof deviceSettingsSet;
3802
+ deviceSettingsPageShow: typeof deviceSettingsPageShow;
3803
+ filesystemPermissionFix: typeof filesystemPermissionFix;
3804
+ filesystemFormat: typeof filesystemFormat;
3805
+ uploadPortfolio: typeof uploadPortfolio;
3806
+ fileRead: typeof fileRead;
3807
+ fileWrite: typeof fileWrite;
3808
+ fileDelete: typeof fileDelete;
3809
+ dirList: typeof dirList;
3810
+ dirMake: typeof dirMake;
3811
+ dirRemove: typeof dirRemove;
3812
+ pathInfo: typeof pathInfo;
3813
+ /**
3814
+ * All network function
3815
+ */
2423
3816
  allNetworkGetAddress: typeof allNetworkGetAddress;
2424
3817
  allNetworkGetAddressByLoop: typeof allNetworkGetAddressByLoop;
3818
+ /**
3819
+ * EVM function
3820
+ */
2425
3821
  evmGetAddress: typeof evmGetAddress;
2426
3822
  evmGetPublicKey: typeof evmGetPublicKey;
2427
3823
  evmSignMessage: typeof evmSignMessage;
@@ -2429,86 +3825,167 @@ type CoreApi = {
2429
3825
  evmSignTransaction: typeof evmSignTransaction;
2430
3826
  evmSignTypedData: typeof evmSignTypedData;
2431
3827
  evmVerifyMessage: typeof evmVerifyMessage;
3828
+ /**
3829
+ * BTC function
3830
+ */
2432
3831
  btcGetAddress: typeof btcGetAddress;
2433
3832
  btcGetPublicKey: typeof btcGetPublicKey;
2434
3833
  btcSignMessage: typeof btcSignMessage;
2435
3834
  btcSignPsbt: typeof btcSignPsbt;
2436
3835
  btcSignTransaction: typeof btcSignTransaction;
2437
3836
  btcVerifyMessage: typeof btcVerifyMessage;
3837
+ /**
3838
+ * Starcoin function
3839
+ */
2438
3840
  starcoinGetAddress: typeof starcoinGetAddress;
2439
3841
  starcoinGetPublicKey: typeof starcoinGetPublicKey;
2440
3842
  starcoinSignMessage: typeof starcoinSignMessage;
2441
3843
  starcoinSignTransaction: typeof starcoinSignTransaction;
2442
3844
  starcoinVerifyMessage: typeof starcoinVerifyMessage;
3845
+ /**
3846
+ * Nem function
3847
+ */
2443
3848
  nemGetAddress: typeof nemGetAddress;
2444
3849
  nemSignTransaction: typeof nemSignTransaction;
3850
+ /**
3851
+ * Solana function
3852
+ */
2445
3853
  solGetAddress: typeof solGetAddress;
2446
3854
  solSignTransaction: typeof solSignTransaction;
2447
3855
  solSignOffchainMessage: typeof solSignOffchainMessage;
2448
3856
  solSignMessage: typeof solSignMessage;
3857
+ /**
3858
+ * Stellar function
3859
+ */
2449
3860
  stellarGetAddress: typeof stellarGetAddress;
2450
3861
  stellarSignTransaction: typeof stellarSignTransaction;
3862
+ /**
3863
+ * Tron function
3864
+ */
2451
3865
  tronGetAddress: typeof tronGetAddress;
2452
3866
  tronSignMessage: typeof tronSignMessage;
2453
3867
  tronSignTransaction: typeof tronSignTransaction;
3868
+ /**
3869
+ * Conflux function
3870
+ */
2454
3871
  confluxGetAddress: typeof confluxGetAddress;
2455
3872
  confluxSignMessage: typeof confluxSignMessage;
2456
3873
  confluxSignMessageCIP23: typeof confluxSignMessageCIP23;
2457
3874
  confluxSignTransaction: typeof confluxSignTransaction;
3875
+ /**
3876
+ * Near function
3877
+ */
2458
3878
  nearGetAddress: typeof nearGetAddress;
2459
3879
  nearSignTransaction: typeof nearSignTransaction;
3880
+ /**
3881
+ * Aptos function
3882
+ */
2460
3883
  aptosGetAddress: typeof aptosGetAddress;
2461
3884
  aptosGetPublicKey: typeof aptosGetPublicKey;
2462
3885
  aptosSignMessage: typeof aptosSignMessage;
2463
3886
  aptosSignInMessage: typeof aptosSignInMessage;
2464
3887
  aptosSignTransaction: typeof aptosSignTransaction;
3888
+ /**
3889
+ * Algo function
3890
+ */
2465
3891
  algoGetAddress: typeof algoGetAddress;
2466
3892
  algoSignTransaction: typeof algoSignTransaction;
3893
+ /**
3894
+ * Cosmos function
3895
+ */
2467
3896
  cosmosGetAddress: typeof cosmosGetAddress;
2468
3897
  cosmosGetPublicKey: typeof cosmosGetPublicKey;
2469
3898
  cosmosSignTransaction: typeof cosmosSignTransaction;
3899
+ /**
3900
+ * XRP function
3901
+ */
2470
3902
  xrpGetAddress: typeof xrpGetAddress;
2471
3903
  xrpSignTransaction: typeof xrpSignTransaction;
3904
+ /**
3905
+ * SUI function
3906
+ */
2472
3907
  suiGetAddress: typeof suiGetAddress;
2473
3908
  suiGetPublicKey: typeof suiGetPublicKey;
2474
3909
  suiSignMessage: typeof suiSignMessage;
2475
3910
  suiSignTransaction: typeof suiSignTransaction;
3911
+ /**
3912
+ * Cardano function
3913
+ */
2476
3914
  cardanoGetAddress: typeof cardanoGetAddress;
2477
3915
  cardanoGetPublicKey: typeof cardanoGetPublicKey;
2478
3916
  cardanoSignTransaction: typeof cardanoSignTransaction;
2479
3917
  cardanoSignMessage: typeof cardanoSignMessage;
3918
+ /**
3919
+ * Filecoin function
3920
+ */
2480
3921
  filecoinGetAddress: typeof filecoinGetAddress;
2481
3922
  filecoinSignTransaction: typeof filecoinSignTransaction;
3923
+ /**
3924
+ * Polkadot function
3925
+ */
2482
3926
  polkadotGetAddress: typeof polkadotGetAddress;
2483
3927
  polkadotSignTransaction: typeof polkadotSignTransaction;
3928
+ /**
3929
+ * Kaspa function
3930
+ */
2484
3931
  kaspaGetAddress: typeof kaspaGetAddress;
2485
3932
  kaspaSignTransaction: typeof kaspaSignTransaction;
3933
+ /**
3934
+ * nexa function
3935
+ */
2486
3936
  nexaGetAddress: typeof nexaGetAddress;
2487
3937
  nexaSignTransaction: typeof nexaSignTransaction;
3938
+ /**
3939
+ * Nostr function
3940
+ */
2488
3941
  nostrGetPublicKey: typeof nostrGetPublicKey;
2489
3942
  nostrSignEvent: typeof nostrSignEvent;
2490
3943
  nostrEncryptMessage: typeof nostrEncryptMessage;
2491
3944
  nostrDecryptMessage: typeof nostrDecryptMessage;
2492
3945
  nostrSignSchnorr: typeof nostrSignSchnorr;
3946
+ /**
3947
+ * Lightning Network
3948
+ */
2493
3949
  lnurlAuth: typeof lnurlAuth;
3950
+ /**
3951
+ * Nervos Network
3952
+ */
2494
3953
  nervosGetAddress: typeof nervosGetAddress;
2495
3954
  nervosSignTransaction: typeof nervosSignTransaction;
3955
+ /**
3956
+ * Dnx Network
3957
+ */
2496
3958
  dnxGetAddress: typeof dnxGetAddress;
2497
3959
  dnxSignTransaction: typeof dnxSignTransaction;
3960
+ /**
3961
+ * TON Network
3962
+ */
2498
3963
  tonGetAddress: typeof tonGetAddress;
2499
3964
  tonSignMessage: typeof tonSignMessage;
2500
3965
  tonSignProof: typeof tonSignProof;
2501
3966
  tonSignData: typeof tonSignData;
3967
+ /**
3968
+ * SCDO Network
3969
+ */
2502
3970
  scdoGetAddress: typeof scdoGetAddress;
2503
3971
  scdoSignMessage: typeof scdoSignMessage;
2504
3972
  scdoSignTransaction: typeof scdoSignTransaction;
3973
+ /**
3974
+ * Alephium Network
3975
+ */
2505
3976
  alephiumGetAddress: typeof alephiumGetAddress;
2506
3977
  alephiumSignMessage: typeof alephiumSignMessage;
2507
3978
  alephiumSignTransaction: typeof alephiumSignTransaction;
3979
+ /**
3980
+ * Benfen Network
3981
+ */
2508
3982
  benfenGetAddress: typeof benfenGetAddress;
2509
3983
  benfenGetPublicKey: typeof benfenGetPublicKey;
2510
3984
  benfenSignTransaction: typeof benfenSignTransaction;
2511
3985
  benfenSignMessage: typeof benfenSignMessage;
3986
+ /**
3987
+ * Neo Network
3988
+ */
2512
3989
  neoGetAddress: typeof neoGetAddress;
2513
3990
  neoSignTransaction: typeof neoSignTransaction;
2514
3991
  };
@@ -2583,11 +4060,13 @@ declare const DEVICE: {
2583
4060
  readonly PIN: "pin";
2584
4061
  readonly PASSPHRASE: "passphrase";
2585
4062
  readonly PASSPHRASE_ON_DEVICE: "passphrase_on_device";
4063
+ readonly ATTACH_PIN_ON_DEVICE: "attach_pin_on_device";
2586
4064
  readonly WORD: "word";
2587
4065
  readonly SUPPORT_FEATURES: "support_features";
2588
4066
  readonly SELECT_DEVICE_IN_BOOTLOADER_FOR_WEB_DEVICE: "select_device_in_bootloader_for_web_device";
2589
4067
  readonly SELECT_DEVICE_FOR_SWITCH_FIRMWARE_WEB_DEVICE: "select_device_for_switch_firmware_web_device";
2590
4068
  readonly FEATURES: "features";
4069
+ readonly STATE: "state";
2591
4070
  };
2592
4071
  interface DeviceConnnectRequest {
2593
4072
  type: typeof DEVICE.CONNECT;
@@ -2606,6 +4085,9 @@ interface DeviceButtonRequestPayload extends Omit<Messages.ButtonRequest, 'code'
2606
4085
  }
2607
4086
  type PassphraseRequestPayload = {
2608
4087
  existsAttachPinUser?: boolean;
4088
+ source?: 'wallet-session-coordinator';
4089
+ reason?: 'open-wallet' | 'session-recovery';
4090
+ expectedPassphraseState?: string;
2609
4091
  };
2610
4092
  interface DeviceButtonRequest {
2611
4093
  type: typeof DEVICE.BUTTON;
@@ -2618,6 +4100,10 @@ interface DeviceSendFeatures {
2618
4100
  type: typeof DEVICE.FEATURES;
2619
4101
  payload: DeviceFeaturesPayload;
2620
4102
  }
4103
+ interface DeviceSendState {
4104
+ type: typeof DEVICE.STATE;
4105
+ payload: DeviceStateEvent;
4106
+ }
2621
4107
  type DeviceSupportFeaturesPayload = SupportFeatures & {
2622
4108
  device: KnownDevice | null;
2623
4109
  };
@@ -2625,7 +4111,7 @@ interface DeviceSendSupportFeatures {
2625
4111
  type: typeof DEVICE.SUPPORT_FEATURES;
2626
4112
  payload: DeviceSupportFeaturesPayload;
2627
4113
  }
2628
- type DeviceEvent = DeviceButtonRequest | DeviceSendFeatures | DeviceSendSupportFeatures | DeviceDisconnnectRequest | DeviceConnnectRequest;
4114
+ type DeviceEvent = DeviceButtonRequest | DeviceSendState | DeviceSendFeatures | DeviceSendSupportFeatures | DeviceDisconnnectRequest | DeviceConnnectRequest;
2629
4115
  type DeviceEventMessage = DeviceEvent & {
2630
4116
  event: typeof DEVICE_EVENT;
2631
4117
  };
@@ -2666,6 +4152,17 @@ declare const UI_REQUEST: {
2666
4152
  readonly FIRMWARE_NOT_INSTALLED: "ui-device_firmware_not_installed";
2667
4153
  readonly NOT_USE_ONEKEY_DEVICE: "ui-device_please_use_onekey_device";
2668
4154
  };
4155
+ type ProtocolV2UiEventSource = 'unlock-coordinator' | 'wallet-session-coordinator' | 'method-lifecycle';
4156
+ type ProtocolV2UiCompletion = 'page-accepted' | 'operation-completed';
4157
+ type ProtocolV2UiEventMetadata = {
4158
+ source?: ProtocolV2UiEventSource;
4159
+ reason?: string;
4160
+ deviceOnly?: boolean;
4161
+ completion?: ProtocolV2UiCompletion;
4162
+ method?: string;
4163
+ page?: string | number;
4164
+ operation?: string;
4165
+ };
2669
4166
  interface UiRequestWithoutPayload {
2670
4167
  type: typeof UI_REQUEST.CLOSE_UI_WINDOW | typeof UI_REQUEST.CLOSE_UI_PIN_WINDOW | typeof UI_REQUEST.BLUETOOTH_PERMISSION | typeof UI_REQUEST.BLUETOOTH_UNSUPPORTED | typeof UI_REQUEST.BLUETOOTH_POWERED_OFF | typeof UI_REQUEST.BLUETOOTH_CHARACTERISTIC_NOTIFY_CHANGE_FAILURE | typeof UI_REQUEST.LOCATION_PERMISSION | typeof UI_REQUEST.LOCATION_SERVICE_PERMISSION | typeof UI_REQUEST.FIRMWARE_PROCESSING | typeof UI_REQUEST.WEB_DEVICE_PROMPT_ACCESS_PERMISSION;
2671
4168
  payload?: typeof undefined;
@@ -2678,14 +4175,14 @@ interface UiRequestFirmwareProgressing {
2678
4175
  }
2679
4176
  type UiRequestDeviceAction = {
2680
4177
  type: typeof UI_REQUEST.REQUEST_PIN;
2681
- payload: {
4178
+ payload: ProtocolV2UiEventMetadata & {
2682
4179
  device: Device$1;
2683
4180
  type?: Messages.PinMatrixRequestType | 'ButtonRequest_PinEntry' | 'ButtonRequest_AttachPin';
2684
4181
  };
2685
4182
  };
2686
4183
  interface UiRequestButton {
2687
4184
  type: typeof UI_REQUEST.REQUEST_BUTTON;
2688
- payload: DeviceButtonRequest['payload'];
4185
+ payload: DeviceButtonRequest['payload'] & ProtocolV2UiEventMetadata;
2689
4186
  }
2690
4187
  interface UiRequestPassphrase {
2691
4188
  type: typeof UI_REQUEST.REQUEST_PASSPHRASE;
@@ -2693,6 +4190,9 @@ interface UiRequestPassphrase {
2693
4190
  device: Device$1;
2694
4191
  passphraseState?: string;
2695
4192
  existsAttachPinUser?: boolean;
4193
+ source?: 'wallet-session-coordinator';
4194
+ reason?: 'open-wallet' | 'session-recovery';
4195
+ expectedPassphraseState?: string;
2696
4196
  };
2697
4197
  }
2698
4198
  interface UiRequestPassphraseOnDevice {
@@ -2700,6 +4200,8 @@ interface UiRequestPassphraseOnDevice {
2700
4200
  payload: {
2701
4201
  device: Device$1;
2702
4202
  passphraseState?: string;
4203
+ source?: 'wallet-session-coordinator';
4204
+ reason?: 'open-wallet' | 'session-recovery';
2703
4205
  };
2704
4206
  }
2705
4207
  interface UiRequestSelectDeviceInBootloaderForWebDevice {
@@ -2727,6 +4229,10 @@ interface FirmwareProgress {
2727
4229
  device: Device$1;
2728
4230
  progress: number;
2729
4231
  progressType: IFirmwareUpdateProgressType;
4232
+ transferredBytes?: number;
4233
+ totalBytes?: number;
4234
+ rateBytesPerSecond?: number;
4235
+ elapsedMs?: number;
2730
4236
  };
2731
4237
  }
2732
4238
  interface FirmwareTip {
@@ -2742,6 +4248,10 @@ interface DeviceProgress {
2742
4248
  type: typeof UI_REQUEST.DEVICE_PROGRESS;
2743
4249
  payload: {
2744
4250
  progress?: number;
4251
+ transferredBytes?: number;
4252
+ totalBytes?: number;
4253
+ rateBytesPerSecond?: number;
4254
+ elapsedMs?: number;
2745
4255
  };
2746
4256
  }
2747
4257
  interface PreviousAddressResult {
@@ -2793,6 +4303,7 @@ declare const IFRAME: {
2793
4303
  readonly INIT_BRIDGE: "iframe-init-bridge";
2794
4304
  readonly CALL: "iframe-call";
2795
4305
  readonly CANCEL: "iframe-cancel";
4306
+ readonly CANCEL_OPERATION: "iframe-cancel-operation";
2796
4307
  readonly SWITCH_TRANSPORT: "iframe-switch-transport";
2797
4308
  readonly CALLBACK: "iframe-callback";
2798
4309
  };
@@ -2861,6 +4372,13 @@ interface IFrameCancelMessage {
2861
4372
  connectId?: string;
2862
4373
  };
2863
4374
  }
4375
+ interface IFrameCancelOperationMessage {
4376
+ event: typeof IFRAME.CANCEL_OPERATION;
4377
+ type: typeof IFRAME.CANCEL_OPERATION;
4378
+ payload: {
4379
+ operationId: string;
4380
+ };
4381
+ }
2864
4382
  interface IFrameSwitchTransportMessage {
2865
4383
  event: typeof IFRAME.SWITCH_TRANSPORT;
2866
4384
  type: typeof IFRAME.SWITCH_TRANSPORT;
@@ -2987,231 +4505,13 @@ declare const CORE_EVENT = "CORE_EVENT";
2987
4505
  type CoreMessage = {
2988
4506
  id?: string;
2989
4507
  success?: true | false;
2990
- } & (IFrameEventMessage | IFrameCallMessage | IFrameCancelMessage | IFrameSwitchTransportMessage | IFrameCallbackMessage | UiResponseMessage | UiEventMessage | DeviceEventMessage | LogEventMessage | FirmwareMessage);
4508
+ } & (IFrameEventMessage | IFrameCallMessage | IFrameCancelMessage | IFrameCancelOperationMessage | IFrameSwitchTransportMessage | IFrameCallbackMessage | UiResponseMessage | UiEventMessage | DeviceEventMessage | LogEventMessage | FirmwareMessage);
2991
4509
  type PostMessageEvent = MessageEvent<any>;
2992
4510
  declare const parseMessage: (messageData: any) => CoreMessage;
2993
4511
  declare const createErrorMessage: (error: Error & {
2994
4512
  code?: string | number;
2995
4513
  }) => Unsuccessful;
2996
4514
 
2997
- type PassphrasePromptResponse = {
2998
- passphrase?: string;
2999
- passphraseOnDevice?: boolean;
3000
- attachPinOnDevice?: boolean;
3001
- cache?: boolean;
3002
- };
3003
- type MessageType = Messages.MessageType;
3004
- type MessageKey = keyof MessageType;
3005
- type TypedResponseMessage<T extends MessageKey> = {
3006
- type: T;
3007
- message: MessageType[T];
3008
- };
3009
- type TypedCallResponseMap = {
3010
- [K in keyof MessageType]: TypedResponseMessage<K>;
3011
- };
3012
- type DefaultMessageResponse = TypedCallResponseMap[keyof MessageType];
3013
- declare class DeviceCommands {
3014
- instanceId: string;
3015
- currentResponseID?: number;
3016
- device: Device;
3017
- transport: Transport;
3018
- mainId: string;
3019
- disposed: boolean;
3020
- callPromise?: Promise<DefaultMessageResponse>;
3021
- constructor(device: Device, mainId: string);
3022
- dispose(_cancelRequest: boolean): Promise<void>;
3023
- checkDisposed(): void;
3024
- cancelDeviceOnOneKeyDevice(): Promise<{
3025
- readonly success: false;
3026
- readonly error: 800;
3027
- readonly payload: {
3028
- readonly message: "Device disconnected or acquired by someone else";
3029
- };
3030
- } | {
3031
- success: boolean;
3032
- error: null;
3033
- payload: {
3034
- message: string;
3035
- };
3036
- } | {
3037
- success: boolean;
3038
- error: 0 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 200 | 300 | 301 | 302 | 303 | 304 | 305 | 400 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 500 | 600 | 601 | 602 | 603 | 700 | 701 | 702 | 703 | 704 | 705 | 706 | 707 | 708 | 709 | 710 | 711 | 712 | 713 | 714 | 715 | 716 | 717 | 718 | 719 | 720 | 721 | 722 | 800 | 801 | 802 | 803 | 804 | 805 | 806 | 807 | 808 | 809 | 810 | 811 | 812 | 813 | 814 | 815 | 816 | 817 | 818 | 819 | 820 | 821 | 822 | 823 | 824 | 825 | 826 | 827 | 828 | 829 | 900 | 901 | 902;
3039
- payload: {
3040
- message: string;
3041
- };
3042
- } | undefined>;
3043
- cancelDevice(): Promise<{
3044
- readonly success: false;
3045
- readonly error: 800;
3046
- readonly payload: {
3047
- readonly message: "Device disconnected or acquired by someone else";
3048
- };
3049
- } | {
3050
- success: boolean;
3051
- error: null;
3052
- payload: {
3053
- message: string;
3054
- };
3055
- } | {
3056
- success: boolean;
3057
- error: 0 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 200 | 300 | 301 | 302 | 303 | 304 | 305 | 400 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 500 | 600 | 601 | 602 | 603 | 700 | 701 | 702 | 703 | 704 | 705 | 706 | 707 | 708 | 709 | 710 | 711 | 712 | 713 | 714 | 715 | 716 | 717 | 718 | 719 | 720 | 721 | 722 | 800 | 801 | 802 | 803 | 804 | 805 | 806 | 807 | 808 | 809 | 810 | 811 | 812 | 813 | 814 | 815 | 816 | 817 | 818 | 819 | 820 | 821 | 822 | 823 | 824 | 825 | 826 | 827 | 828 | 829 | 900 | 901 | 902;
3058
- payload: {
3059
- message: string;
3060
- };
3061
- } | undefined>;
3062
- cancel(): Promise<void>;
3063
- call(type: MessageKey, msg?: DefaultMessageResponse['message']): Promise<DefaultMessageResponse>;
3064
- typedCall<T extends MessageKey, R extends MessageKey[]>(type: T, resType: R, msg?: MessageType[T]): Promise<TypedCallResponseMap[R[number]]>;
3065
- typedCall<T extends MessageKey, R extends MessageKey>(type: T, resType: R, msg?: MessageType[T]): Promise<TypedResponseMessage<R>>;
3066
- _commonCall(type: MessageKey, msg?: DefaultMessageResponse['message']): Promise<DefaultMessageResponse>;
3067
- _filterCommonTypes(res: DefaultMessageResponse, callType: MessageKey): Promise<DefaultMessageResponse>;
3068
- _promptPin(type?: Messages.PinMatrixRequestType): Promise<string>;
3069
- _promptPassphrase(options: PassphraseRequestPayload): Promise<PassphrasePromptResponse>;
3070
- }
3071
-
3072
- type DeviceDescriptorDiff = {
3073
- didUpdate: boolean;
3074
- connected: OneKeyDeviceInfo[];
3075
- disconnected: OneKeyDeviceInfo[];
3076
- changedSessions: OneKeyDeviceInfo[];
3077
- changedDebugSessions: OneKeyDeviceInfo[];
3078
- acquired: OneKeyDeviceInfo[];
3079
- debugAcquired: OneKeyDeviceInfo[];
3080
- released: OneKeyDeviceInfo[];
3081
- debugReleased: OneKeyDeviceInfo[];
3082
- descriptors: OneKeyDeviceInfo[];
3083
- };
3084
-
3085
- declare class DeviceConnector {
3086
- transport: Transport;
3087
- listenTimestamp: number;
3088
- current: OneKeyDeviceInfo[] | null;
3089
- upcoming: OneKeyDeviceInfo[];
3090
- listening: boolean;
3091
- constructor();
3092
- enumerate(): Promise<DeviceDescriptorDiff | undefined>;
3093
- listen(): Promise<void>;
3094
- stop(): void;
3095
- acquire(path: string, session?: string | null, forceCleanRunPromise?: boolean): Promise<string | undefined>;
3096
- release(session: string, onclose: boolean): Promise<void>;
3097
- disconnect(session: string | undefined | null): Promise<void>;
3098
- promptDeviceAccess(): Promise<USBDevice | BluetoothDevice | null>;
3099
- _reportDevicesChange(): void;
3100
- }
3101
-
3102
- type InitOptions = {
3103
- initSession?: boolean;
3104
- deviceId?: string;
3105
- passphraseState?: string;
3106
- deriveCardano?: boolean;
3107
- };
3108
- type RunOptions = {
3109
- keepSession?: boolean;
3110
- skipInitialize?: boolean;
3111
- } & InitOptions;
3112
- interface DeviceEvents {
3113
- [DEVICE.PIN]: [Device, Messages.PinMatrixRequestType | undefined, (err: any, pin: string) => void];
3114
- [DEVICE.PASSPHRASE_ON_DEVICE]: [Device, ((response: any) => void)?];
3115
- [DEVICE.BUTTON]: [Device, DeviceButtonRequestPayload];
3116
- [DEVICE.FEATURES]: [Device, DeviceFeaturesPayload];
3117
- [DEVICE.PASSPHRASE]: [
3118
- Device,
3119
- PassphraseRequestPayload,
3120
- (response: PassphrasePromptResponse, error?: Error) => void
3121
- ];
3122
- [DEVICE.SELECT_DEVICE_IN_BOOTLOADER_FOR_WEB_DEVICE]: [
3123
- Device,
3124
- (err: any, deviceId: string) => void
3125
- ];
3126
- [DEVICE.SELECT_DEVICE_FOR_SWITCH_FIRMWARE_WEB_DEVICE]: [
3127
- Device,
3128
- (err: any, deviceId: string) => void
3129
- ];
3130
- }
3131
- declare function preloadSessionCache(deviceId: string, passphraseState: string, sessionId: string): void;
3132
- interface Device {
3133
- on<K extends keyof DeviceEvents>(type: K, listener: (...event: DeviceEvents[K]) => void): this;
3134
- off<K extends keyof DeviceEvents>(type: K, listener: (...event: DeviceEvents[K]) => void): this;
3135
- emit<K extends keyof DeviceEvents>(type: K, ...args: DeviceEvents[K]): boolean;
3136
- }
3137
- declare class Device extends EventEmitter$1 {
3138
- originalDescriptor: OneKeyDeviceInfo;
3139
- sdkInstanceId?: string;
3140
- instanceId: string;
3141
- createdAt: number;
3142
- mainId?: string | null;
3143
- deviceConnector?: DeviceConnector | null;
3144
- commands: DeviceCommands;
3145
- private cancelableAction?;
3146
- private deviceAcquired;
3147
- features: Features | undefined;
3148
- featuresNeedsReload: boolean;
3149
- runPromise?: Deferred<void> | null;
3150
- externalState: string[];
3151
- unavailableCapabilities: UnavailableCapabilities;
3152
- instance: number;
3153
- internalState: string[];
3154
- needReloadDevice: boolean;
3155
- keepSession: boolean;
3156
- passphraseState: string | undefined;
3157
- pendingCallbackPromise?: Deferred<void>;
3158
- private preInitializedAt?;
3159
- private preInitializeMeta?;
3160
- private lastInitializeDurationMs?;
3161
- constructor(descriptor: OneKeyDeviceInfo, sdkInstanceId?: string);
3162
- static fromDescriptor(originalDescriptor: OneKeyDeviceInfo, sdkInstanceId?: string): Device;
3163
- toMessageObject(): Device$1 | null;
3164
- connect(): Promise<boolean>;
3165
- acquire(): Promise<void>;
3166
- release(): Promise<void>;
3167
- preInitialize(initOptions?: InitOptions): Promise<void>;
3168
- markPreInitialized(meta?: {
3169
- passphraseState?: string;
3170
- }): void;
3171
- clearPreInitialized(): void;
3172
- isPreInitializeMetaMatch(payload?: {
3173
- passphraseState?: string;
3174
- }): boolean;
3175
- isPreInitializedValid(ttlMs: number): boolean;
3176
- setLastInitializeDuration(durationMs: number): void;
3177
- getLastInitializeDuration(): number | undefined;
3178
- getCommands(): DeviceCommands;
3179
- private generateStateKey;
3180
- getInternalState(_deviceId?: string): string | undefined;
3181
- updateInternalState(enablePassphrase: boolean, passphraseState: string | undefined, deviceId: string, sessionId?: string | null, featuresSessionId?: string | null): void;
3182
- private setInternalState;
3183
- clearInternalState(_deviceId?: string): void;
3184
- initialize(options?: InitOptions): Promise<void>;
3185
- getFeatures(): Promise<void>;
3186
- _updateFeatures(feat: Features, initSession?: boolean): void;
3187
- updateDescriptor(descriptor: OneKeyDeviceInfo, forceUpdate?: boolean): void;
3188
- updateFromCache(device: Device): void;
3189
- run(fn?: () => Promise<void>, options?: RunOptions): Promise<void>;
3190
- _runInner<T>(fn: (() => Promise<T>) | undefined, options: RunOptions): Promise<undefined>;
3191
- interruptionFromOutside(): Promise<void>;
3192
- interruptionFromUser(): Promise<void>;
3193
- setCancelableAction(callback: (err?: Error) => Promise<unknown>): void;
3194
- clearCancelableAction(): void;
3195
- getMode(): EOneKeyDeviceMode;
3196
- getFirmwareVersion(): IVersionArray | null;
3197
- getBLEFirmwareVersion(): IVersionArray | null;
3198
- isUsed(): boolean;
3199
- hasDeviceAcquire(): boolean;
3200
- isUsedHere(): boolean;
3201
- isUsedElsewhere(): boolean;
3202
- isBootloader(): boolean | undefined;
3203
- isInitialized(): boolean | undefined;
3204
- isSeedless(): boolean | undefined;
3205
- isUnacquired(): boolean;
3206
- hasUnexpectedMode(allow: string[], require: string[]): "ui-device_bootloader_mode" | "ui-device_not_in_bootloader_mode" | "ui-device_not_initialized" | "ui-device_seedless" | null;
3207
- hasUsePassphrase(): boolean | undefined;
3208
- checkDeviceId(deviceId: string): boolean;
3209
- lockDevice(): Promise<_onekeyfe_hd_transport.Success>;
3210
- supportUnlockVersionRange(): DeviceFirmwareRange;
3211
- unlockDevice(): Promise<_onekeyfe_hd_transport.Features>;
3212
- checkPassphraseStateSafety(passphraseState?: string, useEmptyPassphrase?: boolean, skipPassphraseCheck?: boolean): Promise<boolean>;
3213
- }
3214
-
3215
4515
  type UiPromiseResponse = UiResponseEvent | {
3216
4516
  type: typeof DEVICE.DISCONNECT;
3217
4517
  payload?: undefined;
@@ -3221,18 +4521,20 @@ type UiPromise<T extends UiPromiseResponse['type']> = Deferred<Extract<UiPromise
3221
4521
  }>, T, Device>;
3222
4522
 
3223
4523
  declare const LogBlockEvent: Set<string>;
4524
+ declare function getLogBlockLabel(message: unknown): string | undefined;
3224
4525
 
3225
4526
  declare const executeCallback: (id: string, ...args: any[]) => void;
3226
4527
  declare const cleanupCallback: (id: string) => void;
3227
4528
 
3228
4529
  interface InjectApi {
3229
4530
  call: CallMethod;
3230
- eventEmitter: EventEmitter;
4531
+ eventEmitter: EventEmitter$1;
3231
4532
  init: CoreApi['init'];
3232
4533
  updateSettings: CoreApi['updateSettings'];
3233
4534
  dispose: CoreApi['dispose'];
3234
4535
  uiResponse: CoreApi['uiResponse'];
3235
4536
  cancel: CoreApi['cancel'];
4537
+ cancelOperation: CoreApi['cancelOperation'];
3236
4538
  switchTransport: CoreApi['switchTransport'];
3237
4539
  }
3238
4540
 
@@ -3241,24 +4543,6 @@ interface TopLevelInjectApi {
3241
4543
  call: CoreApi['call'];
3242
4544
  }
3243
4545
 
3244
- declare class Core extends EventEmitter$1 {
3245
- private tracingContext;
3246
- readonly sdkInstanceId: string;
3247
- private requestQueue;
3248
- private prePendingCallPromise;
3249
- private methodSynchronize;
3250
- constructor();
3251
- private getCoreContext;
3252
- handleMessage(message: CoreMessage): Promise<any>;
3253
- dispose(): void;
3254
- }
3255
- declare const init: (settings: ConnectSettings, Transport: any, plugin?: LowlevelTransportSharedPlugin) => Promise<Core | undefined>;
3256
- declare const switchTransport: ({ env, Transport, plugin, }: {
3257
- env: ConnectSettings['env'];
3258
- Transport: any;
3259
- plugin?: LowlevelTransportSharedPlugin | undefined;
3260
- }) => void;
3261
-
3262
4546
  type LogMessage = {
3263
4547
  level: string;
3264
4548
  prefix: string;
@@ -3303,9 +4587,13 @@ declare enum LoggerNames {
3303
4587
  declare const getLogger: (key: LoggerNames) => Log;
3304
4588
 
3305
4589
  type HttpRequestOptions = {
4590
+ /** Axios adapter-defined request timeout retained for existing opt-in callers. */
3306
4591
  timeoutMs?: number;
4592
+ /** Deadline for DNS, connection, TLS, redirects, and the first response-body progress. */
3307
4593
  connectTimeoutMs?: number;
4594
+ /** Maximum idle interval between response-body progress events. */
3308
4595
  readTimeoutMs?: number;
4596
+ /** Wall-clock deadline across all attempts and retry backoff. */
3309
4597
  overallTimeoutMs?: number;
3310
4598
  maxRetries?: number;
3311
4599
  retryDelayMs?: number;
@@ -3314,78 +4602,121 @@ type HttpRequestOptions = {
3314
4602
  declare const httpRequest: (url: string, type: string, options?: HttpRequestOptions) => any;
3315
4603
  declare const getTimeStamp: () => number;
3316
4604
 
4605
+ /**
4606
+ * Validates version string
4607
+ * @param {string} version Version string
4608
+ * @returns {boolean} True if version string is valid, false if not
4609
+ */
3317
4610
  declare const isValidVersionString: (version: string) => boolean;
4611
+ /**
4612
+ * Validates a version array
4613
+ * @param {number[]} version Version array
4614
+ * @returns {boolean} True if version array is valid, false if not
4615
+ */
3318
4616
  declare const isValidVersionArray: (version: number[]) => boolean;
4617
+ /**
4618
+ * Fills the missing version numbers with zeros (ie: [1, 2] will become [1, 2, 0])
4619
+ * @param {number[]} version Version array
4620
+ * @returns {number[]} Version array with all positions filled
4621
+ */
3319
4622
  declare const normalizeVersionArray: (version: number[]) => number[];
4623
+ /**
4624
+ * Returns a valid version array from a version string
4625
+ * @param {string} version Version string
4626
+ * @returns {number[]} Version array
4627
+ */
3320
4628
  declare const versionSplit: (version: string) => number[];
3321
- declare const versionCompare: (a: string | number[], b: string | number[]) => 0 | 1 | -1;
3322
-
3323
- declare function patchFeatures(response: DefaultMessageResponse): TypedResponseMessage<"PassphraseState"> | TypedResponseMessage<"Address"> | TypedResponseMessage<"AptosMessagePayload"> | TypedResponseMessage<"BinanceInputOutput"> | TypedResponseMessage<"BinanceCoin"> | TypedResponseMessage<"HDNodePathType"> | TypedResponseMessage<"HDNodeType"> | TypedResponseMessage<"MultisigRedeemScriptType"> | TypedResponseMessage<"TxRequestDetailsType"> | TypedResponseMessage<"TxRequestSerializedType"> | TypedResponseMessage<"TxInputType"> | TypedResponseMessage<"TxOutputBinType"> | TypedResponseMessage<"TxOutputType"> | TypedResponseMessage<"TxAckInputWrapper"> | TypedResponseMessage<"TxAckOutputWrapper"> | TypedResponseMessage<"PrevTx"> | TypedResponseMessage<"TxAckPrevInputWrapper"> | TypedResponseMessage<"PrevInput"> | TypedResponseMessage<"TxAckPrevOutputWrapper"> | TypedResponseMessage<"PrevOutput"> | TypedResponseMessage<"TxAckPrevExtraDataWrapper"> | TypedResponseMessage<"BIP32Address"> | TypedResponseMessage<"CardanoNativeScript"> | TypedResponseMessage<"CardanoBlockchainPointerType"> | TypedResponseMessage<"CardanoAddressParametersType"> | TypedResponseMessage<"CardanoPoolMetadataType"> | TypedResponseMessage<"CardanoPoolParametersType"> | TypedResponseMessage<"CardanoDRep"> | TypedResponseMessage<"CardanoCVoteRegistrationDelegation"> | TypedResponseMessage<"CardanoCVoteRegistrationParametersType"> | TypedResponseMessage<"IdentityType"> | TypedResponseMessage<"Path"> | TypedResponseMessage<"DnxTxKey"> | TypedResponseMessage<"DnxComputedKeyImage"> | TypedResponseMessage<"EmmcFile"> | TypedResponseMessage<"EosTxHeader"> | TypedResponseMessage<"EosActionCommon"> | TypedResponseMessage<"EosActionTransfer"> | TypedResponseMessage<"EosActionDelegate"> | TypedResponseMessage<"EosActionUndelegate"> | TypedResponseMessage<"EosActionRefund"> | TypedResponseMessage<"EosActionBuyRam"> | TypedResponseMessage<"EosActionBuyRamBytes"> | TypedResponseMessage<"EosActionSellRam"> | TypedResponseMessage<"EosActionVoteProducer"> | TypedResponseMessage<"EosActionUpdateAuth"> | TypedResponseMessage<"EosActionDeleteAuth"> | TypedResponseMessage<"EosActionLinkAuth"> | TypedResponseMessage<"EosActionUnlinkAuth"> | TypedResponseMessage<"EosActionNewAccount"> | TypedResponseMessage<"EosActionUnknown"> | TypedResponseMessage<"EosPermissionLevel"> | TypedResponseMessage<"EosAuthorizationKey"> | TypedResponseMessage<"EosAuthorizationAccount"> | TypedResponseMessage<"EosAuthorizationWait"> | TypedResponseMessage<"EosAsset"> | TypedResponseMessage<"EosAuthorization"> | TypedResponseMessage<"EthereumStructMemberOneKey"> | TypedResponseMessage<"EthereumFieldTypeOneKey"> | TypedResponseMessage<"EthereumDefinitions"> | TypedResponseMessage<"EthereumStructMember"> | TypedResponseMessage<"EthereumFieldType"> | TypedResponseMessage<"EthereumAccessListOneKey"> | TypedResponseMessage<"EthereumAuthorizationOneKey"> | TypedResponseMessage<"EthereumAuthorizationSignature"> | TypedResponseMessage<"EthereumAccessList"> | TypedResponseMessage<"KaspaTxRequestSignature"> | TypedResponseMessage<"KaspaOutpoint"> | TypedResponseMessage<"FileInfo"> | TypedResponseMessage<"MoneroOutputEntry"> | TypedResponseMessage<"MoneroMultisigKLRki"> | TypedResponseMessage<"MoneroRctKeyPublic"> | TypedResponseMessage<"MoneroAccountPublicAddress"> | TypedResponseMessage<"MoneroTransactionData"> | TypedResponseMessage<"MoneroTransactionDestinationEntry"> | TypedResponseMessage<"MoneroTransactionRsigData"> | TypedResponseMessage<"MoneroTransactionSourceEntry"> | TypedResponseMessage<"MoneroRingCtSig"> | TypedResponseMessage<"MoneroSubAddressIndicesList"> | TypedResponseMessage<"MoneroTransferDetails"> | TypedResponseMessage<"MoneroExportedKeyImage"> | TypedResponseMessage<"NEMTransactionCommon"> | TypedResponseMessage<"NEMTransfer"> | TypedResponseMessage<"NEMProvisionNamespace"> | TypedResponseMessage<"NEMMosaicCreation"> | TypedResponseMessage<"NEMMosaicSupplyChange"> | TypedResponseMessage<"NEMAggregateModification"> | TypedResponseMessage<"NEMImportanceTransfer"> | TypedResponseMessage<"NEMMosaic"> | TypedResponseMessage<"NEMMosaicDefinition"> | TypedResponseMessage<"NEMCosignatoryModification"> | TypedResponseMessage<"RipplePayment"> | TypedResponseMessage<"SolanaTxATADetails"> | TypedResponseMessage<"SolanaTxExtraInfo"> | TypedResponseMessage<"StellarAsset"> | TypedResponseMessage<"TezosRevealOp"> | TypedResponseMessage<"TezosTransactionOp"> | TypedResponseMessage<"TezosOriginationOp"> | TypedResponseMessage<"TezosDelegationOp"> | TypedResponseMessage<"TezosProposalOp"> | TypedResponseMessage<"TezosBallotOp"> | TypedResponseMessage<"TezosContractID"> | TypedResponseMessage<"TezosParametersManager"> | TypedResponseMessage<"TezosManagerTransfer"> | TypedResponseMessage<"TronContract"> | TypedResponseMessage<"TronTransferContract"> | TypedResponseMessage<"TronVoteWitnessContract"> | TypedResponseMessage<"TronFreezeBalanceContract"> | TypedResponseMessage<"TronUnfreezeBalanceContract"> | TypedResponseMessage<"TronWithdrawBalanceContract"> | TypedResponseMessage<"TronTriggerSmartContract"> | TypedResponseMessage<"TronFreezeBalanceV2Contract"> | TypedResponseMessage<"TronUnfreezeBalanceV2Contract"> | TypedResponseMessage<"TronWithdrawExpireUnfreezeContract"> | TypedResponseMessage<"TronDelegateResourceContract"> | TypedResponseMessage<"TronUnDelegateResourceContract"> | TypedResponseMessage<"TronCancelAllUnfreezeV2Contract"> | TypedResponseMessage<"Vote"> | TypedResponseMessage<"AlephiumGetAddress"> | TypedResponseMessage<"AlephiumAddress"> | TypedResponseMessage<"AlephiumSignTx"> | TypedResponseMessage<"AlephiumSignedTx"> | TypedResponseMessage<"AlephiumTxRequest"> | TypedResponseMessage<"AlephiumTxAck"> | TypedResponseMessage<"AlephiumBytecodeRequest"> | TypedResponseMessage<"AlephiumBytecodeAck"> | TypedResponseMessage<"AlephiumSignMessage"> | TypedResponseMessage<"AlephiumMessageSignature"> | TypedResponseMessage<"AlgorandGetAddress"> | TypedResponseMessage<"AlgorandAddress"> | TypedResponseMessage<"AlgorandSignTx"> | TypedResponseMessage<"AlgorandSignedTx"> | TypedResponseMessage<"AptosGetAddress"> | TypedResponseMessage<"AptosAddress"> | TypedResponseMessage<"AptosSignTx"> | TypedResponseMessage<"AptosSignedTx"> | TypedResponseMessage<"AptosSignMessage"> | TypedResponseMessage<"AptosMessageSignature"> | TypedResponseMessage<"AptosSignSIWAMessage"> | TypedResponseMessage<"BenfenGetAddress"> | TypedResponseMessage<"BenfenAddress"> | TypedResponseMessage<"BenfenSignTx"> | TypedResponseMessage<"BenfenSignedTx"> | TypedResponseMessage<"BenfenTxRequest"> | TypedResponseMessage<"BenfenTxAck"> | TypedResponseMessage<"BenfenSignMessage"> | TypedResponseMessage<"BenfenMessageSignature"> | TypedResponseMessage<"BinanceGetAddress"> | TypedResponseMessage<"BinanceAddress"> | TypedResponseMessage<"BinanceGetPublicKey"> | TypedResponseMessage<"BinancePublicKey"> | TypedResponseMessage<"BinanceSignTx"> | TypedResponseMessage<"BinanceTxRequest"> | TypedResponseMessage<"BinanceTransferMsg"> | TypedResponseMessage<"BinanceOrderMsg"> | TypedResponseMessage<"BinanceCancelMsg"> | TypedResponseMessage<"BinanceSignedTx"> | TypedResponseMessage<"GetPublicKey"> | TypedResponseMessage<"PublicKey"> | TypedResponseMessage<"GetAddress"> | TypedResponseMessage<"GetOwnershipId"> | TypedResponseMessage<"OwnershipId"> | TypedResponseMessage<"SignMessage"> | TypedResponseMessage<"MessageSignature"> | TypedResponseMessage<"VerifyMessage"> | TypedResponseMessage<"SignTx"> | TypedResponseMessage<"TxRequest"> | TypedResponseMessage<"TxAck"> | TypedResponseMessage<"TxAckInput"> | TypedResponseMessage<"TxAckOutput"> | TypedResponseMessage<"TxAckPrevMeta"> | TypedResponseMessage<"TxAckPrevInput"> | TypedResponseMessage<"TxAckPrevOutput"> | TypedResponseMessage<"TxAckPrevExtraData"> | TypedResponseMessage<"GetOwnershipProof"> | TypedResponseMessage<"OwnershipProof"> | TypedResponseMessage<"AuthorizeCoinJoin"> | TypedResponseMessage<"GetPublicKeyMultiple"> | TypedResponseMessage<"PublicKeyMultiple"> | TypedResponseMessage<"SignPsbt"> | TypedResponseMessage<"SignedPsbt"> | TypedResponseMessage<"FirmwareErase"> | TypedResponseMessage<"FirmwareRequest"> | TypedResponseMessage<"FirmwareUpload"> | TypedResponseMessage<"SelfTest"> | TypedResponseMessage<"FirmwareErase_ex"> | TypedResponseMessage<"Reboot"> | TypedResponseMessage<"FirmwareUpdateEmmc"> | TypedResponseMessage<"UpgradeFileHeader"> | TypedResponseMessage<"CardanoGetNativeScriptHash"> | TypedResponseMessage<"CardanoNativeScriptHash"> | TypedResponseMessage<"CardanoGetAddress"> | TypedResponseMessage<"CardanoAddress"> | TypedResponseMessage<"CardanoGetPublicKey"> | TypedResponseMessage<"CardanoPublicKey"> | TypedResponseMessage<"CardanoSignTxInit"> | TypedResponseMessage<"CardanoTxInput"> | TypedResponseMessage<"CardanoTxOutput"> | TypedResponseMessage<"CardanoAssetGroup"> | TypedResponseMessage<"CardanoToken"> | TypedResponseMessage<"CardanoTxInlineDatumChunk"> | TypedResponseMessage<"CardanoTxReferenceScriptChunk"> | TypedResponseMessage<"CardanoPoolOwner"> | TypedResponseMessage<"CardanoPoolRelayParameters"> | TypedResponseMessage<"CardanoTxCertificate"> | TypedResponseMessage<"CardanoTxWithdrawal"> | TypedResponseMessage<"CardanoTxAuxiliaryData"> | TypedResponseMessage<"CardanoTxMint"> | TypedResponseMessage<"CardanoTxCollateralInput"> | TypedResponseMessage<"CardanoTxRequiredSigner"> | TypedResponseMessage<"CardanoTxReferenceInput"> | TypedResponseMessage<"CardanoTxItemAck"> | TypedResponseMessage<"CardanoTxAuxiliaryDataSupplement"> | TypedResponseMessage<"CardanoTxWitnessRequest"> | TypedResponseMessage<"CardanoTxWitnessResponse"> | TypedResponseMessage<"CardanoTxHostAck"> | TypedResponseMessage<"CardanoTxBodyHash"> | TypedResponseMessage<"CardanoSignTxFinished"> | TypedResponseMessage<"CardanoSignMessage"> | TypedResponseMessage<"CardanoMessageSignature"> | TypedResponseMessage<"Success"> | TypedResponseMessage<"Failure"> | TypedResponseMessage<"ButtonRequest"> | TypedResponseMessage<"ButtonAck"> | TypedResponseMessage<"PinMatrixRequest"> | TypedResponseMessage<"PinMatrixAck"> | TypedResponseMessage<"PassphraseRequest"> | TypedResponseMessage<"PassphraseAck"> | TypedResponseMessage<"Deprecated_PassphraseStateRequest"> | TypedResponseMessage<"Deprecated_PassphraseStateAck"> | TypedResponseMessage<"BixinPinInputOnDevice"> | TypedResponseMessage<"ConfluxGetAddress"> | TypedResponseMessage<"ConfluxAddress"> | TypedResponseMessage<"ConfluxSignTx"> | TypedResponseMessage<"ConfluxTxRequest"> | TypedResponseMessage<"ConfluxTxAck"> | TypedResponseMessage<"ConfluxSignMessage"> | TypedResponseMessage<"ConfluxMessageSignature"> | TypedResponseMessage<"ConfluxSignMessageCIP23"> | TypedResponseMessage<"CosmosGetAddress"> | TypedResponseMessage<"CosmosAddress"> | TypedResponseMessage<"CosmosSignTx"> | TypedResponseMessage<"CosmosSignedTx"> | TypedResponseMessage<"CipherKeyValue"> | TypedResponseMessage<"CipheredKeyValue"> | TypedResponseMessage<"SignIdentity"> | TypedResponseMessage<"SignedIdentity"> | TypedResponseMessage<"GetECDHSessionKey"> | TypedResponseMessage<"ECDHSessionKey"> | TypedResponseMessage<"BatchGetPublickeys"> | TypedResponseMessage<"EcdsaPublicKeys"> | TypedResponseMessage<"DnxGetAddress"> | TypedResponseMessage<"DnxAddress"> | TypedResponseMessage<"DnxSignTx"> | TypedResponseMessage<"DnxInputRequest"> | TypedResponseMessage<"DnxInputAck"> | TypedResponseMessage<"DnxRTSigsRequest"> | TypedResponseMessage<"DnxSignedTx"> | TypedResponseMessage<"EmmcFixPermission"> | TypedResponseMessage<"EmmcPath"> | TypedResponseMessage<"EmmcPathInfo"> | TypedResponseMessage<"EmmcFileRead"> | TypedResponseMessage<"EmmcFileWrite"> | TypedResponseMessage<"EmmcFileDelete"> | TypedResponseMessage<"EmmcDir"> | TypedResponseMessage<"EmmcDirList"> | TypedResponseMessage<"EmmcDirMake"> | TypedResponseMessage<"EmmcDirRemove"> | TypedResponseMessage<"EosGetPublicKey"> | TypedResponseMessage<"EosPublicKey"> | TypedResponseMessage<"EosSignTx"> | TypedResponseMessage<"EosTxActionRequest"> | TypedResponseMessage<"EosTxActionAck"> | TypedResponseMessage<"EosSignedTx"> | TypedResponseMessage<"EthereumNetworkInfo"> | TypedResponseMessage<"EthereumTokenInfo"> | TypedResponseMessage<"EthereumSignTypedDataOneKey"> | TypedResponseMessage<"EthereumGnosisSafeTxRequest"> | TypedResponseMessage<"EthereumGnosisSafeTxAck"> | TypedResponseMessage<"EthereumTypedDataStructRequestOneKey"> | TypedResponseMessage<"EthereumTypedDataStructAckOneKey"> | TypedResponseMessage<"EthereumTypedDataValueRequestOneKey"> | TypedResponseMessage<"EthereumTypedDataValueAckOneKey"> | TypedResponseMessage<"EthereumSignTypedData"> | TypedResponseMessage<"EthereumTypedDataStructRequest"> | TypedResponseMessage<"EthereumTypedDataStructAck"> | TypedResponseMessage<"EthereumTypedDataValueRequest"> | TypedResponseMessage<"EthereumTypedDataValueAck"> | TypedResponseMessage<"EthereumGetPublicKeyOneKey"> | TypedResponseMessage<"EthereumPublicKeyOneKey"> | TypedResponseMessage<"EthereumGetAddressOneKey"> | TypedResponseMessage<"EthereumAddressOneKey"> | TypedResponseMessage<"EthereumSignTxOneKey"> | TypedResponseMessage<"EthereumSignTxEIP1559OneKey"> | TypedResponseMessage<"EthereumSignTxEIP7702OneKey"> | TypedResponseMessage<"EthereumTxRequestOneKey"> | TypedResponseMessage<"EthereumTxAckOneKey"> | TypedResponseMessage<"EthereumSignMessageOneKey"> | TypedResponseMessage<"EthereumMessageSignatureOneKey"> | TypedResponseMessage<"EthereumVerifyMessageOneKey"> | TypedResponseMessage<"EthereumSignTypedHashOneKey"> | TypedResponseMessage<"EthereumTypedDataSignatureOneKey"> | TypedResponseMessage<"EthereumSignMessageEIP712"> | TypedResponseMessage<"EthereumGetPublicKey"> | TypedResponseMessage<"EthereumPublicKey"> | TypedResponseMessage<"EthereumGetAddress"> | TypedResponseMessage<"EthereumAddress"> | TypedResponseMessage<"EthereumSignTx"> | TypedResponseMessage<"EthereumSignTxEIP1559"> | TypedResponseMessage<"EthereumTxRequest"> | TypedResponseMessage<"EthereumTxAck"> | TypedResponseMessage<"EthereumSignMessage"> | TypedResponseMessage<"EthereumMessageSignature"> | TypedResponseMessage<"EthereumVerifyMessage"> | TypedResponseMessage<"EthereumSignTypedHash"> | TypedResponseMessage<"EthereumTypedDataSignature"> | TypedResponseMessage<"FilecoinGetAddress"> | TypedResponseMessage<"FilecoinAddress"> | TypedResponseMessage<"FilecoinSignTx"> | TypedResponseMessage<"FilecoinSignedTx"> | TypedResponseMessage<"KaspaGetAddress"> | TypedResponseMessage<"KaspaAddress"> | TypedResponseMessage<"KaspaSignTx"> | TypedResponseMessage<"KaspaTxInputRequest"> | TypedResponseMessage<"KaspaTxInputAck"> | TypedResponseMessage<"KaspaTxRequest"> | TypedResponseMessage<"KaspaTxAckInput"> | TypedResponseMessage<"KaspaTxAckOutput"> | TypedResponseMessage<"KaspaTxAckPayloadChunk"> | TypedResponseMessage<"KaspaTxAckPrevMeta"> | TypedResponseMessage<"KaspaTxAckPrevInput"> | TypedResponseMessage<"KaspaTxAckPrevOutput"> | TypedResponseMessage<"KaspaSignedTx"> | TypedResponseMessage<"LnurlAuth"> | TypedResponseMessage<"LnurlAuthResp"> | TypedResponseMessage<"Initialize"> | TypedResponseMessage<"GetFeatures"> | TypedResponseMessage<"OnekeyGetFeatures"> | TypedResponseMessage<"Features"> | TypedResponseMessage<"OnekeyFeatures"> | TypedResponseMessage<"LockDevice"> | TypedResponseMessage<"EndSession"> | TypedResponseMessage<"ApplySettings"> | TypedResponseMessage<"ApplyFlags"> | TypedResponseMessage<"ChangePin"> | TypedResponseMessage<"ChangeWipeCode"> | TypedResponseMessage<"SdProtect"> | TypedResponseMessage<"Ping"> | TypedResponseMessage<"Cancel"> | TypedResponseMessage<"GetEntropy"> | TypedResponseMessage<"Entropy"> | TypedResponseMessage<"WipeDevice"> | TypedResponseMessage<"ResetDevice"> | TypedResponseMessage<"BackupDevice"> | TypedResponseMessage<"EntropyRequest"> | TypedResponseMessage<"EntropyAck"> | TypedResponseMessage<"RecoveryDevice"> | TypedResponseMessage<"WordRequest"> | TypedResponseMessage<"WordAck"> | TypedResponseMessage<"SetU2FCounter"> | TypedResponseMessage<"GetNextU2FCounter"> | TypedResponseMessage<"NextU2FCounter"> | TypedResponseMessage<"DoPreauthorized"> | TypedResponseMessage<"PreauthorizedRequest"> | TypedResponseMessage<"CancelAuthorization"> | TypedResponseMessage<"BixinSeedOperate"> | TypedResponseMessage<"BixinMessageSE"> | TypedResponseMessage<"BixinOutMessageSE"> | TypedResponseMessage<"DeviceBackToBoot"> | TypedResponseMessage<"BixinBackupRequest"> | TypedResponseMessage<"BixinBackupAck"> | TypedResponseMessage<"BixinRestoreRequest"> | TypedResponseMessage<"BixinRestoreAck"> | TypedResponseMessage<"BixinVerifyDeviceRequest"> | TypedResponseMessage<"BixinVerifyDeviceAck"> | TypedResponseMessage<"BixinWhiteListRequest"> | TypedResponseMessage<"BixinWhiteListAck"> | TypedResponseMessage<"BixinLoadDevice"> | TypedResponseMessage<"BixinBackupDevice"> | TypedResponseMessage<"BixinBackupDeviceAck"> | TypedResponseMessage<"DeviceInfoSettings"> | TypedResponseMessage<"GetDeviceInfo"> | TypedResponseMessage<"DeviceInfo"> | TypedResponseMessage<"ReadSEPublicKey"> | TypedResponseMessage<"SEPublicKey"> | TypedResponseMessage<"WriteSEPublicCert"> | TypedResponseMessage<"ReadSEPublicCert"> | TypedResponseMessage<"SEPublicCert"> | TypedResponseMessage<"SpiFlashWrite"> | TypedResponseMessage<"SpiFlashRead"> | TypedResponseMessage<"SpiFlashData"> | TypedResponseMessage<"SESignMessage"> | TypedResponseMessage<"SEMessageSignature"> | TypedResponseMessage<"ResourceUpload"> | TypedResponseMessage<"ZoomRequest"> | TypedResponseMessage<"BlurRequest"> | TypedResponseMessage<"ResourceRequest"> | TypedResponseMessage<"ResourceAck"> | TypedResponseMessage<"ResourceUpdate"> | TypedResponseMessage<"NFTWriteInfo"> | TypedResponseMessage<"NFTWriteData"> | TypedResponseMessage<"RebootToBootloader"> | TypedResponseMessage<"RebootToBoardloader"> | TypedResponseMessage<"ListResDir"> | TypedResponseMessage<"FileInfoList"> | TypedResponseMessage<"DeviceEraseSector"> | TypedResponseMessage<"UnLockDevice"> | TypedResponseMessage<"UnLockDeviceResponse"> | TypedResponseMessage<"GetPassphraseState"> | TypedResponseMessage<"MoneroGetAddress"> | TypedResponseMessage<"MoneroAddress"> | TypedResponseMessage<"MoneroGetWatchKey"> | TypedResponseMessage<"MoneroWatchKey"> | TypedResponseMessage<"MoneroTransactionInitRequest"> | TypedResponseMessage<"MoneroTransactionInitAck"> | TypedResponseMessage<"MoneroTransactionSetInputRequest"> | TypedResponseMessage<"MoneroTransactionSetInputAck"> | TypedResponseMessage<"MoneroTransactionInputsPermutationRequest"> | TypedResponseMessage<"MoneroTransactionInputsPermutationAck"> | TypedResponseMessage<"MoneroTransactionInputViniRequest"> | TypedResponseMessage<"MoneroTransactionInputViniAck"> | TypedResponseMessage<"MoneroTransactionAllInputsSetRequest"> | TypedResponseMessage<"MoneroTransactionAllInputsSetAck"> | TypedResponseMessage<"MoneroTransactionSetOutputRequest"> | TypedResponseMessage<"MoneroTransactionSetOutputAck"> | TypedResponseMessage<"MoneroTransactionAllOutSetRequest"> | TypedResponseMessage<"MoneroTransactionAllOutSetAck"> | TypedResponseMessage<"MoneroTransactionSignInputRequest"> | TypedResponseMessage<"MoneroTransactionSignInputAck"> | TypedResponseMessage<"MoneroTransactionFinalRequest"> | TypedResponseMessage<"MoneroTransactionFinalAck"> | TypedResponseMessage<"MoneroKeyImageExportInitRequest"> | TypedResponseMessage<"MoneroKeyImageExportInitAck"> | TypedResponseMessage<"MoneroKeyImageSyncStepRequest"> | TypedResponseMessage<"MoneroKeyImageSyncStepAck"> | TypedResponseMessage<"MoneroKeyImageSyncFinalRequest"> | TypedResponseMessage<"MoneroKeyImageSyncFinalAck"> | TypedResponseMessage<"MoneroGetTxKeyRequest"> | TypedResponseMessage<"MoneroGetTxKeyAck"> | TypedResponseMessage<"MoneroLiveRefreshStartRequest"> | TypedResponseMessage<"MoneroLiveRefreshStartAck"> | TypedResponseMessage<"MoneroLiveRefreshStepRequest"> | TypedResponseMessage<"MoneroLiveRefreshStepAck"> | TypedResponseMessage<"MoneroLiveRefreshFinalRequest"> | TypedResponseMessage<"MoneroLiveRefreshFinalAck"> | TypedResponseMessage<"NearGetAddress"> | TypedResponseMessage<"NearAddress"> | TypedResponseMessage<"NearSignTx"> | TypedResponseMessage<"NearSignedTx"> | TypedResponseMessage<"NEMGetAddress"> | TypedResponseMessage<"NEMAddress"> | TypedResponseMessage<"NEMSignTx"> | TypedResponseMessage<"NEMSignedTx"> | TypedResponseMessage<"NEMDecryptMessage"> | TypedResponseMessage<"NEMDecryptedMessage"> | TypedResponseMessage<"NeoGetAddress"> | TypedResponseMessage<"NeoAddress"> | TypedResponseMessage<"NeoSignTx"> | TypedResponseMessage<"NeoSignedTx"> | TypedResponseMessage<"NervosGetAddress"> | TypedResponseMessage<"NervosAddress"> | TypedResponseMessage<"NervosSignTx"> | TypedResponseMessage<"NervosSignedTx"> | TypedResponseMessage<"NervosTxRequest"> | TypedResponseMessage<"NervosTxAck"> | TypedResponseMessage<"NexaGetAddress"> | TypedResponseMessage<"NexaAddress"> | TypedResponseMessage<"NexaSignTx"> | TypedResponseMessage<"NexaTxInputRequest"> | TypedResponseMessage<"NexaTxInputAck"> | TypedResponseMessage<"NexaSignedTx"> | TypedResponseMessage<"NostrGetPublicKey"> | TypedResponseMessage<"NostrPublicKey"> | TypedResponseMessage<"NostrSignEvent"> | TypedResponseMessage<"NostrSignedEvent"> | TypedResponseMessage<"NostrSignSchnorr"> | TypedResponseMessage<"NostrSignedSchnorr"> | TypedResponseMessage<"NostrEncryptMessage"> | TypedResponseMessage<"NostrEncryptedMessage"> | TypedResponseMessage<"NostrDecryptMessage"> | TypedResponseMessage<"NostrDecryptedMessage"> | TypedResponseMessage<"PolkadotGetAddress"> | TypedResponseMessage<"PolkadotAddress"> | TypedResponseMessage<"PolkadotSignTx"> | TypedResponseMessage<"PolkadotSignedTx"> | TypedResponseMessage<"RippleGetAddress"> | TypedResponseMessage<"RippleAddress"> | TypedResponseMessage<"RippleSignTx"> | TypedResponseMessage<"RippleSignedTx"> | TypedResponseMessage<"ScdoGetAddress"> | TypedResponseMessage<"ScdoAddress"> | TypedResponseMessage<"ScdoSignTx"> | TypedResponseMessage<"ScdoSignedTx"> | TypedResponseMessage<"ScdoTxAck"> | TypedResponseMessage<"ScdoSignMessage"> | TypedResponseMessage<"ScdoSignedMessage"> | TypedResponseMessage<"SolanaGetAddress"> | TypedResponseMessage<"SolanaAddress"> | TypedResponseMessage<"SolanaSignTx"> | TypedResponseMessage<"SolanaSignedTx"> | TypedResponseMessage<"SolanaSignOffChainMessage"> | TypedResponseMessage<"SolanaSignUnsafeMessage"> | TypedResponseMessage<"SolanaMessageSignature"> | TypedResponseMessage<"StarcoinGetAddress"> | TypedResponseMessage<"StarcoinAddress"> | TypedResponseMessage<"StarcoinGetPublicKey"> | TypedResponseMessage<"StarcoinPublicKey"> | TypedResponseMessage<"StarcoinSignTx"> | TypedResponseMessage<"StarcoinSignedTx"> | TypedResponseMessage<"StarcoinSignMessage"> | TypedResponseMessage<"StarcoinMessageSignature"> | TypedResponseMessage<"StarcoinVerifyMessage"> | TypedResponseMessage<"StellarGetAddress"> | TypedResponseMessage<"StellarAddress"> | TypedResponseMessage<"StellarSignTx"> | TypedResponseMessage<"StellarTxOpRequest"> | TypedResponseMessage<"StellarPaymentOp"> | TypedResponseMessage<"StellarCreateAccountOp"> | TypedResponseMessage<"StellarPathPaymentStrictReceiveOp"> | TypedResponseMessage<"StellarPathPaymentStrictSendOp"> | TypedResponseMessage<"StellarManageSellOfferOp"> | TypedResponseMessage<"StellarManageBuyOfferOp"> | TypedResponseMessage<"StellarCreatePassiveSellOfferOp"> | TypedResponseMessage<"StellarSetOptionsOp"> | TypedResponseMessage<"StellarChangeTrustOp"> | TypedResponseMessage<"StellarAllowTrustOp"> | TypedResponseMessage<"StellarAccountMergeOp"> | TypedResponseMessage<"StellarManageDataOp"> | TypedResponseMessage<"StellarBumpSequenceOp"> | TypedResponseMessage<"StellarInvokeHostFunctionOp"> | TypedResponseMessage<"StellarSorobanDataRequest"> | TypedResponseMessage<"StellarSorobanDataAck"> | TypedResponseMessage<"StellarSignedTx"> | TypedResponseMessage<"SuiGetAddress"> | TypedResponseMessage<"SuiAddress"> | TypedResponseMessage<"SuiSignTx"> | TypedResponseMessage<"SuiSignedTx"> | TypedResponseMessage<"SuiTxRequest"> | TypedResponseMessage<"SuiTxAck"> | TypedResponseMessage<"SuiSignMessage"> | TypedResponseMessage<"SuiMessageSignature"> | TypedResponseMessage<"TezosGetAddress"> | TypedResponseMessage<"TezosAddress"> | TypedResponseMessage<"TezosGetPublicKey"> | TypedResponseMessage<"TezosPublicKey"> | TypedResponseMessage<"TezosSignTx"> | TypedResponseMessage<"TezosSignedTx"> | TypedResponseMessage<"TonGetAddress"> | TypedResponseMessage<"TonAddress"> | TypedResponseMessage<"TonSignMessage"> | TypedResponseMessage<"TonTxAck"> | TypedResponseMessage<"TonSignedMessage"> | TypedResponseMessage<"TonSignProof"> | TypedResponseMessage<"TonSignedProof"> | TypedResponseMessage<"TonSignData"> | TypedResponseMessage<"TonSignedData"> | TypedResponseMessage<"TronGetAddress"> | TypedResponseMessage<"TronAddress"> | TypedResponseMessage<"TronSignTx"> | TypedResponseMessage<"TronSignedTx"> | TypedResponseMessage<"TronSignMessage"> | TypedResponseMessage<"TronMessageSignature"> | TypedResponseMessage<"facotry">;
3324
-
3325
- declare function generateSdkInstanceId(): string;
3326
- declare function generateInstanceId(type: string, sdkInstanceId?: string): string;
3327
- interface RequestContext {
3328
- responseID: number;
3329
- sdkInstanceId?: string;
3330
- methodName: string;
3331
- connectId?: string;
3332
- deviceInstanceId?: string;
3333
- commandsInstanceId?: string;
3334
- parentResponseID?: number;
3335
- startTime: number;
3336
- endTime?: number;
3337
- status?: 'pending' | 'running' | 'success' | 'error' | 'cancelled';
3338
- error?: string;
3339
- }
3340
- interface SdkTracingContext {
3341
- sdkInstanceId: string;
3342
- createdAt: number;
3343
- activeRequests: Map<number, RequestContext>;
3344
- }
3345
- declare function createSdkTracingContext(): SdkTracingContext;
3346
- declare function createRequestContext(responseID: number, methodName: string, options?: {
3347
- sdkInstanceId?: string;
3348
- connectId?: string;
3349
- deviceInstanceId?: string;
3350
- commandsInstanceId?: string;
3351
- parentResponseID?: number;
3352
- }): RequestContext;
3353
- declare function updateRequestContext(responseID: number, updates: Partial<RequestContext>): void;
3354
- declare function completeRequestContext(responseID: number, error?: Error): void;
3355
- declare function getActiveRequestsByDeviceInstance(deviceInstanceId: string): RequestContext[];
3356
- declare function formatRequestContext(context: RequestContext): string;
3357
- declare function cleanupSdkInstance(sdkInstanceId: string): void;
3358
-
3359
- declare const getDeviceType: (features?: Features) => IDeviceType;
4629
+ /**
4630
+ * Compares two versions and returns if the version is newer (1), older (-1) or equal (0).
4631
+ * @param {string | number[]} a Version to compare from
4632
+ * @param {string | number[]} b Version to compare with
4633
+ * @returns {number} Returns 1 if newer, -1 if older and 0 if equal
4634
+ */
4635
+ declare const versionCompare: (a: string | number[], b: string | number[]) => 1 | 0 | -1;
4636
+
4637
+ declare function patchFeatures(response: DefaultMessageResponse): TypedResponseMessage<"DeviceStatus"> | TypedResponseMessage<"DeviceSession"> | TypedResponseMessage<"PassphraseState"> | TypedResponseMessage<"Address"> | TypedResponseMessage<"DeviceInfo"> | TypedResponseMessage<"DeviceFirmwareUpdateStatus"> | TypedResponseMessage<"Success"> | TypedResponseMessage<"AptosMessagePayload"> | TypedResponseMessage<"BinanceInputOutput"> | TypedResponseMessage<"BinanceCoin"> | TypedResponseMessage<"HDNodePathType"> | TypedResponseMessage<"HDNodeType"> | TypedResponseMessage<"MultisigRedeemScriptType"> | TypedResponseMessage<"TxRequestDetailsType"> | TypedResponseMessage<"TxRequestSerializedType"> | TypedResponseMessage<"TxInputType"> | TypedResponseMessage<"TxOutputBinType"> | TypedResponseMessage<"TxOutputType"> | TypedResponseMessage<"TxAckInputWrapper"> | TypedResponseMessage<"TxAckOutputWrapper"> | TypedResponseMessage<"PrevTx"> | TypedResponseMessage<"TxAckPrevInputWrapper"> | TypedResponseMessage<"PrevInput"> | TypedResponseMessage<"TxAckPrevOutputWrapper"> | TypedResponseMessage<"PrevOutput"> | TypedResponseMessage<"TxAckPrevExtraDataWrapper"> | TypedResponseMessage<"BIP32Address"> | TypedResponseMessage<"CardanoNativeScript"> | TypedResponseMessage<"CardanoBlockchainPointerType"> | TypedResponseMessage<"CardanoAddressParametersType"> | TypedResponseMessage<"CardanoPoolMetadataType"> | TypedResponseMessage<"CardanoPoolParametersType"> | TypedResponseMessage<"CardanoDRep"> | TypedResponseMessage<"CardanoCVoteRegistrationDelegation"> | TypedResponseMessage<"CardanoCVoteRegistrationParametersType"> | TypedResponseMessage<"IdentityType"> | TypedResponseMessage<"Path"> | TypedResponseMessage<"DnxTxKey"> | TypedResponseMessage<"DnxComputedKeyImage"> | TypedResponseMessage<"EmmcFile"> | TypedResponseMessage<"EosTxHeader"> | TypedResponseMessage<"EosActionCommon"> | TypedResponseMessage<"EosActionTransfer"> | TypedResponseMessage<"EosActionDelegate"> | TypedResponseMessage<"EosActionUndelegate"> | TypedResponseMessage<"EosActionRefund"> | TypedResponseMessage<"EosActionBuyRam"> | TypedResponseMessage<"EosActionBuyRamBytes"> | TypedResponseMessage<"EosActionSellRam"> | TypedResponseMessage<"EosActionVoteProducer"> | TypedResponseMessage<"EosActionUpdateAuth"> | TypedResponseMessage<"EosActionDeleteAuth"> | TypedResponseMessage<"EosActionLinkAuth"> | TypedResponseMessage<"EosActionUnlinkAuth"> | TypedResponseMessage<"EosActionNewAccount"> | TypedResponseMessage<"EosActionUnknown"> | TypedResponseMessage<"EosPermissionLevel"> | TypedResponseMessage<"EosAuthorizationKey"> | TypedResponseMessage<"EosAuthorizationAccount"> | TypedResponseMessage<"EosAuthorizationWait"> | TypedResponseMessage<"EosAsset"> | TypedResponseMessage<"EosAuthorization"> | TypedResponseMessage<"EthereumStructMemberOneKey"> | TypedResponseMessage<"EthereumFieldTypeOneKey"> | TypedResponseMessage<"EthereumDefinitions"> | TypedResponseMessage<"EthereumStructMember"> | TypedResponseMessage<"EthereumFieldType"> | TypedResponseMessage<"EthereumAccessListOneKey"> | TypedResponseMessage<"EthereumAuthorizationOneKey"> | TypedResponseMessage<"EthereumAuthorizationSignature"> | TypedResponseMessage<"EthereumAccessList"> | TypedResponseMessage<"KaspaTxRequestSignature"> | TypedResponseMessage<"KaspaOutpoint"> | TypedResponseMessage<"FileInfo"> | TypedResponseMessage<"MoneroOutputEntry"> | TypedResponseMessage<"MoneroMultisigKLRki"> | TypedResponseMessage<"MoneroRctKeyPublic"> | TypedResponseMessage<"MoneroAccountPublicAddress"> | TypedResponseMessage<"MoneroTransactionData"> | TypedResponseMessage<"MoneroTransactionDestinationEntry"> | TypedResponseMessage<"MoneroTransactionRsigData"> | TypedResponseMessage<"MoneroTransactionSourceEntry"> | TypedResponseMessage<"MoneroRingCtSig"> | TypedResponseMessage<"MoneroSubAddressIndicesList"> | TypedResponseMessage<"MoneroTransferDetails"> | TypedResponseMessage<"MoneroExportedKeyImage"> | TypedResponseMessage<"NEMTransactionCommon"> | TypedResponseMessage<"NEMTransfer"> | TypedResponseMessage<"NEMProvisionNamespace"> | TypedResponseMessage<"NEMMosaicCreation"> | TypedResponseMessage<"NEMMosaicSupplyChange"> | TypedResponseMessage<"NEMAggregateModification"> | TypedResponseMessage<"NEMImportanceTransfer"> | TypedResponseMessage<"NEMMosaic"> | TypedResponseMessage<"NEMMosaicDefinition"> | TypedResponseMessage<"NEMCosignatoryModification"> | TypedResponseMessage<"RipplePayment"> | TypedResponseMessage<"SolanaTxATADetails"> | TypedResponseMessage<"SolanaTxExtraInfo"> | TypedResponseMessage<"StellarAsset"> | TypedResponseMessage<"TezosRevealOp"> | TypedResponseMessage<"TezosTransactionOp"> | TypedResponseMessage<"TezosOriginationOp"> | TypedResponseMessage<"TezosDelegationOp"> | TypedResponseMessage<"TezosProposalOp"> | TypedResponseMessage<"TezosBallotOp"> | TypedResponseMessage<"TezosContractID"> | TypedResponseMessage<"TezosParametersManager"> | TypedResponseMessage<"TezosManagerTransfer"> | TypedResponseMessage<"TronContract"> | TypedResponseMessage<"TronTransferContract"> | TypedResponseMessage<"TronVoteWitnessContract"> | TypedResponseMessage<"TronFreezeBalanceContract"> | TypedResponseMessage<"TronUnfreezeBalanceContract"> | TypedResponseMessage<"TronWithdrawBalanceContract"> | TypedResponseMessage<"TronTriggerSmartContract"> | TypedResponseMessage<"TronFreezeBalanceV2Contract"> | TypedResponseMessage<"TronUnfreezeBalanceV2Contract"> | TypedResponseMessage<"TronWithdrawExpireUnfreezeContract"> | TypedResponseMessage<"TronDelegateResourceContract"> | TypedResponseMessage<"TronUnDelegateResourceContract"> | TypedResponseMessage<"TronCancelAllUnfreezeV2Contract"> | TypedResponseMessage<"Vote"> | TypedResponseMessage<"CoinJoinRequest"> | TypedResponseMessage<"PaymentRequestMemo"> | TypedResponseMessage<"TextMemo"> | TypedResponseMessage<"RefundMemo"> | TypedResponseMessage<"CoinPurchaseMemo"> | TypedResponseMessage<"ViewAmount"> | TypedResponseMessage<"ViewDetail"> | TypedResponseMessage<"ViewTip"> | TypedResponseMessage<"ViewRawData"> | TypedResponseMessage<"DeviceSettings"> | TypedResponseMessage<"DeviceCertificate"> | TypedResponseMessage<"DeviceFirmwareTarget"> | TypedResponseMessage<"DeviceFirmwareUpdateRecordFields"> | TypedResponseMessage<"DeviceFirmwareUpdateRecord"> | TypedResponseMessage<"DeviceFactoryInfoManufactureTime"> | TypedResponseMessage<"DeviceFactoryInfo"> | TypedResponseMessage<"DeviceFirmwareImageInfo"> | TypedResponseMessage<"DeviceInfoTargets"> | TypedResponseMessage<"DeviceInfoTypes"> | TypedResponseMessage<"DeviceHardwareInfo"> | TypedResponseMessage<"DeviceMainMcuInfo"> | TypedResponseMessage<"DeviceCoprocessorInfo"> | TypedResponseMessage<"DeviceSEInfo"> | TypedResponseMessage<"DeviceHostPassphrase"> | TypedResponseMessage<"DevicePassphraseOnDevice"> | TypedResponseMessage<"DeviceAttachPinOnDevice"> | TypedResponseMessage<"DeviceSessionResume"> | TypedResponseMessage<"DeviceWalletSelect"> | TypedResponseMessage<"DevOnboardingSetupStatus"> | TypedResponseMessage<"FilesystemFile"> | TypedResponseMessage<"AlephiumGetAddress"> | TypedResponseMessage<"AlephiumAddress"> | TypedResponseMessage<"AlephiumSignTx"> | TypedResponseMessage<"AlephiumSignedTx"> | TypedResponseMessage<"AlephiumTxRequest"> | TypedResponseMessage<"AlephiumTxAck"> | TypedResponseMessage<"AlephiumBytecodeRequest"> | TypedResponseMessage<"AlephiumBytecodeAck"> | TypedResponseMessage<"AlephiumSignMessage"> | TypedResponseMessage<"AlephiumMessageSignature"> | TypedResponseMessage<"AlgorandGetAddress"> | TypedResponseMessage<"AlgorandAddress"> | TypedResponseMessage<"AlgorandSignTx"> | TypedResponseMessage<"AlgorandSignedTx"> | TypedResponseMessage<"AptosGetAddress"> | TypedResponseMessage<"AptosAddress"> | TypedResponseMessage<"AptosSignTx"> | TypedResponseMessage<"AptosSignedTx"> | TypedResponseMessage<"AptosSignMessage"> | TypedResponseMessage<"AptosMessageSignature"> | TypedResponseMessage<"AptosSignSIWAMessage"> | TypedResponseMessage<"BenfenGetAddress"> | TypedResponseMessage<"BenfenAddress"> | TypedResponseMessage<"BenfenSignTx"> | TypedResponseMessage<"BenfenSignedTx"> | TypedResponseMessage<"BenfenTxRequest"> | TypedResponseMessage<"BenfenTxAck"> | TypedResponseMessage<"BenfenSignMessage"> | TypedResponseMessage<"BenfenMessageSignature"> | TypedResponseMessage<"BinanceGetAddress"> | TypedResponseMessage<"BinanceAddress"> | TypedResponseMessage<"BinanceGetPublicKey"> | TypedResponseMessage<"BinancePublicKey"> | TypedResponseMessage<"BinanceSignTx"> | TypedResponseMessage<"BinanceTxRequest"> | TypedResponseMessage<"BinanceTransferMsg"> | TypedResponseMessage<"BinanceOrderMsg"> | TypedResponseMessage<"BinanceCancelMsg"> | TypedResponseMessage<"BinanceSignedTx"> | TypedResponseMessage<"GetPublicKey"> | TypedResponseMessage<"PublicKey"> | TypedResponseMessage<"GetAddress"> | TypedResponseMessage<"GetOwnershipId"> | TypedResponseMessage<"OwnershipId"> | TypedResponseMessage<"SignMessage"> | TypedResponseMessage<"MessageSignature"> | TypedResponseMessage<"VerifyMessage"> | TypedResponseMessage<"SignTx"> | TypedResponseMessage<"TxRequest"> | TypedResponseMessage<"TxAck"> | TypedResponseMessage<"TxAckInput"> | TypedResponseMessage<"TxAckOutput"> | TypedResponseMessage<"TxAckPrevMeta"> | TypedResponseMessage<"TxAckPrevInput"> | TypedResponseMessage<"TxAckPrevOutput"> | TypedResponseMessage<"TxAckPrevExtraData"> | TypedResponseMessage<"GetOwnershipProof"> | TypedResponseMessage<"OwnershipProof"> | TypedResponseMessage<"AuthorizeCoinJoin"> | TypedResponseMessage<"GetPublicKeyMultiple"> | TypedResponseMessage<"PublicKeyMultiple"> | TypedResponseMessage<"SignPsbt"> | TypedResponseMessage<"SignedPsbt"> | TypedResponseMessage<"FirmwareErase"> | TypedResponseMessage<"FirmwareRequest"> | TypedResponseMessage<"FirmwareUpload"> | TypedResponseMessage<"SelfTest"> | TypedResponseMessage<"FirmwareErase_ex"> | TypedResponseMessage<"Reboot"> | TypedResponseMessage<"FirmwareUpdateEmmc"> | TypedResponseMessage<"UpgradeFileHeader"> | TypedResponseMessage<"CardanoGetNativeScriptHash"> | TypedResponseMessage<"CardanoNativeScriptHash"> | TypedResponseMessage<"CardanoGetAddress"> | TypedResponseMessage<"CardanoAddress"> | TypedResponseMessage<"CardanoGetPublicKey"> | TypedResponseMessage<"CardanoPublicKey"> | TypedResponseMessage<"CardanoSignTxInit"> | TypedResponseMessage<"CardanoTxInput"> | TypedResponseMessage<"CardanoTxOutput"> | TypedResponseMessage<"CardanoAssetGroup"> | TypedResponseMessage<"CardanoToken"> | TypedResponseMessage<"CardanoTxInlineDatumChunk"> | TypedResponseMessage<"CardanoTxReferenceScriptChunk"> | TypedResponseMessage<"CardanoPoolOwner"> | TypedResponseMessage<"CardanoPoolRelayParameters"> | TypedResponseMessage<"CardanoTxCertificate"> | TypedResponseMessage<"CardanoTxWithdrawal"> | TypedResponseMessage<"CardanoTxAuxiliaryData"> | TypedResponseMessage<"CardanoTxMint"> | TypedResponseMessage<"CardanoTxCollateralInput"> | TypedResponseMessage<"CardanoTxRequiredSigner"> | TypedResponseMessage<"CardanoTxReferenceInput"> | TypedResponseMessage<"CardanoTxItemAck"> | TypedResponseMessage<"CardanoTxAuxiliaryDataSupplement"> | TypedResponseMessage<"CardanoTxWitnessRequest"> | TypedResponseMessage<"CardanoTxWitnessResponse"> | TypedResponseMessage<"CardanoTxHostAck"> | TypedResponseMessage<"CardanoTxBodyHash"> | TypedResponseMessage<"CardanoSignTxFinished"> | TypedResponseMessage<"CardanoSignMessage"> | TypedResponseMessage<"CardanoMessageSignature"> | TypedResponseMessage<"Failure"> | TypedResponseMessage<"ButtonRequest"> | TypedResponseMessage<"ButtonAck"> | TypedResponseMessage<"PinMatrixRequest"> | TypedResponseMessage<"PinMatrixAck"> | TypedResponseMessage<"PassphraseRequest"> | TypedResponseMessage<"PassphraseAck"> | TypedResponseMessage<"Deprecated_PassphraseStateRequest"> | TypedResponseMessage<"Deprecated_PassphraseStateAck"> | TypedResponseMessage<"BixinPinInputOnDevice"> | TypedResponseMessage<"ConfluxGetAddress"> | TypedResponseMessage<"ConfluxAddress"> | TypedResponseMessage<"ConfluxSignTx"> | TypedResponseMessage<"ConfluxTxRequest"> | TypedResponseMessage<"ConfluxTxAck"> | TypedResponseMessage<"ConfluxSignMessage"> | TypedResponseMessage<"ConfluxMessageSignature"> | TypedResponseMessage<"ConfluxSignMessageCIP23"> | TypedResponseMessage<"CosmosGetAddress"> | TypedResponseMessage<"CosmosAddress"> | TypedResponseMessage<"CosmosSignTx"> | TypedResponseMessage<"CosmosSignedTx"> | TypedResponseMessage<"CipherKeyValue"> | TypedResponseMessage<"CipheredKeyValue"> | TypedResponseMessage<"SignIdentity"> | TypedResponseMessage<"SignedIdentity"> | TypedResponseMessage<"GetECDHSessionKey"> | TypedResponseMessage<"ECDHSessionKey"> | TypedResponseMessage<"BatchGetPublickeys"> | TypedResponseMessage<"EcdsaPublicKeys"> | TypedResponseMessage<"DnxGetAddress"> | TypedResponseMessage<"DnxAddress"> | TypedResponseMessage<"DnxSignTx"> | TypedResponseMessage<"DnxInputRequest"> | TypedResponseMessage<"DnxInputAck"> | TypedResponseMessage<"DnxRTSigsRequest"> | TypedResponseMessage<"DnxSignedTx"> | TypedResponseMessage<"EmmcFixPermission"> | TypedResponseMessage<"EmmcPath"> | TypedResponseMessage<"EmmcPathInfo"> | TypedResponseMessage<"EmmcFileRead"> | TypedResponseMessage<"EmmcFileWrite"> | TypedResponseMessage<"EmmcFileDelete"> | TypedResponseMessage<"EmmcDir"> | TypedResponseMessage<"EmmcDirList"> | TypedResponseMessage<"EmmcDirMake"> | TypedResponseMessage<"EmmcDirRemove"> | TypedResponseMessage<"EosGetPublicKey"> | TypedResponseMessage<"EosPublicKey"> | TypedResponseMessage<"EosSignTx"> | TypedResponseMessage<"EosTxActionRequest"> | TypedResponseMessage<"EosTxActionAck"> | TypedResponseMessage<"EosSignedTx"> | TypedResponseMessage<"EthereumNetworkInfo"> | TypedResponseMessage<"EthereumTokenInfo"> | TypedResponseMessage<"EthereumSignTypedDataOneKey"> | TypedResponseMessage<"EthereumGnosisSafeTxRequest"> | TypedResponseMessage<"EthereumGnosisSafeTxAck"> | TypedResponseMessage<"EthereumTypedDataStructRequestOneKey"> | TypedResponseMessage<"EthereumTypedDataStructAckOneKey"> | TypedResponseMessage<"EthereumTypedDataValueRequestOneKey"> | TypedResponseMessage<"EthereumTypedDataValueAckOneKey"> | TypedResponseMessage<"EthereumSignTypedData"> | TypedResponseMessage<"EthereumTypedDataStructRequest"> | TypedResponseMessage<"EthereumTypedDataStructAck"> | TypedResponseMessage<"EthereumTypedDataValueRequest"> | TypedResponseMessage<"EthereumTypedDataValueAck"> | TypedResponseMessage<"EthereumGetPublicKeyOneKey"> | TypedResponseMessage<"EthereumPublicKeyOneKey"> | TypedResponseMessage<"EthereumGetAddressOneKey"> | TypedResponseMessage<"EthereumAddressOneKey"> | TypedResponseMessage<"EthereumSignTxOneKey"> | TypedResponseMessage<"EthereumSignTxEIP1559OneKey"> | TypedResponseMessage<"EthereumSignTxEIP7702OneKey"> | TypedResponseMessage<"EthereumTxRequestOneKey"> | TypedResponseMessage<"EthereumTxAckOneKey"> | TypedResponseMessage<"EthereumSignMessageOneKey"> | TypedResponseMessage<"EthereumMessageSignatureOneKey"> | TypedResponseMessage<"EthereumVerifyMessageOneKey"> | TypedResponseMessage<"EthereumSignTypedHashOneKey"> | TypedResponseMessage<"EthereumTypedDataSignatureOneKey"> | TypedResponseMessage<"EthereumSignMessageEIP712"> | TypedResponseMessage<"EthereumGetPublicKey"> | TypedResponseMessage<"EthereumPublicKey"> | TypedResponseMessage<"EthereumGetAddress"> | TypedResponseMessage<"EthereumAddress"> | TypedResponseMessage<"EthereumSignTx"> | TypedResponseMessage<"EthereumSignTxEIP1559"> | TypedResponseMessage<"EthereumTxRequest"> | TypedResponseMessage<"EthereumTxAck"> | TypedResponseMessage<"EthereumSignMessage"> | TypedResponseMessage<"EthereumMessageSignature"> | TypedResponseMessage<"EthereumVerifyMessage"> | TypedResponseMessage<"EthereumSignTypedHash"> | TypedResponseMessage<"EthereumTypedDataSignature"> | TypedResponseMessage<"FilecoinGetAddress"> | TypedResponseMessage<"FilecoinAddress"> | TypedResponseMessage<"FilecoinSignTx"> | TypedResponseMessage<"FilecoinSignedTx"> | TypedResponseMessage<"KaspaGetAddress"> | TypedResponseMessage<"KaspaAddress"> | TypedResponseMessage<"KaspaSignTx"> | TypedResponseMessage<"KaspaTxInputRequest"> | TypedResponseMessage<"KaspaTxInputAck"> | TypedResponseMessage<"KaspaTxRequest"> | TypedResponseMessage<"KaspaTxAckInput"> | TypedResponseMessage<"KaspaTxAckOutput"> | TypedResponseMessage<"KaspaTxAckPayloadChunk"> | TypedResponseMessage<"KaspaTxAckPrevMeta"> | TypedResponseMessage<"KaspaTxAckPrevInput"> | TypedResponseMessage<"KaspaTxAckPrevOutput"> | TypedResponseMessage<"KaspaSignedTx"> | TypedResponseMessage<"LnurlAuth"> | TypedResponseMessage<"LnurlAuthResp"> | TypedResponseMessage<"Initialize"> | TypedResponseMessage<"GetFeatures"> | TypedResponseMessage<"OnekeyGetFeatures"> | TypedResponseMessage<"Features"> | TypedResponseMessage<"OnekeyFeatures"> | TypedResponseMessage<"LockDevice"> | TypedResponseMessage<"EndSession"> | TypedResponseMessage<"ApplySettings"> | TypedResponseMessage<"ApplyFlags"> | TypedResponseMessage<"ChangePin"> | TypedResponseMessage<"ChangeWipeCode"> | TypedResponseMessage<"SdProtect"> | TypedResponseMessage<"Ping"> | TypedResponseMessage<"Cancel"> | TypedResponseMessage<"GetEntropy"> | TypedResponseMessage<"Entropy"> | TypedResponseMessage<"WipeDevice"> | TypedResponseMessage<"ResetDevice"> | TypedResponseMessage<"BackupDevice"> | TypedResponseMessage<"EntropyRequest"> | TypedResponseMessage<"EntropyAck"> | TypedResponseMessage<"RecoveryDevice"> | TypedResponseMessage<"WordRequest"> | TypedResponseMessage<"WordAck"> | TypedResponseMessage<"SetU2FCounter"> | TypedResponseMessage<"GetNextU2FCounter"> | TypedResponseMessage<"NextU2FCounter"> | TypedResponseMessage<"DoPreauthorized"> | TypedResponseMessage<"PreauthorizedRequest"> | TypedResponseMessage<"CancelAuthorization"> | TypedResponseMessage<"BixinSeedOperate"> | TypedResponseMessage<"BixinMessageSE"> | TypedResponseMessage<"BixinOutMessageSE"> | TypedResponseMessage<"DeviceBackToBoot"> | TypedResponseMessage<"BixinBackupRequest"> | TypedResponseMessage<"BixinBackupAck"> | TypedResponseMessage<"BixinRestoreRequest"> | TypedResponseMessage<"BixinRestoreAck"> | TypedResponseMessage<"BixinVerifyDeviceRequest"> | TypedResponseMessage<"BixinVerifyDeviceAck"> | TypedResponseMessage<"BixinWhiteListRequest"> | TypedResponseMessage<"BixinWhiteListAck"> | TypedResponseMessage<"BixinLoadDevice"> | TypedResponseMessage<"BixinBackupDevice"> | TypedResponseMessage<"BixinBackupDeviceAck"> | TypedResponseMessage<"DeviceInfoSettings"> | TypedResponseMessage<"GetDeviceInfo"> | TypedResponseMessage<"ReadSEPublicKey"> | TypedResponseMessage<"SEPublicKey"> | TypedResponseMessage<"WriteSEPublicCert"> | TypedResponseMessage<"ReadSEPublicCert"> | TypedResponseMessage<"SEPublicCert"> | TypedResponseMessage<"SpiFlashWrite"> | TypedResponseMessage<"SpiFlashRead"> | TypedResponseMessage<"SpiFlashData"> | TypedResponseMessage<"SESignMessage"> | TypedResponseMessage<"SEMessageSignature"> | TypedResponseMessage<"ResourceUpload"> | TypedResponseMessage<"ZoomRequest"> | TypedResponseMessage<"BlurRequest"> | TypedResponseMessage<"ResourceRequest"> | TypedResponseMessage<"ResourceAck"> | TypedResponseMessage<"ResourceUpdate"> | TypedResponseMessage<"NFTWriteInfo"> | TypedResponseMessage<"NFTWriteData"> | TypedResponseMessage<"RebootToBootloader"> | TypedResponseMessage<"RebootToBoardloader"> | TypedResponseMessage<"ListResDir"> | TypedResponseMessage<"FileInfoList"> | TypedResponseMessage<"DeviceEraseSector"> | TypedResponseMessage<"UnLockDevice"> | TypedResponseMessage<"UnLockDeviceResponse"> | TypedResponseMessage<"GetPassphraseState"> | TypedResponseMessage<"MoneroGetAddress"> | TypedResponseMessage<"MoneroAddress"> | TypedResponseMessage<"MoneroGetWatchKey"> | TypedResponseMessage<"MoneroWatchKey"> | TypedResponseMessage<"MoneroTransactionInitRequest"> | TypedResponseMessage<"MoneroTransactionInitAck"> | TypedResponseMessage<"MoneroTransactionSetInputRequest"> | TypedResponseMessage<"MoneroTransactionSetInputAck"> | TypedResponseMessage<"MoneroTransactionInputsPermutationRequest"> | TypedResponseMessage<"MoneroTransactionInputsPermutationAck"> | TypedResponseMessage<"MoneroTransactionInputViniRequest"> | TypedResponseMessage<"MoneroTransactionInputViniAck"> | TypedResponseMessage<"MoneroTransactionAllInputsSetRequest"> | TypedResponseMessage<"MoneroTransactionAllInputsSetAck"> | TypedResponseMessage<"MoneroTransactionSetOutputRequest"> | TypedResponseMessage<"MoneroTransactionSetOutputAck"> | TypedResponseMessage<"MoneroTransactionAllOutSetRequest"> | TypedResponseMessage<"MoneroTransactionAllOutSetAck"> | TypedResponseMessage<"MoneroTransactionSignInputRequest"> | TypedResponseMessage<"MoneroTransactionSignInputAck"> | TypedResponseMessage<"MoneroTransactionFinalRequest"> | TypedResponseMessage<"MoneroTransactionFinalAck"> | TypedResponseMessage<"MoneroKeyImageExportInitRequest"> | TypedResponseMessage<"MoneroKeyImageExportInitAck"> | TypedResponseMessage<"MoneroKeyImageSyncStepRequest"> | TypedResponseMessage<"MoneroKeyImageSyncStepAck"> | TypedResponseMessage<"MoneroKeyImageSyncFinalRequest"> | TypedResponseMessage<"MoneroKeyImageSyncFinalAck"> | TypedResponseMessage<"MoneroGetTxKeyRequest"> | TypedResponseMessage<"MoneroGetTxKeyAck"> | TypedResponseMessage<"MoneroLiveRefreshStartRequest"> | TypedResponseMessage<"MoneroLiveRefreshStartAck"> | TypedResponseMessage<"MoneroLiveRefreshStepRequest"> | TypedResponseMessage<"MoneroLiveRefreshStepAck"> | TypedResponseMessage<"MoneroLiveRefreshFinalRequest"> | TypedResponseMessage<"MoneroLiveRefreshFinalAck"> | TypedResponseMessage<"NearGetAddress"> | TypedResponseMessage<"NearAddress"> | TypedResponseMessage<"NearSignTx"> | TypedResponseMessage<"NearSignedTx"> | TypedResponseMessage<"NEMGetAddress"> | TypedResponseMessage<"NEMAddress"> | TypedResponseMessage<"NEMSignTx"> | TypedResponseMessage<"NEMSignedTx"> | TypedResponseMessage<"NEMDecryptMessage"> | TypedResponseMessage<"NEMDecryptedMessage"> | TypedResponseMessage<"NeoGetAddress"> | TypedResponseMessage<"NeoAddress"> | TypedResponseMessage<"NeoSignTx"> | TypedResponseMessage<"NeoSignedTx"> | TypedResponseMessage<"NervosGetAddress"> | TypedResponseMessage<"NervosAddress"> | TypedResponseMessage<"NervosSignTx"> | TypedResponseMessage<"NervosSignedTx"> | TypedResponseMessage<"NervosTxRequest"> | TypedResponseMessage<"NervosTxAck"> | TypedResponseMessage<"NexaGetAddress"> | TypedResponseMessage<"NexaAddress"> | TypedResponseMessage<"NexaSignTx"> | TypedResponseMessage<"NexaTxInputRequest"> | TypedResponseMessage<"NexaTxInputAck"> | TypedResponseMessage<"NexaSignedTx"> | TypedResponseMessage<"NostrGetPublicKey"> | TypedResponseMessage<"NostrPublicKey"> | TypedResponseMessage<"NostrSignEvent"> | TypedResponseMessage<"NostrSignedEvent"> | TypedResponseMessage<"NostrSignSchnorr"> | TypedResponseMessage<"NostrSignedSchnorr"> | TypedResponseMessage<"NostrEncryptMessage"> | TypedResponseMessage<"NostrEncryptedMessage"> | TypedResponseMessage<"NostrDecryptMessage"> | TypedResponseMessage<"NostrDecryptedMessage"> | TypedResponseMessage<"PolkadotGetAddress"> | TypedResponseMessage<"PolkadotAddress"> | TypedResponseMessage<"PolkadotSignTx"> | TypedResponseMessage<"PolkadotSignedTx"> | TypedResponseMessage<"RippleGetAddress"> | TypedResponseMessage<"RippleAddress"> | TypedResponseMessage<"RippleSignTx"> | TypedResponseMessage<"RippleSignedTx"> | TypedResponseMessage<"ScdoGetAddress"> | TypedResponseMessage<"ScdoAddress"> | TypedResponseMessage<"ScdoSignTx"> | TypedResponseMessage<"ScdoSignedTx"> | TypedResponseMessage<"ScdoTxAck"> | TypedResponseMessage<"ScdoSignMessage"> | TypedResponseMessage<"ScdoSignedMessage"> | TypedResponseMessage<"SolanaGetAddress"> | TypedResponseMessage<"SolanaAddress"> | TypedResponseMessage<"SolanaSignTx"> | TypedResponseMessage<"SolanaSignedTx"> | TypedResponseMessage<"SolanaSignOffChainMessage"> | TypedResponseMessage<"SolanaSignUnsafeMessage"> | TypedResponseMessage<"SolanaMessageSignature"> | TypedResponseMessage<"StarcoinGetAddress"> | TypedResponseMessage<"StarcoinAddress"> | TypedResponseMessage<"StarcoinGetPublicKey"> | TypedResponseMessage<"StarcoinPublicKey"> | TypedResponseMessage<"StarcoinSignTx"> | TypedResponseMessage<"StarcoinSignedTx"> | TypedResponseMessage<"StarcoinSignMessage"> | TypedResponseMessage<"StarcoinMessageSignature"> | TypedResponseMessage<"StarcoinVerifyMessage"> | TypedResponseMessage<"StellarGetAddress"> | TypedResponseMessage<"StellarAddress"> | TypedResponseMessage<"StellarSignTx"> | TypedResponseMessage<"StellarTxOpRequest"> | TypedResponseMessage<"StellarPaymentOp"> | TypedResponseMessage<"StellarCreateAccountOp"> | TypedResponseMessage<"StellarPathPaymentStrictReceiveOp"> | TypedResponseMessage<"StellarPathPaymentStrictSendOp"> | TypedResponseMessage<"StellarManageSellOfferOp"> | TypedResponseMessage<"StellarManageBuyOfferOp"> | TypedResponseMessage<"StellarCreatePassiveSellOfferOp"> | TypedResponseMessage<"StellarSetOptionsOp"> | TypedResponseMessage<"StellarChangeTrustOp"> | TypedResponseMessage<"StellarAllowTrustOp"> | TypedResponseMessage<"StellarAccountMergeOp"> | TypedResponseMessage<"StellarManageDataOp"> | TypedResponseMessage<"StellarBumpSequenceOp"> | TypedResponseMessage<"StellarInvokeHostFunctionOp"> | TypedResponseMessage<"StellarSorobanDataRequest"> | TypedResponseMessage<"StellarSorobanDataAck"> | TypedResponseMessage<"StellarSignedTx"> | TypedResponseMessage<"SuiGetAddress"> | TypedResponseMessage<"SuiAddress"> | TypedResponseMessage<"SuiSignTx"> | TypedResponseMessage<"SuiSignedTx"> | TypedResponseMessage<"SuiTxRequest"> | TypedResponseMessage<"SuiTxAck"> | TypedResponseMessage<"SuiSignMessage"> | TypedResponseMessage<"SuiMessageSignature"> | TypedResponseMessage<"TezosGetAddress"> | TypedResponseMessage<"TezosAddress"> | TypedResponseMessage<"TezosGetPublicKey"> | TypedResponseMessage<"TezosPublicKey"> | TypedResponseMessage<"TezosSignTx"> | TypedResponseMessage<"TezosSignedTx"> | TypedResponseMessage<"TonGetAddress"> | TypedResponseMessage<"TonAddress"> | TypedResponseMessage<"TonSignMessage"> | TypedResponseMessage<"TonTxAck"> | TypedResponseMessage<"TonSignedMessage"> | TypedResponseMessage<"TonSignProof"> | TypedResponseMessage<"TonSignedProof"> | TypedResponseMessage<"TonSignData"> | TypedResponseMessage<"TonSignedData"> | TypedResponseMessage<"TronGetAddress"> | TypedResponseMessage<"TronAddress"> | TypedResponseMessage<"TronSignTx"> | TypedResponseMessage<"TronSignedTx"> | TypedResponseMessage<"TronSignMessage"> | TypedResponseMessage<"TronMessageSignature"> | TypedResponseMessage<"facotry"> | TypedResponseMessage<"experimental_message"> | TypedResponseMessage<"experimental_field"> | TypedResponseMessage<"TxAckPaymentRequest"> | TypedResponseMessage<"EthereumSignTypedDataQR"> | TypedResponseMessage<"InternalMyAddressRequest"> | TypedResponseMessage<"StartSession"> | TypedResponseMessage<"SetBusy"> | TypedResponseMessage<"GetFirmwareHash"> | TypedResponseMessage<"FirmwareHash"> | TypedResponseMessage<"GetNonce"> | TypedResponseMessage<"Nonce"> | TypedResponseMessage<"WriteSEPrivateKey"> | TypedResponseMessage<"SetWallpaper"> | TypedResponseMessage<"GetWallpaper"> | TypedResponseMessage<"Wallpaper"> | TypedResponseMessage<"UnlockPath"> | TypedResponseMessage<"UnlockedPathRequest"> | TypedResponseMessage<"ViewSignPage"> | TypedResponseMessage<"ViewVerifyPage"> | TypedResponseMessage<"ProtocolInfoRequest"> | TypedResponseMessage<"ProtocolInfo"> | TypedResponseMessage<"DeviceReboot"> | TypedResponseMessage<"DeviceSettingsGet"> | TypedResponseMessage<"DeviceSettingsSet"> | TypedResponseMessage<"DeviceSettingsPageShow"> | TypedResponseMessage<"DeviceCertificateWrite"> | TypedResponseMessage<"DeviceCertificateRead"> | TypedResponseMessage<"DeviceCertificateSignature"> | TypedResponseMessage<"DeviceCertificateSign"> | TypedResponseMessage<"DeviceFirmwareUpdateRequest"> | TypedResponseMessage<"DeviceFirmwareUpdateStatusGet"> | TypedResponseMessage<"DeviceFactoryInfoSet"> | TypedResponseMessage<"DeviceFactoryInfoGet"> | TypedResponseMessage<"DeviceFactoryPermanentLock"> | TypedResponseMessage<"DeviceFactoryTest"> | TypedResponseMessage<"DeviceInfoGet"> | TypedResponseMessage<"DeviceSessionOpen"> | TypedResponseMessage<"DeviceSessionAskPin"> | TypedResponseMessage<"DeviceStatusGet"> | TypedResponseMessage<"DevGetOnboardingStatus"> | TypedResponseMessage<"DevOnboardingStatus"> | TypedResponseMessage<"FilesystemPermissionFix"> | TypedResponseMessage<"FilesystemPathInfo"> | TypedResponseMessage<"FilesystemPathInfoQuery"> | TypedResponseMessage<"FilesystemFileRead"> | TypedResponseMessage<"FilesystemFileWrite"> | TypedResponseMessage<"FilesystemFileDelete"> | TypedResponseMessage<"FilesystemDir"> | TypedResponseMessage<"FilesystemDirList"> | TypedResponseMessage<"FilesystemDirMake"> | TypedResponseMessage<"FilesystemDirRemove"> | TypedResponseMessage<"FilesystemFormat"> | TypedResponseMessage<"PortfolioUpdate">;
4638
+
4639
+ type DeviceFeaturesInput = Features | Messages.Features;
4640
+
4641
+ /**
4642
+ * get device type by features
4643
+ */
4644
+ declare const getDeviceType: (features?: DeviceFeaturesInput) => IDeviceType;
4645
+ /**
4646
+ * get device type by ble name
4647
+ * @param name Ble name
4648
+ */
3360
4649
  declare const getDeviceTypeByBleName: (name?: string) => IDeviceType;
3361
- declare const getDeviceBleName: (features?: Features) => string | null;
3362
- declare const getDeviceUUID: (features: Features) => string;
3363
- declare const getDeviceLabel: (features?: Features) => string | null;
3364
- declare const getMethodVersionRange: (features: Features | undefined, getVersionRange: (deviceModel: IDeviceType | IDeviceModel) => IVersionRange | undefined) => IVersionRange | undefined;
3365
- declare const getFirmwareType: (features: Features | undefined) => EFirmwareType;
3366
-
3367
- declare const getDeviceFirmwareVersion: (features: Features | undefined) => IVersionArray;
3368
- declare const getDeviceBLEFirmwareVersion: (features: Features) => IVersionArray;
3369
- declare const getDeviceBootloaderVersion: (features: Features | undefined) => IVersionArray;
3370
- declare const getDeviceBoardloaderVersion: (features: Features) => IVersionArray;
3371
-
3372
- declare const FIRMWARE_FIELDS: readonly ["firmware", "firmware-v2", "firmware-v8", "firmware-btc-v8"];
4650
+ /**
4651
+ * Get Connected Device ble name by features
4652
+ * @returns
4653
+ */
4654
+ declare const getDeviceBleName: (features?: DeviceFeaturesInput) => string | null;
4655
+ /**
4656
+ * Get Connected Device serial number by features
4657
+ */
4658
+ declare const getDeviceSerialNo: (features?: DeviceFeaturesInput) => string;
4659
+ /**
4660
+ * @deprecated Use getDeviceSerialNo instead.
4661
+ */
4662
+ declare const getDeviceUUID: (features?: DeviceFeaturesInput) => string;
4663
+ /**
4664
+ * Get Connected Device label by features
4665
+ */
4666
+ declare const getDeviceLabel: (features?: DeviceFeaturesInput) => string | null;
4667
+ /**
4668
+ * Get firmware version range by features
4669
+ * Type has a higher priority than Model
4670
+ */
4671
+ declare const getMethodVersionRange: (features: DeviceFeaturesInput | undefined, getVersionRange: (deviceModel: IDeviceType | IDeviceModel) => IVersionRange | undefined) => IVersionRange | undefined;
4672
+ declare const isMethodVersionRangeUnsupported: (versionRange?: IVersionRange) => boolean;
4673
+ declare const getFirmwareType: (features?: DeviceFeaturesInput) => _onekeyfe_hd_shared.EFirmwareType;
4674
+
4675
+ /**
4676
+ * Get Connected Device version by features
4677
+ */
4678
+ declare const getDeviceFirmwareVersion: (features?: DeviceFeaturesInput) => IVersionArray;
4679
+ /**
4680
+ * Get Connected Device bootloader version by features
4681
+ */
4682
+ declare const getDeviceBootloaderVersion: (features?: DeviceFeaturesInput) => IVersionArray;
4683
+ /**
4684
+ * Get Connected Device boardloader/romloader version by features
4685
+ */
4686
+ declare const getDeviceBoardloaderVersion: (features?: DeviceFeaturesInput) => IVersionArray;
4687
+ /**
4688
+ * Get Connected Device bluetooth firmware version by features
4689
+ */
4690
+ declare const getDeviceBLEFirmwareVersion: (features?: DeviceFeaturesInput) => IVersionArray;
4691
+
4692
+ declare const FIRMWARE_FIELDS: readonly ["firmware", "firmware-v1", "firmware-v2", "firmware-v8", "firmware-btc-v8"];
3373
4693
  type IFirmwareField = (typeof FIRMWARE_FIELDS)[number];
3374
- type MessageVersion = 'latest' | 'v1';
4694
+ type ProtocolV1MessageSchema = 'v1CurrentSchema' | 'v1LegacySchema';
4695
+ type ProtobufMessageSchema = ProtocolV1MessageSchema | 'v2Schema';
3375
4696
  declare class DataManager {
3376
- static deviceMap: DeviceTypeMap;
4697
+ static deviceMap: DeviceTypeMap & {
4698
+ [k: string]: DeviceTypeMap[keyof DeviceTypeMap] | undefined;
4699
+ };
3377
4700
  static assets: AssetsMap | null;
3378
4701
  static settings: ConnectSettings;
3379
4702
  static messages: {
3380
- [version in MessageVersion]: JSON;
4703
+ [schema in ProtobufMessageSchema]: JSON;
3381
4704
  };
3382
4705
  static lastCheckTimestamp: number;
3383
4706
  static getFirmwareStatus: (features: Features, firmwareType: EFirmwareType) => IDeviceFirmwareStatus;
4707
+ /**
4708
+ * Touch、Pro System UI Resource Update
4709
+ * ** Interval upgrade is not considered **
4710
+ */
3384
4711
  static getSysResourcesLatestRelease: ({ features, forcedUpdateRes, firmwareType, }: {
3385
4712
  features: Features;
3386
4713
  forcedUpdateRes?: boolean | undefined;
3387
4714
  firmwareType: EFirmwareType;
3388
4715
  }) => string | undefined;
4716
+ /**
4717
+ * Touch、Pro System full UI Resource Update
4718
+ * ** Interval upgrade is not considered **
4719
+ */
3389
4720
  static getSysFullResource: (features: Features, firmwareType: EFirmwareType) => string | undefined;
3390
4721
  static getBootloaderResource: (features: Features, firmwareType: EFirmwareType) => string | undefined;
3391
4722
  static getBootloaderTargetVersion: (features: Features, firmwareType: EFirmwareType) => IVersionArray | undefined;
@@ -3408,23 +4739,34 @@ declare class DataManager {
3408
4739
  } | undefined;
3409
4740
  private static enrichFirmwareReleaseInfo;
3410
4741
  static load(settings: ConnectSettings): Promise<void>;
4742
+ private static applyRemoteConfig;
3411
4743
  static updateEnv(newEnv: ConnectSettings['env']): void;
3412
4744
  static checkAndReloadData(): Promise<void>;
3413
- static getProtobufMessages(messageVersion?: MessageVersion): JSON;
4745
+ static getProtobufMessages(schema?: ProtobufMessageSchema): JSON;
3414
4746
  static getSettings(key?: undefined): ConnectSettings;
3415
4747
  static getSettings<T extends keyof ConnectSettings>(key: T): ConnectSettings[T];
3416
4748
  static isBleConnect: (env: ConnectSettings['env']) => boolean;
4749
+ /** Desktop WebUSB doesn't need browser permission prompt */
3417
4750
  static isDesktopWebUsb: (env: ConnectSettings['env']) => boolean;
4751
+ /** Browser WebUSB needs permission prompt */
3418
4752
  static isBrowserWebUsb: (env: ConnectSettings['env']) => boolean;
3419
4753
  }
3420
4754
 
3421
- declare const supportInputPinOnSoftware: (features: Features) => SupportFeatureType;
4755
+ declare const supportInputPinOnSoftware: (features?: Features) => SupportFeatureType;
4756
+ /**
4757
+ * Since 3.5.0, Touch uses the firmware-v3 field to get firmware release info
4758
+ */
3422
4759
  declare const getFirmwareUpdateField: ({ features, updateType, targetVersion, firmwareType, }: {
3423
4760
  features: Features;
3424
4761
  updateType: 'firmware' | 'ble';
3425
4762
  targetVersion?: string | undefined;
3426
4763
  firmwareType: EFirmwareType;
3427
4764
  }) => 'ble' | IFirmwareField;
4765
+ /**
4766
+ * Returns the optional firmware version
4767
+ * Used in firmware web update
4768
+ * https://firmware.onekey.so/
4769
+ */
3428
4770
  declare const getFirmwareUpdateFieldArray: (features: Features, updateType: 'firmware' | 'ble' | 'bootloader') => ('ble' | IFirmwareField)[];
3429
4771
 
3430
4772
  declare function checkNeedUpdateBootForTouch(features: Features, firmwareType: EFirmwareType): boolean;
@@ -3479,8 +4821,12 @@ declare const getEnv: () => "web" | "webextension" | "electron" | "react-native"
3479
4821
  declare const corsValidator: (url?: string) => string | undefined;
3480
4822
  declare const parseConnectSettings: (input?: Partial<ConnectSettings>) => ConnectSettings;
3481
4823
 
3482
- declare const HardwareSdk: ({ init, call, dispose, eventEmitter, uiResponse, cancel, updateSettings, switchTransport, }: InjectApi) => CoreApi;
3483
- declare const HardwareSDKLowLevel: ({ init, call, dispose, eventEmitter, addHardwareGlobalEventListener, uiResponse, cancel, updateSettings, switchTransport, }: LowLevelInjectApi) => LowLevelCoreApi;
4824
+ declare const registerFirmwareUpdateHostBinding: (binding: FirmwareUpdateHostBinding) => number;
4825
+ declare const unregisterFirmwareUpdateHostBinding: (generation?: number) => boolean;
4826
+ declare const getFirmwareUpdateHostBindingGeneration: () => number;
4827
+
4828
+ declare const HardwareSdk: ({ init, call, dispose, eventEmitter, uiResponse, cancel, cancelOperation, updateSettings, switchTransport, }: InjectApi) => CoreApi;
4829
+ declare const HardwareSDKLowLevel: ({ init, call, dispose, eventEmitter, addHardwareGlobalEventListener, uiResponse, cancel, cancelOperation, updateSettings, switchTransport, }: LowLevelInjectApi) => LowLevelCoreApi;
3484
4830
  declare const HardwareTopLevelSdk: () => CoreApi;
3485
4831
 
3486
- export { AccountAddress, AccountAddresses, AlephiumAddress, AlephiumGetAddressParams, AlephiumSignMessageParams, AlephiumSignTransactionParams, AlephiumSignedTx, AlgoAddress, AlgoGetAddressParams, AlgoSignTransactionParams, AlgoSignedTx, AllFirmwareRelease, AllNetworkAddressParams, AllNetworkGetAddressParams, AptosAddress, AptosGetAddressParams, AptosGetPublicKeyParams, AptosMessageSignature, AptosPublicKey, AptosSignInMessageParams, AptosSignInMessageSignature, AptosSignMessageParams, AptosSignTransactionParams, AptosSignedTx, AssetsMap, BTCAddress, BTCGetAddressParams, BTCGetPublicKeyParams, BTCPublicKey, BTCSignMessageParams, BTCSignTransactionParams, BTCVerifyMessageParams, BenfenAddress, BenfenGetAddressParams, BenfenGetPublicKeyParams, BenfenPublicKey, BenfenSignMessageParams, BenfenSignTransactionParams, BenfenSignedTx, BleReleaseInfoEvent, BleReleaseInfoPayload, CORE_EVENT, CallMethod, CallMethodAnyResponse, CallMethodKeys, CallMethodPayload, CallMethodResponse, CallMethodUnion, CardanoAddress, CardanoGetAddressMethodParams, CardanoGetAddressParams, CardanoSignMessageMethodParams, CardanoSignMessageParams, CardanoSignTransaction, CardanoSignedTxData, CipheredKeyValue, CipheredKeyValueParams, CommonParams, ConfluxAddress, ConfluxGetAddressParams, ConfluxSignMessageCIP23Params, ConfluxSignMessageParams, ConfluxSignTransactionParams, ConfluxSignedTx, ConfluxTransaction, ConnectSettings, Core, CoreApi, CoreMessage, CosmosAddress, CosmosGetAddressParams, CosmosGetPublicKeyParams, CosmosPublicKey, CosmosSignTransactionParams, CosmosSignedTx, DEFAULT_PRIORITY, DEVICE, DEVICE_EVENT, DataManager, Device$1 as Device, DeviceButtonRequest, DeviceButtonRequestPayload, DeviceChangePinParams, DeviceConnnectRequest, DeviceDisconnnectRequest, DeviceEvent, DeviceEventListenerFn, DeviceEventMessage, DeviceFeaturesPayload, DeviceFirmwareRange, DeviceFlagsParams, DeviceModelToTypes, DeviceProgress, DeviceRecoveryParams, DeviceResetParams, DeviceSendFeatures, DeviceSendSupportFeatures, DeviceSettingsParams, DeviceStatus, DeviceSupportFeatures, DeviceSupportFeaturesPayload, DeviceTypeMap, DeviceTypeToModels, DeviceUploadResourceParams, DeviceUploadResourceResponse, DeviceVerifyParams, DeviceVerifySignature, DnxAddress, DnxGetAddressParams, DnxSignTransactionParams, DnxSignature, DnxTxKey, EOneKeyDeviceMode, EVMAccessList, EVMAddress, EVMAuthorization, EVMAuthorizationSignature, EVMGetAddressParams, EVMGetPublicKeyParams, EVMPublicKey, EVMSignMessageEIP712Params, EVMSignMessageParams, EVMSignTransactionParams, EVMSignTypedDataParams, EVMSignedTx, EVMTransaction, EVMTransactionEIP1559, EVMTransactionEIP7702, EVMVerifyMessageParams, EthereumSignTypedDataMessage, EthereumSignTypedDataTypeProperty, EthereumSignTypedDataTypes, FIRMWARE, FIRMWARE_EVENT, Features, FilecoinAddress, FilecoinGetAddressParams, FilecoinSignTransactionParams, FilecoinSignedTx, FirmwareEvent, FirmwareMessage, FirmwareProcessing, FirmwareProgress, FirmwareRange, FirmwareRelease, FirmwareTip, FirmwareUpdateBinaryParams, FirmwareUpdateParams, FirmwareUpdateTipMessage, FirmwareUpdateV3Params, HardwareSDKLowLevel, HardwareTopLevelSdk, IBLEFirmwareReleaseInfo, IDeviceBLEFirmwareStatus, IDeviceFirmwareStatus, IDeviceModel, IDeviceType, IFRAME, IFirmwareField, IFirmwareReleaseInfo, IFirmwareUpdateProgressType, IFirmwareUpdateTipMessage, IFrameBridge, IFrameCallMessage, IFrameCallback, IFrameCallbackMessage, IFrameCancelMessage, IFrameEvent, IFrameEventMessage, IFrameInit, IFrameSwitchTransport, IFrameSwitchTransportMessage, ILocale, ITransportStatus, IVersionArray, IVersionRange, KaspaAddress, KaspaGetAddressParams, KaspaSignInputParams, KaspaSignOutputParams, KaspaSignTransactionParams, KaspaSignature, KnownDevice, LOG, LOG_EVENT, LogBlockEvent, LogEvent, LogEventMessage, LogOutput, LoggerNames, LowLevelCoreApi, LowLevelInjectApi, MajorVersion, MethodResponseMessage, NEMAddress, NEMAggregateModificationTransaction, NEMGetAddressParams, NEMImportanceTransaction, NEMMosaic, NEMMosaicCreationTransaction, NEMMultisigTransaction, NEMProvisionNamespaceTransaction, NEMSignTransactionParams, NEMSupplyChangeTransaction, NEMTransaction, NEMTransferTransaction, NearAddress, NearGetAddressParams, NearSignTransactionParams, NervosAddress, NervosGetAddressParams, NervosSignTransactionParams, NervosSignedTx, NexaAddress, NexaGetAddressParams, NexaSignInputParams, NexaSignOutputParams, NexaSignTransactionParams, NexaSignature, OnekeyFeatures, Params, PassphraseRequestPayload, PolkadotAddress, PolkadotGetAddressParams, PolkadotSignTransactionParams, PolkadotSignedTx, PostMessageEvent, PreviousAddressResult, RESPONSE_EVENT, RefTransaction, ReleaseInfo, ReleaseInfoEvent, ReleaseInfoPayload, RemoteConfigResponse, RequestContext, Response, ScdoAddress, ScdoGetAddressParams, ScdoSignMessageParams, ScdoSignTransactionParams, ScdoSignedTx, SdkTracingContext, SearchDevice, SignedTransaction, SolSignMessageParams, SolSignMessageResponse, SolSignOffchainMessageParams, SolSignOffchainMessageResponse, SolanaAddress, SolanaGetAddressParams, SolanaSignTransactionParams, SolanaSignedTx, StarcoinAddress, StarcoinGetAddressParams, StarcoinGetPublicKeyParams, StarcoinPublicKey, StarcoinSignMessageParams, StarcoinSignTransactionParams, StarcoinVerifyMessageParams, StellarAddress, StellarAsset, StellarGetAddressParams, StellarOperation, StellarSignTransactionParams, StellarTransaction, StrictFeatures, Success, SuiAddress, SuiGetAddressParams, SuiGetPublicKeyParams, SuiPublicKey, SuiSignMessageParams, SuiSignTransactionParams, SuiSignedTx, SupportFeatureType, SupportFeatures, TonAddress, TonGetAddressParams, TonSignDataParams, TonSignMessageParams, TonSignProofParams, TopLevelInjectApi, TransactionOptions, TransportReleaseStatus, TronAddress, TronDelegateResourceContract, TronFreezeBalanceV2Contract, TronGetAddressParams, TronSignMessageParams, TronSignTransactionParams, TronTransaction, TronTransactionContract, TronTransferContract, TronTriggerSmartContract, TronUnDelegateResourceContract, TronUnfreezeBalanceV2Contract, TronWithdrawBalanceContract, TronWithdrawExpireUnfreezeContract, UI_EVENT, UI_REQUEST, UI_RESPONSE, UiEvent, UiEventMessage, UiPromise, UiPromiseResponse, UiRequestButton, UiRequestDeviceAction, UiRequestFirmwareProgressing, UiRequestPassphrase, UiRequestPassphraseOnDevice, UiRequestSelectDeviceForSwitchFirmwareWebDevice, UiRequestSelectDeviceInBootloaderForWebDevice, UiRequestWithoutPayload, UiResponseEvent, UiResponseMessage, UiResponsePassphrase, UiResponsePin, UiResponseSelectDeviceForSwitchFirmwareWebDevice, UiResponseSelectDeviceInBootloaderForWebDevice, UnavailableCapabilities, UnavailableCapability, Unsuccessful, VersionArray, checkNeedUpdateBootForClassicAndMini, checkNeedUpdateBootForTouch, cleanupCallback, cleanupSdkInstance, completeRequestContext, corsValidator, createDeviceMessage, createErrorMessage, createFirmwareMessage, createIFrameMessage, createLogMessage, createRequestContext, createResponseMessage, createSdkTracingContext, createUiMessage, createUiResponse, HardwareSdk as default, enableLog, executeCallback, formatRequestContext, generateInstanceId, generateSdkInstanceId, getActiveRequestsByDeviceInstance, getAutoLockOptions, getAutoShutDownOptions, getDeviceBLEFirmwareVersion, getDeviceBleName, getDeviceBoardloaderVersion, getDeviceBootloaderVersion, getDeviceFirmwareVersion, getDeviceLabel, getDeviceType, getDeviceTypeByBleName, getDeviceUUID, getEnv, getFirmwareType, getFirmwareUpdateField, getFirmwareUpdateFieldArray, getHDPath, getHomeScreenDefaultList, getHomeScreenHex, getHomeScreenSize, getLanguageConfig, getLog, getLogger, getMethodVersionRange, getOutputScriptType, getSDKVersion, getScriptType, getTimeStamp, httpRequest, init as initCore, isBleConnect, isValidVersionArray, isValidVersionString, normalizeVersionArray, parseConnectSettings, parseMessage, patchFeatures, preloadSessionCache, safeThrowError, setLoggerPostMessage, supportInputPinOnSoftware, switchTransport, transportEnv, updateRequestContext, versionCompare, versionSplit, wait, whitelist, whitelistExtension };
4832
+ export { AccountAddress, AccountAddresses, AlephiumAddress, AlephiumGetAddressParams, AlephiumSignMessageParams, AlephiumSignTransactionParams, AlephiumSignedTx, AlgoAddress, AlgoGetAddressParams, AlgoSignTransactionParams, AlgoSignedTx, AllFirmwareRelease, AllNetworkAddressParams, AllNetworkGetAddressParams, AptosAddress, AptosGetAddressParams, AptosGetPublicKeyParams, AptosMessageSignature, AptosPublicKey, AptosSignInMessageParams, AptosSignInMessageSignature, AptosSignMessageParams, AptosSignTransactionParams, AptosSignedTx, AssetsMap, BTCAddress, BTCGetAddressParams, BTCGetPublicKeyParams, BTCPublicKey, BTCSignMessageParams, BTCSignTransactionParams, BTCVerifyMessageParams, BenfenAddress, BenfenGetAddressParams, BenfenGetPublicKeyParams, BenfenPublicKey, BenfenSignMessageParams, BenfenSignTransactionParams, BenfenSignedTx, BleReleaseInfoEvent, BleReleaseInfoPayload, CORE_EVENT, CallMethod, CallMethodAnyResponse, CallMethodKeys, CallMethodPayload, CallMethodResponse, CallMethodUnion, CardanoAddress, CardanoGetAddressMethodParams, CardanoGetAddressParams, CardanoSignMessageMethodParams, CardanoSignMessageParams, CardanoSignTransaction, CardanoSignedTxData, CipheredKeyValue, CipheredKeyValueParams, ClearSessionCacheParams, ClearSessionCachePayload, CommonParams, ConfluxAddress, ConfluxGetAddressParams, ConfluxSignMessageCIP23Params, ConfluxSignMessageParams, ConfluxSignTransactionParams, ConfluxSignedTx, ConfluxTransaction, ConnectSettings, Core, CoreApi, CoreMessage, CosmosAddress, CosmosGetAddressParams, CosmosGetPublicKeyParams, CosmosPublicKey, CosmosSignTransactionParams, CosmosSignedTx, DEFAULT_PRIORITY, DEVICE, DEVICE_EVENT, DataManager, Device$1 as Device, DeviceButtonRequest, DeviceButtonRequestPayload, DeviceChangePinParams, DeviceConnnectRequest, DeviceDisconnnectRequest, DeviceEvent, DeviceEventListenerFn, DeviceEventMessage, DeviceFeaturesMode, DeviceFeaturesPayload, DeviceFeaturesProtocol, DeviceFeaturesRaw, DeviceFeaturesRawPatch, DeviceFeaturesVerify, DeviceFirmwareRange, DeviceFlagsParams, DeviceModelToTypes, DeviceProgress, DeviceRecoveryParams, DeviceResetParams, DeviceSendFeatures, DeviceSendState, DeviceSendSupportFeatures, DeviceSettingsParams, DeviceState, DeviceStateEvent, DeviceStateIdentity, DeviceStateMode, DeviceStatePatch, DeviceStateProtocol, DeviceStateScope, DeviceStateSection, DeviceStateSettings, DeviceStateStatus, DeviceStateUpdateSource, DeviceStateVersions, DeviceStatus, DeviceSupportFeatures, DeviceSupportFeaturesPayload, DeviceTypeMap, DeviceTypeToModels, DeviceUploadResourceParams, DeviceUploadResourceResponse, DeviceVerifyParams, DeviceVerifySignature, DnxAddress, DnxGetAddressParams, DnxSignTransactionParams, DnxSignature, DnxTxKey, EOneKeyDeviceMode, EVMAccessList, EVMAddress, EVMAuthorization, EVMAuthorizationSignature, EVMGetAddressParams, EVMGetPublicKeyParams, EVMPublicKey, EVMSignMessageEIP712Params, EVMSignMessageParams, EVMSignTransactionParams, EVMSignTypedDataParams, EVMSignedTx, EVMTransaction, EVMTransactionEIP1559, EVMTransactionEIP7702, EVMVerifyMessageParams, EthereumSignTypedDataMessage, EthereumSignTypedDataTypeProperty, EthereumSignTypedDataTypes, FIRMWARE, FIRMWARE_EVENT, Features, FilecoinAddress, FilecoinGetAddressParams, FilecoinSignTransactionParams, FilecoinSignedTx, FirmwareArtifactReader, FirmwareArtifactReference, FirmwareCheckpoint, FirmwareCheckpointParams, FirmwareCheckpointSink, FirmwareCheckpointStage, FirmwareEvent, FirmwareMessage, FirmwareProcessing, FirmwareProgress, FirmwareRange, FirmwareRelease, FirmwareTip, FirmwareUpdateArtifactParams, FirmwareUpdateBinaryParams, FirmwareUpdateCapabilities, FirmwareUpdateHostBinding, FirmwareUpdateParams, FirmwareUpdatePlan, FirmwareUpdatePlanArtifact, FirmwareUpdatePlanArtifactRole, FirmwareUpdatePlanEpoch, FirmwareUpdatePlanEpochKind, FirmwareUpdatePlanTarget, FirmwareUpdatePreparedArtifact, FirmwareUpdatePreparedArtifactInput, FirmwareUpdatePreparedEntry, FirmwareUpdatePreparedPlan, FirmwareUpdateTipMessage, FirmwareUpdateV3Params, FirmwareUpdateV4Params, FirmwareUpdateV4Target, GetDeviceStateParams, GetPassphraseStateParams, HardwareSDKLowLevel, HardwareTopLevelSdk, IBLEFirmwareReleaseInfo, IDeviceBLEFirmwareStatus, IDeviceFirmwareStatus, IDeviceModel, IDeviceType, IFRAME, IFirmwareField, IFirmwareReleaseInfo, IFirmwareUpdateProgressType, IFirmwareUpdateTipMessage, IFrameBridge, IFrameCallMessage, IFrameCallback, IFrameCallbackMessage, IFrameCancelMessage, IFrameCancelOperationMessage, IFrameEvent, IFrameEventMessage, IFrameInit, IFrameSwitchTransport, IFrameSwitchTransportMessage, ILocale, IProtocolV2FirmwareComponent, IProtocolV2FirmwareComponentTarget, IProtocolV2ResourceBundle, ITransportStatus, IVersionArray, IVersionRange, KaspaAddress, KaspaGetAddressParams, KaspaSignInputParams, KaspaSignOutputParams, KaspaSignTransactionParams, KaspaSignature, KnownDevice, LOG, LOG_EVENT, LogBlockEvent, LogEvent, LogEventMessage, LogOutput, LoggerNames, LowLevelCoreApi, LowLevelInjectApi, MajorVersion, MethodResponseMessage, NEMAddress, NEMAggregateModificationTransaction, NEMGetAddressParams, NEMImportanceTransaction, NEMMosaic, NEMMosaicCreationTransaction, NEMMultisigTransaction, NEMProvisionNamespaceTransaction, NEMSignTransactionParams, NEMSupplyChangeTransaction, NEMTransaction, NEMTransferTransaction, NearAddress, NearGetAddressParams, NearSignTransactionParams, NervosAddress, NervosGetAddressParams, NervosSignTransactionParams, NervosSignedTx, NexaAddress, NexaGetAddressParams, NexaSignInputParams, NexaSignOutputParams, NexaSignTransactionParams, NexaSignature, NormalizedFeatures, OnekeyFeatures, OpenWalletSessionParams, OpenWalletSessionPayload, PRO2_WALLPAPER_HEIGHT, PRO2_WALLPAPER_WIDTH, Params, PassphraseRequestPayload, PolkadotAddress, PolkadotGetAddressParams, PolkadotSignTransactionParams, PolkadotSignedTx, PostMessageEvent, PreviousAddressResult, Pro2WallpaperColorFormat, ProtocolV2UiCompletion, ProtocolV2UiEventMetadata, ProtocolV2UiEventSource, RESPONSE_EVENT, RefTransaction, ReleaseInfo, ReleaseInfoEvent, ReleaseInfoPayload, RemoteConfigResponse, RequestContext, Response, ScdoAddress, ScdoGetAddressParams, ScdoSignMessageParams, ScdoSignTransactionParams, ScdoSignedTx, SdkTracingContext, SearchDevice, SignedTransaction, SolSignMessageParams, SolSignMessageResponse, SolSignOffchainMessageParams, SolSignOffchainMessageResponse, SolanaAddress, SolanaGetAddressParams, SolanaSignTransactionParams, SolanaSignedTx, StarcoinAddress, StarcoinGetAddressParams, StarcoinGetPublicKeyParams, StarcoinPublicKey, StarcoinSignMessageParams, StarcoinSignTransactionParams, StarcoinVerifyMessageParams, StellarAddress, StellarAsset, StellarGetAddressParams, StellarOperation, StellarSignTransactionParams, StellarTransaction, StrictFeatures, Success, SuiAddress, SuiGetAddressParams, SuiGetPublicKeyParams, SuiPublicKey, SuiSignMessageParams, SuiSignTransactionParams, SuiSignedTx, SupportFeatureType, SupportFeatures, TonAddress, TonGetAddressParams, TonSignDataParams, TonSignMessageParams, TonSignProofParams, TopLevelInjectApi, TransactionOptions, TransportReleaseStatus, TronAddress, TronDelegateResourceContract, TronFreezeBalanceV2Contract, TronGetAddressParams, TronSignMessageParams, TronSignTransactionParams, TronTransaction, TronTransactionContract, TronTransferContract, TronTriggerSmartContract, TronUnDelegateResourceContract, TronUnfreezeBalanceV2Contract, TronWithdrawBalanceContract, TronWithdrawExpireUnfreezeContract, UI_EVENT, UI_REQUEST, UI_RESPONSE, UiEvent, UiEventMessage, UiPromise, UiPromiseResponse, UiRequestButton, UiRequestDeviceAction, UiRequestFirmwareProgressing, UiRequestPassphrase, UiRequestPassphraseOnDevice, UiRequestSelectDeviceForSwitchFirmwareWebDevice, UiRequestSelectDeviceInBootloaderForWebDevice, UiRequestWithoutPayload, UiResponseEvent, UiResponseMessage, UiResponsePassphrase, UiResponsePin, UiResponseSelectDeviceForSwitchFirmwareWebDevice, UiResponseSelectDeviceInBootloaderForWebDevice, UnavailableCapabilities, UnavailableCapability, Unsuccessful, VersionArray, checkNeedUpdateBootForClassicAndMini, checkNeedUpdateBootForTouch, cleanupCallback, cleanupSdkInstance, completeRequestContext, corsValidator, createDeviceMessage, createErrorMessage, createFirmwareMessage, createIFrameMessage, createLogMessage, createRequestContext, createResponseMessage, createSdkTracingContext, createUiMessage, createUiResponse, HardwareSdk as default, enableLog, encodePro2Wallpaper, executeCallback, formatRequestContext, generateInstanceId, generateSdkInstanceId, getActiveRequestsByDeviceInstance, getAutoLockOptions, getAutoShutDownOptions, getDeviceBLEFirmwareVersion, getDeviceBleName, getDeviceBoardloaderVersion, getDeviceBootloaderVersion, getDeviceFirmwareVersion, getDeviceLabel, getDeviceSerialNo, getDeviceType, getDeviceTypeByBleName, getDeviceUUID, getEnv, getFirmwareType, getFirmwareUpdateField, getFirmwareUpdateFieldArray, getFirmwareUpdateHostBindingGeneration, getHDPath, getHomeScreenDefaultList, getHomeScreenHex, getHomeScreenSize, getLanguageConfig, getLog, getLogBlockLabel, getLogger, getMethodVersionRange, getOutputScriptType, getSDKVersion, getScriptType, getTimeStamp, httpRequest, init$1 as initCore, isBleConnect, isMethodVersionRangeUnsupported, isValidVersionArray, isValidVersionString, normalizeVersionArray, parseConnectSettings, parseMessage, patchFeatures, preloadSessionCache, registerFirmwareUpdateHostBinding, safeThrowError, setLoggerPostMessage, supportInputPinOnSoftware, switchTransport, transportEnv, unregisterFirmwareUpdateHostBinding, updateRequestContext, versionCompare, versionSplit, wait, whitelist, whitelistExtension };