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

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 (601) hide show
  1. package/lib/__tests__/test-helpers/bridge.d.ts.map +1 -1
  2. package/lib/__tests__/test-helpers/bridge.js +0 -4
  3. package/lib/__tests__/test-helpers/bridge.js.map +1 -1
  4. package/lib/bridge/generic-alpaca/getAccountShape.d.ts.map +1 -1
  5. package/lib/bridge/generic-alpaca/getAccountShape.js +12 -10
  6. package/lib/bridge/generic-alpaca/getAccountShape.js.map +1 -1
  7. package/lib/currencies/helpers.d.ts +1 -3
  8. package/lib/currencies/helpers.d.ts.map +1 -1
  9. package/lib/currencies/helpers.js +1 -27
  10. package/lib/currencies/helpers.js.map +1 -1
  11. package/lib/dada-client/hooks/useAssetsData.d.ts +1 -0
  12. package/lib/dada-client/hooks/useAssetsData.d.ts.map +1 -1
  13. package/lib/dada-client/hooks/useAssetsData.js +1 -0
  14. package/lib/dada-client/hooks/useAssetsData.js.map +1 -1
  15. package/lib/deposit/type.d.ts +0 -17
  16. package/lib/deposit/type.d.ts.map +1 -1
  17. package/lib/deposit/type.js.map +1 -1
  18. package/lib/deviceSDK/actions/getBatteryStatuses.d.ts +2 -1
  19. package/lib/deviceSDK/actions/getBatteryStatuses.d.ts.map +1 -1
  20. package/lib/deviceSDK/actions/getBatteryStatuses.js +2 -2
  21. package/lib/deviceSDK/actions/getBatteryStatuses.js.map +1 -1
  22. package/lib/deviceSDK/actions/getDeviceInfo.d.ts +2 -1
  23. package/lib/deviceSDK/actions/getDeviceInfo.d.ts.map +1 -1
  24. package/lib/deviceSDK/actions/getDeviceInfo.js +2 -2
  25. package/lib/deviceSDK/actions/getDeviceInfo.js.map +1 -1
  26. package/lib/deviceSDK/actions/getLatestAvailableFirmware.d.ts +2 -1
  27. package/lib/deviceSDK/actions/getLatestAvailableFirmware.d.ts.map +1 -1
  28. package/lib/deviceSDK/actions/getLatestAvailableFirmware.js +6 -3
  29. package/lib/deviceSDK/actions/getLatestAvailableFirmware.js.map +1 -1
  30. package/lib/deviceSDK/actions/toggleOnboardingEarlyCheck.d.ts +2 -1
  31. package/lib/deviceSDK/actions/toggleOnboardingEarlyCheck.d.ts.map +1 -1
  32. package/lib/deviceSDK/actions/toggleOnboardingEarlyCheck.js +2 -2
  33. package/lib/deviceSDK/actions/toggleOnboardingEarlyCheck.js.map +1 -1
  34. package/lib/deviceSDK/actions/updateFirmware.d.ts +2 -1
  35. package/lib/deviceSDK/actions/updateFirmware.d.ts.map +1 -1
  36. package/lib/deviceSDK/actions/updateFirmware.js +4 -3
  37. package/lib/deviceSDK/actions/updateFirmware.js.map +1 -1
  38. package/lib/deviceSDK/hooks/useBatteryStatuses.d.ts +2 -1
  39. package/lib/deviceSDK/hooks/useBatteryStatuses.d.ts.map +1 -1
  40. package/lib/deviceSDK/hooks/useBatteryStatuses.js +3 -2
  41. package/lib/deviceSDK/hooks/useBatteryStatuses.js.map +1 -1
  42. package/lib/deviceSDK/hooks/useGetDeviceInfo.d.ts +2 -1
  43. package/lib/deviceSDK/hooks/useGetDeviceInfo.d.ts.map +1 -1
  44. package/lib/deviceSDK/hooks/useGetDeviceInfo.js +3 -3
  45. package/lib/deviceSDK/hooks/useGetDeviceInfo.js.map +1 -1
  46. package/lib/deviceSDK/hooks/useGetLatestAvailableFirmware.d.ts +2 -1
  47. package/lib/deviceSDK/hooks/useGetLatestAvailableFirmware.d.ts.map +1 -1
  48. package/lib/deviceSDK/hooks/useGetLatestAvailableFirmware.js +2 -1
  49. package/lib/deviceSDK/hooks/useGetLatestAvailableFirmware.js.map +1 -1
  50. package/lib/deviceSDK/hooks/useToggleOnboardingEarlyChecks.d.ts +2 -1
  51. package/lib/deviceSDK/hooks/useToggleOnboardingEarlyChecks.d.ts.map +1 -1
  52. package/lib/deviceSDK/hooks/useToggleOnboardingEarlyChecks.js +3 -2
  53. package/lib/deviceSDK/hooks/useToggleOnboardingEarlyChecks.js.map +1 -1
  54. package/lib/deviceSDK/hooks/useUpdateFirmware.d.ts +2 -1
  55. package/lib/deviceSDK/hooks/useUpdateFirmware.d.ts.map +1 -1
  56. package/lib/deviceSDK/hooks/useUpdateFirmware.js +3 -2
  57. package/lib/deviceSDK/hooks/useUpdateFirmware.js.map +1 -1
  58. package/lib/deviceSDK/tasks/core.d.ts +1 -1
  59. package/lib/deviceSDK/tasks/core.d.ts.map +1 -1
  60. package/lib/deviceSDK/tasks/core.js +1 -1
  61. package/lib/deviceSDK/tasks/core.js.map +1 -1
  62. package/lib/deviceSDK/tasks/getBatteryStatuses.d.ts +1 -0
  63. package/lib/deviceSDK/tasks/getBatteryStatuses.d.ts.map +1 -1
  64. package/lib/deviceSDK/tasks/getBatteryStatuses.js +2 -2
  65. package/lib/deviceSDK/tasks/getBatteryStatuses.js.map +1 -1
  66. package/lib/deviceSDK/tasks/getDeviceInfo.d.ts +2 -1
  67. package/lib/deviceSDK/tasks/getDeviceInfo.d.ts.map +1 -1
  68. package/lib/deviceSDK/tasks/getDeviceInfo.js +2 -2
  69. package/lib/deviceSDK/tasks/getDeviceInfo.js.map +1 -1
  70. package/lib/deviceSDK/tasks/getLatestFirmware.d.ts +1 -0
  71. package/lib/deviceSDK/tasks/getLatestFirmware.d.ts.map +1 -1
  72. package/lib/deviceSDK/tasks/getLatestFirmware.js +2 -2
  73. package/lib/deviceSDK/tasks/getLatestFirmware.js.map +1 -1
  74. package/lib/deviceSDK/tasks/toggleOnboardingEarlyCheck.d.ts +1 -0
  75. package/lib/deviceSDK/tasks/toggleOnboardingEarlyCheck.d.ts.map +1 -1
  76. package/lib/deviceSDK/tasks/toggleOnboardingEarlyCheck.js +2 -2
  77. package/lib/deviceSDK/tasks/toggleOnboardingEarlyCheck.js.map +1 -1
  78. package/lib/deviceSDK/tasks/updateFirmware.d.ts +1 -0
  79. package/lib/deviceSDK/tasks/updateFirmware.d.ts.map +1 -1
  80. package/lib/deviceSDK/tasks/updateFirmware.js +2 -2
  81. package/lib/deviceSDK/tasks/updateFirmware.js.map +1 -1
  82. package/lib/deviceSDK/transports/core.d.ts +1 -0
  83. package/lib/deviceSDK/transports/core.d.ts.map +1 -1
  84. package/lib/deviceSDK/transports/core.js +2 -2
  85. package/lib/deviceSDK/transports/core.js.map +1 -1
  86. package/lib/e2e/enum/Account.d.ts +0 -1
  87. package/lib/e2e/enum/Account.d.ts.map +1 -1
  88. package/lib/e2e/enum/Account.js +0 -1
  89. package/lib/e2e/enum/Account.js.map +1 -1
  90. package/lib/e2e/enum/Currency.d.ts +0 -1
  91. package/lib/e2e/enum/Currency.d.ts.map +1 -1
  92. package/lib/e2e/enum/Currency.js +1 -5
  93. package/lib/e2e/enum/Currency.js.map +1 -1
  94. package/lib/e2e/enum/ReceiveFundsOptions.d.ts +6 -0
  95. package/lib/e2e/enum/ReceiveFundsOptions.d.ts.map +1 -0
  96. package/lib/e2e/enum/ReceiveFundsOptions.js +8 -0
  97. package/lib/e2e/enum/ReceiveFundsOptions.js.map +1 -0
  98. package/lib/exchange/providers/swap.d.ts +1 -0
  99. package/lib/exchange/providers/swap.d.ts.map +1 -1
  100. package/lib/exchange/providers/swap.js +5 -1
  101. package/lib/exchange/providers/swap.js.map +1 -1
  102. package/lib/exchange/swap/hooks/v5/useFetchCurrencyAll.d.ts.map +1 -1
  103. package/lib/exchange/swap/hooks/v5/useFetchCurrencyAll.js +2 -3
  104. package/lib/exchange/swap/hooks/v5/useFetchCurrencyAll.js.map +1 -1
  105. package/lib/exchange/swap/hooks/v5/useFilteredProviders.d.ts.map +1 -1
  106. package/lib/exchange/swap/hooks/v5/useFilteredProviders.js +15 -10
  107. package/lib/exchange/swap/hooks/v5/useFilteredProviders.js.map +1 -1
  108. package/lib/hw/actions/app.d.ts.map +1 -1
  109. package/lib/hw/actions/app.js +2 -1
  110. package/lib/hw/actions/app.js.map +1 -1
  111. package/lib/hw/actions/customLockScreenLoad.d.ts +1 -1
  112. package/lib/hw/actions/customLockScreenLoad.d.ts.map +1 -1
  113. package/lib/hw/actions/customLockScreenLoad.js +2 -0
  114. package/lib/hw/actions/customLockScreenLoad.js.map +1 -1
  115. package/lib/hw/actions/implementations.d.ts +1 -0
  116. package/lib/hw/actions/implementations.d.ts.map +1 -1
  117. package/lib/hw/actions/implementations.js +12 -2
  118. package/lib/hw/actions/implementations.js.map +1 -1
  119. package/lib/hw/connectApp.d.ts +2 -1
  120. package/lib/hw/connectApp.d.ts.map +1 -1
  121. package/lib/hw/connectApp.js +4 -4
  122. package/lib/hw/connectApp.js.map +1 -1
  123. package/lib/hw/connectManager.d.ts +2 -1
  124. package/lib/hw/connectManager.d.ts.map +1 -1
  125. package/lib/hw/connectManager.js +4 -4
  126. package/lib/hw/connectManager.js.map +1 -1
  127. package/lib/hw/customLockScreenFetch.d.ts +2 -1
  128. package/lib/hw/customLockScreenFetch.d.ts.map +1 -1
  129. package/lib/hw/customLockScreenFetch.js +2 -2
  130. package/lib/hw/customLockScreenFetch.js.map +1 -1
  131. package/lib/hw/customLockScreenLoad.d.ts +2 -1
  132. package/lib/hw/customLockScreenLoad.d.ts.map +1 -1
  133. package/lib/hw/customLockScreenLoad.js +2 -2
  134. package/lib/hw/customLockScreenLoad.js.map +1 -1
  135. package/lib/hw/deviceAccess.d.ts +3 -3
  136. package/lib/hw/deviceAccess.d.ts.map +1 -1
  137. package/lib/hw/deviceAccess.js +2 -1
  138. package/lib/hw/deviceAccess.js.map +1 -1
  139. package/lib/hw/getGenuineCheckFromDeviceId.d.ts +2 -1
  140. package/lib/hw/getGenuineCheckFromDeviceId.d.ts.map +1 -1
  141. package/lib/hw/getGenuineCheckFromDeviceId.js +2 -2
  142. package/lib/hw/getGenuineCheckFromDeviceId.js.map +1 -1
  143. package/lib/hw/getOnboardingStatePolling.d.ts +2 -1
  144. package/lib/hw/getOnboardingStatePolling.d.ts.map +1 -1
  145. package/lib/hw/getOnboardingStatePolling.js +5 -2
  146. package/lib/hw/getOnboardingStatePolling.js.map +1 -1
  147. package/lib/hw/hooks/useGenuineCheck.d.ts +2 -1
  148. package/lib/hw/hooks/useGenuineCheck.d.ts.map +1 -1
  149. package/lib/hw/hooks/useGenuineCheck.js +3 -1
  150. package/lib/hw/hooks/useGenuineCheck.js.map +1 -1
  151. package/lib/hw/index.d.ts +6 -2
  152. package/lib/hw/index.d.ts.map +1 -1
  153. package/lib/hw/index.js +6 -6
  154. package/lib/hw/index.js.map +1 -1
  155. package/lib/hw/installLanguage.d.ts +2 -1
  156. package/lib/hw/installLanguage.d.ts.map +1 -1
  157. package/lib/hw/installLanguage.js +2 -2
  158. package/lib/hw/installLanguage.js.map +1 -1
  159. package/lib/market/hooks/useMarketDataProvider.js +1 -0
  160. package/lib/market/hooks/useMarketDataProvider.js.map +1 -1
  161. package/lib/market/utils/types.d.ts +1 -0
  162. package/lib/market/utils/types.d.ts.map +1 -1
  163. package/lib/market/utils/types.js.map +1 -1
  164. package/lib/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.d.ts.map +1 -1
  165. package/lib/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.js +2 -0
  166. package/lib/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.js.map +1 -1
  167. package/lib/modularDrawer/hooks/useNetworkAccountCounts.d.ts +1 -5
  168. package/lib/modularDrawer/hooks/useNetworkAccountCounts.d.ts.map +1 -1
  169. package/lib/modularDrawer/hooks/useNetworkAccountCounts.js +2 -2
  170. package/lib/modularDrawer/hooks/useNetworkAccountCounts.js.map +1 -1
  171. package/lib/modularDrawer/modules/createNetworkConfiguration.d.ts +1 -1
  172. package/lib/modularDrawer/modules/createNetworkConfiguration.d.ts.map +1 -1
  173. package/lib/modularDrawer/modules/createNetworkConfiguration.js +1 -2
  174. package/lib/modularDrawer/modules/createNetworkConfiguration.js.map +1 -1
  175. package/lib/modularDrawer/utils/{groupCurrenciesByProvider.d.ts → groupCurrenciesByAsset.d.ts} +2 -2
  176. package/lib/modularDrawer/utils/groupCurrenciesByAsset.d.ts.map +1 -0
  177. package/lib/modularDrawer/utils/{groupCurrenciesByProvider.js → groupCurrenciesByAsset.js} +7 -7
  178. package/lib/modularDrawer/utils/groupCurrenciesByAsset.js.map +1 -0
  179. package/lib/modularDrawer/utils/index.d.ts +1 -1
  180. package/lib/modularDrawer/utils/index.d.ts.map +1 -1
  181. package/lib/modularDrawer/utils/index.js +3 -3
  182. package/lib/modularDrawer/utils/index.js.map +1 -1
  183. package/lib/modularDrawer/utils/type.d.ts +0 -5
  184. package/lib/modularDrawer/utils/type.d.ts.map +1 -1
  185. package/lib/onboarding/hooks/useOnboardingStatePolling.d.ts.map +1 -1
  186. package/lib/onboarding/hooks/useOnboardingStatePolling.js +1 -0
  187. package/lib/onboarding/hooks/useOnboardingStatePolling.js.map +1 -1
  188. package/lib/platform/filters.d.ts +1 -2
  189. package/lib/platform/filters.d.ts.map +1 -1
  190. package/lib/platform/filters.js +1 -17
  191. package/lib/platform/filters.js.map +1 -1
  192. package/lib/platform/helpers.d.ts +1 -5
  193. package/lib/platform/helpers.d.ts.map +1 -1
  194. package/lib/platform/helpers.js +1 -33
  195. package/lib/platform/helpers.js.map +1 -1
  196. package/lib/platform/react.d.ts +2 -3
  197. package/lib/platform/react.d.ts.map +1 -1
  198. package/lib/platform/react.js +66 -16
  199. package/lib/platform/react.js.map +1 -1
  200. package/lib/platform/types.d.ts +3 -3
  201. package/lib/platform/types.d.ts.map +1 -1
  202. package/lib/utils/getAccountTuplesForCurrency.d.ts +1 -1
  203. package/lib/utils/getAccountTuplesForCurrency.d.ts.map +1 -1
  204. package/lib/utils/getAccountTuplesForCurrency.js +2 -3
  205. package/lib/utils/getAccountTuplesForCurrency.js.map +1 -1
  206. package/lib/wallet-api/Exchange/server.d.ts.map +1 -1
  207. package/lib/wallet-api/Exchange/server.js +5 -4
  208. package/lib/wallet-api/Exchange/server.js.map +1 -1
  209. package/lib/wallet-api/converters.d.ts +1 -0
  210. package/lib/wallet-api/converters.d.ts.map +1 -1
  211. package/lib/wallet-api/converters.js +7 -2
  212. package/lib/wallet-api/converters.js.map +1 -1
  213. package/lib/wallet-api/react.d.ts +6 -11
  214. package/lib/wallet-api/react.d.ts.map +1 -1
  215. package/lib/wallet-api/react.js +291 -135
  216. package/lib/wallet-api/react.js.map +1 -1
  217. package/lib/wallet-api/tracking.d.ts +6 -0
  218. package/lib/wallet-api/tracking.d.ts.map +1 -1
  219. package/lib/wallet-api/tracking.js +20 -0
  220. package/lib/wallet-api/tracking.js.map +1 -1
  221. package/lib/wallet-api/types.d.ts +3 -0
  222. package/lib/wallet-api/types.d.ts.map +1 -1
  223. package/lib/wallet-api/useDappLogic.d.ts.map +1 -1
  224. package/lib/wallet-api/useDappLogic.js +65 -80
  225. package/lib/wallet-api/useDappLogic.js.map +1 -1
  226. package/lib/wallet-api/utils/deriveAccountIdForManifest.d.ts +6 -0
  227. package/lib/wallet-api/utils/deriveAccountIdForManifest.d.ts.map +1 -1
  228. package/lib/wallet-api/utils/deriveAccountIdForManifest.js +13 -3
  229. package/lib/wallet-api/utils/deriveAccountIdForManifest.js.map +1 -1
  230. package/lib-es/__tests__/test-helpers/bridge.d.ts.map +1 -1
  231. package/lib-es/__tests__/test-helpers/bridge.js +0 -4
  232. package/lib-es/__tests__/test-helpers/bridge.js.map +1 -1
  233. package/lib-es/bridge/generic-alpaca/getAccountShape.d.ts.map +1 -1
  234. package/lib-es/bridge/generic-alpaca/getAccountShape.js +13 -11
  235. package/lib-es/bridge/generic-alpaca/getAccountShape.js.map +1 -1
  236. package/lib-es/currencies/helpers.d.ts +1 -3
  237. package/lib-es/currencies/helpers.d.ts.map +1 -1
  238. package/lib-es/currencies/helpers.js +0 -24
  239. package/lib-es/currencies/helpers.js.map +1 -1
  240. package/lib-es/dada-client/hooks/useAssetsData.d.ts +1 -0
  241. package/lib-es/dada-client/hooks/useAssetsData.d.ts.map +1 -1
  242. package/lib-es/dada-client/hooks/useAssetsData.js +1 -0
  243. package/lib-es/dada-client/hooks/useAssetsData.js.map +1 -1
  244. package/lib-es/deposit/type.d.ts +0 -17
  245. package/lib-es/deposit/type.d.ts.map +1 -1
  246. package/lib-es/deposit/type.js.map +1 -1
  247. package/lib-es/deviceSDK/actions/getBatteryStatuses.d.ts +2 -1
  248. package/lib-es/deviceSDK/actions/getBatteryStatuses.d.ts.map +1 -1
  249. package/lib-es/deviceSDK/actions/getBatteryStatuses.js +2 -2
  250. package/lib-es/deviceSDK/actions/getBatteryStatuses.js.map +1 -1
  251. package/lib-es/deviceSDK/actions/getDeviceInfo.d.ts +2 -1
  252. package/lib-es/deviceSDK/actions/getDeviceInfo.d.ts.map +1 -1
  253. package/lib-es/deviceSDK/actions/getDeviceInfo.js +2 -2
  254. package/lib-es/deviceSDK/actions/getDeviceInfo.js.map +1 -1
  255. package/lib-es/deviceSDK/actions/getLatestAvailableFirmware.d.ts +2 -1
  256. package/lib-es/deviceSDK/actions/getLatestAvailableFirmware.d.ts.map +1 -1
  257. package/lib-es/deviceSDK/actions/getLatestAvailableFirmware.js +6 -3
  258. package/lib-es/deviceSDK/actions/getLatestAvailableFirmware.js.map +1 -1
  259. package/lib-es/deviceSDK/actions/toggleOnboardingEarlyCheck.d.ts +2 -1
  260. package/lib-es/deviceSDK/actions/toggleOnboardingEarlyCheck.d.ts.map +1 -1
  261. package/lib-es/deviceSDK/actions/toggleOnboardingEarlyCheck.js +2 -2
  262. package/lib-es/deviceSDK/actions/toggleOnboardingEarlyCheck.js.map +1 -1
  263. package/lib-es/deviceSDK/actions/updateFirmware.d.ts +2 -1
  264. package/lib-es/deviceSDK/actions/updateFirmware.d.ts.map +1 -1
  265. package/lib-es/deviceSDK/actions/updateFirmware.js +4 -3
  266. package/lib-es/deviceSDK/actions/updateFirmware.js.map +1 -1
  267. package/lib-es/deviceSDK/hooks/useBatteryStatuses.d.ts +2 -1
  268. package/lib-es/deviceSDK/hooks/useBatteryStatuses.d.ts.map +1 -1
  269. package/lib-es/deviceSDK/hooks/useBatteryStatuses.js +3 -2
  270. package/lib-es/deviceSDK/hooks/useBatteryStatuses.js.map +1 -1
  271. package/lib-es/deviceSDK/hooks/useGetDeviceInfo.d.ts +2 -1
  272. package/lib-es/deviceSDK/hooks/useGetDeviceInfo.d.ts.map +1 -1
  273. package/lib-es/deviceSDK/hooks/useGetDeviceInfo.js +3 -3
  274. package/lib-es/deviceSDK/hooks/useGetDeviceInfo.js.map +1 -1
  275. package/lib-es/deviceSDK/hooks/useGetLatestAvailableFirmware.d.ts +2 -1
  276. package/lib-es/deviceSDK/hooks/useGetLatestAvailableFirmware.d.ts.map +1 -1
  277. package/lib-es/deviceSDK/hooks/useGetLatestAvailableFirmware.js +2 -1
  278. package/lib-es/deviceSDK/hooks/useGetLatestAvailableFirmware.js.map +1 -1
  279. package/lib-es/deviceSDK/hooks/useToggleOnboardingEarlyChecks.d.ts +2 -1
  280. package/lib-es/deviceSDK/hooks/useToggleOnboardingEarlyChecks.d.ts.map +1 -1
  281. package/lib-es/deviceSDK/hooks/useToggleOnboardingEarlyChecks.js +3 -2
  282. package/lib-es/deviceSDK/hooks/useToggleOnboardingEarlyChecks.js.map +1 -1
  283. package/lib-es/deviceSDK/hooks/useUpdateFirmware.d.ts +2 -1
  284. package/lib-es/deviceSDK/hooks/useUpdateFirmware.d.ts.map +1 -1
  285. package/lib-es/deviceSDK/hooks/useUpdateFirmware.js +3 -2
  286. package/lib-es/deviceSDK/hooks/useUpdateFirmware.js.map +1 -1
  287. package/lib-es/deviceSDK/tasks/core.d.ts +1 -1
  288. package/lib-es/deviceSDK/tasks/core.d.ts.map +1 -1
  289. package/lib-es/deviceSDK/tasks/core.js +1 -1
  290. package/lib-es/deviceSDK/tasks/core.js.map +1 -1
  291. package/lib-es/deviceSDK/tasks/getBatteryStatuses.d.ts +1 -0
  292. package/lib-es/deviceSDK/tasks/getBatteryStatuses.d.ts.map +1 -1
  293. package/lib-es/deviceSDK/tasks/getBatteryStatuses.js +2 -2
  294. package/lib-es/deviceSDK/tasks/getBatteryStatuses.js.map +1 -1
  295. package/lib-es/deviceSDK/tasks/getDeviceInfo.d.ts +2 -1
  296. package/lib-es/deviceSDK/tasks/getDeviceInfo.d.ts.map +1 -1
  297. package/lib-es/deviceSDK/tasks/getDeviceInfo.js +2 -2
  298. package/lib-es/deviceSDK/tasks/getDeviceInfo.js.map +1 -1
  299. package/lib-es/deviceSDK/tasks/getLatestFirmware.d.ts +1 -0
  300. package/lib-es/deviceSDK/tasks/getLatestFirmware.d.ts.map +1 -1
  301. package/lib-es/deviceSDK/tasks/getLatestFirmware.js +2 -2
  302. package/lib-es/deviceSDK/tasks/getLatestFirmware.js.map +1 -1
  303. package/lib-es/deviceSDK/tasks/toggleOnboardingEarlyCheck.d.ts +1 -0
  304. package/lib-es/deviceSDK/tasks/toggleOnboardingEarlyCheck.d.ts.map +1 -1
  305. package/lib-es/deviceSDK/tasks/toggleOnboardingEarlyCheck.js +2 -2
  306. package/lib-es/deviceSDK/tasks/toggleOnboardingEarlyCheck.js.map +1 -1
  307. package/lib-es/deviceSDK/tasks/updateFirmware.d.ts +1 -0
  308. package/lib-es/deviceSDK/tasks/updateFirmware.d.ts.map +1 -1
  309. package/lib-es/deviceSDK/tasks/updateFirmware.js +2 -2
  310. package/lib-es/deviceSDK/tasks/updateFirmware.js.map +1 -1
  311. package/lib-es/deviceSDK/transports/core.d.ts +1 -0
  312. package/lib-es/deviceSDK/transports/core.d.ts.map +1 -1
  313. package/lib-es/deviceSDK/transports/core.js +2 -2
  314. package/lib-es/deviceSDK/transports/core.js.map +1 -1
  315. package/lib-es/e2e/enum/Account.d.ts +0 -1
  316. package/lib-es/e2e/enum/Account.d.ts.map +1 -1
  317. package/lib-es/e2e/enum/Account.js +0 -1
  318. package/lib-es/e2e/enum/Account.js.map +1 -1
  319. package/lib-es/e2e/enum/Currency.d.ts +0 -1
  320. package/lib-es/e2e/enum/Currency.d.ts.map +1 -1
  321. package/lib-es/e2e/enum/Currency.js +1 -5
  322. package/lib-es/e2e/enum/Currency.js.map +1 -1
  323. package/lib-es/e2e/enum/ReceiveFundsOptions.d.ts +6 -0
  324. package/lib-es/e2e/enum/ReceiveFundsOptions.d.ts.map +1 -0
  325. package/lib-es/e2e/enum/ReceiveFundsOptions.js +5 -0
  326. package/lib-es/e2e/enum/ReceiveFundsOptions.js.map +1 -0
  327. package/lib-es/exchange/providers/swap.d.ts +1 -0
  328. package/lib-es/exchange/providers/swap.d.ts.map +1 -1
  329. package/lib-es/exchange/providers/swap.js +3 -0
  330. package/lib-es/exchange/providers/swap.js.map +1 -1
  331. package/lib-es/exchange/swap/hooks/v5/useFetchCurrencyAll.d.ts.map +1 -1
  332. package/lib-es/exchange/swap/hooks/v5/useFetchCurrencyAll.js +2 -3
  333. package/lib-es/exchange/swap/hooks/v5/useFetchCurrencyAll.js.map +1 -1
  334. package/lib-es/exchange/swap/hooks/v5/useFilteredProviders.d.ts.map +1 -1
  335. package/lib-es/exchange/swap/hooks/v5/useFilteredProviders.js +17 -12
  336. package/lib-es/exchange/swap/hooks/v5/useFilteredProviders.js.map +1 -1
  337. package/lib-es/hw/actions/app.d.ts.map +1 -1
  338. package/lib-es/hw/actions/app.js +2 -1
  339. package/lib-es/hw/actions/app.js.map +1 -1
  340. package/lib-es/hw/actions/customLockScreenLoad.d.ts +1 -1
  341. package/lib-es/hw/actions/customLockScreenLoad.d.ts.map +1 -1
  342. package/lib-es/hw/actions/customLockScreenLoad.js +2 -0
  343. package/lib-es/hw/actions/customLockScreenLoad.js.map +1 -1
  344. package/lib-es/hw/actions/implementations.d.ts +1 -0
  345. package/lib-es/hw/actions/implementations.d.ts.map +1 -1
  346. package/lib-es/hw/actions/implementations.js +12 -2
  347. package/lib-es/hw/actions/implementations.js.map +1 -1
  348. package/lib-es/hw/connectApp.d.ts +2 -1
  349. package/lib-es/hw/connectApp.d.ts.map +1 -1
  350. package/lib-es/hw/connectApp.js +4 -4
  351. package/lib-es/hw/connectApp.js.map +1 -1
  352. package/lib-es/hw/connectManager.d.ts +2 -1
  353. package/lib-es/hw/connectManager.d.ts.map +1 -1
  354. package/lib-es/hw/connectManager.js +4 -4
  355. package/lib-es/hw/connectManager.js.map +1 -1
  356. package/lib-es/hw/customLockScreenFetch.d.ts +2 -1
  357. package/lib-es/hw/customLockScreenFetch.d.ts.map +1 -1
  358. package/lib-es/hw/customLockScreenFetch.js +2 -2
  359. package/lib-es/hw/customLockScreenFetch.js.map +1 -1
  360. package/lib-es/hw/customLockScreenLoad.d.ts +2 -1
  361. package/lib-es/hw/customLockScreenLoad.d.ts.map +1 -1
  362. package/lib-es/hw/customLockScreenLoad.js +2 -2
  363. package/lib-es/hw/customLockScreenLoad.js.map +1 -1
  364. package/lib-es/hw/deviceAccess.d.ts +3 -3
  365. package/lib-es/hw/deviceAccess.d.ts.map +1 -1
  366. package/lib-es/hw/deviceAccess.js +2 -1
  367. package/lib-es/hw/deviceAccess.js.map +1 -1
  368. package/lib-es/hw/getGenuineCheckFromDeviceId.d.ts +2 -1
  369. package/lib-es/hw/getGenuineCheckFromDeviceId.d.ts.map +1 -1
  370. package/lib-es/hw/getGenuineCheckFromDeviceId.js +2 -2
  371. package/lib-es/hw/getGenuineCheckFromDeviceId.js.map +1 -1
  372. package/lib-es/hw/getOnboardingStatePolling.d.ts +2 -1
  373. package/lib-es/hw/getOnboardingStatePolling.d.ts.map +1 -1
  374. package/lib-es/hw/getOnboardingStatePolling.js +5 -2
  375. package/lib-es/hw/getOnboardingStatePolling.js.map +1 -1
  376. package/lib-es/hw/hooks/useGenuineCheck.d.ts +2 -1
  377. package/lib-es/hw/hooks/useGenuineCheck.d.ts.map +1 -1
  378. package/lib-es/hw/hooks/useGenuineCheck.js +3 -1
  379. package/lib-es/hw/hooks/useGenuineCheck.js.map +1 -1
  380. package/lib-es/hw/index.d.ts +6 -2
  381. package/lib-es/hw/index.d.ts.map +1 -1
  382. package/lib-es/hw/index.js +6 -6
  383. package/lib-es/hw/index.js.map +1 -1
  384. package/lib-es/hw/installLanguage.d.ts +2 -1
  385. package/lib-es/hw/installLanguage.d.ts.map +1 -1
  386. package/lib-es/hw/installLanguage.js +2 -2
  387. package/lib-es/hw/installLanguage.js.map +1 -1
  388. package/lib-es/market/hooks/useMarketDataProvider.js +1 -0
  389. package/lib-es/market/hooks/useMarketDataProvider.js.map +1 -1
  390. package/lib-es/market/utils/types.d.ts +1 -0
  391. package/lib-es/market/utils/types.d.ts.map +1 -1
  392. package/lib-es/market/utils/types.js.map +1 -1
  393. package/lib-es/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.d.ts.map +1 -1
  394. package/lib-es/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.js +2 -0
  395. package/lib-es/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.js.map +1 -1
  396. package/lib-es/modularDrawer/hooks/useNetworkAccountCounts.d.ts +1 -5
  397. package/lib-es/modularDrawer/hooks/useNetworkAccountCounts.d.ts.map +1 -1
  398. package/lib-es/modularDrawer/hooks/useNetworkAccountCounts.js +2 -2
  399. package/lib-es/modularDrawer/hooks/useNetworkAccountCounts.js.map +1 -1
  400. package/lib-es/modularDrawer/modules/createNetworkConfiguration.d.ts +1 -1
  401. package/lib-es/modularDrawer/modules/createNetworkConfiguration.d.ts.map +1 -1
  402. package/lib-es/modularDrawer/modules/createNetworkConfiguration.js +1 -2
  403. package/lib-es/modularDrawer/modules/createNetworkConfiguration.js.map +1 -1
  404. package/lib-es/modularDrawer/utils/{groupCurrenciesByProvider.d.ts → groupCurrenciesByAsset.d.ts} +2 -2
  405. package/lib-es/modularDrawer/utils/groupCurrenciesByAsset.d.ts.map +1 -0
  406. package/lib-es/modularDrawer/utils/{groupCurrenciesByProvider.js → groupCurrenciesByAsset.js} +5 -5
  407. package/lib-es/modularDrawer/utils/groupCurrenciesByAsset.js.map +1 -0
  408. package/lib-es/modularDrawer/utils/index.d.ts +1 -1
  409. package/lib-es/modularDrawer/utils/index.d.ts.map +1 -1
  410. package/lib-es/modularDrawer/utils/index.js +1 -1
  411. package/lib-es/modularDrawer/utils/index.js.map +1 -1
  412. package/lib-es/modularDrawer/utils/type.d.ts +0 -5
  413. package/lib-es/modularDrawer/utils/type.d.ts.map +1 -1
  414. package/lib-es/onboarding/hooks/useOnboardingStatePolling.d.ts.map +1 -1
  415. package/lib-es/onboarding/hooks/useOnboardingStatePolling.js +1 -0
  416. package/lib-es/onboarding/hooks/useOnboardingStatePolling.js.map +1 -1
  417. package/lib-es/platform/filters.d.ts +1 -2
  418. package/lib-es/platform/filters.d.ts.map +1 -1
  419. package/lib-es/platform/filters.js +0 -15
  420. package/lib-es/platform/filters.js.map +1 -1
  421. package/lib-es/platform/helpers.d.ts +1 -5
  422. package/lib-es/platform/helpers.d.ts.map +1 -1
  423. package/lib-es/platform/helpers.js +1 -30
  424. package/lib-es/platform/helpers.js.map +1 -1
  425. package/lib-es/platform/react.d.ts +2 -3
  426. package/lib-es/platform/react.d.ts.map +1 -1
  427. package/lib-es/platform/react.js +67 -16
  428. package/lib-es/platform/react.js.map +1 -1
  429. package/lib-es/platform/types.d.ts +3 -3
  430. package/lib-es/platform/types.d.ts.map +1 -1
  431. package/lib-es/utils/getAccountTuplesForCurrency.d.ts +1 -1
  432. package/lib-es/utils/getAccountTuplesForCurrency.d.ts.map +1 -1
  433. package/lib-es/utils/getAccountTuplesForCurrency.js +2 -3
  434. package/lib-es/utils/getAccountTuplesForCurrency.js.map +1 -1
  435. package/lib-es/wallet-api/Exchange/server.d.ts.map +1 -1
  436. package/lib-es/wallet-api/Exchange/server.js +5 -4
  437. package/lib-es/wallet-api/Exchange/server.js.map +1 -1
  438. package/lib-es/wallet-api/converters.d.ts +1 -0
  439. package/lib-es/wallet-api/converters.d.ts.map +1 -1
  440. package/lib-es/wallet-api/converters.js +5 -1
  441. package/lib-es/wallet-api/converters.js.map +1 -1
  442. package/lib-es/wallet-api/react.d.ts +6 -11
  443. package/lib-es/wallet-api/react.d.ts.map +1 -1
  444. package/lib-es/wallet-api/react.js +289 -131
  445. package/lib-es/wallet-api/react.js.map +1 -1
  446. package/lib-es/wallet-api/tracking.d.ts +6 -0
  447. package/lib-es/wallet-api/tracking.d.ts.map +1 -1
  448. package/lib-es/wallet-api/tracking.js +20 -0
  449. package/lib-es/wallet-api/tracking.js.map +1 -1
  450. package/lib-es/wallet-api/types.d.ts +3 -0
  451. package/lib-es/wallet-api/types.d.ts.map +1 -1
  452. package/lib-es/wallet-api/useDappLogic.d.ts.map +1 -1
  453. package/lib-es/wallet-api/useDappLogic.js +62 -77
  454. package/lib-es/wallet-api/useDappLogic.js.map +1 -1
  455. package/lib-es/wallet-api/utils/deriveAccountIdForManifest.d.ts +6 -0
  456. package/lib-es/wallet-api/utils/deriveAccountIdForManifest.d.ts.map +1 -1
  457. package/lib-es/wallet-api/utils/deriveAccountIdForManifest.js +11 -2
  458. package/lib-es/wallet-api/utils/deriveAccountIdForManifest.js.map +1 -1
  459. package/package.json +56 -56
  460. package/src/__tests__/test-helpers/bridge.ts +0 -2
  461. package/src/bridge/generic-alpaca/getAccountShape.ts +15 -12
  462. package/src/bridge/generic-alpaca/tests/getAccountShape.test.ts +142 -101
  463. package/src/currencies/helpers.ts +1 -42
  464. package/src/dada-client/hooks/useAssetsData.ts +1 -0
  465. package/src/deposit/type.ts +0 -21
  466. package/src/deviceSDK/actions/getBatteryStatuses.ts +3 -1
  467. package/src/deviceSDK/actions/getDeviceInfo.ts +3 -2
  468. package/src/deviceSDK/actions/getLatestAvailableFirmware.test.ts +31 -0
  469. package/src/deviceSDK/actions/getLatestAvailableFirmware.ts +7 -2
  470. package/src/deviceSDK/actions/toggleOnboardingEarlyCheck.ts +3 -1
  471. package/src/deviceSDK/actions/updateFirmware.ts +5 -2
  472. package/src/deviceSDK/hooks/useBatteryStatuses.test.ts +3 -1
  473. package/src/deviceSDK/hooks/useBatteryStatuses.ts +4 -1
  474. package/src/deviceSDK/hooks/useGetDeviceInfo.ts +4 -2
  475. package/src/deviceSDK/hooks/useGetLatestAvailableFirmware.ts +3 -0
  476. package/src/deviceSDK/hooks/useToggleOnboardingEarlyChecks.test.ts +2 -0
  477. package/src/deviceSDK/hooks/useToggleOnboardingEarlyChecks.ts +4 -1
  478. package/src/deviceSDK/hooks/useUpdateFirmware.ts +4 -1
  479. package/src/deviceSDK/tasks/core.test.ts +20 -0
  480. package/src/deviceSDK/tasks/core.ts +2 -1
  481. package/src/deviceSDK/tasks/getBatteryStatuses.ts +6 -1
  482. package/src/deviceSDK/tasks/getDeviceInfo.ts +6 -2
  483. package/src/deviceSDK/tasks/getLatestFirmware.ts +6 -1
  484. package/src/deviceSDK/tasks/toggleOnboardingEarlyCheck.test.ts +3 -0
  485. package/src/deviceSDK/tasks/toggleOnboardingEarlyCheck.ts +6 -1
  486. package/src/deviceSDK/tasks/updateFirmware.ts +6 -1
  487. package/src/deviceSDK/transports/core.ts +6 -3
  488. package/src/e2e/enum/Account.ts +0 -6
  489. package/src/e2e/enum/Currency.ts +1 -5
  490. package/src/e2e/enum/ReceiveFundsOptions.ts +7 -0
  491. package/src/exchange/providers/swap.ts +4 -0
  492. package/src/exchange/swap/hooks/v5/useFetchCurrencyAll.ts +2 -3
  493. package/src/exchange/swap/hooks/v5/useFilteredProviders.ts +37 -12
  494. package/src/families/stellar/__snapshots__/bridge.integration.test.ts.snap +84 -12
  495. package/src/hw/actions/app.ts +2 -1
  496. package/src/hw/actions/customLockScreenLoad.ts +6 -2
  497. package/src/hw/actions/implementations.ts +17 -3
  498. package/src/hw/connectApp.ts +12 -5
  499. package/src/hw/connectManager.ts +13 -6
  500. package/src/hw/customLockScreenFetch.ts +10 -2
  501. package/src/hw/customLockScreenLoad.test.ts +28 -3
  502. package/src/hw/customLockScreenLoad.ts +10 -2
  503. package/src/hw/deviceAccess.ts +4 -3
  504. package/src/hw/getGenuineCheckFromDeviceId.test.ts +4 -0
  505. package/src/hw/getGenuineCheckFromDeviceId.ts +6 -1
  506. package/src/hw/getOnboardingStatePolling.test.ts +34 -0
  507. package/src/hw/getOnboardingStatePolling.ts +6 -3
  508. package/src/hw/hooks/useGenuineCheck.test.ts +37 -0
  509. package/src/hw/hooks/useGenuineCheck.ts +4 -0
  510. package/src/hw/index.test.ts +27 -6
  511. package/src/hw/index.ts +15 -8
  512. package/src/hw/installLanguage.ts +6 -1
  513. package/src/market/hooks/useMarketDataProvider.ts +1 -0
  514. package/src/market/utils/types.ts +1 -0
  515. package/src/modularDrawer/hooks/__test__/useAssetAccountCounts.test.ts +0 -5
  516. package/src/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.ts +2 -0
  517. package/src/modularDrawer/hooks/useNetworkAccountCounts.tsx +1 -6
  518. package/src/modularDrawer/modules/__test__/createAssetConfiguration.test.tsx +2 -2
  519. package/src/modularDrawer/modules/createNetworkConfiguration.ts +1 -2
  520. package/src/modularDrawer/utils/__tests__/{groupCurrenciesByProvider.test.ts → groupCurrenciesByAsset.test.ts} +6 -6
  521. package/src/modularDrawer/utils/{groupCurrenciesByProvider.ts → groupCurrenciesByAsset.ts} +4 -4
  522. package/src/modularDrawer/utils/index.ts +1 -1
  523. package/src/modularDrawer/utils/type.ts +0 -5
  524. package/src/onboarding/hooks/useOnboardingStatePolling.ts +1 -0
  525. package/src/platform/filters.ts +1 -23
  526. package/src/platform/helpers.ts +2 -49
  527. package/src/platform/react.ts +86 -22
  528. package/src/platform/types.ts +1 -1
  529. package/src/utils/__tests__/getAccountTuplesForCurrency.test.ts +0 -30
  530. package/src/utils/getAccountTuplesForCurrency.ts +1 -6
  531. package/src/wallet-api/Exchange/server.test.ts +0 -5
  532. package/src/wallet-api/Exchange/server.ts +7 -6
  533. package/src/wallet-api/converters.ts +6 -1
  534. package/src/wallet-api/react.ts +310 -137
  535. package/src/wallet-api/tracking.ts +22 -0
  536. package/src/wallet-api/types.ts +5 -0
  537. package/src/wallet-api/useDappLogic.ts +91 -106
  538. package/src/wallet-api/utils/deriveAccountIdForManifest.ts +14 -2
  539. package/lib/deposit/helper.d.ts +0 -8
  540. package/lib/deposit/helper.d.ts.map +0 -1
  541. package/lib/deposit/helper.js +0 -125
  542. package/lib/deposit/helper.js.map +0 -1
  543. package/lib/deposit/index.d.ts +0 -3
  544. package/lib/deposit/index.d.ts.map +0 -1
  545. package/lib/deposit/index.js +0 -6
  546. package/lib/deposit/index.js.map +0 -1
  547. package/lib/deposit/mock.d.ts +0 -75
  548. package/lib/deposit/mock.d.ts.map +0 -1
  549. package/lib/deposit/mock.js +0 -15111
  550. package/lib/deposit/mock.js.map +0 -1
  551. package/lib/deposit/useGroupedCurrenciesByProvider.hook.d.ts +0 -3
  552. package/lib/deposit/useGroupedCurrenciesByProvider.hook.d.ts.map +0 -1
  553. package/lib/deposit/useGroupedCurrenciesByProvider.hook.js +0 -40
  554. package/lib/deposit/useGroupedCurrenciesByProvider.hook.js.map +0 -1
  555. package/lib/modularDrawer/__mocks__/useGroupedCurrenciesByProvider.mock.d.ts +0 -22
  556. package/lib/modularDrawer/__mocks__/useGroupedCurrenciesByProvider.mock.d.ts.map +0 -1
  557. package/lib/modularDrawer/__mocks__/useGroupedCurrenciesByProvider.mock.js +0 -41
  558. package/lib/modularDrawer/__mocks__/useGroupedCurrenciesByProvider.mock.js.map +0 -1
  559. package/lib/modularDrawer/utils/currencyUtils.d.ts +0 -10
  560. package/lib/modularDrawer/utils/currencyUtils.d.ts.map +0 -1
  561. package/lib/modularDrawer/utils/currencyUtils.js +0 -74
  562. package/lib/modularDrawer/utils/currencyUtils.js.map +0 -1
  563. package/lib/modularDrawer/utils/groupCurrenciesByProvider.d.ts.map +0 -1
  564. package/lib/modularDrawer/utils/groupCurrenciesByProvider.js.map +0 -1
  565. package/lib-es/deposit/helper.d.ts +0 -8
  566. package/lib-es/deposit/helper.d.ts.map +0 -1
  567. package/lib-es/deposit/helper.js +0 -117
  568. package/lib-es/deposit/helper.js.map +0 -1
  569. package/lib-es/deposit/index.d.ts +0 -3
  570. package/lib-es/deposit/index.d.ts.map +0 -1
  571. package/lib-es/deposit/index.js +0 -3
  572. package/lib-es/deposit/index.js.map +0 -1
  573. package/lib-es/deposit/mock.d.ts +0 -75
  574. package/lib-es/deposit/mock.d.ts.map +0 -1
  575. package/lib-es/deposit/mock.js +0 -15108
  576. package/lib-es/deposit/mock.js.map +0 -1
  577. package/lib-es/deposit/useGroupedCurrenciesByProvider.hook.d.ts +0 -3
  578. package/lib-es/deposit/useGroupedCurrenciesByProvider.hook.d.ts.map +0 -1
  579. package/lib-es/deposit/useGroupedCurrenciesByProvider.hook.js +0 -36
  580. package/lib-es/deposit/useGroupedCurrenciesByProvider.hook.js.map +0 -1
  581. package/lib-es/modularDrawer/__mocks__/useGroupedCurrenciesByProvider.mock.d.ts +0 -22
  582. package/lib-es/modularDrawer/__mocks__/useGroupedCurrenciesByProvider.mock.d.ts.map +0 -1
  583. package/lib-es/modularDrawer/__mocks__/useGroupedCurrenciesByProvider.mock.js +0 -38
  584. package/lib-es/modularDrawer/__mocks__/useGroupedCurrenciesByProvider.mock.js.map +0 -1
  585. package/lib-es/modularDrawer/utils/currencyUtils.d.ts +0 -10
  586. package/lib-es/modularDrawer/utils/currencyUtils.d.ts.map +0 -1
  587. package/lib-es/modularDrawer/utils/currencyUtils.js +0 -65
  588. package/lib-es/modularDrawer/utils/currencyUtils.js.map +0 -1
  589. package/lib-es/modularDrawer/utils/groupCurrenciesByProvider.d.ts.map +0 -1
  590. package/lib-es/modularDrawer/utils/groupCurrenciesByProvider.js.map +0 -1
  591. package/src/currencies/helpers.test.ts +0 -20
  592. package/src/deposit/deposit.integration.test.ts +0 -88
  593. package/src/deposit/deposit.test.ts +0 -684
  594. package/src/deposit/helper.ts +0 -143
  595. package/src/deposit/index.ts +0 -3
  596. package/src/deposit/mock.ts +0 -15112
  597. package/src/deposit/useGroupedCurrenciesByProvider.hook.ts +0 -46
  598. package/src/modularDrawer/__mocks__/useGroupedCurrenciesByProvider.mock.ts +0 -49
  599. package/src/modularDrawer/modules/__test__/createNetworkConfiguration.test.ts +0 -342
  600. package/src/modularDrawer/utils/__tests__/currencyUtils.test.ts +0 -126
  601. package/src/modularDrawer/utils/currencyUtils.ts +0 -95
