@ledgerhq/live-common 34.53.0-nightly.20251115023630 → 34.53.0-nightly.20251118023800

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 (410) hide show
  1. package/lib/currencies/helpers.d.ts +1 -3
  2. package/lib/currencies/helpers.d.ts.map +1 -1
  3. package/lib/currencies/helpers.js +1 -27
  4. package/lib/currencies/helpers.js.map +1 -1
  5. package/lib/dada-client/hooks/useAssetsData.d.ts +1 -0
  6. package/lib/dada-client/hooks/useAssetsData.d.ts.map +1 -1
  7. package/lib/dada-client/hooks/useAssetsData.js +1 -0
  8. package/lib/dada-client/hooks/useAssetsData.js.map +1 -1
  9. package/lib/deviceSDK/actions/getBatteryStatuses.d.ts +2 -1
  10. package/lib/deviceSDK/actions/getBatteryStatuses.d.ts.map +1 -1
  11. package/lib/deviceSDK/actions/getBatteryStatuses.js +2 -2
  12. package/lib/deviceSDK/actions/getBatteryStatuses.js.map +1 -1
  13. package/lib/deviceSDK/actions/getDeviceInfo.d.ts +2 -1
  14. package/lib/deviceSDK/actions/getDeviceInfo.d.ts.map +1 -1
  15. package/lib/deviceSDK/actions/getDeviceInfo.js +2 -2
  16. package/lib/deviceSDK/actions/getDeviceInfo.js.map +1 -1
  17. package/lib/deviceSDK/actions/getLatestAvailableFirmware.d.ts +2 -1
  18. package/lib/deviceSDK/actions/getLatestAvailableFirmware.d.ts.map +1 -1
  19. package/lib/deviceSDK/actions/getLatestAvailableFirmware.js +6 -3
  20. package/lib/deviceSDK/actions/getLatestAvailableFirmware.js.map +1 -1
  21. package/lib/deviceSDK/actions/toggleOnboardingEarlyCheck.d.ts +2 -1
  22. package/lib/deviceSDK/actions/toggleOnboardingEarlyCheck.d.ts.map +1 -1
  23. package/lib/deviceSDK/actions/toggleOnboardingEarlyCheck.js +2 -2
  24. package/lib/deviceSDK/actions/toggleOnboardingEarlyCheck.js.map +1 -1
  25. package/lib/deviceSDK/actions/updateFirmware.d.ts +2 -1
  26. package/lib/deviceSDK/actions/updateFirmware.d.ts.map +1 -1
  27. package/lib/deviceSDK/actions/updateFirmware.js +4 -3
  28. package/lib/deviceSDK/actions/updateFirmware.js.map +1 -1
  29. package/lib/deviceSDK/hooks/useBatteryStatuses.d.ts +2 -1
  30. package/lib/deviceSDK/hooks/useBatteryStatuses.d.ts.map +1 -1
  31. package/lib/deviceSDK/hooks/useBatteryStatuses.js +3 -2
  32. package/lib/deviceSDK/hooks/useBatteryStatuses.js.map +1 -1
  33. package/lib/deviceSDK/hooks/useGetDeviceInfo.d.ts +2 -1
  34. package/lib/deviceSDK/hooks/useGetDeviceInfo.d.ts.map +1 -1
  35. package/lib/deviceSDK/hooks/useGetDeviceInfo.js +3 -3
  36. package/lib/deviceSDK/hooks/useGetDeviceInfo.js.map +1 -1
  37. package/lib/deviceSDK/hooks/useGetLatestAvailableFirmware.d.ts +2 -1
  38. package/lib/deviceSDK/hooks/useGetLatestAvailableFirmware.d.ts.map +1 -1
  39. package/lib/deviceSDK/hooks/useGetLatestAvailableFirmware.js +2 -1
  40. package/lib/deviceSDK/hooks/useGetLatestAvailableFirmware.js.map +1 -1
  41. package/lib/deviceSDK/hooks/useToggleOnboardingEarlyChecks.d.ts +2 -1
  42. package/lib/deviceSDK/hooks/useToggleOnboardingEarlyChecks.d.ts.map +1 -1
  43. package/lib/deviceSDK/hooks/useToggleOnboardingEarlyChecks.js +3 -2
  44. package/lib/deviceSDK/hooks/useToggleOnboardingEarlyChecks.js.map +1 -1
  45. package/lib/deviceSDK/hooks/useUpdateFirmware.d.ts +2 -1
  46. package/lib/deviceSDK/hooks/useUpdateFirmware.d.ts.map +1 -1
  47. package/lib/deviceSDK/hooks/useUpdateFirmware.js +3 -2
  48. package/lib/deviceSDK/hooks/useUpdateFirmware.js.map +1 -1
  49. package/lib/deviceSDK/tasks/getBatteryStatuses.d.ts +1 -0
  50. package/lib/deviceSDK/tasks/getBatteryStatuses.d.ts.map +1 -1
  51. package/lib/deviceSDK/tasks/getBatteryStatuses.js +2 -2
  52. package/lib/deviceSDK/tasks/getBatteryStatuses.js.map +1 -1
  53. package/lib/deviceSDK/tasks/getDeviceInfo.d.ts +2 -1
  54. package/lib/deviceSDK/tasks/getDeviceInfo.d.ts.map +1 -1
  55. package/lib/deviceSDK/tasks/getDeviceInfo.js +2 -2
  56. package/lib/deviceSDK/tasks/getDeviceInfo.js.map +1 -1
  57. package/lib/deviceSDK/tasks/getLatestFirmware.d.ts +1 -0
  58. package/lib/deviceSDK/tasks/getLatestFirmware.d.ts.map +1 -1
  59. package/lib/deviceSDK/tasks/getLatestFirmware.js +2 -2
  60. package/lib/deviceSDK/tasks/getLatestFirmware.js.map +1 -1
  61. package/lib/deviceSDK/tasks/toggleOnboardingEarlyCheck.d.ts +1 -0
  62. package/lib/deviceSDK/tasks/toggleOnboardingEarlyCheck.d.ts.map +1 -1
  63. package/lib/deviceSDK/tasks/toggleOnboardingEarlyCheck.js +2 -2
  64. package/lib/deviceSDK/tasks/toggleOnboardingEarlyCheck.js.map +1 -1
  65. package/lib/deviceSDK/tasks/updateFirmware.d.ts +1 -0
  66. package/lib/deviceSDK/tasks/updateFirmware.d.ts.map +1 -1
  67. package/lib/deviceSDK/tasks/updateFirmware.js +2 -2
  68. package/lib/deviceSDK/tasks/updateFirmware.js.map +1 -1
  69. package/lib/deviceSDK/transports/core.d.ts +1 -0
  70. package/lib/deviceSDK/transports/core.d.ts.map +1 -1
  71. package/lib/deviceSDK/transports/core.js +2 -2
  72. package/lib/deviceSDK/transports/core.js.map +1 -1
  73. package/lib/hw/actions/app.d.ts.map +1 -1
  74. package/lib/hw/actions/app.js +2 -1
  75. package/lib/hw/actions/app.js.map +1 -1
  76. package/lib/hw/actions/customLockScreenLoad.d.ts +1 -1
  77. package/lib/hw/actions/customLockScreenLoad.d.ts.map +1 -1
  78. package/lib/hw/actions/customLockScreenLoad.js +2 -0
  79. package/lib/hw/actions/customLockScreenLoad.js.map +1 -1
  80. package/lib/hw/actions/implementations.d.ts +1 -0
  81. package/lib/hw/actions/implementations.d.ts.map +1 -1
  82. package/lib/hw/actions/implementations.js +12 -2
  83. package/lib/hw/actions/implementations.js.map +1 -1
  84. package/lib/hw/connectApp.d.ts +2 -1
  85. package/lib/hw/connectApp.d.ts.map +1 -1
  86. package/lib/hw/connectApp.js +4 -4
  87. package/lib/hw/connectApp.js.map +1 -1
  88. package/lib/hw/connectManager.d.ts +2 -1
  89. package/lib/hw/connectManager.d.ts.map +1 -1
  90. package/lib/hw/connectManager.js +4 -4
  91. package/lib/hw/connectManager.js.map +1 -1
  92. package/lib/hw/customLockScreenFetch.d.ts +2 -1
  93. package/lib/hw/customLockScreenFetch.d.ts.map +1 -1
  94. package/lib/hw/customLockScreenFetch.js +2 -2
  95. package/lib/hw/customLockScreenFetch.js.map +1 -1
  96. package/lib/hw/customLockScreenLoad.d.ts +2 -1
  97. package/lib/hw/customLockScreenLoad.d.ts.map +1 -1
  98. package/lib/hw/customLockScreenLoad.js +2 -2
  99. package/lib/hw/customLockScreenLoad.js.map +1 -1
  100. package/lib/hw/deviceAccess.d.ts +3 -3
  101. package/lib/hw/deviceAccess.d.ts.map +1 -1
  102. package/lib/hw/deviceAccess.js +2 -1
  103. package/lib/hw/deviceAccess.js.map +1 -1
  104. package/lib/hw/getGenuineCheckFromDeviceId.d.ts +2 -1
  105. package/lib/hw/getGenuineCheckFromDeviceId.d.ts.map +1 -1
  106. package/lib/hw/getGenuineCheckFromDeviceId.js +2 -2
  107. package/lib/hw/getGenuineCheckFromDeviceId.js.map +1 -1
  108. package/lib/hw/getOnboardingStatePolling.d.ts +2 -1
  109. package/lib/hw/getOnboardingStatePolling.d.ts.map +1 -1
  110. package/lib/hw/getOnboardingStatePolling.js +5 -2
  111. package/lib/hw/getOnboardingStatePolling.js.map +1 -1
  112. package/lib/hw/hooks/useGenuineCheck.d.ts +2 -1
  113. package/lib/hw/hooks/useGenuineCheck.d.ts.map +1 -1
  114. package/lib/hw/hooks/useGenuineCheck.js +3 -1
  115. package/lib/hw/hooks/useGenuineCheck.js.map +1 -1
  116. package/lib/hw/index.d.ts +6 -2
  117. package/lib/hw/index.d.ts.map +1 -1
  118. package/lib/hw/index.js +6 -6
  119. package/lib/hw/index.js.map +1 -1
  120. package/lib/hw/installLanguage.d.ts +2 -1
  121. package/lib/hw/installLanguage.d.ts.map +1 -1
  122. package/lib/hw/installLanguage.js +2 -2
  123. package/lib/hw/installLanguage.js.map +1 -1
  124. package/lib/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.d.ts.map +1 -1
  125. package/lib/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.js +2 -0
  126. package/lib/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.js.map +1 -1
  127. package/lib/modularDrawer/hooks/useNetworkAccountCounts.d.ts +1 -5
  128. package/lib/modularDrawer/hooks/useNetworkAccountCounts.d.ts.map +1 -1
  129. package/lib/modularDrawer/hooks/useNetworkAccountCounts.js +2 -2
  130. package/lib/modularDrawer/hooks/useNetworkAccountCounts.js.map +1 -1
  131. package/lib/modularDrawer/modules/createNetworkConfiguration.d.ts +1 -1
  132. package/lib/modularDrawer/modules/createNetworkConfiguration.d.ts.map +1 -1
  133. package/lib/modularDrawer/modules/createNetworkConfiguration.js +1 -2
  134. package/lib/modularDrawer/modules/createNetworkConfiguration.js.map +1 -1
  135. package/lib/modularDrawer/utils/type.d.ts +0 -5
  136. package/lib/modularDrawer/utils/type.d.ts.map +1 -1
  137. package/lib/onboarding/hooks/useOnboardingStatePolling.d.ts.map +1 -1
  138. package/lib/onboarding/hooks/useOnboardingStatePolling.js +1 -0
  139. package/lib/onboarding/hooks/useOnboardingStatePolling.js.map +1 -1
  140. package/lib/platform/filters.d.ts +1 -2
  141. package/lib/platform/filters.d.ts.map +1 -1
  142. package/lib/platform/filters.js +1 -17
  143. package/lib/platform/filters.js.map +1 -1
  144. package/lib/platform/helpers.d.ts +1 -5
  145. package/lib/platform/helpers.d.ts.map +1 -1
  146. package/lib/platform/helpers.js +1 -33
  147. package/lib/platform/helpers.js.map +1 -1
  148. package/lib/platform/react.d.ts +2 -3
  149. package/lib/platform/react.d.ts.map +1 -1
  150. package/lib/platform/react.js +66 -16
  151. package/lib/platform/react.js.map +1 -1
  152. package/lib/platform/types.d.ts +3 -3
  153. package/lib/platform/types.d.ts.map +1 -1
  154. package/lib/utils/getAccountTuplesForCurrency.d.ts +1 -1
  155. package/lib/utils/getAccountTuplesForCurrency.d.ts.map +1 -1
  156. package/lib/utils/getAccountTuplesForCurrency.js +2 -3
  157. package/lib/utils/getAccountTuplesForCurrency.js.map +1 -1
  158. package/lib/wallet-api/Exchange/server.d.ts.map +1 -1
  159. package/lib/wallet-api/Exchange/server.js +5 -4
  160. package/lib/wallet-api/Exchange/server.js.map +1 -1
  161. package/lib/wallet-api/converters.d.ts +1 -0
  162. package/lib/wallet-api/converters.d.ts.map +1 -1
  163. package/lib/wallet-api/converters.js +7 -2
  164. package/lib/wallet-api/converters.js.map +1 -1
  165. package/lib/wallet-api/react.d.ts +6 -11
  166. package/lib/wallet-api/react.d.ts.map +1 -1
  167. package/lib/wallet-api/react.js +291 -135
  168. package/lib/wallet-api/react.js.map +1 -1
  169. package/lib/wallet-api/tracking.d.ts +6 -0
  170. package/lib/wallet-api/tracking.d.ts.map +1 -1
  171. package/lib/wallet-api/tracking.js +20 -0
  172. package/lib/wallet-api/tracking.js.map +1 -1
  173. package/lib/wallet-api/useDappLogic.d.ts.map +1 -1
  174. package/lib/wallet-api/useDappLogic.js +65 -80
  175. package/lib/wallet-api/useDappLogic.js.map +1 -1
  176. package/lib-es/currencies/helpers.d.ts +1 -3
  177. package/lib-es/currencies/helpers.d.ts.map +1 -1
  178. package/lib-es/currencies/helpers.js +0 -24
  179. package/lib-es/currencies/helpers.js.map +1 -1
  180. package/lib-es/dada-client/hooks/useAssetsData.d.ts +1 -0
  181. package/lib-es/dada-client/hooks/useAssetsData.d.ts.map +1 -1
  182. package/lib-es/dada-client/hooks/useAssetsData.js +1 -0
  183. package/lib-es/dada-client/hooks/useAssetsData.js.map +1 -1
  184. package/lib-es/deviceSDK/actions/getBatteryStatuses.d.ts +2 -1
  185. package/lib-es/deviceSDK/actions/getBatteryStatuses.d.ts.map +1 -1
  186. package/lib-es/deviceSDK/actions/getBatteryStatuses.js +2 -2
  187. package/lib-es/deviceSDK/actions/getBatteryStatuses.js.map +1 -1
  188. package/lib-es/deviceSDK/actions/getDeviceInfo.d.ts +2 -1
  189. package/lib-es/deviceSDK/actions/getDeviceInfo.d.ts.map +1 -1
  190. package/lib-es/deviceSDK/actions/getDeviceInfo.js +2 -2
  191. package/lib-es/deviceSDK/actions/getDeviceInfo.js.map +1 -1
  192. package/lib-es/deviceSDK/actions/getLatestAvailableFirmware.d.ts +2 -1
  193. package/lib-es/deviceSDK/actions/getLatestAvailableFirmware.d.ts.map +1 -1
  194. package/lib-es/deviceSDK/actions/getLatestAvailableFirmware.js +6 -3
  195. package/lib-es/deviceSDK/actions/getLatestAvailableFirmware.js.map +1 -1
  196. package/lib-es/deviceSDK/actions/toggleOnboardingEarlyCheck.d.ts +2 -1
  197. package/lib-es/deviceSDK/actions/toggleOnboardingEarlyCheck.d.ts.map +1 -1
  198. package/lib-es/deviceSDK/actions/toggleOnboardingEarlyCheck.js +2 -2
  199. package/lib-es/deviceSDK/actions/toggleOnboardingEarlyCheck.js.map +1 -1
  200. package/lib-es/deviceSDK/actions/updateFirmware.d.ts +2 -1
  201. package/lib-es/deviceSDK/actions/updateFirmware.d.ts.map +1 -1
  202. package/lib-es/deviceSDK/actions/updateFirmware.js +4 -3
  203. package/lib-es/deviceSDK/actions/updateFirmware.js.map +1 -1
  204. package/lib-es/deviceSDK/hooks/useBatteryStatuses.d.ts +2 -1
  205. package/lib-es/deviceSDK/hooks/useBatteryStatuses.d.ts.map +1 -1
  206. package/lib-es/deviceSDK/hooks/useBatteryStatuses.js +3 -2
  207. package/lib-es/deviceSDK/hooks/useBatteryStatuses.js.map +1 -1
  208. package/lib-es/deviceSDK/hooks/useGetDeviceInfo.d.ts +2 -1
  209. package/lib-es/deviceSDK/hooks/useGetDeviceInfo.d.ts.map +1 -1
  210. package/lib-es/deviceSDK/hooks/useGetDeviceInfo.js +3 -3
  211. package/lib-es/deviceSDK/hooks/useGetDeviceInfo.js.map +1 -1
  212. package/lib-es/deviceSDK/hooks/useGetLatestAvailableFirmware.d.ts +2 -1
  213. package/lib-es/deviceSDK/hooks/useGetLatestAvailableFirmware.d.ts.map +1 -1
  214. package/lib-es/deviceSDK/hooks/useGetLatestAvailableFirmware.js +2 -1
  215. package/lib-es/deviceSDK/hooks/useGetLatestAvailableFirmware.js.map +1 -1
  216. package/lib-es/deviceSDK/hooks/useToggleOnboardingEarlyChecks.d.ts +2 -1
  217. package/lib-es/deviceSDK/hooks/useToggleOnboardingEarlyChecks.d.ts.map +1 -1
  218. package/lib-es/deviceSDK/hooks/useToggleOnboardingEarlyChecks.js +3 -2
  219. package/lib-es/deviceSDK/hooks/useToggleOnboardingEarlyChecks.js.map +1 -1
  220. package/lib-es/deviceSDK/hooks/useUpdateFirmware.d.ts +2 -1
  221. package/lib-es/deviceSDK/hooks/useUpdateFirmware.d.ts.map +1 -1
  222. package/lib-es/deviceSDK/hooks/useUpdateFirmware.js +3 -2
  223. package/lib-es/deviceSDK/hooks/useUpdateFirmware.js.map +1 -1
  224. package/lib-es/deviceSDK/tasks/getBatteryStatuses.d.ts +1 -0
  225. package/lib-es/deviceSDK/tasks/getBatteryStatuses.d.ts.map +1 -1
  226. package/lib-es/deviceSDK/tasks/getBatteryStatuses.js +2 -2
  227. package/lib-es/deviceSDK/tasks/getBatteryStatuses.js.map +1 -1
  228. package/lib-es/deviceSDK/tasks/getDeviceInfo.d.ts +2 -1
  229. package/lib-es/deviceSDK/tasks/getDeviceInfo.d.ts.map +1 -1
  230. package/lib-es/deviceSDK/tasks/getDeviceInfo.js +2 -2
  231. package/lib-es/deviceSDK/tasks/getDeviceInfo.js.map +1 -1
  232. package/lib-es/deviceSDK/tasks/getLatestFirmware.d.ts +1 -0
  233. package/lib-es/deviceSDK/tasks/getLatestFirmware.d.ts.map +1 -1
  234. package/lib-es/deviceSDK/tasks/getLatestFirmware.js +2 -2
  235. package/lib-es/deviceSDK/tasks/getLatestFirmware.js.map +1 -1
  236. package/lib-es/deviceSDK/tasks/toggleOnboardingEarlyCheck.d.ts +1 -0
  237. package/lib-es/deviceSDK/tasks/toggleOnboardingEarlyCheck.d.ts.map +1 -1
  238. package/lib-es/deviceSDK/tasks/toggleOnboardingEarlyCheck.js +2 -2
  239. package/lib-es/deviceSDK/tasks/toggleOnboardingEarlyCheck.js.map +1 -1
  240. package/lib-es/deviceSDK/tasks/updateFirmware.d.ts +1 -0
  241. package/lib-es/deviceSDK/tasks/updateFirmware.d.ts.map +1 -1
  242. package/lib-es/deviceSDK/tasks/updateFirmware.js +2 -2
  243. package/lib-es/deviceSDK/tasks/updateFirmware.js.map +1 -1
  244. package/lib-es/deviceSDK/transports/core.d.ts +1 -0
  245. package/lib-es/deviceSDK/transports/core.d.ts.map +1 -1
  246. package/lib-es/deviceSDK/transports/core.js +2 -2
  247. package/lib-es/deviceSDK/transports/core.js.map +1 -1
  248. package/lib-es/hw/actions/app.d.ts.map +1 -1
  249. package/lib-es/hw/actions/app.js +2 -1
  250. package/lib-es/hw/actions/app.js.map +1 -1
  251. package/lib-es/hw/actions/customLockScreenLoad.d.ts +1 -1
  252. package/lib-es/hw/actions/customLockScreenLoad.d.ts.map +1 -1
  253. package/lib-es/hw/actions/customLockScreenLoad.js +2 -0
  254. package/lib-es/hw/actions/customLockScreenLoad.js.map +1 -1
  255. package/lib-es/hw/actions/implementations.d.ts +1 -0
  256. package/lib-es/hw/actions/implementations.d.ts.map +1 -1
  257. package/lib-es/hw/actions/implementations.js +12 -2
  258. package/lib-es/hw/actions/implementations.js.map +1 -1
  259. package/lib-es/hw/connectApp.d.ts +2 -1
  260. package/lib-es/hw/connectApp.d.ts.map +1 -1
  261. package/lib-es/hw/connectApp.js +4 -4
  262. package/lib-es/hw/connectApp.js.map +1 -1
  263. package/lib-es/hw/connectManager.d.ts +2 -1
  264. package/lib-es/hw/connectManager.d.ts.map +1 -1
  265. package/lib-es/hw/connectManager.js +4 -4
  266. package/lib-es/hw/connectManager.js.map +1 -1
  267. package/lib-es/hw/customLockScreenFetch.d.ts +2 -1
  268. package/lib-es/hw/customLockScreenFetch.d.ts.map +1 -1
  269. package/lib-es/hw/customLockScreenFetch.js +2 -2
  270. package/lib-es/hw/customLockScreenFetch.js.map +1 -1
  271. package/lib-es/hw/customLockScreenLoad.d.ts +2 -1
  272. package/lib-es/hw/customLockScreenLoad.d.ts.map +1 -1
  273. package/lib-es/hw/customLockScreenLoad.js +2 -2
  274. package/lib-es/hw/customLockScreenLoad.js.map +1 -1
  275. package/lib-es/hw/deviceAccess.d.ts +3 -3
  276. package/lib-es/hw/deviceAccess.d.ts.map +1 -1
  277. package/lib-es/hw/deviceAccess.js +2 -1
  278. package/lib-es/hw/deviceAccess.js.map +1 -1
  279. package/lib-es/hw/getGenuineCheckFromDeviceId.d.ts +2 -1
  280. package/lib-es/hw/getGenuineCheckFromDeviceId.d.ts.map +1 -1
  281. package/lib-es/hw/getGenuineCheckFromDeviceId.js +2 -2
  282. package/lib-es/hw/getGenuineCheckFromDeviceId.js.map +1 -1
  283. package/lib-es/hw/getOnboardingStatePolling.d.ts +2 -1
  284. package/lib-es/hw/getOnboardingStatePolling.d.ts.map +1 -1
  285. package/lib-es/hw/getOnboardingStatePolling.js +5 -2
  286. package/lib-es/hw/getOnboardingStatePolling.js.map +1 -1
  287. package/lib-es/hw/hooks/useGenuineCheck.d.ts +2 -1
  288. package/lib-es/hw/hooks/useGenuineCheck.d.ts.map +1 -1
  289. package/lib-es/hw/hooks/useGenuineCheck.js +3 -1
  290. package/lib-es/hw/hooks/useGenuineCheck.js.map +1 -1
  291. package/lib-es/hw/index.d.ts +6 -2
  292. package/lib-es/hw/index.d.ts.map +1 -1
  293. package/lib-es/hw/index.js +6 -6
  294. package/lib-es/hw/index.js.map +1 -1
  295. package/lib-es/hw/installLanguage.d.ts +2 -1
  296. package/lib-es/hw/installLanguage.d.ts.map +1 -1
  297. package/lib-es/hw/installLanguage.js +2 -2
  298. package/lib-es/hw/installLanguage.js.map +1 -1
  299. package/lib-es/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.d.ts.map +1 -1
  300. package/lib-es/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.js +2 -0
  301. package/lib-es/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.js.map +1 -1
  302. package/lib-es/modularDrawer/hooks/useNetworkAccountCounts.d.ts +1 -5
  303. package/lib-es/modularDrawer/hooks/useNetworkAccountCounts.d.ts.map +1 -1
  304. package/lib-es/modularDrawer/hooks/useNetworkAccountCounts.js +2 -2
  305. package/lib-es/modularDrawer/hooks/useNetworkAccountCounts.js.map +1 -1
  306. package/lib-es/modularDrawer/modules/createNetworkConfiguration.d.ts +1 -1
  307. package/lib-es/modularDrawer/modules/createNetworkConfiguration.d.ts.map +1 -1
  308. package/lib-es/modularDrawer/modules/createNetworkConfiguration.js +1 -2
  309. package/lib-es/modularDrawer/modules/createNetworkConfiguration.js.map +1 -1
  310. package/lib-es/modularDrawer/utils/type.d.ts +0 -5
  311. package/lib-es/modularDrawer/utils/type.d.ts.map +1 -1
  312. package/lib-es/onboarding/hooks/useOnboardingStatePolling.d.ts.map +1 -1
  313. package/lib-es/onboarding/hooks/useOnboardingStatePolling.js +1 -0
  314. package/lib-es/onboarding/hooks/useOnboardingStatePolling.js.map +1 -1
  315. package/lib-es/platform/filters.d.ts +1 -2
  316. package/lib-es/platform/filters.d.ts.map +1 -1
  317. package/lib-es/platform/filters.js +0 -15
  318. package/lib-es/platform/filters.js.map +1 -1
  319. package/lib-es/platform/helpers.d.ts +1 -5
  320. package/lib-es/platform/helpers.d.ts.map +1 -1
  321. package/lib-es/platform/helpers.js +1 -30
  322. package/lib-es/platform/helpers.js.map +1 -1
  323. package/lib-es/platform/react.d.ts +2 -3
  324. package/lib-es/platform/react.d.ts.map +1 -1
  325. package/lib-es/platform/react.js +67 -16
  326. package/lib-es/platform/react.js.map +1 -1
  327. package/lib-es/platform/types.d.ts +3 -3
  328. package/lib-es/platform/types.d.ts.map +1 -1
  329. package/lib-es/utils/getAccountTuplesForCurrency.d.ts +1 -1
  330. package/lib-es/utils/getAccountTuplesForCurrency.d.ts.map +1 -1
  331. package/lib-es/utils/getAccountTuplesForCurrency.js +2 -3
  332. package/lib-es/utils/getAccountTuplesForCurrency.js.map +1 -1
  333. package/lib-es/wallet-api/Exchange/server.d.ts.map +1 -1
  334. package/lib-es/wallet-api/Exchange/server.js +5 -4
  335. package/lib-es/wallet-api/Exchange/server.js.map +1 -1
  336. package/lib-es/wallet-api/converters.d.ts +1 -0
  337. package/lib-es/wallet-api/converters.d.ts.map +1 -1
  338. package/lib-es/wallet-api/converters.js +5 -1
  339. package/lib-es/wallet-api/converters.js.map +1 -1
  340. package/lib-es/wallet-api/react.d.ts +6 -11
  341. package/lib-es/wallet-api/react.d.ts.map +1 -1
  342. package/lib-es/wallet-api/react.js +289 -131
  343. package/lib-es/wallet-api/react.js.map +1 -1
  344. package/lib-es/wallet-api/tracking.d.ts +6 -0
  345. package/lib-es/wallet-api/tracking.d.ts.map +1 -1
  346. package/lib-es/wallet-api/tracking.js +20 -0
  347. package/lib-es/wallet-api/tracking.js.map +1 -1
  348. package/lib-es/wallet-api/useDappLogic.d.ts.map +1 -1
  349. package/lib-es/wallet-api/useDappLogic.js +62 -77
  350. package/lib-es/wallet-api/useDappLogic.js.map +1 -1
  351. package/package.json +55 -55
  352. package/src/currencies/helpers.ts +1 -42
  353. package/src/dada-client/hooks/useAssetsData.ts +1 -0
  354. package/src/deviceSDK/actions/getBatteryStatuses.ts +3 -1
  355. package/src/deviceSDK/actions/getDeviceInfo.ts +3 -2
  356. package/src/deviceSDK/actions/getLatestAvailableFirmware.test.ts +31 -0
  357. package/src/deviceSDK/actions/getLatestAvailableFirmware.ts +7 -2
  358. package/src/deviceSDK/actions/toggleOnboardingEarlyCheck.ts +3 -1
  359. package/src/deviceSDK/actions/updateFirmware.ts +5 -2
  360. package/src/deviceSDK/hooks/useBatteryStatuses.test.ts +3 -1
  361. package/src/deviceSDK/hooks/useBatteryStatuses.ts +4 -1
  362. package/src/deviceSDK/hooks/useGetDeviceInfo.ts +4 -2
  363. package/src/deviceSDK/hooks/useGetLatestAvailableFirmware.ts +3 -0
  364. package/src/deviceSDK/hooks/useToggleOnboardingEarlyChecks.test.ts +2 -0
  365. package/src/deviceSDK/hooks/useToggleOnboardingEarlyChecks.ts +4 -1
  366. package/src/deviceSDK/hooks/useUpdateFirmware.ts +4 -1
  367. package/src/deviceSDK/tasks/getBatteryStatuses.ts +6 -1
  368. package/src/deviceSDK/tasks/getDeviceInfo.ts +6 -2
  369. package/src/deviceSDK/tasks/getLatestFirmware.ts +6 -1
  370. package/src/deviceSDK/tasks/toggleOnboardingEarlyCheck.test.ts +3 -0
  371. package/src/deviceSDK/tasks/toggleOnboardingEarlyCheck.ts +6 -1
  372. package/src/deviceSDK/tasks/updateFirmware.ts +6 -1
  373. package/src/deviceSDK/transports/core.ts +6 -3
  374. package/src/hw/actions/app.ts +2 -1
  375. package/src/hw/actions/customLockScreenLoad.ts +6 -2
  376. package/src/hw/actions/implementations.ts +17 -3
  377. package/src/hw/connectApp.ts +12 -5
  378. package/src/hw/connectManager.ts +13 -6
  379. package/src/hw/customLockScreenFetch.ts +10 -2
  380. package/src/hw/customLockScreenLoad.test.ts +28 -3
  381. package/src/hw/customLockScreenLoad.ts +10 -2
  382. package/src/hw/deviceAccess.ts +4 -3
  383. package/src/hw/getGenuineCheckFromDeviceId.test.ts +4 -0
  384. package/src/hw/getGenuineCheckFromDeviceId.ts +6 -1
  385. package/src/hw/getOnboardingStatePolling.test.ts +34 -0
  386. package/src/hw/getOnboardingStatePolling.ts +6 -3
  387. package/src/hw/hooks/useGenuineCheck.test.ts +37 -0
  388. package/src/hw/hooks/useGenuineCheck.ts +4 -0
  389. package/src/hw/index.test.ts +27 -6
  390. package/src/hw/index.ts +15 -8
  391. package/src/hw/installLanguage.ts +6 -1
  392. package/src/modularDrawer/hooks/__test__/useAssetAccountCounts.test.ts +0 -5
  393. package/src/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.ts +2 -0
  394. package/src/modularDrawer/hooks/useNetworkAccountCounts.tsx +1 -6
  395. package/src/modularDrawer/modules/createNetworkConfiguration.ts +1 -2
  396. package/src/modularDrawer/utils/type.ts +0 -5
  397. package/src/onboarding/hooks/useOnboardingStatePolling.ts +1 -0
  398. package/src/platform/filters.ts +1 -23
  399. package/src/platform/helpers.ts +2 -49
  400. package/src/platform/react.ts +86 -22
  401. package/src/platform/types.ts +1 -1
  402. package/src/utils/__tests__/getAccountTuplesForCurrency.test.ts +0 -30
  403. package/src/utils/getAccountTuplesForCurrency.ts +1 -6
  404. package/src/wallet-api/Exchange/server.test.ts +0 -5
  405. package/src/wallet-api/Exchange/server.ts +7 -6
  406. package/src/wallet-api/converters.ts +6 -1
  407. package/src/wallet-api/react.ts +310 -137
  408. package/src/wallet-api/tracking.ts +22 -0
  409. package/src/wallet-api/useDappLogic.ts +91 -106
  410. package/src/currencies/helpers.test.ts +0 -20
