@ledgerhq/device-core 0.1.0

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 (374) hide show
  1. package/.turbo/turbo-build.log +4 -0
  2. package/LICENSE.txt +21 -0
  3. package/jest.config.json +13 -0
  4. package/lib/capabilities/isCustomLockScreenSupported.d.ts +5 -0
  5. package/lib/capabilities/isCustomLockScreenSupported.d.ts.map +1 -0
  6. package/lib/capabilities/isCustomLockScreenSupported.js +16 -0
  7. package/lib/capabilities/isCustomLockScreenSupported.js.map +1 -0
  8. package/lib/capabilities/isCustomLockScreenSupported.test.d.ts +2 -0
  9. package/lib/capabilities/isCustomLockScreenSupported.test.d.ts.map +1 -0
  10. package/lib/capabilities/isCustomLockScreenSupported.test.js +22 -0
  11. package/lib/capabilities/isCustomLockScreenSupported.test.js.map +1 -0
  12. package/lib/capabilities/isEditDeviceNameSupported.d.ts +3 -0
  13. package/lib/capabilities/isEditDeviceNameSupported.d.ts.map +1 -0
  14. package/lib/capabilities/isEditDeviceNameSupported.js +9 -0
  15. package/lib/capabilities/isEditDeviceNameSupported.js.map +1 -0
  16. package/lib/capabilities/isEditDeviceNameSupported.test.d.ts +2 -0
  17. package/lib/capabilities/isEditDeviceNameSupported.test.d.ts.map +1 -0
  18. package/lib/capabilities/isEditDeviceNameSupported.test.js +19 -0
  19. package/lib/capabilities/isEditDeviceNameSupported.test.js.map +1 -0
  20. package/lib/capabilities/isSyncOnboardingSupported.d.ts +3 -0
  21. package/lib/capabilities/isSyncOnboardingSupported.d.ts.map +1 -0
  22. package/lib/capabilities/isSyncOnboardingSupported.js +9 -0
  23. package/lib/capabilities/isSyncOnboardingSupported.js.map +1 -0
  24. package/lib/capabilities/isSyncOnboardingSupported.test.d.ts +2 -0
  25. package/lib/capabilities/isSyncOnboardingSupported.test.d.ts.map +1 -0
  26. package/lib/capabilities/isSyncOnboardingSupported.test.js +17 -0
  27. package/lib/capabilities/isSyncOnboardingSupported.test.js.map +1 -0
  28. package/lib/commands/entities/APDU.d.ts +9 -0
  29. package/lib/commands/entities/APDU.d.ts.map +1 -0
  30. package/lib/commands/entities/APDU.js +3 -0
  31. package/lib/commands/entities/APDU.js.map +1 -0
  32. package/lib/commands/entities/FirmwareInfoEntity.d.ts +16 -0
  33. package/lib/commands/entities/FirmwareInfoEntity.d.ts.map +1 -0
  34. package/lib/commands/entities/FirmwareInfoEntity.js +3 -0
  35. package/lib/commands/entities/FirmwareInfoEntity.js.map +1 -0
  36. package/lib/commands/use-cases/getDeviceName.d.ts +3 -0
  37. package/lib/commands/use-cases/getDeviceName.d.ts.map +1 -0
  38. package/lib/commands/use-cases/getDeviceName.js +48 -0
  39. package/lib/commands/use-cases/getDeviceName.js.map +1 -0
  40. package/lib/commands/use-cases/getVersion.d.ts +15 -0
  41. package/lib/commands/use-cases/getVersion.d.ts.map +1 -0
  42. package/lib/commands/use-cases/getVersion.js +31 -0
  43. package/lib/commands/use-cases/getVersion.js.map +1 -0
  44. package/lib/commands/use-cases/isBootloaderVersionSupported.d.ts +7 -0
  45. package/lib/commands/use-cases/isBootloaderVersionSupported.d.ts.map +1 -0
  46. package/lib/commands/use-cases/isBootloaderVersionSupported.js +20 -0
  47. package/lib/commands/use-cases/isBootloaderVersionSupported.js.map +1 -0
  48. package/lib/commands/use-cases/isBootloaderVersionSupported.test.d.ts +2 -0
  49. package/lib/commands/use-cases/isBootloaderVersionSupported.test.d.ts.map +1 -0
  50. package/lib/commands/use-cases/isBootloaderVersionSupported.test.js +53 -0
  51. package/lib/commands/use-cases/isBootloaderVersionSupported.test.js.map +1 -0
  52. package/lib/commands/use-cases/isDeviceLocalizationSupported.d.ts +3 -0
  53. package/lib/commands/use-cases/isDeviceLocalizationSupported.d.ts.map +1 -0
  54. package/lib/commands/use-cases/isDeviceLocalizationSupported.js +15 -0
  55. package/lib/commands/use-cases/isDeviceLocalizationSupported.js.map +1 -0
  56. package/lib/commands/use-cases/isDeviceLocalizationSupported.test.d.ts +2 -0
  57. package/lib/commands/use-cases/isDeviceLocalizationSupported.test.d.ts.map +1 -0
  58. package/lib/commands/use-cases/isDeviceLocalizationSupported.test.js +45 -0
  59. package/lib/commands/use-cases/isDeviceLocalizationSupported.test.js.map +1 -0
  60. package/lib/commands/use-cases/isHardwareVersionSupported.d.ts +7 -0
  61. package/lib/commands/use-cases/isHardwareVersionSupported.d.ts.map +1 -0
  62. package/lib/commands/use-cases/isHardwareVersionSupported.js +16 -0
  63. package/lib/commands/use-cases/isHardwareVersionSupported.js.map +1 -0
  64. package/lib/commands/use-cases/isHardwareVersionSupported.test.d.ts +2 -0
  65. package/lib/commands/use-cases/isHardwareVersionSupported.test.d.ts.map +1 -0
  66. package/lib/commands/use-cases/isHardwareVersionSupported.test.js +36 -0
  67. package/lib/commands/use-cases/isHardwareVersionSupported.test.js.map +1 -0
  68. package/lib/commands/use-cases/parseGetDeviceNameResponse.d.ts +3 -0
  69. package/lib/commands/use-cases/parseGetDeviceNameResponse.d.ts.map +1 -0
  70. package/lib/commands/use-cases/parseGetDeviceNameResponse.js +23 -0
  71. package/lib/commands/use-cases/parseGetDeviceNameResponse.js.map +1 -0
  72. package/lib/commands/use-cases/parseGetDeviceNameResponse.test.d.ts +2 -0
  73. package/lib/commands/use-cases/parseGetDeviceNameResponse.test.d.ts.map +1 -0
  74. package/lib/commands/use-cases/parseGetDeviceNameResponse.test.js +27 -0
  75. package/lib/commands/use-cases/parseGetDeviceNameResponse.test.js.map +1 -0
  76. package/lib/commands/use-cases/parseGetVersionResponse.d.ts +4 -0
  77. package/lib/commands/use-cases/parseGetVersionResponse.d.ts.map +1 -0
  78. package/lib/commands/use-cases/parseGetVersionResponse.js +108 -0
  79. package/lib/commands/use-cases/parseGetVersionResponse.js.map +1 -0
  80. package/lib/commands/use-cases/parseGetVersionResponse.test.d.ts +2 -0
  81. package/lib/commands/use-cases/parseGetVersionResponse.test.d.ts.map +1 -0
  82. package/lib/commands/use-cases/parseGetVersionResponse.test.js +105 -0
  83. package/lib/commands/use-cases/parseGetVersionResponse.test.js.map +1 -0
  84. package/lib/customLockScreen/screenSpecs.d.ts +30 -0
  85. package/lib/customLockScreen/screenSpecs.d.ts.map +1 -0
  86. package/lib/customLockScreen/screenSpecs.js +46 -0
  87. package/lib/customLockScreen/screenSpecs.js.map +1 -0
  88. package/lib/index.d.ts +23 -0
  89. package/lib/index.d.ts.map +1 -0
  90. package/lib/index.js +56 -0
  91. package/lib/index.js.map +1 -0
  92. package/lib/managerApi/entities/AppEntity.d.ts +62 -0
  93. package/lib/managerApi/entities/AppEntity.d.ts.map +1 -0
  94. package/lib/managerApi/entities/AppEntity.js +12 -0
  95. package/lib/managerApi/entities/AppEntity.js.map +1 -0
  96. package/lib/managerApi/entities/DeviceInfoEntity.d.ts +22 -0
  97. package/lib/managerApi/entities/DeviceInfoEntity.d.ts.map +1 -0
  98. package/lib/managerApi/entities/DeviceInfoEntity.js +3 -0
  99. package/lib/managerApi/entities/DeviceInfoEntity.js.map +1 -0
  100. package/lib/managerApi/entities/DeviceVersionEntity.d.ts +17 -0
  101. package/lib/managerApi/entities/DeviceVersionEntity.d.ts.map +1 -0
  102. package/lib/managerApi/entities/DeviceVersionEntity.js +3 -0
  103. package/lib/managerApi/entities/DeviceVersionEntity.js.map +1 -0
  104. package/lib/managerApi/entities/FirmwareUpdateContextEntity.d.ts +42 -0
  105. package/lib/managerApi/entities/FirmwareUpdateContextEntity.d.ts.map +1 -0
  106. package/lib/managerApi/entities/FirmwareUpdateContextEntity.js +3 -0
  107. package/lib/managerApi/entities/FirmwareUpdateContextEntity.js.map +1 -0
  108. package/lib/managerApi/entities/Id.d.ts +2 -0
  109. package/lib/managerApi/entities/Id.d.ts.map +1 -0
  110. package/lib/managerApi/entities/Id.js +3 -0
  111. package/lib/managerApi/entities/Id.js.map +1 -0
  112. package/lib/managerApi/entities/LanguagePackageEntity.d.ts +20 -0
  113. package/lib/managerApi/entities/LanguagePackageEntity.d.ts.map +1 -0
  114. package/lib/managerApi/entities/LanguagePackageEntity.js +3 -0
  115. package/lib/managerApi/entities/LanguagePackageEntity.js.map +1 -0
  116. package/lib/managerApi/entities/mocks/aDeviceInfo.d.ts +3 -0
  117. package/lib/managerApi/entities/mocks/aDeviceInfo.d.ts.map +1 -0
  118. package/lib/managerApi/entities/mocks/aDeviceInfo.js +8 -0
  119. package/lib/managerApi/entities/mocks/aDeviceInfo.js.map +1 -0
  120. package/lib/managerApi/entities/mocks/aDeviceVersion.d.ts +3 -0
  121. package/lib/managerApi/entities/mocks/aDeviceVersion.d.ts.map +1 -0
  122. package/lib/managerApi/entities/mocks/aDeviceVersion.js +8 -0
  123. package/lib/managerApi/entities/mocks/aDeviceVersion.js.map +1 -0
  124. package/lib/managerApi/entities/mocks/aFinalFirmware.d.ts +3 -0
  125. package/lib/managerApi/entities/mocks/aFinalFirmware.d.ts.map +1 -0
  126. package/lib/managerApi/entities/mocks/aFinalFirmware.js +8 -0
  127. package/lib/managerApi/entities/mocks/aFinalFirmware.js.map +1 -0
  128. package/lib/managerApi/entities/mocks/aOsuFirmware.d.ts +19 -0
  129. package/lib/managerApi/entities/mocks/aOsuFirmware.d.ts.map +1 -0
  130. package/lib/managerApi/entities/mocks/aOsuFirmware.js +8 -0
  131. package/lib/managerApi/entities/mocks/aOsuFirmware.js.map +1 -0
  132. package/lib/managerApi/repositories/HttpManagerApiRepository.d.ts +18 -0
  133. package/lib/managerApi/repositories/HttpManagerApiRepository.d.ts.map +1 -0
  134. package/lib/managerApi/repositories/HttpManagerApiRepository.js +204 -0
  135. package/lib/managerApi/repositories/HttpManagerApiRepository.js.map +1 -0
  136. package/lib/managerApi/repositories/HttpManagerApiRepository.test.d.ts +2 -0
  137. package/lib/managerApi/repositories/HttpManagerApiRepository.test.d.ts.map +1 -0
  138. package/lib/managerApi/repositories/HttpManagerApiRepository.test.js +402 -0
  139. package/lib/managerApi/repositories/HttpManagerApiRepository.test.js.map +1 -0
  140. package/lib/managerApi/repositories/ManagerApiRepository.d.ts +54 -0
  141. package/lib/managerApi/repositories/ManagerApiRepository.d.ts.map +1 -0
  142. package/lib/managerApi/repositories/ManagerApiRepository.js +3 -0
  143. package/lib/managerApi/repositories/ManagerApiRepository.js.map +1 -0
  144. package/lib/managerApi/repositories/StubManagerApiRepository.d.ts +15 -0
  145. package/lib/managerApi/repositories/StubManagerApiRepository.d.ts.map +1 -0
  146. package/lib/managerApi/repositories/StubManagerApiRepository.js +44 -0
  147. package/lib/managerApi/repositories/StubManagerApiRepository.js.map +1 -0
  148. package/lib/managerApi/use-cases/fetchMcus.d.ts +3 -0
  149. package/lib/managerApi/use-cases/fetchMcus.d.ts.map +1 -0
  150. package/lib/managerApi/use-cases/fetchMcus.js +8 -0
  151. package/lib/managerApi/use-cases/fetchMcus.js.map +1 -0
  152. package/lib/managerApi/use-cases/getLatestFirmwareForDevice.d.ts +12 -0
  153. package/lib/managerApi/use-cases/getLatestFirmwareForDevice.d.ts.map +1 -0
  154. package/lib/managerApi/use-cases/getLatestFirmwareForDevice.js +62 -0
  155. package/lib/managerApi/use-cases/getLatestFirmwareForDevice.js.map +1 -0
  156. package/lib/managerApi/use-cases/getLatestFirmwareForDevice.test.d.ts +2 -0
  157. package/lib/managerApi/use-cases/getLatestFirmwareForDevice.test.d.ts.map +1 -0
  158. package/lib/managerApi/use-cases/getLatestFirmwareForDevice.test.js +178 -0
  159. package/lib/managerApi/use-cases/getLatestFirmwareForDevice.test.js.map +1 -0
  160. package/lib/managerApi/use-cases/getProviderIdUseCase.d.ts +7 -0
  161. package/lib/managerApi/use-cases/getProviderIdUseCase.d.ts.map +1 -0
  162. package/lib/managerApi/use-cases/getProviderIdUseCase.js +23 -0
  163. package/lib/managerApi/use-cases/getProviderIdUseCase.js.map +1 -0
  164. package/lib/managerApi/use-cases/getUserHashes.d.ts +5 -0
  165. package/lib/managerApi/use-cases/getUserHashes.d.ts.map +1 -0
  166. package/lib/managerApi/use-cases/getUserHashes.js +33 -0
  167. package/lib/managerApi/use-cases/getUserHashes.js.map +1 -0
  168. package/lib-es/capabilities/isCustomLockScreenSupported.d.ts +5 -0
  169. package/lib-es/capabilities/isCustomLockScreenSupported.d.ts.map +1 -0
  170. package/lib-es/capabilities/isCustomLockScreenSupported.js +12 -0
  171. package/lib-es/capabilities/isCustomLockScreenSupported.js.map +1 -0
  172. package/lib-es/capabilities/isCustomLockScreenSupported.test.d.ts +2 -0
  173. package/lib-es/capabilities/isCustomLockScreenSupported.test.d.ts.map +1 -0
  174. package/lib-es/capabilities/isCustomLockScreenSupported.test.js +20 -0
  175. package/lib-es/capabilities/isCustomLockScreenSupported.test.js.map +1 -0
  176. package/lib-es/capabilities/isEditDeviceNameSupported.d.ts +3 -0
  177. package/lib-es/capabilities/isEditDeviceNameSupported.d.ts.map +1 -0
  178. package/lib-es/capabilities/isEditDeviceNameSupported.js +5 -0
  179. package/lib-es/capabilities/isEditDeviceNameSupported.js.map +1 -0
  180. package/lib-es/capabilities/isEditDeviceNameSupported.test.d.ts +2 -0
  181. package/lib-es/capabilities/isEditDeviceNameSupported.test.d.ts.map +1 -0
  182. package/lib-es/capabilities/isEditDeviceNameSupported.test.js +17 -0
  183. package/lib-es/capabilities/isEditDeviceNameSupported.test.js.map +1 -0
  184. package/lib-es/capabilities/isSyncOnboardingSupported.d.ts +3 -0
  185. package/lib-es/capabilities/isSyncOnboardingSupported.d.ts.map +1 -0
  186. package/lib-es/capabilities/isSyncOnboardingSupported.js +5 -0
  187. package/lib-es/capabilities/isSyncOnboardingSupported.js.map +1 -0
  188. package/lib-es/capabilities/isSyncOnboardingSupported.test.d.ts +2 -0
  189. package/lib-es/capabilities/isSyncOnboardingSupported.test.d.ts.map +1 -0
  190. package/lib-es/capabilities/isSyncOnboardingSupported.test.js +15 -0
  191. package/lib-es/capabilities/isSyncOnboardingSupported.test.js.map +1 -0
  192. package/lib-es/commands/entities/APDU.d.ts +9 -0
  193. package/lib-es/commands/entities/APDU.d.ts.map +1 -0
  194. package/lib-es/commands/entities/APDU.js +2 -0
  195. package/lib-es/commands/entities/APDU.js.map +1 -0
  196. package/lib-es/commands/entities/FirmwareInfoEntity.d.ts +16 -0
  197. package/lib-es/commands/entities/FirmwareInfoEntity.d.ts.map +1 -0
  198. package/lib-es/commands/entities/FirmwareInfoEntity.js +2 -0
  199. package/lib-es/commands/entities/FirmwareInfoEntity.js.map +1 -0
  200. package/lib-es/commands/use-cases/getDeviceName.d.ts +3 -0
  201. package/lib-es/commands/use-cases/getDeviceName.d.ts.map +1 -0
  202. package/lib-es/commands/use-cases/getDeviceName.js +44 -0
  203. package/lib-es/commands/use-cases/getDeviceName.js.map +1 -0
  204. package/lib-es/commands/use-cases/getVersion.d.ts +15 -0
  205. package/lib-es/commands/use-cases/getVersion.d.ts.map +1 -0
  206. package/lib-es/commands/use-cases/getVersion.js +27 -0
  207. package/lib-es/commands/use-cases/getVersion.js.map +1 -0
  208. package/lib-es/commands/use-cases/isBootloaderVersionSupported.d.ts +7 -0
  209. package/lib-es/commands/use-cases/isBootloaderVersionSupported.d.ts.map +1 -0
  210. package/lib-es/commands/use-cases/isBootloaderVersionSupported.js +16 -0
  211. package/lib-es/commands/use-cases/isBootloaderVersionSupported.js.map +1 -0
  212. package/lib-es/commands/use-cases/isBootloaderVersionSupported.test.d.ts +2 -0
  213. package/lib-es/commands/use-cases/isBootloaderVersionSupported.test.d.ts.map +1 -0
  214. package/lib-es/commands/use-cases/isBootloaderVersionSupported.test.js +51 -0
  215. package/lib-es/commands/use-cases/isBootloaderVersionSupported.test.js.map +1 -0
  216. package/lib-es/commands/use-cases/isDeviceLocalizationSupported.d.ts +3 -0
  217. package/lib-es/commands/use-cases/isDeviceLocalizationSupported.d.ts.map +1 -0
  218. package/lib-es/commands/use-cases/isDeviceLocalizationSupported.js +11 -0
  219. package/lib-es/commands/use-cases/isDeviceLocalizationSupported.js.map +1 -0
  220. package/lib-es/commands/use-cases/isDeviceLocalizationSupported.test.d.ts +2 -0
  221. package/lib-es/commands/use-cases/isDeviceLocalizationSupported.test.d.ts.map +1 -0
  222. package/lib-es/commands/use-cases/isDeviceLocalizationSupported.test.js +43 -0
  223. package/lib-es/commands/use-cases/isDeviceLocalizationSupported.test.js.map +1 -0
  224. package/lib-es/commands/use-cases/isHardwareVersionSupported.d.ts +7 -0
  225. package/lib-es/commands/use-cases/isHardwareVersionSupported.d.ts.map +1 -0
  226. package/lib-es/commands/use-cases/isHardwareVersionSupported.js +12 -0
  227. package/lib-es/commands/use-cases/isHardwareVersionSupported.js.map +1 -0
  228. package/lib-es/commands/use-cases/isHardwareVersionSupported.test.d.ts +2 -0
  229. package/lib-es/commands/use-cases/isHardwareVersionSupported.test.d.ts.map +1 -0
  230. package/lib-es/commands/use-cases/isHardwareVersionSupported.test.js +34 -0
  231. package/lib-es/commands/use-cases/isHardwareVersionSupported.test.js.map +1 -0
  232. package/lib-es/commands/use-cases/parseGetDeviceNameResponse.d.ts +3 -0
  233. package/lib-es/commands/use-cases/parseGetDeviceNameResponse.d.ts.map +1 -0
  234. package/lib-es/commands/use-cases/parseGetDeviceNameResponse.js +19 -0
  235. package/lib-es/commands/use-cases/parseGetDeviceNameResponse.js.map +1 -0
  236. package/lib-es/commands/use-cases/parseGetDeviceNameResponse.test.d.ts +2 -0
  237. package/lib-es/commands/use-cases/parseGetDeviceNameResponse.test.d.ts.map +1 -0
  238. package/lib-es/commands/use-cases/parseGetDeviceNameResponse.test.js +25 -0
  239. package/lib-es/commands/use-cases/parseGetDeviceNameResponse.test.js.map +1 -0
  240. package/lib-es/commands/use-cases/parseGetVersionResponse.d.ts +4 -0
  241. package/lib-es/commands/use-cases/parseGetVersionResponse.d.ts.map +1 -0
  242. package/lib-es/commands/use-cases/parseGetVersionResponse.js +104 -0
  243. package/lib-es/commands/use-cases/parseGetVersionResponse.js.map +1 -0
  244. package/lib-es/commands/use-cases/parseGetVersionResponse.test.d.ts +2 -0
  245. package/lib-es/commands/use-cases/parseGetVersionResponse.test.d.ts.map +1 -0
  246. package/lib-es/commands/use-cases/parseGetVersionResponse.test.js +103 -0
  247. package/lib-es/commands/use-cases/parseGetVersionResponse.test.js.map +1 -0
  248. package/lib-es/customLockScreen/screenSpecs.d.ts +30 -0
  249. package/lib-es/customLockScreen/screenSpecs.d.ts.map +1 -0
  250. package/lib-es/customLockScreen/screenSpecs.js +40 -0
  251. package/lib-es/customLockScreen/screenSpecs.js.map +1 -0
  252. package/lib-es/index.d.ts +23 -0
  253. package/lib-es/index.d.ts.map +1 -0
  254. package/lib-es/index.js +21 -0
  255. package/lib-es/index.js.map +1 -0
  256. package/lib-es/managerApi/entities/AppEntity.d.ts +62 -0
  257. package/lib-es/managerApi/entities/AppEntity.d.ts.map +1 -0
  258. package/lib-es/managerApi/entities/AppEntity.js +9 -0
  259. package/lib-es/managerApi/entities/AppEntity.js.map +1 -0
  260. package/lib-es/managerApi/entities/DeviceInfoEntity.d.ts +22 -0
  261. package/lib-es/managerApi/entities/DeviceInfoEntity.d.ts.map +1 -0
  262. package/lib-es/managerApi/entities/DeviceInfoEntity.js +2 -0
  263. package/lib-es/managerApi/entities/DeviceInfoEntity.js.map +1 -0
  264. package/lib-es/managerApi/entities/DeviceVersionEntity.d.ts +17 -0
  265. package/lib-es/managerApi/entities/DeviceVersionEntity.d.ts.map +1 -0
  266. package/lib-es/managerApi/entities/DeviceVersionEntity.js +2 -0
  267. package/lib-es/managerApi/entities/DeviceVersionEntity.js.map +1 -0
  268. package/lib-es/managerApi/entities/FirmwareUpdateContextEntity.d.ts +42 -0
  269. package/lib-es/managerApi/entities/FirmwareUpdateContextEntity.d.ts.map +1 -0
  270. package/lib-es/managerApi/entities/FirmwareUpdateContextEntity.js +2 -0
  271. package/lib-es/managerApi/entities/FirmwareUpdateContextEntity.js.map +1 -0
  272. package/lib-es/managerApi/entities/Id.d.ts +2 -0
  273. package/lib-es/managerApi/entities/Id.d.ts.map +1 -0
  274. package/lib-es/managerApi/entities/Id.js +2 -0
  275. package/lib-es/managerApi/entities/Id.js.map +1 -0
  276. package/lib-es/managerApi/entities/LanguagePackageEntity.d.ts +20 -0
  277. package/lib-es/managerApi/entities/LanguagePackageEntity.d.ts.map +1 -0
  278. package/lib-es/managerApi/entities/LanguagePackageEntity.js +2 -0
  279. package/lib-es/managerApi/entities/LanguagePackageEntity.js.map +1 -0
  280. package/lib-es/managerApi/entities/mocks/aDeviceInfo.d.ts +3 -0
  281. package/lib-es/managerApi/entities/mocks/aDeviceInfo.d.ts.map +1 -0
  282. package/lib-es/managerApi/entities/mocks/aDeviceInfo.js +4 -0
  283. package/lib-es/managerApi/entities/mocks/aDeviceInfo.js.map +1 -0
  284. package/lib-es/managerApi/entities/mocks/aDeviceVersion.d.ts +3 -0
  285. package/lib-es/managerApi/entities/mocks/aDeviceVersion.d.ts.map +1 -0
  286. package/lib-es/managerApi/entities/mocks/aDeviceVersion.js +4 -0
  287. package/lib-es/managerApi/entities/mocks/aDeviceVersion.js.map +1 -0
  288. package/lib-es/managerApi/entities/mocks/aFinalFirmware.d.ts +3 -0
  289. package/lib-es/managerApi/entities/mocks/aFinalFirmware.d.ts.map +1 -0
  290. package/lib-es/managerApi/entities/mocks/aFinalFirmware.js +4 -0
  291. package/lib-es/managerApi/entities/mocks/aFinalFirmware.js.map +1 -0
  292. package/lib-es/managerApi/entities/mocks/aOsuFirmware.d.ts +19 -0
  293. package/lib-es/managerApi/entities/mocks/aOsuFirmware.d.ts.map +1 -0
  294. package/lib-es/managerApi/entities/mocks/aOsuFirmware.js +4 -0
  295. package/lib-es/managerApi/entities/mocks/aOsuFirmware.js.map +1 -0
  296. package/lib-es/managerApi/repositories/HttpManagerApiRepository.d.ts +18 -0
  297. package/lib-es/managerApi/repositories/HttpManagerApiRepository.d.ts.map +1 -0
  298. package/lib-es/managerApi/repositories/HttpManagerApiRepository.js +197 -0
  299. package/lib-es/managerApi/repositories/HttpManagerApiRepository.js.map +1 -0
  300. package/lib-es/managerApi/repositories/HttpManagerApiRepository.test.d.ts +2 -0
  301. package/lib-es/managerApi/repositories/HttpManagerApiRepository.test.d.ts.map +1 -0
  302. package/lib-es/managerApi/repositories/HttpManagerApiRepository.test.js +400 -0
  303. package/lib-es/managerApi/repositories/HttpManagerApiRepository.test.js.map +1 -0
  304. package/lib-es/managerApi/repositories/ManagerApiRepository.d.ts +54 -0
  305. package/lib-es/managerApi/repositories/ManagerApiRepository.d.ts.map +1 -0
  306. package/lib-es/managerApi/repositories/ManagerApiRepository.js +2 -0
  307. package/lib-es/managerApi/repositories/ManagerApiRepository.js.map +1 -0
  308. package/lib-es/managerApi/repositories/StubManagerApiRepository.d.ts +15 -0
  309. package/lib-es/managerApi/repositories/StubManagerApiRepository.d.ts.map +1 -0
  310. package/lib-es/managerApi/repositories/StubManagerApiRepository.js +40 -0
  311. package/lib-es/managerApi/repositories/StubManagerApiRepository.js.map +1 -0
  312. package/lib-es/managerApi/use-cases/fetchMcus.d.ts +3 -0
  313. package/lib-es/managerApi/use-cases/fetchMcus.d.ts.map +1 -0
  314. package/lib-es/managerApi/use-cases/fetchMcus.js +4 -0
  315. package/lib-es/managerApi/use-cases/fetchMcus.js.map +1 -0
  316. package/lib-es/managerApi/use-cases/getLatestFirmwareForDevice.d.ts +12 -0
  317. package/lib-es/managerApi/use-cases/getLatestFirmwareForDevice.d.ts.map +1 -0
  318. package/lib-es/managerApi/use-cases/getLatestFirmwareForDevice.js +58 -0
  319. package/lib-es/managerApi/use-cases/getLatestFirmwareForDevice.js.map +1 -0
  320. package/lib-es/managerApi/use-cases/getLatestFirmwareForDevice.test.d.ts +2 -0
  321. package/lib-es/managerApi/use-cases/getLatestFirmwareForDevice.test.d.ts.map +1 -0
  322. package/lib-es/managerApi/use-cases/getLatestFirmwareForDevice.test.js +176 -0
  323. package/lib-es/managerApi/use-cases/getLatestFirmwareForDevice.test.js.map +1 -0
  324. package/lib-es/managerApi/use-cases/getProviderIdUseCase.d.ts +7 -0
  325. package/lib-es/managerApi/use-cases/getProviderIdUseCase.d.ts.map +1 -0
  326. package/lib-es/managerApi/use-cases/getProviderIdUseCase.js +19 -0
  327. package/lib-es/managerApi/use-cases/getProviderIdUseCase.js.map +1 -0
  328. package/lib-es/managerApi/use-cases/getUserHashes.d.ts +5 -0
  329. package/lib-es/managerApi/use-cases/getUserHashes.d.ts.map +1 -0
  330. package/lib-es/managerApi/use-cases/getUserHashes.js +26 -0
  331. package/lib-es/managerApi/use-cases/getUserHashes.js.map +1 -0
  332. package/package.json +67 -0
  333. package/src/capabilities/isCustomLockScreenSupported.test.ts +25 -0
  334. package/src/capabilities/isCustomLockScreenSupported.ts +17 -0
  335. package/src/capabilities/isEditDeviceNameSupported.test.ts +18 -0
  336. package/src/capabilities/isEditDeviceNameSupported.ts +5 -0
  337. package/src/capabilities/isSyncOnboardingSupported.test.ts +16 -0
  338. package/src/capabilities/isSyncOnboardingSupported.ts +5 -0
  339. package/src/commands/entities/APDU.ts +12 -0
  340. package/src/commands/entities/FirmwareInfoEntity.ts +14 -0
  341. package/src/commands/use-cases/getDeviceName.ts +38 -0
  342. package/src/commands/use-cases/getVersion.ts +23 -0
  343. package/src/commands/use-cases/isBootloaderVersionSupported.test.ts +58 -0
  344. package/src/commands/use-cases/isBootloaderVersionSupported.ts +24 -0
  345. package/src/commands/use-cases/isDeviceLocalizationSupported.test.ts +48 -0
  346. package/src/commands/use-cases/isDeviceLocalizationSupported.ts +20 -0
  347. package/src/commands/use-cases/isHardwareVersionSupported.test.ts +39 -0
  348. package/src/commands/use-cases/isHardwareVersionSupported.ts +20 -0
  349. package/src/commands/use-cases/parseGetDeviceNameResponse.test.ts +35 -0
  350. package/src/commands/use-cases/parseGetDeviceNameResponse.ts +20 -0
  351. package/src/commands/use-cases/parseGetVersionResponse.test.ts +123 -0
  352. package/src/commands/use-cases/parseGetVersionResponse.ts +121 -0
  353. package/src/customLockScreen/screenSpecs.ts +87 -0
  354. package/src/index.ts +33 -0
  355. package/src/managerApi/entities/AppEntity.ts +66 -0
  356. package/src/managerApi/entities/DeviceInfoEntity.ts +26 -0
  357. package/src/managerApi/entities/DeviceVersionEntity.ts +17 -0
  358. package/src/managerApi/entities/FirmwareUpdateContextEntity.ts +44 -0
  359. package/src/managerApi/entities/Id.ts +1 -0
  360. package/src/managerApi/entities/LanguagePackageEntity.ts +21 -0
  361. package/src/managerApi/entities/mocks/aDeviceInfo.ts +16 -0
  362. package/src/managerApi/entities/mocks/aDeviceVersion.ts +22 -0
  363. package/src/managerApi/entities/mocks/aFinalFirmware.ts +25 -0
  364. package/src/managerApi/entities/mocks/aOsuFirmware.ts +22 -0
  365. package/src/managerApi/repositories/HttpManagerApiRepository.test.ts +494 -0
  366. package/src/managerApi/repositories/HttpManagerApiRepository.ts +284 -0
  367. package/src/managerApi/repositories/ManagerApiRepository.ts +68 -0
  368. package/src/managerApi/repositories/StubManagerApiRepository.ts +49 -0
  369. package/src/managerApi/use-cases/fetchMcus.ts +5 -0
  370. package/src/managerApi/use-cases/getLatestFirmwareForDevice.test.ts +196 -0
  371. package/src/managerApi/use-cases/getLatestFirmwareForDevice.ts +66 -0
  372. package/src/managerApi/use-cases/getProviderIdUseCase.ts +24 -0
  373. package/src/managerApi/use-cases/getUserHashes.ts +30 -0
  374. package/tsconfig.json +16 -0