@@ -1,27 +1,52 @@
1
1
  import { getEnv } from "@ledgerhq/live-env";
2
- import { useCallback, useEffect, useState } from "react";
3
- import { fetchAndMergeProviderData } from "../../../providers/swap";
2
+ import { useCallback, useEffect, useState, useMemo } from "react";
3
+ import { fetchAndMergeProviderData, getDefaultSwapProviderKeys } from "../../../providers/swap";
4
4
  import { useFeature } from "../../../../featureFlags";
5
5
 
6
+ const filterProvidersByFeatureFlags = (
7
+ providers: string[],
8
+ ptxSwapMoonpayProviderFlag?: { enabled?: boolean },
9
+ ptxSwapExodusProviderFlag?: { enabled?: boolean },
10
+ ): string[] => {
11
+ let filtered = providers;
12
+ if (!ptxSwapMoonpayProviderFlag?.enabled) {
13
+ filtered = filtered.filter(provider => provider !== "moonpay");
14
+ }
15
+ if (!ptxSwapExodusProviderFlag?.enabled) {
16
+ filtered = filtered.filter(provider => provider !== "exodus");
17
+ }
18
+ return filtered;
19
+ };
20
+
6
21
  export const useFilteredProviders = () => {
7
- const [providers, setProviders] = useState<string[]>([]);
8
- const [loading, setLoading] = useState(true);
9
- const [error, setError] = useState<unknown>(null);
10
22
  const ptxSwapMoonpayProviderFlag = useFeature("ptxSwapMoonpayProvider");
11
23
  const ptxSwapExodusProviderFlag = useFeature("ptxSwapExodusProvider");
24
+
25
+ const defaultProviders = useMemo(
26
+ () =>
27
+ filterProvidersByFeatureFlags(
28
+ getDefaultSwapProviderKeys(),
29
+ ptxSwapMoonpayProviderFlag ?? undefined,
30
+ ptxSwapExodusProviderFlag ?? undefined,
31
+ ),
32
+ [ptxSwapMoonpayProviderFlag, ptxSwapExodusProviderFlag],
33
+ );
34
+
35
+ const [providers, setProviders] = useState<string[]>(defaultProviders);
36
+ const [loading, setLoading] = useState(true);
37
+ const [error, setError] = useState<unknown>(null);
38
+
12
39
  const fetchProviders = useCallback(async () => {
13
40
  try {
14
41
  const ledgerSignatureEnv = getEnv("MOCK_EXCHANGE_TEST_CONFIG") ? "test" : "prod";
15
42
  const partnerSignatureEnv = getEnv("MOCK_EXCHANGE_TEST_PARTNER") ? "test" : "prod";
16
43
 
17
44
  const data = await fetchAndMergeProviderData({ ledgerSignatureEnv, partnerSignatureEnv });
18
- let filteredProviders = Object.keys(data);
19
- if (!ptxSwapMoonpayProviderFlag?.enabled) {
20
- filteredProviders = filteredProviders.filter(provider => provider !== "moonpay");
21
- }
22
- if (!ptxSwapExodusProviderFlag?.enabled) {
23
- filteredProviders = filteredProviders.filter(provider => provider !== "exodus");
24
- }
45
+ const filteredProviders = filterProvidersByFeatureFlags(
46
+ Object.keys(data),
47
+ ptxSwapMoonpayProviderFlag ?? undefined,
48
+ ptxSwapExodusProviderFlag ?? undefined,
49
+ );
25
50
 
26
51
  setProviders(filteredProviders);
27
52
  } catch (error) {
@@ -3,20 +3,20 @@
3
3
  exports[`stellar currency bridge scanAccounts stellar seed 1 1`] = `
4
4
  [
5
5
  {
6
- "balance": "341065021",
6
+ "balance": "341065024",
7
7
  "currencyId": "stellar",
8
8
  "derivationMode": "sep5",
9
9
  "freshAddress": "GAT4LBXYJGJJJRSNK74NPFLO55CDDXSYVMQODSEAAH3M6EY4S7LPH5GV",
10
10
  "freshAddressPath": "44'/148'/0'",
11
11
  "id": "js:2:stellar:GAT4LBXYJGJJJRSNK74NPFLO55CDDXSYVMQODSEAAH3M6EY4S7LPH5GV:sep5",
12
12
  "index": 0,
13
- "operationsCount": 142,
13
+ "operationsCount": 145,
14
14
  "pendingOperations": [],
15
15
  "seedIdentifier": "27c586f8499294c64d57f8d7956eef4431de58ab20e1c88001f6cf131c97d6f3",
16
- "spendableBalance": "311064921",
16
+ "spendableBalance": "311064924",
17
17
  "subAccounts": [],
18
18
  "swapHistory": [],
19
- "syncHash": undefined,
19
+ "syncHash": "0x1431ef5f",
20
20
  "used": true,
21
21
  "xpub": "GAT4LBXYJGJJJRSNK74NPFLO55CDDXSYVMQODSEAAH3M6EY4S7LPH5GV",
22
22
  },
@@ -34,7 +34,7 @@ exports[`stellar currency bridge scanAccounts stellar seed 1 1`] = `
34
34
  "spendableBalance": "79999760",
35
35
  "subAccounts": [],
36
36
  "swapHistory": [],
37
- "syncHash": undefined,
37
+ "syncHash": "0x1431ef5f",
38
38
  "used": true,
39
39
  "xpub": "GAIXIJBMYPTSF2CDVQ35WOTULCLZIE4W2SDEK3RQGAA3A22BPWY7R53Z",
40
40
  },
@@ -52,7 +52,7 @@ exports[`stellar currency bridge scanAccounts stellar seed 1 1`] = `
52
52
  "spendableBalance": "44999262",
53
53
  "subAccounts": [],
54
54
  "swapHistory": [],
55
- "syncHash": undefined,
55
+ "syncHash": "0x1431ef5f",
56
56
  "used": true,
57
57
  "xpub": "GCDDN6T2LJN3T7SPWJQV6BCCL5KNY5GBN7X4CMSZLDEXDHXAH32TOAHS",
58
58
  },
@@ -70,7 +70,7 @@ exports[`stellar currency bridge scanAccounts stellar seed 1 1`] = `
70
70
  "spendableBalance": "10145721",
71
71
  "subAccounts": [],
72
72
  "swapHistory": [],
73
- "syncHash": undefined,
73
+ "syncHash": "0x1431ef5f",
74
74
  "used": true,
75
75
  "xpub": "GAHQKL7UW5DSNJXWNA4ASJ6D2I7JYFWVHDFWYJZK3WDR4BUTG27K2PWC",
76
76
  },
@@ -88,7 +88,7 @@ exports[`stellar currency bridge scanAccounts stellar seed 1 1`] = `
88
88
  "spendableBalance": "0",
89
89
  "subAccounts": [],
90
90
  "swapHistory": [],
91
- "syncHash": undefined,
91
+ "syncHash": "0x1431ef5f",
92
92
  "used": true,
93
93
  "xpub": "GBQMOU2WYJUP6AKY53FFKZJGQMDWCMTWSOUTZ5DVIAQPVW7AJUHSX2M5",
94
94
  },
@@ -106,7 +106,7 @@ exports[`stellar currency bridge scanAccounts stellar seed 1 1`] = `
106
106
  "spendableBalance": "0",
107
107
  "subAccounts": [],
108
108
  "swapHistory": [],
109
- "syncHash": undefined,
109
+ "syncHash": "0x1431ef5f",
110
110
  "used": false,
111
111
  "xpub": "GAJEKFXY76YWDSKJESDOKS2EGKRMCHSIC5AU32SU7OF54E5VVREUHXLH",
112
112
  },
@@ -690,7 +690,7 @@ exports[`stellar currency bridge scanAccounts stellar seed 1 2`] = `
690
690
  ],
691
691
  "transactionSequenceNumber": "251606365385008908",
692
692
  "type": "IN",
693
- "value": "0",
693
+ "value": "10000",
694
694
  },
695
695
  {
696
696
  "accountId": "js:2:stellar:GAT4LBXYJGJJJRSNK74NPFLO55CDDXSYVMQODSEAAH3M6EY4S7LPH5GV:sep5",
@@ -764,6 +764,30 @@ exports[`stellar currency bridge scanAccounts stellar seed 1 2`] = `
764
764
  "type": "IN",
765
765
  "value": "1",
766
766
  },
