@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
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ledgerhq/live-common",
3
3
  "description": "Common ground for the Ledger Live apps",
4
- "version": "34.53.0-nightly.20251115023630",
4
+ "version": "34.53.0-nightly.20251119023741",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/LedgerHQ/ledger-live.git"
@@ -109,9 +109,9 @@
109
109
  "@cardano-foundation/ledgerjs-hw-app-cardano": "^7.1.2",
110
110
  "@ledgerhq/device-management-kit": "0.11.1",
111
111
  "@ledgerhq/live-app-sdk": "^0.8.1",
112
- "@ledgerhq/wallet-api-client": "^1.12.3",
113
- "@ledgerhq/wallet-api-core": "^1.25.0",
114
- "@ledgerhq/wallet-api-server": "^1.13.3",
112
+ "@ledgerhq/wallet-api-client": "^1.12.5",
113
+ "@ledgerhq/wallet-api-core": "^1.26.1",
114
+ "@ledgerhq/wallet-api-server": "^2.0.0",
115
115
  "@noble/curves": "^1.9.7",
116
116
  "@noble/hashes": "1.8.0",
117
117
  "@reduxjs/toolkit": "2.8.2",
@@ -155,6 +155,7 @@
155
155
  "performance-now": "^2.1.0",
156
156
  "prando": "^6.0.1",
157
157
  "qs": "^6.10.1",
158
+ "react-redux": "7.2.9",
158
159
  "reselect": "^4.1.5",
159
160
  "rlp": "^3.0.0",
160
161
  "rxjs": "^7.8.1",
@@ -167,46 +168,45 @@
167
168
  "xstate": "^5.19.2",
168
169
  "yargs": "^17.0.0",
169
170
  "zod": "^3.22.4",
