@onekeyfe/hd-core 1.2.0-alpha.57 → 1.2.0-alpha.59

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 (671) hide show
  1. package/__tests__/AllNetworkGetAddressBase.tracing.test.ts +84 -2
  2. package/__tests__/DeviceCommands.test.ts +14 -13
  3. package/__tests__/core-initialization.test.ts +23 -0
  4. package/__tests__/device-connector-protocol.test.ts +81 -0
  5. package/__tests__/device-pool-state.test.ts +22 -0
  6. package/__tests__/device-settings.test.ts +39 -18
  7. package/__tests__/device-state-mapper.test.ts +12 -0
  8. package/__tests__/device-utils.test.ts +48 -1
  9. package/__tests__/deviceSettings.test.ts +10 -0
  10. package/__tests__/deviceUploadNft.test.ts +4 -28
  11. package/__tests__/kaspa-use-tweak-pro2.test.ts +2 -2
  12. package/__tests__/protocol-v2-resources.test.ts +48 -9
  13. package/__tests__/protocol-v2-unlock-policy.test.ts +34 -0
  14. package/__tests__/protocol-v2.test.ts +208 -263
  15. package/__tests__/protocolV2FileWrite.test.ts +113 -0
  16. package/__tests__/public-pro2-api-boundary.test.ts +2 -98
  17. package/__tests__/tron-sign-message-init.test.ts +2 -2
  18. package/dist/api/CheckAllFirmwareRelease.d.ts.map +1 -1
  19. package/dist/api/FirmwareUpdateV4.d.ts +4 -4
  20. package/dist/api/FirmwareUpdateV4.d.ts.map +1 -1
  21. package/dist/api/OpenWalletSession.d.ts.map +1 -1
  22. package/dist/api/allnetwork/AllNetworkGetAddressBase.d.ts.map +1 -1
  23. package/dist/api/device/DeviceSettings.d.ts.map +1 -1
  24. package/dist/api/device/DeviceVerify.d.ts.map +1 -1
  25. package/dist/api/firmware/FirmwareUpdateBaseMethod.d.ts +4 -2
  26. package/dist/api/firmware/FirmwareUpdateBaseMethod.d.ts.map +1 -1
  27. package/dist/api/helpers/protocolV2FileWrite.d.ts +7 -0
  28. package/dist/api/helpers/protocolV2FileWrite.d.ts.map +1 -1
  29. package/dist/api/index.d.ts +0 -3
  30. package/dist/api/index.d.ts.map +1 -1
  31. package/dist/api/kaspa/KaspaGetAddress.d.ts +1 -1
  32. package/dist/api/kaspa/KaspaSignTransaction.d.ts +1 -1
  33. package/dist/api/polkadot/PolkadotGetAddress.d.ts +1 -1
  34. package/dist/api/polkadot/networks.d.ts +1 -1
  35. package/dist/api/protocol-v2/DeviceFactoryInfoGet.d.ts.map +1 -1
  36. package/dist/api/protocol-v2/DeviceFactoryInfoSet.d.ts.map +1 -1
  37. package/dist/api/protocol-v2/DeviceUploadNft.d.ts.map +1 -1
  38. package/dist/api/protocol-v2/helpers.d.ts +5 -15
  39. package/dist/api/protocol-v2/helpers.d.ts.map +1 -1
  40. package/dist/api/solana/SolSignMessage.d.ts +1 -1
  41. package/dist/api/solana/SolSignOffchainMessage.d.ts +1 -1
  42. package/dist/api/solana/SolSignTransaction.d.ts +2 -2
  43. package/dist/api/stellar/StellarSignTransaction.d.ts +1 -1
  44. package/dist/api/sui/SuiGetAddress.d.ts +1 -1
  45. package/dist/api/sui/SuiGetPublicKey.d.ts +1 -1
  46. package/dist/api/sui/SuiSignMessage.d.ts +1 -1
  47. package/dist/api/sui/SuiSignTransaction.d.ts +1 -1
  48. package/dist/api/ton/TonGetAddress.d.ts +1 -1
  49. package/dist/api/ton/TonSignMessage.d.ts +1 -1
  50. package/dist/api/ton/TonSignProof.d.ts +1 -1
  51. package/dist/api/tron/TronSignMessage.d.ts +2 -2
  52. package/dist/api/tron/TronSignTransaction.d.ts +1 -1
  53. package/dist/api/utils.d.ts +1 -6
  54. package/dist/api/utils.d.ts.map +1 -1
  55. package/dist/core/index.d.ts +4 -10
  56. package/dist/core/index.d.ts.map +1 -1
  57. package/dist/data-manager/DataManager.d.ts +8 -5
  58. package/dist/data-manager/DataManager.d.ts.map +1 -1
  59. package/dist/data-manager/TransportManager.d.ts.map +1 -1
  60. package/dist/device/Device.d.ts.map +1 -1
  61. package/dist/device/DeviceCommands.d.ts.map +1 -1
  62. package/dist/device/DeviceConnector.d.ts +2 -1
  63. package/dist/device/DeviceConnector.d.ts.map +1 -1
  64. package/dist/device/DevicePool.d.ts.map +1 -1
  65. package/dist/deviceProfile/protocolV2DeviceIdentity.d.ts.map +1 -1
  66. package/dist/index.d.ts +87 -756
  67. package/dist/index.d.ts.map +1 -1
  68. package/dist/index.js +723 -3114
  69. package/dist/inject.d.ts +2 -6
  70. package/dist/inject.d.ts.map +1 -1
  71. package/dist/protocols/protocol-v2/resources.d.ts +2 -2
  72. package/dist/protocols/protocol-v2/resources.d.ts.map +1 -1
  73. package/dist/types/api/checkAllFirmwareRelease.d.ts +1 -1
  74. package/dist/types/api/checkAllFirmwareRelease.d.ts.map +1 -1
  75. package/dist/types/api/firmwareUpdate.d.ts +3 -2
  76. package/dist/types/api/firmwareUpdate.d.ts.map +1 -1
  77. package/dist/types/api/index.d.ts +3 -176
  78. package/dist/types/api/index.d.ts.map +1 -1
  79. package/dist/types/api/protocolV2.d.ts +2 -8
  80. package/dist/types/api/protocolV2.d.ts.map +1 -1
  81. package/dist/types/device.d.ts +2 -2
  82. package/dist/types/device.d.ts.map +1 -1
  83. package/dist/types/settings.d.ts +22 -14
  84. package/dist/types/settings.d.ts.map +1 -1
  85. package/dist/utils/deviceFeaturesCompat.d.ts.map +1 -1
  86. package/dist/utils/deviceFeaturesUtils.d.ts.map +1 -1
  87. package/dist/utils/deviceInfoUtils.d.ts.map +1 -1
  88. package/dist/utils/deviceSettings.d.ts.map +1 -1
  89. package/dist/utils/patch.d.ts +1 -1
  90. package/dist/utils/patch.d.ts.map +1 -1
  91. package/package.json +4 -4
  92. package/src/api/CheckAllFirmwareRelease.ts +7 -5
  93. package/src/api/FirmwareUpdateV4.ts +154 -171
  94. package/src/api/OpenWalletSession.ts +1 -0
  95. package/src/api/allnetwork/AllNetworkGetAddressBase.ts +3 -1
  96. package/src/api/device/DeviceSettings.ts +5 -4
  97. package/src/api/device/DeviceVerify.ts +0 -2
  98. package/src/api/firmware/FirmwareUpdateBaseMethod.ts +12 -1
  99. package/src/api/helpers/protocolV2FileWrite.ts +192 -73
  100. package/src/api/index.ts +0 -3
  101. package/src/api/kaspa/KaspaGetAddress.ts +1 -1
  102. package/src/api/kaspa/KaspaSignTransaction.ts +1 -1
  103. package/src/api/polkadot/networks.ts +3 -3
  104. package/src/api/protocol-v2/DeviceFactoryInfoGet.ts +0 -3
  105. package/src/api/protocol-v2/DeviceFactoryInfoSet.ts +7 -6
  106. package/src/api/protocol-v2/DeviceUploadNft.ts +7 -12
  107. package/src/api/protocol-v2/helpers.ts +5 -153
  108. package/src/api/solana/SolSignMessage.ts +1 -1
  109. package/src/api/solana/SolSignOffchainMessage.ts +1 -1
  110. package/src/api/solana/SolSignTransaction.ts +2 -2
  111. package/src/api/sui/SuiGetAddress.ts +1 -1
  112. package/src/api/sui/SuiGetPublicKey.ts +1 -1
  113. package/src/api/sui/SuiSignMessage.ts +1 -1
  114. package/src/api/sui/SuiSignTransaction.ts +1 -1
  115. package/src/api/ton/TonGetAddress.ts +1 -1
  116. package/src/api/ton/TonSignMessage.ts +1 -1
  117. package/src/api/ton/TonSignProof.ts +1 -1
  118. package/src/api/tron/TronSignMessage.ts +2 -2
  119. package/src/api/tron/TronSignTransaction.ts +1 -1
  120. package/src/api/utils.ts +1 -46
  121. package/src/core/index.ts +16 -28
  122. package/src/data-manager/DataManager.ts +51 -11
  123. package/src/data-manager/TransportManager.ts +6 -0
  124. package/src/device/Device.ts +15 -6
  125. package/src/device/DeviceCommands.ts +24 -3
  126. package/src/device/DeviceConnector.ts +33 -13
  127. package/src/device/DevicePool.ts +17 -8
  128. package/src/deviceProfile/buildDeviceFeatures.ts +2 -2
  129. package/src/deviceProfile/protocolV2DeviceIdentity.ts +3 -0
  130. package/src/index.ts +0 -5
  131. package/src/inject.ts +7 -209
  132. package/src/protocols/protocol-v2/resources.ts +44 -13
  133. package/src/types/api/checkAllFirmwareRelease.ts +1 -1
  134. package/src/types/api/firmwareUpdate.ts +5 -5
  135. package/src/types/api/index.ts +2 -288
  136. package/src/types/api/protocolV2.ts +2 -43
  137. package/src/types/device.ts +12 -3
  138. package/src/types/settings.ts +30 -21
  139. package/src/utils/deviceFeaturesCompat.ts +5 -0
  140. package/src/utils/deviceFeaturesUtils.ts +6 -3
  141. package/src/utils/deviceInfoUtils.ts +2 -0
  142. package/src/utils/deviceSettings.ts +3 -0
  143. package/__tests__/public-test-api-boundary.test.ts +0 -167
  144. package/dist/api/BixinBackupDevice.d.ts +0 -7
  145. package/dist/api/BixinBackupDevice.d.ts.map +0 -1
  146. package/dist/api/BixinLoadDevice.d.ts +0 -7
  147. package/dist/api/BixinLoadDevice.d.ts.map +0 -1
  148. package/dist/api/BixinMessageSE.d.ts +0 -8
  149. package/dist/api/BixinMessageSE.d.ts.map +0 -1
  150. package/dist/api/BixinVerifyDeviceRequest.d.ts +0 -8
  151. package/dist/api/BixinVerifyDeviceRequest.d.ts.map +0 -1
  152. package/dist/api/WebAuthnAddResidentCredential.d.ts +0 -8
  153. package/dist/api/WebAuthnAddResidentCredential.d.ts.map +0 -1
  154. package/dist/api/WebAuthnListResidentCredentials.d.ts +0 -8
  155. package/dist/api/WebAuthnListResidentCredentials.d.ts.map +0 -1
  156. package/dist/api/WebAuthnRemoveResidentCredential.d.ts +0 -8
  157. package/dist/api/WebAuthnRemoveResidentCredential.d.ts.map +0 -1
  158. package/dist/api/binance/BinanceGetAddress.d.ts +0 -8
  159. package/dist/api/binance/BinanceGetAddress.d.ts.map +0 -1
  160. package/dist/api/binance/BinanceGetPublicKey.d.ts +0 -8
  161. package/dist/api/binance/BinanceGetPublicKey.d.ts.map +0 -1
  162. package/dist/api/binance/BinanceSignTx.d.ts +0 -7
  163. package/dist/api/binance/BinanceSignTx.d.ts.map +0 -1
  164. package/dist/api/btc/BTCAuthorizeCoinJoin.d.ts +0 -7
  165. package/dist/api/btc/BTCAuthorizeCoinJoin.d.ts.map +0 -1
  166. package/dist/api/btc/BTCGetOwnershipId.d.ts +0 -7
  167. package/dist/api/btc/BTCGetOwnershipId.d.ts.map +0 -1
  168. package/dist/api/btc/BTCGetOwnershipProof.d.ts +0 -7
  169. package/dist/api/btc/BTCGetOwnershipProof.d.ts.map +0 -1
  170. package/dist/api/crypto/CryptoBatchGetPublickeys.d.ts +0 -8
  171. package/dist/api/crypto/CryptoBatchGetPublickeys.d.ts.map +0 -1
  172. package/dist/api/crypto/CryptoCipherKeyValue.d.ts +0 -8
  173. package/dist/api/crypto/CryptoCipherKeyValue.d.ts.map +0 -1
  174. package/dist/api/crypto/CryptoCosiCommit.d.ts +0 -8
  175. package/dist/api/crypto/CryptoCosiCommit.d.ts.map +0 -1
  176. package/dist/api/crypto/CryptoCosiSign.d.ts +0 -8
  177. package/dist/api/crypto/CryptoCosiSign.d.ts.map +0 -1
  178. package/dist/api/crypto/CryptoGetECDHSessionKey.d.ts +0 -8
  179. package/dist/api/crypto/CryptoGetECDHSessionKey.d.ts.map +0 -1
  180. package/dist/api/crypto/CryptoSignIdentity.d.ts +0 -8
  181. package/dist/api/crypto/CryptoSignIdentity.d.ts.map +0 -1
  182. package/dist/api/debug/DebugLinkDecision.d.ts +0 -7
  183. package/dist/api/debug/DebugLinkDecision.d.ts.map +0 -1
  184. package/dist/api/debug/DebugLinkEraseSdCard.d.ts +0 -7
  185. package/dist/api/debug/DebugLinkEraseSdCard.d.ts.map +0 -1
  186. package/dist/api/debug/DebugLinkFlashErase.d.ts +0 -7
  187. package/dist/api/debug/DebugLinkFlashErase.d.ts.map +0 -1
  188. package/dist/api/debug/DebugLinkGetState.d.ts +0 -7
  189. package/dist/api/debug/DebugLinkGetState.d.ts.map +0 -1
  190. package/dist/api/debug/DebugLinkMemoryRead.d.ts +0 -7
  191. package/dist/api/debug/DebugLinkMemoryRead.d.ts.map +0 -1
  192. package/dist/api/debug/DebugLinkMemoryWrite.d.ts +0 -7
  193. package/dist/api/debug/DebugLinkMemoryWrite.d.ts.map +0 -1
  194. package/dist/api/debug/DebugLinkRecordScreen.d.ts +0 -7
  195. package/dist/api/debug/DebugLinkRecordScreen.d.ts.map +0 -1
  196. package/dist/api/debug/DebugLinkReseedRandom.d.ts +0 -7
  197. package/dist/api/debug/DebugLinkReseedRandom.d.ts.map +0 -1
  198. package/dist/api/debug/DebugLinkStop.d.ts +0 -7
  199. package/dist/api/debug/DebugLinkStop.d.ts.map +0 -1
  200. package/dist/api/debug/DebugLinkWatchLayout.d.ts +0 -7
  201. package/dist/api/debug/DebugLinkWatchLayout.d.ts.map +0 -1
  202. package/dist/api/emmc/EmmcDirList.d.ts +0 -7
  203. package/dist/api/emmc/EmmcDirList.d.ts.map +0 -1
  204. package/dist/api/emmc/EmmcDirMake.d.ts +0 -7
  205. package/dist/api/emmc/EmmcDirMake.d.ts.map +0 -1
  206. package/dist/api/emmc/EmmcDirRemove.d.ts +0 -7
  207. package/dist/api/emmc/EmmcDirRemove.d.ts.map +0 -1
  208. package/dist/api/emmc/EmmcFileDelete.d.ts +0 -7
  209. package/dist/api/emmc/EmmcFileDelete.d.ts.map +0 -1
  210. package/dist/api/emmc/EmmcFileRead.d.ts +0 -7
  211. package/dist/api/emmc/EmmcFileRead.d.ts.map +0 -1
  212. package/dist/api/emmc/EmmcFileWrite.d.ts +0 -7
  213. package/dist/api/emmc/EmmcFileWrite.d.ts.map +0 -1
  214. package/dist/api/emmc/EmmcFixPermission.d.ts +0 -7
  215. package/dist/api/emmc/EmmcFixPermission.d.ts.map +0 -1
  216. package/dist/api/emmc/EmmcPathInfo.d.ts +0 -7
  217. package/dist/api/emmc/EmmcPathInfo.d.ts.map +0 -1
  218. package/dist/api/eos/EosGetPublicKey.d.ts +0 -8
  219. package/dist/api/eos/EosGetPublicKey.d.ts.map +0 -1
  220. package/dist/api/eos/EosSignTx.d.ts +0 -12
  221. package/dist/api/eos/EosSignTx.d.ts.map +0 -1
  222. package/dist/api/evmTrezor/EVMGetAddress.d.ts +0 -10
  223. package/dist/api/evmTrezor/EVMGetAddress.d.ts.map +0 -1
  224. package/dist/api/evmTrezor/EVMGetPublicKey.d.ts +0 -16
  225. package/dist/api/evmTrezor/EVMGetPublicKey.d.ts.map +0 -1
  226. package/dist/api/evmTrezor/EVMSignMessage.d.ts +0 -7
  227. package/dist/api/evmTrezor/EVMSignMessage.d.ts.map +0 -1
  228. package/dist/api/evmTrezor/EVMSignTransaction.d.ts +0 -15
  229. package/dist/api/evmTrezor/EVMSignTransaction.d.ts.map +0 -1
  230. package/dist/api/evmTrezor/EVMSignTypedData.d.ts +0 -43
  231. package/dist/api/evmTrezor/EVMSignTypedData.d.ts.map +0 -1
  232. package/dist/api/evmTrezor/EVMVerifyMessage.d.ts +0 -7
  233. package/dist/api/evmTrezor/EVMVerifyMessage.d.ts.map +0 -1
  234. package/dist/api/evmTrezor/legacyV1/getAddress.d.ts +0 -6
  235. package/dist/api/evmTrezor/legacyV1/getAddress.d.ts.map +0 -1
  236. package/dist/api/evmTrezor/legacyV1/getPublicKey.d.ts +0 -6
  237. package/dist/api/evmTrezor/legacyV1/getPublicKey.d.ts.map +0 -1
  238. package/dist/api/evmTrezor/legacyV1/signMessage.d.ts +0 -6
  239. package/dist/api/evmTrezor/legacyV1/signMessage.d.ts.map +0 -1
  240. package/dist/api/evmTrezor/legacyV1/signTransaction.d.ts +0 -9
  241. package/dist/api/evmTrezor/legacyV1/signTransaction.d.ts.map +0 -1
  242. package/dist/api/evmTrezor/legacyV1/signTypedData.d.ts +0 -10
  243. package/dist/api/evmTrezor/legacyV1/signTypedData.d.ts.map +0 -1
  244. package/dist/api/evmTrezor/legacyV1/signTypedHash.d.ts +0 -11
  245. package/dist/api/evmTrezor/legacyV1/signTypedHash.d.ts.map +0 -1
  246. package/dist/api/evmTrezor/legacyV1/verifyMessage.d.ts +0 -6
  247. package/dist/api/evmTrezor/legacyV1/verifyMessage.d.ts.map +0 -1
  248. package/dist/api/extensionMethodNames.d.ts +0 -3
  249. package/dist/api/extensionMethodNames.d.ts.map +0 -1
  250. package/dist/api/factoryMethods.d.ts +0 -3
  251. package/dist/api/factoryMethods.d.ts.map +0 -1
  252. package/dist/api/firmware/FirmwareErase.d.ts +0 -12
  253. package/dist/api/firmware/FirmwareErase.d.ts.map +0 -1
  254. package/dist/api/firmware/FirmwareEraseEx.d.ts +0 -12
  255. package/dist/api/firmware/FirmwareEraseEx.d.ts.map +0 -1
  256. package/dist/api/firmware/FirmwareUpdateEmmcTest.d.ts +0 -7
  257. package/dist/api/firmware/FirmwareUpdateEmmcTest.d.ts.map +0 -1
  258. package/dist/api/firmware/FirmwareUploadTest.d.ts +0 -7
  259. package/dist/api/firmware/FirmwareUploadTest.d.ts.map +0 -1
  260. package/dist/api/firmware/Reboot.d.ts +0 -7
  261. package/dist/api/firmware/Reboot.d.ts.map +0 -1
  262. package/dist/api/firmware/SelfTest.d.ts +0 -7
  263. package/dist/api/firmware/SelfTest.d.ts.map +0 -1
  264. package/dist/api/manager/DeviceCancelAuthorization.d.ts +0 -7
  265. package/dist/api/manager/DeviceCancelAuthorization.d.ts.map +0 -1
  266. package/dist/api/manager/DeviceChangeWipeCode.d.ts +0 -7
  267. package/dist/api/manager/DeviceChangeWipeCode.d.ts.map +0 -1
  268. package/dist/api/manager/DeviceDoPreauthorized.d.ts +0 -7
  269. package/dist/api/manager/DeviceDoPreauthorized.d.ts.map +0 -1
  270. package/dist/api/manager/DeviceEndSession.d.ts +0 -7
  271. package/dist/api/manager/DeviceEndSession.d.ts.map +0 -1
  272. package/dist/api/manager/DeviceGetEntropy.d.ts +0 -7
  273. package/dist/api/manager/DeviceGetEntropy.d.ts.map +0 -1
  274. package/dist/api/manager/DeviceGetFirmwareHash.d.ts +0 -7
  275. package/dist/api/manager/DeviceGetFirmwareHash.d.ts.map +0 -1
  276. package/dist/api/manager/DeviceInfoSettings.d.ts +0 -7
  277. package/dist/api/manager/DeviceInfoSettings.d.ts.map +0 -1
  278. package/dist/api/manager/DeviceLoad.d.ts +0 -7
  279. package/dist/api/manager/DeviceLoad.d.ts.map +0 -1
  280. package/dist/api/manager/DevicePing.d.ts +0 -7
  281. package/dist/api/manager/DevicePing.d.ts.map +0 -1
  282. package/dist/api/manager/DeviceReadSEPublicCert.d.ts +0 -7
  283. package/dist/api/manager/DeviceReadSEPublicCert.d.ts.map +0 -1
  284. package/dist/api/manager/DeviceSESignMessage.d.ts +0 -7
  285. package/dist/api/manager/DeviceSESignMessage.d.ts.map +0 -1
  286. package/dist/api/manager/DeviceSdProtect.d.ts +0 -7
  287. package/dist/api/manager/DeviceSdProtect.d.ts.map +0 -1
  288. package/dist/api/manager/DeviceSpiFlashRead.d.ts +0 -7
  289. package/dist/api/manager/DeviceSpiFlashRead.d.ts.map +0 -1
  290. package/dist/api/manager/DeviceSpiFlashWrite.d.ts +0 -7
  291. package/dist/api/manager/DeviceSpiFlashWrite.d.ts.map +0 -1
  292. package/dist/api/manager/DeviceUnlockPath.d.ts +0 -7
  293. package/dist/api/manager/DeviceUnlockPath.d.ts.map +0 -1
  294. package/dist/api/manager/DeviceWriteSEPrivateKey.d.ts +0 -7
  295. package/dist/api/manager/DeviceWriteSEPrivateKey.d.ts.map +0 -1
  296. package/dist/api/manager/DeviceWriteSEPublicCert.d.ts +0 -7
  297. package/dist/api/manager/DeviceWriteSEPublicCert.d.ts.map +0 -1
  298. package/dist/api/manager/GetDeviceInfoSettings.d.ts +0 -7
  299. package/dist/api/manager/GetDeviceInfoSettings.d.ts.map +0 -1
  300. package/dist/api/manager/GetPublicKeyMultiple.d.ts +0 -7
  301. package/dist/api/manager/GetPublicKeyMultiple.d.ts.map +0 -1
  302. package/dist/api/manager/ListResDir.d.ts +0 -7
  303. package/dist/api/manager/ListResDir.d.ts.map +0 -1
  304. package/dist/api/manager/NFTWriteData.d.ts +0 -7
  305. package/dist/api/manager/NFTWriteData.d.ts.map +0 -1
  306. package/dist/api/manager/NFTWriteInfo.d.ts +0 -7
  307. package/dist/api/manager/NFTWriteInfo.d.ts.map +0 -1
  308. package/dist/api/manager/ReadSEPublicKey.d.ts +0 -7
  309. package/dist/api/manager/ReadSEPublicKey.d.ts.map +0 -1
  310. package/dist/api/manager/ResourceUpdate.d.ts +0 -6
  311. package/dist/api/manager/ResourceUpdate.d.ts.map +0 -1
  312. package/dist/api/methodExtension.d.ts +0 -13
  313. package/dist/api/methodExtension.d.ts.map +0 -1
  314. package/dist/api/monero/MoneroGetAddress.d.ts +0 -9
  315. package/dist/api/monero/MoneroGetAddress.d.ts.map +0 -1
  316. package/dist/api/monero/MoneroGetWatchKey.d.ts +0 -8
  317. package/dist/api/monero/MoneroGetWatchKey.d.ts.map +0 -1
  318. package/dist/api/nem/NEMDecryptMessage.d.ts +0 -8
  319. package/dist/api/nem/NEMDecryptMessage.d.ts.map +0 -1
  320. package/dist/api/protocol-v2/DeviceFactoryCertificateRead.d.ts +0 -7
  321. package/dist/api/protocol-v2/DeviceFactoryCertificateRead.d.ts.map +0 -1
  322. package/dist/api/protocol-v2/DeviceFactoryCertificateWrite.d.ts +0 -8
  323. package/dist/api/protocol-v2/DeviceFactoryCertificateWrite.d.ts.map +0 -1
  324. package/dist/api/protocol-v2/DeviceFactoryChallengeSign.d.ts +0 -8
  325. package/dist/api/protocol-v2/DeviceFactoryChallengeSign.d.ts.map +0 -1
  326. package/dist/api/testMethods.d.ts +0 -82
  327. package/dist/api/testMethods.d.ts.map +0 -1
  328. package/dist/api/tezos/TezosGetAddress.d.ts +0 -9
  329. package/dist/api/tezos/TezosGetAddress.d.ts.map +0 -1
  330. package/dist/api/tezos/TezosGetPublicKey.d.ts +0 -8
  331. package/dist/api/tezos/TezosGetPublicKey.d.ts.map +0 -1
  332. package/dist/api/tezos/TezosSignTx.d.ts +0 -12
  333. package/dist/api/tezos/TezosSignTx.d.ts.map +0 -1
  334. package/dist/types/api/binanceGetAddress.d.ts +0 -11
  335. package/dist/types/api/binanceGetAddress.d.ts.map +0 -1
  336. package/dist/types/api/binanceGetPublicKey.d.ts +0 -11
  337. package/dist/types/api/binanceGetPublicKey.d.ts.map +0 -1
  338. package/dist/types/api/binanceSignTx.d.ts +0 -7
  339. package/dist/types/api/binanceSignTx.d.ts.map +0 -1
  340. package/dist/types/api/bixinBackupDevice.d.ts +0 -4
  341. package/dist/types/api/bixinBackupDevice.d.ts.map +0 -1
  342. package/dist/types/api/bixinLoadDevice.d.ts +0 -4
  343. package/dist/types/api/bixinLoadDevice.d.ts.map +0 -1
  344. package/dist/types/api/bixinMessageSE.d.ts +0 -4
  345. package/dist/types/api/bixinMessageSE.d.ts.map +0 -1
  346. package/dist/types/api/bixinVerifyDeviceRequest.d.ts +0 -4
  347. package/dist/types/api/bixinVerifyDeviceRequest.d.ts.map +0 -1
  348. package/dist/types/api/btcAuthorizeCoinJoin.d.ts +0 -13
  349. package/dist/types/api/btcAuthorizeCoinJoin.d.ts.map +0 -1
  350. package/dist/types/api/btcGetOwnershipId.d.ts +0 -10
  351. package/dist/types/api/btcGetOwnershipId.d.ts.map +0 -1
  352. package/dist/types/api/btcGetOwnershipProof.d.ts +0 -13
  353. package/dist/types/api/btcGetOwnershipProof.d.ts.map +0 -1
  354. package/dist/types/api/cryptoBatchGetPublickeys.d.ts +0 -12
  355. package/dist/types/api/cryptoBatchGetPublickeys.d.ts.map +0 -1
  356. package/dist/types/api/cryptoCipherKeyValue.d.ts +0 -13
  357. package/dist/types/api/cryptoCipherKeyValue.d.ts.map +0 -1
  358. package/dist/types/api/cryptoCosiCommit.d.ts +0 -8
  359. package/dist/types/api/cryptoCosiCommit.d.ts.map +0 -1
  360. package/dist/types/api/cryptoCosiSign.d.ts +0 -10
  361. package/dist/types/api/cryptoCosiSign.d.ts.map +0 -1
  362. package/dist/types/api/cryptoGetECDHSessionKey.d.ts +0 -4
  363. package/dist/types/api/cryptoGetECDHSessionKey.d.ts.map +0 -1
  364. package/dist/types/api/cryptoSignIdentity.d.ts +0 -4
  365. package/dist/types/api/cryptoSignIdentity.d.ts.map +0 -1
  366. package/dist/types/api/debugLinkDecision.d.ts +0 -4
  367. package/dist/types/api/debugLinkDecision.d.ts.map +0 -1
  368. package/dist/types/api/debugLinkEraseSdCard.d.ts +0 -4
  369. package/dist/types/api/debugLinkEraseSdCard.d.ts.map +0 -1
  370. package/dist/types/api/debugLinkFlashErase.d.ts +0 -4
  371. package/dist/types/api/debugLinkFlashErase.d.ts.map +0 -1
  372. package/dist/types/api/debugLinkGetState.d.ts +0 -4
  373. package/dist/types/api/debugLinkGetState.d.ts.map +0 -1
  374. package/dist/types/api/debugLinkMemoryRead.d.ts +0 -4
  375. package/dist/types/api/debugLinkMemoryRead.d.ts.map +0 -1
  376. package/dist/types/api/debugLinkMemoryWrite.d.ts +0 -4
  377. package/dist/types/api/debugLinkMemoryWrite.d.ts.map +0 -1
  378. package/dist/types/api/debugLinkRecordScreen.d.ts +0 -4
  379. package/dist/types/api/debugLinkRecordScreen.d.ts.map +0 -1
  380. package/dist/types/api/debugLinkReseedRandom.d.ts +0 -4
  381. package/dist/types/api/debugLinkReseedRandom.d.ts.map +0 -1
  382. package/dist/types/api/debugLinkStop.d.ts +0 -4
  383. package/dist/types/api/debugLinkStop.d.ts.map +0 -1
  384. package/dist/types/api/debugLinkWatchLayout.d.ts +0 -4
  385. package/dist/types/api/debugLinkWatchLayout.d.ts.map +0 -1
  386. package/dist/types/api/deviceCancelAuthorization.d.ts +0 -4
  387. package/dist/types/api/deviceCancelAuthorization.d.ts.map +0 -1
  388. package/dist/types/api/deviceChangeWipeCode.d.ts +0 -4
  389. package/dist/types/api/deviceChangeWipeCode.d.ts.map +0 -1
  390. package/dist/types/api/deviceDoPreauthorized.d.ts +0 -4
  391. package/dist/types/api/deviceDoPreauthorized.d.ts.map +0 -1
  392. package/dist/types/api/deviceEndSession.d.ts +0 -4
  393. package/dist/types/api/deviceEndSession.d.ts.map +0 -1
  394. package/dist/types/api/deviceGetEntropy.d.ts +0 -4
  395. package/dist/types/api/deviceGetEntropy.d.ts.map +0 -1
  396. package/dist/types/api/deviceGetFirmwareHash.d.ts +0 -4
  397. package/dist/types/api/deviceGetFirmwareHash.d.ts.map +0 -1
  398. package/dist/types/api/deviceGetInfo.d.ts +0 -4
  399. package/dist/types/api/deviceGetInfo.d.ts.map +0 -1
  400. package/dist/types/api/deviceInfoSettings.d.ts +0 -4
  401. package/dist/types/api/deviceInfoSettings.d.ts.map +0 -1
  402. package/dist/types/api/deviceLoad.d.ts +0 -16
  403. package/dist/types/api/deviceLoad.d.ts.map +0 -1
  404. package/dist/types/api/devicePing.d.ts +0 -4
  405. package/dist/types/api/devicePing.d.ts.map +0 -1
  406. package/dist/types/api/deviceReadSEPublicCert.d.ts +0 -4
  407. package/dist/types/api/deviceReadSEPublicCert.d.ts.map +0 -1
  408. package/dist/types/api/deviceSESignMessage.d.ts +0 -4
  409. package/dist/types/api/deviceSESignMessage.d.ts.map +0 -1
  410. package/dist/types/api/deviceSdProtect.d.ts +0 -4
  411. package/dist/types/api/deviceSdProtect.d.ts.map +0 -1
  412. package/dist/types/api/deviceSpiFlashRead.d.ts +0 -4
  413. package/dist/types/api/deviceSpiFlashRead.d.ts.map +0 -1
  414. package/dist/types/api/deviceSpiFlashWrite.d.ts +0 -4
  415. package/dist/types/api/deviceSpiFlashWrite.d.ts.map +0 -1
  416. package/dist/types/api/deviceUnlockPath.d.ts +0 -11
  417. package/dist/types/api/deviceUnlockPath.d.ts.map +0 -1
  418. package/dist/types/api/deviceWriteSEPrivateKey.d.ts +0 -4
  419. package/dist/types/api/deviceWriteSEPrivateKey.d.ts.map +0 -1
  420. package/dist/types/api/deviceWriteSEPublicCert.d.ts +0 -4
  421. package/dist/types/api/deviceWriteSEPublicCert.d.ts.map +0 -1
  422. package/dist/types/api/emmcDirList.d.ts +0 -4
  423. package/dist/types/api/emmcDirList.d.ts.map +0 -1
  424. package/dist/types/api/emmcDirMake.d.ts +0 -4
  425. package/dist/types/api/emmcDirMake.d.ts.map +0 -1
  426. package/dist/types/api/emmcDirRemove.d.ts +0 -4
  427. package/dist/types/api/emmcDirRemove.d.ts.map +0 -1
  428. package/dist/types/api/emmcFileDelete.d.ts +0 -4
  429. package/dist/types/api/emmcFileDelete.d.ts.map +0 -1
  430. package/dist/types/api/emmcFileRead.d.ts +0 -4
  431. package/dist/types/api/emmcFileRead.d.ts.map +0 -1
  432. package/dist/types/api/emmcFileWrite.d.ts +0 -4
  433. package/dist/types/api/emmcFileWrite.d.ts.map +0 -1
  434. package/dist/types/api/emmcFixPermission.d.ts +0 -4
  435. package/dist/types/api/emmcFixPermission.d.ts.map +0 -1
  436. package/dist/types/api/emmcPathInfo.d.ts +0 -4
  437. package/dist/types/api/emmcPathInfo.d.ts.map +0 -1
  438. package/dist/types/api/eosGetPublicKey.d.ts +0 -8
  439. package/dist/types/api/eosGetPublicKey.d.ts.map +0 -1
  440. package/dist/types/api/eosSignTx.d.ts +0 -7
  441. package/dist/types/api/eosSignTx.d.ts.map +0 -1
  442. package/dist/types/api/evmGetAddressTrezor.d.ts +0 -15
  443. package/dist/types/api/evmGetAddressTrezor.d.ts.map +0 -1
  444. package/dist/types/api/evmGetPublicKeyTrezor.d.ts +0 -20
  445. package/dist/types/api/evmGetPublicKeyTrezor.d.ts.map +0 -1
  446. package/dist/types/api/evmSignMessageTrezor.d.ts +0 -9
  447. package/dist/types/api/evmSignMessageTrezor.d.ts.map +0 -1
  448. package/dist/types/api/evmSignTransactionTrezor.d.ts +0 -40
  449. package/dist/types/api/evmSignTransactionTrezor.d.ts.map +0 -1
  450. package/dist/types/api/evmSignTypedDataTrezor.d.ts +0 -34
  451. package/dist/types/api/evmSignTypedDataTrezor.d.ts.map +0 -1
  452. package/dist/types/api/evmVerifyMessageTrezor.d.ts +0 -10
  453. package/dist/types/api/evmVerifyMessageTrezor.d.ts.map +0 -1
  454. package/dist/types/api/firmwareErase.d.ts +0 -4
  455. package/dist/types/api/firmwareErase.d.ts.map +0 -1
  456. package/dist/types/api/firmwareEraseEx.d.ts +0 -4
  457. package/dist/types/api/firmwareEraseEx.d.ts.map +0 -1
  458. package/dist/types/api/firmwareUpdateEmmcTest.d.ts +0 -4
  459. package/dist/types/api/firmwareUpdateEmmcTest.d.ts.map +0 -1
  460. package/dist/types/api/firmwareUploadTest.d.ts +0 -4
  461. package/dist/types/api/firmwareUploadTest.d.ts.map +0 -1
  462. package/dist/types/api/getPublicKeyMultiple.d.ts +0 -4
  463. package/dist/types/api/getPublicKeyMultiple.d.ts.map +0 -1
  464. package/dist/types/api/listResDir.d.ts +0 -4
  465. package/dist/types/api/listResDir.d.ts.map +0 -1
  466. package/dist/types/api/moneroGetAddress.d.ts +0 -14
  467. package/dist/types/api/moneroGetAddress.d.ts.map +0 -1
  468. package/dist/types/api/moneroGetWatchKey.d.ts +0 -14
  469. package/dist/types/api/moneroGetWatchKey.d.ts.map +0 -1
  470. package/dist/types/api/nemDecryptMessage.d.ts +0 -10
  471. package/dist/types/api/nemDecryptMessage.d.ts.map +0 -1
  472. package/dist/types/api/nftWriteData.d.ts +0 -4
  473. package/dist/types/api/nftWriteData.d.ts.map +0 -1
  474. package/dist/types/api/nftWriteInfo.d.ts +0 -4
  475. package/dist/types/api/nftWriteInfo.d.ts.map +0 -1
  476. package/dist/types/api/readSEPublicKey.d.ts +0 -4
  477. package/dist/types/api/readSEPublicKey.d.ts.map +0 -1
  478. package/dist/types/api/reboot.d.ts +0 -4
  479. package/dist/types/api/reboot.d.ts.map +0 -1
  480. package/dist/types/api/resourceUpdate.d.ts +0 -7
  481. package/dist/types/api/resourceUpdate.d.ts.map +0 -1
  482. package/dist/types/api/selfTest.d.ts +0 -4
  483. package/dist/types/api/selfTest.d.ts.map +0 -1
  484. package/dist/types/api/tezosGetAddress.d.ts +0 -14
  485. package/dist/types/api/tezosGetAddress.d.ts.map +0 -1
  486. package/dist/types/api/tezosGetPublicKey.d.ts +0 -14
  487. package/dist/types/api/tezosGetPublicKey.d.ts.map +0 -1
  488. package/dist/types/api/tezosSignTx.d.ts +0 -7
  489. package/dist/types/api/tezosSignTx.d.ts.map +0 -1
  490. package/dist/types/api/webAuthnAddResidentCredential.d.ts +0 -4
  491. package/dist/types/api/webAuthnAddResidentCredential.d.ts.map +0 -1
  492. package/dist/types/api/webAuthnListResidentCredentials.d.ts +0 -4
  493. package/dist/types/api/webAuthnListResidentCredentials.d.ts.map +0 -1
  494. package/dist/types/api/webAuthnRemoveResidentCredential.d.ts +0 -4
  495. package/dist/types/api/webAuthnRemoveResidentCredential.d.ts.map +0 -1
  496. package/src/api/BixinBackupDevice.ts +0 -15
  497. package/src/api/BixinLoadDevice.ts +0 -22
  498. package/src/api/BixinMessageSE.ts +0 -22
  499. package/src/api/BixinVerifyDeviceRequest.ts +0 -22
  500. package/src/api/WebAuthnAddResidentCredential.ts +0 -22
  501. package/src/api/WebAuthnListResidentCredentials.ts +0 -24
  502. package/src/api/WebAuthnRemoveResidentCredential.ts +0 -22
  503. package/src/api/binance/BinanceGetAddress.ts +0 -26
  504. package/src/api/binance/BinanceGetPublicKey.ts +0 -26
  505. package/src/api/binance/BinanceSignTx.ts +0 -35
  506. package/src/api/btc/BTCAuthorizeCoinJoin.ts +0 -37
  507. package/src/api/btc/BTCGetOwnershipId.ts +0 -34
  508. package/src/api/btc/BTCGetOwnershipProof.ts +0 -37
  509. package/src/api/crypto/CryptoBatchGetPublickeys.ts +0 -30
  510. package/src/api/crypto/CryptoCipherKeyValue.ts +0 -29
  511. package/src/api/crypto/CryptoCosiCommit.ts +0 -24
  512. package/src/api/crypto/CryptoCosiSign.ts +0 -26
  513. package/src/api/crypto/CryptoGetECDHSessionKey.ts +0 -24
  514. package/src/api/crypto/CryptoSignIdentity.ts +0 -25
  515. package/src/api/debug/DebugLinkDecision.ts +0 -25
  516. package/src/api/debug/DebugLinkEraseSdCard.ts +0 -23
  517. package/src/api/debug/DebugLinkFlashErase.ts +0 -23
  518. package/src/api/debug/DebugLinkGetState.ts +0 -21
  519. package/src/api/debug/DebugLinkMemoryRead.ts +0 -24
  520. package/src/api/debug/DebugLinkMemoryWrite.ts +0 -25
  521. package/src/api/debug/DebugLinkRecordScreen.ts +0 -23
  522. package/src/api/debug/DebugLinkReseedRandom.ts +0 -23
  523. package/src/api/debug/DebugLinkStop.ts +0 -25
  524. package/src/api/debug/DebugLinkWatchLayout.ts +0 -23
  525. package/src/api/emmc/EmmcDirList.ts +0 -20
  526. package/src/api/emmc/EmmcDirMake.ts +0 -20
  527. package/src/api/emmc/EmmcDirRemove.ts +0 -20
  528. package/src/api/emmc/EmmcFileDelete.ts +0 -20
  529. package/src/api/emmc/EmmcFileRead.ts +0 -21
  530. package/src/api/emmc/EmmcFileWrite.ts +0 -23
  531. package/src/api/emmc/EmmcFixPermission.ts +0 -17
  532. package/src/api/emmc/EmmcPathInfo.ts +0 -20
  533. package/src/api/eos/EosGetPublicKey.ts +0 -26
  534. package/src/api/eos/EosSignTx.ts +0 -40
  535. package/src/api/evmTrezor/EVMGetAddress.ts +0 -75
  536. package/src/api/evmTrezor/EVMGetPublicKey.ts +0 -106
  537. package/src/api/evmTrezor/EVMSignMessage.ts +0 -40
  538. package/src/api/evmTrezor/EVMSignTransaction.ts +0 -83
  539. package/src/api/evmTrezor/EVMSignTypedData.ts +0 -366
  540. package/src/api/evmTrezor/EVMVerifyMessage.ts +0 -37
  541. package/src/api/evmTrezor/legacyV1/getAddress.ts +0 -16
  542. package/src/api/evmTrezor/legacyV1/getPublicKey.ts +0 -20
  543. package/src/api/evmTrezor/legacyV1/signMessage.ts +0 -22
  544. package/src/api/evmTrezor/legacyV1/signTransaction.ts +0 -24
  545. package/src/api/evmTrezor/legacyV1/signTypedData.ts +0 -36
  546. package/src/api/evmTrezor/legacyV1/signTypedHash.ts +0 -48
  547. package/src/api/evmTrezor/legacyV1/verifyMessage.ts +0 -19
  548. package/src/api/extensionMethodNames.ts +0 -88
  549. package/src/api/factoryMethods.ts +0 -2
  550. package/src/api/firmware/FirmwareErase.ts +0 -18
  551. package/src/api/firmware/FirmwareEraseEx.ts +0 -18
  552. package/src/api/firmware/FirmwareUpdateEmmcTest.ts +0 -18
  553. package/src/api/firmware/FirmwareUploadTest.ts +0 -17
  554. package/src/api/firmware/Reboot.ts +0 -17
  555. package/src/api/firmware/SelfTest.ts +0 -17
  556. package/src/api/manager/DeviceCancelAuthorization.ts +0 -15
  557. package/src/api/manager/DeviceChangeWipeCode.ts +0 -19
  558. package/src/api/manager/DeviceDoPreauthorized.ts +0 -15
  559. package/src/api/manager/DeviceEndSession.ts +0 -19
  560. package/src/api/manager/DeviceGetEntropy.ts +0 -19
  561. package/src/api/manager/DeviceGetFirmwareHash.ts +0 -23
  562. package/src/api/manager/DeviceInfoSettings.ts +0 -23
  563. package/src/api/manager/DeviceLoad.ts +0 -27
  564. package/src/api/manager/DevicePing.ts +0 -19
  565. package/src/api/manager/DeviceReadSEPublicCert.ts +0 -18
  566. package/src/api/manager/DeviceSESignMessage.ts +0 -23
  567. package/src/api/manager/DeviceSdProtect.ts +0 -18
  568. package/src/api/manager/DeviceSpiFlashRead.ts +0 -22
  569. package/src/api/manager/DeviceSpiFlashWrite.ts +0 -22
  570. package/src/api/manager/DeviceUnlockPath.ts +0 -26
  571. package/src/api/manager/DeviceWriteSEPrivateKey.ts +0 -23
  572. package/src/api/manager/DeviceWriteSEPublicCert.ts +0 -23
  573. package/src/api/manager/GetDeviceInfoSettings.ts +0 -20
  574. package/src/api/manager/GetPublicKeyMultiple.ts +0 -24
  575. package/src/api/manager/ListResDir.ts +0 -19
  576. package/src/api/manager/NFTWriteData.ts +0 -21
  577. package/src/api/manager/NFTWriteInfo.ts +0 -23
  578. package/src/api/manager/ReadSEPublicKey.ts +0 -20
  579. package/src/api/manager/ResourceUpdate.ts +0 -22
  580. package/src/api/methodExtension.ts +0 -27
  581. package/src/api/monero/MoneroGetAddress.ts +0 -64
  582. package/src/api/monero/MoneroGetWatchKey.ts +0 -59
  583. package/src/api/nem/NEMDecryptMessage.ts +0 -29
  584. package/src/api/protocol-v2/DeviceFactoryCertificateRead.ts +0 -25
  585. package/src/api/protocol-v2/DeviceFactoryCertificateWrite.ts +0 -30
  586. package/src/api/protocol-v2/DeviceFactoryChallengeSign.ts +0 -28
  587. package/src/api/testMethods.ts +0 -95
  588. package/src/api/tezos/TezosGetAddress.ts +0 -64
  589. package/src/api/tezos/TezosGetPublicKey.ts +0 -63
  590. package/src/api/tezos/TezosSignTx.ts +0 -44
  591. package/src/types/api/binanceGetAddress.ts +0 -17
  592. package/src/types/api/binanceGetPublicKey.ts +0 -17
  593. package/src/types/api/binanceSignTx.ts +0 -15
  594. package/src/types/api/bixinBackupDevice.ts +0 -8
  595. package/src/types/api/bixinLoadDevice.ts +0 -8
  596. package/src/types/api/bixinMessageSE.ts +0 -8
  597. package/src/types/api/bixinVerifyDeviceRequest.ts +0 -8
  598. package/src/types/api/btcAuthorizeCoinJoin.ts +0 -18
  599. package/src/types/api/btcGetOwnershipId.ts +0 -19
  600. package/src/types/api/btcGetOwnershipProof.ts +0 -22
  601. package/src/types/api/cryptoBatchGetPublickeys.ts +0 -18
  602. package/src/types/api/cryptoCipherKeyValue.ts +0 -18
  603. package/src/types/api/cryptoCosiCommit.ts +0 -13
  604. package/src/types/api/cryptoCosiSign.ts +0 -15
  605. package/src/types/api/cryptoGetECDHSessionKey.ts +0 -8
  606. package/src/types/api/cryptoSignIdentity.ts +0 -8
  607. package/src/types/api/debugLinkDecision.ts +0 -7
  608. package/src/types/api/debugLinkEraseSdCard.ts +0 -7
  609. package/src/types/api/debugLinkFlashErase.ts +0 -7
  610. package/src/types/api/debugLinkGetState.ts +0 -7
  611. package/src/types/api/debugLinkMemoryRead.ts +0 -7
  612. package/src/types/api/debugLinkMemoryWrite.ts +0 -7
  613. package/src/types/api/debugLinkRecordScreen.ts +0 -7
  614. package/src/types/api/debugLinkReseedRandom.ts +0 -7
  615. package/src/types/api/debugLinkStop.ts +0 -7
  616. package/src/types/api/debugLinkWatchLayout.ts +0 -7
  617. package/src/types/api/deviceCancelAuthorization.ts +0 -7
  618. package/src/types/api/deviceChangeWipeCode.ts +0 -7
  619. package/src/types/api/deviceDoPreauthorized.ts +0 -7
  620. package/src/types/api/deviceEndSession.ts +0 -7
  621. package/src/types/api/deviceGetEntropy.ts +0 -7
  622. package/src/types/api/deviceGetFirmwareHash.ts +0 -7
  623. package/src/types/api/deviceGetInfo.ts +0 -7
  624. package/src/types/api/deviceInfoSettings.ts +0 -7
  625. package/src/types/api/deviceLoad.ts +0 -19
  626. package/src/types/api/devicePing.ts +0 -7
  627. package/src/types/api/deviceReadSEPublicCert.ts +0 -7
  628. package/src/types/api/deviceSESignMessage.ts +0 -7
  629. package/src/types/api/deviceSdProtect.ts +0 -7
  630. package/src/types/api/deviceSpiFlashRead.ts +0 -7
  631. package/src/types/api/deviceSpiFlashWrite.ts +0 -7
  632. package/src/types/api/deviceUnlockPath.ts +0 -16
  633. package/src/types/api/deviceWriteSEPrivateKey.ts +0 -7
  634. package/src/types/api/deviceWriteSEPublicCert.ts +0 -7
  635. package/src/types/api/emmcDirList.ts +0 -7
  636. package/src/types/api/emmcDirMake.ts +0 -7
  637. package/src/types/api/emmcDirRemove.ts +0 -7
  638. package/src/types/api/emmcFileDelete.ts +0 -7
  639. package/src/types/api/emmcFileRead.ts +0 -7
  640. package/src/types/api/emmcFileWrite.ts +0 -7
  641. package/src/types/api/emmcFixPermission.ts +0 -7
  642. package/src/types/api/emmcPathInfo.ts +0 -7
  643. package/src/types/api/eosGetPublicKey.ts +0 -13
  644. package/src/types/api/eosSignTx.ts +0 -12
  645. package/src/types/api/evmGetAddressTrezor.ts +0 -24
  646. package/src/types/api/evmGetPublicKeyTrezor.ts +0 -31
  647. package/src/types/api/evmSignMessageTrezor.ts +0 -14
  648. package/src/types/api/evmSignTransactionTrezor.ts +0 -49
  649. package/src/types/api/evmSignTypedDataTrezor.ts +0 -42
  650. package/src/types/api/evmVerifyMessageTrezor.ts +0 -15
  651. package/src/types/api/firmwareErase.ts +0 -4
  652. package/src/types/api/firmwareEraseEx.ts +0 -7
  653. package/src/types/api/firmwareUpdateEmmcTest.ts +0 -7
  654. package/src/types/api/firmwareUploadTest.ts +0 -7
  655. package/src/types/api/getPublicKeyMultiple.ts +0 -11
  656. package/src/types/api/listResDir.ts +0 -8
  657. package/src/types/api/moneroGetAddress.ts +0 -23
  658. package/src/types/api/moneroGetWatchKey.ts +0 -26
  659. package/src/types/api/nemDecryptMessage.ts +0 -15
  660. package/src/types/api/nftWriteData.ts +0 -8
  661. package/src/types/api/nftWriteInfo.ts +0 -8
  662. package/src/types/api/readSEPublicKey.ts +0 -8
  663. package/src/types/api/reboot.ts +0 -4
  664. package/src/types/api/resourceUpdate.ts +0 -11
  665. package/src/types/api/selfTest.ts +0 -7
  666. package/src/types/api/tezosGetAddress.ts +0 -23
  667. package/src/types/api/tezosGetPublicKey.ts +0 -23
  668. package/src/types/api/tezosSignTx.ts +0 -12
  669. package/src/types/api/webAuthnAddResidentCredential.ts +0 -8
  670. package/src/types/api/webAuthnListResidentCredentials.ts +0 -8
  671. package/src/types/api/webAuthnRemoveResidentCredential.ts +0 -8
