@onekeyfe/hd-core 1.2.0-alpha.15 → 1.2.0-alpha.151

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 (851) hide show
  1. package/__tests__/AllNetworkGetAddressBase.tracing.test.ts +390 -0
  2. package/__tests__/DeviceCommands.test.ts +654 -0
  3. package/__tests__/DeviceEventRegistration.test.ts +17 -3
  4. package/__tests__/base64Data.test.ts +69 -0
  5. package/__tests__/chain-params-onekey-compatibility.test.ts +229 -0
  6. package/__tests__/check-all-firmware-release-protocol-v2.test.ts +878 -0
  7. package/__tests__/check-firmware-release-protocol-v2.test.ts +270 -0
  8. package/__tests__/connectSettings.test.ts +45 -5
  9. package/__tests__/core-dispose.test.ts +34 -0
  10. package/__tests__/core-error-output.test.ts +39 -0
  11. package/__tests__/core-initialization.test.ts +23 -0
  12. package/__tests__/device-connector-protocol.test.ts +102 -0
  13. package/__tests__/device-features-state.test.ts +78 -0
  14. package/__tests__/device-identity.test.ts +52 -0
  15. package/__tests__/device-initialize-timeout.test.ts +56 -0
  16. package/__tests__/device-lifecycle-events.test.ts +752 -0
  17. package/__tests__/device-pool-state.test.ts +191 -0
  18. package/__tests__/device-settings.test.ts +665 -0
  19. package/__tests__/device-state-contract.test.ts +28 -0
  20. package/__tests__/device-state-events.test.ts +286 -0
  21. package/__tests__/device-state-mapper.test.ts +335 -0
  22. package/__tests__/device-state-projector.test.ts +114 -0
  23. package/__tests__/device-state-store.test.ts +109 -0
  24. package/__tests__/device-utils.test.ts +162 -0
  25. package/__tests__/device-wallet-session-store.test.ts +474 -1
  26. package/__tests__/deviceFeaturesUtils.test.ts +39 -0
  27. package/__tests__/devicePoolBootloaderPath.test.ts +64 -0
  28. package/__tests__/deviceSettings.test.ts +117 -0
  29. package/__tests__/deviceUploadNft.test.ts +348 -0
  30. package/__tests__/evmLedgerLegacySafety.test.ts +12 -6
  31. package/__tests__/evmSignTransaction.test.ts +69 -0
  32. package/__tests__/evmSignTypedData.test.ts +80 -0
  33. package/__tests__/filesystemValidation.test.ts +53 -0
  34. package/__tests__/firmware-memory-host.test.ts +126 -0
  35. package/__tests__/firmware-update/check-all-firmware-release.test.ts +175 -0
  36. package/__tests__/firmware-update/device-update-bootloader.test.ts +109 -0
  37. package/__tests__/firmware-update/firmware-artifact-source.test.ts +171 -0
  38. package/__tests__/firmware-update/firmware-host-binding.test.ts +79 -0
  39. package/__tests__/firmware-update/firmware-preparation-error.test.ts +27 -0
  40. package/__tests__/firmware-update/firmware-prepared-host-digest.test.ts +583 -0
  41. package/__tests__/firmware-update/firmware-prepared-resource-archive.test.ts +171 -0
  42. package/__tests__/firmware-update/firmware-update-bootloader-poll.test.ts +438 -0
  43. package/__tests__/firmware-update/firmware-update-capabilities.test.ts +13 -0
  44. package/__tests__/firmware-update/firmware-update-plan-bootloader-identity.test.ts +474 -0
  45. package/__tests__/firmware-update/firmware-update-plan.test.ts +819 -0
  46. package/__tests__/firmware-update/firmware-update-prepared-plan.test.ts +287 -0
  47. package/__tests__/firmware-update/firmware-update-prepared-resource-executors.test.ts +326 -0
  48. package/__tests__/firmware-update/firmware-update-v2-download-before-boot.test.ts +457 -0
  49. package/__tests__/firmware-update/firmware-update-v3-reconnect.test.ts +237 -0
  50. package/__tests__/firmware-update/firmware-update-v4-install-poll.test.ts +166 -0
  51. package/__tests__/firmware-update/firmware-update-v4-parameters.test.ts +85 -0
  52. package/__tests__/firmware-update/firmware-upload-source.test.ts +70 -0
  53. package/__tests__/get-device-state.test.ts +617 -0
  54. package/__tests__/homescreen.test.ts +81 -0
  55. package/__tests__/kaspa-public-types.type-test.ts +16 -0
  56. package/__tests__/kaspa-use-tweak-pro2.test.ts +20 -0
  57. package/__tests__/kaspaSignTransaction.test.ts +578 -0
  58. package/__tests__/known-device-public-types.type-test.ts +3 -0
  59. package/__tests__/logBlockEvent.test.ts +140 -1
  60. package/__tests__/method-protocol-support.test.ts +144 -0
  61. package/__tests__/networkUtils.test.ts +406 -0
  62. package/__tests__/open-wallet-session-error-response.test.ts +43 -0
  63. package/__tests__/open-wallet-session.test.ts +1899 -0
  64. package/__tests__/pro2Nft.test.ts +108 -0
  65. package/__tests__/pro2Wallpaper.test.ts +8 -19
  66. package/__tests__/protocol-binding.test.ts +89 -0
  67. package/__tests__/protocol-v2-firmware-targets.test.ts +105 -0
  68. package/__tests__/protocol-v2-ping.test.ts +28 -0
  69. package/__tests__/protocol-v2-resources.test.ts +331 -0
  70. package/__tests__/protocol-v2-ui-lifecycle.test.ts +91 -0
  71. package/__tests__/protocol-v2-unlock-policy.test.ts +507 -0
  72. package/__tests__/protocol-v2.test.ts +7405 -1680
  73. package/__tests__/protocolV2FileWrite.test.ts +221 -3
  74. package/__tests__/protocolV2UiInteraction.test.ts +329 -0
  75. package/__tests__/public-device-state-api.test.ts +275 -0
  76. package/__tests__/public-pro2-api-boundary.test.ts +107 -0
  77. package/__tests__/refresh-device-state.test.ts +103 -0
  78. package/__tests__/request-context-logging.test.ts +16 -0
  79. package/__tests__/resourceBase64Boundary.test.ts +48 -0
  80. package/__tests__/search-devices.test.ts +191 -0
  81. package/__tests__/ton-sign-message.test.ts +84 -0
  82. package/__tests__/tron-sign-message-init.test.ts +74 -0
  83. package/__tests__/uiProgressThrottle.test.ts +74 -0
  84. package/__tests__/uiPromiseRegistry.test.ts +115 -0
  85. package/dist/api/BaseMethod.d.ts +14 -2
  86. package/dist/api/BaseMethod.d.ts.map +1 -1
  87. package/dist/api/CheckAllFirmwareRelease.d.ts +25 -1
  88. package/dist/api/CheckAllFirmwareRelease.d.ts.map +1 -1
  89. package/dist/api/CheckBLEFirmwareRelease.d.ts +3 -2
  90. package/dist/api/CheckBLEFirmwareRelease.d.ts.map +1 -1
  91. package/dist/api/CheckBootloaderRelease.d.ts +2 -1
  92. package/dist/api/CheckBootloaderRelease.d.ts.map +1 -1
  93. package/dist/api/CheckFirmwareRelease.d.ts +3 -2
  94. package/dist/api/CheckFirmwareRelease.d.ts.map +1 -1
  95. package/dist/api/CipherKeyValue.d.ts +1 -0
  96. package/dist/api/CipherKeyValue.d.ts.map +1 -1
  97. package/dist/api/ClearSessionCache.d.ts.map +1 -1
  98. package/dist/api/DetectDeviceConnectProtocol.d.ts +7 -0
  99. package/dist/api/DetectDeviceConnectProtocol.d.ts.map +1 -0
  100. package/dist/api/DirList.d.ts +1 -0
  101. package/dist/api/DirList.d.ts.map +1 -1
  102. package/dist/api/DirMake.d.ts +1 -0
  103. package/dist/api/DirMake.d.ts.map +1 -1
  104. package/dist/api/DirRemove.d.ts +1 -0
  105. package/dist/api/DirRemove.d.ts.map +1 -1
  106. package/dist/api/FileDelete.d.ts +1 -0
  107. package/dist/api/FileDelete.d.ts.map +1 -1
  108. package/dist/api/FileRead.d.ts +1 -0
  109. package/dist/api/FileRead.d.ts.map +1 -1
  110. package/dist/api/FileWrite.d.ts +1 -0
  111. package/dist/api/FileWrite.d.ts.map +1 -1
  112. package/dist/api/FirmwareUpdate.d.ts.map +1 -1
  113. package/dist/api/FirmwareUpdateV2.d.ts +13 -2
  114. package/dist/api/FirmwareUpdateV2.d.ts.map +1 -1
  115. package/dist/api/FirmwareUpdateV3.d.ts +7 -3
  116. package/dist/api/FirmwareUpdateV3.d.ts.map +1 -1
  117. package/dist/api/FirmwareUpdateV4.d.ts +60 -14
  118. package/dist/api/FirmwareUpdateV4.d.ts.map +1 -1
  119. package/dist/api/GetDeviceState.d.ts +8 -0
  120. package/dist/api/GetDeviceState.d.ts.map +1 -0
  121. package/dist/api/GetFeatures.d.ts +1 -1
  122. package/dist/api/GetFeatures.d.ts.map +1 -1
  123. package/dist/api/GetOnekeyFeatures.d.ts.map +1 -1
  124. package/dist/api/GetPassphraseState.d.ts +1 -0
  125. package/dist/api/GetPassphraseState.d.ts.map +1 -1
  126. package/dist/api/OpenWalletSession.d.ts +8 -0
  127. package/dist/api/OpenWalletSession.d.ts.map +1 -0
  128. package/dist/api/PathInfo.d.ts +1 -0
  129. package/dist/api/PathInfo.d.ts.map +1 -1
  130. package/dist/api/PromptWebDeviceAccess.d.ts.map +1 -1
  131. package/dist/api/SearchDevices.d.ts +3 -0
  132. package/dist/api/SearchDevices.d.ts.map +1 -1
  133. package/dist/api/UploadPortfolio.d.ts +1 -2
  134. package/dist/api/UploadPortfolio.d.ts.map +1 -1
  135. package/dist/api/alephium/AlephiumGetAddress.d.ts.map +1 -1
  136. package/dist/api/alephium/AlephiumSignMessage.d.ts.map +1 -1
  137. package/dist/api/alephium/AlephiumSignTransaction.d.ts.map +1 -1
  138. package/dist/api/algo/AlgoGetAddress.d.ts +1 -0
  139. package/dist/api/algo/AlgoGetAddress.d.ts.map +1 -1
  140. package/dist/api/algo/AlgoSignTransaction.d.ts +1 -0
  141. package/dist/api/algo/AlgoSignTransaction.d.ts.map +1 -1
  142. package/dist/api/allnetwork/AllNetworkGetAddressBase.d.ts +1 -0
  143. package/dist/api/allnetwork/AllNetworkGetAddressBase.d.ts.map +1 -1
  144. package/dist/api/aptos/AptosGetAddress.d.ts +1 -0
  145. package/dist/api/aptos/AptosGetAddress.d.ts.map +1 -1
  146. package/dist/api/aptos/AptosGetPublicKey.d.ts +1 -0
  147. package/dist/api/aptos/AptosGetPublicKey.d.ts.map +1 -1
  148. package/dist/api/aptos/AptosSignInMessage.d.ts +1 -0
  149. package/dist/api/aptos/AptosSignInMessage.d.ts.map +1 -1
  150. package/dist/api/aptos/AptosSignMessage.d.ts +1 -0
  151. package/dist/api/aptos/AptosSignMessage.d.ts.map +1 -1
  152. package/dist/api/aptos/AptosSignTransaction.d.ts +1 -0
  153. package/dist/api/aptos/AptosSignTransaction.d.ts.map +1 -1
  154. package/dist/api/benfen/BenfenGetAddress.d.ts.map +1 -1
  155. package/dist/api/benfen/BenfenGetPublicKey.d.ts.map +1 -1
  156. package/dist/api/benfen/BenfenSignMessage.d.ts.map +1 -1
  157. package/dist/api/benfen/BenfenSignTransaction.d.ts.map +1 -1
  158. package/dist/api/btc/BTCGetAddress.d.ts +1 -0
  159. package/dist/api/btc/BTCGetAddress.d.ts.map +1 -1
  160. package/dist/api/btc/BTCGetPublicKey.d.ts +1 -0
  161. package/dist/api/btc/BTCGetPublicKey.d.ts.map +1 -1
  162. package/dist/api/btc/BTCSignMessage.d.ts +1 -0
  163. package/dist/api/btc/BTCSignMessage.d.ts.map +1 -1
  164. package/dist/api/btc/BTCSignPsbt.d.ts +1 -0
  165. package/dist/api/btc/BTCSignPsbt.d.ts.map +1 -1
  166. package/dist/api/btc/BTCSignTransaction.d.ts +1 -0
  167. package/dist/api/btc/BTCSignTransaction.d.ts.map +1 -1
  168. package/dist/api/btc/BTCVerifyMessage.d.ts +1 -0
  169. package/dist/api/btc/BTCVerifyMessage.d.ts.map +1 -1
  170. package/dist/api/btc/helpers/versionLimit.d.ts +2 -0
  171. package/dist/api/btc/helpers/versionLimit.d.ts.map +1 -1
  172. package/dist/api/cardano/CardanoGetAddress.d.ts +1 -0
  173. package/dist/api/cardano/CardanoGetAddress.d.ts.map +1 -1
  174. package/dist/api/cardano/CardanoGetPublicKey.d.ts +1 -0
  175. package/dist/api/cardano/CardanoGetPublicKey.d.ts.map +1 -1
  176. package/dist/api/cardano/CardanoSignMessage.d.ts +1 -0
  177. package/dist/api/cardano/CardanoSignMessage.d.ts.map +1 -1
  178. package/dist/api/cardano/CardanoSignTransaction.d.ts +1 -0
  179. package/dist/api/cardano/CardanoSignTransaction.d.ts.map +1 -1
  180. package/dist/api/conflux/ConfluxGetAddress.d.ts +2 -0
  181. package/dist/api/conflux/ConfluxGetAddress.d.ts.map +1 -1
  182. package/dist/api/conflux/ConfluxSignMessage.d.ts +2 -0
  183. package/dist/api/conflux/ConfluxSignMessage.d.ts.map +1 -1
  184. package/dist/api/conflux/ConfluxSignMessageCIP23.d.ts +2 -0
  185. package/dist/api/conflux/ConfluxSignMessageCIP23.d.ts.map +1 -1
  186. package/dist/api/conflux/ConfluxSignTransaction.d.ts +2 -0
  187. package/dist/api/conflux/ConfluxSignTransaction.d.ts.map +1 -1
  188. package/dist/api/cosmos/CosmosGetAddress.d.ts +1 -0
  189. package/dist/api/cosmos/CosmosGetAddress.d.ts.map +1 -1
  190. package/dist/api/cosmos/CosmosGetPublicKey.d.ts +1 -0
  191. package/dist/api/cosmos/CosmosGetPublicKey.d.ts.map +1 -1
  192. package/dist/api/cosmos/CosmosSignTransaction.d.ts +1 -0
  193. package/dist/api/cosmos/CosmosSignTransaction.d.ts.map +1 -1
  194. package/dist/api/device/DeviceCancel.d.ts +1 -0
  195. package/dist/api/device/DeviceCancel.d.ts.map +1 -1
  196. package/dist/api/device/DeviceChangePin.d.ts +1 -0
  197. package/dist/api/device/DeviceChangePin.d.ts.map +1 -1
  198. package/dist/api/device/DeviceFullyUploadResource.d.ts +1 -2
  199. package/dist/api/device/DeviceFullyUploadResource.d.ts.map +1 -1
  200. package/dist/api/device/DeviceLock.d.ts +1 -0
  201. package/dist/api/device/DeviceLock.d.ts.map +1 -1
  202. package/dist/api/device/DeviceRebootToBoardloader.d.ts +1 -0
  203. package/dist/api/device/DeviceRebootToBoardloader.d.ts.map +1 -1
  204. package/dist/api/device/DeviceRebootToBootloader.d.ts +1 -0
  205. package/dist/api/device/DeviceRebootToBootloader.d.ts.map +1 -1
  206. package/dist/api/device/DeviceSettings.d.ts +1 -0
  207. package/dist/api/device/DeviceSettings.d.ts.map +1 -1
  208. package/dist/api/device/DeviceSupportFeatures.d.ts +1 -0
  209. package/dist/api/device/DeviceSupportFeatures.d.ts.map +1 -1
  210. package/dist/api/device/DeviceUnlock.d.ts +3 -2
  211. package/dist/api/device/DeviceUnlock.d.ts.map +1 -1
  212. package/dist/api/device/DeviceUpdateBootloader.d.ts +5 -1
  213. package/dist/api/device/DeviceUpdateBootloader.d.ts.map +1 -1
  214. package/dist/api/device/DeviceVerify.d.ts +1 -0
  215. package/dist/api/device/DeviceVerify.d.ts.map +1 -1
  216. package/dist/api/device/DeviceWipe.d.ts +1 -0
  217. package/dist/api/device/DeviceWipe.d.ts.map +1 -1
  218. package/dist/api/device/PreInitialize.d.ts +1 -0
  219. package/dist/api/device/PreInitialize.d.ts.map +1 -1
  220. package/dist/api/dynex/DnxGetAddress.d.ts.map +1 -1
  221. package/dist/api/dynex/DnxSignTransaction.d.ts.map +1 -1
  222. package/dist/api/evm/EVMGetAddress.d.ts +1 -0
  223. package/dist/api/evm/EVMGetAddress.d.ts.map +1 -1
  224. package/dist/api/evm/EVMGetPublicKey.d.ts +1 -0
  225. package/dist/api/evm/EVMGetPublicKey.d.ts.map +1 -1
  226. package/dist/api/evm/EVMSignMessage.d.ts +1 -0
  227. package/dist/api/evm/EVMSignMessage.d.ts.map +1 -1
  228. package/dist/api/evm/EVMSignMessageEIP712.d.ts.map +1 -1
  229. package/dist/api/evm/EVMSignTransaction.d.ts +1 -0
  230. package/dist/api/evm/EVMSignTransaction.d.ts.map +1 -1
  231. package/dist/api/evm/EVMSignTypedData.d.ts +1 -0
  232. package/dist/api/evm/EVMSignTypedData.d.ts.map +1 -1
  233. package/dist/api/evm/EVMVerifyMessage.d.ts +1 -0
  234. package/dist/api/evm/EVMVerifyMessage.d.ts.map +1 -1
  235. package/dist/api/evm/protocol.d.ts +3 -0
  236. package/dist/api/evm/protocol.d.ts.map +1 -0
  237. package/dist/api/filecoin/FilecoinGetAddress.d.ts +1 -0
  238. package/dist/api/filecoin/FilecoinGetAddress.d.ts.map +1 -1
  239. package/dist/api/filecoin/FilecoinSignTransaction.d.ts +1 -0
  240. package/dist/api/filecoin/FilecoinSignTransaction.d.ts.map +1 -1
  241. package/dist/api/firmware/FirmwareArtifactSource.d.ts +29 -0
  242. package/dist/api/firmware/FirmwareArtifactSource.d.ts.map +1 -0
  243. package/dist/api/firmware/FirmwareHostBinding.d.ts +6 -0
  244. package/dist/api/firmware/FirmwareHostBinding.d.ts.map +1 -0
  245. package/dist/api/firmware/FirmwareMemoryHost.d.ts +22 -0
  246. package/dist/api/firmware/FirmwareMemoryHost.d.ts.map +1 -0
  247. package/dist/api/firmware/FirmwarePreparationError.d.ts +3 -0
  248. package/dist/api/firmware/FirmwarePreparationError.d.ts.map +1 -0
  249. package/dist/api/firmware/FirmwarePreparedResourceArchive.d.ts +11 -0
  250. package/dist/api/firmware/FirmwarePreparedResourceArchive.d.ts.map +1 -0
  251. package/dist/api/firmware/FirmwareUpdateBaseMethod.d.ts +12 -3
  252. package/dist/api/firmware/FirmwareUpdateBaseMethod.d.ts.map +1 -1
  253. package/dist/api/firmware/FirmwareUpdateCapabilities.d.ts +3 -0
  254. package/dist/api/firmware/FirmwareUpdateCapabilities.d.ts.map +1 -0
  255. package/dist/api/firmware/FirmwareUpdatePlan.d.ts +72 -0
  256. package/dist/api/firmware/FirmwareUpdatePlan.d.ts.map +1 -0
  257. package/dist/api/firmware/FirmwareUpdatePreparedPlan.d.ts +38 -0
  258. package/dist/api/firmware/FirmwareUpdatePreparedPlan.d.ts.map +1 -0
  259. package/dist/api/firmware/getBinary.d.ts +15 -4
  260. package/dist/api/firmware/getBinary.d.ts.map +1 -1
  261. package/dist/api/firmware/protocolV2Release.d.ts +33 -0
  262. package/dist/api/firmware/protocolV2Release.d.ts.map +1 -0
  263. package/dist/api/firmware/updateBootloader.d.ts +2 -0
  264. package/dist/api/firmware/updateBootloader.d.ts.map +1 -1
  265. package/dist/api/firmware/uploadFirmware.d.ts +9 -1
  266. package/dist/api/firmware/uploadFirmware.d.ts.map +1 -1
  267. package/dist/api/helpers/base64Data.d.ts +16 -0
  268. package/dist/api/helpers/base64Data.d.ts.map +1 -0
  269. package/dist/api/helpers/filesystemValidation.d.ts +3 -0
  270. package/dist/api/helpers/filesystemValidation.d.ts.map +1 -1
  271. package/dist/api/helpers/paramsValidator.d.ts +1 -0
  272. package/dist/api/helpers/paramsValidator.d.ts.map +1 -1
  273. package/dist/api/helpers/protocolV2FileWrite.d.ts +11 -0
  274. package/dist/api/helpers/protocolV2FileWrite.d.ts.map +1 -1
  275. package/dist/api/index.d.ts +5 -29
  276. package/dist/api/index.d.ts.map +1 -1
  277. package/dist/api/kaspa/KaspaGetAddress.d.ts +4 -0
  278. package/dist/api/kaspa/KaspaGetAddress.d.ts.map +1 -1
  279. package/dist/api/kaspa/KaspaSignTransaction.d.ts +9 -1
  280. package/dist/api/kaspa/KaspaSignTransaction.d.ts.map +1 -1
  281. package/dist/api/kaspa/helpers/TransferSerialize.d.ts.map +1 -1
  282. package/dist/api/lightning/LnurlAuth.d.ts +0 -4
  283. package/dist/api/lightning/LnurlAuth.d.ts.map +1 -1
  284. package/dist/api/near/NearGetAddress.d.ts +1 -0
  285. package/dist/api/near/NearGetAddress.d.ts.map +1 -1
  286. package/dist/api/near/NearSignTransaction.d.ts +1 -0
  287. package/dist/api/near/NearSignTransaction.d.ts.map +1 -1
  288. package/dist/api/nem/NEMGetAddress.d.ts +1 -0
  289. package/dist/api/nem/NEMGetAddress.d.ts.map +1 -1
  290. package/dist/api/nem/NEMSignTransaction.d.ts +1 -0
  291. package/dist/api/nem/NEMSignTransaction.d.ts.map +1 -1
  292. package/dist/api/neo/NeoGetAddress.d.ts.map +1 -1
  293. package/dist/api/neo/NeoSignTransaction.d.ts.map +1 -1
  294. package/dist/api/nervos/NervosGetAddress.d.ts.map +1 -1
  295. package/dist/api/nervos/NervosSignTransaction.d.ts.map +1 -1
  296. package/dist/api/nexa/NexaGetAddress.d.ts.map +1 -1
  297. package/dist/api/nexa/NexaSignTransaction.d.ts +1 -0
  298. package/dist/api/nexa/NexaSignTransaction.d.ts.map +1 -1
  299. package/dist/api/nostr/NostrDecryptMessage.d.ts +1 -0
  300. package/dist/api/nostr/NostrDecryptMessage.d.ts.map +1 -1
  301. package/dist/api/nostr/NostrEncryptMessage.d.ts +1 -0
  302. package/dist/api/nostr/NostrEncryptMessage.d.ts.map +1 -1
  303. package/dist/api/nostr/NostrGetPublicKey.d.ts +1 -0
  304. package/dist/api/nostr/NostrGetPublicKey.d.ts.map +1 -1
  305. package/dist/api/nostr/NostrSignEvent.d.ts +1 -0
  306. package/dist/api/nostr/NostrSignEvent.d.ts.map +1 -1
  307. package/dist/api/nostr/NostrSignSchnorr.d.ts +1 -0
  308. package/dist/api/nostr/NostrSignSchnorr.d.ts.map +1 -1
  309. package/dist/api/polkadot/PolkadotGetAddress.d.ts +2 -1
  310. package/dist/api/polkadot/PolkadotGetAddress.d.ts.map +1 -1
  311. package/dist/api/polkadot/PolkadotSignTransaction.d.ts +1 -0
  312. package/dist/api/polkadot/PolkadotSignTransaction.d.ts.map +1 -1
  313. package/dist/api/polkadot/networks.d.ts +1 -1
  314. package/dist/api/protocol-v2/DeviceFactoryInfoGet.d.ts +1 -0
  315. package/dist/api/protocol-v2/DeviceFactoryInfoGet.d.ts.map +1 -1
  316. package/dist/api/protocol-v2/DeviceFactoryInfoSet.d.ts +1 -0
  317. package/dist/api/protocol-v2/DeviceFactoryInfoSet.d.ts.map +1 -1
  318. package/dist/api/protocol-v2/DeviceFirmwareUpdate.d.ts +4 -1
  319. package/dist/api/protocol-v2/DeviceFirmwareUpdate.d.ts.map +1 -1
  320. package/dist/api/protocol-v2/DeviceGetFirmwareUpdateStatus.d.ts +1 -0
  321. package/dist/api/protocol-v2/DeviceGetFirmwareUpdateStatus.d.ts.map +1 -1
  322. package/dist/api/protocol-v2/DeviceGetOnboardingStatus.d.ts +2 -1
  323. package/dist/api/protocol-v2/DeviceGetOnboardingStatus.d.ts.map +1 -1
  324. package/dist/api/protocol-v2/DeviceInfoGet.d.ts +2 -2
  325. package/dist/api/protocol-v2/DeviceInfoGet.d.ts.map +1 -1
  326. package/dist/api/protocol-v2/DeviceReboot.d.ts +2 -1
  327. package/dist/api/protocol-v2/DeviceReboot.d.ts.map +1 -1
  328. package/dist/api/protocol-v2/DeviceStatusGet.d.ts +1 -0
  329. package/dist/api/protocol-v2/DeviceStatusGet.d.ts.map +1 -1
  330. package/dist/api/protocol-v2/DeviceUploadNft.d.ts +30 -0
  331. package/dist/api/protocol-v2/DeviceUploadNft.d.ts.map +1 -0
  332. package/dist/api/protocol-v2/DeviceUploadWallpaper.d.ts +3 -3
  333. package/dist/api/protocol-v2/DeviceUploadWallpaper.d.ts.map +1 -1
  334. package/dist/api/protocol-v2/FilesystemFormat.d.ts +1 -0
  335. package/dist/api/protocol-v2/FilesystemFormat.d.ts.map +1 -1
  336. package/dist/api/protocol-v2/FilesystemPermissionFix.d.ts +1 -0
  337. package/dist/api/protocol-v2/FilesystemPermissionFix.d.ts.map +1 -1
  338. package/dist/api/protocol-v2/Ping.d.ts +3 -0
  339. package/dist/api/protocol-v2/Ping.d.ts.map +1 -1
  340. package/dist/api/protocol-v2/ProtocolInfoRequest.d.ts +1 -0
  341. package/dist/api/protocol-v2/ProtocolInfoRequest.d.ts.map +1 -1
  342. package/dist/api/protocol-v2/helpers.d.ts.map +1 -1
  343. package/dist/api/scdo/ScdoGetAddress.d.ts.map +1 -1
  344. package/dist/api/scdo/ScdoSignMessage.d.ts.map +1 -1
  345. package/dist/api/scdo/ScdoSignTransaction.d.ts.map +1 -1
  346. package/dist/api/solana/SolGetAddress.d.ts +1 -0
  347. package/dist/api/solana/SolGetAddress.d.ts.map +1 -1
  348. package/dist/api/solana/SolSignMessage.d.ts +2 -1
  349. package/dist/api/solana/SolSignMessage.d.ts.map +1 -1
  350. package/dist/api/solana/SolSignOffchainMessage.d.ts +2 -1
  351. package/dist/api/solana/SolSignOffchainMessage.d.ts.map +1 -1
  352. package/dist/api/solana/SolSignTransaction.d.ts +3 -2
  353. package/dist/api/solana/SolSignTransaction.d.ts.map +1 -1
  354. package/dist/api/starcoin/StarcoinGetAddress.d.ts +1 -0
  355. package/dist/api/starcoin/StarcoinGetAddress.d.ts.map +1 -1
  356. package/dist/api/starcoin/StarcoinGetPublicKey.d.ts +1 -0
  357. package/dist/api/starcoin/StarcoinGetPublicKey.d.ts.map +1 -1
  358. package/dist/api/starcoin/StarcoinSignMessage.d.ts +1 -0
  359. package/dist/api/starcoin/StarcoinSignMessage.d.ts.map +1 -1
  360. package/dist/api/starcoin/StarcoinSignTransaction.d.ts +1 -0
  361. package/dist/api/starcoin/StarcoinSignTransaction.d.ts.map +1 -1
  362. package/dist/api/starcoin/StarcoinVerifyMessage.d.ts +1 -0
  363. package/dist/api/starcoin/StarcoinVerifyMessage.d.ts.map +1 -1
  364. package/dist/api/stellar/StellarGetAddress.d.ts +1 -2
  365. package/dist/api/stellar/StellarGetAddress.d.ts.map +1 -1
  366. package/dist/api/stellar/StellarSignTransaction.d.ts +2 -3
  367. package/dist/api/stellar/StellarSignTransaction.d.ts.map +1 -1
  368. package/dist/api/sui/SuiGetAddress.d.ts +2 -1
  369. package/dist/api/sui/SuiGetAddress.d.ts.map +1 -1
  370. package/dist/api/sui/SuiGetPublicKey.d.ts +2 -1
  371. package/dist/api/sui/SuiGetPublicKey.d.ts.map +1 -1
  372. package/dist/api/sui/SuiSignMessage.d.ts +2 -1
  373. package/dist/api/sui/SuiSignMessage.d.ts.map +1 -1
  374. package/dist/api/sui/SuiSignTransaction.d.ts +2 -1
  375. package/dist/api/sui/SuiSignTransaction.d.ts.map +1 -1
  376. package/dist/api/ton/TonGetAddress.d.ts +2 -1
  377. package/dist/api/ton/TonGetAddress.d.ts.map +1 -1
  378. package/dist/api/ton/TonSignData.d.ts +1 -0
  379. package/dist/api/ton/TonSignData.d.ts.map +1 -1
  380. package/dist/api/ton/TonSignMessage.d.ts +2 -1
  381. package/dist/api/ton/TonSignMessage.d.ts.map +1 -1
  382. package/dist/api/ton/TonSignProof.d.ts +2 -1
  383. package/dist/api/ton/TonSignProof.d.ts.map +1 -1
  384. package/dist/api/tron/TronGetAddress.d.ts +1 -0
  385. package/dist/api/tron/TronGetAddress.d.ts.map +1 -1
  386. package/dist/api/tron/TronSignMessage.d.ts +6 -1
  387. package/dist/api/tron/TronSignMessage.d.ts.map +1 -1
  388. package/dist/api/tron/TronSignTransaction.d.ts +2 -1
  389. package/dist/api/tron/TronSignTransaction.d.ts.map +1 -1
  390. package/dist/api/utils.d.ts +4 -1
  391. package/dist/api/utils.d.ts.map +1 -1
  392. package/dist/api/xrp/XrpGetAddress.d.ts +1 -0
  393. package/dist/api/xrp/XrpGetAddress.d.ts.map +1 -1
  394. package/dist/api/xrp/XrpSignTransaction.d.ts +1 -0
  395. package/dist/api/xrp/XrpSignTransaction.d.ts.map +1 -1
  396. package/dist/constants/index.d.ts +1 -1
  397. package/dist/constants/index.d.ts.map +1 -1
  398. package/dist/core/RequestQueue.d.ts +0 -2
  399. package/dist/core/RequestQueue.d.ts.map +1 -1
  400. package/dist/core/deviceEventRegistration.d.ts +4 -2
  401. package/dist/core/deviceEventRegistration.d.ts.map +1 -1
  402. package/dist/core/index.d.ts +8 -3
  403. package/dist/core/index.d.ts.map +1 -1
  404. package/dist/core/uiPromiseRegistry.d.ts +6 -0
  405. package/dist/core/uiPromiseRegistry.d.ts.map +1 -0
  406. package/dist/data-manager/DataManager.d.ts +14 -5
  407. package/dist/data-manager/DataManager.d.ts.map +1 -1
  408. package/dist/data-manager/TransportManager.d.ts.map +1 -1
  409. package/dist/data-manager/connectSettings.d.ts.map +1 -1
  410. package/dist/device/Device.d.ts +84 -16
  411. package/dist/device/Device.d.ts.map +1 -1
  412. package/dist/device/DeviceCommands.d.ts +8 -6
  413. package/dist/device/DeviceCommands.d.ts.map +1 -1
  414. package/dist/device/DeviceConnector.d.ts +4 -3
  415. package/dist/device/DeviceConnector.d.ts.map +1 -1
  416. package/dist/device/DeviceFeaturesState.d.ts +3 -0
  417. package/dist/device/DeviceFeaturesState.d.ts.map +1 -0
  418. package/dist/device/DevicePool.d.ts +6 -2
  419. package/dist/device/DevicePool.d.ts.map +1 -1
  420. package/dist/device/DeviceStateMapper.d.ts +13 -0
  421. package/dist/device/DeviceStateMapper.d.ts.map +1 -0
  422. package/dist/device/DeviceStateProjector.d.ts +7 -0
  423. package/dist/device/DeviceStateProjector.d.ts.map +1 -0
  424. package/dist/device/DeviceStateStore.d.ts +21 -0
  425. package/dist/device/DeviceStateStore.d.ts.map +1 -0
  426. package/dist/device/DeviceWalletSessionStore.d.ts +13 -1
  427. package/dist/device/DeviceWalletSessionStore.d.ts.map +1 -1
  428. package/dist/device/cloneDeviceState.d.ts +2 -0
  429. package/dist/device/cloneDeviceState.d.ts.map +1 -0
  430. package/dist/device/deviceIdentity.d.ts +5 -0
  431. package/dist/device/deviceIdentity.d.ts.map +1 -0
  432. package/dist/deviceProfile/buildDeviceFeatures.d.ts +8 -2
  433. package/dist/deviceProfile/buildDeviceFeatures.d.ts.map +1 -1
  434. package/dist/deviceProfile/index.d.ts +0 -1
  435. package/dist/deviceProfile/index.d.ts.map +1 -1
  436. package/dist/deviceProfile/protocolV2DeviceIdentity.d.ts +7 -0
  437. package/dist/deviceProfile/protocolV2DeviceIdentity.d.ts.map +1 -0
  438. package/dist/events/call.d.ts +0 -7
  439. package/dist/events/call.d.ts.map +1 -1
  440. package/dist/events/core.d.ts +2 -2
  441. package/dist/events/core.d.ts.map +1 -1
  442. package/dist/events/device.d.ts +16 -2
  443. package/dist/events/device.d.ts.map +1 -1
  444. package/dist/events/iframe.d.ts +0 -1
  445. package/dist/events/iframe.d.ts.map +1 -1
  446. package/dist/events/logBlockEvent.d.ts +2 -0
  447. package/dist/events/logBlockEvent.d.ts.map +1 -1
  448. package/dist/events/ui-promise.d.ts +4 -2
  449. package/dist/events/ui-promise.d.ts.map +1 -1
  450. package/dist/events/ui-request.d.ts +50 -4
  451. package/dist/events/ui-request.d.ts.map +1 -1
  452. package/dist/events/ui-response.d.ts +10 -2
  453. package/dist/events/ui-response.d.ts.map +1 -1
  454. package/dist/index.d.ts +1763 -830
  455. package/dist/index.d.ts.map +1 -1
  456. package/dist/index.js +11675 -4659
  457. package/dist/inject.d.ts +7 -3
  458. package/dist/inject.d.ts.map +1 -1
  459. package/dist/lowLevelInject.d.ts +1 -2
  460. package/dist/lowLevelInject.d.ts.map +1 -1
  461. package/dist/protocols/protocol-v2/deviceSession.d.ts +7 -0
  462. package/dist/protocols/protocol-v2/deviceSession.d.ts.map +1 -0
  463. package/dist/protocols/protocol-v2/features.d.ts +33 -22
  464. package/dist/protocols/protocol-v2/features.d.ts.map +1 -1
  465. package/dist/protocols/protocol-v2/firmware.d.ts.map +1 -1
  466. package/dist/protocols/protocol-v2/index.d.ts +2 -2
  467. package/dist/protocols/protocol-v2/index.d.ts.map +1 -1
  468. package/dist/protocols/protocol-v2/resources.d.ts +16 -0
  469. package/dist/protocols/protocol-v2/resources.d.ts.map +1 -0
  470. package/dist/protocols/protocol-v2/settingsUnlockPolicy.d.ts +17 -0
  471. package/dist/protocols/protocol-v2/settingsUnlockPolicy.d.ts.map +1 -0
  472. package/dist/protocols/protocol-v2/uiInteraction.d.ts +42 -0
  473. package/dist/protocols/protocol-v2/uiInteraction.d.ts.map +1 -0
  474. package/dist/protocols/protocol-v2/unlockPolicy.d.ts +2 -0
  475. package/dist/protocols/protocol-v2/unlockPolicy.d.ts.map +1 -0
  476. package/dist/protocols/protocol-v2/unlockPolicyRunner.d.ts +22 -0
  477. package/dist/protocols/protocol-v2/unlockPolicyRunner.d.ts.map +1 -0
  478. package/dist/protocols/protocol-v2/walletSession.d.ts +18 -4
  479. package/dist/protocols/protocol-v2/walletSession.d.ts.map +1 -1
  480. package/dist/topLevelInject.d.ts.map +1 -1
  481. package/dist/types/api/checkAllFirmwareRelease.d.ts +48 -9
  482. package/dist/types/api/checkAllFirmwareRelease.d.ts.map +1 -1
  483. package/dist/types/api/checkBLEFirmwareRelease.d.ts +2 -13
  484. package/dist/types/api/checkBLEFirmwareRelease.d.ts.map +1 -1
  485. package/dist/types/api/checkBootloaderRelease.d.ts +2 -6
  486. package/dist/types/api/checkBootloaderRelease.d.ts.map +1 -1
  487. package/dist/types/api/checkFirmwareRelease.d.ts +2 -13
  488. package/dist/types/api/checkFirmwareRelease.d.ts.map +1 -1
  489. package/dist/types/api/checkFirmwareTypeAvailable.d.ts +2 -2
  490. package/dist/types/api/checkFirmwareTypeAvailable.d.ts.map +1 -1
  491. package/dist/types/api/detectDeviceConnectProtocol.d.ts +4 -0
  492. package/dist/types/api/detectDeviceConnectProtocol.d.ts.map +1 -0
  493. package/dist/types/api/deviceSettings.d.ts +11 -2
  494. package/dist/types/api/deviceSettings.d.ts.map +1 -1
  495. package/dist/types/api/deviceUnlock.d.ts +6 -2
  496. package/dist/types/api/deviceUnlock.d.ts.map +1 -1
  497. package/dist/types/api/deviceUpdateBootloader.d.ts +6 -0
  498. package/dist/types/api/deviceUpdateBootloader.d.ts.map +1 -1
  499. package/dist/types/api/export.d.ts +8 -3
  500. package/dist/types/api/export.d.ts.map +1 -1
  501. package/dist/types/api/firmwareUpdate.d.ts +67 -5
  502. package/dist/types/api/firmwareUpdate.d.ts.map +1 -1
  503. package/dist/types/api/firmwareUpdateCapabilities.d.ts +9 -0
  504. package/dist/types/api/firmwareUpdateCapabilities.d.ts.map +1 -0
  505. package/dist/types/api/firmwareUpdatePlan.d.ts +28 -0
  506. package/dist/types/api/firmwareUpdatePlan.d.ts.map +1 -0
  507. package/dist/types/api/firmwareUpdatePreparedPlan.d.ts +42 -0
  508. package/dist/types/api/firmwareUpdatePreparedPlan.d.ts.map +1 -0
  509. package/dist/types/api/getDeviceState.d.ts +12 -0
  510. package/dist/types/api/getDeviceState.d.ts.map +1 -0
  511. package/dist/types/api/getFeatures.d.ts.map +1 -1
  512. package/dist/types/api/getOnekeyFeatures.d.ts.map +1 -1
  513. package/dist/types/api/getPassphraseState.d.ts.map +1 -1
  514. package/dist/types/api/index.d.ts +25 -35
  515. package/dist/types/api/index.d.ts.map +1 -1
  516. package/dist/types/api/kaspaSignTransaction.d.ts +42 -4
  517. package/dist/types/api/kaspaSignTransaction.d.ts.map +1 -1
  518. package/dist/types/api/openWalletSession.d.ts +35 -0
  519. package/dist/types/api/openWalletSession.d.ts.map +1 -0
  520. package/dist/types/api/protocolV2.d.ts +11 -93
  521. package/dist/types/api/protocolV2.d.ts.map +1 -1
  522. package/dist/types/api/sessionCache.d.ts +4 -1
  523. package/dist/types/api/sessionCache.d.ts.map +1 -1
  524. package/dist/types/device.d.ts +139 -8
  525. package/dist/types/device.d.ts.map +1 -1
  526. package/dist/types/params.d.ts +1 -0
  527. package/dist/types/params.d.ts.map +1 -1
  528. package/dist/types/settings.d.ts +31 -16
  529. package/dist/types/settings.d.ts.map +1 -1
  530. package/dist/utils/assets.d.ts +2 -1
  531. package/dist/utils/assets.d.ts.map +1 -1
  532. package/dist/utils/deviceFeaturesCompat.d.ts +14 -0
  533. package/dist/utils/deviceFeaturesCompat.d.ts.map +1 -0
  534. package/dist/utils/deviceFeaturesUtils.d.ts +10 -1
  535. package/dist/utils/deviceFeaturesUtils.d.ts.map +1 -1
  536. package/dist/utils/deviceInfoUtils.d.ts +9 -9
  537. package/dist/utils/deviceInfoUtils.d.ts.map +1 -1
  538. package/dist/utils/deviceSettings.d.ts +39 -7
  539. package/dist/utils/deviceSettings.d.ts.map +1 -1
  540. package/dist/utils/deviceVersionUtils.d.ts +7 -5
  541. package/dist/utils/deviceVersionUtils.d.ts.map +1 -1
  542. package/dist/utils/homescreen.d.ts +4 -0
  543. package/dist/utils/homescreen.d.ts.map +1 -1
  544. package/dist/utils/index.d.ts +5 -4
  545. package/dist/utils/index.d.ts.map +1 -1
  546. package/dist/utils/networkUtils.d.ts +10 -1
  547. package/dist/utils/networkUtils.d.ts.map +1 -1
  548. package/dist/utils/patch.d.ts +1 -1
  549. package/dist/utils/patch.d.ts.map +1 -1
  550. package/dist/utils/pro2Nft.d.ts +38 -0
  551. package/dist/utils/pro2Nft.d.ts.map +1 -0
  552. package/dist/utils/pro2Wallpaper.d.ts +10 -0
  553. package/dist/utils/pro2Wallpaper.d.ts.map +1 -1
  554. package/dist/utils/tracing.d.ts.map +1 -1
  555. package/dist/utils/uiProgressThrottle.d.ts +3 -0
  556. package/dist/utils/uiProgressThrottle.d.ts.map +1 -0
  557. package/package.json +6 -4
  558. package/src/api/BaseMethod.ts +45 -23
  559. package/src/api/CheckAllFirmwareRelease.ts +440 -4
  560. package/src/api/CheckBLEFirmwareRelease.ts +37 -5
  561. package/src/api/CheckBootloaderRelease.ts +37 -5
  562. package/src/api/CheckFirmwareRelease.ts +36 -9
  563. package/src/api/CipherKeyValue.ts +4 -0
  564. package/src/api/ClearSessionCache.ts +4 -0
  565. package/src/api/DetectDeviceConnectProtocol.ts +18 -0
  566. package/src/api/DirList.ts +9 -4
  567. package/src/api/DirMake.ts +7 -4
  568. package/src/api/DirRemove.ts +7 -4
  569. package/src/api/FileDelete.ts +7 -4
  570. package/src/api/FileRead.ts +13 -7
  571. package/src/api/FileWrite.ts +7 -4
  572. package/src/api/FirmwareUpdate.ts +30 -15
  573. package/src/api/FirmwareUpdateV2.ts +535 -169
  574. package/src/api/FirmwareUpdateV3.ts +349 -91
  575. package/src/api/FirmwareUpdateV4.ts +2145 -749
  576. package/src/api/GetDeviceState.ts +59 -0
  577. package/src/api/GetFeatures.ts +6 -4
  578. package/src/api/GetOnekeyFeatures.ts +1 -75
  579. package/src/api/GetPassphraseState.ts +36 -12
  580. package/src/api/OpenWalletSession.ts +268 -0
  581. package/src/api/PathInfo.ts +9 -4
  582. package/src/api/PromptWebDeviceAccess.ts +3 -8
  583. package/src/api/SearchDevices.ts +35 -5
  584. package/src/api/UploadPortfolio.ts +30 -4
  585. package/src/api/alephium/AlephiumGetAddress.ts +0 -4
  586. package/src/api/alephium/AlephiumSignMessage.ts +0 -4
  587. package/src/api/alephium/AlephiumSignTransaction.ts +2 -6
  588. package/src/api/algo/AlgoGetAddress.ts +4 -0
  589. package/src/api/algo/AlgoSignTransaction.ts +4 -0
  590. package/src/api/allnetwork/AllNetworkGetAddress.ts +21 -21
  591. package/src/api/allnetwork/AllNetworkGetAddressBase.ts +53 -45
  592. package/src/api/aptos/AptosGetAddress.ts +4 -0
  593. package/src/api/aptos/AptosGetPublicKey.ts +4 -0
  594. package/src/api/aptos/AptosSignInMessage.ts +4 -0
  595. package/src/api/aptos/AptosSignMessage.ts +4 -0
  596. package/src/api/aptos/AptosSignTransaction.ts +4 -0
  597. package/src/api/benfen/BenfenGetAddress.ts +11 -7
  598. package/src/api/benfen/BenfenGetPublicKey.ts +0 -4
  599. package/src/api/benfen/BenfenSignMessage.ts +0 -4
  600. package/src/api/benfen/BenfenSignTransaction.ts +0 -4
  601. package/src/api/btc/BTCGetAddress.ts +8 -1
  602. package/src/api/btc/BTCGetPublicKey.ts +9 -2
  603. package/src/api/btc/BTCSignMessage.ts +8 -1
  604. package/src/api/btc/BTCSignPsbt.ts +4 -0
  605. package/src/api/btc/BTCSignTransaction.ts +8 -1
  606. package/src/api/btc/BTCVerifyMessage.ts +8 -1
  607. package/src/api/btc/helpers/versionLimit.ts +7 -4
  608. package/src/api/cardano/CardanoGetAddress.ts +4 -0
  609. package/src/api/cardano/CardanoGetPublicKey.ts +4 -0
  610. package/src/api/cardano/CardanoSignMessage.ts +4 -0
  611. package/src/api/cardano/CardanoSignTransaction.ts +4 -0
  612. package/src/api/conflux/ConfluxGetAddress.ts +6 -0
  613. package/src/api/conflux/ConfluxSignMessage.ts +6 -0
  614. package/src/api/conflux/ConfluxSignMessageCIP23.ts +6 -0
  615. package/src/api/conflux/ConfluxSignTransaction.ts +8 -5
  616. package/src/api/cosmos/CosmosGetAddress.ts +4 -0
  617. package/src/api/cosmos/CosmosGetPublicKey.ts +4 -0
  618. package/src/api/cosmos/CosmosSignTransaction.ts +4 -0
  619. package/src/api/device/DeviceCancel.ts +5 -0
  620. package/src/api/device/DeviceChangePin.ts +31 -0
  621. package/src/api/device/DeviceFullyUploadResource.ts +4 -5
  622. package/src/api/device/DeviceLock.ts +5 -0
  623. package/src/api/device/DeviceRebootToBoardloader.ts +8 -1
  624. package/src/api/device/DeviceRebootToBootloader.ts +8 -1
  625. package/src/api/device/DeviceSettings.ts +211 -3
  626. package/src/api/device/DeviceSupportFeatures.ts +4 -0
  627. package/src/api/device/DeviceUnlock.ts +21 -3
  628. package/src/api/device/DeviceUpdateBootloader.ts +152 -8
  629. package/src/api/device/DeviceVerify.ts +25 -0
  630. package/src/api/device/DeviceWipe.ts +28 -0
  631. package/src/api/device/PreInitialize.ts +4 -0
  632. package/src/api/dynex/DnxGetAddress.ts +0 -6
  633. package/src/api/dynex/DnxSignTransaction.ts +0 -6
  634. package/src/api/evm/EVMGetAddress.ts +6 -2
  635. package/src/api/evm/EVMGetPublicKey.ts +6 -2
  636. package/src/api/evm/EVMSignMessage.ts +6 -2
  637. package/src/api/evm/EVMSignMessageEIP712.ts +1 -11
  638. package/src/api/evm/EVMSignTransaction.ts +6 -2
  639. package/src/api/evm/EVMSignTypedData.ts +42 -50
  640. package/src/api/evm/EVMVerifyMessage.ts +6 -2
  641. package/src/api/evm/legacyV1/getAddress.ts +2 -2
  642. package/src/api/evm/legacyV1/getPublicKey.ts +2 -2
  643. package/src/api/evm/legacyV1/signMessage.ts +2 -2
  644. package/src/api/evm/legacyV1/signTypedData.ts +2 -2
  645. package/src/api/evm/legacyV1/signTypedHash.ts +2 -2
  646. package/src/api/evm/legacyV1/verifyMessage.ts +2 -2
  647. package/src/api/evm/protocol.ts +6 -0
  648. package/src/api/filecoin/FilecoinGetAddress.ts +4 -0
  649. package/src/api/filecoin/FilecoinSignTransaction.ts +4 -0
  650. package/src/api/firmware/FirmwareArtifactSource.ts +305 -0
  651. package/src/api/firmware/FirmwareHostBinding.ts +123 -0
  652. package/src/api/firmware/FirmwareMemoryHost.ts +143 -0
  653. package/src/api/firmware/FirmwarePreparationError.ts +12 -0
  654. package/src/api/firmware/FirmwarePreparedResourceArchive.ts +196 -0
  655. package/src/api/firmware/FirmwareUpdateBaseMethod.ts +214 -77
  656. package/src/api/firmware/FirmwareUpdateCapabilities.ts +9 -0
  657. package/src/api/firmware/FirmwareUpdatePlan.ts +946 -0
  658. package/src/api/firmware/FirmwareUpdatePreparedPlan.ts +486 -0
  659. package/src/api/firmware/getBinary.ts +8 -3
  660. package/src/api/firmware/protocolV2Release.ts +173 -0
  661. package/src/api/firmware/updateBootloader.ts +19 -4
  662. package/src/api/firmware/uploadFirmware.ts +157 -26
  663. package/src/api/helpers/base64Data.ts +85 -0
  664. package/src/api/helpers/batchGetPublickeys.ts +2 -2
  665. package/src/api/helpers/filesystemValidation.ts +61 -0
  666. package/src/api/helpers/paramsValidator.ts +1 -1
  667. package/src/api/helpers/protocolV2FileWrite.ts +266 -42
  668. package/src/api/index.ts +6 -30
  669. package/src/api/kaspa/KaspaGetAddress.ts +7 -0
  670. package/src/api/kaspa/KaspaSignTransaction.ts +369 -29
  671. package/src/api/kaspa/helpers/TransferSerialize.ts +17 -7
  672. package/src/api/lightning/LnurlAuth.ts +0 -4
  673. package/src/api/near/NearGetAddress.ts +4 -0
  674. package/src/api/near/NearSignTransaction.ts +4 -0
  675. package/src/api/nem/NEMGetAddress.ts +4 -0
  676. package/src/api/nem/NEMSignTransaction.ts +4 -0
  677. package/src/api/neo/NeoGetAddress.ts +0 -4
  678. package/src/api/neo/NeoSignTransaction.ts +0 -4
  679. package/src/api/nervos/NervosGetAddress.ts +0 -4
  680. package/src/api/nervos/NervosSignTransaction.ts +2 -6
  681. package/src/api/nexa/NexaGetAddress.ts +0 -4
  682. package/src/api/nexa/NexaSignTransaction.ts +3 -5
  683. package/src/api/nostr/NostrDecryptMessage.ts +4 -0
  684. package/src/api/nostr/NostrEncryptMessage.ts +4 -0
  685. package/src/api/nostr/NostrGetPublicKey.ts +4 -0
  686. package/src/api/nostr/NostrSignEvent.ts +4 -0
  687. package/src/api/nostr/NostrSignSchnorr.ts +4 -0
  688. package/src/api/polkadot/PolkadotGetAddress.ts +4 -0
  689. package/src/api/polkadot/PolkadotSignTransaction.ts +4 -0
  690. package/src/api/polkadot/networks.ts +3 -3
  691. package/src/api/protocol-v2/DeviceFactoryInfoGet.ts +5 -2
  692. package/src/api/protocol-v2/DeviceFactoryInfoSet.ts +6 -3
  693. package/src/api/protocol-v2/DeviceFirmwareUpdate.ts +13 -32
  694. package/src/api/protocol-v2/DeviceGetFirmwareUpdateStatus.ts +10 -6
  695. package/src/api/protocol-v2/DeviceGetOnboardingStatus.ts +6 -3
  696. package/src/api/protocol-v2/DeviceInfoGet.ts +11 -18
  697. package/src/api/protocol-v2/DeviceReboot.ts +12 -3
  698. package/src/api/protocol-v2/DeviceStatusGet.ts +6 -1
  699. package/src/api/protocol-v2/DeviceUploadNft.ts +249 -0
  700. package/src/api/protocol-v2/DeviceUploadWallpaper.ts +59 -21
  701. package/src/api/protocol-v2/FilesystemFormat.ts +5 -2
  702. package/src/api/protocol-v2/FilesystemPermissionFix.ts +5 -2
  703. package/src/api/protocol-v2/Ping.ts +37 -3
  704. package/src/api/protocol-v2/ProtocolInfoRequest.ts +8 -3
  705. package/src/api/protocol-v2/helpers.ts +1 -1
  706. package/src/api/scdo/ScdoGetAddress.ts +0 -4
  707. package/src/api/scdo/ScdoSignMessage.ts +0 -4
  708. package/src/api/scdo/ScdoSignTransaction.ts +0 -4
  709. package/src/api/solana/SolGetAddress.ts +4 -0
  710. package/src/api/solana/SolSignMessage.ts +5 -1
  711. package/src/api/solana/SolSignOffchainMessage.ts +5 -1
  712. package/src/api/solana/SolSignTransaction.ts +6 -2
  713. package/src/api/starcoin/StarcoinGetAddress.ts +4 -0
  714. package/src/api/starcoin/StarcoinGetPublicKey.ts +4 -0
  715. package/src/api/starcoin/StarcoinSignMessage.ts +4 -0
  716. package/src/api/starcoin/StarcoinSignTransaction.ts +4 -0
  717. package/src/api/starcoin/StarcoinVerifyMessage.ts +4 -0
  718. package/src/api/stellar/StellarGetAddress.ts +1 -10
  719. package/src/api/stellar/StellarSignTransaction.ts +1 -14
  720. package/src/api/sui/SuiGetAddress.ts +5 -1
  721. package/src/api/sui/SuiGetPublicKey.ts +5 -1
  722. package/src/api/sui/SuiSignMessage.ts +5 -1
  723. package/src/api/sui/SuiSignTransaction.ts +5 -1
  724. package/src/api/ton/TonGetAddress.ts +5 -1
  725. package/src/api/ton/TonSignData.ts +5 -1
  726. package/src/api/ton/TonSignMessage.ts +10 -4
  727. package/src/api/ton/TonSignProof.ts +5 -1
  728. package/src/api/tron/TronGetAddress.ts +4 -0
  729. package/src/api/tron/TronSignMessage.ts +19 -8
  730. package/src/api/tron/TronSignTransaction.ts +5 -1
  731. package/src/api/utils.ts +32 -3
  732. package/src/api/xrp/XrpGetAddress.ts +4 -0
  733. package/src/api/xrp/XrpSignTransaction.ts +5 -1
  734. package/src/constants/index.ts +1 -4
  735. package/src/core/RequestQueue.ts +0 -18
  736. package/src/core/deviceEventRegistration.ts +7 -8
  737. package/src/core/index.ts +605 -198
  738. package/src/core/uiPromiseRegistry.ts +63 -0
  739. package/src/data/messages/messages-protocol-v2.json +523 -449
  740. package/src/data/messages/messages.json +286 -1
  741. package/src/data-manager/DataManager.ts +162 -44
  742. package/src/data-manager/TransportManager.ts +7 -1
  743. package/src/data-manager/connectSettings.ts +11 -0
  744. package/src/device/Device.ts +1019 -267
  745. package/src/device/DeviceCommands.ts +197 -161
  746. package/src/device/DeviceConnector.ts +54 -21
  747. package/src/device/DeviceFeaturesState.ts +25 -0
  748. package/src/device/DevicePool.ts +108 -23
  749. package/src/device/DeviceStateMapper.ts +422 -0
  750. package/src/device/DeviceStateProjector.ts +152 -0
  751. package/src/device/DeviceStateStore.ts +232 -0
  752. package/src/device/DeviceWalletSessionStore.ts +72 -6
  753. package/src/device/cloneDeviceState.ts +39 -0
  754. package/src/device/deviceIdentity.ts +18 -0
  755. package/src/deviceProfile/buildDeviceFeatures.ts +209 -191
  756. package/src/deviceProfile/index.ts +0 -1
  757. package/src/deviceProfile/protocolV2DeviceIdentity.ts +35 -0
  758. package/src/events/call.ts +0 -6
  759. package/src/events/core.ts +0 -2
  760. package/src/events/device.ts +22 -1
  761. package/src/events/iframe.ts +0 -1
  762. package/src/events/logBlockEvent.ts +93 -2
  763. package/src/events/ui-promise.ts +4 -2
  764. package/src/events/ui-request.ts +61 -4
  765. package/src/events/ui-response.ts +12 -2
  766. package/src/index.ts +13 -4
  767. package/src/inject.ts +89 -55
  768. package/src/lowLevelInject.ts +11 -7
  769. package/src/protocols/protocol-v2/deviceSession.ts +24 -0
  770. package/src/protocols/protocol-v2/features.ts +118 -52
  771. package/src/protocols/protocol-v2/firmware.ts +3 -1
  772. package/src/protocols/protocol-v2/index.ts +9 -3
  773. package/src/protocols/protocol-v2/resources.ts +161 -0
  774. package/src/protocols/protocol-v2/settingsUnlockPolicy.ts +65 -0
  775. package/src/protocols/protocol-v2/uiInteraction.ts +250 -0
  776. package/src/protocols/protocol-v2/unlockPolicy.ts +1 -0
  777. package/src/protocols/protocol-v2/unlockPolicyRunner.ts +136 -0
  778. package/src/protocols/protocol-v2/walletSession.ts +417 -61
  779. package/src/topLevelInject.ts +11 -6
  780. package/src/types/api/checkAllFirmwareRelease.ts +72 -9
  781. package/src/types/api/checkBLEFirmwareRelease.ts +4 -13
  782. package/src/types/api/checkBootloaderRelease.ts +2 -6
  783. package/src/types/api/checkFirmwareRelease.ts +2 -13
  784. package/src/types/api/checkFirmwareTypeAvailable.ts +2 -2
  785. package/src/types/api/detectDeviceConnectProtocol.ts +6 -0
  786. package/src/types/api/deviceSettings.ts +26 -2
  787. package/src/types/api/deviceUnlock.ts +13 -2
  788. package/src/types/api/deviceUpdateBootloader.ts +7 -0
  789. package/src/types/api/export.ts +33 -1
  790. package/src/types/api/firmwareUpdate.ts +85 -11
  791. package/src/types/api/firmwareUpdateCapabilities.ts +9 -0
  792. package/src/types/api/firmwareUpdatePlan.ts +38 -0
  793. package/src/types/api/firmwareUpdatePreparedPlan.ts +53 -0
  794. package/src/types/api/getDeviceState.ts +19 -0
  795. package/src/types/api/getFeatures.ts +3 -0
  796. package/src/types/api/getOnekeyFeatures.ts +3 -0
  797. package/src/types/api/getPassphraseState.ts +7 -0
  798. package/src/types/api/index.ts +43 -73
  799. package/src/types/api/kaspaSignTransaction.ts +60 -4
  800. package/src/types/api/openWalletSession.ts +54 -0
  801. package/src/types/api/protocolV2.ts +23 -188
  802. package/src/types/api/sessionCache.ts +9 -4
  803. package/src/types/device.ts +211 -9
  804. package/src/types/params.ts +9 -2
  805. package/src/types/settings.ts +37 -25
  806. package/src/utils/assets.ts +4 -1
  807. package/src/utils/deviceFeaturesCompat.ts +191 -0
  808. package/src/utils/deviceFeaturesUtils.ts +42 -9
  809. package/src/utils/deviceInfoUtils.ts +35 -70
  810. package/src/utils/deviceSettings.ts +181 -39
  811. package/src/utils/deviceVersionUtils.ts +25 -44
  812. package/src/utils/findDefectiveBatchDevice.ts +3 -3
  813. package/src/utils/homescreen.ts +40 -0
  814. package/src/utils/index.ts +26 -7
  815. package/src/utils/networkUtils.ts +274 -16
  816. package/src/utils/pro2Nft.ts +165 -0
  817. package/src/utils/pro2Wallpaper.ts +44 -25
  818. package/src/utils/tracing.ts +3 -1
  819. package/src/utils/uiProgressThrottle.ts +63 -0
  820. package/tsconfig.type-tests.json +12 -0
  821. package/__tests__/RequestQueue.test.ts +0 -34
  822. package/dist/api/GetDeviceInfo.d.ts +0 -9
  823. package/dist/api/GetDeviceInfo.d.ts.map +0 -1
  824. package/dist/api/firmware/progressThrottle.d.ts +0 -3
  825. package/dist/api/firmware/progressThrottle.d.ts.map +0 -1
  826. package/dist/api/protocol-v2/DeviceSessionGet.d.ts +0 -6
  827. package/dist/api/protocol-v2/DeviceSessionGet.d.ts.map +0 -1
  828. package/dist/api/protocol-v2/DeviceSettingsGet.d.ts +0 -6
  829. package/dist/api/protocol-v2/DeviceSettingsGet.d.ts.map +0 -1
  830. package/dist/api/protocol-v2/DeviceSettingsPageShow.d.ts +0 -16
  831. package/dist/api/protocol-v2/DeviceSettingsPageShow.d.ts.map +0 -1
  832. package/dist/api/protocol-v2/DeviceSettingsSet.d.ts +0 -12
  833. package/dist/api/protocol-v2/DeviceSettingsSet.d.ts.map +0 -1
  834. package/dist/deviceProfile/buildDeviceProfile.d.ts +0 -21
  835. package/dist/deviceProfile/buildDeviceProfile.d.ts.map +0 -1
  836. package/dist/protocols/protocol-v2/lockedError.d.ts +0 -2
  837. package/dist/protocols/protocol-v2/lockedError.d.ts.map +0 -1
  838. package/dist/protocols/protocol-v2/unlockRetry.d.ts +0 -9
  839. package/dist/protocols/protocol-v2/unlockRetry.d.ts.map +0 -1
  840. package/dist/types/api/getDeviceInfo.d.ts +0 -87
  841. package/dist/types/api/getDeviceInfo.d.ts.map +0 -1
  842. package/src/api/GetDeviceInfo.ts +0 -145
  843. package/src/api/firmware/progressThrottle.ts +0 -44
  844. package/src/api/protocol-v2/DeviceSessionGet.ts +0 -15
  845. package/src/api/protocol-v2/DeviceSettingsGet.ts +0 -16
  846. package/src/api/protocol-v2/DeviceSettingsPageShow.ts +0 -59
  847. package/src/api/protocol-v2/DeviceSettingsSet.ts +0 -39
  848. package/src/deviceProfile/buildDeviceProfile.ts +0 -354
  849. package/src/protocols/protocol-v2/lockedError.ts +0 -10
  850. package/src/protocols/protocol-v2/unlockRetry.ts +0 -36
  851. package/src/types/api/getDeviceInfo.ts +0 -101