767
+ {
768
+ "accountId": "js:2:stellar:GAT4LBXYJGJJJRSNK74NPFLO55CDDXSYVMQODSEAAH3M6EY4S7LPH5GV:sep5",
769
+ "blockHash": "0d4b1748aeb13c64f001d9b486054744d5e8521081ce6d21dc9acbb2a1c0a171",
770
+ "blockHeight": 59792876,
771
+ "extra": {
772
+ "memo": {
773
+ "type": "MEMO_TEXT",
774
+ "value": "Own VTX & Start Earning XLM!",
775
+ },
776
+ },
777
+ "fee": "10000",
778
+ "hasFailed": false,
779
+ "hash": "277aa9d93c6674951b4cc198a25ee1d5726d686f459d957a9bf4b40b0b66ffb6",
780
+ "id": "js:2:stellar:GAT4LBXYJGJJJRSNK74NPFLO55CDDXSYVMQODSEAAH3M6EY4S7LPH5GV:sep5-277aa9d93c6674951b4cc198a25ee1d5726d686f459d957a9bf4b40b0b66ffb6-IN",
781
+ "recipients": [
782
+ "GAT4LBXYJGJJJRSNK74NPFLO55CDDXSYVMQODSEAAH3M6EY4S7LPH5GV",
783
+ ],
784
+ "senders": [
785
+ "GDM2UBYCTDJ7LBBNLWU5XTNNIR6GIQW7KXJTPBWOTMFECHF5YJAE3JTH",
786
+ ],
787
+ "transactionSequenceNumber": "256741054621943059",
788
+ "type": "IN",
789
+ "value": "1",
790
+ },
767
791
  {
768
792
  "accountId": "js:2:stellar:GAT4LBXYJGJJJRSNK74NPFLO55CDDXSYVMQODSEAAH3M6EY4S7LPH5GV:sep5",
769
793
  "blockHash": "d43eb458fb93eb861373fbe61743bdc51800bf41eaeff2fd2b6a2b001254044b",
@@ -1676,6 +1700,30 @@ exports[`stellar currency bridge scanAccounts stellar seed 1 2`] = `
1676
1700
  "type": "IN",
1677
1701
  "value": "1",
1678
1702
  },
1703
+ {
1704
+ "accountId": "js:2:stellar:GAT4LBXYJGJJJRSNK74NPFLO55CDDXSYVMQODSEAAH3M6EY4S7LPH5GV:sep5",
1705
+ "blockHash": "70caf48d48b190098064b972f0142dfa3549adbc4893021d5d002df3c7a6c9b0",
1706
+ "blockHeight": 59745989,
1707
+ "extra": {
1708
+ "memo": {
1709
+ "type": "MEMO_TEXT",
1710
+ "value": "Buy XRVT Earn fchain.io XRP!",
1711
+ },
1712
+ },
1713
+ "fee": "10000",
1714
+ "hasFailed": false,
1715
+ "hash": "6db88bc812940527d1387217bd4574cdac5bf3857efe72e0c1aec661b5c4a90f",
1716
+ "id": "js:2:stellar:GAT4LBXYJGJJJRSNK74NPFLO55CDDXSYVMQODSEAAH3M6EY4S7LPH5GV:sep5-6db88bc812940527d1387217bd4574cdac5bf3857efe72e0c1aec661b5c4a90f-IN",
1717
+ "recipients": [
1718
+ "GAT4LBXYJGJJJRSNK74NPFLO55CDDXSYVMQODSEAAH3M6EY4S7LPH5GV",
1719
+ ],
1720
+ "senders": [
1721
+ "GD7NZ4LUIJPEIWM3UY4IW5HMV3WV3PRVM5CPSILLBUIG5YFNNCCTZXJL",
1722
+ ],
1723
+ "transactionSequenceNumber": "256247545699769514",
1724
+ "type": "IN",
1725
+ "value": "1",
1726
+ },
1679
1727
  {
1680
1728
  "accountId": "js:2:stellar:GAT4LBXYJGJJJRSNK74NPFLO55CDDXSYVMQODSEAAH3M6EY4S7LPH5GV:sep5",
1681
1729
  "blockHash": "d36bfe52924033397bdb89574feb1d4bdf2f063420d204c54d3cf7b829bd571f",
@@ -3068,6 +3116,30 @@ exports[`stellar currency bridge scanAccounts stellar seed 1 2`] = `
3068
3116
  "type": "IN",
3069
3117
  "value": "1",
3070
3118
  },
