@ledgerhq/live-common 34.53.0-nightly.20251119110540 → 34.53.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (397) hide show
  1. package/lib/__tests__/test-helpers/bridge.d.ts.map +1 -1
  2. package/lib/__tests__/test-helpers/bridge.js +4 -0
  3. package/lib/__tests__/test-helpers/bridge.js.map +1 -1
  4. package/lib/__tests__/test-helpers/environment.js +0 -3
  5. package/lib/__tests__/test-helpers/environment.js.map +1 -1
  6. package/lib/bridge/generic-alpaca/getAccountShape.d.ts.map +1 -1
  7. package/lib/bridge/generic-alpaca/getAccountShape.js +10 -12
  8. package/lib/bridge/generic-alpaca/getAccountShape.js.map +1 -1
  9. package/lib/currencies/helpers.d.ts +3 -1
  10. package/lib/currencies/helpers.d.ts.map +1 -1
  11. package/lib/currencies/helpers.js +27 -1
  12. package/lib/currencies/helpers.js.map +1 -1
  13. package/lib/dada-client/hooks/useAssetsData.d.ts +0 -1
  14. package/lib/dada-client/hooks/useAssetsData.d.ts.map +1 -1
  15. package/lib/dada-client/hooks/useAssetsData.js +0 -1
  16. package/lib/dada-client/hooks/useAssetsData.js.map +1 -1
  17. package/lib/deposit/helper.d.ts +8 -0
  18. package/lib/deposit/helper.d.ts.map +1 -0
  19. package/lib/deposit/helper.js +125 -0
  20. package/lib/deposit/helper.js.map +1 -0
  21. package/lib/deposit/index.d.ts +3 -0
  22. package/lib/deposit/index.d.ts.map +1 -0
  23. package/lib/deposit/index.js +6 -0
  24. package/lib/deposit/index.js.map +1 -0
  25. package/lib/deposit/mock.d.ts +75 -0
  26. package/lib/deposit/mock.d.ts.map +1 -0
  27. package/lib/deposit/mock.js +15111 -0
  28. package/lib/deposit/mock.js.map +1 -0
  29. package/lib/deposit/type.d.ts +17 -0
  30. package/lib/deposit/type.d.ts.map +1 -1
  31. package/lib/deposit/type.js.map +1 -1
  32. package/lib/deposit/useGroupedCurrenciesByProvider.hook.d.ts +3 -0
  33. package/lib/deposit/useGroupedCurrenciesByProvider.hook.d.ts.map +1 -0
  34. package/lib/deposit/useGroupedCurrenciesByProvider.hook.js +40 -0
  35. package/lib/deposit/useGroupedCurrenciesByProvider.hook.js.map +1 -0
  36. package/lib/deviceSDK/hooks/useBatteryStatuses.d.ts +1 -2
  37. package/lib/deviceSDK/hooks/useBatteryStatuses.d.ts.map +1 -1
  38. package/lib/deviceSDK/hooks/useBatteryStatuses.js +2 -4
  39. package/lib/deviceSDK/hooks/useBatteryStatuses.js.map +1 -1
  40. package/lib/deviceSDK/tasks/core.d.ts +1 -1
  41. package/lib/deviceSDK/tasks/core.d.ts.map +1 -1
  42. package/lib/deviceSDK/tasks/core.js +1 -1
  43. package/lib/deviceSDK/tasks/core.js.map +1 -1
  44. package/lib/deviceSDK/tasks/getDeviceInfo.d.ts.map +1 -1
  45. package/lib/deviceSDK/tasks/getDeviceInfo.js +0 -2
  46. package/lib/deviceSDK/tasks/getDeviceInfo.js.map +1 -1
  47. package/lib/deviceSDK/tasks/getLatestFirmware.d.ts.map +1 -1
  48. package/lib/deviceSDK/tasks/getLatestFirmware.js +2 -2
  49. package/lib/deviceSDK/tasks/getLatestFirmware.js.map +1 -1
  50. package/lib/deviceSDK/tasks/updateFirmware.d.ts.map +1 -1
  51. package/lib/deviceSDK/tasks/updateFirmware.js +0 -1
  52. package/lib/deviceSDK/tasks/updateFirmware.js.map +1 -1
  53. package/lib/e2e/enum/Account.d.ts +1 -0
  54. package/lib/e2e/enum/Account.d.ts.map +1 -1
  55. package/lib/e2e/enum/Account.js +1 -0
  56. package/lib/e2e/enum/Account.js.map +1 -1
  57. package/lib/e2e/enum/Currency.d.ts +1 -0
  58. package/lib/e2e/enum/Currency.d.ts.map +1 -1
  59. package/lib/e2e/enum/Currency.js +6 -2
  60. package/lib/e2e/enum/Currency.js.map +1 -1
  61. package/lib/e2e/index.d.ts +0 -9
  62. package/lib/e2e/index.d.ts.map +1 -1
  63. package/lib/exchange/providers/swap.d.ts +0 -1
  64. package/lib/exchange/providers/swap.d.ts.map +1 -1
  65. package/lib/exchange/providers/swap.js +1 -5
  66. package/lib/exchange/providers/swap.js.map +1 -1
  67. package/lib/exchange/swap/hooks/v5/useFetchCurrencyAll.d.ts.map +1 -1
  68. package/lib/exchange/swap/hooks/v5/useFetchCurrencyAll.js +3 -2
  69. package/lib/exchange/swap/hooks/v5/useFetchCurrencyAll.js.map +1 -1
  70. package/lib/exchange/swap/hooks/v5/useFilteredProviders.d.ts.map +1 -1
  71. package/lib/exchange/swap/hooks/v5/useFilteredProviders.js +10 -15
  72. package/lib/exchange/swap/hooks/v5/useFilteredProviders.js.map +1 -1
  73. package/lib/families/evm/config.d.ts.map +1 -1
  74. package/lib/families/evm/config.js +0 -49
  75. package/lib/families/evm/config.js.map +1 -1
  76. package/lib/featureFlags/defaultFeatures.d.ts +0 -3
  77. package/lib/featureFlags/defaultFeatures.d.ts.map +1 -1
  78. package/lib/featureFlags/defaultFeatures.js +0 -4
  79. package/lib/featureFlags/defaultFeatures.js.map +1 -1
  80. package/lib/market/hooks/useMarketDataProvider.js +0 -1
  81. package/lib/market/hooks/useMarketDataProvider.js.map +1 -1
  82. package/lib/market/utils/types.d.ts +0 -1
  83. package/lib/market/utils/types.d.ts.map +1 -1
  84. package/lib/market/utils/types.js.map +1 -1
  85. package/lib/modularDrawer/__mocks__/useGroupedCurrenciesByProvider.mock.d.ts +22 -0
  86. package/lib/modularDrawer/__mocks__/useGroupedCurrenciesByProvider.mock.d.ts.map +1 -0
  87. package/lib/modularDrawer/__mocks__/useGroupedCurrenciesByProvider.mock.js +41 -0
  88. package/lib/modularDrawer/__mocks__/useGroupedCurrenciesByProvider.mock.js.map +1 -0
  89. package/lib/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.d.ts.map +1 -1
  90. package/lib/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.js +0 -11
  91. package/lib/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.js.map +1 -1
  92. package/lib/modularDrawer/hooks/useNetworkAccountCounts.d.ts +5 -1
  93. package/lib/modularDrawer/hooks/useNetworkAccountCounts.d.ts.map +1 -1
  94. package/lib/modularDrawer/hooks/useNetworkAccountCounts.js +2 -2
  95. package/lib/modularDrawer/hooks/useNetworkAccountCounts.js.map +1 -1
  96. package/lib/modularDrawer/modules/createNetworkConfiguration.d.ts +1 -1
  97. package/lib/modularDrawer/modules/createNetworkConfiguration.d.ts.map +1 -1
  98. package/lib/modularDrawer/modules/createNetworkConfiguration.js +2 -1
  99. package/lib/modularDrawer/modules/createNetworkConfiguration.js.map +1 -1
  100. package/lib/modularDrawer/utils/currencyUtils.d.ts +10 -0
  101. package/lib/modularDrawer/utils/currencyUtils.d.ts.map +1 -0
  102. package/lib/modularDrawer/utils/currencyUtils.js +74 -0
  103. package/lib/modularDrawer/utils/currencyUtils.js.map +1 -0
  104. package/lib/modularDrawer/utils/{groupCurrenciesByAsset.d.ts → groupCurrenciesByProvider.d.ts} +2 -2
  105. package/lib/modularDrawer/utils/groupCurrenciesByProvider.d.ts.map +1 -0
  106. package/lib/modularDrawer/utils/groupCurrenciesByProvider.js +21 -0
  107. package/lib/modularDrawer/utils/groupCurrenciesByProvider.js.map +1 -0
  108. package/lib/modularDrawer/utils/index.d.ts +1 -1
  109. package/lib/modularDrawer/utils/index.d.ts.map +1 -1
  110. package/lib/modularDrawer/utils/index.js +3 -3
  111. package/lib/modularDrawer/utils/index.js.map +1 -1
  112. package/lib/modularDrawer/utils/type.d.ts +5 -0
  113. package/lib/modularDrawer/utils/type.d.ts.map +1 -1
  114. package/lib/platform/filters.d.ts +2 -1
  115. package/lib/platform/filters.d.ts.map +1 -1
  116. package/lib/platform/filters.js +17 -1
  117. package/lib/platform/filters.js.map +1 -1
  118. package/lib/platform/helpers.d.ts +5 -1
  119. package/lib/platform/helpers.d.ts.map +1 -1
  120. package/lib/platform/helpers.js +33 -1
  121. package/lib/platform/helpers.js.map +1 -1
  122. package/lib/platform/react.d.ts +3 -2
  123. package/lib/platform/react.d.ts.map +1 -1
  124. package/lib/platform/react.js +16 -66
  125. package/lib/platform/react.js.map +1 -1
  126. package/lib/platform/types.d.ts +3 -3
  127. package/lib/platform/types.d.ts.map +1 -1
  128. package/lib/postOnboarding/reducer.d.ts +0 -2
  129. package/lib/postOnboarding/reducer.d.ts.map +1 -1
  130. package/lib/utils/getAccountTuplesForCurrency.d.ts +1 -1
  131. package/lib/utils/getAccountTuplesForCurrency.d.ts.map +1 -1
  132. package/lib/utils/getAccountTuplesForCurrency.js +3 -2
  133. package/lib/utils/getAccountTuplesForCurrency.js.map +1 -1
  134. package/lib/wallet-api/Exchange/server.d.ts.map +1 -1
  135. package/lib/wallet-api/Exchange/server.js +4 -5
  136. package/lib/wallet-api/Exchange/server.js.map +1 -1
  137. package/lib/wallet-api/converters.d.ts +0 -1
  138. package/lib/wallet-api/converters.d.ts.map +1 -1
  139. package/lib/wallet-api/converters.js +2 -7
  140. package/lib/wallet-api/converters.js.map +1 -1
  141. package/lib/wallet-api/react.d.ts +11 -6
  142. package/lib/wallet-api/react.d.ts.map +1 -1
  143. package/lib/wallet-api/react.js +135 -291
  144. package/lib/wallet-api/react.js.map +1 -1
  145. package/lib/wallet-api/tracking.d.ts +0 -6
  146. package/lib/wallet-api/tracking.d.ts.map +1 -1
  147. package/lib/wallet-api/tracking.js +0 -20
  148. package/lib/wallet-api/tracking.js.map +1 -1
  149. package/lib/wallet-api/types.d.ts +0 -3
  150. package/lib/wallet-api/types.d.ts.map +1 -1
  151. package/lib/wallet-api/useDappLogic.d.ts.map +1 -1
  152. package/lib/wallet-api/useDappLogic.js +80 -65
  153. package/lib/wallet-api/useDappLogic.js.map +1 -1
  154. package/lib/wallet-api/utils/deriveAccountIdForManifest.d.ts +0 -6
  155. package/lib/wallet-api/utils/deriveAccountIdForManifest.d.ts.map +1 -1
  156. package/lib/wallet-api/utils/deriveAccountIdForManifest.js +3 -13
  157. package/lib/wallet-api/utils/deriveAccountIdForManifest.js.map +1 -1
  158. package/lib-es/__tests__/test-helpers/bridge.d.ts.map +1 -1
  159. package/lib-es/__tests__/test-helpers/bridge.js +4 -0
  160. package/lib-es/__tests__/test-helpers/bridge.js.map +1 -1
  161. package/lib-es/__tests__/test-helpers/environment.js +0 -3
  162. package/lib-es/__tests__/test-helpers/environment.js.map +1 -1
  163. package/lib-es/bridge/generic-alpaca/getAccountShape.d.ts.map +1 -1
  164. package/lib-es/bridge/generic-alpaca/getAccountShape.js +11 -13
  165. package/lib-es/bridge/generic-alpaca/getAccountShape.js.map +1 -1
  166. package/lib-es/currencies/helpers.d.ts +3 -1
  167. package/lib-es/currencies/helpers.d.ts.map +1 -1
  168. package/lib-es/currencies/helpers.js +24 -0
  169. package/lib-es/currencies/helpers.js.map +1 -1
  170. package/lib-es/dada-client/hooks/useAssetsData.d.ts +0 -1
  171. package/lib-es/dada-client/hooks/useAssetsData.d.ts.map +1 -1
  172. package/lib-es/dada-client/hooks/useAssetsData.js +0 -1
  173. package/lib-es/dada-client/hooks/useAssetsData.js.map +1 -1
  174. package/lib-es/deposit/helper.d.ts +8 -0
  175. package/lib-es/deposit/helper.d.ts.map +1 -0
  176. package/lib-es/deposit/helper.js +117 -0
  177. package/lib-es/deposit/helper.js.map +1 -0
  178. package/lib-es/deposit/index.d.ts +3 -0
  179. package/lib-es/deposit/index.d.ts.map +1 -0
  180. package/lib-es/deposit/index.js +3 -0
  181. package/lib-es/deposit/index.js.map +1 -0
  182. package/lib-es/deposit/mock.d.ts +75 -0
  183. package/lib-es/deposit/mock.d.ts.map +1 -0
  184. package/lib-es/deposit/mock.js +15108 -0
  185. package/lib-es/deposit/mock.js.map +1 -0
  186. package/lib-es/deposit/type.d.ts +17 -0
  187. package/lib-es/deposit/type.d.ts.map +1 -1
  188. package/lib-es/deposit/type.js.map +1 -1
  189. package/lib-es/deposit/useGroupedCurrenciesByProvider.hook.d.ts +3 -0
  190. package/lib-es/deposit/useGroupedCurrenciesByProvider.hook.d.ts.map +1 -0
  191. package/lib-es/deposit/useGroupedCurrenciesByProvider.hook.js +36 -0
  192. package/lib-es/deposit/useGroupedCurrenciesByProvider.hook.js.map +1 -0
  193. package/lib-es/deviceSDK/hooks/useBatteryStatuses.d.ts +1 -2
  194. package/lib-es/deviceSDK/hooks/useBatteryStatuses.d.ts.map +1 -1
  195. package/lib-es/deviceSDK/hooks/useBatteryStatuses.js +2 -4
  196. package/lib-es/deviceSDK/hooks/useBatteryStatuses.js.map +1 -1
  197. package/lib-es/deviceSDK/tasks/core.d.ts +1 -1
  198. package/lib-es/deviceSDK/tasks/core.d.ts.map +1 -1
  199. package/lib-es/deviceSDK/tasks/core.js +1 -1
  200. package/lib-es/deviceSDK/tasks/core.js.map +1 -1
  201. package/lib-es/deviceSDK/tasks/getDeviceInfo.d.ts.map +1 -1
  202. package/lib-es/deviceSDK/tasks/getDeviceInfo.js +0 -2
  203. package/lib-es/deviceSDK/tasks/getDeviceInfo.js.map +1 -1
  204. package/lib-es/deviceSDK/tasks/getLatestFirmware.d.ts.map +1 -1
  205. package/lib-es/deviceSDK/tasks/getLatestFirmware.js +2 -2
  206. package/lib-es/deviceSDK/tasks/getLatestFirmware.js.map +1 -1
  207. package/lib-es/deviceSDK/tasks/updateFirmware.d.ts.map +1 -1
  208. package/lib-es/deviceSDK/tasks/updateFirmware.js +1 -2
  209. package/lib-es/deviceSDK/tasks/updateFirmware.js.map +1 -1
  210. package/lib-es/e2e/enum/Account.d.ts +1 -0
  211. package/lib-es/e2e/enum/Account.d.ts.map +1 -1
  212. package/lib-es/e2e/enum/Account.js +1 -0
  213. package/lib-es/e2e/enum/Account.js.map +1 -1
  214. package/lib-es/e2e/enum/Currency.d.ts +1 -0
  215. package/lib-es/e2e/enum/Currency.d.ts.map +1 -1
  216. package/lib-es/e2e/enum/Currency.js +6 -2
  217. package/lib-es/e2e/enum/Currency.js.map +1 -1
  218. package/lib-es/e2e/index.d.ts +0 -9
  219. package/lib-es/e2e/index.d.ts.map +1 -1
  220. package/lib-es/exchange/providers/swap.d.ts +0 -1
  221. package/lib-es/exchange/providers/swap.d.ts.map +1 -1
  222. package/lib-es/exchange/providers/swap.js +0 -3
  223. package/lib-es/exchange/providers/swap.js.map +1 -1
  224. package/lib-es/exchange/swap/hooks/v5/useFetchCurrencyAll.d.ts.map +1 -1
  225. package/lib-es/exchange/swap/hooks/v5/useFetchCurrencyAll.js +3 -2
  226. package/lib-es/exchange/swap/hooks/v5/useFetchCurrencyAll.js.map +1 -1
  227. package/lib-es/exchange/swap/hooks/v5/useFilteredProviders.d.ts.map +1 -1
  228. package/lib-es/exchange/swap/hooks/v5/useFilteredProviders.js +12 -17
  229. package/lib-es/exchange/swap/hooks/v5/useFilteredProviders.js.map +1 -1
  230. package/lib-es/families/evm/config.d.ts.map +1 -1
  231. package/lib-es/families/evm/config.js +0 -49
  232. package/lib-es/families/evm/config.js.map +1 -1
  233. package/lib-es/featureFlags/defaultFeatures.d.ts +0 -3
  234. package/lib-es/featureFlags/defaultFeatures.d.ts.map +1 -1
  235. package/lib-es/featureFlags/defaultFeatures.js +0 -4
  236. package/lib-es/featureFlags/defaultFeatures.js.map +1 -1
  237. package/lib-es/market/hooks/useMarketDataProvider.js +0 -1
  238. package/lib-es/market/hooks/useMarketDataProvider.js.map +1 -1
  239. package/lib-es/market/utils/types.d.ts +0 -1
  240. package/lib-es/market/utils/types.d.ts.map +1 -1
  241. package/lib-es/market/utils/types.js.map +1 -1
  242. package/lib-es/modularDrawer/__mocks__/useGroupedCurrenciesByProvider.mock.d.ts +22 -0
  243. package/lib-es/modularDrawer/__mocks__/useGroupedCurrenciesByProvider.mock.d.ts.map +1 -0
  244. package/lib-es/modularDrawer/__mocks__/useGroupedCurrenciesByProvider.mock.js +38 -0
  245. package/lib-es/modularDrawer/__mocks__/useGroupedCurrenciesByProvider.mock.js.map +1 -0
  246. package/lib-es/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.d.ts.map +1 -1
  247. package/lib-es/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.js +0 -11
  248. package/lib-es/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.js.map +1 -1
  249. package/lib-es/modularDrawer/hooks/useNetworkAccountCounts.d.ts +5 -1
  250. package/lib-es/modularDrawer/hooks/useNetworkAccountCounts.d.ts.map +1 -1
  251. package/lib-es/modularDrawer/hooks/useNetworkAccountCounts.js +2 -2
  252. package/lib-es/modularDrawer/hooks/useNetworkAccountCounts.js.map +1 -1
  253. package/lib-es/modularDrawer/modules/createNetworkConfiguration.d.ts +1 -1
  254. package/lib-es/modularDrawer/modules/createNetworkConfiguration.d.ts.map +1 -1
  255. package/lib-es/modularDrawer/modules/createNetworkConfiguration.js +2 -1
  256. package/lib-es/modularDrawer/modules/createNetworkConfiguration.js.map +1 -1
  257. package/lib-es/modularDrawer/utils/currencyUtils.d.ts +10 -0
  258. package/lib-es/modularDrawer/utils/currencyUtils.d.ts.map +1 -0
  259. package/lib-es/modularDrawer/utils/currencyUtils.js +65 -0
  260. package/lib-es/modularDrawer/utils/currencyUtils.js.map +1 -0
  261. package/lib-es/modularDrawer/utils/{groupCurrenciesByAsset.d.ts → groupCurrenciesByProvider.d.ts} +2 -2
  262. package/lib-es/modularDrawer/utils/groupCurrenciesByProvider.d.ts.map +1 -0
  263. package/lib-es/modularDrawer/utils/{groupCurrenciesByAsset.js → groupCurrenciesByProvider.js} +6 -6
  264. package/lib-es/modularDrawer/utils/groupCurrenciesByProvider.js.map +1 -0
  265. package/lib-es/modularDrawer/utils/index.d.ts +1 -1
  266. package/lib-es/modularDrawer/utils/index.d.ts.map +1 -1
  267. package/lib-es/modularDrawer/utils/index.js +1 -1
  268. package/lib-es/modularDrawer/utils/index.js.map +1 -1
  269. package/lib-es/modularDrawer/utils/type.d.ts +5 -0
  270. package/lib-es/modularDrawer/utils/type.d.ts.map +1 -1
  271. package/lib-es/platform/filters.d.ts +2 -1
  272. package/lib-es/platform/filters.d.ts.map +1 -1
  273. package/lib-es/platform/filters.js +15 -0
  274. package/lib-es/platform/filters.js.map +1 -1
  275. package/lib-es/platform/helpers.d.ts +5 -1
  276. package/lib-es/platform/helpers.d.ts.map +1 -1
  277. package/lib-es/platform/helpers.js +30 -1
  278. package/lib-es/platform/helpers.js.map +1 -1
  279. package/lib-es/platform/react.d.ts +3 -2
  280. package/lib-es/platform/react.d.ts.map +1 -1
  281. package/lib-es/platform/react.js +16 -67
  282. package/lib-es/platform/react.js.map +1 -1
  283. package/lib-es/platform/types.d.ts +3 -3
  284. package/lib-es/platform/types.d.ts.map +1 -1
  285. package/lib-es/postOnboarding/reducer.d.ts +0 -2
  286. package/lib-es/postOnboarding/reducer.d.ts.map +1 -1
  287. package/lib-es/utils/getAccountTuplesForCurrency.d.ts +1 -1
  288. package/lib-es/utils/getAccountTuplesForCurrency.d.ts.map +1 -1
  289. package/lib-es/utils/getAccountTuplesForCurrency.js +3 -2
  290. package/lib-es/utils/getAccountTuplesForCurrency.js.map +1 -1
  291. package/lib-es/wallet-api/Exchange/server.d.ts.map +1 -1
  292. package/lib-es/wallet-api/Exchange/server.js +4 -5
  293. package/lib-es/wallet-api/Exchange/server.js.map +1 -1
  294. package/lib-es/wallet-api/converters.d.ts +0 -1
  295. package/lib-es/wallet-api/converters.d.ts.map +1 -1
  296. package/lib-es/wallet-api/converters.js +1 -5
  297. package/lib-es/wallet-api/converters.js.map +1 -1
  298. package/lib-es/wallet-api/react.d.ts +11 -6
  299. package/lib-es/wallet-api/react.d.ts.map +1 -1
  300. package/lib-es/wallet-api/react.js +131 -289
  301. package/lib-es/wallet-api/react.js.map +1 -1
  302. package/lib-es/wallet-api/tracking.d.ts +0 -6
  303. package/lib-es/wallet-api/tracking.d.ts.map +1 -1
  304. package/lib-es/wallet-api/tracking.js +0 -20
  305. package/lib-es/wallet-api/tracking.js.map +1 -1
  306. package/lib-es/wallet-api/types.d.ts +0 -3
  307. package/lib-es/wallet-api/types.d.ts.map +1 -1
  308. package/lib-es/wallet-api/useDappLogic.d.ts.map +1 -1
  309. package/lib-es/wallet-api/useDappLogic.js +77 -62
  310. package/lib-es/wallet-api/useDappLogic.js.map +1 -1
  311. package/lib-es/wallet-api/utils/deriveAccountIdForManifest.d.ts +0 -6
  312. package/lib-es/wallet-api/utils/deriveAccountIdForManifest.d.ts.map +1 -1
  313. package/lib-es/wallet-api/utils/deriveAccountIdForManifest.js +2 -11
  314. package/lib-es/wallet-api/utils/deriveAccountIdForManifest.js.map +1 -1
  315. package/package.json +57 -57
  316. package/src/__tests__/migration/account-migration.ts +0 -3
  317. package/src/__tests__/test-helpers/bridge.ts +2 -0
  318. package/src/__tests__/test-helpers/environment.ts +0 -3
  319. package/src/bridge/generic-alpaca/getAccountShape.ts +12 -15
  320. package/src/bridge/generic-alpaca/tests/getAccountShape.test.ts +101 -142
  321. package/src/currencies/helpers.test.ts +20 -0
  322. package/src/currencies/helpers.ts +42 -1
  323. package/src/dada-client/hooks/useAssetsData.ts +0 -1
  324. package/src/deposit/deposit.integration.test.ts +88 -0
  325. package/src/deposit/deposit.test.ts +684 -0
  326. package/src/deposit/helper.ts +143 -0
  327. package/src/deposit/index.ts +3 -0
  328. package/src/deposit/mock.ts +15112 -0
  329. package/src/deposit/type.ts +21 -0
  330. package/src/deposit/useGroupedCurrenciesByProvider.hook.ts +46 -0
  331. package/src/deviceSDK/hooks/useBatteryStatuses.test.ts +1 -3
  332. package/src/deviceSDK/hooks/useBatteryStatuses.ts +1 -4
  333. package/src/deviceSDK/tasks/core.test.ts +0 -20
  334. package/src/deviceSDK/tasks/core.ts +1 -2
  335. package/src/deviceSDK/tasks/getDeviceInfo.ts +0 -2
  336. package/src/deviceSDK/tasks/getLatestFirmware.ts +4 -4
  337. package/src/deviceSDK/tasks/updateFirmware.ts +0 -2
  338. package/src/e2e/enum/Account.ts +6 -0
  339. package/src/e2e/enum/Currency.ts +6 -2
  340. package/src/exchange/providers/swap.ts +0 -4
  341. package/src/exchange/swap/hooks/v5/useFetchCurrencyAll.ts +3 -2
  342. package/src/exchange/swap/hooks/v5/useFilteredProviders.ts +12 -37
  343. package/src/families/evm/config.ts +0 -49
  344. package/src/families/stellar/__snapshots__/bridge.integration.test.ts.snap +12 -84
  345. package/src/featureFlags/defaultFeatures.ts +0 -4
  346. package/src/market/hooks/useMarketDataProvider.ts +0 -1
  347. package/src/market/utils/types.ts +0 -1
  348. package/src/modularDrawer/__mocks__/useGroupedCurrenciesByProvider.mock.ts +49 -0
  349. package/src/modularDrawer/hooks/__test__/useAssetAccountCounts.test.ts +5 -0
  350. package/src/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.ts +0 -11
  351. package/src/modularDrawer/hooks/useNetworkAccountCounts.tsx +6 -1
  352. package/src/modularDrawer/modules/__test__/createAssetConfiguration.test.tsx +2 -2
  353. package/src/modularDrawer/modules/__test__/createNetworkConfiguration.test.ts +342 -0
  354. package/src/modularDrawer/modules/createNetworkConfiguration.ts +2 -1
  355. package/src/modularDrawer/utils/__tests__/currencyUtils.test.ts +126 -0
  356. package/src/modularDrawer/utils/currencyUtils.ts +95 -0
  357. package/src/modularDrawer/utils/{groupCurrenciesByAsset.ts → groupCurrenciesByProvider.ts} +5 -5
  358. package/src/modularDrawer/utils/index.ts +1 -1
  359. package/src/modularDrawer/utils/type.ts +5 -0
  360. package/src/platform/filters.ts +23 -1
  361. package/src/platform/helpers.ts +49 -2
  362. package/src/platform/react.ts +22 -86
  363. package/src/platform/types.ts +1 -1
  364. package/src/utils/__tests__/getAccountTuplesForCurrency.test.ts +30 -0
  365. package/src/utils/getAccountTuplesForCurrency.ts +6 -1
  366. package/src/wallet-api/Exchange/server.test.ts +5 -0
  367. package/src/wallet-api/Exchange/server.ts +6 -7
  368. package/src/wallet-api/converters.ts +1 -6
  369. package/src/wallet-api/react.ts +137 -310
  370. package/src/wallet-api/tracking.ts +0 -22
  371. package/src/wallet-api/types.ts +0 -5
  372. package/src/wallet-api/useDappLogic.ts +106 -91
  373. package/src/wallet-api/utils/deriveAccountIdForManifest.ts +2 -14
  374. package/lib/device/use-cases/getDeviceHasBattery.d.ts +0 -2
  375. package/lib/device/use-cases/getDeviceHasBattery.d.ts.map +0 -1
  376. package/lib/device/use-cases/getDeviceHasBattery.js +0 -6
  377. package/lib/device/use-cases/getDeviceHasBattery.js.map +0 -1
  378. package/lib/e2e/enum/ReceiveFundsOptions.d.ts +0 -6
  379. package/lib/e2e/enum/ReceiveFundsOptions.d.ts.map +0 -1
  380. package/lib/e2e/enum/ReceiveFundsOptions.js +0 -8
  381. package/lib/e2e/enum/ReceiveFundsOptions.js.map +0 -1
  382. package/lib/modularDrawer/utils/groupCurrenciesByAsset.d.ts.map +0 -1
  383. package/lib/modularDrawer/utils/groupCurrenciesByAsset.js +0 -21
  384. package/lib/modularDrawer/utils/groupCurrenciesByAsset.js.map +0 -1
  385. package/lib-es/device/use-cases/getDeviceHasBattery.d.ts +0 -2
  386. package/lib-es/device/use-cases/getDeviceHasBattery.d.ts.map +0 -1
  387. package/lib-es/device/use-cases/getDeviceHasBattery.js +0 -2
  388. package/lib-es/device/use-cases/getDeviceHasBattery.js.map +0 -1
  389. package/lib-es/e2e/enum/ReceiveFundsOptions.d.ts +0 -6
  390. package/lib-es/e2e/enum/ReceiveFundsOptions.d.ts.map +0 -1
  391. package/lib-es/e2e/enum/ReceiveFundsOptions.js +0 -5
  392. package/lib-es/e2e/enum/ReceiveFundsOptions.js.map +0 -1
  393. package/lib-es/modularDrawer/utils/groupCurrenciesByAsset.d.ts.map +0 -1
  394. package/lib-es/modularDrawer/utils/groupCurrenciesByAsset.js.map +0 -1
  395. package/src/device/use-cases/getDeviceHasBattery.ts +0 -1
  396. package/src/e2e/enum/ReceiveFundsOptions.ts +0 -7
  397. package/src/modularDrawer/utils/__tests__/groupCurrenciesByAsset.test.ts +0 -88
