@ledgerhq/live-common 34.47.0-nightly.7 → 34.47.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 (370) hide show
  1. package/lib/bridge/crypto-assets/index.d.ts.map +1 -1
  2. package/lib/bridge/crypto-assets/index.js +0 -4
  3. package/lib/bridge/crypto-assets/index.js.map +1 -1
  4. package/lib/bridge/crypto-assets/index.test.js +0 -36
  5. package/lib/bridge/crypto-assets/index.test.js.map +1 -1
  6. package/lib/bridge/generic-alpaca/alpaca/index.d.ts.map +1 -1
  7. package/lib/bridge/generic-alpaca/alpaca/index.js +1 -6
  8. package/lib/bridge/generic-alpaca/alpaca/index.js.map +1 -1
  9. package/lib/bridge/generic-alpaca/alpaca/network/network-alpaca.js +1 -1
  10. package/lib/bridge/generic-alpaca/alpaca/network/network-alpaca.js.map +1 -1
  11. package/lib/bridge/generic-alpaca/buildSubAccounts.d.ts +3 -2
  12. package/lib/bridge/generic-alpaca/buildSubAccounts.d.ts.map +1 -1
  13. package/lib/bridge/generic-alpaca/buildSubAccounts.js +12 -3
  14. package/lib/bridge/generic-alpaca/buildSubAccounts.js.map +1 -1
  15. package/lib/bridge/generic-alpaca/getAccountShape.d.ts.map +1 -1
  16. package/lib/bridge/generic-alpaca/getAccountShape.js +4 -4
  17. package/lib/bridge/generic-alpaca/getAccountShape.js.map +1 -1
  18. package/lib/bridge/generic-alpaca/tests/utils.test.d.ts.map +1 -0
  19. package/lib/bridge/generic-alpaca/tests/utils.test.js +20 -0
  20. package/lib/bridge/generic-alpaca/tests/utils.test.js.map +1 -0
  21. package/lib/bridge/generic-alpaca/utils.d.ts.map +1 -1
  22. package/lib/bridge/generic-alpaca/utils.js +2 -5
  23. package/lib/bridge/generic-alpaca/utils.js.map +1 -1
  24. package/lib/e2e/enum/DeviceLabels.d.ts +1 -3
  25. package/lib/e2e/enum/DeviceLabels.d.ts.map +1 -1
  26. package/lib/e2e/enum/DeviceLabels.js +0 -2
  27. package/lib/e2e/enum/DeviceLabels.js.map +1 -1
  28. package/lib/e2e/families/tezos.d.ts.map +1 -1
  29. package/lib/e2e/families/tezos.js +0 -2
  30. package/lib/e2e/families/tezos.js.map +1 -1
  31. package/lib/e2e/index.d.ts +4 -4
  32. package/lib/e2e/speculos.d.ts +0 -1
  33. package/lib/e2e/speculos.d.ts.map +1 -1
  34. package/lib/e2e/speculos.js +2 -12
  35. package/lib/e2e/speculos.js.map +1 -1
  36. package/lib/exchange/platform/transfer/completeExchange.d.ts.map +1 -1
  37. package/lib/exchange/platform/transfer/completeExchange.js +5 -3
  38. package/lib/exchange/platform/transfer/completeExchange.js.map +1 -1
  39. package/lib/exchange/swap/completeExchange.d.ts.map +1 -1
  40. package/lib/exchange/swap/completeExchange.js +2 -5
  41. package/lib/exchange/swap/completeExchange.js.map +1 -1
  42. package/lib/exchange/swap/initSwap.d.ts.map +1 -1
  43. package/lib/exchange/swap/initSwap.js +2 -5
  44. package/lib/exchange/swap/initSwap.js.map +1 -1
  45. package/lib/families/canton/config.d.ts.map +1 -1
  46. package/lib/families/canton/config.js +0 -4
  47. package/lib/families/canton/config.js.map +1 -1
  48. package/lib/families/solana/setup.d.ts.map +1 -1
  49. package/lib/families/solana/setup.js +0 -9
  50. package/lib/families/solana/setup.js.map +1 -1
  51. package/lib/featureFlags/defaultFeatures.js +1 -1
  52. package/lib/featureFlags/defaultFeatures.js.map +1 -1
  53. package/lib/featureFlags/useFeature.d.ts +1 -1
  54. package/lib/featureFlags/useFeature.d.ts.map +1 -1
  55. package/lib/modularDrawer/data/state-manager/api.d.ts +37 -727
  56. package/lib/modularDrawer/data/state-manager/api.d.ts.map +1 -1
  57. package/lib/modularDrawer/data/state-manager/api.js +17 -38
  58. package/lib/modularDrawer/data/state-manager/api.js.map +1 -1
  59. package/lib/modularDrawer/hooks/__test__/useAssetsData.test.js +78 -134
  60. package/lib/modularDrawer/hooks/__test__/useAssetsData.test.js.map +1 -1
  61. package/{lib-es/modularDrawer/hooks → lib/modularDrawer/hooks/modules}/useAssetAccountCounts.d.ts +1 -1
  62. package/lib/modularDrawer/hooks/modules/useAssetAccountCounts.d.ts.map +1 -0
  63. package/lib/modularDrawer/hooks/{useAssetAccountCounts.js → modules/useAssetAccountCounts.js} +1 -1
  64. package/lib/modularDrawer/hooks/modules/useAssetAccountCounts.js.map +1 -0
  65. package/lib/modularDrawer/hooks/modules/useLeftApyModule.d.ts +3 -3
  66. package/lib/modularDrawer/hooks/modules/useLeftApyModule.d.ts.map +1 -1
  67. package/lib/modularDrawer/hooks/modules/useLeftApyModule.js +10 -59
  68. package/lib/modularDrawer/hooks/modules/useLeftApyModule.js.map +1 -1
  69. package/lib/modularDrawer/hooks/useAssetsData.d.ts +6 -10
  70. package/lib/modularDrawer/hooks/useAssetsData.d.ts.map +1 -1
  71. package/lib/modularDrawer/hooks/useAssetsData.js +17 -40
  72. package/lib/modularDrawer/hooks/useAssetsData.js.map +1 -1
  73. package/lib/modularDrawer/types.d.ts +2 -0
  74. package/lib/modularDrawer/types.d.ts.map +1 -0
  75. package/lib/modularDrawer/types.js +3 -0
  76. package/lib/modularDrawer/types.js.map +1 -0
  77. package/lib/modularDrawer/utils/type.d.ts +1 -89
  78. package/lib/modularDrawer/utils/type.d.ts.map +1 -1
  79. package/lib/wallet-api/Exchange/server.js +2 -2
  80. package/lib/wallet-api/Exchange/server.js.map +1 -1
  81. package/lib/wallet-api/react.d.ts +0 -2
  82. package/lib/wallet-api/react.d.ts.map +1 -1
  83. package/lib/wallet-api/react.js +1 -3
  84. package/lib/wallet-api/react.js.map +1 -1
  85. package/lib-es/bridge/crypto-assets/index.d.ts.map +1 -1
  86. package/lib-es/bridge/crypto-assets/index.js +0 -4
  87. package/lib-es/bridge/crypto-assets/index.js.map +1 -1
  88. package/lib-es/bridge/crypto-assets/index.test.js +0 -36
  89. package/lib-es/bridge/crypto-assets/index.test.js.map +1 -1
  90. package/lib-es/bridge/generic-alpaca/alpaca/index.d.ts.map +1 -1
  91. package/lib-es/bridge/generic-alpaca/alpaca/index.js +1 -6
  92. package/lib-es/bridge/generic-alpaca/alpaca/index.js.map +1 -1
  93. package/lib-es/bridge/generic-alpaca/alpaca/network/network-alpaca.js +1 -1
  94. package/lib-es/bridge/generic-alpaca/alpaca/network/network-alpaca.js.map +1 -1
  95. package/lib-es/bridge/generic-alpaca/buildSubAccounts.d.ts +3 -2
  96. package/lib-es/bridge/generic-alpaca/buildSubAccounts.d.ts.map +1 -1
  97. package/lib-es/bridge/generic-alpaca/buildSubAccounts.js +9 -2
  98. package/lib-es/bridge/generic-alpaca/buildSubAccounts.js.map +1 -1
  99. package/lib-es/bridge/generic-alpaca/getAccountShape.d.ts.map +1 -1
  100. package/lib-es/bridge/generic-alpaca/getAccountShape.js +3 -3
  101. package/lib-es/bridge/generic-alpaca/getAccountShape.js.map +1 -1
  102. package/lib-es/bridge/generic-alpaca/tests/utils.test.d.ts.map +1 -0
  103. package/lib-es/bridge/generic-alpaca/tests/utils.test.js +18 -0
  104. package/lib-es/bridge/generic-alpaca/tests/utils.test.js.map +1 -0
  105. package/lib-es/bridge/generic-alpaca/utils.d.ts.map +1 -1
  106. package/lib-es/bridge/generic-alpaca/utils.js +2 -5
  107. package/lib-es/bridge/generic-alpaca/utils.js.map +1 -1
  108. package/lib-es/e2e/enum/DeviceLabels.d.ts +1 -3
  109. package/lib-es/e2e/enum/DeviceLabels.d.ts.map +1 -1
  110. package/lib-es/e2e/enum/DeviceLabels.js +0 -2
  111. package/lib-es/e2e/enum/DeviceLabels.js.map +1 -1
  112. package/lib-es/e2e/families/tezos.d.ts.map +1 -1
  113. package/lib-es/e2e/families/tezos.js +0 -2
  114. package/lib-es/e2e/families/tezos.js.map +1 -1
  115. package/lib-es/e2e/index.d.ts +4 -4
  116. package/lib-es/e2e/speculos.d.ts +0 -1
  117. package/lib-es/e2e/speculos.d.ts.map +1 -1
  118. package/lib-es/e2e/speculos.js +1 -10
  119. package/lib-es/e2e/speculos.js.map +1 -1
  120. package/lib-es/exchange/platform/transfer/completeExchange.d.ts.map +1 -1
  121. package/lib-es/exchange/platform/transfer/completeExchange.js +2 -3
  122. package/lib-es/exchange/platform/transfer/completeExchange.js.map +1 -1
  123. package/lib-es/exchange/swap/completeExchange.d.ts.map +1 -1
  124. package/lib-es/exchange/swap/completeExchange.js +2 -5
  125. package/lib-es/exchange/swap/completeExchange.js.map +1 -1
  126. package/lib-es/exchange/swap/initSwap.d.ts.map +1 -1
  127. package/lib-es/exchange/swap/initSwap.js +2 -5
  128. package/lib-es/exchange/swap/initSwap.js.map +1 -1
  129. package/lib-es/families/canton/config.d.ts.map +1 -1
  130. package/lib-es/families/canton/config.js +0 -4
  131. package/lib-es/families/canton/config.js.map +1 -1
  132. package/lib-es/families/solana/setup.d.ts.map +1 -1
  133. package/lib-es/families/solana/setup.js +0 -9
  134. package/lib-es/families/solana/setup.js.map +1 -1
  135. package/lib-es/featureFlags/defaultFeatures.js +1 -1
  136. package/lib-es/featureFlags/defaultFeatures.js.map +1 -1
  137. package/lib-es/featureFlags/useFeature.d.ts +1 -1
  138. package/lib-es/featureFlags/useFeature.d.ts.map +1 -1
  139. package/lib-es/modularDrawer/data/state-manager/api.d.ts +37 -727
  140. package/lib-es/modularDrawer/data/state-manager/api.d.ts.map +1 -1
  141. package/lib-es/modularDrawer/data/state-manager/api.js +14 -35
  142. package/lib-es/modularDrawer/data/state-manager/api.js.map +1 -1
  143. package/lib-es/modularDrawer/hooks/__test__/useAssetsData.test.js +79 -135
  144. package/lib-es/modularDrawer/hooks/__test__/useAssetsData.test.js.map +1 -1
  145. package/{lib/modularDrawer/hooks → lib-es/modularDrawer/hooks/modules}/useAssetAccountCounts.d.ts +1 -1
  146. package/lib-es/modularDrawer/hooks/modules/useAssetAccountCounts.d.ts.map +1 -0
  147. package/lib-es/modularDrawer/hooks/{useAssetAccountCounts.js → modules/useAssetAccountCounts.js} +1 -1
  148. package/lib-es/modularDrawer/hooks/modules/useAssetAccountCounts.js.map +1 -0
  149. package/lib-es/modularDrawer/hooks/modules/useLeftApyModule.d.ts +3 -3
  150. package/lib-es/modularDrawer/hooks/modules/useLeftApyModule.d.ts.map +1 -1
  151. package/lib-es/modularDrawer/hooks/modules/useLeftApyModule.js +8 -37
  152. package/lib-es/modularDrawer/hooks/modules/useLeftApyModule.js.map +1 -1
  153. package/lib-es/modularDrawer/hooks/useAssetsData.d.ts +6 -10
  154. package/lib-es/modularDrawer/hooks/useAssetsData.d.ts.map +1 -1
  155. package/lib-es/modularDrawer/hooks/useAssetsData.js +19 -42
  156. package/lib-es/modularDrawer/hooks/useAssetsData.js.map +1 -1
  157. package/lib-es/modularDrawer/types.d.ts +2 -0
  158. package/lib-es/modularDrawer/types.d.ts.map +1 -0
  159. package/lib-es/modularDrawer/types.js +2 -0
  160. package/lib-es/modularDrawer/types.js.map +1 -0
  161. package/lib-es/modularDrawer/utils/type.d.ts +1 -89
  162. package/lib-es/modularDrawer/utils/type.d.ts.map +1 -1
  163. package/lib-es/wallet-api/Exchange/server.js +2 -2
  164. package/lib-es/wallet-api/Exchange/server.js.map +1 -1
  165. package/lib-es/wallet-api/react.d.ts +0 -2
  166. package/lib-es/wallet-api/react.d.ts.map +1 -1
  167. package/lib-es/wallet-api/react.js +1 -3
  168. package/lib-es/wallet-api/react.js.map +1 -1
  169. package/package.json +77 -77
  170. package/src/bridge/crypto-assets/index.test.ts +0 -47
  171. package/src/bridge/crypto-assets/index.ts +0 -5
  172. package/src/bridge/generic-alpaca/alpaca/index.ts +1 -14
  173. package/src/bridge/generic-alpaca/alpaca/network/network-alpaca.ts +1 -1
  174. package/src/bridge/generic-alpaca/buildSubAccounts.ts +11 -3
  175. package/src/bridge/generic-alpaca/getAccountShape.ts +4 -3
  176. package/src/bridge/generic-alpaca/tests/utils.test.ts +19 -0
  177. package/src/bridge/generic-alpaca/utils.ts +2 -6
  178. package/src/e2e/enum/DeviceLabels.ts +0 -2
  179. package/src/e2e/families/tezos.ts +0 -2
  180. package/src/e2e/speculos.ts +1 -11
  181. package/src/exchange/platform/transfer/completeExchange.ts +2 -3
  182. package/src/exchange/swap/completeExchange.ts +2 -5
  183. package/src/exchange/swap/initSwap.ts +4 -5
  184. package/src/families/canton/config.ts +0 -5
  185. package/src/families/solana/setup.ts +0 -9
  186. package/src/featureFlags/defaultFeatures.ts +1 -1
  187. package/src/modularDrawer/data/state-manager/api.ts +27 -42
  188. package/src/modularDrawer/hooks/__test__/useAssetsData.test.ts +80 -141
  189. package/src/modularDrawer/hooks/{useAssetAccountCounts.tsx → modules/useAssetAccountCounts.tsx} +2 -2
  190. package/src/modularDrawer/hooks/modules/useLeftApyModule.tsx +9 -42
  191. package/src/modularDrawer/hooks/useAssetsData.ts +22 -59
  192. package/src/modularDrawer/types.ts +1 -0
  193. package/src/modularDrawer/utils/type.ts +0 -97
  194. package/src/wallet-api/Exchange/server.ts +2 -2
  195. package/src/wallet-api/react.ts +1 -5
  196. package/lib/bridge/crypto-assets/cal-integration.d.ts +0 -4
  197. package/lib/bridge/crypto-assets/cal-integration.d.ts.map +0 -1
  198. package/lib/bridge/crypto-assets/cal-integration.js +0 -26
  199. package/lib/bridge/crypto-assets/cal-integration.js.map +0 -1
  200. package/lib/bridge/crypto-assets/cal-integration.test.d.ts +0 -2
  201. package/lib/bridge/crypto-assets/cal-integration.test.d.ts.map +0 -1
  202. package/lib/bridge/crypto-assets/cal-integration.test.js +0 -45
  203. package/lib/bridge/crypto-assets/cal-integration.test.js.map +0 -1
  204. package/lib/bridge/crypto-assets/cal-store.d.ts +0 -14
  205. package/lib/bridge/crypto-assets/cal-store.d.ts.map +0 -1
  206. package/lib/bridge/crypto-assets/cal-store.js +0 -58
  207. package/lib/bridge/crypto-assets/cal-store.js.map +0 -1
  208. package/lib/bridge/crypto-assets/cal-store.test.d.ts +0 -2
  209. package/lib/bridge/crypto-assets/cal-store.test.d.ts.map +0 -1
  210. package/lib/bridge/crypto-assets/cal-store.test.js +0 -70
  211. package/lib/bridge/crypto-assets/cal-store.test.js.map +0 -1
  212. package/lib/bridge/generic-alpaca/alpaca/index.unit.test.d.ts +0 -2
  213. package/lib/bridge/generic-alpaca/alpaca/index.unit.test.d.ts.map +0 -1
  214. package/lib/bridge/generic-alpaca/alpaca/index.unit.test.js +0 -89
  215. package/lib/bridge/generic-alpaca/alpaca/index.unit.test.js.map +0 -1
  216. package/lib/bridge/generic-alpaca/utils.test.d.ts.map +0 -1
  217. package/lib/bridge/generic-alpaca/utils.test.js +0 -123
  218. package/lib/bridge/generic-alpaca/utils.test.js.map +0 -1
  219. package/lib/modularDrawer/__mocks__/dada.mock.d.ts +0 -3336
  220. package/lib/modularDrawer/__mocks__/dada.mock.d.ts.map +0 -1
  221. package/lib/modularDrawer/__mocks__/dada.mock.js +0 -3879
  222. package/lib/modularDrawer/__mocks__/dada.mock.js.map +0 -1
  223. package/lib/modularDrawer/data/entities/interestRateSelectors.d.ts +0 -16
  224. package/lib/modularDrawer/data/entities/interestRateSelectors.d.ts.map +0 -1
  225. package/lib/modularDrawer/data/entities/interestRateSelectors.js +0 -21
  226. package/lib/modularDrawer/data/entities/interestRateSelectors.js.map +0 -1
  227. package/lib/modularDrawer/data/state-manager/types.d.ts +0 -24
  228. package/lib/modularDrawer/data/state-manager/types.d.ts.map +0 -1
  229. package/lib/modularDrawer/data/state-manager/types.js +0 -13
  230. package/lib/modularDrawer/data/state-manager/types.js.map +0 -1
  231. package/lib/modularDrawer/hooks/useAssetAccountCounts.d.ts.map +0 -1
  232. package/lib/modularDrawer/hooks/useAssetAccountCounts.js.map +0 -1
  233. package/lib/modularDrawer/hooks/useLeftAccounts.d.ts +0 -13
  234. package/lib/modularDrawer/hooks/useLeftAccounts.d.ts.map +0 -1
  235. package/lib/modularDrawer/hooks/useLeftAccounts.js +0 -15
  236. package/lib/modularDrawer/hooks/useLeftAccounts.js.map +0 -1
  237. package/lib/modularDrawer/hooks/useLeftAccountsApy.d.ts +0 -6
  238. package/lib/modularDrawer/hooks/useLeftAccountsApy.d.ts.map +0 -1
  239. package/lib/modularDrawer/hooks/useLeftAccountsApy.js +0 -19
  240. package/lib/modularDrawer/hooks/useLeftAccountsApy.js.map +0 -1
  241. package/lib/modularDrawer/hooks/useLeftApy.d.ts +0 -54
  242. package/lib/modularDrawer/hooks/useLeftApy.d.ts.map +0 -1
  243. package/lib/modularDrawer/hooks/useLeftApy.js +0 -15
  244. package/lib/modularDrawer/hooks/useLeftApy.js.map +0 -1
  245. package/lib/modularDrawer/hooks/useRightBalanceAsset.d.ts +0 -57
  246. package/lib/modularDrawer/hooks/useRightBalanceAsset.d.ts.map +0 -1
  247. package/lib/modularDrawer/hooks/useRightBalanceAsset.js +0 -87
  248. package/lib/modularDrawer/hooks/useRightBalanceAsset.js.map +0 -1
  249. package/lib/modularDrawer/hooks/useRightBalanceNetwork.d.ts +0 -63
  250. package/lib/modularDrawer/hooks/useRightBalanceNetwork.d.ts.map +0 -1
  251. package/lib/modularDrawer/hooks/useRightBalanceNetwork.js +0 -66
  252. package/lib/modularDrawer/hooks/useRightBalanceNetwork.js.map +0 -1
  253. package/lib/modularDrawer/modules/createAssetConfiguration.d.ts +0 -4
  254. package/lib/modularDrawer/modules/createAssetConfiguration.d.ts.map +0 -1
  255. package/lib/modularDrawer/modules/createAssetConfiguration.js +0 -41
  256. package/lib/modularDrawer/modules/createAssetConfiguration.js.map +0 -1
  257. package/lib/modularDrawer/modules/createNetworkConfiguration.d.ts +0 -6
  258. package/lib/modularDrawer/modules/createNetworkConfiguration.d.ts.map +0 -1
  259. package/lib/modularDrawer/modules/createNetworkConfiguration.js +0 -56
  260. package/lib/modularDrawer/modules/createNetworkConfiguration.js.map +0 -1
  261. package/lib/modularDrawer/utils/buildProviderCurrenciesMap.d.ts +0 -9
  262. package/lib/modularDrawer/utils/buildProviderCurrenciesMap.d.ts.map +0 -1
  263. package/lib/modularDrawer/utils/buildProviderCurrenciesMap.js +0 -17
  264. package/lib/modularDrawer/utils/buildProviderCurrenciesMap.js.map +0 -1
  265. package/lib/modularDrawer/utils/getLoadingStatus.d.ts +0 -9
  266. package/lib/modularDrawer/utils/getLoadingStatus.d.ts.map +0 -1
  267. package/lib/modularDrawer/utils/getLoadingStatus.js +0 -18
  268. package/lib/modularDrawer/utils/getLoadingStatus.js.map +0 -1
  269. package/lib/modularDrawer/utils/sortByBalance.d.ts +0 -6
  270. package/lib/modularDrawer/utils/sortByBalance.d.ts.map +0 -1
  271. package/lib/modularDrawer/utils/sortByBalance.js +0 -32
  272. package/lib/modularDrawer/utils/sortByBalance.js.map +0 -1
  273. package/lib-es/bridge/crypto-assets/cal-integration.d.ts +0 -4
  274. package/lib-es/bridge/crypto-assets/cal-integration.d.ts.map +0 -1
  275. package/lib-es/bridge/crypto-assets/cal-integration.js +0 -21
  276. package/lib-es/bridge/crypto-assets/cal-integration.js.map +0 -1
  277. package/lib-es/bridge/crypto-assets/cal-integration.test.d.ts +0 -2
  278. package/lib-es/bridge/crypto-assets/cal-integration.test.d.ts.map +0 -1
  279. package/lib-es/bridge/crypto-assets/cal-integration.test.js +0 -43
  280. package/lib-es/bridge/crypto-assets/cal-integration.test.js.map +0 -1
  281. package/lib-es/bridge/crypto-assets/cal-store.d.ts +0 -14
  282. package/lib-es/bridge/crypto-assets/cal-store.d.ts.map +0 -1
  283. package/lib-es/bridge/crypto-assets/cal-store.js +0 -54
  284. package/lib-es/bridge/crypto-assets/cal-store.js.map +0 -1
  285. package/lib-es/bridge/crypto-assets/cal-store.test.d.ts +0 -2
  286. package/lib-es/bridge/crypto-assets/cal-store.test.d.ts.map +0 -1
  287. package/lib-es/bridge/crypto-assets/cal-store.test.js +0 -68
  288. package/lib-es/bridge/crypto-assets/cal-store.test.js.map +0 -1
  289. package/lib-es/bridge/generic-alpaca/alpaca/index.unit.test.d.ts +0 -2
  290. package/lib-es/bridge/generic-alpaca/alpaca/index.unit.test.d.ts.map +0 -1
  291. package/lib-es/bridge/generic-alpaca/alpaca/index.unit.test.js +0 -64
  292. package/lib-es/bridge/generic-alpaca/alpaca/index.unit.test.js.map +0 -1
  293. package/lib-es/bridge/generic-alpaca/utils.test.d.ts.map +0 -1
  294. package/lib-es/bridge/generic-alpaca/utils.test.js +0 -118
  295. package/lib-es/bridge/generic-alpaca/utils.test.js.map +0 -1
  296. package/lib-es/modularDrawer/__mocks__/dada.mock.d.ts +0 -3336
  297. package/lib-es/modularDrawer/__mocks__/dada.mock.d.ts.map +0 -1
  298. package/lib-es/modularDrawer/__mocks__/dada.mock.js +0 -3876
  299. package/lib-es/modularDrawer/__mocks__/dada.mock.js.map +0 -1
  300. package/lib-es/modularDrawer/data/entities/interestRateSelectors.d.ts +0 -16
  301. package/lib-es/modularDrawer/data/entities/interestRateSelectors.d.ts.map +0 -1
  302. package/lib-es/modularDrawer/data/entities/interestRateSelectors.js +0 -18
  303. package/lib-es/modularDrawer/data/entities/interestRateSelectors.js.map +0 -1
  304. package/lib-es/modularDrawer/data/state-manager/types.d.ts +0 -24
  305. package/lib-es/modularDrawer/data/state-manager/types.d.ts.map +0 -1
  306. package/lib-es/modularDrawer/data/state-manager/types.js +0 -10
  307. package/lib-es/modularDrawer/data/state-manager/types.js.map +0 -1
  308. package/lib-es/modularDrawer/hooks/useAssetAccountCounts.d.ts.map +0 -1
  309. package/lib-es/modularDrawer/hooks/useAssetAccountCounts.js.map +0 -1
  310. package/lib-es/modularDrawer/hooks/useLeftAccounts.d.ts +0 -13
  311. package/lib-es/modularDrawer/hooks/useLeftAccounts.d.ts.map +0 -1
  312. package/lib-es/modularDrawer/hooks/useLeftAccounts.js +0 -11
  313. package/lib-es/modularDrawer/hooks/useLeftAccounts.js.map +0 -1
  314. package/lib-es/modularDrawer/hooks/useLeftAccountsApy.d.ts +0 -6
  315. package/lib-es/modularDrawer/hooks/useLeftAccountsApy.d.ts.map +0 -1
  316. package/lib-es/modularDrawer/hooks/useLeftAccountsApy.js +0 -15
  317. package/lib-es/modularDrawer/hooks/useLeftAccountsApy.js.map +0 -1
  318. package/lib-es/modularDrawer/hooks/useLeftApy.d.ts +0 -54
  319. package/lib-es/modularDrawer/hooks/useLeftApy.d.ts.map +0 -1
  320. package/lib-es/modularDrawer/hooks/useLeftApy.js +0 -11
  321. package/lib-es/modularDrawer/hooks/useLeftApy.js.map +0 -1
  322. package/lib-es/modularDrawer/hooks/useRightBalanceAsset.d.ts +0 -57
  323. package/lib-es/modularDrawer/hooks/useRightBalanceAsset.d.ts.map +0 -1
  324. package/lib-es/modularDrawer/hooks/useRightBalanceAsset.js +0 -83
  325. package/lib-es/modularDrawer/hooks/useRightBalanceAsset.js.map +0 -1
  326. package/lib-es/modularDrawer/hooks/useRightBalanceNetwork.d.ts +0 -63
  327. package/lib-es/modularDrawer/hooks/useRightBalanceNetwork.d.ts.map +0 -1
  328. package/lib-es/modularDrawer/hooks/useRightBalanceNetwork.js +0 -62
  329. package/lib-es/modularDrawer/hooks/useRightBalanceNetwork.js.map +0 -1
  330. package/lib-es/modularDrawer/modules/createAssetConfiguration.d.ts +0 -4
  331. package/lib-es/modularDrawer/modules/createAssetConfiguration.d.ts.map +0 -1
  332. package/lib-es/modularDrawer/modules/createAssetConfiguration.js +0 -39
  333. package/lib-es/modularDrawer/modules/createAssetConfiguration.js.map +0 -1
  334. package/lib-es/modularDrawer/modules/createNetworkConfiguration.d.ts +0 -6
  335. package/lib-es/modularDrawer/modules/createNetworkConfiguration.d.ts.map +0 -1
  336. package/lib-es/modularDrawer/modules/createNetworkConfiguration.js +0 -50
  337. package/lib-es/modularDrawer/modules/createNetworkConfiguration.js.map +0 -1
  338. package/lib-es/modularDrawer/utils/buildProviderCurrenciesMap.d.ts +0 -9
  339. package/lib-es/modularDrawer/utils/buildProviderCurrenciesMap.d.ts.map +0 -1
  340. package/lib-es/modularDrawer/utils/buildProviderCurrenciesMap.js +0 -13
  341. package/lib-es/modularDrawer/utils/buildProviderCurrenciesMap.js.map +0 -1
  342. package/lib-es/modularDrawer/utils/getLoadingStatus.d.ts +0 -9
  343. package/lib-es/modularDrawer/utils/getLoadingStatus.d.ts.map +0 -1
  344. package/lib-es/modularDrawer/utils/getLoadingStatus.js +0 -14
  345. package/lib-es/modularDrawer/utils/getLoadingStatus.js.map +0 -1
  346. package/lib-es/modularDrawer/utils/sortByBalance.d.ts +0 -6
  347. package/lib-es/modularDrawer/utils/sortByBalance.d.ts.map +0 -1
  348. package/lib-es/modularDrawer/utils/sortByBalance.js +0 -25
  349. package/lib-es/modularDrawer/utils/sortByBalance.js.map +0 -1
  350. package/src/bridge/crypto-assets/cal-integration.test.ts +0 -53
  351. package/src/bridge/crypto-assets/cal-integration.ts +0 -23
  352. package/src/bridge/crypto-assets/cal-store.test.ts +0 -93
  353. package/src/bridge/crypto-assets/cal-store.ts +0 -63
  354. package/src/bridge/generic-alpaca/alpaca/index.unit.test.ts +0 -78
  355. package/src/bridge/generic-alpaca/utils.test.ts +0 -133
  356. package/src/modularDrawer/__mocks__/dada.mock.ts +0 -3890
  357. package/src/modularDrawer/data/entities/interestRateSelectors.ts +0 -39
  358. package/src/modularDrawer/data/state-manager/types.ts +0 -28
  359. package/src/modularDrawer/hooks/useLeftAccounts.tsx +0 -23
  360. package/src/modularDrawer/hooks/useLeftAccountsApy.tsx +0 -28
  361. package/src/modularDrawer/hooks/useLeftApy.tsx +0 -19
  362. package/src/modularDrawer/hooks/useRightBalanceAsset.tsx +0 -140
  363. package/src/modularDrawer/hooks/useRightBalanceNetwork.tsx +0 -116
  364. package/src/modularDrawer/modules/createAssetConfiguration.ts +0 -61
  365. package/src/modularDrawer/modules/createNetworkConfiguration.ts +0 -79
  366. package/src/modularDrawer/utils/buildProviderCurrenciesMap.tsx +0 -25
  367. package/src/modularDrawer/utils/getLoadingStatus.ts +0 -24
  368. package/src/modularDrawer/utils/sortByBalance.tsx +0 -32
  369. /package/lib/bridge/generic-alpaca/{utils.test.d.ts → tests/utils.test.d.ts} +0 -0
  370. /package/lib-es/bridge/generic-alpaca/{utils.test.d.ts → tests/utils.test.d.ts} +0 -0