3119
+ {
3120
+ "accountId": "js:2:stellar:GAT4LBXYJGJJJRSNK74NPFLO55CDDXSYVMQODSEAAH3M6EY4S7LPH5GV:sep5",
3121
+ "blockHash": "e70f311ceddcb90dd9853589896e4dedfe9d57dcdc130cf62a1c5e8564b24b7b",
3122
+ "blockHeight": 59761051,
3123
+ "extra": {
3124
+ "memo": {
3125
+ "type": "MEMO_TEXT",
3126
+ "value": "Buy XRVT Earn fchain.io XRP!",
3127
+ },
3128
+ },
3129
+ "fee": "10000",
3130
+ "hasFailed": false,
3131
+ "hash": "c911e6f578b4d869a71ea7e8cd139c5a885d996d2f15e63c63b31db10e42f415",
3132
+ "id": "js:2:stellar:GAT4LBXYJGJJJRSNK74NPFLO55CDDXSYVMQODSEAAH3M6EY4S7LPH5GV:sep5-c911e6f578b4d869a71ea7e8cd139c5a885d996d2f15e63c63b31db10e42f415-IN",
3133
+ "recipients": [
3134
+ "GAT4LBXYJGJJJRSNK74NPFLO55CDDXSYVMQODSEAAH3M6EY4S7LPH5GV",
3135
+ ],
3136
+ "senders": [
3137
+ "GD7NZ4LUIJPEIWM3UY4IW5HMV3WV3PRVM5CPSILLBUIG5YFNNCCTZXJL",
3138
+ ],
3139
+ "transactionSequenceNumber": "256247545699771532",
3140
+ "type": "IN",
3141
+ "value": "1",
3142
+ },
3071
3143
  {
3072
3144
  "accountId": "js:2:stellar:GAT4LBXYJGJJJRSNK74NPFLO55CDDXSYVMQODSEAAH3M6EY4S7LPH5GV:sep5",
3073
3145
  "blockHash": "6eb78e902ecc290b25216c0afae3a354b9b3bf723510c8aa3162f801635b0f35",
@@ -5283,7 +5355,7 @@ exports[`stellar currency bridge scanAccounts stellar seed 1 2`] = `
5283
5355
  ],
5284
5356
  "transactionSequenceNumber": "119784086674866178",
5285
5357
  "type": "OUT",
5286
- "value": "200",
5358
+ "value": "100",
5287
5359
  },
5288
5360
  {
5289
5361
  "accountId": "js:2:stellar:GCDDN6T2LJN3T7SPWJQV6BCCL5KNY5GBN7X4CMSZLDEXDHXAH32TOAHS:sep5",
@@ -5798,7 +5870,7 @@ exports[`stellar currency bridge scanAccounts stellar seed 1 2`] = `
5798
5870
  ],