@@ -103,7 +103,7 @@ export class DevicePool extends EventEmitter {
103
103
  const device = this.devicesCache[connectId];
104
104
  if (device) {
105
105
  const exist = descriptorList.find(d => d.path === device.originalDescriptor.path);
106
- if (exist) {
106
+ if (exist && !initOptions?.forceProtocolDetection) {
107
107
  // Log.debug('find existed Device: ', connectId);
108
108
  device.updateDescriptor(exist, true);
109
109
  await this._refreshRuntimeState(device, initOptions);
@@ -151,14 +151,23 @@ export class DevicePool extends EventEmitter {
151
151
  }
152
152
  }
153
153
 
154
- static async _createDevice(descriptor: DeviceDescriptor, initOptions?: InitOptions) {
155
- let device = this.getDeviceByPath(descriptor.path);
156
- if (!device) {
157
- device = Device.fromDescriptor(descriptor);
154
+ static async _createDevice(
155
+ descriptor: DeviceDescriptor,
156
+ initOptions?: InitOptions
157
+ ): Promise<Device> {
158
+ const cachedDevice = this.getDeviceByPath(descriptor.path);
159
+ const forceProtocolDetection = initOptions?.forceProtocolDetection === true;
160
+ const isNewDevice = !cachedDevice;
161
+ const device = cachedDevice ?? Device.fromDescriptor(descriptor);
162
+ if (isNewDevice || forceProtocolDetection) {
158
163
  device.deviceConnector = this.connector;
159
- await device.connect(initOptions?.connectProtocol, {
160
- forceProtocolDetection: initOptions?.forceProtocolDetection,
161
- });
164
+ if (forceProtocolDetection && !isNewDevice) {
165
+ await device.acquire(initOptions?.connectProtocol, { forceProtocolDetection: true });
166
+ } else {
167
+ await device.connect(initOptions?.connectProtocol, {
168
+ forceProtocolDetection: initOptions?.forceProtocolDetection,
169
+ });
170
+ }
162
171
  try {
163
172
  await device.initialize(initOptions);
164
173
  if (initOptions?.refreshRuntimeState && device.isProtocolV2()) {
@@ -1,4 +1,4 @@
1
- import { EFirmwareType } from '@onekeyfe/hd-shared';
1
+ import { EDeviceType, EFirmwareType } from '@onekeyfe/hd-shared';
2
2
 
3
3
  import {
4
4
  resolveDeviceBleFirmwareVersion,
@@ -386,7 +386,7 @@ export const buildProtocolV2FeaturesPayload = ({
386
386
  device_id: deviceId ?? undefined,
387
387
  session_id: cached?.sessionId ?? undefined,
388
388
  ble_name: bleName ?? undefined,
389
- onekey_device_type: 'PRO2',
389
+ onekey_device_type: deviceType === EDeviceType.Unknown ? undefined : deviceType.toUpperCase(),
390
390
  passphrase_protection: passphraseProtection ?? undefined,
391
391
  bootloader_mode: bootloaderMode,
392
392
  passphraseState: cached?.passphraseState,
@@ -26,6 +26,9 @@ export const resolveProtocolV2DeviceIdentity = (
26
26
  case DeviceType.PRO2:
27
27
  case 'PRO2':
28
28
  return { deviceType: EDeviceType.Pro2, model: 'pro2' };
29
+ case DeviceType.NEO:
30
+ case 'NEO':
31
+ return { deviceType: EDeviceType.Neo, model: 'neo' };
29
32
  default:
30
33
  return { deviceType: EDeviceType.Unknown, model: null };
31
34
  }
package/src/index.ts CHANGED
@@ -10,11 +10,6 @@ export type { LowLevelCoreApi, LowLevelInjectApi } from './lowLevelInject';
10
10
  export type { TopLevelInjectApi } from './topLevelInject';
11
11
 
12
12
  export { default as Core, init as initCore, switchTransport } from './core';
13
- export type { CoreOptions } from './core';
14
- export { factoryApiMethodExtension, testApiMethodExtension } from './api/methodExtension';
15
- export type { CoreMethodConstructor, CoreMethodExtension } from './api/methodExtension';
16
- export { FACTORY_API_METHOD_NAMES, TEST_API_METHOD_NAMES } from './api/extensionMethodNames';
17
- export { createFactoryApi, createTestApi } from './inject';
18
13
 
19
14
  export * from './constants';
20
15
  export * from './utils';
package/src/inject.ts CHANGED
@@ -1,10 +1,8 @@
1
- import { FACTORY_API_METHOD_NAMES, TEST_API_METHOD_NAMES } from './api/extensionMethodNames';
2
-
3
1
  import type { HardwareConnectProtocol } from '@onekeyfe/hd-shared';
4
2
  import type { Unsuccessful } from './types';
5
3
  import type { EventEmitter } from 'events';
6
4
  import type { CallMethod } from './events';
7
- import type { CoreApi, FactoryApi, TestApi, TestApiMethods } from './types/api';
5
+ import type { CoreApi } from './types/api';
8
6
  import type { AllNetworkAddress } from './types/api/allNetworkGetAddress';
9
7
 
10
8
  type CallbackFunction = (data?: any, error?: Unsuccessful) => void;
@@ -133,7 +131,10 @@ export const inject = ({
133
131
  return api;
134
132
  };
135
133
 
136
- type ApiControlMethodName =
134
+ export const createCoreApi = (
135
+ call: CoreApi['call']
136
+ ): Omit<
137
+ CoreApi,
137
138
  | 'on'
138
139
  | 'off'
139
140
  | 'emit'
@@ -145,11 +146,8 @@ type ApiControlMethodName =
145
146
  | 'uiResponse'
146
147
  | 'cancel'
147
148
  | 'updateSettings'
148
- | 'switchTransport';
149
-
150
- type InjectedApi<TApi> = Omit<TApi, ApiControlMethodName>;
151
-
152
- const createAllCoreApi = (call: CoreApi['call']): InjectedApi<TestApi> => ({
149
+ | 'switchTransport'
150
+ > => ({
153
151
  getLogs: () => call({ method: 'getLogs' }),
154
152
  clearSessionCache: params => call({ ...params, method: 'clearSessionCache' }),
155
153
  /**
@@ -217,16 +215,6 @@ const createAllCoreApi = (call: CoreApi['call']): InjectedApi<TestApi> => ({
217
215
  deviceReboot: (connectId, params) => call({ ...params, connectId, method: 'deviceReboot' }),
218
216
  deviceGetOnboardingStatus: (connectId, params) =>
219
217
  call({ ...params, connectId, method: 'deviceGetOnboardingStatus' }),
220
- deviceProvisionFactoryInfo: (connectId, params) =>
221
- call({ ...params, connectId, method: 'deviceProvisionFactoryInfo' }),
222
- deviceReadFactoryInfo: (connectId, params) =>
223
- call({ ...params, connectId, method: 'deviceReadFactoryInfo' }),
224
- deviceWriteFactoryCertificate: (connectId, params) =>
225
- call({ ...params, connectId, method: 'deviceWriteFactoryCertificate' }),
226
- deviceReadFactoryCertificate: (connectId, params) =>
227
- call({ ...params, connectId, method: 'deviceReadFactoryCertificate' }),
228
- deviceSignFactoryChallenge: (connectId, params) =>
229
- call({ ...params, connectId, method: 'deviceSignFactoryChallenge' }),
230
218
  deviceUploadWallpaper: (connectId, params) =>
231
219
  call({ ...params, connectId, method: 'deviceUploadWallpaper' }),
232
220
  deviceUploadNft: (connectId, params) => call({ ...params, connectId, method: 'deviceUploadNft' }),
@@ -297,19 +285,6 @@ const createAllCoreApi = (call: CoreApi['call']): InjectedApi<TestApi> => ({
297
285
  evmVerifyMessage: (connectId, deviceId, params) =>
298
286
  call({ ...params, connectId, deviceId, method: 'evmVerifyMessage' }),
299
287
 
300
- evmGetAddressTrezor: (connectId, deviceId, params) =>
301
- call({ ...params, connectId, deviceId, method: 'evmGetAddressTrezor' }),
302
- evmGetPublicKeyTrezor: (connectId, deviceId, params) =>
303
- call({ ...params, connectId, deviceId, method: 'evmGetPublicKeyTrezor' }),
304
- evmSignMessageTrezor: (connectId, deviceId, params) =>
305
- call({ ...params, connectId, deviceId, method: 'evmSignMessageTrezor' }),
306
- evmSignTransactionTrezor: (connectId, deviceId, params) =>
307
- call({ ...params, connectId, deviceId, method: 'evmSignTransactionTrezor' }),
308
- evmSignTypedDataTrezor: (connectId, deviceId, params) =>
309
- call({ ...params, connectId, deviceId, method: 'evmSignTypedDataTrezor' }),
310
- evmVerifyMessageTrezor: (connectId, deviceId, params) =>
311
- call({ ...params, connectId, deviceId, method: 'evmVerifyMessageTrezor' }),
312
-
313
288
  btcGetAddress: (connectId, deviceId, params) =>
314
289
  call({ ...params, connectId, deviceId, method: 'btcGetAddress' }),
315
290
  btcGetPublicKey: (connectId, deviceId, params) =>
@@ -322,25 +297,6 @@ const createAllCoreApi = (call: CoreApi['call']): InjectedApi<TestApi> => ({
322
297
  call({ ...params, connectId, deviceId, method: 'btcSignTransaction' }),
323
298
  btcVerifyMessage: (connectId, deviceId, params) =>
324
299
  call({ ...params, connectId, deviceId, method: 'btcVerifyMessage' }),
325
- btcGetOwnershipId: (connectId, deviceId, params) =>
326
- call({ ...params, connectId, deviceId, method: 'btcGetOwnershipId' }),
327
- btcGetOwnershipProof: (connectId, deviceId, params) =>
328
- call({ ...params, connectId, deviceId, method: 'btcGetOwnershipProof' }),
329
- btcAuthorizeCoinJoin: (connectId, deviceId, params) =>
330
- call({ ...params, connectId, deviceId, method: 'btcAuthorizeCoinJoin' }),
331
-
332
- cryptoBatchGetPublickeys: (connectId, deviceId, params) =>
333
- call({ ...params, connectId, deviceId, method: 'cryptoBatchGetPublickeys' }),
334
- cryptoCipherKeyValue: (connectId, deviceId, params) =>
335
- call({ ...params, connectId, deviceId, method: 'cryptoCipherKeyValue' }),
336
- cryptoCosiCommit: (connectId, deviceId, params) =>
337
- call({ ...params, connectId, deviceId, method: 'cryptoCosiCommit' }),
338
- cryptoCosiSign: (connectId, deviceId, params) =>
339
- call({ ...params, connectId, deviceId, method: 'cryptoCosiSign' }),
340
- cryptoGetECDHSessionKey: (connectId, deviceId, params) =>
341
- call({ ...params, connectId, deviceId, method: 'cryptoGetECDHSessionKey' }),
342
- cryptoSignIdentity: (connectId, deviceId, params) =>
343
- call({ ...params, connectId, deviceId, method: 'cryptoSignIdentity' }),
344
300
 
345
301
  starcoinGetAddress: (connectId, deviceId, params) =>
346
302
  call({ ...params, connectId, deviceId, method: 'starcoinGetAddress' }),
@@ -357,8 +313,6 @@ const createAllCoreApi = (call: CoreApi['call']): InjectedApi<TestApi> => ({
357
313
  call({ ...params, connectId, deviceId, method: 'nemGetAddress' }),
358
314
  nemSignTransaction: (connectId, deviceId, params) =>
359
315
  call({ ...params, connectId, deviceId, method: 'nemSignTransaction' }),
360
- nemDecryptMessage: (connectId, deviceId, params) =>
361
- call({ ...params, connectId, deviceId, method: 'nemDecryptMessage' }),
362
316
 
363
317
  solGetAddress: (connectId, deviceId, params) =>
364
318
  call({ ...params, connectId, deviceId, method: 'solGetAddress' }),
@@ -524,164 +478,8 @@ const createAllCoreApi = (call: CoreApi['call']): InjectedApi<TestApi> => ({
524
478
  benfenSignMessage: (connectId, deviceId, params) =>
525
479
  call({ ...params, connectId, deviceId, method: 'benfenSignMessage' }),
526
480
 
527
- /**
528
- * Test-only APIs.
529
- */
530
- tezosGetAddress: (connectId, deviceId, params) =>
531
- call({ ...params, connectId, deviceId, method: 'tezosGetAddress' }),
532
- tezosGetPublicKey: (connectId, deviceId, params) =>
533
- call({ ...params, connectId, deviceId, method: 'tezosGetPublicKey' }),
534
- tezosSignTx: (connectId, deviceId, params) =>
535
- call({ ...params, connectId, deviceId, method: 'tezosSignTx' }),
536
-
537
- binanceGetAddress: (connectId, deviceId, params) =>
538
- call({ ...params, connectId, deviceId, method: 'binanceGetAddress' }),
539
- binanceGetPublicKey: (connectId, deviceId, params) =>
540
- call({ ...params, connectId, deviceId, method: 'binanceGetPublicKey' }),
541
- binanceSignTx: (connectId, deviceId, params) =>
542
- call({ ...params, connectId, deviceId, method: 'binanceSignTx' }),
543
-
544
- moneroGetWatchKey: (connectId, deviceId, params) =>
545
- call({ ...params, connectId, deviceId, method: 'moneroGetWatchKey' }),
546
- moneroGetAddress: (connectId, deviceId, params) =>
547
- call({ ...params, connectId, deviceId, method: 'moneroGetAddress' }),
548
-
549
- eosGetPublicKey: (connectId, deviceId, params) =>
550
- call({ ...params, connectId, deviceId, method: 'eosGetPublicKey' }),
551
- eosSignTx: (connectId, deviceId, params) =>
552
- call({ ...params, connectId, deviceId, method: 'eosSignTx' }),
553
-
554
- webAuthnAddResidentCredential: (connectId, deviceId, params) =>
555
- call({ ...params, connectId, deviceId, method: 'webAuthnAddResidentCredential' }),
556
- webAuthnListResidentCredentials: (connectId, deviceId, params) =>
557
- call({ ...params, connectId, deviceId, method: 'webAuthnListResidentCredentials' }),
558
- webAuthnRemoveResidentCredential: (connectId, deviceId, params) =>
559
- call({ ...params, connectId, deviceId, method: 'webAuthnRemoveResidentCredential' }),
560
-
561
- getPublicKeyMultiple: (connectId, deviceId, params) =>
562
- call({ ...params, connectId, deviceId, method: 'getPublicKeyMultiple' }),
563
- listResDir: (connectId, deviceId, params) =>
564
- call({ ...params, connectId, deviceId, method: 'listResDir' }),
565
- nftWriteData: (connectId, deviceId, params) =>
566
- call({ ...params, connectId, deviceId, method: 'nftWriteData' }),
567
- nftWriteInfo: (connectId, deviceId, params) =>
568
- call({ ...params, connectId, deviceId, method: 'nftWriteInfo' }),
569
- readSEPublicKey: (connectId, deviceId, params) =>
570
- call({ ...params, connectId, deviceId, method: 'readSEPublicKey' }),
571
- resourceUpdate: (connectId, deviceId, params) =>
572
- call({ ...params, connectId, deviceId, method: 'resourceUpdate' }),
573
-
574
- bixinBackupDevice: (connectId, deviceId, params) =>
575
- call({ ...params, connectId, deviceId, method: 'bixinBackupDevice' }),
576
- bixinLoadDevice: (connectId, deviceId, params) =>
577
- call({ ...params, connectId, deviceId, method: 'bixinLoadDevice' }),
578
- bixinMessageSE: (connectId, deviceId, params) =>
579
- call({ ...params, connectId, deviceId, method: 'bixinMessageSE' }),
580
- bixinVerifyDeviceRequest: (connectId, deviceId, params) =>
581
- call({ ...params, connectId, deviceId, method: 'bixinVerifyDeviceRequest' }),
582
-
583
- deviceSpiFlashWrite: (connectId, params) =>
584
- call({ ...params, connectId, method: 'deviceSpiFlashWrite' }),
585
- deviceSpiFlashRead: (connectId, params) =>
586
- call({ ...params, connectId, method: 'deviceSpiFlashRead' }),
587
- deviceInfoSettings: (connectId, params) =>
588
- call({ ...params, connectId, method: 'deviceInfoSettings' }),
589
- deviceGetInfo: (connectId, params) => call({ ...params, connectId, method: 'deviceGetInfo' }),
590
- deviceReadSEPublicCert: (connectId, params) =>
591
- call({ ...params, connectId, method: 'deviceReadSEPublicCert' }),
592
- deviceWriteSEPrivateKey: (connectId, params) =>
593
- call({ ...params, connectId, method: 'deviceWriteSEPrivateKey' }),
594
- deviceWriteSEPublicCert: (connectId, params) =>
595
- call({ ...params, connectId, method: 'deviceWriteSEPublicCert' }),
596
- deviceSESignMessage: (connectId, params) =>
597
- call({ ...params, connectId, method: 'deviceSESignMessage' }),
598
- deviceGetFirmwareHash: (connectId, params) =>
599
- call({ ...params, connectId, method: 'deviceGetFirmwareHash' }),
600
- deviceUnlockPath: (connectId, params) =>
601
- call({ ...params, connectId, method: 'deviceUnlockPath' }),
602
- devicePing: (connectId, params) => call({ ...params, connectId, method: 'devicePing' }),
603
- deviceGetEntropy: (connectId, params) =>
604
- call({ ...params, connectId, method: 'deviceGetEntropy' }),
605
- deviceSdProtect: (connectId, params) => call({ ...params, connectId, method: 'deviceSdProtect' }),
606
- deviceChangeWipeCode: (connectId, params) =>
607
- call({ ...params, connectId, method: 'deviceChangeWipeCode' }),
608
- deviceEndSession: (connectId, params) =>
609
- call({ ...params, connectId, method: 'deviceEndSession' }),
610
- deviceLoad: (connectId, params) => call({ ...params, connectId, method: 'deviceLoad' }),
611
- deviceDoPreauthorized: (connectId, params) =>
612
- call({ ...params, connectId, method: 'deviceDoPreauthorized' }),
613
- deviceCancelAuthorization: (connectId, params) =>
614
- call({ ...params, connectId, method: 'deviceCancelAuthorization' }),
615
-
616
- emmcDirList: (connectId, params) => call({ ...params, connectId, method: 'emmcDirList' }),
617
- emmcDirMake: (connectId, params) => call({ ...params, connectId, method: 'emmcDirMake' }),
618
- emmcDirRemove: (connectId, params) => call({ ...params, connectId, method: 'emmcDirRemove' }),
619
- emmcFileDelete: (connectId, params) => call({ ...params, connectId, method: 'emmcFileDelete' }),
620
- emmcFileRead: (connectId, params) => call({ ...params, connectId, method: 'emmcFileRead' }),
621
- emmcFileWrite: (connectId, params) => call({ ...params, connectId, method: 'emmcFileWrite' }),
622
- emmcFixPermission: (connectId, params) =>
623
- call({ ...params, connectId, method: 'emmcFixPermission' }),
624
- emmcPathInfo: (connectId, params) => call({ ...params, connectId, method: 'emmcPathInfo' }),
625
-
626
- debugLinkDecision: (connectId, params) =>
627
- call({ ...params, connectId, method: 'debugLinkDecision' }),
628
- debugLinkEraseSdCard: (connectId, params) =>
629
- call({ ...params, connectId, method: 'debugLinkEraseSdCard' }),
630
- debugLinkFlashErase: (connectId, params) =>
631
- call({ ...params, connectId, method: 'debugLinkFlashErase' }),
632
- debugLinkGetState: (connectId, params) =>
633
- call({ ...params, connectId, method: 'debugLinkGetState' }),
634
- debugLinkMemoryRead: (connectId, params) =>
635
- call({ ...params, connectId, method: 'debugLinkMemoryRead' }),
636
- debugLinkMemoryWrite: (connectId, params) =>
637
- call({ ...params, connectId, method: 'debugLinkMemoryWrite' }),
638
- debugLinkRecordScreen: (connectId, params) =>
639
- call({ ...params, connectId, method: 'debugLinkRecordScreen' }),
640
- debugLinkReseedRandom: (connectId, params) =>
641
- call({ ...params, connectId, method: 'debugLinkReseedRandom' }),
642
- debugLinkStop: (connectId, params) => call({ ...params, connectId, method: 'debugLinkStop' }),
643
- debugLinkWatchLayout: (connectId, params) =>
644
- call({ ...params, connectId, method: 'debugLinkWatchLayout' }),
645
-
646
- firmwareEraseEx: (connectId, params) => call({ ...params, connectId, method: 'firmwareEraseEx' }),
647
- firmwareErase: (connectId, params) => call({ ...params, connectId, method: 'firmwareErase' }),
648
- firmwareUpdateEmmcTest: (connectId, params) =>
649
- call({ ...params, connectId, method: 'firmwareUpdateEmmcTest' }),
650
- firmwareUploadTest: (connectId, params) =>
651
- call({ ...params, connectId, method: 'firmwareUploadTest' }),
652
- reboot: (connectId, params) => call({ ...params, connectId, method: 'reboot' }),
653
- selfTest: (connectId, params) => call({ ...params, connectId, method: 'selfTest' }),
654
-
655
481
  neoGetAddress: (connectId, deviceId, params) =>
656
482
  call({ ...params, connectId, deviceId, method: 'neoGetAddress' }),
657
483
  neoSignTransaction: (connectId, deviceId, params) =>
658
484
  call({ ...params, connectId, deviceId, method: 'neoSignTransaction' }),
659
485
  });
660
-
661
- const pickApiMethods = <TApi extends object>(
662
- api: InjectedApi<TestApi>,
663
- methodNames: readonly string[]
664
- ): TApi => {
665
- const selected: Record<string, unknown> = {};
666
- methodNames.forEach(methodName => {
667
- selected[methodName] = api[methodName as keyof typeof api];
668
- });
669
- return selected as TApi;
670
- };
671
-
672
- export const createCoreApi = (call: CoreApi['call']): InjectedApi<CoreApi> => {
673
- const api = createAllCoreApi(call);
674
- const extensionMethodNames = new Set<string>([
675
- ...TEST_API_METHOD_NAMES,
676
- ...FACTORY_API_METHOD_NAMES,
677
- ]);
678
- return Object.fromEntries(
679
- Object.entries(api).filter(([methodName]) => !extensionMethodNames.has(methodName))
680
- ) as InjectedApi<CoreApi>;
681
- };
682
-
683
- export const createTestApi = (call: CoreApi['call']): TestApiMethods =>
684
- pickApiMethods<TestApiMethods>(createAllCoreApi(call), TEST_API_METHOD_NAMES);
685
-
686
- export const createFactoryApi = (call: CoreApi['call']): FactoryApi =>
687
- pickApiMethods<FactoryApi>(createAllCoreApi(call), FACTORY_API_METHOD_NAMES);
@@ -4,6 +4,7 @@ import { PROTOCOL_V2_BLE_FILE_READ_CHUNK_SIZE } from '@onekeyfe/hd-transport';
4
4
  import type {
5
5
  IProtocolV2BootResources,
6
6
  IProtocolV2Resource,
7
+ IProtocolV2ResourceFile,
7
8
  IProtocolV2ResourceType,
8
9
  IProtocolV2Resources,
9
10
  } from '../../types';
@@ -247,23 +248,53 @@ function validateBootResources(value: unknown): IProtocolV2BootResources {
247
248
  if (resource.required !== false) {
248
249
  throw new Error('Invalid Pro2 boot resources required flag: expected false');
249
250
  }
250
- if (resource.target !== 'CRATE') {
251
- throw new Error('Invalid Pro2 boot resources target: expected CRATE');
251
+ if (resource.target !== 'RES') {
252
+ throw new Error('Invalid Pro2 boot resources target: expected RES');
252
253
  }
253
- if (typeof resource.url !== 'string' || !resource.url.startsWith('https://')) {
254
- throw new Error('Invalid Pro2 boot resources url');
254
+ if (
255
+ resource.manifestUrl !== undefined &&
256
+ (typeof resource.manifestUrl !== 'string' || !resource.manifestUrl.startsWith('https://'))
257
+ ) {
258
+ throw new Error('Invalid Pro2 boot resources manifestUrl');
255
259
  }
256
- if (!Number.isSafeInteger(resource.size) || Number(resource.size) <= 0) {
257
- throw new Error('Invalid Pro2 boot resources size');
260
+ if (!Array.isArray(resource.files) || resource.files.length === 0) {
261
+ throw new Error('Invalid Pro2 boot resources files');
262
+ }
263
+ const files = resource.files.map((value, index): IProtocolV2ResourceFile => {
264
+ if (!value || typeof value !== 'object') {
265
+ throw new Error(`Invalid Pro2 boot resource file at files[${index}]`);
266
+ }
267
+ const file = value as Partial<IProtocolV2ResourceFile>;
268
+ if (typeof file.url !== 'string' || !file.url.startsWith('https://')) {
269
+ throw new Error(`Invalid Pro2 boot resource url at files[${index}]`);
270
+ }
271
+ if (
272
+ typeof file.devicePath !== 'string' ||
273
+ !file.devicePath.startsWith('vol0:/') ||
274
+ file.devicePath.includes('..') ||
275
+ file.devicePath.includes('\\\\')
276
+ ) {
277
+ throw new Error(`Invalid Pro2 boot resource devicePath at files[${index}]`);
278
+ }
279
+ if (!Number.isSafeInteger(file.size) || Number(file.size) <= 0) {
280
+ throw new Error(`Invalid Pro2 boot resource size at files[${index}]`);
281
+ }
282
+ return {
283
+ ...(typeof file.name === 'string' && file.name ? { name: file.name } : undefined),
284
+ url: file.url,
285
+ devicePath: file.devicePath,
286
+ size: Number(file.size),
287
+ fileHash: normalizeHex(file.fileHash, SHA256_HEX_LENGTH, `boot files[${index}].fileHash`),
288
+ };
289
+ });
290
+ if (new Set(files.map(file => file.devicePath)).size !== files.length) {
291
+ throw new Error('Invalid Pro2 boot resources files: duplicate devicePath');
258
292
  }
259
293
  return {
260
294
  required: false,
261
- target: 'CRATE',
262
- url: resource.url,
263
- size: Number(resource.size),
264
- fileHash: normalizeHex(resource.fileHash, SHA256_HEX_LENGTH, 'boot fileHash'),
265
- payloadHash: normalizeHex(resource.payloadHash, SHA3_512_HEX_LENGTH, 'boot payloadHash'),
266
- headerHash: normalizeHex(resource.headerHash, SHA3_512_HEX_LENGTH, 'boot headerHash'),
295
+ target: 'RES',
296
+ ...(resource.manifestUrl ? { manifestUrl: resource.manifestUrl } : undefined),
297
+ files,
267
298
  };
268
299
  }
269
300
 
@@ -352,7 +383,7 @@ function bytesToHex(bytes: Uint8Array): string {
352
383
  /** Verify the complete downloaded file before any device mutation. */
353
384
  export function isProtocolV2ResourceFileValid(
354
385
  binary: ArrayBuffer,
355
- resource: Pick<IProtocolV2Resource, 'size' | 'fileHash'>
386
+ resource: Pick<IProtocolV2ResourceFile, 'size' | 'fileHash'>
356
387
  ): boolean {
357
388
  if (binary.byteLength !== resource.size) return false;
358
389
  return bytesToHex(sha256(new Uint8Array(binary))) === resource.fileHash.toLowerCase();
@@ -54,7 +54,7 @@ export type AllFirmwareRelease = {
54
54
  bridge?: FirmwareRelease;
55
55
  features?: Features;
56
56
  protocol?: 'V1' | 'V2';
57
- deviceType?: 'pro2';
57
+ deviceType?: 'pro2' | 'neo';
58
58
  firmwareType?: EFirmwareType;
59
59
  status?: ProtocolV2FirmwareReleaseStatus;
60
60
  hasUpgrade?: boolean;
@@ -83,8 +83,6 @@ export interface FirmwareUpdateV4Params {
83
83
  romloaderBinary?: ArrayBuffer;
84
84
  /** FW_MGMT_TARGET_BOOTLOADER = 3 */
85
85
  bootloaderBinary?: ArrayBuffer;
86
- /** FW_MGMT_TARGET_CRATE = 1; optional Pro2 startup resources. */
87
- bootResourcesBinary?: ArrayBuffer;
88
86
  /** FW_MGMT_TARGET_APPLICATION_P1 = 4 */
89
87
  applicationP1Binary?: ArrayBuffer;
90
88
  /** FW_MGMT_TARGET_APPLICATION_P2 = 5 */
@@ -98,12 +96,14 @@ export interface FirmwareUpdateV4Params {
98
96
  se04Binary?: ArrayBuffer;
99
97
  forcedUpdateRes?: boolean;
100
98
  /**
101
- * RESC bundle okpkg files written directly to devicePath through FilesystemFileWrite.
102
- * Manual mode installs them without version comparison.
99
+ * Arbitrary Protocol V2 resource files written directly with FilesystemFileWrite.
100
+ * Use this for manifest-driven boot resources and other non-RESC files.
103
101
  */
104
- resourceBundleFiles?: Array<{
102
+ resourceFiles?: Array<{
105
103
  binary: ArrayBuffer;
106
104
  devicePath: string;
105
+ size?: number;
106
+ fileHash?: string;
107
107
  }>;
108
108
  }
109
109