@@ -4,27 +4,21 @@
4
4
 
5
5
  import { renderHook } from "@testing-library/react";
6
6
  import { useAssetsData } from "../useAssetsData";
7
- import { useGetAssetsDataInfiniteQuery } from "../../data/state-manager/api";
7
+ import { useGetAssetsDataQuery } from "../../data/state-manager/api";
8
8
 
9
9
  jest.mock("../../data/state-manager/api", () => ({
10
- useGetAssetsDataInfiniteQuery: jest.fn(),
10
+ useGetAssetsDataQuery: jest.fn(),
11
11
  }));
12
12
 
13
- const mockuseGetAssetsDataInfiniteQuery = jest.mocked(useGetAssetsDataInfiniteQuery);
14
-
15
- const defaultMockValues = {
16
- data: undefined,
17
- isLoading: false,
18
- error: undefined,
19
- fetchNextPage: jest.fn(),
20
- isSuccess: true,
21
- isFetching: false,
22
- isError: false,
23
- fetchPreviousPage: jest.fn(),
24
- isFetchingPreviousPage: false,
25
- refetch: jest.fn(),
26
- status: "success",
27
- };
13
+ const mockSetCursor = jest.fn();
14
+ jest.mock("react", () => ({
15
+ ...jest.requireActual("react"),
16
+ useState: jest.fn(() => [undefined, mockSetCursor]),
17
+ useCallback: jest.fn(fn => fn),
18
+ useMemo: jest.fn(fn => fn()),
19
+ }));
20
+
21
+ const mockUseGetAssetsDataQuery = jest.mocked(useGetAssetsDataQuery);
28
22
 
