@onekeyfe/hd-core 1.2.0-alpha.1 → 1.2.0-alpha.100

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 (833) hide show
  1. package/__tests__/AllNetworkGetAddressBase.tracing.test.ts +390 -0
  2. package/__tests__/DeviceCommands.test.ts +563 -0
  3. package/__tests__/DeviceEventRegistration.test.ts +49 -0
  4. package/__tests__/chain-params-onekey-compatibility.test.ts +229 -0
  5. package/__tests__/check-all-firmware-release-protocol-v2.test.ts +830 -0
  6. package/__tests__/check-firmware-release-protocol-v2.test.ts +270 -0
  7. package/__tests__/connectSettings.test.ts +59 -0
  8. package/__tests__/core-dispose.test.ts +34 -0
  9. package/__tests__/core-error-output.test.ts +39 -0
  10. package/__tests__/core-initialization.test.ts +23 -0
  11. package/__tests__/device-connector-protocol.test.ts +81 -0
  12. package/__tests__/device-features-state.test.ts +78 -0
  13. package/__tests__/device-identity.test.ts +52 -0
  14. package/__tests__/device-initialize-timeout.test.ts +56 -0
  15. package/__tests__/device-lifecycle-events.test.ts +351 -0
  16. package/__tests__/device-pool-state.test.ts +166 -0
  17. package/__tests__/device-settings.test.ts +437 -0
  18. package/__tests__/device-state-contract.test.ts +28 -0
  19. package/__tests__/device-state-events.test.ts +286 -0
  20. package/__tests__/device-state-mapper.test.ts +288 -0
  21. package/__tests__/device-state-projector.test.ts +114 -0
  22. package/__tests__/device-state-store.test.ts +109 -0
  23. package/__tests__/device-utils.test.ts +154 -0
  24. package/__tests__/device-wallet-session-store.test.ts +478 -0
  25. package/__tests__/deviceFeaturesUtils.test.ts +39 -0
  26. package/__tests__/devicePoolBootloaderPath.test.ts +64 -0
  27. package/__tests__/deviceSettings.test.ts +113 -0
  28. package/__tests__/deviceUploadNft.test.ts +316 -0
  29. package/__tests__/evmLedgerLegacySafety.test.ts +12 -6
  30. package/__tests__/evmSignTransaction.test.ts +69 -0
  31. package/__tests__/evmSignTypedData.test.ts +80 -0
  32. package/__tests__/filesystemValidation.test.ts +53 -0
  33. package/__tests__/firmware-memory-host.test.ts +126 -0
  34. package/__tests__/firmware-update/check-all-firmware-release.test.ts +175 -0
  35. package/__tests__/firmware-update/device-update-bootloader.test.ts +109 -0
  36. package/__tests__/firmware-update/firmware-artifact-source.test.ts +171 -0
  37. package/__tests__/firmware-update/firmware-host-binding.test.ts +79 -0
  38. package/__tests__/firmware-update/firmware-preparation-error.test.ts +27 -0
  39. package/__tests__/firmware-update/firmware-prepared-host-digest.test.ts +583 -0
  40. package/__tests__/firmware-update/firmware-prepared-resource-archive.test.ts +150 -0
  41. package/__tests__/firmware-update/firmware-update-bootloader-poll.test.ts +375 -0
  42. package/__tests__/firmware-update/firmware-update-capabilities.test.ts +13 -0
  43. package/__tests__/firmware-update/firmware-update-plan-bootloader-identity.test.ts +474 -0
  44. package/__tests__/firmware-update/firmware-update-plan.test.ts +815 -0
  45. package/__tests__/firmware-update/firmware-update-prepared-plan.test.ts +283 -0
  46. package/__tests__/firmware-update/firmware-update-prepared-resource-executors.test.ts +326 -0
  47. package/__tests__/firmware-update/firmware-update-v2-download-before-boot.test.ts +457 -0
  48. package/__tests__/firmware-update/firmware-update-v3-reconnect.test.ts +121 -0
  49. package/__tests__/firmware-update/firmware-update-v4-parameters.test.ts +85 -0
  50. package/__tests__/firmware-update/firmware-upload-source.test.ts +70 -0
  51. package/__tests__/get-device-state.test.ts +578 -0
  52. package/__tests__/homescreen.test.ts +81 -0
  53. package/__tests__/kaspa-public-types.type-test.ts +16 -0
  54. package/__tests__/kaspa-use-tweak-pro2.test.ts +20 -0
  55. package/__tests__/kaspaSignTransaction.test.ts +578 -0
  56. package/__tests__/known-device-public-types.type-test.ts +3 -0
  57. package/__tests__/logBlockEvent.test.ts +128 -1
  58. package/__tests__/method-protocol-support.test.ts +144 -0
  59. package/__tests__/networkUtils.test.ts +406 -0
  60. package/__tests__/open-wallet-session-error-response.test.ts +43 -0
  61. package/__tests__/open-wallet-session.test.ts +1899 -0
  62. package/__tests__/preInitialize.test.ts +33 -0
  63. package/__tests__/pro2Nft.test.ts +108 -0
  64. package/__tests__/pro2Wallpaper.test.ts +39 -0
  65. package/__tests__/protocol-binding.test.ts +89 -0
  66. package/__tests__/protocol-v2-bootloader-mode.test.ts +37 -0
  67. package/__tests__/protocol-v2-firmware-targets.test.ts +124 -0
  68. package/__tests__/protocol-v2-ping.test.ts +28 -0
  69. package/__tests__/protocol-v2-resources.test.ts +270 -0
  70. package/__tests__/protocol-v2-ui-lifecycle.test.ts +91 -0
  71. package/__tests__/protocol-v2-unlock-policy.test.ts +308 -0
  72. package/__tests__/protocol-v2.test.ts +8346 -1866
  73. package/__tests__/protocolV2FileWrite.test.ts +285 -0
  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 +101 -0
  78. package/__tests__/request-context-logging.test.ts +16 -0
  79. package/__tests__/search-devices.test.ts +145 -0
  80. package/__tests__/tron-sign-message-init.test.ts +74 -0
  81. package/__tests__/uiProgressThrottle.test.ts +74 -0
  82. package/__tests__/uiPromiseRegistry.test.ts +115 -0
  83. package/dist/api/BaseMethod.d.ts +16 -1
  84. package/dist/api/BaseMethod.d.ts.map +1 -1
  85. package/dist/api/CheckAllFirmwareRelease.d.ts +25 -1
  86. package/dist/api/CheckAllFirmwareRelease.d.ts.map +1 -1
  87. package/dist/api/CheckBLEFirmwareRelease.d.ts +3 -2
  88. package/dist/api/CheckBLEFirmwareRelease.d.ts.map +1 -1
  89. package/dist/api/CheckBootloaderRelease.d.ts +2 -1
  90. package/dist/api/CheckBootloaderRelease.d.ts.map +1 -1
  91. package/dist/api/CheckFirmwareRelease.d.ts +3 -2
  92. package/dist/api/CheckFirmwareRelease.d.ts.map +1 -1
  93. package/dist/api/CipherKeyValue.d.ts +1 -0
  94. package/dist/api/CipherKeyValue.d.ts.map +1 -1
  95. package/dist/api/ClearSessionCache.d.ts +9 -0
  96. package/dist/api/ClearSessionCache.d.ts.map +1 -0
  97. package/dist/api/DetectDeviceConnectProtocol.d.ts +7 -0
  98. package/dist/api/DetectDeviceConnectProtocol.d.ts.map +1 -0
  99. package/dist/api/DirList.d.ts +1 -0
  100. package/dist/api/DirList.d.ts.map +1 -1
  101. package/dist/api/DirMake.d.ts +1 -0
  102. package/dist/api/DirMake.d.ts.map +1 -1
  103. package/dist/api/DirRemove.d.ts +1 -0
  104. package/dist/api/DirRemove.d.ts.map +1 -1
  105. package/dist/api/FileDelete.d.ts +1 -0
  106. package/dist/api/FileDelete.d.ts.map +1 -1
  107. package/dist/api/FileRead.d.ts +1 -0
  108. package/dist/api/FileRead.d.ts.map +1 -1
  109. package/dist/api/FileWrite.d.ts +2 -0
  110. package/dist/api/FileWrite.d.ts.map +1 -1
  111. package/dist/api/FirmwareUpdate.d.ts.map +1 -1
  112. package/dist/api/FirmwareUpdateV2.d.ts +13 -2
  113. package/dist/api/FirmwareUpdateV2.d.ts.map +1 -1
  114. package/dist/api/FirmwareUpdateV3.d.ts +7 -3
  115. package/dist/api/FirmwareUpdateV3.d.ts.map +1 -1
  116. package/dist/api/FirmwareUpdateV4.d.ts +63 -6
  117. package/dist/api/FirmwareUpdateV4.d.ts.map +1 -1
  118. package/dist/api/GetDeviceState.d.ts +8 -0
  119. package/dist/api/GetDeviceState.d.ts.map +1 -0
  120. package/dist/api/GetFeatures.d.ts +1 -1
  121. package/dist/api/GetFeatures.d.ts.map +1 -1
  122. package/dist/api/GetOnekeyFeatures.d.ts.map +1 -1
  123. package/dist/api/GetPassphraseState.d.ts +2 -6
  124. package/dist/api/GetPassphraseState.d.ts.map +1 -1
  125. package/dist/api/OpenWalletSession.d.ts +8 -0
  126. package/dist/api/OpenWalletSession.d.ts.map +1 -0
  127. package/dist/api/PathInfo.d.ts +1 -0
  128. package/dist/api/PathInfo.d.ts.map +1 -1
  129. package/dist/api/PromptWebDeviceAccess.d.ts.map +1 -1
  130. package/dist/api/SearchDevices.d.ts +3 -0
  131. package/dist/api/SearchDevices.d.ts.map +1 -1
  132. package/dist/api/UploadPortfolio.d.ts +17 -0
  133. package/dist/api/UploadPortfolio.d.ts.map +1 -0
  134. package/dist/api/alephium/AlephiumGetAddress.d.ts.map +1 -1
  135. package/dist/api/alephium/AlephiumSignMessage.d.ts.map +1 -1
  136. package/dist/api/alephium/AlephiumSignTransaction.d.ts.map +1 -1
  137. package/dist/api/algo/AlgoGetAddress.d.ts +1 -0
  138. package/dist/api/algo/AlgoGetAddress.d.ts.map +1 -1
  139. package/dist/api/algo/AlgoSignTransaction.d.ts +1 -0
  140. package/dist/api/algo/AlgoSignTransaction.d.ts.map +1 -1
  141. package/dist/api/allnetwork/AllNetworkGetAddressBase.d.ts +1 -0
  142. package/dist/api/allnetwork/AllNetworkGetAddressBase.d.ts.map +1 -1
  143. package/dist/api/aptos/AptosGetAddress.d.ts +1 -0
  144. package/dist/api/aptos/AptosGetAddress.d.ts.map +1 -1
  145. package/dist/api/aptos/AptosGetPublicKey.d.ts +1 -0
  146. package/dist/api/aptos/AptosGetPublicKey.d.ts.map +1 -1
  147. package/dist/api/aptos/AptosSignInMessage.d.ts +1 -0
  148. package/dist/api/aptos/AptosSignInMessage.d.ts.map +1 -1
  149. package/dist/api/aptos/AptosSignMessage.d.ts +1 -0
  150. package/dist/api/aptos/AptosSignMessage.d.ts.map +1 -1
  151. package/dist/api/aptos/AptosSignTransaction.d.ts +1 -0
  152. package/dist/api/aptos/AptosSignTransaction.d.ts.map +1 -1
  153. package/dist/api/benfen/BenfenGetAddress.d.ts.map +1 -1
  154. package/dist/api/benfen/BenfenGetPublicKey.d.ts.map +1 -1
  155. package/dist/api/benfen/BenfenSignMessage.d.ts.map +1 -1
  156. package/dist/api/benfen/BenfenSignTransaction.d.ts.map +1 -1
  157. package/dist/api/btc/BTCGetAddress.d.ts +1 -0
  158. package/dist/api/btc/BTCGetAddress.d.ts.map +1 -1
  159. package/dist/api/btc/BTCGetPublicKey.d.ts +1 -0
  160. package/dist/api/btc/BTCGetPublicKey.d.ts.map +1 -1
  161. package/dist/api/btc/BTCSignMessage.d.ts +1 -0
  162. package/dist/api/btc/BTCSignMessage.d.ts.map +1 -1
  163. package/dist/api/btc/BTCSignPsbt.d.ts +1 -0
  164. package/dist/api/btc/BTCSignPsbt.d.ts.map +1 -1
  165. package/dist/api/btc/BTCSignTransaction.d.ts +1 -0
  166. package/dist/api/btc/BTCSignTransaction.d.ts.map +1 -1
  167. package/dist/api/btc/BTCVerifyMessage.d.ts +1 -0
  168. package/dist/api/btc/BTCVerifyMessage.d.ts.map +1 -1
  169. package/dist/api/btc/helpers/versionLimit.d.ts +2 -0
  170. package/dist/api/btc/helpers/versionLimit.d.ts.map +1 -1
  171. package/dist/api/cardano/CardanoGetAddress.d.ts +1 -0
  172. package/dist/api/cardano/CardanoGetAddress.d.ts.map +1 -1
  173. package/dist/api/cardano/CardanoGetPublicKey.d.ts +1 -0
  174. package/dist/api/cardano/CardanoGetPublicKey.d.ts.map +1 -1
  175. package/dist/api/cardano/CardanoSignMessage.d.ts +1 -0
  176. package/dist/api/cardano/CardanoSignMessage.d.ts.map +1 -1
  177. package/dist/api/cardano/CardanoSignTransaction.d.ts +1 -0
  178. package/dist/api/cardano/CardanoSignTransaction.d.ts.map +1 -1
  179. package/dist/api/conflux/ConfluxGetAddress.d.ts +2 -0
  180. package/dist/api/conflux/ConfluxGetAddress.d.ts.map +1 -1
  181. package/dist/api/conflux/ConfluxSignMessage.d.ts +2 -0
  182. package/dist/api/conflux/ConfluxSignMessage.d.ts.map +1 -1
  183. package/dist/api/conflux/ConfluxSignMessageCIP23.d.ts +2 -0
  184. package/dist/api/conflux/ConfluxSignMessageCIP23.d.ts.map +1 -1
  185. package/dist/api/conflux/ConfluxSignTransaction.d.ts +2 -0
  186. package/dist/api/conflux/ConfluxSignTransaction.d.ts.map +1 -1
  187. package/dist/api/cosmos/CosmosGetAddress.d.ts +1 -0
  188. package/dist/api/cosmos/CosmosGetAddress.d.ts.map +1 -1
  189. package/dist/api/cosmos/CosmosGetPublicKey.d.ts +1 -0
  190. package/dist/api/cosmos/CosmosGetPublicKey.d.ts.map +1 -1
  191. package/dist/api/cosmos/CosmosSignTransaction.d.ts +1 -0
  192. package/dist/api/cosmos/CosmosSignTransaction.d.ts.map +1 -1
  193. package/dist/api/device/DeviceCancel.d.ts +1 -0
  194. package/dist/api/device/DeviceCancel.d.ts.map +1 -1
  195. package/dist/api/device/DeviceChangePin.d.ts +1 -0
  196. package/dist/api/device/DeviceChangePin.d.ts.map +1 -1
  197. package/dist/api/device/DeviceFullyUploadResource.d.ts +1 -2
  198. package/dist/api/device/DeviceFullyUploadResource.d.ts.map +1 -1
  199. package/dist/api/device/DeviceLock.d.ts +1 -0
  200. package/dist/api/device/DeviceLock.d.ts.map +1 -1
  201. package/dist/api/device/DeviceRebootToBoardloader.d.ts +1 -0
  202. package/dist/api/device/DeviceRebootToBoardloader.d.ts.map +1 -1
  203. package/dist/api/device/DeviceRebootToBootloader.d.ts +1 -0
  204. package/dist/api/device/DeviceRebootToBootloader.d.ts.map +1 -1
  205. package/dist/api/device/DeviceSettings.d.ts +1 -0
  206. package/dist/api/device/DeviceSettings.d.ts.map +1 -1
  207. package/dist/api/device/DeviceSupportFeatures.d.ts +1 -0
  208. package/dist/api/device/DeviceSupportFeatures.d.ts.map +1 -1
  209. package/dist/api/device/DeviceUnlock.d.ts +3 -2
  210. package/dist/api/device/DeviceUnlock.d.ts.map +1 -1
  211. package/dist/api/device/DeviceUpdateBootloader.d.ts +5 -1
  212. package/dist/api/device/DeviceUpdateBootloader.d.ts.map +1 -1
  213. package/dist/api/device/DeviceWipe.d.ts +1 -0
  214. package/dist/api/device/DeviceWipe.d.ts.map +1 -1
  215. package/dist/api/device/PreInitialize.d.ts +1 -0
  216. package/dist/api/device/PreInitialize.d.ts.map +1 -1
  217. package/dist/api/dynex/DnxGetAddress.d.ts.map +1 -1
  218. package/dist/api/dynex/DnxSignTransaction.d.ts.map +1 -1
  219. package/dist/api/evm/EVMGetAddress.d.ts +1 -0
  220. package/dist/api/evm/EVMGetAddress.d.ts.map +1 -1
  221. package/dist/api/evm/EVMGetPublicKey.d.ts +1 -0
  222. package/dist/api/evm/EVMGetPublicKey.d.ts.map +1 -1
  223. package/dist/api/evm/EVMSignMessage.d.ts +1 -0
  224. package/dist/api/evm/EVMSignMessage.d.ts.map +1 -1
  225. package/dist/api/evm/EVMSignMessageEIP712.d.ts.map +1 -1
  226. package/dist/api/evm/EVMSignTransaction.d.ts +1 -0
  227. package/dist/api/evm/EVMSignTransaction.d.ts.map +1 -1
  228. package/dist/api/evm/EVMSignTypedData.d.ts +1 -0
  229. package/dist/api/evm/EVMSignTypedData.d.ts.map +1 -1
  230. package/dist/api/evm/EVMVerifyMessage.d.ts +1 -0
  231. package/dist/api/evm/EVMVerifyMessage.d.ts.map +1 -1
  232. package/dist/api/evm/protocol.d.ts +3 -0
  233. package/dist/api/evm/protocol.d.ts.map +1 -0
  234. package/dist/api/filecoin/FilecoinGetAddress.d.ts +1 -0
  235. package/dist/api/filecoin/FilecoinGetAddress.d.ts.map +1 -1
  236. package/dist/api/filecoin/FilecoinSignTransaction.d.ts +1 -0
  237. package/dist/api/filecoin/FilecoinSignTransaction.d.ts.map +1 -1
  238. package/dist/api/firmware/FirmwareArtifactSource.d.ts +29 -0
  239. package/dist/api/firmware/FirmwareArtifactSource.d.ts.map +1 -0
  240. package/dist/api/firmware/FirmwareHostBinding.d.ts +6 -0
  241. package/dist/api/firmware/FirmwareHostBinding.d.ts.map +1 -0
  242. package/dist/api/firmware/FirmwareMemoryHost.d.ts +22 -0
  243. package/dist/api/firmware/FirmwareMemoryHost.d.ts.map +1 -0
  244. package/dist/api/firmware/FirmwarePreparationError.d.ts +3 -0
  245. package/dist/api/firmware/FirmwarePreparationError.d.ts.map +1 -0
  246. package/dist/api/firmware/FirmwarePreparedResourceArchive.d.ts +11 -0
  247. package/dist/api/firmware/FirmwarePreparedResourceArchive.d.ts.map +1 -0
  248. package/dist/api/firmware/FirmwareUpdateBaseMethod.d.ts +12 -2
  249. package/dist/api/firmware/FirmwareUpdateBaseMethod.d.ts.map +1 -1
  250. package/dist/api/firmware/FirmwareUpdateCapabilities.d.ts +3 -0
  251. package/dist/api/firmware/FirmwareUpdateCapabilities.d.ts.map +1 -0
  252. package/dist/api/firmware/FirmwareUpdatePlan.d.ts +72 -0
  253. package/dist/api/firmware/FirmwareUpdatePlan.d.ts.map +1 -0
  254. package/dist/api/firmware/FirmwareUpdatePreparedPlan.d.ts +38 -0
  255. package/dist/api/firmware/FirmwareUpdatePreparedPlan.d.ts.map +1 -0
  256. package/dist/api/firmware/getBinary.d.ts +17 -3
  257. package/dist/api/firmware/getBinary.d.ts.map +1 -1
  258. package/dist/api/firmware/protocolV2Release.d.ts +33 -0
  259. package/dist/api/firmware/protocolV2Release.d.ts.map +1 -0
  260. package/dist/api/firmware/updateBootloader.d.ts +2 -0
  261. package/dist/api/firmware/updateBootloader.d.ts.map +1 -1
  262. package/dist/api/firmware/uploadFirmware.d.ts +9 -1
  263. package/dist/api/firmware/uploadFirmware.d.ts.map +1 -1
  264. package/dist/api/helpers/filesystemValidation.d.ts +3 -0
  265. package/dist/api/helpers/filesystemValidation.d.ts.map +1 -1
  266. package/dist/api/helpers/paramsValidator.d.ts +1 -0
  267. package/dist/api/helpers/paramsValidator.d.ts.map +1 -1
  268. package/dist/api/helpers/protocolV2FileWrite.d.ts +43 -0
  269. package/dist/api/helpers/protocolV2FileWrite.d.ts.map +1 -0
  270. package/dist/api/index.d.ts +8 -29
  271. package/dist/api/index.d.ts.map +1 -1
  272. package/dist/api/kaspa/KaspaGetAddress.d.ts +4 -0
  273. package/dist/api/kaspa/KaspaGetAddress.d.ts.map +1 -1
  274. package/dist/api/kaspa/KaspaSignTransaction.d.ts +9 -1
  275. package/dist/api/kaspa/KaspaSignTransaction.d.ts.map +1 -1
  276. package/dist/api/kaspa/helpers/TransferSerialize.d.ts.map +1 -1
  277. package/dist/api/lightning/LnurlAuth.d.ts +0 -4
  278. package/dist/api/lightning/LnurlAuth.d.ts.map +1 -1
  279. package/dist/api/near/NearGetAddress.d.ts +1 -0
  280. package/dist/api/near/NearGetAddress.d.ts.map +1 -1
  281. package/dist/api/near/NearSignTransaction.d.ts +1 -0
  282. package/dist/api/near/NearSignTransaction.d.ts.map +1 -1
  283. package/dist/api/nem/NEMGetAddress.d.ts +1 -0
  284. package/dist/api/nem/NEMGetAddress.d.ts.map +1 -1
  285. package/dist/api/nem/NEMSignTransaction.d.ts +1 -0
  286. package/dist/api/nem/NEMSignTransaction.d.ts.map +1 -1
  287. package/dist/api/neo/NeoGetAddress.d.ts.map +1 -1
  288. package/dist/api/neo/NeoSignTransaction.d.ts.map +1 -1
  289. package/dist/api/nervos/NervosGetAddress.d.ts.map +1 -1
  290. package/dist/api/nervos/NervosSignTransaction.d.ts.map +1 -1
  291. package/dist/api/nexa/NexaGetAddress.d.ts.map +1 -1
  292. package/dist/api/nexa/NexaSignTransaction.d.ts +1 -0
  293. package/dist/api/nexa/NexaSignTransaction.d.ts.map +1 -1
  294. package/dist/api/nostr/NostrDecryptMessage.d.ts +1 -0
  295. package/dist/api/nostr/NostrDecryptMessage.d.ts.map +1 -1
  296. package/dist/api/nostr/NostrEncryptMessage.d.ts +1 -0
  297. package/dist/api/nostr/NostrEncryptMessage.d.ts.map +1 -1
  298. package/dist/api/nostr/NostrGetPublicKey.d.ts +1 -0
  299. package/dist/api/nostr/NostrGetPublicKey.d.ts.map +1 -1
  300. package/dist/api/nostr/NostrSignEvent.d.ts +1 -0
  301. package/dist/api/nostr/NostrSignEvent.d.ts.map +1 -1
  302. package/dist/api/nostr/NostrSignSchnorr.d.ts +1 -0
  303. package/dist/api/nostr/NostrSignSchnorr.d.ts.map +1 -1
  304. package/dist/api/polkadot/PolkadotGetAddress.d.ts +2 -1
  305. package/dist/api/polkadot/PolkadotGetAddress.d.ts.map +1 -1
  306. package/dist/api/polkadot/PolkadotSignTransaction.d.ts +1 -0
  307. package/dist/api/polkadot/PolkadotSignTransaction.d.ts.map +1 -1
  308. package/dist/api/polkadot/networks.d.ts +1 -1
  309. package/dist/api/protocol-v2/DeviceFactoryInfoGet.d.ts +7 -0
  310. package/dist/api/protocol-v2/DeviceFactoryInfoGet.d.ts.map +1 -0
  311. package/dist/api/protocol-v2/DeviceFactoryInfoSet.d.ts +8 -0
  312. package/dist/api/protocol-v2/DeviceFactoryInfoSet.d.ts.map +1 -0
  313. package/dist/api/protocol-v2/DeviceFirmwareUpdate.d.ts +2 -1
  314. package/dist/api/protocol-v2/DeviceFirmwareUpdate.d.ts.map +1 -1
  315. package/dist/api/protocol-v2/DeviceGetFirmwareUpdateStatus.d.ts +4 -2
  316. package/dist/api/protocol-v2/DeviceGetFirmwareUpdateStatus.d.ts.map +1 -1
  317. package/dist/api/protocol-v2/DeviceGetOnboardingStatus.d.ts +1 -0
  318. package/dist/api/protocol-v2/DeviceGetOnboardingStatus.d.ts.map +1 -1
  319. package/dist/api/protocol-v2/DeviceInfoGet.d.ts +29 -0
  320. package/dist/api/protocol-v2/DeviceInfoGet.d.ts.map +1 -0
  321. package/dist/api/protocol-v2/DeviceReboot.d.ts +1 -0
  322. package/dist/api/protocol-v2/DeviceReboot.d.ts.map +1 -1
  323. package/dist/api/protocol-v2/DeviceStatusGet.d.ts +7 -0
  324. package/dist/api/protocol-v2/DeviceStatusGet.d.ts.map +1 -0
  325. package/dist/api/protocol-v2/DeviceUploadNft.d.ts +31 -0
  326. package/dist/api/protocol-v2/DeviceUploadNft.d.ts.map +1 -0
  327. package/dist/api/protocol-v2/DeviceUploadWallpaper.d.ts +27 -0
  328. package/dist/api/protocol-v2/DeviceUploadWallpaper.d.ts.map +1 -0
  329. package/dist/api/protocol-v2/FilesystemFormat.d.ts +1 -0
  330. package/dist/api/protocol-v2/FilesystemFormat.d.ts.map +1 -1
  331. package/dist/api/protocol-v2/FilesystemPermissionFix.d.ts +7 -0
  332. package/dist/api/protocol-v2/FilesystemPermissionFix.d.ts.map +1 -0
  333. package/dist/api/protocol-v2/Ping.d.ts +3 -0
  334. package/dist/api/protocol-v2/Ping.d.ts.map +1 -1
  335. package/dist/api/protocol-v2/ProtocolInfoRequest.d.ts +7 -0
  336. package/dist/api/protocol-v2/ProtocolInfoRequest.d.ts.map +1 -0
  337. package/dist/api/protocol-v2/helpers.d.ts +27 -18
  338. package/dist/api/protocol-v2/helpers.d.ts.map +1 -1
  339. package/dist/api/scdo/ScdoGetAddress.d.ts.map +1 -1
  340. package/dist/api/scdo/ScdoSignMessage.d.ts.map +1 -1
  341. package/dist/api/scdo/ScdoSignTransaction.d.ts.map +1 -1
  342. package/dist/api/solana/SolGetAddress.d.ts +1 -0
  343. package/dist/api/solana/SolGetAddress.d.ts.map +1 -1
  344. package/dist/api/solana/SolSignMessage.d.ts +2 -1
  345. package/dist/api/solana/SolSignMessage.d.ts.map +1 -1
  346. package/dist/api/solana/SolSignOffchainMessage.d.ts +2 -1
  347. package/dist/api/solana/SolSignOffchainMessage.d.ts.map +1 -1
  348. package/dist/api/solana/SolSignTransaction.d.ts +3 -2
  349. package/dist/api/solana/SolSignTransaction.d.ts.map +1 -1
  350. package/dist/api/starcoin/StarcoinGetAddress.d.ts +1 -0
  351. package/dist/api/starcoin/StarcoinGetAddress.d.ts.map +1 -1
  352. package/dist/api/starcoin/StarcoinGetPublicKey.d.ts +1 -0
  353. package/dist/api/starcoin/StarcoinGetPublicKey.d.ts.map +1 -1
  354. package/dist/api/starcoin/StarcoinSignMessage.d.ts +1 -0
  355. package/dist/api/starcoin/StarcoinSignMessage.d.ts.map +1 -1
  356. package/dist/api/starcoin/StarcoinSignTransaction.d.ts +1 -0
  357. package/dist/api/starcoin/StarcoinSignTransaction.d.ts.map +1 -1
  358. package/dist/api/starcoin/StarcoinVerifyMessage.d.ts +1 -0
  359. package/dist/api/starcoin/StarcoinVerifyMessage.d.ts.map +1 -1
  360. package/dist/api/stellar/StellarGetAddress.d.ts +1 -2
  361. package/dist/api/stellar/StellarGetAddress.d.ts.map +1 -1
  362. package/dist/api/stellar/StellarSignTransaction.d.ts +2 -3
  363. package/dist/api/stellar/StellarSignTransaction.d.ts.map +1 -1
  364. package/dist/api/sui/SuiGetAddress.d.ts +2 -1
  365. package/dist/api/sui/SuiGetAddress.d.ts.map +1 -1
  366. package/dist/api/sui/SuiGetPublicKey.d.ts +2 -1
  367. package/dist/api/sui/SuiGetPublicKey.d.ts.map +1 -1
  368. package/dist/api/sui/SuiSignMessage.d.ts +2 -1
  369. package/dist/api/sui/SuiSignMessage.d.ts.map +1 -1
  370. package/dist/api/sui/SuiSignTransaction.d.ts +2 -1
  371. package/dist/api/sui/SuiSignTransaction.d.ts.map +1 -1
  372. package/dist/api/ton/TonGetAddress.d.ts +2 -1
  373. package/dist/api/ton/TonGetAddress.d.ts.map +1 -1
  374. package/dist/api/ton/TonSignData.d.ts +2 -5
  375. package/dist/api/ton/TonSignData.d.ts.map +1 -1
  376. package/dist/api/ton/TonSignMessage.d.ts +2 -1
  377. package/dist/api/ton/TonSignMessage.d.ts.map +1 -1
  378. package/dist/api/ton/TonSignProof.d.ts +2 -1
  379. package/dist/api/ton/TonSignProof.d.ts.map +1 -1
  380. package/dist/api/tron/TronGetAddress.d.ts +1 -0
  381. package/dist/api/tron/TronGetAddress.d.ts.map +1 -1
  382. package/dist/api/tron/TronSignMessage.d.ts +6 -2
  383. package/dist/api/tron/TronSignMessage.d.ts.map +1 -1
  384. package/dist/api/tron/TronSignTransaction.d.ts +2 -2
  385. package/dist/api/tron/TronSignTransaction.d.ts.map +1 -1
  386. package/dist/api/utils.d.ts +4 -1
  387. package/dist/api/utils.d.ts.map +1 -1
  388. package/dist/api/xrp/XrpGetAddress.d.ts +1 -0
  389. package/dist/api/xrp/XrpGetAddress.d.ts.map +1 -1
  390. package/dist/api/xrp/XrpSignTransaction.d.ts +1 -0
  391. package/dist/api/xrp/XrpSignTransaction.d.ts.map +1 -1
  392. package/dist/constants/index.d.ts +1 -1
  393. package/dist/constants/index.d.ts.map +1 -1
  394. package/dist/core/RequestQueue.d.ts.map +1 -1
  395. package/dist/core/deviceEventRegistration.d.ts +13 -0
  396. package/dist/core/deviceEventRegistration.d.ts.map +1 -0
  397. package/dist/core/index.d.ts +3 -1
  398. package/dist/core/index.d.ts.map +1 -1
  399. package/dist/core/uiPromiseRegistry.d.ts +6 -0
  400. package/dist/core/uiPromiseRegistry.d.ts.map +1 -0
  401. package/dist/data-manager/DataManager.d.ts +12 -4
  402. package/dist/data-manager/DataManager.d.ts.map +1 -1
  403. package/dist/data-manager/TransportManager.d.ts.map +1 -1
  404. package/dist/data-manager/connectSettings.d.ts.map +1 -1
  405. package/dist/device/Device.d.ts +75 -17
  406. package/dist/device/Device.d.ts.map +1 -1
  407. package/dist/device/DeviceCommands.d.ts +8 -6
  408. package/dist/device/DeviceCommands.d.ts.map +1 -1
  409. package/dist/device/DeviceConnector.d.ts +4 -3
  410. package/dist/device/DeviceConnector.d.ts.map +1 -1
  411. package/dist/device/DeviceFeaturesState.d.ts +3 -0
  412. package/dist/device/DeviceFeaturesState.d.ts.map +1 -0
  413. package/dist/device/DevicePool.d.ts +6 -2
  414. package/dist/device/DevicePool.d.ts.map +1 -1
  415. package/dist/device/DeviceStateMapper.d.ts +13 -0
  416. package/dist/device/DeviceStateMapper.d.ts.map +1 -0
  417. package/dist/device/DeviceStateProjector.d.ts +7 -0
  418. package/dist/device/DeviceStateProjector.d.ts.map +1 -0
  419. package/dist/device/DeviceStateStore.d.ts +21 -0
  420. package/dist/device/DeviceStateStore.d.ts.map +1 -0
  421. package/dist/device/DeviceWalletSessionStore.d.ts +27 -0
  422. package/dist/device/DeviceWalletSessionStore.d.ts.map +1 -0
  423. package/dist/device/cloneDeviceState.d.ts +2 -0
  424. package/dist/device/cloneDeviceState.d.ts.map +1 -0
  425. package/dist/device/deviceIdentity.d.ts +5 -0
  426. package/dist/device/deviceIdentity.d.ts.map +1 -0
  427. package/dist/deviceProfile/buildDeviceFeatures.d.ts +9 -3
  428. package/dist/deviceProfile/buildDeviceFeatures.d.ts.map +1 -1
  429. package/dist/deviceProfile/index.d.ts +0 -1
  430. package/dist/deviceProfile/index.d.ts.map +1 -1
  431. package/dist/deviceProfile/protocolV2DeviceIdentity.d.ts +7 -0
  432. package/dist/deviceProfile/protocolV2DeviceIdentity.d.ts.map +1 -0
  433. package/dist/events/device.d.ts +16 -2
  434. package/dist/events/device.d.ts.map +1 -1
  435. package/dist/events/logBlockEvent.d.ts +2 -0
  436. package/dist/events/logBlockEvent.d.ts.map +1 -1
  437. package/dist/events/ui-promise.d.ts +4 -2
  438. package/dist/events/ui-promise.d.ts.map +1 -1
  439. package/dist/events/ui-request.d.ts +50 -4
  440. package/dist/events/ui-request.d.ts.map +1 -1
  441. package/dist/events/ui-response.d.ts +10 -2
  442. package/dist/events/ui-response.d.ts.map +1 -1
  443. package/dist/index.d.ts +1792 -750
  444. package/dist/index.d.ts.map +1 -1
  445. package/dist/index.js +12615 -4679
  446. package/dist/inject.d.ts +6 -1
  447. package/dist/inject.d.ts.map +1 -1
  448. package/dist/lowLevelInject.d.ts.map +1 -1
  449. package/dist/protocols/protocol-v2/deviceSession.d.ts +7 -0
  450. package/dist/protocols/protocol-v2/deviceSession.d.ts.map +1 -0
  451. package/dist/protocols/protocol-v2/features.d.ts +30 -28
  452. package/dist/protocols/protocol-v2/features.d.ts.map +1 -1
  453. package/dist/protocols/protocol-v2/firmware.d.ts +11 -9
  454. package/dist/protocols/protocol-v2/firmware.d.ts.map +1 -1
  455. package/dist/protocols/protocol-v2/index.d.ts +3 -2
  456. package/dist/protocols/protocol-v2/index.d.ts.map +1 -1
  457. package/dist/protocols/protocol-v2/resources.d.ts +12 -0
  458. package/dist/protocols/protocol-v2/resources.d.ts.map +1 -0
  459. package/dist/protocols/protocol-v2/settingsUnlockPolicy.d.ts +17 -0
  460. package/dist/protocols/protocol-v2/settingsUnlockPolicy.d.ts.map +1 -0
  461. package/dist/protocols/protocol-v2/uiInteraction.d.ts +42 -0
  462. package/dist/protocols/protocol-v2/uiInteraction.d.ts.map +1 -0
  463. package/dist/protocols/protocol-v2/unlockPolicy.d.ts +2 -0
  464. package/dist/protocols/protocol-v2/unlockPolicy.d.ts.map +1 -0
  465. package/dist/protocols/protocol-v2/unlockPolicyRunner.d.ts +22 -0
  466. package/dist/protocols/protocol-v2/unlockPolicyRunner.d.ts.map +1 -0
  467. package/dist/protocols/protocol-v2/walletSession.d.ts +27 -0
  468. package/dist/protocols/protocol-v2/walletSession.d.ts.map +1 -0
  469. package/dist/topLevelInject.d.ts.map +1 -1
  470. package/dist/types/api/checkAllFirmwareRelease.d.ts +48 -9
  471. package/dist/types/api/checkAllFirmwareRelease.d.ts.map +1 -1
  472. package/dist/types/api/checkBLEFirmwareRelease.d.ts +2 -13
  473. package/dist/types/api/checkBLEFirmwareRelease.d.ts.map +1 -1
  474. package/dist/types/api/checkBootloaderRelease.d.ts +2 -6
  475. package/dist/types/api/checkBootloaderRelease.d.ts.map +1 -1
  476. package/dist/types/api/checkFirmwareRelease.d.ts +2 -13
  477. package/dist/types/api/checkFirmwareRelease.d.ts.map +1 -1
  478. package/dist/types/api/checkFirmwareTypeAvailable.d.ts +2 -2
  479. package/dist/types/api/checkFirmwareTypeAvailable.d.ts.map +1 -1
  480. package/dist/types/api/detectDeviceConnectProtocol.d.ts +4 -0
  481. package/dist/types/api/detectDeviceConnectProtocol.d.ts.map +1 -0
  482. package/dist/types/api/deviceSettings.d.ts +11 -2
  483. package/dist/types/api/deviceSettings.d.ts.map +1 -1
  484. package/dist/types/api/deviceUnlock.d.ts +6 -2
  485. package/dist/types/api/deviceUnlock.d.ts.map +1 -1
  486. package/dist/types/api/deviceUpdateBootloader.d.ts +6 -0
  487. package/dist/types/api/deviceUpdateBootloader.d.ts.map +1 -1
  488. package/dist/types/api/export.d.ts +8 -3
  489. package/dist/types/api/export.d.ts.map +1 -1
  490. package/dist/types/api/firmwareUpdate.d.ts +68 -6
  491. package/dist/types/api/firmwareUpdate.d.ts.map +1 -1
  492. package/dist/types/api/firmwareUpdateCapabilities.d.ts +9 -0
  493. package/dist/types/api/firmwareUpdateCapabilities.d.ts.map +1 -0
  494. package/dist/types/api/firmwareUpdatePlan.d.ts +28 -0
  495. package/dist/types/api/firmwareUpdatePlan.d.ts.map +1 -0
  496. package/dist/types/api/firmwareUpdatePreparedPlan.d.ts +42 -0
  497. package/dist/types/api/firmwareUpdatePreparedPlan.d.ts.map +1 -0
  498. package/dist/types/api/getDeviceState.d.ts +12 -0
  499. package/dist/types/api/getDeviceState.d.ts.map +1 -0
  500. package/dist/types/api/getFeatures.d.ts.map +1 -1
  501. package/dist/types/api/getOnekeyFeatures.d.ts.map +1 -1
  502. package/dist/types/api/getPassphraseState.d.ts +2 -10
  503. package/dist/types/api/getPassphraseState.d.ts.map +1 -1
  504. package/dist/types/api/index.d.ts +31 -35
  505. package/dist/types/api/index.d.ts.map +1 -1
  506. package/dist/types/api/kaspaSignTransaction.d.ts +42 -4
  507. package/dist/types/api/kaspaSignTransaction.d.ts.map +1 -1
  508. package/dist/types/api/openWalletSession.d.ts +35 -0
  509. package/dist/types/api/openWalletSession.d.ts.map +1 -0
  510. package/dist/types/api/protocolV2.d.ts +17 -88
  511. package/dist/types/api/protocolV2.d.ts.map +1 -1
  512. package/dist/types/api/sessionCache.d.ts +13 -0
  513. package/dist/types/api/sessionCache.d.ts.map +1 -0
  514. package/dist/types/device.d.ts +143 -10
  515. package/dist/types/device.d.ts.map +1 -1
  516. package/dist/types/params.d.ts +2 -0
  517. package/dist/types/params.d.ts.map +1 -1
  518. package/dist/types/settings.d.ts +71 -9
  519. package/dist/types/settings.d.ts.map +1 -1
  520. package/dist/utils/assets.d.ts +2 -1
  521. package/dist/utils/assets.d.ts.map +1 -1
  522. package/dist/utils/deviceFeaturesCompat.d.ts +14 -0
  523. package/dist/utils/deviceFeaturesCompat.d.ts.map +1 -0
  524. package/dist/utils/deviceFeaturesUtils.d.ts +12 -3
  525. package/dist/utils/deviceFeaturesUtils.d.ts.map +1 -1
  526. package/dist/utils/deviceInfoUtils.d.ts +9 -9
  527. package/dist/utils/deviceInfoUtils.d.ts.map +1 -1
  528. package/dist/utils/deviceSettings.d.ts +38 -7
  529. package/dist/utils/deviceSettings.d.ts.map +1 -1
  530. package/dist/utils/deviceVersionUtils.d.ts +7 -5
  531. package/dist/utils/deviceVersionUtils.d.ts.map +1 -1
  532. package/dist/utils/homescreen.d.ts +4 -0
  533. package/dist/utils/homescreen.d.ts.map +1 -1
  534. package/dist/utils/index.d.ts +6 -3
  535. package/dist/utils/index.d.ts.map +1 -1
  536. package/dist/utils/networkUtils.d.ts +10 -1
  537. package/dist/utils/networkUtils.d.ts.map +1 -1
  538. package/dist/utils/patch.d.ts +1 -1
  539. package/dist/utils/patch.d.ts.map +1 -1
  540. package/dist/utils/pro2Nft.d.ts +31 -0
  541. package/dist/utils/pro2Nft.d.ts.map +1 -0
  542. package/dist/utils/pro2Wallpaper.d.ts +22 -0
  543. package/dist/utils/pro2Wallpaper.d.ts.map +1 -0
  544. package/dist/utils/tracing.d.ts.map +1 -1
  545. package/dist/utils/uiProgressThrottle.d.ts +3 -0
  546. package/dist/utils/uiProgressThrottle.d.ts.map +1 -0
  547. package/package.json +4 -4
  548. package/src/api/BaseMethod.ts +53 -20
  549. package/src/api/CheckAllFirmwareRelease.ts +442 -4
  550. package/src/api/CheckBLEFirmwareRelease.ts +37 -5
  551. package/src/api/CheckBootloaderRelease.ts +37 -5
  552. package/src/api/CheckFirmwareRelease.ts +36 -9
  553. package/src/api/CipherKeyValue.ts +4 -0
  554. package/src/api/ClearSessionCache.ts +32 -0
  555. package/src/api/DetectDeviceConnectProtocol.ts +18 -0
  556. package/src/api/DirList.ts +9 -4
  557. package/src/api/DirMake.ts +7 -4
  558. package/src/api/DirRemove.ts +7 -4
  559. package/src/api/FileDelete.ts +7 -4
  560. package/src/api/FileRead.ts +27 -8
  561. package/src/api/FileWrite.ts +26 -168
  562. package/src/api/FirmwareUpdate.ts +30 -15
  563. package/src/api/FirmwareUpdateV2.ts +532 -169
  564. package/src/api/FirmwareUpdateV3.ts +320 -72
  565. package/src/api/FirmwareUpdateV4.ts +2691 -428
  566. package/src/api/GetDeviceState.ts +59 -0
  567. package/src/api/GetFeatures.ts +6 -4
  568. package/src/api/GetOnekeyFeatures.ts +1 -75
  569. package/src/api/GetPassphraseState.ts +36 -18
  570. package/src/api/OpenWalletSession.ts +268 -0
  571. package/src/api/PathInfo.ts +9 -4
  572. package/src/api/PromptWebDeviceAccess.ts +2 -7
  573. package/src/api/SearchDevices.ts +31 -4
  574. package/src/api/UploadPortfolio.ts +58 -0
  575. package/src/api/alephium/AlephiumGetAddress.ts +0 -4
  576. package/src/api/alephium/AlephiumSignMessage.ts +0 -4
  577. package/src/api/alephium/AlephiumSignTransaction.ts +2 -6
  578. package/src/api/algo/AlgoGetAddress.ts +4 -0
  579. package/src/api/algo/AlgoSignTransaction.ts +4 -0
  580. package/src/api/allnetwork/AllNetworkGetAddress.ts +21 -21
  581. package/src/api/allnetwork/AllNetworkGetAddressBase.ts +45 -32
  582. package/src/api/aptos/AptosGetAddress.ts +4 -0
  583. package/src/api/aptos/AptosGetPublicKey.ts +4 -0
  584. package/src/api/aptos/AptosSignInMessage.ts +4 -0
  585. package/src/api/aptos/AptosSignMessage.ts +4 -0
  586. package/src/api/aptos/AptosSignTransaction.ts +4 -0
  587. package/src/api/benfen/BenfenGetAddress.ts +11 -7
  588. package/src/api/benfen/BenfenGetPublicKey.ts +0 -4
  589. package/src/api/benfen/BenfenSignMessage.ts +0 -4
  590. package/src/api/benfen/BenfenSignTransaction.ts +0 -4
  591. package/src/api/btc/BTCGetAddress.ts +8 -1
  592. package/src/api/btc/BTCGetPublicKey.ts +9 -2
  593. package/src/api/btc/BTCSignMessage.ts +8 -1
  594. package/src/api/btc/BTCSignPsbt.ts +4 -0
  595. package/src/api/btc/BTCSignTransaction.ts +8 -1
  596. package/src/api/btc/BTCVerifyMessage.ts +8 -1
  597. package/src/api/btc/helpers/versionLimit.ts +7 -4
  598. package/src/api/cardano/CardanoGetAddress.ts +4 -0
  599. package/src/api/cardano/CardanoGetPublicKey.ts +4 -0
  600. package/src/api/cardano/CardanoSignMessage.ts +5 -1
  601. package/src/api/cardano/CardanoSignTransaction.ts +5 -1
  602. package/src/api/conflux/ConfluxGetAddress.ts +6 -0
  603. package/src/api/conflux/ConfluxSignMessage.ts +6 -0
  604. package/src/api/conflux/ConfluxSignMessageCIP23.ts +6 -0
  605. package/src/api/conflux/ConfluxSignTransaction.ts +8 -5
  606. package/src/api/cosmos/CosmosGetAddress.ts +4 -0
  607. package/src/api/cosmos/CosmosGetPublicKey.ts +4 -0
  608. package/src/api/cosmos/CosmosSignTransaction.ts +4 -0
  609. package/src/api/device/DeviceCancel.ts +5 -0
  610. package/src/api/device/DeviceChangePin.ts +28 -0
  611. package/src/api/device/DeviceFullyUploadResource.ts +4 -5
  612. package/src/api/device/DeviceLock.ts +5 -0
  613. package/src/api/device/DeviceRebootToBoardloader.ts +9 -4
  614. package/src/api/device/DeviceRebootToBootloader.ts +9 -4
  615. package/src/api/device/DeviceSettings.ts +195 -1
  616. package/src/api/device/DeviceSupportFeatures.ts +4 -0
  617. package/src/api/device/DeviceUnlock.ts +21 -3
  618. package/src/api/device/DeviceUpdateBootloader.ts +152 -8
  619. package/src/api/device/DeviceWipe.ts +25 -0
  620. package/src/api/device/PreInitialize.ts +4 -0
  621. package/src/api/dynex/DnxGetAddress.ts +0 -6
  622. package/src/api/dynex/DnxSignTransaction.ts +0 -6
  623. package/src/api/evm/EVMGetAddress.ts +6 -2
  624. package/src/api/evm/EVMGetPublicKey.ts +6 -2
  625. package/src/api/evm/EVMSignMessage.ts +6 -2
  626. package/src/api/evm/EVMSignMessageEIP712.ts +1 -11
  627. package/src/api/evm/EVMSignTransaction.ts +6 -2
  628. package/src/api/evm/EVMSignTypedData.ts +42 -50
  629. package/src/api/evm/EVMVerifyMessage.ts +6 -2
  630. package/src/api/evm/legacyV1/getAddress.ts +2 -2
  631. package/src/api/evm/legacyV1/getPublicKey.ts +2 -2
  632. package/src/api/evm/legacyV1/signMessage.ts +2 -2
  633. package/src/api/evm/legacyV1/signTypedData.ts +2 -2
  634. package/src/api/evm/legacyV1/signTypedHash.ts +2 -2
  635. package/src/api/evm/legacyV1/verifyMessage.ts +2 -2
  636. package/src/api/evm/protocol.ts +6 -0
  637. package/src/api/filecoin/FilecoinGetAddress.ts +4 -0
  638. package/src/api/filecoin/FilecoinSignTransaction.ts +4 -0
  639. package/src/api/firmware/FirmwareArtifactSource.ts +305 -0
  640. package/src/api/firmware/FirmwareHostBinding.ts +123 -0
  641. package/src/api/firmware/FirmwareMemoryHost.ts +143 -0
  642. package/src/api/firmware/FirmwarePreparationError.ts +12 -0
  643. package/src/api/firmware/FirmwarePreparedResourceArchive.ts +187 -0
  644. package/src/api/firmware/FirmwareUpdateBaseMethod.ts +216 -65
  645. package/src/api/firmware/FirmwareUpdateCapabilities.ts +9 -0
  646. package/src/api/firmware/FirmwareUpdatePlan.ts +945 -0
  647. package/src/api/firmware/FirmwareUpdatePreparedPlan.ts +486 -0
  648. package/src/api/firmware/getBinary.ts +8 -3
  649. package/src/api/firmware/protocolV2Release.ts +168 -0
  650. package/src/api/firmware/updateBootloader.ts +19 -4
  651. package/src/api/firmware/uploadFirmware.ts +157 -26
  652. package/src/api/helpers/batchGetPublickeys.ts +2 -2
  653. package/src/api/helpers/filesystemValidation.ts +61 -0
  654. package/src/api/helpers/paramsValidator.ts +1 -1
  655. package/src/api/helpers/protocolV2FileWrite.ts +392 -0
  656. package/src/api/index.ts +9 -30
  657. package/src/api/kaspa/KaspaGetAddress.ts +7 -0
  658. package/src/api/kaspa/KaspaSignTransaction.ts +369 -29
  659. package/src/api/kaspa/helpers/TransferSerialize.ts +17 -7
  660. package/src/api/lightning/LnurlAuth.ts +0 -4
  661. package/src/api/near/NearGetAddress.ts +4 -0
  662. package/src/api/near/NearSignTransaction.ts +4 -0
  663. package/src/api/nem/NEMGetAddress.ts +4 -0
  664. package/src/api/nem/NEMSignTransaction.ts +4 -0
  665. package/src/api/neo/NeoGetAddress.ts +0 -4
  666. package/src/api/neo/NeoSignTransaction.ts +0 -4
  667. package/src/api/nervos/NervosGetAddress.ts +0 -4
  668. package/src/api/nervos/NervosSignTransaction.ts +2 -6
  669. package/src/api/nexa/NexaGetAddress.ts +0 -4
  670. package/src/api/nexa/NexaSignTransaction.ts +3 -5
  671. package/src/api/nostr/NostrDecryptMessage.ts +4 -0
  672. package/src/api/nostr/NostrEncryptMessage.ts +4 -0
  673. package/src/api/nostr/NostrGetPublicKey.ts +4 -0
  674. package/src/api/nostr/NostrSignEvent.ts +4 -0
  675. package/src/api/nostr/NostrSignSchnorr.ts +4 -0
  676. package/src/api/polkadot/PolkadotGetAddress.ts +4 -0
  677. package/src/api/polkadot/PolkadotSignTransaction.ts +4 -0
  678. package/src/api/polkadot/networks.ts +3 -3
  679. package/src/api/protocol-v2/{FactoryGetDeviceInfo.ts → DeviceFactoryInfoGet.ts} +8 -5
  680. package/src/api/protocol-v2/DeviceFactoryInfoSet.ts +35 -0
  681. package/src/api/protocol-v2/DeviceFirmwareUpdate.ts +11 -10
  682. package/src/api/protocol-v2/DeviceGetFirmwareUpdateStatus.ts +45 -7
  683. package/src/api/protocol-v2/DeviceGetOnboardingStatus.ts +10 -5
  684. package/src/api/protocol-v2/DeviceInfoGet.ts +141 -0
  685. package/src/api/protocol-v2/DeviceReboot.ts +8 -4
  686. package/src/api/protocol-v2/DeviceStatusGet.ts +19 -0
  687. package/src/api/protocol-v2/DeviceUploadNft.ts +197 -0
  688. package/src/api/protocol-v2/DeviceUploadWallpaper.ts +134 -0
  689. package/src/api/protocol-v2/FilesystemFormat.ts +9 -3
  690. package/src/api/protocol-v2/{FilesystemFixPermission.ts → FilesystemPermissionFix.ts} +7 -4
  691. package/src/api/protocol-v2/Ping.ts +37 -3
  692. package/src/api/protocol-v2/ProtocolInfoRequest.ts +21 -0
  693. package/src/api/protocol-v2/helpers.ts +71 -50
  694. package/src/api/scdo/ScdoGetAddress.ts +0 -4
  695. package/src/api/scdo/ScdoSignMessage.ts +0 -4
  696. package/src/api/scdo/ScdoSignTransaction.ts +0 -4
  697. package/src/api/solana/SolGetAddress.ts +4 -0
  698. package/src/api/solana/SolSignMessage.ts +5 -1
  699. package/src/api/solana/SolSignOffchainMessage.ts +5 -1
  700. package/src/api/solana/SolSignTransaction.ts +6 -2
  701. package/src/api/starcoin/StarcoinGetAddress.ts +4 -0
  702. package/src/api/starcoin/StarcoinGetPublicKey.ts +4 -0
  703. package/src/api/starcoin/StarcoinSignMessage.ts +4 -0
  704. package/src/api/starcoin/StarcoinSignTransaction.ts +4 -0
  705. package/src/api/starcoin/StarcoinVerifyMessage.ts +4 -0
  706. package/src/api/stellar/StellarGetAddress.ts +1 -10
  707. package/src/api/stellar/StellarSignTransaction.ts +1 -14
  708. package/src/api/sui/SuiGetAddress.ts +5 -1
  709. package/src/api/sui/SuiGetPublicKey.ts +5 -1
  710. package/src/api/sui/SuiSignMessage.ts +5 -1
  711. package/src/api/sui/SuiSignTransaction.ts +5 -1
  712. package/src/api/ton/TonGetAddress.ts +5 -1
  713. package/src/api/ton/TonSignData.ts +6 -6
  714. package/src/api/ton/TonSignMessage.ts +5 -1
  715. package/src/api/ton/TonSignProof.ts +5 -1
  716. package/src/api/tron/TronGetAddress.ts +4 -0
  717. package/src/api/tron/TronSignMessage.ts +19 -9
  718. package/src/api/tron/TronSignTransaction.ts +5 -2
  719. package/src/api/utils.ts +32 -3
  720. package/src/api/xrp/XrpGetAddress.ts +4 -0
  721. package/src/api/xrp/XrpSignTransaction.ts +5 -1
  722. package/src/constants/index.ts +1 -4
  723. package/src/core/RequestQueue.ts +1 -0
  724. package/src/core/deviceEventRegistration.ts +27 -0
  725. package/src/core/index.ts +400 -157
  726. package/src/core/uiPromiseRegistry.ts +63 -0
  727. package/src/data/messages/messages-protocol-v2.json +904 -791
  728. package/src/data/messages/messages.json +286 -1
  729. package/src/data-manager/DataManager.ts +158 -40
  730. package/src/data-manager/TransportManager.ts +7 -1
  731. package/src/data-manager/connectSettings.ts +13 -4
  732. package/src/device/Device.ts +909 -296
  733. package/src/device/DeviceCommands.ts +193 -158
  734. package/src/device/DeviceConnector.ts +44 -21
  735. package/src/device/DeviceFeaturesState.ts +25 -0
  736. package/src/device/DevicePool.ts +101 -23
  737. package/src/device/DeviceStateMapper.ts +416 -0
  738. package/src/device/DeviceStateProjector.ts +152 -0
  739. package/src/device/DeviceStateStore.ts +232 -0
  740. package/src/device/DeviceWalletSessionStore.ts +144 -0
  741. package/src/device/cloneDeviceState.ts +39 -0
  742. package/src/device/deviceIdentity.ts +18 -0
  743. package/src/deviceProfile/buildDeviceFeatures.ts +243 -212
  744. package/src/deviceProfile/index.ts +0 -1
  745. package/src/deviceProfile/protocolV2DeviceIdentity.ts +35 -0
  746. package/src/events/device.ts +22 -1
  747. package/src/events/logBlockEvent.ts +80 -2
  748. package/src/events/ui-promise.ts +4 -2
  749. package/src/events/ui-request.ts +61 -4
  750. package/src/events/ui-response.ts +12 -2
  751. package/src/index.ts +17 -0
  752. package/src/inject.ts +93 -49
  753. package/src/lowLevelInject.ts +11 -4
  754. package/src/protocols/protocol-v2/deviceSession.ts +24 -0
  755. package/src/protocols/protocol-v2/features.ts +113 -83
  756. package/src/protocols/protocol-v2/firmware.ts +14 -36
  757. package/src/protocols/protocol-v2/index.ts +8 -1
  758. package/src/protocols/protocol-v2/resources.ts +210 -0
  759. package/src/protocols/protocol-v2/settingsUnlockPolicy.ts +65 -0
  760. package/src/protocols/protocol-v2/uiInteraction.ts +250 -0
  761. package/src/protocols/protocol-v2/unlockPolicy.ts +1 -0
  762. package/src/protocols/protocol-v2/unlockPolicyRunner.ts +131 -0
  763. package/src/protocols/protocol-v2/walletSession.ts +463 -0
  764. package/src/topLevelInject.ts +11 -4
  765. package/src/types/api/checkAllFirmwareRelease.ts +72 -9
  766. package/src/types/api/checkBLEFirmwareRelease.ts +4 -13
  767. package/src/types/api/checkBootloaderRelease.ts +2 -6
  768. package/src/types/api/checkFirmwareRelease.ts +2 -13
  769. package/src/types/api/checkFirmwareTypeAvailable.ts +2 -2
  770. package/src/types/api/detectDeviceConnectProtocol.ts +6 -0
  771. package/src/types/api/deviceSettings.ts +26 -2
  772. package/src/types/api/deviceUnlock.ts +13 -2
  773. package/src/types/api/deviceUpdateBootloader.ts +7 -0
  774. package/src/types/api/export.ts +33 -1
  775. package/src/types/api/firmwareUpdate.ts +101 -19
  776. package/src/types/api/firmwareUpdateCapabilities.ts +9 -0
  777. package/src/types/api/firmwareUpdatePlan.ts +38 -0
  778. package/src/types/api/firmwareUpdatePreparedPlan.ts +53 -0
  779. package/src/types/api/getDeviceState.ts +19 -0
  780. package/src/types/api/getFeatures.ts +3 -0
  781. package/src/types/api/getOnekeyFeatures.ts +3 -0
  782. package/src/types/api/getPassphraseState.ts +9 -11
  783. package/src/types/api/index.ts +50 -72
  784. package/src/types/api/kaspaSignTransaction.ts +60 -4
  785. package/src/types/api/openWalletSession.ts +54 -0
  786. package/src/types/api/protocolV2.ts +31 -157
  787. package/src/types/api/sessionCache.ts +19 -0
  788. package/src/types/device.ts +217 -10
  789. package/src/types/params.ts +12 -1
  790. package/src/types/settings.ts +91 -42
  791. package/src/utils/assets.ts +4 -1
  792. package/src/utils/deviceFeaturesCompat.ts +191 -0
  793. package/src/utils/deviceFeaturesUtils.ts +85 -26
  794. package/src/utils/deviceInfoUtils.ts +29 -69
  795. package/src/utils/deviceSettings.ts +174 -39
  796. package/src/utils/deviceVersionUtils.ts +25 -44
  797. package/src/utils/findDefectiveBatchDevice.ts +3 -3
  798. package/src/utils/homescreen.ts +40 -0
  799. package/src/utils/index.ts +27 -3
  800. package/src/utils/networkUtils.ts +274 -16
  801. package/src/utils/pro2Nft.ts +142 -0
  802. package/src/utils/pro2Wallpaper.ts +130 -0
  803. package/src/utils/tracing.ts +3 -1
  804. package/src/utils/uiProgressThrottle.ts +63 -0
  805. package/tsconfig.type-tests.json +12 -0
  806. package/dist/api/GetDeviceInfo.d.ts +0 -9
  807. package/dist/api/GetDeviceInfo.d.ts.map +0 -1
  808. package/dist/api/protocol-v2/DevReboot.d.ts +0 -7
  809. package/dist/api/protocol-v2/DevReboot.d.ts.map +0 -1
  810. package/dist/api/protocol-v2/DeviceGetDeviceInfo.d.ts +0 -29
  811. package/dist/api/protocol-v2/DeviceGetDeviceInfo.d.ts.map +0 -1
  812. package/dist/api/protocol-v2/FactoryDeviceInfoSettings.d.ts +0 -7
  813. package/dist/api/protocol-v2/FactoryDeviceInfoSettings.d.ts.map +0 -1
  814. package/dist/api/protocol-v2/FactoryGetDeviceInfo.d.ts +0 -6
  815. package/dist/api/protocol-v2/FactoryGetDeviceInfo.d.ts.map +0 -1
  816. package/dist/api/protocol-v2/FilesystemDiskControl.d.ts +0 -13
  817. package/dist/api/protocol-v2/FilesystemDiskControl.d.ts.map +0 -1
  818. package/dist/api/protocol-v2/FilesystemFixPermission.d.ts +0 -6
  819. package/dist/api/protocol-v2/FilesystemFixPermission.d.ts.map +0 -1
  820. package/dist/api/protocol-v2/GetProtoVersion.d.ts +0 -6
  821. package/dist/api/protocol-v2/GetProtoVersion.d.ts.map +0 -1
  822. package/dist/deviceProfile/buildDeviceProfile.d.ts +0 -21
  823. package/dist/deviceProfile/buildDeviceProfile.d.ts.map +0 -1
  824. package/dist/types/api/getDeviceInfo.d.ts +0 -85
  825. package/dist/types/api/getDeviceInfo.d.ts.map +0 -1
  826. package/src/api/GetDeviceInfo.ts +0 -145
  827. package/src/api/protocol-v2/DevReboot.ts +0 -24
  828. package/src/api/protocol-v2/DeviceGetDeviceInfo.ts +0 -118
  829. package/src/api/protocol-v2/FactoryDeviceInfoSettings.ts +0 -29
  830. package/src/api/protocol-v2/FilesystemDiskControl.ts +0 -50
  831. package/src/api/protocol-v2/GetProtoVersion.ts +0 -16
  832. package/src/deviceProfile/buildDeviceProfile.ts +0 -333
  833. package/src/types/api/getDeviceInfo.ts +0 -99
