@onekeyfe/hd-core 1.2.0-alpha.2 → 1.2.0-alpha.21

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 (406) hide show
  1. package/__tests__/AllNetworkGetAddressBase.tracing.test.ts +75 -0
  2. package/__tests__/DeviceCommands.test.ts +285 -0
  3. package/__tests__/DeviceEventRegistration.test.ts +43 -0
  4. package/__tests__/connectSettings.test.ts +19 -0
  5. package/__tests__/core-dispose.test.ts +34 -0
  6. package/__tests__/core-error-output.test.ts +39 -0
  7. package/__tests__/device-features-state.test.ts +78 -0
  8. package/__tests__/device-identity.test.ts +30 -0
  9. package/__tests__/device-lifecycle-events.test.ts +117 -0
  10. package/__tests__/device-pool-state.test.ts +132 -0
  11. package/__tests__/device-settings.test.ts +391 -0
  12. package/__tests__/device-state-contract.test.ts +27 -0
  13. package/__tests__/device-state-events.test.ts +162 -0
  14. package/__tests__/device-state-mapper.test.ts +241 -0
  15. package/__tests__/device-state-projector.test.ts +94 -0
  16. package/__tests__/device-state-store.test.ts +82 -0
  17. package/__tests__/device-utils.test.ts +106 -0
  18. package/__tests__/device-wallet-session-store.test.ts +213 -0
  19. package/__tests__/deviceFeaturesUtils.test.ts +39 -0
  20. package/__tests__/deviceSettings.test.ts +103 -0
  21. package/__tests__/evmLedgerLegacySafety.test.ts +10 -6
  22. package/__tests__/evmSignTypedData.test.ts +80 -0
  23. package/__tests__/filesystemValidation.test.ts +53 -0
  24. package/__tests__/firmware-update/firmware-update-v2-download-before-boot.test.ts +402 -0
  25. package/__tests__/get-device-state.test.ts +410 -0
  26. package/__tests__/homescreen.test.ts +24 -0
  27. package/__tests__/kaspaSignTransaction.test.ts +591 -0
  28. package/__tests__/logBlockEvent.test.ts +26 -0
  29. package/__tests__/networkUtils.test.ts +386 -0
  30. package/__tests__/open-wallet-session-error-response.test.ts +43 -0
  31. package/__tests__/open-wallet-session.test.ts +559 -0
  32. package/__tests__/preInitialize.test.ts +33 -0
  33. package/__tests__/pro2Wallpaper.test.ts +50 -0
  34. package/__tests__/protocol-v2-bootloader-mode.test.ts +37 -0
  35. package/__tests__/protocol-v2-firmware-targets.test.ts +19 -0
  36. package/__tests__/protocol-v2.test.ts +3954 -1191
  37. package/__tests__/protocolV2FileWrite.test.ts +92 -0
  38. package/__tests__/protocolV2UiInteraction.test.ts +266 -0
  39. package/__tests__/public-device-state-api.test.ts +257 -0
  40. package/__tests__/public-pro2-api-boundary.test.ts +110 -0
  41. package/__tests__/refresh-device-state.test.ts +101 -0
  42. package/__tests__/request-context-logging.test.ts +16 -0
  43. package/__tests__/search-devices.test.ts +136 -0
  44. package/dist/api/BaseMethod.d.ts +8 -0
  45. package/dist/api/BaseMethod.d.ts.map +1 -1
  46. package/dist/api/CheckBootloaderRelease.d.ts.map +1 -1
  47. package/dist/api/CheckFirmwareRelease.d.ts.map +1 -1
  48. package/dist/api/ClearSessionCache.d.ts +9 -0
  49. package/dist/api/ClearSessionCache.d.ts.map +1 -0
  50. package/dist/api/DirList.d.ts.map +1 -1
  51. package/dist/api/FileRead.d.ts.map +1 -1
  52. package/dist/api/FileWrite.d.ts +1 -0
  53. package/dist/api/FileWrite.d.ts.map +1 -1
  54. package/dist/api/FirmwareUpdateV2.d.ts +2 -2
  55. package/dist/api/FirmwareUpdateV2.d.ts.map +1 -1
  56. package/dist/api/FirmwareUpdateV3.d.ts.map +1 -1
  57. package/dist/api/FirmwareUpdateV4.d.ts +25 -5
  58. package/dist/api/FirmwareUpdateV4.d.ts.map +1 -1
  59. package/dist/api/GetDeviceState.d.ts +7 -0
  60. package/dist/api/GetDeviceState.d.ts.map +1 -0
  61. package/dist/api/GetFeatures.d.ts +1 -1
  62. package/dist/api/GetFeatures.d.ts.map +1 -1
  63. package/dist/api/GetOnekeyFeatures.d.ts.map +1 -1
  64. package/dist/api/GetPassphraseState.d.ts +1 -6
  65. package/dist/api/GetPassphraseState.d.ts.map +1 -1
  66. package/dist/api/OpenWalletSession.d.ts +14 -0
  67. package/dist/api/OpenWalletSession.d.ts.map +1 -0
  68. package/dist/api/PathInfo.d.ts.map +1 -1
  69. package/dist/api/PromptWebDeviceAccess.d.ts.map +1 -1
  70. package/dist/api/SearchDevices.d.ts +3 -0
  71. package/dist/api/SearchDevices.d.ts.map +1 -1
  72. package/dist/api/UploadPortfolio.d.ts +17 -0
  73. package/dist/api/UploadPortfolio.d.ts.map +1 -0
  74. package/dist/api/allnetwork/AllNetworkGetAddressBase.d.ts.map +1 -1
  75. package/dist/api/device/DeviceCancel.d.ts.map +1 -1
  76. package/dist/api/device/DeviceChangePin.d.ts.map +1 -1
  77. package/dist/api/device/DeviceFullyUploadResource.d.ts +1 -2
  78. package/dist/api/device/DeviceFullyUploadResource.d.ts.map +1 -1
  79. package/dist/api/device/DeviceLock.d.ts.map +1 -1
  80. package/dist/api/device/DeviceRebootToBoardloader.d.ts.map +1 -1
  81. package/dist/api/device/DeviceRebootToBootloader.d.ts.map +1 -1
  82. package/dist/api/device/DeviceSettings.d.ts.map +1 -1
  83. package/dist/api/device/DeviceUnlock.d.ts +1 -1
  84. package/dist/api/device/DeviceUnlock.d.ts.map +1 -1
  85. package/dist/api/device/DeviceUpdateBootloader.d.ts.map +1 -1
  86. package/dist/api/device/DeviceWipe.d.ts.map +1 -1
  87. package/dist/api/evm/EVMSignTypedData.d.ts.map +1 -1
  88. package/dist/api/firmware/FirmwareUpdateBaseMethod.d.ts +1 -0
  89. package/dist/api/firmware/FirmwareUpdateBaseMethod.d.ts.map +1 -1
  90. package/dist/api/firmware/getBinary.d.ts +11 -3
  91. package/dist/api/firmware/getBinary.d.ts.map +1 -1
  92. package/dist/api/firmware/progressThrottle.d.ts +3 -0
  93. package/dist/api/firmware/progressThrottle.d.ts.map +1 -0
  94. package/dist/api/helpers/filesystemValidation.d.ts +3 -0
  95. package/dist/api/helpers/filesystemValidation.d.ts.map +1 -1
  96. package/dist/api/helpers/paramsValidator.d.ts +1 -0
  97. package/dist/api/helpers/paramsValidator.d.ts.map +1 -1
  98. package/dist/api/helpers/protocolV2FileWrite.d.ts +33 -0
  99. package/dist/api/helpers/protocolV2FileWrite.d.ts.map +1 -0
  100. package/dist/api/index.d.ts +12 -19
  101. package/dist/api/index.d.ts.map +1 -1
  102. package/dist/api/kaspa/KaspaSignTransaction.d.ts +5 -1
  103. package/dist/api/kaspa/KaspaSignTransaction.d.ts.map +1 -1
  104. package/dist/api/kaspa/helpers/TransferSerialize.d.ts.map +1 -1
  105. package/dist/api/protocol-v2/DeviceFactoryInfoGet.d.ts +6 -0
  106. package/dist/api/protocol-v2/DeviceFactoryInfoGet.d.ts.map +1 -0
  107. package/dist/api/protocol-v2/DeviceFactoryInfoSet.d.ts +7 -0
  108. package/dist/api/protocol-v2/DeviceFactoryInfoSet.d.ts.map +1 -0
  109. package/dist/api/protocol-v2/DeviceFirmwareUpdate.d.ts +1 -1
  110. package/dist/api/protocol-v2/DeviceFirmwareUpdate.d.ts.map +1 -1
  111. package/dist/api/protocol-v2/DeviceGetFirmwareUpdateStatus.d.ts +3 -2
  112. package/dist/api/protocol-v2/DeviceGetFirmwareUpdateStatus.d.ts.map +1 -1
  113. package/dist/api/protocol-v2/DeviceGetOnboardingStatus.d.ts +1 -1
  114. package/dist/api/protocol-v2/DeviceGetOnboardingStatus.d.ts.map +1 -1
  115. package/dist/api/protocol-v2/DeviceInfoGet.d.ts +28 -0
  116. package/dist/api/protocol-v2/DeviceInfoGet.d.ts.map +1 -0
  117. package/dist/api/protocol-v2/DeviceReboot.d.ts.map +1 -1
  118. package/dist/api/protocol-v2/DeviceStatusGet.d.ts +6 -0
  119. package/dist/api/protocol-v2/DeviceStatusGet.d.ts.map +1 -0
  120. package/dist/api/protocol-v2/DeviceUploadWallpaper.d.ts +26 -0
  121. package/dist/api/protocol-v2/DeviceUploadWallpaper.d.ts.map +1 -0
  122. package/dist/api/protocol-v2/FilesystemFormat.d.ts.map +1 -1
  123. package/dist/api/protocol-v2/{FilesystemFixPermission.d.ts → FilesystemPermissionFix.d.ts} +2 -2
  124. package/dist/api/protocol-v2/FilesystemPermissionFix.d.ts.map +1 -0
  125. package/dist/api/protocol-v2/ProtocolInfoRequest.d.ts +6 -0
  126. package/dist/api/protocol-v2/ProtocolInfoRequest.d.ts.map +1 -0
  127. package/dist/api/protocol-v2/helpers.d.ts +27 -19
  128. package/dist/api/protocol-v2/helpers.d.ts.map +1 -1
  129. package/dist/api/ton/TonSignData.d.ts +1 -5
  130. package/dist/api/ton/TonSignData.d.ts.map +1 -1
  131. package/dist/api/utils.d.ts +2 -1
  132. package/dist/api/utils.d.ts.map +1 -1
  133. package/dist/constants/index.d.ts +2 -1
  134. package/dist/constants/index.d.ts.map +1 -1
  135. package/dist/core/RequestQueue.d.ts.map +1 -1
  136. package/dist/core/deviceEventRegistration.d.ts +11 -0
  137. package/dist/core/deviceEventRegistration.d.ts.map +1 -0
  138. package/dist/core/index.d.ts +3 -1
  139. package/dist/core/index.d.ts.map +1 -1
  140. package/dist/data-manager/DataManager.d.ts +1 -1
  141. package/dist/data-manager/DataManager.d.ts.map +1 -1
  142. package/dist/data-manager/connectSettings.d.ts.map +1 -1
  143. package/dist/device/Device.d.ts +35 -11
  144. package/dist/device/Device.d.ts.map +1 -1
  145. package/dist/device/DeviceCommands.d.ts +8 -6
  146. package/dist/device/DeviceCommands.d.ts.map +1 -1
  147. package/dist/device/DeviceFeaturesState.d.ts +3 -0
  148. package/dist/device/DeviceFeaturesState.d.ts.map +1 -0
  149. package/dist/device/DevicePool.d.ts +4 -2
  150. package/dist/device/DevicePool.d.ts.map +1 -1
  151. package/dist/device/DeviceStateMapper.d.ts +13 -0
  152. package/dist/device/DeviceStateMapper.d.ts.map +1 -0
  153. package/dist/device/DeviceStateProjector.d.ts +7 -0
  154. package/dist/device/DeviceStateProjector.d.ts.map +1 -0
  155. package/dist/device/DeviceStateStore.d.ts +21 -0
  156. package/dist/device/DeviceStateStore.d.ts.map +1 -0
  157. package/dist/device/DeviceWalletSessionStore.d.ts +20 -0
  158. package/dist/device/DeviceWalletSessionStore.d.ts.map +1 -0
  159. package/dist/device/cloneDeviceState.d.ts +2 -0
  160. package/dist/device/cloneDeviceState.d.ts.map +1 -0
  161. package/dist/device/deviceIdentity.d.ts +5 -0
  162. package/dist/device/deviceIdentity.d.ts.map +1 -0
  163. package/dist/deviceProfile/buildDeviceFeatures.d.ts +9 -3
  164. package/dist/deviceProfile/buildDeviceFeatures.d.ts.map +1 -1
  165. package/dist/deviceProfile/index.d.ts +0 -1
  166. package/dist/deviceProfile/index.d.ts.map +1 -1
  167. package/dist/events/device.d.ts +11 -2
  168. package/dist/events/device.d.ts.map +1 -1
  169. package/dist/events/logBlockEvent.d.ts.map +1 -1
  170. package/dist/events/ui-request.d.ts +18 -2
  171. package/dist/events/ui-request.d.ts.map +1 -1
  172. package/dist/index.d.ts +1361 -609
  173. package/dist/index.js +5898 -2860
  174. package/dist/inject.d.ts.map +1 -1
  175. package/dist/protocols/protocol-v2/deviceSession.d.ts +7 -0
  176. package/dist/protocols/protocol-v2/deviceSession.d.ts.map +1 -0
  177. package/dist/protocols/protocol-v2/features.d.ts +23 -28
  178. package/dist/protocols/protocol-v2/features.d.ts.map +1 -1
  179. package/dist/protocols/protocol-v2/firmware.d.ts +11 -9
  180. package/dist/protocols/protocol-v2/firmware.d.ts.map +1 -1
  181. package/dist/protocols/protocol-v2/index.d.ts +3 -2
  182. package/dist/protocols/protocol-v2/index.d.ts.map +1 -1
  183. package/dist/protocols/protocol-v2/lockedError.d.ts +2 -0
  184. package/dist/protocols/protocol-v2/lockedError.d.ts.map +1 -0
  185. package/dist/protocols/protocol-v2/settingsUnlockPolicy.d.ts +16 -0
  186. package/dist/protocols/protocol-v2/settingsUnlockPolicy.d.ts.map +1 -0
  187. package/dist/protocols/protocol-v2/uiInteraction.d.ts +39 -0
  188. package/dist/protocols/protocol-v2/uiInteraction.d.ts.map +1 -0
  189. package/dist/protocols/protocol-v2/unlockRetry.d.ts +11 -0
  190. package/dist/protocols/protocol-v2/unlockRetry.d.ts.map +1 -0
  191. package/dist/protocols/protocol-v2/walletSession.d.ts +19 -0
  192. package/dist/protocols/protocol-v2/walletSession.d.ts.map +1 -0
  193. package/dist/types/api/checkAllFirmwareRelease.d.ts +1 -2
  194. package/dist/types/api/checkAllFirmwareRelease.d.ts.map +1 -1
  195. package/dist/types/api/deviceSettings.d.ts +11 -2
  196. package/dist/types/api/deviceSettings.d.ts.map +1 -1
  197. package/dist/types/api/deviceUnlock.d.ts +2 -2
  198. package/dist/types/api/deviceUnlock.d.ts.map +1 -1
  199. package/dist/types/api/firmwareUpdate.d.ts +6 -6
  200. package/dist/types/api/firmwareUpdate.d.ts.map +1 -1
  201. package/dist/types/api/getDeviceState.d.ts +12 -0
  202. package/dist/types/api/getDeviceState.d.ts.map +1 -0
  203. package/dist/types/api/getFeatures.d.ts.map +1 -1
  204. package/dist/types/api/getOnekeyFeatures.d.ts.map +1 -1
  205. package/dist/types/api/getPassphraseState.d.ts +2 -10
  206. package/dist/types/api/getPassphraseState.d.ts.map +1 -1
  207. package/dist/types/api/index.d.ts +22 -25
  208. package/dist/types/api/index.d.ts.map +1 -1
  209. package/dist/types/api/kaspaSignTransaction.d.ts +27 -2
  210. package/dist/types/api/kaspaSignTransaction.d.ts.map +1 -1
  211. package/dist/types/api/openWalletSession.d.ts +41 -0
  212. package/dist/types/api/openWalletSession.d.ts.map +1 -0
  213. package/dist/types/api/protocolV2.d.ts +23 -28
  214. package/dist/types/api/protocolV2.d.ts.map +1 -1
  215. package/dist/types/api/sessionCache.d.ts +10 -0
  216. package/dist/types/api/sessionCache.d.ts.map +1 -0
  217. package/dist/types/device.d.ts +121 -5
  218. package/dist/types/device.d.ts.map +1 -1
  219. package/dist/types/params.d.ts +1 -0
  220. package/dist/types/params.d.ts.map +1 -1
  221. package/dist/types/settings.d.ts +21 -1
  222. package/dist/types/settings.d.ts.map +1 -1
  223. package/dist/utils/assets.d.ts +2 -1
  224. package/dist/utils/assets.d.ts.map +1 -1
  225. package/dist/utils/deviceFeaturesCompat.d.ts +13 -0
  226. package/dist/utils/deviceFeaturesCompat.d.ts.map +1 -0
  227. package/dist/utils/deviceFeaturesUtils.d.ts +13 -3
  228. package/dist/utils/deviceFeaturesUtils.d.ts.map +1 -1
  229. package/dist/utils/deviceInfoUtils.d.ts +9 -8
  230. package/dist/utils/deviceInfoUtils.d.ts.map +1 -1
  231. package/dist/utils/deviceSettings.d.ts +38 -7
  232. package/dist/utils/deviceSettings.d.ts.map +1 -1
  233. package/dist/utils/deviceVersionUtils.d.ts +6 -5
  234. package/dist/utils/deviceVersionUtils.d.ts.map +1 -1
  235. package/dist/utils/homescreen.d.ts.map +1 -1
  236. package/dist/utils/index.d.ts +5 -2
  237. package/dist/utils/index.d.ts.map +1 -1
  238. package/dist/utils/networkUtils.d.ts +9 -1
  239. package/dist/utils/networkUtils.d.ts.map +1 -1
  240. package/dist/utils/patch.d.ts +1 -1
  241. package/dist/utils/patch.d.ts.map +1 -1
  242. package/dist/utils/pro2Wallpaper.d.ts +12 -0
  243. package/dist/utils/pro2Wallpaper.d.ts.map +1 -0
  244. package/dist/utils/tracing.d.ts.map +1 -1
  245. package/package.json +4 -4
  246. package/src/api/BaseMethod.ts +36 -9
  247. package/src/api/CheckBootloaderRelease.ts +1 -2
  248. package/src/api/CheckFirmwareRelease.ts +1 -2
  249. package/src/api/ClearSessionCache.ts +28 -0
  250. package/src/api/DirList.ts +5 -3
  251. package/src/api/DirMake.ts +3 -3
  252. package/src/api/DirRemove.ts +3 -3
  253. package/src/api/FileDelete.ts +3 -3
  254. package/src/api/FileRead.ts +23 -7
  255. package/src/api/FileWrite.ts +23 -168
  256. package/src/api/FirmwareUpdate.ts +4 -4
  257. package/src/api/FirmwareUpdateV2.ts +133 -45
  258. package/src/api/FirmwareUpdateV3.ts +3 -5
  259. package/src/api/FirmwareUpdateV4.ts +1138 -357
  260. package/src/api/GetDeviceState.ts +55 -0
  261. package/src/api/GetFeatures.ts +8 -3
  262. package/src/api/GetOnekeyFeatures.ts +3 -72
  263. package/src/api/GetPassphraseState.ts +11 -18
  264. package/src/api/OpenWalletSession.ts +221 -0
  265. package/src/api/PathInfo.ts +5 -3
  266. package/src/api/PromptWebDeviceAccess.ts +2 -3
  267. package/src/api/SearchDevices.ts +29 -4
  268. package/src/api/UploadPortfolio.ts +40 -0
  269. package/src/api/alephium/AlephiumSignTransaction.ts +2 -2
  270. package/src/api/allnetwork/AllNetworkGetAddressBase.ts +4 -8
  271. package/src/api/benfen/BenfenGetAddress.ts +1 -1
  272. package/src/api/btc/BTCGetPublicKey.ts +1 -1
  273. package/src/api/cardano/CardanoSignMessage.ts +1 -1
  274. package/src/api/cardano/CardanoSignTransaction.ts +1 -1
  275. package/src/api/device/DeviceCancel.ts +1 -0
  276. package/src/api/device/DeviceChangePin.ts +24 -0
  277. package/src/api/device/DeviceFullyUploadResource.ts +4 -5
  278. package/src/api/device/DeviceLock.ts +1 -0
  279. package/src/api/device/DeviceRebootToBoardloader.ts +5 -4
  280. package/src/api/device/DeviceRebootToBootloader.ts +5 -4
  281. package/src/api/device/DeviceSettings.ts +183 -1
  282. package/src/api/device/DeviceUnlock.ts +11 -1
  283. package/src/api/device/DeviceUpdateBootloader.ts +1 -2
  284. package/src/api/device/DeviceWipe.ts +19 -0
  285. package/src/api/evm/EVMSignTypedData.ts +3 -5
  286. package/src/api/evm/legacyV1/getAddress.ts +2 -2
  287. package/src/api/evm/legacyV1/getPublicKey.ts +2 -2
  288. package/src/api/evm/legacyV1/signMessage.ts +2 -2
  289. package/src/api/evm/legacyV1/signTypedData.ts +2 -2
  290. package/src/api/evm/legacyV1/signTypedHash.ts +2 -2
  291. package/src/api/evm/legacyV1/verifyMessage.ts +2 -2
  292. package/src/api/firmware/FirmwareUpdateBaseMethod.ts +21 -7
  293. package/src/api/firmware/getBinary.ts +8 -3
  294. package/src/api/firmware/progressThrottle.ts +44 -0
  295. package/src/api/helpers/batchGetPublickeys.ts +2 -2
  296. package/src/api/helpers/filesystemValidation.ts +61 -0
  297. package/src/api/helpers/paramsValidator.ts +1 -1
  298. package/src/api/helpers/protocolV2FileWrite.ts +193 -0
  299. package/src/api/index.ts +14 -20
  300. package/src/api/kaspa/KaspaSignTransaction.ts +341 -22
  301. package/src/api/kaspa/helpers/TransferSerialize.ts +14 -0
  302. package/src/api/nervos/NervosSignTransaction.ts +2 -2
  303. package/src/api/nexa/NexaSignTransaction.ts +1 -1
  304. package/src/api/protocol-v2/{FactoryGetDeviceInfo.ts → DeviceFactoryInfoGet.ts} +4 -4
  305. package/src/api/protocol-v2/DeviceFactoryInfoSet.ts +32 -0
  306. package/src/api/protocol-v2/DeviceFirmwareUpdate.ts +7 -9
  307. package/src/api/protocol-v2/DeviceGetFirmwareUpdateStatus.ts +41 -6
  308. package/src/api/protocol-v2/DeviceGetOnboardingStatus.ts +6 -4
  309. package/src/api/protocol-v2/DeviceInfoGet.ts +145 -0
  310. package/src/api/protocol-v2/DeviceReboot.ts +5 -3
  311. package/src/api/protocol-v2/DeviceStatusGet.ts +16 -0
  312. package/src/api/protocol-v2/DeviceUploadWallpaper.ts +131 -0
  313. package/src/api/protocol-v2/FilesystemFormat.ts +5 -2
  314. package/src/api/protocol-v2/{FilesystemFixPermission.ts → FilesystemPermissionFix.ts} +3 -3
  315. package/src/api/protocol-v2/Ping.ts +1 -1
  316. package/src/api/protocol-v2/{GetProtoVersion.ts → ProtocolInfoRequest.ts} +3 -3
  317. package/src/api/protocol-v2/helpers.ts +58 -62
  318. package/src/api/ton/TonSignData.ts +1 -5
  319. package/src/api/utils.ts +7 -3
  320. package/src/constants/index.ts +7 -1
  321. package/src/core/RequestQueue.ts +1 -0
  322. package/src/core/deviceEventRegistration.ts +23 -0
  323. package/src/core/index.ts +140 -35
  324. package/src/data/messages/messages-protocol-v2.json +825 -709
  325. package/src/data/messages/messages.json +286 -1
  326. package/src/data-manager/DataManager.ts +13 -6
  327. package/src/data-manager/connectSettings.ts +4 -0
  328. package/src/device/Device.ts +480 -192
  329. package/src/device/DeviceCommands.ts +81 -25
  330. package/src/device/DeviceFeaturesState.ts +25 -0
  331. package/src/device/DevicePool.ts +67 -19
  332. package/src/device/DeviceStateMapper.ts +349 -0
  333. package/src/device/DeviceStateProjector.ts +95 -0
  334. package/src/device/DeviceStateStore.ts +201 -0
  335. package/src/device/DeviceWalletSessionStore.ts +105 -0
  336. package/src/device/cloneDeviceState.ts +39 -0
  337. package/src/device/deviceIdentity.ts +18 -0
  338. package/src/deviceProfile/buildDeviceFeatures.ts +235 -210
  339. package/src/deviceProfile/index.ts +0 -1
  340. package/src/events/device.ts +17 -1
  341. package/src/events/logBlockEvent.ts +8 -1
  342. package/src/events/ui-request.ts +24 -2
  343. package/src/inject.ts +23 -34
  344. package/src/protocols/protocol-v2/deviceSession.ts +24 -0
  345. package/src/protocols/protocol-v2/features.ts +68 -82
  346. package/src/protocols/protocol-v2/firmware.ts +12 -36
  347. package/src/protocols/protocol-v2/index.ts +3 -1
  348. package/src/protocols/protocol-v2/lockedError.ts +10 -0
  349. package/src/protocols/protocol-v2/settingsUnlockPolicy.ts +61 -0
  350. package/src/protocols/protocol-v2/uiInteraction.ts +210 -0
  351. package/src/protocols/protocol-v2/unlockRetry.ts +76 -0
  352. package/src/protocols/protocol-v2/walletSession.ts +107 -0
  353. package/src/types/api/checkAllFirmwareRelease.ts +1 -2
  354. package/src/types/api/deviceSettings.ts +26 -2
  355. package/src/types/api/deviceUnlock.ts +5 -2
  356. package/src/types/api/firmwareUpdate.ts +28 -20
  357. package/src/types/api/getDeviceState.ts +19 -0
  358. package/src/types/api/getFeatures.ts +3 -0
  359. package/src/types/api/getOnekeyFeatures.ts +3 -0
  360. package/src/types/api/getPassphraseState.ts +8 -11
  361. package/src/types/api/index.ts +30 -53
  362. package/src/types/api/kaspaSignTransaction.ts +40 -2
  363. package/src/types/api/openWalletSession.ts +64 -0
  364. package/src/types/api/protocolV2.ts +58 -55
  365. package/src/types/api/sessionCache.ts +14 -0
  366. package/src/types/device.ts +170 -4
  367. package/src/types/params.ts +4 -0
  368. package/src/types/settings.ts +42 -30
  369. package/src/utils/assets.ts +4 -1
  370. package/src/utils/deviceFeaturesCompat.ts +173 -0
  371. package/src/utils/deviceFeaturesUtils.ts +68 -24
  372. package/src/utils/deviceInfoUtils.ts +26 -64
  373. package/src/utils/deviceSettings.ts +161 -39
  374. package/src/utils/deviceVersionUtils.ts +25 -44
  375. package/src/utils/findDefectiveBatchDevice.ts +3 -3
  376. package/src/utils/homescreen.ts +10 -0
  377. package/src/utils/index.ts +21 -1
  378. package/src/utils/networkUtils.ts +270 -14
  379. package/src/utils/pro2Wallpaper.ts +109 -0
  380. package/src/utils/tracing.ts +3 -1
  381. package/dist/api/GetDeviceInfo.d.ts +0 -9
  382. package/dist/api/GetDeviceInfo.d.ts.map +0 -1
  383. package/dist/api/protocol-v2/DevReboot.d.ts +0 -7
  384. package/dist/api/protocol-v2/DevReboot.d.ts.map +0 -1
  385. package/dist/api/protocol-v2/DeviceGetDeviceInfo.d.ts +0 -29
  386. package/dist/api/protocol-v2/DeviceGetDeviceInfo.d.ts.map +0 -1
  387. package/dist/api/protocol-v2/FactoryDeviceInfoSettings.d.ts +0 -7
  388. package/dist/api/protocol-v2/FactoryDeviceInfoSettings.d.ts.map +0 -1
  389. package/dist/api/protocol-v2/FactoryGetDeviceInfo.d.ts +0 -6
  390. package/dist/api/protocol-v2/FactoryGetDeviceInfo.d.ts.map +0 -1
  391. package/dist/api/protocol-v2/FilesystemDiskControl.d.ts +0 -13
  392. package/dist/api/protocol-v2/FilesystemDiskControl.d.ts.map +0 -1
  393. package/dist/api/protocol-v2/FilesystemFixPermission.d.ts.map +0 -1
  394. package/dist/api/protocol-v2/GetProtoVersion.d.ts +0 -6
  395. package/dist/api/protocol-v2/GetProtoVersion.d.ts.map +0 -1
  396. package/dist/deviceProfile/buildDeviceProfile.d.ts +0 -21
  397. package/dist/deviceProfile/buildDeviceProfile.d.ts.map +0 -1
  398. package/dist/types/api/getDeviceInfo.d.ts +0 -85
  399. package/dist/types/api/getDeviceInfo.d.ts.map +0 -1
  400. package/src/api/GetDeviceInfo.ts +0 -145
  401. package/src/api/protocol-v2/DevReboot.ts +0 -24
  402. package/src/api/protocol-v2/DeviceGetDeviceInfo.ts +0 -118
  403. package/src/api/protocol-v2/FactoryDeviceInfoSettings.ts +0 -29
  404. package/src/api/protocol-v2/FilesystemDiskControl.ts +0 -50
  405. package/src/deviceProfile/buildDeviceProfile.ts +0 -334
  406. package/src/types/api/getDeviceInfo.ts +0 -99