170
- "react-redux": "7.2.9",
171
- "@ledgerhq/coin-algorand": "^0.13.0-nightly.20251115023630",
172
- "@ledgerhq/coin-aptos": "^3.6.0-nightly.20251115023630",
173
- "@ledgerhq/coin-bitcoin": "^0.25.0-nightly.20251115023630",
174
- "@ledgerhq/coin-canton": "^0.10.0-nightly.20251115023630",
175
- "@ledgerhq/coin-cardano": "^0.15.0-nightly.20251115023630",
176
- "@ledgerhq/coin-casper": "^2.3.1-nightly.20251115023630",
177
- "@ledgerhq/coin-celo": "^1.7.1-nightly.20251115023630",
178
- "@ledgerhq/coin-cosmos": "^0.20.0-nightly.20251115023630",
179
- "@ledgerhq/coin-filecoin": "^1.15.0-nightly.20251115023630",
180
- "@ledgerhq/coin-evm": "^2.35.0-nightly.20251115023630",
181
- "@ledgerhq/coin-framework": "^6.9.0-nightly.20251115023630",
182
- "@ledgerhq/coin-hedera": "^1.14.0-nightly.20251115023630",
183
- "@ledgerhq/coin-icon": "^0.15.0-nightly.20251115023630",
184
- "@ledgerhq/coin-kaspa": "^1.4.1-nightly.20251115023630",
185
- "@ledgerhq/coin-mina": "^1.4.1-nightly.20251115023630",
186
- "@ledgerhq/coin-multiversx": "^0.8.0-nightly.20251115023630",
187
- "@ledgerhq/coin-internet_computer": "^1.10.1-nightly.20251115023630",
188
- "@ledgerhq/coin-near": "^0.16.0-nightly.20251115023630",
189
- "@ledgerhq/coin-polkadot": "^6.13.0-nightly.20251115023630",
190
- "@ledgerhq/coin-solana": "^0.37.0-nightly.20251115023630",
191
- "@ledgerhq/coin-stacks": "^0.12.0-nightly.20251115023630",
192
- "@ledgerhq/coin-stellar": "^6.7.0-nightly.20251115023630",
193
- "@ledgerhq/coin-sui": "^0.18.0-nightly.20251115023630",
194
- "@ledgerhq/coin-tezos": "^6.9.0-nightly.20251115023630",
195
- "@ledgerhq/coin-ton": "^0.17.0-nightly.20251115023630",
196
- "@ledgerhq/coin-tron": "^5.7.0-nightly.20251115023630",
197
- "@ledgerhq/coin-vechain": "^2.12.1-nightly.20251115023630",
198
- "@ledgerhq/coin-xrp": "^7.8.0-nightly.20251115023630",
199
- "@ledgerhq/cryptoassets": "^13.33.0-nightly.20251115023630",
200
- "@ledgerhq/device-core": "^0.6.8-nightly.20251115023630",
171
+ "@ledgerhq/coin-algorand": "^0.13.0-nightly.20251119023741",
172
+ "@ledgerhq/coin-aptos": "^3.6.0-nightly.20251119023741",
173
+ "@ledgerhq/coin-bitcoin": "^0.25.0-nightly.20251119023741",
174
+ "@ledgerhq/coin-canton": "^0.10.0-nightly.20251119023741",
175
+ "@ledgerhq/coin-cardano": "^0.15.0-nightly.20251119023741",
176
+ "@ledgerhq/coin-casper": "^2.3.1-nightly.20251119023741",
177
+ "@ledgerhq/coin-celo": "^1.7.1-nightly.20251119023741",
178
+ "@ledgerhq/coin-cosmos": "^0.20.0-nightly.20251119023741",
179
+ "@ledgerhq/coin-evm": "^2.35.0-nightly.20251119023741",
180
+ "@ledgerhq/coin-filecoin": "^1.15.0-nightly.20251119023741",
181
+ "@ledgerhq/coin-framework": "^6.9.0-nightly.20251119023741",
182
+ "@ledgerhq/coin-hedera": "^1.14.0-nightly.20251119023741",
183
+ "@ledgerhq/coin-icon": "^0.15.0-nightly.20251119023741",
184
+ "@ledgerhq/coin-internet_computer": "^1.10.1-nightly.20251119023741",
185
+ "@ledgerhq/coin-kaspa": "^1.4.1-nightly.20251119023741",
186
+ "@ledgerhq/coin-mina": "^1.4.1-nightly.20251119023741",
187
+ "@ledgerhq/coin-multiversx": "^0.8.0-nightly.20251119023741",
188
+ "@ledgerhq/coin-near": "^0.16.0-nightly.20251119023741",
189
+ "@ledgerhq/coin-polkadot": "^6.13.0-nightly.20251119023741",
190
+ "@ledgerhq/coin-solana": "^0.37.0-nightly.20251119023741",
191
+ "@ledgerhq/coin-stacks": "^0.12.0-nightly.20251119023741",
192
+ "@ledgerhq/coin-stellar": "^6.7.0-nightly.20251119023741",
193
+ "@ledgerhq/coin-sui": "^0.18.0-nightly.20251119023741",
194
+ "@ledgerhq/coin-tezos": "^6.9.0-nightly.20251119023741",
195
+ "@ledgerhq/coin-ton": "^0.17.0-nightly.20251119023741",
196
+ "@ledgerhq/coin-tron": "^5.7.0-nightly.20251119023741",
197
+ "@ledgerhq/coin-vechain": "^2.12.1-nightly.20251119023741",
198
+ "@ledgerhq/coin-xrp": "^7.8.0-nightly.20251119023741",
199
+ "@ledgerhq/crypto-icons-ui": "^1.23.0-nightly.20251119023741",
200
+ "@ledgerhq/cryptoassets": "^13.33.0-nightly.20251119023741",
201
+ "@ledgerhq/device-core": "^0.6.8-nightly.20251119023741",
201
202
  "@ledgerhq/devices": "8.7.0",
202
- "@ledgerhq/crypto-icons-ui": "^1.23.0-nightly.20251115023630",
203
203
  "@ledgerhq/errors": "^6.27.0",
204
204
  "@ledgerhq/hw-app-algorand": "^6.31.9",
205
205
  "@ledgerhq/hw-app-aptos": "^6.34.9",
206
206
  "@ledgerhq/hw-app-btc": "^10.12.0",
207
- "@ledgerhq/hw-app-celo": "^6.35.3-nightly.20251115023630",
207
+ "@ledgerhq/hw-app-celo": "^6.35.3-nightly.20251119023741",
208
208
  "@ledgerhq/hw-app-cosmos": "^6.32.9",
209
- "@ledgerhq/hw-app-eth": "^6.47.1-nightly.20251115023630",
209
+ "@ledgerhq/hw-app-eth": "^6.47.1-nightly.20251119023741",
210
210
  "@ledgerhq/hw-app-exchange": "^0.17.0",
211
211
  "@ledgerhq/hw-app-hedera": "^1.2.9",