@@ -0,0 +1,44 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { StatusCodes } from "@ledgerhq/hw-transport";
11
+ import { LocalTracer } from "@ledgerhq/logs";
12
+ import { parseGetDeviceNameResponse } from "./parseGetDeviceNameResponse";
13
+ /**
14
+ * A first APDU that we send because getDeviceName sometimes misbehaves on LNX
15
+ * if it's not sent.
16
+ * cf. https://github.com/LedgerHQ/ledger-live/pull/2250 where it was removed
17
+ * cf. https://github.com/LedgerHQ/ledger-live/pull/2401 where it was added back
18
+ */
19
+ const CLEANING_APDU = [0xe0, 0x50, 0x00, 0x00, undefined];
20
+ const GET_DEVICE_NAME_APDU = [0xe0, 0xd2, 0x00, 0x00, Buffer.from([])];
21
+ export function getDeviceName(transport) {
22
+ return __awaiter(this, void 0, void 0, function* () {
23
+ const tracer = new LocalTracer("hw", {
24
+ transport: transport.getTraceContext(),
25
+ function: "getDeviceName",
26
+ });
27
+ tracer.trace("Start");
28
+ try {
29
+ // Legacy: prevents bad apdu response for LNX
30
+ yield transport.send(...CLEANING_APDU);
31
+ }
32
+ catch (error) {
33
+ tracer.trace(`Error on 0xe0500000: ${error}`, { error });
34
+ }
35
+ tracer.trace("Sent cleaning 0xe0500000");
36
+ const res = yield transport.send(...GET_DEVICE_NAME_APDU, [
37
+ StatusCodes.OK,
38
+ StatusCodes.DEVICE_NOT_ONBOARDED,
39
+ StatusCodes.DEVICE_NOT_ONBOARDED_2,
40
+ ]);
41
+ return parseGetDeviceNameResponse(res);
42
+ });
43
+ }
44
+ //# sourceMappingURL=getDeviceName.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getDeviceName.js","sourceRoot":"","sources":["../../../src/commands/use-cases/getDeviceName.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAkB,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAE1E;;;;;GAKG;AACH,MAAM,aAAa,GAAS,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC;AAEhE,MAAM,oBAAoB,GAAS,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;AAE7E,MAAM,UAAgB,aAAa,CAAC,SAAoB;;QACtD,MAAM,MAAM,GAAG,IAAI,WAAW,CAAC,IAAI,EAAE;YACnC,SAAS,EAAE,SAAS,CAAC,eAAe,EAAE;YACtC,QAAQ,EAAE,eAAe;SAC1B,CAAC,CAAC;QACH,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAEtB,IAAI;YACF,6CAA6C;YAC7C,MAAM,SAAS,CAAC,IAAI,CAAC,GAAG,aAAa,CAAC,CAAC;SACxC;QAAC,OAAO,KAAK,EAAE;YACd,MAAM,CAAC,KAAK,CAAC,wBAAwB,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;SAC1D;QACD,MAAM,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC;QAEzC,MAAM,GAAG,GAAG,MAAM,SAAS,CAAC,IAAI,CAAC,GAAG,oBAAoB,EAAE;YACxD,WAAW,CAAC,EAAE;YACd,WAAW,CAAC,oBAAoB;YAChC,WAAW,CAAC,sBAAsB;SACnC,CAAC,CAAC;QAEH,OAAO,0BAA0B,CAAC,GAAG,CAAC,CAAC;IACzC,CAAC;CAAA"}
@@ -0,0 +1,15 @@
1
+ import Transport from "@ledgerhq/hw-transport";
2
+ import { FirmwareInfoEntity } from "../entities/FirmwareInfoEntity";
3
+ import { APDU } from "../entities/APDU";
4
+ export declare const GET_VERSION_APDU: APDU;
5
+ /**
6
+ * Get the FirmwareInfo of a given device
7
+ *
8
+ * @param transport
9
+ * @param options - Contains optional options:
10
+ * - abortTimeoutMs: aborts the APDU exchange after a given timeout
11
+ */
12
+ export declare function getVersion(transport: Transport, { abortTimeoutMs }?: {
13
+ abortTimeoutMs?: number;
14
+ }): Promise<FirmwareInfoEntity>;
15
+ //# sourceMappingURL=getVersion.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getVersion.d.ts","sourceRoot":"","sources":["../../../src/commands/use-cases/getVersion.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAGxC,eAAO,MAAM,gBAAgB,EAAE,IAA0C,CAAC;AAE1E;;;;;;GAMG;AACH,wBAAsB,UAAU,CAC9B,SAAS,EAAE,SAAS,EACpB,EAAE,cAAc,EAAE,GAAE;IAAE,cAAc,CAAC,EAAE,MAAM,CAAA;CAAO,GACnD,OAAO,CAAC,kBAAkB,CAAC,CAK7B"}
@@ -0,0 +1,27 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { parseGetVersionResponse } from "./parseGetVersionResponse";
11
+ export const GET_VERSION_APDU = [0xe0, 0x01, 0x00, 0x00, undefined];
12
+ /**
13
+ * Get the FirmwareInfo of a given device
14
+ *
15
+ * @param transport
16
+ * @param options - Contains optional options:
17
+ * - abortTimeoutMs: aborts the APDU exchange after a given timeout
18
+ */
19
+ export function getVersion(transport, { abortTimeoutMs } = {}) {
20
+ return __awaiter(this, void 0, void 0, function* () {
21
+ const res = yield transport.send(...GET_VERSION_APDU, undefined, {
22
+ abortTimeoutMs,
23
+ });
24
+ return parseGetVersionResponse(res);
25
+ });
26
+ }
27
+ //# sourceMappingURL=getVersion.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getVersion.js","sourceRoot":"","sources":["../../../src/commands/use-cases/getVersion.ts"],"names":[],"mappings":";;;;;;;;;AAGA,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEpE,MAAM,CAAC,MAAM,gBAAgB,GAAS,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC;AAE1E;;;;;;GAMG;AACH,MAAM,UAAgB,UAAU,CAC9B,SAAoB,EACpB,EAAE,cAAc,KAAkC,EAAE;;QAEpD,MAAM,GAAG,GAAG,MAAM,SAAS,CAAC,IAAI,CAAC,GAAG,gBAAgB,EAAE,SAAS,EAAE;YAC/D,cAAc;SACf,CAAC,CAAC;QACH,OAAO,uBAAuB,CAAC,GAAG,CAAC,CAAC;IACtC,CAAC;CAAA"}
@@ -0,0 +1,7 @@
1
+ import { DeviceModelId } from "@ledgerhq/devices";
2
+ /**
3
+ * @returns whether the Bootloader Version bytes are included in the result of the
4
+ * getVersion APDU
5
+ **/
6
+ export declare const isBootloaderVersionSupported: (seVersion: string, modelId?: DeviceModelId) => boolean;
7
+ //# sourceMappingURL=isBootloaderVersionSupported.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isBootloaderVersionSupported.d.ts","sourceRoot":"","sources":["../../../src/commands/use-cases/isBootloaderVersionSupported.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAWlD;;;IAGI;AAEJ,eAAO,MAAM,4BAA4B,cAAe,MAAM,YAAY,aAAa,KAAG,OAMvF,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { satisfies as versionSatisfies, coerce as semverCoerce } from "semver";
2
+ const deviceVersionRangesForBootloaderVersion = {
3
+ nanoS: ">=2.0.0",
4
+ nanoX: ">=2.0.0",
5
+ nanoSP: ">=1.0.0",
6
+ stax: ">=1.0.0",
7
+ europa: ">=1.0.0",
8
+ };
9
+ /**
10
+ * @returns whether the Bootloader Version bytes are included in the result of the
11
+ * getVersion APDU
12
+ **/
13
+ export const isBootloaderVersionSupported = (seVersion, modelId) => !!modelId &&
14
+ !!deviceVersionRangesForBootloaderVersion[modelId] &&
15
+ !!versionSatisfies(semverCoerce(seVersion) || seVersion, deviceVersionRangesForBootloaderVersion[modelId]);
16
+ //# sourceMappingURL=isBootloaderVersionSupported.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isBootloaderVersionSupported.js","sourceRoot":"","sources":["../../../src/commands/use-cases/isBootloaderVersionSupported.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,IAAI,gBAAgB,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,QAAQ,CAAC;AAG/E,MAAM,uCAAuC,GAEzC;IACF,KAAK,EAAE,SAAS;IAChB,KAAK,EAAE,SAAS;IAChB,MAAM,EAAE,SAAS;IACjB,IAAI,EAAE,SAAS;IACf,MAAM,EAAE,SAAS;CAClB,CAAC;AACF;;;IAGI;AAEJ,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,SAAiB,EAAE,OAAuB,EAAW,EAAE,CAClG,CAAC,CAAC,OAAO;IACT,CAAC,CAAC,uCAAuC,CAAC,OAAO,CAAC;IAClD,CAAC,CAAC,gBAAgB,CAChB,YAAY,CAAC,SAAS,CAAC,IAAI,SAAS,EACpC,uCAAuC,CAAC,OAAO,CAAW,CAC3D,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=isBootloaderVersionSupported.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isBootloaderVersionSupported.test.d.ts","sourceRoot":"","sources":["../../../src/commands/use-cases/isBootloaderVersionSupported.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,51 @@
1
+ import { DeviceModelId } from "@ledgerhq/devices";
2
+ import { isBootloaderVersionSupported } from "./isBootloaderVersionSupported";
3
+ const { nanoS, nanoSP, nanoX, stax } = DeviceModelId;
4
+ test("isBootloaderVersionSupported", () => {
5
+ /**
6
+ * Nano S
7
+ * */
8
+ expect(isBootloaderVersionSupported("1.9.0", nanoS)).toBe(false);
9
+ expect(isBootloaderVersionSupported("1.9.0-whatever0", nanoS)).toBe(false);
10
+ expect(isBootloaderVersionSupported("2.0.0", nanoS)).toBe(true);
11
+ expect(isBootloaderVersionSupported("2.0.0-rc1", nanoS)).toBe(true);
12
+ expect(isBootloaderVersionSupported("2.0.1", nanoS)).toBe(true);
13
+ expect(isBootloaderVersionSupported("2.0.1-whatever0", nanoS)).toBe(true);
14
+ expect(isBootloaderVersionSupported("2.1.0", nanoS)).toBe(true);
15
+ expect(isBootloaderVersionSupported("2.1.0-whatever0", nanoS)).toBe(true);
16
+ expect(isBootloaderVersionSupported("3.0.0", nanoS)).toBe(true);
17
+ expect(isBootloaderVersionSupported("3.0.0-whatever0", nanoS)).toBe(true);
18
+ /**
19
+ * Nano X
20
+ * */
21
+ expect(isBootloaderVersionSupported("1.9.0", nanoX)).toBe(false);
22
+ expect(isBootloaderVersionSupported("1.9.0-whatever0", nanoX)).toBe(false);
23
+ expect(isBootloaderVersionSupported("2.0.0", nanoX)).toBe(true);
24
+ expect(isBootloaderVersionSupported("2.0.0-rc1", nanoX)).toBe(true);
25
+ expect(isBootloaderVersionSupported("2.0.1", nanoX)).toBe(true);
26
+ expect(isBootloaderVersionSupported("2.0.1-whatever0", nanoX)).toBe(true);
27
+ expect(isBootloaderVersionSupported("2.1.0", nanoX)).toBe(true);
28
+ expect(isBootloaderVersionSupported("2.1.0-whatever0", nanoX)).toBe(true);
29
+ expect(isBootloaderVersionSupported("3.0.0", nanoX)).toBe(true);
30
+ expect(isBootloaderVersionSupported("3.0.0-whatever0", nanoX)).toBe(true);
31
+ /**
32
+ * Nano SP
33
+ * */
34
+ expect(isBootloaderVersionSupported("0.9.0", nanoSP)).toBe(false);
35
+ expect(isBootloaderVersionSupported("0.9.0-whatever0", nanoSP)).toBe(false);
36
+ expect(isBootloaderVersionSupported("1.0.0", nanoSP)).toBe(true);
37
+ expect(isBootloaderVersionSupported("1.0.0-rc1", nanoSP)).toBe(true);
38
+ expect(isBootloaderVersionSupported("1.0.1", nanoSP)).toBe(true);
39
+ expect(isBootloaderVersionSupported("1.0.1-whatever0", nanoSP)).toBe(true);
40
+ expect(isBootloaderVersionSupported("1.1.0", nanoSP)).toBe(true);
41
+ expect(isBootloaderVersionSupported("1.1.0-whatever0", nanoSP)).toBe(true);
42
+ expect(isBootloaderVersionSupported("1.0.0", nanoSP)).toBe(true);
43
+ expect(isBootloaderVersionSupported("1.0.0-whatever0", nanoSP)).toBe(true);
44
+ /**
45
+ * Stax
46
+ * */
47
+ expect(isBootloaderVersionSupported("0.9.0", stax)).toBe(false);
48
+ expect(isBootloaderVersionSupported("1.0.0", stax)).toBe(true);
49
+ expect(isBootloaderVersionSupported("1.0.0-whatever0", stax)).toBe(true);
50
+ });
51
+ //# sourceMappingURL=isBootloaderVersionSupported.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isBootloaderVersionSupported.test.js","sourceRoot":"","sources":["../../../src/commands/use-cases/isBootloaderVersionSupported.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAE9E,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,aAAa,CAAC;AAErD,IAAI,CAAC,8BAA8B,EAAE,GAAG,EAAE;IACxC;;SAEK;IACL,MAAM,CAAC,4BAA4B,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACjE,MAAM,CAAC,4BAA4B,CAAC,iBAAiB,EAAE,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAE3E,MAAM,CAAC,4BAA4B,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAChE,MAAM,CAAC,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,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC3E,MAAM,CAAC,4BAA4B,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACjE,MAAM,CAAC,4BAA4B,CAAC,iBAAiB,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAE3E;;SAEK;IACL,MAAM,CAAC,4BAA4B,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAChE,MAAM,CAAC,4BAA4B,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC/D,MAAM,CAAC,4BAA4B,CAAC,iBAAiB,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC3E,CAAC,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { DeviceModelId } from "@ledgerhq/devices";
2
+ export declare const isDeviceLocalizationSupported: (seVersion: string, modelId?: DeviceModelId) => boolean;
3
+ //# sourceMappingURL=isDeviceLocalizationSupported.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isDeviceLocalizationSupported.d.ts","sourceRoot":"","sources":["../../../src/commands/use-cases/isDeviceLocalizationSupported.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAUlD,eAAO,MAAM,6BAA6B,cAC7B,MAAM,YACP,aAAa,KACtB,OAMA,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { satisfies as versionSatisfies, coerce as semverCoerce } from "semver";
2
+ const deviceVersionRangesForLocalization = {
3
+ nanoX: ">=2.1.0",
4
+ nanoSP: ">=1.1.0",
5
+ stax: ">=1.0.0",
6
+ europa: ">=1.0.0",
7
+ };
8
+ export const isDeviceLocalizationSupported = (seVersion, modelId) => !!modelId &&
9
+ !!deviceVersionRangesForLocalization[modelId] &&
10
+ !!versionSatisfies(semverCoerce(seVersion) || seVersion, deviceVersionRangesForLocalization[modelId]);
11
+ //# sourceMappingURL=isDeviceLocalizationSupported.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isDeviceLocalizationSupported.js","sourceRoot":"","sources":["../../../src/commands/use-cases/isDeviceLocalizationSupported.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,IAAI,gBAAgB,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,QAAQ,CAAC;AAE/E,MAAM,kCAAkC,GAAwC;IAC9E,KAAK,EAAE,SAAS;IAChB,MAAM,EAAE,SAAS;IACjB,IAAI,EAAE,SAAS;IACf,MAAM,EAAE,SAAS;CAClB,CAAC;AAEF,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAC3C,SAAiB,EACjB,OAAuB,EACd,EAAE,CACX,CAAC,CAAC,OAAO;IACT,CAAC,CAAC,kCAAkC,CAAC,OAAO,CAAC;IAC7C,CAAC,CAAC,gBAAgB,CAChB,YAAY,CAAC,SAAS,CAAC,IAAI,SAAS,EACpC,kCAAkC,CAAC,OAAO,CAAW,CACtD,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=isDeviceLocalizationSupported.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isDeviceLocalizationSupported.test.d.ts","sourceRoot":"","sources":["../../../src/commands/use-cases/isDeviceLocalizationSupported.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,43 @@
1
+ import { DeviceModelId } from "@ledgerhq/devices";
2
+ import { isDeviceLocalizationSupported } from "./isDeviceLocalizationSupported";
3
+ const { nanoS, nanoSP, nanoX, stax } = DeviceModelId;
4
+ test("isDeviceLocalizationSupported", () => {
5
+ /**
6
+ * Nano X
7
+ * */
8
+ expect(isDeviceLocalizationSupported("2.0.0", nanoX)).toBe(false);
9
+ expect(isDeviceLocalizationSupported("2.0.0-whatever0", nanoX)).toBe(false);
10
+ expect(isDeviceLocalizationSupported("2.1.0", nanoX)).toBe(true);
11
+ expect(isDeviceLocalizationSupported("2.1.0-rc1", nanoX)).toBe(true);
12
+ expect(isDeviceLocalizationSupported("2.1.1", nanoX)).toBe(true);
13
+ expect(isDeviceLocalizationSupported("2.1.1-whatever0", nanoX)).toBe(true);
14
+ expect(isDeviceLocalizationSupported("2.2.0", nanoX)).toBe(true);
15
+ expect(isDeviceLocalizationSupported("2.2.0-whatever0", nanoX)).toBe(true);
16
+ expect(isDeviceLocalizationSupported("3.0.0", nanoX)).toBe(true);
17
+ expect(isDeviceLocalizationSupported("3.0.0-whatever0", nanoX)).toBe(true);
18
+ /**
19
+ * Nano SP
20
+ * */
21
+ expect(isDeviceLocalizationSupported("1.0.0", nanoSP)).toBe(false);
22
+ expect(isDeviceLocalizationSupported("1.0.0-whatever", nanoSP)).toBe(false);
23
+ expect(isDeviceLocalizationSupported("1.1.0", nanoSP)).toBe(true);
24
+ expect(isDeviceLocalizationSupported("1.1.0-rc1", nanoSP)).toBe(true);
25
+ expect(isDeviceLocalizationSupported("1.1.2", nanoSP)).toBe(true);
26
+ expect(isDeviceLocalizationSupported("1.1.2-whatever0", nanoSP)).toBe(true);
27
+ expect(isDeviceLocalizationSupported("1.2.0", nanoSP)).toBe(true);
28
+ expect(isDeviceLocalizationSupported("1.2.0-whatever0", nanoSP)).toBe(true);
29
+ expect(isDeviceLocalizationSupported("2.0.0", nanoSP)).toBe(true);
30
+ expect(isDeviceLocalizationSupported("2.0.0-whatever0", nanoSP)).toBe(true);
31
+ /**
32
+ * Stax
33
+ * */
34
+ expect(isDeviceLocalizationSupported("0.9.0", stax)).toBe(false);
35
+ expect(isDeviceLocalizationSupported("9.0.0", stax)).toBe(true);
36
+ expect(isDeviceLocalizationSupported("9.0.0-whatever", stax)).toBe(true);
37
+ /**
38
+ * NanoS
39
+ * */
40
+ expect(isDeviceLocalizationSupported("9.0.0", nanoS)).toBe(false);
41
+ expect(isDeviceLocalizationSupported("9.0.0-whatever", nanoS)).toBe(false);
42
+ });
43
+ //# sourceMappingURL=isDeviceLocalizationSupported.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isDeviceLocalizationSupported.test.js","sourceRoot":"","sources":["../../../src/commands/use-cases/isDeviceLocalizationSupported.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAChF,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,aAAa,CAAC;AAErD,IAAI,CAAC,+BAA+B,EAAE,GAAG,EAAE;IACzC;;SAEK;IACL,MAAM,CAAC,6BAA6B,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAClE,MAAM,CAAC,6BAA6B,CAAC,iBAAiB,EAAE,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAE5E,MAAM,CAAC,6BAA6B,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACjE,MAAM,CAAC,6BAA6B,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACrE,MAAM,CAAC,6BAA6B,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACjE,MAAM,CAAC,6BAA6B,CAAC,iBAAiB,EAAE,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC3E,MAAM,CAAC,6BAA6B,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACjE,MAAM,CAAC,6BAA6B,CAAC,iBAAiB,EAAE,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAA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AEK;IACL,MAAM,CAAC,6BAA6B,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACjE,MAAM,CAAC,6BAA6B,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAChE,MAAM,CAAC,6BAA6B,CAAC,gBAAgB,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAEzE;;SAEK;IACL,MAAM,CAAC,6BAA6B,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAClE,MAAM,CAAC,6BAA6B,CAAC,gBAAgB,EAAE,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC7E,CAAC,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { DeviceModelId } from "@ledgerhq/devices";
2
+ /**
3
+ * @returns whether the Hardware Version bytes are included in the result of the
4
+ * getVersion APDU
5
+ * */
6
+ export declare const isHardwareVersionSupported: (seVersion: string, modelId?: DeviceModelId) => boolean;
7
+ //# sourceMappingURL=isHardwareVersionSupported.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isHardwareVersionSupported.d.ts","sourceRoot":"","sources":["../../../src/commands/use-cases/isHardwareVersionSupported.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAOlD;;;KAGK;AAEL,eAAO,MAAM,0BAA0B,cAAe,MAAM,YAAY,aAAa,KAAG,OAMrF,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { satisfies as versionSatisfies, coerce as semverCoerce } from "semver";
2
+ const deviceVersionRangesForHardwareVersion = {
3
+ nanoX: ">=2.0.0",
4
+ };
5
+ /**
6
+ * @returns whether the Hardware Version bytes are included in the result of the
7
+ * getVersion APDU
8
+ * */
9
+ export const isHardwareVersionSupported = (seVersion, modelId) => !!modelId &&
10
+ !!deviceVersionRangesForHardwareVersion[modelId] &&
11
+ !!versionSatisfies(semverCoerce(seVersion) || seVersion, deviceVersionRangesForHardwareVersion[modelId]);
12
+ //# sourceMappingURL=isHardwareVersionSupported.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isHardwareVersionSupported.js","sourceRoot":"","sources":["../../../src/commands/use-cases/isHardwareVersionSupported.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,IAAI,gBAAgB,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,QAAQ,CAAC;AAG/E,MAAM,qCAAqC,GAEvC;IACF,KAAK,EAAE,SAAS;CACjB,CAAC;AACF;;;KAGK;AAEL,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,SAAiB,EAAE,OAAuB,EAAW,EAAE,CAChG,CAAC,CAAC,OAAO;IACT,CAAC,CAAC,qCAAqC,CAAC,OAAO,CAAC;IAChD,CAAC,CAAC,gBAAgB,CAChB,YAAY,CAAC,SAAS,CAAC,IAAI,SAAS,EACpC,qCAAqC,CAAC,OAAO,CAAW,CACzD,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=isHardwareVersionSupported.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isHardwareVersionSupported.test.d.ts","sourceRoot":"","sources":["../../../src/commands/use-cases/isHardwareVersionSupported.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,34 @@
1
+ import { DeviceModelId } from "@ledgerhq/devices";
2
+ import { isHardwareVersionSupported } from "./isHardwareVersionSupported";
3
+ const { nanoS, nanoSP, nanoX, stax } = DeviceModelId;
4
+ test("isHardwareVersionSupported", () => {
5
+ /**
6
+ * Nano S
7
+ * */
8
+ expect(isHardwareVersionSupported("2.0.0", nanoS)).toBe(false);
9
+ expect(isHardwareVersionSupported("2.0.0-whatever0", nanoS)).toBe(false);
10
+ /**
11
+ * Nano X
12
+ * */
13
+ expect(isHardwareVersionSupported("1.9.0", nanoX)).toBe(false);
14
+ expect(isHardwareVersionSupported("1.9.0-whatever0", nanoX)).toBe(false);
15
+ expect(isHardwareVersionSupported("2.0.0", nanoX)).toBe(true);
16
+ expect(isHardwareVersionSupported("2.0.0-rc1", nanoX)).toBe(true);
17
+ expect(isHardwareVersionSupported("2.0.1", nanoX)).toBe(true);
18
+ expect(isHardwareVersionSupported("2.0.1-whatever0", nanoX)).toBe(true);
19
+ expect(isHardwareVersionSupported("2.1.0", nanoX)).toBe(true);
20
+ expect(isHardwareVersionSupported("2.1.0-whatever0", nanoX)).toBe(true);
21
+ expect(isHardwareVersionSupported("3.0.0", nanoX)).toBe(true);
22
+ expect(isHardwareVersionSupported("3.0.0-whatever0", nanoX)).toBe(true);
23
+ /**
24
+ * Nano SP
25
+ * */
26
+ expect(isHardwareVersionSupported("2.0.0", nanoSP)).toBe(false);
27
+ expect(isHardwareVersionSupported("2.0.0-whatever0", nanoSP)).toBe(false);
28
+ /**
29
+ * Stax
30
+ * */
31
+ expect(isHardwareVersionSupported("2.0.0", stax)).toBe(false);
32
+ expect(isHardwareVersionSupported("2.0.0-whatever0", stax)).toBe(false);
33
+ });
34
+ //# sourceMappingURL=isHardwareVersionSupported.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isHardwareVersionSupported.test.js","sourceRoot":"","sources":["../../../src/commands/use-cases/isHardwareVersionSupported.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAE1E,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,aAAa,CAAC;AAErD,IAAI,CAAC,4BAA4B,EAAE,GAAG,EAAE;IACtC;;SAEK;IACL,MAAM,CAAC,0BAA0B,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC/D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AM,CAAC,0BAA0B,CAAC,iBAAiB,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAE1E;;SAEK;IACL,MAAM,CAAC,0BAA0B,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC9D,MAAM,CAAC,0BAA0B,CAAC,iBAAiB,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC1E,CAAC,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ /// <reference types="node" />
2
+ export declare function parseGetDeviceNameResponse(response: Buffer): string;
3
+ //# sourceMappingURL=parseGetDeviceNameResponse.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parseGetDeviceNameResponse.d.ts","sourceRoot":"","sources":["../../../src/commands/use-cases/parseGetDeviceNameResponse.ts"],"names":[],"mappings":";AAGA,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAgBnE"}
@@ -0,0 +1,19 @@
1
+ import { StatusCodes, TransportStatusError } from "@ledgerhq/hw-transport";
2
+ import { LocalTracer } from "@ledgerhq/logs";
3
+ export function parseGetDeviceNameResponse(response) {
4
+ const tracer = new LocalTracer("hw", {
5
+ function: "parseGetDeviceNameResponse",
6
+ });
7
+ const status = response.readUInt16BE(response.length - 2);
8
+ if (tracer)
9
+ tracer.trace("Result status from 0xe0d20000", { status });
10
+ switch (status) {
11
+ case StatusCodes.OK:
12
+ return response.slice(0, response.length - 2).toString("utf-8");
13
+ case StatusCodes.DEVICE_NOT_ONBOARDED:
14
+ case StatusCodes.DEVICE_NOT_ONBOARDED_2:
15
+ return "";
16
+ }
17
+ throw new TransportStatusError(status);
18
+ }
19
+ //# sourceMappingURL=parseGetDeviceNameResponse.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parseGetDeviceNameResponse.js","sourceRoot":"","sources":["../../../src/commands/use-cases/parseGetDeviceNameResponse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,MAAM,UAAU,0BAA0B,CAAC,QAAgB;IACzD,MAAM,MAAM,GAAG,IAAI,WAAW,CAAC,IAAI,EAAE;QACnC,QAAQ,EAAE,4BAA4B;KACvC,CAAC,CAAC;IACH,MAAM,MAAM,GAAG,QAAQ,CAAC,YAAY,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC1D,IAAI,MAAM;QAAE,MAAM,CAAC,KAAK,CAAC,+BAA+B,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;IAEtE,QAAQ,MAAM,EAAE;QACd,KAAK,WAAW,CAAC,EAAE;YACjB,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAClE,KAAK,WAAW,CAAC,oBAAoB,CAAC;QACtC,KAAK,WAAW,CAAC,sBAAsB;YACrC,OAAO,EAAE,CAAC;KACb;IAED,MAAM,IAAI,oBAAoB,CAAC,MAAM,CAAC,CAAC;AACzC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=parseGetDeviceNameResponse.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parseGetDeviceNameResponse.test.d.ts","sourceRoot":"","sources":["../../../src/commands/use-cases/parseGetDeviceNameResponse.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,25 @@
1
+ import { parseGetDeviceNameResponse } from "./parseGetDeviceNameResponse";
2
+ describe("getDeviceName", () => {
3
+ it("should return name if available", () => {
4
+ const responseBuffer = Buffer.from("50756572746f9000", "hex");
5
+ const result = parseGetDeviceNameResponse(responseBuffer);
6
+ expect(result).toMatch("Puerto"); // 🐾
7
+ });
8
+ it("should return empty name when the device is not onboarded", () => {
9
+ const responseBuffer = Buffer.from("bababababababa6d07", "hex");
10
+ const result = parseGetDeviceNameResponse(responseBuffer);
11
+ expect(result).toMatch("");
12
+ });
13
+ it("should return empty name when the device is not onboarded #2", () => {
14
+ const responseBuffer = Buffer.from("bababababababa6611", "hex");
15
+ const result = parseGetDeviceNameResponse(responseBuffer);
16
+ expect(result).toMatch("");
17
+ });
18
+ it("should throw for an unexpected bootloader or any other code", () => {
19
+ const responseBuffer = Buffer.from("662d", "hex");
20
+ expect(() => {
21
+ parseGetDeviceNameResponse(responseBuffer);
22
+ }).toThrow(Error);
23
+ });
24
+ });
25
+ //# sourceMappingURL=parseGetDeviceNameResponse.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parseGetDeviceNameResponse.test.js","sourceRoot":"","sources":["../../../src/commands/use-cases/parseGetDeviceNameResponse.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAE1E,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAC7B,EAAE,CAAC,iCAAiC,EAAE,GAAG,EAAE;QACzC,MAAM,cAAc,GAAG,MAAM,CAAC,IAAI,CAAC,kBAAkB,EAAE,KAAK,CAAC,CAAC;QAE9D,MAAM,MAAM,GAAG,0BAA0B,CAAC,cAAc,CAAC,CAAC;QAE1D,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK;IACzC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,2DAA2D,EAAE,GAAG,EAAE;QACnE,MAAM,cAAc,GAAG,MAAM,CAAC,IAAI,CAAC,oBAAoB,EAAE,KAAK,CAAC,CAAC;QAEhE,MAAM,MAAM,GAAG,0BAA0B,CAAC,cAAc,CAAC,CAAC;QAE1D,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAC7B,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,8DAA8D,EAAE,GAAG,EAAE;QACtE,MAAM,cAAc,GAAG,MAAM,CAAC,IAAI,CAAC,oBAAoB,EAAE,KAAK,CAAC,CAAC;QAEhE,MAAM,MAAM,GAAG,0BAA0B,CAAC,cAAc,CAAC,CAAC;QAE1D,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAC7B,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,6DAA6D,EAAE,GAAG,EAAE;QACrE,MAAM,cAAc,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;QAElD,MAAM,CAAC,GAAG,EAAE;YACV,0BAA0B,CAAC,cAAc,CAAC,CAAC;QAC7C,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACpB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ /// <reference types="node" />
2
+ import { FirmwareInfoEntity } from "../entities/FirmwareInfoEntity";
3
+ export declare function parseGetVersionResponse(response: Buffer): FirmwareInfoEntity;
4
+ //# sourceMappingURL=parseGetVersionResponse.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parseGetVersionResponse.d.ts","sourceRoot":"","sources":["../../../src/commands/use-cases/parseGetVersionResponse.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAKpE,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,GAAG,kBAAkB,CAkH5E"}
@@ -0,0 +1,104 @@
1
+ import { identifyTargetId } from "@ledgerhq/devices";
2
+ import { isDeviceLocalizationSupported } from "./isDeviceLocalizationSupported";
3
+ import { isHardwareVersionSupported } from "./isHardwareVersionSupported";
4
+ import { isBootloaderVersionSupported } from "./isBootloaderVersionSupported";
5
+ export function parseGetVersionResponse(response) {
6
+ const data = response.slice(0, response.length - 2);
7
+ let i = 0;
8
+ // parse the target id of either BL or SE
9
+ const targetId = data.readUIntBE(0, 4);
10
+ i += 4;
11
+ // parse the version of either BL or SE
12
+ const rawVersionLength = data[i++];
13
+ let rawVersion = data.slice(i, i + rawVersionLength).toString();
14
+ i += rawVersionLength;
15
+ // flags. gives information about manager allowed in SE mode.
16
+ const flagsLength = data[i++];
17
+ let flags = data.slice(i, i + flagsLength);
18
+ i += flagsLength;
19
+ if (!rawVersionLength) {
20
+ // To support old firmware like bootloader of 1.3.1
21
+ rawVersion = "0.0.0";
22
+ flags = Buffer.allocUnsafeSlow(0);
23
+ }
24
+ let mcuVersion = "";
25
+ let mcuBlVersion;
26
+ let seVersion;
27
+ let bootloaderVersion;
28
+ let hardwareVersion;
29
+ let mcuTargetId;
30
+ let seTargetId;
31
+ let languageId;
32
+ const isBootloader = (targetId & 4026531840) !== 805306368;
33
+ if (isBootloader) {
34
+ mcuBlVersion = rawVersion;
35
+ mcuTargetId = targetId;
36
+ if (i < data.length) {
37
+ // se part 1
38
+ const part1Length = data[i++];
39
+ const part1 = data.slice(i, i + part1Length);
40
+ i += part1Length;
41
+ // at this time, this is how we branch old & new format
42
+ if (part1Length >= 5) {
43
+ seVersion = part1.toString();
44
+ // se part 2
45
+ const part2Length = data[i++];
46
+ const part2 = data.slice(i, i + part2Length);
47
+ i += flagsLength;
48
+ seTargetId = part2.readUIntBE(0, 4);
49
+ }
50
+ else {
51
+ seTargetId = part1.readUIntBE(0, 4);
52
+ }
53
+ }
54
+ }
55
+ else {
56
+ seVersion = rawVersion;
57
+ seTargetId = targetId;
58
+ // if SE: mcu version
59
+ const mcuVersionLength = data[i++];
60
+ let mcuVersionBuf = Buffer.from(data.slice(i, i + mcuVersionLength));
61
+ i += mcuVersionLength;
62
+ if (mcuVersionBuf[mcuVersionBuf.length - 1] === 0) {
63
+ mcuVersionBuf = mcuVersionBuf.slice(0, mcuVersionBuf.length - 1);
64
+ }
65
+ mcuVersion = mcuVersionBuf.toString();
66
+ const isOSU = rawVersion.includes("-osu");
67
+ if (!isOSU) {
68
+ const deviceModel = identifyTargetId(targetId);
69
+ if (isBootloaderVersionSupported(seVersion, deviceModel === null || deviceModel === void 0 ? void 0 : deviceModel.id)) {
70
+ const bootloaderVersionLength = data[i++];
71
+ let bootloaderVersionBuf = Buffer.from(data.slice(i, i + bootloaderVersionLength));
72
+ i += bootloaderVersionLength;
73
+ if (bootloaderVersionBuf[bootloaderVersionBuf.length - 1] === 0) {
74
+ bootloaderVersionBuf = bootloaderVersionBuf.slice(0, bootloaderVersionBuf.length - 1);
75
+ }
76
+ bootloaderVersion = bootloaderVersionBuf.toString();
77
+ }
78
+ if (isHardwareVersionSupported(seVersion, deviceModel === null || deviceModel === void 0 ? void 0 : deviceModel.id)) {
79
+ const hardwareVersionLength = data[i++];
80
+ hardwareVersion = data.slice(i, i + hardwareVersionLength).readUIntBE(0, 1); // ?? string? number?
81
+ i += hardwareVersionLength;
82
+ }
83
+ if (isDeviceLocalizationSupported(seVersion, deviceModel === null || deviceModel === void 0 ? void 0 : deviceModel.id)) {
84
+ const languageIdLength = data[i++];
85
+ languageId = data.slice(i, i + languageIdLength).readUIntBE(0, 1);
86
+ }
87
+ }
88
+ }
89
+ return {
90
+ isBootloader,
91
+ rawVersion,
92
+ targetId,
93
+ seVersion,
94
+ mcuVersion,
95
+ mcuBlVersion,
96
+ mcuTargetId,
97
+ seTargetId,
98
+ flags,
99
+ bootloaderVersion,
100
+ hardwareVersion,
101
+ languageId,
102
+ };
103
+ }
104
+ //# sourceMappingURL=parseGetVersionResponse.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parseGetVersionResponse.js","sourceRoot":"","sources":["../../../src/commands/use-cases/parseGetVersionResponse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAErD,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAChF,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;A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WAAW,CAAE,EAAE,CAAC,EAAE;gBAC7D,MAAM,gBAAgB,GAAG,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC;gBACnC,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,gBAAgB,CAAC,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;aACnE;SACF;KACF;IAED,OAAO;QACL,YAAY;QACZ,UAAU;QACV,QAAQ;QACR,SAAS;QACT,UAAU;QACV,YAAY;QACZ,WAAW;QACX,UAAU;QACV,KAAK;QACL,iBAAiB;QACjB,eAAe;QACf,UAAU;KACX,CAAC;AACJ,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=parseGetVersionResponse.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parseGetVersionResponse.test.d.ts","sourceRoot":"","sources":["../../../src/commands/use-cases/parseGetVersionResponse.test.ts"],"names":[],"mappings":""}