package/dist/index.d.ts CHANGED
@@ -1,23 +1,64 @@
1
1
  import EventEmitter, { EventEmitter as EventEmitter$1 } from 'events';
2
- import { DevFirmwareTargetType, DevRebootType, DeviceRebootType, DevFirmwareTarget, Messages, Transport, TransportCallOptions, OneKeyDeviceInfo, ProtocolV2DeviceInfo, Success as Success$1, LowlevelTransportSharedPlugin, ProtoVersion, OnboardingStatus, DevFirmwareUpdateStatus, DeviceFirmwareUpdateStatus, FactoryDeviceInfo, OneKeyDeviceCommType, Features as Features$1, ProtocolType, RecoveryDeviceType, SafetyCheckLevel, ResourceType, NextU2FCounter, SetU2FCounter, CipheredKeyValue as CipheredKeyValue$1, UintType, EthereumPublicKey, EthereumMessageSignature, Address, MultisigRedeemScriptType, InputScriptType, PublicKey, MessageSignature, SignedPsbt, PrevInput, TxOutputBinType, TxInput, TxOutputType, TxInputType, StarcoinAddress as StarcoinAddress$1, StarcoinPublicKey as StarcoinPublicKey$1, StarcoinMessageSignature, StarcoinSignedTx, NEMAddress as NEMAddress$1, NEMSignedTx, SolanaAddress as SolanaAddress$1, SolanaSignedTx as SolanaSignedTx$1, SolanaTxExtraInfo, SolanaOffChainMessageVersion, SolanaOffChainMessageFormat, StellarAddress as StellarAddress$1, StellarSignedTx, TronAddress as TronAddress$1, TronResourceCode, TronSignedTx, TronMessageSignature, ConfluxAddress as ConfluxAddress$1, ConfluxMessageSignature, NearAddress as NearAddress$1, NearSignedTx, AptosAddress as AptosAddress$1, AptosMessageSignature as AptosMessageSignature$1, AptosSignedTx as AptosSignedTx$1, AlgorandAddress, AlgorandSignedTx, CosmosAddress as CosmosAddress$1, CosmosSignedTx as CosmosSignedTx$1, SuiAddress as SuiAddress$1, SuiMessageSignature, CardanoAddressParametersType, CardanoMessageSignature, FilecoinAddress as FilecoinAddress$1, FilecoinSignedTx as FilecoinSignedTx$1, PolkadotAddress as PolkadotAddress$1, PolkadotSignedTx as PolkadotSignedTx$1, KaspaAddress as KaspaAddress$1, NervosAddress as NervosAddress$1, NervosSignedTx as NervosSignedTx$1, DnxAddress as DnxAddress$1, TonWalletVersion, TonWorkChain, TonSignedMessage, TonSignedProof, TonSignDataType, TonSignedData, ScdoAddress as ScdoAddress$1, ScdoSignedMessage, ScdoSignedTx as ScdoSignedTx$1, AlephiumMessageSignature, AlephiumSignedTx as AlephiumSignedTx$1, BenfenAddress as BenfenAddress$1, BenfenMessageSignature, ChangeOutputScriptType } from '@onekeyfe/hd-transport';
3
- export { Messages as PROTO, TonSignDataType } from '@onekeyfe/hd-transport';
2
+ import * as _onekeyfe_hd_transport from '@onekeyfe/hd-transport';
3
+ import { DeviceFirmwareTargetType, DeviceFirmwareUpdateRecordFields, DeviceRebootType, DeviceFirmwareTarget, Messages, Transport, TransportCallOptions, OneKeyDeviceCommType, ProtocolV2DeviceInfo, DeviceStatus as DeviceStatus$1, Enum_SafetyCheckLevel, OneKeyDeviceInfo, Success as Success$1, LowlevelTransportSharedPlugin, ProtocolInfo, DevOnboardingStatus, DeviceFirmwareUpdateStatus, DeviceFactoryInfo, 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';
4
+ export { Success as DeviceSuccess, HDNodeType, Messages as PROTO, ResourceType, TonSignDataType, TonWalletVersion } from '@onekeyfe/hd-transport';
4
5
  import * as _onekeyfe_hd_shared from '@onekeyfe/hd-shared';
5
- import { HardwareConnectProtocol, Deferred, EFirmwareType, EDeviceType } from '@onekeyfe/hd-shared';
6
+ import { HardwareConnectProtocol, EFirmwareType, EDeviceType, Deferred } from '@onekeyfe/hd-shared';
6
7
 
7
8
  interface CommonParams {
8
9
  keepSession?: boolean;
10
+ /**
11
+ * polling connect max retry count
12
+ */
9
13
  retryCount?: number;
14
+ /**
15
+ * polling interval time
16
+ */
10
17
  pollIntervalTime?: number;
18
+ /**
19
+ * Timeout time for single polling
20
+ */
11
21
  timeout?: number;
22
+ /**
23
+ * DeviceInfoGet timeout during Protocol V2 initialization.
24
+ */
25
+ protocolV2DeviceInfoTimeoutMs?: number;
26
+ /**
27
+ * passphrase state
28
+ */
12
29
  passphraseState?: string;
30
+ /**
31
+ * Use empty passphrase
32
+ */
13
33
  useEmptyPassphrase?: boolean;
34
+ /**
35
+ * Every init session
36
+ */
14
37
  initSession?: boolean;
38
+ /**
39
+ * Use derive cardano
40
+ */
15
41
  deriveCardano?: boolean;
16
42
  detectBootloaderDevice?: boolean;
43
+ /**
44
+ * Skip web device prompt
45
+ */
17
46
  skipWebDevicePrompt?: boolean;
47
+ /**
48
+ * Skip passphrase check
49
+ */
18
50
  skipPassphraseCheck?: boolean;
51
+ /**
52
+ * Only connect device, not initialize device, only ble connect
53
+ */
19
54
  onlyConnectBleDevice?: boolean;
55
+ /**
56
+ * Use pre-initialized device state (BLE only)
57
+ */
20
58
  usePreInitialize?: boolean;
59
+ /**
60
+ * Expected transport protocol. If omitted, SDK probes Protocol V1 then Protocol V2.
61
+ */
21
62
  connectProtocol?: HardwareConnectProtocol;
22
63
  }
23
64
  type Params<T> = CommonParams & T & {
@@ -38,29 +79,38 @@ type Response<T> = Promise<Success<T> | Unsuccessful>;
38
79
 
39
80
  declare const safeThrowError: (error: any) => never;
40
81
 
41
- type RebootTypeInput = DevRebootType | DeviceRebootType | keyof typeof DevRebootType | keyof typeof DeviceRebootType | string | number;
82
+ type RebootTypeInput = DeviceRebootType | keyof typeof DeviceRebootType | string | number;
42
83
  type DeviceRebootParams = {
43
84
  rebootType?: RebootTypeInput;
44
85
  reboot_type?: RebootTypeInput;
45
86
  };
46
- type DeviceFirmwareTargetInput = DevFirmwareTarget | {
47
- targetId?: DevFirmwareTargetType | string | number;
48
- target_id?: DevFirmwareTargetType | string | number;
87
+ type DeviceFirmwareTargetInput = DeviceFirmwareTarget | {
88
+ targetId?: DeviceFirmwareTargetType | string | number;
89
+ target_id?: DeviceFirmwareTargetType | string | number;
49
90
  path: string;
50
91
  };
51
92
  type DeviceFirmwareUpdateParams = {
52
93
  targets?: DeviceFirmwareTargetInput[];
53
- targetId?: DevFirmwareTargetType | string | number;
54
- target_id?: DevFirmwareTargetType | string | number;
94
+ targetId?: DeviceFirmwareTargetType | string | number;
95
+ target_id?: DeviceFirmwareTargetType | string | number;
55
96
  path?: string;
56
97
  };
57
- type FactoryDeviceInfoSettingsParams = {
58
- serial_no?: string;
59
- serialNo?: string;
60
- cpu_info?: string;
61
- cpuInfo?: string;
62
- pre_firmware?: string;
63
- preFirmware?: string;
98
+ type DeviceFirmwareUpdateStatusGetParams = {
99
+ fields?: DeviceFirmwareUpdateRecordFields;
100
+ };
101
+ type DeviceFactoryInfoSetParams = {
102
+ version?: number;
103
+ serial_number?: string;
104
+ burn_in_completed?: boolean;
105
+ factory_test_completed?: boolean;
106
+ manufacture_time?: {
107
+ year: number;
108
+ month: number;
109
+ day: number;
110
+ hour: number;
111
+ minute: number;
112
+ second: number;
113
+ };
64
114
  };
65
115
 
66
116
  type PassphrasePromptResponse = {
@@ -79,15 +129,19 @@ type TypedCallResponseMap = {
79
129
  [K in MessageKey]: TypedResponseMessage<K>;
80
130
  };
81
131
  type DefaultMessageResponse = TypedCallResponseMap[MessageKey];
132
+ /**
133
+ * The life cycle begins with the acquisition of the device and ends with the disposal device commands
134
+ * acquire device -> create DeviceCommands -> release device -> dispose DeviceCommands
135
+ */
82
136
  declare class DeviceCommands {
83
137
  instanceId: string;
84
138
  currentResponseID?: number;
85
- device: Device$1;
139
+ device: Device;
86
140
  transport: Transport;
87
141
  mainId: string;
88
142
  disposed: boolean;
89
143
  callPromise?: Promise<DefaultMessageResponse>;
90
- constructor(device: Device$1, mainId: string);
144
+ constructor(device: Device, mainId: string);
91
145
  dispose(_cancelRequest: boolean): Promise<void>;
92
146
  checkDisposed(): void;
93
147
  cancelDeviceOnOneKeyDevice(): Promise<{
@@ -104,7 +158,7 @@ declare class DeviceCommands {
104
158
  };
105
159
  } | {
106
160
  success: boolean;
107
- error: 0 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 200 | 300 | 301 | 302 | 303 | 304 | 305 | 400 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 500 | 600 | 601 | 602 | 603 | 700 | 701 | 702 | 703 | 704 | 705 | 706 | 707 | 708 | 709 | 710 | 711 | 712 | 713 | 714 | 715 | 716 | 717 | 718 | 719 | 720 | 721 | 722 | 800 | 801 | 802 | 803 | 804 | 805 | 806 | 807 | 808 | 809 | 810 | 811 | 812 | 813 | 814 | 815 | 816 | 817 | 818 | 819 | 820 | 821 | 822 | 823 | 824 | 825 | 826 | 827 | 828 | 900 | 901 | 902;
161
+ error: 0 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 200 | 300 | 301 | 302 | 303 | 304 | 305 | 400 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 500 | 600 | 601 | 602 | 603 | 700 | 701 | 702 | 703 | 704 | 705 | 706 | 707 | 708 | 709 | 710 | 711 | 712 | 713 | 714 | 715 | 716 | 717 | 718 | 719 | 720 | 721 | 722 | 800 | 801 | 802 | 803 | 804 | 805 | 806 | 807 | 808 | 809 | 810 | 811 | 812 | 813 | 814 | 815 | 816 | 817 | 818 | 819 | 820 | 821 | 822 | 823 | 824 | 825 | 826 | 827 | 828 | 829 | 830 | 831 | 900 | 901 | 902;
108
162
  payload: {
109
163
  message: string;
110
164
  };
@@ -123,7 +177,7 @@ declare class DeviceCommands {
123
177
  };
124
178
  } | {
125
179
  success: boolean;
126
- error: 0 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 200 | 300 | 301 | 302 | 303 | 304 | 305 | 400 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 500 | 600 | 601 | 602 | 603 | 700 | 701 | 702 | 703 | 704 | 705 | 706 | 707 | 708 | 709 | 710 | 711 | 712 | 713 | 714 | 715 | 716 | 717 | 718 | 719 | 720 | 721 | 722 | 800 | 801 | 802 | 803 | 804 | 805 | 806 | 807 | 808 | 809 | 810 | 811 | 812 | 813 | 814 | 815 | 816 | 817 | 818 | 819 | 820 | 821 | 822 | 823 | 824 | 825 | 826 | 827 | 828 | 900 | 901 | 902;
180
+ error: 0 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 200 | 300 | 301 | 302 | 303 | 304 | 305 | 400 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 500 | 600 | 601 | 602 | 603 | 700 | 701 | 702 | 703 | 704 | 705 | 706 | 707 | 708 | 709 | 710 | 711 | 712 | 713 | 714 | 715 | 716 | 717 | 718 | 719 | 720 | 721 | 722 | 800 | 801 | 802 | 803 | 804 | 805 | 806 | 807 | 808 | 809 | 810 | 811 | 812 | 813 | 814 | 815 | 816 | 817 | 818 | 819 | 820 | 821 | 822 | 823 | 824 | 825 | 826 | 827 | 828 | 829 | 830 | 831 | 900 | 901 | 902;
127
181
  payload: {
128
182
  message: string;
129
183
  };
@@ -135,364 +189,135 @@ declare class DeviceCommands {
135
189
  _commonCall(type: MessageKey, msg?: DefaultMessageResponse['message'], options?: TransportCallOptions): Promise<DefaultMessageResponse>;
136
190
  _filterCommonTypes(res: DefaultMessageResponse, callType: MessageKey, options?: TransportCallOptions): Promise<DefaultMessageResponse>;
137
191
  _promptPin(type?: Messages.PinMatrixRequestType): Promise<string>;
138
- _promptPassphrase(options: PassphraseRequestPayload): Promise<PassphrasePromptResponse>;
192
+ promptPassphrase(options: PassphraseRequestPayload, promptOptions?: {
193
+ cancelDeviceOnReject?: boolean;
194
+ }): Promise<PassphrasePromptResponse>;
139
195
  }
140
196
 
141
- type DeviceDescriptorDiff = {
142
- didUpdate: boolean;
143
- connected: OneKeyDeviceInfo[];
144
- disconnected: OneKeyDeviceInfo[];
145
- changedSessions: OneKeyDeviceInfo[];
146
- changedDebugSessions: OneKeyDeviceInfo[];
147
- acquired: OneKeyDeviceInfo[];
148
- debugAcquired: OneKeyDeviceInfo[];
149
- released: OneKeyDeviceInfo[];
150
- debugReleased: OneKeyDeviceInfo[];
151
- descriptors: OneKeyDeviceInfo[];
152
- };
153
-
154
- declare class DeviceConnector {
155
- transport: Transport;
156
- listenTimestamp: number;
157
- current: OneKeyDeviceInfo[] | null;
158
- upcoming: OneKeyDeviceInfo[];
159
- listening: boolean;
160
- constructor();
161
- enumerate(): Promise<DeviceDescriptorDiff | undefined>;
162
- listen(): Promise<void>;
163
- stop(): void;
164
- acquire(path: string, session?: string | null, forceCleanRunPromise?: boolean, connectProtocol?: HardwareConnectProtocol): Promise<string | undefined>;
165
- release(session: string, onclose: boolean): Promise<void>;
166
- disconnect(session: string | undefined | null): Promise<void>;
167
- promptDeviceAccess(): Promise<USBDevice | BluetoothDevice | null>;
168
- _reportDevicesChange(): void;
169
- }
197
+ type ProtocolV2RuntimeMode = 'normal' | 'bootloader';
170
198
 
171
- type InitOptions = {
172
- initSession?: boolean;
173
- deviceId?: string;
174
- passphraseState?: string;
175
- deriveCardano?: boolean;
176
- connectProtocol?: HardwareConnectProtocol;
177
- };
178
- type RunOptions = {
179
- keepSession?: boolean;
180
- skipInitialize?: boolean;
181
- } & InitOptions;
182
- interface DeviceEvents {
183
- [DEVICE.PIN]: [Device$1, Messages.PinMatrixRequestType | undefined, (err: any, pin: string) => void];
184
- [DEVICE.PASSPHRASE_ON_DEVICE]: [Device$1, ((response: any) => void)?];
185
- [DEVICE.BUTTON]: [Device$1, DeviceButtonRequestPayload];
186
- [DEVICE.FEATURES]: [Device$1, DeviceFeaturesPayload];
187
- [DEVICE.PASSPHRASE]: [
188
- Device$1,
189
- PassphraseRequestPayload,
190
- (response: PassphrasePromptResponse, error?: Error) => void
191
- ];
192
- [DEVICE.SELECT_DEVICE_IN_BOOTLOADER_FOR_WEB_DEVICE]: [
193
- Device$1,
194
- (err: any, deviceId: string) => void
195
- ];
196
- [DEVICE.SELECT_DEVICE_FOR_SWITCH_FIRMWARE_WEB_DEVICE]: [
197
- Device$1,
198
- (err: any, deviceId: string) => void
199
- ];
200
- }
201
- declare function preloadSessionCache(deviceId: string, passphraseState: string, sessionId: string): void;
202
- interface Device$1 {
203
- on<K extends keyof DeviceEvents>(type: K, listener: (...event: DeviceEvents[K]) => void): this;
204
- off<K extends keyof DeviceEvents>(type: K, listener: (...event: DeviceEvents[K]) => void): this;
205
- emit<K extends keyof DeviceEvents>(type: K, ...args: DeviceEvents[K]): boolean;
206
- }
207
- declare class Device$1 extends EventEmitter {
208
- originalDescriptor: OneKeyDeviceInfo;
209
- sdkInstanceId?: string;
210
- instanceId: string;
211
- createdAt: number;
212
- mainId?: string | null;
213
- deviceConnector?: DeviceConnector | null;
214
- commands: DeviceCommands;
215
- private cancelableAction?;
216
- private deviceAcquired;
217
- features: Features | undefined;
218
- featuresNeedsReload: boolean;
219
- runPromise?: Deferred<void> | null;
220
- externalState: string[];
221
- unavailableCapabilities: UnavailableCapabilities;
222
- instance: number;
223
- internalState: string[];
224
- needReloadDevice: boolean;
225
- keepSession: boolean;
226
- passphraseState: string | undefined;
227
- pendingCallbackPromise?: Deferred<void>;
228
- private preInitializedAt?;
229
- private preInitializeMeta?;
230
- private lastInitializeDurationMs?;
231
- constructor(descriptor: OneKeyDeviceInfo, sdkInstanceId?: string);
232
- static fromDescriptor(originalDescriptor: OneKeyDeviceInfo, sdkInstanceId?: string): Device$1;
233
- toMessageObject(): Device | null;
234
- connect(connectProtocol?: HardwareConnectProtocol): Promise<boolean>;
235
- acquire(connectProtocol?: HardwareConnectProtocol): Promise<void>;
236
- release(): Promise<void>;
237
- preInitialize(initOptions?: InitOptions): Promise<void>;
238
- markPreInitialized(meta?: {
239
- passphraseState?: string;
240
- }): void;
241
- clearPreInitialized(): void;
242
- isPreInitializeMetaMatch(payload?: {
243
- passphraseState?: string;
244
- }): boolean;
245
- isPreInitializedValid(ttlMs: number): boolean;
246
- setLastInitializeDuration(durationMs: number): void;
247
- getLastInitializeDuration(): number | undefined;
248
- getCommands(): DeviceCommands;
249
- getProtocol(): 'V1' | 'V2';
250
- isProtocolV2(): boolean;
251
- getCurrentDeviceType(): IDeviceType;
252
- getCurrentDeviceId(): string | undefined;
253
- getCurrentSerialNo(): string;
254
- getCurrentBleName(): string | null;
255
- getCurrentLabel(): string | null;
256
- getCurrentPassphraseProtection(): boolean | null | undefined;
257
- getCurrentFirmwareType(): _onekeyfe_hd_shared.EFirmwareType;
258
- getCurrentFirmwareVersionString(): string;
259
- getCurrentBLEFirmwareVersionString(): string | undefined;
260
- getCurrentSafetyChecks(): string | null | undefined;
261
- getCurrentMethodVersionRange(getVersionRange: (deviceModel: IDeviceType | IDeviceModel) => IVersionRange | undefined): IVersionRange | undefined;
262
- supportNewPassphrase(): SupportFeatureType;
263
- supportInputPinOnSoftware(): SupportFeatureType;
264
- supportModifyHomescreen(): SupportFeatureType;
265
- private generateStateKey;
266
- private getSessionCacheDeviceKey;
267
- getInternalState(_deviceId?: string): string | undefined;
268
- updateInternalState(enablePassphrase: boolean, passphraseState: string | undefined, deviceId: string | undefined, sessionId?: string | null, featuresSessionId?: string | null): void;
269
- private setInternalState;
270
- clearInternalState(_deviceId?: string): void;
271
- initialize(options?: InitOptions): Promise<void>;
272
- private _initializeProtocolV2;
273
- private _refreshProtocolV2Status;
274
- getFeatures(): Promise<Features | undefined>;
275
- _updateFeatures(protoFeatures: Messages.Features | Features, initSession?: boolean): void;
276
- updateProtocolV2Features(deviceInfo?: ProtocolV2DeviceInfo): Features;
277
- updateDescriptor(descriptor: OneKeyDeviceInfo, forceUpdate?: boolean): void;
278
- updateFromCache(device: Device$1): void;
279
- run(fn?: () => Promise<void>, options?: RunOptions): Promise<void>;
280
- _runInner<T>(fn: (() => Promise<T>) | undefined, options: RunOptions): Promise<undefined>;
281
- interruptionFromOutside(): Promise<void>;
282
- interruptionFromUser(): Promise<void>;
283
- setCancelableAction(callback: (err?: Error) => Promise<unknown>): void;
284
- clearCancelableAction(): void;
285
- getMode(): EOneKeyDeviceMode;
286
- getFirmwareVersion(): IVersionArray | null;
287
- getBLEFirmwareVersion(): IVersionArray | null;
288
- isUsed(): boolean;
289
- hasDeviceAcquire(): boolean;
290
- isUsedHere(): boolean;
291
- isUsedElsewhere(): boolean;
292
- isBootloader(): boolean | undefined;
293
- isInitialized(): boolean | undefined;
294
- isSeedless(): boolean | undefined;
295
- isUnacquired(): boolean;
296
- hasUnexpectedMode(allow: string[], require: string[]): "ui-device_bootloader_mode" | "ui-device_not_in_bootloader_mode" | "ui-device_not_initialized" | "ui-device_seedless" | null;
297
- hasUsePassphrase(): boolean;
298
- checkDeviceId(deviceId: string): boolean;
299
- lockDevice(): Promise<Success$1>;
300
- supportUnlockVersionRange(): DeviceFirmwareRange;
301
- unlockDevice(): Promise<Features | undefined>;
302
- checkPassphraseStateSafety(passphraseState?: string, useEmptyPassphrase?: boolean, skipPassphraseCheck?: boolean): Promise<boolean>;
303
- }
304
-
305
- declare function generateSdkInstanceId(): string;
306
- declare function generateInstanceId(type: string, sdkInstanceId?: string): string;
307
- interface RequestContext {
308
- responseID: number;
309
- sdkInstanceId?: string;
310
- methodName: string;
311
- connectId?: string;
312
- deviceInstanceId?: string;
313
- commandsInstanceId?: string;
314
- parentResponseID?: number;
315
- startTime: number;
316
- endTime?: number;
317
- status?: 'pending' | 'running' | 'success' | 'error' | 'cancelled';
318
- error?: string;
319
- }
320
- interface SdkTracingContext {
321
- sdkInstanceId: string;
322
- createdAt: number;
323
- activeRequests: Map<number, RequestContext>;
324
- }
325
- declare function createSdkTracingContext(): SdkTracingContext;
326
- declare function createRequestContext(responseID: number, methodName: string, options?: {
327
- sdkInstanceId?: string;
328
- connectId?: string;
329
- deviceInstanceId?: string;
330
- commandsInstanceId?: string;
331
- parentResponseID?: number;
332
- }): RequestContext;
333
- declare function updateRequestContext(responseID: number, updates: Partial<RequestContext>): void;
334
- declare function completeRequestContext(responseID: number, error?: Error): void;
335
- declare function getActiveRequestsByDeviceInstance(deviceInstanceId: string): RequestContext[];
336
- declare function formatRequestContext(context: RequestContext): string;
337
- declare function cleanupSdkInstance(sdkInstanceId: string): void;
338
-
339
- declare class Core extends EventEmitter {
340
- private tracingContext;
341
- readonly sdkInstanceId: string;
342
- private requestQueue;
343
- private prePendingCallPromise;
344
- private methodSynchronize;
345
- constructor();
346
- private getCoreContext;
347
- handleMessage(message: CoreMessage): Promise<any>;
348
- dispose(): void;
349
- }
350
- declare const init$1: (settings: ConnectSettings, Transport: any, plugin?: LowlevelTransportSharedPlugin) => Promise<Core | undefined>;
351
- declare const switchTransport: ({ env, Transport, plugin, }: {
352
- env: ConnectSettings['env'];
353
- Transport: any;
354
- plugin?: LowlevelTransportSharedPlugin | undefined;
355
- }) => void;
356
-
357
- type DeviceGetDeviceInfoTargets = {
358
- hw?: boolean;
359
- fw?: boolean;
360
- bt?: boolean;
361
- se1?: boolean;
362
- se2?: boolean;
363
- se3?: boolean;
364
- se4?: boolean;
365
- status?: boolean;
366
- };
367
- type DeviceGetDeviceInfoTypes = {
368
- version?: boolean;
369
- build_id?: boolean;
370
- hash?: boolean;
371
- specific?: boolean;
372
- };
373
- type DeviceGetDeviceInfoParams = {
374
- targets?: DeviceGetDeviceInfoTargets;
375
- types?: DeviceGetDeviceInfoTypes;
199
+ type transportEnv = 'node' | 'web' | 'webextension' | 'electron' | 'react-native' | 'webusb' | 'desktop-webusb' | 'desktop-web-ble' | 'emulator' | 'lowlevel' | 'node-usb';
200
+ type ConnectSettings = {
201
+ connectSrc?: string;
202
+ debug?: boolean;
203
+ transportReconnect?: boolean;
204
+ lazyLoad?: boolean;
205
+ origin?: string;
206
+ parentOrigin?: string;
207
+ configSrc: string;
208
+ iframeSrc: string;
209
+ version: string;
210
+ priority: number;
211
+ trustedHost: boolean;
212
+ supportedBrowser?: boolean;
213
+ env: transportEnv;
214
+ timestamp: number;
215
+ isFrame?: boolean;
216
+ preRelease?: boolean;
217
+ fetchConfig?: boolean;
218
+ extension?: string;
219
+ configFetcher?: (url: string) => Promise<RemoteConfigResponse | null>;
376
220
  };
377
-
378
- type FileOpSuccess = {
379
- message?: string;
221
+ type IVersionArray = [number, number, number];
222
+ type ILocale = 'zh-CN' | 'en-US';
223
+ type IProtocolV2FirmwareComponentTarget = 'ROMLOADER' | 'BOOTLOADER' | 'APPLICATION_P1' | 'APPLICATION_P2' | 'COPROCESSOR' | 'SE01' | 'SE02' | 'SE03' | 'SE04';
224
+ type IProtocolV2FirmwareComponent = {
225
+ target: IProtocolV2FirmwareComponentTarget;
226
+ url: string;
227
+ fingerprint?: string;
228
+ version?: IVersionArray;
380
229
  };
381
- type FileInfo = {
382
- path: string;
383
- offset: number;
384
- total_size: number;
385
- data?: Uint8Array;
386
- data_hash?: number;
387
- processed_byte?: number;
388
- chunks?: number;
230
+ /** Pro2 RESC bundle okpkg descriptor for incremental FileWrite synchronization. */
231
+ type IProtocolV2ResourceBundle = {
232
+ /** Bundle name, such as images, animation, translations, or fonts_roobert. */
233
+ name: string;
234
+ /** Download URL. */
235
+ url: string;
236
+ /** Device target path, such as vol0:/bundles/images/images.okpkg. */
237
+ devicePath: string;
238
+ /** okpkg payload_version used to skip matching content after FileRead. */
239
+ version?: IVersionArray;
240
+ /** okpkg payload_hash used for SHA3-512 comparison after FileRead. */
241
+ payloadHash?: string;
242
+ /** okpkg header_hash used for SHA3-512 comparison after FileRead. */
243
+ headerHash?: string;
244
+ };
245
+ /** STM32 firmware config */
246
+ type IFirmwareReleaseInfo = {
247
+ required: boolean;
248
+ url: string;
249
+ /**
250
+ * Firmware type (bitcoinonly or universal)
251
+ * This field is not present in the remote config, but will be inferred from the firmware field name
252
+ */
253
+ firmwareType?: EFirmwareType;
254
+ /** Firmware UI resource */
255
+ resource?: string;
256
+ /** Firmware full UI resource */
257
+ fullResource?: string;
258
+ fullResourceRange?: string[];
259
+ bootloaderResource?: string;
260
+ bootloaderVersion?: IVersionArray;
261
+ displayBootloaderVersion?: IVersionArray;
262
+ bootloaderRelatedFirmwareVersion?: IVersionArray;
263
+ upgradeType?: 'payload-package-set' | string;
264
+ components?: Record<string, IProtocolV2FirmwareComponent>;
265
+ installOrder?: string[];
266
+ /** Pro2 RESC bundles for incremental direct FileWrite synchronization. */
267
+ resourceBundles?: IProtocolV2ResourceBundle[];
268
+ bootloaderChangelog?: {
269
+ [k in ILocale]: string;
270
+ };
271
+ fingerprint: string;
272
+ version: IVersionArray;
273
+ changelog: {
274
+ [k in ILocale]: string;
275
+ };
389
276
  };
390
- type DirInfo = {
391
- path: string;
392
- child_dirs?: string;
393
- child_files?: string;
277
+ /** BLE firmware config */
278
+ type IBLEFirmwareReleaseInfo = {
279
+ required: boolean;
280
+ /** bluetooth dfu version */
281
+ url: string;
282
+ /** stm bluetooth update version */
283
+ webUpdate: string;
284
+ fingerprint: string;
285
+ fingerprintWeb: string;
286
+ version: IVersionArray;
287
+ changelog: {
288
+ [k in ILocale]: string;
289
+ };
394
290
  };
395
- type PathInfoResult = {
396
- exist: boolean;
397
- size: number;
398
- year: number;
399
- month: number;
400
- day: number;
401
- hour: number;
402
- minute: number;
403
- second: number;
404
- readonly: boolean;
405
- hidden: boolean;
406
- system: boolean;
407
- archive: boolean;
408
- directory: boolean;
291
+ type IKnownDevice = Exclude<IDeviceType, 'unknown'>;
292
+ type DeviceTypeMap = {
293
+ [k in IKnownDevice]: {
294
+ firmware: IFirmwareReleaseInfo[];
295
+ /** Pro2 Protocol V2 payload package set */
296
+ 'firmware-v1'?: IFirmwareReleaseInfo[];
297
+ 'firmware-v2'?: IFirmwareReleaseInfo[];
298
+ 'firmware-v8'?: IFirmwareReleaseInfo[];
299
+ 'firmware-btc-v8'?: IFirmwareReleaseInfo[];
300
+ ble: IBLEFirmwareReleaseInfo[];
301
+ };
409
302
  };
410
- declare function getProtoVersion(connectId: string, params?: CommonParams): Response<ProtoVersion>;
411
- declare function ping(connectId: string, params?: CommonParams & {
412
- message?: string;
413
- }): Response<Success$1>;
414
- declare function deviceReboot(connectId: string, params: CommonParams & DeviceRebootParams): Response<Success$1>;
415
- declare function deviceGetDeviceInfo(connectId: string, params?: CommonParams & DeviceGetDeviceInfoParams): Response<ProtocolV2DeviceInfo>;
416
- declare function deviceGetOnboardingStatus(connectId: string, params?: CommonParams): Response<OnboardingStatus>;
417
- declare function deviceFirmwareUpdate(connectId: string, params: CommonParams & DeviceFirmwareUpdateParams): Response<Success$1 | DevFirmwareUpdateStatus | DeviceFirmwareUpdateStatus>;
418
- declare function deviceGetFirmwareUpdateStatus(connectId: string, params?: CommonParams): Response<DevFirmwareUpdateStatus | DeviceFirmwareUpdateStatus>;
419
- declare function devReboot(connectId: string, params: CommonParams & DeviceRebootParams): Response<Success$1>;
420
- declare function devGetDeviceInfo(connectId: string, params?: CommonParams & DeviceGetDeviceInfoParams): Response<ProtocolV2DeviceInfo>;
421
- declare function devFirmwareUpdate(connectId: string, params: CommonParams & DeviceFirmwareUpdateParams): Response<Success$1 | DevFirmwareUpdateStatus>;
422
- declare function devGetFirmwareUpdateStatus(connectId: string, params?: CommonParams): Response<DevFirmwareUpdateStatus>;
423
- declare function factoryDeviceInfoSettings(connectId: string, params: FactoryDeviceInfoSettingsParams): Response<Success$1>;
424
- declare function factoryGetDeviceInfo(connectId: string): Response<FactoryDeviceInfo>;
425
- declare function filesystemFixPermission(connectId: string): Response<Success$1>;
426
- declare function fileRead(connectId: string, params: {
427
- path: string;
428
- offset?: number;
429
- totalSize?: number;
430
- chunkLen?: number;
431
- uiPercentage?: number;
432
- }): Response<FileInfo>;
433
- declare function fileWrite(connectId: string, params: {
434
- path: string;
435
- offset?: number;
436
- totalSize?: number;
437
- chunkSize?: number;
438
- chunkLen?: number;
439
- data: ArrayBuffer | Uint8Array | Blob | string;
440
- overwrite?: boolean;
441
- append?: boolean;
442
- uiPercentage?: number;
443
- timeoutMs?: number | string;
444
- }): Response<FileInfo>;
445
- declare function fileDelete(connectId: string, params: {
446
- path: string;
447
- }): Response<FileOpSuccess>;
448
- declare function dirList(connectId: string, params: {
449
- path: string;
450
- depth?: number;
451
- }): Response<DirInfo>;
452
- declare function dirMake(connectId: string, params: {
453
- path: string;
454
- }): Response<FileOpSuccess>;
455
- declare function dirRemove(connectId: string, params: {
456
- path: string;
457
- }): Response<FileOpSuccess>;
458
- declare function pathInfo(connectId: string, params: {
459
- path: string;
460
- timeoutMs?: number | string;
461
- }): Response<PathInfoResult>;
462
- declare const filesystemFileRead: typeof fileRead;
463
- declare const filesystemFileWrite: typeof fileWrite;
464
- declare const filesystemFileDelete: typeof fileDelete;
465
- declare const filesystemDirList: typeof dirList;
466
- declare const filesystemDirMake: typeof dirMake;
467
- declare const filesystemDirRemove: typeof dirRemove;
468
- declare const filesystemPathInfoQuery: typeof pathInfo;
469
- declare function filesystemFormat(connectId: string): Response<Success$1>;
470
- declare function filesystemDiskControl(connectId: string, params: CommonParams & {
471
- enable: boolean | 0 | 1;
472
- timeoutMs?: number | string;
473
- }): Response<Success$1>;
474
-
475
- declare const on: <T extends string, P extends (...args: any[]) => any>(type: T, fn: P) => void;
476
- declare const off: (type: any, fn: any) => void;
477
- declare const removeAllListeners: (type: any) => void;
478
-
479
- declare function uiResponse(response: UiResponseEvent): void;
480
-
481
- type IAddHardwareGlobalEventListener = (coreMessage: CoreMessage) => void;
482
- interface LowLevelInjectApi {
483
- call: CallMethod;
484
- eventEmitter: EventEmitter$1;
485
- init: CoreApi['init'];
486
- dispose: CoreApi['dispose'];
487
- uiResponse: CoreApi['uiResponse'];
488
- cancel: CoreApi['cancel'];
489
- updateSettings: CoreApi['updateSettings'];
490
- switchTransport: CoreApi['switchTransport'];
491
- addHardwareGlobalEventListener: (listener: IAddHardwareGlobalEventListener) => void;
492
- }
493
- type LowLevelCoreApi = Omit<CoreApi, 'on' | 'off'> & {
494
- addHardwareGlobalEventListener: (listener: IAddHardwareGlobalEventListener) => void;
303
+ type AssetsMap = {
304
+ bridge: {
305
+ version: IVersionArray;
306
+ linux32Rpm: string;
307
+ linux64Rpm: string;
308
+ linux32Deb: string;
309
+ linux64Deb: string;
310
+ win: string;
311
+ mac: string;
312
+ sha256sumAsc: string;
313
+ changelog: {
314
+ [k in ILocale]: string;
315
+ };
316
+ };
495
317
  };
318
+ type RemoteConfigResponse = {
319
+ bridge: AssetsMap['bridge'];
320
+ } & DeviceTypeMap;
496
321
 
497
322
  type DeviceStatus = 'available' | 'occupied' | 'used';
498
323
  declare enum EOneKeyDeviceMode {
@@ -507,6 +332,12 @@ type UnavailableCapabilities = {
507
332
  };
508
333
  type KnownDevice = {
509
334
  connectId: string | null;
335
+ /**
336
+ * Stable physical-device identity. Current SDK responses always include this
337
+ * value; it remains optional in the type during the uuid compatibility window.
338
+ */
339
+ serialNo?: string;
340
+ /** @deprecated Use serialNo instead. */
510
341
  uuid: string;
511
342
  deviceId: string | null;
512
343
  deviceType: IDeviceType | null;
@@ -518,7 +349,8 @@ type KnownDevice = {
518
349
  error?: typeof undefined;
519
350
  mode: EOneKeyDeviceMode;
520
351
  features?: Features;
521
- sessionId?: string | null;
352
+ /** Unified SDK device-state snapshot; features remains a legacy projection. */
353
+ state?: DeviceState;
522
354
  unavailableCapabilities: UnavailableCapabilities;
523
355
  bleFirmwareVersion: IVersionArray | null;
524
356
  firmwareVersion: IVersionArray | null;
@@ -528,15 +360,26 @@ type KnownDevice = {
528
360
  };
529
361
  type SearchDevice = {
530
362
  connectId: string | null;
363
+ /**
364
+ * Available after device initialization. BLE discovery does not connect to the
365
+ * device, so it returns null until a later initialized device response. Current
366
+ * SDK responses always include the field; it remains optional in the type during
367
+ * the uuid compatibility window.
368
+ */
369
+ serialNo?: string | null;
370
+ /**
371
+ * @deprecated Ambiguous legacy identifier. Use serialNo for hardware identity
372
+ * and connectId for transport routing.
373
+ */
531
374
  uuid: string;
532
375
  deviceId: string | null;
533
376
  deviceType: IDeviceType;
534
377
  name: string;
535
378
  commType: OneKeyDeviceCommType;
536
379
  };
537
- type Device = KnownDevice;
380
+ type Device$1 = KnownDevice;
538
381
  type DeviceFeaturesProtocol = 'V1' | 'V2' | 'unknown';
539
- type DeviceFeaturesMode = 'normal' | 'bootloader' | 'notInitialized' | 'backupMode' | 'unknown';
382
+ type DeviceFeaturesMode = 'normal' | 'bootloader' | 'romloader' | 'notInitialized' | 'backupMode' | 'unknown';
540
383
  type DeviceFeaturesVerify = {
541
384
  firmwareBuildId?: string;
542
385
  firmwareHash?: string;
@@ -567,8 +410,111 @@ type DeviceFeaturesRaw = {
567
410
  protocolV1Features?: Messages.Features;
568
411
  protocolV1OneKeyFeatures?: OnekeyFeatures;
569
412
  protocolV2DeviceInfo?: ProtocolV2DeviceInfo;
413
+ protocolV2DeviceStatus?: DeviceStatus$1;
414
+ };
415
+ type DeviceFeaturesRawPatch = {
416
+ [Key in keyof DeviceFeaturesRaw]?: DeviceFeaturesRaw[Key] | null;
417
+ };
418
+ type DeviceStateProtocol = DeviceFeaturesProtocol;
419
+ type DeviceStateMode = DeviceFeaturesMode;
420
+ type DeviceStateSection = 'identity' | 'status' | 'settings' | 'versions' | 'verification';
421
+ type DeviceStateUpdateSource = 'initialize' | 'device-info' | 'device-status' | 'settings-read' | 'settings-write' | 'change-pin' | 'lock' | 'unlock' | 'passphrase' | 'session-clear' | 'firmware-update' | 'transport-reconnect' | 'compatibility';
422
+ type DeviceStateIdentity = {
423
+ deviceType: IDeviceType;
424
+ firmwareType: EFirmwareType;
425
+ model: string | null;
426
+ vendor: string | null;
427
+ deviceId: string | null;
428
+ serialNo: string;
429
+ label: string | null;
430
+ bleName: string | null;
431
+ };
432
+ type DeviceStateStatus = {
433
+ mode: DeviceStateMode;
434
+ initialized: boolean | null;
435
+ unlocked: boolean | null;
436
+ firmwarePresent: boolean | null;
437
+ backupRequired: boolean | null;
438
+ noBackup: boolean | null;
439
+ unfinishedBackup: boolean | null;
440
+ recoveryMode: boolean | null;
441
+ passphraseProtection: boolean | null;
442
+ pinProtection: boolean | null;
443
+ attachToPinEnabled: boolean | null;
444
+ unlockedAttachPin: boolean | null;
445
+ };
446
+ type DeviceStateSettings = {
447
+ language: string | null;
448
+ bleEnabled: boolean | null;
449
+ sdCardPresent: boolean | null;
450
+ sdProtection: boolean | null;
451
+ wipeCodeProtection: boolean | null;
452
+ passphraseAlwaysOnDevice: boolean | null;
453
+ safetyChecks: Enum_SafetyCheckLevel | null;
454
+ autoLockDelayMs: number | null;
455
+ autoShutdownDelayMs: number | null;
456
+ displayRotation: number | null;
457
+ experimentalFeatures: boolean | null;
458
+ wallpaperPath: string | null;
459
+ brightness: number | null;
460
+ animationEnabled: boolean | null;
461
+ tapToWake: boolean | null;
462
+ hapticFeedback: boolean | null;
463
+ deviceNameDisplayEnabled: boolean | null;
464
+ airgapMode: boolean | null;
465
+ fidoEnabled: boolean | null;
466
+ usbLockEnabled: boolean | null;
467
+ randomKeypad: boolean | null;
468
+ };
469
+ type DeviceStateVersions = {
470
+ firmware: string | null;
471
+ bootloader: string | null;
472
+ board: string | null;
473
+ ble: string | null;
474
+ /** @deprecated Kept for legacy consumers; new code should read se01. */
475
+ se?: string | null;
476
+ se01?: string | null;
477
+ se02?: string | null;
478
+ se03?: string | null;
479
+ se04?: string | null;
480
+ se01Boot?: string | null;
481
+ se02Boot?: string | null;
482
+ se03Boot?: string | null;
483
+ se04Boot?: string | null;
484
+ };
485
+ type DeviceState = {
486
+ schemaVersion: 1;
487
+ revision: number;
488
+ updatedAt: number;
489
+ protocol: DeviceStateProtocol;
490
+ /** Device-message protocol version, independent of the SDK V1/V2 protocol family. */
491
+ protocolVersion: number | null;
492
+ identity: DeviceStateIdentity;
493
+ status: DeviceStateStatus;
494
+ settings: DeviceStateSettings;
495
+ versions: DeviceStateVersions;
496
+ capabilities: Array<number | string>;
497
+ verification?: Partial<DeviceFeaturesVerify>;
498
+ };
499
+ type DeviceStatePatch = {
500
+ protocol?: DeviceStateProtocol;
501
+ protocolVersion?: number | null;
502
+ identity?: Partial<DeviceStateIdentity>;
503
+ status?: Partial<DeviceStateStatus>;
504
+ settings?: Partial<DeviceStateSettings>;
505
+ versions?: Partial<DeviceStateVersions>;
506
+ capabilities?: Array<number | string>;
507
+ verification?: DeviceFeaturesVerify;
508
+ raw?: DeviceFeaturesRawPatch;
509
+ };
510
+ type DeviceStateEvent = {
511
+ connectId: string | null;
512
+ state: DeviceState;
513
+ revision: number;
514
+ source: DeviceStateUpdateSource;
515
+ changedKeys: string[];
570
516
  };
571
- type Features = {
517
+ type NormalizedFeatures = {
572
518
  protocol: DeviceFeaturesProtocol;
573
519
  protocolVersion?: number | null;
574
520
  deviceType: IDeviceType;
@@ -597,10 +543,22 @@ type Features = {
597
543
  sdProtection: boolean | null;
598
544
  wipeCodeProtection: boolean | null;
599
545
  passphraseAlwaysOnDevice: boolean | null;
600
- safetyChecks: string | null;
546
+ attachToPinEnabled?: boolean | null;
547
+ safetyChecks: Enum_SafetyCheckLevel | null;
601
548
  autoLockDelayMs: number | null;
549
+ autoShutdownDelayMs: number | null;
602
550
  displayRotation: number | null;
603
551
  experimentalFeatures: boolean | null;
552
+ wallpaperPath: string | null;
553
+ brightness: number | null;
554
+ animationEnabled: boolean | null;
555
+ tapToWake: boolean | null;
556
+ hapticFeedback: boolean | null;
557
+ deviceNameDisplayEnabled: boolean | null;
558
+ airgapMode: boolean | null;
559
+ fidoEnabled: boolean | null;
560
+ usbLockEnabled: boolean | null;
561
+ randomKeypad: boolean | null;
604
562
  firmwareVersion: string | null;
605
563
  bootloaderVersion: string | null;
606
564
  boardVersion: string | null;
@@ -620,8 +578,14 @@ type Features = {
620
578
  unlockedAttachPin?: boolean;
621
579
  raw?: DeviceFeaturesRaw;
622
580
  };
581
+ type Features = NormalizedFeatures & Partial<Omit<Messages.Features, keyof NormalizedFeatures>> & Partial<Omit<Messages.OnekeyFeatures, keyof NormalizedFeatures | keyof Messages.Features>>;
623
582
  type OnekeyFeatures = Messages.OnekeyFeatures;
624
583
  type IDeviceType = EDeviceType.Unknown | EDeviceType.Classic | EDeviceType.Classic1s | EDeviceType.ClassicPure | EDeviceType.Mini | EDeviceType.Touch | EDeviceType.Pro | EDeviceType.Pro2;
584
+ /**
585
+ * model_classic: 'classic' | 'classic1s' | 'classicpure'
586
+ * model_mini: 'classic' | 'classic1s' | 'classicpure' | 'mini'
587
+ * model_touch: 'touch' | 'pro'
588
+ */
625
589
  type IDeviceModel = 'model_classic' | 'model_mini' | 'model_touch' | 'model_classic1s';
626
590
  declare const DeviceModelToTypes: {
627
591
  [deviceModel in IDeviceModel]: IDeviceType[];
@@ -686,89 +650,545 @@ type SupportFeatures = {
686
650
  modifyHomescreen: SupportFeatureType;
687
651
  };
688
652
 
689
- type transportEnv = 'node' | 'web' | 'webextension' | 'electron' | 'react-native' | 'webusb' | 'desktop-webusb' | 'desktop-web-ble' | 'emulator' | 'lowlevel' | 'node-usb';
690
- type ConnectSettings = {
691
- connectSrc?: string;
692
- debug?: boolean;
693
- transportReconnect?: boolean;
694
- lazyLoad?: boolean;
695
- origin?: string;
696
- parentOrigin?: string;
697
- configSrc: string;
698
- iframeSrc: string;
699
- version: string;
700
- priority: number;
701
- trustedHost: boolean;
702
- supportedBrowser?: boolean;
703
- env: transportEnv;
704
- timestamp: number;
705
- isFrame?: boolean;
706
- preRelease?: boolean;
707
- fetchConfig?: boolean;
708
- extension?: string;
709
- configFetcher?: (url: string) => Promise<RemoteConfigResponse | null>;
653
+ type DeviceStateScope = 'runtime' | 'settings' | 'firmware';
654
+ type GetDeviceStateParams = CommonParams & {
655
+ scope?: DeviceStateScope;
710
656
  };
711
- type IVersionArray = [number, number, number];
712
- type ILocale = 'zh-CN' | 'en-US';
713
- type IFirmwareReleaseInfo = {
714
- required: boolean;
715
- url: string;
716
- firmwareType?: EFirmwareType;
717
- resource?: string;
718
- fullResource?: string;
719
- fullResourceRange?: string[];
720
- bootloaderResource?: string;
721
- bootloaderVersion?: IVersionArray;
722
- displayBootloaderVersion?: IVersionArray;
723
- bootloaderRelatedFirmwareVersion?: IVersionArray;
724
- bootloaderChangelog?: {
725
- [k in ILocale]: string;
726
- };
727
- fingerprint: string;
728
- version: IVersionArray;
729
- changelog: {
730
- [k in ILocale]: string;
657
+ /** Internal state-read options, not part of the public CoreApi. */
658
+ type DeviceStateReadOptions = {
659
+ refreshSections?: DeviceStateSection[];
660
+ includeRaw?: boolean;
661
+ };
662
+ declare function getDeviceState(connectId?: string, params?: GetDeviceStateParams): Response<DeviceState>;
663
+
664
+ type DeviceDescriptorDiff = {
665
+ didUpdate: boolean;
666
+ connected: OneKeyDeviceInfo[];
667
+ disconnected: OneKeyDeviceInfo[];
668
+ changedSessions: OneKeyDeviceInfo[];
669
+ changedDebugSessions: OneKeyDeviceInfo[];
670
+ acquired: OneKeyDeviceInfo[];
671
+ debugAcquired: OneKeyDeviceInfo[];
672
+ released: OneKeyDeviceInfo[];
673
+ debugReleased: OneKeyDeviceInfo[];
674
+ descriptors: OneKeyDeviceInfo[];
675
+ };
676
+
677
+ declare class DeviceConnector {
678
+ transport: Transport;
679
+ listenTimestamp: number;
680
+ current: OneKeyDeviceInfo[] | null;
681
+ upcoming: OneKeyDeviceInfo[];
682
+ listening: boolean;
683
+ constructor();
684
+ enumerate(): Promise<DeviceDescriptorDiff | undefined>;
685
+ listen(): Promise<void>;
686
+ stop(): void;
687
+ acquire(path: string, session?: string | null, forceCleanRunPromise?: boolean, connectProtocol?: HardwareConnectProtocol): Promise<string | undefined>;
688
+ release(session: string, onclose: boolean): Promise<void>;
689
+ disconnect(session: string | undefined | null): Promise<void>;
690
+ promptDeviceAccess(): Promise<USBDevice | BluetoothDevice | null>;
691
+ _reportDevicesChange(): void;
692
+ }
693
+
694
+ type InitOptions = {
695
+ initSession?: boolean;
696
+ deviceId?: string;
697
+ passphraseState?: string;
698
+ deriveCardano?: boolean;
699
+ connectProtocol?: HardwareConnectProtocol;
700
+ protocolV2DeviceInfoTimeoutMs?: number;
701
+ /** Refresh Protocol V2 runtime state before returning discovery results. */
702
+ refreshRuntimeState?: boolean;
703
+ };
704
+ type RunOptions = {
705
+ keepSession?: boolean;
706
+ skipInitialize?: boolean;
707
+ } & InitOptions;
708
+ interface DeviceEvents {
709
+ [DEVICE.PIN]: [Device, Messages.PinMatrixRequestType | undefined, (err: any, pin: string) => void];
710
+ [DEVICE.PASSPHRASE_ON_DEVICE]: [Device, PassphraseRequestPayload?];
711
+ [DEVICE.ATTACH_PIN_ON_DEVICE]: [Device, PassphraseRequestPayload?];
712
+ [DEVICE.BUTTON]: [Device, DeviceButtonRequestPayload];
713
+ [DEVICE.FEATURES]: [Device, DeviceFeaturesPayload];
714
+ [DEVICE.STATE]: [Device, DeviceStateEvent];
715
+ [DEVICE.PASSPHRASE]: [
716
+ Device,
717
+ PassphraseRequestPayload,
718
+ (response: PassphrasePromptResponse, error?: Error) => void
719
+ ];
720
+ [DEVICE.SELECT_DEVICE_IN_BOOTLOADER_FOR_WEB_DEVICE]: [
721
+ Device,
722
+ (err: any, deviceId: string) => void
723
+ ];
724
+ [DEVICE.SELECT_DEVICE_FOR_SWITCH_FIRMWARE_WEB_DEVICE]: [
725
+ Device,
726
+ (err: any, deviceId: string) => void
727
+ ];
728
+ }
729
+ /**
730
+ * Pre-populate the device session cache with a known session ID.
731
+ *
732
+ * This allows short-lived processes (e.g. CLI) to restore a previously
733
+ * obtained session, avoiding the need to re-enter passphrase on every
734
+ * invocation. The session must have been obtained from a prior
735
+ * getPassphraseState() call on the same device.
736
+ *
737
+ * @param deviceId - The device's device_id (from features)
738
+ * @param passphraseState - The passphrase state token
739
+ * @param sessionId - The session_id to cache (from features.session_id)
740
+ */
741
+ declare function preloadSessionCache(deviceId: string, passphraseState: string, sessionId: string): void;
742
+ interface Device {
743
+ on<K extends keyof DeviceEvents>(type: K, listener: (...event: DeviceEvents[K]) => void): this;
744
+ off<K extends keyof DeviceEvents>(type: K, listener: (...event: DeviceEvents[K]) => void): this;
745
+ emit<K extends keyof DeviceEvents>(type: K, ...args: DeviceEvents[K]): boolean;
746
+ }
747
+ declare class Device extends EventEmitter {
748
+ /**
749
+ * 设备标识对象
750
+ */
751
+ originalDescriptor: OneKeyDeviceInfo;
752
+ sdkInstanceId?: string;
753
+ /**
754
+ * 设备实例唯一标识
755
+ */
756
+ instanceId: string;
757
+ createdAt: number;
758
+ /**
759
+ * 设备主 ID
760
+ * 蓝牙连接时是设备的 UUID
761
+ * USB连接时是设备的 sessionID
762
+ */
763
+ mainId?: string | null;
764
+ /**
765
+ * 通信管道,向设备发送请求
766
+ */
767
+ deviceConnector?: DeviceConnector | null;
768
+ /**
769
+ * 固件命令
770
+ */
771
+ commands: DeviceCommands;
772
+ /**
773
+ * 可取消的操作
774
+ */
775
+ private cancelableAction?;
776
+ /**
777
+ * 设备是否被占用
778
+ */
779
+ private deviceAcquired;
780
+ /** Canonical device-state cache; legacy Features is a compatibility projection. */
781
+ private stateStore;
782
+ /** Force the next initialization to reload DeviceInfo after reconnect or reboot. */
783
+ private protocolV2StateNeedsReload;
784
+ get state(): (DeviceState & {
785
+ raw?: DeviceFeaturesRaw | undefined;
786
+ }) | undefined;
787
+ get features(): Features | undefined;
788
+ set features(features: Features | undefined);
789
+ runPromise?: Deferred<void> | null;
790
+ externalState: string[];
791
+ unavailableCapabilities: UnavailableCapabilities;
792
+ instance: number;
793
+ internalState: string[];
794
+ needReloadDevice: boolean;
795
+ /**
796
+ * 执行 API 方法后是否保留 SessionID
797
+ */
798
+ keepSession: boolean;
799
+ passphraseState: string | undefined;
800
+ pendingCallbackPromise?: Deferred<void>;
801
+ /** Pre-initialize timestamp (ms) */
802
+ private preInitializedAt?;
803
+ /** Pre-initialize context, used to verify state consistency before skipping */
804
+ private preInitializeMeta?;
805
+ /** Last Initialize duration (ms), reported as "saved" when a skip happens */
806
+ private lastInitializeDurationMs?;
807
+ constructor(descriptor: OneKeyDeviceInfo, sdkInstanceId?: string);
808
+ static fromDescriptor(originalDescriptor: OneKeyDeviceInfo, sdkInstanceId?: string): Device;
809
+ toMessageObject(): Device$1 | null;
810
+ /**
811
+ * Device connect
812
+ * @returns {Promise<boolean>}
813
+ */
814
+ connect(connectProtocol?: HardwareConnectProtocol): Promise<boolean>;
815
+ acquire(connectProtocol?: HardwareConnectProtocol, options?: {
816
+ throwOnRunPromiseError?: boolean;
817
+ }): Promise<void>;
818
+ release(): Promise<void>;
819
+ /**
820
+ * Pre-initialize: connect + Initialize ahead of the sign.
821
+ */
822
+ preInitialize(initOptions?: InitOptions): Promise<void>;
823
+ markPreInitialized(meta?: {
824
+ passphraseState?: string;
825
+ }): void;
826
+ clearPreInitialized(): void;
827
+ isPreInitializeMetaMatch(payload?: {
828
+ passphraseState?: string;
829
+ }): boolean;
830
+ isPreInitializedValid(ttlMs: number): boolean;
831
+ setLastInitializeDuration(durationMs: number): void;
832
+ getLastInitializeDuration(): number | undefined;
833
+ getCommands(): DeviceCommands;
834
+ /**
835
+ * Canonical protocol discriminator.
836
+ *
837
+ * descriptor.protocolType is established by active probing; V2 features are mapped
838
+ * from DeviceInfoGet. All protocol branches must use this method instead of reading
839
+ * originalDescriptor.protocolType directly or inferring a protocol from features.
840
+ */
841
+ getProtocol(): 'V1' | 'V2';
842
+ isProtocolV2(): boolean;
843
+ getCurrentDeviceType(): IDeviceType;
844
+ getCurrentDeviceId(): string | undefined;
845
+ getCurrentSerialNo(): string;
846
+ getConnectId(): string;
847
+ getCurrentBleName(): string | null;
848
+ getCurrentLabel(): string | null;
849
+ getCurrentPassphraseProtection(): boolean | null | undefined;
850
+ getCurrentFirmwareType(): _onekeyfe_hd_shared.EFirmwareType;
851
+ getCurrentFirmwareVersionString(): string;
852
+ getCurrentBLEFirmwareVersionString(): string | undefined;
853
+ getCurrentBootloaderVersionString(): string | undefined;
854
+ getCurrentSafetyChecks(): _onekeyfe_hd_transport.Enum_SafetyCheckLevel | null | undefined;
855
+ getCurrentMethodVersionRange(getVersionRange: (deviceModel: IDeviceType | IDeviceModel) => IVersionRange | undefined): IVersionRange | undefined;
856
+ supportNewPassphrase(): SupportFeatureType;
857
+ supportInputPinOnSoftware(): SupportFeatureType;
858
+ supportModifyHomescreen(): SupportFeatureType;
859
+ private getSessionCacheDeviceKey;
860
+ private reconcileSessionCacheDeviceIdentity;
861
+ getInternalState(_deviceId?: string): string | undefined;
862
+ updateInternalState(enablePassphrase: boolean, passphraseState: string | undefined, deviceId: string | undefined, sessionId?: string | null, featuresSessionId?: string | null): void;
863
+ private setInternalState;
864
+ clearInternalState(_deviceId?: string): void;
865
+ initialize(options?: InitOptions): Promise<void>;
866
+ /**
867
+ * Device initialization over Protocol V2.
868
+ *
869
+ * Protocol V2 bypasses legacy Initialize/GetFeatures and builds its canonical
870
+ * features state directly from DeviceInfoGet.
871
+ */
872
+ private _initializeProtocolV2;
873
+ getFeatures(): Promise<Features | undefined>;
874
+ getDeviceState(params?: DeviceStateReadOptions): Promise<DeviceState>;
875
+ _updateFeatures(protoFeatures: Messages.Features | Features, initSession?: boolean): void;
876
+ updateState(patch: DeviceStatePatch, source: DeviceStateUpdateSource): DeviceState & {
877
+ raw?: DeviceFeaturesRaw | undefined;
731
878
  };
879
+ updateFeaturesPatch(patch: Partial<Features>, source: DeviceStateUpdateSource): Features | undefined;
880
+ probeProtocolV2RuntimeState(deviceInfo: ProtocolV2DeviceInfo, timeoutMs?: number): Promise<Features>;
881
+ updateProtocolV2Features(deviceInfo?: ProtocolV2DeviceInfo, deviceStatus?: DeviceStatus$1 | null, runtimeMode?: ProtocolV2RuntimeMode): Features;
882
+ updateProtocolV2Status(status: DeviceStatus$1): Features;
883
+ markTransportDisconnected(): void;
884
+ markProtocolV2Reboot(rebootType: DeviceRebootType): void;
885
+ /**
886
+ * 暂时只在 acquire 后更新 Session ID
887
+ * 后续看是否有需要依据 listen 返回结果更新
888
+ * @param descriptor
889
+ */
890
+ updateDescriptor(descriptor: OneKeyDeviceInfo, forceUpdate?: boolean): void;
891
+ updateFromCache(device: Device): void;
892
+ run(fn?: () => Promise<void>, options?: RunOptions): Promise<void>;
893
+ _runInner<T>(fn: (() => Promise<T>) | undefined, options: RunOptions, runPromise: Deferred<void>): Promise<void>;
894
+ interruptionFromOutside(): Promise<void>;
895
+ interruptionFromUser(): Promise<void>;
896
+ setCancelableAction(callback: (err?: Error) => Promise<unknown>): void;
897
+ clearCancelableAction(): void;
898
+ getMode(): EOneKeyDeviceMode;
899
+ getFirmwareVersion(): IVersionArray | null;
900
+ getBLEFirmwareVersion(): IVersionArray | null;
901
+ isUsed(): boolean;
902
+ hasDeviceAcquire(): boolean;
903
+ isUsedHere(): boolean;
904
+ isUsedElsewhere(): boolean;
905
+ isBootloader(): boolean | undefined;
906
+ isInitialized(): boolean | undefined;
907
+ isSeedless(): boolean | undefined;
908
+ isUnacquired(): boolean;
909
+ hasUnexpectedMode(allow: string[], require: string[]): "ui-device_bootloader_mode" | "ui-device_not_in_bootloader_mode" | "ui-device_not_initialized" | "ui-device_seedless" | null;
910
+ hasUsePassphrase(): boolean;
911
+ checkDeviceId(deviceId: string): boolean;
912
+ lockDevice(): Promise<Success$1>;
913
+ supportUnlockVersionRange(): DeviceFirmwareRange;
914
+ unlockDevice(): Promise<Features | undefined>;
915
+ checkPassphraseStateSafety(passphraseState?: string, useEmptyPassphrase?: boolean, skipPassphraseCheck?: boolean): Promise<boolean>;
916
+ }
917
+
918
+ /**
919
+ * SDK Tracing Utilities
920
+ * Tracks object instances and request call chains across multiple SDK instances
921
+ */
922
+ /**
923
+ * Generate SDK instance ID
924
+ * @returns Format: "SDK-<number>-<timestamp>"
925
+ * @example "SDK-1-123456"
926
+ */
927
+ declare function generateSdkInstanceId(): string;
928
+ /**
929
+ * Generate globally unique instance ID
930
+ * @param type Instance type (Device, DeviceCommands, BaseMethod, etc.)
931
+ * @param sdkInstanceId SDK instance ID (optional)
932
+ * @returns Format: <SDK>.<type>-<number>-<timestamp>
933
+ * @example "SDK-1.Device-1-123456" or "Device-1-123456"
934
+ */
935
+ declare function generateInstanceId(type: string, sdkInstanceId?: string): string;
936
+ /**
937
+ * Request context information
938
+ */
939
+ interface RequestContext {
940
+ /** Request unique ID (reuses BaseMethod.responseID) */
941
+ responseID: number;
942
+ /** SDK instance ID */
943
+ sdkInstanceId?: string;
944
+ /** API method name */
945
+ methodName: string;
946
+ /** Device connection ID */
947
+ connectId?: string;
948
+ /** Device instance ID */
949
+ deviceInstanceId?: string;
950
+ /** DeviceCommands instance ID */
951
+ commandsInstanceId?: string;
952
+ /** Parent request ID (for nested calls like allNetworkGetAddress) */
953
+ parentResponseID?: number;
954
+ /** Request start time */
955
+ startTime: number;
956
+ /** Request end time */
957
+ endTime?: number;
958
+ /** Request status */
959
+ status?: 'pending' | 'running' | 'success' | 'error' | 'cancelled';
960
+ /** Error message */
961
+ error?: string;
962
+ }
963
+ /**
964
+ * SDK instance tracing context
965
+ */
966
+ interface SdkTracingContext {
967
+ /** SDK instance ID */
968
+ sdkInstanceId: string;
969
+ /** Creation timestamp */
970
+ createdAt: number;
971
+ /** Active requests */
972
+ activeRequests: Map<number, RequestContext>;
973
+ }
974
+ /**
975
+ * Create SDK instance tracing context
976
+ */
977
+ declare function createSdkTracingContext(): SdkTracingContext;
978
+ /**
979
+ * Create and register request context
980
+ * @param responseID Request ID (reuses BaseMethod.responseID)
981
+ * @param methodName API method name
982
+ * @param options Additional options
983
+ */
984
+ declare function createRequestContext(responseID: number, methodName: string, options?: {
985
+ sdkInstanceId?: string;
986
+ connectId?: string;
987
+ deviceInstanceId?: string;
988
+ commandsInstanceId?: string;
989
+ parentResponseID?: number;
990
+ }): RequestContext;
991
+ /**
992
+ * Update request context
993
+ */
994
+ declare function updateRequestContext(responseID: number, updates: Partial<RequestContext>): void;
995
+ /**
996
+ * Complete request context
997
+ */
998
+ declare function completeRequestContext(responseID: number, error?: Error): void;
999
+ /**
1000
+ * Get active requests for specific Device instance
1001
+ */
1002
+ declare function getActiveRequestsByDeviceInstance(deviceInstanceId: string): RequestContext[];
1003
+ /**
1004
+ * Format request context for logging
1005
+ */
1006
+ declare function formatRequestContext(context: RequestContext): string;
1007
+ /**
1008
+ * Cleanup specific SDK instance
1009
+ */
1010
+ declare function cleanupSdkInstance(sdkInstanceId: string): void;
1011
+
1012
+ declare class Core extends EventEmitter {
1013
+ private tracingContext;
1014
+ readonly sdkInstanceId: string;
1015
+ private requestQueue;
1016
+ private disposePromise?;
1017
+ private prePendingCallPromise;
1018
+ private methodSynchronize;
1019
+ constructor();
1020
+ private getCoreContext;
1021
+ handleMessage(message: CoreMessage): Promise<any>;
1022
+ dispose(): Promise<void>;
1023
+ private disposeResources;
1024
+ }
1025
+ declare const init$1: (settings: ConnectSettings, Transport: any, plugin?: LowlevelTransportSharedPlugin) => Promise<Core | undefined>;
1026
+ declare const switchTransport: ({ env, Transport, plugin, }: {
1027
+ env: ConnectSettings['env'];
1028
+ Transport: any;
1029
+ plugin?: LowlevelTransportSharedPlugin | undefined;
1030
+ }) => void;
1031
+
1032
+ type DeviceInfoGetTargets = {
1033
+ hw?: boolean;
1034
+ fw?: boolean;
1035
+ coprocessor?: boolean;
1036
+ se1?: boolean;
1037
+ se2?: boolean;
1038
+ se3?: boolean;
1039
+ se4?: boolean;
1040
+ };
1041
+ type DeviceInfoGetTypes = {
1042
+ version?: boolean;
1043
+ build_id?: boolean;
1044
+ hash?: boolean;
1045
+ specific?: boolean;
1046
+ };
1047
+ type DeviceInfoGetParams = {
1048
+ targets?: DeviceInfoGetTargets;
1049
+ types?: DeviceInfoGetTypes;
1050
+ };
1051
+
1052
+ declare const PRO2_WALLPAPER_WIDTH = 604;
1053
+ declare const PRO2_WALLPAPER_HEIGHT = 1024;
1054
+ type Pro2WallpaperColorFormat = 'RGB565' | 'RGB565A8';
1055
+ declare function encodePro2Wallpaper(options: {
1056
+ width: number;
1057
+ height: number;
1058
+ rgba: Uint8Array | ArrayBuffer;
1059
+ }): {
1060
+ data: Uint8Array;
1061
+ colorFormat: Pro2WallpaperColorFormat;
732
1062
  };
733
- type IBLEFirmwareReleaseInfo = {
734
- required: boolean;
735
- url: string;
736
- webUpdate: string;
737
- fingerprint: string;
738
- fingerprintWeb: string;
739
- version: IVersionArray;
740
- changelog: {
741
- [k in ILocale]: string;
742
- };
1063
+
1064
+ type DeviceUploadWallpaperParams = {
1065
+ width: number;
1066
+ height: number;
1067
+ rgba: Uint8Array | ArrayBuffer;
1068
+ fileName?: string;
1069
+ chunkSize?: number;
743
1070
  };
744
- type IKnownDevice = Exclude<IDeviceType, 'unknown' | 'pro2'>;
745
- type DeviceTypeMap = {
746
- [k in IKnownDevice]: {
747
- firmware: IFirmwareReleaseInfo[];
748
- 'firmware-v2'?: IFirmwareReleaseInfo[];
749
- 'firmware-v8'?: IFirmwareReleaseInfo[];
750
- 'firmware-btc-v8'?: IFirmwareReleaseInfo[];
751
- ble: IBLEFirmwareReleaseInfo[];
752
- };
1071
+ type DeviceUploadWallpaperResponse = {
1072
+ path: string;
1073
+ size: number;
1074
+ colorFormat: Pro2WallpaperColorFormat;
1075
+ message?: string;
753
1076
  };
754
- type AssetsMap = {
755
- bridge: {
756
- version: IVersionArray;
757
- linux32Rpm: string;
758
- linux64Rpm: string;
759
- linux32Deb: string;
760
- linux64Deb: string;
761
- win: string;
762
- mac: string;
763
- sha256sumAsc: string;
764
- changelog: {
765
- [k in ILocale]: string;
766
- };
767
- };
1077
+
1078
+ type FileOpSuccess = {
1079
+ message?: string;
1080
+ };
1081
+ type FileInfo = {
1082
+ path: string;
1083
+ offset: number;
1084
+ total_size: number;
1085
+ data?: Uint8Array;
1086
+ data_hash?: number;
1087
+ processed_byte?: number;
1088
+ chunks?: number;
1089
+ };
1090
+ type DirInfo = {
1091
+ path: string;
1092
+ child_dirs?: string;
1093
+ child_files?: string;
1094
+ };
1095
+ type PathInfoResult = {
1096
+ exist: boolean;
1097
+ size: number;
1098
+ year: number;
1099
+ month: number;
1100
+ day: number;
1101
+ hour: number;
1102
+ minute: number;
1103
+ second: number;
1104
+ readonly: boolean;
1105
+ hidden: boolean;
1106
+ system: boolean;
1107
+ archive: boolean;
1108
+ directory: boolean;
1109
+ };
1110
+ /** @deprecated Development-only raw Protocol V2 command. Use `getDeviceState`. */
1111
+ declare function deviceInfoGet(connectId: string, params?: CommonParams & DeviceInfoGetParams): Response<ProtocolV2DeviceInfo>;
1112
+ /** @deprecated Development-only raw Protocol V2 command. Use `getDeviceState`. */
1113
+ declare function deviceStatusGet(connectId: string, params?: CommonParams): Response<DeviceStatus$1>;
1114
+ /** @deprecated Development-only raw Protocol V2 command. */
1115
+ declare function protocolInfoRequest(connectId: string, params?: CommonParams): Response<ProtocolInfo>;
1116
+ declare function ping(connectId: string, params?: CommonParams & {
1117
+ message?: string;
1118
+ }): Response<Success$1>;
1119
+ declare function deviceReboot(connectId: string, params: CommonParams & DeviceRebootParams): Response<Success$1>;
1120
+ declare function deviceGetOnboardingStatus(connectId: string, params?: CommonParams): Response<DevOnboardingStatus>;
1121
+ declare function deviceFirmwareUpdate(connectId: string, params: CommonParams & DeviceFirmwareUpdateParams): Response<Success$1 | DeviceFirmwareUpdateStatus>;
1122
+ declare function deviceGetFirmwareUpdateStatus(connectId: string, params?: CommonParams & DeviceFirmwareUpdateStatusGetParams): Response<DeviceFirmwareUpdateStatus>;
1123
+ declare function deviceFactoryInfoSet(connectId: string, params: CommonParams & DeviceFactoryInfoSetParams): Response<Success$1>;
1124
+ declare function deviceFactoryInfoGet(connectId: string, params?: CommonParams): Response<DeviceFactoryInfo>;
1125
+ declare function deviceUploadWallpaper(connectId: string, params: CommonParams & DeviceUploadWallpaperParams): Response<DeviceUploadWallpaperResponse>;
1126
+ declare function filesystemPermissionFix(connectId: string, params?: CommonParams): Response<Success$1>;
1127
+ declare function fileRead(connectId: string, params: {
1128
+ path: string;
1129
+ offset?: number;
1130
+ totalSize?: number;
1131
+ chunkLen?: number;
1132
+ uiPercentage?: number;
1133
+ }): Response<FileInfo>;
1134
+ declare function fileWrite(connectId: string, params: {
1135
+ path: string;
1136
+ offset?: number;
1137
+ totalSize?: number;
1138
+ chunkSize?: number;
1139
+ chunkLen?: number;
1140
+ data: ArrayBuffer | Uint8Array | Blob | string;
1141
+ overwrite?: boolean;
1142
+ append?: boolean;
1143
+ uiPercentage?: number;
1144
+ timeoutMs?: number | string;
1145
+ }): Response<FileInfo>;
1146
+ declare function fileDelete(connectId: string, params: {
1147
+ path: string;
1148
+ }): Response<FileOpSuccess>;
1149
+ declare function dirList(connectId: string, params: {
1150
+ path: string;
1151
+ depth?: number;
1152
+ }): Response<DirInfo>;
1153
+ declare function dirMake(connectId: string, params: {
1154
+ path: string;
1155
+ }): Response<FileOpSuccess>;
1156
+ declare function dirRemove(connectId: string, params: {
1157
+ path: string;
1158
+ }): Response<FileOpSuccess>;
1159
+ declare function pathInfo(connectId: string, params: {
1160
+ path: string;
1161
+ timeoutMs?: number | string;
1162
+ }): Response<PathInfoResult>;
1163
+ declare function uploadPortfolio(connectId: string, params: {
1164
+ packageBytes: ArrayBuffer | Uint8Array | Blob;
1165
+ timeoutMs?: number | string;
1166
+ }): Response<FileInfo & {
1167
+ portfolioUpdated: true;
1168
+ }>;
1169
+ declare function filesystemFormat(connectId: string): Response<Success$1>;
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;
768
1191
  };
769
- type RemoteConfigResponse = {
770
- bridge: AssetsMap['bridge'];
771
- } & DeviceTypeMap;
772
1192
 
773
1193
  declare function init(settings: Partial<ConnectSettings>, lowLevelApi?: LowLevelCoreApi, pulgin?: LowlevelTransportSharedPlugin): Promise<boolean>;
774
1194
  declare function updateSettings(settings: Partial<ConnectSettings>): Promise<boolean>;
@@ -779,6 +1199,15 @@ declare function preInitialize(connectId: string, params?: CommonParams): Respon
779
1199
 
780
1200
  declare function getLogs(): Response<string[]>;
781
1201
 
1202
+ type ClearSessionCacheParams = {
1203
+ deviceId?: string;
1204
+ passphraseState?: string;
1205
+ };
1206
+ type ClearSessionCachePayload = {
1207
+ cleared: true;
1208
+ };
1209
+ declare function clearSessionCache(params?: ClearSessionCacheParams): Response<ClearSessionCachePayload>;
1210
+
782
1211
  declare function checkBridgeStatus(): Response<boolean>;
783
1212
 
784
1213
  type CheckBridgeReleaseResponse = {
@@ -817,7 +1246,7 @@ type AllFirmwareRelease = {
817
1246
  ble: FirmwareRelease$2;
818
1247
  bootloader?: FirmwareRelease$2;
819
1248
  bridge?: FirmwareRelease$2;
820
- features?: Features$1;
1249
+ features?: Features;
821
1250
  };
822
1251
  type CheckAllFirmwareReleaseParams = {
823
1252
  checkBridgeRelease?: boolean;
@@ -833,101 +1262,73 @@ declare function checkFirmwareTypeAvailable(params: CheckFirmwareTypeAvailablePa
833
1262
 
834
1263
  declare function searchDevices(params?: CommonParams): Response<SearchDevice[]>;
835
1264
 
1265
+ /**
1266
+ * @deprecated Use `getDeviceState` for both Protocol V1 and Protocol V2 devices.
1267
+ */
836
1268
  declare function getFeatures(connectId?: string, params?: CommonParams): Response<Features>;
837
1269
 
838
- type DeviceInfoProtocol = ProtocolType | 'unknown';
839
- type DeviceInfoSource = 'features' | 'protocolV1OneKeyFeatures' | 'deviceInfo';
840
- type DeviceInfoScope = 'basic' | 'versions' | 'verify' | 'full';
841
- type GetDeviceInfoParams = {
842
- scope?: DeviceInfoScope;
843
- refresh?: boolean;
844
- includeRaw?: boolean;
845
- };
846
- type DeviceInfoMode = 'normal' | 'bootloader' | 'notInitialized' | 'unknown';
847
- type DeviceInfoStatus = {
848
- mode: DeviceInfoMode;
849
- initialized: boolean | null;
850
- bootloaderMode: boolean | null;
851
- unlocked: boolean | null;
852
- passphraseProtection: boolean | null;
853
- backupRequired: boolean | null;
854
- noBackup: boolean | null;
855
- language: string | null;
856
- bleEnabled: boolean | null;
857
- };
858
- type DeviceProfileVersions = {
859
- firmware: string | null;
860
- bootloader: string | null;
861
- board: string | null;
862
- ble: string | null;
863
- se01?: string | null;
864
- se02?: string | null;
865
- se03?: string | null;
866
- se04?: string | null;
867
- se01Boot?: string | null;
868
- se02Boot?: string | null;
869
- se03Boot?: string | null;
870
- se04Boot?: string | null;
871
- };
872
- type DeviceProfileVerify = {
873
- firmwareBuildId?: string;
874
- firmwareHash?: string;
875
- bootloaderBuildId?: string;
876
- bootloaderHash?: string;
877
- boardBuildId?: string;
878
- boardHash?: string;
879
- bleBuildId?: string;
880
- bleHash?: string;
881
- se01BuildId?: string;
882
- se01Hash?: string;
883
- se02BuildId?: string;
884
- se02Hash?: string;
885
- se03BuildId?: string;
886
- se03Hash?: string;
887
- se04BuildId?: string;
888
- se04Hash?: string;
889
- se01BootBuildId?: string;
890
- se01BootHash?: string;
891
- se02BootBuildId?: string;
892
- se02BootHash?: string;
893
- se03BootBuildId?: string;
894
- se03BootHash?: string;
895
- se04BootBuildId?: string;
896
- se04BootHash?: string;
897
- };
898
- type DeviceProfileRaw = {
899
- features?: Features;
900
- protocolV1OneKeyFeatures?: OnekeyFeatures;
901
- protocolV2DeviceInfo?: ProtocolV2DeviceInfo;
902
- };
903
- type DeviceProfile = {
904
- protocol: DeviceInfoProtocol;
905
- sources: DeviceInfoSource[];
906
- deviceType: IDeviceType;
907
- firmwareType: EFirmwareType;
908
- deviceId: string;
909
- serialNo: string;
910
- label: string | null;
911
- bleName: string | null;
912
- status: DeviceInfoStatus;
913
- versions: DeviceProfileVersions;
914
- verify?: DeviceProfileVerify;
915
- raw?: DeviceProfileRaw;
916
- };
917
- declare function getDeviceInfo(connectId?: string, params?: CommonParams & GetDeviceInfoParams): Response<DeviceProfile>;
918
-
1270
+ /**
1271
+ * @deprecated Use `getDeviceState(connectId, { scope: 'firmware' })`.
1272
+ */
919
1273
  declare function getOnekeyFeatures(connectId?: string, params?: CommonParams): Response<OnekeyFeatures>;
920
1274
 
921
- type GetPassphraseStatePayload = {
922
- passphrase_state?: string;
923
- session_id?: string;
924
- unlocked_attach_pin?: boolean;
925
- passphrase_protection?: boolean | null;
1275
+ type GetPassphraseStateParams = CommonParams;
1276
+ /**
1277
+ * Legacy Protocol V1 wallet API.
1278
+ *
1279
+ * This remains supported for Protocol V1 integrations. New cross-protocol integrations
1280
+ * and all Protocol V2 callers should use `openWalletSession`.
1281
+ */
1282
+ declare function getPassphraseState(connectId?: string, params?: GetPassphraseStateParams): Response<string | undefined>;
1283
+
1284
+ type OpenWalletSessionParams = {
1285
+ mode: 'standard';
1286
+ deviceId?: never;
1287
+ passphraseState?: never;
1288
+ useEmptyPassphrase?: never;
1289
+ initSession?: never;
1290
+ } | {
1291
+ mode: 'select-hidden';
1292
+ deviceId?: never;
1293
+ passphraseState?: never;
1294
+ useEmptyPassphrase?: never;
1295
+ initSession?: never;
1296
+ } | {
1297
+ mode: 'resume-hidden';
1298
+ deviceId: string;
1299
+ passphraseState: string;
1300
+ useEmptyPassphrase?: never;
1301
+ initSession?: never;
1302
+ } | {
1303
+ /**
1304
+ * Compatibility form. `useEmptyPassphrase: true` opens the standard wallet;
1305
+ * otherwise `initSession: true` starts a fresh hidden-wallet selection, a
1306
+ * complete wallet binding resumes a hidden wallet, and no binding starts the
1307
+ * hidden-wallet selection flow.
1308
+ */
1309
+ mode?: undefined;
1310
+ useEmptyPassphrase?: boolean;
1311
+ initSession?: boolean;
1312
+ deviceId?: string;
1313
+ passphraseState?: string;
926
1314
  };
927
- type GetPassphraseStateParams = CommonParams & {
928
- allowCreateAttachPin?: boolean;
1315
+ type OpenWalletSessionPayloadBase = {
1316
+ protocol: 'V1' | 'V2';
1317
+ deviceId: string;
1318
+ resumed: boolean;
929
1319
  };
930
- declare function getPassphraseState(connectId?: string, params?: GetPassphraseStateParams): Response<GetPassphraseStatePayload>;
1320
+ type OpenWalletSessionPayload = OpenWalletSessionPayloadBase & ({
1321
+ walletType: 'standard';
1322
+ passphraseState: null;
1323
+ } | {
1324
+ walletType: 'hidden';
1325
+ passphraseState: string;
1326
+ });
1327
+ /**
1328
+ * Opens the standard, hidden, or Attach-to-PIN wallet flow through a unified
1329
+ * Protocol V1/V2 API.
1330
+ */
1331
+ declare function openWalletSession(connectId: string, params: CommonParams & OpenWalletSessionParams): Response<OpenWalletSessionPayload>;
931
1332
 
932
1333
  type FirmwareRelease$1 = {
933
1334
  status: IDeviceFirmwareStatus;
@@ -991,26 +1392,40 @@ interface FirmwareUpdateV3Params {
991
1392
  firmwareType?: EFirmwareType;
992
1393
  platform: IPlatform;
993
1394
  }
1395
+ /**
1396
+ * firmwareUpdateV4 target binaries grouped by DeviceFirmwareTargetType.
1397
+ * Except for romloader, each field maps to a target accepted by bootloader.
1398
+ */
1399
+ type FirmwareUpdateV4Target = 'boot' | 'app_v1' | 'app_v2' | 'coprocessor' | 'resource' | 'se01' | 'se02' | 'se03' | 'se04';
994
1400
  interface FirmwareUpdateV4Params {
995
1401
  platform: IPlatform;
996
1402
  chunkSize?: number;
997
1403
  firmwareType?: EFirmwareType;
1404
+ targetsToUpdate?: FirmwareUpdateV4Target[];
1405
+ /** FW_MGMT_TARGET_ROMLOADER = 2; Pro2 cannot install it through firmwareUpdateV4. */
998
1406
  romloaderBinary?: ArrayBuffer;
1407
+ /** FW_MGMT_TARGET_BOOTLOADER = 3 */
999
1408
  bootloaderBinary?: ArrayBuffer;
1409
+ /** FW_MGMT_TARGET_APPLICATION_P1 = 4 */
1000
1410
  applicationP1Binary?: ArrayBuffer;
1411
+ /** FW_MGMT_TARGET_APPLICATION_P2 = 5 */
1001
1412
  applicationP2Binary?: ArrayBuffer;
1413
+ /** FW_MGMT_TARGET_COPROCESSOR = 6 */
1002
1414
  coprocessorBinary?: ArrayBuffer;
1415
+ /** FW_MGMT_TARGET_SE01-04 = 7-10 */
1003
1416
  se01Binary?: ArrayBuffer;
1004
1417
  se02Binary?: ArrayBuffer;
1005
1418
  se03Binary?: ArrayBuffer;
1006
1419
  se04Binary?: ArrayBuffer;
1007
- resourceBinary?: ArrayBuffer;
1008
1420
  forcedUpdateRes?: boolean;
1009
- firmwareVersion?: number[];
1010
- bleVersion?: number[];
1011
- bootloaderVersion?: number[];
1012
- firmwareBinary?: ArrayBuffer;
1013
- bleBinary?: ArrayBuffer;
1421
+ /**
1422
+ * RESC bundle okpkg files written directly to devicePath through FilesystemFileWrite.
1423
+ * Manual mode installs them without version comparison.
1424
+ */
1425
+ resourceBundleFiles?: Array<{
1426
+ binary: ArrayBuffer;
1427
+ devicePath: string;
1428
+ }>;
1014
1429
  }
1015
1430
  declare function firmwareUpdateV3(connectId: string | undefined, params: Params<FirmwareUpdateV3Params>): Response<{
1016
1431
  bleVersion: string;
@@ -1082,16 +1497,40 @@ type DeviceSettingsParams = {
1082
1497
  language?: string;
1083
1498
  label?: string;
1084
1499
  usePassphrase?: boolean;
1500
+ /** Protocol V1 only. */
1085
1501
  homescreen?: string;
1502
+ /** Protocol V1 only. */
1086
1503
  passphraseSource?: number;
1087
1504
  autoLockDelayMs?: number;
1505
+ /** Protocol V1 only. */
1088
1506
  displayRotation?: number;
1507
+ /** Protocol V1 only. */
1089
1508
  passphraseAlwaysOnDevice?: boolean;
1090
- safetyChecks?: SafetyCheckLevel;
1509
+ /** Protocol V1 only. Uses Enum_SafetyCheckLevel numeric values. */
1510
+ safetyChecks?: Enum_SafetyCheckLevel;
1511
+ /** Protocol V1 only; the current Protocol V2 schema has no matching field. */
1091
1512
  experimentalFeatures?: boolean;
1092
1513
  autoShutdownDelayMs?: number;
1514
+ /** Protocol V1 only; opens the legacy device-side brightness flow. */
1093
1515
  changeBrightness?: boolean;
1516
+ /** Protocol V2 only. */
1517
+ brightness?: number;
1094
1518
  hapticFeedback?: boolean;
1519
+ bluetoothEnabled?: boolean;
1520
+ /** Protocol V2 only; changed through an on-device confirmation page. */
1521
+ airgapMode?: boolean;
1522
+ /** Protocol V2 only. */
1523
+ animationEnabled?: boolean;
1524
+ /** Protocol V2 only. */
1525
+ tapToWake?: boolean;
1526
+ /** Protocol V2 only. */
1527
+ deviceNameDisplayEnabled?: boolean;
1528
+ /** Protocol V2 only. */
1529
+ fidoEnabled?: boolean;
1530
+ /** Protocol V2 only. */
1531
+ usbLockEnabled?: boolean;
1532
+ /** Protocol V2 only. */
1533
+ randomKeypad?: boolean;
1095
1534
  };
1096
1535
  declare function deviceSettings(connectId: string, params: CommonParams & DeviceSettingsParams): Response<Success$1>;
1097
1536
 
@@ -1117,7 +1556,7 @@ type DeviceUploadResourceResponse = Success$1 & {
1117
1556
  declare function deviceUploadResource(connectId: string, params: CommonParams & DeviceUploadResourceParams): Response<DeviceUploadResourceResponse>;
1118
1557
 
1119
1558
  type DeviceSupportFeatures = SupportFeatures & {
1120
- device: Device | null;
1559
+ device: Device$1 | null;
1121
1560
  };
1122
1561
  declare function deviceSupportFeatures(connectId?: string): Response<DeviceSupportFeatures>;
1123
1562
 
@@ -1133,7 +1572,7 @@ declare function deviceUpdateBootloader(connectId: string, params?: DeviceUpdate
1133
1572
 
1134
1573
  declare function deviceLock(connectId: string, params: CommonParams): Response<Success$1>;
1135
1574
 
1136
- declare function deviceUnlock(connectId: string, params?: CommonParams): Response<Features$1>;
1575
+ declare function deviceUnlock(connectId: string, params?: CommonParams): Response<DeviceState>;
1137
1576
 
1138
1577
  declare function deviceCancel(connectId: string, params: CommonParams): Response<Success$1>;
1139
1578
 
@@ -1337,6 +1776,9 @@ type AllNetworkAddressParams = {
1337
1776
  type AllNetworkAddressPayload = {
1338
1777
  address: string;
1339
1778
  pub?: string;
1779
+ /**
1780
+ * @deprecated Use `pub` instead.
1781
+ */
1340
1782
  publicKey?: string;
1341
1783
  npub?: string;
1342
1784
  } | {
@@ -1402,6 +1844,9 @@ declare function evmGetAddress(connectId: string, deviceId: string, params: Comm
1402
1844
  type EVMPublicKey = {
1403
1845
  path: string;
1404
1846
  pub: string;
1847
+ /**
1848
+ * @deprecated Use `pub` instead.
1849
+ */
1405
1850
  publicKey?: string;
1406
1851
  } & EthereumPublicKey;
1407
1852
  type EVMGetPublicKeyParams = {
@@ -2185,6 +2630,9 @@ declare function nearSignTransaction(connectId: string, deviceId: string, params
2185
2630
  type AptosAddress = {
2186
2631
  path: string;
2187
2632
  pub?: string;
2633
+ /**
2634
+ * @deprecated Use `pub` instead.
2635
+ */
2188
2636
  publicKey?: string;
2189
2637
  } & AptosAddress$1;
2190
2638
  type AptosGetAddressParams = {
@@ -2199,6 +2647,9 @@ declare function aptosGetAddress(connectId: string, deviceId: string, params: Co
2199
2647
  type AptosPublicKey = {
2200
2648
  path: string;
2201
2649
  pub: string;
2650
+ /**
2651
+ * @deprecated Use `pub` instead.
2652
+ */
2202
2653
  publicKey?: string;
2203
2654
  };
2204
2655
  type AptosGetPublicKeyParams = {
@@ -2283,6 +2734,9 @@ declare function cosmosGetAddress(connectId: string, deviceId: string, params: C
2283
2734
  type CosmosPublicKey = {
2284
2735
  path: string;
2285
2736
  pub: string;
2737
+ /**
2738
+ * @deprecated Use `pub` instead.
2739
+ */
2286
2740
  publicKey?: string;
2287
2741
  };
2288
2742
  type CosmosGetPublicKeyParams = {
@@ -2307,6 +2761,9 @@ declare function cosmosSignTransaction(connectId: string, deviceId: string, para
2307
2761
  type XrpAddress = {
2308
2762
  path: string;
2309
2763
  pub?: string;
2764
+ /**
2765
+ * @deprecated Use `pub` instead.
2766
+ */
2310
2767
  publicKey?: string;
2311
2768
  address: string;
2312
2769
  };
@@ -2340,6 +2797,9 @@ declare function xrpSignTransaction(connectId: string, deviceId: string, params:
2340
2797
  type SuiAddress = {
2341
2798
  path: string;
2342
2799
  pub?: string;
2800
+ /**
2801
+ * @deprecated Use `pub` instead.
2802
+ */
2343
2803
  publicKey?: string;
2344
2804
  } & SuiAddress$1;
2345
2805
  type SuiGetAddressParams = {
@@ -2354,6 +2814,9 @@ declare function suiGetAddress(connectId: string, deviceId: string, params: Comm
2354
2814
  type SuiPublicKey = {
2355
2815
  path: string;
2356
2816
  pub: string;
2817
+ /**
2818
+ * @deprecated Use `pub` instead.
2819
+ */
2357
2820
  publicKey?: string;
2358
2821
  };
2359
2822
  type SuiGetPublicKeyParams = {
@@ -2383,6 +2846,10 @@ declare function suiSignTransaction(connectId: string, deviceId: string, params:
2383
2846
  type CardanoGetAddressMethodParams = {
2384
2847
  addressParameters: CardanoAddressParameters;
2385
2848
  networkId: number;
2849
+ /**
2850
+ * Testnet cip34:0-1097911063
2851
+ * Mainnet cip34:1-764824073
2852
+ */
2386
2853
  protocolMagic: number;
2387
2854
  derivationType: number;
2388
2855
  address?: string;
@@ -2444,6 +2911,10 @@ type CardanoSignMessageMethodParams = {
2444
2911
  derivationType: number;
2445
2912
  networkId: number;
2446
2913
  addressType?: Messages.CardanoAddressType;
2914
+ /**
2915
+ * Testnet cip34:0-1097911063
2916
+ * Mainnet cip34:1-764824073
2917
+ */
2447
2918
  protocolMagic?: number;
2448
2919
  };
2449
2920
  declare function cardanoSignMessage(connectId: string, deviceId: string, params: CommonParams & CardanoSignMessageMethodParams): Response<CardanoMessageSignature>;
@@ -2477,6 +2948,9 @@ declare function filecoinSignTransaction(connectId: string, deviceId: string, pa
2477
2948
  type PolkadotAddress = {
2478
2949
  path: string;
2479
2950
  pub: string;
2951
+ /**
2952
+ * @deprecated Use `pub` instead.
2953
+ */
2480
2954
  publicKey?: string;
2481
2955
  } & PolkadotAddress$1;
2482
2956
  type PolkadotGetAddressParams = {
@@ -2535,14 +3009,36 @@ type KaspaSignInputParams = {
2535
3009
  sequenceNumber: number | string;
2536
3010
  output: {
2537
3011
  satoshis: number | string;
2538
- script: string;
3012
+ script?: string;
2539
3013
  };
2540
3014
  sigOpCount?: number;
2541
3015
  };
2542
3016
  type KaspaSignOutputParams = {
2543
3017
  satoshis: number | string;
3018
+ address?: string;
3019
+ addressN?: string | number[];
3020
+ script?: string;
3021
+ scriptVersion?: number;
3022
+ };
3023
+ type KaspaRefTransactionInput = {
3024
+ prevTxId: string;
3025
+ outputIndex: number;
3026
+ sequenceNumber: number | string;
3027
+ };
3028
+ type KaspaRefTransactionOutput = {
3029
+ satoshis: number | string;
3030
+ scriptVersion?: number;
2544
3031
  script: string;
2545
- scriptVersion: number;
3032
+ };
3033
+ type KaspaRefTransaction = {
3034
+ txId: string;
3035
+ version: number;
3036
+ inputs: KaspaRefTransactionInput[];
3037
+ outputs: KaspaRefTransactionOutput[];
3038
+ lockTime?: number | string;
3039
+ subNetworkID?: string;
3040
+ gas?: number | string;
3041
+ payload?: string;
2546
3042
  };
2547
3043
  type KaspaSignTransactionParams = {
2548
3044
  version: number;
@@ -2552,6 +3048,9 @@ type KaspaSignTransactionParams = {
2552
3048
  sigHashType?: SignatureType;
2553
3049
  sigOpCount?: number;
2554
3050
  subNetworkID?: string;
3051
+ payload?: string;
3052
+ gas?: number | string;
3053
+ refTxs?: KaspaRefTransaction[];
2555
3054
  scheme?: string;
2556
3055
  prefix?: string;
2557
3056
  useTweak?: boolean;
@@ -2596,6 +3095,9 @@ declare function nexaSignTransaction(connectId: string, deviceId: string, params
2596
3095
  type NostrPublicKey = {
2597
3096
  npub?: string;
2598
3097
  pub?: string;
3098
+ /**
3099
+ * @deprecated Use `pub` instead.
3100
+ */
2599
3101
  publicKey?: string;
2600
3102
  path: string;
2601
3103
  };
@@ -2692,6 +3194,9 @@ declare function nostrSignSchnorr(connectId: string, deviceId: string, params: C
2692
3194
 
2693
3195
  interface LnurlAuth {
2694
3196
  pub?: string;
3197
+ /**
3198
+ * @deprecated Use `pub` instead.
3199
+ */
2695
3200
  publickey?: string;
2696
3201
  path?: string;
2697
3202
  signature?: string;
@@ -2768,6 +3273,9 @@ declare function dnxSignTransaction(connectId: string, deviceId: string, params:
2768
3273
  type TonAddress = {
2769
3274
  path: string;
2770
3275
  pub: string;
3276
+ /**
3277
+ * @deprecated Use `pub` instead.
3278
+ */
2771
3279
  publicKey?: string;
2772
3280
  address: string;
2773
3281
  };
@@ -2879,6 +3387,9 @@ declare function scdoSignTransaction(connectId: string, deviceId: string, params
2879
3387
 
2880
3388
  type AlephiumAddress = {
2881
3389
  path: string;
3390
+ /**
3391
+ * @deprecated Use `pub` instead.
3392
+ */
2882
3393
  publicKey?: string;
2883
3394
  pub?: string;
2884
3395
  address: string;
@@ -2981,12 +3492,15 @@ type NeoSignedTx = {
2981
3492
  declare function neoSignTransaction(connectId: string, deviceId: string, params: CommonParams & NeoUnsignedTx): Response<NeoSignedTx>;
2982
3493
 
2983
3494
  type CoreApi = {
3495
+ /**
3496
+ * Inject function
3497
+ */
2984
3498
  init: typeof init;
2985
3499
  on: typeof on;
2986
3500
  off: typeof off;
2987
3501
  emit: (event: string, ...args: any[]) => void;
2988
3502
  removeAllListeners: typeof removeAllListeners;
2989
- dispose: () => void;
3503
+ dispose: () => void | Promise<void>;
2990
3504
  call: (params: any) => Promise<any>;
2991
3505
  uiResponse: typeof uiResponse;
2992
3506
  cancel: (connectId?: string) => void;
@@ -2995,19 +3509,30 @@ type CoreApi = {
2995
3509
  success: boolean;
2996
3510
  }>;
2997
3511
  getLogs: typeof getLogs;
3512
+ clearSessionCache: typeof clearSessionCache;
3513
+ /**
3514
+ * Test function
3515
+ */
2998
3516
  testInitializeDeviceDuration: typeof testInitializeDeviceDuration;
2999
3517
  preInitialize: typeof preInitialize;
3518
+ /**
3519
+ * Core function
3520
+ */
3000
3521
  checkAllFirmwareRelease: typeof checkAllFirmwareRelease;
3001
3522
  checkBridgeStatus: typeof checkBridgeStatus;
3002
3523
  checkBridgeRelease: typeof checkBridgeRelease;
3003
3524
  checkBootloaderRelease: typeof checkBootloaderRelease;
3004
3525
  checkFirmwareTypeAvailable: typeof checkFirmwareTypeAvailable;
3526
+ /**
3527
+ * Device function
3528
+ */
3005
3529
  searchDevices: typeof searchDevices;
3006
3530
  promptWebDeviceAccess: typeof promptWebDeviceAccess;
3007
3531
  getFeatures: typeof getFeatures;
3008
- getDeviceInfo: typeof getDeviceInfo;
3532
+ getDeviceState: typeof getDeviceState;
3009
3533
  getOnekeyFeatures: typeof getOnekeyFeatures;
3010
3534
  getPassphraseState: typeof getPassphraseState;
3535
+ openWalletSession: typeof openWalletSession;
3011
3536
  deviceBackup: typeof deviceBackup;
3012
3537
  deviceChangePin: typeof deviceChangePin;
3013
3538
  deviceFlags: typeof deviceFlags;
@@ -3035,20 +3560,23 @@ type CoreApi = {
3035
3560
  firmwareUpdateV3: typeof firmwareUpdateV3;
3036
3561
  firmwareUpdateV4: typeof firmwareUpdateV4;
3037
3562
  cipherKeyValue: typeof cipherKeyValue;
3038
- getProtoVersion: typeof getProtoVersion;
3039
- ping: typeof ping;
3563
+ /**
3564
+ * Pro2 business API
3565
+ */
3040
3566
  deviceReboot: typeof deviceReboot;
3041
- deviceGetDeviceInfo: typeof deviceGetDeviceInfo;
3042
3567
  deviceGetOnboardingStatus: typeof deviceGetOnboardingStatus;
3568
+ deviceUploadWallpaper: typeof deviceUploadWallpaper;
3569
+ deviceInfoGet: typeof deviceInfoGet;
3570
+ deviceStatusGet: typeof deviceStatusGet;
3571
+ protocolInfoRequest: typeof protocolInfoRequest;
3572
+ ping: typeof ping;
3043
3573
  deviceFirmwareUpdate: typeof deviceFirmwareUpdate;
3044
3574
  deviceGetFirmwareUpdateStatus: typeof deviceGetFirmwareUpdateStatus;
3045
- devReboot: typeof devReboot;
3046
- devGetDeviceInfo: typeof devGetDeviceInfo;
3047
- devFirmwareUpdate: typeof devFirmwareUpdate;
3048
- devGetFirmwareUpdateStatus: typeof devGetFirmwareUpdateStatus;
3049
- factoryDeviceInfoSettings: typeof factoryDeviceInfoSettings;
3050
- factoryGetDeviceInfo: typeof factoryGetDeviceInfo;
3051
- filesystemFixPermission: typeof filesystemFixPermission;
3575
+ deviceFactoryInfoSet: typeof deviceFactoryInfoSet;
3576
+ deviceFactoryInfoGet: typeof deviceFactoryInfoGet;
3577
+ filesystemPermissionFix: typeof filesystemPermissionFix;
3578
+ filesystemFormat: typeof filesystemFormat;
3579
+ uploadPortfolio: typeof uploadPortfolio;
3052
3580
  fileRead: typeof fileRead;
3053
3581
  fileWrite: typeof fileWrite;
3054
3582
  fileDelete: typeof fileDelete;
@@ -3056,17 +3584,14 @@ type CoreApi = {
3056
3584
  dirMake: typeof dirMake;
3057
3585
  dirRemove: typeof dirRemove;
3058
3586
  pathInfo: typeof pathInfo;
3059
- filesystemFileRead: typeof filesystemFileRead;
3060
- filesystemFileWrite: typeof filesystemFileWrite;
3061
- filesystemFileDelete: typeof filesystemFileDelete;
3062
- filesystemDirList: typeof filesystemDirList;
3063
- filesystemDirMake: typeof filesystemDirMake;
3064
- filesystemDirRemove: typeof filesystemDirRemove;
3065
- filesystemPathInfoQuery: typeof filesystemPathInfoQuery;
3066
- filesystemFormat: typeof filesystemFormat;
3067
- filesystemDiskControl: typeof filesystemDiskControl;
3587
+ /**
3588
+ * All network function
3589
+ */
3068
3590
  allNetworkGetAddress: typeof allNetworkGetAddress;
3069
3591
  allNetworkGetAddressByLoop: typeof allNetworkGetAddressByLoop;
3592
+ /**
3593
+ * EVM function
3594
+ */
3070
3595
  evmGetAddress: typeof evmGetAddress;
3071
3596
  evmGetPublicKey: typeof evmGetPublicKey;
3072
3597
  evmSignMessage: typeof evmSignMessage;
@@ -3074,86 +3599,167 @@ type CoreApi = {
3074
3599
  evmSignTransaction: typeof evmSignTransaction;
3075
3600
  evmSignTypedData: typeof evmSignTypedData;
3076
3601
  evmVerifyMessage: typeof evmVerifyMessage;
3602
+ /**
3603
+ * BTC function
3604
+ */
3077
3605
  btcGetAddress: typeof btcGetAddress;
3078
3606
  btcGetPublicKey: typeof btcGetPublicKey;
3079
3607
  btcSignMessage: typeof btcSignMessage;
3080
3608
  btcSignPsbt: typeof btcSignPsbt;
3081
3609
  btcSignTransaction: typeof btcSignTransaction;
3082
3610
  btcVerifyMessage: typeof btcVerifyMessage;
3611
+ /**
3612
+ * Starcoin function
3613
+ */
3083
3614
  starcoinGetAddress: typeof starcoinGetAddress;
3084
3615
  starcoinGetPublicKey: typeof starcoinGetPublicKey;
3085
3616
  starcoinSignMessage: typeof starcoinSignMessage;
3086
3617
  starcoinSignTransaction: typeof starcoinSignTransaction;
3087
3618
  starcoinVerifyMessage: typeof starcoinVerifyMessage;
3619
+ /**
3620
+ * Nem function
3621
+ */
3088
3622
  nemGetAddress: typeof nemGetAddress;
3089
3623
  nemSignTransaction: typeof nemSignTransaction;
3624
+ /**
3625
+ * Solana function
3626
+ */
3090
3627
  solGetAddress: typeof solGetAddress;
3091
3628
  solSignTransaction: typeof solSignTransaction;
3092
3629
  solSignOffchainMessage: typeof solSignOffchainMessage;
3093
3630
  solSignMessage: typeof solSignMessage;
3631
+ /**
3632
+ * Stellar function
3633
+ */
3094
3634
  stellarGetAddress: typeof stellarGetAddress;
3095
3635
  stellarSignTransaction: typeof stellarSignTransaction;
3636
+ /**
3637
+ * Tron function
3638
+ */
3096
3639
  tronGetAddress: typeof tronGetAddress;
3097
3640
  tronSignMessage: typeof tronSignMessage;
3098
3641
  tronSignTransaction: typeof tronSignTransaction;
3642
+ /**
3643
+ * Conflux function
3644
+ */
3099
3645
  confluxGetAddress: typeof confluxGetAddress;
3100
3646
  confluxSignMessage: typeof confluxSignMessage;
3101
3647
  confluxSignMessageCIP23: typeof confluxSignMessageCIP23;
3102
3648
  confluxSignTransaction: typeof confluxSignTransaction;
3649
+ /**
3650
+ * Near function
3651
+ */
3103
3652
  nearGetAddress: typeof nearGetAddress;
3104
3653
  nearSignTransaction: typeof nearSignTransaction;
3654
+ /**
3655
+ * Aptos function
3656
+ */
3105
3657
  aptosGetAddress: typeof aptosGetAddress;
3106
3658
  aptosGetPublicKey: typeof aptosGetPublicKey;
3107
3659
  aptosSignMessage: typeof aptosSignMessage;
3108
3660
  aptosSignInMessage: typeof aptosSignInMessage;
3109
3661
  aptosSignTransaction: typeof aptosSignTransaction;
3662
+ /**
3663
+ * Algo function
3664
+ */
3110
3665
  algoGetAddress: typeof algoGetAddress;
3111
3666
  algoSignTransaction: typeof algoSignTransaction;
3667
+ /**
3668
+ * Cosmos function
3669
+ */
3112
3670
  cosmosGetAddress: typeof cosmosGetAddress;
3113
3671
  cosmosGetPublicKey: typeof cosmosGetPublicKey;
3114
3672
  cosmosSignTransaction: typeof cosmosSignTransaction;
3673
+ /**
3674
+ * XRP function
3675
+ */
3115
3676
  xrpGetAddress: typeof xrpGetAddress;
3116
3677
  xrpSignTransaction: typeof xrpSignTransaction;
3678
+ /**
3679
+ * SUI function
3680
+ */
3117
3681
  suiGetAddress: typeof suiGetAddress;
3118
3682
  suiGetPublicKey: typeof suiGetPublicKey;
3119
3683
  suiSignMessage: typeof suiSignMessage;
3120
3684
  suiSignTransaction: typeof suiSignTransaction;
3685
+ /**
3686
+ * Cardano function
3687
+ */
3121
3688
  cardanoGetAddress: typeof cardanoGetAddress;
3122
3689
  cardanoGetPublicKey: typeof cardanoGetPublicKey;
3123
3690
  cardanoSignTransaction: typeof cardanoSignTransaction;
3124
3691
  cardanoSignMessage: typeof cardanoSignMessage;
3692
+ /**
3693
+ * Filecoin function
3694
+ */
3125
3695
  filecoinGetAddress: typeof filecoinGetAddress;
3126
3696
  filecoinSignTransaction: typeof filecoinSignTransaction;
3697
+ /**
3698
+ * Polkadot function
3699
+ */
3127
3700
  polkadotGetAddress: typeof polkadotGetAddress;
3128
3701
  polkadotSignTransaction: typeof polkadotSignTransaction;
3702
+ /**
3703
+ * Kaspa function
3704
+ */
3129
3705
  kaspaGetAddress: typeof kaspaGetAddress;
3130
3706
  kaspaSignTransaction: typeof kaspaSignTransaction;
3707
+ /**
3708
+ * nexa function
3709
+ */
3131
3710
  nexaGetAddress: typeof nexaGetAddress;
3132
3711
  nexaSignTransaction: typeof nexaSignTransaction;
3712
+ /**
3713
+ * Nostr function
3714
+ */
3133
3715
  nostrGetPublicKey: typeof nostrGetPublicKey;
3134
3716
  nostrSignEvent: typeof nostrSignEvent;
3135
3717
  nostrEncryptMessage: typeof nostrEncryptMessage;
3136
3718
  nostrDecryptMessage: typeof nostrDecryptMessage;
3137
3719
  nostrSignSchnorr: typeof nostrSignSchnorr;
3720
+ /**
3721
+ * Lightning Network
3722
+ */
3138
3723
  lnurlAuth: typeof lnurlAuth;
3724
+ /**
3725
+ * Nervos Network
3726
+ */
3139
3727
  nervosGetAddress: typeof nervosGetAddress;
3140
3728
  nervosSignTransaction: typeof nervosSignTransaction;
3729
+ /**
3730
+ * Dnx Network
3731
+ */
3141
3732
  dnxGetAddress: typeof dnxGetAddress;
3142
3733
  dnxSignTransaction: typeof dnxSignTransaction;
3734
+ /**
3735
+ * TON Network
3736
+ */
3143
3737
  tonGetAddress: typeof tonGetAddress;
3144
3738
  tonSignMessage: typeof tonSignMessage;
3145
3739
  tonSignProof: typeof tonSignProof;
3146
3740
  tonSignData: typeof tonSignData;
3741
+ /**
3742
+ * SCDO Network
3743
+ */
3147
3744
  scdoGetAddress: typeof scdoGetAddress;
3148
3745
  scdoSignMessage: typeof scdoSignMessage;
3149
3746
  scdoSignTransaction: typeof scdoSignTransaction;
3747
+ /**
3748
+ * Alephium Network
3749
+ */
3150
3750
  alephiumGetAddress: typeof alephiumGetAddress;
3151
3751
  alephiumSignMessage: typeof alephiumSignMessage;
3152
3752
  alephiumSignTransaction: typeof alephiumSignTransaction;
3753
+ /**
3754
+ * Benfen Network
3755
+ */
3153
3756
  benfenGetAddress: typeof benfenGetAddress;
3154
3757
  benfenGetPublicKey: typeof benfenGetPublicKey;
3155
3758
  benfenSignTransaction: typeof benfenSignTransaction;
3156
3759
  benfenSignMessage: typeof benfenSignMessage;
3760
+ /**
3761
+ * Neo Network
3762
+ */
3157
3763
  neoGetAddress: typeof neoGetAddress;
3158
3764
  neoSignTransaction: typeof neoSignTransaction;
3159
3765
  };
@@ -3228,11 +3834,13 @@ declare const DEVICE: {
3228
3834
  readonly PIN: "pin";
3229
3835
  readonly PASSPHRASE: "passphrase";
3230
3836
  readonly PASSPHRASE_ON_DEVICE: "passphrase_on_device";
3837
+ readonly ATTACH_PIN_ON_DEVICE: "attach_pin_on_device";
3231
3838
  readonly WORD: "word";
3232
3839
  readonly SUPPORT_FEATURES: "support_features";
3233
3840
  readonly SELECT_DEVICE_IN_BOOTLOADER_FOR_WEB_DEVICE: "select_device_in_bootloader_for_web_device";
3234
3841
  readonly SELECT_DEVICE_FOR_SWITCH_FIRMWARE_WEB_DEVICE: "select_device_for_switch_firmware_web_device";
3235
3842
  readonly FEATURES: "features";
3843
+ readonly STATE: "state";
3236
3844
  };
3237
3845
  interface DeviceConnnectRequest {
3238
3846
  type: typeof DEVICE.CONNECT;
@@ -3251,6 +3859,9 @@ interface DeviceButtonRequestPayload extends Omit<Messages.ButtonRequest, 'code'
3251
3859
  }
3252
3860
  type PassphraseRequestPayload = {
3253
3861
  existsAttachPinUser?: boolean;
3862
+ source?: 'wallet-session-coordinator';
3863
+ reason?: 'open-wallet' | 'session-recovery';
3864
+ expectedPassphraseState?: string;
3254
3865
  };
3255
3866
  interface DeviceButtonRequest {
3256
3867
  type: typeof DEVICE.BUTTON;
@@ -3263,6 +3874,10 @@ interface DeviceSendFeatures {
3263
3874
  type: typeof DEVICE.FEATURES;
3264
3875
  payload: DeviceFeaturesPayload;
3265
3876
  }
3877
+ interface DeviceSendState {
3878
+ type: typeof DEVICE.STATE;
3879
+ payload: DeviceStateEvent;
3880
+ }
3266
3881
  type DeviceSupportFeaturesPayload = SupportFeatures & {
3267
3882
  device: KnownDevice | null;
3268
3883
  };
@@ -3270,7 +3885,7 @@ interface DeviceSendSupportFeatures {
3270
3885
  type: typeof DEVICE.SUPPORT_FEATURES;
3271
3886
  payload: DeviceSupportFeaturesPayload;
3272
3887
  }
3273
- type DeviceEvent = DeviceButtonRequest | DeviceSendFeatures | DeviceSendSupportFeatures | DeviceDisconnnectRequest | DeviceConnnectRequest;
3888
+ type DeviceEvent = DeviceButtonRequest | DeviceSendState | DeviceSendFeatures | DeviceSendSupportFeatures | DeviceDisconnnectRequest | DeviceConnnectRequest;
3274
3889
  type DeviceEventMessage = DeviceEvent & {
3275
3890
  event: typeof DEVICE_EVENT;
3276
3891
  };
@@ -3311,6 +3926,17 @@ declare const UI_REQUEST: {
3311
3926
  readonly FIRMWARE_NOT_INSTALLED: "ui-device_firmware_not_installed";
3312
3927
  readonly NOT_USE_ONEKEY_DEVICE: "ui-device_please_use_onekey_device";
3313
3928
  };
3929
+ type ProtocolV2UiEventSource = 'unlock-coordinator' | 'wallet-session-coordinator' | 'method-lifecycle';
3930
+ type ProtocolV2UiCompletion = 'page-accepted' | 'operation-completed';
3931
+ type ProtocolV2UiEventMetadata = {
3932
+ source?: ProtocolV2UiEventSource;
3933
+ reason?: string;
3934
+ deviceOnly?: boolean;
3935
+ completion?: ProtocolV2UiCompletion;
3936
+ method?: string;
3937
+ page?: string | number;
3938
+ operation?: string;
3939
+ };
3314
3940
  interface UiRequestWithoutPayload {
3315
3941
  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;
3316
3942
  payload?: typeof undefined;
@@ -3323,40 +3949,45 @@ interface UiRequestFirmwareProgressing {
3323
3949
  }
3324
3950
  type UiRequestDeviceAction = {
3325
3951
  type: typeof UI_REQUEST.REQUEST_PIN;
3326
- payload: {
3327
- device: Device;
3952
+ payload: ProtocolV2UiEventMetadata & {
3953
+ device: Device$1;
3328
3954
  type?: Messages.PinMatrixRequestType | 'ButtonRequest_PinEntry' | 'ButtonRequest_AttachPin';
3329
3955
  };
3330
3956
  };
3331
3957
  interface UiRequestButton {
3332
3958
  type: typeof UI_REQUEST.REQUEST_BUTTON;
3333
- payload: DeviceButtonRequest['payload'];
3959
+ payload: DeviceButtonRequest['payload'] & ProtocolV2UiEventMetadata;
3334
3960
  }
3335
3961
  interface UiRequestPassphrase {
3336
3962
  type: typeof UI_REQUEST.REQUEST_PASSPHRASE;
3337
3963
  payload: {
3338
- device: Device;
3964
+ device: Device$1;
3339
3965
  passphraseState?: string;
3340
3966
  existsAttachPinUser?: boolean;
3967
+ source?: 'wallet-session-coordinator';
3968
+ reason?: 'open-wallet' | 'session-recovery';
3969
+ expectedPassphraseState?: string;
3341
3970
  };
3342
3971
  }
3343
3972
  interface UiRequestPassphraseOnDevice {
3344
3973
  type: typeof UI_REQUEST.REQUEST_PASSPHRASE_ON_DEVICE;
3345
3974
  payload: {
3346
- device: Device;
3975
+ device: Device$1;
3347
3976
  passphraseState?: string;
3977
+ source?: 'wallet-session-coordinator';
3978
+ reason?: 'open-wallet' | 'session-recovery';
3348
3979
  };
3349
3980
  }
3350
3981
  interface UiRequestSelectDeviceInBootloaderForWebDevice {
3351
3982
  type: typeof UI_REQUEST.REQUEST_DEVICE_IN_BOOTLOADER_FOR_WEB_DEVICE;
3352
3983
  payload: {
3353
- device: Device;
3984
+ device: Device$1;
3354
3985
  };
3355
3986
  }
3356
3987
  interface UiRequestSelectDeviceForSwitchFirmwareWebDevice {
3357
3988
  type: typeof UI_REQUEST.REQUEST_DEVICE_FOR_SWITCH_FIRMWARE_WEB_DEVICE;
3358
3989
  payload: {
3359
- device: Device;
3990
+ device: Device$1;
3360
3991
  };
3361
3992
  }
3362
3993
  interface FirmwareProcessing {
@@ -3369,7 +4000,7 @@ type IFirmwareUpdateProgressType = 'transferData' | 'installingFirmware';
3369
4000
  interface FirmwareProgress {
3370
4001
  type: typeof UI_REQUEST.FIRMWARE_PROGRESS;
3371
4002
  payload: {
3372
- device: Device;
4003
+ device: Device$1;
3373
4004
  progress: number;
3374
4005
  progressType: IFirmwareUpdateProgressType;
3375
4006
  transferredBytes?: number;
@@ -3381,7 +4012,7 @@ interface FirmwareProgress {
3381
4012
  interface FirmwareTip {
3382
4013
  type: typeof UI_REQUEST.FIRMWARE_TIP;
3383
4014
  payload: {
3384
- device: Device;
4015
+ device: Device$1;
3385
4016
  data: {
3386
4017
  message: string;
3387
4018
  };
@@ -3400,7 +4031,7 @@ interface DeviceProgress {
3400
4031
  interface PreviousAddressResult {
3401
4032
  type: typeof UI_REQUEST.PREVIOUS_ADDRESS_RESULT;
3402
4033
  payload: {
3403
- device: Device;
4034
+ device: Device$1;
3404
4035
  data: {
3405
4036
  address?: string;
3406
4037
  path?: string;
@@ -3653,7 +4284,7 @@ type UiPromiseResponse = UiResponseEvent | {
3653
4284
  };
3654
4285
  type UiPromise<T extends UiPromiseResponse['type']> = Deferred<Extract<UiPromiseResponse, {
3655
4286
  type: T;
3656
- }>, T, Device$1>;
4287
+ }>, T, Device>;
3657
4288
 
3658
4289
  declare const LogBlockEvent: Set<string>;
3659
4290
  declare function getLogBlockLabel(message: unknown): string | undefined;
@@ -3720,32 +4351,110 @@ declare enum LoggerNames {
3720
4351
  }
3721
4352
  declare const getLogger: (key: LoggerNames) => Log;
3722
4353
 
3723
- declare const httpRequest: (url: string, type: string) => any;
4354
+ type HttpRequestOptions = {
4355
+ /** Axios adapter-defined request timeout retained for existing opt-in callers. */
4356
+ timeoutMs?: number;
4357
+ /** Deadline for DNS, connection, TLS, redirects, and the first response-body progress. */
4358
+ connectTimeoutMs?: number;
4359
+ /** Maximum idle interval between response-body progress events. */
4360
+ readTimeoutMs?: number;
4361
+ /** Wall-clock deadline across all attempts and retry backoff. */
4362
+ overallTimeoutMs?: number;
4363
+ maxRetries?: number;
4364
+ retryDelayMs?: number;
4365
+ };
4366
+
4367
+ declare const httpRequest: (url: string, type: string, options?: HttpRequestOptions) => any;
3724
4368
  declare const getTimeStamp: () => number;
3725
4369
 
4370
+ /**
4371
+ * Validates version string
4372
+ * @param {string} version Version string
4373
+ * @returns {boolean} True if version string is valid, false if not
4374
+ */
3726
4375
  declare const isValidVersionString: (version: string) => boolean;
4376
+ /**
4377
+ * Validates a version array
4378
+ * @param {number[]} version Version array
4379
+ * @returns {boolean} True if version array is valid, false if not
4380
+ */
3727
4381
  declare const isValidVersionArray: (version: number[]) => boolean;
4382
+ /**
4383
+ * Fills the missing version numbers with zeros (ie: [1, 2] will become [1, 2, 0])
4384
+ * @param {number[]} version Version array
4385
+ * @returns {number[]} Version array with all positions filled
4386
+ */
3728
4387
  declare const normalizeVersionArray: (version: number[]) => number[];
4388
+ /**
4389
+ * Returns a valid version array from a version string
4390
+ * @param {string} version Version string
4391
+ * @returns {number[]} Version array
4392
+ */
3729
4393
  declare const versionSplit: (version: string) => number[];
4394
+ /**
4395
+ * Compares two versions and returns if the version is newer (1), older (-1) or equal (0).
4396
+ * @param {string | number[]} a Version to compare from
4397
+ * @param {string | number[]} b Version to compare with
4398
+ * @returns {number} Returns 1 if newer, -1 if older and 0 if equal
4399
+ */
3730
4400
  declare const versionCompare: (a: string | number[], b: string | number[]) => 0 | 1 | -1;
3731
4401
 
3732
- declare function patchFeatures(response: DefaultMessageResponse): TypedResponseMessage<"PassphraseState"> | TypedResponseMessage<"Address"> | TypedResponseMessage<"DevFirmwareInstallProgress"> | TypedResponseMessage<"Success"> | TypedResponseMessage<"DevFirmwareUpdateStatus"> | TypedResponseMessage<"AptosMessagePayload"> | TypedResponseMessage<"BinanceInputOutput"> | TypedResponseMessage<"BinanceCoin"> | TypedResponseMessage<"HDNodePathType"> | TypedResponseMessage<"HDNodeType"> | TypedResponseMessage<"MultisigRedeemScriptType"> | TypedResponseMessage<"TxRequestDetailsType"> | TypedResponseMessage<"TxRequestSerializedType"> | TypedResponseMessage<"TxInputType"> | TypedResponseMessage<"TxOutputBinType"> | TypedResponseMessage<"TxOutputType"> | TypedResponseMessage<"TxAckInputWrapper"> | TypedResponseMessage<"TxAckOutputWrapper"> | TypedResponseMessage<"PrevTx"> | TypedResponseMessage<"TxAckPrevInputWrapper"> | TypedResponseMessage<"PrevInput"> | TypedResponseMessage<"TxAckPrevOutputWrapper"> | TypedResponseMessage<"PrevOutput"> | TypedResponseMessage<"TxAckPrevExtraDataWrapper"> | TypedResponseMessage<"BIP32Address"> | TypedResponseMessage<"CardanoNativeScript"> | TypedResponseMessage<"CardanoBlockchainPointerType"> | TypedResponseMessage<"CardanoAddressParametersType"> | TypedResponseMessage<"CardanoPoolMetadataType"> | TypedResponseMessage<"CardanoPoolParametersType"> | TypedResponseMessage<"CardanoDRep"> | TypedResponseMessage<"CardanoCVoteRegistrationDelegation"> | TypedResponseMessage<"CardanoCVoteRegistrationParametersType"> | TypedResponseMessage<"IdentityType"> | TypedResponseMessage<"Path"> | TypedResponseMessage<"DnxTxKey"> | TypedResponseMessage<"DnxComputedKeyImage"> | TypedResponseMessage<"EmmcFile"> | TypedResponseMessage<"EosTxHeader"> | TypedResponseMessage<"EosActionCommon"> | TypedResponseMessage<"EosActionTransfer"> | TypedResponseMessage<"EosActionDelegate"> | TypedResponseMessage<"EosActionUndelegate"> | TypedResponseMessage<"EosActionRefund"> | TypedResponseMessage<"EosActionBuyRam"> | TypedResponseMessage<"EosActionBuyRamBytes"> | TypedResponseMessage<"EosActionSellRam"> | TypedResponseMessage<"EosActionVoteProducer"> | TypedResponseMessage<"EosActionUpdateAuth"> | TypedResponseMessage<"EosActionDeleteAuth"> | TypedResponseMessage<"EosActionLinkAuth"> | TypedResponseMessage<"EosActionUnlinkAuth"> | TypedResponseMessage<"EosActionNewAccount"> | TypedResponseMessage<"EosActionUnknown"> | TypedResponseMessage<"EosPermissionLevel"> | TypedResponseMessage<"EosAuthorizationKey"> | TypedResponseMessage<"EosAuthorizationAccount"> | TypedResponseMessage<"EosAuthorizationWait"> | TypedResponseMessage<"EosAsset"> | TypedResponseMessage<"EosAuthorization"> | TypedResponseMessage<"EthereumStructMemberOneKey"> | TypedResponseMessage<"EthereumFieldTypeOneKey"> | TypedResponseMessage<"EthereumDefinitions"> | TypedResponseMessage<"EthereumStructMember"> | TypedResponseMessage<"EthereumFieldType"> | TypedResponseMessage<"EthereumAccessListOneKey"> | TypedResponseMessage<"EthereumAuthorizationOneKey"> | TypedResponseMessage<"EthereumAuthorizationSignature"> | TypedResponseMessage<"EthereumAccessList"> | TypedResponseMessage<"FileInfo"> | TypedResponseMessage<"MoneroOutputEntry"> | TypedResponseMessage<"MoneroMultisigKLRki"> | TypedResponseMessage<"MoneroRctKeyPublic"> | TypedResponseMessage<"MoneroAccountPublicAddress"> | TypedResponseMessage<"MoneroTransactionData"> | TypedResponseMessage<"MoneroTransactionDestinationEntry"> | TypedResponseMessage<"MoneroTransactionRsigData"> | TypedResponseMessage<"MoneroTransactionSourceEntry"> | TypedResponseMessage<"MoneroRingCtSig"> | TypedResponseMessage<"MoneroSubAddressIndicesList"> | TypedResponseMessage<"MoneroTransferDetails"> | TypedResponseMessage<"MoneroExportedKeyImage"> | TypedResponseMessage<"NEMTransactionCommon"> | TypedResponseMessage<"NEMTransfer"> | TypedResponseMessage<"NEMProvisionNamespace"> | TypedResponseMessage<"NEMMosaicCreation"> | TypedResponseMessage<"NEMMosaicSupplyChange"> | TypedResponseMessage<"NEMAggregateModification"> | TypedResponseMessage<"NEMImportanceTransfer"> | TypedResponseMessage<"NEMMosaic"> | TypedResponseMessage<"NEMMosaicDefinition"> | TypedResponseMessage<"NEMCosignatoryModification"> | TypedResponseMessage<"RipplePayment"> | TypedResponseMessage<"SolanaTxATADetails"> | TypedResponseMessage<"SolanaTxExtraInfo"> | TypedResponseMessage<"StellarAsset"> | TypedResponseMessage<"TezosRevealOp"> | TypedResponseMessage<"TezosTransactionOp"> | TypedResponseMessage<"TezosOriginationOp"> | TypedResponseMessage<"TezosDelegationOp"> | TypedResponseMessage<"TezosProposalOp"> | TypedResponseMessage<"TezosBallotOp"> | TypedResponseMessage<"TezosContractID"> | TypedResponseMessage<"TezosParametersManager"> | TypedResponseMessage<"TezosManagerTransfer"> | TypedResponseMessage<"TronContract"> | TypedResponseMessage<"TronTransferContract"> | TypedResponseMessage<"TronVoteWitnessContract"> | TypedResponseMessage<"TronFreezeBalanceContract"> | TypedResponseMessage<"TronUnfreezeBalanceContract"> | TypedResponseMessage<"TronWithdrawBalanceContract"> | TypedResponseMessage<"TronTriggerSmartContract"> | TypedResponseMessage<"TronFreezeBalanceV2Contract"> | TypedResponseMessage<"TronUnfreezeBalanceV2Contract"> | TypedResponseMessage<"TronWithdrawExpireUnfreezeContract"> | TypedResponseMessage<"TronDelegateResourceContract"> | TypedResponseMessage<"TronUnDelegateResourceContract"> | TypedResponseMessage<"TronCancelAllUnfreezeV2Contract"> | TypedResponseMessage<"Vote"> | TypedResponseMessage<"CoinJoinRequest"> | TypedResponseMessage<"PaymentRequestMemo"> | TypedResponseMessage<"TextMemo"> | TypedResponseMessage<"RefundMemo"> | TypedResponseMessage<"CoinPurchaseMemo"> | TypedResponseMessage<"TxDetailsAmount"> | TypedResponseMessage<"TxDetailsNetwork"> | TypedResponseMessage<"TxDetailsAddress"> | TypedResponseMessage<"TxDetailsGeneral"> | TypedResponseMessage<"DevFirmwareImageInfo"> | TypedResponseMessage<"DevInfoTargets"> | TypedResponseMessage<"DevInfoTypes"> | TypedResponseMessage<"DevHardwareInfo"> | TypedResponseMessage<"DevMainMcuInfo"> | TypedResponseMessage<"DevBluetoothInfo"> | TypedResponseMessage<"DevSEInfo"> | TypedResponseMessage<"DevStatus"> | TypedResponseMessage<"DevFirmwareTarget"> | TypedResponseMessage<"DevFirmwareUpdateStatusEntry"> | TypedResponseMessage<"FilesystemFile"> | TypedResponseMessage<"Setup"> | TypedResponseMessage<"NewDevice"> | TypedResponseMessage<"Restore"> | TypedResponseMessage<"DeviceFirmwareTarget"> | TypedResponseMessage<"DeviceFirmwareUpdateStatusEntry"> | 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<"SetBusy"> | TypedResponseMessage<"GetFirmwareHash"> | TypedResponseMessage<"FirmwareHash"> | TypedResponseMessage<"GetNonce"> | TypedResponseMessage<"Nonce"> | TypedResponseMessage<"WriteSEPrivateKey"> | TypedResponseMessage<"UnlockPath"> | TypedResponseMessage<"UnlockedPathRequest"> | TypedResponseMessage<"TxDetailsPage"> | TypedResponseMessage<"GetProtoVersion"> | TypedResponseMessage<"ProtoVersion"> | TypedResponseMessage<"DevReboot"> | TypedResponseMessage<"DeviceReboot"> | TypedResponseMessage<"DevGetDeviceInfo"> | TypedResponseMessage<"DeviceGetDeviceInfo"> | TypedResponseMessage<"DevFirmwareUpdate"> | TypedResponseMessage<"DeviceFirmwareUpdate"> | TypedResponseMessage<"DeviceFirmwareInstallProgress"> | TypedResponseMessage<"DevGetFirmwareUpdateStatus"> | TypedResponseMessage<"DeviceGetFirmwareUpdateStatus"> | TypedResponseMessage<"DeviceFirmwareUpdateStatus"> | TypedResponseMessage<"FactoryDeviceInfoSettings"> | TypedResponseMessage<"FactoryGetDeviceInfo"> | TypedResponseMessage<"FactoryDeviceInfo"> | TypedResponseMessage<"FilesystemFixPermission"> | TypedResponseMessage<"FilesystemPathInfo"> | TypedResponseMessage<"FilesystemPathInfoQuery"> | TypedResponseMessage<"FilesystemFileRead"> | TypedResponseMessage<"FilesystemFileWrite"> | TypedResponseMessage<"FilesystemFileDelete"> | TypedResponseMessage<"FilesystemDir"> | TypedResponseMessage<"FilesystemDirList"> | TypedResponseMessage<"FilesystemDirMake"> | TypedResponseMessage<"FilesystemDirRemove"> | TypedResponseMessage<"FilesystemFormat"> | TypedResponseMessage<"GetOnboardingStatus"> | TypedResponseMessage<"OnboardingStatus">;
4402
+ declare function patchFeatures(response: DefaultMessageResponse): TypedResponseMessage<"DeviceStatus"> | TypedResponseMessage<"DeviceSession"> | TypedResponseMessage<"PassphraseState"> | TypedResponseMessage<"Address"> | TypedResponseMessage<"DeviceFirmwareUpdateStatus"> | TypedResponseMessage<"Success"> | TypedResponseMessage<"AptosMessagePayload"> | TypedResponseMessage<"BinanceInputOutput"> | TypedResponseMessage<"BinanceCoin"> | TypedResponseMessage<"HDNodePathType"> | TypedResponseMessage<"HDNodeType"> | TypedResponseMessage<"MultisigRedeemScriptType"> | TypedResponseMessage<"TxRequestDetailsType"> | TypedResponseMessage<"TxRequestSerializedType"> | TypedResponseMessage<"TxInputType"> | TypedResponseMessage<"TxOutputBinType"> | TypedResponseMessage<"TxOutputType"> | TypedResponseMessage<"TxAckInputWrapper"> | TypedResponseMessage<"TxAckOutputWrapper"> | TypedResponseMessage<"PrevTx"> | TypedResponseMessage<"TxAckPrevInputWrapper"> | TypedResponseMessage<"PrevInput"> | TypedResponseMessage<"TxAckPrevOutputWrapper"> | TypedResponseMessage<"PrevOutput"> | TypedResponseMessage<"TxAckPrevExtraDataWrapper"> | TypedResponseMessage<"BIP32Address"> | TypedResponseMessage<"CardanoNativeScript"> | TypedResponseMessage<"CardanoBlockchainPointerType"> | TypedResponseMessage<"CardanoAddressParametersType"> | TypedResponseMessage<"CardanoPoolMetadataType"> | TypedResponseMessage<"CardanoPoolParametersType"> | TypedResponseMessage<"CardanoDRep"> | TypedResponseMessage<"CardanoCVoteRegistrationDelegation"> | TypedResponseMessage<"CardanoCVoteRegistrationParametersType"> | TypedResponseMessage<"IdentityType"> | TypedResponseMessage<"Path"> | TypedResponseMessage<"DnxTxKey"> | TypedResponseMessage<"DnxComputedKeyImage"> | TypedResponseMessage<"EmmcFile"> | TypedResponseMessage<"EosTxHeader"> | TypedResponseMessage<"EosActionCommon"> | TypedResponseMessage<"EosActionTransfer"> | TypedResponseMessage<"EosActionDelegate"> | TypedResponseMessage<"EosActionUndelegate"> | TypedResponseMessage<"EosActionRefund"> | TypedResponseMessage<"EosActionBuyRam"> | TypedResponseMessage<"EosActionBuyRamBytes"> | TypedResponseMessage<"EosActionSellRam"> | TypedResponseMessage<"EosActionVoteProducer"> | TypedResponseMessage<"EosActionUpdateAuth"> | TypedResponseMessage<"EosActionDeleteAuth"> | TypedResponseMessage<"EosActionLinkAuth"> | TypedResponseMessage<"EosActionUnlinkAuth"> | TypedResponseMessage<"EosActionNewAccount"> | TypedResponseMessage<"EosActionUnknown"> | TypedResponseMessage<"EosPermissionLevel"> | TypedResponseMessage<"EosAuthorizationKey"> | TypedResponseMessage<"EosAuthorizationAccount"> | TypedResponseMessage<"EosAuthorizationWait"> | TypedResponseMessage<"EosAsset"> | TypedResponseMessage<"EosAuthorization"> | TypedResponseMessage<"EthereumStructMemberOneKey"> | TypedResponseMessage<"EthereumFieldTypeOneKey"> | TypedResponseMessage<"EthereumDefinitions"> | TypedResponseMessage<"EthereumStructMember"> | TypedResponseMessage<"EthereumFieldType"> | TypedResponseMessage<"EthereumAccessListOneKey"> | TypedResponseMessage<"EthereumAuthorizationOneKey"> | TypedResponseMessage<"EthereumAuthorizationSignature"> | TypedResponseMessage<"EthereumAccessList"> | TypedResponseMessage<"KaspaTxRequestSignature"> | TypedResponseMessage<"KaspaOutpoint"> | TypedResponseMessage<"FileInfo"> | TypedResponseMessage<"MoneroOutputEntry"> | TypedResponseMessage<"MoneroMultisigKLRki"> | TypedResponseMessage<"MoneroRctKeyPublic"> | TypedResponseMessage<"MoneroAccountPublicAddress"> | TypedResponseMessage<"MoneroTransactionData"> | TypedResponseMessage<"MoneroTransactionDestinationEntry"> | TypedResponseMessage<"MoneroTransactionRsigData"> | TypedResponseMessage<"MoneroTransactionSourceEntry"> | TypedResponseMessage<"MoneroRingCtSig"> | TypedResponseMessage<"MoneroSubAddressIndicesList"> | TypedResponseMessage<"MoneroTransferDetails"> | TypedResponseMessage<"MoneroExportedKeyImage"> | TypedResponseMessage<"NEMTransactionCommon"> | TypedResponseMessage<"NEMTransfer"> | TypedResponseMessage<"NEMProvisionNamespace"> | TypedResponseMessage<"NEMMosaicCreation"> | TypedResponseMessage<"NEMMosaicSupplyChange"> | TypedResponseMessage<"NEMAggregateModification"> | TypedResponseMessage<"NEMImportanceTransfer"> | TypedResponseMessage<"NEMMosaic"> | TypedResponseMessage<"NEMMosaicDefinition"> | TypedResponseMessage<"NEMCosignatoryModification"> | TypedResponseMessage<"RipplePayment"> | TypedResponseMessage<"SolanaTxATADetails"> | TypedResponseMessage<"SolanaTxExtraInfo"> | TypedResponseMessage<"StellarAsset"> | TypedResponseMessage<"TezosRevealOp"> | TypedResponseMessage<"TezosTransactionOp"> | TypedResponseMessage<"TezosOriginationOp"> | TypedResponseMessage<"TezosDelegationOp"> | TypedResponseMessage<"TezosProposalOp"> | TypedResponseMessage<"TezosBallotOp"> | TypedResponseMessage<"TezosContractID"> | TypedResponseMessage<"TezosParametersManager"> | TypedResponseMessage<"TezosManagerTransfer"> | TypedResponseMessage<"TronContract"> | TypedResponseMessage<"TronTransferContract"> | TypedResponseMessage<"TronVoteWitnessContract"> | TypedResponseMessage<"TronFreezeBalanceContract"> | TypedResponseMessage<"TronUnfreezeBalanceContract"> | TypedResponseMessage<"TronWithdrawBalanceContract"> | TypedResponseMessage<"TronTriggerSmartContract"> | TypedResponseMessage<"TronFreezeBalanceV2Contract"> | TypedResponseMessage<"TronUnfreezeBalanceV2Contract"> | TypedResponseMessage<"TronWithdrawExpireUnfreezeContract"> | TypedResponseMessage<"TronDelegateResourceContract"> | TypedResponseMessage<"TronUnDelegateResourceContract"> | TypedResponseMessage<"TronCancelAllUnfreezeV2Contract"> | TypedResponseMessage<"Vote"> | TypedResponseMessage<"CoinJoinRequest"> | TypedResponseMessage<"PaymentRequestMemo"> | TypedResponseMessage<"TextMemo"> | TypedResponseMessage<"RefundMemo"> | TypedResponseMessage<"CoinPurchaseMemo"> | TypedResponseMessage<"ViewAmount"> | TypedResponseMessage<"ViewDetail"> | TypedResponseMessage<"ViewTip"> | TypedResponseMessage<"ViewRawData"> | TypedResponseMessage<"DeviceSettings"> | TypedResponseMessage<"DeviceCertificate"> | TypedResponseMessage<"DeviceFirmwareTarget"> | TypedResponseMessage<"DeviceFirmwareUpdateRecordFields"> | TypedResponseMessage<"DeviceFirmwareUpdateRecord"> | TypedResponseMessage<"DeviceFactoryInfoManufactureTime"> | TypedResponseMessage<"DeviceFactoryInfo"> | TypedResponseMessage<"DeviceFirmwareImageInfo"> | TypedResponseMessage<"DeviceInfoTargets"> | TypedResponseMessage<"DeviceInfoTypes"> | TypedResponseMessage<"DeviceHardwareInfo"> | TypedResponseMessage<"DeviceMainMcuInfo"> | TypedResponseMessage<"DeviceCoprocessorInfo"> | TypedResponseMessage<"DeviceSEInfo"> | TypedResponseMessage<"DevOnboardingSetupStatus"> | TypedResponseMessage<"FilesystemFile"> | TypedResponseMessage<"AlephiumGetAddress"> | TypedResponseMessage<"AlephiumAddress"> | TypedResponseMessage<"AlephiumSignTx"> | TypedResponseMessage<"AlephiumSignedTx"> | TypedResponseMessage<"AlephiumTxRequest"> | TypedResponseMessage<"AlephiumTxAck"> | TypedResponseMessage<"AlephiumBytecodeRequest"> | TypedResponseMessage<"AlephiumBytecodeAck"> | TypedResponseMessage<"AlephiumSignMessage"> | TypedResponseMessage<"AlephiumMessageSignature"> | TypedResponseMessage<"AlgorandGetAddress"> | TypedResponseMessage<"AlgorandAddress"> | TypedResponseMessage<"AlgorandSignTx"> | TypedResponseMessage<"AlgorandSignedTx"> | TypedResponseMessage<"AptosGetAddress"> | TypedResponseMessage<"AptosAddress"> | TypedResponseMessage<"AptosSignTx"> | TypedResponseMessage<"AptosSignedTx"> | TypedResponseMessage<"AptosSignMessage"> | TypedResponseMessage<"AptosMessageSignature"> | TypedResponseMessage<"AptosSignSIWAMessage"> | TypedResponseMessage<"BenfenGetAddress"> | TypedResponseMessage<"BenfenAddress"> | TypedResponseMessage<"BenfenSignTx"> | TypedResponseMessage<"BenfenSignedTx"> | TypedResponseMessage<"BenfenTxRequest"> | TypedResponseMessage<"BenfenTxAck"> | TypedResponseMessage<"BenfenSignMessage"> | TypedResponseMessage<"BenfenMessageSignature"> | TypedResponseMessage<"BinanceGetAddress"> | TypedResponseMessage<"BinanceAddress"> | TypedResponseMessage<"BinanceGetPublicKey"> | TypedResponseMessage<"BinancePublicKey"> | TypedResponseMessage<"BinanceSignTx"> | TypedResponseMessage<"BinanceTxRequest"> | TypedResponseMessage<"BinanceTransferMsg"> | TypedResponseMessage<"BinanceOrderMsg"> | TypedResponseMessage<"BinanceCancelMsg"> | TypedResponseMessage<"BinanceSignedTx"> | TypedResponseMessage<"GetPublicKey"> | TypedResponseMessage<"PublicKey"> | TypedResponseMessage<"GetAddress"> | TypedResponseMessage<"GetOwnershipId"> | TypedResponseMessage<"OwnershipId"> | TypedResponseMessage<"SignMessage"> | TypedResponseMessage<"MessageSignature"> | TypedResponseMessage<"VerifyMessage"> | TypedResponseMessage<"SignTx"> | TypedResponseMessage<"TxRequest"> | TypedResponseMessage<"TxAck"> | TypedResponseMessage<"TxAckInput"> | TypedResponseMessage<"TxAckOutput"> | TypedResponseMessage<"TxAckPrevMeta"> | TypedResponseMessage<"TxAckPrevInput"> | TypedResponseMessage<"TxAckPrevOutput"> | TypedResponseMessage<"TxAckPrevExtraData"> | TypedResponseMessage<"GetOwnershipProof"> | TypedResponseMessage<"OwnershipProof"> | TypedResponseMessage<"AuthorizeCoinJoin"> | TypedResponseMessage<"GetPublicKeyMultiple"> | TypedResponseMessage<"PublicKeyMultiple"> | TypedResponseMessage<"SignPsbt"> | TypedResponseMessage<"SignedPsbt"> | TypedResponseMessage<"FirmwareErase"> | TypedResponseMessage<"FirmwareRequest"> | TypedResponseMessage<"FirmwareUpload"> | TypedResponseMessage<"SelfTest"> | TypedResponseMessage<"FirmwareErase_ex"> | TypedResponseMessage<"Reboot"> | TypedResponseMessage<"FirmwareUpdateEmmc"> | TypedResponseMessage<"UpgradeFileHeader"> | TypedResponseMessage<"CardanoGetNativeScriptHash"> | TypedResponseMessage<"CardanoNativeScriptHash"> | TypedResponseMessage<"CardanoGetAddress"> | TypedResponseMessage<"CardanoAddress"> | TypedResponseMessage<"CardanoGetPublicKey"> | TypedResponseMessage<"CardanoPublicKey"> | TypedResponseMessage<"CardanoSignTxInit"> | TypedResponseMessage<"CardanoTxInput"> | TypedResponseMessage<"CardanoTxOutput"> | TypedResponseMessage<"CardanoAssetGroup"> | TypedResponseMessage<"CardanoToken"> | TypedResponseMessage<"CardanoTxInlineDatumChunk"> | TypedResponseMessage<"CardanoTxReferenceScriptChunk"> | TypedResponseMessage<"CardanoPoolOwner"> | TypedResponseMessage<"CardanoPoolRelayParameters"> | TypedResponseMessage<"CardanoTxCertificate"> | TypedResponseMessage<"CardanoTxWithdrawal"> | TypedResponseMessage<"CardanoTxAuxiliaryData"> | TypedResponseMessage<"CardanoTxMint"> | TypedResponseMessage<"CardanoTxCollateralInput"> | TypedResponseMessage<"CardanoTxRequiredSigner"> | TypedResponseMessage<"CardanoTxReferenceInput"> | TypedResponseMessage<"CardanoTxItemAck"> | TypedResponseMessage<"CardanoTxAuxiliaryDataSupplement"> | TypedResponseMessage<"CardanoTxWitnessRequest"> | TypedResponseMessage<"CardanoTxWitnessResponse"> | TypedResponseMessage<"CardanoTxHostAck"> | TypedResponseMessage<"CardanoTxBodyHash"> | TypedResponseMessage<"CardanoSignTxFinished"> | TypedResponseMessage<"CardanoSignMessage"> | TypedResponseMessage<"CardanoMessageSignature"> | TypedResponseMessage<"Failure"> | TypedResponseMessage<"ButtonRequest"> | TypedResponseMessage<"ButtonAck"> | TypedResponseMessage<"PinMatrixRequest"> | TypedResponseMessage<"PinMatrixAck"> | TypedResponseMessage<"PassphraseRequest"> | TypedResponseMessage<"PassphraseAck"> | TypedResponseMessage<"Deprecated_PassphraseStateRequest"> | TypedResponseMessage<"Deprecated_PassphraseStateAck"> | TypedResponseMessage<"BixinPinInputOnDevice"> | TypedResponseMessage<"ConfluxGetAddress"> | TypedResponseMessage<"ConfluxAddress"> | TypedResponseMessage<"ConfluxSignTx"> | TypedResponseMessage<"ConfluxTxRequest"> | TypedResponseMessage<"ConfluxTxAck"> | TypedResponseMessage<"ConfluxSignMessage"> | TypedResponseMessage<"ConfluxMessageSignature"> | TypedResponseMessage<"ConfluxSignMessageCIP23"> | TypedResponseMessage<"CosmosGetAddress"> | TypedResponseMessage<"CosmosAddress"> | TypedResponseMessage<"CosmosSignTx"> | TypedResponseMessage<"CosmosSignedTx"> | TypedResponseMessage<"CipherKeyValue"> | TypedResponseMessage<"CipheredKeyValue"> | TypedResponseMessage<"SignIdentity"> | TypedResponseMessage<"SignedIdentity"> | TypedResponseMessage<"GetECDHSessionKey"> | TypedResponseMessage<"ECDHSessionKey"> | TypedResponseMessage<"BatchGetPublickeys"> | TypedResponseMessage<"EcdsaPublicKeys"> | TypedResponseMessage<"DnxGetAddress"> | TypedResponseMessage<"DnxAddress"> | TypedResponseMessage<"DnxSignTx"> | TypedResponseMessage<"DnxInputRequest"> | TypedResponseMessage<"DnxInputAck"> | TypedResponseMessage<"DnxRTSigsRequest"> | TypedResponseMessage<"DnxSignedTx"> | TypedResponseMessage<"EmmcFixPermission"> | TypedResponseMessage<"EmmcPath"> | TypedResponseMessage<"EmmcPathInfo"> | TypedResponseMessage<"EmmcFileRead"> | TypedResponseMessage<"EmmcFileWrite"> | TypedResponseMessage<"EmmcFileDelete"> | TypedResponseMessage<"EmmcDir"> | TypedResponseMessage<"EmmcDirList"> | TypedResponseMessage<"EmmcDirMake"> | TypedResponseMessage<"EmmcDirRemove"> | TypedResponseMessage<"EosGetPublicKey"> | TypedResponseMessage<"EosPublicKey"> | TypedResponseMessage<"EosSignTx"> | TypedResponseMessage<"EosTxActionRequest"> | TypedResponseMessage<"EosTxActionAck"> | TypedResponseMessage<"EosSignedTx"> | TypedResponseMessage<"EthereumNetworkInfo"> | TypedResponseMessage<"EthereumTokenInfo"> | TypedResponseMessage<"EthereumSignTypedDataOneKey"> | TypedResponseMessage<"EthereumGnosisSafeTxRequest"> | TypedResponseMessage<"EthereumGnosisSafeTxAck"> | TypedResponseMessage<"EthereumTypedDataStructRequestOneKey"> | TypedResponseMessage<"EthereumTypedDataStructAckOneKey"> | TypedResponseMessage<"EthereumTypedDataValueRequestOneKey"> | TypedResponseMessage<"EthereumTypedDataValueAckOneKey"> | TypedResponseMessage<"EthereumSignTypedData"> | TypedResponseMessage<"EthereumTypedDataStructRequest"> | TypedResponseMessage<"EthereumTypedDataStructAck"> | TypedResponseMessage<"EthereumTypedDataValueRequest"> | TypedResponseMessage<"EthereumTypedDataValueAck"> | TypedResponseMessage<"EthereumGetPublicKeyOneKey"> | TypedResponseMessage<"EthereumPublicKeyOneKey"> | TypedResponseMessage<"EthereumGetAddressOneKey"> | TypedResponseMessage<"EthereumAddressOneKey"> | TypedResponseMessage<"EthereumSignTxOneKey"> | TypedResponseMessage<"EthereumSignTxEIP1559OneKey"> | TypedResponseMessage<"EthereumSignTxEIP7702OneKey"> | TypedResponseMessage<"EthereumTxRequestOneKey"> | TypedResponseMessage<"EthereumTxAckOneKey"> | TypedResponseMessage<"EthereumSignMessageOneKey"> | TypedResponseMessage<"EthereumMessageSignatureOneKey"> | TypedResponseMessage<"EthereumVerifyMessageOneKey"> | TypedResponseMessage<"EthereumSignTypedHashOneKey"> | TypedResponseMessage<"EthereumTypedDataSignatureOneKey"> | TypedResponseMessage<"EthereumSignMessageEIP712"> | TypedResponseMessage<"EthereumGetPublicKey"> | TypedResponseMessage<"EthereumPublicKey"> | TypedResponseMessage<"EthereumGetAddress"> | TypedResponseMessage<"EthereumAddress"> | TypedResponseMessage<"EthereumSignTx"> | TypedResponseMessage<"EthereumSignTxEIP1559"> | TypedResponseMessage<"EthereumTxRequest"> | TypedResponseMessage<"EthereumTxAck"> | TypedResponseMessage<"EthereumSignMessage"> | TypedResponseMessage<"EthereumMessageSignature"> | TypedResponseMessage<"EthereumVerifyMessage"> | TypedResponseMessage<"EthereumSignTypedHash"> | TypedResponseMessage<"EthereumTypedDataSignature"> | TypedResponseMessage<"FilecoinGetAddress"> | TypedResponseMessage<"FilecoinAddress"> | TypedResponseMessage<"FilecoinSignTx"> | TypedResponseMessage<"FilecoinSignedTx"> | TypedResponseMessage<"KaspaGetAddress"> | TypedResponseMessage<"KaspaAddress"> | TypedResponseMessage<"KaspaSignTx"> | TypedResponseMessage<"KaspaTxInputRequest"> | TypedResponseMessage<"KaspaTxInputAck"> | TypedResponseMessage<"KaspaTxRequest"> | TypedResponseMessage<"KaspaTxAckInput"> | TypedResponseMessage<"KaspaTxAckOutput"> | TypedResponseMessage<"KaspaTxAckPayloadChunk"> | TypedResponseMessage<"KaspaTxAckPrevMeta"> | TypedResponseMessage<"KaspaTxAckPrevInput"> | TypedResponseMessage<"KaspaTxAckPrevOutput"> | TypedResponseMessage<"KaspaSignedTx"> | TypedResponseMessage<"LnurlAuth"> | TypedResponseMessage<"LnurlAuthResp"> | TypedResponseMessage<"Initialize"> | TypedResponseMessage<"GetFeatures"> | TypedResponseMessage<"OnekeyGetFeatures"> | TypedResponseMessage<"Features"> | TypedResponseMessage<"OnekeyFeatures"> | TypedResponseMessage<"LockDevice"> | TypedResponseMessage<"EndSession"> | TypedResponseMessage<"ApplySettings"> | TypedResponseMessage<"ApplyFlags"> | TypedResponseMessage<"ChangePin"> | TypedResponseMessage<"ChangeWipeCode"> | TypedResponseMessage<"SdProtect"> | TypedResponseMessage<"Ping"> | TypedResponseMessage<"Cancel"> | TypedResponseMessage<"GetEntropy"> | TypedResponseMessage<"Entropy"> | TypedResponseMessage<"WipeDevice"> | TypedResponseMessage<"ResetDevice"> | TypedResponseMessage<"BackupDevice"> | TypedResponseMessage<"EntropyRequest"> | TypedResponseMessage<"EntropyAck"> | TypedResponseMessage<"RecoveryDevice"> | TypedResponseMessage<"WordRequest"> | TypedResponseMessage<"WordAck"> | TypedResponseMessage<"SetU2FCounter"> | TypedResponseMessage<"GetNextU2FCounter"> | TypedResponseMessage<"NextU2FCounter"> | TypedResponseMessage<"DoPreauthorized"> | TypedResponseMessage<"PreauthorizedRequest"> | TypedResponseMessage<"CancelAuthorization"> | TypedResponseMessage<"BixinSeedOperate"> | TypedResponseMessage<"BixinMessageSE"> | TypedResponseMessage<"BixinOutMessageSE"> | TypedResponseMessage<"DeviceBackToBoot"> | TypedResponseMessage<"BixinBackupRequest"> | TypedResponseMessage<"BixinBackupAck"> | TypedResponseMessage<"BixinRestoreRequest"> | TypedResponseMessage<"BixinRestoreAck"> | TypedResponseMessage<"BixinVerifyDeviceRequest"> | TypedResponseMessage<"BixinVerifyDeviceAck"> | TypedResponseMessage<"BixinWhiteListRequest"> | TypedResponseMessage<"BixinWhiteListAck"> | TypedResponseMessage<"BixinLoadDevice"> | TypedResponseMessage<"BixinBackupDevice"> | TypedResponseMessage<"BixinBackupDeviceAck"> | TypedResponseMessage<"DeviceInfoSettings"> | TypedResponseMessage<"GetDeviceInfo"> | TypedResponseMessage<"DeviceInfo"> | TypedResponseMessage<"ReadSEPublicKey"> | TypedResponseMessage<"SEPublicKey"> | TypedResponseMessage<"WriteSEPublicCert"> | TypedResponseMessage<"ReadSEPublicCert"> | TypedResponseMessage<"SEPublicCert"> | TypedResponseMessage<"SpiFlashWrite"> | TypedResponseMessage<"SpiFlashRead"> | TypedResponseMessage<"SpiFlashData"> | TypedResponseMessage<"SESignMessage"> | TypedResponseMessage<"SEMessageSignature"> | TypedResponseMessage<"ResourceUpload"> | TypedResponseMessage<"ZoomRequest"> | TypedResponseMessage<"BlurRequest"> | TypedResponseMessage<"ResourceRequest"> | TypedResponseMessage<"ResourceAck"> | TypedResponseMessage<"ResourceUpdate"> | TypedResponseMessage<"NFTWriteInfo"> | TypedResponseMessage<"NFTWriteData"> | TypedResponseMessage<"RebootToBootloader"> | TypedResponseMessage<"RebootToBoardloader"> | TypedResponseMessage<"ListResDir"> | TypedResponseMessage<"FileInfoList"> | TypedResponseMessage<"DeviceEraseSector"> | TypedResponseMessage<"UnLockDevice"> | TypedResponseMessage<"UnLockDeviceResponse"> | TypedResponseMessage<"GetPassphraseState"> | TypedResponseMessage<"MoneroGetAddress"> | TypedResponseMessage<"MoneroAddress"> | TypedResponseMessage<"MoneroGetWatchKey"> | TypedResponseMessage<"MoneroWatchKey"> | TypedResponseMessage<"MoneroTransactionInitRequest"> | TypedResponseMessage<"MoneroTransactionInitAck"> | TypedResponseMessage<"MoneroTransactionSetInputRequest"> | TypedResponseMessage<"MoneroTransactionSetInputAck"> | TypedResponseMessage<"MoneroTransactionInputsPermutationRequest"> | TypedResponseMessage<"MoneroTransactionInputsPermutationAck"> | TypedResponseMessage<"MoneroTransactionInputViniRequest"> | TypedResponseMessage<"MoneroTransactionInputViniAck"> | TypedResponseMessage<"MoneroTransactionAllInputsSetRequest"> | TypedResponseMessage<"MoneroTransactionAllInputsSetAck"> | TypedResponseMessage<"MoneroTransactionSetOutputRequest"> | TypedResponseMessage<"MoneroTransactionSetOutputAck"> | TypedResponseMessage<"MoneroTransactionAllOutSetRequest"> | TypedResponseMessage<"MoneroTransactionAllOutSetAck"> | TypedResponseMessage<"MoneroTransactionSignInputRequest"> | TypedResponseMessage<"MoneroTransactionSignInputAck"> | TypedResponseMessage<"MoneroTransactionFinalRequest"> | TypedResponseMessage<"MoneroTransactionFinalAck"> | TypedResponseMessage<"MoneroKeyImageExportInitRequest"> | TypedResponseMessage<"MoneroKeyImageExportInitAck"> | TypedResponseMessage<"MoneroKeyImageSyncStepRequest"> | TypedResponseMessage<"MoneroKeyImageSyncStepAck"> | TypedResponseMessage<"MoneroKeyImageSyncFinalRequest"> | TypedResponseMessage<"MoneroKeyImageSyncFinalAck"> | TypedResponseMessage<"MoneroGetTxKeyRequest"> | TypedResponseMessage<"MoneroGetTxKeyAck"> | TypedResponseMessage<"MoneroLiveRefreshStartRequest"> | TypedResponseMessage<"MoneroLiveRefreshStartAck"> | TypedResponseMessage<"MoneroLiveRefreshStepRequest"> | TypedResponseMessage<"MoneroLiveRefreshStepAck"> | TypedResponseMessage<"MoneroLiveRefreshFinalRequest"> | TypedResponseMessage<"MoneroLiveRefreshFinalAck"> | TypedResponseMessage<"NearGetAddress"> | TypedResponseMessage<"NearAddress"> | TypedResponseMessage<"NearSignTx"> | TypedResponseMessage<"NearSignedTx"> | TypedResponseMessage<"NEMGetAddress"> | TypedResponseMessage<"NEMAddress"> | TypedResponseMessage<"NEMSignTx"> | TypedResponseMessage<"NEMSignedTx"> | TypedResponseMessage<"NEMDecryptMessage"> | TypedResponseMessage<"NEMDecryptedMessage"> | TypedResponseMessage<"NeoGetAddress"> | TypedResponseMessage<"NeoAddress"> | TypedResponseMessage<"NeoSignTx"> | TypedResponseMessage<"NeoSignedTx"> | TypedResponseMessage<"NervosGetAddress"> | TypedResponseMessage<"NervosAddress"> | TypedResponseMessage<"NervosSignTx"> | TypedResponseMessage<"NervosSignedTx"> | TypedResponseMessage<"NervosTxRequest"> | TypedResponseMessage<"NervosTxAck"> | TypedResponseMessage<"NexaGetAddress"> | TypedResponseMessage<"NexaAddress"> | TypedResponseMessage<"NexaSignTx"> | TypedResponseMessage<"NexaTxInputRequest"> | TypedResponseMessage<"NexaTxInputAck"> | TypedResponseMessage<"NexaSignedTx"> | TypedResponseMessage<"NostrGetPublicKey"> | TypedResponseMessage<"NostrPublicKey"> | TypedResponseMessage<"NostrSignEvent"> | TypedResponseMessage<"NostrSignedEvent"> | TypedResponseMessage<"NostrSignSchnorr"> | TypedResponseMessage<"NostrSignedSchnorr"> | TypedResponseMessage<"NostrEncryptMessage"> | TypedResponseMessage<"NostrEncryptedMessage"> | TypedResponseMessage<"NostrDecryptMessage"> | TypedResponseMessage<"NostrDecryptedMessage"> | TypedResponseMessage<"PolkadotGetAddress"> | TypedResponseMessage<"PolkadotAddress"> | TypedResponseMessage<"PolkadotSignTx"> | TypedResponseMessage<"PolkadotSignedTx"> | TypedResponseMessage<"RippleGetAddress"> | TypedResponseMessage<"RippleAddress"> | TypedResponseMessage<"RippleSignTx"> | TypedResponseMessage<"RippleSignedTx"> | TypedResponseMessage<"ScdoGetAddress"> | TypedResponseMessage<"ScdoAddress"> | TypedResponseMessage<"ScdoSignTx"> | TypedResponseMessage<"ScdoSignedTx"> | TypedResponseMessage<"ScdoTxAck"> | TypedResponseMessage<"ScdoSignMessage"> | TypedResponseMessage<"ScdoSignedMessage"> | TypedResponseMessage<"SolanaGetAddress"> | TypedResponseMessage<"SolanaAddress"> | TypedResponseMessage<"SolanaSignTx"> | TypedResponseMessage<"SolanaSignedTx"> | TypedResponseMessage<"SolanaSignOffChainMessage"> | TypedResponseMessage<"SolanaSignUnsafeMessage"> | TypedResponseMessage<"SolanaMessageSignature"> | TypedResponseMessage<"StarcoinGetAddress"> | TypedResponseMessage<"StarcoinAddress"> | TypedResponseMessage<"StarcoinGetPublicKey"> | TypedResponseMessage<"StarcoinPublicKey"> | TypedResponseMessage<"StarcoinSignTx"> | TypedResponseMessage<"StarcoinSignedTx"> | TypedResponseMessage<"StarcoinSignMessage"> | TypedResponseMessage<"StarcoinMessageSignature"> | TypedResponseMessage<"StarcoinVerifyMessage"> | TypedResponseMessage<"StellarGetAddress"> | TypedResponseMessage<"StellarAddress"> | TypedResponseMessage<"StellarSignTx"> | TypedResponseMessage<"StellarTxOpRequest"> | TypedResponseMessage<"StellarPaymentOp"> | TypedResponseMessage<"StellarCreateAccountOp"> | TypedResponseMessage<"StellarPathPaymentStrictReceiveOp"> | TypedResponseMessage<"StellarPathPaymentStrictSendOp"> | TypedResponseMessage<"StellarManageSellOfferOp"> | TypedResponseMessage<"StellarManageBuyOfferOp"> | TypedResponseMessage<"StellarCreatePassiveSellOfferOp"> | TypedResponseMessage<"StellarSetOptionsOp"> | TypedResponseMessage<"StellarChangeTrustOp"> | TypedResponseMessage<"StellarAllowTrustOp"> | TypedResponseMessage<"StellarAccountMergeOp"> | TypedResponseMessage<"StellarManageDataOp"> | TypedResponseMessage<"StellarBumpSequenceOp"> | TypedResponseMessage<"StellarInvokeHostFunctionOp"> | TypedResponseMessage<"StellarSorobanDataRequest"> | TypedResponseMessage<"StellarSorobanDataAck"> | TypedResponseMessage<"StellarSignedTx"> | TypedResponseMessage<"SuiGetAddress"> | TypedResponseMessage<"SuiAddress"> | TypedResponseMessage<"SuiSignTx"> | TypedResponseMessage<"SuiSignedTx"> | TypedResponseMessage<"SuiTxRequest"> | TypedResponseMessage<"SuiTxAck"> | TypedResponseMessage<"SuiSignMessage"> | TypedResponseMessage<"SuiMessageSignature"> | TypedResponseMessage<"TezosGetAddress"> | TypedResponseMessage<"TezosAddress"> | TypedResponseMessage<"TezosGetPublicKey"> | TypedResponseMessage<"TezosPublicKey"> | TypedResponseMessage<"TezosSignTx"> | TypedResponseMessage<"TezosSignedTx"> | TypedResponseMessage<"TonGetAddress"> | TypedResponseMessage<"TonAddress"> | TypedResponseMessage<"TonSignMessage"> | TypedResponseMessage<"TonTxAck"> | TypedResponseMessage<"TonSignedMessage"> | TypedResponseMessage<"TonSignProof"> | TypedResponseMessage<"TonSignedProof"> | TypedResponseMessage<"TonSignData"> | TypedResponseMessage<"TonSignedData"> | TypedResponseMessage<"TronGetAddress"> | TypedResponseMessage<"TronAddress"> | TypedResponseMessage<"TronSignTx"> | TypedResponseMessage<"TronSignedTx"> | TypedResponseMessage<"TronSignMessage"> | TypedResponseMessage<"TronMessageSignature"> | TypedResponseMessage<"facotry"> | TypedResponseMessage<"experimental_message"> | TypedResponseMessage<"experimental_field"> | TypedResponseMessage<"TxAckPaymentRequest"> | TypedResponseMessage<"EthereumSignTypedDataQR"> | TypedResponseMessage<"InternalMyAddressRequest"> | TypedResponseMessage<"StartSession"> | TypedResponseMessage<"SetBusy"> | TypedResponseMessage<"GetFirmwareHash"> | TypedResponseMessage<"FirmwareHash"> | TypedResponseMessage<"GetNonce"> | TypedResponseMessage<"Nonce"> | TypedResponseMessage<"WriteSEPrivateKey"> | TypedResponseMessage<"SetWallpaper"> | TypedResponseMessage<"GetWallpaper"> | TypedResponseMessage<"Wallpaper"> | TypedResponseMessage<"UnlockPath"> | TypedResponseMessage<"UnlockedPathRequest"> | TypedResponseMessage<"ViewSignPage"> | TypedResponseMessage<"ViewVerifyPage"> | TypedResponseMessage<"ProtocolInfoRequest"> | TypedResponseMessage<"ProtocolInfo"> | TypedResponseMessage<"DeviceReboot"> | TypedResponseMessage<"DeviceSettingsGet"> | TypedResponseMessage<"DeviceSettingsSet"> | TypedResponseMessage<"DeviceSettingsPageShow"> | TypedResponseMessage<"DeviceCertificateWrite"> | TypedResponseMessage<"DeviceCertificateRead"> | TypedResponseMessage<"DeviceCertificateSignature"> | TypedResponseMessage<"DeviceCertificateSign"> | TypedResponseMessage<"DeviceFirmwareUpdateRequest"> | TypedResponseMessage<"DeviceFirmwareUpdateStatusGet"> | TypedResponseMessage<"DeviceFactoryInfoSet"> | TypedResponseMessage<"DeviceFactoryInfoGet"> | TypedResponseMessage<"DeviceFactoryPermanentLock"> | TypedResponseMessage<"DeviceFactoryTest"> | TypedResponseMessage<"DeviceInfoGet"> | TypedResponseMessage<"DeviceSessionGet"> | TypedResponseMessage<"DeviceSessionAskPin"> | TypedResponseMessage<"DeviceStatusGet"> | TypedResponseMessage<"DevGetOnboardingStatus"> | TypedResponseMessage<"DevOnboardingStatus"> | TypedResponseMessage<"FilesystemPermissionFix"> | TypedResponseMessage<"FilesystemPathInfo"> | TypedResponseMessage<"FilesystemPathInfoQuery"> | TypedResponseMessage<"FilesystemFileRead"> | TypedResponseMessage<"FilesystemFileWrite"> | TypedResponseMessage<"FilesystemFileDelete"> | TypedResponseMessage<"FilesystemDir"> | TypedResponseMessage<"FilesystemDirList"> | TypedResponseMessage<"FilesystemDirMake"> | TypedResponseMessage<"FilesystemDirRemove"> | TypedResponseMessage<"FilesystemFormat"> | TypedResponseMessage<"PortfolioUpdate">;
4403
+
4404
+ type DeviceFeaturesInput = Features | Messages.Features;
3733
4405
 
3734
- declare const getDeviceType: (features?: Features) => IDeviceType;
4406
+ /**
4407
+ * get device type by features
4408
+ */
4409
+ declare const getDeviceType: (features?: DeviceFeaturesInput) => IDeviceType;
4410
+ /**
4411
+ * get device type by ble name
4412
+ * @param name Ble name
4413
+ */
3735
4414
  declare const getDeviceTypeByBleName: (name?: string) => IDeviceType;
3736
- declare const getDeviceBleName: (features?: Features) => string | null;
3737
- declare const getDeviceUUID: (features: Features) => string;
3738
- declare const getDeviceLabel: (features?: Features) => string | null;
3739
- declare const getMethodVersionRange: (features: Features | undefined, getVersionRange: (deviceModel: IDeviceType | IDeviceModel) => IVersionRange | undefined) => IVersionRange | undefined;
4415
+ /**
4416
+ * Get Connected Device ble name by features
4417
+ * @returns
4418
+ */
4419
+ declare const getDeviceBleName: (features?: DeviceFeaturesInput) => string | null;
4420
+ /**
4421
+ * Get Connected Device serial number by features
4422
+ */
4423
+ declare const getDeviceSerialNo: (features?: DeviceFeaturesInput) => string;
4424
+ /**
4425
+ * @deprecated Use getDeviceSerialNo instead.
4426
+ */
4427
+ declare const getDeviceUUID: (features?: DeviceFeaturesInput) => string;
4428
+ /**
4429
+ * Get Connected Device label by features
4430
+ */
4431
+ declare const getDeviceLabel: (features?: DeviceFeaturesInput) => string | null;
4432
+ /**
4433
+ * Get firmware version range by features
4434
+ * Type has a higher priority than Model
4435
+ */
4436
+ declare const getMethodVersionRange: (features: DeviceFeaturesInput | undefined, getVersionRange: (deviceModel: IDeviceType | IDeviceModel) => IVersionRange | undefined) => IVersionRange | undefined;
3740
4437
  declare const isMethodVersionRangeUnsupported: (versionRange?: IVersionRange) => boolean;
3741
- declare const getFirmwareType: (features: Features | undefined) => EFirmwareType;
3742
-
3743
- declare const getDeviceFirmwareVersion: (features: Features | undefined) => IVersionArray;
3744
- declare const getDeviceBLEFirmwareVersion: (features: Features) => IVersionArray;
3745
- declare const getDeviceBootloaderVersion: (features: Features | undefined) => IVersionArray;
3746
- declare const getDeviceBoardloaderVersion: (features: Features) => IVersionArray;
3747
-
3748
- declare const FIRMWARE_FIELDS: readonly ["firmware", "firmware-v2", "firmware-v8", "firmware-btc-v8"];
4438
+ declare const getFirmwareType: (features?: DeviceFeaturesInput) => _onekeyfe_hd_shared.EFirmwareType;
4439
+
4440
+ /**
4441
+ * Get Connected Device version by features
4442
+ */
4443
+ declare const getDeviceFirmwareVersion: (features?: DeviceFeaturesInput) => IVersionArray;
4444
+ /**
4445
+ * Get Connected Device bootloader version by features
4446
+ */
4447
+ declare const getDeviceBootloaderVersion: (features?: DeviceFeaturesInput) => IVersionArray;
4448
+ /**
4449
+ * Get Connected Device boardloader/romloader version by features
4450
+ */
4451
+ declare const getDeviceBoardloaderVersion: (features?: DeviceFeaturesInput) => IVersionArray;
4452
+ /**
4453
+ * Get Connected Device bluetooth firmware version by features
4454
+ */
4455
+ declare const getDeviceBLEFirmwareVersion: (features?: DeviceFeaturesInput) => IVersionArray;
4456
+
4457
+ declare const FIRMWARE_FIELDS: readonly ["firmware", "firmware-v1", "firmware-v2", "firmware-v8", "firmware-btc-v8"];
3749
4458
  type IFirmwareField = (typeof FIRMWARE_FIELDS)[number];
3750
4459
  type ProtocolV1MessageSchema = 'v1CurrentSchema' | 'v1LegacySchema';
3751
4460
  type ProtobufMessageSchema = ProtocolV1MessageSchema | 'v2Schema';
@@ -3760,11 +4469,19 @@ declare class DataManager {
3760
4469
  };
3761
4470
  static lastCheckTimestamp: number;
3762
4471
  static getFirmwareStatus: (features: Features, firmwareType: EFirmwareType) => IDeviceFirmwareStatus;
4472
+ /**
4473
+ * Touch、Pro System UI Resource Update
4474
+ * ** Interval upgrade is not considered **
4475
+ */
3763
4476
  static getSysResourcesLatestRelease: ({ features, forcedUpdateRes, firmwareType, }: {
3764
4477
  features: Features;
3765
4478
  forcedUpdateRes?: boolean | undefined;
3766
4479
  firmwareType: EFirmwareType;
3767
4480
  }) => string | undefined;
4481
+ /**
4482
+ * Touch、Pro System full UI Resource Update
4483
+ * ** Interval upgrade is not considered **
4484
+ */
3768
4485
  static getSysFullResource: (features: Features, firmwareType: EFirmwareType) => string | undefined;
3769
4486
  static getBootloaderResource: (features: Features, firmwareType: EFirmwareType) => string | undefined;
3770
4487
  static getBootloaderTargetVersion: (features: Features, firmwareType: EFirmwareType) => IVersionArray | undefined;
@@ -3793,17 +4510,27 @@ declare class DataManager {
3793
4510
  static getSettings(key?: undefined): ConnectSettings;
3794
4511
  static getSettings<T extends keyof ConnectSettings>(key: T): ConnectSettings[T];
3795
4512
  static isBleConnect: (env: ConnectSettings['env']) => boolean;
4513
+ /** Desktop WebUSB doesn't need browser permission prompt */
3796
4514
  static isDesktopWebUsb: (env: ConnectSettings['env']) => boolean;
4515
+ /** Browser WebUSB needs permission prompt */
3797
4516
  static isBrowserWebUsb: (env: ConnectSettings['env']) => boolean;
3798
4517
  }
3799
4518
 
3800
- declare const supportInputPinOnSoftware: (features: Features) => SupportFeatureType;
4519
+ declare const supportInputPinOnSoftware: (features?: Features) => SupportFeatureType;
4520
+ /**
4521
+ * Since 3.5.0, Touch uses the firmware-v3 field to get firmware release info
4522
+ */
3801
4523
  declare const getFirmwareUpdateField: ({ features, updateType, targetVersion, firmwareType, }: {
3802
4524
  features: Features;
3803
4525
  updateType: 'firmware' | 'ble';
3804
4526
  targetVersion?: string | undefined;
3805
4527
  firmwareType: EFirmwareType;
3806
4528
  }) => 'ble' | IFirmwareField;
4529
+ /**
4530
+ * Returns the optional firmware version
4531
+ * Used in firmware web update
4532
+ * https://firmware.onekey.so/
4533
+ */
3807
4534
  declare const getFirmwareUpdateFieldArray: (features: Features, updateType: 'firmware' | 'ble' | 'bootloader') => ('ble' | IFirmwareField)[];
3808
4535
 
3809
4536
  declare function checkNeedUpdateBootForTouch(features: Features, firmwareType: EFirmwareType): boolean;
@@ -3813,15 +4540,40 @@ declare function checkNeedUpdateBootForClassicAndMini({ features, willUpdateFirm
3813
4540
  firmwareType: EFirmwareType;
3814
4541
  }): boolean;
3815
4542
 
4543
+ type DeviceSettingsProtocol = 'V1' | 'V2';
4544
+ type DeviceSettingsField = keyof DeviceSettingsParams;
4545
+ declare const DEVICE_SETTINGS_SHARED_FIELDS: readonly ["language", "label", "usePassphrase", "autoLockDelayMs", "autoShutdownDelayMs", "hapticFeedback", "bluetoothEnabled"];
4546
+ declare const DEVICE_SETTINGS_V1_ONLY_FIELDS: readonly ["homescreen", "passphraseSource", "displayRotation", "passphraseAlwaysOnDevice", "safetyChecks", "experimentalFeatures", "changeBrightness"];
4547
+ declare const DEVICE_SETTINGS_V2_ONLY_FIELDS: readonly ["brightness", "airgapMode", "animationEnabled", "tapToWake", "deviceNameDisplayEnabled", "fidoEnabled", "usbLockEnabled", "randomKeypad"];
4548
+ declare const PROTOCOL_V2_NEVER_TIMEOUT_MS = 268435456;
4549
+ declare const normalizeSafetyCheckLevel: (value: SafetyCheckLevel | null | undefined) => Enum_SafetyCheckLevel | null | undefined;
3816
4550
  declare const getLanguageConfig: (deviceType: IDeviceType) => Record<string, string>[];
3817
- type DurationParts = {
3818
- seconds: number;
3819
- minute: number;
3820
- hour: number;
3821
- day: number;
4551
+ type DeviceSettingsDurationOption = {
4552
+ label: string;
4553
+ valueMs: number;
4554
+ };
4555
+ type DeviceSettingsValueOption<T> = {
4556
+ label: string;
4557
+ value: T;
4558
+ };
4559
+ declare const getAutoLockOptions: (deviceType: IDeviceType, protocol: DeviceSettingsProtocol) => DeviceSettingsDurationOption[];
4560
+ declare const getAutoShutDownOptions: (deviceType: IDeviceType, protocol: DeviceSettingsProtocol) => DeviceSettingsDurationOption[];
4561
+ type DeviceSettingsCapabilities = {
4562
+ protocol: DeviceSettingsProtocol;
4563
+ supportedFields: readonly DeviceSettingsField[];
4564
+ languageOptions: ReadonlyArray<Record<string, string>>;
4565
+ autoLockDelayOptions: readonly DeviceSettingsDurationOption[];
4566
+ autoShutdownDelayOptions: readonly DeviceSettingsDurationOption[];
4567
+ ranges: {
4568
+ brightness?: {
4569
+ min: number;
4570
+ max: number;
4571
+ };
4572
+ };
4573
+ safetyCheckOptions: ReadonlyArray<DeviceSettingsValueOption<Enum_SafetyCheckLevel>>;
4574
+ onDeviceConfirmationFields: readonly DeviceSettingsField[];
3822
4575
  };
3823
- declare const getAutoLockOptions: (_deviceType: IDeviceType) => DurationParts[];
3824
- declare const getAutoShutDownOptions: (_deviceType: IDeviceType) => DurationParts[];
4576
+ declare const getDeviceSettingsCapabilities: (deviceType: IDeviceType, protocol: DeviceSettingsProtocol) => DeviceSettingsCapabilities;
3825
4577
 
3826
4578
  declare const getHDPath: (path: string) => Array<number>;
3827
4579
  declare const getScriptType: (path: Array<number>) => InputScriptType;
@@ -3862,4 +4614,4 @@ declare const HardwareSdk: ({ init, call, dispose, eventEmitter, uiResponse, can
3862
4614
  declare const HardwareSDKLowLevel: ({ init, call, dispose, eventEmitter, addHardwareGlobalEventListener, uiResponse, cancel, updateSettings, switchTransport, }: LowLevelInjectApi) => LowLevelCoreApi;
3863
4615
  declare const HardwareTopLevelSdk: () => CoreApi;
3864
4616
 
3865
- export { AccountAddress, AccountAddresses, AlephiumAddress, AlephiumGetAddressParams, AlephiumSignMessageParams, AlephiumSignTransactionParams, AlephiumSignedTx, AlgoAddress, AlgoGetAddressParams, AlgoSignTransactionParams, AlgoSignedTx, AllFirmwareRelease, AllNetworkAddressParams, AllNetworkGetAddressParams, AptosAddress, AptosGetAddressParams, AptosGetPublicKeyParams, AptosMessageSignature, AptosPublicKey, AptosSignInMessageParams, AptosSignInMessageSignature, AptosSignMessageParams, AptosSignTransactionParams, AptosSignedTx, AssetsMap, BTCAddress, BTCGetAddressParams, BTCGetPublicKeyParams, BTCPublicKey, BTCSignMessageParams, BTCSignTransactionParams, BTCVerifyMessageParams, BenfenAddress, BenfenGetAddressParams, BenfenGetPublicKeyParams, BenfenPublicKey, BenfenSignMessageParams, BenfenSignTransactionParams, BenfenSignedTx, BleReleaseInfoEvent, BleReleaseInfoPayload, CORE_EVENT, CallMethod, CallMethodAnyResponse, CallMethodKeys, CallMethodPayload, CallMethodResponse, CallMethodUnion, CardanoAddress, CardanoGetAddressMethodParams, CardanoGetAddressParams, CardanoSignMessageMethodParams, CardanoSignMessageParams, CardanoSignTransaction, CardanoSignedTxData, CipheredKeyValue, CipheredKeyValueParams, CommonParams, ConfluxAddress, ConfluxGetAddressParams, ConfluxSignMessageCIP23Params, ConfluxSignMessageParams, ConfluxSignTransactionParams, ConfluxSignedTx, ConfluxTransaction, ConnectSettings, Core, CoreApi, CoreMessage, CosmosAddress, CosmosGetAddressParams, CosmosGetPublicKeyParams, CosmosPublicKey, CosmosSignTransactionParams, CosmosSignedTx, DEFAULT_PRIORITY, DEVICE, DEVICE_EVENT, DataManager, Device, DeviceButtonRequest, DeviceButtonRequestPayload, DeviceChangePinParams, DeviceConnnectRequest, DeviceDisconnnectRequest, DeviceEvent, DeviceEventListenerFn, DeviceEventMessage, DeviceFeaturesMode, DeviceFeaturesPayload, DeviceFeaturesProtocol, DeviceFeaturesRaw, DeviceFeaturesVerify, DeviceFirmwareRange, DeviceFlagsParams, DeviceInfoMode, DeviceInfoProtocol, DeviceInfoScope, DeviceInfoSource, DeviceInfoStatus, DeviceModelToTypes, DeviceProfile, DeviceProfileRaw, DeviceProfileVerify, DeviceProfileVersions, DeviceProgress, DeviceRecoveryParams, DeviceResetParams, DeviceSendFeatures, DeviceSendSupportFeatures, DeviceSettingsParams, DeviceStatus, DeviceSupportFeatures, DeviceSupportFeaturesPayload, DeviceTypeMap, DeviceTypeToModels, DeviceUploadResourceParams, DeviceUploadResourceResponse, DeviceVerifyParams, DeviceVerifySignature, DnxAddress, DnxGetAddressParams, DnxSignTransactionParams, DnxSignature, DnxTxKey, EOneKeyDeviceMode, EVMAccessList, EVMAddress, EVMAuthorization, EVMAuthorizationSignature, EVMGetAddressParams, EVMGetPublicKeyParams, EVMPublicKey, EVMSignMessageEIP712Params, EVMSignMessageParams, EVMSignTransactionParams, EVMSignTypedDataParams, EVMSignedTx, EVMTransaction, EVMTransactionEIP1559, EVMTransactionEIP7702, EVMVerifyMessageParams, EthereumSignTypedDataMessage, EthereumSignTypedDataTypeProperty, EthereumSignTypedDataTypes, FIRMWARE, FIRMWARE_EVENT, Features, FilecoinAddress, FilecoinGetAddressParams, FilecoinSignTransactionParams, FilecoinSignedTx, FirmwareEvent, FirmwareMessage, FirmwareProcessing, FirmwareProgress, FirmwareRange, FirmwareRelease, FirmwareTip, FirmwareUpdateBinaryParams, FirmwareUpdateParams, FirmwareUpdateTipMessage, FirmwareUpdateV3Params, FirmwareUpdateV4Params, GetDeviceInfoParams, GetPassphraseStateParams, GetPassphraseStatePayload, HardwareSDKLowLevel, HardwareTopLevelSdk, IBLEFirmwareReleaseInfo, IDeviceBLEFirmwareStatus, IDeviceFirmwareStatus, IDeviceModel, IDeviceType, IFRAME, IFirmwareField, IFirmwareReleaseInfo, IFirmwareUpdateProgressType, IFirmwareUpdateTipMessage, IFrameBridge, IFrameCallMessage, IFrameCallback, IFrameCallbackMessage, IFrameCancelMessage, IFrameEvent, IFrameEventMessage, IFrameInit, IFrameSwitchTransport, IFrameSwitchTransportMessage, ILocale, ITransportStatus, IVersionArray, IVersionRange, KaspaAddress, KaspaGetAddressParams, KaspaSignInputParams, KaspaSignOutputParams, KaspaSignTransactionParams, KaspaSignature, KnownDevice, LOG, LOG_EVENT, LogBlockEvent, LogEvent, LogEventMessage, LogOutput, LoggerNames, LowLevelCoreApi, LowLevelInjectApi, MajorVersion, MethodResponseMessage, NEMAddress, NEMAggregateModificationTransaction, NEMGetAddressParams, NEMImportanceTransaction, NEMMosaic, NEMMosaicCreationTransaction, NEMMultisigTransaction, NEMProvisionNamespaceTransaction, NEMSignTransactionParams, NEMSupplyChangeTransaction, NEMTransaction, NEMTransferTransaction, NearAddress, NearGetAddressParams, NearSignTransactionParams, NervosAddress, NervosGetAddressParams, NervosSignTransactionParams, NervosSignedTx, NexaAddress, NexaGetAddressParams, NexaSignInputParams, NexaSignOutputParams, NexaSignTransactionParams, NexaSignature, OnekeyFeatures, Params, PassphraseRequestPayload, PolkadotAddress, PolkadotGetAddressParams, PolkadotSignTransactionParams, PolkadotSignedTx, PostMessageEvent, PreviousAddressResult, RESPONSE_EVENT, RefTransaction, ReleaseInfo, ReleaseInfoEvent, ReleaseInfoPayload, RemoteConfigResponse, RequestContext, Response, ScdoAddress, ScdoGetAddressParams, ScdoSignMessageParams, ScdoSignTransactionParams, ScdoSignedTx, SdkTracingContext, SearchDevice, SignedTransaction, SolSignMessageParams, SolSignMessageResponse, SolSignOffchainMessageParams, SolSignOffchainMessageResponse, SolanaAddress, SolanaGetAddressParams, SolanaSignTransactionParams, SolanaSignedTx, StarcoinAddress, StarcoinGetAddressParams, StarcoinGetPublicKeyParams, StarcoinPublicKey, StarcoinSignMessageParams, StarcoinSignTransactionParams, StarcoinVerifyMessageParams, StellarAddress, StellarAsset, StellarGetAddressParams, StellarOperation, StellarSignTransactionParams, StellarTransaction, StrictFeatures, Success, SuiAddress, SuiGetAddressParams, SuiGetPublicKeyParams, SuiPublicKey, SuiSignMessageParams, SuiSignTransactionParams, SuiSignedTx, SupportFeatureType, SupportFeatures, TonAddress, TonGetAddressParams, TonSignDataParams, TonSignMessageParams, TonSignProofParams, TopLevelInjectApi, TransactionOptions, TransportReleaseStatus, TronAddress, TronDelegateResourceContract, TronFreezeBalanceV2Contract, TronGetAddressParams, TronSignMessageParams, TronSignTransactionParams, TronTransaction, TronTransactionContract, TronTransferContract, TronTriggerSmartContract, TronUnDelegateResourceContract, TronUnfreezeBalanceV2Contract, TronWithdrawBalanceContract, TronWithdrawExpireUnfreezeContract, UI_EVENT, UI_REQUEST, UI_RESPONSE, UiEvent, UiEventMessage, UiPromise, UiPromiseResponse, UiRequestButton, UiRequestDeviceAction, UiRequestFirmwareProgressing, UiRequestPassphrase, UiRequestPassphraseOnDevice, UiRequestSelectDeviceForSwitchFirmwareWebDevice, UiRequestSelectDeviceInBootloaderForWebDevice, UiRequestWithoutPayload, UiResponseEvent, UiResponseMessage, UiResponsePassphrase, UiResponsePin, UiResponseSelectDeviceForSwitchFirmwareWebDevice, UiResponseSelectDeviceInBootloaderForWebDevice, UnavailableCapabilities, UnavailableCapability, Unsuccessful, VersionArray, checkNeedUpdateBootForClassicAndMini, checkNeedUpdateBootForTouch, cleanupCallback, cleanupSdkInstance, completeRequestContext, corsValidator, createDeviceMessage, createErrorMessage, createFirmwareMessage, createIFrameMessage, createLogMessage, createRequestContext, createResponseMessage, createSdkTracingContext, createUiMessage, createUiResponse, HardwareSdk as default, enableLog, executeCallback, formatRequestContext, generateInstanceId, generateSdkInstanceId, getActiveRequestsByDeviceInstance, getAutoLockOptions, getAutoShutDownOptions, getDeviceBLEFirmwareVersion, getDeviceBleName, getDeviceBoardloaderVersion, getDeviceBootloaderVersion, getDeviceFirmwareVersion, getDeviceLabel, getDeviceType, getDeviceTypeByBleName, getDeviceUUID, getEnv, getFirmwareType, getFirmwareUpdateField, getFirmwareUpdateFieldArray, getHDPath, getHomeScreenDefaultList, getHomeScreenHex, getHomeScreenSize, getLanguageConfig, getLog, getLogBlockLabel, getLogger, getMethodVersionRange, getOutputScriptType, getSDKVersion, getScriptType, getTimeStamp, httpRequest, init$1 as initCore, isBleConnect, isMethodVersionRangeUnsupported, isValidVersionArray, isValidVersionString, normalizeVersionArray, parseConnectSettings, parseMessage, patchFeatures, preloadSessionCache, safeThrowError, setLoggerPostMessage, supportInputPinOnSoftware, switchTransport, transportEnv, updateRequestContext, versionCompare, versionSplit, wait, whitelist, whitelistExtension };
4617
+ 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, GetDeviceStateParams, GetPassphraseStateParams, 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, IProtocolV2ResourceBundle, ITransportStatus, IVersionArray, IVersionRange, KaspaAddress, KaspaGetAddressParams, KaspaSignInputParams, KaspaSignOutputParams, KaspaSignTransactionParams, KaspaSignature, KnownDevice, LOG, LOG_EVENT, LogBlockEvent, LogEvent, LogEventMessage, LogOutput, LoggerNames, LowLevelCoreApi, LowLevelInjectApi, MajorVersion, MethodResponseMessage, NEMAddress, NEMAggregateModificationTransaction, NEMGetAddressParams, NEMImportanceTransaction, NEMMosaic, NEMMosaicCreationTransaction, NEMMultisigTransaction, NEMProvisionNamespaceTransaction, NEMSignTransactionParams, NEMSupplyChangeTransaction, NEMTransaction, NEMTransferTransaction, NearAddress, NearGetAddressParams, NearSignTransactionParams, NervosAddress, NervosGetAddressParams, NervosSignTransactionParams, NervosSignedTx, NexaAddress, NexaGetAddressParams, NexaSignInputParams, NexaSignOutputParams, NexaSignTransactionParams, NexaSignature, NormalizedFeatures, OnekeyFeatures, OpenWalletSessionParams, OpenWalletSessionPayload, PRO2_WALLPAPER_HEIGHT, PRO2_WALLPAPER_WIDTH, PROTOCOL_V2_NEVER_TIMEOUT_MS, Params, PassphraseRequestPayload, PolkadotAddress, PolkadotGetAddressParams, PolkadotSignTransactionParams, PolkadotSignedTx, PostMessageEvent, PreviousAddressResult, Pro2WallpaperColorFormat, ProtocolV2UiCompletion, ProtocolV2UiEventMetadata, ProtocolV2UiEventSource, RESPONSE_EVENT, RefTransaction, ReleaseInfo, ReleaseInfoEvent, ReleaseInfoPayload, RemoteConfigResponse, RequestContext, Response, ScdoAddress, ScdoGetAddressParams, ScdoSignMessageParams, ScdoSignTransactionParams, ScdoSignedTx, SdkTracingContext, SearchDevice, SignedTransaction, SolSignMessageParams, SolSignMessageResponse, SolSignOffchainMessageParams, SolSignOffchainMessageResponse, SolanaAddress, SolanaGetAddressParams, SolanaSignTransactionParams, SolanaSignedTx, StarcoinAddress, StarcoinGetAddressParams, StarcoinGetPublicKeyParams, StarcoinPublicKey, StarcoinSignMessageParams, StarcoinSignTransactionParams, StarcoinVerifyMessageParams, StellarAddress, StellarAsset, StellarGetAddressParams, StellarOperation, StellarSignTransactionParams, StellarTransaction, StrictFeatures, Success, SuiAddress, SuiGetAddressParams, SuiGetPublicKeyParams, SuiPublicKey, SuiSignMessageParams, SuiSignTransactionParams, SuiSignedTx, SupportFeatureType, SupportFeatures, TonAddress, TonGetAddressParams, TonSignDataParams, TonSignMessageParams, TonSignProofParams, TopLevelInjectApi, TransactionOptions, TransportReleaseStatus, TronAddress, TronDelegateResourceContract, TronFreezeBalanceV2Contract, TronGetAddressParams, TronSignMessageParams, TronSignTransactionParams, TronTransaction, TronTransactionContract, TronTransferContract, TronTriggerSmartContract, TronUnDelegateResourceContract, TronUnfreezeBalanceV2Contract, TronWithdrawBalanceContract, TronWithdrawExpireUnfreezeContract, UI_EVENT, UI_REQUEST, UI_RESPONSE, UiEvent, UiEventMessage, UiPromise, UiPromiseResponse, UiRequestButton, UiRequestDeviceAction, UiRequestFirmwareProgressing, UiRequestPassphrase, UiRequestPassphraseOnDevice, UiRequestSelectDeviceForSwitchFirmwareWebDevice, UiRequestSelectDeviceInBootloaderForWebDevice, UiRequestWithoutPayload, UiResponseEvent, UiResponseMessage, UiResponsePassphrase, UiResponsePin, UiResponseSelectDeviceForSwitchFirmwareWebDevice, UiResponseSelectDeviceInBootloaderForWebDevice, UnavailableCapabilities, UnavailableCapability, Unsuccessful, VersionArray, checkNeedUpdateBootForClassicAndMini, checkNeedUpdateBootForTouch, cleanupCallback, cleanupSdkInstance, completeRequestContext, corsValidator, createDeviceMessage, createErrorMessage, createFirmwareMessage, createIFrameMessage, createLogMessage, createRequestContext, createResponseMessage, createSdkTracingContext, createUiMessage, createUiResponse, HardwareSdk as default, enableLog, encodePro2Wallpaper, executeCallback, formatRequestContext, generateInstanceId, generateSdkInstanceId, getActiveRequestsByDeviceInstance, getAutoLockOptions, getAutoShutDownOptions, getDeviceBLEFirmwareVersion, getDeviceBleName, getDeviceBoardloaderVersion, getDeviceBootloaderVersion, getDeviceFirmwareVersion, getDeviceLabel, getDeviceSerialNo, getDeviceSettingsCapabilities, 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, normalizeSafetyCheckLevel, normalizeVersionArray, parseConnectSettings, parseMessage, patchFeatures, preloadSessionCache, safeThrowError, setLoggerPostMessage, supportInputPinOnSoftware, switchTransport, transportEnv, updateRequestContext, versionCompare, versionSplit, wait, whitelist, whitelistExtension };