212
212
  "@ledgerhq/hw-app-icon": "^1.3.9",
@@ -218,29 +218,29 @@
218
218
  "@ledgerhq/hw-app-sui": "^1.4.0",
219
219
  "@ledgerhq/hw-app-tezos": "^6.31.9",
220
220
  "@ledgerhq/hw-app-trx": "^6.31.9",
221
- "@ledgerhq/hw-app-vet": "^0.7.0",
221
+ "@ledgerhq/hw-app-vet": "^0.8.0-nightly.20251119023741",
222
222
  "@ledgerhq/hw-app-xrp": "^6.32.7",
223
223
  "@ledgerhq/hw-bolos": "^6.32.9",
224
224
  "@ledgerhq/hw-transport": "6.31.13",
225
225
  "@ledgerhq/hw-transport-mocker": "^6.29.13",
226
- "@ledgerhq/ledger-cal-service": "^1.9.0-nightly.20251115023630",
227
- "@ledgerhq/ledger-trust-service": "^0.4.2-nightly.20251115023630",
228
- "@ledgerhq/live-countervalues": "^0.10.0-nightly.20251115023630",
226
+ "@ledgerhq/ledger-cal-service": "^1.9.0-nightly.20251119023741",
227
+ "@ledgerhq/ledger-trust-service": "^0.4.2-nightly.20251119023741",
229
228
  "@ledgerhq/live-config": "^3.2.0",
230
- "@ledgerhq/live-countervalues-react": "^0.7.2-nightly.20251115023630",
229
+ "@ledgerhq/live-countervalues": "^0.10.0-nightly.20251119023741",
230
+ "@ledgerhq/live-countervalues-react": "^0.7.2-nightly.20251119023741",
231
231
  "@ledgerhq/live-dmk-shared": "^0.15.0",
232
- "@ledgerhq/live-env": "^2.21.0-nightly.20251115023630",
232
+ "@ledgerhq/live-env": "^2.21.0-nightly.20251119023741",
233
233
  "@ledgerhq/live-hooks": "0.2.0",
234
- "@ledgerhq/live-network": "^2.1.1-nightly.20251115023630",
235
- "@ledgerhq/live-signer-canton": "^0.5.1-nightly.20251115023630",
234
+ "@ledgerhq/live-network": "^2.1.1-nightly.20251119023741",
236
235
  "@ledgerhq/live-promise": "^0.1.1",
237
- "@ledgerhq/live-signer-evm": "^0.10.1-nightly.20251115023630",
238
- "@ledgerhq/live-signer-solana": "^0.6.1-nightly.20251115023630",
239
- "@ledgerhq/live-wallet": "^0.16.0-nightly.20251115023630",
236
+ "@ledgerhq/live-signer-canton": "^0.5.1-nightly.20251119023741",
237
+ "@ledgerhq/live-signer-evm": "^0.10.1-nightly.20251119023741",
238
+ "@ledgerhq/live-signer-solana": "^0.6.1-nightly.20251119023741",
239
+ "@ledgerhq/live-wallet": "^0.16.0-nightly.20251119023741",
240
240
  "@ledgerhq/logs": "^6.13.0",
241
- "@ledgerhq/speculos-transport": "^0.2.15-nightly.20251115023630",
242
- "@ledgerhq/wallet-api-acre-module": "^0.9.0",
243
- "@ledgerhq/wallet-api-exchange-module": "^0.18.0"
241
+ "@ledgerhq/speculos-transport": "^0.2.15-nightly.20251119023741",
242
+ "@ledgerhq/wallet-api-acre-module": "^0.10.0-nightly.20251119023741",
243
+ "@ledgerhq/wallet-api-exchange-module": "^0.19.0-nightly.20251119023741"
244
244
  },
245
245
  "devDependencies": {
246
246
  "@solana/web3.js": "1.95.4",
@@ -277,8 +277,8 @@
277
277
  "nock": "^13.0.5",
278
278
  "react": "18.3.1",
279
279
  "react-dom": "18.3.1",
280
- "react-native": "0.77.2",
281
- "react-native-svg": "15.11.2",
280
+ "react-native": "0.77.3",
281
+ "react-native-svg": "15.12.1",
282
282
  "react-test-renderer": "18.3.1",
283
283
  "redux-actions": "2.6.5",
284
284
  "timemachine": "^0.3.2",
@@ -288,10 +288,10 @@
288
288
  "undici": "6.19.2",
289
289
  "uuid": "^8.3.2",
290
290
  "ws": "7",
291
- "@ledgerhq/device-react": "^0.3.2-nightly.20251115023630",
291
+ "@ledgerhq/device-react": "^0.3.2-nightly.20251119023741",
292
292
  "@ledgerhq/types-cryptoassets": "^7.30.0",
293
293
  "@ledgerhq/types-devices": "^6.27.0",
294
- "@ledgerhq/types-live": "^6.89.0-nightly.20251115023630"
294
+ "@ledgerhq/types-live": "^6.89.0-nightly.20251119023741"
295
295
  },