@@ -8,15 +8,16 @@ import { getAccountBridge } from "../bridge";
8
8
  import { getEnv } from "@ledgerhq/live-env";
9
9
  import network from "@ledgerhq/live-network/network";
10
10
  import { getWalletAPITransactionSignFlowInfos } from "./converters";
11
+ import { getCryptoCurrencyById } from "@ledgerhq/cryptoassets/index";
12
+ import { getCryptoAssetsStore } from "../bridge/crypto-assets/index";
11
13
  import { prepareMessageToSign } from "../hw/signMessage/index";
12
- import { CurrentAccountHistDB, UiHook } from "./react";
14
+ import { CurrentAccountHistDB, UiHook, usePermission } from "./react";
13
15
  import BigNumber from "bignumber.js";
14
16
  import { safeEncodeEIP55 } from "@ledgerhq/coin-evm/utils";
15
17
  import { SmartWebsocket } from "./SmartWebsocket";
16
18
  import { stripHexPrefix } from "./helpers";
17
19
  import { getTxType } from "./utils/txTrackingHelper";
18
20
  import { Transaction as EvmTransaction } from "@ledgerhq/coin-evm/types/transaction";
19
- import { getCryptoAssetsStore } from "../bridge/crypto-assets";
20
21
 
21
22
  type MessageId = number | string | null;