5799
5871
  "transactionSequenceNumber": "119784086674866178",
5800
5872
  "type": "IN",
5801
- "value": "0",
5873
+ "value": "100",
5802
5874
  },
5803
5875
  {
5804
5876
  "accountId": "js:2:stellar:GAHQKL7UW5DSNJXWNA4ASJ6D2I7JYFWVHDFWYJZK3WDR4BUTG27K2PWC:sep5",
@@ -468,12 +468,13 @@ export const createAction = (
468
468
  );
469
469
 
470
470
  const task: (arg0: ConnectAppInput) => Observable<ConnectAppEvent> = useCallback(
471
- ({ deviceId, request }: ConnectAppInput) => {
471
+ ({ deviceId, deviceName, request }: ConnectAppInput) => {
472
472
  //To avoid redundant checks, we remove passed checks from the request.
473
473
  const { dependencies, requireLatestFirmware } = request;
474
474
 
475
475
  return connectAppExec({
476
476
  deviceId,
477
+ deviceName,
477
478
  request: {
478
479
  ...request,
479
480
  dependencies: dependenciesResolvedRef.current ? undefined : dependencies,
@@ -37,7 +37,7 @@ type ActionState = State & {
37
37
  onRetry: () => void;
38
38
  };
39
39
 
40
- type LoadImageAction = Action<LoadImageRequest, ActionState, LoadimageResult>;
40
+ type LoadImageAction = Action<LoadImageRequest | undefined, ActionState, LoadimageResult>;
41
41
 
42
42
  const mapResult = ({ imageHash, imageSize }: State) => ({
43
43
  imageHash,
@@ -131,12 +131,16 @@ export const reducer = (state: State, e: Event): State => {
131
131
  export const createAction = (
132
132
  task: (arg0: LoadImageInput) => Observable<LoadImageEvent>,
133
133
  ): LoadImageAction => {
134
- const useHook = (device: Device | null | undefined, request: LoadImageRequest): ActionState => {
134
+ const useHook = (
135
+ device: Device | null | undefined,
136
+ request: LoadImageRequest | undefined,
137
+ ): ActionState => {
135
138
  const [state, setState] = useState(() => getInitialState(device));
136
139
  const [resetIndex, setResetIndex] = useState(0);
137
140
  const deviceSubject = useReplaySubject(device);
138
141
 
139
142
  useEffect(() => {
143
+ if (!request) return;
140
144
  if (state.imageLoaded) return;
141
145
 
142
146
  const impl = getImplementation(currentMode)<LoadImageEvent, LoadImageRequest>({
@@ -50,7 +50,11 @@ type PollingImplementationConfig = {
50
50
 
51
51
  type PollingImplementationParams<Request, EmittedEvents> = {
52
52
  deviceSubject: ReplaySubject<Device | null | undefined>;
53
- task: (params: { deviceId: string; request: Request }) => Observable<EmittedEvents>;
53
+ task: (params: {
54
+ deviceId: string;
55
+ deviceName: string | null;
56
+ request: Request;
57
+ }) => Observable<EmittedEvents>;
54
58
  request: Request;
55
59
  config?: PollingImplementationConfig;
56
60
  // retryableWithDelayDisconnectedErrors has default value of [DisconnectedDevice, DisconnectedDeviceDuringOperation]
@@ -137,7 +141,11 @@ const pollingImplementation: Implementation = <SpecificType, GenericRequestType>
137
141
  device: currentDevice,
138
142
  replaceable: !firstRound,
139
143
  }),
140
- task({ deviceId: currentDevice.deviceId, request }),
144
+ task({
145
+ deviceId: currentDevice.deviceId,
146
+ deviceName: currentDevice.deviceName ?? null,
147
+ request,
148
+ }),
141
149
  )
142
150
  .pipe(
143
151
  // Any event should clear the initialTimeout.
@@ -241,7 +249,13 @@ const eventImplementation: Implementation = <SpecificType, GenericRequestType>(
241
249
 
242
250
  return concat(
243
251
  initialEvent,
244
- !device ? EMPTY : task({ deviceId: device.deviceId, request }),
252
+ device
253
+ ? task({
254
+ deviceId: device.deviceId,
255
+ deviceName: device.deviceName ?? null,
256
+ request,
257
+ })
258
+ : EMPTY,
245
259
  );
246
260
  }),
247
261
  catchError((error: Error) =>
@@ -48,6 +48,7 @@ export type RequiresDerivation = {
48
48
  };
49
49
  export type Input = {
50
50
  deviceId: string;
51
+ deviceName: string | null;
51
52
  request: ConnectAppRequest;
52
53
  };
53
54
  export type ConnectAppRequest = {
@@ -524,10 +525,13 @@ export default function connectAppFactory(
524
525
  } = { isLdmkConnectAppEnabled: false },
525
526
  ) {
526
527
  if (!isLdmkConnectAppEnabled) {
527
- return ({ deviceId, request }: Input): Observable<ConnectAppEvent> =>
528
- withDevice(deviceId)(transport => cmd(transport, { deviceId, request }));
528
+ return ({ deviceId, deviceName, request }: Input): Observable<ConnectAppEvent> =>
529
+ withDevice(
530
+ deviceId,
531
+ deviceName ? { matchDeviceByName: deviceName } : undefined,
532
+ )(transport => cmd(transport, { deviceId, deviceName, request }));
529
533
  }
530
- return ({ deviceId, request }: Input): Observable<ConnectAppEvent> => {
534
+ return ({ deviceId, deviceName, request }: Input): Observable<ConnectAppEvent> => {
531
535
  const {
532
536
  appName,
533
537
  requiresDerivation,
@@ -535,9 +539,12 @@ export default function connectAppFactory(
535
539
  requireLatestFirmware,
536
540
  allowPartialDependencies = false,
537
541
  } = request;
538
- return withDevice(deviceId)(transport => {
542
+ return withDevice(
543
+ deviceId,
544
+ deviceName ? { matchDeviceByName: deviceName } : undefined,
545
+ )(transport => {
539
546
  if (!isDmkTransport(transport)) {
540
- return cmd(transport, { deviceId, request });
547
+ return cmd(transport, { deviceId, deviceName, request });
541
548
  }
542
549
  const { dmk, sessionId } = transport;
543
550
  const deviceAction = new ConnectAppDeviceAction({
@@ -27,6 +27,7 @@ import { extractOnboardingState, OnboardingStep } from "./extractOnboardingState
27
27
 
28
28
  export type Input = {
29
29
  deviceId: string;
30
+ deviceName: string | null;
30
31
  request: ManagerRequest | null | undefined;
31
32
  };
32
33
 
@@ -159,13 +160,19 @@ export default function connectManagerFactory(
159
160
  } = { isLdmkConnectAppEnabled: false },
160
161
  ) {
161
162
  if (!isLdmkConnectAppEnabled) {
162
- return ({ deviceId, request }: Input): Observable<ConnectManagerEvent> =>
163
- withDevice(deviceId)(transport => cmd(transport, { deviceId, request }));
163
+ return ({ deviceId, deviceName, request }: Input): Observable<ConnectManagerEvent> =>
164
+ withDevice(
165
+ deviceId,
166
+ deviceName ? { matchDeviceByName: deviceName } : undefined,
167
+ )(transport => cmd(transport, { deviceId, deviceName, request }));
164
168
  }
165
- return ({ deviceId, request }: Input): Observable<ConnectManagerEvent> =>
166
- withDevice(deviceId)(transport => {
169
+ return ({ deviceId, deviceName, request }: Input): Observable<ConnectManagerEvent> =>
170
+ withDevice(
171
+ deviceId,
172
+ deviceName ? { matchDeviceByName: deviceName } : undefined,
173
+ )(transport => {
167
174
  if (!isDmkTransport(transport)) {
168
- return cmd(transport, { deviceId, request });
175
+ return cmd(transport, { deviceId, deviceName, request });
169
176
  }
170
177
  const { dmk, sessionId } = transport;
171
178
  const deviceAction = new PrepareConnectManagerDeviceAction({
@@ -179,6 +186,6 @@ export default function connectManagerFactory(
179
186
  });
180
187
  return new PrepareConnectManagerEventMapper(observable)
181
188
  .map()
182
- .pipe(concatWith(cmd(transport, { deviceId, request })));
189
+ .pipe(concatWith(cmd(transport, { deviceId, deviceName, request })));
183
190
  });
184
191
  }
@@ -47,13 +47,21 @@ export type FetchImageRequest = {
47
47
 
48
48
  export type Input = {
49
49
  deviceId: string;
50
+ deviceName: string | null;
50
51
  request: FetchImageRequest;
51
52
  };
52
53
 
53
- export default function fetchImage({ deviceId, request }: Input): Observable<FetchImageEvent> {
54
+ export default function fetchImage({
55
+ deviceId,
56
+ deviceName,
57
+ request,
58
+ }: Input): Observable<FetchImageEvent> {
54
59
  const { backupHash, allowedEmpty = false, deviceModelId } = request;
55
60
 
56
- const sub = withDevice(deviceId)(
61
+ const sub = withDevice(
62
+ deviceId,
63
+ deviceName ? { matchDeviceByName: deviceName } : undefined,
64
+ )(
57
65
  transport =>
58
66
  new Observable(subscriber => {
59
67
  const timeoutSub = of<FetchImageEvent>({
@@ -9,8 +9,12 @@ const mockTransport = {
9
9
  send: jest.fn(),
10
10
  getTraceContext: jest.fn(),
11
11
  };
12
+ const mockWithTransport = jest.fn(
13
+ (_deviceId: string, _options?: any) => callback =>
14
+ callback({ transportRef: { current: mockTransport } }),
15
+ );
12
16
  jest.mock("../deviceSDK/transports/core", () => ({
13
- withTransport: () => callback => callback({ transportRef: { current: mockTransport } }),
17
+ withTransport: (deviceId: string, options?: any) => mockWithTransport(deviceId, options),
14
18
  }));
15
19
  jest.mock("./getDeviceInfo", () => jest.fn(() => of([])));
16
20
 
@@ -24,7 +28,9 @@ describe("customLockScreenLoad", () => {
24
28
  mockTransport.send.mockResolvedValue(Buffer.from([0x42, 0x42, 0x43, 0x90, 0x00]));
25
29
 
26
30
  // when
27
- const ret = await lastValueFrom(await customLockScreenLoad({ deviceId: "deviceId", request }));
31
+ const ret = await lastValueFrom(
32
+ await customLockScreenLoad({ deviceId: "deviceId", deviceName: null, request }),
33
+ );
28
34
 
29
35
  // then
30
36
  expect(mockTransport.send).toHaveBeenNthCalledWith(
@@ -78,9 +84,28 @@ describe("customLockScreenLoad", () => {
78
84
 
79
85
  // when
80
86
  try {
81
- await lastValueFrom(await customLockScreenLoad({ deviceId: "nanoX", request }));
87
+ await lastValueFrom(
88
+ await customLockScreenLoad({ deviceId: "nanoX", deviceName: null, request }),
89
+ );
82
90
  } catch (err) {
83
91
  expect(err).toStrictEqual(error);
84
92
  }
85
93
  });
94
+
95
+ it("should pass deviceName to withTransport", async () => {
96
+ const request = {
97
+ deviceModelId: DeviceModelId.stax as CLSSupportedDeviceModelId,
98
+ hexImage: "hello_world",
99
+ };
100
+ mockTransport.send.mockResolvedValue(Buffer.from([0x42, 0x42, 0x43, 0x90, 0x00]));
101
+
102
+ await lastValueFrom(
103
+ await customLockScreenLoad({ deviceId: "deviceId", deviceName: "My Device", request }),
104
+ );
105
+
106
+ expect(mockWithTransport).toHaveBeenCalledWith(
107
+ "deviceId",
108
+ expect.objectContaining({ matchDeviceByName: "My Device" }),
109
+ );
110
+ });
86
111
  });
@@ -68,14 +68,22 @@ export type LoadImageRequest = {
68
68
 
69
69
  export type Input = {
70
70
  deviceId: string;
71
+ deviceName: string | null;
71
72
  request: LoadImageRequest;
72
73
  };
73
74
 
74
- export default function loadImage({ deviceId, request }: Input): Observable<LoadImageEvent> {
75
+ export default function loadImage({
76
+ deviceId,
77
+ deviceName,
78
+ request,
79
+ }: Input): Observable<LoadImageEvent> {
75
80
  const { hexImage, padImage = true, deviceModelId } = request;
76
81
  const screenSpecs = getScreenSpecs(deviceModelId);
77
82
 
78
- const sub = withTransport(deviceId)(
83
+ const sub = withTransport(
84
+ deviceId,
85
+ deviceName ? { matchDeviceByName: deviceName } : undefined,
86
+ )(
79
87
  ({ transportRef }) =>
80
88
  new Observable(subscriber => {
81
89
  const timeoutSub = of<LoadImageEvent>({ type: "unresponsiveDevice" })
@@ -17,7 +17,7 @@ import {
17
17
  } from "@ledgerhq/errors";
18
18
  import { LocalTracer, TraceContext, trace } from "@ledgerhq/logs";
19
19
  import { getEnv } from "@ledgerhq/live-env";
20
- import { open, close } from ".";
20
+ import { open, close, OpenOptions } from ".";
21
21
 
22
22
  const LOG_TYPE = "hw";
23
23
 
@@ -172,9 +172,10 @@ export class DeviceQueuedJobsManager {
172
172
  * @param deviceId
173
173
  * @param options contains optional configuration
174
174
  * - openTimeoutMs: optional timeout that limits in time the open attempt of the matching registered transport.
175
+ * - matchDeviceByName: optional name of the device to match.
175
176
  */
176
177
  export const withDevice =
177
- (deviceId: string, options?: { openTimeoutMs?: number }) =>
178
+ (deviceId: string, options?: OpenOptions) =>
178
179
  <T>(job: (t: Transport) => Observable<T>): Observable<T> =>
179
180
  new Observable(o => {
180
181
  const queuedJobManager = DeviceQueuedJobsManager.getInstance();
@@ -221,7 +222,7 @@ export const withDevice =
221
222
  previousJobId: previousQueuedJob.id,
222
223
  currentJobId: jobId,
223
224
  });
224
- return open(deviceId, options?.openTimeoutMs, tracer.getContext());
225
+ return open(deviceId, options, tracer.getContext());
225
226
  }) // open the transport
226
227
  .then(async transport => {
227
228
  tracer.trace("Got a Transport instance from open");
@@ -85,6 +85,7 @@ describe("getGenuineCheckFromDeviceId", () => {
85
85
  let step = 1;
86
86
  getGenuineCheckFromDeviceId({
87
87
  deviceId: "A_DEVICE_ID",
88
+ deviceName: null,
88
89
  lockedDeviceTimeoutMs: 1000,
89
90
  }).subscribe({
90
91
  next: ({ socketEvent, lockedDevice }: GetGenuineCheckFromDeviceIdResult) => {
@@ -147,6 +148,7 @@ describe("getGenuineCheckFromDeviceId", () => {
147
148
  let step = 1;
148
149
  getGenuineCheckFromDeviceId({
149
150
  deviceId: "A_DEVICE_ID",
151
+ deviceName: null,
150
152
  lockedDeviceTimeoutMs: 1000,
151
153
  }).subscribe({
152
154
  next: ({ socketEvent, lockedDevice }: GetGenuineCheckFromDeviceIdResult) => {
@@ -227,6 +229,7 @@ describe("getGenuineCheckFromDeviceId", () => {
227
229
  let step = 1;
228
230
  const subscriber = getGenuineCheckFromDeviceId({
229
231
  deviceId: "A_DEVICE_ID",
232
+ deviceName: null,
230
233
  lockedDeviceTimeoutMs: 1000,
231
234
  }).subscribe({
232
235
  next: ({ socketEvent, lockedDevice }: GetGenuineCheckFromDeviceIdResult) => {
@@ -286,6 +289,7 @@ describe("getGenuineCheckFromDeviceId", () => {
286
289
  let step = 1;
287
290
  getGenuineCheckFromDeviceId({
288
291
  deviceId: "A_DEVICE_ID",
292
+ deviceName: null,
289
293
  lockedDeviceTimeoutMs: 1000,
290
294
  }).subscribe({
291
295
  next: ({ socketEvent, lockedDevice }: GetGenuineCheckFromDeviceIdResult) => {
@@ -8,6 +8,7 @@ import genuineCheck from "./genuineCheck";
8
8
 
9
9
  export type GetGenuineCheckFromDeviceIdArgs = {
10
10
  deviceId: string;
11
+ deviceName: string | null;
11
12
  lockedDeviceTimeoutMs?: number;
12
13
  };
13
14
 
@@ -29,6 +30,7 @@ export type GetGenuineCheckFromDeviceIdOutput = Observable<GetGenuineCheckFromDe
29
30
  */
30
31
  export const getGenuineCheckFromDeviceId = ({
31
32
  deviceId,
33
+ deviceName,
32
34
  lockedDeviceTimeoutMs = 1000,
33
35
  }: GetGenuineCheckFromDeviceIdArgs): GetGenuineCheckFromDeviceIdOutput => {
34
36
  return new Observable(subscriber => {
@@ -42,7 +44,10 @@ export const getGenuineCheckFromDeviceId = ({
42
44
 
43
45
  // Returns a Subscription that can be unsubscribed/cleaned
44
46
  return (
45
- withDevice(deviceId)(t =>
47
+ withDevice(
48
+ deviceId,
49
+ deviceName ? { matchDeviceByName: deviceName } : undefined,
50
+ )(t =>
46
51
  from(getDeviceInfo(t)).pipe(
47
52
  mergeMap(deviceInfo => {
48
53
  clearTimeout(lockedDeviceTimeout);