296
296
  "scripts": {
297
297
  "build": "zx ./scripts/build-ts.mjs",
@@ -468,7 +468,6 @@ export function testBridge<T extends TransactionCommon>(data: DatasetTest<T>): v
468
468
  };
469
469
  const bridge = await getBridge();
470
470
  const synced = await syncAccount(bridge, copy);
471
- if (initialAccountId.includes("ripple")) return; // ripple wont work because of the current implementation of pagination
472
471
  expect(synced.operations.length).toBe(account.operations.length);
473
472
  // same ops are restored
474
473
  expect(synced.operations).toEqual(account.operations);
@@ -481,7 +480,6 @@ export function testBridge<T extends TransactionCommon>(data: DatasetTest<T>): v
481
480
  });
482
481
  makeTest("pendingOperations are cleaned up", async () => {
483
482
  const account = await getSynced();
484
- if (initialAccountId.includes("ripple")) return; // ripple wont work because of the current implementation of pagination
485
483
 
486
484
  if (account.operations.length) {
487
485
  const operations = account.operations.slice(1);
@@ -1,4 +1,4 @@
1
- import { encodeAccountId } from "@ledgerhq/coin-framework/account/index";
1
+ import { encodeAccountId, getSyncHash } from "@ledgerhq/coin-framework/account/index";
2
2
  import { GetAccountShape, mergeOps } from "@ledgerhq/coin-framework/bridge/jsHelpers";
3
3
  import { encodeOperationId } from "@ledgerhq/coin-framework/operation";
4
4
  import BigNumber from "bignumber.js";
@@ -8,6 +8,7 @@ import { inferSubOperations } from "@ledgerhq/coin-framework/serialization";
8
8
  import { buildSubAccounts, mergeSubAccounts } from "./buildSubAccounts";
9
9
  import type { Operation, Pagination } from "@ledgerhq/coin-framework/api/types";
10
10
  import type { OperationCommon } from "./types";
11
+ import type { Account } from "@ledgerhq/types-live";
11
12
 
12
13
  function isNftCoreOp(operation: Operation): boolean {
13
14
  return (
@@ -52,14 +53,13 @@ export function genericGetAccountShape(network: string, kind: string): GetAccoun
52
53
  : { ...op, accountId, id: encodeOperationId(accountId, op.hash, op.type) },
53
54
  );
54
55
  const lastPagingToken = oldOps[0]?.extra?.pagingToken || "";
56
+ const syncHash = await getSyncHash(currency.id, syncConfig.blacklistedTokenIds);
57
+ const syncFromScratch = !initialAccount?.blockHeight || initialAccount?.syncHash !== syncHash;
55
58
 
56
59
  // Calculate minHeight for pagination
57
- let minHeight: number = 0;
58
- if (oldOps.length > 0 && initialAccount?.blockHeight !== 0) {
59
- minHeight = (oldOps[0].blockHeight ?? 0) + 1;
60
- }
60
+ const minHeight = syncFromScratch ? 0 : (oldOps[0]?.blockHeight ?? 0) + 1;
61
61
  const paginationParams: Pagination = { minHeight, order: "asc" };
62
- if (lastPagingToken) {
62
+ if (lastPagingToken && !syncFromScratch) {
63
63
  paginationParams.lastPagingToken = lastPagingToken;
64
64
  }
65
65
 
@@ -81,7 +81,9 @@ export function genericGetAccountShape(network: string, kind: string): GetAccoun
81
81
  operations: newAssetOperations,
82
82
  getTokenFromAsset: alpacaApi.getTokenFromAsset,
83
83
  });
84
- const subAccounts = mergeSubAccounts(initialAccount?.subAccounts ?? [], newSubAccounts);
84
+ const subAccounts = syncFromScratch
85
+ ? newSubAccounts
86
+ : mergeSubAccounts(initialAccount?.subAccounts ?? [], newSubAccounts);
85
87
 
86
88
  const newOpsWithSubs = newOps.map(op => {
87
89
  const subOperations = inferSubOperations(op.hash, newSubAccounts);
@@ -95,12 +97,12 @@ export function genericGetAccountShape(network: string, kind: string): GetAccoun
95
97
  alpacaApi.refreshOperations && initialAccount?.pendingOperations.length
96
98
  ? await alpacaApi.refreshOperations(initialAccount.pendingOperations)
97
99
  : [];
98
- const operations = mergeOps(oldOps, [
99
- ...confirmedOperations,
100
- ...newOpsWithSubs,
101
- ]) as OperationCommon[];
100
+ const newOperations = [...confirmedOperations, ...newOpsWithSubs];
101
+ const operations = syncFromScratch
102
+ ? newOperations
103
+ : (mergeOps(oldOps, newOperations) as OperationCommon[]);
102
104
 
103
- const res = {
105
+ const res: Partial<Account> = {
104
106
  id: accountId,
105
107
  xpub: address,
106
108
  blockHeight: operations.length === 0 ? 0 : blockInfo.height || initialAccount?.blockHeight,
@@ -109,6 +111,7 @@ export function genericGetAccountShape(network: string, kind: string): GetAccoun
109
111
  operations,
110
112
  subAccounts,
111
113
  operationsCount: operations.length,
114
+ syncHash,
112
115
  };
113
116
  return res;
114
117
  };
@@ -1,8 +1,10 @@
1
1
  import BigNumber from "bignumber.js";
2
2
  import { genericGetAccountShape } from "../getAccountShape";
3
3
 
4
+ const getSyncHashMock = jest.fn();
4
5
  jest.mock("@ledgerhq/coin-framework/account/index", () => ({
5
6
  encodeAccountId: jest.fn(() => "accId"),
7
+ getSyncHash: (...args: any[]) => getSyncHashMock(...args),
6
8
  }));
7
9
 
8
10
  const mergeOpsMock = jest.fn();
@@ -63,105 +65,16 @@ describe("genericGetAccountShape", () => {
63
65
  });
64
66
 
65
67
  describe.each(chains)("$currency.id", ({ currency, network }) => {
66
- test("builds account shape with existing operations, pagination and sub accounts", async () => {
67
- const oldOp = {
68
- hash: "h1",
69
- blockHeight: 10,
70
- type: "OPT_IN",
71
- extra: { pagingToken: "pt1", assetReference: "ar1", assetOwner: "ow1" },
72
- };
73
- const pendingOp = {
74
- hash: "h0",
75
- blockHeight: 10,
76
- type: "OUT",
77
- };
78
- const initialAccount = {
79
- operations: [oldOp],
80
- pendingOperations: [pendingOp],
81
- blockHeight: 10,
82
- };
83
-
84
- extractBalanceMock.mockReturnValue({ value: "1000", locked: "300" });
85
- getBalanceMock.mockResolvedValue([
86
- { asset: { type: "native" }, value: "1000", locked: "300" },
87
- { asset: { type: "token", symbol: "TOK1" }, value: "42" },
88
- { asset: { type: "token", symbol: "TOK_IGNORE" }, value: "5" },
89
- ]);
90
-
91
- getTokenFromAssetMock.mockImplementation(asset =>
92
- asset.symbol === "TOK1" ? { id: `${currency.id}_token1` } : null,
93
- );
94
-
95
- const coreOp = { hash: "h2", height: 12 };
96
- listOperationsMock.mockResolvedValue([[coreOp]]);
97
- refreshOperationsMock.mockImplementation(ops => {
98
- const op = ops[0];
99
- if (op?.hash === "h0") {
100
- return [{ ...op, blockHeight: 12 }];
101
- }
102
- return [];
103
- });
104
-
105
- adaptCoreOperationToLiveOperationMock.mockImplementation((_accId, op) => ({
106
- hash: op.hash,
107
- type: "IN",
108
- blockHeight: 12,
109
- extra: { assetReference: "ar2", assetOwner: "ow2" },
110
- }));
111
-
112
- mergeOpsMock.mockImplementation((oldOps, newOps) => [...newOps, ...oldOps]);
113
- cleanedOperationMock.mockImplementation(operation => operation);
114
- mergeSubAccountsMock.mockImplementation((oldSubAccounts, newSubAccounts) => [
115
- ...newSubAccounts,
116
- ...oldSubAccounts,
117
- ]);
118
-
119
- buildSubAccountsMock.mockReturnValue([
120
- { id: `${currency.id}_subAcc1`, type: "TokenAccount" },
121
- ]);
122
-
123
- inferSubOperationsMock.mockImplementation(hash =>
124
- hash === "h2" ? [{ id: `${currency.id}_subOp1` }] : [],
125
- );
126
-
127
- lastBlockMock.mockResolvedValue({ height: 123 });
128
-
129
- const getShape = genericGetAccountShape(network, currency.id);
130
- const result = await getShape(
68
+ test.each([
69
+ [
70
+ "an up-to-date sync hash",
71
+ "sync-hash",
131
72
  {
132
- address: `${currency.id}_addr1`,
133
- initialAccount,
134
- currency,
135
- derivationMode: "",
136
- } as any,
137
- { paginationConfig: {} as any },
138
- );
139
-
140
- expect(chainSpecificGetAccountShapeMock).toHaveBeenCalledWith(`${currency.id}_addr1`);
141
-
142
- expect(listOperationsMock).toHaveBeenCalledWith(`${currency.id}_addr1`, {
143
- minHeight: 11,
144
- order: "asc",
145
- lastPagingToken: "pt1",
146
- });
147
-
148
- const assetsBalancePassed = buildSubAccountsMock.mock.calls[0][0].allTokenAssetsBalances;
149
- expect(assetsBalancePassed).toEqual([
150
- { asset: { symbol: "TOK1", type: "token" }, value: "42" },
151
- { asset: { symbol: "TOK_IGNORE", type: "token" }, value: "5" },
152
- ]);
153
-
154
- const assetOpsPassed = buildSubAccountsMock.mock.calls[0][0].operations;
155
- expect(assetOpsPassed).toHaveLength(1);
156
- expect(assetOpsPassed[0].hash).toBe("h2");
157
-
158
- expect(result).toMatchObject({
159
- balance: new BigNumber(1000),
160
- spendableBalance: new BigNumber(700),
161
- blockHeight: 123,
162
- operationsCount: 3,
163
- subAccounts: [{ id: `${currency.id}_subAcc1`, type: "TokenAccount" }],
164
- operations: [
73
+ minHeight: 11,
74
+ order: "asc",
75
+ lastPagingToken: "pt1",
76
+ },
77
+ [
165
78
  {
166
79
  hash: "h0",
167
80
  type: "OUT",
@@ -174,10 +87,138 @@ describe("genericGetAccountShape", () => {
174
87
  subOperations: [{ id: `${currency.id}_subOp1` }],
175
88
  extra: { assetReference: "ar2", assetOwner: "ow2" },
176
89
  },
177
- oldOp,
90
+ {
91
+ hash: "h1",
92
+ blockHeight: 10,
93
+ type: "OPT_IN",
94
+ extra: { pagingToken: "pt1", assetReference: "ar1", assetOwner: "ow1" },
95
+ },
178
96
  ],
179
- });
180
- });
97
+ ],
98
+ [
99
+ "an outdated sync hash",
100
+ "outdated-sync-hash",
101
+ {
102
+ minHeight: 0,
103
+ order: "asc",
104
+ },
105
+ [
106
+ {
107
+ hash: "h0",
108
+ type: "OUT",
109
+ blockHeight: 12,
110
+ },
111
+ {
112
+ hash: "h2",
113
+ type: "IN",
114
+ blockHeight: 12,
115
+ subOperations: [{ id: `${currency.id}_subOp1` }],
116
+ extra: { assetReference: "ar2", assetOwner: "ow2" },
117
+ },
118
+ ],
119
+ ],
120
+ ])(
121
+ "builds account shape with existing operations, pagination and sub accounts from %s",
122
+ async (_s, syncHash, expectedPagination, expectedOperations) => {
123
+ const oldOp = {
124
+ hash: "h1",
125
+ blockHeight: 10,
126
+ type: "OPT_IN",
127
+ extra: { pagingToken: "pt1", assetReference: "ar1", assetOwner: "ow1" },
128
+ };
129
+ const pendingOp = {
130
+ hash: "h0",
131
+ blockHeight: 10,
132
+ type: "OUT",
133
+ };
134
+ const initialAccount = {
135
+ operations: [oldOp],
136
+ pendingOperations: [pendingOp],
137
+ blockHeight: 10,
138
+ syncHash,
139
+ };
140
+
141
+ getSyncHashMock.mockReturnValue("sync-hash");
142
+ extractBalanceMock.mockReturnValue({ value: "1000", locked: "300" });
143
+ getBalanceMock.mockResolvedValue([
144
+ { asset: { type: "native" }, value: "1000", locked: "300" },
145
+ { asset: { type: "token", symbol: "TOK1" }, value: "42" },
146
+ { asset: { type: "token", symbol: "TOK_IGNORE" }, value: "5" },
147
+ ]);
148
+
149
+ getTokenFromAssetMock.mockImplementation(asset =>
150
+ asset.symbol === "TOK1" ? { id: `${currency.id}_token1` } : null,
151
+ );
152
+
153
+ const coreOp = { hash: "h2", height: 12 };
154
+ listOperationsMock.mockResolvedValue([[coreOp]]);
155
+ refreshOperationsMock.mockImplementation(ops => {
156
+ const op = ops[0];
157
+ if (op?.hash === "h0") {
158
+ return [{ ...op, blockHeight: 12 }];
159
+ }
160
+ return [];
161
+ });
162
+
163
+ adaptCoreOperationToLiveOperationMock.mockImplementation((_accId, op) => ({
164
+ hash: op.hash,
165
+ type: "IN",
166
+ blockHeight: 12,
167
+ extra: { assetReference: "ar2", assetOwner: "ow2" },
168
+ }));
169
+
170
+ mergeOpsMock.mockImplementation((oldOps, newOps) => [...newOps, ...oldOps]);
171
+ cleanedOperationMock.mockImplementation(operation => operation);
172
+ mergeSubAccountsMock.mockImplementation((oldSubAccounts, newSubAccounts) => [
173
+ ...newSubAccounts,
174
+ ...oldSubAccounts,
175
+ ]);
176
+
177
+ buildSubAccountsMock.mockReturnValue([
178
+ { id: `${currency.id}_subAcc1`, type: "TokenAccount" },
179
+ ]);
180
+
181
+ inferSubOperationsMock.mockImplementation(hash =>
182
+ hash === "h2" ? [{ id: `${currency.id}_subOp1` }] : [],
183
+ );
184
+
185
+ lastBlockMock.mockResolvedValue({ height: 123 });
186
+
187
+ const getShape = genericGetAccountShape(network, currency.id);
188
+ const result = await getShape(
189
+ {
190
+ address: `${currency.id}_addr1`,
191
+ initialAccount,
192
+ currency,
193
+ derivationMode: "",
194
+ } as any,
195
+ { paginationConfig: {} as any },
196
+ );
197
+
198
+ expect(chainSpecificGetAccountShapeMock).toHaveBeenCalledWith(`${currency.id}_addr1`);
199
+
200
+ expect(listOperationsMock).toHaveBeenCalledWith(`${currency.id}_addr1`, expectedPagination);
201
+
202
+ const assetsBalancePassed = buildSubAccountsMock.mock.calls[0][0].allTokenAssetsBalances;
203
+ expect(assetsBalancePassed).toEqual([
204
+ { asset: { symbol: "TOK1", type: "token" }, value: "42" },
205
+ { asset: { symbol: "TOK_IGNORE", type: "token" }, value: "5" },
206
+ ]);
207
+
208
+ const assetOpsPassed = buildSubAccountsMock.mock.calls[0][0].operations;
209
+ expect(assetOpsPassed).toHaveLength(1);
210
+ expect(assetOpsPassed[0].hash).toBe("h2");
211
+
212
+ expect(result).toMatchObject({
213
+ balance: new BigNumber(1000),
214
+ spendableBalance: new BigNumber(700),
215
+ blockHeight: 123,
216
+ operationsCount: expectedOperations.length,
217
+ subAccounts: [{ id: `${currency.id}_subAcc1`, type: "TokenAccount" }],
218
+ operations: expectedOperations,
219
+ });
220
+ },
221
+ );
181
222
 
182
223
  test("handles empty operations (no old ops, no new ops) and blockHeight=0", async () => {
183
224
  getBalanceMock.mockResolvedValue([{ asset: { type: "native" }, value: "0", locked: "0" }]);
@@ -1,12 +1,4 @@
1
- import {
2
- Currency,
3
- CryptoCurrency,
4
- CryptoOrTokenCurrency,
5
- TokenCurrency,
6
- } from "@ledgerhq/types-cryptoassets";
7
- import { makeRe } from "minimatch";
8
- import { listTokens } from "@ledgerhq/cryptoassets";
9
- import { listSupportedCurrencies } from "@ledgerhq/coin-framework/currencies/index";
1
+ import { Currency, CryptoCurrency, TokenCurrency } from "@ledgerhq/types-cryptoassets";
10
2
 
11
3
  export function isCryptoCurrency(currency: Currency): currency is CryptoCurrency {
12
4
  return currency.type === "CryptoCurrency";
@@ -20,39 +12,6 @@ export function isUTXOCompliant(currencyFamily: string): boolean {
20
12
  return currencyFamily === "bitcoin" || currencyFamily === "cardano";
21
13
  }
22
14
 
23
- export function listCurrencies(includeTokens: boolean): CryptoOrTokenCurrency[] {
24
- const currencies = listSupportedCurrencies();
25
-
26
- if (!includeTokens) {
27
- return currencies;
28
- }
29
-
30
- const allTokens = listTokens();
31
-
32
- return [...currencies, ...allTokens];
33
- }
34
-
35
15
  export type CurrencyFilters = {
36
16
  currencies?: string[];
37
17
  };
38
-
39
- export function filterCurrencies(
40
- currencies: CryptoOrTokenCurrency[],
41
- filters: CurrencyFilters,
42
- ): CryptoOrTokenCurrency[] {
43
- const filterCurrencyRegexes = filters.currencies
44
- ? filters.currencies.map(filter => makeRe(filter))
45
- : null;
46
-
47
- return currencies.filter(currency => {
48
- if (
49
- filterCurrencyRegexes &&
50
- filterCurrencyRegexes.length &&
51
- !filterCurrencyRegexes.some(regex => currency.id.match(regex))
52
- ) {
53
- return false;
54
- }
55
-
56
- return true;
57
- });
58
- }
@@ -80,6 +80,7 @@ export function useAssetsData({
80
80
  return {
81
81
  data: joinedPages,
82
82
  isLoading: isInitialLoading,
83
+ isFetchingNextPage,
83
84
  error,
84
85
  loadNext: hasMore ? fetchNextPage : undefined,
85
86
  isSuccess,
@@ -17,30 +17,9 @@ export type MappedAsset = {
17
17
  ledgerCurrency?: CryptoOrTokenCurrency;
18
18
  };
19
19
 
20
- export type GroupedCurrency = {
21
- providerId: string;
22
- currenciesByNetwork: MappedAsset[];
23
- };
24
-
25
- export type CurrenciesByProviderId = {
26
- currenciesByNetwork: CryptoOrTokenCurrency[];
27
- providerId: string;
28
- metaCurrencyId?: string;
29
- };
30
-
31
- export type GroupedCurrencies = {
32
- currenciesByProvider: CurrenciesByProviderId[];
33
- sortedCryptoCurrencies: CryptoOrTokenCurrency[];
34
- };
35
-
36
20
  export enum LoadingStatus {
37
21
  Idle = "idle",
38
22
  Pending = "pending",
39
23
  Success = "success",
40
24
  Error = "error",
41
25
  }
42
-
43
- export type LoadingBasedGroupedCurrencies = {
44
- result: GroupedCurrencies;
45
- loadingStatus: LoadingStatus;
46
- };
@@ -8,6 +8,7 @@ import { BatteryStatusTypes } from "../../hw/getBatteryStatus";
8
8
 
9
9
  export type GetBatteryStatusesActionArgs = {
10
10
  deviceId: DeviceId;
11
+ deviceName: string | null;
11
12
  statuses: BatteryStatusTypes[];
12
13
  };
13
14
 
@@ -26,9 +27,10 @@ export const initialState: GetBatteryStatusesActionState = {
26
27
 
27
28
  export function getBatteryStatusesAction({
28
29
  deviceId,
30
+ deviceName,
29
31
  statuses,
30
32
  }: GetBatteryStatusesActionArgs): Observable<GetBatteryStatusesActionState> {
31
- return getBatteryStatusTask({ deviceId, statuses }).pipe(
33
+ return getBatteryStatusTask({ deviceId, deviceName, statuses }).pipe(
32
34
  scan((currentState, event) => {
33
35
  switch (event.type) {
34
36
  case "taskError":