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

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 (434) 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__/RequestQueue.test.ts +140 -0
  5. package/__tests__/UploadPortfolio.test.ts +46 -0
  6. package/__tests__/connectSettings.test.ts +19 -0
  7. package/__tests__/core-dispose.test.ts +34 -0
  8. package/__tests__/core-error-output.test.ts +39 -0
  9. package/__tests__/device-features-state.test.ts +78 -0
  10. package/__tests__/device-identity.test.ts +30 -0
  11. package/__tests__/device-lifecycle-events.test.ts +117 -0
  12. package/__tests__/device-pool-state.test.ts +132 -0
  13. package/__tests__/device-settings.test.ts +286 -0
  14. package/__tests__/device-state-contract.test.ts +27 -0
  15. package/__tests__/device-state-events.test.ts +162 -0
  16. package/__tests__/device-state-mapper.test.ts +229 -0
  17. package/__tests__/device-state-projector.test.ts +94 -0
  18. package/__tests__/device-state-store.test.ts +82 -0
  19. package/__tests__/device-utils.test.ts +106 -0
  20. package/__tests__/device-wallet-session-store.test.ts +213 -0
  21. package/__tests__/deviceFeaturesUtils.test.ts +39 -0
  22. package/__tests__/deviceSettings.test.ts +63 -0
  23. package/__tests__/evmLedgerLegacySafety.test.ts +4 -1
  24. package/__tests__/evmSignTypedData.test.ts +80 -0
  25. package/__tests__/filesystemValidation.test.ts +53 -0
  26. package/__tests__/firmware-update/firmware-update-v2-download-before-boot.test.ts +402 -0
  27. package/__tests__/get-device-state.test.ts +403 -0
  28. package/__tests__/homescreen.test.ts +24 -0
  29. package/__tests__/kaspaSignTransaction.test.ts +591 -0
  30. package/__tests__/logBlockEvent.test.ts +26 -0
  31. package/__tests__/networkUtils.test.ts +386 -0
  32. package/__tests__/open-wallet-session-error-response.test.ts +43 -0
  33. package/__tests__/open-wallet-session.test.ts +559 -0
  34. package/__tests__/preInitialize.test.ts +33 -0
  35. package/__tests__/pro2Wallpaper.test.ts +50 -0
  36. package/__tests__/protocol-v2-bootloader-mode.test.ts +37 -0
  37. package/__tests__/protocol-v2-firmware-targets.test.ts +19 -0
  38. package/__tests__/protocol-v2.test.ts +4054 -1178
  39. package/__tests__/protocolV2FileWrite.test.ts +92 -0
  40. package/__tests__/protocolV2UiInteraction.test.ts +266 -0
  41. package/__tests__/public-device-state-api.test.ts +253 -0
  42. package/__tests__/public-pro2-api-boundary.test.ts +91 -0
  43. package/__tests__/refresh-device-state.test.ts +101 -0
  44. package/__tests__/request-context-logging.test.ts +16 -0
  45. package/__tests__/search-devices.test.ts +136 -0
  46. package/dist/api/BaseMethod.d.ts +11 -0
  47. package/dist/api/BaseMethod.d.ts.map +1 -1
  48. package/dist/api/CheckBootloaderRelease.d.ts.map +1 -1
  49. package/dist/api/CheckFirmwareRelease.d.ts.map +1 -1
  50. package/dist/api/ClearSessionCache.d.ts +9 -0
  51. package/dist/api/ClearSessionCache.d.ts.map +1 -0
  52. package/dist/api/DirList.d.ts.map +1 -1
  53. package/dist/api/FileRead.d.ts.map +1 -1
  54. package/dist/api/FileWrite.d.ts +1 -0
  55. package/dist/api/FileWrite.d.ts.map +1 -1
  56. package/dist/api/FirmwareUpdateV2.d.ts +2 -2
  57. package/dist/api/FirmwareUpdateV2.d.ts.map +1 -1
  58. package/dist/api/FirmwareUpdateV3.d.ts.map +1 -1
  59. package/dist/api/FirmwareUpdateV4.d.ts +25 -5
  60. package/dist/api/FirmwareUpdateV4.d.ts.map +1 -1
  61. package/dist/api/GetDeviceState.d.ts +7 -0
  62. package/dist/api/GetDeviceState.d.ts.map +1 -0
  63. package/dist/api/GetFeatures.d.ts +1 -1
  64. package/dist/api/GetFeatures.d.ts.map +1 -1
  65. package/dist/api/GetOnekeyFeatures.d.ts.map +1 -1
  66. package/dist/api/GetPassphraseState.d.ts +1 -6
  67. package/dist/api/GetPassphraseState.d.ts.map +1 -1
  68. package/dist/api/OpenWalletSession.d.ts +14 -0
  69. package/dist/api/OpenWalletSession.d.ts.map +1 -0
  70. package/dist/api/PathInfo.d.ts.map +1 -1
  71. package/dist/api/PromptWebDeviceAccess.d.ts.map +1 -1
  72. package/dist/api/SearchDevices.d.ts +3 -0
  73. package/dist/api/SearchDevices.d.ts.map +1 -1
  74. package/dist/api/UploadPortfolio.d.ts +18 -0
  75. package/dist/api/UploadPortfolio.d.ts.map +1 -0
  76. package/dist/api/allnetwork/AllNetworkGetAddressBase.d.ts.map +1 -1
  77. package/dist/api/device/DeviceCancel.d.ts.map +1 -1
  78. package/dist/api/device/DeviceChangePin.d.ts.map +1 -1
  79. package/dist/api/device/DeviceFullyUploadResource.d.ts +1 -2
  80. package/dist/api/device/DeviceFullyUploadResource.d.ts.map +1 -1
  81. package/dist/api/device/DeviceLock.d.ts.map +1 -1
  82. package/dist/api/device/DeviceRebootToBoardloader.d.ts.map +1 -1
  83. package/dist/api/device/DeviceRebootToBootloader.d.ts.map +1 -1
  84. package/dist/api/device/DeviceSettings.d.ts.map +1 -1
  85. package/dist/api/device/DeviceUnlock.d.ts.map +1 -1
  86. package/dist/api/device/DeviceUpdateBootloader.d.ts.map +1 -1
  87. package/dist/api/device/DeviceWipe.d.ts.map +1 -1
  88. package/dist/api/evm/EVMSignTypedData.d.ts.map +1 -1
  89. package/dist/api/firmware/FirmwareUpdateBaseMethod.d.ts +1 -0
  90. package/dist/api/firmware/FirmwareUpdateBaseMethod.d.ts.map +1 -1
  91. package/dist/api/firmware/getBinary.d.ts +11 -3
  92. package/dist/api/firmware/getBinary.d.ts.map +1 -1
  93. package/dist/api/firmware/progressThrottle.d.ts +3 -0
  94. package/dist/api/firmware/progressThrottle.d.ts.map +1 -0
  95. package/dist/api/helpers/filesystemValidation.d.ts +3 -0
  96. package/dist/api/helpers/filesystemValidation.d.ts.map +1 -1
  97. package/dist/api/helpers/paramsValidator.d.ts +1 -0
  98. package/dist/api/helpers/paramsValidator.d.ts.map +1 -1
  99. package/dist/api/helpers/protocolV2FileWrite.d.ts +33 -0
  100. package/dist/api/helpers/protocolV2FileWrite.d.ts.map +1 -0
  101. package/dist/api/index.d.ts +15 -19
  102. package/dist/api/index.d.ts.map +1 -1
  103. package/dist/api/kaspa/KaspaSignTransaction.d.ts +5 -1
  104. package/dist/api/kaspa/KaspaSignTransaction.d.ts.map +1 -1
  105. package/dist/api/kaspa/helpers/TransferSerialize.d.ts.map +1 -1
  106. package/dist/api/protocol-v2/DeviceFactoryInfoGet.d.ts +6 -0
  107. package/dist/api/protocol-v2/DeviceFactoryInfoGet.d.ts.map +1 -0
  108. package/dist/api/protocol-v2/DeviceFactoryInfoSet.d.ts +7 -0
  109. package/dist/api/protocol-v2/DeviceFactoryInfoSet.d.ts.map +1 -0
  110. package/dist/api/protocol-v2/DeviceFirmwareUpdate.d.ts +1 -1
  111. package/dist/api/protocol-v2/DeviceFirmwareUpdate.d.ts.map +1 -1
  112. package/dist/api/protocol-v2/DeviceGetFirmwareUpdateStatus.d.ts +3 -2
  113. package/dist/api/protocol-v2/DeviceGetFirmwareUpdateStatus.d.ts.map +1 -1
  114. package/dist/api/protocol-v2/DeviceGetOnboardingStatus.d.ts +1 -1
  115. package/dist/api/protocol-v2/DeviceGetOnboardingStatus.d.ts.map +1 -1
  116. package/dist/api/protocol-v2/DeviceInfoGet.d.ts +28 -0
  117. package/dist/api/protocol-v2/DeviceInfoGet.d.ts.map +1 -0
  118. package/dist/api/protocol-v2/DeviceReboot.d.ts.map +1 -1
  119. package/dist/api/protocol-v2/DeviceSettingsGet.d.ts +6 -0
  120. package/dist/api/protocol-v2/DeviceSettingsGet.d.ts.map +1 -0
  121. package/dist/api/protocol-v2/DeviceSettingsPageShow.d.ts +16 -0
  122. package/dist/api/protocol-v2/DeviceSettingsPageShow.d.ts.map +1 -0
  123. package/dist/api/protocol-v2/DeviceSettingsSet.d.ts +12 -0
  124. package/dist/api/protocol-v2/DeviceSettingsSet.d.ts.map +1 -0
  125. package/dist/api/protocol-v2/DeviceStatusGet.d.ts +6 -0
  126. package/dist/api/protocol-v2/DeviceStatusGet.d.ts.map +1 -0
  127. package/dist/api/protocol-v2/DeviceUploadWallpaper.d.ts +26 -0
  128. package/dist/api/protocol-v2/DeviceUploadWallpaper.d.ts.map +1 -0
  129. package/dist/api/protocol-v2/FilesystemFormat.d.ts.map +1 -1
  130. package/dist/api/protocol-v2/{FilesystemFixPermission.d.ts → FilesystemPermissionFix.d.ts} +2 -2
  131. package/dist/api/protocol-v2/FilesystemPermissionFix.d.ts.map +1 -0
  132. package/dist/api/protocol-v2/ProtocolInfoRequest.d.ts +6 -0
  133. package/dist/api/protocol-v2/ProtocolInfoRequest.d.ts.map +1 -0
  134. package/dist/api/protocol-v2/helpers.d.ts +27 -19
  135. package/dist/api/protocol-v2/helpers.d.ts.map +1 -1
  136. package/dist/api/ton/TonSignData.d.ts +1 -5
  137. package/dist/api/ton/TonSignData.d.ts.map +1 -1
  138. package/dist/api/utils.d.ts +2 -1
  139. package/dist/api/utils.d.ts.map +1 -1
  140. package/dist/constants/index.d.ts +2 -1
  141. package/dist/constants/index.d.ts.map +1 -1
  142. package/dist/core/RequestQueue.d.ts +19 -1
  143. package/dist/core/RequestQueue.d.ts.map +1 -1
  144. package/dist/core/deviceEventRegistration.d.ts +11 -0
  145. package/dist/core/deviceEventRegistration.d.ts.map +1 -0
  146. package/dist/core/index.d.ts +4 -1
  147. package/dist/core/index.d.ts.map +1 -1
  148. package/dist/data-manager/DataManager.d.ts +1 -1
  149. package/dist/data-manager/DataManager.d.ts.map +1 -1
  150. package/dist/data-manager/connectSettings.d.ts.map +1 -1
  151. package/dist/device/Device.d.ts +34 -10
  152. package/dist/device/Device.d.ts.map +1 -1
  153. package/dist/device/DeviceCommands.d.ts +8 -6
  154. package/dist/device/DeviceCommands.d.ts.map +1 -1
  155. package/dist/device/DeviceFeaturesState.d.ts +4 -0
  156. package/dist/device/DeviceFeaturesState.d.ts.map +1 -0
  157. package/dist/device/DevicePool.d.ts +4 -2
  158. package/dist/device/DevicePool.d.ts.map +1 -1
  159. package/dist/device/DeviceStateMapper.d.ts +13 -0
  160. package/dist/device/DeviceStateMapper.d.ts.map +1 -0
  161. package/dist/device/DeviceStateProjector.d.ts +7 -0
  162. package/dist/device/DeviceStateProjector.d.ts.map +1 -0
  163. package/dist/device/DeviceStateStore.d.ts +21 -0
  164. package/dist/device/DeviceStateStore.d.ts.map +1 -0
  165. package/dist/device/DeviceWalletSessionStore.d.ts +20 -0
  166. package/dist/device/DeviceWalletSessionStore.d.ts.map +1 -0
  167. package/dist/device/cloneDeviceState.d.ts +2 -0
  168. package/dist/device/cloneDeviceState.d.ts.map +1 -0
  169. package/dist/device/deviceIdentity.d.ts +5 -0
  170. package/dist/device/deviceIdentity.d.ts.map +1 -0
  171. package/dist/deviceProfile/buildDeviceFeatures.d.ts +9 -3
  172. package/dist/deviceProfile/buildDeviceFeatures.d.ts.map +1 -1
  173. package/dist/deviceProfile/index.d.ts +0 -1
  174. package/dist/deviceProfile/index.d.ts.map +1 -1
  175. package/dist/events/call.d.ts +7 -0
  176. package/dist/events/call.d.ts.map +1 -1
  177. package/dist/events/core.d.ts +2 -2
  178. package/dist/events/core.d.ts.map +1 -1
  179. package/dist/events/device.d.ts +11 -2
  180. package/dist/events/device.d.ts.map +1 -1
  181. package/dist/events/iframe.d.ts +1 -0
  182. package/dist/events/iframe.d.ts.map +1 -1
  183. package/dist/events/logBlockEvent.d.ts.map +1 -1
  184. package/dist/events/ui-request.d.ts +18 -2
  185. package/dist/events/ui-request.d.ts.map +1 -1
  186. package/dist/index.d.ts +1351 -603
  187. package/dist/index.d.ts.map +1 -1
  188. package/dist/index.js +5995 -2816
  189. package/dist/inject.d.ts +3 -2
  190. package/dist/inject.d.ts.map +1 -1
  191. package/dist/lowLevelInject.d.ts +2 -1
  192. package/dist/lowLevelInject.d.ts.map +1 -1
  193. package/dist/protocols/protocol-v2/deviceSession.d.ts +7 -0
  194. package/dist/protocols/protocol-v2/deviceSession.d.ts.map +1 -0
  195. package/dist/protocols/protocol-v2/features.d.ts +23 -28
  196. package/dist/protocols/protocol-v2/features.d.ts.map +1 -1
  197. package/dist/protocols/protocol-v2/firmware.d.ts +11 -9
  198. package/dist/protocols/protocol-v2/firmware.d.ts.map +1 -1
  199. package/dist/protocols/protocol-v2/index.d.ts +3 -2
  200. package/dist/protocols/protocol-v2/index.d.ts.map +1 -1
  201. package/dist/protocols/protocol-v2/lockedError.d.ts +2 -0
  202. package/dist/protocols/protocol-v2/lockedError.d.ts.map +1 -0
  203. package/dist/protocols/protocol-v2/settingsUnlockPolicy.d.ts +16 -0
  204. package/dist/protocols/protocol-v2/settingsUnlockPolicy.d.ts.map +1 -0
  205. package/dist/protocols/protocol-v2/uiInteraction.d.ts +39 -0
  206. package/dist/protocols/protocol-v2/uiInteraction.d.ts.map +1 -0
  207. package/dist/protocols/protocol-v2/unlockRetry.d.ts +11 -0
  208. package/dist/protocols/protocol-v2/unlockRetry.d.ts.map +1 -0
  209. package/dist/protocols/protocol-v2/walletSession.d.ts +19 -0
  210. package/dist/protocols/protocol-v2/walletSession.d.ts.map +1 -0
  211. package/dist/topLevelInject.d.ts.map +1 -1
  212. package/dist/types/api/checkAllFirmwareRelease.d.ts +1 -2
  213. package/dist/types/api/checkAllFirmwareRelease.d.ts.map +1 -1
  214. package/dist/types/api/deviceSettings.d.ts +9 -0
  215. package/dist/types/api/deviceSettings.d.ts.map +1 -1
  216. package/dist/types/api/deviceUnlock.d.ts +1 -1
  217. package/dist/types/api/deviceUnlock.d.ts.map +1 -1
  218. package/dist/types/api/firmwareUpdate.d.ts +6 -6
  219. package/dist/types/api/firmwareUpdate.d.ts.map +1 -1
  220. package/dist/types/api/getDeviceState.d.ts +12 -0
  221. package/dist/types/api/getDeviceState.d.ts.map +1 -0
  222. package/dist/types/api/getFeatures.d.ts.map +1 -1
  223. package/dist/types/api/getOnekeyFeatures.d.ts.map +1 -1
  224. package/dist/types/api/getPassphraseState.d.ts +2 -10
  225. package/dist/types/api/getPassphraseState.d.ts.map +1 -1
  226. package/dist/types/api/index.d.ts +26 -25
  227. package/dist/types/api/index.d.ts.map +1 -1
  228. package/dist/types/api/kaspaSignTransaction.d.ts +27 -2
  229. package/dist/types/api/kaspaSignTransaction.d.ts.map +1 -1
  230. package/dist/types/api/openWalletSession.d.ts +41 -0
  231. package/dist/types/api/openWalletSession.d.ts.map +1 -0
  232. package/dist/types/api/protocolV2.d.ts +31 -28
  233. package/dist/types/api/protocolV2.d.ts.map +1 -1
  234. package/dist/types/api/sessionCache.d.ts +10 -0
  235. package/dist/types/api/sessionCache.d.ts.map +1 -0
  236. package/dist/types/device.d.ts +120 -4
  237. package/dist/types/device.d.ts.map +1 -1
  238. package/dist/types/params.d.ts +1 -0
  239. package/dist/types/params.d.ts.map +1 -1
  240. package/dist/types/settings.d.ts +21 -1
  241. package/dist/types/settings.d.ts.map +1 -1
  242. package/dist/utils/assets.d.ts +2 -1
  243. package/dist/utils/assets.d.ts.map +1 -1
  244. package/dist/utils/deviceFeaturesCompat.d.ts +13 -0
  245. package/dist/utils/deviceFeaturesCompat.d.ts.map +1 -0
  246. package/dist/utils/deviceFeaturesUtils.d.ts +13 -3
  247. package/dist/utils/deviceFeaturesUtils.d.ts.map +1 -1
  248. package/dist/utils/deviceInfoUtils.d.ts +9 -8
  249. package/dist/utils/deviceInfoUtils.d.ts.map +1 -1
  250. package/dist/utils/deviceSettings.d.ts +2 -0
  251. package/dist/utils/deviceSettings.d.ts.map +1 -1
  252. package/dist/utils/deviceVersionUtils.d.ts +6 -5
  253. package/dist/utils/deviceVersionUtils.d.ts.map +1 -1
  254. package/dist/utils/homescreen.d.ts.map +1 -1
  255. package/dist/utils/index.d.ts +3 -1
  256. package/dist/utils/index.d.ts.map +1 -1
  257. package/dist/utils/networkUtils.d.ts +9 -1
  258. package/dist/utils/networkUtils.d.ts.map +1 -1
  259. package/dist/utils/patch.d.ts +1 -1
  260. package/dist/utils/patch.d.ts.map +1 -1
  261. package/dist/utils/pro2Wallpaper.d.ts +12 -0
  262. package/dist/utils/pro2Wallpaper.d.ts.map +1 -0
  263. package/dist/utils/tracing.d.ts.map +1 -1
  264. package/package.json +4 -4
  265. package/src/api/BaseMethod.ts +40 -7
  266. package/src/api/CheckBootloaderRelease.ts +1 -2
  267. package/src/api/CheckFirmwareRelease.ts +1 -2
  268. package/src/api/ClearSessionCache.ts +28 -0
  269. package/src/api/DirList.ts +5 -3
  270. package/src/api/DirMake.ts +3 -3
  271. package/src/api/DirRemove.ts +3 -3
  272. package/src/api/FileDelete.ts +3 -3
  273. package/src/api/FileRead.ts +23 -7
  274. package/src/api/FileWrite.ts +23 -168
  275. package/src/api/FirmwareUpdate.ts +4 -4
  276. package/src/api/FirmwareUpdateV2.ts +133 -45
  277. package/src/api/FirmwareUpdateV3.ts +3 -5
  278. package/src/api/FirmwareUpdateV4.ts +1138 -357
  279. package/src/api/GetDeviceState.ts +55 -0
  280. package/src/api/GetFeatures.ts +8 -3
  281. package/src/api/GetOnekeyFeatures.ts +3 -72
  282. package/src/api/GetPassphraseState.ts +11 -18
  283. package/src/api/OpenWalletSession.ts +221 -0
  284. package/src/api/PathInfo.ts +5 -3
  285. package/src/api/PromptWebDeviceAccess.ts +2 -3
  286. package/src/api/SearchDevices.ts +29 -4
  287. package/src/api/UploadPortfolio.ts +50 -0
  288. package/src/api/alephium/AlephiumSignTransaction.ts +2 -2
  289. package/src/api/allnetwork/AllNetworkGetAddressBase.ts +4 -8
  290. package/src/api/benfen/BenfenGetAddress.ts +1 -1
  291. package/src/api/btc/BTCGetPublicKey.ts +1 -1
  292. package/src/api/cardano/CardanoSignMessage.ts +1 -1
  293. package/src/api/cardano/CardanoSignTransaction.ts +1 -1
  294. package/src/api/device/DeviceCancel.ts +1 -0
  295. package/src/api/device/DeviceChangePin.ts +24 -0
  296. package/src/api/device/DeviceFullyUploadResource.ts +4 -5
  297. package/src/api/device/DeviceLock.ts +1 -0
  298. package/src/api/device/DeviceRebootToBoardloader.ts +5 -4
  299. package/src/api/device/DeviceRebootToBootloader.ts +5 -4
  300. package/src/api/device/DeviceSettings.ts +121 -0
  301. package/src/api/device/DeviceUnlock.ts +9 -0
  302. package/src/api/device/DeviceUpdateBootloader.ts +1 -2
  303. package/src/api/device/DeviceWipe.ts +19 -0
  304. package/src/api/evm/EVMSignTypedData.ts +3 -5
  305. package/src/api/evm/legacyV1/getAddress.ts +2 -2
  306. package/src/api/evm/legacyV1/getPublicKey.ts +2 -2
  307. package/src/api/evm/legacyV1/signMessage.ts +2 -2
  308. package/src/api/evm/legacyV1/signTypedData.ts +2 -2
  309. package/src/api/evm/legacyV1/signTypedHash.ts +2 -2
  310. package/src/api/evm/legacyV1/verifyMessage.ts +2 -2
  311. package/src/api/firmware/FirmwareUpdateBaseMethod.ts +21 -7
  312. package/src/api/firmware/getBinary.ts +8 -3
  313. package/src/api/firmware/progressThrottle.ts +44 -0
  314. package/src/api/helpers/batchGetPublickeys.ts +2 -2
  315. package/src/api/helpers/filesystemValidation.ts +61 -0
  316. package/src/api/helpers/paramsValidator.ts +1 -1
  317. package/src/api/helpers/protocolV2FileWrite.ts +193 -0
  318. package/src/api/index.ts +17 -20
  319. package/src/api/kaspa/KaspaSignTransaction.ts +341 -22
  320. package/src/api/kaspa/helpers/TransferSerialize.ts +14 -0
  321. package/src/api/nervos/NervosSignTransaction.ts +2 -2
  322. package/src/api/nexa/NexaSignTransaction.ts +1 -1
  323. package/src/api/protocol-v2/{FactoryGetDeviceInfo.ts → DeviceFactoryInfoGet.ts} +4 -4
  324. package/src/api/protocol-v2/DeviceFactoryInfoSet.ts +32 -0
  325. package/src/api/protocol-v2/DeviceFirmwareUpdate.ts +7 -9
  326. package/src/api/protocol-v2/DeviceGetFirmwareUpdateStatus.ts +41 -6
  327. package/src/api/protocol-v2/DeviceGetOnboardingStatus.ts +6 -4
  328. package/src/api/protocol-v2/DeviceInfoGet.ts +145 -0
  329. package/src/api/protocol-v2/DeviceReboot.ts +5 -3
  330. package/src/api/protocol-v2/DeviceSettingsGet.ts +18 -0
  331. package/src/api/protocol-v2/DeviceSettingsPageShow.ts +70 -0
  332. package/src/api/protocol-v2/DeviceSettingsSet.ts +44 -0
  333. package/src/api/protocol-v2/DeviceStatusGet.ts +16 -0
  334. package/src/api/protocol-v2/DeviceUploadWallpaper.ts +131 -0
  335. package/src/api/protocol-v2/FilesystemFormat.ts +5 -2
  336. package/src/api/protocol-v2/{FilesystemFixPermission.ts → FilesystemPermissionFix.ts} +3 -3
  337. package/src/api/protocol-v2/Ping.ts +1 -1
  338. package/src/api/protocol-v2/{GetProtoVersion.ts → ProtocolInfoRequest.ts} +3 -3
  339. package/src/api/protocol-v2/helpers.ts +58 -62
  340. package/src/api/ton/TonSignData.ts +1 -5
  341. package/src/api/utils.ts +7 -3
  342. package/src/constants/index.ts +7 -1
  343. package/src/core/RequestQueue.ts +124 -4
  344. package/src/core/deviceEventRegistration.ts +23 -0
  345. package/src/core/index.ts +171 -60
  346. package/src/data/messages/messages-protocol-v2.json +825 -709
  347. package/src/data/messages/messages.json +286 -1
  348. package/src/data-manager/DataManager.ts +13 -6
  349. package/src/data-manager/connectSettings.ts +4 -0
  350. package/src/device/Device.ts +480 -192
  351. package/src/device/DeviceCommands.ts +81 -25
  352. package/src/device/DeviceFeaturesState.ts +34 -0
  353. package/src/device/DevicePool.ts +67 -19
  354. package/src/device/DeviceStateMapper.ts +348 -0
  355. package/src/device/DeviceStateProjector.ts +95 -0
  356. package/src/device/DeviceStateStore.ts +201 -0
  357. package/src/device/DeviceWalletSessionStore.ts +105 -0
  358. package/src/device/cloneDeviceState.ts +39 -0
  359. package/src/device/deviceIdentity.ts +18 -0
  360. package/src/deviceProfile/buildDeviceFeatures.ts +233 -209
  361. package/src/deviceProfile/index.ts +0 -1
  362. package/src/events/call.ts +6 -0
  363. package/src/events/core.ts +2 -0
  364. package/src/events/device.ts +17 -1
  365. package/src/events/iframe.ts +1 -0
  366. package/src/events/logBlockEvent.ts +8 -1
  367. package/src/events/ui-request.ts +24 -2
  368. package/src/index.ts +4 -0
  369. package/src/inject.ts +33 -34
  370. package/src/lowLevelInject.ts +3 -0
  371. package/src/protocols/protocol-v2/deviceSession.ts +24 -0
  372. package/src/protocols/protocol-v2/features.ts +68 -82
  373. package/src/protocols/protocol-v2/firmware.ts +12 -36
  374. package/src/protocols/protocol-v2/index.ts +3 -1
  375. package/src/protocols/protocol-v2/lockedError.ts +10 -0
  376. package/src/protocols/protocol-v2/settingsUnlockPolicy.ts +61 -0
  377. package/src/protocols/protocol-v2/uiInteraction.ts +210 -0
  378. package/src/protocols/protocol-v2/unlockRetry.ts +76 -0
  379. package/src/protocols/protocol-v2/walletSession.ts +107 -0
  380. package/src/topLevelInject.ts +2 -0
  381. package/src/types/api/checkAllFirmwareRelease.ts +1 -2
  382. package/src/types/api/deviceSettings.ts +9 -0
  383. package/src/types/api/deviceUnlock.ts +1 -1
  384. package/src/types/api/firmwareUpdate.ts +28 -20
  385. package/src/types/api/getDeviceState.ts +19 -0
  386. package/src/types/api/getFeatures.ts +3 -0
  387. package/src/types/api/getOnekeyFeatures.ts +3 -0
  388. package/src/types/api/getPassphraseState.ts +8 -11
  389. package/src/types/api/index.ts +37 -53
  390. package/src/types/api/kaspaSignTransaction.ts +40 -2
  391. package/src/types/api/openWalletSession.ts +64 -0
  392. package/src/types/api/protocolV2.ts +88 -54
  393. package/src/types/api/sessionCache.ts +14 -0
  394. package/src/types/device.ts +167 -3
  395. package/src/types/params.ts +4 -0
  396. package/src/types/settings.ts +42 -30
  397. package/src/utils/assets.ts +4 -1
  398. package/src/utils/deviceFeaturesCompat.ts +173 -0
  399. package/src/utils/deviceFeaturesUtils.ts +68 -24
  400. package/src/utils/deviceInfoUtils.ts +26 -64
  401. package/src/utils/deviceSettings.ts +48 -0
  402. package/src/utils/deviceVersionUtils.ts +25 -44
  403. package/src/utils/findDefectiveBatchDevice.ts +3 -3
  404. package/src/utils/homescreen.ts +10 -0
  405. package/src/utils/index.ts +3 -0
  406. package/src/utils/networkUtils.ts +270 -14
  407. package/src/utils/pro2Wallpaper.ts +109 -0
  408. package/src/utils/tracing.ts +3 -1
  409. package/dist/api/GetDeviceInfo.d.ts +0 -9
  410. package/dist/api/GetDeviceInfo.d.ts.map +0 -1
  411. package/dist/api/protocol-v2/DevReboot.d.ts +0 -7
  412. package/dist/api/protocol-v2/DevReboot.d.ts.map +0 -1
  413. package/dist/api/protocol-v2/DeviceGetDeviceInfo.d.ts +0 -29
  414. package/dist/api/protocol-v2/DeviceGetDeviceInfo.d.ts.map +0 -1
  415. package/dist/api/protocol-v2/FactoryDeviceInfoSettings.d.ts +0 -7
  416. package/dist/api/protocol-v2/FactoryDeviceInfoSettings.d.ts.map +0 -1
  417. package/dist/api/protocol-v2/FactoryGetDeviceInfo.d.ts +0 -6
  418. package/dist/api/protocol-v2/FactoryGetDeviceInfo.d.ts.map +0 -1
  419. package/dist/api/protocol-v2/FilesystemDiskControl.d.ts +0 -13
  420. package/dist/api/protocol-v2/FilesystemDiskControl.d.ts.map +0 -1
  421. package/dist/api/protocol-v2/FilesystemFixPermission.d.ts.map +0 -1
  422. package/dist/api/protocol-v2/GetProtoVersion.d.ts +0 -6
  423. package/dist/api/protocol-v2/GetProtoVersion.d.ts.map +0 -1
  424. package/dist/deviceProfile/buildDeviceProfile.d.ts +0 -21
  425. package/dist/deviceProfile/buildDeviceProfile.d.ts.map +0 -1
  426. package/dist/types/api/getDeviceInfo.d.ts +0 -85
  427. package/dist/types/api/getDeviceInfo.d.ts.map +0 -1
  428. package/src/api/GetDeviceInfo.ts +0 -145
  429. package/src/api/protocol-v2/DevReboot.ts +0 -24
  430. package/src/api/protocol-v2/DeviceGetDeviceInfo.ts +0 -118
  431. package/src/api/protocol-v2/FactoryDeviceInfoSettings.ts +0 -29
  432. package/src/api/protocol-v2/FilesystemDiskControl.ts +0 -50
  433. package/src/deviceProfile/buildDeviceProfile.ts +0 -334
  434. package/src/types/api/getDeviceInfo.ts +0 -99