package/dist/index.d.ts CHANGED
@@ -1,25 +1,71 @@
1
1
  import EventEmitter, { EventEmitter as EventEmitter$1 } from 'events';
2
- import { DeviceFirmwareTargetType, DeviceFirmwareUpdateRecordFields, DeviceRebootType, DeviceFirmwareTarget, Messages, Transport, TransportCallOptions, OneKeyDeviceInfo, ProtocolV2DeviceInfo, DeviceStatus as DeviceStatus$1, Success as Success$1, LowlevelTransportSharedPlugin, DeviceSettings, DeviceSettingsPage, ProtocolInfo, DevOnboardingStatus, DeviceSession, DeviceFirmwareUpdateStatus, DeviceFactoryInfo, OneKeyDeviceCommType, Features as Features$1, ProtocolType, 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';
2
+ import * as _onekeyfe_hd_transport from '@onekeyfe/hd-transport';
3
+ import { DeviceRebootType, Messages, Transport, TransportCallOptions, OneKeyDeviceCommType, ProtocolInfo, ProtocolV2DeviceInfo, DeviceStatus as DeviceStatus$1, Enum_SafetyCheckLevel, OneKeyDeviceInfo, Success as Success$1, DeviceSessionPinType, LowlevelTransportSharedPlugin, OnboardingStatus, RecoveryDeviceType, 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, SafetyCheckLevel, ChangeOutputScriptType, ProtocolType } from '@onekeyfe/hd-transport';
3
4
  export { Success as DeviceSuccess, HDNodeType, Messages as PROTO, ResourceType, TonSignDataType, TonWalletVersion } from '@onekeyfe/hd-transport';
4
5
  import * as _onekeyfe_hd_shared from '@onekeyfe/hd-shared';
5
- import { HardwareConnectProtocol, Deferred, EFirmwareType, EDeviceType } from '@onekeyfe/hd-shared';
6
+ import { HardwareConnectProtocol, EFirmwareType, EDeviceType, Deferred } from '@onekeyfe/hd-shared';
6
7
 
7
8
  interface CommonParams {
8
9
  keepSession?: boolean;
10
+ /**
11
+ * polling connect max retry count
12
+ */
9
13
  retryCount?: number;
14
+ /**
15
+ * polling interval time
16
+ */
10
17
  pollIntervalTime?: number;
18
+ /**
19
+ * Timeout time for single polling
20
+ */
11
21
  timeout?: number;
22
+ /**
23
+ * DeviceInfoGet timeout during Protocol V2 initialization.
24
+ */
12
25
  protocolV2DeviceInfoTimeoutMs?: number;
26
+ /**
27
+ * passphrase state
28
+ */
13
29
  passphraseState?: string;
30
+ /**
31
+ * Use empty passphrase
32
+ */
14
33
  useEmptyPassphrase?: boolean;
34
+ /**
35
+ * Every init session
36
+ */
15
37
  initSession?: boolean;
38
+ /**
39
+ * Use derive cardano
40
+ */
16
41
  deriveCardano?: boolean;
17
42
  detectBootloaderDevice?: boolean;
43
+ /**
44
+ * Skip web device prompt
45
+ */
18
46
  skipWebDevicePrompt?: boolean;
47
+ /**
48
+ * Skip passphrase check
49
+ */
19
50
  skipPassphraseCheck?: boolean;
51
+ /**
52
+ * Only connect device, not initialize device, only ble connect
53
+ */
20
54
  onlyConnectBleDevice?: boolean;
55
+ /**
56
+ * Use pre-initialized device state (BLE only)
57
+ */
21
58
  usePreInitialize?: boolean;
59
+ /**
60
+ * Strictly expected transport protocol. The SDK actively verifies this value and
61
+ * rejects a mismatch. After a successful probe, the cached protocol is also strict.
62
+ */
22
63
  connectProtocol?: HardwareConnectProtocol;
64
+ /**
65
+ * Ignore a previously bound protocol for this call and actively detect the
66
+ * protocol again. Intended for the first verified connection or explicit recovery.
67
+ */
68
+ forceProtocolDetection?: boolean;
23
69
  }
24
70
  type Params<T> = CommonParams & T & {
25
71
  bundle?: undefined;
@@ -44,34 +90,6 @@ type DeviceRebootParams = {
44
90
  rebootType?: RebootTypeInput;
45
91
  reboot_type?: RebootTypeInput;
46
92
  };
47
- type DeviceFirmwareTargetInput = DeviceFirmwareTarget | {
48
- targetId?: DeviceFirmwareTargetType | string | number;
49
- target_id?: DeviceFirmwareTargetType | string | number;
50
- path: string;
51
- };
52
- type DeviceFirmwareUpdateParams = {
53
- targets?: DeviceFirmwareTargetInput[];
54
- targetId?: DeviceFirmwareTargetType | string | number;
55
- target_id?: DeviceFirmwareTargetType | string | number;
56
- path?: string;
57
- };
58
- type DeviceFirmwareUpdateStatusGetParams = {
59
- fields?: DeviceFirmwareUpdateRecordFields;
60
- };
61
- type DeviceFactoryInfoSetParams = {
62
- version?: number;
63
- serial_number?: string;
64
- burn_in_completed?: boolean;
65
- factory_test_completed?: boolean;
66
- manufacture_time?: {
67
- year: number;
68
- month: number;
69
- day: number;
70
- hour: number;
71
- minute: number;
72
- second: number;
73
- };
74
- };
75
93
 
76
94
  type PassphrasePromptResponse = {
77
95
  passphrase?: string;
@@ -89,15 +107,19 @@ type TypedCallResponseMap = {
89
107
  [K in MessageKey]: TypedResponseMessage<K>;
90
108
  };
91
109
  type DefaultMessageResponse = TypedCallResponseMap[MessageKey];
110
+ /**
111
+ * The life cycle begins with the acquisition of the device and ends with the disposal device commands
112
+ * acquire device -> create DeviceCommands -> release device -> dispose DeviceCommands
113
+ */
92
114
  declare class DeviceCommands {
93
115
  instanceId: string;
94
116
  currentResponseID?: number;
95
- device: Device$1;
117
+ device: Device;
96
118
  transport: Transport;
97
119
  mainId: string;
98
120
  disposed: boolean;
99
121
  callPromise?: Promise<DefaultMessageResponse>;
100
- constructor(device: Device$1, mainId: string);
122
+ constructor(device: Device, mainId: string);
101
123
  dispose(_cancelRequest: boolean): Promise<void>;
102
124
  checkDisposed(): void;
103
125
  cancelDeviceOnOneKeyDevice(): Promise<{
@@ -114,7 +136,7 @@ declare class DeviceCommands {
114
136
  };
115
137
  } | {
116
138
  success: boolean;
117
- 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;
139
+ 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 | 723 | 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 | 830 | 831 | 832 | 900 | 901 | 902;
118
140
  payload: {
119
141
  message: string;
120
142
  };
@@ -133,7 +155,7 @@ declare class DeviceCommands {
133
155
  };
134
156
  } | {
135
157
  success: boolean;
136
- 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;
158
+ 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 | 723 | 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 | 830 | 831 | 832 | 900 | 901 | 902;
137
159
  payload: {
138
160
  message: string;
139
161
  };
@@ -145,412 +167,146 @@ declare class DeviceCommands {
145
167
  _commonCall(type: MessageKey, msg?: DefaultMessageResponse['message'], options?: TransportCallOptions): Promise<DefaultMessageResponse>;
146
168
  _filterCommonTypes(res: DefaultMessageResponse, callType: MessageKey, options?: TransportCallOptions): Promise<DefaultMessageResponse>;
147
169
  _promptPin(type?: Messages.PinMatrixRequestType): Promise<string>;
148
- _promptPassphrase(options: PassphraseRequestPayload): Promise<PassphrasePromptResponse>;
149
- }
150
-
151
- type DeviceDescriptorDiff = {
152
- didUpdate: boolean;
153
- connected: OneKeyDeviceInfo[];
154
- disconnected: OneKeyDeviceInfo[];
155
- changedSessions: OneKeyDeviceInfo[];
156
- changedDebugSessions: OneKeyDeviceInfo[];
157
- acquired: OneKeyDeviceInfo[];
158
- debugAcquired: OneKeyDeviceInfo[];
159
- released: OneKeyDeviceInfo[];
160
- debugReleased: OneKeyDeviceInfo[];
161
- descriptors: OneKeyDeviceInfo[];
162
- };
163
-
164
- declare class DeviceConnector {
165
- transport: Transport;
166
- listenTimestamp: number;
167
- current: OneKeyDeviceInfo[] | null;
168
- upcoming: OneKeyDeviceInfo[];
169
- listening: boolean;
170
- constructor();
171
- enumerate(): Promise<DeviceDescriptorDiff | undefined>;
172
- listen(): Promise<void>;
173
- stop(): void;
174
- acquire(path: string, session?: string | null, forceCleanRunPromise?: boolean, connectProtocol?: HardwareConnectProtocol): Promise<string | undefined>;
175
- release(session: string, onclose: boolean): Promise<void>;
176
- disconnect(session: string | undefined | null): Promise<void>;
177
- promptDeviceAccess(): Promise<USBDevice | BluetoothDevice | null>;
178
- _reportDevicesChange(): void;
179
- }
180
-
181
- type InitOptions = {
182
- initSession?: boolean;
183
- deviceId?: string;
184
- passphraseState?: string;
185
- deriveCardano?: boolean;
186
- connectProtocol?: HardwareConnectProtocol;
187
- protocolV2DeviceInfoTimeoutMs?: number;
188
- };
189
- type RunOptions = {
190
- keepSession?: boolean;
191
- skipInitialize?: boolean;
192
- } & InitOptions;
193
- interface DeviceEvents {
194
- [DEVICE.PIN]: [Device$1, Messages.PinMatrixRequestType | undefined, (err: any, pin: string) => void];
195
- [DEVICE.PASSPHRASE_ON_DEVICE]: [Device$1, ((response: any) => void)?];
196
- [DEVICE.BUTTON]: [Device$1, DeviceButtonRequestPayload];
197
- [DEVICE.FEATURES]: [Device$1, DeviceFeaturesPayload];
198
- [DEVICE.PASSPHRASE]: [
199
- Device$1,
200
- PassphraseRequestPayload,
201
- (response: PassphrasePromptResponse, error?: Error) => void
202
- ];
203
- [DEVICE.SELECT_DEVICE_IN_BOOTLOADER_FOR_WEB_DEVICE]: [
204
- Device$1,
205
- (err: any, deviceId: string) => void
206
- ];
207
- [DEVICE.SELECT_DEVICE_FOR_SWITCH_FIRMWARE_WEB_DEVICE]: [
208
- Device$1,
209
- (err: any, deviceId: string) => void
210
- ];
211
- }
212
- declare function preloadSessionCache(deviceId: string, passphraseState: string, sessionId: string): void;
213
- interface Device$1 {
214
- on<K extends keyof DeviceEvents>(type: K, listener: (...event: DeviceEvents[K]) => void): this;
215
- off<K extends keyof DeviceEvents>(type: K, listener: (...event: DeviceEvents[K]) => void): this;
216
- emit<K extends keyof DeviceEvents>(type: K, ...args: DeviceEvents[K]): boolean;
217
- }
218
- declare class Device$1 extends EventEmitter {
219
- originalDescriptor: OneKeyDeviceInfo;
220
- sdkInstanceId?: string;
221
- instanceId: string;
222
- createdAt: number;
223
- mainId?: string | null;
224
- deviceConnector?: DeviceConnector | null;
225
- commands: DeviceCommands;
226
- private cancelableAction?;
227
- private deviceAcquired;
228
- features: Features | undefined;
229
- featuresNeedsReload: boolean;
230
- runPromise?: Deferred<void> | null;
231
- externalState: string[];
232
- unavailableCapabilities: UnavailableCapabilities;
233
- instance: number;
234
- internalState: string[];
235
- needReloadDevice: boolean;
236
- keepSession: boolean;
237
- passphraseState: string | undefined;
238
- pendingCallbackPromise?: Deferred<void>;
239
- private preInitializedAt?;
240
- private preInitializeMeta?;
241
- private lastInitializeDurationMs?;
242
- constructor(descriptor: OneKeyDeviceInfo, sdkInstanceId?: string);
243
- static fromDescriptor(originalDescriptor: OneKeyDeviceInfo, sdkInstanceId?: string): Device$1;
244
- toMessageObject(): Device | null;
245
- connect(connectProtocol?: HardwareConnectProtocol): Promise<boolean>;
246
- acquire(connectProtocol?: HardwareConnectProtocol, options?: {
247
- throwOnRunPromiseError?: boolean;
248
- }): Promise<void>;
249
- release(): Promise<void>;
250
- preInitialize(initOptions?: InitOptions): Promise<void>;
251
- markPreInitialized(meta?: {
252
- passphraseState?: string;
253
- }): void;
254
- clearPreInitialized(): void;
255
- isPreInitializeMetaMatch(payload?: {
256
- passphraseState?: string;
257
- }): boolean;
258
- isPreInitializedValid(ttlMs: number): boolean;
259
- setLastInitializeDuration(durationMs: number): void;
260
- getLastInitializeDuration(): number | undefined;
261
- getCommands(): DeviceCommands;
262
- getProtocol(): 'V1' | 'V2';
263
- isProtocolV2(): boolean;
264
- getCurrentDeviceType(): IDeviceType;
265
- getCurrentDeviceId(): string | undefined;
266
- getCurrentSerialNo(): string;
267
- getConnectId(): string;
268
- getCurrentBleName(): string | null;
269
- getCurrentLabel(): string | null;
270
- getCurrentPassphraseProtection(): boolean | null | undefined;
271
- getCurrentFirmwareType(): _onekeyfe_hd_shared.EFirmwareType;
272
- getCurrentFirmwareVersionString(): string;
273
- getCurrentBLEFirmwareVersionString(): string | undefined;
274
- getCurrentSafetyChecks(): string | null | undefined;
275
- getCurrentMethodVersionRange(getVersionRange: (deviceModel: IDeviceType | IDeviceModel) => IVersionRange | undefined): IVersionRange | undefined;
276
- supportNewPassphrase(): SupportFeatureType;
277
- supportInputPinOnSoftware(): SupportFeatureType;
278
- supportModifyHomescreen(): SupportFeatureType;
279
- private getSessionCacheDeviceKey;
280
- getInternalState(_deviceId?: string): string | undefined;
281
- updateInternalState(enablePassphrase: boolean, passphraseState: string | undefined, deviceId: string | undefined, sessionId?: string | null, featuresSessionId?: string | null): void;
282
- private setInternalState;
283
- clearInternalState(_deviceId?: string): void;
284
- initialize(options?: InitOptions): Promise<void>;
285
- private _initializeProtocolV2;
286
- private _refreshProtocolV2Status;
287
- getFeatures(): Promise<Features | undefined>;
288
- _updateFeatures(protoFeatures: Messages.Features | Features, initSession?: boolean): void;
289
- updateProtocolV2Features(deviceInfo?: ProtocolV2DeviceInfo): Features;
290
- updateProtocolV2Status(status: DeviceStatus$1): Features;
291
- updateDescriptor(descriptor: OneKeyDeviceInfo, forceUpdate?: boolean): void;
292
- updateFromCache(device: Device$1): void;
293
- run(fn?: () => Promise<void>, options?: RunOptions): Promise<void>;
294
- _runInner<T>(fn: (() => Promise<T>) | undefined, options: RunOptions): Promise<undefined>;
295
- interruptionFromOutside(): Promise<void>;
296
- interruptionFromUser(): Promise<void>;
297
- setCancelableAction(callback: (err?: Error) => Promise<unknown>): void;
298
- clearCancelableAction(): void;
299
- getMode(): EOneKeyDeviceMode;
300
- getFirmwareVersion(): IVersionArray | null;
301
- getBLEFirmwareVersion(): IVersionArray | null;
302
- isUsed(): boolean;
303
- hasDeviceAcquire(): boolean;
304
- isUsedHere(): boolean;
305
- isUsedElsewhere(): boolean;
306
- isBootloader(): boolean | undefined;
307
- isInitialized(): boolean | undefined;
308
- isSeedless(): boolean | undefined;
309
- isUnacquired(): boolean;
310
- hasUnexpectedMode(allow: string[], require: string[]): "ui-device_bootloader_mode" | "ui-device_not_in_bootloader_mode" | "ui-device_not_initialized" | "ui-device_seedless" | null;
311
- hasUsePassphrase(): boolean;
312
- checkDeviceId(deviceId: string): boolean;
313
- lockDevice(): Promise<Success$1>;
314
- supportUnlockVersionRange(): DeviceFirmwareRange;
315
- unlockDevice(): Promise<Features | undefined>;
316
- checkPassphraseStateSafety(passphraseState?: string, useEmptyPassphrase?: boolean, skipPassphraseCheck?: boolean): Promise<boolean>;
317
- }
318
-
319
- declare function generateSdkInstanceId(): string;
320
- declare function generateInstanceId(type: string, sdkInstanceId?: string): string;
321
- interface RequestContext {
322
- responseID: number;
323
- sdkInstanceId?: string;
324
- methodName: string;
325
- connectId?: string;
326
- deviceInstanceId?: string;
327
- commandsInstanceId?: string;
328
- parentResponseID?: number;
329
- startTime: number;
330
- endTime?: number;
331
- status?: 'pending' | 'running' | 'success' | 'error' | 'cancelled';
332
- error?: string;
333
- }
334
- interface SdkTracingContext {
335
- sdkInstanceId: string;
336
- createdAt: number;
337
- activeRequests: Map<number, RequestContext>;
170
+ promptPassphrase(options: PassphraseRequestPayload, promptOptions?: {
171
+ cancelDeviceOnReject?: boolean;
172
+ }): Promise<PassphrasePromptResponse>;
338
173
  }
339
- declare function createSdkTracingContext(): SdkTracingContext;
340
- declare function createRequestContext(responseID: number, methodName: string, options?: {
341
- sdkInstanceId?: string;
342
- connectId?: string;
343
- deviceInstanceId?: string;
344
- commandsInstanceId?: string;
345
- parentResponseID?: number;
346
- }): RequestContext;
347
- declare function updateRequestContext(responseID: number, updates: Partial<RequestContext>): void;
348
- declare function completeRequestContext(responseID: number, error?: Error): void;
349
- declare function getActiveRequestsByDeviceInstance(deviceInstanceId: string): RequestContext[];
350
- declare function formatRequestContext(context: RequestContext): string;
351
- declare function cleanupSdkInstance(sdkInstanceId: string): void;
352
174
 
353
- declare class Core extends EventEmitter {
354
- private tracingContext;
355
- readonly sdkInstanceId: string;
356
- private requestQueue;
357
- private prePendingCallPromise;
358
- private methodSynchronize;
359
- constructor();
360
- cancelOperation(operationId: string): void;
361
- private getCoreContext;
362
- handleMessage(message: CoreMessage): Promise<any>;
363
- dispose(): void;
364
- }
365
- declare const init$1: (settings: ConnectSettings, Transport: any, plugin?: LowlevelTransportSharedPlugin) => Promise<Core | undefined>;
366
- declare const switchTransport: ({ env, Transport, plugin, }: {
367
- env: ConnectSettings['env'];
368
- Transport: any;
369
- plugin?: LowlevelTransportSharedPlugin | undefined;
370
- }) => void;
175
+ type ProtocolV2RuntimeMode = 'normal' | 'bootloader' | 'romloader';
371
176
 
372
- type DeviceInfoGetTargets = {
373
- hw?: boolean;
374
- fw?: boolean;
375
- coprocessor?: boolean;
376
- se1?: boolean;
377
- se2?: boolean;
378
- se3?: boolean;
379
- se4?: boolean;
380
- status?: boolean;
177
+ type transportEnv = 'node' | 'web' | 'webextension' | 'electron' | 'react-native' | 'webusb' | 'desktop-webusb' | 'desktop-web-ble' | 'emulator' | 'lowlevel' | 'node-usb';
178
+ type ConnectSettings = {
179
+ connectSrc?: string;
180
+ debug?: boolean;
181
+ transportReconnect?: boolean;
182
+ lazyLoad?: boolean;
183
+ origin?: string;
184
+ parentOrigin?: string;
185
+ configSrc: string;
186
+ iframeSrc: string;
187
+ version: string;
188
+ priority: number;
189
+ trustedHost: boolean;
190
+ supportedBrowser?: boolean;
191
+ env: transportEnv;
192
+ timestamp: number;
193
+ isFrame?: boolean;
194
+ preRelease?: boolean;
195
+ firmwareManifestMode?: 'sdk-managed' | 'external-only';
196
+ preloadedConfig?: RemoteConfigResponse;
197
+ fetchConfig?: boolean;
198
+ extension?: string;
199
+ configFetcher?: (url: string) => Promise<RemoteConfigResponse | null>;
381
200
  };
382
- type DeviceInfoGetTypes = {
383
- version?: boolean;
384
- build_id?: boolean;
385
- hash?: boolean;
386
- specific?: boolean;
201
+ type IVersionArray = [number, number, number];
202
+ type ILocale = 'zh-CN' | 'en-US';
203
+ type IProtocolV2FirmwareComponentTarget = 'ROMLOADER' | 'BOOTLOADER' | 'APPLICATION_P1' | 'APPLICATION_P2' | 'COPROCESSOR' | 'SE01' | 'SE02' | 'SE03' | 'SE04';
204
+ type IProtocolV2FirmwareComponent = {
205
+ target: IProtocolV2FirmwareComponentTarget;
206
+ url: string;
207
+ /** SHA-256 of the complete okpkg, used after downloading the package. */
208
+ fingerprint?: string;
209
+ /** OKPP payload hash, used to detect same-version package changes. */
210
+ payloadHash?: string;
211
+ expectedSize?: number;
212
+ version?: IVersionArray;
387
213
  };
388
- type DeviceInfoGetParams = {
389
- targets?: DeviceInfoGetTargets;
390
- types?: DeviceInfoGetTypes;
214
+ type IProtocolV2ResourceSource = {
215
+ archiveUrl: string;
216
+ archiveSha256: string;
217
+ archiveSize: number;
391
218
  };
392
-
393
- type DeviceSettingsSetParams = {
394
- settings?: Omit<DeviceSettings, 'passphrase_enable' | 'airgap_mode'>;
219
+ type IProtocolV2Resources = {
220
+ source: IProtocolV2ResourceSource;
395
221
  };
396
-
397
- type SupportedDeviceSettingsPage = DeviceSettingsPage;
398
- type DeviceSettingsPageShowParams = {
399
- page?: SupportedDeviceSettingsPage | 'DeviceReset' | 'DevicePinChange' | 'DevicePassphrase' | 'DeviceAirgap';
400
- fieldName?: string;
401
- field_name?: string;
222
+ /** STM32 firmware config */
223
+ type IFirmwareReleaseInfo = {
224
+ required: boolean;
225
+ url: string;
226
+ /**
227
+ * Firmware type (bitcoinonly or universal)
228
+ * This field is not present in the remote config, but will be inferred from the firmware field name
229
+ */
230
+ firmwareType?: EFirmwareType;
231
+ /** Firmware UI resource */
232
+ resource?: string;
233
+ resourceFingerprint?: string;
234
+ resourceExpectedSize?: number;
235
+ /** Firmware full UI resource */
236
+ fullResource?: string;
237
+ fullResourceFingerprint?: string;
238
+ fullResourceExpectedSize?: number;
239
+ fullResourceRange?: string[];
240
+ bootloaderResource?: string;
241
+ bootloaderFingerprint?: string;
242
+ bootloaderExpectedSize?: number;
243
+ bootloaderVersion?: IVersionArray;
244
+ displayBootloaderVersion?: IVersionArray;
245
+ bootloaderRelatedFirmwareVersion?: IVersionArray;
246
+ upgradeType?: 'payload-package-set' | string;
247
+ components?: Record<string, IProtocolV2FirmwareComponent>;
248
+ installOrder?: string[];
249
+ /** Protocol V2 resources matched to this firmware release. */
250
+ resources?: IProtocolV2Resources;
251
+ bootloaderChangelog?: {
252
+ [k in ILocale]: string;
253
+ };
254
+ fingerprint: string;
255
+ expectedSize?: number;
256
+ version: IVersionArray;
257
+ changelog: {
258
+ [k in ILocale]: string;
259
+ };
402
260
  };
403
-
404
- declare const PRO2_WALLPAPER_WIDTH = 604;
405
- declare const PRO2_WALLPAPER_HEIGHT = 1024;
406
- type Pro2WallpaperColorFormat = 'RGB565' | 'RGB565A8';
407
- declare function encodePro2Wallpaper(options: {
408
- width: number;
409
- height: number;
410
- rgba: Uint8Array | ArrayBuffer;
411
- }): {
412
- data: Uint8Array;
413
- colorFormat: Pro2WallpaperColorFormat;
414
- };
415
-
416
- type DeviceUploadWallpaperParams = {
417
- width: number;
418
- height: number;
419
- rgba: Uint8Array | ArrayBuffer;
420
- fileName?: string;
421
- chunkSize?: number;
422
- };
423
- type DeviceUploadWallpaperResponse = {
424
- path: string;
425
- size: number;
426
- colorFormat: Pro2WallpaperColorFormat;
427
- message?: string;
428
- };
429
-
430
- type FileOpSuccess = {
431
- message?: string;
261
+ /** BLE firmware config */
262
+ type IBLEFirmwareReleaseInfo = {
263
+ required: boolean;
264
+ /** bluetooth dfu version */
265
+ url: string;
266
+ /** stm bluetooth update version */
267
+ webUpdate: string;
268
+ fingerprint: string;
269
+ fingerprintWeb: string;
270
+ expectedSize?: number;
271
+ version: IVersionArray;
272
+ changelog: {
273
+ [k in ILocale]: string;
274
+ };
432
275
  };
433
- type FileInfo = {
434
- path: string;
435
- offset: number;
436
- total_size: number;
437
- data?: Uint8Array;
438
- data_hash?: number;
439
- processed_byte?: number;
440
- chunks?: number;
276
+ type IKnownDevice = Exclude<IDeviceType, 'unknown'>;
277
+ type IDeviceReleaseInfo = {
278
+ firmware?: IFirmwareReleaseInfo[];
279
+ /** Protocol V2 payload package set */
280
+ 'firmware-v1'?: IFirmwareReleaseInfo[];
281
+ 'firmware-v2'?: IFirmwareReleaseInfo[];
282
+ 'firmware-v8'?: IFirmwareReleaseInfo[];
283
+ 'firmware-btc-v8'?: IFirmwareReleaseInfo[];
284
+ ble?: IBLEFirmwareReleaseInfo[];
441
285
  };
442
- type DirInfo = {
443
- path: string;
444
- child_dirs?: string;
445
- child_files?: string;
286
+ type DeviceTypeMap = {
287
+ [k in Exclude<IKnownDevice, 'neo'>]: IDeviceReleaseInfo;
288
+ } & {
289
+ /** Optional until every remote-config producer publishes a Neo entry. */
290
+ neo?: IDeviceReleaseInfo;
446
291
  };
447
- type PathInfoResult = {
448
- exist: boolean;
449
- size: number;
450
- year: number;
451
- month: number;
452
- day: number;
453
- hour: number;
454
- minute: number;
455
- second: number;
456
- readonly: boolean;
457
- hidden: boolean;
458
- system: boolean;
459
- archive: boolean;
460
- directory: boolean;
461
- };
462
- declare function protocolInfoRequest(connectId: string, params?: CommonParams): Response<ProtocolInfo>;
463
- declare function ping(connectId: string, params?: CommonParams & {
464
- message?: string;
465
- }): Response<Success$1>;
466
- declare function deviceReboot(connectId: string, params: CommonParams & DeviceRebootParams): Response<Success$1>;
467
- declare function deviceInfoGet(connectId: string, params?: CommonParams & DeviceInfoGetParams): Response<ProtocolV2DeviceInfo>;
468
- declare function deviceStatusGet(connectId: string, params?: CommonParams): Response<DeviceStatus$1>;
469
- declare function deviceGetOnboardingStatus(connectId: string, params?: CommonParams): Response<DevOnboardingStatus>;
470
- declare function deviceSessionGet(connectId: string, params?: CommonParams): Response<DeviceSession>;
471
- declare function deviceFirmwareUpdate(connectId: string, params: CommonParams & DeviceFirmwareUpdateParams): Response<Success$1 | DeviceFirmwareUpdateStatus>;
472
- declare function deviceGetFirmwareUpdateStatus(connectId: string, params?: CommonParams & DeviceFirmwareUpdateStatusGetParams): Response<DeviceFirmwareUpdateStatus>;
473
- declare function deviceFactoryInfoSet(connectId: string, params: CommonParams & DeviceFactoryInfoSetParams): Response<Success$1>;
474
- declare function deviceFactoryInfoGet(connectId: string, params?: CommonParams): Response<DeviceFactoryInfo>;
475
- declare function deviceSettingsGet(connectId: string, params?: CommonParams): Response<DeviceSettings>;
476
- declare function deviceSettingsSet(connectId: string, params: CommonParams & DeviceSettingsSetParams): Response<Success$1>;
477
- declare function deviceSettingsPageShow(connectId: string, params: CommonParams & DeviceSettingsPageShowParams): Response<Success$1>;
478
- declare function deviceUploadWallpaper(connectId: string, params: CommonParams & DeviceUploadWallpaperParams): Response<DeviceUploadWallpaperResponse>;
479
- declare function filesystemPermissionFix(connectId: string, params?: CommonParams): Response<Success$1>;
480
- declare function fileRead(connectId: string, params: {
481
- path: string;
482
- offset?: number;
483
- totalSize?: number;
484
- chunkLen?: number;
485
- uiPercentage?: number;
486
- }): Response<FileInfo>;
487
- declare function fileWrite(connectId: string, params: {
488
- path: string;
489
- offset?: number;
490
- totalSize?: number;
491
- chunkSize?: number;
492
- chunkLen?: number;
493
- data: ArrayBuffer | Uint8Array | Blob | string;
494
- overwrite?: boolean;
495
- append?: boolean;
496
- uiPercentage?: number;
497
- timeoutMs?: number | string;
498
- }): Response<FileInfo>;
499
- declare function fileDelete(connectId: string, params: {
500
- path: string;
501
- }): Response<FileOpSuccess>;
502
- declare function dirList(connectId: string, params: {
503
- path: string;
504
- depth?: number;
505
- }): Response<DirInfo>;
506
- declare function dirMake(connectId: string, params: {
507
- path: string;
508
- }): Response<FileOpSuccess>;
509
- declare function dirRemove(connectId: string, params: {
510
- path: string;
511
- }): Response<FileOpSuccess>;
512
- declare function pathInfo(connectId: string, params: {
513
- path: string;
514
- timeoutMs?: number | string;
515
- }): Response<PathInfoResult>;
516
- declare const filesystemFileRead: typeof fileRead;
517
- declare const filesystemFileWrite: typeof fileWrite;
518
- declare function uploadPortfolio(connectId: string, params: {
519
- operationId?: string;
520
- packageBytes: ArrayBuffer | Uint8Array | Blob;
521
- timeoutMs?: number | string;
522
- }): Response<FileInfo & {
523
- portfolioUpdated: true;
524
- }>;
525
- declare const filesystemFileDelete: typeof fileDelete;
526
- declare const filesystemDirList: typeof dirList;
527
- declare const filesystemDirMake: typeof dirMake;
528
- declare const filesystemDirRemove: typeof dirRemove;
529
- declare const filesystemPathInfoQuery: typeof pathInfo;
530
- declare function filesystemFormat(connectId: string): Response<Success$1>;
531
-
532
- declare const on: <T extends string, P extends (...args: any[]) => any>(type: T, fn: P) => void;
533
- declare const off: (type: any, fn: any) => void;
534
- declare const removeAllListeners: (type: any) => void;
535
-
536
- declare function uiResponse(response: UiResponseEvent): void;
537
-
538
- type IAddHardwareGlobalEventListener = (coreMessage: CoreMessage) => void;
539
- interface LowLevelInjectApi {
540
- call: CallMethod;
541
- eventEmitter: EventEmitter$1;
542
- init: CoreApi['init'];
543
- dispose: CoreApi['dispose'];
544
- uiResponse: CoreApi['uiResponse'];
545
- cancel: CoreApi['cancel'];
546
- cancelOperation: CoreApi['cancelOperation'];
547
- updateSettings: CoreApi['updateSettings'];
548
- switchTransport: CoreApi['switchTransport'];
549
- addHardwareGlobalEventListener: (listener: IAddHardwareGlobalEventListener) => void;
550
- }
551
- type LowLevelCoreApi = Omit<CoreApi, 'on' | 'off'> & {
552
- addHardwareGlobalEventListener: (listener: IAddHardwareGlobalEventListener) => void;
292
+ type AssetsMap = {
293
+ bridge: {
294
+ version: IVersionArray;
295
+ linux32Rpm: string;
296
+ linux64Rpm: string;
297
+ linux32Deb: string;
298
+ linux64Deb: string;
299
+ win: string;
300
+ mac: string;
301
+ sha256sumAsc: string;
302
+ changelog: {
303
+ [k in ILocale]: string;
304
+ };
305
+ };
553
306
  };
307
+ type RemoteConfigResponse = {
308
+ bridge: AssetsMap['bridge'];
309
+ } & DeviceTypeMap;
554
310
 
555
311
  type DeviceStatus = 'available' | 'occupied' | 'used';
556
312
  declare enum EOneKeyDeviceMode {
@@ -565,6 +321,14 @@ type UnavailableCapabilities = {
565
321
  };
566
322
  type KnownDevice = {
567
323
  connectId: string | null;
324
+ /** Protocol family confirmed by the transport's active probe. */
325
+ connectProtocol?: HardwareConnectProtocol;
326
+ /**
327
+ * Stable physical-device identity. Current SDK responses always include this
328
+ * value; it remains optional in the type during the uuid compatibility window.
329
+ */
330
+ serialNo?: string;
331
+ /** @deprecated Use serialNo instead. */
568
332
  uuid: string;
569
333
  deviceId: string | null;
570
334
  deviceType: IDeviceType | null;
@@ -574,9 +338,12 @@ type KnownDevice = {
574
338
  bleName: string | null;
575
339
  name: string;
576
340
  error?: typeof undefined;
341
+ /** Current SDK/transport usage state for connection indicators. */
342
+ status?: DeviceStatus;
577
343
  mode: EOneKeyDeviceMode;
578
- features?: Features;
579
- sessionId?: string | null;
344
+ features: Features;
345
+ /** Unified SDK device-state snapshot; features remains a legacy projection. */
346
+ state?: DeviceState;
580
347
  unavailableCapabilities: UnavailableCapabilities;
581
348
  bleFirmwareVersion: IVersionArray | null;
582
349
  firmwareVersion: IVersionArray | null;
@@ -586,18 +353,36 @@ type KnownDevice = {
586
353
  };
587
354
  type SearchDevice = {
588
355
  connectId: string | null;
356
+ /** Protocol family confirmed by the transport's active probe. */
357
+ connectProtocol?: HardwareConnectProtocol;
358
+ /**
359
+ * Available after device initialization. BLE discovery does not connect to the
360
+ * device, so it returns null until a later initialized device response. Current
361
+ * SDK responses always include the field; it remains optional in the type during
362
+ * the uuid compatibility window.
363
+ */
364
+ serialNo?: string | null;
365
+ /**
366
+ * @deprecated Ambiguous legacy identifier. Use serialNo for hardware identity
367
+ * and connectId for transport routing. Empty during BLE discovery until the
368
+ * physical serial number is available after initialization.
369
+ */
589
370
  uuid: string;
590
371
  deviceId: string | null;
591
372
  deviceType: IDeviceType;
592
373
  name: string;
593
374
  commType: OneKeyDeviceCommType;
594
375
  };
595
- type Device = KnownDevice;
376
+ type Device$1 = KnownDevice;
596
377
  type DeviceFeaturesProtocol = 'V1' | 'V2' | 'unknown';
597
378
  type DeviceFeaturesMode = 'normal' | 'bootloader' | 'romloader' | 'notInitialized' | 'backupMode' | 'unknown';
598
379
  type DeviceFeaturesVerify = {
599
380
  firmwareBuildId?: string;
600
381
  firmwareHash?: string;
382
+ applicationP1BuildId?: string;
383
+ applicationP1Hash?: string;
384
+ applicationP2BuildId?: string;
385
+ applicationP2Hash?: string;
601
386
  bootloaderBuildId?: string;
602
387
  bootloaderHash?: string;
603
388
  boardBuildId?: string;
@@ -624,7 +409,124 @@ type DeviceFeaturesVerify = {
624
409
  type DeviceFeaturesRaw = {
625
410
  protocolV1Features?: Messages.Features;
626
411
  protocolV1OneKeyFeatures?: OnekeyFeatures;
412
+ protocolV2ProtocolInfo?: ProtocolInfo;
627
413
  protocolV2DeviceInfo?: ProtocolV2DeviceInfo;
414
+ protocolV2DeviceStatus?: DeviceStatus$1;
415
+ };
416
+ type DeviceFeaturesRawPatch = {
417
+ [Key in keyof DeviceFeaturesRaw]?: DeviceFeaturesRaw[Key] | null;
418
+ };
419
+ type DeviceStateProtocol = DeviceFeaturesProtocol;
420
+ type DeviceStateMode = DeviceFeaturesMode;
421
+ type DeviceStateSection = 'identity' | 'status' | 'settings' | 'versions' | 'verification';
422
+ type DeviceStateUpdateSource = 'initialize' | 'device-info' | 'device-status' | 'settings-read' | 'settings-write' | 'change-pin' | 'lock' | 'unlock' | 'passphrase' | 'session-clear' | 'firmware-update' | 'transport-reconnect' | 'compatibility';
423
+ type DeviceStateIdentity = {
424
+ deviceType: IDeviceType;
425
+ firmwareType: EFirmwareType;
426
+ model: string | null;
427
+ vendor: string | null;
428
+ deviceId: string | null;
429
+ serialNo: string;
430
+ label: string | null;
431
+ bleName: string | null;
432
+ };
433
+ type DeviceStateStatus = {
434
+ mode: DeviceStateMode;
435
+ initialized: boolean | null;
436
+ unlocked: boolean | null;
437
+ firmwarePresent: boolean | null;
438
+ backupRequired: boolean | null;
439
+ noBackup: boolean | null;
440
+ unfinishedBackup: boolean | null;
441
+ recoveryMode: boolean | null;
442
+ passphraseProtection: boolean | null;
443
+ pinProtection: boolean | null;
444
+ /** `attach_to_pin_enabled`:是否至少存在一个 Attach PIN 绑定。 */
445
+ attachToPinEnabled: boolean | null;
446
+ /** `unlocked_by_attach_to_pin`:本次解锁是否由 Attach PIN 完成。 */
447
+ unlockedAttachPin: boolean | null;
448
+ };
449
+ type DeviceStateSettings = {
450
+ language: string | null;
451
+ bleEnabled: boolean | null;
452
+ sdCardPresent: boolean | null;
453
+ sdProtection: boolean | null;
454
+ wipeCodeProtection: boolean | null;
455
+ passphraseAlwaysOnDevice: boolean | null;
456
+ safetyChecks: Enum_SafetyCheckLevel | null;
457
+ autoLockDelayMs: number | null;
458
+ autoShutdownDelayMs: number | null;
459
+ displayRotation: number | null;
460
+ experimentalFeatures: boolean | null;
461
+ wallpaperPath: string | null;
462
+ brightness: number | null;
463
+ animationEnabled: boolean | null;
464
+ tapToWake: boolean | null;
465
+ hapticFeedback: boolean | null;
466
+ deviceNameDisplayEnabled: boolean | null;
467
+ airgapMode: boolean | null;
468
+ fidoEnabled: boolean | null;
469
+ usbLockEnabled: boolean | null;
470
+ randomKeypad: boolean | null;
471
+ };
472
+ type DeviceStateVersions = {
473
+ firmware: string | null;
474
+ applicationP1?: string | null;
475
+ applicationP2?: string | null;
476
+ bootloader: string | null;
477
+ board: string | null;
478
+ ble: string | null;
479
+ /** @deprecated Kept for legacy consumers; new code should read se01. */
480
+ se?: string | null;
481
+ se01?: string | null;
482
+ se02?: string | null;
483
+ se03?: string | null;
484
+ se04?: string | null;
485
+ se01Boot?: string | null;
486
+ se02Boot?: string | null;
487
+ se03Boot?: string | null;
488
+ se04Boot?: string | null;
489
+ };
490
+ type DeviceStateSecurityElement = {
491
+ type: string | null;
492
+ state: string | null;
493
+ };
494
+ type DeviceStateSecurityElements = Partial<Record<'se01' | 'se02' | 'se03' | 'se04', DeviceStateSecurityElement>>;
495
+ type DeviceStateSecurityElementsPatch = Partial<Record<keyof DeviceStateSecurityElements, Partial<DeviceStateSecurityElement>>>;
496
+ type DeviceState = {
497
+ schemaVersion: 1;
498
+ revision: number;
499
+ updatedAt: number;
500
+ protocol: DeviceStateProtocol;
501
+ /** Device-message protocol version, independent of the SDK V1/V2 protocol family. */
502
+ protocolVersion: number | null;
503
+ identity: DeviceStateIdentity;
504
+ status: DeviceStateStatus;
505
+ settings: DeviceStateSettings;
506
+ versions: DeviceStateVersions;
507
+ /** Secure-element metadata exposed by the unified firmware information read. */
508
+ securityElements?: DeviceStateSecurityElements;
509
+ capabilities: Array<number | string>;
510
+ verification?: Partial<DeviceFeaturesVerify>;
511
+ };
512
+ type DeviceStatePatch = {
513
+ protocol?: DeviceStateProtocol;
514
+ protocolVersion?: number | null;
515
+ identity?: Partial<DeviceStateIdentity>;
516
+ status?: Partial<DeviceStateStatus>;
517
+ settings?: Partial<DeviceStateSettings>;
518
+ versions?: Partial<DeviceStateVersions>;
519
+ securityElements?: DeviceStateSecurityElementsPatch;
520
+ capabilities?: Array<number | string>;
521
+ verification?: DeviceFeaturesVerify;
522
+ raw?: DeviceFeaturesRawPatch;
523
+ };
524
+ type DeviceStateEvent = {
525
+ connectId: string | null;
526
+ state: DeviceState;
527
+ revision: number;
528
+ source: DeviceStateUpdateSource;
529
+ changedKeys: string[];
628
530
  };
629
531
  type NormalizedFeatures = {
630
532
  protocol: DeviceFeaturesProtocol;
@@ -655,11 +557,23 @@ type NormalizedFeatures = {
655
557
  sdProtection: boolean | null;
656
558
  wipeCodeProtection: boolean | null;
657
559
  passphraseAlwaysOnDevice: boolean | null;
560
+ /** `attach_to_pin_enabled`:是否至少存在一个 Attach PIN 绑定。 */
658
561
  attachToPinEnabled?: boolean | null;
659
- safetyChecks: string | null;
562
+ safetyChecks: Enum_SafetyCheckLevel | null;
660
563
  autoLockDelayMs: number | null;
564
+ autoShutdownDelayMs: number | null;
661
565
  displayRotation: number | null;
662
566
  experimentalFeatures: boolean | null;
567
+ wallpaperPath: string | null;
568
+ brightness: number | null;
569
+ animationEnabled: boolean | null;
570
+ tapToWake: boolean | null;
571
+ hapticFeedback: boolean | null;
572
+ deviceNameDisplayEnabled: boolean | null;
573
+ airgapMode: boolean | null;
574
+ fidoEnabled: boolean | null;
575
+ usbLockEnabled: boolean | null;
576
+ randomKeypad: boolean | null;
663
577
  firmwareVersion: string | null;
664
578
  bootloaderVersion: string | null;
665
579
  boardVersion: string | null;
@@ -681,8 +595,14 @@ type NormalizedFeatures = {
681
595
  };
682
596
  type Features = NormalizedFeatures & Partial<Omit<Messages.Features, keyof NormalizedFeatures>> & Partial<Omit<Messages.OnekeyFeatures, keyof NormalizedFeatures | keyof Messages.Features>>;
683
597
  type OnekeyFeatures = Messages.OnekeyFeatures;
684
- type IDeviceType = EDeviceType.Unknown | EDeviceType.Classic | EDeviceType.Classic1s | EDeviceType.ClassicPure | EDeviceType.Mini | EDeviceType.Touch | EDeviceType.Pro | EDeviceType.Pro2;
685
- type IDeviceModel = 'model_classic' | 'model_mini' | 'model_touch' | 'model_classic1s';
598
+ type IDeviceType = EDeviceType.Unknown | EDeviceType.Classic | EDeviceType.Classic1s | EDeviceType.ClassicPure | EDeviceType.Mini | EDeviceType.Touch | EDeviceType.Pro | EDeviceType.Pro2 | EDeviceType.Neo;
599
+ /**
600
+ * model_classic: 'classic' | 'classic1s' | 'classicpure'
601
+ * model_mini: 'classic' | 'classic1s' | 'classicpure' | 'mini'
602
+ * model_touch: 'touch' | 'pro'
603
+ * model_pro2: 'pro2' | 'neo'
604
+ */
605
+ type IDeviceModel = 'model_classic' | 'model_mini' | 'model_touch' | 'model_classic1s' | 'model_pro2';
686
606
  declare const DeviceModelToTypes: {
687
607
  [deviceModel in IDeviceModel]: IDeviceType[];
688
608
  };
@@ -695,7 +615,6 @@ type ITransportStatus = 'valid' | 'outdated';
695
615
  type IVersionRange = {
696
616
  min: string;
697
617
  max?: string;
698
- unsupported?: boolean;
699
618
  };
700
619
  type DeviceFirmwareRange = {
701
620
  [deviceType in IDeviceType | IDeviceModel]?: IVersionRange;
@@ -746,302 +665,690 @@ type SupportFeatures = {
746
665
  modifyHomescreen: SupportFeatureType;
747
666
  };
748
667
 
749
- type transportEnv = 'node' | 'web' | 'webextension' | 'electron' | 'react-native' | 'webusb' | 'desktop-webusb' | 'desktop-web-ble' | 'emulator' | 'lowlevel' | 'node-usb';
750
- type ConnectSettings = {
751
- connectSrc?: string;
752
- debug?: boolean;
753
- transportReconnect?: boolean;
754
- lazyLoad?: boolean;
755
- origin?: string;
756
- parentOrigin?: string;
757
- configSrc: string;
758
- iframeSrc: string;
759
- version: string;
760
- priority: number;
761
- trustedHost: boolean;
762
- supportedBrowser?: boolean;
763
- env: transportEnv;
764
- timestamp: number;
765
- isFrame?: boolean;
766
- preRelease?: boolean;
767
- fetchConfig?: boolean;
768
- extension?: string;
769
- configFetcher?: (url: string) => Promise<RemoteConfigResponse | null>;
668
+ type DeviceStateScope = 'runtime' | 'settings' | 'firmware';
669
+ type GetDeviceStateParams = CommonParams & {
670
+ scope?: DeviceStateScope;
770
671
  };
771
- type IVersionArray = [number, number, number];
772
- type ILocale = 'zh-CN' | 'en-US';
773
- type IProtocolV2FirmwareComponentTarget = 'ROMLOADER' | 'BOOTLOADER' | 'APPLICATION_P1' | 'APPLICATION_P2' | 'COPROCESSOR' | 'SE01' | 'SE02' | 'SE03' | 'SE04';
774
- type IProtocolV2FirmwareComponent = {
775
- target: IProtocolV2FirmwareComponentTarget;
776
- url: string;
777
- fingerprint?: string;
778
- version?: IVersionArray;
779
- };
780
- type IProtocolV2ResourceBundle = {
781
- name: string;
782
- url: string;
783
- devicePath: string;
784
- version?: IVersionArray;
785
- payloadHash?: string;
786
- headerHash?: string;
672
+ /** Internal state-read options, not part of the public CoreApi. */
673
+ type DeviceStateReadOptions = {
674
+ refreshSections?: DeviceStateSection[];
675
+ includeRaw?: boolean;
787
676
  };
788
- type IFirmwareReleaseInfo = {
789
- required: boolean;
790
- url: string;
791
- firmwareType?: EFirmwareType;
792
- resource?: string;
793
- fullResource?: string;
794
- fullResourceRange?: string[];
795
- bootloaderResource?: string;
796
- bootloaderVersion?: IVersionArray;
797
- displayBootloaderVersion?: IVersionArray;
798
- bootloaderRelatedFirmwareVersion?: IVersionArray;
799
- upgradeType?: 'payload-package-set' | string;
800
- components?: Record<string, IProtocolV2FirmwareComponent>;
801
- installOrder?: string[];
802
- resourceBundles?: IProtocolV2ResourceBundle[];
803
- bootloaderChangelog?: {
804
- [k in ILocale]: string;
805
- };
806
- fingerprint: string;
807
- version: IVersionArray;
808
- changelog: {
809
- [k in ILocale]: string;
810
- };
677
+ declare function getDeviceState(connectId?: string, params?: GetDeviceStateParams): Response<DeviceState>;
678
+
679
+ type DeviceDescriptorDiff = {
680
+ didUpdate: boolean;
681
+ connected: OneKeyDeviceInfo[];
682
+ disconnected: OneKeyDeviceInfo[];
683
+ changedSessions: OneKeyDeviceInfo[];
684
+ changedDebugSessions: OneKeyDeviceInfo[];
685
+ acquired: OneKeyDeviceInfo[];
686
+ debugAcquired: OneKeyDeviceInfo[];
687
+ released: OneKeyDeviceInfo[];
688
+ debugReleased: OneKeyDeviceInfo[];
689
+ descriptors: OneKeyDeviceInfo[];
811
690
  };
812
- type IBLEFirmwareReleaseInfo = {
813
- required: boolean;
814
- url: string;
815
- webUpdate: string;
816
- fingerprint: string;
817
- fingerprintWeb: string;
818
- version: IVersionArray;
819
- changelog: {
820
- [k in ILocale]: string;
821
- };
691
+
692
+ declare class DeviceConnector {
693
+ transport?: Transport;
694
+ listenTimestamp: number;
695
+ current: OneKeyDeviceInfo[] | null;
696
+ upcoming: OneKeyDeviceInfo[];
697
+ listening: boolean;
698
+ constructor();
699
+ private getActiveTransport;
700
+ enumerate(): Promise<DeviceDescriptorDiff | undefined>;
701
+ listen(): Promise<void>;
702
+ stop(): void;
703
+ acquire(path: string, session?: string | null, forceCleanRunPromise?: boolean, expectedProtocol?: HardwareConnectProtocol, protocolHint?: HardwareConnectProtocol, forceProtocolDetection?: boolean): Promise<string | undefined>;
704
+ release(session: string, onclose: boolean, keepSession?: boolean): Promise<void>;
705
+ disconnect(session: string | undefined | null): Promise<void>;
706
+ promptDeviceAccess(): Promise<USBDevice | BluetoothDevice | null>;
707
+ _reportDevicesChange(): void;
708
+ }
709
+
710
+ type InitOptions = {
711
+ initSession?: boolean;
712
+ deviceId?: string;
713
+ passphraseState?: string;
714
+ deriveCardano?: boolean;
715
+ connectProtocol?: HardwareConnectProtocol;
716
+ forceProtocolDetection?: boolean;
717
+ protocolV2DeviceInfoTimeoutMs?: number;
718
+ /** Refresh Protocol V2 runtime state before returning discovery results. */
719
+ refreshRuntimeState?: boolean;
720
+ /**
721
+ * Protocol V1 Initialize response timeout override. Reboot-wait polling passes a
722
+ * short value so an unanswered probe settles before the next poll tick.
723
+ */
724
+ timeoutMs?: number;
822
725
  };
823
- type IKnownDevice = Exclude<IDeviceType, 'unknown'>;
824
- type DeviceTypeMap = {
825
- [k in IKnownDevice]: {
826
- firmware: IFirmwareReleaseInfo[];
827
- 'firmware-v1'?: IFirmwareReleaseInfo[];
828
- 'firmware-v2'?: IFirmwareReleaseInfo[];
829
- 'firmware-v8'?: IFirmwareReleaseInfo[];
830
- 'firmware-btc-v8'?: IFirmwareReleaseInfo[];
831
- ble: IBLEFirmwareReleaseInfo[];
832
- };
833
- };
834
- type AssetsMap = {
835
- bridge: {
836
- version: IVersionArray;
837
- linux32Rpm: string;
838
- linux64Rpm: string;
839
- linux32Deb: string;
840
- linux64Deb: string;
841
- win: string;
842
- mac: string;
843
- sha256sumAsc: string;
844
- changelog: {
845
- [k in ILocale]: string;
846
- };
726
+ type RunOptions = {
727
+ keepSession?: boolean;
728
+ skipInitialize?: boolean;
729
+ } & InitOptions;
730
+ interface DeviceEvents {
731
+ [DEVICE.PIN]: [Device, Messages.PinMatrixRequestType | undefined, (err: any, pin: string) => void];
732
+ [DEVICE.PIN_ON_DEVICE]: [Device, DeviceSessionPinType, ProtocolV2UiEventMetadata?];
733
+ [DEVICE.PIN_ON_DEVICE_COMPLETE]: [Device, HardwareUiInteractionMeta];
734
+ [DEVICE.PASSPHRASE_ON_DEVICE]: [Device, PassphraseRequestPayload?];
735
+ [DEVICE.ATTACH_PIN_ON_DEVICE]: [Device, PassphraseRequestPayload?];
736
+ [DEVICE.BUTTON]: [Device, DeviceButtonRequestPayload];
737
+ [DEVICE.FEATURES]: [Device, DeviceFeaturesPayload];
738
+ [DEVICE.STATE]: [Device, DeviceStateEvent];
739
+ [DEVICE.PASSPHRASE]: [
740
+ Device,
741
+ PassphraseRequestPayload,
742
+ (response: PassphrasePromptResponse, error?: Error) => void
743
+ ];
744
+ [DEVICE.SELECT_DEVICE_IN_BOOTLOADER_FOR_WEB_DEVICE]: [
745
+ Device,
746
+ (err: any, deviceId: string) => void
747
+ ];
748
+ [DEVICE.SELECT_DEVICE_FOR_SWITCH_FIRMWARE_WEB_DEVICE]: [
749
+ Device,
750
+ (err: any, deviceId: string) => void
751
+ ];
752
+ }
753
+ /**
754
+ * Pre-populate the device session cache with a known session ID.
755
+ *
756
+ * This allows short-lived processes (e.g. CLI) to restore a previously
757
+ * obtained session, avoiding the need to re-enter passphrase on every
758
+ * invocation. The session must have been obtained from a prior
759
+ * wallet-session call on the same device. This compatibility hook is intended
760
+ * for a trusted CLI process restoring its own OS-keychain entry.
761
+ *
762
+ * @param deviceId - The device's device_id (from features)
763
+ * @param passphraseState - The passphrase state token
764
+ * @param sessionId - The session_id to cache (from features.session_id)
765
+ */
766
+ declare function preloadSessionCache(deviceId: string, passphraseState: string, sessionId: string): void;
767
+ interface Device {
768
+ on<K extends keyof DeviceEvents>(type: K, listener: (...event: DeviceEvents[K]) => void): this;
769
+ off<K extends keyof DeviceEvents>(type: K, listener: (...event: DeviceEvents[K]) => void): this;
770
+ emit<K extends keyof DeviceEvents>(type: K, ...args: DeviceEvents[K]): boolean;
771
+ }
772
+ declare class Device extends EventEmitter {
773
+ /**
774
+ * 设备标识对象
775
+ */
776
+ originalDescriptor: OneKeyDeviceInfo;
777
+ sdkInstanceId?: string;
778
+ /**
779
+ * 设备实例唯一标识
780
+ */
781
+ instanceId: string;
782
+ createdAt: number;
783
+ /**
784
+ * 设备主 ID
785
+ * 蓝牙连接时是设备的 UUID
786
+ * USB连接时是设备的 sessionID
787
+ */
788
+ mainId?: string | null;
789
+ /**
790
+ * 通信管道,向设备发送请求
791
+ */
792
+ deviceConnector?: DeviceConnector | null;
793
+ /**
794
+ * 固件命令
795
+ */
796
+ commands: DeviceCommands;
797
+ /**
798
+ * 可取消的操作
799
+ */
800
+ private cancelableAction?;
801
+ /**
802
+ * 设备是否被占用
803
+ */
804
+ private deviceAcquired;
805
+ /**
806
+ * Connection-attempt generation. interruptionFromUser() pins the current
807
+ * attempt so a late acquire cannot finish, while the next public connect
808
+ * increments this and is allowed to proceed.
809
+ */
810
+ private connectionAttempt;
811
+ private interruptedAttempt;
812
+ /** Canonical device-state cache; legacy Features is a compatibility projection. */
813
+ private stateStore;
814
+ /** Force the next initialization to reload DeviceInfo after reconnect or reboot. */
815
+ private protocolV2StateNeedsReload;
816
+ /** Runtime context negotiated once per active Protocol V2 link. */
817
+ private protocolV2RuntimeContext?;
818
+ /** Coalesces concurrent first-use runtime negotiation on the same active link. */
819
+ private protocolV2RuntimeContextPromise?;
820
+ /** Invalidates an in-flight runtime-context response without adding a transport epoch. */
821
+ private protocolV2RuntimeContextRequestToken?;
822
+ private protocolV2UiInteraction?;
823
+ private protocolV2UiInteractionCounter;
824
+ get state(): (DeviceState & {
825
+ raw?: DeviceFeaturesRaw | undefined;
826
+ }) | undefined;
827
+ get features(): Features | undefined;
828
+ set features(features: Features | undefined);
829
+ runPromise?: Deferred<void> | null;
830
+ /** Resolves only after the active run has completed its release path. */
831
+ private runCleanupPromise?;
832
+ externalState: string[];
833
+ unavailableCapabilities: UnavailableCapabilities;
834
+ instance: number;
835
+ internalState: string[];
836
+ needReloadDevice: boolean;
837
+ /**
838
+ * 执行 API 方法后是否保留 SessionID
839
+ */
840
+ keepSession: boolean;
841
+ passphraseState: string | undefined;
842
+ pendingCallbackPromise?: Deferred<void>;
843
+ /** Pre-initialize timestamp (ms) */
844
+ private preInitializedAt?;
845
+ /** Pre-initialize context, used to verify state consistency before skipping */
846
+ private preInitializeMeta?;
847
+ /** Last Initialize duration (ms), reported as "saved" when a skip happens */
848
+ private lastInitializeDurationMs?;
849
+ constructor(descriptor: OneKeyDeviceInfo, sdkInstanceId?: string);
850
+ static fromDescriptor(originalDescriptor: OneKeyDeviceInfo, sdkInstanceId?: string): Device;
851
+ toMessageObject(): Device$1 | null;
852
+ /**
853
+ * Device connect
854
+ * @returns {Promise<boolean>}
855
+ */
856
+ connect(connectProtocol?: HardwareConnectProtocol, options?: {
857
+ forceProtocolDetection?: boolean;
858
+ }): Promise<boolean>;
859
+ acquire(expectedProtocol?: HardwareConnectProtocol, options?: {
860
+ throwOnRunPromiseError?: boolean;
861
+ forceProtocolDetection?: boolean;
862
+ }): Promise<void>;
863
+ release(): Promise<void>;
864
+ /**
865
+ * Pre-initialize: connect + Initialize ahead of the sign.
866
+ */
867
+ preInitialize(initOptions?: InitOptions): Promise<void>;
868
+ markPreInitialized(meta?: {
869
+ passphraseState?: string;
870
+ }): void;
871
+ clearPreInitialized(): void;
872
+ isPreInitializeMetaMatch(payload?: {
873
+ passphraseState?: string;
874
+ }): boolean;
875
+ isPreInitializedValid(ttlMs: number): boolean;
876
+ setLastInitializeDuration(durationMs: number): void;
877
+ getLastInitializeDuration(): number | undefined;
878
+ getCommands(): DeviceCommands;
879
+ /**
880
+ * Canonical protocol discriminator.
881
+ *
882
+ * descriptor.protocolType is established by active probing; V2 features are mapped
883
+ * from DeviceInfoGet. All protocol branches must use this method instead of reading
884
+ * originalDescriptor.protocolType directly or inferring a protocol from features.
885
+ */
886
+ getProtocol(): 'V1' | 'V2';
887
+ isProtocolV2(): boolean;
888
+ getCurrentDeviceType(): IDeviceType;
889
+ getCurrentDeviceId(): string | undefined;
890
+ getCurrentSerialNo(): string;
891
+ getConnectId(): string;
892
+ getCurrentBleName(): string | null;
893
+ getCurrentLabel(): string | null;
894
+ getCurrentDisplayName(): string | null;
895
+ getCurrentPassphraseProtection(): boolean | null | undefined;
896
+ getCurrentFirmwareType(): EFirmwareType;
897
+ getCurrentFirmwareVersionString(): string;
898
+ getCurrentBLEFirmwareVersionString(): string | undefined;
899
+ getCurrentBootloaderVersionString(): string | undefined;
900
+ getCurrentSafetyChecks(): _onekeyfe_hd_transport.Enum_SafetyCheckLevel | null | undefined;
901
+ getCurrentMethodVersionRange(getVersionRange: (deviceModel: IDeviceType | IDeviceModel) => IVersionRange | undefined): IVersionRange | undefined;
902
+ supportNewPassphrase(): SupportFeatureType;
903
+ supportInputPinOnSoftware(): SupportFeatureType;
904
+ supportModifyHomescreen(): SupportFeatureType;
905
+ private getSessionCacheDeviceKey;
906
+ private reconcileSessionCacheDeviceIdentity;
907
+ getInternalState(_deviceId?: string): string | undefined;
908
+ getStandardInternalState(_deviceId?: string): {
909
+ passphraseState: string;
910
+ sessionId: string;
911
+ } | undefined;
912
+ updateInternalState(enablePassphrase: boolean, passphraseState: string | undefined, deviceId: string | undefined, sessionId?: string | null, featuresSessionId?: string | null, walletType?: 'standard' | 'hidden'): void;
913
+ private setInternalState;
914
+ clearInternalState(_deviceId?: string): void;
915
+ clearStandardInternalState(_deviceId?: string): void;
916
+ initialize(options?: InitOptions): Promise<void>;
917
+ /**
918
+ * Device initialization over Protocol V2.
919
+ *
920
+ * Protocol V2 bypasses legacy Initialize/GetFeatures and builds its canonical
921
+ * features state directly from DeviceInfoGet.
922
+ */
923
+ private _initializeProtocolV2;
924
+ getFeatures(): Promise<Features | undefined>;
925
+ getDeviceState(params?: DeviceStateReadOptions): Promise<DeviceState>;
926
+ refreshProtocolV2SettingsAfterMutation(): Promise<DeviceState>;
927
+ _updateFeatures(protoFeatures: Messages.Features | Features, initSession?: boolean): void;
928
+ updateState(patch: DeviceStatePatch, source: DeviceStateUpdateSource): DeviceState & {
929
+ raw?: DeviceFeaturesRaw | undefined;
847
930
  };
848
- };
849
- type RemoteConfigResponse = {
850
- bridge: AssetsMap['bridge'];
851
- } & DeviceTypeMap;
852
-
853
- declare function init(settings: Partial<ConnectSettings>, lowLevelApi?: LowLevelCoreApi, pulgin?: LowlevelTransportSharedPlugin): Promise<boolean>;
854
- declare function updateSettings(settings: Partial<ConnectSettings>): Promise<boolean>;
931
+ updateFeaturesPatch(patch: Partial<Features>, source: DeviceStateUpdateSource): Features | undefined;
932
+ ensureProtocolV2RuntimeContext(timeoutMs?: number, options?: {
933
+ forceRefresh?: boolean;
934
+ }): Promise<ProtocolInfo>;
935
+ probeProtocolV2RuntimeState(deviceInfo?: ProtocolV2DeviceInfo, timeoutMs?: number, options?: {
936
+ forceRuntimeContextRefresh?: boolean;
937
+ }): Promise<Features>;
938
+ updateProtocolV2Features(deviceInfo?: ProtocolV2DeviceInfo, deviceStatus?: DeviceStatus$1 | null, runtimeMode?: ProtocolV2RuntimeMode, protocolInfo?: ProtocolInfo): Features;
939
+ updateProtocolV2Status(status: DeviceStatus$1): Features;
940
+ private invalidateProtocolV2RuntimeState;
941
+ markTransportDisconnected(): void;
942
+ invalidateAfterWipe(): void;
943
+ markProtocolV2Reboot(rebootType: DeviceRebootType): void;
944
+ /**
945
+ * 暂时只在 acquire 后更新 Session ID
946
+ * 后续看是否有需要依据 listen 返回结果更新
947
+ * @param descriptor
948
+ */
949
+ updateDescriptor(descriptor: OneKeyDeviceInfo, forceUpdate?: boolean): void;
950
+ updateFromCache(device: Device): void;
951
+ run(fn?: () => Promise<void>, options?: RunOptions): Promise<void>;
952
+ _runInner<T>(fn: (() => Promise<T>) | undefined, options: RunOptions, runPromise: Deferred<void>): Promise<void>;
953
+ interruptionFromOutside(): Promise<void>;
954
+ interruptionFromUser(): Promise<void>;
955
+ setCancelableAction(callback: (err?: Error) => Promise<unknown>): void;
956
+ clearCancelableAction(): void;
957
+ getMode(): EOneKeyDeviceMode;
958
+ getStatus(): "available" | "occupied" | "used";
959
+ getFirmwareVersion(): IVersionArray | null;
960
+ getBLEFirmwareVersion(): IVersionArray | null;
961
+ isUsed(): boolean;
962
+ beginConnectionAttempt(): number;
963
+ wasInterruptedByUser(): boolean;
964
+ private throwIfInterruptedByUser;
965
+ /**
966
+ * Protocol Cancel is only for an acquired session that is already in a
967
+ * user-facing prompt. Connect, probe and initialize must not send Cancel
968
+ * and must not re-acquire just to deliver one.
969
+ */
970
+ private shouldSendFallbackProtocolCancel;
971
+ hasDeviceAcquire(): boolean;
972
+ isUsedHere(): boolean;
973
+ isUsedElsewhere(): boolean;
974
+ isBootloader(): boolean | undefined;
975
+ isRomloader(): boolean | undefined;
976
+ isInitialized(): boolean | undefined;
977
+ isSeedless(): boolean | undefined;
978
+ isUnacquired(): boolean;
979
+ hasUnexpectedMode(allow: string[], require: string[]): "ui-device_bootloader_mode" | "ui-device_not_in_bootloader_mode" | "ui-device_not_initialized" | "ui-device_seedless" | null;
980
+ hasUsePassphrase(): boolean;
981
+ checkDeviceId(deviceId: string): boolean;
982
+ lockDevice(): Promise<Success$1>;
983
+ beginProtocolV2UiInteraction(): void;
984
+ createProtocolV2UiPhaseMetadata(phase: HardwareUiInteractionMeta['phase'], transition: HardwareUiInteractionMeta['transition'], options?: {
985
+ phaseId?: string;
986
+ outcome?: HardwareUiInteractionMeta['outcome'];
987
+ }): HardwareUiInteractionMeta | undefined;
988
+ completeProtocolV2UiPhase(phase: HardwareUiInteractionMeta, outcome?: HardwareUiInteractionMeta['outcome']): HardwareUiInteractionMeta | undefined;
989
+ finishProtocolV2UiInteraction(outcome?: HardwareUiInteractionMeta['outcome'], options?: {
990
+ ensureMetadata?: boolean;
991
+ }): HardwareUiInteractionMeta | undefined;
992
+ hasOpenProtocolV2UiInteraction(): boolean;
993
+ supportUnlockVersionRange(): DeviceFirmwareRange;
994
+ unlockDevice(pinType?: DeviceSessionPinType, options?: ProtocolV2UiEventMetadata & {
995
+ emitUiEvent?: boolean;
996
+ }): Promise<Features | undefined>;
997
+ checkPassphraseStateSafety(passphraseState?: string, useEmptyPassphrase?: boolean, skipPassphraseCheck?: boolean, deriveCardano?: boolean): Promise<boolean>;
998
+ }
855
999
 
856
- declare function testInitializeDeviceDuration(connectId?: string, params?: CommonParams): Response<number>;
1000
+ /**
1001
+ * SDK Tracing Utilities
1002
+ * Tracks object instances and request call chains across multiple SDK instances
1003
+ */
1004
+ /**
1005
+ * Generate SDK instance ID
1006
+ * @returns Format: "SDK-<number>-<timestamp>"
1007
+ * @example "SDK-1-123456"
1008
+ */
1009
+ declare function generateSdkInstanceId(): string;
1010
+ /**
1011
+ * Generate globally unique instance ID
1012
+ * @param type Instance type (Device, DeviceCommands, BaseMethod, etc.)
1013
+ * @param sdkInstanceId SDK instance ID (optional)
1014
+ * @returns Format: <SDK>.<type>-<number>-<timestamp>
1015
+ * @example "SDK-1.Device-1-123456" or "Device-1-123456"
1016
+ */
1017
+ declare function generateInstanceId(type: string, sdkInstanceId?: string): string;
1018
+ /**
1019
+ * Request context information
1020
+ */
1021
+ interface RequestContext {
1022
+ /** Request unique ID (reuses BaseMethod.responseID) */
1023
+ responseID: number;
1024
+ /** SDK instance ID */
1025
+ sdkInstanceId?: string;
1026
+ /** API method name */
1027
+ methodName: string;
1028
+ /** Device connection ID */
1029
+ connectId?: string;
1030
+ /** Device instance ID */
1031
+ deviceInstanceId?: string;
1032
+ /** DeviceCommands instance ID */
1033
+ commandsInstanceId?: string;
1034
+ /** Parent request ID (for nested calls like allNetworkGetAddress) */
1035
+ parentResponseID?: number;
1036
+ /** Request start time */
1037
+ startTime: number;
1038
+ /** Request end time */
1039
+ endTime?: number;
1040
+ /** Request status */
1041
+ status?: 'pending' | 'running' | 'success' | 'error' | 'cancelled';
1042
+ /** Error message */
1043
+ error?: string;
1044
+ }
1045
+ /**
1046
+ * SDK instance tracing context
1047
+ */
1048
+ interface SdkTracingContext {
1049
+ /** SDK instance ID */
1050
+ sdkInstanceId: string;
1051
+ /** Creation timestamp */
1052
+ createdAt: number;
1053
+ /** Active requests */
1054
+ activeRequests: Map<number, RequestContext>;
1055
+ }
1056
+ /**
1057
+ * Create SDK instance tracing context
1058
+ */
1059
+ declare function createSdkTracingContext(): SdkTracingContext;
1060
+ /**
1061
+ * Create and register request context
1062
+ * @param responseID Request ID (reuses BaseMethod.responseID)
1063
+ * @param methodName API method name
1064
+ * @param options Additional options
1065
+ */
1066
+ declare function createRequestContext(responseID: number, methodName: string, options?: {
1067
+ sdkInstanceId?: string;
1068
+ connectId?: string;
1069
+ deviceInstanceId?: string;
1070
+ commandsInstanceId?: string;
1071
+ parentResponseID?: number;
1072
+ }): RequestContext;
1073
+ /**
1074
+ * Update request context
1075
+ */
1076
+ declare function updateRequestContext(responseID: number, updates: Partial<RequestContext>): void;
1077
+ /**
1078
+ * Complete request context
1079
+ */
1080
+ declare function completeRequestContext(responseID: number, error?: Error): void;
1081
+ /**
1082
+ * Get active requests for specific Device instance
1083
+ */
1084
+ declare function getActiveRequestsByDeviceInstance(deviceInstanceId: string): RequestContext[];
1085
+ /**
1086
+ * Format request context for logging
1087
+ */
1088
+ declare function formatRequestContext(context: RequestContext): string;
1089
+ /**
1090
+ * Cleanup specific SDK instance
1091
+ */
1092
+ declare function cleanupSdkInstance(sdkInstanceId: string): void;
857
1093
 
858
- declare function preInitialize(connectId: string, params?: CommonParams): Response<boolean>;
1094
+ declare class Core extends EventEmitter {
1095
+ private tracingContext;
1096
+ readonly sdkInstanceId: string;
1097
+ private requestQueue;
1098
+ private disposePromise?;
1099
+ private prePendingCallPromises;
1100
+ private methodSynchronize;
1101
+ constructor();
1102
+ private getCoreContext;
1103
+ handleMessage(message: CoreMessage): Promise<any>;
1104
+ dispose(): Promise<void>;
1105
+ private disposeResources;
1106
+ }
1107
+ declare const init$1: (settings: ConnectSettings, Transport: any, plugin?: LowlevelTransportSharedPlugin) => Promise<Core | undefined>;
1108
+ declare const switchTransport: ({ env, Transport, plugin, }: {
1109
+ env: ConnectSettings['env'];
1110
+ Transport: any;
1111
+ plugin?: LowlevelTransportSharedPlugin | undefined;
1112
+ }) => void;
859
1113
 
860
- declare function getLogs(): Response<string[]>;
1114
+ declare const PRO2_WALLPAPER_WIDTH = 604;
1115
+ declare const PRO2_WALLPAPER_HEIGHT = 1024;
1116
+ type Pro2WallpaperColorFormat = 'RGB565' | 'RGB565A8';
1117
+ declare function encodePro2Wallpaper(options: {
1118
+ width: number;
1119
+ height: number;
1120
+ rgba: Uint8Array | ArrayBuffer;
1121
+ }): {
1122
+ data: Uint8Array;
1123
+ colorFormat: Pro2WallpaperColorFormat;
1124
+ };
861
1125
 
862
- type ClearSessionCacheParams = {
863
- deviceId?: string;
864
- passphraseState?: string;
1126
+ type DeviceUploadWallpaperParams = {
1127
+ jpegBase64: string;
1128
+ fileName?: string;
1129
+ chunkSize?: number;
865
1130
  };
866
- type ClearSessionCachePayload = {
867
- cleared: true;
1131
+ type DeviceUploadWallpaperResponse = {
1132
+ path: string;
1133
+ size: number;
1134
+ colorFormat: Pro2WallpaperColorFormat;
1135
+ message?: string;
868
1136
  };
869
- declare function clearSessionCache(params?: ClearSessionCacheParams): Response<ClearSessionCachePayload>;
870
-
871
- declare function checkBridgeStatus(): Response<boolean>;
872
-
873
- type CheckBridgeReleaseResponse = {
874
- shouldUpdate: boolean;
875
- status: 'outdated' | 'valid';
876
- releaseVersion: string;
877
- } | null;
878
- declare function checkBridgeRelease(connectId?: string, params?: CommonParams & {
879
- willUpdateFirmwareVersion?: string;
880
- }): Response<CheckBridgeReleaseResponse>;
881
1137
 
882
- type CheckBootloaderReleaseResponse = {
883
- shouldUpdate: boolean;
884
- status: 'outdated' | 'valid';
885
- release: string | undefined;
886
- bootloaderMode: boolean;
887
- } | null;
888
- type CheckBootloaderReleaseParams = {
889
- willUpdateFirmwareVersion?: string;
890
- firmwareType?: EFirmwareType;
1138
+ type DeviceUploadNftParams = {
1139
+ imageJpegBase64: string;
1140
+ thumbnailJpegBase64: string;
1141
+ title: string;
1142
+ subtitle: string;
1143
+ timestampMs?: number;
1144
+ chunkSize?: number;
1145
+ paceMs?: number;
1146
+ timeoutMs?: number;
1147
+ };
1148
+ type DeviceUploadNftResponse = {
1149
+ basename: string;
1150
+ imagePath: string;
1151
+ thumbnailPath: string;
1152
+ metadataPath: string;
1153
+ totalSize: number;
1154
+ nftUpdated: true;
1155
+ message?: string;
891
1156
  };
892
- declare function checkBootloaderRelease(connectId?: string, params?: CommonParams & CheckBootloaderReleaseParams): Response<CheckBootloaderReleaseResponse>;
893
1157
 
894
- type FirmwareRelease$2 = {
895
- shouldUpdate?: boolean;
896
- status: IDeviceFirmwareStatus;
897
- changelog?: {
898
- 'zh-CN': string;
899
- 'en-US': string;
900
- }[];
901
- release: IDeviceBLEFirmwareStatus | IBLEFirmwareReleaseInfo;
902
- bootloaderMode?: boolean;
903
- };
904
- type AllFirmwareRelease = {
905
- firmware: FirmwareRelease$2;
906
- ble: FirmwareRelease$2;
907
- bootloader?: FirmwareRelease$2;
908
- bridge?: FirmwareRelease$2;
909
- features?: Features$1;
910
- };
911
- type CheckAllFirmwareReleaseParams = {
912
- checkBridgeRelease?: boolean;
913
- firmwareType?: EFirmwareType;
1158
+ type FileInfo = {
1159
+ path: string;
1160
+ offset: number;
1161
+ total_size: number;
1162
+ data?: Uint8Array;
1163
+ data_hash?: number;
1164
+ processed_byte?: number;
1165
+ chunks?: number;
914
1166
  };
915
- declare function checkAllFirmwareRelease(connectId?: string, params?: CommonParams & CheckAllFirmwareReleaseParams): Response<AllFirmwareRelease>;
916
-
917
- type CheckFirmwareTypeAvailableParams = {
918
- deviceType: EDeviceType;
919
- firmwareType: EFirmwareType;
1167
+ type TestProtocolV2PingParams = CommonParams & {
1168
+ /** Firmware diagnostic echo payload, limited to 63 UTF-8 bytes. */
1169
+ message?: string;
920
1170
  };
921
- declare function checkFirmwareTypeAvailable(params: CheckFirmwareTypeAvailableParams): Response<FirmwareRelease$2 | undefined>;
1171
+ declare function testProtocolV2Ping(connectId: string, params?: TestProtocolV2PingParams): Response<Success$1>;
1172
+ declare function deviceReboot(connectId: string, params: CommonParams & DeviceRebootParams): Response<Success$1>;
1173
+ declare function deviceGetOnboardingStatus(connectId: string, params?: CommonParams): Response<OnboardingStatus>;
1174
+ declare function deviceUploadWallpaper(connectId: string, params: CommonParams & DeviceUploadWallpaperParams): Response<DeviceUploadWallpaperResponse>;
1175
+ declare function deviceUploadNft(connectId: string, params: CommonParams & DeviceUploadNftParams): Response<DeviceUploadNftResponse>;
1176
+ declare function uploadPortfolio(connectId: string, params: {
1177
+ packageBase64: string;
1178
+ timeoutMs?: number | string;
1179
+ }): Response<FileInfo & {
1180
+ portfolioUpdated: true;
1181
+ }>;
922
1182
 
923
- declare function searchDevices(params?: CommonParams): Response<SearchDevice[]>;
1183
+ declare const on: <T extends string, P extends (...args: any[]) => any>(type: T, fn: P) => void;
1184
+ declare const off: (type: any, fn: any) => void;
1185
+ declare const removeAllListeners: (type: any) => void;
924
1186
 
925
- declare function getFeatures(connectId?: string, params?: CommonParams): Response<Features>;
1187
+ declare function uiResponse(response: UiResponseEvent): void;
926
1188
 
927
- type DeviceInfoProtocol = ProtocolType | 'unknown';
928
- type DeviceInfoSource = 'features' | 'protocolV1OneKeyFeatures' | 'deviceInfo';
929
- type DeviceInfoScope = 'basic' | 'versions' | 'verify' | 'full';
930
- type GetDeviceInfoParams = {
931
- scope?: DeviceInfoScope;
932
- refresh?: boolean;
933
- includeRaw?: boolean;
934
- };
935
- type DeviceInfoMode = 'normal' | 'bootloader' | 'romloader' | 'notInitialized' | 'unknown';
936
- type DeviceInfoStatus = {
937
- mode: DeviceInfoMode;
938
- initialized: boolean | null;
939
- bootloaderMode: boolean | null;
940
- unlocked: boolean | null;
941
- passphraseProtection: boolean | null;
942
- attachToPinEnabled?: boolean | null;
943
- unlockedAttachPin?: boolean | null;
944
- backupRequired: boolean | null;
945
- noBackup: boolean | null;
946
- language: string | null;
947
- bleEnabled: boolean | null;
948
- };
949
- type DeviceProfileVersions = {
950
- firmware: string | null;
951
- bootloader: string | null;
952
- board: string | null;
953
- ble: string | null;
954
- se01?: string | null;
955
- se02?: string | null;
956
- se03?: string | null;
957
- se04?: string | null;
958
- se01Boot?: string | null;
959
- se02Boot?: string | null;
960
- se03Boot?: string | null;
961
- se04Boot?: string | null;
962
- };
963
- type DeviceProfileVerify = {
964
- firmwareBuildId?: string;
965
- firmwareHash?: string;
966
- bootloaderBuildId?: string;
967
- bootloaderHash?: string;
968
- boardBuildId?: string;
969
- boardHash?: string;
970
- bleBuildId?: string;
971
- bleHash?: string;
972
- se01BuildId?: string;
973
- se01Hash?: string;
974
- se02BuildId?: string;
975
- se02Hash?: string;
976
- se03BuildId?: string;
977
- se03Hash?: string;
978
- se04BuildId?: string;
979
- se04Hash?: string;
980
- se01BootBuildId?: string;
981
- se01BootHash?: string;
982
- se02BootBuildId?: string;
983
- se02BootHash?: string;
984
- se03BootBuildId?: string;
985
- se03BootHash?: string;
986
- se04BootBuildId?: string;
987
- se04BootHash?: string;
988
- };
989
- type DeviceProfileRaw = {
990
- features?: Features;
991
- protocolV1OneKeyFeatures?: OnekeyFeatures;
992
- protocolV2DeviceInfo?: ProtocolV2DeviceInfo;
993
- };
994
- type DeviceProfile = {
995
- protocol: DeviceInfoProtocol;
996
- sources: DeviceInfoSource[];
997
- deviceType: IDeviceType;
998
- firmwareType: EFirmwareType;
999
- deviceId: string;
1000
- serialNo: string;
1001
- label: string | null;
1002
- bleName: string | null;
1003
- status: DeviceInfoStatus;
1004
- versions: DeviceProfileVersions;
1005
- verify?: DeviceProfileVerify;
1006
- raw?: DeviceProfileRaw;
1189
+ type IAddHardwareGlobalEventListener = (coreMessage: CoreMessage) => void;
1190
+ interface LowLevelInjectApi {
1191
+ call: CallMethod;
1192
+ eventEmitter: EventEmitter$1;
1193
+ init: CoreApi['init'];
1194
+ dispose: CoreApi['dispose'];
1195
+ uiResponse: CoreApi['uiResponse'];
1196
+ cancel: CoreApi['cancel'];
1197
+ updateSettings: CoreApi['updateSettings'];
1198
+ switchTransport: CoreApi['switchTransport'];
1199
+ addHardwareGlobalEventListener: (listener: IAddHardwareGlobalEventListener) => void;
1200
+ }
1201
+ type LowLevelCoreApi = Omit<CoreApi, 'on' | 'off'> & {
1202
+ addHardwareGlobalEventListener: (listener: IAddHardwareGlobalEventListener) => void;
1007
1203
  };
1008
- declare function getDeviceInfo(connectId?: string, params?: CommonParams & GetDeviceInfoParams): Response<DeviceProfile>;
1009
1204
 
1010
- declare function getOnekeyFeatures(connectId?: string, params?: CommonParams): Response<OnekeyFeatures>;
1205
+ declare function init(settings: Partial<ConnectSettings>, lowLevelApi?: LowLevelCoreApi, pulgin?: LowlevelTransportSharedPlugin): Promise<boolean>;
1206
+ declare function updateSettings(settings: Partial<ConnectSettings>): Promise<boolean>;
1207
+
1208
+ declare function testInitializeDeviceDuration(connectId?: string, params?: CommonParams): Response<number>;
1011
1209
 
1012
- type GetPassphraseStateParams = CommonParams;
1013
- declare function getPassphraseState(connectId?: string, params?: GetPassphraseStateParams): Response<string | undefined>;
1210
+ declare function preInitialize(connectId: string, params?: CommonParams): Response<boolean>;
1014
1211
 
1015
- type FirmwareRelease$1 = {
1016
- status: IDeviceFirmwareStatus;
1017
- changelog: {
1018
- 'en-US': string;
1019
- 'zh-CN': string;
1020
- }[];
1021
- release: IFirmwareReleaseInfo;
1022
- bootloaderMode: boolean;
1212
+ declare function getLogs(): Response<string[]>;
1213
+
1214
+ type ClearSessionCacheParams = {
1215
+ deviceId?: never;
1216
+ passphraseState?: never;
1217
+ } | {
1218
+ deviceId: string;
1219
+ passphraseState?: string;
1023
1220
  };
1024
- type CheckFirmwareReleaseParams = {
1025
- firmwareType?: EFirmwareType;
1221
+ type ClearSessionCachePayload = {
1222
+ cleared: true;
1026
1223
  };
1027
- declare function checkFirmwareRelease(connectId?: string, params?: CheckFirmwareReleaseParams): Response<FirmwareRelease$1>;
1224
+ declare function clearSessionCache(params?: ClearSessionCacheParams): Response<ClearSessionCachePayload>;
1028
1225
 
1029
- type BleFirmwareRelease = {
1030
- status: IDeviceBLEFirmwareStatus;
1031
- changelog: {
1032
- 'zh-CN': string;
1033
- 'en-US': string;
1034
- }[];
1035
- release: IBLEFirmwareReleaseInfo;
1036
- bootloaderMode: boolean;
1037
- };
1038
- declare function checkBLEFirmwareRelease(connectId?: string): Response<BleFirmwareRelease>;
1226
+ declare function checkBridgeStatus(): Response<boolean>;
1227
+
1228
+ type CheckBridgeReleaseResponse = {
1229
+ shouldUpdate: boolean;
1230
+ status: 'outdated' | 'valid';
1231
+ releaseVersion: string;
1232
+ } | null;
1233
+ declare function checkBridgeRelease(connectId?: string, params?: CommonParams & {
1234
+ willUpdateFirmwareVersion?: string;
1235
+ }): Response<CheckBridgeReleaseResponse>;
1236
+
1237
+ type FirmwareUpdatePlanArtifactRole = 'firmware' | 'ble' | 'bootloader' | 'resource' | 'component' | 'resourceBundle';
1238
+ type FirmwareUpdatePlanTarget = 'firmware' | 'ble' | 'bootloader' | FirmwareUpdateV4Target;
1239
+ type FirmwareUpdatePlanForceTarget = 'firmware' | 'ble' | 'bootloader' | 'resource';
1240
+ interface FirmwareUpdatePlanArtifact {
1241
+ artifactId: string;
1242
+ role: FirmwareUpdatePlanArtifactRole;
1243
+ target: FirmwareUpdatePlanTarget;
1244
+ url: string;
1245
+ container: 'raw' | 'zip';
1246
+ logicalName?: string;
1247
+ expectedSize?: number;
1248
+ expectedSha256?: string;
1249
+ targetVersion?: string;
1250
+ }
1251
+ interface FirmwareUpdatePlan {
1252
+ schemaVersion: 2;
1253
+ planDigest: string;
1254
+ executor: 'v2' | 'v3' | 'v4';
1255
+ deviceIdentity: string;
1256
+ deviceModel: string;
1257
+ firmwareType: EFirmwareType;
1258
+ platform: 'native' | 'desktop' | 'ext' | 'web' | 'web-embed';
1259
+ artifacts: FirmwareUpdatePlanArtifact[];
1260
+ targetsToUpdate: FirmwareUpdatePlanTarget[];
1261
+ }
1262
+
1263
+ interface FirmwareUpdatePreparedEntry {
1264
+ entryName: string;
1265
+ artifact: FirmwareArtifactReference;
1266
+ }
1267
+ interface FirmwareUpdatePreparedArtifactInput {
1268
+ artifactId: string;
1269
+ artifact: FirmwareArtifactReference;
1270
+ materializedEntries?: FirmwareUpdatePreparedEntry[];
1271
+ }
1272
+ interface FirmwareUpdatePreparedArtifact {
1273
+ artifactId: string;
1274
+ role: FirmwareUpdatePlanArtifactRole;
1275
+ target: FirmwareUpdatePlanTarget;
1276
+ container: 'raw' | 'zip';
1277
+ logicalName?: string;
1278
+ targetVersion?: string;
1279
+ artifact: FirmwareArtifactReference;
1280
+ materializedEntries?: FirmwareUpdatePreparedEntry[];
1281
+ }
1282
+ interface FirmwareUpdatePreparedPlan {
1283
+ schemaVersion: 2;
1284
+ preparedPlanDigest: string;
1285
+ planDigest: string;
1286
+ networkPolicy: 'forbid';
1287
+ executor: FirmwareUpdatePlan['executor'];
1288
+ deviceIdentity: string;
1289
+ deviceModel: string;
1290
+ firmwareType: FirmwareUpdatePlan['firmwareType'];
1291
+ platform: FirmwareUpdatePlan['platform'];
1292
+ leaseRef: string;
1293
+ artifacts: FirmwareUpdatePreparedArtifact[];
1294
+ targetsToUpdate: FirmwareUpdatePlanTarget[];
1295
+ }
1296
+ declare function prepareFirmwareUpdatePlan(input: {
1297
+ plan: FirmwareUpdatePlan;
1298
+ leaseRef: string;
1299
+ artifacts: FirmwareUpdatePreparedArtifactInput[];
1300
+ }): FirmwareUpdatePreparedPlan;
1301
+ declare function validateFirmwareUpdatePreparedPlan(value: unknown): FirmwareUpdatePreparedPlan;
1039
1302
 
1040
1303
  type IUpdateType = 'firmware' | 'ble';
1304
+ interface FirmwareArtifactReference {
1305
+ artifactRef: string;
1306
+ size: number;
1307
+ sha256: string;
1308
+ }
1309
+ interface FirmwareArtifactReader {
1310
+ open(input: {
1311
+ artifactRef: string;
1312
+ }): Promise<{
1313
+ readerId: string;
1314
+ size: number;
1315
+ }>;
1316
+ read(input: {
1317
+ readerId: string;
1318
+ offset: number;
1319
+ length: number;
1320
+ }): Promise<{
1321
+ data: ArrayBuffer;
1322
+ bytesRead: number;
1323
+ eof: boolean;
1324
+ }>;
1325
+ close(input: {
1326
+ readerId: string;
1327
+ }): Promise<void>;
1328
+ }
1329
+ interface FirmwareUpdateHostBinding {
1330
+ artifactReader: FirmwareArtifactReader;
1331
+ /** 将读取器 generation 绑定到包含 ZIP 条目的完整 PreparedPlan。 */
1332
+ preparedPlanDigest: string;
1333
+ }
1041
1334
  interface FirmwareUpdateBinaryParams {
1042
1335
  binary: ArrayBuffer;
1043
1336
  updateType: IUpdateType;
1044
1337
  }
1338
+ interface FirmwareUpdateArtifactParams {
1339
+ preparedPlan: FirmwareUpdatePreparedPlan;
1340
+ hostBindingGeneration: number;
1341
+ /** @deprecated Core derives the component artifact from preparedPlan. */
1342
+ artifact?: FirmwareArtifactReference;
1343
+ resourceEntries?: Array<{
1344
+ entryName: string;
1345
+ artifact: FirmwareArtifactReference;
1346
+ }>;
1347
+ updateType: IUpdateType;
1348
+ forcedUpdateRes?: boolean;
1349
+ isUpdateBootloader?: boolean;
1350
+ firmwareType?: EFirmwareType;
1351
+ }
1045
1352
  interface FirmwareUpdateParams {
1046
1353
  version?: number[];
1047
1354
  updateType: IUpdateType;
@@ -1061,7 +1368,10 @@ type Platform = {
1061
1368
  };
1062
1369
  declare function firmwareUpdateV2(connectId: string | undefined, params: Params<FirmwareUpdateParams & Platform>): Response<Messages.Success>;
1063
1370
  declare function firmwareUpdateV2(connectId: string | undefined, params: Params<FirmwareUpdateBinaryParams & Platform>): Response<Messages.Success>;
1371
+ declare function firmwareUpdateV2(connectId: string | undefined, params: Params<FirmwareUpdateArtifactParams & Platform>): Response<Messages.Success>;
1064
1372
  interface FirmwareUpdateV3Params {
1373
+ preparedPlan?: FirmwareUpdatePreparedPlan;
1374
+ hostBindingGeneration?: number;
1065
1375
  bleVersion?: number[];
1066
1376
  bleBinary?: ArrayBuffer;
1067
1377
  chunkSize?: number;
@@ -1073,28 +1383,58 @@ interface FirmwareUpdateV3Params {
1073
1383
  forcedUpdateRes?: boolean;
1074
1384
  firmwareType?: EFirmwareType;
1075
1385
  platform: IPlatform;
1386
+ artifactReader?: FirmwareArtifactReader;
1387
+ artifacts?: {
1388
+ ble?: FirmwareArtifactReference;
1389
+ firmware?: FirmwareArtifactReference;
1390
+ bootloader?: FirmwareArtifactReference;
1391
+ resourceEntries?: Array<{
1392
+ entryName: string;
1393
+ artifact: FirmwareArtifactReference;
1394
+ }>;
1395
+ };
1076
1396
  }
1077
- type FirmwareUpdateV4Target = 'boot' | 'app_v1' | 'app_v2' | 'coprocessor' | 'resource' | 'se01' | 'se02' | 'se03' | 'se04';
1397
+ /**
1398
+ * firmwareUpdateV4 target binaries grouped by DeviceFirmwareTargetType.
1399
+ * Except for romloader, each field maps to a target accepted by bootloader.
1400
+ */
1401
+ type FirmwareUpdateV4Target = 'boot'
1402
+ /** @deprecated Use resource with resourceArchiveBinary. */
1403
+ | 'boot_resources' | 'app_v1' | 'app_v2' | 'coprocessor' | 'resource' | 'se01' | 'se02' | 'se03' | 'se04';
1078
1404
  interface FirmwareUpdateV4Params {
1405
+ preparedPlan?: FirmwareUpdatePreparedPlan;
1406
+ /** Required whenever preparedPlan is present; Core resolves the reader from this digest-bound host. */
1407
+ hostBindingGeneration?: number;
1079
1408
  platform: IPlatform;
1409
+ expectedDeviceId?: string;
1080
1410
  chunkSize?: number;
1081
1411
  firmwareType?: EFirmwareType;
1082
1412
  targetsToUpdate?: FirmwareUpdateV4Target[];
1413
+ expectedTargetVersions?: Partial<Record<FirmwareUpdateV4Target, string>>;
1414
+ /** FW_MGMT_TARGET_ROMLOADER = 2; Pro2 cannot install it through firmwareUpdateV4. */
1083
1415
  romloaderBinary?: ArrayBuffer;
1416
+ /** FW_MGMT_TARGET_BOOTLOADER = 3 */
1084
1417
  bootloaderBinary?: ArrayBuffer;
1418
+ /** FW_MGMT_TARGET_APPLICATION_P1 = 4 */
1085
1419
  applicationP1Binary?: ArrayBuffer;
1420
+ /** FW_MGMT_TARGET_APPLICATION_P2 = 5 */
1086
1421
  applicationP2Binary?: ArrayBuffer;
1422
+ /** FW_MGMT_TARGET_COPROCESSOR = 6 */
1087
1423
  coprocessorBinary?: ArrayBuffer;
1424
+ /** FW_MGMT_TARGET_SE01-04 = 7-10 */
1088
1425
  se01Binary?: ArrayBuffer;
1089
1426
  se02Binary?: ArrayBuffer;
1090
1427
  se03Binary?: ArrayBuffer;
1091
1428
  se04Binary?: ArrayBuffer;
1429
+ /** Complete Protocol V2 resource ZIP for local development; Core converts it to a local PreparedPlan. */
1430
+ resourceArchiveBinary?: ArrayBuffer;
1092
1431
  forcedUpdateRes?: boolean;
1093
- resourceBundleFiles?: Array<{
1094
- binary: ArrayBuffer;
1095
- devicePath: string;
1096
- }>;
1432
+ artifactReader?: FirmwareArtifactReader;
1433
+ componentArtifacts?: Partial<Record<Exclude<FirmwareUpdateV4Target, 'resource' | 'boot_resources'>, FirmwareArtifactReference>>;
1097
1434
  }
1435
+ declare function registerFirmwareUpdateHostBinding$1(binding: FirmwareUpdateHostBinding): number;
1436
+ declare function unregisterFirmwareUpdateHostBinding$1(generation?: number): boolean;
1437
+ declare function getFirmwareUpdateHostBindingGeneration$1(): number;
1098
1438
  declare function firmwareUpdateV3(connectId: string | undefined, params: Params<FirmwareUpdateV3Params>): Response<{
1099
1439
  bleVersion: string;
1100
1440
  firmwareVersion: string;
@@ -1106,6 +1446,157 @@ declare function firmwareUpdateV4(connectId: string | undefined, params: Params<
1106
1446
  bootloaderVersion: string;
1107
1447
  }>;
1108
1448
 
1449
+ type ProtocolV2ComponentReleaseInfo = IProtocolV2FirmwareComponent & {
1450
+ protocol: 'V2';
1451
+ configKey: string;
1452
+ componentTarget: IProtocolV2FirmwareComponentTarget;
1453
+ required: boolean;
1454
+ changelog: IFirmwareReleaseInfo['changelog'];
1455
+ };
1456
+ type FirmwareReleaseCheckResult = {
1457
+ shouldUpdate?: boolean;
1458
+ status: IDeviceFirmwareStatus;
1459
+ changelog?: {
1460
+ 'zh-CN': string;
1461
+ 'en-US': string;
1462
+ }[];
1463
+ release: IBLEFirmwareReleaseInfo | IFirmwareReleaseInfo | ProtocolV2ComponentReleaseInfo | undefined;
1464
+ bootloaderMode?: boolean;
1465
+ };
1466
+ type BridgeReleaseCheckResult = Omit<FirmwareReleaseCheckResult, 'release'> & {
1467
+ release: string | undefined;
1468
+ };
1469
+ type ProtocolV2FirmwareComponentReleaseStatus = 'valid' | 'outdated' | 'unknown' | 'unsupported';
1470
+ type ProtocolV2FirmwareReleaseStatus = 'unavailable' | 'valid' | 'unknown' | 'outdated' | 'required';
1471
+ type ProtocolV2FirmwareComponentRelease = {
1472
+ configKey: string;
1473
+ componentTarget: IProtocolV2FirmwareComponentTarget;
1474
+ updateTarget: FirmwareUpdateV4Target | null;
1475
+ currentVersion: string | null;
1476
+ targetVersion: string | null;
1477
+ status: ProtocolV2FirmwareComponentReleaseStatus;
1478
+ required: boolean;
1479
+ };
1480
+ type AllFirmwareRelease = {
1481
+ firmware: FirmwareReleaseCheckResult;
1482
+ ble: FirmwareReleaseCheckResult;
1483
+ bootloader?: FirmwareReleaseCheckResult;
1484
+ bridge?: BridgeReleaseCheckResult;
1485
+ features?: Features;
1486
+ protocol?: 'V1' | 'V2';
1487
+ deviceType?: 'pro2' | 'neo';
1488
+ firmwareType?: EFirmwareType;
1489
+ status?: ProtocolV2FirmwareReleaseStatus;
1490
+ hasUpgrade?: boolean;
1491
+ required?: boolean;
1492
+ resourceStatus?: 'valid' | 'outdated' | 'unknown';
1493
+ resourceArchive?: IProtocolV2ResourceSource;
1494
+ currentVersions?: DeviceStateVersions;
1495
+ components?: ProtocolV2FirmwareComponentRelease[];
1496
+ targetsToUpdate?: FirmwareUpdateV4Target[];
1497
+ release?: IFirmwareReleaseInfo;
1498
+ firmwareUpdatePlan?: FirmwareUpdatePlan;
1499
+ };
1500
+ type CheckAllFirmwareReleaseParams = {
1501
+ checkBridgeRelease?: boolean;
1502
+ checkFirmwareHash?: boolean;
1503
+ firmwareType?: EFirmwareType;
1504
+ platform?: 'native' | 'desktop' | 'ext' | 'web' | 'web-embed';
1505
+ forceUpdateTargets?: FirmwareUpdatePlanForceTarget[];
1506
+ protocolV2ForceUpdateTargets?: FirmwareUpdateV4Target[];
1507
+ };
1508
+ declare function checkAllFirmwareRelease(connectId?: string, params?: CommonParams & CheckAllFirmwareReleaseParams): Response<AllFirmwareRelease>;
1509
+
1510
+ type CheckBootloaderReleaseResponse = FirmwareReleaseCheckResult | null;
1511
+ type CheckBootloaderReleaseParams = {
1512
+ willUpdateFirmwareVersion?: string;
1513
+ firmwareType?: EFirmwareType;
1514
+ };
1515
+ declare function checkBootloaderRelease(connectId?: string, params?: CommonParams & CheckBootloaderReleaseParams): Response<CheckBootloaderReleaseResponse>;
1516
+
1517
+ type CheckFirmwareTypeAvailableParams = {
1518
+ deviceType: EDeviceType;
1519
+ firmwareType: EFirmwareType;
1520
+ };
1521
+ declare function checkFirmwareTypeAvailable(params: CheckFirmwareTypeAvailableParams): Response<FirmwareReleaseCheckResult | undefined>;
1522
+
1523
+ declare function searchDevices(params?: CommonParams): Response<SearchDevice[]>;
1524
+
1525
+ declare function detectDeviceConnectProtocol(connectId: string): Response<HardwareConnectProtocol>;
1526
+
1527
+ /**
1528
+ * @deprecated Use `getDeviceState` for both Protocol V1 and Protocol V2 devices.
1529
+ */
1530
+ declare function getFeatures(connectId?: string, params?: CommonParams): Response<Features>;
1531
+
1532
+ /**
1533
+ * @deprecated Use `getDeviceState(connectId, { scope: 'firmware' })`.
1534
+ */
1535
+ declare function getOnekeyFeatures(connectId?: string, params?: CommonParams): Response<OnekeyFeatures>;
1536
+
1537
+ type GetPassphraseStateParams = CommonParams;
1538
+ /**
1539
+ * Compatibility wallet-state API for existing App integrations.
1540
+ *
1541
+ * Protocol V1 keeps its parameterless firmware flow. Protocol V2 maps the existing
1542
+ * `useEmptyPassphrase` and `initSession` intent to the device-only wallet-session flow.
1543
+ * New integrations should prefer `openWalletSession` for explicit wallet intent.
1544
+ */
1545
+ declare function getPassphraseState(connectId?: string, params?: GetPassphraseStateParams): Response<string | undefined>;
1546
+
1547
+ declare const OpenWalletSessionMode: {
1548
+ readonly Standard: "standard";
1549
+ readonly SelectHidden: "select-hidden";
1550
+ readonly ResumeHidden: "resume-hidden";
1551
+ };
1552
+ type OpenWalletSessionModeValue = (typeof OpenWalletSessionMode)[keyof typeof OpenWalletSessionMode];
1553
+ type OpenWalletSessionParams = {
1554
+ mode: typeof OpenWalletSessionMode.Standard;
1555
+ deviceId?: never;
1556
+ passphraseState?: never;
1557
+ } | {
1558
+ mode: typeof OpenWalletSessionMode.SelectHidden;
1559
+ deviceId?: never;
1560
+ passphraseState?: never;
1561
+ } | {
1562
+ mode: typeof OpenWalletSessionMode.ResumeHidden;
1563
+ deviceId: string;
1564
+ passphraseState: string;
1565
+ };
1566
+ type OpenWalletSessionPayloadBase = {
1567
+ protocol: 'V1' | 'V2';
1568
+ deviceId: string;
1569
+ resumed: boolean;
1570
+ };
1571
+ type OpenWalletSessionPayload = OpenWalletSessionPayloadBase & ({
1572
+ walletType: 'standard';
1573
+ passphraseState: null;
1574
+ } | {
1575
+ walletType: 'hidden';
1576
+ passphraseState: string;
1577
+ });
1578
+ /**
1579
+ * Opens the standard, hidden, or Attach-to-PIN wallet flow through a unified
1580
+ * Protocol V1/V2 API.
1581
+ */
1582
+ declare function openWalletSession(connectId: string, params: CommonParams & OpenWalletSessionParams): Response<OpenWalletSessionPayload>;
1583
+
1584
+ type CheckFirmwareReleaseParams = {
1585
+ firmwareType?: EFirmwareType;
1586
+ };
1587
+ declare function checkFirmwareRelease(connectId?: string, params?: CheckFirmwareReleaseParams): Response<FirmwareReleaseCheckResult | null>;
1588
+
1589
+ declare function checkBLEFirmwareRelease(connectId?: string): Response<FirmwareReleaseCheckResult | null>;
1590
+
1591
+ interface FirmwareUpdateCapabilities {
1592
+ planSchemaVersion: 2;
1593
+ preparedPlanSchemaVersion: 2;
1594
+ hostBindingProtocolVersion: 2;
1595
+ manifestModes: Array<'external-only' | 'sdk-managed'>;
1596
+ supportsArtifactReader: true;
1597
+ }
1598
+ declare function getFirmwareUpdateCapabilities(): FirmwareUpdateCapabilities;
1599
+
1109
1600
  declare function promptWebDeviceAccess(options?: {
1110
1601
  deviceSerialNumberFromUI?: string;
1111
1602
  }): Response<{
@@ -1165,16 +1656,40 @@ type DeviceSettingsParams = {
1165
1656
  language?: string;
1166
1657
  label?: string;
1167
1658
  usePassphrase?: boolean;
1659
+ /** Protocol V1 only. */
1168
1660
  homescreen?: string;
1661
+ /** Protocol V1 only. */
1169
1662
  passphraseSource?: number;
1170
1663
  autoLockDelayMs?: number;
1664
+ /** Protocol V1 only. */
1171
1665
  displayRotation?: number;
1666
+ /** Protocol V1 only. */
1172
1667
  passphraseAlwaysOnDevice?: boolean;
1173
- safetyChecks?: SafetyCheckLevel;
1668
+ /** Protocol V1 only. Uses Enum_SafetyCheckLevel numeric values. */
1669
+ safetyChecks?: Enum_SafetyCheckLevel;
1670
+ /** Protocol V1 only; the current Protocol V2 schema has no matching field. */
1174
1671
  experimentalFeatures?: boolean;
1175
1672
  autoShutdownDelayMs?: number;
1673
+ /** Protocol V1 only; opens the legacy device-side brightness flow. */
1176
1674
  changeBrightness?: boolean;
1675
+ /** Protocol V2 only. */
1676
+ brightness?: number;
1177
1677
  hapticFeedback?: boolean;
1678
+ bluetoothEnabled?: boolean;
1679
+ /** Protocol V2 only; changed through an on-device confirmation page. */
1680
+ airgapMode?: boolean;
1681
+ /** Protocol V2 only. */
1682
+ animationEnabled?: boolean;
1683
+ /** Protocol V2 only. */
1684
+ tapToWake?: boolean;
1685
+ /** Protocol V2 only. */
1686
+ deviceNameDisplayEnabled?: boolean;
1687
+ /** Protocol V2 only. */
1688
+ fidoEnabled?: boolean;
1689
+ /** Protocol V2 only. */
1690
+ usbLockEnabled?: boolean;
1691
+ /** Protocol V2 only. */
1692
+ randomKeypad?: boolean;
1178
1693
  };
1179
1694
  declare function deviceSettings(connectId: string, params: CommonParams & DeviceSettingsParams): Response<Success$1>;
1180
1695
 
@@ -1200,7 +1715,7 @@ type DeviceUploadResourceResponse = Success$1 & {
1200
1715
  declare function deviceUploadResource(connectId: string, params: CommonParams & DeviceUploadResourceParams): Response<DeviceUploadResourceResponse>;
1201
1716
 
1202
1717
  type DeviceSupportFeatures = SupportFeatures & {
1203
- device: Device | null;
1718
+ device: Device$1 | null;
1204
1719
  };
1205
1720
  declare function deviceSupportFeatures(connectId?: string): Response<DeviceSupportFeatures>;
1206
1721
 
@@ -1209,14 +1724,25 @@ declare function deviceFullyUploadResource(connectId: string, params: CommonPara
1209
1724
  }): Response<Success$1>;
1210
1725
 
1211
1726
  type DeviceUpdateBootloaderParams = {
1727
+ preparedPlan?: FirmwareUpdatePreparedPlan;
1728
+ hostBindingGeneration?: number;
1212
1729
  binary?: ArrayBuffer;
1730
+ /** @deprecated Core derives the bootloader artifact from preparedPlan. */
1731
+ artifact?: FirmwareArtifactReference;
1732
+ artifactReader?: FirmwareArtifactReader;
1213
1733
  firmwareType?: EFirmwareType;
1214
1734
  };
1215
1735
  declare function deviceUpdateBootloader(connectId: string, params?: DeviceUpdateBootloaderParams): Response<Success$1>;
1216
1736
 
1217
1737
  declare function deviceLock(connectId: string, params: CommonParams): Response<Success$1>;
1218
1738
 
1219
- declare function deviceUnlock(connectId: string, params?: CommonParams): Response<Features$1>;
1739
+ type DeviceUnlockParams = {
1740
+ /**
1741
+ * 限定本次解锁允许使用的 PIN 类型。省略时保持兼容行为,仅允许主 PIN。
1742
+ */
1743
+ pinType?: DeviceSessionPinType;
1744
+ };
1745
+ declare function deviceUnlock(connectId: string, params?: CommonParams & DeviceUnlockParams): Response<Features>;
1220
1746
 
1221
1747
  declare function deviceCancel(connectId: string, params: CommonParams): Response<Success$1>;
1222
1748
 
@@ -1420,6 +1946,9 @@ type AllNetworkAddressParams = {
1420
1946
  type AllNetworkAddressPayload = {
1421
1947
  address: string;
1422
1948
  pub?: string;
1949
+ /**
1950
+ * @deprecated Use `pub` instead.
1951
+ */
1423
1952
  publicKey?: string;
1424
1953
  npub?: string;
1425
1954
  } | {
@@ -1485,6 +2014,9 @@ declare function evmGetAddress(connectId: string, deviceId: string, params: Comm
1485
2014
  type EVMPublicKey = {
1486
2015
  path: string;
1487
2016
  pub: string;
2017
+ /**
2018
+ * @deprecated Use `pub` instead.
2019
+ */
1488
2020
  publicKey?: string;
1489
2021
  } & EthereumPublicKey;
1490
2022
  type EVMGetPublicKeyParams = {
@@ -2268,6 +2800,9 @@ declare function nearSignTransaction(connectId: string, deviceId: string, params
2268
2800
  type AptosAddress = {
2269
2801
  path: string;
2270
2802
  pub?: string;
2803
+ /**
2804
+ * @deprecated Use `pub` instead.
2805
+ */
2271
2806
  publicKey?: string;
2272
2807
  } & AptosAddress$1;
2273
2808
  type AptosGetAddressParams = {
@@ -2282,6 +2817,9 @@ declare function aptosGetAddress(connectId: string, deviceId: string, params: Co
2282
2817
  type AptosPublicKey = {
2283
2818
  path: string;
2284
2819
  pub: string;
2820
+ /**
2821
+ * @deprecated Use `pub` instead.
2822
+ */
2285
2823
  publicKey?: string;
2286
2824
  };
2287
2825
  type AptosGetPublicKeyParams = {
@@ -2366,6 +2904,9 @@ declare function cosmosGetAddress(connectId: string, deviceId: string, params: C
2366
2904
  type CosmosPublicKey = {
2367
2905
  path: string;
2368
2906
  pub: string;
2907
+ /**
2908
+ * @deprecated Use `pub` instead.
2909
+ */
2369
2910
  publicKey?: string;
2370
2911
  };
2371
2912
  type CosmosGetPublicKeyParams = {
@@ -2390,6 +2931,9 @@ declare function cosmosSignTransaction(connectId: string, deviceId: string, para
2390
2931
  type XrpAddress = {
2391
2932
  path: string;
2392
2933
  pub?: string;
2934
+ /**
2935
+ * @deprecated Use `pub` instead.
2936
+ */
2393
2937
  publicKey?: string;
2394
2938
  address: string;
2395
2939
  };
@@ -2423,6 +2967,9 @@ declare function xrpSignTransaction(connectId: string, deviceId: string, params:
2423
2967
  type SuiAddress = {
2424
2968
  path: string;
2425
2969
  pub?: string;
2970
+ /**
2971
+ * @deprecated Use `pub` instead.
2972
+ */
2426
2973
  publicKey?: string;
2427
2974
  } & SuiAddress$1;
2428
2975
  type SuiGetAddressParams = {
@@ -2437,6 +2984,9 @@ declare function suiGetAddress(connectId: string, deviceId: string, params: Comm
2437
2984
  type SuiPublicKey = {
2438
2985
  path: string;
2439
2986
  pub: string;
2987
+ /**
2988
+ * @deprecated Use `pub` instead.
2989
+ */
2440
2990
  publicKey?: string;
2441
2991
  };
2442
2992
  type SuiGetPublicKeyParams = {
@@ -2466,6 +3016,10 @@ declare function suiSignTransaction(connectId: string, deviceId: string, params:
2466
3016
  type CardanoGetAddressMethodParams = {
2467
3017
  addressParameters: CardanoAddressParameters;
2468
3018
  networkId: number;
3019
+ /**
3020
+ * Testnet cip34:0-1097911063
3021
+ * Mainnet cip34:1-764824073
3022
+ */
2469
3023
  protocolMagic: number;
2470
3024
  derivationType: number;
2471
3025
  address?: string;
@@ -2527,6 +3081,10 @@ type CardanoSignMessageMethodParams = {
2527
3081
  derivationType: number;
2528
3082
  networkId: number;
2529
3083
  addressType?: Messages.CardanoAddressType;
3084
+ /**
3085
+ * Testnet cip34:0-1097911063
3086
+ * Mainnet cip34:1-764824073
3087
+ */
2530
3088
  protocolMagic?: number;
2531
3089
  };
2532
3090
  declare function cardanoSignMessage(connectId: string, deviceId: string, params: CommonParams & CardanoSignMessageMethodParams): Response<CardanoMessageSignature>;
@@ -2560,6 +3118,9 @@ declare function filecoinSignTransaction(connectId: string, deviceId: string, pa
2560
3118
  type PolkadotAddress = {
2561
3119
  path: string;
2562
3120
  pub: string;
3121
+ /**
3122
+ * @deprecated Use `pub` instead.
3123
+ */
2563
3124
  publicKey?: string;
2564
3125
  } & PolkadotAddress$1;
2565
3126
  type PolkadotGetAddressParams = {
@@ -2618,23 +3179,61 @@ type KaspaSignInputParams = {
2618
3179
  sequenceNumber: number | string;
2619
3180
  output: {
2620
3181
  satoshis: number | string;
2621
- script: string;
3182
+ script?: string;
2622
3183
  };
2623
3184
  sigOpCount?: number;
2624
3185
  };
2625
3186
  type KaspaSignOutputParams = {
2626
3187
  satoshis: number | string;
3188
+ address?: string;
3189
+ addressN?: string | number[];
3190
+ script?: string;
3191
+ scriptVersion?: number;
3192
+ };
3193
+ type KaspaStreamingSignInputParams = Omit<KaspaSignInputParams, 'output'> & {
3194
+ output: {
3195
+ satoshis: number | string;
3196
+ script?: string;
3197
+ };
3198
+ };
3199
+ type KaspaStreamingSignOutputParams = {
3200
+ satoshis: number | string;
3201
+ address?: string;
3202
+ addressN?: string | number[];
3203
+ script?: string;
3204
+ scriptVersion?: number;
3205
+ };
3206
+ type KaspaRefTransactionInput = {
3207
+ prevTxId: string;
3208
+ outputIndex: number;
3209
+ sequenceNumber: number | string;
3210
+ };
3211
+ type KaspaRefTransactionOutput = {
3212
+ satoshis: number | string;
3213
+ scriptVersion?: number;
2627
3214
  script: string;
2628
- scriptVersion: number;
3215
+ };
3216
+ type KaspaRefTransaction = {
3217
+ txId: string;
3218
+ version: number;
3219
+ inputs: KaspaRefTransactionInput[];
3220
+ outputs: KaspaRefTransactionOutput[];
3221
+ lockTime?: number | string;
3222
+ subNetworkID?: string;
3223
+ gas?: number | string;
3224
+ payload?: string;
2629
3225
  };
2630
3226
  type KaspaSignTransactionParams = {
2631
3227
  version: number;
2632
- inputs: KaspaSignInputParams[];
2633
- outputs: KaspaSignOutputParams[];
3228
+ inputs: Array<KaspaSignInputParams | KaspaStreamingSignInputParams>;
3229
+ outputs: Array<KaspaSignOutputParams | KaspaStreamingSignOutputParams>;
2634
3230
  lockTime: number | string;
2635
3231
  sigHashType?: SignatureType;
2636
3232
  sigOpCount?: number;
2637
3233
  subNetworkID?: string;
3234
+ payload?: string;
3235
+ gas?: number | string;
3236
+ refTxs?: KaspaRefTransaction[];
2638
3237
  scheme?: string;
2639
3238
  prefix?: string;
2640
3239
  useTweak?: boolean;
@@ -2679,6 +3278,9 @@ declare function nexaSignTransaction(connectId: string, deviceId: string, params
2679
3278
  type NostrPublicKey = {
2680
3279
  npub?: string;
2681
3280
  pub?: string;
3281
+ /**
3282
+ * @deprecated Use `pub` instead.
3283
+ */
2682
3284
  publicKey?: string;
2683
3285
  path: string;
2684
3286
  };
@@ -2775,6 +3377,9 @@ declare function nostrSignSchnorr(connectId: string, deviceId: string, params: C
2775
3377
 
2776
3378
  interface LnurlAuth {
2777
3379
  pub?: string;
3380
+ /**
3381
+ * @deprecated Use `pub` instead.
3382
+ */
2778
3383
  publickey?: string;
2779
3384
  path?: string;
2780
3385
  signature?: string;
@@ -2851,6 +3456,9 @@ declare function dnxSignTransaction(connectId: string, deviceId: string, params:
2851
3456
  type TonAddress = {
2852
3457
  path: string;
2853
3458
  pub: string;
3459
+ /**
3460
+ * @deprecated Use `pub` instead.
3461
+ */
2854
3462
  publicKey?: string;
2855
3463
  address: string;
2856
3464
  };
@@ -2962,6 +3570,9 @@ declare function scdoSignTransaction(connectId: string, deviceId: string, params
2962
3570
 
2963
3571
  type AlephiumAddress = {
2964
3572
  path: string;
3573
+ /**
3574
+ * @deprecated Use `pub` instead.
3575
+ */
2965
3576
  publicKey?: string;
2966
3577
  pub?: string;
2967
3578
  address: string;
@@ -3064,35 +3675,54 @@ type NeoSignedTx = {
3064
3675
  declare function neoSignTransaction(connectId: string, deviceId: string, params: CommonParams & NeoUnsignedTx): Response<NeoSignedTx>;
3065
3676
 
3066
3677
  type CoreApi = {
3678
+ /**
3679
+ * Inject function
3680
+ */
3067
3681
  init: typeof init;
3068
3682
  on: typeof on;
3069
3683
  off: typeof off;
3070
3684
  emit: (event: string, ...args: any[]) => void;
3071
3685
  removeAllListeners: typeof removeAllListeners;
3072
- dispose: () => void;
3686
+ dispose: () => void | Promise<void>;
3073
3687
  call: (params: any) => Promise<any>;
3688
+ /**
3689
+ * Bind a protocol that has already been verified for one transport endpoint.
3690
+ * Every later SDK call for the same connectId uses it as a strict expectation.
3691
+ */
3692
+ setDeviceConnectProtocol: (connectId: string, connectProtocol: HardwareConnectProtocol | undefined) => void;
3074
3693
  uiResponse: typeof uiResponse;
3075
3694
  cancel: (connectId?: string) => void;
3076
- cancelOperation: (operationId: string) => void;
3077
3695
  updateSettings: typeof updateSettings;
3078
3696
  switchTransport: (env: ConnectSettings['env']) => Promise<{
3079
3697
  success: boolean;
3080
3698
  }>;
3081
3699
  getLogs: typeof getLogs;
3082
3700
  clearSessionCache: typeof clearSessionCache;
3701
+ /**
3702
+ * Test function
3703
+ */
3083
3704
  testInitializeDeviceDuration: typeof testInitializeDeviceDuration;
3705
+ testProtocolV2Ping: typeof testProtocolV2Ping;
3084
3706
  preInitialize: typeof preInitialize;
3707
+ /**
3708
+ * Core function
3709
+ */
3085
3710
  checkAllFirmwareRelease: typeof checkAllFirmwareRelease;
3086
3711
  checkBridgeStatus: typeof checkBridgeStatus;
3087
3712
  checkBridgeRelease: typeof checkBridgeRelease;
3088
3713
  checkBootloaderRelease: typeof checkBootloaderRelease;
3089
3714
  checkFirmwareTypeAvailable: typeof checkFirmwareTypeAvailable;
3715
+ /**
3716
+ * Device function
3717
+ */
3090
3718
  searchDevices: typeof searchDevices;
3719
+ detectDeviceConnectProtocol: typeof detectDeviceConnectProtocol;
3091
3720
  promptWebDeviceAccess: typeof promptWebDeviceAccess;
3092
3721
  getFeatures: typeof getFeatures;
3093
- getDeviceInfo: typeof getDeviceInfo;
3722
+ getDeviceState: typeof getDeviceState;
3094
3723
  getOnekeyFeatures: typeof getOnekeyFeatures;
3095
3724
  getPassphraseState: typeof getPassphraseState;
3725
+ openWalletSession: typeof openWalletSession;
3096
3726
  deviceBackup: typeof deviceBackup;
3097
3727
  deviceChangePin: typeof deviceChangePin;
3098
3728
  deviceFlags: typeof deviceFlags;
@@ -3119,41 +3749,29 @@ type CoreApi = {
3119
3749
  firmwareUpdateV2: typeof firmwareUpdateV2;
3120
3750
  firmwareUpdateV3: typeof firmwareUpdateV3;
3121
3751
  firmwareUpdateV4: typeof firmwareUpdateV4;
3752
+ registerFirmwareUpdateHostBinding: typeof registerFirmwareUpdateHostBinding$1;
3753
+ unregisterFirmwareUpdateHostBinding: typeof unregisterFirmwareUpdateHostBinding$1;
3754
+ getFirmwareUpdateHostBindingGeneration: typeof getFirmwareUpdateHostBindingGeneration$1;
3755
+ getFirmwareUpdateCapabilities: typeof getFirmwareUpdateCapabilities;
3756
+ prepareFirmwareUpdatePlan: typeof prepareFirmwareUpdatePlan;
3757
+ validateFirmwareUpdatePreparedPlan: typeof validateFirmwareUpdatePreparedPlan;
3122
3758
  cipherKeyValue: typeof cipherKeyValue;
3123
- protocolInfoRequest: typeof protocolInfoRequest;
3124
- ping: typeof ping;
3759
+ /**
3760
+ * Pro2 business API
3761
+ */
3125
3762
  deviceReboot: typeof deviceReboot;
3126
- deviceInfoGet: typeof deviceInfoGet;
3127
- deviceStatusGet: typeof deviceStatusGet;
3128
3763
  deviceGetOnboardingStatus: typeof deviceGetOnboardingStatus;
3129
- deviceSessionGet: typeof deviceSessionGet;
3130
- deviceFirmwareUpdate: typeof deviceFirmwareUpdate;
3131
- deviceGetFirmwareUpdateStatus: typeof deviceGetFirmwareUpdateStatus;
3132
- deviceFactoryInfoSet: typeof deviceFactoryInfoSet;
3133
- deviceFactoryInfoGet: typeof deviceFactoryInfoGet;
3134
- deviceSettingsGet: typeof deviceSettingsGet;
3135
- deviceSettingsSet: typeof deviceSettingsSet;
3136
- deviceSettingsPageShow: typeof deviceSettingsPageShow;
3764
+ deviceUploadNft: typeof deviceUploadNft;
3137
3765
  deviceUploadWallpaper: typeof deviceUploadWallpaper;
3138
- filesystemPermissionFix: typeof filesystemPermissionFix;
3139
- fileRead: typeof fileRead;
3140
- fileWrite: typeof fileWrite;
3141
- fileDelete: typeof fileDelete;
3142
- dirList: typeof dirList;
3143
- dirMake: typeof dirMake;
3144
- dirRemove: typeof dirRemove;
3145
- pathInfo: typeof pathInfo;
3146
- filesystemFileRead: typeof filesystemFileRead;
3147
- filesystemFileWrite: typeof filesystemFileWrite;
3148
3766
  uploadPortfolio: typeof uploadPortfolio;
3149
- filesystemFileDelete: typeof filesystemFileDelete;
3150
- filesystemDirList: typeof filesystemDirList;
3151
- filesystemDirMake: typeof filesystemDirMake;
3152
- filesystemDirRemove: typeof filesystemDirRemove;
3153
- filesystemPathInfoQuery: typeof filesystemPathInfoQuery;
3154
- filesystemFormat: typeof filesystemFormat;
3767
+ /**
3768
+ * All network function
3769
+ */
3155
3770
  allNetworkGetAddress: typeof allNetworkGetAddress;
3156
3771
  allNetworkGetAddressByLoop: typeof allNetworkGetAddressByLoop;
3772
+ /**
3773
+ * EVM function
3774
+ */
3157
3775
  evmGetAddress: typeof evmGetAddress;
3158
3776
  evmGetPublicKey: typeof evmGetPublicKey;
3159
3777
  evmSignMessage: typeof evmSignMessage;
@@ -3161,86 +3779,167 @@ type CoreApi = {
3161
3779
  evmSignTransaction: typeof evmSignTransaction;
3162
3780
  evmSignTypedData: typeof evmSignTypedData;
3163
3781
  evmVerifyMessage: typeof evmVerifyMessage;
3782
+ /**
3783
+ * BTC function
3784
+ */
3164
3785
  btcGetAddress: typeof btcGetAddress;
3165
3786
  btcGetPublicKey: typeof btcGetPublicKey;
3166
3787
  btcSignMessage: typeof btcSignMessage;
3167
3788
  btcSignPsbt: typeof btcSignPsbt;
3168
3789
  btcSignTransaction: typeof btcSignTransaction;
3169
3790
  btcVerifyMessage: typeof btcVerifyMessage;
3791
+ /**
3792
+ * Starcoin function
3793
+ */
3170
3794
  starcoinGetAddress: typeof starcoinGetAddress;
3171
3795
  starcoinGetPublicKey: typeof starcoinGetPublicKey;
3172
3796
  starcoinSignMessage: typeof starcoinSignMessage;
3173
3797
  starcoinSignTransaction: typeof starcoinSignTransaction;
3174
3798
  starcoinVerifyMessage: typeof starcoinVerifyMessage;
3799
+ /**
3800
+ * Nem function
3801
+ */
3175
3802
  nemGetAddress: typeof nemGetAddress;
3176
3803
  nemSignTransaction: typeof nemSignTransaction;
3804
+ /**
3805
+ * Solana function
3806
+ */
3177
3807
  solGetAddress: typeof solGetAddress;
3178
3808
  solSignTransaction: typeof solSignTransaction;
3179
3809
  solSignOffchainMessage: typeof solSignOffchainMessage;
3180
3810
  solSignMessage: typeof solSignMessage;
3811
+ /**
3812
+ * Stellar function
3813
+ */
3181
3814
  stellarGetAddress: typeof stellarGetAddress;
3182
3815
  stellarSignTransaction: typeof stellarSignTransaction;
3816
+ /**
3817
+ * Tron function
3818
+ */
3183
3819
  tronGetAddress: typeof tronGetAddress;
3184
3820
  tronSignMessage: typeof tronSignMessage;
3185
3821
  tronSignTransaction: typeof tronSignTransaction;
3822
+ /**
3823
+ * Conflux function
3824
+ */
3186
3825
  confluxGetAddress: typeof confluxGetAddress;
3187
3826
  confluxSignMessage: typeof confluxSignMessage;
3188
3827
  confluxSignMessageCIP23: typeof confluxSignMessageCIP23;
3189
3828
  confluxSignTransaction: typeof confluxSignTransaction;
3829
+ /**
3830
+ * Near function
3831
+ */
3190
3832
  nearGetAddress: typeof nearGetAddress;
3191
3833
  nearSignTransaction: typeof nearSignTransaction;
3834
+ /**
3835
+ * Aptos function
3836
+ */
3192
3837
  aptosGetAddress: typeof aptosGetAddress;
3193
3838
  aptosGetPublicKey: typeof aptosGetPublicKey;
3194
3839
  aptosSignMessage: typeof aptosSignMessage;
3195
3840
  aptosSignInMessage: typeof aptosSignInMessage;
3196
3841
  aptosSignTransaction: typeof aptosSignTransaction;
3842
+ /**
3843
+ * Algo function
3844
+ */
3197
3845
  algoGetAddress: typeof algoGetAddress;
3198
3846
  algoSignTransaction: typeof algoSignTransaction;
3847
+ /**
3848
+ * Cosmos function
3849
+ */
3199
3850
  cosmosGetAddress: typeof cosmosGetAddress;
3200
3851
  cosmosGetPublicKey: typeof cosmosGetPublicKey;
3201
3852
  cosmosSignTransaction: typeof cosmosSignTransaction;
3853
+ /**
3854
+ * XRP function
3855
+ */
3202
3856
  xrpGetAddress: typeof xrpGetAddress;
3203
3857
  xrpSignTransaction: typeof xrpSignTransaction;
3858
+ /**
3859
+ * SUI function
3860
+ */
3204
3861
  suiGetAddress: typeof suiGetAddress;
3205
3862
  suiGetPublicKey: typeof suiGetPublicKey;
3206
3863
  suiSignMessage: typeof suiSignMessage;
3207
3864
  suiSignTransaction: typeof suiSignTransaction;
3865
+ /**
3866
+ * Cardano function
3867
+ */
3208
3868
  cardanoGetAddress: typeof cardanoGetAddress;
3209
3869
  cardanoGetPublicKey: typeof cardanoGetPublicKey;
3210
3870
  cardanoSignTransaction: typeof cardanoSignTransaction;
3211
3871
  cardanoSignMessage: typeof cardanoSignMessage;
3872
+ /**
3873
+ * Filecoin function
3874
+ */
3212
3875
  filecoinGetAddress: typeof filecoinGetAddress;
3213
3876
  filecoinSignTransaction: typeof filecoinSignTransaction;
3877
+ /**
3878
+ * Polkadot function
3879
+ */
3214
3880
  polkadotGetAddress: typeof polkadotGetAddress;
3215
3881
  polkadotSignTransaction: typeof polkadotSignTransaction;
3882
+ /**
3883
+ * Kaspa function
3884
+ */
3216
3885
  kaspaGetAddress: typeof kaspaGetAddress;
3217
3886
  kaspaSignTransaction: typeof kaspaSignTransaction;
3887
+ /**
3888
+ * nexa function
3889
+ */
3218
3890
  nexaGetAddress: typeof nexaGetAddress;
3219
3891
  nexaSignTransaction: typeof nexaSignTransaction;
3892
+ /**
3893
+ * Nostr function
3894
+ */
3220
3895
  nostrGetPublicKey: typeof nostrGetPublicKey;
3221
3896
  nostrSignEvent: typeof nostrSignEvent;
3222
3897
  nostrEncryptMessage: typeof nostrEncryptMessage;
3223
3898
  nostrDecryptMessage: typeof nostrDecryptMessage;
3224
3899
  nostrSignSchnorr: typeof nostrSignSchnorr;
3900
+ /**
3901
+ * Lightning Network
3902
+ */
3225
3903
  lnurlAuth: typeof lnurlAuth;
3904
+ /**
3905
+ * Nervos Network
3906
+ */
3226
3907
  nervosGetAddress: typeof nervosGetAddress;
3227
3908
  nervosSignTransaction: typeof nervosSignTransaction;
3909
+ /**
3910
+ * Dnx Network
3911
+ */
3228
3912
  dnxGetAddress: typeof dnxGetAddress;
3229
3913
  dnxSignTransaction: typeof dnxSignTransaction;
3914
+ /**
3915
+ * TON Network
3916
+ */
3230
3917
  tonGetAddress: typeof tonGetAddress;
3231
3918
  tonSignMessage: typeof tonSignMessage;
3232
3919
  tonSignProof: typeof tonSignProof;
3233
3920
  tonSignData: typeof tonSignData;
3921
+ /**
3922
+ * SCDO Network
3923
+ */
3234
3924
  scdoGetAddress: typeof scdoGetAddress;
3235
3925
  scdoSignMessage: typeof scdoSignMessage;
3236
3926
  scdoSignTransaction: typeof scdoSignTransaction;
3927
+ /**
3928
+ * Alephium Network
3929
+ */
3237
3930
  alephiumGetAddress: typeof alephiumGetAddress;
3238
3931
  alephiumSignMessage: typeof alephiumSignMessage;
3239
3932
  alephiumSignTransaction: typeof alephiumSignTransaction;
3933
+ /**
3934
+ * Benfen Network
3935
+ */
3240
3936
  benfenGetAddress: typeof benfenGetAddress;
3241
3937
  benfenGetPublicKey: typeof benfenGetPublicKey;
3242
3938
  benfenSignTransaction: typeof benfenSignTransaction;
3243
3939
  benfenSignMessage: typeof benfenSignMessage;
3940
+ /**
3941
+ * Neo Network
3942
+ */
3244
3943
  neoGetAddress: typeof neoGetAddress;
3245
3944
  neoSignTransaction: typeof neoSignTransaction;
3246
3945
  };
@@ -3313,13 +4012,17 @@ declare const DEVICE: {
3313
4012
  readonly LOADING: "device-loading";
3314
4013
  readonly BUTTON: "button";
3315
4014
  readonly PIN: "pin";
4015
+ readonly PIN_ON_DEVICE: "pin_on_device";
4016
+ readonly PIN_ON_DEVICE_COMPLETE: "pin_on_device_complete";
3316
4017
  readonly PASSPHRASE: "passphrase";
3317
4018
  readonly PASSPHRASE_ON_DEVICE: "passphrase_on_device";
4019
+ readonly ATTACH_PIN_ON_DEVICE: "attach_pin_on_device";
3318
4020
  readonly WORD: "word";
3319
4021
  readonly SUPPORT_FEATURES: "support_features";
3320
4022
  readonly SELECT_DEVICE_IN_BOOTLOADER_FOR_WEB_DEVICE: "select_device_in_bootloader_for_web_device";
3321
4023
  readonly SELECT_DEVICE_FOR_SWITCH_FIRMWARE_WEB_DEVICE: "select_device_for_switch_firmware_web_device";
3322
4024
  readonly FEATURES: "features";
4025
+ readonly STATE: "state";
3323
4026
  };
3324
4027
  interface DeviceConnnectRequest {
3325
4028
  type: typeof DEVICE.CONNECT;
@@ -3338,6 +4041,11 @@ interface DeviceButtonRequestPayload extends Omit<Messages.ButtonRequest, 'code'
3338
4041
  }
3339
4042
  type PassphraseRequestPayload = {
3340
4043
  existsAttachPinUser?: boolean;
4044
+ deviceOnly?: boolean;
4045
+ source?: 'wallet-session-coordinator';
4046
+ reason?: 'open-wallet' | 'session-recovery';
4047
+ expectedPassphraseState?: string;
4048
+ interaction?: HardwareUiInteractionMeta;
3341
4049
  };
3342
4050
  interface DeviceButtonRequest {
3343
4051
  type: typeof DEVICE.BUTTON;
@@ -3350,6 +4058,10 @@ interface DeviceSendFeatures {
3350
4058
  type: typeof DEVICE.FEATURES;
3351
4059
  payload: DeviceFeaturesPayload;
3352
4060
  }
4061
+ interface DeviceSendState {
4062
+ type: typeof DEVICE.STATE;
4063
+ payload: DeviceStateEvent;
4064
+ }
3353
4065
  type DeviceSupportFeaturesPayload = SupportFeatures & {
3354
4066
  device: KnownDevice | null;
3355
4067
  };
@@ -3357,13 +4069,58 @@ interface DeviceSendSupportFeatures {
3357
4069
  type: typeof DEVICE.SUPPORT_FEATURES;
3358
4070
  payload: DeviceSupportFeaturesPayload;
3359
4071
  }
3360
- type DeviceEvent = DeviceButtonRequest | DeviceSendFeatures | DeviceSendSupportFeatures | DeviceDisconnnectRequest | DeviceConnnectRequest;
4072
+ type DeviceEvent = DeviceButtonRequest | DeviceSendState | DeviceSendFeatures | DeviceSendSupportFeatures | DeviceDisconnnectRequest | DeviceConnnectRequest;
3361
4073
  type DeviceEventMessage = DeviceEvent & {
3362
4074
  event: typeof DEVICE_EVENT;
3363
4075
  };
3364
4076
  type DeviceEventListenerFn = (type: typeof DEVICE_EVENT, cb: (event: DeviceEventMessage) => void) => void;
3365
4077
  declare const createDeviceMessage: MessageFactoryFn<typeof DEVICE_EVENT, DeviceEvent>;
3366
4078
 
4079
+ declare const UI_RESPONSE: {
4080
+ readonly RECEIVE_PIN: "ui-receive_pin";
4081
+ readonly RECEIVE_PASSPHRASE: "ui-receive_passphrase";
4082
+ readonly SELECT_DEVICE_IN_BOOTLOADER_FOR_WEB_DEVICE: "ui-receive_select-device-in-bootloader-for-web-device";
4083
+ readonly SELECT_DEVICE_FOR_SWITCH_FIRMWARE_WEB_DEVICE: "ui-receive_select-device-for-switch-firmware-web-device";
4084
+ };
4085
+ interface UiResponseCorrelation {
4086
+ interactionId: string;
4087
+ deviceId: string;
4088
+ }
4089
+ interface UiResponseCorrelationFields {
4090
+ interactionId?: string;
4091
+ deviceId?: string;
4092
+ }
4093
+ interface UiResponsePin extends UiResponseCorrelationFields {
4094
+ type: typeof UI_RESPONSE.RECEIVE_PIN;
4095
+ payload: string;
4096
+ }
4097
+ interface UiResponsePassphrase extends UiResponseCorrelationFields {
4098
+ type: typeof UI_RESPONSE.RECEIVE_PASSPHRASE;
4099
+ payload: {
4100
+ value: string;
4101
+ passphraseOnDevice?: boolean;
4102
+ attachPinOnDevice?: boolean;
4103
+ save?: boolean;
4104
+ };
4105
+ }
4106
+ interface UiResponseSelectDeviceInBootloaderForWebDevice {
4107
+ type: typeof UI_RESPONSE.SELECT_DEVICE_IN_BOOTLOADER_FOR_WEB_DEVICE;
4108
+ payload: {
4109
+ deviceId: string;
4110
+ };
4111
+ }
4112
+ interface UiResponseSelectDeviceForSwitchFirmwareWebDevice {
4113
+ type: typeof UI_RESPONSE.SELECT_DEVICE_FOR_SWITCH_FIRMWARE_WEB_DEVICE;
4114
+ payload: {
4115
+ deviceId: string;
4116
+ };
4117
+ }
4118
+ type UiResponseEvent = UiResponsePin | UiResponsePassphrase | UiResponseSelectDeviceInBootloaderForWebDevice | UiResponseSelectDeviceForSwitchFirmwareWebDevice;
4119
+ type UiResponseMessage = UiResponseEvent & {
4120
+ event: typeof UI_EVENT;
4121
+ };
4122
+ declare const createUiResponse: MessageFactoryFn<typeof UI_EVENT, UiResponseEvent>;
4123
+
3367
4124
  declare const UI_EVENT = "UI_EVENT";
3368
4125
  declare const UI_REQUEST: {
3369
4126
  readonly REQUEST_PIN: "ui-request_pin";
@@ -3398,8 +4155,43 @@ declare const UI_REQUEST: {
3398
4155
  readonly FIRMWARE_NOT_INSTALLED: "ui-device_firmware_not_installed";
3399
4156
  readonly NOT_USE_ONEKEY_DEVICE: "ui-device_please_use_onekey_device";
3400
4157
  };
4158
+ type ProtocolV2UiEventSource = 'unlock-coordinator' | 'wallet-session-coordinator' | 'method-lifecycle';
4159
+ type ProtocolV2UiCompletion = 'page-accepted' | 'operation-completed';
4160
+ type HardwareUiInteractionMeta = {
4161
+ interactionId: string;
4162
+ phaseId: string;
4163
+ sequence: number;
4164
+ phase: 'pin' | 'passphrase' | 'passphrase-on-device' | 'button' | 'processing';
4165
+ transition: 'start' | 'complete' | 'finish';
4166
+ outcome?: 'submitted' | 'succeeded' | 'failed' | 'cancelled' | 'disconnected';
4167
+ protocol: 'V2';
4168
+ device?: Device$1;
4169
+ };
4170
+ type ProtocolV2UiEventMetadata = {
4171
+ source?: ProtocolV2UiEventSource;
4172
+ reason?: string;
4173
+ deviceOnly?: boolean;
4174
+ completion?: ProtocolV2UiCompletion;
4175
+ method?: string;
4176
+ page?: string | number;
4177
+ operation?: string;
4178
+ interaction?: HardwareUiInteractionMeta;
4179
+ };
4180
+ type UiRequestWindowClose = {
4181
+ type: typeof UI_REQUEST.CLOSE_UI_WINDOW;
4182
+ payload: HardwareUiInteractionMeta;
4183
+ } | {
4184
+ type: typeof UI_REQUEST.CLOSE_UI_PIN_WINDOW;
4185
+ payload: HardwareUiInteractionMeta;
4186
+ } | {
4187
+ type: typeof UI_REQUEST.CLOSE_UI_WINDOW;
4188
+ payload?: undefined;
4189
+ } | {
4190
+ type: typeof UI_REQUEST.CLOSE_UI_PIN_WINDOW;
4191
+ payload?: undefined;
4192
+ };
3401
4193
  interface UiRequestWithoutPayload {
3402
- 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;
4194
+ type: 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;
3403
4195
  payload?: typeof undefined;
3404
4196
  }
3405
4197
  interface UiRequestFirmwareProgressing {
@@ -3410,40 +4202,50 @@ interface UiRequestFirmwareProgressing {
3410
4202
  }
3411
4203
  type UiRequestDeviceAction = {
3412
4204
  type: typeof UI_REQUEST.REQUEST_PIN;
3413
- payload: {
3414
- device: Device;
4205
+ payload: ProtocolV2UiEventMetadata & {
4206
+ device: Device$1;
3415
4207
  type?: Messages.PinMatrixRequestType | 'ButtonRequest_PinEntry' | 'ButtonRequest_AttachPin';
4208
+ responseCorrelation?: UiResponseCorrelation;
3416
4209
  };
3417
4210
  };
3418
4211
  interface UiRequestButton {
3419
4212
  type: typeof UI_REQUEST.REQUEST_BUTTON;
3420
- payload: DeviceButtonRequest['payload'];
4213
+ payload: DeviceButtonRequest['payload'] & ProtocolV2UiEventMetadata;
3421
4214
  }
3422
4215
  interface UiRequestPassphrase {
3423
4216
  type: typeof UI_REQUEST.REQUEST_PASSPHRASE;
3424
4217
  payload: {
3425
- device: Device;
4218
+ device: Device$1;
3426
4219
  passphraseState?: string;
3427
4220
  existsAttachPinUser?: boolean;
4221
+ deviceOnly?: boolean;
4222
+ source?: 'wallet-session-coordinator';
4223
+ reason?: 'open-wallet' | 'session-recovery';
4224
+ expectedPassphraseState?: string;
4225
+ interaction?: HardwareUiInteractionMeta;
4226
+ responseCorrelation?: UiResponseCorrelation;
3428
4227
  };
3429
4228
  }
3430
4229
  interface UiRequestPassphraseOnDevice {
3431
4230
  type: typeof UI_REQUEST.REQUEST_PASSPHRASE_ON_DEVICE;
3432
4231
  payload: {
3433
- device: Device;
4232
+ device: Device$1;
3434
4233
  passphraseState?: string;
4234
+ source?: 'wallet-session-coordinator';
4235
+ reason?: 'open-wallet' | 'session-recovery';
4236
+ interaction?: HardwareUiInteractionMeta;
3435
4237
  };
3436
4238
  }
3437
4239
  interface UiRequestSelectDeviceInBootloaderForWebDevice {
3438
4240
  type: typeof UI_REQUEST.REQUEST_DEVICE_IN_BOOTLOADER_FOR_WEB_DEVICE;
3439
4241
  payload: {
3440
- device: Device;
4242
+ device: Device$1;
3441
4243
  };
3442
4244
  }
3443
4245
  interface UiRequestSelectDeviceForSwitchFirmwareWebDevice {
3444
4246
  type: typeof UI_REQUEST.REQUEST_DEVICE_FOR_SWITCH_FIRMWARE_WEB_DEVICE;
3445
4247
  payload: {
3446
- device: Device;
4248
+ device: Device$1;
3447
4249
  };
3448
4250
  }
3449
4251
  interface FirmwareProcessing {
@@ -3456,7 +4258,7 @@ type IFirmwareUpdateProgressType = 'transferData' | 'installingFirmware';
3456
4258
  interface FirmwareProgress {
3457
4259
  type: typeof UI_REQUEST.FIRMWARE_PROGRESS;
3458
4260
  payload: {
3459
- device: Device;
4261
+ device: Device$1;
3460
4262
  progress: number;
3461
4263
  progressType: IFirmwareUpdateProgressType;
3462
4264
  transferredBytes?: number;
@@ -3468,7 +4270,7 @@ interface FirmwareProgress {
3468
4270
  interface FirmwareTip {
3469
4271
  type: typeof UI_REQUEST.FIRMWARE_TIP;
3470
4272
  payload: {
3471
- device: Device;
4273
+ device: Device$1;
3472
4274
  data: {
3473
4275
  message: string;
3474
4276
  };
@@ -3487,14 +4289,14 @@ interface DeviceProgress {
3487
4289
  interface PreviousAddressResult {
3488
4290
  type: typeof UI_REQUEST.PREVIOUS_ADDRESS_RESULT;
3489
4291
  payload: {
3490
- device: Device;
4292
+ device: Device$1;
3491
4293
  data: {
3492
4294
  address?: string;
3493
4295
  path?: string;
3494
4296
  };
3495
4297
  };
3496
4298
  }
3497
- type UiEvent = UiRequestWithoutPayload | UiRequestDeviceAction | UiRequestButton | UiRequestPassphraseOnDevice | UiRequestPassphrase | UiRequestSelectDeviceInBootloaderForWebDevice | UiRequestSelectDeviceForSwitchFirmwareWebDevice | FirmwareProcessing | UiRequestSelectDeviceInBootloaderForWebDevice | FirmwareProgress | FirmwareTip | DeviceProgress | PreviousAddressResult;
4299
+ type UiEvent = UiRequestWithoutPayload | UiRequestWindowClose | UiRequestDeviceAction | UiRequestButton | UiRequestPassphraseOnDevice | UiRequestPassphrase | UiRequestSelectDeviceInBootloaderForWebDevice | UiRequestSelectDeviceForSwitchFirmwareWebDevice | FirmwareProcessing | UiRequestSelectDeviceInBootloaderForWebDevice | FirmwareProgress | FirmwareTip | DeviceProgress | PreviousAddressResult;
3498
4300
  declare enum FirmwareUpdateTipMessage {
3499
4301
  CheckLatestUiResource = "CheckLatestUiResource",
3500
4302
  StartDownloadFirmware = "StartDownloadFirmware",
@@ -3533,7 +4335,6 @@ declare const IFRAME: {
3533
4335
  readonly INIT_BRIDGE: "iframe-init-bridge";
3534
4336
  readonly CALL: "iframe-call";
3535
4337
  readonly CANCEL: "iframe-cancel";
3536
- readonly CANCEL_OPERATION: "iframe-cancel-operation";
3537
4338
  readonly SWITCH_TRANSPORT: "iframe-switch-transport";
3538
4339
  readonly CALLBACK: "iframe-callback";
3539
4340
  };
@@ -3602,13 +4403,6 @@ interface IFrameCancelMessage {
3602
4403
  connectId?: string;
3603
4404
  };
3604
4405
  }
3605
- interface IFrameCancelOperationMessage {
3606
- event: typeof IFRAME.CANCEL_OPERATION;
3607
- type: typeof IFRAME.CANCEL_OPERATION;
3608
- payload: {
3609
- operationId: string;
3610
- };
3611
- }
3612
4406
  interface IFrameSwitchTransportMessage {
3613
4407
  event: typeof IFRAME.SWITCH_TRANSPORT;
3614
4408
  type: typeof IFRAME.SWITCH_TRANSPORT;
@@ -3636,43 +4430,6 @@ interface MethodResponseMessage {
3636
4430
  declare const createResponseMessage: (id: number, success: boolean, payload: any) => MethodResponseMessage;
3637
4431
  type CallMethodKeys = keyof CoreApi;
3638
4432
 
3639
- declare const UI_RESPONSE: {
3640
- readonly RECEIVE_PIN: "ui-receive_pin";
3641
- readonly RECEIVE_PASSPHRASE: "ui-receive_passphrase";
3642
- readonly SELECT_DEVICE_IN_BOOTLOADER_FOR_WEB_DEVICE: "ui-receive_select-device-in-bootloader-for-web-device";
3643
- readonly SELECT_DEVICE_FOR_SWITCH_FIRMWARE_WEB_DEVICE: "ui-receive_select-device-for-switch-firmware-web-device";
3644
- };
3645
- interface UiResponsePin {
3646
- type: typeof UI_RESPONSE.RECEIVE_PIN;
3647
- payload: string;
3648
- }
3649
- interface UiResponsePassphrase {
3650
- type: typeof UI_RESPONSE.RECEIVE_PASSPHRASE;
3651
- payload: {
3652
- value: string;
3653
- passphraseOnDevice?: boolean;
3654
- attachPinOnDevice?: boolean;
3655
- save?: boolean;
3656
- };
3657
- }
3658
- interface UiResponseSelectDeviceInBootloaderForWebDevice {
3659
- type: typeof UI_RESPONSE.SELECT_DEVICE_IN_BOOTLOADER_FOR_WEB_DEVICE;
3660
- payload: {
3661
- deviceId: string;
3662
- };
3663
- }
3664
- interface UiResponseSelectDeviceForSwitchFirmwareWebDevice {
3665
- type: typeof UI_RESPONSE.SELECT_DEVICE_FOR_SWITCH_FIRMWARE_WEB_DEVICE;
3666
- payload: {
3667
- deviceId: string;
3668
- };
3669
- }
3670
- type UiResponseEvent = UiResponsePin | UiResponsePassphrase | UiResponseSelectDeviceInBootloaderForWebDevice | UiResponseSelectDeviceForSwitchFirmwareWebDevice;
3671
- type UiResponseMessage = UiResponseEvent & {
3672
- event: typeof UI_EVENT;
3673
- };
3674
- declare const createUiResponse: MessageFactoryFn<typeof UI_EVENT, UiResponseEvent>;
3675
-
3676
4433
  declare const LOG_EVENT = "LOG_EVENT";
3677
4434
  declare const LOG: {
3678
4435
  readonly OUTPUT: "log-output";
@@ -3735,7 +4492,7 @@ declare const CORE_EVENT = "CORE_EVENT";
3735
4492
  type CoreMessage = {
3736
4493
  id?: string;
3737
4494
  success?: true | false;
3738
- } & (IFrameEventMessage | IFrameCallMessage | IFrameCancelMessage | IFrameCancelOperationMessage | IFrameSwitchTransportMessage | IFrameCallbackMessage | UiResponseMessage | UiEventMessage | DeviceEventMessage | LogEventMessage | FirmwareMessage);
4495
+ } & (IFrameEventMessage | IFrameCallMessage | IFrameCancelMessage | IFrameSwitchTransportMessage | IFrameCallbackMessage | UiResponseMessage | UiEventMessage | DeviceEventMessage | LogEventMessage | FirmwareMessage);
3739
4496
  type PostMessageEvent = MessageEvent<any>;
3740
4497
  declare const parseMessage: (messageData: any) => CoreMessage;
3741
4498
  declare const createErrorMessage: (error: Error & {
@@ -3748,10 +4505,14 @@ type UiPromiseResponse = UiResponseEvent | {
3748
4505
  };
3749
4506
  type UiPromise<T extends UiPromiseResponse['type']> = Deferred<Extract<UiPromiseResponse, {
3750
4507
  type: T;
3751
- }>, T, Device$1>;
4508
+ }>, T, Device> & {
4509
+ responseCorrelation?: UiResponseCorrelation;
4510
+ };
3752
4511
 
3753
4512
  declare const LogBlockEvent: Set<string>;
3754
4513
  declare function getLogBlockLabel(message: unknown): string | undefined;
4514
+ declare function getSafeLogPayload(value: unknown, blockLabel?: string): unknown;
4515
+ declare function formatLogMethodLabel(label: string, methodName?: string): string;
3755
4516
 
3756
4517
  declare const executeCallback: (id: string, ...args: any[]) => void;
3757
4518
  declare const cleanupCallback: (id: string) => void;
@@ -3764,7 +4525,6 @@ interface InjectApi {
3764
4525
  dispose: CoreApi['dispose'];
3765
4526
  uiResponse: CoreApi['uiResponse'];
3766
4527
  cancel: CoreApi['cancel'];
3767
- cancelOperation: CoreApi['cancelOperation'];
3768
4528
  switchTransport: CoreApi['switchTransport'];
3769
4529
  }
3770
4530
 
@@ -3816,30 +4576,109 @@ declare enum LoggerNames {
3816
4576
  }
3817
4577
  declare const getLogger: (key: LoggerNames) => Log;
3818
4578
 
3819
- declare const httpRequest: (url: string, type: string) => any;
4579
+ type HttpRequestOptions = {
4580
+ /** Additional request headers, such as a byte range for package metadata reads. */
4581
+ headers?: Record<string, string>;
4582
+ /** Axios adapter-defined request timeout retained for existing opt-in callers. */
4583
+ timeoutMs?: number;
4584
+ /** Deadline for DNS, connection, TLS, redirects, and the first response-body progress. */
4585
+ connectTimeoutMs?: number;
4586
+ /** Maximum idle interval between response-body progress events. */
4587
+ readTimeoutMs?: number;
4588
+ /** Wall-clock deadline across all attempts and retry backoff. */
4589
+ overallTimeoutMs?: number;
4590
+ maxRetries?: number;
4591
+ retryDelayMs?: number;
4592
+ };
4593
+
4594
+ declare const httpRequest: (url: string, type: string, options?: HttpRequestOptions) => any;
3820
4595
  declare const getTimeStamp: () => number;
3821
4596
 
4597
+ /**
4598
+ * Validates version string
4599
+ * @param {string} version Version string
4600
+ * @returns {boolean} True if version string is valid, false if not
4601
+ */
3822
4602
  declare const isValidVersionString: (version: string) => boolean;
4603
+ /**
4604
+ * Validates a version array
4605
+ * @param {number[]} version Version array
4606
+ * @returns {boolean} True if version array is valid, false if not
4607
+ */
3823
4608
  declare const isValidVersionArray: (version: number[]) => boolean;
4609
+ /**
4610
+ * Fills the missing version numbers with zeros (ie: [1, 2] will become [1, 2, 0])
4611
+ * @param {number[]} version Version array
4612
+ * @returns {number[]} Version array with all positions filled
4613
+ */
3824
4614
  declare const normalizeVersionArray: (version: number[]) => number[];
4615
+ /**
4616
+ * Returns a valid version array from a version string
4617
+ * @param {string} version Version string
4618
+ * @returns {number[]} Version array
4619
+ */
3825
4620
  declare const versionSplit: (version: string) => number[];
4621
+ /**
4622
+ * Compares two versions and returns if the version is newer (1), older (-1) or equal (0).
4623
+ * @param {string | number[]} a Version to compare from
4624
+ * @param {string | number[]} b Version to compare with
4625
+ * @returns {number} Returns 1 if newer, -1 if older and 0 if equal
4626
+ */
3826
4627
  declare const versionCompare: (a: string | number[], b: string | number[]) => 0 | 1 | -1;
3827
4628
 
3828
- declare function patchFeatures(response: DefaultMessageResponse): TypedResponseMessage<"DeviceStatus"> | TypedResponseMessage<"DeviceSession"> | TypedResponseMessage<"PassphraseState"> | TypedResponseMessage<"Address"> | 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<"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<"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<"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"> | 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<"DeviceSessionGet"> | 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">;
4629
+ declare function patchFeatures(response: DefaultMessageResponse): TypedResponseMessage<"DeviceStatus"> | TypedResponseMessage<"DeviceSession"> | TypedResponseMessage<"Success"> | TypedResponseMessage<"PassphraseState"> | TypedResponseMessage<"Address"> | TypedResponseMessage<"ProtocolInfo"> | TypedResponseMessage<"DeviceInfo"> | TypedResponseMessage<"DeviceFirmwareUpdateStatus"> | 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<"DeviceSettings"> | TypedResponseMessage<"DeviceCertificate"> | TypedResponseMessage<"DeviceFactoryInfoManufactureTime"> | TypedResponseMessage<"DeviceFactoryInfo"> | TypedResponseMessage<"DeviceFirmwareTarget"> | TypedResponseMessage<"DeviceFirmwareUpdateRecordFields"> | TypedResponseMessage<"DeviceFirmwareUpdateRecord"> | TypedResponseMessage<"DeviceFirmwareImageInfo"> | TypedResponseMessage<"DeviceInfoTargets"> | TypedResponseMessage<"DeviceInfoTypes"> | TypedResponseMessage<"DeviceHardwareInfo"> | TypedResponseMessage<"DeviceMainMcuInfo"> | TypedResponseMessage<"DeviceCoprocessorInfo"> | TypedResponseMessage<"DeviceSEInfo"> | TypedResponseMessage<"FilesystemFile"> | TypedResponseMessage<"OnboardingSetupStatus"> | TypedResponseMessage<"ViewAmount"> | TypedResponseMessage<"ViewDetail"> | TypedResponseMessage<"ViewTip"> | TypedResponseMessage<"ViewRawData"> | 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<"SetBusy"> | TypedResponseMessage<"GetFirmwareHash"> | TypedResponseMessage<"FirmwareHash"> | TypedResponseMessage<"GetNonce"> | TypedResponseMessage<"Nonce"> | TypedResponseMessage<"WriteSEPrivateKey"> | TypedResponseMessage<"UnlockPath"> | TypedResponseMessage<"UnlockedPathRequest"> | TypedResponseMessage<"UiAnimationRequest"> | TypedResponseMessage<"ProtocolInfoRequest"> | TypedResponseMessage<"DeviceReboot"> | TypedResponseMessage<"DeviceSettingsGet"> | TypedResponseMessage<"DeviceSettingsSet"> | TypedResponseMessage<"DeviceSettingsPageShow"> | TypedResponseMessage<"DeviceCertificateWrite"> | TypedResponseMessage<"DeviceCertificateRead"> | TypedResponseMessage<"DeviceCertificateSignature"> | TypedResponseMessage<"DeviceCertificateSign"> | TypedResponseMessage<"DeviceMiscUsbMscControl"> | TypedResponseMessage<"DeviceFactoryInfoSet"> | TypedResponseMessage<"DeviceFactoryInfoGet"> | TypedResponseMessage<"DeviceFactoryPermanentLock"> | TypedResponseMessage<"DeviceFactoryTest"> | TypedResponseMessage<"DeviceFirmwareUpdateStage"> | TypedResponseMessage<"DeviceFirmwareUpdateRequest"> | TypedResponseMessage<"DeviceFirmwareUpdateStatusGet"> | TypedResponseMessage<"DeviceInfoGet"> | TypedResponseMessage<"DeviceSessionGet"> | TypedResponseMessage<"DeviceSessionAskPin"> | TypedResponseMessage<"DeviceSessionAskPassphrase"> | TypedResponseMessage<"DeviceStatusGet"> | TypedResponseMessage<"FilesystemPermissionFix"> | TypedResponseMessage<"FilesystemPathInfo"> | TypedResponseMessage<"FilesystemPathInfoQuery"> | TypedResponseMessage<"FilesystemFileRead"> | TypedResponseMessage<"FilesystemFileWrite"> | TypedResponseMessage<"FilesystemFileDelete"> | TypedResponseMessage<"FilesystemDir"> | TypedResponseMessage<"FilesystemDirList"> | TypedResponseMessage<"FilesystemDirMake"> | TypedResponseMessage<"FilesystemDirRemove"> | TypedResponseMessage<"FilesystemFormat"> | TypedResponseMessage<"InternalMyAddressRequest"> | TypedResponseMessage<"NftUpdate"> | TypedResponseMessage<"OnboardingStatusGet"> | TypedResponseMessage<"OnboardingStatus"> | TypedResponseMessage<"PortfolioUpdate"> | TypedResponseMessage<"ViewSignPage"> | TypedResponseMessage<"ViewVerifyPage">;
4630
+
4631
+ type DeviceFeaturesInput = Features | Messages.Features;
3829
4632
 
3830
- declare const getDeviceType: (features?: Features) => IDeviceType;
4633
+ /**
4634
+ * get device type by features
4635
+ */
4636
+ declare const getDeviceType: (features?: DeviceFeaturesInput) => IDeviceType;
4637
+ /**
4638
+ * get device type by ble name
4639
+ * @param name Ble name
4640
+ */
3831
4641
  declare const getDeviceTypeByBleName: (name?: string) => IDeviceType;
3832
- declare const getDeviceBleName: (features?: Features) => string | null;
3833
- declare const getDeviceUUID: (features: Features) => string;
3834
- declare const getDeviceLabel: (features?: Features) => string | null;
3835
- declare const getMethodVersionRange: (features: Features | undefined, getVersionRange: (deviceModel: IDeviceType | IDeviceModel) => IVersionRange | undefined) => IVersionRange | undefined;
3836
- declare const isMethodVersionRangeUnsupported: (versionRange?: IVersionRange) => boolean;
3837
- declare const getFirmwareType: (features: Features | undefined) => EFirmwareType;
3838
-
3839
- declare const getDeviceFirmwareVersion: (features: Features | undefined) => IVersionArray;
3840
- declare const getDeviceBLEFirmwareVersion: (features: Features) => IVersionArray;
3841
- declare const getDeviceBootloaderVersion: (features: Features | undefined) => IVersionArray;
3842
- declare const getDeviceBoardloaderVersion: (features: Features) => IVersionArray;
4642
+ /**
4643
+ * Get Connected Device ble name by features
4644
+ * @returns
4645
+ */
4646
+ declare const getDeviceBleName: (features?: DeviceFeaturesInput) => string | null;
4647
+ /**
4648
+ * Get Connected Device serial number by features
4649
+ */
4650
+ declare const getDeviceSerialNo: (features?: DeviceFeaturesInput) => string;
4651
+ /**
4652
+ * @deprecated Use getDeviceSerialNo instead.
4653
+ */
4654
+ declare const getDeviceUUID: (features?: DeviceFeaturesInput) => string;
4655
+ /**
4656
+ * Get Connected Device label by features
4657
+ */
4658
+ declare const getDeviceLabel: (features?: DeviceFeaturesInput) => string | null;
4659
+ /**
4660
+ * Get firmware version range by features
4661
+ * Type has a higher priority than Model
4662
+ */
4663
+ declare const getMethodVersionRange: (features: DeviceFeaturesInput | undefined, getVersionRange: (deviceModel: IDeviceType | IDeviceModel) => IVersionRange | undefined) => IVersionRange | undefined;
4664
+ declare const getFirmwareType: (features?: DeviceFeaturesInput) => _onekeyfe_hd_shared.EFirmwareType;
4665
+
4666
+ /**
4667
+ * Get Connected Device version by features
4668
+ */
4669
+ declare const getDeviceFirmwareVersion: (features?: DeviceFeaturesInput) => IVersionArray;
4670
+ /**
4671
+ * Get Connected Device bootloader version by features
4672
+ */
4673
+ declare const getDeviceBootloaderVersion: (features?: DeviceFeaturesInput) => IVersionArray;
4674
+ /**
4675
+ * Get Connected Device boardloader/romloader version by features
4676
+ */
4677
+ declare const getDeviceBoardloaderVersion: (features?: DeviceFeaturesInput) => IVersionArray;
4678
+ /**
4679
+ * Get Connected Device bluetooth firmware version by features
4680
+ */
4681
+ declare const getDeviceBLEFirmwareVersion: (features?: DeviceFeaturesInput) => IVersionArray;
3843
4682
 
3844
4683
  declare const FIRMWARE_FIELDS: readonly ["firmware", "firmware-v1", "firmware-v2", "firmware-v8", "firmware-btc-v8"];
3845
4684
  type IFirmwareField = (typeof FIRMWARE_FIELDS)[number];
@@ -3847,7 +4686,7 @@ type ProtocolV1MessageSchema = 'v1CurrentSchema' | 'v1LegacySchema';
3847
4686
  type ProtobufMessageSchema = ProtocolV1MessageSchema | 'v2Schema';
3848
4687
  declare class DataManager {
3849
4688
  static deviceMap: DeviceTypeMap & {
3850
- [k: string]: DeviceTypeMap[keyof DeviceTypeMap] | undefined;
4689
+ [k: string]: NonNullable<DeviceTypeMap[keyof DeviceTypeMap]> | undefined;
3851
4690
  };
3852
4691
  static assets: AssetsMap | null;
3853
4692
  static settings: ConnectSettings;
@@ -3855,12 +4694,22 @@ declare class DataManager {
3855
4694
  [schema in ProtobufMessageSchema]: JSON;
3856
4695
  };
3857
4696
  static lastCheckTimestamp: number;
4697
+ static protocolV2ResourcesConfigError: Error | undefined;
4698
+ private static protocolV2NeoResourcesConfigError;
3858
4699
  static getFirmwareStatus: (features: Features, firmwareType: EFirmwareType) => IDeviceFirmwareStatus;
4700
+ /**
4701
+ * Touch、Pro System UI Resource Update
4702
+ * ** Interval upgrade is not considered **
4703
+ */
3859
4704
  static getSysResourcesLatestRelease: ({ features, forcedUpdateRes, firmwareType, }: {
3860
4705
  features: Features;
3861
4706
  forcedUpdateRes?: boolean | undefined;
3862
4707
  firmwareType: EFirmwareType;
3863
4708
  }) => string | undefined;
4709
+ /**
4710
+ * Touch、Pro System full UI Resource Update
4711
+ * ** Interval upgrade is not considered **
4712
+ */
3864
4713
  static getSysFullResource: (features: Features, firmwareType: EFirmwareType) => string | undefined;
3865
4714
  static getBootloaderResource: (features: Features, firmwareType: EFirmwareType) => string | undefined;
3866
4715
  static getBootloaderTargetVersion: (features: Features, firmwareType: EFirmwareType) => IVersionArray | undefined;
@@ -3882,24 +4731,42 @@ declare class DataManager {
3882
4731
  "en-US": string;
3883
4732
  } | undefined;
3884
4733
  private static enrichFirmwareReleaseInfo;
3885
- static load(settings: ConnectSettings): Promise<void>;
4734
+ private static enrichProtocolV2FirmwareReleaseInfo;
4735
+ static load(settings: ConnectSettings): Promise<boolean>;
4736
+ private static applyRemoteConfig;
3886
4737
  static updateEnv(newEnv: ConnectSettings['env']): void;
3887
4738
  static checkAndReloadData(): Promise<void>;
4739
+ /** Force a fresh remote config before an update is allowed to mutate the device. */
4740
+ static forceReloadData({ requireResources, resourceDeviceType, }?: {
4741
+ requireResources?: boolean;
4742
+ resourceDeviceType?: EDeviceType.Pro2 | EDeviceType.Neo;
4743
+ }): Promise<void>;
4744
+ static getProtocolV2ResourceSource(release: IFirmwareReleaseInfo | undefined): IProtocolV2ResourceSource | undefined;
3888
4745
  static getProtobufMessages(schema?: ProtobufMessageSchema): JSON;
3889
4746
  static getSettings(key?: undefined): ConnectSettings;
3890
4747
  static getSettings<T extends keyof ConnectSettings>(key: T): ConnectSettings[T];
3891
4748
  static isBleConnect: (env: ConnectSettings['env']) => boolean;
4749
+ /** Desktop WebUSB doesn't need browser permission prompt */
3892
4750
  static isDesktopWebUsb: (env: ConnectSettings['env']) => boolean;
4751
+ /** Browser WebUSB needs permission prompt */
3893
4752
  static isBrowserWebUsb: (env: ConnectSettings['env']) => boolean;
3894
4753
  }
3895
4754
 
3896
- 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
+ */
3897
4759
  declare const getFirmwareUpdateField: ({ features, updateType, targetVersion, firmwareType, }: {
3898
4760
  features: Features;
3899
4761
  updateType: 'firmware' | 'ble';
3900
4762
  targetVersion?: string | undefined;
3901
4763
  firmwareType: EFirmwareType;
3902
4764
  }) => 'ble' | IFirmwareField;
4765
+ /**
4766
+ * Returns the optional firmware version
4767
+ * Used in firmware web update
4768
+ * https://firmware.onekey.so/
4769
+ */
3903
4770
  declare const getFirmwareUpdateFieldArray: (features: Features, updateType: 'firmware' | 'ble' | 'bootloader') => ('ble' | IFirmwareField)[];
3904
4771
 
3905
4772
  declare function checkNeedUpdateBootForTouch(features: Features, firmwareType: EFirmwareType): boolean;
@@ -3909,15 +4776,41 @@ declare function checkNeedUpdateBootForClassicAndMini({ features, willUpdateFirm
3909
4776
  firmwareType: EFirmwareType;
3910
4777
  }): boolean;
3911
4778
 
4779
+ type DeviceSettingsProtocol = 'V1' | 'V2';
4780
+ type DeviceSettingsField = keyof DeviceSettingsParams;
4781
+ declare const DEVICE_SETTINGS_SHARED_FIELDS: readonly ["language", "label", "usePassphrase", "autoLockDelayMs", "autoShutdownDelayMs", "hapticFeedback", "bluetoothEnabled"];
4782
+ declare const DEVICE_SETTINGS_V1_ONLY_FIELDS: readonly ["homescreen", "passphraseSource", "displayRotation", "passphraseAlwaysOnDevice", "safetyChecks", "experimentalFeatures", "changeBrightness"];
4783
+ declare const DEVICE_SETTINGS_V2_ONLY_FIELDS: readonly ["brightness", "airgapMode", "animationEnabled", "tapToWake", "deviceNameDisplayEnabled", "fidoEnabled", "usbLockEnabled", "randomKeypad"];
4784
+ declare const DEVICE_SETTINGS_NEVER_TIMEOUT_MS = 268435456;
4785
+ declare const PROTOCOL_V2_NEVER_TIMEOUT_MS = 268435456;
4786
+ declare const normalizeSafetyCheckLevel: (value: SafetyCheckLevel | null | undefined) => Enum_SafetyCheckLevel | null | undefined;
3912
4787
  declare const getLanguageConfig: (deviceType: IDeviceType) => Record<string, string>[];
3913
- type DurationParts = {
3914
- seconds: number;
3915
- minute: number;
3916
- hour: number;
3917
- day: number;
4788
+ type DeviceSettingsDurationOption = {
4789
+ label: string;
4790
+ valueMs: number;
4791
+ };
4792
+ type DeviceSettingsValueOption<T> = {
4793
+ label: string;
4794
+ value: T;
4795
+ };
4796
+ declare const getAutoLockOptions: (deviceType: IDeviceType, protocol: DeviceSettingsProtocol) => DeviceSettingsDurationOption[];
4797
+ declare const getAutoShutDownOptions: (deviceType: IDeviceType, protocol: DeviceSettingsProtocol) => DeviceSettingsDurationOption[];
4798
+ type DeviceSettingsCapabilities = {
4799
+ protocol: DeviceSettingsProtocol;
4800
+ supportedFields: readonly DeviceSettingsField[];
4801
+ languageOptions: ReadonlyArray<Record<string, string>>;
4802
+ autoLockDelayOptions: readonly DeviceSettingsDurationOption[];
4803
+ autoShutdownDelayOptions: readonly DeviceSettingsDurationOption[];
4804
+ ranges: {
4805
+ brightness?: {
4806
+ min: number;
4807
+ max: number;
4808
+ };
4809
+ };
4810
+ safetyCheckOptions: ReadonlyArray<DeviceSettingsValueOption<Enum_SafetyCheckLevel>>;
4811
+ onDeviceConfirmationFields: readonly DeviceSettingsField[];
3918
4812
  };
3919
- declare const getAutoLockOptions: (_deviceType: IDeviceType) => DurationParts[];
3920
- declare const getAutoShutDownOptions: (_deviceType: IDeviceType) => DurationParts[];
4813
+ declare const getDeviceSettingsCapabilities: (deviceType: IDeviceType, protocol: DeviceSettingsProtocol) => DeviceSettingsCapabilities;
3921
4814
 
3922
4815
  declare const getHDPath: (path: string) => Array<number>;
3923
4816
  declare const getScriptType: (path: Array<number>) => InputScriptType;
@@ -3930,6 +4823,10 @@ type SizeConfig = {
3930
4823
  height: number;
3931
4824
  radius?: number;
3932
4825
  };
4826
+ declare const getNftSize: ({ deviceType, thumbnail, }: {
4827
+ deviceType: IDeviceType;
4828
+ thumbnail?: boolean | undefined;
4829
+ }) => SizeConfig | undefined;
3933
4830
  declare const getHomeScreenSize: ({ deviceType, homeScreenType, thumbnail, }: {
3934
4831
  deviceType: IDeviceType;
3935
4832
  homeScreenType: 'WallPaper' | 'Nft';
@@ -3954,8 +4851,44 @@ declare const getEnv: () => "web" | "webextension" | "electron" | "react-native"
3954
4851
  declare const corsValidator: (url?: string) => string | undefined;
3955
4852
  declare const parseConnectSettings: (input?: Partial<ConnectSettings>) => ConnectSettings;
3956
4853
 
3957
- declare const HardwareSdk: ({ init, call, dispose, eventEmitter, uiResponse, cancel, cancelOperation, updateSettings, switchTransport, }: InjectApi) => CoreApi;
3958
- declare const HardwareSDKLowLevel: ({ init, call, dispose, eventEmitter, addHardwareGlobalEventListener, uiResponse, cancel, cancelOperation, updateSettings, switchTransport, }: LowLevelInjectApi) => LowLevelCoreApi;
4854
+ type StoredDeviceState = DeviceState & {
4855
+ raw?: DeviceFeaturesRaw;
4856
+ };
4857
+ declare const projectFeatures: (state: StoredDeviceState) => Features;
4858
+
4859
+ /**
4860
+ * Read the protocol contract from the same method instance used by the Core dispatcher.
4861
+ * Passing a payload initializes the method first so parameter-dependent contracts, such
4862
+ * as Bitcoin fork support, are evaluated with the actual request.
4863
+ */
4864
+ declare function getMethodSupportedProtocols(method: string, payload?: Record<string, unknown>): readonly ProtocolType[];
4865
+
4866
+ type FirmwareMemoryArtifactEntry = {
4867
+ entryName: string;
4868
+ binary: ArrayBuffer;
4869
+ };
4870
+ type FirmwareMemoryArtifact = {
4871
+ artifactId: string;
4872
+ binary: ArrayBuffer;
4873
+ materializedEntries?: FirmwareMemoryArtifactEntry[];
4874
+ };
4875
+ type FirmwareUpdateV4MemoryHost = {
4876
+ preparedPlan: ReturnType<CoreApi['prepareFirmwareUpdatePlan']>;
4877
+ hostBindingGeneration: number;
4878
+ release: () => void;
4879
+ };
4880
+ declare function prepareFirmwareUpdateV4MemoryHost({ sdk, plan, artifacts, }: {
4881
+ sdk: Pick<CoreApi, 'prepareFirmwareUpdatePlan' | 'registerFirmwareUpdateHostBinding' | 'unregisterFirmwareUpdateHostBinding'>;
4882
+ plan: FirmwareUpdatePlan;
4883
+ artifacts: FirmwareMemoryArtifact[];
4884
+ }): FirmwareUpdateV4MemoryHost;
4885
+
4886
+ declare const registerFirmwareUpdateHostBinding: (binding: FirmwareUpdateHostBinding) => number;
4887
+ declare const unregisterFirmwareUpdateHostBinding: (generation?: number) => boolean;
4888
+ declare const getFirmwareUpdateHostBindingGeneration: () => number;
4889
+
4890
+ declare const HardwareSdk: ({ init, call, dispose, eventEmitter, uiResponse, cancel, updateSettings, switchTransport, }: InjectApi) => CoreApi;
4891
+ declare const HardwareSDKLowLevel: ({ init, call, dispose, eventEmitter, addHardwareGlobalEventListener, uiResponse, cancel, updateSettings, switchTransport, }: LowLevelInjectApi) => LowLevelCoreApi;
3959
4892
  declare const HardwareTopLevelSdk: () => CoreApi;
3960
4893
 
3961
- 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, DeviceButtonRequest, DeviceButtonRequestPayload, DeviceChangePinParams, DeviceConnnectRequest, DeviceDisconnnectRequest, DeviceEvent, DeviceEventListenerFn, DeviceEventMessage, DeviceFeaturesMode, DeviceFeaturesPayload, DeviceFeaturesProtocol, DeviceFeaturesRaw, DeviceFeaturesVerify, DeviceFirmwareRange, DeviceFlagsParams, DeviceInfoMode, DeviceInfoProtocol, DeviceInfoScope, DeviceInfoSource, DeviceInfoStatus, DeviceModelToTypes, DeviceProfile, DeviceProfileRaw, DeviceProfileVerify, DeviceProfileVersions, 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, FirmwareUpdateV4Params, GetDeviceInfoParams, 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, PRO2_WALLPAPER_HEIGHT, PRO2_WALLPAPER_WIDTH, Params, PassphraseRequestPayload, PolkadotAddress, PolkadotGetAddressParams, PolkadotSignTransactionParams, PolkadotSignedTx, PostMessageEvent, PreviousAddressResult, Pro2WallpaperColorFormat, 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, getDeviceType, getDeviceTypeByBleName, getDeviceUUID, getEnv, getFirmwareType, getFirmwareUpdateField, getFirmwareUpdateFieldArray, 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, safeThrowError, setLoggerPostMessage, supportInputPinOnSoftware, switchTransport, transportEnv, updateRequestContext, versionCompare, versionSplit, wait, whitelist, whitelistExtension };
4894
+ 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, BridgeReleaseCheckResult, 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, DEVICE_SETTINGS_NEVER_TIMEOUT_MS, DEVICE_SETTINGS_SHARED_FIELDS, DEVICE_SETTINGS_V1_ONLY_FIELDS, DEVICE_SETTINGS_V2_ONLY_FIELDS, 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, DeviceSettingsCapabilities, DeviceSettingsDurationOption, DeviceSettingsField, DeviceSettingsParams, DeviceSettingsProtocol, DeviceSettingsValueOption, DeviceState, DeviceStateEvent, DeviceStateIdentity, DeviceStateMode, DeviceStatePatch, DeviceStateProtocol, DeviceStateScope, DeviceStateSection, DeviceStateSecurityElement, DeviceStateSecurityElements, DeviceStateSecurityElementsPatch, DeviceStateSettings, DeviceStateStatus, DeviceStateUpdateSource, DeviceStateVersions, DeviceStatus, DeviceSupportFeatures, DeviceSupportFeaturesPayload, DeviceTypeMap, DeviceTypeToModels, DeviceUnlockParams, 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, FirmwareEvent, FirmwareMemoryArtifact, FirmwareMemoryArtifactEntry, FirmwareMessage, FirmwareProcessing, FirmwareProgress, FirmwareRange, FirmwareRelease, FirmwareReleaseCheckResult, FirmwareTip, FirmwareUpdateArtifactParams, FirmwareUpdateBinaryParams, FirmwareUpdateCapabilities, FirmwareUpdateHostBinding, FirmwareUpdateParams, FirmwareUpdatePlan, FirmwareUpdatePlanArtifact, FirmwareUpdatePlanArtifactRole, FirmwareUpdatePlanForceTarget, FirmwareUpdatePlanTarget, FirmwareUpdatePreparedArtifact, FirmwareUpdatePreparedArtifactInput, FirmwareUpdatePreparedEntry, FirmwareUpdatePreparedPlan, FirmwareUpdateTipMessage, FirmwareUpdateV3Params, FirmwareUpdateV4MemoryHost, FirmwareUpdateV4Params, FirmwareUpdateV4Target, GetDeviceStateParams, GetPassphraseStateParams, HardwareSDKLowLevel, HardwareTopLevelSdk, HardwareUiInteractionMeta, IBLEFirmwareReleaseInfo, IDeviceBLEFirmwareStatus, IDeviceFirmwareStatus, IDeviceModel, IDeviceType, IFRAME, IFirmwareField, IFirmwareReleaseInfo, IFirmwareUpdateProgressType, IFirmwareUpdateTipMessage, IFrameBridge, IFrameCallMessage, IFrameCallback, IFrameCallbackMessage, IFrameCancelMessage, IFrameEvent, IFrameEventMessage, IFrameInit, IFrameSwitchTransport, IFrameSwitchTransportMessage, ILocale, IProtocolV2FirmwareComponent, IProtocolV2FirmwareComponentTarget, IProtocolV2ResourceSource, IProtocolV2Resources, ITransportStatus, IVersionArray, IVersionRange, KaspaAddress, KaspaGetAddressParams, KaspaSignInputParams, KaspaSignOutputParams, KaspaSignTransactionParams, KaspaSignature, KaspaStreamingSignInputParams, KaspaStreamingSignOutputParams, 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, OpenWalletSessionMode, OpenWalletSessionModeValue, OpenWalletSessionParams, OpenWalletSessionPayload, PRO2_WALLPAPER_HEIGHT, PRO2_WALLPAPER_WIDTH, PROTOCOL_V2_NEVER_TIMEOUT_MS, Params, PassphraseRequestPayload, PolkadotAddress, PolkadotGetAddressParams, PolkadotSignTransactionParams, PolkadotSignedTx, PostMessageEvent, PreviousAddressResult, Pro2WallpaperColorFormat, ProtocolV2ComponentReleaseInfo, ProtocolV2FirmwareComponentRelease, ProtocolV2FirmwareComponentReleaseStatus, ProtocolV2FirmwareReleaseStatus, 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, TestProtocolV2PingParams, 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, UiRequestWindowClose, UiRequestWithoutPayload, UiResponseCorrelation, UiResponseCorrelationFields, 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, formatLogMethodLabel, formatRequestContext, generateInstanceId, generateSdkInstanceId, getActiveRequestsByDeviceInstance, getAutoLockOptions, getAutoShutDownOptions, getDeviceBLEFirmwareVersion, getDeviceBleName, getDeviceBoardloaderVersion, getDeviceBootloaderVersion, getDeviceFirmwareVersion, getDeviceLabel, getDeviceSerialNo, getDeviceSettingsCapabilities, getDeviceType, getDeviceTypeByBleName, getDeviceUUID, getEnv, getFirmwareType, getFirmwareUpdateField, getFirmwareUpdateFieldArray, getFirmwareUpdateHostBindingGeneration, getHDPath, getHomeScreenDefaultList, getHomeScreenHex, getHomeScreenSize, getLanguageConfig, getLog, getLogBlockLabel, getLogger, getMethodSupportedProtocols, getMethodVersionRange, getNftSize, getOutputScriptType, getSDKVersion, getSafeLogPayload, getScriptType, getTimeStamp, httpRequest, init$1 as initCore, isBleConnect, isValidVersionArray, isValidVersionString, normalizeSafetyCheckLevel, normalizeVersionArray, parseConnectSettings, parseMessage, patchFeatures, preloadSessionCache, prepareFirmwareUpdateV4MemoryHost, projectFeatures as projectDeviceStateFeatures, registerFirmwareUpdateHostBinding, safeThrowError, setLoggerPostMessage, supportInputPinOnSoftware, switchTransport, transportEnv, unregisterFirmwareUpdateHostBinding, updateRequestContext, versionCompare, versionSplit, wait, whitelist, whitelistExtension };