package/dist/index.d.ts CHANGED
@@ -1,24 +1,71 @@
1
1
  import EventEmitter, { EventEmitter as EventEmitter$1 } from 'events';
2
- import { DevFirmwareTargetType, DevRebootType, DevFirmwareTarget, Messages, Transport, TransportCallOptions, OneKeyDeviceInfo, ProtocolV2DeviceInfo, Success as Success$1, LowlevelTransportSharedPlugin, ProtoVersion, OnboardingStatus, DevFirmwareUpdateStatus, FactoryDeviceInfo, 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
+ */
25
+ protocolV2DeviceInfoTimeoutMs?: number;
26
+ /**
27
+ * passphrase state
28
+ */
12
29
  passphraseState?: string;
30
+ /**
31
+ * Use empty passphrase
32
+ */
13
33
  useEmptyPassphrase?: boolean;
34
+ /**
35
+ * Every init session
36
+ */
14
37
  initSession?: boolean;
38
+ /**
39
+ * Use derive cardano
40
+ */
15
41
  deriveCardano?: boolean;
16
42
  detectBootloaderDevice?: boolean;
43
+ /**
44
+ * Skip web device prompt
45
+ */
17
46
  skipWebDevicePrompt?: boolean;
47
+ /**
48
+ * Skip passphrase check
49
+ */
18
50
  skipPassphraseCheck?: boolean;
51
+ /**
52
+ * Only connect device, not initialize device, only ble connect
53
+ */
19
54
  onlyConnectBleDevice?: boolean;
55
+ /**
56
+ * Use pre-initialized device state (BLE only)
57
+ */
20
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
+ */
21
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;
22
69
  }
