@onekeyfe/hd-core 1.2.0-alpha.5 → 1.2.0-alpha.50

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 (727) hide show
  1. package/__tests__/AllNetworkGetAddressBase.tracing.test.ts +155 -0
  2. package/__tests__/DeviceCommands.test.ts +517 -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 +390 -0
  6. package/__tests__/connectSettings.test.ts +19 -0
  7. package/__tests__/core-dispose.test.ts +34 -0
  8. package/__tests__/core-error-output.test.ts +39 -0
  9. package/__tests__/device-features-state.test.ts +78 -0
  10. package/__tests__/device-identity.test.ts +52 -0
  11. package/__tests__/device-lifecycle-events.test.ts +351 -0
  12. package/__tests__/device-pool-state.test.ts +144 -0
  13. package/__tests__/device-settings.test.ts +416 -0
  14. package/__tests__/device-state-contract.test.ts +27 -0
  15. package/__tests__/device-state-events.test.ts +286 -0
  16. package/__tests__/device-state-mapper.test.ts +261 -0
  17. package/__tests__/device-state-projector.test.ts +94 -0
  18. package/__tests__/device-state-store.test.ts +82 -0
  19. package/__tests__/device-utils.test.ts +107 -0
  20. package/__tests__/device-wallet-session-store.test.ts +478 -0
  21. package/__tests__/deviceFeaturesUtils.test.ts +39 -0
  22. package/__tests__/deviceSettings.test.ts +103 -0
  23. package/__tests__/deviceUploadNft.test.ts +293 -0
  24. package/__tests__/evmLedgerLegacySafety.test.ts +12 -6
  25. package/__tests__/evmSignTransaction.test.ts +69 -0
  26. package/__tests__/evmSignTypedData.test.ts +80 -0
  27. package/__tests__/filesystemValidation.test.ts +53 -0
  28. package/__tests__/firmware-update/firmware-update-v2-download-before-boot.test.ts +402 -0
  29. package/__tests__/get-device-state.test.ts +578 -0
  30. package/__tests__/homescreen.test.ts +64 -0
  31. package/__tests__/kaspa-public-types.type-test.ts +16 -0
  32. package/__tests__/kaspa-use-tweak-pro2.test.ts +20 -0
  33. package/__tests__/kaspaSignTransaction.test.ts +601 -0
  34. package/__tests__/known-device-public-types.type-test.ts +3 -0
  35. package/__tests__/logBlockEvent.test.ts +128 -1
  36. package/__tests__/method-protocol-support.test.ts +132 -0
  37. package/__tests__/networkUtils.test.ts +406 -0
  38. package/__tests__/open-wallet-session-error-response.test.ts +43 -0
  39. package/__tests__/open-wallet-session.test.ts +1781 -0
  40. package/__tests__/pro2Nft.test.ts +108 -0
  41. package/__tests__/pro2Wallpaper.test.ts +39 -0
  42. package/__tests__/protocol-binding.test.ts +89 -0
  43. package/__tests__/protocol-v2-bootloader-mode.test.ts +37 -0
  44. package/__tests__/protocol-v2-firmware-targets.test.ts +37 -0
  45. package/__tests__/protocol-v2-ping.test.ts +28 -0
  46. package/__tests__/protocol-v2-resources.test.ts +284 -0
  47. package/__tests__/protocol-v2-ui-lifecycle.test.ts +91 -0
  48. package/__tests__/protocol-v2-unlock-policy.test.ts +206 -0
  49. package/__tests__/protocol-v2.test.ts +6162 -2544
  50. package/__tests__/protocolV2FileWrite.test.ts +92 -0
  51. package/__tests__/protocolV2UiInteraction.test.ts +329 -0
  52. package/__tests__/public-device-state-api.test.ts +275 -0
  53. package/__tests__/public-pro2-api-boundary.test.ts +107 -0
  54. package/__tests__/refresh-device-state.test.ts +101 -0
  55. package/__tests__/request-context-logging.test.ts +16 -0
  56. package/__tests__/search-devices.test.ts +145 -0
  57. package/__tests__/tron-sign-message-init.test.ts +74 -0
  58. package/__tests__/uiProgressThrottle.test.ts +74 -0
  59. package/__tests__/uiPromiseRegistry.test.ts +86 -0
  60. package/dist/api/BaseMethod.d.ts +16 -1
  61. package/dist/api/BaseMethod.d.ts.map +1 -1
  62. package/dist/api/CheckAllFirmwareRelease.d.ts +24 -1
  63. package/dist/api/CheckAllFirmwareRelease.d.ts.map +1 -1
  64. package/dist/api/CheckBootloaderRelease.d.ts.map +1 -1
  65. package/dist/api/CheckFirmwareRelease.d.ts.map +1 -1
  66. package/dist/api/CipherKeyValue.d.ts +1 -0
  67. package/dist/api/CipherKeyValue.d.ts.map +1 -1
  68. package/dist/api/ClearSessionCache.d.ts +9 -0
  69. package/dist/api/ClearSessionCache.d.ts.map +1 -0
  70. package/dist/api/DetectDeviceConnectProtocol.d.ts +7 -0
  71. package/dist/api/DetectDeviceConnectProtocol.d.ts.map +1 -0
  72. package/dist/api/DirList.d.ts +1 -0
  73. package/dist/api/DirList.d.ts.map +1 -1
  74. package/dist/api/DirMake.d.ts +1 -0
  75. package/dist/api/DirMake.d.ts.map +1 -1
  76. package/dist/api/DirRemove.d.ts +1 -0
  77. package/dist/api/DirRemove.d.ts.map +1 -1
  78. package/dist/api/FileDelete.d.ts +1 -0
  79. package/dist/api/FileDelete.d.ts.map +1 -1
  80. package/dist/api/FileRead.d.ts +1 -0
  81. package/dist/api/FileRead.d.ts.map +1 -1
  82. package/dist/api/FileWrite.d.ts +2 -0
  83. package/dist/api/FileWrite.d.ts.map +1 -1
  84. package/dist/api/FirmwareUpdate.d.ts.map +1 -1
  85. package/dist/api/FirmwareUpdateV2.d.ts +2 -2
  86. package/dist/api/FirmwareUpdateV2.d.ts.map +1 -1
  87. package/dist/api/FirmwareUpdateV3.d.ts.map +1 -1
  88. package/dist/api/FirmwareUpdateV4.d.ts +24 -16
  89. package/dist/api/FirmwareUpdateV4.d.ts.map +1 -1
  90. package/dist/api/GetDeviceState.d.ts +8 -0
  91. package/dist/api/GetDeviceState.d.ts.map +1 -0
  92. package/dist/api/GetFeatures.d.ts +1 -1
  93. package/dist/api/GetFeatures.d.ts.map +1 -1
  94. package/dist/api/GetOnekeyFeatures.d.ts.map +1 -1
  95. package/dist/api/GetPassphraseState.d.ts +2 -6
  96. package/dist/api/GetPassphraseState.d.ts.map +1 -1
  97. package/dist/api/OpenWalletSession.d.ts +8 -0
  98. package/dist/api/OpenWalletSession.d.ts.map +1 -0
  99. package/dist/api/PathInfo.d.ts +1 -0
  100. package/dist/api/PathInfo.d.ts.map +1 -1
  101. package/dist/api/PromptWebDeviceAccess.d.ts.map +1 -1
  102. package/dist/api/SearchDevices.d.ts +3 -0
  103. package/dist/api/SearchDevices.d.ts.map +1 -1
  104. package/dist/api/UploadPortfolio.d.ts +17 -0
  105. package/dist/api/UploadPortfolio.d.ts.map +1 -0
  106. package/dist/api/alephium/AlephiumGetAddress.d.ts.map +1 -1
  107. package/dist/api/alephium/AlephiumSignMessage.d.ts.map +1 -1
  108. package/dist/api/alephium/AlephiumSignTransaction.d.ts.map +1 -1
  109. package/dist/api/algo/AlgoGetAddress.d.ts +1 -0
  110. package/dist/api/algo/AlgoGetAddress.d.ts.map +1 -1
  111. package/dist/api/algo/AlgoSignTransaction.d.ts +1 -0
  112. package/dist/api/algo/AlgoSignTransaction.d.ts.map +1 -1
  113. package/dist/api/allnetwork/AllNetworkGetAddressBase.d.ts +1 -0
  114. package/dist/api/allnetwork/AllNetworkGetAddressBase.d.ts.map +1 -1
  115. package/dist/api/aptos/AptosGetAddress.d.ts +1 -0
  116. package/dist/api/aptos/AptosGetAddress.d.ts.map +1 -1
  117. package/dist/api/aptos/AptosGetPublicKey.d.ts +1 -0
  118. package/dist/api/aptos/AptosGetPublicKey.d.ts.map +1 -1
  119. package/dist/api/aptos/AptosSignInMessage.d.ts +1 -0
  120. package/dist/api/aptos/AptosSignInMessage.d.ts.map +1 -1
  121. package/dist/api/aptos/AptosSignMessage.d.ts +1 -0
  122. package/dist/api/aptos/AptosSignMessage.d.ts.map +1 -1
  123. package/dist/api/aptos/AptosSignTransaction.d.ts +1 -0
  124. package/dist/api/aptos/AptosSignTransaction.d.ts.map +1 -1
  125. package/dist/api/benfen/BenfenGetAddress.d.ts.map +1 -1
  126. package/dist/api/benfen/BenfenGetPublicKey.d.ts.map +1 -1
  127. package/dist/api/benfen/BenfenSignMessage.d.ts.map +1 -1
  128. package/dist/api/benfen/BenfenSignTransaction.d.ts.map +1 -1
  129. package/dist/api/btc/BTCGetAddress.d.ts +1 -0
  130. package/dist/api/btc/BTCGetAddress.d.ts.map +1 -1
  131. package/dist/api/btc/BTCGetPublicKey.d.ts +1 -0
  132. package/dist/api/btc/BTCGetPublicKey.d.ts.map +1 -1
  133. package/dist/api/btc/BTCSignMessage.d.ts +1 -0
  134. package/dist/api/btc/BTCSignMessage.d.ts.map +1 -1
  135. package/dist/api/btc/BTCSignPsbt.d.ts +1 -0
  136. package/dist/api/btc/BTCSignPsbt.d.ts.map +1 -1
  137. package/dist/api/btc/BTCSignTransaction.d.ts +1 -0
  138. package/dist/api/btc/BTCSignTransaction.d.ts.map +1 -1
  139. package/dist/api/btc/BTCVerifyMessage.d.ts +1 -0
  140. package/dist/api/btc/BTCVerifyMessage.d.ts.map +1 -1
  141. package/dist/api/btc/helpers/versionLimit.d.ts +2 -0
  142. package/dist/api/btc/helpers/versionLimit.d.ts.map +1 -1
  143. package/dist/api/cardano/CardanoGetAddress.d.ts +1 -0
  144. package/dist/api/cardano/CardanoGetAddress.d.ts.map +1 -1
  145. package/dist/api/cardano/CardanoGetPublicKey.d.ts +1 -0
  146. package/dist/api/cardano/CardanoGetPublicKey.d.ts.map +1 -1
  147. package/dist/api/cardano/CardanoSignMessage.d.ts +1 -0
  148. package/dist/api/cardano/CardanoSignMessage.d.ts.map +1 -1
  149. package/dist/api/cardano/CardanoSignTransaction.d.ts +1 -0
  150. package/dist/api/cardano/CardanoSignTransaction.d.ts.map +1 -1
  151. package/dist/api/conflux/ConfluxGetAddress.d.ts +2 -0
  152. package/dist/api/conflux/ConfluxGetAddress.d.ts.map +1 -1
  153. package/dist/api/conflux/ConfluxSignMessage.d.ts +2 -0
  154. package/dist/api/conflux/ConfluxSignMessage.d.ts.map +1 -1
  155. package/dist/api/conflux/ConfluxSignMessageCIP23.d.ts +2 -0
  156. package/dist/api/conflux/ConfluxSignMessageCIP23.d.ts.map +1 -1
  157. package/dist/api/conflux/ConfluxSignTransaction.d.ts +2 -0
  158. package/dist/api/conflux/ConfluxSignTransaction.d.ts.map +1 -1
  159. package/dist/api/cosmos/CosmosGetAddress.d.ts +1 -0
  160. package/dist/api/cosmos/CosmosGetAddress.d.ts.map +1 -1
  161. package/dist/api/cosmos/CosmosGetPublicKey.d.ts +1 -0
  162. package/dist/api/cosmos/CosmosGetPublicKey.d.ts.map +1 -1
  163. package/dist/api/cosmos/CosmosSignTransaction.d.ts +1 -0
  164. package/dist/api/cosmos/CosmosSignTransaction.d.ts.map +1 -1
  165. package/dist/api/device/DeviceCancel.d.ts +1 -0
  166. package/dist/api/device/DeviceCancel.d.ts.map +1 -1
  167. package/dist/api/device/DeviceChangePin.d.ts +1 -0
  168. package/dist/api/device/DeviceChangePin.d.ts.map +1 -1
  169. package/dist/api/device/DeviceFullyUploadResource.d.ts +1 -2
  170. package/dist/api/device/DeviceFullyUploadResource.d.ts.map +1 -1
  171. package/dist/api/device/DeviceLock.d.ts +1 -0
  172. package/dist/api/device/DeviceLock.d.ts.map +1 -1
  173. package/dist/api/device/DeviceRebootToBoardloader.d.ts +1 -0
  174. package/dist/api/device/DeviceRebootToBoardloader.d.ts.map +1 -1
  175. package/dist/api/device/DeviceRebootToBootloader.d.ts +1 -0
  176. package/dist/api/device/DeviceRebootToBootloader.d.ts.map +1 -1
  177. package/dist/api/device/DeviceSettings.d.ts +1 -0
  178. package/dist/api/device/DeviceSettings.d.ts.map +1 -1
  179. package/dist/api/device/DeviceSupportFeatures.d.ts +1 -0
  180. package/dist/api/device/DeviceSupportFeatures.d.ts.map +1 -1
  181. package/dist/api/device/DeviceUnlock.d.ts +1 -0
  182. package/dist/api/device/DeviceUnlock.d.ts.map +1 -1
  183. package/dist/api/device/DeviceUpdateBootloader.d.ts.map +1 -1
  184. package/dist/api/device/DeviceWipe.d.ts +1 -0
  185. package/dist/api/device/DeviceWipe.d.ts.map +1 -1
  186. package/dist/api/device/PreInitialize.d.ts +1 -0
  187. package/dist/api/device/PreInitialize.d.ts.map +1 -1
  188. package/dist/api/dynex/DnxGetAddress.d.ts.map +1 -1
  189. package/dist/api/dynex/DnxSignTransaction.d.ts.map +1 -1
  190. package/dist/api/evm/EVMGetAddress.d.ts +1 -0
  191. package/dist/api/evm/EVMGetAddress.d.ts.map +1 -1
  192. package/dist/api/evm/EVMGetPublicKey.d.ts +1 -0
  193. package/dist/api/evm/EVMGetPublicKey.d.ts.map +1 -1
  194. package/dist/api/evm/EVMSignMessage.d.ts +1 -0
  195. package/dist/api/evm/EVMSignMessage.d.ts.map +1 -1
  196. package/dist/api/evm/EVMSignMessageEIP712.d.ts.map +1 -1
  197. package/dist/api/evm/EVMSignTransaction.d.ts +1 -0
  198. package/dist/api/evm/EVMSignTransaction.d.ts.map +1 -1
  199. package/dist/api/evm/EVMSignTypedData.d.ts +1 -0
  200. package/dist/api/evm/EVMSignTypedData.d.ts.map +1 -1
  201. package/dist/api/evm/EVMVerifyMessage.d.ts +1 -0
  202. package/dist/api/evm/EVMVerifyMessage.d.ts.map +1 -1
  203. package/dist/api/evm/protocol.d.ts +3 -0
  204. package/dist/api/evm/protocol.d.ts.map +1 -0
  205. package/dist/api/filecoin/FilecoinGetAddress.d.ts +1 -0
  206. package/dist/api/filecoin/FilecoinGetAddress.d.ts.map +1 -1
  207. package/dist/api/filecoin/FilecoinSignTransaction.d.ts +1 -0
  208. package/dist/api/filecoin/FilecoinSignTransaction.d.ts.map +1 -1
  209. package/dist/api/firmware/FirmwareUpdateBaseMethod.d.ts +0 -1
  210. package/dist/api/firmware/FirmwareUpdateBaseMethod.d.ts.map +1 -1
  211. package/dist/api/firmware/getBinary.d.ts +8 -4
  212. package/dist/api/firmware/getBinary.d.ts.map +1 -1
  213. package/dist/api/firmware/uploadFirmware.d.ts.map +1 -1
  214. package/dist/api/helpers/filesystemValidation.d.ts +3 -0
  215. package/dist/api/helpers/filesystemValidation.d.ts.map +1 -1
  216. package/dist/api/helpers/paramsValidator.d.ts +1 -0
  217. package/dist/api/helpers/paramsValidator.d.ts.map +1 -1
  218. package/dist/api/helpers/protocolV2FileWrite.d.ts +35 -0
  219. package/dist/api/helpers/protocolV2FileWrite.d.ts.map +1 -0
  220. package/dist/api/index.d.ts +9 -25
  221. package/dist/api/index.d.ts.map +1 -1
  222. package/dist/api/kaspa/KaspaGetAddress.d.ts +4 -0
  223. package/dist/api/kaspa/KaspaGetAddress.d.ts.map +1 -1
  224. package/dist/api/kaspa/KaspaSignTransaction.d.ts +9 -1
  225. package/dist/api/kaspa/KaspaSignTransaction.d.ts.map +1 -1
  226. package/dist/api/kaspa/helpers/TransferSerialize.d.ts.map +1 -1
  227. package/dist/api/lightning/LnurlAuth.d.ts +0 -4
  228. package/dist/api/lightning/LnurlAuth.d.ts.map +1 -1
  229. package/dist/api/near/NearGetAddress.d.ts +1 -0
  230. package/dist/api/near/NearGetAddress.d.ts.map +1 -1
  231. package/dist/api/near/NearSignTransaction.d.ts +1 -0
  232. package/dist/api/near/NearSignTransaction.d.ts.map +1 -1
  233. package/dist/api/nem/NEMGetAddress.d.ts +1 -0
  234. package/dist/api/nem/NEMGetAddress.d.ts.map +1 -1
  235. package/dist/api/nem/NEMSignTransaction.d.ts +1 -0
  236. package/dist/api/nem/NEMSignTransaction.d.ts.map +1 -1
  237. package/dist/api/neo/NeoGetAddress.d.ts.map +1 -1
  238. package/dist/api/neo/NeoSignTransaction.d.ts.map +1 -1
  239. package/dist/api/nervos/NervosGetAddress.d.ts.map +1 -1
  240. package/dist/api/nervos/NervosSignTransaction.d.ts.map +1 -1
  241. package/dist/api/nexa/NexaGetAddress.d.ts.map +1 -1
  242. package/dist/api/nexa/NexaSignTransaction.d.ts +1 -0
  243. package/dist/api/nexa/NexaSignTransaction.d.ts.map +1 -1
  244. package/dist/api/nostr/NostrDecryptMessage.d.ts +1 -0
  245. package/dist/api/nostr/NostrDecryptMessage.d.ts.map +1 -1
  246. package/dist/api/nostr/NostrEncryptMessage.d.ts +1 -0
  247. package/dist/api/nostr/NostrEncryptMessage.d.ts.map +1 -1
  248. package/dist/api/nostr/NostrGetPublicKey.d.ts +1 -0
  249. package/dist/api/nostr/NostrGetPublicKey.d.ts.map +1 -1
  250. package/dist/api/nostr/NostrSignEvent.d.ts +1 -0
  251. package/dist/api/nostr/NostrSignEvent.d.ts.map +1 -1
  252. package/dist/api/nostr/NostrSignSchnorr.d.ts +1 -0
  253. package/dist/api/nostr/NostrSignSchnorr.d.ts.map +1 -1
  254. package/dist/api/polkadot/PolkadotGetAddress.d.ts +1 -0
  255. package/dist/api/polkadot/PolkadotGetAddress.d.ts.map +1 -1
  256. package/dist/api/polkadot/PolkadotSignTransaction.d.ts +1 -0
  257. package/dist/api/polkadot/PolkadotSignTransaction.d.ts.map +1 -1
  258. package/dist/api/protocol-v2/DeviceFactoryInfoGet.d.ts +1 -0
  259. package/dist/api/protocol-v2/DeviceFactoryInfoGet.d.ts.map +1 -1
  260. package/dist/api/protocol-v2/DeviceFactoryInfoSet.d.ts +1 -0
  261. package/dist/api/protocol-v2/DeviceFactoryInfoSet.d.ts.map +1 -1
  262. package/dist/api/protocol-v2/DeviceFirmwareUpdate.d.ts +1 -0
  263. package/dist/api/protocol-v2/DeviceFirmwareUpdate.d.ts.map +1 -1
  264. package/dist/api/protocol-v2/DeviceGetFirmwareUpdateStatus.d.ts +1 -0
  265. package/dist/api/protocol-v2/DeviceGetFirmwareUpdateStatus.d.ts.map +1 -1
  266. package/dist/api/protocol-v2/DeviceGetOnboardingStatus.d.ts +7 -0
  267. package/dist/api/protocol-v2/DeviceGetOnboardingStatus.d.ts.map +1 -0
  268. package/dist/api/protocol-v2/DeviceInfoGet.d.ts +1 -1
  269. package/dist/api/protocol-v2/DeviceInfoGet.d.ts.map +1 -1
  270. package/dist/api/protocol-v2/DeviceReboot.d.ts +1 -0
  271. package/dist/api/protocol-v2/DeviceReboot.d.ts.map +1 -1
  272. package/dist/api/protocol-v2/DeviceStatusGet.d.ts +7 -0
  273. package/dist/api/protocol-v2/DeviceStatusGet.d.ts.map +1 -0
  274. package/dist/api/protocol-v2/DeviceUploadNft.d.ts +31 -0
  275. package/dist/api/protocol-v2/DeviceUploadNft.d.ts.map +1 -0
  276. package/dist/api/protocol-v2/DeviceUploadWallpaper.d.ts +27 -0
  277. package/dist/api/protocol-v2/DeviceUploadWallpaper.d.ts.map +1 -0
  278. package/dist/api/protocol-v2/FilesystemFormat.d.ts +1 -0
  279. package/dist/api/protocol-v2/FilesystemFormat.d.ts.map +1 -1
  280. package/dist/api/protocol-v2/FilesystemPermissionFix.d.ts +1 -0
  281. package/dist/api/protocol-v2/FilesystemPermissionFix.d.ts.map +1 -1
  282. package/dist/api/protocol-v2/Ping.d.ts +3 -0
  283. package/dist/api/protocol-v2/Ping.d.ts.map +1 -1
  284. package/dist/api/protocol-v2/ProtocolInfoRequest.d.ts +1 -0
  285. package/dist/api/protocol-v2/ProtocolInfoRequest.d.ts.map +1 -1
  286. package/dist/api/protocol-v2/helpers.d.ts +1 -1
  287. package/dist/api/protocol-v2/helpers.d.ts.map +1 -1
  288. package/dist/api/scdo/ScdoGetAddress.d.ts.map +1 -1
  289. package/dist/api/scdo/ScdoSignMessage.d.ts.map +1 -1
  290. package/dist/api/scdo/ScdoSignTransaction.d.ts.map +1 -1
  291. package/dist/api/solana/SolGetAddress.d.ts +1 -0
  292. package/dist/api/solana/SolGetAddress.d.ts.map +1 -1
  293. package/dist/api/solana/SolSignMessage.d.ts +1 -0
  294. package/dist/api/solana/SolSignMessage.d.ts.map +1 -1
  295. package/dist/api/solana/SolSignOffchainMessage.d.ts +1 -0
  296. package/dist/api/solana/SolSignOffchainMessage.d.ts.map +1 -1
  297. package/dist/api/solana/SolSignTransaction.d.ts +1 -0
  298. package/dist/api/solana/SolSignTransaction.d.ts.map +1 -1
  299. package/dist/api/starcoin/StarcoinGetAddress.d.ts +1 -0
  300. package/dist/api/starcoin/StarcoinGetAddress.d.ts.map +1 -1
  301. package/dist/api/starcoin/StarcoinGetPublicKey.d.ts +1 -0
  302. package/dist/api/starcoin/StarcoinGetPublicKey.d.ts.map +1 -1
  303. package/dist/api/starcoin/StarcoinSignMessage.d.ts +1 -0
  304. package/dist/api/starcoin/StarcoinSignMessage.d.ts.map +1 -1
  305. package/dist/api/starcoin/StarcoinSignTransaction.d.ts +1 -0
  306. package/dist/api/starcoin/StarcoinSignTransaction.d.ts.map +1 -1
  307. package/dist/api/starcoin/StarcoinVerifyMessage.d.ts +1 -0
  308. package/dist/api/starcoin/StarcoinVerifyMessage.d.ts.map +1 -1
  309. package/dist/api/stellar/StellarGetAddress.d.ts +1 -2
  310. package/dist/api/stellar/StellarGetAddress.d.ts.map +1 -1
  311. package/dist/api/stellar/StellarSignTransaction.d.ts +1 -2
  312. package/dist/api/stellar/StellarSignTransaction.d.ts.map +1 -1
  313. package/dist/api/sui/SuiGetAddress.d.ts +1 -0
  314. package/dist/api/sui/SuiGetAddress.d.ts.map +1 -1
  315. package/dist/api/sui/SuiGetPublicKey.d.ts +1 -0
  316. package/dist/api/sui/SuiGetPublicKey.d.ts.map +1 -1
  317. package/dist/api/sui/SuiSignMessage.d.ts +1 -0
  318. package/dist/api/sui/SuiSignMessage.d.ts.map +1 -1
  319. package/dist/api/sui/SuiSignTransaction.d.ts +1 -0
  320. package/dist/api/sui/SuiSignTransaction.d.ts.map +1 -1
  321. package/dist/api/ton/TonGetAddress.d.ts +1 -0
  322. package/dist/api/ton/TonGetAddress.d.ts.map +1 -1
  323. package/dist/api/ton/TonSignData.d.ts +1 -0
  324. package/dist/api/ton/TonSignData.d.ts.map +1 -1
  325. package/dist/api/ton/TonSignMessage.d.ts +1 -0
  326. package/dist/api/ton/TonSignMessage.d.ts.map +1 -1
  327. package/dist/api/ton/TonSignProof.d.ts +1 -0
  328. package/dist/api/ton/TonSignProof.d.ts.map +1 -1
  329. package/dist/api/tron/TronGetAddress.d.ts +1 -0
  330. package/dist/api/tron/TronGetAddress.d.ts.map +1 -1
  331. package/dist/api/tron/TronSignMessage.d.ts +5 -0
  332. package/dist/api/tron/TronSignMessage.d.ts.map +1 -1
  333. package/dist/api/tron/TronSignTransaction.d.ts +1 -0
  334. package/dist/api/tron/TronSignTransaction.d.ts.map +1 -1
  335. package/dist/api/utils.d.ts +2 -1
  336. package/dist/api/utils.d.ts.map +1 -1
  337. package/dist/api/xrp/XrpGetAddress.d.ts +1 -0
  338. package/dist/api/xrp/XrpGetAddress.d.ts.map +1 -1
  339. package/dist/api/xrp/XrpSignTransaction.d.ts +1 -0
  340. package/dist/api/xrp/XrpSignTransaction.d.ts.map +1 -1
  341. package/dist/constants/index.d.ts +1 -1
  342. package/dist/constants/index.d.ts.map +1 -1
  343. package/dist/core/RequestQueue.d.ts.map +1 -1
  344. package/dist/core/deviceEventRegistration.d.ts +13 -0
  345. package/dist/core/deviceEventRegistration.d.ts.map +1 -0
  346. package/dist/core/index.d.ts +3 -1
  347. package/dist/core/index.d.ts.map +1 -1
  348. package/dist/core/uiPromiseRegistry.d.ts +4 -0
  349. package/dist/core/uiPromiseRegistry.d.ts.map +1 -0
  350. package/dist/data-manager/DataManager.d.ts +4 -1
  351. package/dist/data-manager/DataManager.d.ts.map +1 -1
  352. package/dist/data-manager/connectSettings.d.ts.map +1 -1
  353. package/dist/device/Device.d.ts +71 -17
  354. package/dist/device/Device.d.ts.map +1 -1
  355. package/dist/device/DeviceCommands.d.ts +8 -6
  356. package/dist/device/DeviceCommands.d.ts.map +1 -1
  357. package/dist/device/DeviceConnector.d.ts +1 -1
  358. package/dist/device/DeviceConnector.d.ts.map +1 -1
  359. package/dist/device/DeviceFeaturesState.d.ts +3 -0
  360. package/dist/device/DeviceFeaturesState.d.ts.map +1 -0
  361. package/dist/device/DevicePool.d.ts +5 -2
  362. package/dist/device/DevicePool.d.ts.map +1 -1
  363. package/dist/device/DeviceStateMapper.d.ts +13 -0
  364. package/dist/device/DeviceStateMapper.d.ts.map +1 -0
  365. package/dist/device/DeviceStateProjector.d.ts +7 -0
  366. package/dist/device/DeviceStateProjector.d.ts.map +1 -0
  367. package/dist/device/DeviceStateStore.d.ts +21 -0
  368. package/dist/device/DeviceStateStore.d.ts.map +1 -0
  369. package/dist/device/DeviceWalletSessionStore.d.ts +27 -0
  370. package/dist/device/DeviceWalletSessionStore.d.ts.map +1 -0
  371. package/dist/device/cloneDeviceState.d.ts +2 -0
  372. package/dist/device/cloneDeviceState.d.ts.map +1 -0
  373. package/dist/device/deviceIdentity.d.ts +5 -0
  374. package/dist/device/deviceIdentity.d.ts.map +1 -0
  375. package/dist/deviceProfile/buildDeviceFeatures.d.ts +9 -3
  376. package/dist/deviceProfile/buildDeviceFeatures.d.ts.map +1 -1
  377. package/dist/deviceProfile/index.d.ts +0 -1
  378. package/dist/deviceProfile/index.d.ts.map +1 -1
  379. package/dist/deviceProfile/protocolV2DeviceIdentity.d.ts +7 -0
  380. package/dist/deviceProfile/protocolV2DeviceIdentity.d.ts.map +1 -0
  381. package/dist/events/device.d.ts +16 -2
  382. package/dist/events/device.d.ts.map +1 -1
  383. package/dist/events/logBlockEvent.d.ts +2 -0
  384. package/dist/events/logBlockEvent.d.ts.map +1 -1
  385. package/dist/events/ui-promise.d.ts +4 -2
  386. package/dist/events/ui-promise.d.ts.map +1 -1
  387. package/dist/events/ui-request.d.ts +50 -4
  388. package/dist/events/ui-request.d.ts.map +1 -1
  389. package/dist/events/ui-response.d.ts +10 -2
  390. package/dist/events/ui-response.d.ts.map +1 -1
  391. package/dist/index.d.ts +1592 -794
  392. package/dist/index.js +8249 -3981
  393. package/dist/inject.d.ts +6 -1
  394. package/dist/inject.d.ts.map +1 -1
  395. package/dist/lowLevelInject.d.ts.map +1 -1
  396. package/dist/protocols/protocol-v2/deviceSession.d.ts +7 -0
  397. package/dist/protocols/protocol-v2/deviceSession.d.ts.map +1 -0
  398. package/dist/protocols/protocol-v2/features.d.ts +25 -17
  399. package/dist/protocols/protocol-v2/features.d.ts.map +1 -1
  400. package/dist/protocols/protocol-v2/index.d.ts +3 -2
  401. package/dist/protocols/protocol-v2/index.d.ts.map +1 -1
  402. package/dist/protocols/protocol-v2/resources.d.ts +30 -0
  403. package/dist/protocols/protocol-v2/resources.d.ts.map +1 -0
  404. package/dist/protocols/protocol-v2/settingsUnlockPolicy.d.ts +17 -0
  405. package/dist/protocols/protocol-v2/settingsUnlockPolicy.d.ts.map +1 -0
  406. package/dist/protocols/protocol-v2/uiInteraction.d.ts +42 -0
  407. package/dist/protocols/protocol-v2/uiInteraction.d.ts.map +1 -0
  408. package/dist/protocols/protocol-v2/unlockPolicy.d.ts +2 -0
  409. package/dist/protocols/protocol-v2/unlockPolicy.d.ts.map +1 -0
  410. package/dist/protocols/protocol-v2/unlockPolicyRunner.d.ts +22 -0
  411. package/dist/protocols/protocol-v2/unlockPolicyRunner.d.ts.map +1 -0
  412. package/dist/protocols/protocol-v2/walletSession.d.ts +25 -0
  413. package/dist/protocols/protocol-v2/walletSession.d.ts.map +1 -0
  414. package/dist/topLevelInject.d.ts.map +1 -1
  415. package/dist/types/api/checkAllFirmwareRelease.d.ts +26 -4
  416. package/dist/types/api/checkAllFirmwareRelease.d.ts.map +1 -1
  417. package/dist/types/api/detectDeviceConnectProtocol.d.ts +4 -0
  418. package/dist/types/api/detectDeviceConnectProtocol.d.ts.map +1 -0
  419. package/dist/types/api/deviceSettings.d.ts +11 -2
  420. package/dist/types/api/deviceSettings.d.ts.map +1 -1
  421. package/dist/types/api/deviceUnlock.d.ts +1 -1
  422. package/dist/types/api/deviceUnlock.d.ts.map +1 -1
  423. package/dist/types/api/export.d.ts +3 -2
  424. package/dist/types/api/export.d.ts.map +1 -1
  425. package/dist/types/api/firmwareUpdate.d.ts +7 -1
  426. package/dist/types/api/firmwareUpdate.d.ts.map +1 -1
  427. package/dist/types/api/getDeviceState.d.ts +12 -0
  428. package/dist/types/api/getDeviceState.d.ts.map +1 -0
  429. package/dist/types/api/getFeatures.d.ts.map +1 -1
  430. package/dist/types/api/getOnekeyFeatures.d.ts.map +1 -1
  431. package/dist/types/api/getPassphraseState.d.ts +2 -10
  432. package/dist/types/api/getPassphraseState.d.ts.map +1 -1
  433. package/dist/types/api/index.d.ts +23 -30
  434. package/dist/types/api/index.d.ts.map +1 -1
  435. package/dist/types/api/kaspaSignTransaction.d.ts +42 -4
  436. package/dist/types/api/kaspaSignTransaction.d.ts.map +1 -1
  437. package/dist/types/api/openWalletSession.d.ts +35 -0
  438. package/dist/types/api/openWalletSession.d.ts.map +1 -0
  439. package/dist/types/api/protocolV2.d.ts +18 -84
  440. package/dist/types/api/protocolV2.d.ts.map +1 -1
  441. package/dist/types/api/sessionCache.d.ts +13 -0
  442. package/dist/types/api/sessionCache.d.ts.map +1 -0
  443. package/dist/types/device.d.ts +132 -8
  444. package/dist/types/device.d.ts.map +1 -1
  445. package/dist/types/params.d.ts +1 -0
  446. package/dist/types/params.d.ts.map +1 -1
  447. package/dist/types/settings.d.ts +29 -14
  448. package/dist/types/settings.d.ts.map +1 -1
  449. package/dist/utils/assets.d.ts +2 -1
  450. package/dist/utils/assets.d.ts.map +1 -1
  451. package/dist/utils/deviceFeaturesCompat.d.ts +13 -0
  452. package/dist/utils/deviceFeaturesCompat.d.ts.map +1 -0
  453. package/dist/utils/deviceFeaturesUtils.d.ts +8 -3
  454. package/dist/utils/deviceFeaturesUtils.d.ts.map +1 -1
  455. package/dist/utils/deviceInfoUtils.d.ts +9 -9
  456. package/dist/utils/deviceInfoUtils.d.ts.map +1 -1
  457. package/dist/utils/deviceSettings.d.ts +38 -7
  458. package/dist/utils/deviceSettings.d.ts.map +1 -1
  459. package/dist/utils/deviceVersionUtils.d.ts +7 -5
  460. package/dist/utils/deviceVersionUtils.d.ts.map +1 -1
  461. package/dist/utils/homescreen.d.ts +4 -0
  462. package/dist/utils/homescreen.d.ts.map +1 -1
  463. package/dist/utils/index.d.ts +6 -3
  464. package/dist/utils/index.d.ts.map +1 -1
  465. package/dist/utils/networkUtils.d.ts +10 -1
  466. package/dist/utils/networkUtils.d.ts.map +1 -1
  467. package/dist/utils/patch.d.ts +1 -1
  468. package/dist/utils/patch.d.ts.map +1 -1
  469. package/dist/utils/pro2Nft.d.ts +31 -0
  470. package/dist/utils/pro2Nft.d.ts.map +1 -0
  471. package/dist/utils/pro2Wallpaper.d.ts +22 -0
  472. package/dist/utils/pro2Wallpaper.d.ts.map +1 -0
  473. package/dist/utils/tracing.d.ts.map +1 -1
  474. package/dist/utils/uiProgressThrottle.d.ts +3 -0
  475. package/dist/utils/uiProgressThrottle.d.ts.map +1 -0
  476. package/package.json +4 -4
  477. package/src/api/BaseMethod.ts +53 -20
  478. package/src/api/CheckAllFirmwareRelease.ts +329 -1
  479. package/src/api/CheckBootloaderRelease.ts +1 -2
  480. package/src/api/CheckFirmwareRelease.ts +1 -2
  481. package/src/api/CipherKeyValue.ts +4 -0
  482. package/src/api/ClearSessionCache.ts +32 -0
  483. package/src/api/DetectDeviceConnectProtocol.ts +18 -0
  484. package/src/api/DirList.ts +9 -4
  485. package/src/api/DirMake.ts +7 -4
  486. package/src/api/DirRemove.ts +7 -4
  487. package/src/api/FileDelete.ts +7 -4
  488. package/src/api/FileRead.ts +15 -9
  489. package/src/api/FileWrite.ts +26 -181
  490. package/src/api/FirmwareUpdate.ts +17 -14
  491. package/src/api/FirmwareUpdateV2.ts +137 -54
  492. package/src/api/FirmwareUpdateV3.ts +9 -13
  493. package/src/api/FirmwareUpdateV4.ts +660 -580
  494. package/src/api/GetDeviceState.ts +59 -0
  495. package/src/api/GetFeatures.ts +6 -4
  496. package/src/api/GetOnekeyFeatures.ts +1 -75
  497. package/src/api/GetPassphraseState.ts +36 -21
  498. package/src/api/OpenWalletSession.ts +251 -0
  499. package/src/api/PathInfo.ts +9 -4
  500. package/src/api/PromptWebDeviceAccess.ts +2 -7
  501. package/src/api/SearchDevices.ts +31 -4
  502. package/src/api/UploadPortfolio.ts +40 -0
  503. package/src/api/alephium/AlephiumGetAddress.ts +0 -4
  504. package/src/api/alephium/AlephiumSignMessage.ts +0 -4
  505. package/src/api/alephium/AlephiumSignTransaction.ts +2 -6
  506. package/src/api/algo/AlgoGetAddress.ts +4 -0
  507. package/src/api/algo/AlgoSignTransaction.ts +4 -0
  508. package/src/api/allnetwork/AllNetworkGetAddressBase.ts +41 -32
  509. package/src/api/aptos/AptosGetAddress.ts +4 -0
  510. package/src/api/aptos/AptosGetPublicKey.ts +4 -0
  511. package/src/api/aptos/AptosSignInMessage.ts +4 -0
  512. package/src/api/aptos/AptosSignMessage.ts +4 -0
  513. package/src/api/aptos/AptosSignTransaction.ts +4 -0
  514. package/src/api/benfen/BenfenGetAddress.ts +11 -7
  515. package/src/api/benfen/BenfenGetPublicKey.ts +0 -4
  516. package/src/api/benfen/BenfenSignMessage.ts +0 -4
  517. package/src/api/benfen/BenfenSignTransaction.ts +0 -4
  518. package/src/api/btc/BTCGetAddress.ts +8 -1
  519. package/src/api/btc/BTCGetPublicKey.ts +9 -2
  520. package/src/api/btc/BTCSignMessage.ts +8 -1
  521. package/src/api/btc/BTCSignPsbt.ts +4 -0
  522. package/src/api/btc/BTCSignTransaction.ts +8 -1
  523. package/src/api/btc/BTCVerifyMessage.ts +8 -1
  524. package/src/api/btc/helpers/versionLimit.ts +7 -4
  525. package/src/api/cardano/CardanoGetAddress.ts +4 -0
  526. package/src/api/cardano/CardanoGetPublicKey.ts +4 -0
  527. package/src/api/cardano/CardanoSignMessage.ts +5 -1
  528. package/src/api/cardano/CardanoSignTransaction.ts +5 -1
  529. package/src/api/conflux/ConfluxGetAddress.ts +6 -0
  530. package/src/api/conflux/ConfluxSignMessage.ts +6 -0
  531. package/src/api/conflux/ConfluxSignMessageCIP23.ts +6 -0
  532. package/src/api/conflux/ConfluxSignTransaction.ts +8 -5
  533. package/src/api/cosmos/CosmosGetAddress.ts +4 -0
  534. package/src/api/cosmos/CosmosGetPublicKey.ts +4 -0
  535. package/src/api/cosmos/CosmosSignTransaction.ts +4 -0
  536. package/src/api/device/DeviceCancel.ts +5 -0
  537. package/src/api/device/DeviceChangePin.ts +28 -0
  538. package/src/api/device/DeviceFullyUploadResource.ts +4 -5
  539. package/src/api/device/DeviceLock.ts +5 -0
  540. package/src/api/device/DeviceRebootToBoardloader.ts +5 -0
  541. package/src/api/device/DeviceRebootToBootloader.ts +5 -0
  542. package/src/api/device/DeviceSettings.ts +194 -1
  543. package/src/api/device/DeviceSupportFeatures.ts +4 -0
  544. package/src/api/device/DeviceUnlock.ts +14 -1
  545. package/src/api/device/DeviceUpdateBootloader.ts +1 -2
  546. package/src/api/device/DeviceWipe.ts +25 -0
  547. package/src/api/device/PreInitialize.ts +4 -0
  548. package/src/api/dynex/DnxGetAddress.ts +0 -6
  549. package/src/api/dynex/DnxSignTransaction.ts +0 -6
  550. package/src/api/evm/EVMGetAddress.ts +6 -2
  551. package/src/api/evm/EVMGetPublicKey.ts +6 -2
  552. package/src/api/evm/EVMSignMessage.ts +6 -2
  553. package/src/api/evm/EVMSignMessageEIP712.ts +1 -11
  554. package/src/api/evm/EVMSignTransaction.ts +6 -2
  555. package/src/api/evm/EVMSignTypedData.ts +42 -50
  556. package/src/api/evm/EVMVerifyMessage.ts +6 -2
  557. package/src/api/evm/legacyV1/getAddress.ts +2 -2
  558. package/src/api/evm/legacyV1/getPublicKey.ts +2 -2
  559. package/src/api/evm/legacyV1/signMessage.ts +2 -2
  560. package/src/api/evm/legacyV1/signTypedData.ts +2 -2
  561. package/src/api/evm/legacyV1/signTypedHash.ts +2 -2
  562. package/src/api/evm/legacyV1/verifyMessage.ts +2 -2
  563. package/src/api/evm/protocol.ts +6 -0
  564. package/src/api/filecoin/FilecoinGetAddress.ts +4 -0
  565. package/src/api/filecoin/FilecoinSignTransaction.ts +4 -0
  566. package/src/api/firmware/FirmwareUpdateBaseMethod.ts +18 -14
  567. package/src/api/firmware/getBinary.ts +8 -3
  568. package/src/api/firmware/uploadFirmware.ts +17 -4
  569. package/src/api/helpers/batchGetPublickeys.ts +2 -2
  570. package/src/api/helpers/filesystemValidation.ts +61 -0
  571. package/src/api/helpers/paramsValidator.ts +1 -1
  572. package/src/api/helpers/protocolV2FileWrite.ts +206 -0
  573. package/src/api/index.ts +10 -26
  574. package/src/api/kaspa/KaspaGetAddress.ts +7 -0
  575. package/src/api/kaspa/KaspaSignTransaction.ts +380 -29
  576. package/src/api/kaspa/helpers/TransferSerialize.ts +17 -7
  577. package/src/api/lightning/LnurlAuth.ts +0 -4
  578. package/src/api/near/NearGetAddress.ts +4 -0
  579. package/src/api/near/NearSignTransaction.ts +4 -0
  580. package/src/api/nem/NEMGetAddress.ts +4 -0
  581. package/src/api/nem/NEMSignTransaction.ts +4 -0
  582. package/src/api/neo/NeoGetAddress.ts +0 -4
  583. package/src/api/neo/NeoSignTransaction.ts +0 -4
  584. package/src/api/nervos/NervosGetAddress.ts +0 -4
  585. package/src/api/nervos/NervosSignTransaction.ts +2 -6
  586. package/src/api/nexa/NexaGetAddress.ts +0 -4
  587. package/src/api/nexa/NexaSignTransaction.ts +3 -5
  588. package/src/api/nostr/NostrDecryptMessage.ts +4 -0
  589. package/src/api/nostr/NostrEncryptMessage.ts +4 -0
  590. package/src/api/nostr/NostrGetPublicKey.ts +4 -0
  591. package/src/api/nostr/NostrSignEvent.ts +4 -0
  592. package/src/api/nostr/NostrSignSchnorr.ts +4 -0
  593. package/src/api/polkadot/PolkadotGetAddress.ts +4 -0
  594. package/src/api/polkadot/PolkadotSignTransaction.ts +4 -0
  595. package/src/api/protocol-v2/DeviceFactoryInfoGet.ts +5 -2
  596. package/src/api/protocol-v2/DeviceFactoryInfoSet.ts +5 -2
  597. package/src/api/protocol-v2/DeviceFirmwareUpdate.ts +8 -5
  598. package/src/api/protocol-v2/DeviceGetFirmwareUpdateStatus.ts +10 -6
  599. package/src/api/protocol-v2/DeviceGetOnboardingStatus.ts +21 -0
  600. package/src/api/protocol-v2/DeviceInfoGet.ts +8 -15
  601. package/src/api/protocol-v2/DeviceReboot.ts +7 -3
  602. package/src/api/protocol-v2/DeviceStatusGet.ts +19 -0
  603. package/src/api/protocol-v2/DeviceUploadNft.ts +189 -0
  604. package/src/api/protocol-v2/DeviceUploadWallpaper.ts +134 -0
  605. package/src/api/protocol-v2/FilesystemFormat.ts +9 -3
  606. package/src/api/protocol-v2/FilesystemPermissionFix.ts +5 -2
  607. package/src/api/protocol-v2/Ping.ts +37 -3
  608. package/src/api/protocol-v2/ProtocolInfoRequest.ts +8 -3
  609. package/src/api/protocol-v2/helpers.ts +17 -17
  610. package/src/api/scdo/ScdoGetAddress.ts +0 -4
  611. package/src/api/scdo/ScdoSignMessage.ts +0 -4
  612. package/src/api/scdo/ScdoSignTransaction.ts +0 -4
  613. package/src/api/solana/SolGetAddress.ts +4 -0
  614. package/src/api/solana/SolSignMessage.ts +4 -0
  615. package/src/api/solana/SolSignOffchainMessage.ts +4 -0
  616. package/src/api/solana/SolSignTransaction.ts +4 -0
  617. package/src/api/starcoin/StarcoinGetAddress.ts +4 -0
  618. package/src/api/starcoin/StarcoinGetPublicKey.ts +4 -0
  619. package/src/api/starcoin/StarcoinSignMessage.ts +4 -0
  620. package/src/api/starcoin/StarcoinSignTransaction.ts +4 -0
  621. package/src/api/starcoin/StarcoinVerifyMessage.ts +4 -0
  622. package/src/api/stellar/StellarGetAddress.ts +1 -10
  623. package/src/api/stellar/StellarSignTransaction.ts +1 -14
  624. package/src/api/sui/SuiGetAddress.ts +4 -0
  625. package/src/api/sui/SuiGetPublicKey.ts +4 -0
  626. package/src/api/sui/SuiSignMessage.ts +4 -0
  627. package/src/api/sui/SuiSignTransaction.ts +4 -0
  628. package/src/api/ton/TonGetAddress.ts +4 -0
  629. package/src/api/ton/TonSignData.ts +5 -1
  630. package/src/api/ton/TonSignMessage.ts +4 -0
  631. package/src/api/ton/TonSignProof.ts +4 -0
  632. package/src/api/tron/TronGetAddress.ts +4 -0
  633. package/src/api/tron/TronSignMessage.ts +18 -7
  634. package/src/api/tron/TronSignTransaction.ts +4 -0
  635. package/src/api/utils.ts +7 -3
  636. package/src/api/xrp/XrpGetAddress.ts +4 -0
  637. package/src/api/xrp/XrpSignTransaction.ts +5 -1
  638. package/src/constants/index.ts +1 -4
  639. package/src/core/RequestQueue.ts +1 -0
  640. package/src/core/deviceEventRegistration.ts +27 -0
  641. package/src/core/index.ts +319 -124
  642. package/src/core/uiPromiseRegistry.ts +41 -0
  643. package/src/data/messages/messages-protocol-v2.json +1138 -441
  644. package/src/data/messages/messages.json +286 -1
  645. package/src/data-manager/DataManager.ts +42 -13
  646. package/src/data-manager/TransportManager.ts +1 -1
  647. package/src/data-manager/connectSettings.ts +4 -0
  648. package/src/device/Device.ts +878 -292
  649. package/src/device/DeviceCommands.ts +166 -158
  650. package/src/device/DeviceConnector.ts +10 -7
  651. package/src/device/DeviceFeaturesState.ts +25 -0
  652. package/src/device/DevicePool.ts +72 -17
  653. package/src/device/DeviceStateMapper.ts +374 -0
  654. package/src/device/DeviceStateProjector.ts +94 -0
  655. package/src/device/DeviceStateStore.ts +201 -0
  656. package/src/device/DeviceWalletSessionStore.ts +144 -0
  657. package/src/device/cloneDeviceState.ts +39 -0
  658. package/src/device/deviceIdentity.ts +18 -0
  659. package/src/deviceProfile/buildDeviceFeatures.ts +224 -190
  660. package/src/deviceProfile/index.ts +0 -1
  661. package/src/deviceProfile/protocolV2DeviceIdentity.ts +32 -0
  662. package/src/events/device.ts +22 -1
  663. package/src/events/logBlockEvent.ts +80 -2
  664. package/src/events/ui-promise.ts +4 -2
  665. package/src/events/ui-request.ts +61 -4
  666. package/src/events/ui-response.ts +12 -2
  667. package/src/inject.ts +73 -43
  668. package/src/lowLevelInject.ts +6 -3
  669. package/src/protocols/protocol-v2/deviceSession.ts +24 -0
  670. package/src/protocols/protocol-v2/features.ts +103 -32
  671. package/src/protocols/protocol-v2/firmware.ts +1 -1
  672. package/src/protocols/protocol-v2/index.ts +8 -1
  673. package/src/protocols/protocol-v2/resources.ts +359 -0
  674. package/src/protocols/protocol-v2/settingsUnlockPolicy.ts +65 -0
  675. package/src/protocols/protocol-v2/uiInteraction.ts +250 -0
  676. package/src/protocols/protocol-v2/unlockPolicy.ts +1 -0
  677. package/src/protocols/protocol-v2/unlockPolicyRunner.ts +124 -0
  678. package/src/protocols/protocol-v2/walletSession.ts +424 -0
  679. package/src/topLevelInject.ts +6 -3
  680. package/src/types/api/checkAllFirmwareRelease.ts +47 -4
  681. package/src/types/api/detectDeviceConnectProtocol.ts +7 -0
  682. package/src/types/api/deviceSettings.ts +26 -2
  683. package/src/types/api/deviceUnlock.ts +1 -1
  684. package/src/types/api/export.ts +8 -0
  685. package/src/types/api/firmwareUpdate.ts +26 -5
  686. package/src/types/api/getDeviceState.ts +19 -0
  687. package/src/types/api/getFeatures.ts +3 -0
  688. package/src/types/api/getOnekeyFeatures.ts +3 -0
  689. package/src/types/api/getPassphraseState.ts +9 -11
  690. package/src/types/api/index.ts +38 -64
  691. package/src/types/api/kaspaSignTransaction.ts +60 -4
  692. package/src/types/api/openWalletSession.ts +54 -0
  693. package/src/types/api/protocolV2.ts +33 -141
  694. package/src/types/api/sessionCache.ts +19 -0
  695. package/src/types/device.ts +185 -7
  696. package/src/types/params.ts +9 -2
  697. package/src/types/settings.ts +59 -16
  698. package/src/utils/assets.ts +4 -1
  699. package/src/utils/deviceFeaturesCompat.ts +180 -0
  700. package/src/utils/deviceFeaturesUtils.ts +56 -45
  701. package/src/utils/deviceInfoUtils.ts +27 -69
  702. package/src/utils/deviceSettings.ts +171 -39
  703. package/src/utils/deviceVersionUtils.ts +25 -44
  704. package/src/utils/findDefectiveBatchDevice.ts +3 -3
  705. package/src/utils/homescreen.ts +36 -0
  706. package/src/utils/index.ts +27 -3
  707. package/src/utils/networkUtils.ts +274 -16
  708. package/src/utils/pro2Nft.ts +142 -0
  709. package/src/utils/pro2Wallpaper.ts +130 -0
  710. package/src/utils/tracing.ts +3 -1
  711. package/src/utils/uiProgressThrottle.ts +63 -0
  712. package/tsconfig.type-tests.json +12 -0
  713. package/dist/api/GetDeviceInfo.d.ts +0 -9
  714. package/dist/api/GetDeviceInfo.d.ts.map +0 -1
  715. package/dist/api/firmware/progressThrottle.d.ts +0 -3
  716. package/dist/api/firmware/progressThrottle.d.ts.map +0 -1
  717. package/dist/api/protocol-v2/FilesystemDiskControl.d.ts +0 -13
  718. package/dist/api/protocol-v2/FilesystemDiskControl.d.ts.map +0 -1
  719. package/dist/deviceProfile/buildDeviceProfile.d.ts +0 -21
  720. package/dist/deviceProfile/buildDeviceProfile.d.ts.map +0 -1
  721. package/dist/types/api/getDeviceInfo.d.ts +0 -87
  722. package/dist/types/api/getDeviceInfo.d.ts.map +0 -1
  723. package/src/api/GetDeviceInfo.ts +0 -145
  724. package/src/api/firmware/progressThrottle.ts +0 -44
  725. package/src/api/protocol-v2/FilesystemDiskControl.ts +0 -50
  726. package/src/deviceProfile/buildDeviceProfile.ts +0 -352
  727. package/src/types/api/getDeviceInfo.ts +0 -101