22
23
 
@@ -87,8 +88,6 @@ export function useDappCurrentAccount(currentAccountHistDb?: CurrentAccountHistD
87
88
  return { currentAccount, setCurrentAccount, setCurrentAccountHist };
88
89
  }
89
90
 
90
- const globCurrencies = ["**"];
91
-
92
91
  function useDappAccountLogic({
93
92
  manifest,
94
93
  accounts,
@@ -101,7 +100,7 @@ function useDappAccountLogic({
101
100
  initialAccountId?: string;
102
101
  }) {
103
102
  const [initialAccountSelected, setInitialAccountSelected] = useState(false);
104
- const currencyIds = manifest.currencies === "*" ? globCurrencies : manifest.currencies;
103
+ const { currencyIds } = usePermission(manifest);
105
104
  const { currentAccount, setCurrentAccount, setCurrentAccountHist } =
106
105
  useDappCurrentAccount(currentAccountHistDb);
107
106
  const currentParentAccount = useMemo(() => {
@@ -435,8 +434,7 @@ export function useDappLogic({
435
434
  try {
436
435
  await new Promise<void>((resolve, reject) =>
437
436
  uiHook["account.request"]({
438
- currencyIds: [requestedCurrency.currency],
439
- areCurrenciesFiltered: true,
437
+ currencies: [getCryptoCurrencyById(requestedCurrency.currency)],
440
438
  onSuccess: account => {
441
439
  setCurrentAccountHist(manifest.id, account);
442
440
  setCurrentAccount(account);
@@ -476,95 +474,108 @@ export function useDappLogic({
476
474
  : currentParentAccount.freshAddress;
477
475
 
478
476
  if (address.toLowerCase() === ethTX.from.toLowerCase()) {
479
- let trackingData: DAppTrackingData | undefined;
480
- try {
481
- const signFlowInfos = getWalletAPITransactionSignFlowInfos({
482
- walletApiTransaction: tx,
483
- account: currentAccount,
484
- });
485
-
486
- const transactionType = getTxType(signFlowInfos.liveTx as EvmTransaction);
487
-
488
- const accountCurrencyName =
489
- currentAccount.type === "TokenAccount"
490
- ? currentAccount.token.name
491
- : currentAccount.currency.name;
492
-
493
- const accountNetwork =
494
- currentAccount.type === "TokenAccount"
495
- ? currentAccount.token.parentCurrency.id
496
- : currentAccount.currency.id;
497
-
498
- const token = await getCryptoAssetsStore().findTokenByAddressInCurrency(
499
- tx.recipient,
500
- accountNetwork,
501
- );
502
-
503
- trackingData = {
504
- type: transactionType,
505
- currency: token ? token.name : accountCurrencyName,
506
- network: token ? token.parentCurrency.id : accountNetwork,
507
- };
508
-
509
- const options = nanoApp
510
- ? { hwAppId: nanoApp, dependencies: dependencies }
511
- : undefined;
512
- tracking.dappSendTransactionRequested(manifest, trackingData);
513
-
514
- const signedTransaction = await new Promise<SignedOperation>((resolve, reject) =>
515
- uiHook["transaction.sign"]({
477
+ (async () => {
478
+ let trackingData: DAppTrackingData | undefined;
479
+ try {
480
+ const signFlowInfos = getWalletAPITransactionSignFlowInfos({
481
+ walletApiTransaction: tx,
516
482
  account: currentAccount,
517
- parentAccount: undefined,
518
- signFlowInfos,
519
- options,
520
- onSuccess: signedOperation => {
521
- resolve(signedOperation);
522
- },
523
- onError: error => {
524
- reject(error);
525
- },
526
- }),
527
- );
528
-
529
- const bridge = getAccountBridge(currentAccount, undefined);
530
- const mainAccount = getMainAccount(currentAccount, undefined);
531
-
532
- let optimisticOperation: Operation = signedTransaction.operation;
533
-
534
- if (!getEnv("DISABLE_TRANSACTION_BROADCAST")) {
535
- optimisticOperation = await bridge.broadcast({
536
- account: mainAccount,
537
- signedOperation: signedTransaction,
538
- broadcastConfig: { mevProtected: !!mevProtected },
539
483
  });
540
- }
541
-
542
- uiHook["transaction.broadcast"](
543
- currentAccount,
544
- undefined,
545
- mainAccount,
546
- optimisticOperation,
547
- );
548
484
 
549
- tracking.dappSendTransactionSuccess(manifest, trackingData);
550
-
551
- postMessage(
552
- JSON.stringify({
553
- id: data.id,
554
- jsonrpc: "2.0",
555
- result: optimisticOperation.hash,
556
- }),
557
- );
558
- } catch (error) {
559
- tracking.dappSendTransactionFail(manifest, trackingData);
485
+ const transactionType = getTxType(signFlowInfos.liveTx as EvmTransaction);
486
+
487
+ const token = await getCryptoAssetsStore().findTokenByAddressInCurrency(
488
+ tx.recipient,
489
+ currentAccount.type === "TokenAccount"
490
+ ? currentAccount.token.parentCurrency.id
491
+ : currentAccount.currency.id,
492
+ );
493
+
494
+ const accountCurrencyName =
495
+ currentAccount.type === "TokenAccount"
496
+ ? currentAccount.token.name
497
+ : currentAccount.currency.name;
498
+
499
+ const accountNetwork =
500
+ currentAccount.type === "TokenAccount"
501
+ ? currentAccount.token.parentCurrency.id
502
+ : currentAccount.currency.id;
503
+
504
+ trackingData = {
505
+ type: transactionType,
506
+ currency: token ? token.name : accountCurrencyName,
507
+ network: token ? token.parentCurrency.id : accountNetwork,
508
+ };
509
+
510
+ const options = nanoApp
511
+ ? { hwAppId: nanoApp, dependencies: dependencies }
512
+ : undefined;
513
+ tracking.dappSendTransactionRequested(manifest, trackingData);
514
+
515
+ const signedTransaction = await new Promise<SignedOperation>((resolve, reject) =>
516
+ uiHook["transaction.sign"]({
517
+ account: currentAccount,
518
+ parentAccount: undefined,
519
+ signFlowInfos,
520
+ options,
521
+ onSuccess: signedOperation => {
522
+ resolve(signedOperation);
523
+ },
524
+ onError: error => {
525
+ reject(error);
526
+ },
527
+ }),
528
+ );
529
+
530
+ const bridge = getAccountBridge(currentAccount, undefined);
531
+ const mainAccount = getMainAccount(currentAccount, undefined);
532
+
533
+ let optimisticOperation: Operation = signedTransaction.operation;
534
+
535
+ if (!getEnv("DISABLE_TRANSACTION_BROADCAST")) {
536
+ optimisticOperation = await bridge.broadcast({
537
+ account: mainAccount,
538
+ signedOperation: signedTransaction,
539
+ broadcastConfig: { mevProtected: !!mevProtected },
540
+ });
541
+ }
542
+
543
+ uiHook["transaction.broadcast"](
544
+ currentAccount,
545
+ undefined,
546
+ mainAccount,
547
+ optimisticOperation,
548
+ );
549
+
550
+ tracking.dappSendTransactionSuccess(manifest, trackingData);
551
+
552
+ postMessage(
553
+ JSON.stringify({
554
+ id: data.id,
555
+ jsonrpc: "2.0",
556
+ result: optimisticOperation.hash,
557
+ }),
558
+ );
559
+ } catch (error) {
560
+ tracking.dappSendTransactionFail(manifest, trackingData);
561
+ postMessage(
562
+ JSON.stringify({
563
+ id: data.id,
564
+ jsonrpc: "2.0",
565
+ error: rejectedError("Transaction declined"),
566
+ }),
567
+ );
568
+ }
569
+ })().catch(error => {
570
+ console.error("Error in eth_sendTransaction handler:", error);
560
571
  postMessage(
561
572
  JSON.stringify({
562
573
  id: data.id,
563
574
  jsonrpc: "2.0",
564
- error: rejectedError("Transaction declined"),
575
+ error: rejectedError("Transaction processing failed"),
565
576
  }),
566
577
  );
567
- }
578
+ });
568
579
  }
569
580
  break;
570
581
  }
@@ -673,13 +684,17 @@ export function useDappLogic({
673
684
  if (ws.current) {
674
685
  ws.current.send(data);
675
686
  } else if (currentNetwork.nodeURL?.startsWith("https:")) {
676
- void network({
687
+ network({
677
688
  method: "POST",
678
689
  url: currentNetwork.nodeURL,
679
690
  data,
680
- }).then(res => {
681
- postMessage(JSON.stringify(res.data));
682
- });
691
+ })
692
+ .then(res => {
693
+ postMessage(JSON.stringify(res.data));
694
+ })
695
+ .catch(() => {
696
+ // Silently ignore network errors
697
+ });
683
698
  }
684
699
  break;
685
700
  }
@@ -4,26 +4,14 @@ import { TokenAccount, Account, AccountLike } from "@ledgerhq/types-live";
4
4
  import { LiveAppManifest } from "../../platform/types";
5
5
  import semver from "semver";
6
6
 
7
- /**
8
- * Determines if a manifest uses (Ledger Live) account ID format or UUID (Wallet API) format.
9
- * @param manifest - The live app manifest to check
10
- * @returns true if the manifest uses encoded format (v3+ dapp), false otherwise
11
- */
12
- export function usesEncodedAccountIdFormat(manifest: LiveAppManifest): boolean {
13
- return (
14
- "dapp" in manifest &&
15
- !!manifest.apiVersion &&
16
- semver.satisfies(WALLET_API_VERSION, manifest.apiVersion)
17
- );
18
- }
19
-
20
7
  /** The dapp connector "v3" uses the ledger live account ID to find the correct account. Live app and dapp browser manifests require wallet API ID. */
21
8
  export function deriveAccountIdForManifest(
22
9
  accountId: Account["id"] | TokenAccount["id"] | AccountLike["id"],
23
10
  walletApiAccountId: WalletAPIAccount["id"] | string,
24
11
  manifest: LiveAppManifest,
25
12
  ) {
26
- if (usesEncodedAccountIdFormat(manifest)) {
13
+ const isDapp = "dapp" in manifest;
14
+ if (isDapp && manifest.apiVersion && semver.satisfies(WALLET_API_VERSION, manifest.apiVersion)) {
27
15
  return accountId;
28
16
  }
29
17
  /** Assume dapp browser <=v2 or live app, fallback to wallet ID. */
@@ -1,2 +0,0 @@
1
- export { getDeviceHasBattery } from "@ledgerhq/device-core";
2
- //# sourceMappingURL=getDeviceHasBattery.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getDeviceHasBattery.d.ts","sourceRoot":"","sources":["../../../src/device/use-cases/getDeviceHasBattery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC"}
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getDeviceHasBattery = void 0;
4
- var device_core_1 = require("@ledgerhq/device-core");
5
- Object.defineProperty(exports, "getDeviceHasBattery", { enumerable: true, get: function () { return device_core_1.getDeviceHasBattery; } });
6
- //# sourceMappingURL=getDeviceHasBattery.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getDeviceHasBattery.js","sourceRoot":"","sources":["../../../src/device/use-cases/getDeviceHasBattery.ts"],"names":[],"mappings":";;;AAAA,qDAA4D;AAAnD,kHAAA,mBAAmB,OAAA"}
@@ -1,6 +0,0 @@
1
- export declare const ReceiveFundsOptions: {
2
- readonly CRYPTO: "crypto";
3
- readonly FIAT: "fiat";
4
- };
5
- export type ReceiveFundsOptionsType = (typeof ReceiveFundsOptions)[keyof typeof ReceiveFundsOptions];
6
- //# sourceMappingURL=ReceiveFundsOptions.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ReceiveFundsOptions.d.ts","sourceRoot":"","sources":["../../../src/e2e/enum/ReceiveFundsOptions.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB;;;CAGtB,CAAC;AAEX,MAAM,MAAM,uBAAuB,GACjC,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,OAAO,mBAAmB,CAAC,CAAC"}
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ReceiveFundsOptions = void 0;
4
- exports.ReceiveFundsOptions = {
5
- CRYPTO: "crypto",
6
- FIAT: "fiat",
7
- };
8
- //# sourceMappingURL=ReceiveFundsOptions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ReceiveFundsOptions.js","sourceRoot":"","sources":["../../../src/e2e/enum/ReceiveFundsOptions.ts"],"names":[],"mappings":";;;AAAa,QAAA,mBAAmB,GAAG;IACjC,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,MAAM;CACJ,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"groupCurrenciesByAsset.d.ts","sourceRoot":"","sources":["../../../src/modularDrawer/utils/groupCurrenciesByAsset.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAEnC,eAAO,MAAM,sBAAsB,iBAAkB,SAAS,EAAE;kBAG5C,qBAAqB;gBAAc,qBAAqB,EAAE;EAoB7E,CAAC"}
@@ -1,21 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.groupCurrenciesByAsset = void 0;
4
- const groupCurrenciesByAsset = (assetsSorted) => {
5
- const assetMap = new Map();
6
- if (assetsSorted) {
7
- for (const item of assetsSorted) {
8
- const { asset: { id: assetId }, networks = [], } = item;
9
- if (networks?.length > 0) {
10
- const mainCurrency = networks.find(c => c.id === assetId) ?? networks[0];
11
- assetMap.set(assetId, {
12
- mainCurrency,
13
- currencies: networks,
14
- });
15
- }
16
- }
17
- }
18
- return assetMap;
19
- };
20
- exports.groupCurrenciesByAsset = groupCurrenciesByAsset;
21
- //# sourceMappingURL=groupCurrenciesByAsset.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"groupCurrenciesByAsset.js","sourceRoot":"","sources":["../../../src/modularDrawer/utils/groupCurrenciesByAsset.ts"],"names":[],"mappings":";;;AAGO,MAAM,sBAAsB,GAAG,CAAC,YAAyB,EAAE,EAAE;IAClE,MAAM,QAAQ,GAAG,IAAI,GAAG,EAGrB,CAAC;IAEJ,IAAI,YAAY,EAAE;QAChB,KAAK,MAAM,IAAI,IAAI,YAAY,EAAE;YAC/B,MAAM,EACJ,KAAK,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,EACtB,QAAQ,GAAG,EAAE,GACd,GAAG,IAAI,CAAC;YACT,IAAI,QAAQ,EAAE,MAAM,GAAG,CAAC,EAAE;gBACxB,MAAM,YAAY,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,OAAO,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC,CAAC;gBACzE,QAAQ,CAAC,GAAG,CAAC,OAAO,EAAE;oBACpB,YAAY;oBACZ,UAAU,EAAE,QAAQ;iBACrB,CAAC,CAAC;aACJ;SACF;KACF;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC;AAvBW,QAAA,sBAAsB,0BAuBjC"}
@@ -1,2 +0,0 @@
1
- export { getDeviceHasBattery } from "@ledgerhq/device-core";
2
- //# sourceMappingURL=getDeviceHasBattery.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getDeviceHasBattery.d.ts","sourceRoot":"","sources":["../../../src/device/use-cases/getDeviceHasBattery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC"}
@@ -1,2 +0,0 @@
1
- export { getDeviceHasBattery } from "@ledgerhq/device-core";
2
- //# sourceMappingURL=getDeviceHasBattery.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getDeviceHasBattery.js","sourceRoot":"","sources":["../../../src/device/use-cases/getDeviceHasBattery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC"}
@@ -1,6 +0,0 @@
1
- export declare const ReceiveFundsOptions: {
2
- readonly CRYPTO: "crypto";
3
- readonly FIAT: "fiat";
4
- };
5
- export type ReceiveFundsOptionsType = (typeof ReceiveFundsOptions)[keyof typeof ReceiveFundsOptions];
6
- //# sourceMappingURL=ReceiveFundsOptions.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ReceiveFundsOptions.d.ts","sourceRoot":"","sources":["../../../src/e2e/enum/ReceiveFundsOptions.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB;;;CAGtB,CAAC;AAEX,MAAM,MAAM,uBAAuB,GACjC,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,OAAO,mBAAmB,CAAC,CAAC"}
@@ -1,5 +0,0 @@
1
- export const ReceiveFundsOptions = {
2
- CRYPTO: "crypto",
3
- FIAT: "fiat",
4
- };
5
- //# sourceMappingURL=ReceiveFundsOptions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ReceiveFundsOptions.js","sourceRoot":"","sources":["../../../src/e2e/enum/ReceiveFundsOptions.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,MAAM;CACJ,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"groupCurrenciesByAsset.d.ts","sourceRoot":"","sources":["../../../src/modularDrawer/utils/groupCurrenciesByAsset.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAEnC,eAAO,MAAM,sBAAsB,iBAAkB,SAAS,EAAE;kBAG5C,qBAAqB;gBAAc,qBAAqB,EAAE;EAoB7E,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"groupCurrenciesByAsset.js","sourceRoot":"","sources":["../../../src/modularDrawer/utils/groupCurrenciesByAsset.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,YAAyB,EAAE,EAAE;IAClE,MAAM,QAAQ,GAAG,IAAI,GAAG,EAGrB,CAAC;IAEJ,IAAI,YAAY,EAAE;QAChB,KAAK,MAAM,IAAI,IAAI,YAAY,EAAE;YAC/B,MAAM,EACJ,KAAK,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,EACtB,QAAQ,GAAG,EAAE,GACd,GAAG,IAAI,CAAC;YACT,IAAI,QAAQ,EAAE,MAAM,GAAG,CAAC,EAAE;gBACxB,MAAM,YAAY,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,OAAO,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC,CAAC;gBACzE,QAAQ,CAAC,GAAG,CAAC,OAAO,EAAE;oBACpB,YAAY;oBACZ,UAAU,EAAE,QAAQ;iBACrB,CAAC,CAAC;aACJ;SACF;KACF;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC"}
@@ -1 +0,0 @@
1
- export { getDeviceHasBattery } from "@ledgerhq/device-core";
@@ -1,7 +0,0 @@
1
- export const ReceiveFundsOptions = {
2
- CRYPTO: "crypto",
3
- FIAT: "fiat",
4
- } as const;
5
-
6
- export type ReceiveFundsOptionsType =
7
- (typeof ReceiveFundsOptions)[keyof typeof ReceiveFundsOptions];
@@ -1,88 +0,0 @@
1
- import { groupCurrenciesByAsset } from "../groupCurrenciesByAsset";
2
- import { AssetData } from "../type";
3
- import {
4
- mockBtcCryptoCurrency,
5
- mockEthCryptoCurrency,
6
- mockBaseCryptoCurrency,
7
- } from "../../__mocks__/currencies.mock";
8
-
9
- describe("groupCurrenciesByAsset", () => {
10
- it("should return an empty map when given an empty array", () => {
11
- const result = groupCurrenciesByAsset([]);
12
- expect(result).toBeInstanceOf(Map);
13
- expect(result.size).toBe(0);
14
- });
15
-
16
- it("should skip assets with empty networks array", () => {
17
- const assetData: AssetData[] = [
18
- {
19
- asset: {
20
- id: "bitcoin",
21
- ticker: "BTC",
22
- name: "Bitcoin",
23
- assetsIds: {},
24
- },
25
- networks: [],
26
- },
27
- ];
28
-
29
- const result = groupCurrenciesByAsset(assetData);
30
- expect(result.size).toBe(0);
31
- });
32
-
33
- it("should group a single asset with matching providerId as mainCurrency", () => {
34
- const assetData: AssetData[] = [
35
- {
36
- asset: {
37
- id: "ethereum",
38
- ticker: "ETH",
39
- name: "Ethereum",
40
- assetsIds: {},
41
- },
42
- networks: [mockBaseCryptoCurrency, mockEthCryptoCurrency],
43
- },
44
- ];
45
-
46
- const result = groupCurrenciesByAsset(assetData);
47
- expect(result.size).toBe(1);
48
- expect(result.has("ethereum")).toBe(true);
49
-
50
- const grouped = result.get("ethereum");
51
- expect(grouped?.mainCurrency).toEqual(mockEthCryptoCurrency);
52
- expect(grouped?.currencies).toEqual([mockBaseCryptoCurrency, mockEthCryptoCurrency]);
53
- });
54
-
55
- it("should group multiple assets correctly", () => {
56
- const assetData: AssetData[] = [
57
- {
58
- asset: {
59
- id: "bitcoin",
60
- ticker: "BTC",
61
- name: "Bitcoin",
62
- assetsIds: {},
63
- },
64
- networks: [mockBtcCryptoCurrency],
65
- },
66
- {
67
- asset: {
68
- id: "ethereum",
69
- ticker: "ETH",
70
- name: "Ethereum",
71
- assetsIds: {},
72
- },
73
- networks: [mockEthCryptoCurrency, mockBaseCryptoCurrency],
74
- },
75
- ];
76
-
77
- const result = groupCurrenciesByAsset(assetData);
78
- expect(result.size).toBe(2);
79
- expect(result.has("bitcoin")).toBe(true);
80
- expect(result.has("ethereum")).toBe(true);
81
-
82
- const btcGrouped = result.get("bitcoin");
83
- expect(btcGrouped?.mainCurrency).toEqual(mockBtcCryptoCurrency);
84
-
85
- const ethGrouped = result.get("ethereum");
86
- expect(ethGrouped?.mainCurrency).toEqual(mockEthCryptoCurrency);
87
- });
88
- });