29
23
  describe("useAssetsData", () => {
30
24
  beforeEach(() => {
@@ -32,169 +26,114 @@ describe("useAssetsData", () => {
32
26
  });
33
27
 
34
28
  it("should return loading state when API is loading", () => {
35
- mockuseGetAssetsDataInfiniteQuery.mockReturnValue({
36
- ...defaultMockValues,
29
+ mockUseGetAssetsDataQuery.mockReturnValue({
30
+ data: undefined,
37
31
  isLoading: true,
38
- status: "pending",
32
+ error: undefined,
33
+ refetch: jest.fn(),
34
+ isFetching: false,
35
+ isSuccess: false,
36
+ isError: false,
37
+ currentData: undefined,
39
38
  });
40
39
 
41
- const { result } = renderHook(() => useAssetsData({ product: "lld", version: "1.0.0" }));
40
+ const { result } = renderHook(() => useAssetsData({}));
42
41
 
43
42
  expect(result.current.isLoading).toBe(true);
44
43
  expect(result.current.data).toBe(undefined);
44
+ expect(result.current.hasMore).toBe(false);
45
45
  });
46
46
 
47
- it("should return combined data from multiple pages", () => {
48
- const mockPages = [
49
- {
50
- cryptoAssets: { bitcoin: { id: "bitcoin", name: "Bitcoin" } },
51
- networks: { bitcoin: { id: "bitcoin", name: "Bitcoin" } },
52
- cryptoOrTokenCurrencies: { bitcoin: { id: "bitcoin" } },
53
- interestRates: {},
54
- markets: {},
55
- currenciesOrder: {
56
- currenciesIds: ["bitcoin"],
57
- metaCurrencyIds: ["bitcoin"],
58
- key: "marketCap",
59
- order: "desc",
60
- },
61
- pagination: { nextCursor: "cursor-2" },
62
- },
63
- {
64
- cryptoAssets: { ethereum: { id: "ethereum", name: "Ethereum" } },
65
- networks: { ethereum: { id: "ethereum", name: "Ethereum" } },
66
- cryptoOrTokenCurrencies: { ethereum: { id: "ethereum" } },
67
- interestRates: {},
68
- markets: {},
69
- currenciesOrder: {
70
- currenciesIds: ["ethereum"],
71
- metaCurrencyIds: ["ethereum"],
72
- key: "marketCap",
73
- order: "desc",
74
- },
75
- pagination: { nextCursor: undefined },
76
- },
77
- ];
78
-
79
- mockuseGetAssetsDataInfiniteQuery.mockReturnValue({
80
- ...defaultMockValues,
81
- data: { pages: mockPages, pageParams: [{ cursor: "" }, { cursor: "cursor-2" }] },
47
+ it("should return data and hasMore when API returns data", () => {
48
+ const mockData = {
49
+ assetsData: [],
50
+ pagination: { nextCursor: "test-cursor" },
51
+ };
52
+ mockUseGetAssetsDataQuery.mockReturnValue({
53
+ data: mockData,
54
+ isLoading: false,
55
+ error: undefined,
56
+ refetch: jest.fn(),
57
+ isFetching: false,
58
+ isSuccess: true,
59
+ isError: false,
60
+ currentData: mockData,
82
61
  });
83
62
 
84
- const { result } = renderHook(() => useAssetsData({ product: "lld", version: "1.0.0" }));
63
+ const { result } = renderHook(() => useAssetsData({}));
85
64
 
86
- expect(result.current.data).toEqual({
87
- cryptoAssets: {
88
- bitcoin: { id: "bitcoin", name: "Bitcoin" },
89
- ethereum: { id: "ethereum", name: "Ethereum" },
90
- },
91
- networks: {
92
- bitcoin: { id: "bitcoin", name: "Bitcoin" },
93
- ethereum: { id: "ethereum", name: "Ethereum" },
94
- },
95
- cryptoOrTokenCurrencies: {
96
- bitcoin: { id: "bitcoin" },
97
- ethereum: { id: "ethereum" },
98
- },
99
- interestRates: {},
100
- markets: {},
101
- currenciesOrder: {
102
- currenciesIds: ["bitcoin", "ethereum"],
103
- metaCurrencyIds: ["bitcoin", "ethereum"],
104
- key: "marketCap",
105
- order: "desc",
106
- },
107
- pagination: { nextCursor: undefined },
108
- });
65
+ expect(result.current.data).toBe(mockData);
109
66
  expect(result.current.isLoading).toBe(false);
67
+ expect(result.current.hasMore).toBe(true);
110
68
  });
111
69
 
112
70
  it("should return error when API has error", () => {
113
71
  const mockError = new Error("API Error");
114
- mockuseGetAssetsDataInfiniteQuery.mockReturnValue({
115
- ...defaultMockValues,
72
+ mockUseGetAssetsDataQuery.mockReturnValue({
116
73
  data: undefined,
74
+ isLoading: false,
117
75
  error: mockError,
76
+ refetch: jest.fn(),
77
+ isFetching: false,
118
78
  isSuccess: false,
119
79
  isError: true,
120
- status: "error",
80
+ currentData: undefined,
121
81
  });
122
82
 
123
- const { result } = renderHook(() => useAssetsData({ product: "lld", version: "1.0.0" }));
83
+ const { result } = renderHook(() => useAssetsData({}));
124
84
 
125
85
  expect(result.current.error).toBe(mockError);
126
86
  expect(result.current.isLoading).toBe(false);
127
87
  });
128
88
 
129
- it("should provide loadNext function when there's a nextCursor", () => {
130
- const mockFetchNextPage = jest.fn();
131
- const mockPages = [
132
- {
133
- cryptoAssets: {},
134
- networks: {},
135
- cryptoOrTokenCurrencies: {},
136
- interestRates: {},
137
- markets: {},
138
- currenciesOrder: {
139
- currenciesIds: [],
140
- metaCurrencyIds: [],
141
- key: "marketCap",
142
- order: "desc",
143
- },
144
- pagination: { nextCursor: "next-cursor-456" },
89
+ it("should call setCursor when loadNext is called and there's a nextCursor", () => {
90
+ const nextCursor = "next-cursor-456";
91
+ mockUseGetAssetsDataQuery.mockReturnValue({
92
+ data: {
93
+ assetsData: [],
94
+ pagination: { nextCursor },
95
+ },
96
+ isLoading: false,
97
+ error: undefined,
98
+ refetch: jest.fn(),
99
+ isFetching: false,
100
+ isSuccess: true,
101
+ isError: false,
102
+ currentData: {
103
+ assetsData: [],
104
+ pagination: { nextCursor },
145
105
  },
146
- ];
147
-
148
- mockuseGetAssetsDataInfiniteQuery.mockReturnValue({
149
- ...defaultMockValues,
150
- data: { pages: mockPages, pageParams: [{ cursor: "" }] },
151
- fetchNextPage: mockFetchNextPage,
152
106
  });
153
107
 
154
- const { result } = renderHook(() => useAssetsData({ product: "lld", version: "1.0.0" }));
108
+ const { result } = renderHook(() => useAssetsData({}));
155
109
 
156
- expect(result.current.loadNext).toBeDefined();
157
- result.current.loadNext?.();
110
+ result.current.loadNext();
158
111
 
159
- expect(mockFetchNextPage).toHaveBeenCalled();
112
+ expect(mockSetCursor).toHaveBeenCalledWith(nextCursor);
160
113
  });
161
114
 
162
- it("should not provide loadNext function when there's no nextCursor", () => {
163
- const mockPages = [
164
- {
165
- cryptoAssets: {},
166
- networks: {},
167
- cryptoOrTokenCurrencies: {},
168
- interestRates: {},
169
- markets: {},
170
- currenciesOrder: {
171
- currenciesIds: [],
172
- metaCurrencyIds: [],
173
- key: "marketCap",
174
- order: "desc",
175
- },
115
+ it("should not call setCursor when there's no nextCursor", () => {
116
+ mockUseGetAssetsDataQuery.mockReturnValue({
117
+ data: {
118
+ assetsData: [],
119
+ pagination: { nextCursor: undefined },
120
+ },
121
+ isLoading: false,
122
+ error: undefined,
123
+ refetch: jest.fn(),
124
+ isFetching: false,
125
+ isSuccess: true,
126
+ isError: false,
127
+ currentData: {
128
+ assetsData: [],
176
129
  pagination: { nextCursor: undefined },
177
130
  },
178
- ];
179
-
180
- mockuseGetAssetsDataInfiniteQuery.mockReturnValue({
181
- ...defaultMockValues,
182
- data: { pages: mockPages, pageParams: [{ cursor: "" }] },
183
131
  });
184
132
 
185
- const { result } = renderHook(() => useAssetsData({ product: "lld", version: "1.0.0" }));
186
-
187
- expect(result.current.loadNext).toBeUndefined();
188
- });
189
-
190
- it("should return undefined data when no pages exist", () => {
191
- mockuseGetAssetsDataInfiniteQuery.mockReturnValue({
192
- ...defaultMockValues,
193
- });
133
+ const { result } = renderHook(() => useAssetsData({}));
194
134
 
195
- const { result } = renderHook(() => useAssetsData({ product: "lld", version: "1.0.0" }));
135
+ result.current.loadNext();
196
136
 
197
- expect(result.current.data).toBeUndefined();
198
- expect(result.current.loadNext).toBeUndefined();
137
+ expect(mockSetCursor).not.toHaveBeenCalled();
199
138
  });
200
139
  });
@@ -1,8 +1,8 @@
1
1
  import { Observable } from "rxjs";
2
2
  import { CryptoOrTokenCurrency } from "@ledgerhq/types-cryptoassets";
3
- import { getAccountTuplesForCurrency } from "../../utils/getAccountTuplesForCurrency";
3
+ import { getAccountTuplesForCurrency } from "../../../utils/getAccountTuplesForCurrency";
4
4
  import type { Account } from "@ledgerhq/types-live";
5
- import { WalletAPIAccount } from "../../wallet-api/types";
5
+ import { WalletAPIAccount } from "../../../wallet-api/types";
6
6
 
7
7
  type AccountModuleParams = {
8
8
  assets: CryptoOrTokenCurrency[];
@@ -1,11 +1,6 @@
1
- import React, { useMemo } from "react";
2
- import { useSelector } from "react-redux";
1
+ import React from "react";
3
2
  import { CryptoOrTokenCurrency } from "@ledgerhq/types-cryptoassets";
4
- import { selectInterestRateByCurrency } from "../../data/entities/interestRateSelectors";
5
- import { ApyType } from "../../utils/type";
6
-
7
- const isValidApyType = (type: string): type is ApyType =>
8
- type === "NRR" || type === "APY" || type === "APR";
3
+ import { ApyType } from "../../types";
9
4
 
10
5
  const createApyItem = ({
11
6
  value,
@@ -18,42 +13,14 @@ const createApyItem = ({
18
13
  }) => <ApyIndicator value={value} type={type} />;
19
14
 
20
15
  export const useLeftApyModule = (
21
- currencies: CryptoOrTokenCurrency[],
16
+ assets: CryptoOrTokenCurrency[],
22
17
  ApyIndicator: React.ComponentType<{ value: number; type: ApyType }>,
23
18
  ) => {
24
- const interestRates = useSelector(state => {
25
- const rates: Record<string, { value: number; type: ApyType } | undefined> = {};
26
- currencies.forEach(currency => {
27
- const apiRate = selectInterestRateByCurrency(state, currency.id);
28
- if (apiRate && isValidApyType(apiRate.type)) {
29
- rates[currency.id] = {
30
- value: apiRate.rate,
31
- type: apiRate.type,
32
- };
33
- }
34
- });
35
- return rates;
36
- });
37
-
38
- return useMemo(() => {
39
- return currencies.map(currency => {
40
- const interestRate = interestRates[currency.id];
41
- const interestRatePercentageRounded = interestRate
42
- ? Math.round(interestRate.value * 100 * 100) / 100
43
- : 0;
44
-
45
- if (!interestRate || interestRatePercentageRounded <= 0) {
46
- return currency;
47
- }
19
+ const value = 5.11; // TODO to be retrieved from DADA
20
+ const type = "APY"; // TODO to be retrieved from DADA
48
21
 
49
- return {
50
- ...currency,
51
- leftElement: createApyItem({
52
- value: interestRatePercentageRounded,
53
- type: interestRate.type,
54
- ApyIndicator,
55
- }),
56
- };
57
- });
58
- }, [currencies, interestRates, ApyIndicator]);
22
+ return assets.map(asset => ({
23
+ ...asset,
24
+ leftElement: createApyItem({ value, type, ApyIndicator }),
25
+ }));
59
26
  };
@@ -1,73 +1,36 @@
1
- import { useMemo } from "react";
2
- import { useGetAssetsDataInfiniteQuery } from "../data/state-manager/api";
3
- import { AssetsDataWithPagination } from "../data/state-manager/types";
4
-
5
- const emptyData = () => ({
6
- cryptoAssets: {},
7
- networks: {},
8
- cryptoOrTokenCurrencies: {},
9
- interestRates: {},
10
- markets: {},
11
- currenciesOrder: {
12
- currenciesIds: [],
13
- metaCurrencyIds: [],
14
- key: "",
15
- order: "",
16
- },
17
- pagination: { nextCursor: "" },
18
- });
1
+ import { useState, useCallback } from "react";
2
+ import { useGetAssetsDataQuery } from "../data/state-manager/api";
19
3
 
20
4
  export function useAssetsData({
21
5
  search,
22
6
  currencyIds,
23
- useCase,
24
- areCurrenciesFiltered,
25
- product,
26
- version,
27
7
  }: {
28
8
  search?: string;
29
9
  currencyIds?: string[];
30
- useCase?: string;
31
- areCurrenciesFiltered?: boolean;
32
- product: "llm" | "lld";
33
- version: string;
34
10
  }) {
35
- const { data, isLoading, error, fetchNextPage, isSuccess, refetch } =
36
- useGetAssetsDataInfiniteQuery({
37
- search,
38
- useCase,
39
- currencyIds: areCurrenciesFiltered ? currencyIds : undefined,
40
- product,
41
- version,
42
- });
43
-
44
- const joinedPages = useMemo(() => {
45
- return data?.pages.reduce<AssetsDataWithPagination>((acc, page) => {
46
- Object.assign(acc.cryptoAssets, page.cryptoAssets);
47
- Object.assign(acc.networks, page.networks);
48
- Object.assign(acc.cryptoOrTokenCurrencies, page.cryptoOrTokenCurrencies);
49
- Object.assign(acc.interestRates, page.interestRates);
50
- Object.assign(acc.markets, page.markets);
51
-
52
- acc.currenciesOrder.currenciesIds.push(...page.currenciesOrder.currenciesIds);
53
- acc.currenciesOrder.metaCurrencyIds.push(...page.currenciesOrder.metaCurrencyIds);
54
-
55
- acc.currenciesOrder.key = page.currenciesOrder.key;
56
- acc.currenciesOrder.order = page.currenciesOrder.order;
57
- acc.pagination.nextCursor = page.pagination.nextCursor;
58
-
59
- return acc;
60
- }, emptyData());
61
- }, [data]);
62
-
63
- const hasMore = Boolean(joinedPages?.pagination.nextCursor);
11
+ const [cursor, setCursor] = useState<string | undefined>(undefined);
12
+ const { data, error, isLoading, isSuccess } = useGetAssetsDataQuery({
13
+ cursor,
14
+ search,
15
+ currencyIds,
16
+ });
17
+
18
+ const loadNext = useCallback(() => {
19
+ const nextCursor = data?.pagination?.nextCursor;
20
+ if (nextCursor) {
21
+ setCursor(nextCursor);
22
+ }
23
+ }, [data?.pagination?.nextCursor]);
24
+
25
+ const hasMore = Boolean(data?.pagination?.nextCursor);
64
26
 
65
27
  return {
66
- data: joinedPages,
67
- isLoading,
28
+ data,
68
29
  error,
69
- loadNext: hasMore ? fetchNextPage : undefined,
30
+ isLoading,
70
31
  isSuccess,
71
- refetch,
32
+ hasMore,
33
+ cursor,
34
+ loadNext,
72
35
  };
73
36
  }
@@ -0,0 +1 @@
1
+ export type ApyType = "NRR" | "APY" | "APR";
@@ -1,14 +1,3 @@
1
- import { CounterValuesState } from "@ledgerhq/live-countervalues/lib/types";
2
- import { CryptoOrTokenCurrency, Currency } from "@ledgerhq/types-cryptoassets";
3
- import { AccountLike } from "@ledgerhq/types-live";
4
- import { ReactNode } from "react";
5
- import { Observable } from "rxjs";
6
- import { WalletAPIAccount } from "../../wallet-api/types";
7
- import { CurrenciesByProviderId } from "../../deposit/type";
8
- import { EnhancedModularDrawerConfiguration } from "../../wallet-api/ModularDrawer/types";
9
-
10
- export type ApyType = "NRR" | "APY" | "APR";
11
-
12
1
  export type AssetType = {
13
2
  name: string;
14
3
  ticker: string;
@@ -31,89 +20,3 @@ export type ProviderBalanceResultsMap = Map<string, ProviderBalanceAsset>;
31
20
  export type AssetWithBalance = AssetType & {
32
21
  sortValue?: number;
33
22
  };
34
-
35
- export type UseBalanceDeps = () => {
36
- flattenedAccounts: AccountLike[];
37
- discreet: boolean;
38
- state: CounterValuesState;
39
- counterValueCurrency: Currency;
40
- locale: string;
41
- };
42
-
43
- export type BalanceUI = { balance?: string; fiatValue?: string };
44
- export type CreateBalanceItem = (x: BalanceUI) => React.ReactNode;
45
-
46
- export type CreateAccountsCountAndApy = (args: {
47
- label: string;
48
- value: number;
49
- type: ApyType;
50
- }) => ReactNode;
51
-
52
- export type NetworkWithCount = CryptoOrTokenCurrency & {
53
- leftElement?: ReactNode;
54
- count: number;
55
- };
56
-
57
- export type AccountDataItem = {
58
- asset: CryptoOrTokenCurrency;
59
- label: string;
60
- count: number;
61
- };
62
-
63
- export type AccountModuleParams = {
64
- assets: CryptoOrTokenCurrency[];
65
- accounts$?: Observable<WalletAPIAccount[]>;
66
- };
67
-
68
- export type CreateAccountsCount = (args: { label: string }) => ReactNode;
69
-
70
- export type UseAccountData = (params: AccountModuleParams) => AccountDataItem[];
71
-
72
- export type NetworkHookParams = {
73
- assets: CryptoOrTokenCurrency[];
74
- selectedAssetId: string;
75
- currenciesByProvider: CurrenciesByProviderId[];
76
- accounts$?: Observable<WalletAPIAccount[]>;
77
- };
78
- export type NetworkHook = (params: NetworkHookParams) => Array<CryptoOrTokenCurrency & Network>;
79
-
80
- export type NetworkConfigurationDeps = {
81
- useAccountData: UseAccountData;
82
- accountsCount: CreateAccountsCount;
83
- accountsCountAndApy: CreateAccountsCountAndApy;
84
- useBalanceDeps: UseBalanceDeps;
85
- balanceItem: CreateBalanceItem;
86
- };
87
-
88
- export type LeftElementKind = "numberOfAccounts" | "numberOfAccountsAndApy" | "undefined";
89
- export type RightElementKind = "balance" | "undefined";
90
-
91
- export type Network = {
92
- name: string;
93
- id: string;
94
- ticker: string;
95
- leftElement?: React.ReactNode;
96
- rightElement?: React.ReactNode;
97
- };
98
-
99
- export type CreateNetworkConfigurationHookProps = {
100
- networksConfig: EnhancedModularDrawerConfiguration["networks"];
101
- currenciesByProvider?: CurrenciesByProviderId[];
102
- selectedAssetId: string;
103
- accounts$?: Observable<WalletAPIAccount[]>;
104
- };
105
-
106
- type Props = {
107
- assetsConfiguration: EnhancedModularDrawerConfiguration["assets"];
108
- currenciesByProvider?: CurrenciesByProviderId[];
109
- };
110
-
111
- export type AssetConfigurationDeps = {
112
- ApyIndicator: (args: { value: number; type: ApyType }) => ReactNode;
113
- useBalanceDeps: UseBalanceDeps;
114
- balanceItem: (asset: { fiatValue?: string; balance?: string }) => ReactNode;
115
- };
116
-
117
- export type CreateAssetConfigurationHook = (
118
- AssetConfigurationDeps: AssetConfigurationDeps,
119
- ) => (props: Props) => (assets: CryptoOrTokenCurrency[]) => (CryptoOrTokenCurrency & AssetType)[];
@@ -666,8 +666,8 @@ function extractSwapStartParam(
666
666
  fromParentAccount,
667
667
  fromCurrency: getCurrencyForAccount(fromAccount),
668
668
  toAccount: newTokenAccount ? newTokenAccount : toAccount,
669
- toParentAccount: toParentAccount,
670
- toCurrency: getCurrencyForAccount(newTokenAccount ? newTokenAccount : toAccount),
669
+ toParentAccount: newTokenAccount ? toAccount : toParentAccount,
670
+ toCurrency: getCurrencyForAccount(toAccount),
671
671
  },
672
672
  };
673
673
  }
@@ -130,8 +130,6 @@ export interface UiHook {
130
130
  "account.request": (params: {
131
131
  accounts$?: Observable<WalletAPIAccount[]>;
132
132
  currencies: CryptoOrTokenCurrency[];
133
- areCurrenciesFiltered?: boolean;
134
- useCase?: string;
135
133
  drawerConfiguration?: ModularDrawerConfiguration;
136
134
  onSuccess: (account: AccountLike, parentAccount: Account | undefined) => void;
137
135
  onCancel: () => void;
@@ -360,7 +358,7 @@ export function useWalletAPIServer({
360
358
 
361
359
  server.setHandler(
362
360
  "account.request",
363
- async ({ accounts$, currencies$, drawerConfiguration, areCurrenciesFiltered, useCase }) => {
361
+ async ({ accounts$, currencies$, drawerConfiguration }) => {
364
362
  tracking.requestAccountRequested(manifest);
365
363
  const currencies = await firstValueFrom(currencies$);
366
364
 
@@ -379,8 +377,6 @@ export function useWalletAPIServer({
379
377
  accounts$,
380
378
  currencies: currencyList,
381
379
  drawerConfiguration,
382
- areCurrenciesFiltered,
383
- useCase,
384
380
  onSuccess: (account: AccountLike, parentAccount: Account | undefined) => {
385
381
  if (done) return;
386
382
  done = true;
@@ -1,4 +0,0 @@
1
- import type { CryptoAssetsStore } from "@ledgerhq/types-live";
2
- export declare function isCALIntegrationEnabled(): boolean;
3
- export declare function getCALStore(): CryptoAssetsStore;
4
- //# sourceMappingURL=cal-integration.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cal-integration.d.ts","sourceRoot":"","sources":["../../../src/bridge/crypto-assets/cal-integration.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAM9D,wBAAgB,uBAAuB,IAAI,OAAO,CAOjD;AAED,wBAAgB,WAAW,IAAI,iBAAiB,CAK/C"}
@@ -1,26 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getCALStore = exports.isCALIntegrationEnabled = void 0;
4
- const live_env_1 = require("@ledgerhq/live-env");
5
- const logs_1 = require("@ledgerhq/logs");
6
- const cal_store_1 = require("./cal-store");
7
- const firebaseFeatureFlags_1 = require("../../featureFlags/firebaseFeatureFlags");
8
- let calStoreInstance;
9
- function isCALIntegrationEnabled() {
10
- try {
11
- return !(0, live_env_1.getEnv)("MOCK") && (0, firebaseFeatureFlags_1.isFeature)("calLedgerService");
12
- }
13
- catch (error) {
14
- (0, logs_1.log)("cal", "Error checking CAL integration:", error);
15
- return false;
16
- }
17
- }
18
- exports.isCALIntegrationEnabled = isCALIntegrationEnabled;
19
- function getCALStore() {
20
- if (!calStoreInstance) {
21
- calStoreInstance = new cal_store_1.CALStore();
22
- }
23
- return calStoreInstance;
24
- }
25
- exports.getCALStore = getCALStore;
26
- //# sourceMappingURL=cal-integration.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cal-integration.js","sourceRoot":"","sources":["../../../src/bridge/crypto-assets/cal-integration.ts"],"names":[],"mappings":";;;AAAA,iDAA4C;AAC5C,yCAAqC;AAErC,2CAAuC;AACvC,kFAAoE;AAEpE,IAAI,gBAAsC,CAAC;AAE3C,SAAgB,uBAAuB;IACrC,IAAI;QACF,OAAO,CAAC,IAAA,iBAAM,EAAC,MAAM,CAAC,IAAI,IAAA,gCAAS,EAAC,kBAAkB,CAAC,CAAC;KACzD;IAAC,OAAO,KAAK,EAAE;QACd,IAAA,UAAG,EAAC,KAAK,EAAE,iCAAiC,EAAE,KAAK,CAAC,CAAC;QACrD,OAAO,KAAK,CAAC;KACd;AACH,CAAC;AAPD,0DAOC;AAED,SAAgB,WAAW;IACzB,IAAI,CAAC,gBAAgB,EAAE;QACrB,gBAAgB,GAAG,IAAI,oBAAQ,EAAE,CAAC;KACnC;IACD,OAAO,gBAAgB,CAAC;AAC1B,CAAC;AALD,kCAKC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=cal-integration.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cal-integration.test.d.ts","sourceRoot":"","sources":["../../../src/bridge/crypto-assets/cal-integration.test.ts"],"names":[],"mappings":""}