package/dist/index.d.ts CHANGED
@@ -1,25 +1,71 @@
1
1
  import EventEmitter, { EventEmitter as EventEmitter$1 } from 'events';
2
- import { DeviceFirmwareTargetType, DeviceFirmwareUpdateRecordFields, DeviceRebootType, DeviceFirmwareTarget, Messages, Transport, TransportCallOptions, OneKeyDeviceInfo, ProtocolV2DeviceInfo, Success as Success$1, LowlevelTransportSharedPlugin, ProtocolInfo, DeviceFirmwareUpdateStatus, DeviceFactoryInfo, OneKeyDeviceCommType, Features as Features$1, ProtocolType, RecoveryDeviceType, SafetyCheckLevel, ResourceType, NextU2FCounter, SetU2FCounter, CipheredKeyValue as CipheredKeyValue$1, UintType, EthereumPublicKey, EthereumMessageSignature, Address, MultisigRedeemScriptType, InputScriptType, PublicKey, MessageSignature, SignedPsbt, PrevInput, TxOutputBinType, TxInput, TxOutputType, TxInputType, StarcoinAddress as StarcoinAddress$1, StarcoinPublicKey as StarcoinPublicKey$1, StarcoinMessageSignature, StarcoinSignedTx, NEMAddress as NEMAddress$1, NEMSignedTx, SolanaAddress as SolanaAddress$1, SolanaSignedTx as SolanaSignedTx$1, SolanaTxExtraInfo, SolanaOffChainMessageVersion, SolanaOffChainMessageFormat, StellarAddress as StellarAddress$1, StellarSignedTx, TronAddress as TronAddress$1, TronResourceCode, TronSignedTx, TronMessageSignature, ConfluxAddress as ConfluxAddress$1, ConfluxMessageSignature, NearAddress as NearAddress$1, NearSignedTx, AptosAddress as AptosAddress$1, AptosMessageSignature as AptosMessageSignature$1, AptosSignedTx as AptosSignedTx$1, AlgorandAddress, AlgorandSignedTx, CosmosAddress as CosmosAddress$1, CosmosSignedTx as CosmosSignedTx$1, SuiAddress as SuiAddress$1, SuiMessageSignature, CardanoAddressParametersType, CardanoMessageSignature, FilecoinAddress as FilecoinAddress$1, FilecoinSignedTx as FilecoinSignedTx$1, PolkadotAddress as PolkadotAddress$1, PolkadotSignedTx as PolkadotSignedTx$1, KaspaAddress as KaspaAddress$1, NervosAddress as NervosAddress$1, NervosSignedTx as NervosSignedTx$1, DnxAddress as DnxAddress$1, TonWalletVersion, TonWorkChain, TonSignedMessage, TonSignedProof, TonSignDataType, TonSignedData, ScdoAddress as ScdoAddress$1, ScdoSignedMessage, ScdoSignedTx as ScdoSignedTx$1, AlephiumMessageSignature, AlephiumSignedTx as AlephiumSignedTx$1, BenfenAddress as BenfenAddress$1, BenfenMessageSignature, ChangeOutputScriptType } from '@onekeyfe/hd-transport';
2
+ import * as _onekeyfe_hd_transport from '@onekeyfe/hd-transport';
3
+ import { DeviceRebootType, Messages, Transport, TransportCallOptions, OneKeyDeviceCommType, ProtocolInfo, ProtocolV2DeviceInfo, DeviceStatus as DeviceStatus$1, Enum_SafetyCheckLevel, OneKeyDeviceInfo, Success as Success$1, DeviceSessionPinType, LowlevelTransportSharedPlugin, OnboardingStatus, RecoveryDeviceType, ResourceType, NextU2FCounter, SetU2FCounter, CipheredKeyValue as CipheredKeyValue$1, UintType, EthereumPublicKey, EthereumMessageSignature, Address, MultisigRedeemScriptType, InputScriptType, PublicKey, MessageSignature, SignedPsbt, PrevInput, TxOutputBinType, TxInput, TxOutputType, TxInputType, StarcoinAddress as StarcoinAddress$1, StarcoinPublicKey as StarcoinPublicKey$1, StarcoinMessageSignature, StarcoinSignedTx, NEMAddress as NEMAddress$1, NEMSignedTx, SolanaAddress as SolanaAddress$1, SolanaSignedTx as SolanaSignedTx$1, SolanaTxExtraInfo, SolanaOffChainMessageVersion, SolanaOffChainMessageFormat, StellarAddress as StellarAddress$1, StellarSignedTx, TronAddress as TronAddress$1, TronResourceCode, TronSignedTx, TronMessageSignature, ConfluxAddress as ConfluxAddress$1, ConfluxMessageSignature, NearAddress as NearAddress$1, NearSignedTx, AptosAddress as AptosAddress$1, AptosMessageSignature as AptosMessageSignature$1, AptosSignedTx as AptosSignedTx$1, AlgorandAddress, AlgorandSignedTx, CosmosAddress as CosmosAddress$1, CosmosSignedTx as CosmosSignedTx$1, SuiAddress as SuiAddress$1, SuiMessageSignature, CardanoAddressParametersType, CardanoMessageSignature, FilecoinAddress as FilecoinAddress$1, FilecoinSignedTx as FilecoinSignedTx$1, PolkadotAddress as PolkadotAddress$1, PolkadotSignedTx as PolkadotSignedTx$1, KaspaAddress as KaspaAddress$1, NervosAddress as NervosAddress$1, NervosSignedTx as NervosSignedTx$1, DnxAddress as DnxAddress$1, TonWalletVersion, TonWorkChain, TonSignedMessage, TonSignedProof, TonSignDataType, TonSignedData, ScdoAddress as ScdoAddress$1, ScdoSignedMessage, ScdoSignedTx as ScdoSignedTx$1, AlephiumMessageSignature, AlephiumSignedTx as AlephiumSignedTx$1, BenfenAddress as BenfenAddress$1, BenfenMessageSignature, SafetyCheckLevel, ChangeOutputScriptType } from '@onekeyfe/hd-transport';
3
4
  export { Success as DeviceSuccess, HDNodeType, Messages as PROTO, ResourceType, TonSignDataType, TonWalletVersion } from '@onekeyfe/hd-transport';
4
5
  import * as _onekeyfe_hd_shared from '@onekeyfe/hd-shared';
5
- import { HardwareConnectProtocol, Deferred, EFirmwareType, EDeviceType } from '@onekeyfe/hd-shared';
6
+ import { HardwareConnectProtocol, EFirmwareType, EDeviceType, Deferred } from '@onekeyfe/hd-shared';
6
7
 
7
8
  interface CommonParams {
8
9
  keepSession?: boolean;
10
+ /**
11
+ * polling connect max retry count
12
+ */
9
13
  retryCount?: number;
14
+ /**
15
+ * polling interval time
16
+ */
10
17
  pollIntervalTime?: number;
18
+ /**
19
+ * Timeout time for single polling
20
+ */
11
21
  timeout?: number;
22
+ /**
23
+ * DeviceInfoGet timeout during Protocol V2 initialization.
24
+ */
12
25
  protocolV2DeviceInfoTimeoutMs?: number;
26
+ /**
27
+ * passphrase state
28
+ */
13
29
  passphraseState?: string;
30
+ /**
31
+ * Use empty passphrase
32
+ */
14
33
  useEmptyPassphrase?: boolean;
34
+ /**
35
+ * Every init session
36
+ */
15
37
  initSession?: boolean;
38
+ /**
39
+ * Use derive cardano
40
+ */
16
41
  deriveCardano?: boolean;
17
42
  detectBootloaderDevice?: boolean;
43
+ /**
44
+ * Skip web device prompt
45
+ */
18
46
  skipWebDevicePrompt?: boolean;
47
+ /**
48
+ * Skip passphrase check
49
+ */
19
50
  skipPassphraseCheck?: boolean;
51
+ /**
52
+ * Only connect device, not initialize device, only ble connect
53
+ */
20
54
  onlyConnectBleDevice?: boolean;
55
+ /**
56
+ * Use pre-initialized device state (BLE only)
57
+ */
21
58
  usePreInitialize?: boolean;
59
+ /**
60
+ * Strictly expected transport protocol. The SDK actively verifies this value and
61
+ * rejects a mismatch. After a successful probe, the cached protocol is also strict.
62
+ */
22
63
  connectProtocol?: HardwareConnectProtocol;
64
+ /**
65
+ * Ignore a previously bound protocol for this call and actively detect the
66
+ * protocol again. Intended for the first verified connection or explicit recovery.
67
+ */
68
+ forceProtocolDetection?: boolean;
23
69
  }