@@ -1,25 +1,281 @@
1
- import axios from 'axios';
1
+ import axios, { type AxiosResponse } from 'axios';
2
2
 
3
- export const httpRequest = async (url: string, type = 'text') => {
3
+ export type HttpRequestOptions = {
4
+ /** Axios adapter-defined request timeout retained for existing opt-in callers. */
5
+ timeoutMs?: number;
6
+ /** Deadline for DNS, connection, TLS, redirects, and the first response-body progress. */
7
+ connectTimeoutMs?: number;
8
+ /** Maximum idle interval between response-body progress events. */
9
+ readTimeoutMs?: number;
10
+ /** Wall-clock deadline across all attempts and retry backoff. */
11
+ overallTimeoutMs?: number;
12
+ maxRetries?: number;
13
+ retryDelayMs?: number;
14
+ };
15
+
16
+ const MAX_RETRY_COUNT = 3;
17
+ const REQUEST_PHASE_TIMEOUT_CODES = {
18
+ connect: 'ECONNECTTIMEDOUT',
19
+ read: 'EREADTIMEDOUT',
20
+ } as const;
21
+ const RETRYABLE_HTTP_STATUSES = new Set([500, 502, 503, 504]);
22
+ const RETRYABLE_NETWORK_ERROR_CODES = new Set([
23
+ REQUEST_PHASE_TIMEOUT_CODES.connect,
24
+ REQUEST_PHASE_TIMEOUT_CODES.read,
25
+ 'ECONNABORTED',
26
+ 'ECONNREFUSED',
27
+ 'ECONNRESET',
28
+ 'EHOSTUNREACH',
29
+ 'ENETDOWN',
30
+ 'ENETUNREACH',
31
+ 'ENOTFOUND',
32
+ 'EAI_AGAIN',
33
+ 'ERR_NETWORK',
34
+ 'ETIMEDOUT',
35
+ ]);
36
+
37
+ const createAbortError = () => {
38
+ const error = new Error('httpRequest aborted');
39
+ error.name = 'AbortError';
40
+ return error;
41
+ };
42
+
43
+ const createOverallTimeoutError = (url: string, timeoutMs: number) => {
44
+ const error = new Error(`httpRequest overall timeout: ${url} ${timeoutMs}ms`);
45
+ error.name = 'HttpRequestOverallTimeoutError';
46
+ return error;
47
+ };
48
+
49
+ const createRequestPhaseTimeoutError = (
50
+ url: string,
51
+ phase: keyof typeof REQUEST_PHASE_TIMEOUT_CODES,
52
+ timeoutMs: number
53
+ ) => {
54
+ const error = new Error(`httpRequest ${phase} timeout: ${url} ${timeoutMs}ms`);
55
+ error.name = 'HttpRequestPhaseTimeoutError';
56
+ return Object.assign(error, {
57
+ code: REQUEST_PHASE_TIMEOUT_CODES[phase],
58
+ });
59
+ };
60
+
61
+ const waitForRetry = async (delayMs: number, attempt: number, signal?: AbortSignal) => {
62
+ const backoffMs = delayMs * 2 ** attempt;
63
+ if (backoffMs <= 0) {
64
+ return;
65
+ }
66
+ await new Promise<void>((resolve, reject) => {
67
+ const timeoutTimer = setTimeout(() => {
68
+ signal?.removeEventListener('abort', handleAbort);
69
+ resolve();
70
+ }, backoffMs);
71
+ const handleAbort = () => {
72
+ clearTimeout(timeoutTimer);
73
+ reject(createAbortError());
74
+ };
75
+ if (signal?.aborted) {
76
+ handleAbort();
77
+ return;
78
+ }
79
+ signal?.addEventListener('abort', handleAbort, { once: true });
80
+ });
81
+ };
82
+
83
+ const isRetryableRequestError = (error: unknown) => {
84
+ if (axios.isCancel(error)) {
85
+ return false;
86
+ }
87
+ if (
88
+ typeof error === 'object' &&
89
+ error !== null &&
90
+ 'code' in error &&
91
+ typeof error.code === 'string' &&
92
+ RETRYABLE_NETWORK_ERROR_CODES.has(error.code)
93
+ ) {
94
+ return true;
95
+ }
96
+ if (!axios.isAxiosError(error)) {
97
+ return false;
98
+ }
99
+ const status = error.response?.status;
100
+ if (status !== undefined) {
101
+ return RETRYABLE_HTTP_STATUSES.has(Number(status));
102
+ }
103
+ return false;
104
+ };
105
+
106
+ export const httpRequest = async <T = unknown>(
107
+ url: string,
108
+ type = 'text',
109
+ options: HttpRequestOptions = {}
110
+ ): Promise<T> => {
4
111
  const headers: any = {};
5
112
  if (url.indexOf('ngrok-free.app') > -1) {
6
113
  headers['ngrok-skip-browser-warning'] = true;
7
114
  }
8
- const response = await axios.request({
9
- url,
10
- withCredentials: false,
11
- responseType: type === 'binary' ? 'arraybuffer' : 'json',
12
- headers,
13
- });
14
115
 
15
- if (+response.status === 200) {
16
- if (type === 'json') {
17
- return response.data;
116
+ const timeoutMs =
117
+ Number.isSafeInteger(options.timeoutMs) && Number(options.timeoutMs) > 0
118
+ ? Number(options.timeoutMs)
119
+ : undefined;
120
+ const connectTimeoutMs =
121
+ Number.isSafeInteger(options.connectTimeoutMs) && Number(options.connectTimeoutMs) > 0
122
+ ? Number(options.connectTimeoutMs)
123
+ : undefined;
124
+ const readTimeoutMs =
125
+ Number.isSafeInteger(options.readTimeoutMs) && Number(options.readTimeoutMs) > 0
126
+ ? Number(options.readTimeoutMs)
127
+ : undefined;
128
+ const overallTimeoutMs =
129
+ Number.isSafeInteger(options.overallTimeoutMs) && Number(options.overallTimeoutMs) > 0
130
+ ? Number(options.overallTimeoutMs)
131
+ : undefined;
132
+ const maxRetries =
133
+ Number.isSafeInteger(options.maxRetries) && Number(options.maxRetries) > 0
134
+ ? Math.min(Number(options.maxRetries), MAX_RETRY_COUNT)
135
+ : 0;
136
+ const retryDelayMs =
137
+ Number.isSafeInteger(options.retryDelayMs) && Number(options.retryDelayMs) > 0
138
+ ? Number(options.retryDelayMs)
139
+ : 0;
140
+ const overallTimeoutError = overallTimeoutMs
141
+ ? createOverallTimeoutError(url, overallTimeoutMs)
142
+ : undefined;
143
+ const overallDeadlineAt = overallTimeoutMs ? Date.now() + overallTimeoutMs : undefined;
144
+ const assertWithinOverallDeadline = () => {
145
+ if (overallDeadlineAt !== undefined && overallTimeoutError && Date.now() >= overallDeadlineAt) {
146
+ throw overallTimeoutError;
147
+ }
148
+ };
149
+
150
+ const request = async (attempt: number, signal?: AbortSignal): Promise<T> => {
151
+ assertWithinOverallDeadline();
152
+ if (signal?.aborted) {
153
+ throw createAbortError();
154
+ }
155
+
156
+ let response: AxiosResponse<T> | undefined;
157
+ let requestError: unknown;
158
+ let requestFailed = false;
159
+ let phaseTimeoutError: ReturnType<typeof createRequestPhaseTimeoutError> | undefined;
160
+ let phaseTimeoutTimer: ReturnType<typeof setTimeout> | undefined;
161
+ const hasPhaseDeadline = Boolean(connectTimeoutMs || readTimeoutMs);
162
+ const attemptController = signal || hasPhaseDeadline ? new AbortController() : undefined;
163
+ let attemptSettled = false;
164
+ let lastProgressLoaded = 0;
165
+ const handleParentAbort = () => {
166
+ attemptController?.abort();
167
+ };
168
+ const clearPhaseTimeout = () => {
169
+ if (phaseTimeoutTimer) {
170
+ clearTimeout(phaseTimeoutTimer);
171
+ phaseTimeoutTimer = undefined;
172
+ }
173
+ };
174
+ const armPhaseTimeout = (
175
+ phase: keyof typeof REQUEST_PHASE_TIMEOUT_CODES,
176
+ phaseTimeoutMs: number | undefined
177
+ ) => {
178
+ clearPhaseTimeout();
179
+ if (!phaseTimeoutMs || !attemptController) {
180
+ return;
181
+ }
182
+ phaseTimeoutTimer = setTimeout(() => {
183
+ phaseTimeoutError = createRequestPhaseTimeoutError(url, phase, phaseTimeoutMs);
184
+ attemptController.abort();
185
+ }, phaseTimeoutMs);
186
+ };
187
+
188
+ if (signal) {
189
+ signal.addEventListener('abort', handleParentAbort, { once: true });
190
+ }
191
+ armPhaseTimeout('connect', connectTimeoutMs);
192
+
193
+ try {
194
+ response = await axios.request<T>({
195
+ url,
196
+ withCredentials: false,
197
+ responseType: type === 'binary' ? 'arraybuffer' : 'json',
198
+ headers,
199
+ ...(timeoutMs ? { timeout: timeoutMs } : {}),
200
+ ...(attemptController ? { signal: attemptController.signal } : {}),
201
+ ...(hasPhaseDeadline
202
+ ? {
203
+ adapter: ['xhr', 'http'],
204
+ onDownloadProgress: (progressEvent: { loaded: number }) => {
205
+ if (
206
+ attemptSettled ||
207
+ attemptController?.signal.aborted ||
208
+ !Number.isFinite(progressEvent.loaded) ||
209
+ progressEvent.loaded <= lastProgressLoaded
210
+ ) {
211
+ return;
212
+ }
213
+ lastProgressLoaded = progressEvent.loaded;
214
+ armPhaseTimeout('read', readTimeoutMs);
215
+ },
216
+ }
217
+ : {}),
218
+ });
219
+ if (phaseTimeoutError) {
220
+ requestFailed = true;
221
+ requestError = phaseTimeoutError;
222
+ response = undefined;
223
+ }
224
+ } catch (error) {
225
+ requestFailed = true;
226
+ requestError = phaseTimeoutError ?? (signal?.aborted ? createAbortError() : error);
227
+ } finally {
228
+ attemptSettled = true;
229
+ clearPhaseTimeout();
230
+ signal?.removeEventListener('abort', handleParentAbort);
231
+ }
232
+
233
+ assertWithinOverallDeadline();
234
+
235
+ if (requestFailed) {
236
+ if (attempt >= maxRetries || !isRetryableRequestError(requestError)) {
237
+ throw requestError;
238
+ }
239
+ await waitForRetry(retryDelayMs, attempt, signal);
240
+ assertWithinOverallDeadline();
241
+ return request(attempt + 1, signal);
18
242
  }
19
- if (type === 'binary') {
243
+
244
+ if (!response) {
245
+ throw new Error(`httpRequest completed without a response: ${url}`);
246
+ }
247
+
248
+ if (+response.status === 200) {
20
249
  return response.data;
21
250
  }
22
- return response.data;
251
+
252
+ if (RETRYABLE_HTTP_STATUSES.has(Number(response.status)) && attempt < maxRetries) {
253
+ await waitForRetry(retryDelayMs, attempt, signal);
254
+ assertWithinOverallDeadline();
255
+ return request(attempt + 1, signal);
256
+ }
257
+
258
+ throw new Error(`httpRequest error: ${url} ${response.statusText}`);
259
+ };
260
+
261
+ if (!overallTimeoutMs) {
262
+ return request(0);
263
+ }
264
+
265
+ const controller = new AbortController();
266
+ const requestPromise = request(0, controller.signal);
267
+ let timeoutTimer: ReturnType<typeof setTimeout> | undefined;
268
+ try {
269
+ return await new Promise<T>((resolve, reject) => {
270
+ timeoutTimer = setTimeout(() => {
271
+ reject(overallTimeoutError);
272
+ controller.abort();
273
+ }, overallTimeoutMs);
274
+ requestPromise.then(resolve, reject);
275
+ });
276
+ } finally {
277
+ if (timeoutTimer) {
278
+ clearTimeout(timeoutTimer);
279
+ }
23
280
  }
24
- throw new Error(`httpRequest error: ${url} ${response.statusText}`);
25
281
  };
@@ -0,0 +1,109 @@
1
+ import { ERRORS, HardwareErrorCode } from '@onekeyfe/hd-shared';
2
+
3
+ // RGB565 pixel packing and dithering index calculation require bitwise operations.
4
+ /* eslint-disable no-bitwise */
5
+
6
+ export const PRO2_WALLPAPER_WIDTH = 604;
7
+ export const PRO2_WALLPAPER_HEIGHT = 1024;
8
+
9
+ export type Pro2WallpaperColorFormat = 'RGB565' | 'RGB565A8';
10
+
11
+ const COLOR_FORMAT_RGB565 = 0x12;
12
+ const COLOR_FORMAT_RGB565A8 = 0x14;
13
+
14
+ const RED_THRESHOLD = [
15
+ 1, 7, 3, 5, 0, 8, 2, 6, 7, 1, 5, 3, 8, 0, 6, 2, 3, 5, 0, 8, 2, 6, 1, 7, 5, 3, 8, 0, 6, 2, 7, 1, 0,
16
+ 8, 2, 6, 1, 7, 3, 5, 8, 0, 6, 2, 7, 1, 5, 3, 2, 6, 1, 7, 3, 5, 0, 8, 6, 2, 7, 1, 5, 3, 8, 0,
17
+ ];
18
+ const GREEN_THRESHOLD = [
19
+ 1, 3, 2, 2, 3, 1, 2, 2, 2, 2, 0, 4, 2, 2, 4, 0, 3, 1, 2, 2, 1, 3, 2, 2, 2, 2, 4, 0, 2, 2, 0, 4, 1,
20
+ 3, 2, 2, 3, 1, 2, 2, 2, 2, 0, 4, 2, 2, 4, 0, 3, 1, 2, 2, 1, 3, 2, 2, 2, 2, 4, 0, 2, 2, 0, 4,
21
+ ];
22
+ const BLUE_THRESHOLD = [
23
+ 5, 3, 8, 0, 6, 2, 7, 1, 3, 5, 0, 8, 2, 6, 1, 7, 8, 0, 6, 2, 7, 1, 5, 3, 0, 8, 2, 6, 1, 7, 3, 5, 6,
24
+ 2, 7, 1, 5, 3, 8, 0, 2, 6, 1, 7, 3, 5, 0, 8, 7, 1, 5, 3, 8, 0, 6, 2, 1, 7, 3, 5, 0, 8, 2, 6,
25
+ ];
26
+
27
+ function invalidParameter(message: string): Error {
28
+ return ERRORS.TypedError(HardwareErrorCode.CallMethodInvalidParameter, message);
29
+ }
30
+
31
+ function asBytes(rgba: Uint8Array | ArrayBuffer): Uint8Array {
32
+ return rgba instanceof Uint8Array ? rgba : new Uint8Array(rgba);
33
+ }
34
+
35
+ function align(value: number, boundary: number): number {
36
+ return Math.ceil(value / boundary) * boundary;
37
+ }
38
+
39
+ export function encodePro2Wallpaper(options: {
40
+ width: number;
41
+ height: number;
42
+ rgba: Uint8Array | ArrayBuffer;
43
+ }): { data: Uint8Array; colorFormat: Pro2WallpaperColorFormat } {
44
+ const { width, height } = options;
45
+ if (!Number.isInteger(width) || width <= 0 || width > 0xffff) {
46
+ throw invalidParameter('Wallpaper width must be an integer between 1 and 65535.');
47
+ }
48
+ if (!Number.isInteger(height) || height <= 0 || height > 0xffff) {
49
+ throw invalidParameter('Wallpaper height must be an integer between 1 and 65535.');
50
+ }
51
+
52
+ const rgba = asBytes(options.rgba);
53
+ const expectedLength = width * height * 4;
54
+ if (rgba.byteLength !== expectedLength) {
55
+ throw invalidParameter(
56
+ `Wallpaper RGBA data length must be ${expectedLength} bytes, received ${rgba.byteLength}.`
57
+ );
58
+ }
59
+
60
+ let hasTransparency = false;
61
+ for (let index = 3; index < rgba.length; index += 4) {
62
+ if (rgba[index] !== 0xff) {
63
+ hasTransparency = true;
64
+ break;
65
+ }
66
+ }
67
+
68
+ const colorFormat: Pro2WallpaperColorFormat = hasTransparency ? 'RGB565A8' : 'RGB565';
69
+ const stride = align(width * 2, 4);
70
+ const alphaStride = stride / 2;
71
+ const rgbSize = stride * height;
72
+ const alphaSize = hasTransparency ? alphaStride * height : 0;
73
+ const data = new Uint8Array(12 + rgbSize + alphaSize);
74
+ const view = new DataView(data.buffer);
75
+
76
+ data[0] = 0x19;
77
+ data[1] = hasTransparency ? COLOR_FORMAT_RGB565A8 : COLOR_FORMAT_RGB565;
78
+ view.setUint16(2, 0, true);
79
+ view.setUint16(4, width, true);
80
+ view.setUint16(6, height, true);
81
+ view.setUint16(8, stride, true);
82
+ view.setUint16(10, 0, true);
83
+
84
+ for (let y = 0; y < height; y += 1) {
85
+ for (let x = 0; x < width; x += 1) {
86
+ const sourceOffset = (y * width + x) * 4;
87
+ const thresholdIndex = ((y & 7) << 3) + (x & 7);
88
+ let red = Math.min(rgba[sourceOffset] + RED_THRESHOLD[thresholdIndex], 0xff) & 0xf8;
89
+ let green = Math.min(rgba[sourceOffset + 1] + GREEN_THRESHOLD[thresholdIndex], 0xff) & 0xfc;
90
+ let blue = Math.min(rgba[sourceOffset + 2] + BLUE_THRESHOLD[thresholdIndex], 0xff) & 0xf8;
91
+ if (!hasTransparency) {
92
+ const alpha = rgba[sourceOffset + 3];
93
+ red = (red * alpha) >> 8;
94
+ green = (green * alpha) >> 8;
95
+ blue = (blue * alpha) >> 8;
96
+ }
97
+ const rgb565 = ((red >> 3) << 11) | ((green >> 2) << 5) | (blue >> 3);
98
+ const rgbOffset = 12 + y * stride + x * 2;
99
+ data[rgbOffset] = rgb565 & 0xff;
100
+ data[rgbOffset + 1] = rgb565 >> 8;
101
+
102
+ if (hasTransparency) {
103
+ data[12 + rgbSize + y * alphaStride + x] = rgba[sourceOffset + 3];
104
+ }
105
+ }
106
+ }
107
+
108
+ return { data, colorFormat };
109
+ }
@@ -164,7 +164,9 @@ export function completeRequestContext(responseID: number, error?: Error): void
164
164
  context.status = error ? 'error' : 'success';
165
165
  if (error) {
166
166
  context.error = error.message;
167
- Log.error(
167
+ // Method errors already reach callers through the standard API response.
168
+ // Request tracing is diagnostic and must not emit a second user-facing error.
169
+ Log.debug(
168
170
  `[RequestContext] [completeRequestContext] Error: ${formatRequestContext(context)}`
169
171
  );
170
172
  }
@@ -1,9 +0,0 @@
1
- import { BaseMethod } from './BaseMethod';
2
- import type { GetDeviceInfoParams } from '../types/api/getDeviceInfo';
3
- export default class GetDeviceInfo extends BaseMethod<GetDeviceInfoParams> {
4
- init(): void;
5
- run(): Promise<import("../types").DeviceProfile>;
6
- private runProtocolV2;
7
- private runProtocolV1;
8
- }
9
- //# sourceMappingURL=GetDeviceInfo.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"GetDeviceInfo.d.ts","sourceRoot":"","sources":["../../src/api/GetDeviceInfo.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,KAAK,EAGV,mBAAmB,EACpB,MAAM,4BAA4B,CAAC;AA0DpC,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,UAAU,CAAC,mBAAmB,CAAC;IACxE,IAAI;IAeE,GAAG;YAOK,aAAa;YAgBb,aAAa;CA4B5B"}
@@ -1,7 +0,0 @@
1
- import { BaseMethod } from '../BaseMethod';
2
- import type { DeviceRebootParams } from './helpers';
3
- export default class DevReboot extends BaseMethod<DeviceRebootParams> {
4
- init(): void;
5
- run(): Promise<import("packages/hd-transport/dist").Success>;
6
- }
7
- //# sourceMappingURL=DevReboot.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DevReboot.d.ts","sourceRoot":"","sources":["../../../src/api/protocol-v2/DevReboot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAG3C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAEpD,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,UAAU,CAAC,kBAAkB,CAAC;IACnE,IAAI;IAWE,GAAG;CAMV"}
@@ -1,29 +0,0 @@
1
- import { BaseMethod } from '../BaseMethod';
2
- export type DeviceGetDeviceInfoTargets = {
3
- hw?: boolean;
4
- fw?: boolean;
5
- bt?: boolean;
6
- se1?: boolean;
7
- se2?: boolean;
8
- se3?: boolean;
9
- se4?: boolean;
10
- status?: boolean;
11
- };
12
- export type DeviceGetDeviceInfoTypes = {
13
- version?: boolean;
14
- build_id?: boolean;
15
- hash?: boolean;
16
- specific?: boolean;
17
- };
18
- export type DeviceGetDeviceInfoParams = {
19
- targets?: DeviceGetDeviceInfoTargets;
20
- types?: DeviceGetDeviceInfoTypes;
21
- };
22
- export default class DeviceGetDeviceInfo extends BaseMethod<{
23
- targets: DeviceGetDeviceInfoTargets;
24
- types: DeviceGetDeviceInfoTypes;
25
- }> {
26
- init(): void;
27
- run(): Promise<import("packages/hd-transport/dist").ProtocolV2DeviceInfo | import("packages/hd-transport/dist").DeviceInfo>;
28
- }
29
- //# sourceMappingURL=DeviceGetDeviceInfo.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DeviceGetDeviceInfo.d.ts","sourceRoot":"","sources":["../../../src/api/protocol-v2/DeviceGetDeviceInfo.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,MAAM,MAAM,0BAA0B,GAAG;IACvC,EAAE,CAAC,EAAE,OAAO,CAAC;IACb,EAAE,CAAC,EAAE,OAAO,CAAC;IACb,EAAE,CAAC,EAAE,OAAO,CAAC;IACb,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG;IACrC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACtC,OAAO,CAAC,EAAE,0BAA0B,CAAC;IACrC,KAAK,CAAC,EAAE,wBAAwB,CAAC;CAClC,CAAC;AAmDF,MAAM,CAAC,OAAO,OAAO,mBAAoB,SAAQ,UAAU,CAAC;IAC1D,OAAO,EAAE,0BAA0B,CAAC;IACpC,KAAK,EAAE,wBAAwB,CAAC;CACjC,CAAC;IACA,IAAI;IAmBE,GAAG;CAgBV"}
@@ -1,7 +0,0 @@
1
- import { BaseMethod } from '../BaseMethod';
2
- import type { FactoryDeviceInfoSettingsParams } from './helpers';
3
- export default class FactoryDeviceInfoSettings extends BaseMethod<FactoryDeviceInfoSettingsParams> {
4
- init(): void;
5
- run(): Promise<import("packages/hd-transport/dist").Success>;
6
- }
7
- //# sourceMappingURL=FactoryDeviceInfoSettings.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FactoryDeviceInfoSettings.d.ts","sourceRoot":"","sources":["../../../src/api/protocol-v2/FactoryDeviceInfoSettings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,WAAW,CAAC;AAEjE,MAAM,CAAC,OAAO,OAAO,yBAA0B,SAAQ,UAAU,CAAC,+BAA+B,CAAC;IAChG,IAAI;IAeE,GAAG;CAQV"}
@@ -1,6 +0,0 @@
1
- import { BaseMethod } from '../BaseMethod';
2
- export default class FactoryGetDeviceInfo extends BaseMethod {
3
- init(): void;
4
- run(): Promise<import("packages/hd-transport/dist").FactoryDeviceInfo>;
5
- }
6
- //# sourceMappingURL=FactoryGetDeviceInfo.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FactoryGetDeviceInfo.d.ts","sourceRoot":"","sources":["../../../src/api/protocol-v2/FactoryGetDeviceInfo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,MAAM,CAAC,OAAO,OAAO,oBAAqB,SAAQ,UAAU;IAC1D,IAAI;IAQE,GAAG;CAQV"}
@@ -1,13 +0,0 @@
1
- import { BaseMethod } from '../BaseMethod';
2
- export type FilesystemDiskControlParams = {
3
- enable?: boolean | 0 | 1;
4
- timeoutMs?: number | string;
5
- };
6
- export default class FilesystemDiskControl extends BaseMethod<{
7
- enable: 0 | 1;
8
- timeoutMs?: number;
9
- }> {
10
- init(): void;
11
- run(): Promise<any>;
12
- }
13
- //# sourceMappingURL=FilesystemDiskControl.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FilesystemDiskControl.d.ts","sourceRoot":"","sources":["../../../src/api/protocol-v2/FilesystemDiskControl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAM3C,MAAM,MAAM,2BAA2B,GAAG;IAExC,MAAM,CAAC,EAAE,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAC7B,CAAC;AAUF,MAAM,CAAC,OAAO,OAAO,qBAAsB,SAAQ,UAAU,CAAC;IAC5D,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;IACA,IAAI;IAWE,GAAG;CAcV"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"FilesystemFixPermission.d.ts","sourceRoot":"","sources":["../../../src/api/protocol-v2/FilesystemFixPermission.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,MAAM,CAAC,OAAO,OAAO,uBAAwB,SAAQ,UAAU;IAC7D,IAAI;IAQE,GAAG;CAIV"}
@@ -1,6 +0,0 @@
1
- import { BaseMethod } from '../BaseMethod';
2
- export default class GetProtoVersion extends BaseMethod {
3
- init(): void;
4
- run(): Promise<import("packages/hd-transport/dist").ProtoVersion>;
5
- }
6
- //# sourceMappingURL=GetProtoVersion.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"GetProtoVersion.d.ts","sourceRoot":"","sources":["../../../src/api/protocol-v2/GetProtoVersion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,UAAU;IACrD,IAAI;IAQE,GAAG;CAIV"}
@@ -1,21 +0,0 @@
1
- import type { DeviceInfoProtocol, DeviceInfoSource, DeviceProfile, GetDeviceInfoParams } from '../types/api/getDeviceInfo';
2
- import type { Features, OnekeyFeatures } from '../types';
3
- import type { ProtocolV2DeviceInfo } from '@onekeyfe/hd-transport';
4
- type BuildProtocolV1ProfileParams = {
5
- protocol?: DeviceInfoProtocol;
6
- features?: Features;
7
- protocolV1OneKeyFeatures?: OnekeyFeatures;
8
- sources?: DeviceInfoSource[];
9
- scope?: GetDeviceInfoParams['scope'];
10
- includeRaw?: boolean;
11
- };
12
- type BuildProtocolV2ProfileParams = {
13
- deviceInfo?: ProtocolV2DeviceInfo;
14
- sources?: DeviceInfoSource[];
15
- scope?: GetDeviceInfoParams['scope'];
16
- includeRaw?: boolean;
17
- };
18
- export declare function buildProfileFromProtocolV1({ protocol, features, protocolV1OneKeyFeatures, sources, scope, includeRaw, }: BuildProtocolV1ProfileParams): DeviceProfile;
19
- export declare function buildProfileFromProtocolV2({ deviceInfo, sources, scope, includeRaw, }: BuildProtocolV2ProfileParams): DeviceProfile;
20
- export {};
21
- //# sourceMappingURL=buildDeviceProfile.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"buildDeviceProfile.d.ts","sourceRoot":"","sources":["../../src/deviceProfile/buildDeviceProfile.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EACV,kBAAkB,EAClB,gBAAgB,EAEhB,aAAa,EAIb,mBAAmB,EACpB,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AACzD,OAAO,KAAK,EAAwB,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAEzF,KAAK,4BAA4B,GAAG;IAClC,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IAC9B,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,wBAAwB,CAAC,EAAE,cAAc,CAAC;IAC1C,OAAO,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC7B,KAAK,CAAC,EAAE,mBAAmB,CAAC,OAAO,CAAC,CAAC;IACrC,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,KAAK,4BAA4B,GAAG;IAClC,UAAU,CAAC,EAAE,oBAAoB,CAAC;IAClC,OAAO,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC7B,KAAK,CAAC,EAAE,mBAAmB,CAAC,OAAO,CAAC,CAAC;IACrC,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AA+NF,wBAAgB,0BAA0B,CAAC,EACzC,QAAe,EACf,QAAQ,EACR,wBAAwB,EACxB,OAAsB,EACtB,KAAe,EACf,UAAkB,GACnB,EAAE,4BAA4B,GAAG,aAAa,CAyB9C;AAED,wBAAgB,0BAA0B,CAAC,EACzC,UAAU,EACV,OAAwB,EACxB,KAAe,EACf,UAAkB,GACnB,EAAE,4BAA4B,GAAG,aAAa,CA4B9C"}
@@ -1,85 +0,0 @@
1
- import type { CommonParams, Response } from '../params';
2
- import type { Features, IDeviceType, OnekeyFeatures } from '../device';
3
- import type { EFirmwareType } from '@onekeyfe/hd-shared';
4
- import type { ProtocolType, ProtocolV2DeviceInfo } from '@onekeyfe/hd-transport';
5
- export type DeviceInfoProtocol = ProtocolType | 'unknown';
6
- export type DeviceInfoSource = 'features' | 'protocolV1OneKeyFeatures' | 'deviceInfo';
7
- export type DeviceInfoScope = 'basic' | 'versions' | 'verify' | 'full';
8
- export type GetDeviceInfoParams = {
9
- scope?: DeviceInfoScope;
10
- refresh?: boolean;
11
- includeRaw?: boolean;
12
- };
13
- export type DeviceInfoMode = 'normal' | 'bootloader' | 'notInitialized' | 'unknown';
14
- export type DeviceInfoStatus = {
15
- mode: DeviceInfoMode;
16
- initialized: boolean | null;
17
- bootloaderMode: boolean | null;
18
- unlocked: boolean | null;
19
- passphraseProtection: boolean | null;
20
- backupRequired: boolean | null;
21
- noBackup: boolean | null;
22
- language: string | null;
23
- bleEnabled: boolean | null;
24
- };
25
- export type DeviceProfileVersions = {
26
- firmware: string | null;
27
- bootloader: string | null;
28
- board: string | null;
29
- ble: string | null;
30
- se01?: string | null;
31
- se02?: string | null;
32
- se03?: string | null;
33
- se04?: string | null;
34
- se01Boot?: string | null;
35
- se02Boot?: string | null;
36
- se03Boot?: string | null;
37
- se04Boot?: string | null;
38
- };
39
- export type DeviceProfileVerify = {
40
- firmwareBuildId?: string;
41
- firmwareHash?: string;
42
- bootloaderBuildId?: string;
43
- bootloaderHash?: string;
44
- boardBuildId?: string;
45
- boardHash?: string;
46
- bleBuildId?: string;
47
- bleHash?: string;
48
- se01BuildId?: string;
49
- se01Hash?: string;
50
- se02BuildId?: string;
51
- se02Hash?: string;
52
- se03BuildId?: string;
53
- se03Hash?: string;
54
- se04BuildId?: string;
55
- se04Hash?: string;
56
- se01BootBuildId?: string;
57
- se01BootHash?: string;
58
- se02BootBuildId?: string;
59
- se02BootHash?: string;
60
- se03BootBuildId?: string;
61
- se03BootHash?: string;
62
- se04BootBuildId?: string;
63
- se04BootHash?: string;
64
- };
65
- export type DeviceProfileRaw = {
66
- features?: Features;
67
- protocolV1OneKeyFeatures?: OnekeyFeatures;
68
- protocolV2DeviceInfo?: ProtocolV2DeviceInfo;
69
- };
70
- export type DeviceProfile = {
71
- protocol: DeviceInfoProtocol;
72
- sources: DeviceInfoSource[];
73
- deviceType: IDeviceType;
74
- firmwareType: EFirmwareType;
75
- deviceId: string;
76
- serialNo: string;
77
- label: string | null;
78
- bleName: string | null;
79
- status: DeviceInfoStatus;
80
- versions: DeviceProfileVersions;
81
- verify?: DeviceProfileVerify;
82
- raw?: DeviceProfileRaw;
83
- };
84
- export declare function getDeviceInfo(connectId?: string, params?: CommonParams & GetDeviceInfoParams): Response<DeviceProfile>;
85
- //# sourceMappingURL=getDeviceInfo.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getDeviceInfo.d.ts","sourceRoot":"","sources":["../../../src/types/api/getDeviceInfo.ts"],"names":[],"mappings":"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"}