@@ -37,6 +37,7 @@ describe("useGenuineCheck", () => {
37
37
  useGenuineCheck({
38
38
  getGenuineCheckFromDeviceId: mockedGetGenuineCheckFromDeviceId,
39
39
  deviceId: "A_DEVICE_ID",
40
+ deviceName: null,
40
41
  }),
41
42
  );
42
43
 
@@ -60,6 +61,7 @@ describe("useGenuineCheck", () => {
60
61
  useGenuineCheck({
61
62
  getGenuineCheckFromDeviceId: mockedGetGenuineCheckFromDeviceId,
62
63
  deviceId: "A_DEVICE_ID",
64
+ deviceName: null,
63
65
  }),
64
66
  );
65
67
 
@@ -80,6 +82,7 @@ describe("useGenuineCheck", () => {
80
82
  useGenuineCheck({
81
83
  getGenuineCheckFromDeviceId: mockedGetGenuineCheckFromDeviceId,
82
84
  deviceId: "A_DEVICE_ID",
85
+ deviceName: null,
83
86
  }),
84
87
  );
85
88
 
@@ -102,6 +105,7 @@ describe("useGenuineCheck", () => {
102
105
  useGenuineCheck({
103
106
  getGenuineCheckFromDeviceId: mockedGetGenuineCheckFromDeviceId,
104
107
  deviceId: "A_DEVICE_ID",
108
+ deviceName: null,
105
109
  }),
106
110
  );
107
111
 
@@ -127,6 +131,7 @@ describe("useGenuineCheck", () => {
127
131
  useGenuineCheck({
128
132
  getGenuineCheckFromDeviceId: mockedGetGenuineCheckFromDeviceId,
129
133
  deviceId: "A_DEVICE_ID",
134
+ deviceName: null,
130
135
  }),
131
136
  );
132
137
 
@@ -151,6 +156,7 @@ describe("useGenuineCheck", () => {
151
156
  useGenuineCheck({
152
157
  getGenuineCheckFromDeviceId: mockedGetGenuineCheckFromDeviceId,
153
158
  deviceId: "A_DEVICE_ID",
159
+ deviceName: null,
154
160
  }),
155
161
  );
156
162
 
@@ -185,6 +191,7 @@ describe("useGenuineCheck", () => {
185
191
  getGenuineCheckFromDeviceId: mockedGetGenuineCheckFromDeviceId,
186
192
  isHookEnabled: true,
187
193
  deviceId: "A_DEVICE_ID",
194
+ deviceName: null,
188
195
  }),
189
196
  );
190
197
 
@@ -220,6 +227,7 @@ describe("useGenuineCheck", () => {
220
227
  useGenuineCheck({
221
228
  getGenuineCheckFromDeviceId: mockedGetGenuineCheckFromDeviceId,
222
229
  deviceId: "A_DEVICE_ID",
230
+ deviceName: null,
223
231
  }),
224
232
  );
225
233
 
@@ -250,6 +258,7 @@ describe("useGenuineCheck", () => {
250
258
  useGenuineCheck({
251
259
  getGenuineCheckFromDeviceId: mockedGetGenuineCheckFromDeviceId,
252
260
  deviceId: "A_DEVICE_ID",
261
+ deviceName: null,
253
262
  permissionTimeoutMs,
254
263
  }),
255
264
  );
@@ -288,6 +297,7 @@ describe("useGenuineCheck", () => {
288
297
  useGenuineCheck({
289
298
  getGenuineCheckFromDeviceId: mockedGetGenuineCheckFromDeviceId,
290
299
  deviceId: "A_DEVICE_ID",
300
+ deviceName: null,
291
301
  }),
292
302
  );
293
303
 
@@ -300,4 +310,31 @@ describe("useGenuineCheck", () => {
300
310
  expect(result.current.error).toBeNull();
301
311
  });
302
312
  });
313
+
314
+ describe("When deviceName is provided", () => {
315
+ it("should pass deviceName to getGenuineCheckFromDeviceId", async () => {
316
+ const mockGetGenuineCheck = jest.fn().mockReturnValue(
317
+ of({
318
+ socketEvent: { type: "device-permission-granted" },
319
+ lockedDevice: false,
320
+ }),
321
+ );
322
+
323
+ renderHook(() =>
324
+ useGenuineCheck({
325
+ getGenuineCheckFromDeviceId: mockGetGenuineCheck,
326
+ deviceId: "A_DEVICE_ID",
327
+ deviceName: "My Device",
328
+ }),
329
+ );
330
+
331
+ await act(async () => {
332
+ jest.advanceTimersByTime(1);
333
+ });
334
+
335
+ expect(mockGetGenuineCheck).toHaveBeenCalledWith(
336
+ expect.objectContaining({ deviceName: "My Device" }),
337
+ );
338
+ });
339
+ });
303
340
  });
@@ -22,6 +22,7 @@ export type DevicePermissionState =
22
22
  export type UseGenuineCheckArgs = {
23
23
  isHookEnabled?: boolean;
24
24
  deviceId: DeviceId;
25
+ deviceName: string | null;
25
26
  lockedDeviceTimeoutMs?: number;
26
27
  permissionTimeoutMs?: number;
27
28
  };
@@ -70,6 +71,7 @@ export const useGenuineCheck = ({
70
71
  getGenuineCheckFromDeviceId = defaultGetGenuineCheckFromDeviceId,
71
72
  isHookEnabled = true,
72
73
  deviceId,
74
+ deviceName,
73
75
  lockedDeviceTimeoutMs = 1000,
74
76
  permissionTimeoutMs = 60 * 1000,
75
77
  }: UseGenuineCheckArgs & UseGenuineCheckDependencies): UseGenuineCheckResult => {
@@ -92,6 +94,7 @@ export const useGenuineCheck = ({
92
94
 
93
95
  const sub = getGenuineCheckFromDeviceId({
94
96
  deviceId,
97
+ deviceName,
95
98
  lockedDeviceTimeoutMs,
96
99
  }).subscribe({
97
100
  next: ({ socketEvent, lockedDevice }: GetGenuineCheckFromDeviceIdResult) => {
@@ -146,6 +149,7 @@ export const useGenuineCheck = ({
146
149
  }, [
147
150
  isHookEnabled,
148
151
  deviceId,
152
+ deviceName,
149
153
  lockedDeviceTimeoutMs,
150
154
  getGenuineCheckFromDeviceId,
151
155
  permissionTimeoutMs,
@@ -9,7 +9,7 @@ describe("open", () => {
9
9
  it("should reject with a CantOpenDevice error", async () => {
10
10
  registerTransportModule({
11
11
  id: "test_0",
12
- open: (_id: string, _timeoutMs?: number) => {
12
+ open: (_id: string, _timeoutMs?: number, _context?, _matchDeviceByName?: string) => {
13
13
  // Handles no device
14
14
  return null;
15
15
  },
@@ -27,7 +27,7 @@ describe("open", () => {
27
27
  it("should return the associated opened Transport instance", async () => {
28
28
  registerTransportModule({
29
29
  id: "test_1",
30
- open: (id: string, _timeoutMs?: number) => {
30
+ open: (id: string, _timeoutMs?: number, _context?, _matchDeviceByName?: string) => {
31
31
  // Filters on this current test
32
32
  if (id !== "device_1") return null;
33
33
 
@@ -47,7 +47,7 @@ describe("open", () => {
47
47
  it("should reject with an error on timeout", async () => {
48
48
  registerTransportModule({
49
49
  id: "test_2",
50
- open: (id: string, timeoutMs?: number) => {
50
+ open: (id: string, timeoutMs?: number, _context?, _matchDeviceByName?: string) => {
51
51
  // Filters on this current test
52
52
  if (id !== "device_2") return null;
53
53
 
@@ -63,7 +63,7 @@ describe("open", () => {
63
63
 
64
64
  const timeoutMs = 1000;
65
65
 
66
- const openPromise = open("device_2", timeoutMs);
66
+ const openPromise = open("device_2", { openTimeoutMs: timeoutMs });
67
67
  jest.advanceTimersByTime(timeoutMs);
68
68
  await expect(openPromise).rejects.toBeInstanceOf(CantOpenDevice);
69
69
  });
@@ -71,7 +71,7 @@ describe("open", () => {
71
71
  test("And the Transport/module implementation timeouts before open, it should still reject with an error", async () => {
72
72
  registerTransportModule({
73
73
  id: "test_3",
74
- open: (id: string, timeoutMs?: number) => {
74
+ open: (id: string, timeoutMs?: number, _context?, _matchDeviceByName?: string) => {
75
75
  // Filters on this current test
76
76
  if (id !== "device_3") return null;
77
77
 
@@ -88,10 +88,31 @@ describe("open", () => {
88
88
 
89
89
  const timeoutMs = 1000;
90
90
 
91
- const openPromise = open("device_3", timeoutMs);
91
+ const openPromise = open("device_3", { openTimeoutMs: timeoutMs });
92
92
  // Advances time after the implementation timeout but before the `open` timeout
93
93
  jest.advanceTimersByTime(timeoutMs - 100);
94
94
  await expect(openPromise).rejects.toBeInstanceOf(TransportError);
95
95
  });
96
96
  });
97
+
98
+ describe("When matchDeviceByName is provided", () => {
99
+ it("should pass matchDeviceByName to the transport module open function", async () => {
100
+ const mockOpen = jest.fn(
101
+ (_id: string, _timeoutMs?: number, _context?, _matchDeviceByName?: string) => {
102
+ return Promise.resolve(aTransportBuilder());
103
+ },
104
+ );
105
+
106
+ registerTransportModule({
107
+ id: "test_4",
108
+ open: mockOpen,
109
+ disconnect: (_id: string) => {
110
+ return Promise.resolve();
111
+ },
112
+ });
113
+
114
+ await open("device_4", { matchDeviceByName: "My Device" });
115
+ expect(mockOpen).toHaveBeenCalledWith("device_4", undefined, undefined, "My Device");
116
+ });
117
+ });
97
118
  });
package/src/hw/index.ts CHANGED
@@ -17,6 +17,7 @@ export type DeviceEvent = {
17
17
  };
18
18
 
19
19
  export type Discovery = Observable<DeviceEvent>;
20
+
20
21
  // NB open/close/disconnect semantic will have to be refined...
21
22
  export type TransportModule = {
22
23
  // unique transport name that identify the transport module
@@ -35,6 +36,7 @@ export type TransportModule = {
35
36
  id: string,
36
37
  timeoutMs?: number,
37
38
  context?: TraceContext,
39
+ matchDeviceByName?: string,
38
40
  ) => Promise<Transport> | null | undefined;
39
41
  // here, close means we want to STOP doing something with the transport
40
42
  close?: (transport: Transport, id: string) => Promise<void> | null | undefined;
@@ -88,6 +90,11 @@ export const discoverDevices = (
88
90
  );
89
91
  };
90
92
 
93
+ export type OpenOptions = {
94
+ openTimeoutMs?: number;
95
+ matchDeviceByName?: string;
96
+ };
97
+
91
98
  /**
92
99
  * Tries to call `open` on the 1st matching registered transport implementation
93
100
  *
@@ -109,7 +116,7 @@ export const discoverDevices = (
109
116
  */
110
117
  export const open = (
111
118
  deviceId: string,
112
- timeoutMs?: number,
119
+ options?: OpenOptions,
113
120
  context?: TraceContext,
114
121
  ): Promise<Transport> => {
115
122
  // The first registered Transport (TransportModule) accepting the given device will be returned.
@@ -117,16 +124,16 @@ export const open = (
117
124
  // A TransportModule can check the prefix of the device id to guess if it should use USB or not on LLM for ex.
118
125
  for (let i = 0; i < modules.length; i++) {
119
126
  const m = modules[i];
120
- const p = m.open(deviceId, timeoutMs, context);
127
+ const p = m.open(deviceId, options?.openTimeoutMs, context, options?.matchDeviceByName);
121
128
  if (p) {
122
129
  trace({
123
130
  type: LOG_TYPE,
124
131
  message: `Found a matching Transport: ${m.id}`,
125
132
  context,
126
- data: { timeoutMs },
133
+ data: { options },
127
134
  });
128
135
 
129
- if (!timeoutMs) {
136
+ if (!options?.openTimeoutMs) {
130
137
  return p;
131
138
  }
132
139
 
@@ -144,18 +151,18 @@ export const open = (
144
151
 
145
152
  return transport;
146
153
  }),
147
- new Promise((_resolve, reject) => {
154
+ new Promise<never>((_resolve, reject) => {
148
155
  timer = setTimeout(() => {
149
156
  trace({
150
157
  type: LOG_TYPE,
151
- message: `Could not open registered transport ${m.id} on ${deviceId}, timed out after ${timeoutMs}ms`,
158
+ message: `Could not open registered transport ${m.id} on ${deviceId}, timed out after ${options?.openTimeoutMs}ms`,
152
159
  context,
153
160
  });
154
161
 
155
162
  return reject(new CantOpenDevice(`Timeout while opening device on transport ${m.id}`));
156
- }, timeoutMs);
163
+ }, options?.openTimeoutMs);
157
164
  }),
158
- ]) as Promise<Transport>;
165
+ ]);
159
166
  }
160
167
  }
161
168
  return Promise.reject(new CantOpenDevice(`Cannot find registered transport to open ${deviceId}`));
@@ -36,16 +36,21 @@ export type InstallLanguageEvent =
36
36
  export type InstallLanguageRequest = { language: Language };
37
37
  export type Input = {
38
38
  deviceId: string;
39
+ deviceName: string | null;
39
40
  request: InstallLanguageRequest;
40
41
  };
41
42
 
42
43
  export default function installLanguage({
43
44
  deviceId,
45
+ deviceName,
44
46
  request,
45
47
  }: Input): Observable<InstallLanguageEvent> {
46
48
  const { language } = request;
47
49
 
48
- const sub = withDevice(deviceId)(
50
+ const sub = withDevice(
51
+ deviceId,
52
+ deviceName ? { matchDeviceByName: deviceName } : undefined,
53
+ )(
49
54
  transport =>
50
55
  new Observable(subscriber => {
51
56
  const timeoutSub = of<InstallLanguageEvent>({
@@ -12,7 +12,6 @@ describe("useNetworkAccountCounts", () => {
12
12
  const assetAccountCounts = useNetworkAccountCounts({
13
13
  networks: [ethereumCurrency],
14
14
  nestedAccounts: [ethereumAccountHigh],
15
- accountIds: new Map([[ethereumAccountHigh.id, true]]),
16
15
  formatLabel: (count: number) => `${count}`,
17
16
  });
18
17
 
@@ -27,10 +26,6 @@ describe("useNetworkAccountCounts", () => {
27
26
  const assetAccountCounts = useNetworkAccountCounts({
28
27
  networks: [ethereumCurrency],
29
28
  nestedAccounts: [ethereumAccountHigh, ethereumAccountLow],
30
- accountIds: new Map([
31
- [ethereumAccountHigh.id, true],
32
- [ethereumAccountLow.id, true],
33
- ]),
34
29
  formatLabel: (count: number) => `${count}`,
35
30
  });
36
31
 
@@ -227,6 +227,8 @@ export function useCurrenciesUnderFeatureFlag() {
227
227
  mina,
228
228
  babylon,
229
229
  canton,
230
+ cantonDevnet,
231
+ cantonTestnet,
230
232
  kaspa,
231
233
  core,
232
234
  ethereumHoodi,
@@ -1,15 +1,11 @@
1
- import { Observable } from "rxjs";
2
1
  import { CryptoOrTokenCurrency } from "@ledgerhq/types-cryptoassets";
3
2
  import { getAccountTuplesForCurrency } from "../../utils/getAccountTuplesForCurrency";
4
3
  import type { Account } from "@ledgerhq/types-live";
5
- import { WalletAPIAccount } from "../../wallet-api/types";
6
4
 
7
5
  type AccountModuleParams = {
8
6
  networks: CryptoOrTokenCurrency[];
9
7
  nestedAccounts: Account[];
10
- accountIds: Map<string, boolean> | undefined;
11
8
  formatLabel: (count: number) => string;
12
- accounts$?: Observable<WalletAPIAccount[]>;
13
9
  };
14
10
 
15
11
  export type NetworkCountItem = {
@@ -21,12 +17,11 @@ export type NetworkCountItem = {
21
17
  export const useNetworkAccountCounts = ({
22
18
  networks,
23
19
  nestedAccounts,
24
- accountIds,
25
20
  formatLabel,
26
21
  }: AccountModuleParams): NetworkCountItem[] =>
27
22
  networks.map(network => {
28
23
  const asset = network.type === "TokenCurrency" ? network.parentCurrency : network;
29
- const { length } = getAccountTuplesForCurrency(asset, nestedAccounts, accountIds);
24
+ const { length } = getAccountTuplesForCurrency(asset, nestedAccounts);
30
25
  return {
31
26
  asset,
32
27
  label: formatLabel(length),
@@ -78,7 +78,7 @@ const sortNetworks = (
78
78
 
79
79
  export const createNetworkConfigurationHook =
80
80
  (NetworkConfigurationDeps: NetworkConfigurationDeps) =>
81
- ({ networksConfig, accounts$ }: CreateNetworkConfigurationHookProps) => {
81
+ ({ networksConfig }: CreateNetworkConfigurationHookProps) => {
82
82
  const { leftElement, rightElement } = networksConfig ?? {};
83
83
  const leftHook = getLeftElement(NetworkConfigurationDeps)(leftElement);
84
84
  const rightHook = getRightElement(NetworkConfigurationDeps)(rightElement);
@@ -90,7 +90,6 @@ export const createNetworkConfigurationHook =
90
90
  ): Array<CryptoOrTokenCurrency & Network & { balanceData?: BalanceUI; count?: number }> => {
91
91
  const hookResults = hooks.map(hook =>
92
92
  hook({
93
- accounts$,
94
93
  networks,
95
94
  }),
96
95
  );
@@ -2,8 +2,6 @@ import { CounterValuesState } from "@ledgerhq/live-countervalues/lib/types";
2
2
  import { CryptoOrTokenCurrency, Currency, Unit } from "@ledgerhq/types-cryptoassets";
3
3
  import { AccountLike } from "@ledgerhq/types-live";
4
4
  import { ReactNode } from "react";
5
- import { Observable } from "rxjs";
6
- import { WalletAPIAccount } from "../../wallet-api/types";
7
5
  import { EnhancedModularDrawerConfiguration } from "../../wallet-api/ModularDrawer/types";
8
6
  import { InterestRate } from "../../dada-client/entities";
9
7
  import { MarketItemResponse } from "../../market/utils/types";
@@ -71,7 +69,6 @@ export type AccountDataItem = {
71
69
 
72
70
  export type AccountModuleParams = {
73
71
  networks: CryptoOrTokenCurrency[];
74
- accounts$?: Observable<WalletAPIAccount[]>;
75
72
  };
76
73
 
77
74
  export type CreateAccountsCount = (args: { label: string }) => ReactNode;
@@ -80,7 +77,6 @@ export type UseAccountData = (params: AccountModuleParams) => AccountDataItem[];
80
77
 
81
78
  export type NetworkHookParams = {
82
79
  networks: CryptoOrTokenCurrency[];
83
- accounts$?: Observable<WalletAPIAccount[]>;
84
80
  };
85
81
  // Network hook type that returns additional properties to be merged with currencies
86
82
  export type NetworkHook = (params: NetworkHookParams) => Array<{
@@ -111,7 +107,6 @@ export type Network = {
111
107
 
112
108
  export type CreateNetworkConfigurationHookProps = {
113
109
  networksConfig: EnhancedModularDrawerConfiguration["networks"];
114
- accounts$?: Observable<WalletAPIAccount[]>;
115
110
  };
116
111
 
117
112
  type Props = {
@@ -65,6 +65,7 @@ export const useOnboardingStatePolling = ({
65
65
  if (device && !stopPolling) {
66
66
  onboardingStatePollingSubscription = getOnboardingStatePolling({
67
67
  deviceId: device.deviceId,
68
+ deviceName: device.deviceName ?? null,
68
69
  pollingPeriodMs,
69
70
  allowedErrorChecks,
70
71
  }).subscribe({
@@ -1,6 +1,5 @@
1
1
  import { makeRe } from "minimatch";
2
- import { AppPlatform, PlatformAccount, PlatformCurrency } from "./types";
3
- import { isPlatformTokenCurrency } from "./helpers";
2
+ import { AppPlatform, PlatformAccount } from "./types";
4
3
 
5
4
  export type FilterParams = {
6
5
  branches?: string[];
@@ -38,24 +37,3 @@ export type CurrencyFilters = {
38
37
  includeTokens?: boolean;
39
38
  currencies?: string[];
40
39
  };
41
-
42
- export function filterPlatformCurrencies(
43
- currencies: PlatformCurrency[],
44
- filters: CurrencyFilters,
45
- ): PlatformCurrency[] {
46
- const filterCurrencyRegexes = filters.currencies
47
- ? filters.currencies.map(filter => makeRe(filter))
48
- : null;
49
-
50
- return currencies.filter(currency => {
51
- if (!filters.includeTokens && isPlatformTokenCurrency(currency)) {
52
- return false;
53
- }
54
-
55
- if (filterCurrencyRegexes && !filterCurrencyRegexes.some(regex => currency.id.match(regex))) {
56
- return false;
57
- }
58
-
59
- return true;
60
- });
61
- }
@@ -1,6 +1,5 @@
1
- import { makeRe } from "minimatch";
2
- import { isCryptoCurrency, isTokenCurrency, listCurrencies } from "../currencies";
3
- import { CryptoOrTokenCurrency, Currency } from "@ledgerhq/types-cryptoassets";
1
+ import { isCryptoCurrency, isTokenCurrency } from "../currencies";
2
+ import { Currency } from "@ledgerhq/types-cryptoassets";
4
3
  import {
5
4
  PlatformCurrency,
6
5
  PlatformSupportedCurrency,
@@ -10,7 +9,6 @@ import {
10
9
  PLATFORM_FAMILIES,
11
10
  } from "./types";
12
11
  import { includes } from "../helpers";
13
- import { CurrencyFilters } from "./filters";
14
12
 
15
13
  export function isPlatformSupportedCurrency(
16
14
  currency: Currency,
@@ -30,53 +28,8 @@ export function isPlatformCryptoCurrency(
30
28
  return currency.type === PlatformCurrencyType.CryptoCurrency;
31
29
  }
32
30
 
33
- export function isPlatformTokenCurrency(
34
- currency: PlatformCurrency,
35
- ): currency is PlatformERC20TokenCurrency {
36
- return currency.type === PlatformCurrencyType.TokenCurrency;
37
- }
38
-
39
31
  export function isPlatformERC20TokenCurrency(
40
32
  currency: PlatformCurrency,
41
33
  ): currency is PlatformERC20TokenCurrency {
42
34
  return (currency as PlatformERC20TokenCurrency).standard === "ERC20";
43
35
  }
44
-
45
- export function filterCurrencies(
46
- currencies: PlatformSupportedCurrency[],
47
- filters: CurrencyFilters,
48
- ): CryptoOrTokenCurrency[] {
49
- const filterCurrencyRegexes = filters.currencies
50
- ? filters.currencies.map(filter => makeRe(filter))
51
- : null;
52
-
53
- return currencies.filter(currency => {
54
- if (!filters.includeTokens && isTokenCurrency(currency)) {
55
- return false;
56
- }
57
-
58
- if (
59
- filterCurrencyRegexes &&
60
- filterCurrencyRegexes.length &&
61
- !filterCurrencyRegexes.some(regex => currency.id.match(regex))
62
- ) {
63
- return false;
64
- }
65
-
66
- return true;
67
- });
68
- }
69
-
70
- export function listAndFilterCurrencies({
71
- includeTokens = false,
72
- currencies,
73
- }: CurrencyFilters): CryptoOrTokenCurrency[] {
74
- // We removed the filtering with `isPlatformSupportedCurrency`
75
- // As we want to show all the currencies in the requestAccount drawer
76
- const allCurrencies = listCurrencies(includeTokens);
77
-
78
- return filterCurrencies(allCurrencies, {
79
- includeTokens,
80
- currencies,
81
- });
82
- }
@@ -1,12 +1,16 @@
1
1
  import { useCallback, useMemo } from "react";
2
+ import { useDispatch } from "react-redux";
3
+ import { ThunkDispatch, UnknownAction } from "@reduxjs/toolkit";
4
+ import { InfiniteData } from "@reduxjs/toolkit/query";
2
5
  import { AccountLike } from "@ledgerhq/types-live";
6
+ import { makeRe } from "minimatch";
7
+ import type {
8
+ TokensDataWithPagination,
9
+ PageParam,
10
+ } from "@ledgerhq/cryptoassets/lib/cal-client/state-manager/types";
11
+ import { endpoints as calEndpoints } from "@ledgerhq/cryptoassets/cal-client/state-manager/api";
3
12
  import { accountToPlatformAccount, currencyToPlatformCurrency } from "./converters";
4
- import {
5
- filterPlatformAccounts,
6
- filterPlatformCurrencies,
7
- AccountFilters,
8
- CurrencyFilters,
9
- } from "./filters";
13
+ import { filterPlatformAccounts, AccountFilters, CurrencyFilters } from "./filters";
10
14
  import { isPlatformSupportedCurrency } from "./helpers";
11
15
  import {
12
16
  ListPlatformAccount,
@@ -16,7 +20,7 @@ import {
16
20
  PlatformAccount,
17
21
  } from "./types";
18
22
  import { getParentAccount } from "../account";
19
- import { listCurrencies } from "../currencies";
23
+ import { listSupportedCurrencies } from "../currencies";
20
24
  import { WalletState } from "@ledgerhq/live-wallet/store";
21
25
 
22
26
  /**
@@ -75,24 +79,84 @@ export function useListPlatformAccounts(
75
79
  );
76
80
  }
77
81
 
78
- export function usePlatformCurrencies(): PlatformCurrency[] {
79
- return useMemo(() => {
80
- return listCurrencies(true).reduce<PlatformCurrency[]>((filtered, currency) => {
81
- if (isPlatformSupportedCurrency(currency)) {
82
- filtered.push(currencyToPlatformCurrency(currency));
82
+ export function useListPlatformCurrencies(
83
+ deactivatedCurrencyIds: Set<string>,
84
+ ): ListPlatformCurrency {
85
+ const dispatch = useDispatch<ThunkDispatch<any, any, UnknownAction>>();
86
+
87
+ return useCallback(
88
+ async (filters?: CurrencyFilters) => {
89
+ const filterCurrencyRegexes = filters?.currencies
90
+ ? filters.currencies.map(filter => makeRe(filter))
91
+ : null;
92
+
93
+ // 1. Gather all supported parent currencies
94
+ const allCurrencies = listSupportedCurrencies().reduce<PlatformCurrency[]>((acc, c) => {
95
+ if (isPlatformSupportedCurrency(c) && !deactivatedCurrencyIds.has(c.id))
96
+ acc.push(currencyToPlatformCurrency(c));
97
+ return acc;
98
+ }, []);
99
+
100
+ // 2. Determine which currencies to include based on patterns
101
+ let includedCurrencies: PlatformCurrency[] = allCurrencies;
102
+ if (filterCurrencyRegexes) {
103
+ includedCurrencies = allCurrencies.filter(c => {
104
+ if (filterCurrencyRegexes && !filterCurrencyRegexes.some(regex => c.id.match(regex))) {
105
+ return false;
106
+ }
107
+ return true;
108
+ });
109
+ }
110
+
111
+ if (filters?.includeTokens === false) {
112
+ return includedCurrencies;
83
113
  }
84
- return filtered;
85
- }, []);
86
- }, []);
87
- }
88
114
 
89
- export function useListPlatformCurrencies(): ListPlatformCurrency {
90
- const currencies = usePlatformCurrencies();
115
+ // 3. Determine which token families to fetch (only if not already fetched as specific tokens)
116
+ const familiesToFetch = new Set<string>();
117
+ includedCurrencies.forEach(c => {
118
+ if (c.type === "CryptoCurrency") familiesToFetch.add(c.family);
119
+ });
91
120
 
92
- return useCallback(
93
- (filters?: CurrencyFilters) => {
94
- return filterPlatformCurrencies(currencies, filters || {});
121
+ // 4. Fetch tokens for relevant families
122
+ const fetchAllPagesForFamily = async (family: string) => {
123
+ const args = { networkFamily: family, pageSize: 1000 };
124
+ let hasNextPage = true;
125
+ let data: InfiniteData<TokensDataWithPagination, PageParam> | undefined;
126
+
127
+ while (hasNextPage) {
128
+ const querySub = dispatch(
129
+ calEndpoints.getTokensData.initiate(args, data ? { direction: "forward" } : undefined),
130
+ );
131
+
132
+ try {
133
+ const result = await querySub;
134
+ data = result.data;
135
+ hasNextPage = result.hasNextPage;
136
+ if (result.error) throw result.error;
137
+ } finally {
138
+ querySub.unsubscribe();
139
+ }
140
+ }
141
+
142
+ return (data?.pages ?? []).flatMap(p => p.tokens);
143
+ };
144
+
145
+ const tokensByFamily = await Promise.all(
146
+ [...familiesToFetch].map(f => fetchAllPagesForFamily(f)),
147
+ );
148
+
149
+ // 5. Combine all results
150
+ return tokensByFamily.reduce<PlatformCurrency[]>((acc, tokens) => {
151
+ return tokens.reduce<PlatformCurrency[]>((tAcc, t) => {
152
+ const pc = currencyToPlatformCurrency(t);
153
+ if (!filterCurrencyRegexes || filterCurrencyRegexes.some(r => pc.id.match(r))) {
154
+ tAcc.push(pc);
155
+ }
156
+ return tAcc;
157
+ }, acc);
158
+ }, includedCurrencies);
95
159
  },
96
- [currencies],
160
+ [deactivatedCurrencyIds, dispatch],
97
161
  );
98
162
  }
@@ -196,6 +196,6 @@ export type PlatformSignedTransaction = SignedOperation;
196
196
 
197
197
  export type ListPlatformAccount = (filters?: AccountFilters) => PlatformAccount[];
198
198
 
199
- export type ListPlatformCurrency = (filters?: CurrencyFilters) => PlatformCurrency[];
199
+ export type ListPlatformCurrency = (filters?: CurrencyFilters) => Promise<PlatformCurrency[]>;
200
200
 
201
201
  export type PlatformSupportedCurrency = CryptoCurrency | TokenCurrency;