24
70
  type Params<T> = CommonParams & T & {
25
71
  bundle?: undefined;
@@ -44,34 +90,6 @@ type DeviceRebootParams = {
44
90
  rebootType?: RebootTypeInput;
45
91
  reboot_type?: RebootTypeInput;
46
92
  };
47
- type DeviceFirmwareTargetInput = DeviceFirmwareTarget | {
48
- targetId?: DeviceFirmwareTargetType | string | number;
49
- target_id?: DeviceFirmwareTargetType | string | number;
50
- path: string;
51
- };
52
- type DeviceFirmwareUpdateParams = {
53
- targets?: DeviceFirmwareTargetInput[];
54
- targetId?: DeviceFirmwareTargetType | string | number;
55
- target_id?: DeviceFirmwareTargetType | string | number;
56
- path?: string;
57
- };
58
- type DeviceFirmwareUpdateStatusGetParams = {
59
- fields?: DeviceFirmwareUpdateRecordFields;
60
- };
61
- type DeviceFactoryInfoSetParams = {
62
- version?: number;
63
- serial_number?: string;
64
- burn_in_completed?: boolean;
65
- factory_test_completed?: boolean;
66
- manufacture_time?: {
67
- year: number;
68
- month: number;
69
- day: number;
70
- hour: number;
71
- minute: number;
72
- second: number;
73
- };
74
- };
75
93
 
76
94
  type PassphrasePromptResponse = {
77
95
  passphrase?: string;
@@ -89,15 +107,19 @@ type TypedCallResponseMap = {
89
107
  [K in MessageKey]: TypedResponseMessage<K>;
90
108
  };
91
109
  type DefaultMessageResponse = TypedCallResponseMap[MessageKey];
110
+ /**
111
+ * The life cycle begins with the acquisition of the device and ends with the disposal device commands
112
+ * acquire device -> create DeviceCommands -> release device -> dispose DeviceCommands
113
+ */
92
114
  declare class DeviceCommands {
93
115
  instanceId: string;
94
116
  currentResponseID?: number;
95
- device: Device$1;
117
+ device: Device;
96
118
  transport: Transport;
97
119
  mainId: string;
98
120
  disposed: boolean;
99
121
  callPromise?: Promise<DefaultMessageResponse>;
100
- constructor(device: Device$1, mainId: string);
122
+ constructor(device: Device, mainId: string);
101
123
  dispose(_cancelRequest: boolean): Promise<void>;
102
124
  checkDisposed(): void;
103
125
  cancelDeviceOnOneKeyDevice(): Promise<{
@@ -114,7 +136,7 @@ declare class DeviceCommands {
114
136
  };
115
137
  } | {
116
138
  success: boolean;
117
- error: 0 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 200 | 300 | 301 | 302 | 303 | 304 | 305 | 400 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 500 | 600 | 601 | 602 | 603 | 700 | 701 | 702 | 703 | 704 | 705 | 706 | 707 | 708 | 709 | 710 | 711 | 712 | 713 | 714 | 715 | 716 | 717 | 718 | 719 | 720 | 721 | 722 | 800 | 801 | 802 | 803 | 804 | 805 | 806 | 807 | 808 | 809 | 810 | 811 | 812 | 813 | 814 | 815 | 816 | 817 | 818 | 819 | 820 | 821 | 822 | 823 | 824 | 825 | 826 | 827 | 828 | 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 | 829 | 830 | 831 | 832 | 900 | 901 | 902;
118
140
  payload: {
119
141
  message: string;
120
142
  };
@@ -133,7 +155,7 @@ declare class DeviceCommands {
133
155
  };
134
156
  } | {
135
157
  success: boolean;
136
- error: 0 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 200 | 300 | 301 | 302 | 303 | 304 | 305 | 400 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 500 | 600 | 601 | 602 | 603 | 700 | 701 | 702 | 703 | 704 | 705 | 706 | 707 | 708 | 709 | 710 | 711 | 712 | 713 | 714 | 715 | 716 | 717 | 718 | 719 | 720 | 721 | 722 | 800 | 801 | 802 | 803 | 804 | 805 | 806 | 807 | 808 | 809 | 810 | 811 | 812 | 813 | 814 | 815 | 816 | 817 | 818 | 819 | 820 | 821 | 822 | 823 | 824 | 825 | 826 | 827 | 828 | 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 | 829 | 830 | 831 | 832 | 900 | 901 | 902;
137
159
  payload: {
138
160
  message: string;
139
161
  };
@@ -145,389 +167,207 @@ declare class DeviceCommands {
145
167
  _commonCall(type: MessageKey, msg?: DefaultMessageResponse['message'], options?: TransportCallOptions): Promise<DefaultMessageResponse>;
146
168
  _filterCommonTypes(res: DefaultMessageResponse, callType: MessageKey, options?: TransportCallOptions): Promise<DefaultMessageResponse>;
147
169
  _promptPin(type?: Messages.PinMatrixRequestType): Promise<string>;
148
- _promptPassphrase(options: PassphraseRequestPayload): Promise<PassphrasePromptResponse>;
170
+ promptPassphrase(options: PassphraseRequestPayload, promptOptions?: {
171
+ cancelDeviceOnReject?: boolean;
172
+ }): Promise<PassphrasePromptResponse>;
149
173
  }
150
174
 
151
- type DeviceDescriptorDiff = {
152
- didUpdate: boolean;
153
- connected: OneKeyDeviceInfo[];
154
- disconnected: OneKeyDeviceInfo[];
155
- changedSessions: OneKeyDeviceInfo[];
156
- changedDebugSessions: OneKeyDeviceInfo[];
157
- acquired: OneKeyDeviceInfo[];
158
- debugAcquired: OneKeyDeviceInfo[];
159
- released: OneKeyDeviceInfo[];
160
- debugReleased: OneKeyDeviceInfo[];
161
- descriptors: OneKeyDeviceInfo[];
175
+ type ProtocolV2RuntimeMode = 'normal' | 'bootloader' | 'romloader';
176
+
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
+ fetchConfig?: boolean;
196
+ extension?: string;
197
+ configFetcher?: (url: string) => Promise<RemoteConfigResponse | null>;
198
+ };
199
+ type IVersionArray = [number, number, number];
200
+ type ILocale = 'zh-CN' | 'en-US';
201
+ type IProtocolV2FirmwareComponentTarget = 'ROMLOADER' | 'BOOTLOADER' | 'APPLICATION_P1' | 'APPLICATION_P2' | 'COPROCESSOR' | 'SE01' | 'SE02' | 'SE03' | 'SE04';
202
+ type IProtocolV2FirmwareComponent = {
203
+ target: IProtocolV2FirmwareComponentTarget;
204
+ url: string;
205
+ /** SHA-256 of the complete okpkg, used after downloading the package. */
206
+ fingerprint?: string;
207
+ /** OKPP payload hash, used to detect same-version package changes. */
208
+ payloadHash?: string;
209
+ version?: IVersionArray;
210
+ };
211
+ type IProtocolV2ResourceType = 'images' | 'animation' | 'wallpaper' | 'translations' | 'roobert' | 'noto';
212
+ /** Pro2 RES package descriptor. Hashes identify content without a human-managed version. */
213
+ type IProtocolV2Resource = {
214
+ type: IProtocolV2ResourceType;
215
+ url: string;
216
+ /** Complete okpkg file size in bytes. */
217
+ size: number;
218
+ /** SHA-256 of the complete okpkg file. */
219
+ fileHash: string;
220
+ /** SHA3-512 header_hash from the signed okpkg header. */
221
+ headerHash: string;
222
+ };
223
+ /** Optional Pro2 startup-resource CRATE installed by the bootloader updater. */
224
+ type IProtocolV2BootResources = {
225
+ required: false;
226
+ target: 'CRATE';
227
+ url: string;
228
+ /** Complete CRATE file size in bytes. */
229
+ size: number;
230
+ /** SHA-256 of the complete CRATE file. */
231
+ fileHash: string;
232
+ /** SHA3-512 payload_hash from the signed CRATE header. */
233
+ payloadHash: string;
234
+ /** SHA3-512 header_hash from the signed CRATE header. */
235
+ headerHash: string;
236
+ };
237
+ type IProtocolV2Resources = {
238
+ stable: IProtocolV2Resource[];
239
+ boot?: IProtocolV2BootResources;
240
+ };
241
+ /** Pro2 RESC bundle okpkg descriptor for incremental FileWrite synchronization. */
242
+ type IProtocolV2ResourceBundle = {
243
+ /** Bundle name, such as images, animation, translations, or fonts_roobert. */
244
+ name: string;
245
+ /** Download URL. */
246
+ url: string;
247
+ /** Device target path, such as vol0:/bundles/images/images.okpkg. */
248
+ devicePath: string;
249
+ /** okpkg payload_version used to skip matching content after FileRead. */
250
+ version?: IVersionArray;
251
+ /** okpkg payload_hash used for SHA3-512 comparison after FileRead. */
252
+ payloadHash?: string;
253
+ /** okpkg header_hash used for SHA3-512 comparison after FileRead. */
254
+ headerHash?: string;
255
+ };
256
+ /** STM32 firmware config */
257
+ type IFirmwareReleaseInfo = {
258
+ required: boolean;
259
+ url: string;
260
+ /**
261
+ * Firmware type (bitcoinonly or universal)
262
+ * This field is not present in the remote config, but will be inferred from the firmware field name
263
+ */
264
+ firmwareType?: EFirmwareType;
265
+ /** Firmware UI resource */
266
+ resource?: string;
267
+ /** Firmware full UI resource */
268
+ fullResource?: string;
269
+ fullResourceRange?: string[];
270
+ bootloaderResource?: string;
271
+ bootloaderVersion?: IVersionArray;
272
+ displayBootloaderVersion?: IVersionArray;
273
+ bootloaderRelatedFirmwareVersion?: IVersionArray;
274
+ upgradeType?: 'payload-package-set' | string;
275
+ components?: Record<string, IProtocolV2FirmwareComponent>;
276
+ installOrder?: string[];
277
+ /** Pro2 RESC bundles for incremental direct FileWrite synchronization. */
278
+ resourceBundles?: IProtocolV2ResourceBundle[];
279
+ bootloaderChangelog?: {
280
+ [k in ILocale]: string;
281
+ };
282
+ fingerprint: string;
283
+ version: IVersionArray;
284
+ changelog: {
285
+ [k in ILocale]: string;
286
+ };
287
+ };
288
+ /** BLE firmware config */
289
+ type IBLEFirmwareReleaseInfo = {
290
+ required: boolean;
291
+ /** bluetooth dfu version */
292
+ url: string;
293
+ /** stm bluetooth update version */
294
+ webUpdate: string;
295
+ fingerprint: string;
296
+ fingerprintWeb: string;
297
+ version: IVersionArray;
298
+ changelog: {
299
+ [k in ILocale]: string;
300
+ };
301
+ };
302
+ type IKnownDevice = Exclude<IDeviceType, 'unknown'>;
303
+ type DeviceTypeMap = {
304
+ [k in IKnownDevice]: {
305
+ firmware: IFirmwareReleaseInfo[];
306
+ /** Pro2 Protocol V2 payload package set */
307
+ 'firmware-v1'?: IFirmwareReleaseInfo[];
308
+ 'firmware-v2'?: IFirmwareReleaseInfo[];
309
+ 'firmware-v8'?: IFirmwareReleaseInfo[];
310
+ 'firmware-btc-v8'?: IFirmwareReleaseInfo[];
311
+ ble: IBLEFirmwareReleaseInfo[];
312
+ /** Independent Pro2 resource release configuration. */
313
+ resources?: IProtocolV2Resources;
314
+ };
315
+ };
316
+ type AssetsMap = {
317
+ bridge: {
318
+ version: IVersionArray;
319
+ linux32Rpm: string;
320
+ linux64Rpm: string;
321
+ linux32Deb: string;
322
+ linux64Deb: string;
323
+ win: string;
324
+ mac: string;
325
+ sha256sumAsc: string;
326
+ changelog: {
327
+ [k in ILocale]: string;
328
+ };
329
+ };
162
330
  };
331
+ type RemoteConfigResponse = {
332
+ bridge: AssetsMap['bridge'];
333
+ } & DeviceTypeMap;
163
334
 
164
- declare class DeviceConnector {
165
- transport: Transport;
166
- listenTimestamp: number;
167
- current: OneKeyDeviceInfo[] | null;
168
- upcoming: OneKeyDeviceInfo[];
169
- listening: boolean;
170
- constructor();
171
- enumerate(): Promise<DeviceDescriptorDiff | undefined>;
172
- listen(): Promise<void>;
173
- stop(): void;
174
- acquire(path: string, session?: string | null, forceCleanRunPromise?: boolean, connectProtocol?: HardwareConnectProtocol): Promise<string | undefined>;
175
- release(session: string, onclose: boolean): Promise<void>;
176
- disconnect(session: string | undefined | null): Promise<void>;
177
- promptDeviceAccess(): Promise<USBDevice | BluetoothDevice | null>;
178
- _reportDevicesChange(): void;
335
+ type DeviceStatus = 'available' | 'occupied' | 'used';
336
+ declare enum EOneKeyDeviceMode {
337
+ bootloader = "bootloader",
338
+ normal = "normal",
339
+ notInitialized = "notInitialized",
340
+ backupMode = "backupMode"
179
341
  }
180
-
181
- type InitOptions = {
182
- initSession?: boolean;
183
- deviceId?: string;
184
- passphraseState?: string;
185
- deriveCardano?: boolean;
186
- connectProtocol?: HardwareConnectProtocol;
187
- protocolV2DeviceInfoTimeoutMs?: number;
342
+ type UnavailableCapability = 'no-capability' | 'no-support' | 'update-required' | 'trezor-connect-outdated';
343
+ type UnavailableCapabilities = {
344
+ [key: string]: UnavailableCapability;
188
345
  };
189
- type RunOptions = {
190
- keepSession?: boolean;
191
- skipInitialize?: boolean;
192
- } & InitOptions;
193
- interface DeviceEvents {
194
- [DEVICE.PIN]: [Device$1, Messages.PinMatrixRequestType | undefined, (err: any, pin: string) => void];
195
- [DEVICE.PASSPHRASE_ON_DEVICE]: [Device$1, ((response: any) => void)?];
196
- [DEVICE.BUTTON]: [Device$1, DeviceButtonRequestPayload];
197
- [DEVICE.FEATURES]: [Device$1, DeviceFeaturesPayload];
198
- [DEVICE.PASSPHRASE]: [
199
- Device$1,
200
- PassphraseRequestPayload,
201
- (response: PassphrasePromptResponse, error?: Error) => void
202
- ];
203
- [DEVICE.SELECT_DEVICE_IN_BOOTLOADER_FOR_WEB_DEVICE]: [
204
- Device$1,
205
- (err: any, deviceId: string) => void
206
- ];
207
- [DEVICE.SELECT_DEVICE_FOR_SWITCH_FIRMWARE_WEB_DEVICE]: [
208
- Device$1,
209
- (err: any, deviceId: string) => void
210
- ];
211
- }
212
- declare function preloadSessionCache(deviceId: string, passphraseState: string, sessionId: string): void;
213
- interface Device$1 {
214
- on<K extends keyof DeviceEvents>(type: K, listener: (...event: DeviceEvents[K]) => void): this;
215
- off<K extends keyof DeviceEvents>(type: K, listener: (...event: DeviceEvents[K]) => void): this;
216
- emit<K extends keyof DeviceEvents>(type: K, ...args: DeviceEvents[K]): boolean;
217
- }
218
- declare class Device$1 extends EventEmitter {
219
- originalDescriptor: OneKeyDeviceInfo;
220
- sdkInstanceId?: string;
221
- instanceId: string;
222
- createdAt: number;
223
- mainId?: string | null;
224
- deviceConnector?: DeviceConnector | null;
225
- commands: DeviceCommands;
226
- private cancelableAction?;
227
- private deviceAcquired;
228
- features: Features | undefined;
229
- featuresNeedsReload: boolean;
230
- runPromise?: Deferred<void> | null;
231
- externalState: string[];
232
- unavailableCapabilities: UnavailableCapabilities;
233
- instance: number;
234
- internalState: string[];
235
- needReloadDevice: boolean;
236
- keepSession: boolean;
237
- passphraseState: string | undefined;
238
- pendingCallbackPromise?: Deferred<void>;
239
- private preInitializedAt?;
240
- private preInitializeMeta?;
241
- private lastInitializeDurationMs?;
242
- constructor(descriptor: OneKeyDeviceInfo, sdkInstanceId?: string);
243
- static fromDescriptor(originalDescriptor: OneKeyDeviceInfo, sdkInstanceId?: string): Device$1;
244
- toMessageObject(): Device | null;
245
- connect(connectProtocol?: HardwareConnectProtocol): Promise<boolean>;
246
- acquire(connectProtocol?: HardwareConnectProtocol, options?: {
247
- throwOnRunPromiseError?: boolean;
248
- }): Promise<void>;
249
- release(): Promise<void>;
250
- preInitialize(initOptions?: InitOptions): Promise<void>;
251
- markPreInitialized(meta?: {
252
- passphraseState?: string;
253
- }): void;
254
- clearPreInitialized(): void;
255
- isPreInitializeMetaMatch(payload?: {
256
- passphraseState?: string;
257
- }): boolean;
258
- isPreInitializedValid(ttlMs: number): boolean;
259
- setLastInitializeDuration(durationMs: number): void;
260
- getLastInitializeDuration(): number | undefined;
261
- getCommands(): DeviceCommands;
262
- getProtocol(): 'V1' | 'V2';
263
- isProtocolV2(): boolean;
264
- getCurrentDeviceType(): IDeviceType;
265
- getCurrentDeviceId(): string | undefined;
266
- getCurrentSerialNo(): string;
267
- getConnectId(): string;
268
- getCurrentBleName(): string | null;
269
- getCurrentLabel(): string | null;
270
- getCurrentPassphraseProtection(): boolean | null | undefined;
271
- getCurrentFirmwareType(): _onekeyfe_hd_shared.EFirmwareType;
272
- getCurrentFirmwareVersionString(): string;
273
- getCurrentBLEFirmwareVersionString(): string | undefined;
274
- getCurrentSafetyChecks(): string | null | undefined;
275
- getCurrentMethodVersionRange(getVersionRange: (deviceModel: IDeviceType | IDeviceModel) => IVersionRange | undefined): IVersionRange | undefined;
276
- supportNewPassphrase(): SupportFeatureType;
277
- supportInputPinOnSoftware(): SupportFeatureType;
278
- supportModifyHomescreen(): SupportFeatureType;
279
- private generateStateKey;
280
- private getSessionCacheDeviceKey;
281
- getInternalState(_deviceId?: string): string | undefined;
282
- updateInternalState(enablePassphrase: boolean, passphraseState: string | undefined, deviceId: string | undefined, sessionId?: string | null, featuresSessionId?: string | null): void;
283
- private setInternalState;
284
- clearInternalState(_deviceId?: string): void;
285
- initialize(options?: InitOptions): Promise<void>;
286
- private _initializeProtocolV2;
287
- private _refreshProtocolV2Status;
288
- getFeatures(): Promise<Features | undefined>;
289
- _updateFeatures(protoFeatures: Messages.Features | Features, initSession?: boolean): void;
290
- updateProtocolV2Features(deviceInfo?: ProtocolV2DeviceInfo): Features;
291
- updateDescriptor(descriptor: OneKeyDeviceInfo, forceUpdate?: boolean): void;
292
- updateFromCache(device: Device$1): void;
293
- run(fn?: () => Promise<void>, options?: RunOptions): Promise<void>;
294
- _runInner<T>(fn: (() => Promise<T>) | undefined, options: RunOptions): Promise<undefined>;
295
- interruptionFromOutside(): Promise<void>;
296
- interruptionFromUser(): Promise<void>;
297
- setCancelableAction(callback: (err?: Error) => Promise<unknown>): void;
298
- clearCancelableAction(): void;
299
- getMode(): EOneKeyDeviceMode;
300
- getFirmwareVersion(): IVersionArray | null;
301
- getBLEFirmwareVersion(): IVersionArray | null;
302
- isUsed(): boolean;
303
- hasDeviceAcquire(): boolean;
304
- isUsedHere(): boolean;
305
- isUsedElsewhere(): boolean;
306
- isBootloader(): boolean | undefined;
307
- isInitialized(): boolean | undefined;
308
- isSeedless(): boolean | undefined;
309
- isUnacquired(): boolean;
310
- hasUnexpectedMode(allow: string[], require: string[]): "ui-device_bootloader_mode" | "ui-device_not_in_bootloader_mode" | "ui-device_not_initialized" | "ui-device_seedless" | null;
311
- hasUsePassphrase(): boolean;
312
- checkDeviceId(deviceId: string): boolean;
313
- lockDevice(): Promise<Success$1>;
314
- supportUnlockVersionRange(): DeviceFirmwareRange;
315
- unlockDevice(): Promise<Features | undefined>;
316
- checkPassphraseStateSafety(passphraseState?: string, useEmptyPassphrase?: boolean, skipPassphraseCheck?: boolean): Promise<boolean>;
317
- }
318
-
319
- declare function generateSdkInstanceId(): string;
320
- declare function generateInstanceId(type: string, sdkInstanceId?: string): string;
321
- interface RequestContext {
322
- responseID: number;
323
- sdkInstanceId?: string;
324
- methodName: string;
325
- connectId?: string;
326
- deviceInstanceId?: string;
327
- commandsInstanceId?: string;
328
- parentResponseID?: number;
329
- startTime: number;
330
- endTime?: number;
331
- status?: 'pending' | 'running' | 'success' | 'error' | 'cancelled';
332
- error?: string;
333
- }
334
- interface SdkTracingContext {
335
- sdkInstanceId: string;
336
- createdAt: number;
337
- activeRequests: Map<number, RequestContext>;
338
- }
339
- declare function createSdkTracingContext(): SdkTracingContext;
340
- declare function createRequestContext(responseID: number, methodName: string, options?: {
341
- sdkInstanceId?: string;
342
- connectId?: string;
343
- deviceInstanceId?: string;
344
- commandsInstanceId?: string;
345
- parentResponseID?: number;
346
- }): RequestContext;
347
- declare function updateRequestContext(responseID: number, updates: Partial<RequestContext>): void;
348
- declare function completeRequestContext(responseID: number, error?: Error): void;
349
- declare function getActiveRequestsByDeviceInstance(deviceInstanceId: string): RequestContext[];
350
- declare function formatRequestContext(context: RequestContext): string;
351
- declare function cleanupSdkInstance(sdkInstanceId: string): void;
352
-
353
- declare class Core extends EventEmitter {
354
- private tracingContext;
355
- readonly sdkInstanceId: string;
356
- private requestQueue;
357
- private prePendingCallPromise;
358
- private methodSynchronize;
359
- constructor();
360
- private getCoreContext;
361
- handleMessage(message: CoreMessage): Promise<any>;
362
- dispose(): void;
363
- }
364
- declare const init$1: (settings: ConnectSettings, Transport: any, plugin?: LowlevelTransportSharedPlugin) => Promise<Core | undefined>;
365
- declare const switchTransport: ({ env, Transport, plugin, }: {
366
- env: ConnectSettings['env'];
367
- Transport: any;
368
- plugin?: LowlevelTransportSharedPlugin | undefined;
369
- }) => void;
370
-
371
- type DeviceInfoGetTargets = {
372
- hw?: boolean;
373
- fw?: boolean;
374
- coprocessor?: boolean;
375
- se1?: boolean;
376
- se2?: boolean;
377
- se3?: boolean;
378
- se4?: boolean;
379
- status?: boolean;
380
- };
381
- type DeviceInfoGetTypes = {
382
- version?: boolean;
383
- build_id?: boolean;
384
- hash?: boolean;
385
- specific?: boolean;
386
- };
387
- type DeviceInfoGetParams = {
388
- targets?: DeviceInfoGetTargets;
389
- types?: DeviceInfoGetTypes;
390
- };
391
-
392
- type FileOpSuccess = {
393
- message?: string;
394
- };
395
- type FileInfo = {
396
- path: string;
397
- offset: number;
398
- total_size: number;
399
- data?: Uint8Array;
400
- data_hash?: number;
401
- processed_byte?: number;
402
- chunks?: number;
403
- };
404
- type DirInfo = {
405
- path: string;
406
- child_dirs?: string;
407
- child_files?: string;
408
- };
409
- type PathInfoResult = {
410
- exist: boolean;
411
- size: number;
412
- year: number;
413
- month: number;
414
- day: number;
415
- hour: number;
416
- minute: number;
417
- second: number;
418
- readonly: boolean;
419
- hidden: boolean;
420
- system: boolean;
421
- archive: boolean;
422
- directory: boolean;
423
- };
424
- declare function protocolInfoRequest(connectId: string, params?: CommonParams): Response<ProtocolInfo>;
425
- declare function ping(connectId: string, params?: CommonParams & {
426
- message?: string;
427
- }): Response<Success$1>;
428
- declare function deviceReboot(connectId: string, params: CommonParams & DeviceRebootParams): Response<Success$1>;
429
- declare function deviceInfoGet(connectId: string, params?: CommonParams & DeviceInfoGetParams): Response<ProtocolV2DeviceInfo>;
430
- declare function deviceFirmwareUpdate(connectId: string, params: CommonParams & DeviceFirmwareUpdateParams): Response<Success$1 | DeviceFirmwareUpdateStatus>;
431
- declare function deviceGetFirmwareUpdateStatus(connectId: string, params?: CommonParams & DeviceFirmwareUpdateStatusGetParams): Response<DeviceFirmwareUpdateStatus>;
432
- declare function deviceFactoryInfoSet(connectId: string, params: CommonParams & DeviceFactoryInfoSetParams): Response<Success$1>;
433
- declare function deviceFactoryInfoGet(connectId: string, params?: CommonParams): Response<DeviceFactoryInfo>;
434
- declare function filesystemPermissionFix(connectId: string, params?: CommonParams): Response<Success$1>;
435
- declare function fileRead(connectId: string, params: {
436
- path: string;
437
- offset?: number;
438
- totalSize?: number;
439
- chunkLen?: number;
440
- uiPercentage?: number;
441
- }): Response<FileInfo>;
442
- declare function fileWrite(connectId: string, params: {
443
- path: string;
444
- offset?: number;
445
- totalSize?: number;
446
- chunkSize?: number;
447
- chunkLen?: number;
448
- data: ArrayBuffer | Uint8Array | Blob | string;
449
- overwrite?: boolean;
450
- append?: boolean;
451
- uiPercentage?: number;
452
- timeoutMs?: number | string;
453
- }): Response<FileInfo>;
454
- declare function fileDelete(connectId: string, params: {
455
- path: string;
456
- }): Response<FileOpSuccess>;
457
- declare function dirList(connectId: string, params: {
458
- path: string;
459
- depth?: number;
460
- }): Response<DirInfo>;
461
- declare function dirMake(connectId: string, params: {
462
- path: string;
463
- }): Response<FileOpSuccess>;
464
- declare function dirRemove(connectId: string, params: {
465
- path: string;
466
- }): Response<FileOpSuccess>;
467
- declare function pathInfo(connectId: string, params: {
468
- path: string;
469
- timeoutMs?: number | string;
470
- }): Response<PathInfoResult>;
471
- declare const filesystemFileRead: typeof fileRead;
472
- declare const filesystemFileWrite: typeof fileWrite;
473
- declare const filesystemFileDelete: typeof fileDelete;
474
- declare const filesystemDirList: typeof dirList;
475
- declare const filesystemDirMake: typeof dirMake;
476
- declare const filesystemDirRemove: typeof dirRemove;
477
- declare const filesystemPathInfoQuery: typeof pathInfo;
478
- declare function filesystemFormat(connectId: string): Response<Success$1>;
479
- declare function filesystemDiskControl(connectId: string, params: CommonParams & {
480
- enable: boolean | 0 | 1;
481
- timeoutMs?: number | string;
482
- }): Response<Success$1>;
483
-
484
- declare const on: <T extends string, P extends (...args: any[]) => any>(type: T, fn: P) => void;
485
- declare const off: (type: any, fn: any) => void;
486
- declare const removeAllListeners: (type: any) => void;
487
-
488
- declare function uiResponse(response: UiResponseEvent): void;
489
-
490
- type IAddHardwareGlobalEventListener = (coreMessage: CoreMessage) => void;
491
- interface LowLevelInjectApi {
492
- call: CallMethod;
493
- eventEmitter: EventEmitter$1;
494
- init: CoreApi['init'];
495
- dispose: CoreApi['dispose'];
496
- uiResponse: CoreApi['uiResponse'];
497
- cancel: CoreApi['cancel'];
498
- updateSettings: CoreApi['updateSettings'];
499
- switchTransport: CoreApi['switchTransport'];
500
- addHardwareGlobalEventListener: (listener: IAddHardwareGlobalEventListener) => void;
501
- }
502
- type LowLevelCoreApi = Omit<CoreApi, 'on' | 'off'> & {
503
- addHardwareGlobalEventListener: (listener: IAddHardwareGlobalEventListener) => void;
504
- };
505
-
506
- type DeviceStatus = 'available' | 'occupied' | 'used';
507
- declare enum EOneKeyDeviceMode {
508
- bootloader = "bootloader",
509
- normal = "normal",
510
- notInitialized = "notInitialized",
511
- backupMode = "backupMode"
512
- }
513
- type UnavailableCapability = 'no-capability' | 'no-support' | 'update-required' | 'trezor-connect-outdated';
514
- type UnavailableCapabilities = {
515
- [key: string]: UnavailableCapability;
516
- };
517
- type KnownDevice = {
518
- connectId: string | null;
519
- uuid: string;
520
- deviceId: string | null;
521
- deviceType: IDeviceType | null;
522
- commType: OneKeyDeviceCommType | null;
523
- path: string;
524
- label: string;
525
- bleName: string | null;
526
- name: string;
527
- error?: typeof undefined;
528
- mode: EOneKeyDeviceMode;
529
- features?: Features;
530
- sessionId?: string | null;
346
+ type KnownDevice = {
347
+ connectId: string | null;
348
+ /** Protocol family confirmed by the transport's active probe. */
349
+ connectProtocol?: HardwareConnectProtocol;
350
+ /**
351
+ * Stable physical-device identity. Current SDK responses always include this
352
+ * value; it remains optional in the type during the uuid compatibility window.
353
+ */
354
+ serialNo?: string;
355
+ /** @deprecated Use serialNo instead. */
356
+ uuid: string;
357
+ deviceId: string | null;
358
+ deviceType: IDeviceType | null;
359
+ commType: OneKeyDeviceCommType | null;
360
+ path: string;
361
+ label: string;
362
+ bleName: string | null;
363
+ name: string;
364
+ error?: typeof undefined;
365
+ /** Current SDK/transport usage state for connection indicators. */
366
+ status?: DeviceStatus;
367
+ mode: EOneKeyDeviceMode;
368
+ features: Features;
369
+ /** Unified SDK device-state snapshot; features remains a legacy projection. */
370
+ state?: DeviceState;
531
371
  unavailableCapabilities: UnavailableCapabilities;
532
372
  bleFirmwareVersion: IVersionArray | null;
533
373
  firmwareVersion: IVersionArray | null;
@@ -537,18 +377,35 @@ type KnownDevice = {
537
377
  };
538
378
  type SearchDevice = {
539
379
  connectId: string | null;
380
+ /** Protocol family confirmed by the transport's active probe. */
381
+ connectProtocol?: HardwareConnectProtocol;
382
+ /**
383
+ * Available after device initialization. BLE discovery does not connect to the
384
+ * device, so it returns null until a later initialized device response. Current
385
+ * SDK responses always include the field; it remains optional in the type during
386
+ * the uuid compatibility window.
387
+ */
388
+ serialNo?: string | null;
389
+ /**
390
+ * @deprecated Ambiguous legacy identifier. Use serialNo for hardware identity
391
+ * and connectId for transport routing.
392
+ */
540
393
  uuid: string;
541
394
  deviceId: string | null;
542
395
  deviceType: IDeviceType;
543
396
  name: string;
544
397
  commType: OneKeyDeviceCommType;
545
398
  };
546
- type Device = KnownDevice;
399
+ type Device$1 = KnownDevice;
547
400
  type DeviceFeaturesProtocol = 'V1' | 'V2' | 'unknown';
548
- type DeviceFeaturesMode = 'normal' | 'bootloader' | 'notInitialized' | 'backupMode' | 'unknown';
401
+ type DeviceFeaturesMode = 'normal' | 'bootloader' | 'romloader' | 'notInitialized' | 'backupMode' | 'unknown';
549
402
  type DeviceFeaturesVerify = {
550
403
  firmwareBuildId?: string;
551
404
  firmwareHash?: string;
405
+ applicationP1BuildId?: string;
406
+ applicationP1Hash?: string;
407
+ applicationP2BuildId?: string;
408
+ applicationP2Hash?: string;
552
409
  bootloaderBuildId?: string;
553
410
  bootloaderHash?: string;
554
411
  boardBuildId?: string;
@@ -575,9 +432,115 @@ type DeviceFeaturesVerify = {
575
432
  type DeviceFeaturesRaw = {
576
433
  protocolV1Features?: Messages.Features;
577
434
  protocolV1OneKeyFeatures?: OnekeyFeatures;
435
+ protocolV2ProtocolInfo?: ProtocolInfo;
578
436
  protocolV2DeviceInfo?: ProtocolV2DeviceInfo;
437
+ protocolV2DeviceStatus?: DeviceStatus$1;
438
+ };
439
+ type DeviceFeaturesRawPatch = {
440
+ [Key in keyof DeviceFeaturesRaw]?: DeviceFeaturesRaw[Key] | null;
441
+ };
442
+ type DeviceStateProtocol = DeviceFeaturesProtocol;
443
+ type DeviceStateMode = DeviceFeaturesMode;
444
+ type DeviceStateSection = 'identity' | 'status' | 'settings' | 'versions' | 'verification';
445
+ type DeviceStateUpdateSource = 'initialize' | 'device-info' | 'device-status' | 'settings-read' | 'settings-write' | 'change-pin' | 'lock' | 'unlock' | 'passphrase' | 'session-clear' | 'firmware-update' | 'transport-reconnect' | 'compatibility';
446
+ type DeviceStateIdentity = {
447
+ deviceType: IDeviceType;
448
+ firmwareType: EFirmwareType;
449
+ model: string | null;
450
+ vendor: string | null;
451
+ deviceId: string | null;
452
+ serialNo: string;
453
+ label: string | null;
454
+ bleName: string | null;
455
+ };
456
+ type DeviceStateStatus = {
457
+ mode: DeviceStateMode;
458
+ initialized: boolean | null;
459
+ unlocked: boolean | null;
460
+ firmwarePresent: boolean | null;
461
+ backupRequired: boolean | null;
462
+ noBackup: boolean | null;
463
+ unfinishedBackup: boolean | null;
464
+ recoveryMode: boolean | null;
465
+ passphraseProtection: boolean | null;
466
+ pinProtection: boolean | null;
467
+ attachToPinEnabled: boolean | null;
468
+ unlockedAttachPin: boolean | null;
469
+ };
470
+ type DeviceStateSettings = {
471
+ language: string | null;
472
+ bleEnabled: boolean | null;
473
+ sdCardPresent: boolean | null;
474
+ sdProtection: boolean | null;
475
+ wipeCodeProtection: boolean | null;
476
+ passphraseAlwaysOnDevice: boolean | null;
477
+ safetyChecks: Enum_SafetyCheckLevel | null;
478
+ autoLockDelayMs: number | null;
479
+ autoShutdownDelayMs: number | null;
480
+ displayRotation: number | null;
481
+ experimentalFeatures: boolean | null;
482
+ wallpaperPath: string | null;
483
+ brightness: number | null;
484
+ animationEnabled: boolean | null;
485
+ tapToWake: boolean | null;
486
+ hapticFeedback: boolean | null;
487
+ deviceNameDisplayEnabled: boolean | null;
488
+ airgapMode: boolean | null;
489
+ fidoEnabled: boolean | null;
490
+ usbLockEnabled: boolean | null;
491
+ randomKeypad: boolean | null;
492
+ };
493
+ type DeviceStateVersions = {
494
+ firmware: string | null;
495
+ applicationP1?: string | null;
496
+ applicationP2?: string | null;
497
+ bootloader: string | null;
498
+ board: string | null;
499
+ ble: string | null;
500
+ /** @deprecated Kept for legacy consumers; new code should read se01. */
501
+ se?: string | null;
502
+ se01?: string | null;
503
+ se02?: string | null;
504
+ se03?: string | null;
505
+ se04?: string | null;
506
+ se01Boot?: string | null;
507
+ se02Boot?: string | null;
508
+ se03Boot?: string | null;
509
+ se04Boot?: string | null;
510
+ };
511
+ type DeviceState = {
512
+ schemaVersion: 1;
513
+ revision: number;
514
+ updatedAt: number;
515
+ protocol: DeviceStateProtocol;
516
+ /** Device-message protocol version, independent of the SDK V1/V2 protocol family. */
517
+ protocolVersion: number | null;
518
+ identity: DeviceStateIdentity;
519
+ status: DeviceStateStatus;
520
+ settings: DeviceStateSettings;
521
+ versions: DeviceStateVersions;
522
+ capabilities: Array<number | string>;
523
+ verification?: Partial<DeviceFeaturesVerify>;
524
+ };
525
+ type DeviceStatePatch = {
526
+ protocol?: DeviceStateProtocol;
527
+ protocolVersion?: number | null;
528
+ identity?: Partial<DeviceStateIdentity>;
529
+ status?: Partial<DeviceStateStatus>;
530
+ settings?: Partial<DeviceStateSettings>;
531
+ versions?: Partial<DeviceStateVersions>;
532
+ capabilities?: Array<number | string>;
533
+ verification?: DeviceFeaturesVerify;
534
+ raw?: DeviceFeaturesRawPatch;
535
+ };
536
+ type DeviceStateEvent = {
537
+ connectId: string | null;
538
+ state: DeviceState;
539
+ revision: number;
540
+ source: DeviceStateUpdateSource;
541
+ changedKeys: string[];
579
542
  };
580
- type Features = {
543
+ type NormalizedFeatures = {
581
544
  protocol: DeviceFeaturesProtocol;
582
545
  protocolVersion?: number | null;
583
546
  deviceType: IDeviceType;
@@ -607,10 +570,21 @@ type Features = {
607
570
  wipeCodeProtection: boolean | null;
608
571
  passphraseAlwaysOnDevice: boolean | null;
609
572
  attachToPinEnabled?: boolean | null;
610
- safetyChecks: string | null;
573
+ safetyChecks: Enum_SafetyCheckLevel | null;
611
574
  autoLockDelayMs: number | null;
575
+ autoShutdownDelayMs: number | null;
612
576
  displayRotation: number | null;
613
577
  experimentalFeatures: boolean | null;
578
+ wallpaperPath: string | null;
579
+ brightness: number | null;
580
+ animationEnabled: boolean | null;
581
+ tapToWake: boolean | null;
582
+ hapticFeedback: boolean | null;
583
+ deviceNameDisplayEnabled: boolean | null;
584
+ airgapMode: boolean | null;
585
+ fidoEnabled: boolean | null;
586
+ usbLockEnabled: boolean | null;
587
+ randomKeypad: boolean | null;
614
588
  firmwareVersion: string | null;
615
589
  bootloaderVersion: string | null;
616
590
  boardVersion: string | null;
@@ -630,8 +604,14 @@ type Features = {
630
604
  unlockedAttachPin?: boolean;
631
605
  raw?: DeviceFeaturesRaw;
632
606
  };
607
+ type Features = NormalizedFeatures & Partial<Omit<Messages.Features, keyof NormalizedFeatures>> & Partial<Omit<Messages.OnekeyFeatures, keyof NormalizedFeatures | keyof Messages.Features>>;
633
608
  type OnekeyFeatures = Messages.OnekeyFeatures;
634
609
  type IDeviceType = EDeviceType.Unknown | EDeviceType.Classic | EDeviceType.Classic1s | EDeviceType.ClassicPure | EDeviceType.Mini | EDeviceType.Touch | EDeviceType.Pro | EDeviceType.Pro2;
610
+ /**
611
+ * model_classic: 'classic' | 'classic1s' | 'classicpure'
612
+ * model_mini: 'classic' | 'classic1s' | 'classicpure' | 'mini'
613
+ * model_touch: 'touch' | 'pro'
614
+ */
635
615
  type IDeviceModel = 'model_classic' | 'model_mini' | 'model_touch' | 'model_classic1s';
636
616
  declare const DeviceModelToTypes: {
637
617
  [deviceModel in IDeviceModel]: IDeviceType[];
@@ -645,7 +625,6 @@ type ITransportStatus = 'valid' | 'outdated';
645
625
  type IVersionRange = {
646
626
  min: string;
647
627
  max?: string;
648
- unsupported?: boolean;
649
628
  };
650
629
  type DeviceFirmwareRange = {
651
630
  [deviceType in IDeviceType | IDeviceModel]?: IVersionRange;
@@ -696,303 +675,564 @@ type SupportFeatures = {
696
675
  modifyHomescreen: SupportFeatureType;
697
676
  };
698
677
 
699
- type transportEnv = 'node' | 'web' | 'webextension' | 'electron' | 'react-native' | 'webusb' | 'desktop-webusb' | 'desktop-web-ble' | 'emulator' | 'lowlevel' | 'node-usb';
700
- type ConnectSettings = {
701
- connectSrc?: string;
702
- debug?: boolean;
703
- transportReconnect?: boolean;
704
- lazyLoad?: boolean;
705
- origin?: string;
706
- parentOrigin?: string;
707
- configSrc: string;
708
- iframeSrc: string;
709
- version: string;
710
- priority: number;
711
- trustedHost: boolean;
712
- supportedBrowser?: boolean;
713
- env: transportEnv;
714
- timestamp: number;
715
- isFrame?: boolean;
716
- preRelease?: boolean;
717
- fetchConfig?: boolean;
718
- extension?: string;
719
- configFetcher?: (url: string) => Promise<RemoteConfigResponse | null>;
720
- };
721
- type IVersionArray = [number, number, number];
722
- type ILocale = 'zh-CN' | 'en-US';
723
- type IProtocolV2FirmwareComponentTarget = 'ROMLOADER' | 'BOOTLOADER' | 'APPLICATION_P1' | 'APPLICATION_P2' | 'COPROCESSOR' | 'SE01' | 'SE02' | 'SE03' | 'SE04' | 'CRATE';
724
- type IProtocolV2FirmwareComponent = {
725
- target: IProtocolV2FirmwareComponentTarget;
726
- url: string;
727
- fingerprint?: string;
728
- version?: IVersionArray;
729
- resourceManifest?: IProtocolV2ResourceManifest;
678
+ type DeviceStateScope = 'runtime' | 'settings' | 'firmware';
679
+ type GetDeviceStateParams = CommonParams & {
680
+ scope?: DeviceStateScope;
730
681
  };
731
- type IProtocolV2ResourceManifestPackage = {
732
- name?: string;
733
- path: string;
734
- type?: string;
735
- version?: IVersionArray;
736
- sha256?: string;
737
- payloadHash?: string;
738
- headerHash?: string;
682
+ /** Internal state-read options, not part of the public CoreApi. */
683
+ type DeviceStateReadOptions = {
684
+ refreshSections?: DeviceStateSection[];
685
+ includeRaw?: boolean;
739
686
  };
740
- type IProtocolV2ResourceManifest = {
741
- format?: 'okpkg-crate' | string;
742
- target?: 'CRATE' | string;
743
- version?: IVersionArray;
744
- packages: IProtocolV2ResourceManifestPackage[];
687
+ declare function getDeviceState(connectId?: string, params?: GetDeviceStateParams): Response<DeviceState>;
688
+
689
+ type DeviceDescriptorDiff = {
690
+ didUpdate: boolean;
691
+ connected: OneKeyDeviceInfo[];
692
+ disconnected: OneKeyDeviceInfo[];
693
+ changedSessions: OneKeyDeviceInfo[];
694
+ changedDebugSessions: OneKeyDeviceInfo[];
695
+ acquired: OneKeyDeviceInfo[];
696
+ debugAcquired: OneKeyDeviceInfo[];
697
+ released: OneKeyDeviceInfo[];
698
+ debugReleased: OneKeyDeviceInfo[];
699
+ descriptors: OneKeyDeviceInfo[];
745
700
  };
746
- type IFirmwareReleaseInfo = {
747
- required: boolean;
748
- url: string;
749
- firmwareType?: EFirmwareType;
750
- resource?: string;
751
- fullResource?: string;
752
- fullResourceRange?: string[];
753
- bootloaderResource?: string;
754
- bootloaderVersion?: IVersionArray;
755
- displayBootloaderVersion?: IVersionArray;
756
- bootloaderRelatedFirmwareVersion?: IVersionArray;
757
- upgradeType?: 'payload-package-set' | string;
758
- components?: Record<string, IProtocolV2FirmwareComponent>;
759
- installOrder?: string[];
760
- resourceManifest?: IProtocolV2ResourceManifest;
761
- bootloaderChangelog?: {
762
- [k in ILocale]: string;
763
- };
764
- fingerprint: string;
765
- version: IVersionArray;
766
- changelog: {
767
- [k in ILocale]: string;
768
- };
769
- };
770
- type IBLEFirmwareReleaseInfo = {
771
- required: boolean;
772
- url: string;
773
- webUpdate: string;
774
- fingerprint: string;
775
- fingerprintWeb: string;
776
- version: IVersionArray;
777
- changelog: {
778
- [k in ILocale]: string;
779
- };
780
- };
781
- type IKnownDevice = Exclude<IDeviceType, 'unknown'>;
782
- type DeviceTypeMap = {
783
- [k in IKnownDevice]: {
784
- firmware: IFirmwareReleaseInfo[];
785
- 'firmware-v1'?: IFirmwareReleaseInfo[];
786
- 'firmware-v2'?: IFirmwareReleaseInfo[];
787
- 'firmware-v8'?: IFirmwareReleaseInfo[];
788
- 'firmware-btc-v8'?: IFirmwareReleaseInfo[];
789
- ble: IBLEFirmwareReleaseInfo[];
790
- };
791
- };
792
- type AssetsMap = {
793
- bridge: {
794
- version: IVersionArray;
795
- linux32Rpm: string;
796
- linux64Rpm: string;
797
- linux32Deb: string;
798
- linux64Deb: string;
799
- win: string;
800
- mac: string;
801
- sha256sumAsc: string;
802
- changelog: {
803
- [k in ILocale]: string;
804
- };
805
- };
806
- };
807
- type RemoteConfigResponse = {
808
- bridge: AssetsMap['bridge'];
809
- } & DeviceTypeMap;
810
-
811
- declare function init(settings: Partial<ConnectSettings>, lowLevelApi?: LowLevelCoreApi, pulgin?: LowlevelTransportSharedPlugin): Promise<boolean>;
812
- declare function updateSettings(settings: Partial<ConnectSettings>): Promise<boolean>;
813
-
814
- declare function testInitializeDeviceDuration(connectId?: string, params?: CommonParams): Response<number>;
815
701
 
816
- declare function preInitialize(connectId: string, params?: CommonParams): Response<boolean>;
702
+ declare class DeviceConnector {
703
+ transport: Transport;
704
+ listenTimestamp: number;
705
+ current: OneKeyDeviceInfo[] | null;
706
+ upcoming: OneKeyDeviceInfo[];
707
+ listening: boolean;
708
+ constructor();
709
+ enumerate(): Promise<DeviceDescriptorDiff | undefined>;
710
+ listen(): Promise<void>;
711
+ stop(): void;
712
+ acquire(path: string, session?: string | null, forceCleanRunPromise?: boolean, expectedProtocol?: HardwareConnectProtocol, protocolHint?: HardwareConnectProtocol): Promise<string | undefined>;
713
+ release(session: string, onclose: boolean): Promise<void>;
714
+ disconnect(session: string | undefined | null): Promise<void>;
715
+ promptDeviceAccess(): Promise<USBDevice | BluetoothDevice | null>;
716
+ _reportDevicesChange(): void;
717
+ }
817
718
 
818
- declare function getLogs(): Response<string[]>;
719
+ type InitOptions = {
720
+ initSession?: boolean;
721
+ deviceId?: string;
722
+ passphraseState?: string;
723
+ deriveCardano?: boolean;
724
+ connectProtocol?: HardwareConnectProtocol;
725
+ forceProtocolDetection?: boolean;
726
+ protocolV2DeviceInfoTimeoutMs?: number;
727
+ /** Refresh Protocol V2 runtime state before returning discovery results. */
728
+ refreshRuntimeState?: boolean;
729
+ };
730
+ type RunOptions = {
731
+ keepSession?: boolean;
732
+ skipInitialize?: boolean;
733
+ } & InitOptions;
734
+ interface DeviceEvents {
735
+ [DEVICE.PIN]: [Device, Messages.PinMatrixRequestType | undefined, (err: any, pin: string) => void];
736
+ [DEVICE.PIN_ON_DEVICE]: [Device, DeviceSessionPinType, ProtocolV2UiEventMetadata?];
737
+ [DEVICE.PIN_ON_DEVICE_COMPLETE]: [Device, HardwareUiInteractionMeta];
738
+ [DEVICE.PASSPHRASE_ON_DEVICE]: [Device, PassphraseRequestPayload?];
739
+ [DEVICE.ATTACH_PIN_ON_DEVICE]: [Device, PassphraseRequestPayload?];
740
+ [DEVICE.BUTTON]: [Device, DeviceButtonRequestPayload];
741
+ [DEVICE.FEATURES]: [Device, DeviceFeaturesPayload];
742
+ [DEVICE.STATE]: [Device, DeviceStateEvent];
743
+ [DEVICE.PASSPHRASE]: [
744
+ Device,
745
+ PassphraseRequestPayload,
746
+ (response: PassphrasePromptResponse, error?: Error) => void
747
+ ];
748
+ [DEVICE.SELECT_DEVICE_IN_BOOTLOADER_FOR_WEB_DEVICE]: [
749
+ Device,
750
+ (err: any, deviceId: string) => void
751
+ ];
752
+ [DEVICE.SELECT_DEVICE_FOR_SWITCH_FIRMWARE_WEB_DEVICE]: [
753
+ Device,
754
+ (err: any, deviceId: string) => void
755
+ ];
756
+ }
757
+ /**
758
+ * Pre-populate the device session cache with a known session ID.
759
+ *
760
+ * This allows short-lived processes (e.g. CLI) to restore a previously
761
+ * obtained session, avoiding the need to re-enter passphrase on every
762
+ * invocation. The session must have been obtained from a prior
763
+ * wallet-session call on the same device. This compatibility hook is intended
764
+ * for a trusted CLI process restoring its own OS-keychain entry.
765
+ *
766
+ * @param deviceId - The device's device_id (from features)
767
+ * @param passphraseState - The passphrase state token
768
+ * @param sessionId - The session_id to cache (from features.session_id)
769
+ */
770
+ declare function preloadSessionCache(deviceId: string, passphraseState: string, sessionId: string): void;
771
+ interface Device {
772
+ on<K extends keyof DeviceEvents>(type: K, listener: (...event: DeviceEvents[K]) => void): this;
773
+ off<K extends keyof DeviceEvents>(type: K, listener: (...event: DeviceEvents[K]) => void): this;
774
+ emit<K extends keyof DeviceEvents>(type: K, ...args: DeviceEvents[K]): boolean;
775
+ }
776
+ declare class Device extends EventEmitter {
777
+ /**
778
+ * 设备标识对象
779
+ */
780
+ originalDescriptor: OneKeyDeviceInfo;
781
+ sdkInstanceId?: string;
782
+ /**
783
+ * 设备实例唯一标识
784
+ */
785
+ instanceId: string;
786
+ createdAt: number;
787
+ /**
788
+ * 设备主 ID
789
+ * 蓝牙连接时是设备的 UUID
790
+ * USB连接时是设备的 sessionID
791
+ */
792
+ mainId?: string | null;
793
+ /**
794
+ * 通信管道,向设备发送请求
795
+ */
796
+ deviceConnector?: DeviceConnector | null;
797
+ /**
798
+ * 固件命令
799
+ */
800
+ commands: DeviceCommands;
801
+ /**
802
+ * 可取消的操作
803
+ */
804
+ private cancelableAction?;
805
+ /**
806
+ * 设备是否被占用
807
+ */
808
+ private deviceAcquired;
809
+ /** Canonical device-state cache; legacy Features is a compatibility projection. */
810
+ private stateStore;
811
+ /** Force the next initialization to reload DeviceInfo after reconnect or reboot. */
812
+ private protocolV2StateNeedsReload;
813
+ /** Runtime context negotiated once per active Protocol V2 link. */
814
+ private protocolV2RuntimeContext?;
815
+ /** Coalesces concurrent first-use runtime negotiation on the same active link. */
816
+ private protocolV2RuntimeContextPromise?;
817
+ /** Invalidates an in-flight runtime-context response without adding a transport epoch. */
818
+ private protocolV2RuntimeContextRequestToken?;
819
+ private protocolV2UiInteraction?;
820
+ private protocolV2UiInteractionCounter;
821
+ get state(): (DeviceState & {
822
+ raw?: DeviceFeaturesRaw | undefined;
823
+ }) | undefined;
824
+ get features(): Features | undefined;
825
+ set features(features: Features | undefined);
826
+ runPromise?: Deferred<void> | null;
827
+ externalState: string[];
828
+ unavailableCapabilities: UnavailableCapabilities;
829
+ instance: number;
830
+ internalState: string[];
831
+ needReloadDevice: boolean;
832
+ /**
833
+ * 执行 API 方法后是否保留 SessionID
834
+ */
835
+ keepSession: boolean;
836
+ passphraseState: string | undefined;
837
+ pendingCallbackPromise?: Deferred<void>;
838
+ /** Pre-initialize timestamp (ms) */
839
+ private preInitializedAt?;
840
+ /** Pre-initialize context, used to verify state consistency before skipping */
841
+ private preInitializeMeta?;
842
+ /** Last Initialize duration (ms), reported as "saved" when a skip happens */
843
+ private lastInitializeDurationMs?;
844
+ constructor(descriptor: OneKeyDeviceInfo, sdkInstanceId?: string);
845
+ static fromDescriptor(originalDescriptor: OneKeyDeviceInfo, sdkInstanceId?: string): Device;
846
+ toMessageObject(): Device$1 | null;
847
+ /**
848
+ * Device connect
849
+ * @returns {Promise<boolean>}
850
+ */
851
+ connect(connectProtocol?: HardwareConnectProtocol, options?: {
852
+ forceProtocolDetection?: boolean;
853
+ }): Promise<boolean>;
854
+ acquire(expectedProtocol?: HardwareConnectProtocol, options?: {
855
+ throwOnRunPromiseError?: boolean;
856
+ forceProtocolDetection?: boolean;
857
+ }): Promise<void>;
858
+ release(): Promise<void>;
859
+ /**
860
+ * Pre-initialize: connect + Initialize ahead of the sign.
861
+ */
862
+ preInitialize(initOptions?: InitOptions): Promise<void>;
863
+ markPreInitialized(meta?: {
864
+ passphraseState?: string;
865
+ }): void;
866
+ clearPreInitialized(): void;
867
+ isPreInitializeMetaMatch(payload?: {
868
+ passphraseState?: string;
869
+ }): boolean;
870
+ isPreInitializedValid(ttlMs: number): boolean;
871
+ setLastInitializeDuration(durationMs: number): void;
872
+ getLastInitializeDuration(): number | undefined;
873
+ getCommands(): DeviceCommands;
874
+ /**
875
+ * Canonical protocol discriminator.
876
+ *
877
+ * descriptor.protocolType is established by active probing; V2 features are mapped
878
+ * from DeviceInfoGet. All protocol branches must use this method instead of reading
879
+ * originalDescriptor.protocolType directly or inferring a protocol from features.
880
+ */
881
+ getProtocol(): 'V1' | 'V2';
882
+ isProtocolV2(): boolean;
883
+ getCurrentDeviceType(): IDeviceType;
884
+ getCurrentDeviceId(): string | undefined;
885
+ getCurrentSerialNo(): string;
886
+ getConnectId(): string;
887
+ getCurrentBleName(): string | null;
888
+ getCurrentLabel(): string | null;
889
+ getCurrentDisplayName(): string | null;
890
+ getCurrentPassphraseProtection(): boolean | null | undefined;
891
+ getCurrentFirmwareType(): EFirmwareType;
892
+ getCurrentFirmwareVersionString(): string;
893
+ getCurrentBLEFirmwareVersionString(): string | undefined;
894
+ getCurrentBootloaderVersionString(): string | undefined;
895
+ getCurrentSafetyChecks(): _onekeyfe_hd_transport.Enum_SafetyCheckLevel | null | undefined;
896
+ getCurrentMethodVersionRange(getVersionRange: (deviceModel: IDeviceType | IDeviceModel) => IVersionRange | undefined): IVersionRange | undefined;
897
+ supportNewPassphrase(): SupportFeatureType;
898
+ supportInputPinOnSoftware(): SupportFeatureType;
899
+ supportModifyHomescreen(): SupportFeatureType;
900
+ private getSessionCacheDeviceKey;
901
+ private reconcileSessionCacheDeviceIdentity;
902
+ getInternalState(_deviceId?: string): string | undefined;
903
+ getStandardInternalState(_deviceId?: string): {
904
+ passphraseState: string;
905
+ sessionId: string;
906
+ } | undefined;
907
+ updateInternalState(enablePassphrase: boolean, passphraseState: string | undefined, deviceId: string | undefined, sessionId?: string | null, featuresSessionId?: string | null, walletType?: 'standard' | 'hidden'): void;
908
+ private setInternalState;
909
+ clearInternalState(_deviceId?: string): void;
910
+ clearStandardInternalState(_deviceId?: string): void;
911
+ initialize(options?: InitOptions): Promise<void>;
912
+ /**
913
+ * Device initialization over Protocol V2.
914
+ *
915
+ * Protocol V2 bypasses legacy Initialize/GetFeatures and builds its canonical
916
+ * features state directly from DeviceInfoGet.
917
+ */
918
+ private _initializeProtocolV2;
919
+ getFeatures(): Promise<Features | undefined>;
920
+ getDeviceState(params?: DeviceStateReadOptions): Promise<DeviceState>;
921
+ _updateFeatures(protoFeatures: Messages.Features | Features, initSession?: boolean): void;
922
+ updateState(patch: DeviceStatePatch, source: DeviceStateUpdateSource): DeviceState & {
923
+ raw?: DeviceFeaturesRaw | undefined;
924
+ };
925
+ updateFeaturesPatch(patch: Partial<Features>, source: DeviceStateUpdateSource): Features | undefined;
926
+ ensureProtocolV2RuntimeContext(timeoutMs?: number): Promise<ProtocolInfo>;
927
+ probeProtocolV2RuntimeState(deviceInfo?: ProtocolV2DeviceInfo, timeoutMs?: number): Promise<Features>;
928
+ updateProtocolV2Features(deviceInfo?: ProtocolV2DeviceInfo, deviceStatus?: DeviceStatus$1 | null, runtimeMode?: ProtocolV2RuntimeMode, protocolInfo?: ProtocolInfo): Features;
929
+ updateProtocolV2Status(status: DeviceStatus$1): Features;
930
+ markTransportDisconnected(): void;
931
+ invalidateAfterWipe(): void;
932
+ markProtocolV2Reboot(rebootType: DeviceRebootType): void;
933
+ /**
934
+ * 暂时只在 acquire 后更新 Session ID
935
+ * 后续看是否有需要依据 listen 返回结果更新
936
+ * @param descriptor
937
+ */
938
+ updateDescriptor(descriptor: OneKeyDeviceInfo, forceUpdate?: boolean): void;
939
+ updateFromCache(device: Device): void;
940
+ run(fn?: () => Promise<void>, options?: RunOptions): Promise<void>;
941
+ _runInner<T>(fn: (() => Promise<T>) | undefined, options: RunOptions, runPromise: Deferred<void>): Promise<void>;
942
+ interruptionFromOutside(): Promise<void>;
943
+ interruptionFromUser(): Promise<void>;
944
+ setCancelableAction(callback: (err?: Error) => Promise<unknown>): void;
945
+ clearCancelableAction(): void;
946
+ getMode(): EOneKeyDeviceMode;
947
+ getStatus(): "available" | "occupied" | "used";
948
+ getFirmwareVersion(): IVersionArray | null;
949
+ getBLEFirmwareVersion(): IVersionArray | null;
950
+ isUsed(): boolean;
951
+ hasDeviceAcquire(): boolean;
952
+ isUsedHere(): boolean;
953
+ isUsedElsewhere(): boolean;
954
+ isBootloader(): boolean | undefined;
955
+ isRomloader(): boolean | undefined;
956
+ isInitialized(): boolean | undefined;
957
+ isSeedless(): boolean | undefined;
958
+ isUnacquired(): boolean;
959
+ hasUnexpectedMode(allow: string[], require: string[]): "ui-device_bootloader_mode" | "ui-device_not_in_bootloader_mode" | "ui-device_not_initialized" | "ui-device_seedless" | null;
960
+ hasUsePassphrase(): boolean;
961
+ checkDeviceId(deviceId: string): boolean;
962
+ lockDevice(): Promise<Success$1>;
963
+ beginProtocolV2UiInteraction(): void;
964
+ createProtocolV2UiPhaseMetadata(phase: HardwareUiInteractionMeta['phase'], transition: HardwareUiInteractionMeta['transition'], options?: {
965
+ phaseId?: string;
966
+ outcome?: HardwareUiInteractionMeta['outcome'];
967
+ }): HardwareUiInteractionMeta | undefined;
968
+ completeProtocolV2UiPhase(phase: HardwareUiInteractionMeta, outcome?: HardwareUiInteractionMeta['outcome']): HardwareUiInteractionMeta | undefined;
969
+ finishProtocolV2UiInteraction(outcome?: HardwareUiInteractionMeta['outcome'], options?: {
970
+ ensureMetadata?: boolean;
971
+ }): HardwareUiInteractionMeta | undefined;
972
+ hasOpenProtocolV2UiInteraction(): boolean;
973
+ supportUnlockVersionRange(): DeviceFirmwareRange;
974
+ unlockDevice(pinType?: DeviceSessionPinType, options?: ProtocolV2UiEventMetadata & {
975
+ emitUiEvent?: boolean;
976
+ }): Promise<Features | undefined>;
977
+ checkPassphraseStateSafety(passphraseState?: string, useEmptyPassphrase?: boolean, skipPassphraseCheck?: boolean, deriveCardano?: boolean): Promise<boolean>;
978
+ }
819
979
 
820
- declare function checkBridgeStatus(): Response<boolean>;
980
+ /**
981
+ * SDK Tracing Utilities
982
+ * Tracks object instances and request call chains across multiple SDK instances
983
+ */
984
+ /**
985
+ * Generate SDK instance ID
986
+ * @returns Format: "SDK-<number>-<timestamp>"
987
+ * @example "SDK-1-123456"
988
+ */
989
+ declare function generateSdkInstanceId(): string;
990
+ /**
991
+ * Generate globally unique instance ID
992
+ * @param type Instance type (Device, DeviceCommands, BaseMethod, etc.)
993
+ * @param sdkInstanceId SDK instance ID (optional)
994
+ * @returns Format: <SDK>.<type>-<number>-<timestamp>
995
+ * @example "SDK-1.Device-1-123456" or "Device-1-123456"
996
+ */
997
+ declare function generateInstanceId(type: string, sdkInstanceId?: string): string;
998
+ /**
999
+ * Request context information
1000
+ */
1001
+ interface RequestContext {
1002
+ /** Request unique ID (reuses BaseMethod.responseID) */
1003
+ responseID: number;
1004
+ /** SDK instance ID */
1005
+ sdkInstanceId?: string;
1006
+ /** API method name */
1007
+ methodName: string;
1008
+ /** Device connection ID */
1009
+ connectId?: string;
1010
+ /** Device instance ID */
1011
+ deviceInstanceId?: string;
1012
+ /** DeviceCommands instance ID */
1013
+ commandsInstanceId?: string;
1014
+ /** Parent request ID (for nested calls like allNetworkGetAddress) */
1015
+ parentResponseID?: number;
1016
+ /** Request start time */
1017
+ startTime: number;
1018
+ /** Request end time */
1019
+ endTime?: number;
1020
+ /** Request status */
1021
+ status?: 'pending' | 'running' | 'success' | 'error' | 'cancelled';
1022
+ /** Error message */
1023
+ error?: string;
1024
+ }
1025
+ /**
1026
+ * SDK instance tracing context
1027
+ */
1028
+ interface SdkTracingContext {
1029
+ /** SDK instance ID */
1030
+ sdkInstanceId: string;
1031
+ /** Creation timestamp */
1032
+ createdAt: number;
1033
+ /** Active requests */
1034
+ activeRequests: Map<number, RequestContext>;
1035
+ }
1036
+ /**
1037
+ * Create SDK instance tracing context
1038
+ */
1039
+ declare function createSdkTracingContext(): SdkTracingContext;
1040
+ /**
1041
+ * Create and register request context
1042
+ * @param responseID Request ID (reuses BaseMethod.responseID)
1043
+ * @param methodName API method name
1044
+ * @param options Additional options
1045
+ */
1046
+ declare function createRequestContext(responseID: number, methodName: string, options?: {
1047
+ sdkInstanceId?: string;
1048
+ connectId?: string;
1049
+ deviceInstanceId?: string;
1050
+ commandsInstanceId?: string;
1051
+ parentResponseID?: number;
1052
+ }): RequestContext;
1053
+ /**
1054
+ * Update request context
1055
+ */
1056
+ declare function updateRequestContext(responseID: number, updates: Partial<RequestContext>): void;
1057
+ /**
1058
+ * Complete request context
1059
+ */
1060
+ declare function completeRequestContext(responseID: number, error?: Error): void;
1061
+ /**
1062
+ * Get active requests for specific Device instance
1063
+ */
1064
+ declare function getActiveRequestsByDeviceInstance(deviceInstanceId: string): RequestContext[];
1065
+ /**
1066
+ * Format request context for logging
1067
+ */
1068
+ declare function formatRequestContext(context: RequestContext): string;
1069
+ /**
1070
+ * Cleanup specific SDK instance
1071
+ */
1072
+ declare function cleanupSdkInstance(sdkInstanceId: string): void;
821
1073
 
822
- type CheckBridgeReleaseResponse = {
823
- shouldUpdate: boolean;
824
- status: 'outdated' | 'valid';
825
- releaseVersion: string;
826
- } | null;
827
- declare function checkBridgeRelease(connectId?: string, params?: CommonParams & {
828
- willUpdateFirmwareVersion?: string;
829
- }): Response<CheckBridgeReleaseResponse>;
1074
+ declare class Core extends EventEmitter {
1075
+ private tracingContext;
1076
+ readonly sdkInstanceId: string;
1077
+ private requestQueue;
1078
+ private disposePromise?;
1079
+ private prePendingCallPromise;
1080
+ private methodSynchronize;
1081
+ constructor();
1082
+ private getCoreContext;
1083
+ handleMessage(message: CoreMessage): Promise<any>;
1084
+ dispose(): Promise<void>;
1085
+ private disposeResources;
1086
+ }
1087
+ declare const init$1: (settings: ConnectSettings, Transport: any, plugin?: LowlevelTransportSharedPlugin) => Promise<Core | undefined>;
1088
+ declare const switchTransport: ({ env, Transport, plugin, }: {
1089
+ env: ConnectSettings['env'];
1090
+ Transport: any;
1091
+ plugin?: LowlevelTransportSharedPlugin | undefined;
1092
+ }) => void;
830
1093
 
831
- type CheckBootloaderReleaseResponse = {
832
- shouldUpdate: boolean;
833
- status: 'outdated' | 'valid';
834
- release: string | undefined;
835
- bootloaderMode: boolean;
836
- } | null;
837
- type CheckBootloaderReleaseParams = {
838
- willUpdateFirmwareVersion?: string;
839
- firmwareType?: EFirmwareType;
1094
+ declare const PRO2_WALLPAPER_WIDTH = 604;
1095
+ declare const PRO2_WALLPAPER_HEIGHT = 1024;
1096
+ type Pro2WallpaperColorFormat = 'RGB565' | 'RGB565A8';
1097
+ declare function encodePro2Wallpaper(options: {
1098
+ width: number;
1099
+ height: number;
1100
+ rgba: Uint8Array | ArrayBuffer;
1101
+ }): {
1102
+ data: Uint8Array;
1103
+ colorFormat: Pro2WallpaperColorFormat;
840
1104
  };
841
- declare function checkBootloaderRelease(connectId?: string, params?: CommonParams & CheckBootloaderReleaseParams): Response<CheckBootloaderReleaseResponse>;
842
1105
 
843
- type FirmwareRelease$2 = {
844
- shouldUpdate?: boolean;
845
- status: IDeviceFirmwareStatus;
846
- changelog?: {
847
- 'zh-CN': string;
848
- 'en-US': string;
849
- }[];
850
- release: IDeviceBLEFirmwareStatus | IBLEFirmwareReleaseInfo;
851
- bootloaderMode?: boolean;
852
- };
853
- type AllFirmwareRelease = {
854
- firmware: FirmwareRelease$2;
855
- ble: FirmwareRelease$2;
856
- bootloader?: FirmwareRelease$2;
857
- bridge?: FirmwareRelease$2;
858
- features?: Features$1;
1106
+ type DeviceUploadWallpaperParams = {
1107
+ width: number;
1108
+ height: number;
1109
+ rgba: Uint8Array | ArrayBuffer;
1110
+ fileName?: string;
1111
+ chunkSize?: number;
859
1112
  };
860
- type CheckAllFirmwareReleaseParams = {
861
- checkBridgeRelease?: boolean;
862
- firmwareType?: EFirmwareType;
1113
+ type DeviceUploadWallpaperResponse = {
1114
+ path: string;
1115
+ size: number;
1116
+ colorFormat: Pro2WallpaperColorFormat;
1117
+ message?: string;
863
1118
  };
864
- declare function checkAllFirmwareRelease(connectId?: string, params?: CommonParams & CheckAllFirmwareReleaseParams): Response<AllFirmwareRelease>;
865
1119
 
866
- type CheckFirmwareTypeAvailableParams = {
867
- deviceType: EDeviceType;
868
- firmwareType: EFirmwareType;
1120
+ type Pro2NftImage = {
1121
+ width: number;
1122
+ height: number;
1123
+ rgba: Uint8Array | ArrayBuffer;
869
1124
  };
870
- declare function checkFirmwareTypeAvailable(params: CheckFirmwareTypeAvailableParams): Response<FirmwareRelease$2 | undefined>;
871
-
872
- declare function searchDevices(params?: CommonParams): Response<SearchDevice[]>;
873
1125
 
874
- declare function getFeatures(connectId?: string, params?: CommonParams): Response<Features>;
875
-
876
- type DeviceInfoProtocol = ProtocolType | 'unknown';
877
- type DeviceInfoSource = 'features' | 'protocolV1OneKeyFeatures' | 'deviceInfo';
878
- type DeviceInfoScope = 'basic' | 'versions' | 'verify' | 'full';
879
- type GetDeviceInfoParams = {
880
- scope?: DeviceInfoScope;
881
- refresh?: boolean;
882
- includeRaw?: boolean;
883
- };
884
- type DeviceInfoMode = 'normal' | 'bootloader' | 'notInitialized' | 'unknown';
885
- type DeviceInfoStatus = {
886
- mode: DeviceInfoMode;
887
- initialized: boolean | null;
888
- bootloaderMode: boolean | null;
889
- unlocked: boolean | null;
890
- passphraseProtection: boolean | null;
891
- attachToPinEnabled?: boolean | null;
892
- unlockedAttachPin?: boolean | null;
893
- backupRequired: boolean | null;
894
- noBackup: boolean | null;
895
- language: string | null;
896
- bleEnabled: boolean | null;
897
- };
898
- type DeviceProfileVersions = {
899
- firmware: string | null;
900
- bootloader: string | null;
901
- board: string | null;
902
- ble: string | null;
903
- se01?: string | null;
904
- se02?: string | null;
905
- se03?: string | null;
906
- se04?: string | null;
907
- se01Boot?: string | null;
908
- se02Boot?: string | null;
909
- se03Boot?: string | null;
910
- se04Boot?: string | null;
1126
+ type DeviceUploadNftParams = {
1127
+ image: Pro2NftImage;
1128
+ thumbnail: Pro2NftImage;
1129
+ title: string;
1130
+ subtitle: string;
1131
+ timestampMs?: number;
1132
+ chunkSize?: number;
1133
+ paceMs?: number;
1134
+ timeoutMs?: number;
1135
+ };
1136
+ type DeviceUploadNftResponse = {
1137
+ basename: string;
1138
+ imagePath: string;
1139
+ thumbnailPath: string;
1140
+ metadataPath: string;
1141
+ totalSize: number;
1142
+ nftUpdated: true;
1143
+ message?: string;
911
1144
  };
912
- type DeviceProfileVerify = {
913
- firmwareBuildId?: string;
914
- firmwareHash?: string;
915
- bootloaderBuildId?: string;
916
- bootloaderHash?: string;
917
- boardBuildId?: string;
918
- boardHash?: string;
919
- bleBuildId?: string;
920
- bleHash?: string;
921
- se01BuildId?: string;
922
- se01Hash?: string;
923
- se02BuildId?: string;
924
- se02Hash?: string;
925
- se03BuildId?: string;
926
- se03Hash?: string;
927
- se04BuildId?: string;
928
- se04Hash?: string;
929
- se01BootBuildId?: string;
930
- se01BootHash?: string;
931
- se02BootBuildId?: string;
932
- se02BootHash?: string;
933
- se03BootBuildId?: string;
934
- se03BootHash?: string;
935
- se04BootBuildId?: string;
936
- se04BootHash?: string;
1145
+
1146
+ type FileInfo = {
1147
+ path: string;
1148
+ offset: number;
1149
+ total_size: number;
1150
+ data?: Uint8Array;
1151
+ data_hash?: number;
1152
+ processed_byte?: number;
1153
+ chunks?: number;
937
1154
  };
938
- type DeviceProfileRaw = {
939
- features?: Features;
940
- protocolV1OneKeyFeatures?: OnekeyFeatures;
941
- protocolV2DeviceInfo?: ProtocolV2DeviceInfo;
1155
+ type TestProtocolV2PingParams = CommonParams & {
1156
+ /** Firmware diagnostic echo payload, limited to 63 UTF-8 bytes. */
1157
+ message?: string;
942
1158
  };
943
- type DeviceProfile = {
944
- protocol: DeviceInfoProtocol;
945
- sources: DeviceInfoSource[];
946
- deviceType: IDeviceType;
947
- firmwareType: EFirmwareType;
948
- deviceId: string;
949
- serialNo: string;
950
- label: string | null;
951
- bleName: string | null;
952
- status: DeviceInfoStatus;
953
- versions: DeviceProfileVersions;
954
- verify?: DeviceProfileVerify;
955
- raw?: DeviceProfileRaw;
1159
+ declare function testProtocolV2Ping(connectId: string, params?: TestProtocolV2PingParams): Response<Success$1>;
1160
+ declare function deviceReboot(connectId: string, params: CommonParams & DeviceRebootParams): Response<Success$1>;
1161
+ declare function deviceGetOnboardingStatus(connectId: string, params?: CommonParams): Response<OnboardingStatus>;
1162
+ declare function deviceUploadWallpaper(connectId: string, params: CommonParams & DeviceUploadWallpaperParams): Response<DeviceUploadWallpaperResponse>;
1163
+ declare function deviceUploadNft(connectId: string, params: CommonParams & DeviceUploadNftParams): Response<DeviceUploadNftResponse>;
1164
+ declare function uploadPortfolio(connectId: string, params: {
1165
+ packageBytes: ArrayBuffer | Uint8Array | Blob;
1166
+ timeoutMs?: number | string;
1167
+ }): Response<FileInfo & {
1168
+ portfolioUpdated: true;
1169
+ }>;
1170
+
1171
+ declare const on: <T extends string, P extends (...args: any[]) => any>(type: T, fn: P) => void;
1172
+ declare const off: (type: any, fn: any) => void;
1173
+ declare const removeAllListeners: (type: any) => void;
1174
+
1175
+ declare function uiResponse(response: UiResponseEvent): void;
1176
+
1177
+ type IAddHardwareGlobalEventListener = (coreMessage: CoreMessage) => void;
1178
+ interface LowLevelInjectApi {
1179
+ call: CallMethod;
1180
+ eventEmitter: EventEmitter$1;
1181
+ init: CoreApi['init'];
1182
+ dispose: CoreApi['dispose'];
1183
+ uiResponse: CoreApi['uiResponse'];
1184
+ cancel: CoreApi['cancel'];
1185
+ updateSettings: CoreApi['updateSettings'];
1186
+ switchTransport: CoreApi['switchTransport'];
1187
+ addHardwareGlobalEventListener: (listener: IAddHardwareGlobalEventListener) => void;
1188
+ }
1189
+ type LowLevelCoreApi = Omit<CoreApi, 'on' | 'off'> & {
1190
+ addHardwareGlobalEventListener: (listener: IAddHardwareGlobalEventListener) => void;
956
1191
  };
957
- declare function getDeviceInfo(connectId?: string, params?: CommonParams & GetDeviceInfoParams): Response<DeviceProfile>;
958
1192
 
959
- declare function getOnekeyFeatures(connectId?: string, params?: CommonParams): Response<OnekeyFeatures>;
1193
+ declare function init(settings: Partial<ConnectSettings>, lowLevelApi?: LowLevelCoreApi, pulgin?: LowlevelTransportSharedPlugin): Promise<boolean>;
1194
+ declare function updateSettings(settings: Partial<ConnectSettings>): Promise<boolean>;
1195
+
1196
+ declare function testInitializeDeviceDuration(connectId?: string, params?: CommonParams): Response<number>;
960
1197
 
961
- type GetPassphraseStatePayload = {
1198
+ declare function preInitialize(connectId: string, params?: CommonParams): Response<boolean>;
1199
+
1200
+ declare function getLogs(): Response<string[]>;
1201
+
1202
+ type ClearSessionCacheParams = {
1203
+ deviceId?: never;
1204
+ passphraseState?: never;
1205
+ } | {
1206
+ deviceId: string;
962
1207
  passphraseState?: string;
963
- sessionId?: string;
964
- unlockedAttachPin?: boolean;
965
- passphraseProtection?: boolean | null;
966
1208
  };
967
- type GetPassphraseStateParams = CommonParams & {
968
- allowCreateAttachPin?: boolean;
1209
+ type ClearSessionCachePayload = {
1210
+ cleared: true;
969
1211
  };
970
- declare function getPassphraseState(connectId?: string, params?: GetPassphraseStateParams): Response<GetPassphraseStatePayload>;
1212
+ declare function clearSessionCache(params?: ClearSessionCacheParams): Response<ClearSessionCachePayload>;
971
1213
 
972
- type FirmwareRelease$1 = {
973
- status: IDeviceFirmwareStatus;
974
- changelog: {
975
- 'en-US': string;
976
- 'zh-CN': string;
977
- }[];
978
- release: IFirmwareReleaseInfo;
979
- bootloaderMode: boolean;
980
- };
981
- type CheckFirmwareReleaseParams = {
982
- firmwareType?: EFirmwareType;
983
- };
984
- declare function checkFirmwareRelease(connectId?: string, params?: CheckFirmwareReleaseParams): Response<FirmwareRelease$1>;
1214
+ declare function checkBridgeStatus(): Response<boolean>;
985
1215
 
986
- type BleFirmwareRelease = {
987
- status: IDeviceBLEFirmwareStatus;
988
- changelog: {
989
- 'zh-CN': string;
990
- 'en-US': string;
991
- }[];
992
- release: IBLEFirmwareReleaseInfo;
1216
+ type CheckBridgeReleaseResponse = {
1217
+ shouldUpdate: boolean;
1218
+ status: 'outdated' | 'valid';
1219
+ releaseVersion: string;
1220
+ } | null;
1221
+ declare function checkBridgeRelease(connectId?: string, params?: CommonParams & {
1222
+ willUpdateFirmwareVersion?: string;
1223
+ }): Response<CheckBridgeReleaseResponse>;
1224
+
1225
+ type CheckBootloaderReleaseResponse = {
1226
+ shouldUpdate: boolean;
1227
+ status: 'outdated' | 'valid';
1228
+ release: string | undefined;
993
1229
  bootloaderMode: boolean;
1230
+ } | null;
1231
+ type CheckBootloaderReleaseParams = {
1232
+ willUpdateFirmwareVersion?: string;
1233
+ firmwareType?: EFirmwareType;
994
1234
  };
995
- declare function checkBLEFirmwareRelease(connectId?: string): Response<BleFirmwareRelease>;
1235
+ declare function checkBootloaderRelease(connectId?: string, params?: CommonParams & CheckBootloaderReleaseParams): Response<CheckBootloaderReleaseResponse>;
996
1236
 
997
1237
  type IUpdateType = 'firmware' | 'ble';
998
1238
  interface FirmwareUpdateBinaryParams {
@@ -1031,21 +1271,42 @@ interface FirmwareUpdateV3Params {
1031
1271
  firmwareType?: EFirmwareType;
1032
1272
  platform: IPlatform;
1033
1273
  }
1274
+ /**
1275
+ * firmwareUpdateV4 target binaries grouped by DeviceFirmwareTargetType.
1276
+ * Except for romloader, each field maps to a target accepted by bootloader.
1277
+ */
1278
+ type FirmwareUpdateV4Target = 'boot' | 'boot_resources' | 'app_v1' | 'app_v2' | 'coprocessor' | 'resource' | 'se01' | 'se02' | 'se03' | 'se04';
1034
1279
  interface FirmwareUpdateV4Params {
1035
1280
  platform: IPlatform;
1036
1281
  chunkSize?: number;
1037
1282
  firmwareType?: EFirmwareType;
1283
+ targetsToUpdate?: FirmwareUpdateV4Target[];
1284
+ /** FW_MGMT_TARGET_ROMLOADER = 2; Pro2 cannot install it through firmwareUpdateV4. */
1038
1285
  romloaderBinary?: ArrayBuffer;
1286
+ /** FW_MGMT_TARGET_BOOTLOADER = 3 */
1039
1287
  bootloaderBinary?: ArrayBuffer;
1288
+ /** FW_MGMT_TARGET_CRATE = 1; optional Pro2 startup resources. */
1289
+ bootResourcesBinary?: ArrayBuffer;
1290
+ /** FW_MGMT_TARGET_APPLICATION_P1 = 4 */
1040
1291
  applicationP1Binary?: ArrayBuffer;
1292
+ /** FW_MGMT_TARGET_APPLICATION_P2 = 5 */
1041
1293
  applicationP2Binary?: ArrayBuffer;
1294
+ /** FW_MGMT_TARGET_COPROCESSOR = 6 */
1042
1295
  coprocessorBinary?: ArrayBuffer;
1296
+ /** FW_MGMT_TARGET_SE01-04 = 7-10 */
1043
1297
  se01Binary?: ArrayBuffer;
1044
1298
  se02Binary?: ArrayBuffer;
1045
1299
  se03Binary?: ArrayBuffer;
1046
1300
  se04Binary?: ArrayBuffer;
1047
- resourceBinaries?: ArrayBuffer[];
1048
1301
  forcedUpdateRes?: boolean;
1302
+ /**
1303
+ * RESC bundle okpkg files written directly to devicePath through FilesystemFileWrite.
1304
+ * Manual mode installs them without version comparison.
1305
+ */
1306
+ resourceBundleFiles?: Array<{
1307
+ binary: ArrayBuffer;
1308
+ devicePath: string;
1309
+ }>;
1049
1310
  }
1050
1311
  declare function firmwareUpdateV3(connectId: string | undefined, params: Params<FirmwareUpdateV3Params>): Response<{
1051
1312
  bleVersion: string;
@@ -1058,6 +1319,143 @@ declare function firmwareUpdateV4(connectId: string | undefined, params: Params<
1058
1319
  bootloaderVersion: string;
1059
1320
  }>;
1060
1321
 
1322
+ type FirmwareRelease$2 = {
1323
+ shouldUpdate?: boolean;
1324
+ status: IDeviceFirmwareStatus;
1325
+ changelog?: {
1326
+ 'zh-CN': string;
1327
+ 'en-US': string;
1328
+ }[];
1329
+ release: IDeviceBLEFirmwareStatus | IBLEFirmwareReleaseInfo | IFirmwareReleaseInfo;
1330
+ bootloaderMode?: boolean;
1331
+ };
1332
+ type ProtocolV2FirmwareComponentReleaseStatus = 'valid' | 'outdated' | 'unknown' | 'unsupported';
1333
+ type ProtocolV2FirmwareReleaseStatus = 'unavailable' | 'valid' | 'unknown' | 'outdated' | 'required';
1334
+ type ProtocolV2FirmwareComponentRelease = {
1335
+ configKey: string;
1336
+ componentTarget: IProtocolV2FirmwareComponentTarget;
1337
+ updateTarget: FirmwareUpdateV4Target | null;
1338
+ currentVersion: string | null;
1339
+ targetVersion: string | null;
1340
+ status: ProtocolV2FirmwareComponentReleaseStatus;
1341
+ required: boolean;
1342
+ };
1343
+ type AllFirmwareRelease = {
1344
+ firmware: FirmwareRelease$2;
1345
+ ble: FirmwareRelease$2;
1346
+ bootloader?: FirmwareRelease$2;
1347
+ bridge?: FirmwareRelease$2;
1348
+ features?: Features;
1349
+ protocol?: 'V1' | 'V2';
1350
+ deviceType?: 'pro2';
1351
+ firmwareType?: EFirmwareType;
1352
+ status?: ProtocolV2FirmwareReleaseStatus;
1353
+ hasUpgrade?: boolean;
1354
+ required?: boolean;
1355
+ resourceStatus?: 'valid' | 'outdated' | 'unknown';
1356
+ currentVersions?: DeviceStateVersions;
1357
+ components?: ProtocolV2FirmwareComponentRelease[];
1358
+ targetsToUpdate?: FirmwareUpdateV4Target[];
1359
+ release?: IFirmwareReleaseInfo;
1360
+ };
1361
+ type CheckAllFirmwareReleaseParams = {
1362
+ checkBridgeRelease?: boolean;
1363
+ firmwareType?: EFirmwareType;
1364
+ };
1365
+ declare function checkAllFirmwareRelease(connectId?: string, params?: CommonParams & CheckAllFirmwareReleaseParams): Response<AllFirmwareRelease>;
1366
+
1367
+ type CheckFirmwareTypeAvailableParams = {
1368
+ deviceType: EDeviceType;
1369
+ firmwareType: EFirmwareType;
1370
+ };
1371
+ declare function checkFirmwareTypeAvailable(params: CheckFirmwareTypeAvailableParams): Response<FirmwareRelease$2 | undefined>;
1372
+
1373
+ declare function searchDevices(params?: CommonParams): Response<SearchDevice[]>;
1374
+
1375
+ declare function detectDeviceConnectProtocol(connectId: string): Response<HardwareConnectProtocol>;
1376
+
1377
+ /**
1378
+ * @deprecated Use `getDeviceState` for both Protocol V1 and Protocol V2 devices.
1379
+ */
1380
+ declare function getFeatures(connectId?: string, params?: CommonParams): Response<Features>;
1381
+
1382
+ /**
1383
+ * @deprecated Use `getDeviceState(connectId, { scope: 'firmware' })`.
1384
+ */
1385
+ declare function getOnekeyFeatures(connectId?: string, params?: CommonParams): Response<OnekeyFeatures>;
1386
+
1387
+ type GetPassphraseStateParams = CommonParams;
1388
+ /**
1389
+ * Compatibility wallet-state API for existing App integrations.
1390
+ *
1391
+ * Protocol V1 keeps its parameterless firmware flow. Protocol V2 maps the existing
1392
+ * `useEmptyPassphrase` and `initSession` intent to the device-only wallet-session flow.
1393
+ * New integrations should prefer `openWalletSession` for explicit wallet intent.
1394
+ */
1395
+ declare function getPassphraseState(connectId?: string, params?: GetPassphraseStateParams): Response<string | undefined>;
1396
+
1397
+ declare const OpenWalletSessionMode: {
1398
+ readonly Standard: "standard";
1399
+ readonly SelectHidden: "select-hidden";
1400
+ readonly ResumeHidden: "resume-hidden";
1401
+ };
1402
+ type OpenWalletSessionModeValue = (typeof OpenWalletSessionMode)[keyof typeof OpenWalletSessionMode];
1403
+ type OpenWalletSessionParams = {
1404
+ mode: typeof OpenWalletSessionMode.Standard;
1405
+ deviceId?: never;
1406
+ passphraseState?: never;
1407
+ } | {
1408
+ mode: typeof OpenWalletSessionMode.SelectHidden;
1409
+ deviceId?: never;
1410
+ passphraseState?: never;
1411
+ } | {
1412
+ mode: typeof OpenWalletSessionMode.ResumeHidden;
1413
+ deviceId: string;
1414
+ passphraseState: string;
1415
+ };
1416
+ type OpenWalletSessionPayloadBase = {
1417
+ protocol: 'V1' | 'V2';
1418
+ deviceId: string;
1419
+ resumed: boolean;
1420
+ };
1421
+ type OpenWalletSessionPayload = OpenWalletSessionPayloadBase & ({
1422
+ walletType: 'standard';
1423
+ passphraseState: null;
1424
+ } | {
1425
+ walletType: 'hidden';
1426
+ passphraseState: string;
1427
+ });
1428
+ /**
1429
+ * Opens the standard, hidden, or Attach-to-PIN wallet flow through a unified
1430
+ * Protocol V1/V2 API.
1431
+ */
1432
+ declare function openWalletSession(connectId: string, params: CommonParams & OpenWalletSessionParams): Response<OpenWalletSessionPayload>;
1433
+
1434
+ type FirmwareRelease$1 = {
1435
+ status: IDeviceFirmwareStatus;
1436
+ changelog: {
1437
+ 'en-US': string;
1438
+ 'zh-CN': string;
1439
+ }[];
1440
+ release: IFirmwareReleaseInfo;
1441
+ bootloaderMode: boolean;
1442
+ };
1443
+ type CheckFirmwareReleaseParams = {
1444
+ firmwareType?: EFirmwareType;
1445
+ };
1446
+ declare function checkFirmwareRelease(connectId?: string, params?: CheckFirmwareReleaseParams): Response<FirmwareRelease$1>;
1447
+
1448
+ type BleFirmwareRelease = {
1449
+ status: IDeviceBLEFirmwareStatus;
1450
+ changelog: {
1451
+ 'zh-CN': string;
1452
+ 'en-US': string;
1453
+ }[];
1454
+ release: IBLEFirmwareReleaseInfo;
1455
+ bootloaderMode: boolean;
1456
+ };
1457
+ declare function checkBLEFirmwareRelease(connectId?: string): Response<BleFirmwareRelease>;
1458
+
1061
1459
  declare function promptWebDeviceAccess(options?: {
1062
1460
  deviceSerialNumberFromUI?: string;
1063
1461
  }): Response<{
@@ -1117,16 +1515,40 @@ type DeviceSettingsParams = {
1117
1515
  language?: string;
1118
1516
  label?: string;
1119
1517
  usePassphrase?: boolean;
1518
+ /** Protocol V1 only. */
1120
1519
  homescreen?: string;
1520
+ /** Protocol V1 only. */
1121
1521
  passphraseSource?: number;
1122
1522
  autoLockDelayMs?: number;
1523
+ /** Protocol V1 only. */
1123
1524
  displayRotation?: number;
1525
+ /** Protocol V1 only. */
1124
1526
  passphraseAlwaysOnDevice?: boolean;
1125
- safetyChecks?: SafetyCheckLevel;
1527
+ /** Protocol V1 only. Uses Enum_SafetyCheckLevel numeric values. */
1528
+ safetyChecks?: Enum_SafetyCheckLevel;
1529
+ /** Protocol V1 only; the current Protocol V2 schema has no matching field. */
1126
1530
  experimentalFeatures?: boolean;
1127
1531
  autoShutdownDelayMs?: number;
1532
+ /** Protocol V1 only; opens the legacy device-side brightness flow. */
1128
1533
  changeBrightness?: boolean;
1534
+ /** Protocol V2 only. */
1535
+ brightness?: number;
1129
1536
  hapticFeedback?: boolean;
1537
+ bluetoothEnabled?: boolean;
1538
+ /** Protocol V2 only; changed through an on-device confirmation page. */
1539
+ airgapMode?: boolean;
1540
+ /** Protocol V2 only. */
1541
+ animationEnabled?: boolean;
1542
+ /** Protocol V2 only. */
1543
+ tapToWake?: boolean;
1544
+ /** Protocol V2 only. */
1545
+ deviceNameDisplayEnabled?: boolean;
1546
+ /** Protocol V2 only. */
1547
+ fidoEnabled?: boolean;
1548
+ /** Protocol V2 only. */
1549
+ usbLockEnabled?: boolean;
1550
+ /** Protocol V2 only. */
1551
+ randomKeypad?: boolean;
1130
1552
  };
1131
1553
  declare function deviceSettings(connectId: string, params: CommonParams & DeviceSettingsParams): Response<Success$1>;
1132
1554
 
@@ -1152,7 +1574,7 @@ type DeviceUploadResourceResponse = Success$1 & {
1152
1574
  declare function deviceUploadResource(connectId: string, params: CommonParams & DeviceUploadResourceParams): Response<DeviceUploadResourceResponse>;
1153
1575
 
1154
1576
  type DeviceSupportFeatures = SupportFeatures & {
1155
- device: Device | null;
1577
+ device: Device$1 | null;
1156
1578
  };
1157
1579
  declare function deviceSupportFeatures(connectId?: string): Response<DeviceSupportFeatures>;
1158
1580
 
@@ -1168,7 +1590,7 @@ declare function deviceUpdateBootloader(connectId: string, params?: DeviceUpdate
1168
1590
 
1169
1591
  declare function deviceLock(connectId: string, params: CommonParams): Response<Success$1>;
1170
1592
 
1171
- declare function deviceUnlock(connectId: string, params?: CommonParams): Response<Features$1>;
1593
+ declare function deviceUnlock(connectId: string, params?: CommonParams): Response<Features>;
1172
1594
 
1173
1595
  declare function deviceCancel(connectId: string, params: CommonParams): Response<Success$1>;
1174
1596
 
@@ -1372,6 +1794,9 @@ type AllNetworkAddressParams = {
1372
1794
  type AllNetworkAddressPayload = {
1373
1795
  address: string;
1374
1796
  pub?: string;
1797
+ /**
1798
+ * @deprecated Use `pub` instead.
1799
+ */
1375
1800
  publicKey?: string;
1376
1801
  npub?: string;
1377
1802
  } | {
@@ -1437,6 +1862,9 @@ declare function evmGetAddress(connectId: string, deviceId: string, params: Comm
1437
1862
  type EVMPublicKey = {
1438
1863
  path: string;
1439
1864
  pub: string;
1865
+ /**
1866
+ * @deprecated Use `pub` instead.
1867
+ */
1440
1868
  publicKey?: string;
1441
1869
  } & EthereumPublicKey;
1442
1870
  type EVMGetPublicKeyParams = {
@@ -2220,6 +2648,9 @@ declare function nearSignTransaction(connectId: string, deviceId: string, params
2220
2648
  type AptosAddress = {
2221
2649
  path: string;
2222
2650
  pub?: string;
2651
+ /**
2652
+ * @deprecated Use `pub` instead.
2653
+ */
2223
2654
  publicKey?: string;
2224
2655
  } & AptosAddress$1;
2225
2656
  type AptosGetAddressParams = {
@@ -2234,6 +2665,9 @@ declare function aptosGetAddress(connectId: string, deviceId: string, params: Co
2234
2665
  type AptosPublicKey = {
2235
2666
  path: string;
2236
2667
  pub: string;
2668
+ /**
2669
+ * @deprecated Use `pub` instead.
2670
+ */
2237
2671
  publicKey?: string;
2238
2672
  };
2239
2673
  type AptosGetPublicKeyParams = {
@@ -2318,6 +2752,9 @@ declare function cosmosGetAddress(connectId: string, deviceId: string, params: C
2318
2752
  type CosmosPublicKey = {
2319
2753
  path: string;
2320
2754
  pub: string;
2755
+ /**
2756
+ * @deprecated Use `pub` instead.
2757
+ */
2321
2758
  publicKey?: string;
2322
2759
  };
2323
2760
  type CosmosGetPublicKeyParams = {
@@ -2342,6 +2779,9 @@ declare function cosmosSignTransaction(connectId: string, deviceId: string, para
2342
2779
  type XrpAddress = {
2343
2780
  path: string;
2344
2781
  pub?: string;
2782
+ /**
2783
+ * @deprecated Use `pub` instead.
2784
+ */
2345
2785
  publicKey?: string;
2346
2786
  address: string;
2347
2787
  };
@@ -2375,6 +2815,9 @@ declare function xrpSignTransaction(connectId: string, deviceId: string, params:
2375
2815
  type SuiAddress = {
2376
2816
  path: string;
2377
2817
  pub?: string;
2818
+ /**
2819
+ * @deprecated Use `pub` instead.
2820
+ */
2378
2821
  publicKey?: string;
2379
2822
  } & SuiAddress$1;
2380
2823
  type SuiGetAddressParams = {
@@ -2389,6 +2832,9 @@ declare function suiGetAddress(connectId: string, deviceId: string, params: Comm
2389
2832
  type SuiPublicKey = {
2390
2833
  path: string;
2391
2834
  pub: string;
2835
+ /**
2836
+ * @deprecated Use `pub` instead.
2837
+ */
2392
2838
  publicKey?: string;
2393
2839
  };
2394
2840
  type SuiGetPublicKeyParams = {
@@ -2418,6 +2864,10 @@ declare function suiSignTransaction(connectId: string, deviceId: string, params:
2418
2864
  type CardanoGetAddressMethodParams = {
2419
2865
  addressParameters: CardanoAddressParameters;
2420
2866
  networkId: number;
2867
+ /**
2868
+ * Testnet cip34:0-1097911063
2869
+ * Mainnet cip34:1-764824073
2870
+ */
2421
2871
  protocolMagic: number;
2422
2872
  derivationType: number;
2423
2873
  address?: string;
@@ -2479,6 +2929,10 @@ type CardanoSignMessageMethodParams = {
2479
2929
  derivationType: number;
2480
2930
  networkId: number;
2481
2931
  addressType?: Messages.CardanoAddressType;
2932
+ /**
2933
+ * Testnet cip34:0-1097911063
2934
+ * Mainnet cip34:1-764824073
2935
+ */
2482
2936
  protocolMagic?: number;
2483
2937
  };
2484
2938
  declare function cardanoSignMessage(connectId: string, deviceId: string, params: CommonParams & CardanoSignMessageMethodParams): Response<CardanoMessageSignature>;
@@ -2512,6 +2966,9 @@ declare function filecoinSignTransaction(connectId: string, deviceId: string, pa
2512
2966
  type PolkadotAddress = {
2513
2967
  path: string;
2514
2968
  pub: string;
2969
+ /**
2970
+ * @deprecated Use `pub` instead.
2971
+ */
2515
2972
  publicKey?: string;
2516
2973
  } & PolkadotAddress$1;
2517
2974
  type PolkadotGetAddressParams = {
@@ -2570,23 +3027,61 @@ type KaspaSignInputParams = {
2570
3027
  sequenceNumber: number | string;
2571
3028
  output: {
2572
3029
  satoshis: number | string;
2573
- script: string;
3030
+ script?: string;
2574
3031
  };
2575
3032
  sigOpCount?: number;
2576
3033
  };
2577
3034
  type KaspaSignOutputParams = {
2578
3035
  satoshis: number | string;
3036
+ address?: string;
3037
+ addressN?: string | number[];
3038
+ script?: string;
3039
+ scriptVersion?: number;
3040
+ };
3041
+ type KaspaStreamingSignInputParams = Omit<KaspaSignInputParams, 'output'> & {
3042
+ output: {
3043
+ satoshis: number | string;
3044
+ script?: string;
3045
+ };
3046
+ };
3047
+ type KaspaStreamingSignOutputParams = {
3048
+ satoshis: number | string;
3049
+ address?: string;
3050
+ addressN?: string | number[];
3051
+ script?: string;
3052
+ scriptVersion?: number;
3053
+ };
3054
+ type KaspaRefTransactionInput = {
3055
+ prevTxId: string;
3056
+ outputIndex: number;
3057
+ sequenceNumber: number | string;
3058
+ };
3059
+ type KaspaRefTransactionOutput = {
3060
+ satoshis: number | string;
3061
+ scriptVersion?: number;
2579
3062
  script: string;
2580
- scriptVersion: number;
3063
+ };
3064
+ type KaspaRefTransaction = {
3065
+ txId: string;
3066
+ version: number;
3067
+ inputs: KaspaRefTransactionInput[];
3068
+ outputs: KaspaRefTransactionOutput[];
3069
+ lockTime?: number | string;
3070
+ subNetworkID?: string;
3071
+ gas?: number | string;
3072
+ payload?: string;
2581
3073
  };
2582
3074
  type KaspaSignTransactionParams = {
2583
3075
  version: number;
2584
- inputs: KaspaSignInputParams[];
2585
- outputs: KaspaSignOutputParams[];
3076
+ inputs: Array<KaspaSignInputParams | KaspaStreamingSignInputParams>;
3077
+ outputs: Array<KaspaSignOutputParams | KaspaStreamingSignOutputParams>;
2586
3078
  lockTime: number | string;
2587
3079
  sigHashType?: SignatureType;
2588
3080
  sigOpCount?: number;
2589
3081
  subNetworkID?: string;
3082
+ payload?: string;
3083
+ gas?: number | string;
3084
+ refTxs?: KaspaRefTransaction[];
2590
3085
  scheme?: string;
2591
3086
  prefix?: string;
2592
3087
  useTweak?: boolean;
@@ -2631,6 +3126,9 @@ declare function nexaSignTransaction(connectId: string, deviceId: string, params
2631
3126
  type NostrPublicKey = {
2632
3127
  npub?: string;
2633
3128
  pub?: string;
3129
+ /**
3130
+ * @deprecated Use `pub` instead.
3131
+ */
2634
3132
  publicKey?: string;
2635
3133
  path: string;
2636
3134
  };
@@ -2727,6 +3225,9 @@ declare function nostrSignSchnorr(connectId: string, deviceId: string, params: C
2727
3225
 
2728
3226
  interface LnurlAuth {
2729
3227
  pub?: string;
3228
+ /**
3229
+ * @deprecated Use `pub` instead.
3230
+ */
2730
3231
  publickey?: string;
2731
3232
  path?: string;
2732
3233
  signature?: string;
@@ -2803,6 +3304,9 @@ declare function dnxSignTransaction(connectId: string, deviceId: string, params:
2803
3304
  type TonAddress = {
2804
3305
  path: string;
2805
3306
  pub: string;
3307
+ /**
3308
+ * @deprecated Use `pub` instead.
3309
+ */
2806
3310
  publicKey?: string;
2807
3311
  address: string;
2808
3312
  };
@@ -2914,6 +3418,9 @@ declare function scdoSignTransaction(connectId: string, deviceId: string, params
2914
3418
 
2915
3419
  type AlephiumAddress = {
2916
3420
  path: string;
3421
+ /**
3422
+ * @deprecated Use `pub` instead.
3423
+ */
2917
3424
  publicKey?: string;
2918
3425
  pub?: string;
2919
3426
  address: string;
@@ -3016,13 +3523,21 @@ type NeoSignedTx = {
3016
3523
  declare function neoSignTransaction(connectId: string, deviceId: string, params: CommonParams & NeoUnsignedTx): Response<NeoSignedTx>;
3017
3524
 
3018
3525
  type CoreApi = {
3526
+ /**
3527
+ * Inject function
3528
+ */
3019
3529
  init: typeof init;
3020
3530
  on: typeof on;
3021
3531
  off: typeof off;
3022
3532
  emit: (event: string, ...args: any[]) => void;
3023
3533
  removeAllListeners: typeof removeAllListeners;
3024
- dispose: () => void;
3534
+ dispose: () => void | Promise<void>;
3025
3535
  call: (params: any) => Promise<any>;
3536
+ /**
3537
+ * Bind a protocol that has already been verified for one transport endpoint.
3538
+ * Every later SDK call for the same connectId uses it as a strict expectation.
3539
+ */
3540
+ setDeviceConnectProtocol: (connectId: string, connectProtocol: HardwareConnectProtocol | undefined) => void;
3026
3541
  uiResponse: typeof uiResponse;
3027
3542
  cancel: (connectId?: string) => void;
3028
3543
  updateSettings: typeof updateSettings;
@@ -3030,19 +3545,32 @@ type CoreApi = {
3030
3545
  success: boolean;
3031
3546
  }>;
3032
3547
  getLogs: typeof getLogs;
3548
+ clearSessionCache: typeof clearSessionCache;
3549
+ /**
3550
+ * Test function
3551
+ */
3033
3552
  testInitializeDeviceDuration: typeof testInitializeDeviceDuration;
3553
+ testProtocolV2Ping: typeof testProtocolV2Ping;
3034
3554
  preInitialize: typeof preInitialize;
3555
+ /**
3556
+ * Core function
3557
+ */
3035
3558
  checkAllFirmwareRelease: typeof checkAllFirmwareRelease;
3036
3559
  checkBridgeStatus: typeof checkBridgeStatus;
3037
3560
  checkBridgeRelease: typeof checkBridgeRelease;
3038
3561
  checkBootloaderRelease: typeof checkBootloaderRelease;
3039
3562
  checkFirmwareTypeAvailable: typeof checkFirmwareTypeAvailable;
3563
+ /**
3564
+ * Device function
3565
+ */
3040
3566
  searchDevices: typeof searchDevices;
3567
+ detectDeviceConnectProtocol: typeof detectDeviceConnectProtocol;
3041
3568
  promptWebDeviceAccess: typeof promptWebDeviceAccess;
3042
3569
  getFeatures: typeof getFeatures;
3043
- getDeviceInfo: typeof getDeviceInfo;
3570
+ getDeviceState: typeof getDeviceState;
3044
3571
  getOnekeyFeatures: typeof getOnekeyFeatures;
3045
3572
  getPassphraseState: typeof getPassphraseState;
3573
+ openWalletSession: typeof openWalletSession;
3046
3574
  deviceBackup: typeof deviceBackup;
3047
3575
  deviceChangePin: typeof deviceChangePin;
3048
3576
  deviceFlags: typeof deviceFlags;
@@ -3070,33 +3598,22 @@ type CoreApi = {
3070
3598
  firmwareUpdateV3: typeof firmwareUpdateV3;
3071
3599
  firmwareUpdateV4: typeof firmwareUpdateV4;
3072
3600
  cipherKeyValue: typeof cipherKeyValue;
3073
- protocolInfoRequest: typeof protocolInfoRequest;
3074
- ping: typeof ping;
3601
+ /**
3602
+ * Pro2 business API
3603
+ */
3075
3604
  deviceReboot: typeof deviceReboot;
3076
- deviceInfoGet: typeof deviceInfoGet;
3077
- deviceFirmwareUpdate: typeof deviceFirmwareUpdate;
3078
- deviceGetFirmwareUpdateStatus: typeof deviceGetFirmwareUpdateStatus;
3079
- deviceFactoryInfoSet: typeof deviceFactoryInfoSet;
3080
- deviceFactoryInfoGet: typeof deviceFactoryInfoGet;
3081
- filesystemPermissionFix: typeof filesystemPermissionFix;
3082
- fileRead: typeof fileRead;
3083
- fileWrite: typeof fileWrite;
3084
- fileDelete: typeof fileDelete;
3085
- dirList: typeof dirList;
3086
- dirMake: typeof dirMake;
3087
- dirRemove: typeof dirRemove;
3088
- pathInfo: typeof pathInfo;
3089
- filesystemFileRead: typeof filesystemFileRead;
3090
- filesystemFileWrite: typeof filesystemFileWrite;
3091
- filesystemFileDelete: typeof filesystemFileDelete;
3092
- filesystemDirList: typeof filesystemDirList;
3093
- filesystemDirMake: typeof filesystemDirMake;
3094
- filesystemDirRemove: typeof filesystemDirRemove;
3095
- filesystemPathInfoQuery: typeof filesystemPathInfoQuery;
3096
- filesystemFormat: typeof filesystemFormat;
3097
- filesystemDiskControl: typeof filesystemDiskControl;
3605
+ deviceGetOnboardingStatus: typeof deviceGetOnboardingStatus;
3606
+ deviceUploadNft: typeof deviceUploadNft;
3607
+ deviceUploadWallpaper: typeof deviceUploadWallpaper;
3608
+ uploadPortfolio: typeof uploadPortfolio;
3609
+ /**
3610
+ * All network function
3611
+ */
3098
3612
  allNetworkGetAddress: typeof allNetworkGetAddress;
3099
3613
  allNetworkGetAddressByLoop: typeof allNetworkGetAddressByLoop;
3614
+ /**
3615
+ * EVM function
3616
+ */
3100
3617
  evmGetAddress: typeof evmGetAddress;
3101
3618
  evmGetPublicKey: typeof evmGetPublicKey;
3102
3619
  evmSignMessage: typeof evmSignMessage;
@@ -3104,86 +3621,167 @@ type CoreApi = {
3104
3621
  evmSignTransaction: typeof evmSignTransaction;
3105
3622
  evmSignTypedData: typeof evmSignTypedData;
3106
3623
  evmVerifyMessage: typeof evmVerifyMessage;
3624
+ /**
3625
+ * BTC function
3626
+ */
3107
3627
  btcGetAddress: typeof btcGetAddress;
3108
3628
  btcGetPublicKey: typeof btcGetPublicKey;
3109
3629
  btcSignMessage: typeof btcSignMessage;
3110
3630
  btcSignPsbt: typeof btcSignPsbt;
3111
3631
  btcSignTransaction: typeof btcSignTransaction;
3112
3632
  btcVerifyMessage: typeof btcVerifyMessage;
3633
+ /**
3634
+ * Starcoin function
3635
+ */
3113
3636
  starcoinGetAddress: typeof starcoinGetAddress;
3114
3637
  starcoinGetPublicKey: typeof starcoinGetPublicKey;
3115
3638
  starcoinSignMessage: typeof starcoinSignMessage;
3116
3639
  starcoinSignTransaction: typeof starcoinSignTransaction;
3117
3640
  starcoinVerifyMessage: typeof starcoinVerifyMessage;
3641
+ /**
3642
+ * Nem function
3643
+ */
3118
3644
  nemGetAddress: typeof nemGetAddress;
3119
3645
  nemSignTransaction: typeof nemSignTransaction;
3646
+ /**
3647
+ * Solana function
3648
+ */
3120
3649
  solGetAddress: typeof solGetAddress;
3121
3650
  solSignTransaction: typeof solSignTransaction;
3122
3651
  solSignOffchainMessage: typeof solSignOffchainMessage;
3123
3652
  solSignMessage: typeof solSignMessage;
3653
+ /**
3654
+ * Stellar function
3655
+ */
3124
3656
  stellarGetAddress: typeof stellarGetAddress;
3125
3657
  stellarSignTransaction: typeof stellarSignTransaction;
3658
+ /**
3659
+ * Tron function
3660
+ */
3126
3661
  tronGetAddress: typeof tronGetAddress;
3127
3662
  tronSignMessage: typeof tronSignMessage;
3128
3663
  tronSignTransaction: typeof tronSignTransaction;
3664
+ /**
3665
+ * Conflux function
3666
+ */
3129
3667
  confluxGetAddress: typeof confluxGetAddress;
3130
3668
  confluxSignMessage: typeof confluxSignMessage;
3131
3669
  confluxSignMessageCIP23: typeof confluxSignMessageCIP23;
3132
3670
  confluxSignTransaction: typeof confluxSignTransaction;
3671
+ /**
3672
+ * Near function
3673
+ */
3133
3674
  nearGetAddress: typeof nearGetAddress;
3134
3675
  nearSignTransaction: typeof nearSignTransaction;
3676
+ /**
3677
+ * Aptos function
3678
+ */
3135
3679
  aptosGetAddress: typeof aptosGetAddress;
3136
3680
  aptosGetPublicKey: typeof aptosGetPublicKey;
3137
3681
  aptosSignMessage: typeof aptosSignMessage;
3138
3682
  aptosSignInMessage: typeof aptosSignInMessage;
3139
3683
  aptosSignTransaction: typeof aptosSignTransaction;
3684
+ /**
3685
+ * Algo function
3686
+ */
3140
3687
  algoGetAddress: typeof algoGetAddress;
3141
3688
  algoSignTransaction: typeof algoSignTransaction;
3689
+ /**
3690
+ * Cosmos function
3691
+ */
3142
3692
  cosmosGetAddress: typeof cosmosGetAddress;
3143
3693
  cosmosGetPublicKey: typeof cosmosGetPublicKey;
3144
3694
  cosmosSignTransaction: typeof cosmosSignTransaction;
3695
+ /**
3696
+ * XRP function
3697
+ */
3145
3698
  xrpGetAddress: typeof xrpGetAddress;
3146
3699
  xrpSignTransaction: typeof xrpSignTransaction;
3700
+ /**
3701
+ * SUI function
3702
+ */
3147
3703
  suiGetAddress: typeof suiGetAddress;
3148
3704
  suiGetPublicKey: typeof suiGetPublicKey;
3149
3705
  suiSignMessage: typeof suiSignMessage;
3150
3706
  suiSignTransaction: typeof suiSignTransaction;
3707
+ /**
3708
+ * Cardano function
3709
+ */
3151
3710
  cardanoGetAddress: typeof cardanoGetAddress;
3152
3711
  cardanoGetPublicKey: typeof cardanoGetPublicKey;
3153
3712
  cardanoSignTransaction: typeof cardanoSignTransaction;
3154
3713
  cardanoSignMessage: typeof cardanoSignMessage;
3714
+ /**
3715
+ * Filecoin function
3716
+ */
3155
3717
  filecoinGetAddress: typeof filecoinGetAddress;
3156
3718
  filecoinSignTransaction: typeof filecoinSignTransaction;
3719
+ /**
3720
+ * Polkadot function
3721
+ */
3157
3722
  polkadotGetAddress: typeof polkadotGetAddress;
3158
3723
  polkadotSignTransaction: typeof polkadotSignTransaction;
3724
+ /**
3725
+ * Kaspa function
3726
+ */
3159
3727
  kaspaGetAddress: typeof kaspaGetAddress;
3160
3728
  kaspaSignTransaction: typeof kaspaSignTransaction;
3729
+ /**
3730
+ * nexa function
3731
+ */
3161
3732
  nexaGetAddress: typeof nexaGetAddress;
3162
3733
  nexaSignTransaction: typeof nexaSignTransaction;
3734
+ /**
3735
+ * Nostr function
3736
+ */
3163
3737
  nostrGetPublicKey: typeof nostrGetPublicKey;
3164
3738
  nostrSignEvent: typeof nostrSignEvent;
3165
3739
  nostrEncryptMessage: typeof nostrEncryptMessage;
3166
3740
  nostrDecryptMessage: typeof nostrDecryptMessage;
3167
3741
  nostrSignSchnorr: typeof nostrSignSchnorr;
3742
+ /**
3743
+ * Lightning Network
3744
+ */
3168
3745
  lnurlAuth: typeof lnurlAuth;
3746
+ /**
3747
+ * Nervos Network
3748
+ */
3169
3749
  nervosGetAddress: typeof nervosGetAddress;
3170
3750
  nervosSignTransaction: typeof nervosSignTransaction;
3751
+ /**
3752
+ * Dnx Network
3753
+ */
3171
3754
  dnxGetAddress: typeof dnxGetAddress;
3172
3755
  dnxSignTransaction: typeof dnxSignTransaction;
3756
+ /**
3757
+ * TON Network
3758
+ */
3173
3759
  tonGetAddress: typeof tonGetAddress;
3174
3760
  tonSignMessage: typeof tonSignMessage;
3175
3761
  tonSignProof: typeof tonSignProof;
3176
3762
  tonSignData: typeof tonSignData;
3763
+ /**
3764
+ * SCDO Network
3765
+ */
3177
3766
  scdoGetAddress: typeof scdoGetAddress;
3178
3767
  scdoSignMessage: typeof scdoSignMessage;
3179
3768
  scdoSignTransaction: typeof scdoSignTransaction;
3769
+ /**
3770
+ * Alephium Network
3771
+ */
3180
3772
  alephiumGetAddress: typeof alephiumGetAddress;
3181
3773
  alephiumSignMessage: typeof alephiumSignMessage;
3182
3774
  alephiumSignTransaction: typeof alephiumSignTransaction;
3775
+ /**
3776
+ * Benfen Network
3777
+ */
3183
3778
  benfenGetAddress: typeof benfenGetAddress;
3184
3779
  benfenGetPublicKey: typeof benfenGetPublicKey;
3185
3780
  benfenSignTransaction: typeof benfenSignTransaction;
3186
3781
  benfenSignMessage: typeof benfenSignMessage;
3782
+ /**
3783
+ * Neo Network
3784
+ */
3187
3785
  neoGetAddress: typeof neoGetAddress;
3188
3786
  neoSignTransaction: typeof neoSignTransaction;
3189
3787
  };
@@ -3256,13 +3854,17 @@ declare const DEVICE: {
3256
3854
  readonly LOADING: "device-loading";
3257
3855
  readonly BUTTON: "button";
3258
3856
  readonly PIN: "pin";
3857
+ readonly PIN_ON_DEVICE: "pin_on_device";
3858
+ readonly PIN_ON_DEVICE_COMPLETE: "pin_on_device_complete";
3259
3859
  readonly PASSPHRASE: "passphrase";
3260
3860
  readonly PASSPHRASE_ON_DEVICE: "passphrase_on_device";
3861
+ readonly ATTACH_PIN_ON_DEVICE: "attach_pin_on_device";
3261
3862
  readonly WORD: "word";
3262
3863
  readonly SUPPORT_FEATURES: "support_features";
3263
3864
  readonly SELECT_DEVICE_IN_BOOTLOADER_FOR_WEB_DEVICE: "select_device_in_bootloader_for_web_device";
3264
3865
  readonly SELECT_DEVICE_FOR_SWITCH_FIRMWARE_WEB_DEVICE: "select_device_for_switch_firmware_web_device";
3265
3866
  readonly FEATURES: "features";
3867
+ readonly STATE: "state";
3266
3868
  };
3267
3869
  interface DeviceConnnectRequest {
3268
3870
  type: typeof DEVICE.CONNECT;
@@ -3281,6 +3883,11 @@ interface DeviceButtonRequestPayload extends Omit<Messages.ButtonRequest, 'code'
3281
3883
  }
3282
3884
  type PassphraseRequestPayload = {
3283
3885
  existsAttachPinUser?: boolean;
3886
+ deviceOnly?: boolean;
3887
+ source?: 'wallet-session-coordinator';
3888
+ reason?: 'open-wallet' | 'session-recovery';
3889
+ expectedPassphraseState?: string;
3890
+ interaction?: HardwareUiInteractionMeta;
3284
3891
  };
3285
3892
  interface DeviceButtonRequest {
3286
3893
  type: typeof DEVICE.BUTTON;
@@ -3293,6 +3900,10 @@ interface DeviceSendFeatures {
3293
3900
  type: typeof DEVICE.FEATURES;
3294
3901
  payload: DeviceFeaturesPayload;
3295
3902
  }
3903
+ interface DeviceSendState {
3904
+ type: typeof DEVICE.STATE;
3905
+ payload: DeviceStateEvent;
3906
+ }
3296
3907
  type DeviceSupportFeaturesPayload = SupportFeatures & {
3297
3908
  device: KnownDevice | null;
3298
3909
  };
@@ -3300,13 +3911,58 @@ interface DeviceSendSupportFeatures {
3300
3911
  type: typeof DEVICE.SUPPORT_FEATURES;
3301
3912
  payload: DeviceSupportFeaturesPayload;
3302
3913
  }
3303
- type DeviceEvent = DeviceButtonRequest | DeviceSendFeatures | DeviceSendSupportFeatures | DeviceDisconnnectRequest | DeviceConnnectRequest;
3914
+ type DeviceEvent = DeviceButtonRequest | DeviceSendState | DeviceSendFeatures | DeviceSendSupportFeatures | DeviceDisconnnectRequest | DeviceConnnectRequest;
3304
3915
  type DeviceEventMessage = DeviceEvent & {
3305
3916
  event: typeof DEVICE_EVENT;
3306
3917
  };
3307
3918
  type DeviceEventListenerFn = (type: typeof DEVICE_EVENT, cb: (event: DeviceEventMessage) => void) => void;
3308
3919
  declare const createDeviceMessage: MessageFactoryFn<typeof DEVICE_EVENT, DeviceEvent>;
3309
3920
 
3921
+ declare const UI_RESPONSE: {
3922
+ readonly RECEIVE_PIN: "ui-receive_pin";
3923
+ readonly RECEIVE_PASSPHRASE: "ui-receive_passphrase";
3924
+ readonly SELECT_DEVICE_IN_BOOTLOADER_FOR_WEB_DEVICE: "ui-receive_select-device-in-bootloader-for-web-device";
3925
+ readonly SELECT_DEVICE_FOR_SWITCH_FIRMWARE_WEB_DEVICE: "ui-receive_select-device-for-switch-firmware-web-device";
3926
+ };
3927
+ interface UiResponseCorrelation {
3928
+ interactionId: string;
3929
+ deviceId: string;
3930
+ }
3931
+ interface UiResponseCorrelationFields {
3932
+ interactionId?: string;
3933
+ deviceId?: string;
3934
+ }
3935
+ interface UiResponsePin extends UiResponseCorrelationFields {
3936
+ type: typeof UI_RESPONSE.RECEIVE_PIN;
3937
+ payload: string;
3938
+ }
3939
+ interface UiResponsePassphrase extends UiResponseCorrelationFields {
3940
+ type: typeof UI_RESPONSE.RECEIVE_PASSPHRASE;
3941
+ payload: {
3942
+ value: string;
3943
+ passphraseOnDevice?: boolean;
3944
+ attachPinOnDevice?: boolean;
3945
+ save?: boolean;
3946
+ };
3947
+ }
3948
+ interface UiResponseSelectDeviceInBootloaderForWebDevice {
3949
+ type: typeof UI_RESPONSE.SELECT_DEVICE_IN_BOOTLOADER_FOR_WEB_DEVICE;
3950
+ payload: {
3951
+ deviceId: string;
3952
+ };
3953
+ }
3954
+ interface UiResponseSelectDeviceForSwitchFirmwareWebDevice {
3955
+ type: typeof UI_RESPONSE.SELECT_DEVICE_FOR_SWITCH_FIRMWARE_WEB_DEVICE;
3956
+ payload: {
3957
+ deviceId: string;
3958
+ };
3959
+ }
3960
+ type UiResponseEvent = UiResponsePin | UiResponsePassphrase | UiResponseSelectDeviceInBootloaderForWebDevice | UiResponseSelectDeviceForSwitchFirmwareWebDevice;
3961
+ type UiResponseMessage = UiResponseEvent & {
3962
+ event: typeof UI_EVENT;
3963
+ };
3964
+ declare const createUiResponse: MessageFactoryFn<typeof UI_EVENT, UiResponseEvent>;
3965
+
3310
3966
  declare const UI_EVENT = "UI_EVENT";
3311
3967
  declare const UI_REQUEST: {
3312
3968
  readonly REQUEST_PIN: "ui-request_pin";
@@ -3341,8 +3997,43 @@ declare const UI_REQUEST: {
3341
3997
  readonly FIRMWARE_NOT_INSTALLED: "ui-device_firmware_not_installed";
3342
3998
  readonly NOT_USE_ONEKEY_DEVICE: "ui-device_please_use_onekey_device";
3343
3999
  };
4000
+ type ProtocolV2UiEventSource = 'unlock-coordinator' | 'wallet-session-coordinator' | 'method-lifecycle';
4001
+ type ProtocolV2UiCompletion = 'page-accepted' | 'operation-completed';
4002
+ type HardwareUiInteractionMeta = {
4003
+ interactionId: string;
4004
+ phaseId: string;
4005
+ sequence: number;
4006
+ phase: 'pin' | 'passphrase' | 'passphrase-on-device' | 'button' | 'processing';
4007
+ transition: 'start' | 'complete' | 'finish';
4008
+ outcome?: 'submitted' | 'succeeded' | 'failed' | 'cancelled' | 'disconnected';
4009
+ protocol: 'V2';
4010
+ device?: Device$1;
4011
+ };
4012
+ type ProtocolV2UiEventMetadata = {
4013
+ source?: ProtocolV2UiEventSource;
4014
+ reason?: string;
4015
+ deviceOnly?: boolean;
4016
+ completion?: ProtocolV2UiCompletion;
4017
+ method?: string;
4018
+ page?: string | number;
4019
+ operation?: string;
4020
+ interaction?: HardwareUiInteractionMeta;
4021
+ };
4022
+ type UiRequestWindowClose = {
4023
+ type: typeof UI_REQUEST.CLOSE_UI_WINDOW;
4024
+ payload: HardwareUiInteractionMeta;
4025
+ } | {
4026
+ type: typeof UI_REQUEST.CLOSE_UI_PIN_WINDOW;
4027
+ payload: HardwareUiInteractionMeta;
4028
+ } | {
4029
+ type: typeof UI_REQUEST.CLOSE_UI_WINDOW;
4030
+ payload?: undefined;
4031
+ } | {
4032
+ type: typeof UI_REQUEST.CLOSE_UI_PIN_WINDOW;
4033
+ payload?: undefined;
4034
+ };
3344
4035
  interface UiRequestWithoutPayload {
3345
- 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;
4036
+ 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;
3346
4037
  payload?: typeof undefined;
3347
4038
  }
3348
4039
  interface UiRequestFirmwareProgressing {
@@ -3353,40 +4044,50 @@ interface UiRequestFirmwareProgressing {
3353
4044
  }
3354
4045
  type UiRequestDeviceAction = {
3355
4046
  type: typeof UI_REQUEST.REQUEST_PIN;
3356
- payload: {
3357
- device: Device;
4047
+ payload: ProtocolV2UiEventMetadata & {
4048
+ device: Device$1;
3358
4049
  type?: Messages.PinMatrixRequestType | 'ButtonRequest_PinEntry' | 'ButtonRequest_AttachPin';
4050
+ responseCorrelation?: UiResponseCorrelation;
3359
4051
  };
3360
4052
  };
3361
4053
  interface UiRequestButton {
3362
4054
  type: typeof UI_REQUEST.REQUEST_BUTTON;
3363
- payload: DeviceButtonRequest['payload'];
4055
+ payload: DeviceButtonRequest['payload'] & ProtocolV2UiEventMetadata;
3364
4056
  }
3365
4057
  interface UiRequestPassphrase {
3366
4058
  type: typeof UI_REQUEST.REQUEST_PASSPHRASE;
3367
4059
  payload: {
3368
- device: Device;
4060
+ device: Device$1;
3369
4061
  passphraseState?: string;
3370
4062
  existsAttachPinUser?: boolean;
4063
+ deviceOnly?: boolean;
4064
+ source?: 'wallet-session-coordinator';
4065
+ reason?: 'open-wallet' | 'session-recovery';
4066
+ expectedPassphraseState?: string;
4067
+ interaction?: HardwareUiInteractionMeta;
4068
+ responseCorrelation?: UiResponseCorrelation;
3371
4069
  };
3372
4070
  }
3373
4071
  interface UiRequestPassphraseOnDevice {
3374
4072
  type: typeof UI_REQUEST.REQUEST_PASSPHRASE_ON_DEVICE;
3375
4073
  payload: {
3376
- device: Device;
4074
+ device: Device$1;
3377
4075
  passphraseState?: string;
4076
+ source?: 'wallet-session-coordinator';
4077
+ reason?: 'open-wallet' | 'session-recovery';
4078
+ interaction?: HardwareUiInteractionMeta;
3378
4079
  };
3379
4080
  }
3380
4081
  interface UiRequestSelectDeviceInBootloaderForWebDevice {
3381
4082
  type: typeof UI_REQUEST.REQUEST_DEVICE_IN_BOOTLOADER_FOR_WEB_DEVICE;
3382
4083
  payload: {
3383
- device: Device;
4084
+ device: Device$1;
3384
4085
  };
3385
4086
  }
3386
4087
  interface UiRequestSelectDeviceForSwitchFirmwareWebDevice {
3387
4088
  type: typeof UI_REQUEST.REQUEST_DEVICE_FOR_SWITCH_FIRMWARE_WEB_DEVICE;
3388
4089
  payload: {
3389
- device: Device;
4090
+ device: Device$1;
3390
4091
  };
3391
4092
  }
3392
4093
  interface FirmwareProcessing {
@@ -3399,7 +4100,7 @@ type IFirmwareUpdateProgressType = 'transferData' | 'installingFirmware';
3399
4100
  interface FirmwareProgress {
3400
4101
  type: typeof UI_REQUEST.FIRMWARE_PROGRESS;
3401
4102
  payload: {
3402
- device: Device;
4103
+ device: Device$1;
3403
4104
  progress: number;
3404
4105
  progressType: IFirmwareUpdateProgressType;
3405
4106
  transferredBytes?: number;
@@ -3411,7 +4112,7 @@ interface FirmwareProgress {
3411
4112
  interface FirmwareTip {
3412
4113
  type: typeof UI_REQUEST.FIRMWARE_TIP;
3413
4114
  payload: {
3414
- device: Device;
4115
+ device: Device$1;
3415
4116
  data: {
3416
4117
  message: string;
3417
4118
  };
@@ -3430,14 +4131,14 @@ interface DeviceProgress {
3430
4131
  interface PreviousAddressResult {
3431
4132
  type: typeof UI_REQUEST.PREVIOUS_ADDRESS_RESULT;
3432
4133
  payload: {
3433
- device: Device;
4134
+ device: Device$1;
3434
4135
  data: {
3435
4136
  address?: string;
3436
4137
  path?: string;
3437
4138
  };
3438
4139
  };
3439
4140
  }
3440
- type UiEvent = UiRequestWithoutPayload | UiRequestDeviceAction | UiRequestButton | UiRequestPassphraseOnDevice | UiRequestPassphrase | UiRequestSelectDeviceInBootloaderForWebDevice | UiRequestSelectDeviceForSwitchFirmwareWebDevice | FirmwareProcessing | UiRequestSelectDeviceInBootloaderForWebDevice | FirmwareProgress | FirmwareTip | DeviceProgress | PreviousAddressResult;
4141
+ type UiEvent = UiRequestWithoutPayload | UiRequestWindowClose | UiRequestDeviceAction | UiRequestButton | UiRequestPassphraseOnDevice | UiRequestPassphrase | UiRequestSelectDeviceInBootloaderForWebDevice | UiRequestSelectDeviceForSwitchFirmwareWebDevice | FirmwareProcessing | UiRequestSelectDeviceInBootloaderForWebDevice | FirmwareProgress | FirmwareTip | DeviceProgress | PreviousAddressResult;
3441
4142
  declare enum FirmwareUpdateTipMessage {
3442
4143
  CheckLatestUiResource = "CheckLatestUiResource",
3443
4144
  StartDownloadFirmware = "StartDownloadFirmware",
@@ -3571,43 +4272,6 @@ interface MethodResponseMessage {
3571
4272
  declare const createResponseMessage: (id: number, success: boolean, payload: any) => MethodResponseMessage;
3572
4273
  type CallMethodKeys = keyof CoreApi;
3573
4274
 
3574
- declare const UI_RESPONSE: {
3575
- readonly RECEIVE_PIN: "ui-receive_pin";
3576
- readonly RECEIVE_PASSPHRASE: "ui-receive_passphrase";
3577
- readonly SELECT_DEVICE_IN_BOOTLOADER_FOR_WEB_DEVICE: "ui-receive_select-device-in-bootloader-for-web-device";
3578
- readonly SELECT_DEVICE_FOR_SWITCH_FIRMWARE_WEB_DEVICE: "ui-receive_select-device-for-switch-firmware-web-device";
3579
- };
3580
- interface UiResponsePin {
3581
- type: typeof UI_RESPONSE.RECEIVE_PIN;
3582
- payload: string;
3583
- }
3584
- interface UiResponsePassphrase {
3585
- type: typeof UI_RESPONSE.RECEIVE_PASSPHRASE;
3586
- payload: {
3587
- value: string;
3588
- passphraseOnDevice?: boolean;
3589
- attachPinOnDevice?: boolean;
3590
- save?: boolean;
3591
- };
3592
- }
3593
- interface UiResponseSelectDeviceInBootloaderForWebDevice {
3594
- type: typeof UI_RESPONSE.SELECT_DEVICE_IN_BOOTLOADER_FOR_WEB_DEVICE;
3595
- payload: {
3596
- deviceId: string;
3597
- };
3598
- }
3599
- interface UiResponseSelectDeviceForSwitchFirmwareWebDevice {
3600
- type: typeof UI_RESPONSE.SELECT_DEVICE_FOR_SWITCH_FIRMWARE_WEB_DEVICE;
3601
- payload: {
3602
- deviceId: string;
3603
- };
3604
- }
3605
- type UiResponseEvent = UiResponsePin | UiResponsePassphrase | UiResponseSelectDeviceInBootloaderForWebDevice | UiResponseSelectDeviceForSwitchFirmwareWebDevice;
3606
- type UiResponseMessage = UiResponseEvent & {
3607
- event: typeof UI_EVENT;
3608
- };
3609
- declare const createUiResponse: MessageFactoryFn<typeof UI_EVENT, UiResponseEvent>;
3610
-
3611
4275
  declare const LOG_EVENT = "LOG_EVENT";
3612
4276
  declare const LOG: {
3613
4277
  readonly OUTPUT: "log-output";
@@ -3683,10 +4347,14 @@ type UiPromiseResponse = UiResponseEvent | {
3683
4347
  };
3684
4348
  type UiPromise<T extends UiPromiseResponse['type']> = Deferred<Extract<UiPromiseResponse, {
3685
4349
  type: T;
3686
- }>, T, Device$1>;
4350
+ }>, T, Device> & {
4351
+ responseCorrelation?: UiResponseCorrelation;
4352
+ };
3687
4353
 
3688
4354
  declare const LogBlockEvent: Set<string>;
3689
4355
  declare function getLogBlockLabel(message: unknown): string | undefined;
4356
+ declare function getSafeLogPayload(value: unknown, blockLabel?: string): unknown;
4357
+ declare function formatLogMethodLabel(label: string, methodName?: string): string;
3690
4358
 
3691
4359
  declare const executeCallback: (id: string, ...args: any[]) => void;
3692
4360
  declare const cleanupCallback: (id: string) => void;
@@ -3750,30 +4418,109 @@ declare enum LoggerNames {
3750
4418
  }
3751
4419
  declare const getLogger: (key: LoggerNames) => Log;
3752
4420
 
3753
- declare const httpRequest: (url: string, type: string) => any;
4421
+ type HttpRequestOptions = {
4422
+ /** Additional request headers, such as a byte range for package metadata reads. */
4423
+ headers?: Record<string, string>;
4424
+ /** Axios adapter-defined request timeout retained for existing opt-in callers. */
4425
+ timeoutMs?: number;
4426
+ /** Deadline for DNS, connection, TLS, redirects, and the first response-body progress. */
4427
+ connectTimeoutMs?: number;
4428
+ /** Maximum idle interval between response-body progress events. */
4429
+ readTimeoutMs?: number;
4430
+ /** Wall-clock deadline across all attempts and retry backoff. */
4431
+ overallTimeoutMs?: number;
4432
+ maxRetries?: number;
4433
+ retryDelayMs?: number;
4434
+ };
4435
+
4436
+ declare const httpRequest: (url: string, type: string, options?: HttpRequestOptions) => any;
3754
4437
  declare const getTimeStamp: () => number;
3755
4438
 
4439
+ /**
4440
+ * Validates version string
4441
+ * @param {string} version Version string
4442
+ * @returns {boolean} True if version string is valid, false if not
4443
+ */
3756
4444
  declare const isValidVersionString: (version: string) => boolean;
4445
+ /**
4446
+ * Validates a version array
4447
+ * @param {number[]} version Version array
4448
+ * @returns {boolean} True if version array is valid, false if not
4449
+ */
3757
4450
  declare const isValidVersionArray: (version: number[]) => boolean;
4451
+ /**
4452
+ * Fills the missing version numbers with zeros (ie: [1, 2] will become [1, 2, 0])
4453
+ * @param {number[]} version Version array
4454
+ * @returns {number[]} Version array with all positions filled
4455
+ */
3758
4456
  declare const normalizeVersionArray: (version: number[]) => number[];
4457
+ /**
4458
+ * Returns a valid version array from a version string
4459
+ * @param {string} version Version string
4460
+ * @returns {number[]} Version array
4461
+ */
3759
4462
  declare const versionSplit: (version: string) => number[];
4463
+ /**
4464
+ * Compares two versions and returns if the version is newer (1), older (-1) or equal (0).
4465
+ * @param {string | number[]} a Version to compare from
4466
+ * @param {string | number[]} b Version to compare with
4467
+ * @returns {number} Returns 1 if newer, -1 if older and 0 if equal
4468
+ */
3760
4469
  declare const versionCompare: (a: string | number[], b: string | number[]) => 0 | 1 | -1;
3761
4470
 
3762
- declare function patchFeatures(response: DefaultMessageResponse): TypedResponseMessage<"DeviceSession"> | TypedResponseMessage<"PassphraseState"> | TypedResponseMessage<"Address"> | TypedResponseMessage<"DeviceFirmwareUpdateStatus"> | TypedResponseMessage<"Success"> | TypedResponseMessage<"AptosMessagePayload"> | TypedResponseMessage<"BinanceInputOutput"> | TypedResponseMessage<"BinanceCoin"> | TypedResponseMessage<"HDNodePathType"> | TypedResponseMessage<"HDNodeType"> | TypedResponseMessage<"MultisigRedeemScriptType"> | TypedResponseMessage<"TxRequestDetailsType"> | TypedResponseMessage<"TxRequestSerializedType"> | TypedResponseMessage<"TxInputType"> | TypedResponseMessage<"TxOutputBinType"> | TypedResponseMessage<"TxOutputType"> | TypedResponseMessage<"TxAckInputWrapper"> | TypedResponseMessage<"TxAckOutputWrapper"> | TypedResponseMessage<"PrevTx"> | TypedResponseMessage<"TxAckPrevInputWrapper"> | TypedResponseMessage<"PrevInput"> | TypedResponseMessage<"TxAckPrevOutputWrapper"> | TypedResponseMessage<"PrevOutput"> | TypedResponseMessage<"TxAckPrevExtraDataWrapper"> | TypedResponseMessage<"BIP32Address"> | TypedResponseMessage<"CardanoNativeScript"> | TypedResponseMessage<"CardanoBlockchainPointerType"> | TypedResponseMessage<"CardanoAddressParametersType"> | TypedResponseMessage<"CardanoPoolMetadataType"> | TypedResponseMessage<"CardanoPoolParametersType"> | TypedResponseMessage<"CardanoDRep"> | TypedResponseMessage<"CardanoCVoteRegistrationDelegation"> | TypedResponseMessage<"CardanoCVoteRegistrationParametersType"> | TypedResponseMessage<"IdentityType"> | TypedResponseMessage<"Path"> | TypedResponseMessage<"DnxTxKey"> | TypedResponseMessage<"DnxComputedKeyImage"> | TypedResponseMessage<"EmmcFile"> | TypedResponseMessage<"EosTxHeader"> | TypedResponseMessage<"EosActionCommon"> | TypedResponseMessage<"EosActionTransfer"> | TypedResponseMessage<"EosActionDelegate"> | TypedResponseMessage<"EosActionUndelegate"> | TypedResponseMessage<"EosActionRefund"> | TypedResponseMessage<"EosActionBuyRam"> | TypedResponseMessage<"EosActionBuyRamBytes"> | TypedResponseMessage<"EosActionSellRam"> | TypedResponseMessage<"EosActionVoteProducer"> | TypedResponseMessage<"EosActionUpdateAuth"> | TypedResponseMessage<"EosActionDeleteAuth"> | TypedResponseMessage<"EosActionLinkAuth"> | TypedResponseMessage<"EosActionUnlinkAuth"> | TypedResponseMessage<"EosActionNewAccount"> | TypedResponseMessage<"EosActionUnknown"> | TypedResponseMessage<"EosPermissionLevel"> | TypedResponseMessage<"EosAuthorizationKey"> | TypedResponseMessage<"EosAuthorizationAccount"> | TypedResponseMessage<"EosAuthorizationWait"> | TypedResponseMessage<"EosAsset"> | TypedResponseMessage<"EosAuthorization"> | TypedResponseMessage<"EthereumStructMemberOneKey"> | TypedResponseMessage<"EthereumFieldTypeOneKey"> | TypedResponseMessage<"EthereumDefinitions"> | TypedResponseMessage<"EthereumStructMember"> | TypedResponseMessage<"EthereumFieldType"> | TypedResponseMessage<"EthereumAccessListOneKey"> | TypedResponseMessage<"EthereumAuthorizationOneKey"> | TypedResponseMessage<"EthereumAuthorizationSignature"> | TypedResponseMessage<"EthereumAccessList"> | TypedResponseMessage<"FileInfo"> | TypedResponseMessage<"MoneroOutputEntry"> | TypedResponseMessage<"MoneroMultisigKLRki"> | TypedResponseMessage<"MoneroRctKeyPublic"> | TypedResponseMessage<"MoneroAccountPublicAddress"> | TypedResponseMessage<"MoneroTransactionData"> | TypedResponseMessage<"MoneroTransactionDestinationEntry"> | TypedResponseMessage<"MoneroTransactionRsigData"> | TypedResponseMessage<"MoneroTransactionSourceEntry"> | TypedResponseMessage<"MoneroRingCtSig"> | TypedResponseMessage<"MoneroSubAddressIndicesList"> | TypedResponseMessage<"MoneroTransferDetails"> | TypedResponseMessage<"MoneroExportedKeyImage"> | TypedResponseMessage<"NEMTransactionCommon"> | TypedResponseMessage<"NEMTransfer"> | TypedResponseMessage<"NEMProvisionNamespace"> | TypedResponseMessage<"NEMMosaicCreation"> | TypedResponseMessage<"NEMMosaicSupplyChange"> | TypedResponseMessage<"NEMAggregateModification"> | TypedResponseMessage<"NEMImportanceTransfer"> | TypedResponseMessage<"NEMMosaic"> | TypedResponseMessage<"NEMMosaicDefinition"> | TypedResponseMessage<"NEMCosignatoryModification"> | TypedResponseMessage<"RipplePayment"> | TypedResponseMessage<"SolanaTxATADetails"> | TypedResponseMessage<"SolanaTxExtraInfo"> | TypedResponseMessage<"StellarAsset"> | TypedResponseMessage<"TezosRevealOp"> | TypedResponseMessage<"TezosTransactionOp"> | TypedResponseMessage<"TezosOriginationOp"> | TypedResponseMessage<"TezosDelegationOp"> | TypedResponseMessage<"TezosProposalOp"> | TypedResponseMessage<"TezosBallotOp"> | TypedResponseMessage<"TezosContractID"> | TypedResponseMessage<"TezosParametersManager"> | TypedResponseMessage<"TezosManagerTransfer"> | TypedResponseMessage<"TronContract"> | TypedResponseMessage<"TronTransferContract"> | TypedResponseMessage<"TronVoteWitnessContract"> | TypedResponseMessage<"TronFreezeBalanceContract"> | TypedResponseMessage<"TronUnfreezeBalanceContract"> | TypedResponseMessage<"TronWithdrawBalanceContract"> | TypedResponseMessage<"TronTriggerSmartContract"> | TypedResponseMessage<"TronFreezeBalanceV2Contract"> | TypedResponseMessage<"TronUnfreezeBalanceV2Contract"> | TypedResponseMessage<"TronWithdrawExpireUnfreezeContract"> | TypedResponseMessage<"TronDelegateResourceContract"> | TypedResponseMessage<"TronUnDelegateResourceContract"> | TypedResponseMessage<"TronCancelAllUnfreezeV2Contract"> | TypedResponseMessage<"Vote"> | TypedResponseMessage<"CoinJoinRequest"> | TypedResponseMessage<"PaymentRequestMemo"> | TypedResponseMessage<"TextMemo"> | TypedResponseMessage<"RefundMemo"> | TypedResponseMessage<"CoinPurchaseMemo"> | TypedResponseMessage<"ViewAmount"> | TypedResponseMessage<"ViewDetail"> | TypedResponseMessage<"ViewTip"> | TypedResponseMessage<"DeviceSettings"> | TypedResponseMessage<"DeviceCertificate"> | TypedResponseMessage<"DeviceFirmwareTarget"> | TypedResponseMessage<"DeviceFirmwareUpdateRecordFields"> | TypedResponseMessage<"DeviceFirmwareUpdateRecord"> | TypedResponseMessage<"DeviceFactoryInfoManufactureTime"> | TypedResponseMessage<"DeviceFactoryInfo"> | TypedResponseMessage<"DeviceFirmwareImageInfo"> | TypedResponseMessage<"DeviceInfoTargets"> | TypedResponseMessage<"DeviceInfoTypes"> | TypedResponseMessage<"DeviceHardwareInfo"> | TypedResponseMessage<"DeviceMainMcuInfo"> | TypedResponseMessage<"DeviceCoprocessorInfo"> | TypedResponseMessage<"DeviceSEInfo"> | TypedResponseMessage<"DeviceStatus"> | TypedResponseMessage<"FilesystemFile"> | TypedResponseMessage<"AlephiumGetAddress"> | TypedResponseMessage<"AlephiumAddress"> | TypedResponseMessage<"AlephiumSignTx"> | TypedResponseMessage<"AlephiumSignedTx"> | TypedResponseMessage<"AlephiumTxRequest"> | TypedResponseMessage<"AlephiumTxAck"> | TypedResponseMessage<"AlephiumBytecodeRequest"> | TypedResponseMessage<"AlephiumBytecodeAck"> | TypedResponseMessage<"AlephiumSignMessage"> | TypedResponseMessage<"AlephiumMessageSignature"> | TypedResponseMessage<"AlgorandGetAddress"> | TypedResponseMessage<"AlgorandAddress"> | TypedResponseMessage<"AlgorandSignTx"> | TypedResponseMessage<"AlgorandSignedTx"> | TypedResponseMessage<"AptosGetAddress"> | TypedResponseMessage<"AptosAddress"> | TypedResponseMessage<"AptosSignTx"> | TypedResponseMessage<"AptosSignedTx"> | TypedResponseMessage<"AptosSignMessage"> | TypedResponseMessage<"AptosMessageSignature"> | TypedResponseMessage<"AptosSignSIWAMessage"> | TypedResponseMessage<"BenfenGetAddress"> | TypedResponseMessage<"BenfenAddress"> | TypedResponseMessage<"BenfenSignTx"> | TypedResponseMessage<"BenfenSignedTx"> | TypedResponseMessage<"BenfenTxRequest"> | TypedResponseMessage<"BenfenTxAck"> | TypedResponseMessage<"BenfenSignMessage"> | TypedResponseMessage<"BenfenMessageSignature"> | TypedResponseMessage<"BinanceGetAddress"> | TypedResponseMessage<"BinanceAddress"> | TypedResponseMessage<"BinanceGetPublicKey"> | TypedResponseMessage<"BinancePublicKey"> | TypedResponseMessage<"BinanceSignTx"> | TypedResponseMessage<"BinanceTxRequest"> | TypedResponseMessage<"BinanceTransferMsg"> | TypedResponseMessage<"BinanceOrderMsg"> | TypedResponseMessage<"BinanceCancelMsg"> | TypedResponseMessage<"BinanceSignedTx"> | TypedResponseMessage<"GetPublicKey"> | TypedResponseMessage<"PublicKey"> | TypedResponseMessage<"GetAddress"> | TypedResponseMessage<"GetOwnershipId"> | TypedResponseMessage<"OwnershipId"> | TypedResponseMessage<"SignMessage"> | TypedResponseMessage<"MessageSignature"> | TypedResponseMessage<"VerifyMessage"> | TypedResponseMessage<"SignTx"> | TypedResponseMessage<"TxRequest"> | TypedResponseMessage<"TxAck"> | TypedResponseMessage<"TxAckInput"> | TypedResponseMessage<"TxAckOutput"> | TypedResponseMessage<"TxAckPrevMeta"> | TypedResponseMessage<"TxAckPrevInput"> | TypedResponseMessage<"TxAckPrevOutput"> | TypedResponseMessage<"TxAckPrevExtraData"> | TypedResponseMessage<"GetOwnershipProof"> | TypedResponseMessage<"OwnershipProof"> | TypedResponseMessage<"AuthorizeCoinJoin"> | TypedResponseMessage<"GetPublicKeyMultiple"> | TypedResponseMessage<"PublicKeyMultiple"> | TypedResponseMessage<"SignPsbt"> | TypedResponseMessage<"SignedPsbt"> | TypedResponseMessage<"FirmwareErase"> | TypedResponseMessage<"FirmwareRequest"> | TypedResponseMessage<"FirmwareUpload"> | TypedResponseMessage<"SelfTest"> | TypedResponseMessage<"FirmwareErase_ex"> | TypedResponseMessage<"Reboot"> | TypedResponseMessage<"FirmwareUpdateEmmc"> | TypedResponseMessage<"UpgradeFileHeader"> | TypedResponseMessage<"CardanoGetNativeScriptHash"> | TypedResponseMessage<"CardanoNativeScriptHash"> | TypedResponseMessage<"CardanoGetAddress"> | TypedResponseMessage<"CardanoAddress"> | TypedResponseMessage<"CardanoGetPublicKey"> | TypedResponseMessage<"CardanoPublicKey"> | TypedResponseMessage<"CardanoSignTxInit"> | TypedResponseMessage<"CardanoTxInput"> | TypedResponseMessage<"CardanoTxOutput"> | TypedResponseMessage<"CardanoAssetGroup"> | TypedResponseMessage<"CardanoToken"> | TypedResponseMessage<"CardanoTxInlineDatumChunk"> | TypedResponseMessage<"CardanoTxReferenceScriptChunk"> | TypedResponseMessage<"CardanoPoolOwner"> | TypedResponseMessage<"CardanoPoolRelayParameters"> | TypedResponseMessage<"CardanoTxCertificate"> | TypedResponseMessage<"CardanoTxWithdrawal"> | TypedResponseMessage<"CardanoTxAuxiliaryData"> | TypedResponseMessage<"CardanoTxMint"> | TypedResponseMessage<"CardanoTxCollateralInput"> | TypedResponseMessage<"CardanoTxRequiredSigner"> | TypedResponseMessage<"CardanoTxReferenceInput"> | TypedResponseMessage<"CardanoTxItemAck"> | TypedResponseMessage<"CardanoTxAuxiliaryDataSupplement"> | TypedResponseMessage<"CardanoTxWitnessRequest"> | TypedResponseMessage<"CardanoTxWitnessResponse"> | TypedResponseMessage<"CardanoTxHostAck"> | TypedResponseMessage<"CardanoTxBodyHash"> | TypedResponseMessage<"CardanoSignTxFinished"> | TypedResponseMessage<"CardanoSignMessage"> | TypedResponseMessage<"CardanoMessageSignature"> | TypedResponseMessage<"Failure"> | TypedResponseMessage<"ButtonRequest"> | TypedResponseMessage<"ButtonAck"> | TypedResponseMessage<"PinMatrixRequest"> | TypedResponseMessage<"PinMatrixAck"> | TypedResponseMessage<"PassphraseRequest"> | TypedResponseMessage<"PassphraseAck"> | TypedResponseMessage<"Deprecated_PassphraseStateRequest"> | TypedResponseMessage<"Deprecated_PassphraseStateAck"> | TypedResponseMessage<"BixinPinInputOnDevice"> | TypedResponseMessage<"ConfluxGetAddress"> | TypedResponseMessage<"ConfluxAddress"> | TypedResponseMessage<"ConfluxSignTx"> | TypedResponseMessage<"ConfluxTxRequest"> | TypedResponseMessage<"ConfluxTxAck"> | TypedResponseMessage<"ConfluxSignMessage"> | TypedResponseMessage<"ConfluxMessageSignature"> | TypedResponseMessage<"ConfluxSignMessageCIP23"> | TypedResponseMessage<"CosmosGetAddress"> | TypedResponseMessage<"CosmosAddress"> | TypedResponseMessage<"CosmosSignTx"> | TypedResponseMessage<"CosmosSignedTx"> | TypedResponseMessage<"CipherKeyValue"> | TypedResponseMessage<"CipheredKeyValue"> | TypedResponseMessage<"SignIdentity"> | TypedResponseMessage<"SignedIdentity"> | TypedResponseMessage<"GetECDHSessionKey"> | TypedResponseMessage<"ECDHSessionKey"> | TypedResponseMessage<"BatchGetPublickeys"> | TypedResponseMessage<"EcdsaPublicKeys"> | TypedResponseMessage<"DnxGetAddress"> | TypedResponseMessage<"DnxAddress"> | TypedResponseMessage<"DnxSignTx"> | TypedResponseMessage<"DnxInputRequest"> | TypedResponseMessage<"DnxInputAck"> | TypedResponseMessage<"DnxRTSigsRequest"> | TypedResponseMessage<"DnxSignedTx"> | TypedResponseMessage<"EmmcFixPermission"> | TypedResponseMessage<"EmmcPath"> | TypedResponseMessage<"EmmcPathInfo"> | TypedResponseMessage<"EmmcFileRead"> | TypedResponseMessage<"EmmcFileWrite"> | TypedResponseMessage<"EmmcFileDelete"> | TypedResponseMessage<"EmmcDir"> | TypedResponseMessage<"EmmcDirList"> | TypedResponseMessage<"EmmcDirMake"> | TypedResponseMessage<"EmmcDirRemove"> | TypedResponseMessage<"EosGetPublicKey"> | TypedResponseMessage<"EosPublicKey"> | TypedResponseMessage<"EosSignTx"> | TypedResponseMessage<"EosTxActionRequest"> | TypedResponseMessage<"EosTxActionAck"> | TypedResponseMessage<"EosSignedTx"> | TypedResponseMessage<"EthereumNetworkInfo"> | TypedResponseMessage<"EthereumTokenInfo"> | TypedResponseMessage<"EthereumSignTypedDataOneKey"> | TypedResponseMessage<"EthereumGnosisSafeTxRequest"> | TypedResponseMessage<"EthereumGnosisSafeTxAck"> | TypedResponseMessage<"EthereumTypedDataStructRequestOneKey"> | TypedResponseMessage<"EthereumTypedDataStructAckOneKey"> | TypedResponseMessage<"EthereumTypedDataValueRequestOneKey"> | TypedResponseMessage<"EthereumTypedDataValueAckOneKey"> | TypedResponseMessage<"EthereumSignTypedData"> | TypedResponseMessage<"EthereumTypedDataStructRequest"> | TypedResponseMessage<"EthereumTypedDataStructAck"> | TypedResponseMessage<"EthereumTypedDataValueRequest"> | TypedResponseMessage<"EthereumTypedDataValueAck"> | TypedResponseMessage<"EthereumGetPublicKeyOneKey"> | TypedResponseMessage<"EthereumPublicKeyOneKey"> | TypedResponseMessage<"EthereumGetAddressOneKey"> | TypedResponseMessage<"EthereumAddressOneKey"> | TypedResponseMessage<"EthereumSignTxOneKey"> | TypedResponseMessage<"EthereumSignTxEIP1559OneKey"> | TypedResponseMessage<"EthereumSignTxEIP7702OneKey"> | TypedResponseMessage<"EthereumTxRequestOneKey"> | TypedResponseMessage<"EthereumTxAckOneKey"> | TypedResponseMessage<"EthereumSignMessageOneKey"> | TypedResponseMessage<"EthereumMessageSignatureOneKey"> | TypedResponseMessage<"EthereumVerifyMessageOneKey"> | TypedResponseMessage<"EthereumSignTypedHashOneKey"> | TypedResponseMessage<"EthereumTypedDataSignatureOneKey"> | TypedResponseMessage<"EthereumSignMessageEIP712"> | TypedResponseMessage<"EthereumGetPublicKey"> | TypedResponseMessage<"EthereumPublicKey"> | TypedResponseMessage<"EthereumGetAddress"> | TypedResponseMessage<"EthereumAddress"> | TypedResponseMessage<"EthereumSignTx"> | TypedResponseMessage<"EthereumSignTxEIP1559"> | TypedResponseMessage<"EthereumTxRequest"> | TypedResponseMessage<"EthereumTxAck"> | TypedResponseMessage<"EthereumSignMessage"> | TypedResponseMessage<"EthereumMessageSignature"> | TypedResponseMessage<"EthereumVerifyMessage"> | TypedResponseMessage<"EthereumSignTypedHash"> | TypedResponseMessage<"EthereumTypedDataSignature"> | TypedResponseMessage<"FilecoinGetAddress"> | TypedResponseMessage<"FilecoinAddress"> | TypedResponseMessage<"FilecoinSignTx"> | TypedResponseMessage<"FilecoinSignedTx"> | TypedResponseMessage<"KaspaGetAddress"> | TypedResponseMessage<"KaspaAddress"> | TypedResponseMessage<"KaspaSignTx"> | TypedResponseMessage<"KaspaTxInputRequest"> | TypedResponseMessage<"KaspaTxInputAck"> | TypedResponseMessage<"KaspaSignedTx"> | TypedResponseMessage<"LnurlAuth"> | TypedResponseMessage<"LnurlAuthResp"> | TypedResponseMessage<"Initialize"> | TypedResponseMessage<"GetFeatures"> | TypedResponseMessage<"OnekeyGetFeatures"> | TypedResponseMessage<"Features"> | TypedResponseMessage<"OnekeyFeatures"> | TypedResponseMessage<"LockDevice"> | TypedResponseMessage<"EndSession"> | TypedResponseMessage<"ApplySettings"> | TypedResponseMessage<"ApplyFlags"> | TypedResponseMessage<"ChangePin"> | TypedResponseMessage<"ChangeWipeCode"> | TypedResponseMessage<"SdProtect"> | TypedResponseMessage<"Ping"> | TypedResponseMessage<"Cancel"> | TypedResponseMessage<"GetEntropy"> | TypedResponseMessage<"Entropy"> | TypedResponseMessage<"WipeDevice"> | TypedResponseMessage<"ResetDevice"> | TypedResponseMessage<"BackupDevice"> | TypedResponseMessage<"EntropyRequest"> | TypedResponseMessage<"EntropyAck"> | TypedResponseMessage<"RecoveryDevice"> | TypedResponseMessage<"WordRequest"> | TypedResponseMessage<"WordAck"> | TypedResponseMessage<"SetU2FCounter"> | TypedResponseMessage<"GetNextU2FCounter"> | TypedResponseMessage<"NextU2FCounter"> | TypedResponseMessage<"DoPreauthorized"> | TypedResponseMessage<"PreauthorizedRequest"> | TypedResponseMessage<"CancelAuthorization"> | TypedResponseMessage<"BixinSeedOperate"> | TypedResponseMessage<"BixinMessageSE"> | TypedResponseMessage<"BixinOutMessageSE"> | TypedResponseMessage<"DeviceBackToBoot"> | TypedResponseMessage<"BixinBackupRequest"> | TypedResponseMessage<"BixinBackupAck"> | TypedResponseMessage<"BixinRestoreRequest"> | TypedResponseMessage<"BixinRestoreAck"> | TypedResponseMessage<"BixinVerifyDeviceRequest"> | TypedResponseMessage<"BixinVerifyDeviceAck"> | TypedResponseMessage<"BixinWhiteListRequest"> | TypedResponseMessage<"BixinWhiteListAck"> | TypedResponseMessage<"BixinLoadDevice"> | TypedResponseMessage<"BixinBackupDevice"> | TypedResponseMessage<"BixinBackupDeviceAck"> | TypedResponseMessage<"DeviceInfoSettings"> | TypedResponseMessage<"GetDeviceInfo"> | TypedResponseMessage<"DeviceInfo"> | TypedResponseMessage<"ReadSEPublicKey"> | TypedResponseMessage<"SEPublicKey"> | TypedResponseMessage<"WriteSEPublicCert"> | TypedResponseMessage<"ReadSEPublicCert"> | TypedResponseMessage<"SEPublicCert"> | TypedResponseMessage<"SpiFlashWrite"> | TypedResponseMessage<"SpiFlashRead"> | TypedResponseMessage<"SpiFlashData"> | TypedResponseMessage<"SESignMessage"> | TypedResponseMessage<"SEMessageSignature"> | TypedResponseMessage<"ResourceUpload"> | TypedResponseMessage<"ZoomRequest"> | TypedResponseMessage<"BlurRequest"> | TypedResponseMessage<"ResourceRequest"> | TypedResponseMessage<"ResourceAck"> | TypedResponseMessage<"ResourceUpdate"> | TypedResponseMessage<"NFTWriteInfo"> | TypedResponseMessage<"NFTWriteData"> | TypedResponseMessage<"RebootToBootloader"> | TypedResponseMessage<"RebootToBoardloader"> | TypedResponseMessage<"ListResDir"> | TypedResponseMessage<"FileInfoList"> | TypedResponseMessage<"DeviceEraseSector"> | TypedResponseMessage<"UnLockDevice"> | TypedResponseMessage<"UnLockDeviceResponse"> | TypedResponseMessage<"GetPassphraseState"> | TypedResponseMessage<"MoneroGetAddress"> | TypedResponseMessage<"MoneroAddress"> | TypedResponseMessage<"MoneroGetWatchKey"> | TypedResponseMessage<"MoneroWatchKey"> | TypedResponseMessage<"MoneroTransactionInitRequest"> | TypedResponseMessage<"MoneroTransactionInitAck"> | TypedResponseMessage<"MoneroTransactionSetInputRequest"> | TypedResponseMessage<"MoneroTransactionSetInputAck"> | TypedResponseMessage<"MoneroTransactionInputsPermutationRequest"> | TypedResponseMessage<"MoneroTransactionInputsPermutationAck"> | TypedResponseMessage<"MoneroTransactionInputViniRequest"> | TypedResponseMessage<"MoneroTransactionInputViniAck"> | TypedResponseMessage<"MoneroTransactionAllInputsSetRequest"> | TypedResponseMessage<"MoneroTransactionAllInputsSetAck"> | TypedResponseMessage<"MoneroTransactionSetOutputRequest"> | TypedResponseMessage<"MoneroTransactionSetOutputAck"> | TypedResponseMessage<"MoneroTransactionAllOutSetRequest"> | TypedResponseMessage<"MoneroTransactionAllOutSetAck"> | TypedResponseMessage<"MoneroTransactionSignInputRequest"> | TypedResponseMessage<"MoneroTransactionSignInputAck"> | TypedResponseMessage<"MoneroTransactionFinalRequest"> | TypedResponseMessage<"MoneroTransactionFinalAck"> | TypedResponseMessage<"MoneroKeyImageExportInitRequest"> | TypedResponseMessage<"MoneroKeyImageExportInitAck"> | TypedResponseMessage<"MoneroKeyImageSyncStepRequest"> | TypedResponseMessage<"MoneroKeyImageSyncStepAck"> | TypedResponseMessage<"MoneroKeyImageSyncFinalRequest"> | TypedResponseMessage<"MoneroKeyImageSyncFinalAck"> | TypedResponseMessage<"MoneroGetTxKeyRequest"> | TypedResponseMessage<"MoneroGetTxKeyAck"> | TypedResponseMessage<"MoneroLiveRefreshStartRequest"> | TypedResponseMessage<"MoneroLiveRefreshStartAck"> | TypedResponseMessage<"MoneroLiveRefreshStepRequest"> | TypedResponseMessage<"MoneroLiveRefreshStepAck"> | TypedResponseMessage<"MoneroLiveRefreshFinalRequest"> | TypedResponseMessage<"MoneroLiveRefreshFinalAck"> | TypedResponseMessage<"NearGetAddress"> | TypedResponseMessage<"NearAddress"> | TypedResponseMessage<"NearSignTx"> | TypedResponseMessage<"NearSignedTx"> | TypedResponseMessage<"NEMGetAddress"> | TypedResponseMessage<"NEMAddress"> | TypedResponseMessage<"NEMSignTx"> | TypedResponseMessage<"NEMSignedTx"> | TypedResponseMessage<"NEMDecryptMessage"> | TypedResponseMessage<"NEMDecryptedMessage"> | TypedResponseMessage<"NeoGetAddress"> | TypedResponseMessage<"NeoAddress"> | TypedResponseMessage<"NeoSignTx"> | TypedResponseMessage<"NeoSignedTx"> | TypedResponseMessage<"NervosGetAddress"> | TypedResponseMessage<"NervosAddress"> | TypedResponseMessage<"NervosSignTx"> | TypedResponseMessage<"NervosSignedTx"> | TypedResponseMessage<"NervosTxRequest"> | TypedResponseMessage<"NervosTxAck"> | TypedResponseMessage<"NexaGetAddress"> | TypedResponseMessage<"NexaAddress"> | TypedResponseMessage<"NexaSignTx"> | TypedResponseMessage<"NexaTxInputRequest"> | TypedResponseMessage<"NexaTxInputAck"> | TypedResponseMessage<"NexaSignedTx"> | TypedResponseMessage<"NostrGetPublicKey"> | TypedResponseMessage<"NostrPublicKey"> | TypedResponseMessage<"NostrSignEvent"> | TypedResponseMessage<"NostrSignedEvent"> | TypedResponseMessage<"NostrSignSchnorr"> | TypedResponseMessage<"NostrSignedSchnorr"> | TypedResponseMessage<"NostrEncryptMessage"> | TypedResponseMessage<"NostrEncryptedMessage"> | TypedResponseMessage<"NostrDecryptMessage"> | TypedResponseMessage<"NostrDecryptedMessage"> | TypedResponseMessage<"PolkadotGetAddress"> | TypedResponseMessage<"PolkadotAddress"> | TypedResponseMessage<"PolkadotSignTx"> | TypedResponseMessage<"PolkadotSignedTx"> | TypedResponseMessage<"RippleGetAddress"> | TypedResponseMessage<"RippleAddress"> | TypedResponseMessage<"RippleSignTx"> | TypedResponseMessage<"RippleSignedTx"> | TypedResponseMessage<"ScdoGetAddress"> | TypedResponseMessage<"ScdoAddress"> | TypedResponseMessage<"ScdoSignTx"> | TypedResponseMessage<"ScdoSignedTx"> | TypedResponseMessage<"ScdoTxAck"> | TypedResponseMessage<"ScdoSignMessage"> | TypedResponseMessage<"ScdoSignedMessage"> | TypedResponseMessage<"SolanaGetAddress"> | TypedResponseMessage<"SolanaAddress"> | TypedResponseMessage<"SolanaSignTx"> | TypedResponseMessage<"SolanaSignedTx"> | TypedResponseMessage<"SolanaSignOffChainMessage"> | TypedResponseMessage<"SolanaSignUnsafeMessage"> | TypedResponseMessage<"SolanaMessageSignature"> | TypedResponseMessage<"StarcoinGetAddress"> | TypedResponseMessage<"StarcoinAddress"> | TypedResponseMessage<"StarcoinGetPublicKey"> | TypedResponseMessage<"StarcoinPublicKey"> | TypedResponseMessage<"StarcoinSignTx"> | TypedResponseMessage<"StarcoinSignedTx"> | TypedResponseMessage<"StarcoinSignMessage"> | TypedResponseMessage<"StarcoinMessageSignature"> | TypedResponseMessage<"StarcoinVerifyMessage"> | TypedResponseMessage<"StellarGetAddress"> | TypedResponseMessage<"StellarAddress"> | TypedResponseMessage<"StellarSignTx"> | TypedResponseMessage<"StellarTxOpRequest"> | TypedResponseMessage<"StellarPaymentOp"> | TypedResponseMessage<"StellarCreateAccountOp"> | TypedResponseMessage<"StellarPathPaymentStrictReceiveOp"> | TypedResponseMessage<"StellarPathPaymentStrictSendOp"> | TypedResponseMessage<"StellarManageSellOfferOp"> | TypedResponseMessage<"StellarManageBuyOfferOp"> | TypedResponseMessage<"StellarCreatePassiveSellOfferOp"> | TypedResponseMessage<"StellarSetOptionsOp"> | TypedResponseMessage<"StellarChangeTrustOp"> | TypedResponseMessage<"StellarAllowTrustOp"> | TypedResponseMessage<"StellarAccountMergeOp"> | TypedResponseMessage<"StellarManageDataOp"> | TypedResponseMessage<"StellarBumpSequenceOp"> | TypedResponseMessage<"StellarInvokeHostFunctionOp"> | TypedResponseMessage<"StellarSorobanDataRequest"> | TypedResponseMessage<"StellarSorobanDataAck"> | TypedResponseMessage<"StellarSignedTx"> | TypedResponseMessage<"SuiGetAddress"> | TypedResponseMessage<"SuiAddress"> | TypedResponseMessage<"SuiSignTx"> | TypedResponseMessage<"SuiSignedTx"> | TypedResponseMessage<"SuiTxRequest"> | TypedResponseMessage<"SuiTxAck"> | TypedResponseMessage<"SuiSignMessage"> | TypedResponseMessage<"SuiMessageSignature"> | TypedResponseMessage<"TezosGetAddress"> | TypedResponseMessage<"TezosAddress"> | TypedResponseMessage<"TezosGetPublicKey"> | TypedResponseMessage<"TezosPublicKey"> | TypedResponseMessage<"TezosSignTx"> | TypedResponseMessage<"TezosSignedTx"> | TypedResponseMessage<"TonGetAddress"> | TypedResponseMessage<"TonAddress"> | TypedResponseMessage<"TonSignMessage"> | TypedResponseMessage<"TonTxAck"> | TypedResponseMessage<"TonSignedMessage"> | TypedResponseMessage<"TonSignProof"> | TypedResponseMessage<"TonSignedProof"> | TypedResponseMessage<"TonSignData"> | TypedResponseMessage<"TonSignedData"> | TypedResponseMessage<"TronGetAddress"> | TypedResponseMessage<"TronAddress"> | TypedResponseMessage<"TronSignTx"> | TypedResponseMessage<"TronSignedTx"> | TypedResponseMessage<"TronSignMessage"> | TypedResponseMessage<"TronMessageSignature"> | TypedResponseMessage<"facotry"> | TypedResponseMessage<"experimental_message"> | TypedResponseMessage<"experimental_field"> | TypedResponseMessage<"TxAckPaymentRequest"> | TypedResponseMessage<"InternalMyAddressRequest"> | TypedResponseMessage<"StartSession"> | TypedResponseMessage<"SetBusy"> | TypedResponseMessage<"GetFirmwareHash"> | TypedResponseMessage<"FirmwareHash"> | TypedResponseMessage<"GetNonce"> | TypedResponseMessage<"Nonce"> | TypedResponseMessage<"WriteSEPrivateKey"> | TypedResponseMessage<"SetWallpaper"> | TypedResponseMessage<"GetWallpaper"> | TypedResponseMessage<"Wallpaper"> | TypedResponseMessage<"UnlockPath"> | TypedResponseMessage<"UnlockedPathRequest"> | TypedResponseMessage<"ViewSignPage"> | TypedResponseMessage<"ViewVerifyPage"> | TypedResponseMessage<"ProtocolInfoRequest"> | TypedResponseMessage<"ProtocolInfo"> | TypedResponseMessage<"DeviceReboot"> | TypedResponseMessage<"DeviceSettingsGet"> | TypedResponseMessage<"DeviceSettingsSet"> | TypedResponseMessage<"DeviceCertificateWrite"> | TypedResponseMessage<"DeviceCertificateRead"> | TypedResponseMessage<"DeviceCertificateSignature"> | TypedResponseMessage<"DeviceCertificateSign"> | TypedResponseMessage<"DeviceFirmwareUpdateRequest"> | TypedResponseMessage<"DeviceFirmwareUpdateStatusGet"> | TypedResponseMessage<"DeviceFactoryInfoSet"> | TypedResponseMessage<"DeviceFactoryInfoGet"> | TypedResponseMessage<"DeviceFactoryPermanentLock"> | TypedResponseMessage<"DeviceFactoryTest"> | TypedResponseMessage<"DeviceInfoGet"> | TypedResponseMessage<"DeviceSessionGet"> | TypedResponseMessage<"FilesystemPermissionFix"> | TypedResponseMessage<"FilesystemPathInfo"> | TypedResponseMessage<"FilesystemPathInfoQuery"> | TypedResponseMessage<"FilesystemFileRead"> | TypedResponseMessage<"FilesystemFileWrite"> | TypedResponseMessage<"FilesystemFileDelete"> | TypedResponseMessage<"FilesystemDir"> | TypedResponseMessage<"FilesystemDirList"> | TypedResponseMessage<"FilesystemDirMake"> | TypedResponseMessage<"FilesystemDirRemove"> | TypedResponseMessage<"FilesystemFormat">;
4471
+ 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">;
4472
+
4473
+ type DeviceFeaturesInput = Features | Messages.Features;
3763
4474
 
3764
- declare const getDeviceType: (features?: Features) => IDeviceType;
4475
+ /**
4476
+ * get device type by features
4477
+ */
4478
+ declare const getDeviceType: (features?: DeviceFeaturesInput) => IDeviceType;
4479
+ /**
4480
+ * get device type by ble name
4481
+ * @param name Ble name
4482
+ */
3765
4483
  declare const getDeviceTypeByBleName: (name?: string) => IDeviceType;
3766
- declare const getDeviceBleName: (features?: Features) => string | null;
3767
- declare const getDeviceUUID: (features: Features) => string;
3768
- declare const getDeviceLabel: (features?: Features) => string | null;
3769
- declare const getMethodVersionRange: (features: Features | undefined, getVersionRange: (deviceModel: IDeviceType | IDeviceModel) => IVersionRange | undefined) => IVersionRange | undefined;
3770
- declare const isMethodVersionRangeUnsupported: (versionRange?: IVersionRange) => boolean;
3771
- declare const getFirmwareType: (features: Features | undefined) => EFirmwareType;
3772
-
3773
- declare const getDeviceFirmwareVersion: (features: Features | undefined) => IVersionArray;
3774
- declare const getDeviceBLEFirmwareVersion: (features: Features) => IVersionArray;
3775
- declare const getDeviceBootloaderVersion: (features: Features | undefined) => IVersionArray;
3776
- declare const getDeviceBoardloaderVersion: (features: Features) => IVersionArray;
4484
+ /**
4485
+ * Get Connected Device ble name by features
4486
+ * @returns
4487
+ */
4488
+ declare const getDeviceBleName: (features?: DeviceFeaturesInput) => string | null;
4489
+ /**
4490
+ * Get Connected Device serial number by features
4491
+ */
4492
+ declare const getDeviceSerialNo: (features?: DeviceFeaturesInput) => string;
4493
+ /**
4494
+ * @deprecated Use getDeviceSerialNo instead.
4495
+ */
4496
+ declare const getDeviceUUID: (features?: DeviceFeaturesInput) => string;
4497
+ /**
4498
+ * Get Connected Device label by features
4499
+ */
4500
+ declare const getDeviceLabel: (features?: DeviceFeaturesInput) => string | null;
4501
+ /**
4502
+ * Get firmware version range by features
4503
+ * Type has a higher priority than Model
4504
+ */
4505
+ declare const getMethodVersionRange: (features: DeviceFeaturesInput | undefined, getVersionRange: (deviceModel: IDeviceType | IDeviceModel) => IVersionRange | undefined) => IVersionRange | undefined;
4506
+ declare const getFirmwareType: (features?: DeviceFeaturesInput) => _onekeyfe_hd_shared.EFirmwareType;
4507
+
4508
+ /**
4509
+ * Get Connected Device version by features
4510
+ */
4511
+ declare const getDeviceFirmwareVersion: (features?: DeviceFeaturesInput) => IVersionArray;
4512
+ /**
4513
+ * Get Connected Device bootloader version by features
4514
+ */
4515
+ declare const getDeviceBootloaderVersion: (features?: DeviceFeaturesInput) => IVersionArray;
4516
+ /**
4517
+ * Get Connected Device boardloader/romloader version by features
4518
+ */
4519
+ declare const getDeviceBoardloaderVersion: (features?: DeviceFeaturesInput) => IVersionArray;
4520
+ /**
4521
+ * Get Connected Device bluetooth firmware version by features
4522
+ */
4523
+ declare const getDeviceBLEFirmwareVersion: (features?: DeviceFeaturesInput) => IVersionArray;
3777
4524
 
3778
4525
  declare const FIRMWARE_FIELDS: readonly ["firmware", "firmware-v1", "firmware-v2", "firmware-v8", "firmware-btc-v8"];
3779
4526
  type IFirmwareField = (typeof FIRMWARE_FIELDS)[number];
@@ -3790,11 +4537,19 @@ declare class DataManager {
3790
4537
  };
3791
4538
  static lastCheckTimestamp: number;
3792
4539
  static getFirmwareStatus: (features: Features, firmwareType: EFirmwareType) => IDeviceFirmwareStatus;
4540
+ /**
4541
+ * Touch、Pro System UI Resource Update
4542
+ * ** Interval upgrade is not considered **
4543
+ */
3793
4544
  static getSysResourcesLatestRelease: ({ features, forcedUpdateRes, firmwareType, }: {
3794
4545
  features: Features;
3795
4546
  forcedUpdateRes?: boolean | undefined;
3796
4547
  firmwareType: EFirmwareType;
3797
4548
  }) => string | undefined;
4549
+ /**
4550
+ * Touch、Pro System full UI Resource Update
4551
+ * ** Interval upgrade is not considered **
4552
+ */
3798
4553
  static getSysFullResource: (features: Features, firmwareType: EFirmwareType) => string | undefined;
3799
4554
  static getBootloaderResource: (features: Features, firmwareType: EFirmwareType) => string | undefined;
3800
4555
  static getBootloaderTargetVersion: (features: Features, firmwareType: EFirmwareType) => IVersionArray | undefined;
@@ -3816,24 +4571,38 @@ declare class DataManager {
3816
4571
  "en-US": string;
3817
4572
  } | undefined;
3818
4573
  private static enrichFirmwareReleaseInfo;
3819
- static load(settings: ConnectSettings): Promise<void>;
4574
+ static load(settings: ConnectSettings): Promise<boolean>;
3820
4575
  static updateEnv(newEnv: ConnectSettings['env']): void;
3821
4576
  static checkAndReloadData(): Promise<void>;
4577
+ /** Force a fresh remote config before an update is allowed to mutate the device. */
4578
+ static forceReloadData(): Promise<void>;
4579
+ static getProtocolV2Resources(): IProtocolV2Resource[] | undefined;
4580
+ static getProtocolV2BootResources(): IProtocolV2BootResources | undefined;
3822
4581
  static getProtobufMessages(schema?: ProtobufMessageSchema): JSON;
3823
4582
  static getSettings(key?: undefined): ConnectSettings;
3824
4583
  static getSettings<T extends keyof ConnectSettings>(key: T): ConnectSettings[T];
3825
4584
  static isBleConnect: (env: ConnectSettings['env']) => boolean;
4585
+ /** Desktop WebUSB doesn't need browser permission prompt */
3826
4586
  static isDesktopWebUsb: (env: ConnectSettings['env']) => boolean;
4587
+ /** Browser WebUSB needs permission prompt */
3827
4588
  static isBrowserWebUsb: (env: ConnectSettings['env']) => boolean;
3828
4589
  }
3829
4590
 
3830
- declare const supportInputPinOnSoftware: (features: Features) => SupportFeatureType;
4591
+ declare const supportInputPinOnSoftware: (features?: Features) => SupportFeatureType;
4592
+ /**
4593
+ * Since 3.5.0, Touch uses the firmware-v3 field to get firmware release info
4594
+ */
3831
4595
  declare const getFirmwareUpdateField: ({ features, updateType, targetVersion, firmwareType, }: {
3832
4596
  features: Features;
3833
4597
  updateType: 'firmware' | 'ble';
3834
4598
  targetVersion?: string | undefined;
3835
4599
  firmwareType: EFirmwareType;
3836
4600
  }) => 'ble' | IFirmwareField;
4601
+ /**
4602
+ * Returns the optional firmware version
4603
+ * Used in firmware web update
4604
+ * https://firmware.onekey.so/
4605
+ */
3837
4606
  declare const getFirmwareUpdateFieldArray: (features: Features, updateType: 'firmware' | 'ble' | 'bootloader') => ('ble' | IFirmwareField)[];
3838
4607
 
3839
4608
  declare function checkNeedUpdateBootForTouch(features: Features, firmwareType: EFirmwareType): boolean;
@@ -3843,15 +4612,40 @@ declare function checkNeedUpdateBootForClassicAndMini({ features, willUpdateFirm
3843
4612
  firmwareType: EFirmwareType;
3844
4613
  }): boolean;
3845
4614
 
4615
+ type DeviceSettingsProtocol = 'V1' | 'V2';
4616
+ type DeviceSettingsField = keyof DeviceSettingsParams;
4617
+ declare const DEVICE_SETTINGS_SHARED_FIELDS: readonly ["language", "label", "usePassphrase", "autoLockDelayMs", "autoShutdownDelayMs", "hapticFeedback", "bluetoothEnabled"];
4618
+ declare const DEVICE_SETTINGS_V1_ONLY_FIELDS: readonly ["homescreen", "passphraseSource", "displayRotation", "passphraseAlwaysOnDevice", "safetyChecks", "experimentalFeatures", "changeBrightness"];
4619
+ declare const DEVICE_SETTINGS_V2_ONLY_FIELDS: readonly ["brightness", "airgapMode", "animationEnabled", "tapToWake", "deviceNameDisplayEnabled", "fidoEnabled", "usbLockEnabled", "randomKeypad"];
4620
+ declare const PROTOCOL_V2_NEVER_TIMEOUT_MS = 268435456;
4621
+ declare const normalizeSafetyCheckLevel: (value: SafetyCheckLevel | null | undefined) => Enum_SafetyCheckLevel | null | undefined;
3846
4622
  declare const getLanguageConfig: (deviceType: IDeviceType) => Record<string, string>[];
3847
- type DurationParts = {
3848
- seconds: number;
3849
- minute: number;
3850
- hour: number;
3851
- day: number;
4623
+ type DeviceSettingsDurationOption = {
4624
+ label: string;
4625
+ valueMs: number;
4626
+ };
4627
+ type DeviceSettingsValueOption<T> = {
4628
+ label: string;
4629
+ value: T;
4630
+ };
4631
+ declare const getAutoLockOptions: (deviceType: IDeviceType, protocol: DeviceSettingsProtocol) => DeviceSettingsDurationOption[];
4632
+ declare const getAutoShutDownOptions: (deviceType: IDeviceType, protocol: DeviceSettingsProtocol) => DeviceSettingsDurationOption[];
4633
+ type DeviceSettingsCapabilities = {
4634
+ protocol: DeviceSettingsProtocol;
4635
+ supportedFields: readonly DeviceSettingsField[];
4636
+ languageOptions: ReadonlyArray<Record<string, string>>;
4637
+ autoLockDelayOptions: readonly DeviceSettingsDurationOption[];
4638
+ autoShutdownDelayOptions: readonly DeviceSettingsDurationOption[];
4639
+ ranges: {
4640
+ brightness?: {
4641
+ min: number;
4642
+ max: number;
4643
+ };
4644
+ };
4645
+ safetyCheckOptions: ReadonlyArray<DeviceSettingsValueOption<Enum_SafetyCheckLevel>>;
4646
+ onDeviceConfirmationFields: readonly DeviceSettingsField[];
3852
4647
  };
3853
- declare const getAutoLockOptions: (_deviceType: IDeviceType) => DurationParts[];
3854
- declare const getAutoShutDownOptions: (_deviceType: IDeviceType) => DurationParts[];
4648
+ declare const getDeviceSettingsCapabilities: (deviceType: IDeviceType, protocol: DeviceSettingsProtocol) => DeviceSettingsCapabilities;
3855
4649
 
3856
4650
  declare const getHDPath: (path: string) => Array<number>;
3857
4651
  declare const getScriptType: (path: Array<number>) => InputScriptType;
@@ -3864,6 +4658,10 @@ type SizeConfig = {
3864
4658
  height: number;
3865
4659
  radius?: number;
3866
4660
  };
4661
+ declare const getNftSize: ({ deviceType, thumbnail, }: {
4662
+ deviceType: IDeviceType;
4663
+ thumbnail?: boolean | undefined;
4664
+ }) => SizeConfig | undefined;
3867
4665
  declare const getHomeScreenSize: ({ deviceType, homeScreenType, thumbnail, }: {
3868
4666
  deviceType: IDeviceType;
3869
4667
  homeScreenType: 'WallPaper' | 'Nft';
@@ -3892,4 +4690,4 @@ declare const HardwareSdk: ({ init, call, dispose, eventEmitter, uiResponse, can
3892
4690
  declare const HardwareSDKLowLevel: ({ init, call, dispose, eventEmitter, addHardwareGlobalEventListener, uiResponse, cancel, updateSettings, switchTransport, }: LowLevelInjectApi) => LowLevelCoreApi;
3893
4691
  declare const HardwareTopLevelSdk: () => CoreApi;
3894
4692
 
3895
- 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, IProtocolV2FirmwareComponent, IProtocolV2FirmwareComponentTarget, IProtocolV2ResourceManifest, IProtocolV2ResourceManifestPackage, 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 };
4693
+ export { AccountAddress, AccountAddresses, AlephiumAddress, AlephiumGetAddressParams, AlephiumSignMessageParams, AlephiumSignTransactionParams, AlephiumSignedTx, AlgoAddress, AlgoGetAddressParams, AlgoSignTransactionParams, AlgoSignedTx, AllFirmwareRelease, AllNetworkAddressParams, AllNetworkGetAddressParams, AptosAddress, AptosGetAddressParams, AptosGetPublicKeyParams, AptosMessageSignature, AptosPublicKey, AptosSignInMessageParams, AptosSignInMessageSignature, AptosSignMessageParams, AptosSignTransactionParams, AptosSignedTx, AssetsMap, BTCAddress, BTCGetAddressParams, BTCGetPublicKeyParams, BTCPublicKey, BTCSignMessageParams, BTCSignTransactionParams, BTCVerifyMessageParams, BenfenAddress, BenfenGetAddressParams, BenfenGetPublicKeyParams, BenfenPublicKey, BenfenSignMessageParams, BenfenSignTransactionParams, BenfenSignedTx, BleReleaseInfoEvent, BleReleaseInfoPayload, CORE_EVENT, CallMethod, CallMethodAnyResponse, CallMethodKeys, CallMethodPayload, CallMethodResponse, CallMethodUnion, CardanoAddress, CardanoGetAddressMethodParams, CardanoGetAddressParams, CardanoSignMessageMethodParams, CardanoSignMessageParams, CardanoSignTransaction, CardanoSignedTxData, CipheredKeyValue, CipheredKeyValueParams, ClearSessionCacheParams, ClearSessionCachePayload, CommonParams, ConfluxAddress, ConfluxGetAddressParams, ConfluxSignMessageCIP23Params, ConfluxSignMessageParams, ConfluxSignTransactionParams, ConfluxSignedTx, ConfluxTransaction, ConnectSettings, Core, CoreApi, CoreMessage, CosmosAddress, CosmosGetAddressParams, CosmosGetPublicKeyParams, CosmosPublicKey, CosmosSignTransactionParams, CosmosSignedTx, DEFAULT_PRIORITY, DEVICE, DEVICE_EVENT, 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, DeviceStateSettings, DeviceStateStatus, DeviceStateUpdateSource, DeviceStateVersions, DeviceStatus, DeviceSupportFeatures, DeviceSupportFeaturesPayload, DeviceTypeMap, DeviceTypeToModels, DeviceUploadResourceParams, DeviceUploadResourceResponse, DeviceVerifyParams, DeviceVerifySignature, DnxAddress, DnxGetAddressParams, DnxSignTransactionParams, DnxSignature, DnxTxKey, EOneKeyDeviceMode, EVMAccessList, EVMAddress, EVMAuthorization, EVMAuthorizationSignature, EVMGetAddressParams, EVMGetPublicKeyParams, EVMPublicKey, EVMSignMessageEIP712Params, EVMSignMessageParams, EVMSignTransactionParams, EVMSignTypedDataParams, EVMSignedTx, EVMTransaction, EVMTransactionEIP1559, EVMTransactionEIP7702, EVMVerifyMessageParams, EthereumSignTypedDataMessage, EthereumSignTypedDataTypeProperty, EthereumSignTypedDataTypes, FIRMWARE, FIRMWARE_EVENT, Features, FilecoinAddress, FilecoinGetAddressParams, FilecoinSignTransactionParams, FilecoinSignedTx, FirmwareEvent, FirmwareMessage, FirmwareProcessing, FirmwareProgress, FirmwareRange, FirmwareRelease, FirmwareTip, FirmwareUpdateBinaryParams, FirmwareUpdateParams, FirmwareUpdateTipMessage, FirmwareUpdateV3Params, 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, IProtocolV2BootResources, IProtocolV2FirmwareComponent, IProtocolV2FirmwareComponentTarget, IProtocolV2Resource, IProtocolV2ResourceBundle, IProtocolV2ResourceType, 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, 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, getHDPath, getHomeScreenDefaultList, getHomeScreenHex, getHomeScreenSize, getLanguageConfig, getLog, getLogBlockLabel, getLogger, getMethodVersionRange, getNftSize, getOutputScriptType, getSDKVersion, getSafeLogPayload, getScriptType, getTimeStamp, httpRequest, init$1 as initCore, isBleConnect, isValidVersionArray, isValidVersionString, normalizeSafetyCheckLevel, normalizeVersionArray, parseConnectSettings, parseMessage, patchFeatures, preloadSessionCache, safeThrowError, setLoggerPostMessage, supportInputPinOnSoftware, switchTransport, transportEnv, updateRequestContext, versionCompare, versionSplit, wait, whitelist, whitelistExtension };