23
70
  type Params<T> = CommonParams & T & {
24
71
  bundle?: undefined;
@@ -38,30 +85,11 @@ type Response<T> = Promise<Success<T> | Unsuccessful>;
38
85
 
39
86
  declare const safeThrowError: (error: any) => never;
40
87
 
41
- type RebootTypeInput = DevRebootType | keyof typeof DevRebootType | string | number;
88
+ type RebootTypeInput = DeviceRebootType | keyof typeof DeviceRebootType | string | number;
42
89
  type DeviceRebootParams = {
43
90
  rebootType?: RebootTypeInput;
44
91
  reboot_type?: RebootTypeInput;
45
92
  };
46
- type DeviceFirmwareTargetInput = DevFirmwareTarget | {
47
- targetId?: DevFirmwareTargetType | string | number;
48
- target_id?: DevFirmwareTargetType | string | number;
49
- path: string;
50
- };
51
- type DeviceFirmwareUpdateParams = {
52
- targets?: DeviceFirmwareTargetInput[];
53
- targetId?: DevFirmwareTargetType | string | number;
54
- target_id?: DevFirmwareTargetType | string | number;
55
- path?: string;
56
- };
57
- type FactoryDeviceInfoSettingsParams = {
58
- serial_no?: string;
59
- serialNo?: string;
60
- cpu_info?: string;
61
- cpuInfo?: string;
62
- pre_firmware?: string;
63
- preFirmware?: string;
64
- };
65
93
 
66
94
  type PassphrasePromptResponse = {
67
95
  passphrase?: string;
@@ -79,15 +107,19 @@ type TypedCallResponseMap = {
79
107
  [K in MessageKey]: TypedResponseMessage<K>;
80
108
  };
81
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
+ */
82
114
  declare class DeviceCommands {
83
115
  instanceId: string;
84
116
  currentResponseID?: number;
85
- device: Device$1;
117
+ device: Device;
86
118
  transport: Transport;
87
119
  mainId: string;
88
120
  disposed: boolean;
89
121
  callPromise?: Promise<DefaultMessageResponse>;
90
- constructor(device: Device$1, mainId: string);
122
+ constructor(device: Device, mainId: string);
91
123
  dispose(_cancelRequest: boolean): Promise<void>;
92
124
  checkDisposed(): void;
93
125
  cancelDeviceOnOneKeyDevice(): Promise<{
@@ -104,7 +136,7 @@ declare class DeviceCommands {
104
136
  };
105
137
  } | {
106
138
  success: boolean;
107
- 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 | 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 | 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;
108
140
  payload: {
109
141
  message: string;
110
142
  };
@@ -123,7 +155,7 @@ declare class DeviceCommands {
123
155
  };
124
156
  } | {
125
157
  success: boolean;
126
- 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 | 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 | 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;
127
159
  payload: {
128
160
  message: string;
129
161
  };
@@ -135,365 +167,174 @@ declare class DeviceCommands {
135
167
  _commonCall(type: MessageKey, msg?: DefaultMessageResponse['message'], options?: TransportCallOptions): Promise<DefaultMessageResponse>;
136
168
  _filterCommonTypes(res: DefaultMessageResponse, callType: MessageKey, options?: TransportCallOptions): Promise<DefaultMessageResponse>;
137
169
  _promptPin(type?: Messages.PinMatrixRequestType): Promise<string>;
138
- _promptPassphrase(options: PassphraseRequestPayload): Promise<PassphrasePromptResponse>;
170
+ promptPassphrase(options: PassphraseRequestPayload, promptOptions?: {
171
+ cancelDeviceOnReject?: boolean;
172
+ }): Promise<PassphrasePromptResponse>;
139
173
  }
140
174
 
141
- type DeviceDescriptorDiff = {
142
- didUpdate: boolean;
143
- connected: OneKeyDeviceInfo[];
144
- disconnected: OneKeyDeviceInfo[];
145
- changedSessions: OneKeyDeviceInfo[];
146
- changedDebugSessions: OneKeyDeviceInfo[];
147
- acquired: OneKeyDeviceInfo[];
148
- debugAcquired: OneKeyDeviceInfo[];
149
- released: OneKeyDeviceInfo[];
150
- debugReleased: OneKeyDeviceInfo[];
151
- descriptors: OneKeyDeviceInfo[];
152
- };
153
-
154
- declare class DeviceConnector {
155
- transport: Transport;
156
- listenTimestamp: number;
157
- current: OneKeyDeviceInfo[] | null;
158
- upcoming: OneKeyDeviceInfo[];
159
- listening: boolean;
160
- constructor();
161
- enumerate(): Promise<DeviceDescriptorDiff | undefined>;
162
- listen(): Promise<void>;
163
- stop(): void;
164
- acquire(path: string, session?: string | null, forceCleanRunPromise?: boolean, connectProtocol?: HardwareConnectProtocol): Promise<string | undefined>;
165
- release(session: string, onclose: boolean): Promise<void>;
166
- disconnect(session: string | undefined | null): Promise<void>;
167
- promptDeviceAccess(): Promise<USBDevice | BluetoothDevice | null>;
168
- _reportDevicesChange(): void;
169
- }
175
+ type ProtocolV2RuntimeMode = 'normal' | 'bootloader' | 'romloader';
170
176
 
171
- type InitOptions = {
172
- initSession?: boolean;
173
- deviceId?: string;
174
- passphraseState?: string;
175
- deriveCardano?: boolean;
176
- connectProtocol?: HardwareConnectProtocol;
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>;
177
200
  };
178
- type RunOptions = {
179
- keepSession?: boolean;
180
- skipInitialize?: boolean;
181
- } & InitOptions;
182
- interface DeviceEvents {
183
- [DEVICE.PIN]: [Device$1, Messages.PinMatrixRequestType | undefined, (err: any, pin: string) => void];
184
- [DEVICE.PASSPHRASE_ON_DEVICE]: [Device$1, ((response: any) => void)?];
185
- [DEVICE.BUTTON]: [Device$1, DeviceButtonRequestPayload];
186
- [DEVICE.FEATURES]: [Device$1, DeviceFeaturesPayload];
187
- [DEVICE.PASSPHRASE]: [
188
- Device$1,
189
- PassphraseRequestPayload,
190
- (response: PassphrasePromptResponse, error?: Error) => void
191
- ];
192
- [DEVICE.SELECT_DEVICE_IN_BOOTLOADER_FOR_WEB_DEVICE]: [
193
- Device$1,
194
- (err: any, deviceId: string) => void
195
- ];
196
- [DEVICE.SELECT_DEVICE_FOR_SWITCH_FIRMWARE_WEB_DEVICE]: [
197
- Device$1,
198
- (err: any, deviceId: string) => void
199
- ];
200
- }
201
- declare function preloadSessionCache(deviceId: string, passphraseState: string, sessionId: string): void;
202
- interface Device$1 {
203
- on<K extends keyof DeviceEvents>(type: K, listener: (...event: DeviceEvents[K]) => void): this;
204
- off<K extends keyof DeviceEvents>(type: K, listener: (...event: DeviceEvents[K]) => void): this;
205
- emit<K extends keyof DeviceEvents>(type: K, ...args: DeviceEvents[K]): boolean;
206
- }
207
- declare class Device$1 extends EventEmitter {
208
- originalDescriptor: OneKeyDeviceInfo;
209
- sdkInstanceId?: string;
210
- instanceId: string;
211
- createdAt: number;
212
- mainId?: string | null;
213
- deviceConnector?: DeviceConnector | null;
214
- commands: DeviceCommands;
215
- private cancelableAction?;
216
- private deviceAcquired;
217
- features: Features | undefined;
218
- featuresNeedsReload: boolean;
219
- runPromise?: Deferred<void> | null;
220
- externalState: string[];
221
- unavailableCapabilities: UnavailableCapabilities;
222
- instance: number;
223
- internalState: string[];
224
- needReloadDevice: boolean;
225
- keepSession: boolean;
226
- passphraseState: string | undefined;
227
- pendingCallbackPromise?: Deferred<void>;
228
- private preInitializedAt?;
229
- private preInitializeMeta?;
230
- private lastInitializeDurationMs?;
231
- constructor(descriptor: OneKeyDeviceInfo, sdkInstanceId?: string);
232
- static fromDescriptor(originalDescriptor: OneKeyDeviceInfo, sdkInstanceId?: string): Device$1;
233
- toMessageObject(): Device | null;
234
- connect(connectProtocol?: HardwareConnectProtocol): Promise<boolean>;
235
- acquire(connectProtocol?: HardwareConnectProtocol): Promise<void>;
236
- release(): Promise<void>;
237
- preInitialize(initOptions?: InitOptions): Promise<void>;
238
- markPreInitialized(meta?: {
239
- passphraseState?: string;
240
- }): void;
241
- clearPreInitialized(): void;
242
- isPreInitializeMetaMatch(payload?: {
243
- passphraseState?: string;
244
- }): boolean;
245
- isPreInitializedValid(ttlMs: number): boolean;
246
- setLastInitializeDuration(durationMs: number): void;
247
- getLastInitializeDuration(): number | undefined;
248
- getCommands(): DeviceCommands;
249
- getProtocol(): 'V1' | 'V2';
250
- isProtocolV2(): boolean;
251
- getCurrentDeviceType(): IDeviceType;
252
- getCurrentDeviceId(): string | undefined;
253
- getCurrentSerialNo(): string;
254
- getConnectId(): string;
255
- getCurrentBleName(): string | null;
256
- getCurrentLabel(): string | null;
257
- getCurrentPassphraseProtection(): boolean | null | undefined;
258
- getCurrentFirmwareType(): _onekeyfe_hd_shared.EFirmwareType;
259
- getCurrentFirmwareVersionString(): string;
260
- getCurrentBLEFirmwareVersionString(): string | undefined;
261
- getCurrentSafetyChecks(): string | null | undefined;
262
- getCurrentMethodVersionRange(getVersionRange: (deviceModel: IDeviceType | IDeviceModel) => IVersionRange | undefined): IVersionRange | undefined;
263
- supportNewPassphrase(): SupportFeatureType;
264
- supportInputPinOnSoftware(): SupportFeatureType;
265
- supportModifyHomescreen(): SupportFeatureType;
266
- private generateStateKey;
267
- private getSessionCacheDeviceKey;
268
- getInternalState(_deviceId?: string): string | undefined;
269
- updateInternalState(enablePassphrase: boolean, passphraseState: string | undefined, deviceId: string | undefined, sessionId?: string | null, featuresSessionId?: string | null): void;
270
- private setInternalState;
271
- clearInternalState(_deviceId?: string): void;
272
- initialize(options?: InitOptions): Promise<void>;
273
- private _initializeProtocolV2;
274
- private _refreshProtocolV2Status;
275
- getFeatures(): Promise<Features | undefined>;
276
- _updateFeatures(protoFeatures: Messages.Features | Features, initSession?: boolean): void;
277
- updateProtocolV2Features(deviceInfo?: ProtocolV2DeviceInfo): Features;
278
- updateDescriptor(descriptor: OneKeyDeviceInfo, forceUpdate?: boolean): void;
279
- updateFromCache(device: Device$1): void;
280
- run(fn?: () => Promise<void>, options?: RunOptions): Promise<void>;
281
- _runInner<T>(fn: (() => Promise<T>) | undefined, options: RunOptions): Promise<undefined>;
282
- interruptionFromOutside(): Promise<void>;
283
- interruptionFromUser(): Promise<void>;
284
- setCancelableAction(callback: (err?: Error) => Promise<unknown>): void;
285
- clearCancelableAction(): void;
286
- getMode(): EOneKeyDeviceMode;
287
- getFirmwareVersion(): IVersionArray | null;
288
- getBLEFirmwareVersion(): IVersionArray | null;
289
- isUsed(): boolean;
290
- hasDeviceAcquire(): boolean;
291
- isUsedHere(): boolean;
292
- isUsedElsewhere(): boolean;
293
- isBootloader(): boolean | undefined;
294
- isInitialized(): boolean | undefined;
295
- isSeedless(): boolean | undefined;
296
- isUnacquired(): boolean;
297
- hasUnexpectedMode(allow: string[], require: string[]): "ui-device_bootloader_mode" | "ui-device_not_in_bootloader_mode" | "ui-device_not_initialized" | "ui-device_seedless" | null;
298
- hasUsePassphrase(): boolean;
299
- checkDeviceId(deviceId: string): boolean;
300
- lockDevice(): Promise<Success$1>;
301
- supportUnlockVersionRange(): DeviceFirmwareRange;
302
- unlockDevice(): Promise<Features | undefined>;
303
- checkPassphraseStateSafety(passphraseState?: string, useEmptyPassphrase?: boolean, skipPassphraseCheck?: boolean): Promise<boolean>;
304
- }
305
-
306
- declare function generateSdkInstanceId(): string;
307
- declare function generateInstanceId(type: string, sdkInstanceId?: string): string;
308
- interface RequestContext {
309
- responseID: number;
310
- sdkInstanceId?: string;
311
- methodName: string;
312
- connectId?: string;
313
- deviceInstanceId?: string;
314
- commandsInstanceId?: string;
315
- parentResponseID?: number;
316
- startTime: number;
317
- endTime?: number;
318
- status?: 'pending' | 'running' | 'success' | 'error' | 'cancelled';
319
- error?: string;
320
- }
321
- interface SdkTracingContext {
322
- sdkInstanceId: string;
323
- createdAt: number;
324
- activeRequests: Map<number, RequestContext>;
325
- }
326
- declare function createSdkTracingContext(): SdkTracingContext;
327
- declare function createRequestContext(responseID: number, methodName: string, options?: {
328
- sdkInstanceId?: string;
329
- connectId?: string;
330
- deviceInstanceId?: string;
331
- commandsInstanceId?: string;
332
- parentResponseID?: number;
333
- }): RequestContext;
334
- declare function updateRequestContext(responseID: number, updates: Partial<RequestContext>): void;
335
- declare function completeRequestContext(responseID: number, error?: Error): void;
336
- declare function getActiveRequestsByDeviceInstance(deviceInstanceId: string): RequestContext[];
337
- declare function formatRequestContext(context: RequestContext): string;
338
- declare function cleanupSdkInstance(sdkInstanceId: string): void;
339
-
340
- declare class Core extends EventEmitter {
341
- private tracingContext;
342
- readonly sdkInstanceId: string;
343
- private requestQueue;
344
- private prePendingCallPromise;
345
- private methodSynchronize;
346
- constructor();
347
- private getCoreContext;
348
- handleMessage(message: CoreMessage): Promise<any>;
349
- dispose(): void;
350
- }
351
- declare const init$1: (settings: ConnectSettings, Transport: any, plugin?: LowlevelTransportSharedPlugin) => Promise<Core | undefined>;
352
- declare const switchTransport: ({ env, Transport, plugin, }: {
353
- env: ConnectSettings['env'];
354
- Transport: any;
355
- plugin?: LowlevelTransportSharedPlugin | undefined;
356
- }) => void;
357
-
358
- type DeviceGetDeviceInfoTargets = {
359
- hw?: boolean;
360
- fw?: boolean;
361
- bt?: boolean;
362
- se1?: boolean;
363
- se2?: boolean;
364
- se3?: boolean;
365
- se4?: boolean;
366
- status?: 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;
213
+ };
214
+ type IProtocolV2ResourceSource = {
215
+ archiveUrl: string;
216
+ archiveSha256: string;
217
+ archiveSize: number;
218
+ };
219
+ type IProtocolV2Resources = {
220
+ source: IProtocolV2ResourceSource;
221
+ };
222
+ type IProtocolV2ResourceManifestFile = {
223
+ archive_path: string;
224
+ original_name: string;
225
+ device_path: string;
226
+ size: number;
227
+ sha256: string;
228
+ signed: true;
229
+ sig_algo: 'ed25519' | 'mldsa65';
230
+ payload_version: string | null;
231
+ };
232
+ type IProtocolV2ResourceManifest = {
233
+ schema: 1;
234
+ artifact_name: string;
235
+ release_name: string;
236
+ variant: 'resource';
237
+ commit: string;
238
+ short_sha: string;
239
+ timestamp_utc: string;
240
+ core_version: string;
241
+ key_set: string;
242
+ device_root: 'vol0:';
243
+ restore_mode: 'bootloader_update';
244
+ trees: Array<{
245
+ path: string;
246
+ device: string;
247
+ }>;
248
+ files: IProtocolV2ResourceManifestFile[];
367
249
  };
368
- type DeviceGetDeviceInfoTypes = {
369
- version?: boolean;
370
- build_id?: boolean;
371
- hash?: boolean;
372
- specific?: boolean;
250
+ /** STM32 firmware config */
251
+ type IFirmwareReleaseInfo = {
252
+ required: boolean;
253
+ url: string;
254
+ /**
255
+ * Firmware type (bitcoinonly or universal)
256
+ * This field is not present in the remote config, but will be inferred from the firmware field name
257
+ */
258
+ firmwareType?: EFirmwareType;
259
+ /** Firmware UI resource */
260
+ resource?: string;
261
+ resourceFingerprint?: string;
262
+ resourceExpectedSize?: number;
263
+ /** Firmware full UI resource */
264
+ fullResource?: string;
265
+ fullResourceFingerprint?: string;
266
+ fullResourceExpectedSize?: number;
267
+ fullResourceRange?: string[];
268
+ bootloaderResource?: string;
269
+ bootloaderFingerprint?: string;
270
+ bootloaderExpectedSize?: number;
271
+ bootloaderVersion?: IVersionArray;
272
+ displayBootloaderVersion?: IVersionArray;
273
+ bootloaderRelatedFirmwareVersion?: IVersionArray;
274
+ upgradeType?: 'payload-package-set' | string;
275
+ components?: Record<string, IProtocolV2FirmwareComponent>;
276
+ installOrder?: string[];
277
+ bootloaderChangelog?: {
278
+ [k in ILocale]: string;
279
+ };
280
+ fingerprint: string;
281
+ expectedSize?: number;
282
+ version: IVersionArray;
283
+ changelog: {
284
+ [k in ILocale]: string;
285
+ };
373
286
  };
374
- type DeviceGetDeviceInfoParams = {
375
- targets?: DeviceGetDeviceInfoTargets;
376
- types?: DeviceGetDeviceInfoTypes;
287
+ /** BLE firmware config */
288
+ type IBLEFirmwareReleaseInfo = {
289
+ required: boolean;
290
+ /** bluetooth dfu version */
291
+ url: string;
292
+ /** stm bluetooth update version */
293
+ webUpdate: string;
294
+ fingerprint: string;
295
+ fingerprintWeb: string;
296
+ expectedSize?: number;
297
+ version: IVersionArray;
298
+ changelog: {
299
+ [k in ILocale]: string;
300
+ };
377
301
  };
378
-
379
- type FileOpSuccess = {
380
- message?: string;
302
+ type IKnownDevice = Exclude<IDeviceType, 'unknown'>;
303
+ type IDeviceReleaseInfo = {
304
+ firmware?: IFirmwareReleaseInfo[];
305
+ /** Protocol V2 payload package set */
306
+ 'firmware-v1'?: IFirmwareReleaseInfo[];
307
+ 'firmware-v2'?: IFirmwareReleaseInfo[];
308
+ 'firmware-v8'?: IFirmwareReleaseInfo[];
309
+ 'firmware-btc-v8'?: IFirmwareReleaseInfo[];
310
+ ble?: IBLEFirmwareReleaseInfo[];
311
+ /** Independent Protocol V2 resource release configuration. */
312
+ resources?: IProtocolV2Resources;
381
313
  };
382
- type FileInfo = {
383
- path: string;
384
- offset: number;
385
- total_size: number;
386
- data?: Uint8Array;
387
- data_hash?: number;
388
- processed_byte?: number;
389
- chunks?: number;
390
- };
391
- type DirInfo = {
392
- path: string;
393
- child_dirs?: string;
394
- child_files?: string;
314
+ type DeviceTypeMap = {
315
+ [k in Exclude<IKnownDevice, 'neo'>]: IDeviceReleaseInfo;
316
+ } & {
317
+ /** Optional until every remote-config producer publishes a Neo entry. */
318
+ neo?: IDeviceReleaseInfo;
395
319
  };
396
- type PathInfoResult = {
397
- exist: boolean;
398
- size: number;
399
- year: number;
400
- month: number;
401
- day: number;
402
- hour: number;
403
- minute: number;
404
- second: number;
405
- readonly: boolean;
406
- hidden: boolean;
407
- system: boolean;
408
- archive: boolean;
409
- directory: boolean;
410
- };
411
- declare function getProtoVersion(connectId: string, params?: CommonParams): Response<ProtoVersion>;
412
- declare function ping(connectId: string, params?: CommonParams & {
413
- message?: string;
414
- }): Response<Success$1>;
415
- declare function deviceReboot(connectId: string, params: CommonParams & DeviceRebootParams): Response<Success$1>;
416
- declare function deviceGetDeviceInfo(connectId: string, params?: CommonParams & DeviceGetDeviceInfoParams): Response<ProtocolV2DeviceInfo>;
417
- declare function deviceGetOnboardingStatus(connectId: string, params?: CommonParams): Response<OnboardingStatus>;
418
- declare function deviceFirmwareUpdate(connectId: string, params: CommonParams & DeviceFirmwareUpdateParams): Response<Success$1 | DevFirmwareUpdateStatus>;
419
- declare function deviceGetFirmwareUpdateStatus(connectId: string, params?: CommonParams): Response<DevFirmwareUpdateStatus>;
420
- declare function devReboot(connectId: string, params: CommonParams & DeviceRebootParams): Response<Success$1>;
421
- declare function devGetDeviceInfo(connectId: string, params?: CommonParams & DeviceGetDeviceInfoParams): Response<ProtocolV2DeviceInfo>;
422
- declare function devFirmwareUpdate(connectId: string, params: CommonParams & DeviceFirmwareUpdateParams): Response<Success$1 | DevFirmwareUpdateStatus>;
423
- declare function devGetFirmwareUpdateStatus(connectId: string, params?: CommonParams): Response<DevFirmwareUpdateStatus>;
424
- declare function factoryDeviceInfoSettings(connectId: string, params: FactoryDeviceInfoSettingsParams): Response<Success$1>;
425
- declare function factoryGetDeviceInfo(connectId: string): Response<FactoryDeviceInfo>;
426
- declare function filesystemFixPermission(connectId: string): Response<Success$1>;
427
- declare function fileRead(connectId: string, params: {
428
- path: string;
429
- offset?: number;
430
- totalSize?: number;
431
- chunkLen?: number;
432
- uiPercentage?: number;
433
- }): Response<FileInfo>;
434
- declare function fileWrite(connectId: string, params: {
435
- path: string;
436
- offset?: number;
437
- totalSize?: number;
438
- chunkSize?: number;
439
- chunkLen?: number;
440
- data: ArrayBuffer | Uint8Array | Blob | string;
441
- overwrite?: boolean;
442
- append?: boolean;
443
- uiPercentage?: number;
444
- timeoutMs?: number | string;
445
- }): Response<FileInfo>;
446
- declare function fileDelete(connectId: string, params: {
447
- path: string;
448
- }): Response<FileOpSuccess>;
449
- declare function dirList(connectId: string, params: {
450
- path: string;
451
- depth?: number;
452
- }): Response<DirInfo>;
453
- declare function dirMake(connectId: string, params: {
454
- path: string;
455
- }): Response<FileOpSuccess>;
456
- declare function dirRemove(connectId: string, params: {
457
- path: string;
458
- }): Response<FileOpSuccess>;
459
- declare function pathInfo(connectId: string, params: {
460
- path: string;
461
- timeoutMs?: number | string;
462
- }): Response<PathInfoResult>;
463
- declare const filesystemFileRead: typeof fileRead;
464
- declare const filesystemFileWrite: typeof fileWrite;
465
- declare const filesystemFileDelete: typeof fileDelete;
466
- declare const filesystemDirList: typeof dirList;
467
- declare const filesystemDirMake: typeof dirMake;
468
- declare const filesystemDirRemove: typeof dirRemove;
469
- declare const filesystemPathInfoQuery: typeof pathInfo;
470
- declare function filesystemFormat(connectId: string): Response<Success$1>;
471
- declare function filesystemDiskControl(connectId: string, params: CommonParams & {
472
- enable: boolean | 0 | 1;
473
- timeoutMs?: number | string;
474
- }): Response<Success$1>;
475
-
476
- declare const on: <T extends string, P extends (...args: any[]) => any>(type: T, fn: P) => void;
477
- declare const off: (type: any, fn: any) => void;
478
- declare const removeAllListeners: (type: any) => void;
479
-
480
- declare function uiResponse(response: UiResponseEvent): void;
481
-
482
- type IAddHardwareGlobalEventListener = (coreMessage: CoreMessage) => void;
483
- interface LowLevelInjectApi {
484
- call: CallMethod;
485
- eventEmitter: EventEmitter$1;
486
- init: CoreApi['init'];
487
- dispose: CoreApi['dispose'];
488
- uiResponse: CoreApi['uiResponse'];
489
- cancel: CoreApi['cancel'];
490
- updateSettings: CoreApi['updateSettings'];
491
- switchTransport: CoreApi['switchTransport'];
492
- addHardwareGlobalEventListener: (listener: IAddHardwareGlobalEventListener) => void;
493
- }
494
- type LowLevelCoreApi = Omit<CoreApi, 'on' | 'off'> & {
495
- addHardwareGlobalEventListener: (listener: IAddHardwareGlobalEventListener) => void;
320
+ type AssetsMap = {
321
+ bridge: {
322
+ version: IVersionArray;
323
+ linux32Rpm: string;
324
+ linux64Rpm: string;
325
+ linux32Deb: string;
326
+ linux64Deb: string;
327
+ win: string;
328
+ mac: string;
329
+ sha256sumAsc: string;
330
+ changelog: {
331
+ [k in ILocale]: string;
332
+ };
333
+ };
496
334
  };
335
+ type RemoteConfigResponse = {
336
+ bridge: AssetsMap['bridge'];
337
+ } & DeviceTypeMap;
497
338
 
498
339
  type DeviceStatus = 'available' | 'occupied' | 'used';
499
340
  declare enum EOneKeyDeviceMode {
@@ -508,6 +349,14 @@ type UnavailableCapabilities = {
508
349
  };
509
350
  type KnownDevice = {
510
351
  connectId: string | null;
352
+ /** Protocol family confirmed by the transport's active probe. */
353
+ connectProtocol?: HardwareConnectProtocol;
354
+ /**
355
+ * Stable physical-device identity. Current SDK responses always include this
356
+ * value; it remains optional in the type during the uuid compatibility window.
357
+ */
358
+ serialNo?: string;
359
+ /** @deprecated Use serialNo instead. */
511
360
  uuid: string;
512
361
  deviceId: string | null;
513
362
  deviceType: IDeviceType | null;
@@ -517,9 +366,12 @@ type KnownDevice = {
517
366
  bleName: string | null;
518
367
  name: string;
519
368
  error?: typeof undefined;
369
+ /** Current SDK/transport usage state for connection indicators. */
370
+ status?: DeviceStatus;
520
371
  mode: EOneKeyDeviceMode;
521
- features?: Features;
522
- sessionId?: string | null;
372
+ features: Features;
373
+ /** Unified SDK device-state snapshot; features remains a legacy projection. */
374
+ state?: DeviceState;
523
375
  unavailableCapabilities: UnavailableCapabilities;
524
376
  bleFirmwareVersion: IVersionArray | null;
525
377
  firmwareVersion: IVersionArray | null;
@@ -529,18 +381,35 @@ type KnownDevice = {
529
381
  };
530
382
  type SearchDevice = {
531
383
  connectId: string | null;
384
+ /** Protocol family confirmed by the transport's active probe. */
385
+ connectProtocol?: HardwareConnectProtocol;
386
+ /**
387
+ * Available after device initialization. BLE discovery does not connect to the
388
+ * device, so it returns null until a later initialized device response. Current
389
+ * SDK responses always include the field; it remains optional in the type during
390
+ * the uuid compatibility window.
391
+ */
392
+ serialNo?: string | null;
393
+ /**
394
+ * @deprecated Ambiguous legacy identifier. Use serialNo for hardware identity
395
+ * and connectId for transport routing.
396
+ */
532
397
  uuid: string;
533
398
  deviceId: string | null;
534
399
  deviceType: IDeviceType;
535
400
  name: string;
536
401
  commType: OneKeyDeviceCommType;
537
402
  };
538
- type Device = KnownDevice;
403
+ type Device$1 = KnownDevice;
539
404
  type DeviceFeaturesProtocol = 'V1' | 'V2' | 'unknown';
540
- type DeviceFeaturesMode = 'normal' | 'bootloader' | 'notInitialized' | 'backupMode' | 'unknown';
405
+ type DeviceFeaturesMode = 'normal' | 'bootloader' | 'romloader' | 'notInitialized' | 'backupMode' | 'unknown';
541
406
  type DeviceFeaturesVerify = {
542
407
  firmwareBuildId?: string;
543
408
  firmwareHash?: string;
409
+ applicationP1BuildId?: string;
410
+ applicationP1Hash?: string;
411
+ applicationP2BuildId?: string;
412
+ applicationP2Hash?: string;
544
413
  bootloaderBuildId?: string;
545
414
  bootloaderHash?: string;
546
415
  boardBuildId?: string;
@@ -567,9 +436,126 @@ type DeviceFeaturesVerify = {
567
436
  type DeviceFeaturesRaw = {
568
437
  protocolV1Features?: Messages.Features;
569
438
  protocolV1OneKeyFeatures?: OnekeyFeatures;
439
+ protocolV2ProtocolInfo?: ProtocolInfo;
570
440
  protocolV2DeviceInfo?: ProtocolV2DeviceInfo;
441
+ protocolV2DeviceStatus?: DeviceStatus$1;
442
+ };
443
+ type DeviceFeaturesRawPatch = {
444
+ [Key in keyof DeviceFeaturesRaw]?: DeviceFeaturesRaw[Key] | null;
445
+ };
446
+ type DeviceStateProtocol = DeviceFeaturesProtocol;
447
+ type DeviceStateMode = DeviceFeaturesMode;
448
+ type DeviceStateSection = 'identity' | 'status' | 'settings' | 'versions' | 'verification';
449
+ type DeviceStateUpdateSource = 'initialize' | 'device-info' | 'device-status' | 'settings-read' | 'settings-write' | 'change-pin' | 'lock' | 'unlock' | 'passphrase' | 'session-clear' | 'firmware-update' | 'transport-reconnect' | 'compatibility';
450
+ type DeviceStateIdentity = {
451
+ deviceType: IDeviceType;
452
+ firmwareType: EFirmwareType;
453
+ model: string | null;
454
+ vendor: string | null;
455
+ deviceId: string | null;
456
+ serialNo: string;
457
+ label: string | null;
458
+ bleName: string | null;
459
+ };
460
+ type DeviceStateStatus = {
461
+ mode: DeviceStateMode;
462
+ initialized: boolean | null;
463
+ unlocked: boolean | null;
464
+ firmwarePresent: boolean | null;
465
+ backupRequired: boolean | null;
466
+ noBackup: boolean | null;
467
+ unfinishedBackup: boolean | null;
468
+ recoveryMode: boolean | null;
469
+ passphraseProtection: boolean | null;
470
+ pinProtection: boolean | null;
471
+ /** `attach_to_pin_enabled`:是否至少存在一个 Attach PIN 绑定。 */
472
+ attachToPinEnabled: boolean | null;
473
+ /** `unlocked_by_attach_to_pin`:本次解锁是否由 Attach PIN 完成。 */
474
+ unlockedAttachPin: boolean | null;
475
+ };
476
+ type DeviceStateSettings = {
477
+ language: string | null;
478
+ bleEnabled: boolean | null;
479
+ sdCardPresent: boolean | null;
480
+ sdProtection: boolean | null;
481
+ wipeCodeProtection: boolean | null;
482
+ passphraseAlwaysOnDevice: boolean | null;
483
+ safetyChecks: Enum_SafetyCheckLevel | null;
484
+ autoLockDelayMs: number | null;
485
+ autoShutdownDelayMs: number | null;
486
+ displayRotation: number | null;
487
+ experimentalFeatures: boolean | null;
488
+ wallpaperPath: string | null;
489
+ brightness: number | null;
490
+ animationEnabled: boolean | null;
491
+ tapToWake: boolean | null;
492
+ hapticFeedback: boolean | null;
493
+ deviceNameDisplayEnabled: boolean | null;
494
+ airgapMode: boolean | null;
495
+ fidoEnabled: boolean | null;
496
+ usbLockEnabled: boolean | null;
497
+ randomKeypad: boolean | null;
498
+ };
499
+ type DeviceStateVersions = {
500
+ firmware: string | null;
501
+ applicationP1?: string | null;
502
+ applicationP2?: string | null;
503
+ bootloader: string | null;
504
+ board: string | null;
505
+ ble: string | null;
506
+ /** @deprecated Kept for legacy consumers; new code should read se01. */
507
+ se?: string | null;
508
+ se01?: string | null;
509
+ se02?: string | null;
510
+ se03?: string | null;
511
+ se04?: string | null;
512
+ se01Boot?: string | null;
513
+ se02Boot?: string | null;
514
+ se03Boot?: string | null;
515
+ se04Boot?: string | null;
516
+ };
517
+ type DeviceStateSecurityElement = {
518
+ type: string | null;
519
+ state: string | null;
520
+ };
521
+ type DeviceStateSecurityElements = Partial<Record<'se01' | 'se02' | 'se03' | 'se04', DeviceStateSecurityElement>>;
522
+ type DeviceStateSecurityElementsPatch = Partial<Record<keyof DeviceStateSecurityElements, Partial<DeviceStateSecurityElement>>>;
523
+ type DeviceState = {
524
+ schemaVersion: 1;
525
+ revision: number;
526
+ updatedAt: number;
527
+ protocol: DeviceStateProtocol;
528
+ /** Device-message protocol version, independent of the SDK V1/V2 protocol family. */
529
+ protocolVersion: number | null;
530
+ identity: DeviceStateIdentity;
531
+ status: DeviceStateStatus;
532
+ settings: DeviceStateSettings;
533
+ versions: DeviceStateVersions;
534
+ /** Secure-element metadata exposed by the unified firmware information read. */
535
+ securityElements?: DeviceStateSecurityElements;
536
+ capabilities: Array<number | string>;
537
+ verification?: Partial<DeviceFeaturesVerify>;
538
+ };
539
+ type DeviceStatePatch = {
540
+ protocol?: DeviceStateProtocol;
541
+ protocolVersion?: number | null;
542
+ identity?: Partial<DeviceStateIdentity>;
543
+ status?: Partial<DeviceStateStatus>;
544
+ settings?: Partial<DeviceStateSettings>;
545
+ versions?: Partial<DeviceStateVersions>;
546
+ securityElements?: DeviceStateSecurityElementsPatch;
547
+ capabilities?: Array<number | string>;
548
+ verification?: DeviceFeaturesVerify;
549
+ raw?: DeviceFeaturesRawPatch;
550
+ };
551
+ type DeviceStateEvent = {
552
+ connectId: string | null;
553
+ state: DeviceState;
554
+ revision: number;
555
+ source: DeviceStateUpdateSource;
556
+ changedKeys: string[];
571
557
  };
572
- type Features = {
558
+ type NormalizedFeatures = {
573
559
  protocol: DeviceFeaturesProtocol;
574
560
  protocolVersion?: number | null;
575
561
  deviceType: IDeviceType;
@@ -598,10 +584,23 @@ type Features = {
598
584
  sdProtection: boolean | null;
599
585
  wipeCodeProtection: boolean | null;
600
586
  passphraseAlwaysOnDevice: boolean | null;
601
- safetyChecks: string | null;
587
+ /** `attach_to_pin_enabled`:是否至少存在一个 Attach PIN 绑定。 */
588
+ attachToPinEnabled?: boolean | null;
589
+ safetyChecks: Enum_SafetyCheckLevel | null;
602
590
  autoLockDelayMs: number | null;
591
+ autoShutdownDelayMs: number | null;
603
592
  displayRotation: number | null;
604
593
  experimentalFeatures: boolean | null;
594
+ wallpaperPath: string | null;
595
+ brightness: number | null;
596
+ animationEnabled: boolean | null;
597
+ tapToWake: boolean | null;
598
+ hapticFeedback: boolean | null;
599
+ deviceNameDisplayEnabled: boolean | null;
600
+ airgapMode: boolean | null;
601
+ fidoEnabled: boolean | null;
602
+ usbLockEnabled: boolean | null;
603
+ randomKeypad: boolean | null;
605
604
  firmwareVersion: string | null;
606
605
  bootloaderVersion: string | null;
607
606
  boardVersion: string | null;
@@ -621,9 +620,16 @@ type Features = {
621
620
  unlockedAttachPin?: boolean;
622
621
  raw?: DeviceFeaturesRaw;
623
622
  };
623
+ type Features = NormalizedFeatures & Partial<Omit<Messages.Features, keyof NormalizedFeatures>> & Partial<Omit<Messages.OnekeyFeatures, keyof NormalizedFeatures | keyof Messages.Features>>;
624
624
  type OnekeyFeatures = Messages.OnekeyFeatures;
625
- type IDeviceType = EDeviceType.Unknown | EDeviceType.Classic | EDeviceType.Classic1s | EDeviceType.ClassicPure | EDeviceType.Mini | EDeviceType.Touch | EDeviceType.Pro | EDeviceType.Pro2;
626
- type IDeviceModel = 'model_classic' | 'model_mini' | 'model_touch' | 'model_classic1s';
625
+ type IDeviceType = EDeviceType.Unknown | EDeviceType.Classic | EDeviceType.Classic1s | EDeviceType.ClassicPure | EDeviceType.Mini | EDeviceType.Touch | EDeviceType.Pro | EDeviceType.Pro2 | EDeviceType.Neo;
626
+ /**
627
+ * model_classic: 'classic' | 'classic1s' | 'classicpure'
628
+ * model_mini: 'classic' | 'classic1s' | 'classicpure' | 'mini'
629
+ * model_touch: 'touch' | 'pro'
630
+ * model_pro2: 'pro2' | 'neo'
631
+ */
632
+ type IDeviceModel = 'model_classic' | 'model_mini' | 'model_touch' | 'model_classic1s' | 'model_pro2';
627
633
  declare const DeviceModelToTypes: {
628
634
  [deviceModel in IDeviceModel]: IDeviceType[];
629
635
  };
@@ -636,7 +642,6 @@ type ITransportStatus = 'valid' | 'outdated';
636
642
  type IVersionRange = {
637
643
  min: string;
638
644
  max?: string;
639
- unsupported?: boolean;
640
645
  };
641
646
  type DeviceFirmwareRange = {
642
647
  [deviceType in IDeviceType | IDeviceModel]?: IVersionRange;
@@ -687,280 +692,674 @@ type SupportFeatures = {
687
692
  modifyHomescreen: SupportFeatureType;
688
693
  };
689
694
 
690
- type transportEnv = 'node' | 'web' | 'webextension' | 'electron' | 'react-native' | 'webusb' | 'desktop-webusb' | 'desktop-web-ble' | 'emulator' | 'lowlevel' | 'node-usb';
691
- type ConnectSettings = {
692
- connectSrc?: string;
693
- debug?: boolean;
694
- transportReconnect?: boolean;
695
- lazyLoad?: boolean;
696
- origin?: string;
697
- parentOrigin?: string;
698
- configSrc: string;
699
- iframeSrc: string;
700
- version: string;
701
- priority: number;
702
- trustedHost: boolean;
703
- supportedBrowser?: boolean;
704
- env: transportEnv;
705
- timestamp: number;
706
- isFrame?: boolean;
707
- preRelease?: boolean;
708
- fetchConfig?: boolean;
709
- extension?: string;
710
- configFetcher?: (url: string) => Promise<RemoteConfigResponse | null>;
711
- protocolV2DeviceInfoMockEnabled?: boolean;
712
- };
713
- type IVersionArray = [number, number, number];
714
- type ILocale = 'zh-CN' | 'en-US';
715
- type IFirmwareReleaseInfo = {
716
- required: boolean;
717
- url: string;
718
- firmwareType?: EFirmwareType;
719
- resource?: string;
720
- fullResource?: string;
721
- fullResourceRange?: string[];
722
- bootloaderResource?: string;
723
- bootloaderVersion?: IVersionArray;
724
- displayBootloaderVersion?: IVersionArray;
725
- bootloaderRelatedFirmwareVersion?: IVersionArray;
726
- bootloaderChangelog?: {
727
- [k in ILocale]: string;
728
- };
729
- fingerprint: string;
730
- version: IVersionArray;
731
- changelog: {
732
- [k in ILocale]: string;
733
- };
734
- };
735
- type IBLEFirmwareReleaseInfo = {
736
- required: boolean;
737
- url: string;
738
- webUpdate: string;
739
- fingerprint: string;
740
- fingerprintWeb: string;
741
- version: IVersionArray;
742
- changelog: {
743
- [k in ILocale]: string;
744
- };
745
- };
746
- type IKnownDevice = Exclude<IDeviceType, 'unknown' | 'pro2'>;
747
- type DeviceTypeMap = {
748
- [k in IKnownDevice]: {
749
- firmware: IFirmwareReleaseInfo[];
750
- 'firmware-v2'?: IFirmwareReleaseInfo[];
751
- 'firmware-v8'?: IFirmwareReleaseInfo[];
752
- 'firmware-btc-v8'?: IFirmwareReleaseInfo[];
753
- ble: IBLEFirmwareReleaseInfo[];
754
- };
695
+ type DeviceStateScope = 'runtime' | 'settings' | 'firmware';
696
+ type GetDeviceStateParams = CommonParams & {
697
+ scope?: DeviceStateScope;
755
698
  };
756
- type AssetsMap = {
757
- bridge: {
758
- version: IVersionArray;
759
- linux32Rpm: string;
760
- linux64Rpm: string;
761
- linux32Deb: string;
762
- linux64Deb: string;
763
- win: string;
764
- mac: string;
765
- sha256sumAsc: string;
766
- changelog: {
767
- [k in ILocale]: string;
768
- };
769
- };
699
+ /** Internal state-read options, not part of the public CoreApi. */
700
+ type DeviceStateReadOptions = {
701
+ refreshSections?: DeviceStateSection[];
702
+ includeRaw?: boolean;
770
703
  };
771
- type RemoteConfigResponse = {
772
- bridge: AssetsMap['bridge'];
773
- } & DeviceTypeMap;
774
-
775
- declare function init(settings: Partial<ConnectSettings>, lowLevelApi?: LowLevelCoreApi, pulgin?: LowlevelTransportSharedPlugin): Promise<boolean>;
776
- declare function updateSettings(settings: Partial<ConnectSettings>): Promise<boolean>;
777
-
778
- declare function testInitializeDeviceDuration(connectId?: string, params?: CommonParams): Response<number>;
704
+ declare function getDeviceState(connectId?: string, params?: GetDeviceStateParams): Response<DeviceState>;
779
705
 
780
- declare function preInitialize(connectId: string, params?: CommonParams): Response<boolean>;
781
-
782
- declare function getLogs(): Response<string[]>;
783
-
784
- declare function checkBridgeStatus(): Response<boolean>;
785
-
786
- type CheckBridgeReleaseResponse = {
787
- shouldUpdate: boolean;
788
- status: 'outdated' | 'valid';
789
- releaseVersion: string;
790
- } | null;
791
- declare function checkBridgeRelease(connectId?: string, params?: CommonParams & {
792
- willUpdateFirmwareVersion?: string;
793
- }): Response<CheckBridgeReleaseResponse>;
794
-
795
- type CheckBootloaderReleaseResponse = {
796
- shouldUpdate: boolean;
797
- status: 'outdated' | 'valid';
798
- release: string | undefined;
799
- bootloaderMode: boolean;
800
- } | null;
801
- type CheckBootloaderReleaseParams = {
802
- willUpdateFirmwareVersion?: string;
803
- firmwareType?: EFirmwareType;
706
+ type DeviceDescriptorDiff = {
707
+ didUpdate: boolean;
708
+ connected: OneKeyDeviceInfo[];
709
+ disconnected: OneKeyDeviceInfo[];
710
+ changedSessions: OneKeyDeviceInfo[];
711
+ changedDebugSessions: OneKeyDeviceInfo[];
712
+ acquired: OneKeyDeviceInfo[];
713
+ debugAcquired: OneKeyDeviceInfo[];
714
+ released: OneKeyDeviceInfo[];
715
+ debugReleased: OneKeyDeviceInfo[];
716
+ descriptors: OneKeyDeviceInfo[];
804
717
  };
805
- declare function checkBootloaderRelease(connectId?: string, params?: CommonParams & CheckBootloaderReleaseParams): Response<CheckBootloaderReleaseResponse>;
806
718
 
807
- type FirmwareRelease$2 = {
808
- shouldUpdate?: boolean;
809
- status: IDeviceFirmwareStatus;
810
- changelog?: {
811
- 'zh-CN': string;
812
- 'en-US': string;
813
- }[];
814
- release: IDeviceBLEFirmwareStatus | IBLEFirmwareReleaseInfo;
815
- bootloaderMode?: boolean;
816
- };
817
- type AllFirmwareRelease = {
818
- firmware: FirmwareRelease$2;
819
- ble: FirmwareRelease$2;
820
- bootloader?: FirmwareRelease$2;
821
- bridge?: FirmwareRelease$2;
822
- features?: Features$1;
823
- };
824
- type CheckAllFirmwareReleaseParams = {
825
- checkBridgeRelease?: boolean;
826
- firmwareType?: EFirmwareType;
827
- };
828
- declare function checkAllFirmwareRelease(connectId?: string, params?: CommonParams & CheckAllFirmwareReleaseParams): Response<AllFirmwareRelease>;
719
+ declare class DeviceConnector {
720
+ transport?: Transport;
721
+ listenTimestamp: number;
722
+ current: OneKeyDeviceInfo[] | null;
723
+ upcoming: OneKeyDeviceInfo[];
724
+ listening: boolean;
725
+ constructor();
726
+ private getActiveTransport;
727
+ enumerate(): Promise<DeviceDescriptorDiff | undefined>;
728
+ listen(): Promise<void>;
729
+ stop(): void;
730
+ acquire(path: string, session?: string | null, forceCleanRunPromise?: boolean, expectedProtocol?: HardwareConnectProtocol, protocolHint?: HardwareConnectProtocol): Promise<string | undefined>;
731
+ release(session: string, onclose: boolean, keepSession?: boolean): Promise<void>;
732
+ disconnect(session: string | undefined | null): Promise<void>;
733
+ promptDeviceAccess(): Promise<USBDevice | BluetoothDevice | null>;
734
+ _reportDevicesChange(): void;
735
+ }
829
736
 
830
- type CheckFirmwareTypeAvailableParams = {
831
- deviceType: EDeviceType;
832
- firmwareType: EFirmwareType;
737
+ type InitOptions = {
738
+ initSession?: boolean;
739
+ deviceId?: string;
740
+ passphraseState?: string;
741
+ deriveCardano?: boolean;
742
+ connectProtocol?: HardwareConnectProtocol;
743
+ forceProtocolDetection?: boolean;
744
+ protocolV2DeviceInfoTimeoutMs?: number;
745
+ /** Refresh Protocol V2 runtime state before returning discovery results. */
746
+ refreshRuntimeState?: boolean;
747
+ /**
748
+ * Protocol V1 Initialize response timeout override. Reboot-wait polling passes a
749
+ * short value so an unanswered probe settles before the next poll tick.
750
+ */
751
+ timeoutMs?: number;
833
752
  };
834
- declare function checkFirmwareTypeAvailable(params: CheckFirmwareTypeAvailableParams): Response<FirmwareRelease$2 | undefined>;
753
+ type RunOptions = {
754
+ keepSession?: boolean;
755
+ skipInitialize?: boolean;
756
+ } & InitOptions;
757
+ interface DeviceEvents {
758
+ [DEVICE.PIN]: [Device, Messages.PinMatrixRequestType | undefined, (err: any, pin: string) => void];
759
+ [DEVICE.PIN_ON_DEVICE]: [Device, DeviceSessionPinType, ProtocolV2UiEventMetadata?];
760
+ [DEVICE.PIN_ON_DEVICE_COMPLETE]: [Device, HardwareUiInteractionMeta];
761
+ [DEVICE.PASSPHRASE_ON_DEVICE]: [Device, PassphraseRequestPayload?];
762
+ [DEVICE.ATTACH_PIN_ON_DEVICE]: [Device, PassphraseRequestPayload?];
763
+ [DEVICE.BUTTON]: [Device, DeviceButtonRequestPayload];
764
+ [DEVICE.FEATURES]: [Device, DeviceFeaturesPayload];
765
+ [DEVICE.STATE]: [Device, DeviceStateEvent];
766
+ [DEVICE.PASSPHRASE]: [
767
+ Device,
768
+ PassphraseRequestPayload,
769
+ (response: PassphrasePromptResponse, error?: Error) => void
770
+ ];
771
+ [DEVICE.SELECT_DEVICE_IN_BOOTLOADER_FOR_WEB_DEVICE]: [
772
+ Device,
773
+ (err: any, deviceId: string) => void
774
+ ];
775
+ [DEVICE.SELECT_DEVICE_FOR_SWITCH_FIRMWARE_WEB_DEVICE]: [
776
+ Device,
777
+ (err: any, deviceId: string) => void
778
+ ];
779
+ }
780
+ /**
781
+ * Pre-populate the device session cache with a known session ID.
782
+ *
783
+ * This allows short-lived processes (e.g. CLI) to restore a previously
784
+ * obtained session, avoiding the need to re-enter passphrase on every
785
+ * invocation. The session must have been obtained from a prior
786
+ * wallet-session call on the same device. This compatibility hook is intended
787
+ * for a trusted CLI process restoring its own OS-keychain entry.
788
+ *
789
+ * @param deviceId - The device's device_id (from features)
790
+ * @param passphraseState - The passphrase state token
791
+ * @param sessionId - The session_id to cache (from features.session_id)
792
+ */
793
+ declare function preloadSessionCache(deviceId: string, passphraseState: string, sessionId: string): void;
794
+ interface Device {
795
+ on<K extends keyof DeviceEvents>(type: K, listener: (...event: DeviceEvents[K]) => void): this;
796
+ off<K extends keyof DeviceEvents>(type: K, listener: (...event: DeviceEvents[K]) => void): this;
797
+ emit<K extends keyof DeviceEvents>(type: K, ...args: DeviceEvents[K]): boolean;
798
+ }
799
+ declare class Device extends EventEmitter {
800
+ /**
801
+ * 设备标识对象
802
+ */
803
+ originalDescriptor: OneKeyDeviceInfo;
804
+ sdkInstanceId?: string;
805
+ /**
806
+ * 设备实例唯一标识
807
+ */
808
+ instanceId: string;
809
+ createdAt: number;
810
+ /**
811
+ * 设备主 ID
812
+ * 蓝牙连接时是设备的 UUID
813
+ * USB连接时是设备的 sessionID
814
+ */
815
+ mainId?: string | null;
816
+ /**
817
+ * 通信管道,向设备发送请求
818
+ */
819
+ deviceConnector?: DeviceConnector | null;
820
+ /**
821
+ * 固件命令
822
+ */
823
+ commands: DeviceCommands;
824
+ /**
825
+ * 可取消的操作
826
+ */
827
+ private cancelableAction?;
828
+ /**
829
+ * 设备是否被占用
830
+ */
831
+ private deviceAcquired;
832
+ /** Canonical device-state cache; legacy Features is a compatibility projection. */
833
+ private stateStore;
834
+ /** Force the next initialization to reload DeviceInfo after reconnect or reboot. */
835
+ private protocolV2StateNeedsReload;
836
+ /** Runtime context negotiated once per active Protocol V2 link. */
837
+ private protocolV2RuntimeContext?;
838
+ /** Coalesces concurrent first-use runtime negotiation on the same active link. */
839
+ private protocolV2RuntimeContextPromise?;
840
+ /** Invalidates an in-flight runtime-context response without adding a transport epoch. */
841
+ private protocolV2RuntimeContextRequestToken?;
842
+ private protocolV2UiInteraction?;
843
+ private protocolV2UiInteractionCounter;
844
+ get state(): (DeviceState & {
845
+ raw?: DeviceFeaturesRaw | undefined;
846
+ }) | undefined;
847
+ get features(): Features | undefined;
848
+ set features(features: Features | undefined);
849
+ runPromise?: Deferred<void> | null;
850
+ externalState: string[];
851
+ unavailableCapabilities: UnavailableCapabilities;
852
+ instance: number;
853
+ internalState: string[];
854
+ needReloadDevice: boolean;
855
+ /**
856
+ * 执行 API 方法后是否保留 SessionID
857
+ */
858
+ keepSession: boolean;
859
+ passphraseState: string | undefined;
860
+ pendingCallbackPromise?: Deferred<void>;
861
+ /** Pre-initialize timestamp (ms) */
862
+ private preInitializedAt?;
863
+ /** Pre-initialize context, used to verify state consistency before skipping */
864
+ private preInitializeMeta?;
865
+ /** Last Initialize duration (ms), reported as "saved" when a skip happens */
866
+ private lastInitializeDurationMs?;
867
+ constructor(descriptor: OneKeyDeviceInfo, sdkInstanceId?: string);
868
+ static fromDescriptor(originalDescriptor: OneKeyDeviceInfo, sdkInstanceId?: string): Device;
869
+ toMessageObject(): Device$1 | null;
870
+ /**
871
+ * Device connect
872
+ * @returns {Promise<boolean>}
873
+ */
874
+ connect(connectProtocol?: HardwareConnectProtocol, options?: {
875
+ forceProtocolDetection?: boolean;
876
+ }): Promise<boolean>;
877
+ acquire(expectedProtocol?: HardwareConnectProtocol, options?: {
878
+ throwOnRunPromiseError?: boolean;
879
+ forceProtocolDetection?: boolean;
880
+ }): Promise<void>;
881
+ release(): Promise<void>;
882
+ /**
883
+ * Pre-initialize: connect + Initialize ahead of the sign.
884
+ */
885
+ preInitialize(initOptions?: InitOptions): Promise<void>;
886
+ markPreInitialized(meta?: {
887
+ passphraseState?: string;
888
+ }): void;
889
+ clearPreInitialized(): void;
890
+ isPreInitializeMetaMatch(payload?: {
891
+ passphraseState?: string;
892
+ }): boolean;
893
+ isPreInitializedValid(ttlMs: number): boolean;
894
+ setLastInitializeDuration(durationMs: number): void;
895
+ getLastInitializeDuration(): number | undefined;
896
+ getCommands(): DeviceCommands;
897
+ /**
898
+ * Canonical protocol discriminator.
899
+ *
900
+ * descriptor.protocolType is established by active probing; V2 features are mapped
901
+ * from DeviceInfoGet. All protocol branches must use this method instead of reading
902
+ * originalDescriptor.protocolType directly or inferring a protocol from features.
903
+ */
904
+ getProtocol(): 'V1' | 'V2';
905
+ isProtocolV2(): boolean;
906
+ getCurrentDeviceType(): IDeviceType;
907
+ getCurrentDeviceId(): string | undefined;
908
+ getCurrentSerialNo(): string;
909
+ getConnectId(): string;
910
+ getCurrentBleName(): string | null;
911
+ getCurrentLabel(): string | null;
912
+ getCurrentDisplayName(): string | null;
913
+ getCurrentPassphraseProtection(): boolean | null | undefined;
914
+ getCurrentFirmwareType(): EFirmwareType;
915
+ getCurrentFirmwareVersionString(): string;
916
+ getCurrentBLEFirmwareVersionString(): string | undefined;
917
+ getCurrentBootloaderVersionString(): string | undefined;
918
+ getCurrentSafetyChecks(): _onekeyfe_hd_transport.Enum_SafetyCheckLevel | null | undefined;
919
+ getCurrentMethodVersionRange(getVersionRange: (deviceModel: IDeviceType | IDeviceModel) => IVersionRange | undefined): IVersionRange | undefined;
920
+ supportNewPassphrase(): SupportFeatureType;
921
+ supportInputPinOnSoftware(): SupportFeatureType;
922
+ supportModifyHomescreen(): SupportFeatureType;
923
+ private getSessionCacheDeviceKey;
924
+ private reconcileSessionCacheDeviceIdentity;
925
+ getInternalState(_deviceId?: string): string | undefined;
926
+ getStandardInternalState(_deviceId?: string): {
927
+ passphraseState: string;
928
+ sessionId: string;
929
+ } | undefined;
930
+ updateInternalState(enablePassphrase: boolean, passphraseState: string | undefined, deviceId: string | undefined, sessionId?: string | null, featuresSessionId?: string | null, walletType?: 'standard' | 'hidden'): void;
931
+ private setInternalState;
932
+ clearInternalState(_deviceId?: string): void;
933
+ clearStandardInternalState(_deviceId?: string): void;
934
+ initialize(options?: InitOptions): Promise<void>;
935
+ /**
936
+ * Device initialization over Protocol V2.
937
+ *
938
+ * Protocol V2 bypasses legacy Initialize/GetFeatures and builds its canonical
939
+ * features state directly from DeviceInfoGet.
940
+ */
941
+ private _initializeProtocolV2;
942
+ getFeatures(): Promise<Features | undefined>;
943
+ getDeviceState(params?: DeviceStateReadOptions): Promise<DeviceState>;
944
+ _updateFeatures(protoFeatures: Messages.Features | Features, initSession?: boolean): void;
945
+ updateState(patch: DeviceStatePatch, source: DeviceStateUpdateSource): DeviceState & {
946
+ raw?: DeviceFeaturesRaw | undefined;
947
+ };
948
+ updateFeaturesPatch(patch: Partial<Features>, source: DeviceStateUpdateSource): Features | undefined;
949
+ ensureProtocolV2RuntimeContext(timeoutMs?: number): Promise<ProtocolInfo>;
950
+ probeProtocolV2RuntimeState(deviceInfo?: ProtocolV2DeviceInfo, timeoutMs?: number): Promise<Features>;
951
+ updateProtocolV2Features(deviceInfo?: ProtocolV2DeviceInfo, deviceStatus?: DeviceStatus$1 | null, runtimeMode?: ProtocolV2RuntimeMode, protocolInfo?: ProtocolInfo): Features;
952
+ updateProtocolV2Status(status: DeviceStatus$1): Features;
953
+ markTransportDisconnected(): void;
954
+ invalidateAfterWipe(): void;
955
+ markProtocolV2Reboot(rebootType: DeviceRebootType): void;
956
+ /**
957
+ * 暂时只在 acquire 后更新 Session ID
958
+ * 后续看是否有需要依据 listen 返回结果更新
959
+ * @param descriptor
960
+ */
961
+ updateDescriptor(descriptor: OneKeyDeviceInfo, forceUpdate?: boolean): void;
962
+ updateFromCache(device: Device): void;
963
+ run(fn?: () => Promise<void>, options?: RunOptions): Promise<void>;
964
+ _runInner<T>(fn: (() => Promise<T>) | undefined, options: RunOptions, runPromise: Deferred<void>): Promise<void>;
965
+ interruptionFromOutside(): Promise<void>;
966
+ interruptionFromUser(): Promise<void>;
967
+ setCancelableAction(callback: (err?: Error) => Promise<unknown>): void;
968
+ clearCancelableAction(): void;
969
+ getMode(): EOneKeyDeviceMode;
970
+ getStatus(): "available" | "occupied" | "used";
971
+ getFirmwareVersion(): IVersionArray | null;
972
+ getBLEFirmwareVersion(): IVersionArray | null;
973
+ isUsed(): boolean;
974
+ hasDeviceAcquire(): boolean;
975
+ isUsedHere(): boolean;
976
+ isUsedElsewhere(): boolean;
977
+ isBootloader(): boolean | undefined;
978
+ isRomloader(): boolean | undefined;
979
+ isInitialized(): boolean | undefined;
980
+ isSeedless(): boolean | undefined;
981
+ isUnacquired(): boolean;
982
+ hasUnexpectedMode(allow: string[], require: string[]): "ui-device_bootloader_mode" | "ui-device_not_in_bootloader_mode" | "ui-device_not_initialized" | "ui-device_seedless" | null;
983
+ hasUsePassphrase(): boolean;
984
+ checkDeviceId(deviceId: string): boolean;
985
+ lockDevice(): Promise<Success$1>;
986
+ beginProtocolV2UiInteraction(): void;
987
+ createProtocolV2UiPhaseMetadata(phase: HardwareUiInteractionMeta['phase'], transition: HardwareUiInteractionMeta['transition'], options?: {
988
+ phaseId?: string;
989
+ outcome?: HardwareUiInteractionMeta['outcome'];
990
+ }): HardwareUiInteractionMeta | undefined;
991
+ completeProtocolV2UiPhase(phase: HardwareUiInteractionMeta, outcome?: HardwareUiInteractionMeta['outcome']): HardwareUiInteractionMeta | undefined;
992
+ finishProtocolV2UiInteraction(outcome?: HardwareUiInteractionMeta['outcome'], options?: {
993
+ ensureMetadata?: boolean;
994
+ }): HardwareUiInteractionMeta | undefined;
995
+ hasOpenProtocolV2UiInteraction(): boolean;
996
+ supportUnlockVersionRange(): DeviceFirmwareRange;
997
+ unlockDevice(pinType?: DeviceSessionPinType, options?: ProtocolV2UiEventMetadata & {
998
+ emitUiEvent?: boolean;
999
+ }): Promise<Features | undefined>;
1000
+ checkPassphraseStateSafety(passphraseState?: string, useEmptyPassphrase?: boolean, skipPassphraseCheck?: boolean, deriveCardano?: boolean): Promise<boolean>;
1001
+ }
835
1002
 
836
- declare function searchDevices(params?: CommonParams): Response<SearchDevice[]>;
1003
+ /**
1004
+ * SDK Tracing Utilities
1005
+ * Tracks object instances and request call chains across multiple SDK instances
1006
+ */
1007
+ /**
1008
+ * Generate SDK instance ID
1009
+ * @returns Format: "SDK-<number>-<timestamp>"
1010
+ * @example "SDK-1-123456"
1011
+ */
1012
+ declare function generateSdkInstanceId(): string;
1013
+ /**
1014
+ * Generate globally unique instance ID
1015
+ * @param type Instance type (Device, DeviceCommands, BaseMethod, etc.)
1016
+ * @param sdkInstanceId SDK instance ID (optional)
1017
+ * @returns Format: <SDK>.<type>-<number>-<timestamp>
1018
+ * @example "SDK-1.Device-1-123456" or "Device-1-123456"
1019
+ */
1020
+ declare function generateInstanceId(type: string, sdkInstanceId?: string): string;
1021
+ /**
1022
+ * Request context information
1023
+ */
1024
+ interface RequestContext {
1025
+ /** Request unique ID (reuses BaseMethod.responseID) */
1026
+ responseID: number;
1027
+ /** SDK instance ID */
1028
+ sdkInstanceId?: string;
1029
+ /** API method name */
1030
+ methodName: string;
1031
+ /** Device connection ID */
1032
+ connectId?: string;
1033
+ /** Device instance ID */
1034
+ deviceInstanceId?: string;
1035
+ /** DeviceCommands instance ID */
1036
+ commandsInstanceId?: string;
1037
+ /** Parent request ID (for nested calls like allNetworkGetAddress) */
1038
+ parentResponseID?: number;
1039
+ /** Request start time */
1040
+ startTime: number;
1041
+ /** Request end time */
1042
+ endTime?: number;
1043
+ /** Request status */
1044
+ status?: 'pending' | 'running' | 'success' | 'error' | 'cancelled';
1045
+ /** Error message */
1046
+ error?: string;
1047
+ }
1048
+ /**
1049
+ * SDK instance tracing context
1050
+ */
1051
+ interface SdkTracingContext {
1052
+ /** SDK instance ID */
1053
+ sdkInstanceId: string;
1054
+ /** Creation timestamp */
1055
+ createdAt: number;
1056
+ /** Active requests */
1057
+ activeRequests: Map<number, RequestContext>;
1058
+ }
1059
+ /**
1060
+ * Create SDK instance tracing context
1061
+ */
1062
+ declare function createSdkTracingContext(): SdkTracingContext;
1063
+ /**
1064
+ * Create and register request context
1065
+ * @param responseID Request ID (reuses BaseMethod.responseID)
1066
+ * @param methodName API method name
1067
+ * @param options Additional options
1068
+ */
1069
+ declare function createRequestContext(responseID: number, methodName: string, options?: {
1070
+ sdkInstanceId?: string;
1071
+ connectId?: string;
1072
+ deviceInstanceId?: string;
1073
+ commandsInstanceId?: string;
1074
+ parentResponseID?: number;
1075
+ }): RequestContext;
1076
+ /**
1077
+ * Update request context
1078
+ */
1079
+ declare function updateRequestContext(responseID: number, updates: Partial<RequestContext>): void;
1080
+ /**
1081
+ * Complete request context
1082
+ */
1083
+ declare function completeRequestContext(responseID: number, error?: Error): void;
1084
+ /**
1085
+ * Get active requests for specific Device instance
1086
+ */
1087
+ declare function getActiveRequestsByDeviceInstance(deviceInstanceId: string): RequestContext[];
1088
+ /**
1089
+ * Format request context for logging
1090
+ */
1091
+ declare function formatRequestContext(context: RequestContext): string;
1092
+ /**
1093
+ * Cleanup specific SDK instance
1094
+ */
1095
+ declare function cleanupSdkInstance(sdkInstanceId: string): void;
837
1096
 
838
- declare function getFeatures(connectId?: string, params?: CommonParams): Response<Features>;
1097
+ declare class Core extends EventEmitter {
1098
+ private tracingContext;
1099
+ readonly sdkInstanceId: string;
1100
+ private requestQueue;
1101
+ private disposePromise?;
1102
+ private prePendingCallPromise;
1103
+ private methodSynchronize;
1104
+ constructor();
1105
+ private getCoreContext;
1106
+ handleMessage(message: CoreMessage): Promise<any>;
1107
+ dispose(): Promise<void>;
1108
+ private disposeResources;
1109
+ }
1110
+ declare const init$1: (settings: ConnectSettings, Transport: any, plugin?: LowlevelTransportSharedPlugin) => Promise<Core | undefined>;
1111
+ declare const switchTransport: ({ env, Transport, plugin, }: {
1112
+ env: ConnectSettings['env'];
1113
+ Transport: any;
1114
+ plugin?: LowlevelTransportSharedPlugin | undefined;
1115
+ }) => void;
839
1116
 
840
- type DeviceInfoProtocol = ProtocolType | 'unknown';
841
- type DeviceInfoSource = 'features' | 'protocolV1OneKeyFeatures' | 'deviceInfo';
842
- type DeviceInfoScope = 'basic' | 'versions' | 'verify' | 'full';
843
- type GetDeviceInfoParams = {
844
- scope?: DeviceInfoScope;
845
- refresh?: boolean;
846
- includeRaw?: boolean;
1117
+ declare const PRO2_WALLPAPER_WIDTH = 604;
1118
+ declare const PRO2_WALLPAPER_HEIGHT = 1024;
1119
+ type Pro2WallpaperColorFormat = 'RGB565' | 'RGB565A8';
1120
+ declare function encodePro2Wallpaper(options: {
1121
+ width: number;
1122
+ height: number;
1123
+ rgba: Uint8Array | ArrayBuffer;
1124
+ }): {
1125
+ data: Uint8Array;
1126
+ colorFormat: Pro2WallpaperColorFormat;
847
1127
  };
848
- type DeviceInfoMode = 'normal' | 'bootloader' | 'notInitialized' | 'unknown';
849
- type DeviceInfoStatus = {
850
- mode: DeviceInfoMode;
851
- initialized: boolean | null;
852
- bootloaderMode: boolean | null;
853
- unlocked: boolean | null;
854
- passphraseProtection: boolean | null;
855
- backupRequired: boolean | null;
856
- noBackup: boolean | null;
857
- language: string | null;
858
- bleEnabled: boolean | null;
1128
+
1129
+ type DeviceUploadWallpaperParams = {
1130
+ width: number;
1131
+ height: number;
1132
+ rgba: Uint8Array | ArrayBuffer;
1133
+ fileName?: string;
1134
+ chunkSize?: number;
859
1135
  };
860
- type DeviceProfileVersions = {
861
- firmware: string | null;
862
- bootloader: string | null;
863
- board: string | null;
864
- ble: string | null;
865
- se01?: string | null;
866
- se02?: string | null;
867
- se03?: string | null;
868
- se04?: string | null;
869
- se01Boot?: string | null;
870
- se02Boot?: string | null;
871
- se03Boot?: string | null;
872
- se04Boot?: string | null;
1136
+ type DeviceUploadWallpaperResponse = {
1137
+ path: string;
1138
+ size: number;
1139
+ colorFormat: Pro2WallpaperColorFormat;
1140
+ message?: string;
873
1141
  };
874
- type DeviceProfileVerify = {
875
- firmwareBuildId?: string;
876
- firmwareHash?: string;
877
- bootloaderBuildId?: string;
878
- bootloaderHash?: string;
879
- boardBuildId?: string;
880
- boardHash?: string;
881
- bleBuildId?: string;
882
- bleHash?: string;
883
- se01BuildId?: string;
884
- se01Hash?: string;
885
- se02BuildId?: string;
886
- se02Hash?: string;
887
- se03BuildId?: string;
888
- se03Hash?: string;
889
- se04BuildId?: string;
890
- se04Hash?: string;
891
- se01BootBuildId?: string;
892
- se01BootHash?: string;
893
- se02BootBuildId?: string;
894
- se02BootHash?: string;
895
- se03BootBuildId?: string;
896
- se03BootHash?: string;
897
- se04BootBuildId?: string;
898
- se04BootHash?: string;
1142
+
1143
+ type Pro2NftImage = {
1144
+ width: number;
1145
+ height: number;
1146
+ rgba: Uint8Array | ArrayBuffer;
899
1147
  };
900
- type DeviceProfileRaw = {
901
- features?: Features;
902
- protocolV1OneKeyFeatures?: OnekeyFeatures;
903
- protocolV2DeviceInfo?: ProtocolV2DeviceInfo;
1148
+
1149
+ type DeviceUploadNftParams = {
1150
+ image: Pro2NftImage;
1151
+ thumbnail: Pro2NftImage;
1152
+ title: string;
1153
+ subtitle: string;
1154
+ timestampMs?: number;
1155
+ chunkSize?: number;
1156
+ paceMs?: number;
1157
+ timeoutMs?: number;
1158
+ };
1159
+ type DeviceUploadNftResponse = {
1160
+ basename: string;
1161
+ imagePath: string;
1162
+ thumbnailPath: string;
1163
+ metadataPath: string;
1164
+ totalSize: number;
1165
+ nftUpdated: true;
1166
+ message?: string;
904
1167
  };
905
- type DeviceProfile = {
906
- protocol: DeviceInfoProtocol;
907
- sources: DeviceInfoSource[];
908
- deviceType: IDeviceType;
909
- firmwareType: EFirmwareType;
910
- deviceId: string;
911
- serialNo: string;
912
- label: string | null;
913
- bleName: string | null;
914
- status: DeviceInfoStatus;
915
- versions: DeviceProfileVersions;
916
- verify?: DeviceProfileVerify;
917
- raw?: DeviceProfileRaw;
1168
+
1169
+ type FileInfo = {
1170
+ path: string;
1171
+ offset: number;
1172
+ total_size: number;
1173
+ data?: Uint8Array;
1174
+ data_hash?: number;
1175
+ processed_byte?: number;
1176
+ chunks?: number;
1177
+ };
1178
+ type TestProtocolV2PingParams = CommonParams & {
1179
+ /** Firmware diagnostic echo payload, limited to 63 UTF-8 bytes. */
1180
+ message?: string;
1181
+ };
1182
+ declare function testProtocolV2Ping(connectId: string, params?: TestProtocolV2PingParams): Response<Success$1>;
1183
+ declare function deviceReboot(connectId: string, params: CommonParams & DeviceRebootParams): Response<Success$1>;
1184
+ declare function deviceGetOnboardingStatus(connectId: string, params?: CommonParams): Response<OnboardingStatus>;
1185
+ declare function deviceUploadWallpaper(connectId: string, params: CommonParams & DeviceUploadWallpaperParams): Response<DeviceUploadWallpaperResponse>;
1186
+ declare function deviceUploadNft(connectId: string, params: CommonParams & DeviceUploadNftParams): Response<DeviceUploadNftResponse>;
1187
+ declare function uploadPortfolio(connectId: string, params: {
1188
+ packageBytes: ArrayBuffer | Uint8Array | Blob;
1189
+ timeoutMs?: number | string;
1190
+ }): Response<FileInfo & {
1191
+ portfolioUpdated: true;
1192
+ }>;
1193
+
1194
+ declare const on: <T extends string, P extends (...args: any[]) => any>(type: T, fn: P) => void;
1195
+ declare const off: (type: any, fn: any) => void;
1196
+ declare const removeAllListeners: (type: any) => void;
1197
+
1198
+ declare function uiResponse(response: UiResponseEvent): void;
1199
+
1200
+ type IAddHardwareGlobalEventListener = (coreMessage: CoreMessage) => void;
1201
+ interface LowLevelInjectApi {
1202
+ call: CallMethod;
1203
+ eventEmitter: EventEmitter$1;
1204
+ init: CoreApi['init'];
1205
+ dispose: CoreApi['dispose'];
1206
+ uiResponse: CoreApi['uiResponse'];
1207
+ cancel: CoreApi['cancel'];
1208
+ updateSettings: CoreApi['updateSettings'];
1209
+ switchTransport: CoreApi['switchTransport'];
1210
+ addHardwareGlobalEventListener: (listener: IAddHardwareGlobalEventListener) => void;
1211
+ }
1212
+ type LowLevelCoreApi = Omit<CoreApi, 'on' | 'off'> & {
1213
+ addHardwareGlobalEventListener: (listener: IAddHardwareGlobalEventListener) => void;
918
1214
  };
919
- declare function getDeviceInfo(connectId?: string, params?: CommonParams & GetDeviceInfoParams): Response<DeviceProfile>;
920
1215
 
921
- declare function getOnekeyFeatures(connectId?: string, params?: CommonParams): Response<OnekeyFeatures>;
1216
+ declare function init(settings: Partial<ConnectSettings>, lowLevelApi?: LowLevelCoreApi, pulgin?: LowlevelTransportSharedPlugin): Promise<boolean>;
1217
+ declare function updateSettings(settings: Partial<ConnectSettings>): Promise<boolean>;
1218
+
1219
+ declare function testInitializeDeviceDuration(connectId?: string, params?: CommonParams): Response<number>;
1220
+
1221
+ declare function preInitialize(connectId: string, params?: CommonParams): Response<boolean>;
1222
+
1223
+ declare function getLogs(): Response<string[]>;
922
1224
 
923
- type GetPassphraseStatePayload = {
1225
+ type ClearSessionCacheParams = {
1226
+ deviceId?: never;
1227
+ passphraseState?: never;
1228
+ } | {
1229
+ deviceId: string;
924
1230
  passphraseState?: string;
925
- sessionId?: string;
926
- unlockedAttachPin?: boolean;
927
- passphraseProtection?: boolean | null;
928
1231
  };
929
- type GetPassphraseStateParams = CommonParams & {
930
- allowCreateAttachPin?: boolean;
1232
+ type ClearSessionCachePayload = {
1233
+ cleared: true;
931
1234
  };
932
- declare function getPassphraseState(connectId?: string, params?: GetPassphraseStateParams): Response<GetPassphraseStatePayload>;
1235
+ declare function clearSessionCache(params?: ClearSessionCacheParams): Response<ClearSessionCachePayload>;
933
1236
 
934
- type FirmwareRelease$1 = {
935
- status: IDeviceFirmwareStatus;
936
- changelog: {
937
- 'en-US': string;
938
- 'zh-CN': string;
939
- }[];
940
- release: IFirmwareReleaseInfo;
941
- bootloaderMode: boolean;
942
- };
943
- type CheckFirmwareReleaseParams = {
944
- firmwareType?: EFirmwareType;
945
- };
946
- declare function checkFirmwareRelease(connectId?: string, params?: CheckFirmwareReleaseParams): Response<FirmwareRelease$1>;
1237
+ declare function checkBridgeStatus(): Response<boolean>;
947
1238
 
948
- type BleFirmwareRelease = {
949
- status: IDeviceBLEFirmwareStatus;
950
- changelog: {
951
- 'zh-CN': string;
952
- 'en-US': string;
953
- }[];
954
- release: IBLEFirmwareReleaseInfo;
955
- bootloaderMode: boolean;
956
- };
957
- declare function checkBLEFirmwareRelease(connectId?: string): Response<BleFirmwareRelease>;
1239
+ type CheckBridgeReleaseResponse = {
1240
+ shouldUpdate: boolean;
1241
+ status: 'outdated' | 'valid';
1242
+ releaseVersion: string;
1243
+ } | null;
1244
+ declare function checkBridgeRelease(connectId?: string, params?: CommonParams & {
1245
+ willUpdateFirmwareVersion?: string;
1246
+ }): Response<CheckBridgeReleaseResponse>;
1247
+
1248
+ type FirmwareUpdatePlanArtifactRole = 'firmware' | 'ble' | 'bootloader' | 'resource' | 'component' | 'resourceBundle';
1249
+ type FirmwareUpdatePlanTarget = 'firmware' | 'ble' | 'bootloader' | FirmwareUpdateV4Target;
1250
+ type FirmwareUpdatePlanForceTarget = 'firmware' | 'ble' | 'bootloader' | 'resource';
1251
+ interface FirmwareUpdatePlanArtifact {
1252
+ artifactId: string;
1253
+ role: FirmwareUpdatePlanArtifactRole;
1254
+ target: FirmwareUpdatePlanTarget;
1255
+ url: string;
1256
+ container: 'raw' | 'zip';
1257
+ logicalName?: string;
1258
+ expectedSize: number;
1259
+ expectedSha256: string;
1260
+ targetVersion?: string;
1261
+ }
1262
+ interface FirmwareUpdatePlan {
1263
+ schemaVersion: 2;
1264
+ planDigest: string;
1265
+ executor: 'v2' | 'v3' | 'v4';
1266
+ deviceIdentity: string;
1267
+ deviceModel: string;
1268
+ firmwareType: EFirmwareType;
1269
+ platform: 'native' | 'desktop' | 'ext' | 'web' | 'web-embed';
1270
+ artifacts: FirmwareUpdatePlanArtifact[];
1271
+ targetsToUpdate: FirmwareUpdatePlanTarget[];
1272
+ }
1273
+
1274
+ interface FirmwareUpdatePreparedEntry {
1275
+ entryName: string;
1276
+ artifact: FirmwareArtifactReference;
1277
+ }
1278
+ interface FirmwareUpdatePreparedArtifactInput {
1279
+ artifactId: string;
1280
+ artifact: FirmwareArtifactReference;
1281
+ materializedEntries?: FirmwareUpdatePreparedEntry[];
1282
+ }
1283
+ interface FirmwareUpdatePreparedArtifact {
1284
+ artifactId: string;
1285
+ role: FirmwareUpdatePlanArtifactRole;
1286
+ target: FirmwareUpdatePlanTarget;
1287
+ container: 'raw' | 'zip';
1288
+ logicalName?: string;
1289
+ targetVersion?: string;
1290
+ artifact: FirmwareArtifactReference;
1291
+ materializedEntries?: FirmwareUpdatePreparedEntry[];
1292
+ }
1293
+ interface FirmwareUpdatePreparedPlan {
1294
+ schemaVersion: 2;
1295
+ preparedPlanDigest: string;
1296
+ planDigest: string;
1297
+ networkPolicy: 'forbid';
1298
+ executor: FirmwareUpdatePlan['executor'];
1299
+ deviceIdentity: string;
1300
+ deviceModel: string;
1301
+ firmwareType: FirmwareUpdatePlan['firmwareType'];
1302
+ platform: FirmwareUpdatePlan['platform'];
1303
+ leaseRef: string;
1304
+ artifacts: FirmwareUpdatePreparedArtifact[];
1305
+ targetsToUpdate: FirmwareUpdatePlanTarget[];
1306
+ }
1307
+ declare function prepareFirmwareUpdatePlan(input: {
1308
+ plan: FirmwareUpdatePlan;
1309
+ leaseRef: string;
1310
+ artifacts: FirmwareUpdatePreparedArtifactInput[];
1311
+ }): FirmwareUpdatePreparedPlan;
1312
+ declare function validateFirmwareUpdatePreparedPlan(value: unknown): FirmwareUpdatePreparedPlan;
958
1313
 
959
1314
  type IUpdateType = 'firmware' | 'ble';
1315
+ interface FirmwareArtifactReference {
1316
+ artifactRef: string;
1317
+ size: number;
1318
+ sha256: string;
1319
+ }
1320
+ interface FirmwareArtifactReader {
1321
+ open(input: {
1322
+ artifactRef: string;
1323
+ }): Promise<{
1324
+ readerId: string;
1325
+ size: number;
1326
+ }>;
1327
+ read(input: {
1328
+ readerId: string;
1329
+ offset: number;
1330
+ length: number;
1331
+ }): Promise<{
1332
+ data: ArrayBuffer;
1333
+ bytesRead: number;
1334
+ eof: boolean;
1335
+ }>;
1336
+ close(input: {
1337
+ readerId: string;
1338
+ }): Promise<void>;
1339
+ }
1340
+ interface FirmwareUpdateHostBinding {
1341
+ artifactReader: FirmwareArtifactReader;
1342
+ /** 将读取器 generation 绑定到包含 ZIP 条目的完整 PreparedPlan。 */
1343
+ preparedPlanDigest: string;
1344
+ }
960
1345
  interface FirmwareUpdateBinaryParams {
961
1346
  binary: ArrayBuffer;
962
1347
  updateType: IUpdateType;
963
1348
  }
1349
+ interface FirmwareUpdateArtifactParams {
1350
+ preparedPlan: FirmwareUpdatePreparedPlan;
1351
+ hostBindingGeneration: number;
1352
+ /** @deprecated Core derives the component artifact from preparedPlan. */
1353
+ artifact?: FirmwareArtifactReference;
1354
+ resourceEntries?: Array<{
1355
+ entryName: string;
1356
+ artifact: FirmwareArtifactReference;
1357
+ }>;
1358
+ updateType: IUpdateType;
1359
+ forcedUpdateRes?: boolean;
1360
+ isUpdateBootloader?: boolean;
1361
+ firmwareType?: EFirmwareType;
1362
+ }
964
1363
  interface FirmwareUpdateParams {
965
1364
  version?: number[];
966
1365
  updateType: IUpdateType;
@@ -980,7 +1379,10 @@ type Platform = {
980
1379
  };
981
1380
  declare function firmwareUpdateV2(connectId: string | undefined, params: Params<FirmwareUpdateParams & Platform>): Response<Messages.Success>;
982
1381
  declare function firmwareUpdateV2(connectId: string | undefined, params: Params<FirmwareUpdateBinaryParams & Platform>): Response<Messages.Success>;
1382
+ declare function firmwareUpdateV2(connectId: string | undefined, params: Params<FirmwareUpdateArtifactParams & Platform>): Response<Messages.Success>;
983
1383
  interface FirmwareUpdateV3Params {
1384
+ preparedPlan?: FirmwareUpdatePreparedPlan;
1385
+ hostBindingGeneration?: number;
984
1386
  bleVersion?: number[];
985
1387
  bleBinary?: ArrayBuffer;
986
1388
  chunkSize?: number;
@@ -992,28 +1394,58 @@ interface FirmwareUpdateV3Params {
992
1394
  forcedUpdateRes?: boolean;
993
1395
  firmwareType?: EFirmwareType;
994
1396
  platform: IPlatform;
1397
+ artifactReader?: FirmwareArtifactReader;
1398
+ artifacts?: {
1399
+ ble?: FirmwareArtifactReference;
1400
+ firmware?: FirmwareArtifactReference;
1401
+ bootloader?: FirmwareArtifactReference;
1402
+ resourceEntries?: Array<{
1403
+ entryName: string;
1404
+ artifact: FirmwareArtifactReference;
1405
+ }>;
1406
+ };
995
1407
  }
1408
+ /**
1409
+ * firmwareUpdateV4 target binaries grouped by DeviceFirmwareTargetType.
1410
+ * Except for romloader, each field maps to a target accepted by bootloader.
1411
+ */
1412
+ type FirmwareUpdateV4Target = 'boot'
1413
+ /** @deprecated Use resource with resourceArchiveBinary. */
1414
+ | 'boot_resources' | 'app_v1' | 'app_v2' | 'coprocessor' | 'resource' | 'se01' | 'se02' | 'se03' | 'se04';
996
1415
  interface FirmwareUpdateV4Params {
1416
+ preparedPlan?: FirmwareUpdatePreparedPlan;
1417
+ /** Required whenever preparedPlan is present; Core resolves the reader from this digest-bound host. */
1418
+ hostBindingGeneration?: number;
997
1419
  platform: IPlatform;
1420
+ expectedDeviceId?: string;
998
1421
  chunkSize?: number;
999
1422
  firmwareType?: EFirmwareType;
1423
+ targetsToUpdate?: FirmwareUpdateV4Target[];
1424
+ expectedTargetVersions?: Partial<Record<FirmwareUpdateV4Target, string>>;
1425
+ /** FW_MGMT_TARGET_ROMLOADER = 2; Pro2 cannot install it through firmwareUpdateV4. */
1000
1426
  romloaderBinary?: ArrayBuffer;
1427
+ /** FW_MGMT_TARGET_BOOTLOADER = 3 */
1001
1428
  bootloaderBinary?: ArrayBuffer;
1429
+ /** FW_MGMT_TARGET_APPLICATION_P1 = 4 */
1002
1430
  applicationP1Binary?: ArrayBuffer;
1431
+ /** FW_MGMT_TARGET_APPLICATION_P2 = 5 */
1003
1432
  applicationP2Binary?: ArrayBuffer;
1433
+ /** FW_MGMT_TARGET_COPROCESSOR = 6 */
1004
1434
  coprocessorBinary?: ArrayBuffer;
1435
+ /** FW_MGMT_TARGET_SE01-04 = 7-10 */
1005
1436
  se01Binary?: ArrayBuffer;
1006
1437
  se02Binary?: ArrayBuffer;
1007
1438
  se03Binary?: ArrayBuffer;
1008
1439
  se04Binary?: ArrayBuffer;
1009
- resourceBinary?: ArrayBuffer;
1440
+ /** Complete Protocol V2 resource ZIP for local development; Core converts it to a local PreparedPlan. */
1441
+ resourceArchiveBinary?: ArrayBuffer;
1010
1442
  forcedUpdateRes?: boolean;
1011
- firmwareVersion?: number[];
1012
- bleVersion?: number[];
1013
- bootloaderVersion?: number[];
1014
- firmwareBinary?: ArrayBuffer;
1015
- bleBinary?: ArrayBuffer;
1443
+ artifactReader?: FirmwareArtifactReader;
1444
+ componentArtifacts?: Partial<Record<Exclude<FirmwareUpdateV4Target, 'resource' | 'boot_resources'>, FirmwareArtifactReference>>;
1016
1445
  }
1446
+ declare function registerFirmwareUpdateHostBinding$1(binding: FirmwareUpdateHostBinding): number;
1447
+ declare function unregisterFirmwareUpdateHostBinding$1(generation?: number): boolean;
1448
+ declare function getFirmwareUpdateHostBindingGeneration$1(): number;
1017
1449
  declare function firmwareUpdateV3(connectId: string | undefined, params: Params<FirmwareUpdateV3Params>): Response<{
1018
1450
  bleVersion: string;
1019
1451
  firmwareVersion: string;
@@ -1025,6 +1457,157 @@ declare function firmwareUpdateV4(connectId: string | undefined, params: Params<
1025
1457
  bootloaderVersion: string;
1026
1458
  }>;
1027
1459
 
1460
+ type ProtocolV2ComponentReleaseInfo = IProtocolV2FirmwareComponent & {
1461
+ protocol: 'V2';
1462
+ configKey: string;
1463
+ componentTarget: IProtocolV2FirmwareComponentTarget;
1464
+ required: boolean;
1465
+ changelog: IFirmwareReleaseInfo['changelog'];
1466
+ };
1467
+ type FirmwareReleaseCheckResult = {
1468
+ shouldUpdate?: boolean;
1469
+ status: IDeviceFirmwareStatus;
1470
+ changelog?: {
1471
+ 'zh-CN': string;
1472
+ 'en-US': string;
1473
+ }[];
1474
+ release: IBLEFirmwareReleaseInfo | IFirmwareReleaseInfo | ProtocolV2ComponentReleaseInfo | undefined;
1475
+ bootloaderMode?: boolean;
1476
+ };
1477
+ type BridgeReleaseCheckResult = Omit<FirmwareReleaseCheckResult, 'release'> & {
1478
+ release: string | undefined;
1479
+ };
1480
+ type ProtocolV2FirmwareComponentReleaseStatus = 'valid' | 'outdated' | 'unknown' | 'unsupported';
1481
+ type ProtocolV2FirmwareReleaseStatus = 'unavailable' | 'valid' | 'unknown' | 'outdated' | 'required';
1482
+ type ProtocolV2FirmwareComponentRelease = {
1483
+ configKey: string;
1484
+ componentTarget: IProtocolV2FirmwareComponentTarget;
1485
+ updateTarget: FirmwareUpdateV4Target | null;
1486
+ currentVersion: string | null;
1487
+ targetVersion: string | null;
1488
+ status: ProtocolV2FirmwareComponentReleaseStatus;
1489
+ required: boolean;
1490
+ };
1491
+ type AllFirmwareRelease = {
1492
+ firmware: FirmwareReleaseCheckResult;
1493
+ ble: FirmwareReleaseCheckResult;
1494
+ bootloader?: FirmwareReleaseCheckResult;
1495
+ bridge?: BridgeReleaseCheckResult;
1496
+ features?: Features;
1497
+ protocol?: 'V1' | 'V2';
1498
+ deviceType?: 'pro2' | 'neo';
1499
+ firmwareType?: EFirmwareType;
1500
+ status?: ProtocolV2FirmwareReleaseStatus;
1501
+ hasUpgrade?: boolean;
1502
+ required?: boolean;
1503
+ resourceStatus?: 'valid' | 'outdated' | 'unknown';
1504
+ resourceArchive?: IProtocolV2ResourceSource;
1505
+ currentVersions?: DeviceStateVersions;
1506
+ components?: ProtocolV2FirmwareComponentRelease[];
1507
+ targetsToUpdate?: FirmwareUpdateV4Target[];
1508
+ release?: IFirmwareReleaseInfo;
1509
+ firmwareUpdatePlan?: FirmwareUpdatePlan;
1510
+ };
1511
+ type CheckAllFirmwareReleaseParams = {
1512
+ checkBridgeRelease?: boolean;
1513
+ checkFirmwareHash?: boolean;
1514
+ firmwareType?: EFirmwareType;
1515
+ platform?: 'native' | 'desktop' | 'ext' | 'web' | 'web-embed';
1516
+ forceUpdateTargets?: FirmwareUpdatePlanForceTarget[];
1517
+ protocolV2ForceUpdateTargets?: FirmwareUpdateV4Target[];
1518
+ };
1519
+ declare function checkAllFirmwareRelease(connectId?: string, params?: CommonParams & CheckAllFirmwareReleaseParams): Response<AllFirmwareRelease>;
1520
+
1521
+ type CheckBootloaderReleaseResponse = FirmwareReleaseCheckResult | null;
1522
+ type CheckBootloaderReleaseParams = {
1523
+ willUpdateFirmwareVersion?: string;
1524
+ firmwareType?: EFirmwareType;
1525
+ };
1526
+ declare function checkBootloaderRelease(connectId?: string, params?: CommonParams & CheckBootloaderReleaseParams): Response<CheckBootloaderReleaseResponse>;
1527
+
1528
+ type CheckFirmwareTypeAvailableParams = {
1529
+ deviceType: EDeviceType;
1530
+ firmwareType: EFirmwareType;
1531
+ };
1532
+ declare function checkFirmwareTypeAvailable(params: CheckFirmwareTypeAvailableParams): Response<FirmwareReleaseCheckResult | undefined>;
1533
+
1534
+ declare function searchDevices(params?: CommonParams): Response<SearchDevice[]>;
1535
+
1536
+ declare function detectDeviceConnectProtocol(connectId: string): Response<HardwareConnectProtocol>;
1537
+
1538
+ /**
1539
+ * @deprecated Use `getDeviceState` for both Protocol V1 and Protocol V2 devices.
1540
+ */
1541
+ declare function getFeatures(connectId?: string, params?: CommonParams): Response<Features>;
1542
+
1543
+ /**
1544
+ * @deprecated Use `getDeviceState(connectId, { scope: 'firmware' })`.
1545
+ */
1546
+ declare function getOnekeyFeatures(connectId?: string, params?: CommonParams): Response<OnekeyFeatures>;
1547
+
1548
+ type GetPassphraseStateParams = CommonParams;
1549
+ /**
1550
+ * Compatibility wallet-state API for existing App integrations.
1551
+ *
1552
+ * Protocol V1 keeps its parameterless firmware flow. Protocol V2 maps the existing
1553
+ * `useEmptyPassphrase` and `initSession` intent to the device-only wallet-session flow.
1554
+ * New integrations should prefer `openWalletSession` for explicit wallet intent.
1555
+ */
1556
+ declare function getPassphraseState(connectId?: string, params?: GetPassphraseStateParams): Response<string | undefined>;
1557
+
1558
+ declare const OpenWalletSessionMode: {
1559
+ readonly Standard: "standard";
1560
+ readonly SelectHidden: "select-hidden";
1561
+ readonly ResumeHidden: "resume-hidden";
1562
+ };
1563
+ type OpenWalletSessionModeValue = (typeof OpenWalletSessionMode)[keyof typeof OpenWalletSessionMode];
1564
+ type OpenWalletSessionParams = {
1565
+ mode: typeof OpenWalletSessionMode.Standard;
1566
+ deviceId?: never;
1567
+ passphraseState?: never;
1568
+ } | {
1569
+ mode: typeof OpenWalletSessionMode.SelectHidden;
1570
+ deviceId?: never;
1571
+ passphraseState?: never;
1572
+ } | {
1573
+ mode: typeof OpenWalletSessionMode.ResumeHidden;
1574
+ deviceId: string;
1575
+ passphraseState: string;
1576
+ };
1577
+ type OpenWalletSessionPayloadBase = {
1578
+ protocol: 'V1' | 'V2';
1579
+ deviceId: string;
1580
+ resumed: boolean;
1581
+ };
1582
+ type OpenWalletSessionPayload = OpenWalletSessionPayloadBase & ({
1583
+ walletType: 'standard';
1584
+ passphraseState: null;
1585
+ } | {
1586
+ walletType: 'hidden';
1587
+ passphraseState: string;
1588
+ });
1589
+ /**
1590
+ * Opens the standard, hidden, or Attach-to-PIN wallet flow through a unified
1591
+ * Protocol V1/V2 API.
1592
+ */
1593
+ declare function openWalletSession(connectId: string, params: CommonParams & OpenWalletSessionParams): Response<OpenWalletSessionPayload>;
1594
+
1595
+ type CheckFirmwareReleaseParams = {
1596
+ firmwareType?: EFirmwareType;
1597
+ };
1598
+ declare function checkFirmwareRelease(connectId?: string, params?: CheckFirmwareReleaseParams): Response<FirmwareReleaseCheckResult | null>;
1599
+
1600
+ declare function checkBLEFirmwareRelease(connectId?: string): Response<FirmwareReleaseCheckResult | null>;
1601
+
1602
+ interface FirmwareUpdateCapabilities {
1603
+ planSchemaVersion: 2;
1604
+ preparedPlanSchemaVersion: 2;
1605
+ hostBindingProtocolVersion: 2;
1606
+ manifestModes: Array<'external-only' | 'sdk-managed'>;
1607
+ supportsArtifactReader: true;
1608
+ }
1609
+ declare function getFirmwareUpdateCapabilities(): FirmwareUpdateCapabilities;
1610
+
1028
1611
  declare function promptWebDeviceAccess(options?: {
1029
1612
  deviceSerialNumberFromUI?: string;
1030
1613
  }): Response<{
@@ -1084,16 +1667,40 @@ type DeviceSettingsParams = {
1084
1667
  language?: string;
1085
1668
  label?: string;
1086
1669
  usePassphrase?: boolean;
1670
+ /** Protocol V1 only. */
1087
1671
  homescreen?: string;
1672
+ /** Protocol V1 only. */
1088
1673
  passphraseSource?: number;
1089
1674
  autoLockDelayMs?: number;
1675
+ /** Protocol V1 only. */
1090
1676
  displayRotation?: number;
1677
+ /** Protocol V1 only. */
1091
1678
  passphraseAlwaysOnDevice?: boolean;
1092
- safetyChecks?: SafetyCheckLevel;
1679
+ /** Protocol V1 only. Uses Enum_SafetyCheckLevel numeric values. */
1680
+ safetyChecks?: Enum_SafetyCheckLevel;
1681
+ /** Protocol V1 only; the current Protocol V2 schema has no matching field. */
1093
1682
  experimentalFeatures?: boolean;
1094
1683
  autoShutdownDelayMs?: number;
1684
+ /** Protocol V1 only; opens the legacy device-side brightness flow. */
1095
1685
  changeBrightness?: boolean;
1686
+ /** Protocol V2 only. */
1687
+ brightness?: number;
1096
1688
  hapticFeedback?: boolean;
1689
+ bluetoothEnabled?: boolean;
1690
+ /** Protocol V2 only; changed through an on-device confirmation page. */
1691
+ airgapMode?: boolean;
1692
+ /** Protocol V2 only. */
1693
+ animationEnabled?: boolean;
1694
+ /** Protocol V2 only. */
1695
+ tapToWake?: boolean;
1696
+ /** Protocol V2 only. */
1697
+ deviceNameDisplayEnabled?: boolean;
1698
+ /** Protocol V2 only. */
1699
+ fidoEnabled?: boolean;
1700
+ /** Protocol V2 only. */
1701
+ usbLockEnabled?: boolean;
1702
+ /** Protocol V2 only. */
1703
+ randomKeypad?: boolean;
1097
1704
  };
1098
1705
  declare function deviceSettings(connectId: string, params: CommonParams & DeviceSettingsParams): Response<Success$1>;
1099
1706
 
@@ -1119,7 +1726,7 @@ type DeviceUploadResourceResponse = Success$1 & {
1119
1726
  declare function deviceUploadResource(connectId: string, params: CommonParams & DeviceUploadResourceParams): Response<DeviceUploadResourceResponse>;
1120
1727
 
1121
1728
  type DeviceSupportFeatures = SupportFeatures & {
1122
- device: Device | null;
1729
+ device: Device$1 | null;
1123
1730
  };
1124
1731
  declare function deviceSupportFeatures(connectId?: string): Response<DeviceSupportFeatures>;
1125
1732
 
@@ -1128,14 +1735,25 @@ declare function deviceFullyUploadResource(connectId: string, params: CommonPara
1128
1735
  }): Response<Success$1>;
1129
1736
 
1130
1737
  type DeviceUpdateBootloaderParams = {
1738
+ preparedPlan?: FirmwareUpdatePreparedPlan;
1739
+ hostBindingGeneration?: number;
1131
1740
  binary?: ArrayBuffer;
1741
+ /** @deprecated Core derives the bootloader artifact from preparedPlan. */
1742
+ artifact?: FirmwareArtifactReference;
1743
+ artifactReader?: FirmwareArtifactReader;
1132
1744
  firmwareType?: EFirmwareType;
1133
1745
  };
1134
1746
  declare function deviceUpdateBootloader(connectId: string, params?: DeviceUpdateBootloaderParams): Response<Success$1>;
1135
1747
 
1136
1748
  declare function deviceLock(connectId: string, params: CommonParams): Response<Success$1>;
1137
1749
 
1138
- declare function deviceUnlock(connectId: string, params?: CommonParams): Response<Features$1>;
1750
+ type DeviceUnlockParams = {
1751
+ /**
1752
+ * 限定本次解锁允许使用的 PIN 类型。省略时保持兼容行为,仅允许主 PIN。
1753
+ */
1754
+ pinType?: DeviceSessionPinType;
1755
+ };
1756
+ declare function deviceUnlock(connectId: string, params?: CommonParams & DeviceUnlockParams): Response<Features>;
1139
1757
 
1140
1758
  declare function deviceCancel(connectId: string, params: CommonParams): Response<Success$1>;
1141
1759
 
@@ -1339,6 +1957,9 @@ type AllNetworkAddressParams = {
1339
1957
  type AllNetworkAddressPayload = {
1340
1958
  address: string;
1341
1959
  pub?: string;
1960
+ /**
1961
+ * @deprecated Use `pub` instead.
1962
+ */
1342
1963
  publicKey?: string;
1343
1964
  npub?: string;
1344
1965
  } | {
@@ -1404,6 +2025,9 @@ declare function evmGetAddress(connectId: string, deviceId: string, params: Comm
1404
2025
  type EVMPublicKey = {
1405
2026
  path: string;
1406
2027
  pub: string;
2028
+ /**
2029
+ * @deprecated Use `pub` instead.
2030
+ */
1407
2031
  publicKey?: string;
1408
2032
  } & EthereumPublicKey;
1409
2033
  type EVMGetPublicKeyParams = {
@@ -2187,6 +2811,9 @@ declare function nearSignTransaction(connectId: string, deviceId: string, params
2187
2811
  type AptosAddress = {
2188
2812
  path: string;
2189
2813
  pub?: string;
2814
+ /**
2815
+ * @deprecated Use `pub` instead.
2816
+ */
2190
2817
  publicKey?: string;
2191
2818
  } & AptosAddress$1;
2192
2819
  type AptosGetAddressParams = {
@@ -2201,6 +2828,9 @@ declare function aptosGetAddress(connectId: string, deviceId: string, params: Co
2201
2828
  type AptosPublicKey = {
2202
2829
  path: string;
2203
2830
  pub: string;
2831
+ /**
2832
+ * @deprecated Use `pub` instead.
2833
+ */
2204
2834
  publicKey?: string;
2205
2835
  };
2206
2836
  type AptosGetPublicKeyParams = {
@@ -2285,6 +2915,9 @@ declare function cosmosGetAddress(connectId: string, deviceId: string, params: C
2285
2915
  type CosmosPublicKey = {
2286
2916
  path: string;
2287
2917
  pub: string;
2918
+ /**
2919
+ * @deprecated Use `pub` instead.
2920
+ */
2288
2921
  publicKey?: string;
2289
2922
  };
2290
2923
  type CosmosGetPublicKeyParams = {
@@ -2309,6 +2942,9 @@ declare function cosmosSignTransaction(connectId: string, deviceId: string, para
2309
2942
  type XrpAddress = {
2310
2943
  path: string;
2311
2944
  pub?: string;
2945
+ /**
2946
+ * @deprecated Use `pub` instead.
2947
+ */
2312
2948
  publicKey?: string;
2313
2949
  address: string;
2314
2950
  };
@@ -2342,6 +2978,9 @@ declare function xrpSignTransaction(connectId: string, deviceId: string, params:
2342
2978
  type SuiAddress = {
2343
2979
  path: string;
2344
2980
  pub?: string;
2981
+ /**
2982
+ * @deprecated Use `pub` instead.
2983
+ */
2345
2984
  publicKey?: string;
2346
2985
  } & SuiAddress$1;
2347
2986
  type SuiGetAddressParams = {
@@ -2356,6 +2995,9 @@ declare function suiGetAddress(connectId: string, deviceId: string, params: Comm
2356
2995
  type SuiPublicKey = {
2357
2996
  path: string;
2358
2997
  pub: string;
2998
+ /**
2999
+ * @deprecated Use `pub` instead.
3000
+ */
2359
3001
  publicKey?: string;
2360
3002
  };
2361
3003
  type SuiGetPublicKeyParams = {
@@ -2385,6 +3027,10 @@ declare function suiSignTransaction(connectId: string, deviceId: string, params:
2385
3027
  type CardanoGetAddressMethodParams = {
2386
3028
  addressParameters: CardanoAddressParameters;
2387
3029
  networkId: number;
3030
+ /**
3031
+ * Testnet cip34:0-1097911063
3032
+ * Mainnet cip34:1-764824073
3033
+ */
2388
3034
  protocolMagic: number;
2389
3035
  derivationType: number;
2390
3036
  address?: string;
@@ -2446,6 +3092,10 @@ type CardanoSignMessageMethodParams = {
2446
3092
  derivationType: number;
2447
3093
  networkId: number;
2448
3094
  addressType?: Messages.CardanoAddressType;
3095
+ /**
3096
+ * Testnet cip34:0-1097911063
3097
+ * Mainnet cip34:1-764824073
3098
+ */
2449
3099
  protocolMagic?: number;
2450
3100
  };
2451
3101
  declare function cardanoSignMessage(connectId: string, deviceId: string, params: CommonParams & CardanoSignMessageMethodParams): Response<CardanoMessageSignature>;
@@ -2479,6 +3129,9 @@ declare function filecoinSignTransaction(connectId: string, deviceId: string, pa
2479
3129
  type PolkadotAddress = {
2480
3130
  path: string;
2481
3131
  pub: string;
3132
+ /**
3133
+ * @deprecated Use `pub` instead.
3134
+ */
2482
3135
  publicKey?: string;
2483
3136
  } & PolkadotAddress$1;
2484
3137
  type PolkadotGetAddressParams = {
@@ -2537,23 +3190,61 @@ type KaspaSignInputParams = {
2537
3190
  sequenceNumber: number | string;
2538
3191
  output: {
2539
3192
  satoshis: number | string;
2540
- script: string;
3193
+ script?: string;
2541
3194
  };
2542
3195
  sigOpCount?: number;
2543
3196
  };
2544
3197
  type KaspaSignOutputParams = {
2545
3198
  satoshis: number | string;
3199
+ address?: string;
3200
+ addressN?: string | number[];
3201
+ script?: string;
3202
+ scriptVersion?: number;
3203
+ };
3204
+ type KaspaStreamingSignInputParams = Omit<KaspaSignInputParams, 'output'> & {
3205
+ output: {
3206
+ satoshis: number | string;
3207
+ script?: string;
3208
+ };
3209
+ };
3210
+ type KaspaStreamingSignOutputParams = {
3211
+ satoshis: number | string;
3212
+ address?: string;
3213
+ addressN?: string | number[];
3214
+ script?: string;
3215
+ scriptVersion?: number;
3216
+ };
3217
+ type KaspaRefTransactionInput = {
3218
+ prevTxId: string;
3219
+ outputIndex: number;
3220
+ sequenceNumber: number | string;
3221
+ };
3222
+ type KaspaRefTransactionOutput = {
3223
+ satoshis: number | string;
3224
+ scriptVersion?: number;
2546
3225
  script: string;
2547
- scriptVersion: number;
3226
+ };
3227
+ type KaspaRefTransaction = {
3228
+ txId: string;
3229
+ version: number;
3230
+ inputs: KaspaRefTransactionInput[];
3231
+ outputs: KaspaRefTransactionOutput[];
3232
+ lockTime?: number | string;
3233
+ subNetworkID?: string;
3234
+ gas?: number | string;
3235
+ payload?: string;
2548
3236
  };
2549
3237
  type KaspaSignTransactionParams = {
2550
3238
  version: number;
2551
- inputs: KaspaSignInputParams[];
2552
- outputs: KaspaSignOutputParams[];
3239
+ inputs: Array<KaspaSignInputParams | KaspaStreamingSignInputParams>;
3240
+ outputs: Array<KaspaSignOutputParams | KaspaStreamingSignOutputParams>;
2553
3241
  lockTime: number | string;
2554
3242
  sigHashType?: SignatureType;
2555
3243
  sigOpCount?: number;
2556
3244
  subNetworkID?: string;
3245
+ payload?: string;
3246
+ gas?: number | string;
3247
+ refTxs?: KaspaRefTransaction[];
2557
3248
  scheme?: string;
2558
3249
  prefix?: string;
2559
3250
  useTweak?: boolean;
@@ -2598,6 +3289,9 @@ declare function nexaSignTransaction(connectId: string, deviceId: string, params
2598
3289
  type NostrPublicKey = {
2599
3290
  npub?: string;
2600
3291
  pub?: string;
3292
+ /**
3293
+ * @deprecated Use `pub` instead.
3294
+ */
2601
3295
  publicKey?: string;
2602
3296
  path: string;
2603
3297
  };
@@ -2694,6 +3388,9 @@ declare function nostrSignSchnorr(connectId: string, deviceId: string, params: C
2694
3388
 
2695
3389
  interface LnurlAuth {
2696
3390
  pub?: string;
3391
+ /**
3392
+ * @deprecated Use `pub` instead.
3393
+ */
2697
3394
  publickey?: string;
2698
3395
  path?: string;
2699
3396
  signature?: string;
@@ -2770,6 +3467,9 @@ declare function dnxSignTransaction(connectId: string, deviceId: string, params:
2770
3467
  type TonAddress = {
2771
3468
  path: string;
2772
3469
  pub: string;
3470
+ /**
3471
+ * @deprecated Use `pub` instead.
3472
+ */
2773
3473
  publicKey?: string;
2774
3474
  address: string;
2775
3475
  };
@@ -2881,6 +3581,9 @@ declare function scdoSignTransaction(connectId: string, deviceId: string, params
2881
3581
 
2882
3582
  type AlephiumAddress = {
2883
3583
  path: string;
3584
+ /**
3585
+ * @deprecated Use `pub` instead.
3586
+ */
2884
3587
  publicKey?: string;
2885
3588
  pub?: string;
2886
3589
  address: string;
@@ -2983,13 +3686,21 @@ type NeoSignedTx = {
2983
3686
  declare function neoSignTransaction(connectId: string, deviceId: string, params: CommonParams & NeoUnsignedTx): Response<NeoSignedTx>;
2984
3687
 
2985
3688
  type CoreApi = {
3689
+ /**
3690
+ * Inject function
3691
+ */
2986
3692
  init: typeof init;
2987
3693
  on: typeof on;
2988
3694
  off: typeof off;
2989
3695
  emit: (event: string, ...args: any[]) => void;
2990
3696
  removeAllListeners: typeof removeAllListeners;
2991
- dispose: () => void;
3697
+ dispose: () => void | Promise<void>;
2992
3698
  call: (params: any) => Promise<any>;
3699
+ /**
3700
+ * Bind a protocol that has already been verified for one transport endpoint.
3701
+ * Every later SDK call for the same connectId uses it as a strict expectation.
3702
+ */
3703
+ setDeviceConnectProtocol: (connectId: string, connectProtocol: HardwareConnectProtocol | undefined) => void;
2993
3704
  uiResponse: typeof uiResponse;
2994
3705
  cancel: (connectId?: string) => void;
2995
3706
  updateSettings: typeof updateSettings;
@@ -2997,19 +3708,32 @@ type CoreApi = {
2997
3708
  success: boolean;
2998
3709
  }>;
2999
3710
  getLogs: typeof getLogs;
3711
+ clearSessionCache: typeof clearSessionCache;
3712
+ /**
3713
+ * Test function
3714
+ */
3000
3715
  testInitializeDeviceDuration: typeof testInitializeDeviceDuration;
3716
+ testProtocolV2Ping: typeof testProtocolV2Ping;
3001
3717
  preInitialize: typeof preInitialize;
3718
+ /**
3719
+ * Core function
3720
+ */
3002
3721
  checkAllFirmwareRelease: typeof checkAllFirmwareRelease;
3003
3722
  checkBridgeStatus: typeof checkBridgeStatus;
3004
3723
  checkBridgeRelease: typeof checkBridgeRelease;
3005
3724
  checkBootloaderRelease: typeof checkBootloaderRelease;
3006
3725
  checkFirmwareTypeAvailable: typeof checkFirmwareTypeAvailable;
3726
+ /**
3727
+ * Device function
3728
+ */
3007
3729
  searchDevices: typeof searchDevices;
3730
+ detectDeviceConnectProtocol: typeof detectDeviceConnectProtocol;
3008
3731
  promptWebDeviceAccess: typeof promptWebDeviceAccess;
3009
3732
  getFeatures: typeof getFeatures;
3010
- getDeviceInfo: typeof getDeviceInfo;
3733
+ getDeviceState: typeof getDeviceState;
3011
3734
  getOnekeyFeatures: typeof getOnekeyFeatures;
3012
3735
  getPassphraseState: typeof getPassphraseState;
3736
+ openWalletSession: typeof openWalletSession;
3013
3737
  deviceBackup: typeof deviceBackup;
3014
3738
  deviceChangePin: typeof deviceChangePin;
3015
3739
  deviceFlags: typeof deviceFlags;
@@ -3036,39 +3760,29 @@ type CoreApi = {
3036
3760
  firmwareUpdateV2: typeof firmwareUpdateV2;
3037
3761
  firmwareUpdateV3: typeof firmwareUpdateV3;
3038
3762
  firmwareUpdateV4: typeof firmwareUpdateV4;
3763
+ registerFirmwareUpdateHostBinding: typeof registerFirmwareUpdateHostBinding$1;
3764
+ unregisterFirmwareUpdateHostBinding: typeof unregisterFirmwareUpdateHostBinding$1;
3765
+ getFirmwareUpdateHostBindingGeneration: typeof getFirmwareUpdateHostBindingGeneration$1;
3766
+ getFirmwareUpdateCapabilities: typeof getFirmwareUpdateCapabilities;
3767
+ prepareFirmwareUpdatePlan: typeof prepareFirmwareUpdatePlan;
3768
+ validateFirmwareUpdatePreparedPlan: typeof validateFirmwareUpdatePreparedPlan;
3039
3769
  cipherKeyValue: typeof cipherKeyValue;
3040
- getProtoVersion: typeof getProtoVersion;
3041
- ping: typeof ping;
3770
+ /**
3771
+ * Pro2 business API
3772
+ */
3042
3773
  deviceReboot: typeof deviceReboot;
3043
- deviceGetDeviceInfo: typeof deviceGetDeviceInfo;
3044
3774
  deviceGetOnboardingStatus: typeof deviceGetOnboardingStatus;
3045
- deviceFirmwareUpdate: typeof deviceFirmwareUpdate;
3046
- deviceGetFirmwareUpdateStatus: typeof deviceGetFirmwareUpdateStatus;
3047
- devReboot: typeof devReboot;
3048
- devGetDeviceInfo: typeof devGetDeviceInfo;
3049
- devFirmwareUpdate: typeof devFirmwareUpdate;
3050
- devGetFirmwareUpdateStatus: typeof devGetFirmwareUpdateStatus;
3051
- factoryDeviceInfoSettings: typeof factoryDeviceInfoSettings;
3052
- factoryGetDeviceInfo: typeof factoryGetDeviceInfo;
3053
- filesystemFixPermission: typeof filesystemFixPermission;
3054
- fileRead: typeof fileRead;
3055
- fileWrite: typeof fileWrite;
3056
- fileDelete: typeof fileDelete;
3057
- dirList: typeof dirList;
3058
- dirMake: typeof dirMake;
3059
- dirRemove: typeof dirRemove;
3060
- pathInfo: typeof pathInfo;
3061
- filesystemFileRead: typeof filesystemFileRead;
3062
- filesystemFileWrite: typeof filesystemFileWrite;
3063
- filesystemFileDelete: typeof filesystemFileDelete;
3064
- filesystemDirList: typeof filesystemDirList;
3065
- filesystemDirMake: typeof filesystemDirMake;
3066
- filesystemDirRemove: typeof filesystemDirRemove;
3067
- filesystemPathInfoQuery: typeof filesystemPathInfoQuery;
3068
- filesystemFormat: typeof filesystemFormat;
3069
- filesystemDiskControl: typeof filesystemDiskControl;
3775
+ deviceUploadNft: typeof deviceUploadNft;
3776
+ deviceUploadWallpaper: typeof deviceUploadWallpaper;
3777
+ uploadPortfolio: typeof uploadPortfolio;
3778
+ /**
3779
+ * All network function
3780
+ */
3070
3781
  allNetworkGetAddress: typeof allNetworkGetAddress;
3071
3782
  allNetworkGetAddressByLoop: typeof allNetworkGetAddressByLoop;
3783
+ /**
3784
+ * EVM function
3785
+ */
3072
3786
  evmGetAddress: typeof evmGetAddress;
3073
3787
  evmGetPublicKey: typeof evmGetPublicKey;
3074
3788
  evmSignMessage: typeof evmSignMessage;
@@ -3076,86 +3790,167 @@ type CoreApi = {
3076
3790
  evmSignTransaction: typeof evmSignTransaction;
3077
3791
  evmSignTypedData: typeof evmSignTypedData;
3078
3792
  evmVerifyMessage: typeof evmVerifyMessage;
3793
+ /**
3794
+ * BTC function
3795
+ */
3079
3796
  btcGetAddress: typeof btcGetAddress;
3080
3797
  btcGetPublicKey: typeof btcGetPublicKey;
3081
3798
  btcSignMessage: typeof btcSignMessage;
3082
3799
  btcSignPsbt: typeof btcSignPsbt;
3083
3800
  btcSignTransaction: typeof btcSignTransaction;
3084
3801
  btcVerifyMessage: typeof btcVerifyMessage;
3802
+ /**
3803
+ * Starcoin function
3804
+ */
3085
3805
  starcoinGetAddress: typeof starcoinGetAddress;
3086
3806
  starcoinGetPublicKey: typeof starcoinGetPublicKey;
3087
3807
  starcoinSignMessage: typeof starcoinSignMessage;
3088
3808
  starcoinSignTransaction: typeof starcoinSignTransaction;
3089
3809
  starcoinVerifyMessage: typeof starcoinVerifyMessage;
3810
+ /**
3811
+ * Nem function
3812
+ */
3090
3813
  nemGetAddress: typeof nemGetAddress;
3091
3814
  nemSignTransaction: typeof nemSignTransaction;
3815
+ /**
3816
+ * Solana function
3817
+ */
3092
3818
  solGetAddress: typeof solGetAddress;
3093
3819
  solSignTransaction: typeof solSignTransaction;
3094
3820
  solSignOffchainMessage: typeof solSignOffchainMessage;
3095
3821
  solSignMessage: typeof solSignMessage;
3822
+ /**
3823
+ * Stellar function
3824
+ */
3096
3825
  stellarGetAddress: typeof stellarGetAddress;
3097
3826
  stellarSignTransaction: typeof stellarSignTransaction;
3827
+ /**
3828
+ * Tron function
3829
+ */
3098
3830
  tronGetAddress: typeof tronGetAddress;
3099
3831
  tronSignMessage: typeof tronSignMessage;
3100
3832
  tronSignTransaction: typeof tronSignTransaction;
3833
+ /**
3834
+ * Conflux function
3835
+ */
3101
3836
  confluxGetAddress: typeof confluxGetAddress;
3102
3837
  confluxSignMessage: typeof confluxSignMessage;
3103
3838
  confluxSignMessageCIP23: typeof confluxSignMessageCIP23;
3104
3839
  confluxSignTransaction: typeof confluxSignTransaction;
3840
+ /**
3841
+ * Near function
3842
+ */
3105
3843
  nearGetAddress: typeof nearGetAddress;
3106
3844
  nearSignTransaction: typeof nearSignTransaction;
3845
+ /**
3846
+ * Aptos function
3847
+ */
3107
3848
  aptosGetAddress: typeof aptosGetAddress;
3108
3849
  aptosGetPublicKey: typeof aptosGetPublicKey;
3109
3850
  aptosSignMessage: typeof aptosSignMessage;
3110
3851
  aptosSignInMessage: typeof aptosSignInMessage;
3111
3852
  aptosSignTransaction: typeof aptosSignTransaction;
3853
+ /**
3854
+ * Algo function
3855
+ */
3112
3856
  algoGetAddress: typeof algoGetAddress;
3113
3857
  algoSignTransaction: typeof algoSignTransaction;
3858
+ /**
3859
+ * Cosmos function
3860
+ */
3114
3861
  cosmosGetAddress: typeof cosmosGetAddress;
3115
3862
  cosmosGetPublicKey: typeof cosmosGetPublicKey;
3116
3863
  cosmosSignTransaction: typeof cosmosSignTransaction;
3864
+ /**
3865
+ * XRP function
3866
+ */
3117
3867
  xrpGetAddress: typeof xrpGetAddress;
3118
3868
  xrpSignTransaction: typeof xrpSignTransaction;
3869
+ /**
3870
+ * SUI function
3871
+ */
3119
3872
  suiGetAddress: typeof suiGetAddress;
3120
3873
  suiGetPublicKey: typeof suiGetPublicKey;
3121
3874
  suiSignMessage: typeof suiSignMessage;
3122
3875
  suiSignTransaction: typeof suiSignTransaction;
3876
+ /**
3877
+ * Cardano function
3878
+ */
3123
3879
  cardanoGetAddress: typeof cardanoGetAddress;
3124
3880
  cardanoGetPublicKey: typeof cardanoGetPublicKey;
3125
3881
  cardanoSignTransaction: typeof cardanoSignTransaction;
3126
3882
  cardanoSignMessage: typeof cardanoSignMessage;
3883
+ /**
3884
+ * Filecoin function
3885
+ */
3127
3886
  filecoinGetAddress: typeof filecoinGetAddress;
3128
3887
  filecoinSignTransaction: typeof filecoinSignTransaction;
3888
+ /**
3889
+ * Polkadot function
3890
+ */
3129
3891
  polkadotGetAddress: typeof polkadotGetAddress;
3130
3892
  polkadotSignTransaction: typeof polkadotSignTransaction;
3893
+ /**
3894
+ * Kaspa function
3895
+ */
3131
3896
  kaspaGetAddress: typeof kaspaGetAddress;
3132
3897
  kaspaSignTransaction: typeof kaspaSignTransaction;
3898
+ /**
3899
+ * nexa function
3900
+ */
3133
3901
  nexaGetAddress: typeof nexaGetAddress;
3134
3902
  nexaSignTransaction: typeof nexaSignTransaction;
3903
+ /**
3904
+ * Nostr function
3905
+ */
3135
3906
  nostrGetPublicKey: typeof nostrGetPublicKey;
3136
3907
  nostrSignEvent: typeof nostrSignEvent;
3137
3908
  nostrEncryptMessage: typeof nostrEncryptMessage;
3138
3909
  nostrDecryptMessage: typeof nostrDecryptMessage;
3139
3910
  nostrSignSchnorr: typeof nostrSignSchnorr;
3911
+ /**
3912
+ * Lightning Network
3913
+ */
3140
3914
  lnurlAuth: typeof lnurlAuth;
3915
+ /**
3916
+ * Nervos Network
3917
+ */
3141
3918
  nervosGetAddress: typeof nervosGetAddress;
3142
3919
  nervosSignTransaction: typeof nervosSignTransaction;
3920
+ /**
3921
+ * Dnx Network
3922
+ */
3143
3923
  dnxGetAddress: typeof dnxGetAddress;
3144
3924
  dnxSignTransaction: typeof dnxSignTransaction;
3925
+ /**
3926
+ * TON Network
3927
+ */
3145
3928
  tonGetAddress: typeof tonGetAddress;
3146
3929
  tonSignMessage: typeof tonSignMessage;
3147
3930
  tonSignProof: typeof tonSignProof;
3148
3931
  tonSignData: typeof tonSignData;
3932
+ /**
3933
+ * SCDO Network
3934
+ */
3149
3935
  scdoGetAddress: typeof scdoGetAddress;
3150
3936
  scdoSignMessage: typeof scdoSignMessage;
3151
3937
  scdoSignTransaction: typeof scdoSignTransaction;
3938
+ /**
3939
+ * Alephium Network
3940
+ */
3152
3941
  alephiumGetAddress: typeof alephiumGetAddress;
3153
3942
  alephiumSignMessage: typeof alephiumSignMessage;
3154
3943
  alephiumSignTransaction: typeof alephiumSignTransaction;
3944
+ /**
3945
+ * Benfen Network
3946
+ */
3155
3947
  benfenGetAddress: typeof benfenGetAddress;
3156
3948
  benfenGetPublicKey: typeof benfenGetPublicKey;
3157
3949
  benfenSignTransaction: typeof benfenSignTransaction;
3158
3950
  benfenSignMessage: typeof benfenSignMessage;
3951
+ /**
3952
+ * Neo Network
3953
+ */
3159
3954
  neoGetAddress: typeof neoGetAddress;
3160
3955
  neoSignTransaction: typeof neoSignTransaction;
3161
3956
  };
@@ -3228,13 +4023,17 @@ declare const DEVICE: {
3228
4023
  readonly LOADING: "device-loading";
3229
4024
  readonly BUTTON: "button";
3230
4025
  readonly PIN: "pin";
4026
+ readonly PIN_ON_DEVICE: "pin_on_device";
4027
+ readonly PIN_ON_DEVICE_COMPLETE: "pin_on_device_complete";
3231
4028
  readonly PASSPHRASE: "passphrase";
3232
4029
  readonly PASSPHRASE_ON_DEVICE: "passphrase_on_device";
4030
+ readonly ATTACH_PIN_ON_DEVICE: "attach_pin_on_device";
3233
4031
  readonly WORD: "word";
3234
4032
  readonly SUPPORT_FEATURES: "support_features";
3235
4033
  readonly SELECT_DEVICE_IN_BOOTLOADER_FOR_WEB_DEVICE: "select_device_in_bootloader_for_web_device";
3236
4034
  readonly SELECT_DEVICE_FOR_SWITCH_FIRMWARE_WEB_DEVICE: "select_device_for_switch_firmware_web_device";
3237
4035
  readonly FEATURES: "features";
4036
+ readonly STATE: "state";
3238
4037
  };
3239
4038
  interface DeviceConnnectRequest {
3240
4039
  type: typeof DEVICE.CONNECT;
@@ -3253,6 +4052,11 @@ interface DeviceButtonRequestPayload extends Omit<Messages.ButtonRequest, 'code'
3253
4052
  }
3254
4053
  type PassphraseRequestPayload = {
3255
4054
  existsAttachPinUser?: boolean;
4055
+ deviceOnly?: boolean;
4056
+ source?: 'wallet-session-coordinator';
4057
+ reason?: 'open-wallet' | 'session-recovery';
4058
+ expectedPassphraseState?: string;
4059
+ interaction?: HardwareUiInteractionMeta;
3256
4060
  };
3257
4061
  interface DeviceButtonRequest {
3258
4062
  type: typeof DEVICE.BUTTON;
@@ -3265,6 +4069,10 @@ interface DeviceSendFeatures {
3265
4069
  type: typeof DEVICE.FEATURES;
3266
4070
  payload: DeviceFeaturesPayload;
3267
4071
  }
4072
+ interface DeviceSendState {
4073
+ type: typeof DEVICE.STATE;
4074
+ payload: DeviceStateEvent;
4075
+ }
3268
4076
  type DeviceSupportFeaturesPayload = SupportFeatures & {
3269
4077
  device: KnownDevice | null;
3270
4078
  };
@@ -3272,13 +4080,58 @@ interface DeviceSendSupportFeatures {
3272
4080
  type: typeof DEVICE.SUPPORT_FEATURES;
3273
4081
  payload: DeviceSupportFeaturesPayload;
3274
4082
  }
3275
- type DeviceEvent = DeviceButtonRequest | DeviceSendFeatures | DeviceSendSupportFeatures | DeviceDisconnnectRequest | DeviceConnnectRequest;
4083
+ type DeviceEvent = DeviceButtonRequest | DeviceSendState | DeviceSendFeatures | DeviceSendSupportFeatures | DeviceDisconnnectRequest | DeviceConnnectRequest;
3276
4084
  type DeviceEventMessage = DeviceEvent & {
3277
4085
  event: typeof DEVICE_EVENT;
3278
4086
  };
3279
4087
  type DeviceEventListenerFn = (type: typeof DEVICE_EVENT, cb: (event: DeviceEventMessage) => void) => void;
3280
4088
  declare const createDeviceMessage: MessageFactoryFn<typeof DEVICE_EVENT, DeviceEvent>;
3281
4089
 
4090
+ declare const UI_RESPONSE: {
4091
+ readonly RECEIVE_PIN: "ui-receive_pin";
4092
+ readonly RECEIVE_PASSPHRASE: "ui-receive_passphrase";
4093
+ readonly SELECT_DEVICE_IN_BOOTLOADER_FOR_WEB_DEVICE: "ui-receive_select-device-in-bootloader-for-web-device";
4094
+ readonly SELECT_DEVICE_FOR_SWITCH_FIRMWARE_WEB_DEVICE: "ui-receive_select-device-for-switch-firmware-web-device";
4095
+ };
4096
+ interface UiResponseCorrelation {
4097
+ interactionId: string;
4098
+ deviceId: string;
4099
+ }
4100
+ interface UiResponseCorrelationFields {
4101
+ interactionId?: string;
4102
+ deviceId?: string;
4103
+ }
4104
+ interface UiResponsePin extends UiResponseCorrelationFields {
4105
+ type: typeof UI_RESPONSE.RECEIVE_PIN;
4106
+ payload: string;
4107
+ }
4108
+ interface UiResponsePassphrase extends UiResponseCorrelationFields {
4109
+ type: typeof UI_RESPONSE.RECEIVE_PASSPHRASE;
4110
+ payload: {
4111
+ value: string;
4112
+ passphraseOnDevice?: boolean;
4113
+ attachPinOnDevice?: boolean;
4114
+ save?: boolean;
4115
+ };
4116
+ }
4117
+ interface UiResponseSelectDeviceInBootloaderForWebDevice {
4118
+ type: typeof UI_RESPONSE.SELECT_DEVICE_IN_BOOTLOADER_FOR_WEB_DEVICE;
4119
+ payload: {
4120
+ deviceId: string;
4121
+ };
4122
+ }
4123
+ interface UiResponseSelectDeviceForSwitchFirmwareWebDevice {
4124
+ type: typeof UI_RESPONSE.SELECT_DEVICE_FOR_SWITCH_FIRMWARE_WEB_DEVICE;
4125
+ payload: {
4126
+ deviceId: string;
4127
+ };
4128
+ }
4129
+ type UiResponseEvent = UiResponsePin | UiResponsePassphrase | UiResponseSelectDeviceInBootloaderForWebDevice | UiResponseSelectDeviceForSwitchFirmwareWebDevice;
4130
+ type UiResponseMessage = UiResponseEvent & {
4131
+ event: typeof UI_EVENT;
4132
+ };
4133
+ declare const createUiResponse: MessageFactoryFn<typeof UI_EVENT, UiResponseEvent>;
4134
+
3282
4135
  declare const UI_EVENT = "UI_EVENT";
3283
4136
  declare const UI_REQUEST: {
3284
4137
  readonly REQUEST_PIN: "ui-request_pin";
@@ -3313,8 +4166,43 @@ declare const UI_REQUEST: {
3313
4166
  readonly FIRMWARE_NOT_INSTALLED: "ui-device_firmware_not_installed";
3314
4167
  readonly NOT_USE_ONEKEY_DEVICE: "ui-device_please_use_onekey_device";
3315
4168
  };
4169
+ type ProtocolV2UiEventSource = 'unlock-coordinator' | 'wallet-session-coordinator' | 'method-lifecycle';
4170
+ type ProtocolV2UiCompletion = 'page-accepted' | 'operation-completed';
4171
+ type HardwareUiInteractionMeta = {
4172
+ interactionId: string;
4173
+ phaseId: string;
4174
+ sequence: number;
4175
+ phase: 'pin' | 'passphrase' | 'passphrase-on-device' | 'button' | 'processing';
4176
+ transition: 'start' | 'complete' | 'finish';
4177
+ outcome?: 'submitted' | 'succeeded' | 'failed' | 'cancelled' | 'disconnected';
4178
+ protocol: 'V2';
4179
+ device?: Device$1;
4180
+ };
4181
+ type ProtocolV2UiEventMetadata = {
4182
+ source?: ProtocolV2UiEventSource;
4183
+ reason?: string;
4184
+ deviceOnly?: boolean;
4185
+ completion?: ProtocolV2UiCompletion;
4186
+ method?: string;
4187
+ page?: string | number;
4188
+ operation?: string;
4189
+ interaction?: HardwareUiInteractionMeta;
4190
+ };
4191
+ type UiRequestWindowClose = {
4192
+ type: typeof UI_REQUEST.CLOSE_UI_WINDOW;
4193
+ payload: HardwareUiInteractionMeta;
4194
+ } | {
4195
+ type: typeof UI_REQUEST.CLOSE_UI_PIN_WINDOW;
4196
+ payload: HardwareUiInteractionMeta;
4197
+ } | {
4198
+ type: typeof UI_REQUEST.CLOSE_UI_WINDOW;
4199
+ payload?: undefined;
4200
+ } | {
4201
+ type: typeof UI_REQUEST.CLOSE_UI_PIN_WINDOW;
4202
+ payload?: undefined;
4203
+ };
3316
4204
  interface UiRequestWithoutPayload {
3317
- 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;
4205
+ 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;
3318
4206
  payload?: typeof undefined;
3319
4207
  }
3320
4208
  interface UiRequestFirmwareProgressing {
@@ -3325,40 +4213,50 @@ interface UiRequestFirmwareProgressing {
3325
4213
  }
3326
4214
  type UiRequestDeviceAction = {
3327
4215
  type: typeof UI_REQUEST.REQUEST_PIN;
3328
- payload: {
3329
- device: Device;
4216
+ payload: ProtocolV2UiEventMetadata & {
4217
+ device: Device$1;
3330
4218
  type?: Messages.PinMatrixRequestType | 'ButtonRequest_PinEntry' | 'ButtonRequest_AttachPin';
4219
+ responseCorrelation?: UiResponseCorrelation;
3331
4220
  };
3332
4221
  };
3333
4222
  interface UiRequestButton {
3334
4223
  type: typeof UI_REQUEST.REQUEST_BUTTON;
3335
- payload: DeviceButtonRequest['payload'];
4224
+ payload: DeviceButtonRequest['payload'] & ProtocolV2UiEventMetadata;
3336
4225
  }
3337
4226
  interface UiRequestPassphrase {
3338
4227
  type: typeof UI_REQUEST.REQUEST_PASSPHRASE;
3339
4228
  payload: {
3340
- device: Device;
4229
+ device: Device$1;
3341
4230
  passphraseState?: string;
3342
4231
  existsAttachPinUser?: boolean;
4232
+ deviceOnly?: boolean;
4233
+ source?: 'wallet-session-coordinator';
4234
+ reason?: 'open-wallet' | 'session-recovery';
4235
+ expectedPassphraseState?: string;
4236
+ interaction?: HardwareUiInteractionMeta;
4237
+ responseCorrelation?: UiResponseCorrelation;
3343
4238
  };
3344
4239
  }
3345
4240
  interface UiRequestPassphraseOnDevice {
3346
4241
  type: typeof UI_REQUEST.REQUEST_PASSPHRASE_ON_DEVICE;
3347
4242
  payload: {
3348
- device: Device;
4243
+ device: Device$1;
3349
4244
  passphraseState?: string;
4245
+ source?: 'wallet-session-coordinator';
4246
+ reason?: 'open-wallet' | 'session-recovery';
4247
+ interaction?: HardwareUiInteractionMeta;
3350
4248
  };
3351
4249
  }
3352
4250
  interface UiRequestSelectDeviceInBootloaderForWebDevice {
3353
4251
  type: typeof UI_REQUEST.REQUEST_DEVICE_IN_BOOTLOADER_FOR_WEB_DEVICE;
3354
4252
  payload: {
3355
- device: Device;
4253
+ device: Device$1;
3356
4254
  };
3357
4255
  }
3358
4256
  interface UiRequestSelectDeviceForSwitchFirmwareWebDevice {
3359
4257
  type: typeof UI_REQUEST.REQUEST_DEVICE_FOR_SWITCH_FIRMWARE_WEB_DEVICE;
3360
4258
  payload: {
3361
- device: Device;
4259
+ device: Device$1;
3362
4260
  };
3363
4261
  }
3364
4262
  interface FirmwareProcessing {
@@ -3371,7 +4269,7 @@ type IFirmwareUpdateProgressType = 'transferData' | 'installingFirmware';
3371
4269
  interface FirmwareProgress {
3372
4270
  type: typeof UI_REQUEST.FIRMWARE_PROGRESS;
3373
4271
  payload: {
3374
- device: Device;
4272
+ device: Device$1;
3375
4273
  progress: number;
3376
4274
  progressType: IFirmwareUpdateProgressType;
3377
4275
  transferredBytes?: number;
@@ -3383,7 +4281,7 @@ interface FirmwareProgress {
3383
4281
  interface FirmwareTip {
3384
4282
  type: typeof UI_REQUEST.FIRMWARE_TIP;
3385
4283
  payload: {
3386
- device: Device;
4284
+ device: Device$1;
3387
4285
  data: {
3388
4286
  message: string;
3389
4287
  };
@@ -3402,14 +4300,14 @@ interface DeviceProgress {
3402
4300
  interface PreviousAddressResult {
3403
4301
  type: typeof UI_REQUEST.PREVIOUS_ADDRESS_RESULT;
3404
4302
  payload: {
3405
- device: Device;
4303
+ device: Device$1;
3406
4304
  data: {
3407
4305
  address?: string;
3408
4306
  path?: string;
3409
4307
  };
3410
4308
  };
3411
4309
  }
3412
- type UiEvent = UiRequestWithoutPayload | UiRequestDeviceAction | UiRequestButton | UiRequestPassphraseOnDevice | UiRequestPassphrase | UiRequestSelectDeviceInBootloaderForWebDevice | UiRequestSelectDeviceForSwitchFirmwareWebDevice | FirmwareProcessing | UiRequestSelectDeviceInBootloaderForWebDevice | FirmwareProgress | FirmwareTip | DeviceProgress | PreviousAddressResult;
4310
+ type UiEvent = UiRequestWithoutPayload | UiRequestWindowClose | UiRequestDeviceAction | UiRequestButton | UiRequestPassphraseOnDevice | UiRequestPassphrase | UiRequestSelectDeviceInBootloaderForWebDevice | UiRequestSelectDeviceForSwitchFirmwareWebDevice | FirmwareProcessing | UiRequestSelectDeviceInBootloaderForWebDevice | FirmwareProgress | FirmwareTip | DeviceProgress | PreviousAddressResult;
3413
4311
  declare enum FirmwareUpdateTipMessage {
3414
4312
  CheckLatestUiResource = "CheckLatestUiResource",
3415
4313
  StartDownloadFirmware = "StartDownloadFirmware",
@@ -3543,43 +4441,6 @@ interface MethodResponseMessage {
3543
4441
  declare const createResponseMessage: (id: number, success: boolean, payload: any) => MethodResponseMessage;
3544
4442
  type CallMethodKeys = keyof CoreApi;
3545
4443
 
3546
- declare const UI_RESPONSE: {
3547
- readonly RECEIVE_PIN: "ui-receive_pin";
3548
- readonly RECEIVE_PASSPHRASE: "ui-receive_passphrase";
3549
- readonly SELECT_DEVICE_IN_BOOTLOADER_FOR_WEB_DEVICE: "ui-receive_select-device-in-bootloader-for-web-device";
3550
- readonly SELECT_DEVICE_FOR_SWITCH_FIRMWARE_WEB_DEVICE: "ui-receive_select-device-for-switch-firmware-web-device";
3551
- };
3552
- interface UiResponsePin {
3553
- type: typeof UI_RESPONSE.RECEIVE_PIN;
3554
- payload: string;
3555
- }
3556
- interface UiResponsePassphrase {
3557
- type: typeof UI_RESPONSE.RECEIVE_PASSPHRASE;
3558
- payload: {
3559
- value: string;
3560
- passphraseOnDevice?: boolean;
3561
- attachPinOnDevice?: boolean;
3562
- save?: boolean;
3563
- };
3564
- }
3565
- interface UiResponseSelectDeviceInBootloaderForWebDevice {
3566
- type: typeof UI_RESPONSE.SELECT_DEVICE_IN_BOOTLOADER_FOR_WEB_DEVICE;
3567
- payload: {
3568
- deviceId: string;
3569
- };
3570
- }
3571
- interface UiResponseSelectDeviceForSwitchFirmwareWebDevice {
3572
- type: typeof UI_RESPONSE.SELECT_DEVICE_FOR_SWITCH_FIRMWARE_WEB_DEVICE;
3573
- payload: {
3574
- deviceId: string;
3575
- };
3576
- }
3577
- type UiResponseEvent = UiResponsePin | UiResponsePassphrase | UiResponseSelectDeviceInBootloaderForWebDevice | UiResponseSelectDeviceForSwitchFirmwareWebDevice;
3578
- type UiResponseMessage = UiResponseEvent & {
3579
- event: typeof UI_EVENT;
3580
- };
3581
- declare const createUiResponse: MessageFactoryFn<typeof UI_EVENT, UiResponseEvent>;
3582
-
3583
4444
  declare const LOG_EVENT = "LOG_EVENT";
3584
4445
  declare const LOG: {
3585
4446
  readonly OUTPUT: "log-output";
@@ -3655,10 +4516,14 @@ type UiPromiseResponse = UiResponseEvent | {
3655
4516
  };
3656
4517
  type UiPromise<T extends UiPromiseResponse['type']> = Deferred<Extract<UiPromiseResponse, {
3657
4518
  type: T;
3658
- }>, T, Device$1>;
4519
+ }>, T, Device> & {
4520
+ responseCorrelation?: UiResponseCorrelation;
4521
+ };
3659
4522
 
3660
4523
  declare const LogBlockEvent: Set<string>;
3661
4524
  declare function getLogBlockLabel(message: unknown): string | undefined;
4525
+ declare function getSafeLogPayload(value: unknown, blockLabel?: string): unknown;
4526
+ declare function formatLogMethodLabel(label: string, methodName?: string): string;
3662
4527
 
3663
4528
  declare const executeCallback: (id: string, ...args: any[]) => void;
3664
4529
  declare const cleanupCallback: (id: string) => void;
@@ -3722,38 +4587,117 @@ declare enum LoggerNames {
3722
4587
  }
3723
4588
  declare const getLogger: (key: LoggerNames) => Log;
3724
4589
 
3725
- declare const httpRequest: (url: string, type: string) => any;
4590
+ type HttpRequestOptions = {
4591
+ /** Additional request headers, such as a byte range for package metadata reads. */
4592
+ headers?: Record<string, string>;
4593
+ /** Axios adapter-defined request timeout retained for existing opt-in callers. */
4594
+ timeoutMs?: number;
4595
+ /** Deadline for DNS, connection, TLS, redirects, and the first response-body progress. */
4596
+ connectTimeoutMs?: number;
4597
+ /** Maximum idle interval between response-body progress events. */
4598
+ readTimeoutMs?: number;
4599
+ /** Wall-clock deadline across all attempts and retry backoff. */
4600
+ overallTimeoutMs?: number;
4601
+ maxRetries?: number;
4602
+ retryDelayMs?: number;
4603
+ };
4604
+
4605
+ declare const httpRequest: (url: string, type: string, options?: HttpRequestOptions) => any;
3726
4606
  declare const getTimeStamp: () => number;
3727
4607
 
4608
+ /**
4609
+ * Validates version string
4610
+ * @param {string} version Version string
4611
+ * @returns {boolean} True if version string is valid, false if not
4612
+ */
3728
4613
  declare const isValidVersionString: (version: string) => boolean;
4614
+ /**
4615
+ * Validates a version array
4616
+ * @param {number[]} version Version array
4617
+ * @returns {boolean} True if version array is valid, false if not
4618
+ */
3729
4619
  declare const isValidVersionArray: (version: number[]) => boolean;
4620
+ /**
4621
+ * Fills the missing version numbers with zeros (ie: [1, 2] will become [1, 2, 0])
4622
+ * @param {number[]} version Version array
4623
+ * @returns {number[]} Version array with all positions filled
4624
+ */
3730
4625
  declare const normalizeVersionArray: (version: number[]) => number[];
4626
+ /**
4627
+ * Returns a valid version array from a version string
4628
+ * @param {string} version Version string
4629
+ * @returns {number[]} Version array
4630
+ */
3731
4631
  declare const versionSplit: (version: string) => number[];
4632
+ /**
4633
+ * Compares two versions and returns if the version is newer (1), older (-1) or equal (0).
4634
+ * @param {string | number[]} a Version to compare from
4635
+ * @param {string | number[]} b Version to compare with
4636
+ * @returns {number} Returns 1 if newer, -1 if older and 0 if equal
4637
+ */
3732
4638
  declare const versionCompare: (a: string | number[], b: string | number[]) => 0 | 1 | -1;
3733
4639
 
3734
- declare function patchFeatures(response: DefaultMessageResponse): TypedResponseMessage<"PassphraseState"> | TypedResponseMessage<"Address"> | TypedResponseMessage<"DevFirmwareInstallProgress"> | TypedResponseMessage<"Success"> | TypedResponseMessage<"DevFirmwareUpdateStatus"> | 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<"DevFirmwareImageInfo"> | TypedResponseMessage<"DevInfoTargets"> | TypedResponseMessage<"DevInfoTypes"> | TypedResponseMessage<"DevHardwareInfo"> | TypedResponseMessage<"DevMainMcuInfo"> | TypedResponseMessage<"DevBluetoothInfo"> | TypedResponseMessage<"DevSEInfo"> | TypedResponseMessage<"DevStatus"> | TypedResponseMessage<"DevFirmwareTarget"> | TypedResponseMessage<"DevFirmwareUpdateStatusEntry"> | TypedResponseMessage<"FilesystemFile"> | TypedResponseMessage<"Setup"> | TypedResponseMessage<"NewDevice"> | TypedResponseMessage<"Restore"> | 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<"DebugLinkInput"> | TypedResponseMessage<"InternalMyAddressRequest"> | 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<"GetProtoVersion"> | TypedResponseMessage<"ProtoVersion"> | TypedResponseMessage<"DevReboot"> | TypedResponseMessage<"DevGetDeviceInfo"> | TypedResponseMessage<"DevFirmwareUpdate"> | TypedResponseMessage<"DevGetFirmwareUpdateStatus"> | TypedResponseMessage<"FactoryDeviceInfoSettings"> | TypedResponseMessage<"FactoryGetDeviceInfo"> | TypedResponseMessage<"FactoryDeviceInfo"> | TypedResponseMessage<"FilesystemFixPermission"> | TypedResponseMessage<"FilesystemPathInfo"> | TypedResponseMessage<"FilesystemPathInfoQuery"> | TypedResponseMessage<"FilesystemFileRead"> | TypedResponseMessage<"FilesystemFileWrite"> | TypedResponseMessage<"FilesystemFileDelete"> | TypedResponseMessage<"FilesystemDir"> | TypedResponseMessage<"FilesystemDirList"> | TypedResponseMessage<"FilesystemDirMake"> | TypedResponseMessage<"FilesystemDirRemove"> | TypedResponseMessage<"FilesystemFormat"> | TypedResponseMessage<"GetOnboardingStatus"> | TypedResponseMessage<"OnboardingStatus">;
4640
+ 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<"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">;
4641
+
4642
+ type DeviceFeaturesInput = Features | Messages.Features;
3735
4643
 
3736
- declare const getDeviceType: (features?: Features) => IDeviceType;
4644
+ /**
4645
+ * get device type by features
4646
+ */
4647
+ declare const getDeviceType: (features?: DeviceFeaturesInput) => IDeviceType;
4648
+ /**
4649
+ * get device type by ble name
4650
+ * @param name Ble name
4651
+ */
3737
4652
  declare const getDeviceTypeByBleName: (name?: string) => IDeviceType;
3738
- declare const getDeviceBleName: (features?: Features) => string | null;
3739
- declare const getDeviceUUID: (features: Features) => string;
3740
- declare const getDeviceLabel: (features?: Features) => string | null;
3741
- declare const getMethodVersionRange: (features: Features | undefined, getVersionRange: (deviceModel: IDeviceType | IDeviceModel) => IVersionRange | undefined) => IVersionRange | undefined;
3742
- declare const isMethodVersionRangeUnsupported: (versionRange?: IVersionRange) => boolean;
3743
- declare const getFirmwareType: (features: Features | undefined) => EFirmwareType;
3744
-
3745
- declare const getDeviceFirmwareVersion: (features: Features | undefined) => IVersionArray;
3746
- declare const getDeviceBLEFirmwareVersion: (features: Features) => IVersionArray;
3747
- declare const getDeviceBootloaderVersion: (features: Features | undefined) => IVersionArray;
3748
- declare const getDeviceBoardloaderVersion: (features: Features) => IVersionArray;
3749
-
3750
- declare const FIRMWARE_FIELDS: readonly ["firmware", "firmware-v2", "firmware-v8", "firmware-btc-v8"];
4653
+ /**
4654
+ * Get Connected Device ble name by features
4655
+ * @returns
4656
+ */
4657
+ declare const getDeviceBleName: (features?: DeviceFeaturesInput) => string | null;
4658
+ /**
4659
+ * Get Connected Device serial number by features
4660
+ */
4661
+ declare const getDeviceSerialNo: (features?: DeviceFeaturesInput) => string;
4662
+ /**
4663
+ * @deprecated Use getDeviceSerialNo instead.
4664
+ */
4665
+ declare const getDeviceUUID: (features?: DeviceFeaturesInput) => string;
4666
+ /**
4667
+ * Get Connected Device label by features
4668
+ */
4669
+ declare const getDeviceLabel: (features?: DeviceFeaturesInput) => string | null;
4670
+ /**
4671
+ * Get firmware version range by features
4672
+ * Type has a higher priority than Model
4673
+ */
4674
+ declare const getMethodVersionRange: (features: DeviceFeaturesInput | undefined, getVersionRange: (deviceModel: IDeviceType | IDeviceModel) => IVersionRange | undefined) => IVersionRange | undefined;
4675
+ declare const getFirmwareType: (features?: DeviceFeaturesInput) => _onekeyfe_hd_shared.EFirmwareType;
4676
+
4677
+ /**
4678
+ * Get Connected Device version by features
4679
+ */
4680
+ declare const getDeviceFirmwareVersion: (features?: DeviceFeaturesInput) => IVersionArray;
4681
+ /**
4682
+ * Get Connected Device bootloader version by features
4683
+ */
4684
+ declare const getDeviceBootloaderVersion: (features?: DeviceFeaturesInput) => IVersionArray;
4685
+ /**
4686
+ * Get Connected Device boardloader/romloader version by features
4687
+ */
4688
+ declare const getDeviceBoardloaderVersion: (features?: DeviceFeaturesInput) => IVersionArray;
4689
+ /**
4690
+ * Get Connected Device bluetooth firmware version by features
4691
+ */
4692
+ declare const getDeviceBLEFirmwareVersion: (features?: DeviceFeaturesInput) => IVersionArray;
4693
+
4694
+ declare const FIRMWARE_FIELDS: readonly ["firmware", "firmware-v1", "firmware-v2", "firmware-v8", "firmware-btc-v8"];
3751
4695
  type IFirmwareField = (typeof FIRMWARE_FIELDS)[number];
3752
4696
  type ProtocolV1MessageSchema = 'v1CurrentSchema' | 'v1LegacySchema';
3753
4697
  type ProtobufMessageSchema = ProtocolV1MessageSchema | 'v2Schema';
3754
4698
  declare class DataManager {
3755
4699
  static deviceMap: DeviceTypeMap & {
3756
- [k: string]: DeviceTypeMap[keyof DeviceTypeMap] | undefined;
4700
+ [k: string]: NonNullable<DeviceTypeMap[keyof DeviceTypeMap]> | undefined;
3757
4701
  };
3758
4702
  static assets: AssetsMap | null;
3759
4703
  static settings: ConnectSettings;
@@ -3761,12 +4705,22 @@ declare class DataManager {
3761
4705
  [schema in ProtobufMessageSchema]: JSON;
3762
4706
  };
3763
4707
  static lastCheckTimestamp: number;
4708
+ static protocolV2ResourcesConfigError: Error | undefined;
4709
+ private static protocolV2NeoResourcesConfigError;
3764
4710
  static getFirmwareStatus: (features: Features, firmwareType: EFirmwareType) => IDeviceFirmwareStatus;
4711
+ /**
4712
+ * Touch、Pro System UI Resource Update
4713
+ * ** Interval upgrade is not considered **
4714
+ */
3765
4715
  static getSysResourcesLatestRelease: ({ features, forcedUpdateRes, firmwareType, }: {
3766
4716
  features: Features;
3767
4717
  forcedUpdateRes?: boolean | undefined;
3768
4718
  firmwareType: EFirmwareType;
3769
4719
  }) => string | undefined;
4720
+ /**
4721
+ * Touch、Pro System full UI Resource Update
4722
+ * ** Interval upgrade is not considered **
4723
+ */
3770
4724
  static getSysFullResource: (features: Features, firmwareType: EFirmwareType) => string | undefined;
3771
4725
  static getBootloaderResource: (features: Features, firmwareType: EFirmwareType) => string | undefined;
3772
4726
  static getBootloaderTargetVersion: (features: Features, firmwareType: EFirmwareType) => IVersionArray | undefined;
@@ -3788,24 +4742,41 @@ declare class DataManager {
3788
4742
  "en-US": string;
3789
4743
  } | undefined;
3790
4744
  private static enrichFirmwareReleaseInfo;
3791
- static load(settings: ConnectSettings): Promise<void>;
4745
+ static load(settings: ConnectSettings): Promise<boolean>;
4746
+ private static applyRemoteConfig;
3792
4747
  static updateEnv(newEnv: ConnectSettings['env']): void;
3793
4748
  static checkAndReloadData(): Promise<void>;
4749
+ /** Force a fresh remote config before an update is allowed to mutate the device. */
4750
+ static forceReloadData({ requireResources, resourceDeviceType, }?: {
4751
+ requireResources?: boolean;
4752
+ resourceDeviceType?: EDeviceType.Pro2 | EDeviceType.Neo;
4753
+ }): Promise<void>;
4754
+ static getProtocolV2ResourceSource(deviceType?: EDeviceType.Pro2 | EDeviceType.Neo): IProtocolV2ResourceSource | undefined;
3794
4755
  static getProtobufMessages(schema?: ProtobufMessageSchema): JSON;
3795
4756
  static getSettings(key?: undefined): ConnectSettings;
3796
4757
  static getSettings<T extends keyof ConnectSettings>(key: T): ConnectSettings[T];
3797
4758
  static isBleConnect: (env: ConnectSettings['env']) => boolean;
4759
+ /** Desktop WebUSB doesn't need browser permission prompt */
3798
4760
  static isDesktopWebUsb: (env: ConnectSettings['env']) => boolean;
4761
+ /** Browser WebUSB needs permission prompt */
3799
4762
  static isBrowserWebUsb: (env: ConnectSettings['env']) => boolean;
3800
4763
  }
3801
4764
 
3802
- declare const supportInputPinOnSoftware: (features: Features) => SupportFeatureType;
4765
+ declare const supportInputPinOnSoftware: (features?: Features) => SupportFeatureType;
4766
+ /**
4767
+ * Since 3.5.0, Touch uses the firmware-v3 field to get firmware release info
4768
+ */
3803
4769
  declare const getFirmwareUpdateField: ({ features, updateType, targetVersion, firmwareType, }: {
3804
4770
  features: Features;
3805
4771
  updateType: 'firmware' | 'ble';
3806
4772
  targetVersion?: string | undefined;
3807
4773
  firmwareType: EFirmwareType;
3808
4774
  }) => 'ble' | IFirmwareField;
4775
+ /**
4776
+ * Returns the optional firmware version
4777
+ * Used in firmware web update
4778
+ * https://firmware.onekey.so/
4779
+ */
3809
4780
  declare const getFirmwareUpdateFieldArray: (features: Features, updateType: 'firmware' | 'ble' | 'bootloader') => ('ble' | IFirmwareField)[];
3810
4781
 
3811
4782
  declare function checkNeedUpdateBootForTouch(features: Features, firmwareType: EFirmwareType): boolean;
@@ -3815,15 +4786,40 @@ declare function checkNeedUpdateBootForClassicAndMini({ features, willUpdateFirm
3815
4786
  firmwareType: EFirmwareType;
3816
4787
  }): boolean;
3817
4788
 
4789
+ type DeviceSettingsProtocol = 'V1' | 'V2';
4790
+ type DeviceSettingsField = keyof DeviceSettingsParams;
4791
+ declare const DEVICE_SETTINGS_SHARED_FIELDS: readonly ["language", "label", "usePassphrase", "autoLockDelayMs", "autoShutdownDelayMs", "hapticFeedback", "bluetoothEnabled"];
4792
+ declare const DEVICE_SETTINGS_V1_ONLY_FIELDS: readonly ["homescreen", "passphraseSource", "displayRotation", "passphraseAlwaysOnDevice", "safetyChecks", "experimentalFeatures", "changeBrightness"];
4793
+ declare const DEVICE_SETTINGS_V2_ONLY_FIELDS: readonly ["brightness", "airgapMode", "animationEnabled", "tapToWake", "deviceNameDisplayEnabled", "fidoEnabled", "usbLockEnabled", "randomKeypad"];
4794
+ declare const PROTOCOL_V2_NEVER_TIMEOUT_MS = 268435456;
4795
+ declare const normalizeSafetyCheckLevel: (value: SafetyCheckLevel | null | undefined) => Enum_SafetyCheckLevel | null | undefined;
3818
4796
  declare const getLanguageConfig: (deviceType: IDeviceType) => Record<string, string>[];
3819
- type DurationParts = {
3820
- seconds: number;
3821
- minute: number;
3822
- hour: number;
3823
- day: number;
4797
+ type DeviceSettingsDurationOption = {
4798
+ label: string;
4799
+ valueMs: number;
4800
+ };
4801
+ type DeviceSettingsValueOption<T> = {
4802
+ label: string;
4803
+ value: T;
4804
+ };
4805
+ declare const getAutoLockOptions: (deviceType: IDeviceType, protocol: DeviceSettingsProtocol) => DeviceSettingsDurationOption[];
4806
+ declare const getAutoShutDownOptions: (deviceType: IDeviceType, protocol: DeviceSettingsProtocol) => DeviceSettingsDurationOption[];
4807
+ type DeviceSettingsCapabilities = {
4808
+ protocol: DeviceSettingsProtocol;
4809
+ supportedFields: readonly DeviceSettingsField[];
4810
+ languageOptions: ReadonlyArray<Record<string, string>>;
4811
+ autoLockDelayOptions: readonly DeviceSettingsDurationOption[];
4812
+ autoShutdownDelayOptions: readonly DeviceSettingsDurationOption[];
4813
+ ranges: {
4814
+ brightness?: {
4815
+ min: number;
4816
+ max: number;
4817
+ };
4818
+ };
4819
+ safetyCheckOptions: ReadonlyArray<DeviceSettingsValueOption<Enum_SafetyCheckLevel>>;
4820
+ onDeviceConfirmationFields: readonly DeviceSettingsField[];
3824
4821
  };
3825
- declare const getAutoLockOptions: (_deviceType: IDeviceType) => DurationParts[];
3826
- declare const getAutoShutDownOptions: (_deviceType: IDeviceType) => DurationParts[];
4822
+ declare const getDeviceSettingsCapabilities: (deviceType: IDeviceType, protocol: DeviceSettingsProtocol) => DeviceSettingsCapabilities;
3827
4823
 
3828
4824
  declare const getHDPath: (path: string) => Array<number>;
3829
4825
  declare const getScriptType: (path: Array<number>) => InputScriptType;
@@ -3836,6 +4832,10 @@ type SizeConfig = {
3836
4832
  height: number;
3837
4833
  radius?: number;
3838
4834
  };
4835
+ declare const getNftSize: ({ deviceType, thumbnail, }: {
4836
+ deviceType: IDeviceType;
4837
+ thumbnail?: boolean | undefined;
4838
+ }) => SizeConfig | undefined;
3839
4839
  declare const getHomeScreenSize: ({ deviceType, homeScreenType, thumbnail, }: {
3840
4840
  deviceType: IDeviceType;
3841
4841
  homeScreenType: 'WallPaper' | 'Nft';
@@ -3860,8 +4860,50 @@ declare const getEnv: () => "web" | "webextension" | "electron" | "react-native"
3860
4860
  declare const corsValidator: (url?: string) => string | undefined;
3861
4861
  declare const parseConnectSettings: (input?: Partial<ConnectSettings>) => ConnectSettings;
3862
4862
 
4863
+ type StoredDeviceState = DeviceState & {
4864
+ raw?: DeviceFeaturesRaw;
4865
+ };
4866
+ declare const projectFeatures: (state: StoredDeviceState) => Features;
4867
+
4868
+ /**
4869
+ * Read the protocol contract from the same method instance used by the Core dispatcher.
4870
+ * Passing a payload initializes the method first so parameter-dependent contracts, such
4871
+ * as Bitcoin fork support, are evaluated with the actual request.
4872
+ */
4873
+ declare function getMethodSupportedProtocols(method: string, payload?: Record<string, unknown>): readonly ProtocolType[];
4874
+
4875
+ declare function parseProtocolV2ResourceManifest(value: unknown): IProtocolV2ResourceManifest;
4876
+ declare function selectProtocolV2ResourceManifestFiles({ manifest, targetsToUpdate, }: {
4877
+ manifest: IProtocolV2ResourceManifest;
4878
+ targetsToUpdate: readonly FirmwareUpdateV4Target[];
4879
+ }): IProtocolV2ResourceManifestFile[];
4880
+
4881
+ type FirmwareMemoryArtifactEntry = {
4882
+ entryName: string;
4883
+ binary: ArrayBuffer;
4884
+ };
4885
+ type FirmwareMemoryArtifact = {
4886
+ artifactId: string;
4887
+ binary: ArrayBuffer;
4888
+ materializedEntries?: FirmwareMemoryArtifactEntry[];
4889
+ };
4890
+ type FirmwareUpdateV4MemoryHost = {
4891
+ preparedPlan: ReturnType<CoreApi['prepareFirmwareUpdatePlan']>;
4892
+ hostBindingGeneration: number;
4893
+ release: () => void;
4894
+ };
4895
+ declare function prepareFirmwareUpdateV4MemoryHost({ sdk, plan, artifacts, }: {
4896
+ sdk: Pick<CoreApi, 'prepareFirmwareUpdatePlan' | 'registerFirmwareUpdateHostBinding' | 'unregisterFirmwareUpdateHostBinding'>;
4897
+ plan: FirmwareUpdatePlan;
4898
+ artifacts: FirmwareMemoryArtifact[];
4899
+ }): FirmwareUpdateV4MemoryHost;
4900
+
4901
+ declare const registerFirmwareUpdateHostBinding: (binding: FirmwareUpdateHostBinding) => number;
4902
+ declare const unregisterFirmwareUpdateHostBinding: (generation?: number) => boolean;
4903
+ declare const getFirmwareUpdateHostBindingGeneration: () => number;
4904
+
3863
4905
  declare const HardwareSdk: ({ init, call, dispose, eventEmitter, uiResponse, cancel, updateSettings, switchTransport, }: InjectApi) => CoreApi;
3864
4906
  declare const HardwareSDKLowLevel: ({ init, call, dispose, eventEmitter, addHardwareGlobalEventListener, uiResponse, cancel, updateSettings, switchTransport, }: LowLevelInjectApi) => LowLevelCoreApi;
3865
4907
  declare const HardwareTopLevelSdk: () => CoreApi;
3866
4908
 
3867
- export { AccountAddress, AccountAddresses, AlephiumAddress, AlephiumGetAddressParams, AlephiumSignMessageParams, AlephiumSignTransactionParams, AlephiumSignedTx, AlgoAddress, AlgoGetAddressParams, AlgoSignTransactionParams, AlgoSignedTx, AllFirmwareRelease, AllNetworkAddressParams, AllNetworkGetAddressParams, AptosAddress, AptosGetAddressParams, AptosGetPublicKeyParams, AptosMessageSignature, AptosPublicKey, AptosSignInMessageParams, AptosSignInMessageSignature, AptosSignMessageParams, AptosSignTransactionParams, AptosSignedTx, AssetsMap, BTCAddress, BTCGetAddressParams, BTCGetPublicKeyParams, BTCPublicKey, BTCSignMessageParams, BTCSignTransactionParams, BTCVerifyMessageParams, BenfenAddress, BenfenGetAddressParams, BenfenGetPublicKeyParams, BenfenPublicKey, BenfenSignMessageParams, BenfenSignTransactionParams, BenfenSignedTx, BleReleaseInfoEvent, BleReleaseInfoPayload, CORE_EVENT, CallMethod, CallMethodAnyResponse, CallMethodKeys, CallMethodPayload, CallMethodResponse, CallMethodUnion, CardanoAddress, CardanoGetAddressMethodParams, CardanoGetAddressParams, CardanoSignMessageMethodParams, CardanoSignMessageParams, CardanoSignTransaction, CardanoSignedTxData, CipheredKeyValue, CipheredKeyValueParams, CommonParams, ConfluxAddress, ConfluxGetAddressParams, ConfluxSignMessageCIP23Params, ConfluxSignMessageParams, ConfluxSignTransactionParams, ConfluxSignedTx, ConfluxTransaction, ConnectSettings, Core, CoreApi, CoreMessage, CosmosAddress, CosmosGetAddressParams, CosmosGetPublicKeyParams, CosmosPublicKey, CosmosSignTransactionParams, CosmosSignedTx, DEFAULT_PRIORITY, DEVICE, DEVICE_EVENT, DataManager, Device, 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, GetPassphraseStatePayload, HardwareSDKLowLevel, HardwareTopLevelSdk, IBLEFirmwareReleaseInfo, IDeviceBLEFirmwareStatus, IDeviceFirmwareStatus, IDeviceModel, IDeviceType, IFRAME, IFirmwareField, IFirmwareReleaseInfo, IFirmwareUpdateProgressType, IFirmwareUpdateTipMessage, IFrameBridge, IFrameCallMessage, IFrameCallback, IFrameCallbackMessage, IFrameCancelMessage, IFrameEvent, IFrameEventMessage, IFrameInit, IFrameSwitchTransport, IFrameSwitchTransportMessage, ILocale, ITransportStatus, IVersionArray, IVersionRange, KaspaAddress, KaspaGetAddressParams, KaspaSignInputParams, KaspaSignOutputParams, KaspaSignTransactionParams, KaspaSignature, KnownDevice, LOG, LOG_EVENT, LogBlockEvent, LogEvent, LogEventMessage, LogOutput, LoggerNames, LowLevelCoreApi, LowLevelInjectApi, MajorVersion, MethodResponseMessage, NEMAddress, NEMAggregateModificationTransaction, NEMGetAddressParams, NEMImportanceTransaction, NEMMosaic, NEMMosaicCreationTransaction, NEMMultisigTransaction, NEMProvisionNamespaceTransaction, NEMSignTransactionParams, NEMSupplyChangeTransaction, NEMTransaction, NEMTransferTransaction, NearAddress, NearGetAddressParams, NearSignTransactionParams, NervosAddress, NervosGetAddressParams, NervosSignTransactionParams, NervosSignedTx, NexaAddress, NexaGetAddressParams, NexaSignInputParams, NexaSignOutputParams, NexaSignTransactionParams, NexaSignature, OnekeyFeatures, Params, PassphraseRequestPayload, PolkadotAddress, PolkadotGetAddressParams, PolkadotSignTransactionParams, PolkadotSignedTx, PostMessageEvent, PreviousAddressResult, RESPONSE_EVENT, RefTransaction, ReleaseInfo, ReleaseInfoEvent, ReleaseInfoPayload, RemoteConfigResponse, RequestContext, Response, ScdoAddress, ScdoGetAddressParams, ScdoSignMessageParams, ScdoSignTransactionParams, ScdoSignedTx, SdkTracingContext, SearchDevice, SignedTransaction, SolSignMessageParams, SolSignMessageResponse, SolSignOffchainMessageParams, SolSignOffchainMessageResponse, SolanaAddress, SolanaGetAddressParams, SolanaSignTransactionParams, SolanaSignedTx, StarcoinAddress, StarcoinGetAddressParams, StarcoinGetPublicKeyParams, StarcoinPublicKey, StarcoinSignMessageParams, StarcoinSignTransactionParams, StarcoinVerifyMessageParams, StellarAddress, StellarAsset, StellarGetAddressParams, StellarOperation, StellarSignTransactionParams, StellarTransaction, StrictFeatures, Success, SuiAddress, SuiGetAddressParams, SuiGetPublicKeyParams, SuiPublicKey, SuiSignMessageParams, SuiSignTransactionParams, SuiSignedTx, SupportFeatureType, SupportFeatures, TonAddress, TonGetAddressParams, TonSignDataParams, TonSignMessageParams, TonSignProofParams, TopLevelInjectApi, TransactionOptions, TransportReleaseStatus, TronAddress, TronDelegateResourceContract, TronFreezeBalanceV2Contract, TronGetAddressParams, TronSignMessageParams, TronSignTransactionParams, TronTransaction, TronTransactionContract, TronTransferContract, TronTriggerSmartContract, TronUnDelegateResourceContract, TronUnfreezeBalanceV2Contract, TronWithdrawBalanceContract, TronWithdrawExpireUnfreezeContract, UI_EVENT, UI_REQUEST, UI_RESPONSE, UiEvent, UiEventMessage, UiPromise, UiPromiseResponse, UiRequestButton, UiRequestDeviceAction, UiRequestFirmwareProgressing, UiRequestPassphrase, UiRequestPassphraseOnDevice, UiRequestSelectDeviceForSwitchFirmwareWebDevice, UiRequestSelectDeviceInBootloaderForWebDevice, UiRequestWithoutPayload, UiResponseEvent, UiResponseMessage, UiResponsePassphrase, UiResponsePin, UiResponseSelectDeviceForSwitchFirmwareWebDevice, UiResponseSelectDeviceInBootloaderForWebDevice, UnavailableCapabilities, UnavailableCapability, Unsuccessful, VersionArray, checkNeedUpdateBootForClassicAndMini, checkNeedUpdateBootForTouch, cleanupCallback, cleanupSdkInstance, completeRequestContext, corsValidator, createDeviceMessage, createErrorMessage, createFirmwareMessage, createIFrameMessage, createLogMessage, createRequestContext, createResponseMessage, createSdkTracingContext, createUiMessage, createUiResponse, HardwareSdk as default, enableLog, executeCallback, formatRequestContext, generateInstanceId, generateSdkInstanceId, getActiveRequestsByDeviceInstance, getAutoLockOptions, getAutoShutDownOptions, getDeviceBLEFirmwareVersion, getDeviceBleName, getDeviceBoardloaderVersion, getDeviceBootloaderVersion, getDeviceFirmwareVersion, getDeviceLabel, getDeviceType, getDeviceTypeByBleName, getDeviceUUID, getEnv, getFirmwareType, getFirmwareUpdateField, getFirmwareUpdateFieldArray, getHDPath, getHomeScreenDefaultList, getHomeScreenHex, getHomeScreenSize, getLanguageConfig, getLog, 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 };
4909
+ 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_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, IProtocolV2ResourceManifest, IProtocolV2ResourceManifestFile, 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, parseProtocolV2ResourceManifest, patchFeatures, preloadSessionCache, prepareFirmwareUpdateV4MemoryHost, projectFeatures as projectDeviceStateFeatures, registerFirmwareUpdateHostBinding, safeThrowError, selectProtocolV2ResourceManifestFiles, setLoggerPostMessage, supportInputPinOnSoftware, switchTransport, transportEnv, unregisterFirmwareUpdateHostBinding, updateRequestContext, versionCompare, versionSplit, wait, whitelist, whitelistExtension };