@ledgerhq/live-common 34.46.0 → 34.47.0-nightly.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 (422) hide show
  1. package/lib/bridge/crypto-assets/index.d.ts +1 -1
  2. package/lib/bridge/crypto-assets/index.d.ts.map +1 -1
  3. package/lib/bridge/crypto-assets/index.js +1 -1
  4. package/lib/bridge/crypto-assets/index.js.map +1 -1
  5. package/lib/bridge/generic-alpaca/estimateMaxSpendable.d.ts.map +1 -1
  6. package/lib/bridge/generic-alpaca/estimateMaxSpendable.js +6 -4
  7. package/lib/bridge/generic-alpaca/estimateMaxSpendable.js.map +1 -1
  8. package/lib/bridge/generic-alpaca/getTransactionStatus.d.ts.map +1 -1
  9. package/lib/bridge/generic-alpaca/getTransactionStatus.js +2 -2
  10. package/lib/bridge/generic-alpaca/getTransactionStatus.js.map +1 -1
  11. package/lib/bridge/generic-alpaca/prepareTransaction.d.ts.map +1 -1
  12. package/lib/bridge/generic-alpaca/prepareTransaction.js +12 -12
  13. package/lib/bridge/generic-alpaca/prepareTransaction.js.map +1 -1
  14. package/lib/bridge/generic-alpaca/signOperation.d.ts.map +1 -1
  15. package/lib/bridge/generic-alpaca/signOperation.js +3 -4
  16. package/lib/bridge/generic-alpaca/signOperation.js.map +1 -1
  17. package/lib/bridge/generic-alpaca/tests/prepareTransaction.test.js +1 -1
  18. package/lib/bridge/generic-alpaca/tests/prepareTransaction.test.js.map +1 -1
  19. package/lib/bridge/generic-alpaca/utils.d.ts +0 -1
  20. package/lib/bridge/generic-alpaca/utils.d.ts.map +1 -1
  21. package/lib/bridge/generic-alpaca/utils.js +0 -1
  22. package/lib/bridge/generic-alpaca/utils.js.map +1 -1
  23. package/lib/bridge/impl.d.ts +1 -1
  24. package/lib/bridge/impl.d.ts.map +1 -1
  25. package/lib/currencies/index.d.ts +1 -1
  26. package/lib/currencies/index.d.ts.map +1 -1
  27. package/lib/currencies/index.js +1 -2
  28. package/lib/currencies/index.js.map +1 -1
  29. package/lib/currencies/sortByMarketcap.test.js +2 -1
  30. package/lib/currencies/sortByMarketcap.test.js.map +1 -1
  31. package/lib/domain/getTokensWithFunds.test.js +1 -1
  32. package/lib/domain/getTokensWithFunds.test.js.map +1 -1
  33. package/lib/e2e/enum/AppInfos.d.ts +1 -1
  34. package/lib/e2e/enum/AppInfos.d.ts.map +1 -1
  35. package/lib/e2e/enum/DeviceLabels.d.ts +3 -2
  36. package/lib/e2e/enum/DeviceLabels.d.ts.map +1 -1
  37. package/lib/e2e/enum/DeviceLabels.js +2 -1
  38. package/lib/e2e/enum/DeviceLabels.js.map +1 -1
  39. package/lib/e2e/enum/Provider.d.ts.map +1 -1
  40. package/lib/e2e/enum/Provider.js +2 -2
  41. package/lib/e2e/enum/Provider.js.map +1 -1
  42. package/lib/e2e/families/solana.d.ts.map +1 -1
  43. package/lib/e2e/families/solana.js +4 -4
  44. package/lib/e2e/families/solana.js.map +1 -1
  45. package/lib/e2e/index.d.ts +5 -0
  46. package/lib/e2e/index.d.ts.map +1 -1
  47. package/lib/e2e/speculos.d.ts.map +1 -1
  48. package/lib/e2e/speculos.js +4 -5
  49. package/lib/e2e/speculos.js.map +1 -1
  50. package/lib/e2e/speculosCI.d.ts +4 -0
  51. package/lib/e2e/speculosCI.d.ts.map +1 -1
  52. package/lib/e2e/speculosCI.js +16 -6
  53. package/lib/e2e/speculosCI.js.map +1 -1
  54. package/lib/env.react.d.ts +1 -1
  55. package/lib/env.react.d.ts.map +1 -1
  56. package/lib/exchange/swap/api/v5/actions.js +1 -1
  57. package/lib/exchange/swap/api/v5/actions.js.map +1 -1
  58. package/lib/exchange/swap/types.d.ts +1 -1
  59. package/lib/exchange/swap/types.d.ts.map +1 -1
  60. package/lib/families/evm/setup.d.ts.map +1 -1
  61. package/lib/families/evm/setup.js +11 -1
  62. package/lib/families/evm/setup.js.map +1 -1
  63. package/lib/families/hedera/constants.d.ts +2 -0
  64. package/lib/families/hedera/constants.d.ts.map +1 -0
  65. package/lib/families/hedera/constants.js +19 -0
  66. package/lib/families/hedera/constants.js.map +1 -0
  67. package/lib/families/hedera/setup.d.ts +5 -5
  68. package/lib/families/hedera/setup.d.ts.map +1 -1
  69. package/lib/families/hedera/setup.js.map +1 -1
  70. package/lib/families/solana/setup.d.ts.map +1 -1
  71. package/lib/families/solana/setup.js +2 -1
  72. package/lib/families/solana/setup.js.map +1 -1
  73. package/lib/families/sui/constants.d.ts +2 -0
  74. package/lib/families/sui/constants.d.ts.map +1 -0
  75. package/lib/families/sui/constants.js +19 -0
  76. package/lib/families/sui/constants.js.map +1 -0
  77. package/lib/families/sui/logic.d.ts +2 -0
  78. package/lib/families/sui/logic.d.ts.map +1 -0
  79. package/lib/families/sui/logic.js +19 -0
  80. package/lib/families/sui/logic.js.map +1 -0
  81. package/lib/families/sui/react.d.ts +8 -0
  82. package/lib/families/sui/react.d.ts.map +1 -0
  83. package/lib/families/sui/react.js +85 -0
  84. package/lib/families/sui/react.js.map +1 -0
  85. package/lib/families/sui/types.d.ts +2 -0
  86. package/lib/families/sui/types.d.ts.map +1 -0
  87. package/lib/families/sui/types.js +19 -0
  88. package/lib/families/sui/types.js.map +1 -0
  89. package/lib/featureFlags/defaultFeatures.d.ts.map +1 -1
  90. package/lib/featureFlags/defaultFeatures.js +1 -0
  91. package/lib/featureFlags/defaultFeatures.js.map +1 -1
  92. package/lib/featureFlags/useFeature.d.ts +1 -1
  93. package/lib/featureFlags/useFeature.d.ts.map +1 -1
  94. package/lib/generated/bridge/js.d.ts +1 -1
  95. package/lib/market/utils/countervalueFormatter.d.ts.map +1 -1
  96. package/lib/market/utils/countervalueFormatter.js.map +1 -1
  97. package/lib/market/utils/types.d.ts +2 -0
  98. package/lib/market/utils/types.d.ts.map +1 -1
  99. package/lib/modularDrawer/__mocks__/currencies.mock.d.ts.map +1 -1
  100. package/lib/modularDrawer/__mocks__/currencies.mock.js +7 -7
  101. package/lib/modularDrawer/__mocks__/currencies.mock.js.map +1 -1
  102. package/lib/modularDrawer/__mocks__/useGroupedCurrenciesByProvider.mock.js +1 -1
  103. package/lib/modularDrawer/__mocks__/useGroupedCurrenciesByProvider.mock.js.map +1 -1
  104. package/lib/modularDrawer/data/entities/index.d.ts +68 -0
  105. package/lib/modularDrawer/data/entities/index.d.ts.map +1 -0
  106. package/lib/modularDrawer/data/entities/index.js +3 -0
  107. package/lib/modularDrawer/data/entities/index.js.map +1 -0
  108. package/lib/modularDrawer/data/state-manager/api.d.ts +152 -0
  109. package/lib/modularDrawer/data/state-manager/api.d.ts.map +1 -0
  110. package/lib/modularDrawer/data/state-manager/api.js +45 -0
  111. package/lib/modularDrawer/data/state-manager/api.js.map +1 -0
  112. package/lib/modularDrawer/hooks/__test__/useAssetsData.test.d.ts +5 -0
  113. package/lib/modularDrawer/hooks/__test__/useAssetsData.test.d.ts.map +1 -0
  114. package/lib/modularDrawer/hooks/__test__/useAssetsData.test.js +120 -0
  115. package/lib/modularDrawer/hooks/__test__/useAssetsData.test.js.map +1 -0
  116. package/lib/modularDrawer/hooks/modules/useAssetAccountCounts.d.ts +19 -0
  117. package/lib/modularDrawer/hooks/modules/useAssetAccountCounts.d.ts.map +1 -0
  118. package/lib/modularDrawer/hooks/modules/useAssetAccountCounts.js +16 -0
  119. package/lib/modularDrawer/hooks/modules/useAssetAccountCounts.js.map +1 -0
  120. package/lib/modularDrawer/hooks/modules/useLeftApyModule.d.ts +52 -0
  121. package/lib/modularDrawer/hooks/modules/useLeftApyModule.d.ts.map +1 -0
  122. package/lib/modularDrawer/hooks/modules/useLeftApyModule.js +18 -0
  123. package/lib/modularDrawer/hooks/modules/useLeftApyModule.js.map +1 -0
  124. package/lib/modularDrawer/hooks/useAssetsData.d.ts +13 -0
  125. package/lib/modularDrawer/hooks/useAssetsData.d.ts.map +1 -0
  126. package/lib/modularDrawer/hooks/useAssetsData.js +31 -0
  127. package/lib/modularDrawer/hooks/useAssetsData.js.map +1 -0
  128. package/lib/modularDrawer/types.d.ts +2 -0
  129. package/lib/modularDrawer/types.d.ts.map +1 -0
  130. package/lib/modularDrawer/types.js +3 -0
  131. package/lib/modularDrawer/types.js.map +1 -0
  132. package/lib/modularDrawer/utils/__tests__/counterValueFormatter.test.d.ts +2 -0
  133. package/lib/modularDrawer/utils/__tests__/counterValueFormatter.test.d.ts.map +1 -0
  134. package/lib/modularDrawer/utils/__tests__/counterValueFormatter.test.js +496 -0
  135. package/lib/modularDrawer/utils/__tests__/counterValueFormatter.test.js.map +1 -0
  136. package/lib/modularDrawer/utils/__tests__/currencyUtils.test.js +1 -1
  137. package/lib/modularDrawer/utils/__tests__/currencyUtils.test.js.map +1 -1
  138. package/lib/modularDrawer/utils/__tests__/haveOneCommonProvider.test.js +1 -1
  139. package/lib/modularDrawer/utils/__tests__/haveOneCommonProvider.test.js.map +1 -1
  140. package/lib/modularDrawer/utils/calculateProviderTotal.d.ts +9 -0
  141. package/lib/modularDrawer/utils/calculateProviderTotal.d.ts.map +1 -0
  142. package/lib/modularDrawer/utils/calculateProviderTotal.js +23 -0
  143. package/lib/modularDrawer/utils/calculateProviderTotal.js.map +1 -0
  144. package/lib/modularDrawer/utils/counterValueFormatter.d.ts +14 -0
  145. package/lib/modularDrawer/utils/counterValueFormatter.d.ts.map +1 -0
  146. package/lib/modularDrawer/utils/counterValueFormatter.js +107 -0
  147. package/lib/modularDrawer/utils/counterValueFormatter.js.map +1 -0
  148. package/lib/modularDrawer/utils/getBalanceAndFiatValueByAssets.d.ts +11 -0
  149. package/lib/modularDrawer/utils/getBalanceAndFiatValueByAssets.d.ts.map +1 -0
  150. package/lib/modularDrawer/utils/getBalanceAndFiatValueByAssets.js +45 -0
  151. package/lib/modularDrawer/utils/getBalanceAndFiatValueByAssets.js.map +1 -0
  152. package/lib/modularDrawer/utils/getProviderCurrency.d.ts +3 -0
  153. package/lib/modularDrawer/utils/getProviderCurrency.d.ts.map +1 -0
  154. package/lib/modularDrawer/utils/getProviderCurrency.js +14 -0
  155. package/lib/modularDrawer/utils/getProviderCurrency.js.map +1 -0
  156. package/lib/modularDrawer/utils/groupAccountsByAsset.d.ts +11 -0
  157. package/lib/modularDrawer/utils/groupAccountsByAsset.d.ts.map +1 -0
  158. package/lib/modularDrawer/utils/groupAccountsByAsset.js +32 -0
  159. package/lib/modularDrawer/utils/groupAccountsByAsset.js.map +1 -0
  160. package/lib/modularDrawer/utils/parseToBigNumber.d.ts +9 -0
  161. package/lib/modularDrawer/utils/parseToBigNumber.d.ts.map +1 -0
  162. package/lib/modularDrawer/utils/parseToBigNumber.js +24 -0
  163. package/lib/modularDrawer/utils/parseToBigNumber.js.map +1 -0
  164. package/lib/modularDrawer/utils/type.d.ts +21 -0
  165. package/lib/modularDrawer/utils/type.d.ts.map +1 -0
  166. package/lib/modularDrawer/utils/type.js +3 -0
  167. package/lib/modularDrawer/utils/type.js.map +1 -0
  168. package/lib/utils/__tests__/getAccountTuplesForCurrency.test.js +1 -1
  169. package/lib/utils/__tests__/getAccountTuplesForCurrency.test.js.map +1 -1
  170. package/lib/wallet-api/Exchange/error.d.ts +1 -0
  171. package/lib/wallet-api/Exchange/error.d.ts.map +1 -1
  172. package/lib/wallet-api/Exchange/error.js +11 -1
  173. package/lib/wallet-api/Exchange/error.js.map +1 -1
  174. package/lib/wallet-api/Exchange/server.d.ts +2 -0
  175. package/lib/wallet-api/Exchange/server.d.ts.map +1 -1
  176. package/lib/wallet-api/Exchange/server.js +29 -5
  177. package/lib/wallet-api/Exchange/server.js.map +1 -1
  178. package/lib/wallet-api/Exchange/server.test.js +3 -0
  179. package/lib/wallet-api/Exchange/server.test.js.map +1 -1
  180. package/lib-es/bridge/crypto-assets/index.d.ts +1 -1
  181. package/lib-es/bridge/crypto-assets/index.d.ts.map +1 -1
  182. package/lib-es/bridge/crypto-assets/index.js +1 -1
  183. package/lib-es/bridge/crypto-assets/index.js.map +1 -1
  184. package/lib-es/bridge/generic-alpaca/estimateMaxSpendable.d.ts.map +1 -1
  185. package/lib-es/bridge/generic-alpaca/estimateMaxSpendable.js +6 -4
  186. package/lib-es/bridge/generic-alpaca/estimateMaxSpendable.js.map +1 -1
  187. package/lib-es/bridge/generic-alpaca/getTransactionStatus.d.ts.map +1 -1
  188. package/lib-es/bridge/generic-alpaca/getTransactionStatus.js +2 -2
  189. package/lib-es/bridge/generic-alpaca/getTransactionStatus.js.map +1 -1
  190. package/lib-es/bridge/generic-alpaca/prepareTransaction.d.ts.map +1 -1
  191. package/lib-es/bridge/generic-alpaca/prepareTransaction.js +12 -12
  192. package/lib-es/bridge/generic-alpaca/prepareTransaction.js.map +1 -1
  193. package/lib-es/bridge/generic-alpaca/signOperation.d.ts.map +1 -1
  194. package/lib-es/bridge/generic-alpaca/signOperation.js +3 -4
  195. package/lib-es/bridge/generic-alpaca/signOperation.js.map +1 -1
  196. package/lib-es/bridge/generic-alpaca/tests/prepareTransaction.test.js +1 -1
  197. package/lib-es/bridge/generic-alpaca/tests/prepareTransaction.test.js.map +1 -1
  198. package/lib-es/bridge/generic-alpaca/utils.d.ts +0 -1
  199. package/lib-es/bridge/generic-alpaca/utils.d.ts.map +1 -1
  200. package/lib-es/bridge/generic-alpaca/utils.js +0 -1
  201. package/lib-es/bridge/generic-alpaca/utils.js.map +1 -1
  202. package/lib-es/bridge/impl.d.ts +1 -1
  203. package/lib-es/bridge/impl.d.ts.map +1 -1
  204. package/lib-es/currencies/index.d.ts +1 -1
  205. package/lib-es/currencies/index.d.ts.map +1 -1
  206. package/lib-es/currencies/index.js +1 -1
  207. package/lib-es/currencies/index.js.map +1 -1
  208. package/lib-es/currencies/sortByMarketcap.test.js +2 -1
  209. package/lib-es/currencies/sortByMarketcap.test.js.map +1 -1
  210. package/lib-es/domain/getTokensWithFunds.test.js +1 -1
  211. package/lib-es/domain/getTokensWithFunds.test.js.map +1 -1
  212. package/lib-es/e2e/enum/AppInfos.d.ts +1 -1
  213. package/lib-es/e2e/enum/AppInfos.d.ts.map +1 -1
  214. package/lib-es/e2e/enum/DeviceLabels.d.ts +3 -2
  215. package/lib-es/e2e/enum/DeviceLabels.d.ts.map +1 -1
  216. package/lib-es/e2e/enum/DeviceLabels.js +2 -1
  217. package/lib-es/e2e/enum/DeviceLabels.js.map +1 -1
  218. package/lib-es/e2e/enum/Provider.d.ts.map +1 -1
  219. package/lib-es/e2e/enum/Provider.js +2 -2
  220. package/lib-es/e2e/enum/Provider.js.map +1 -1
  221. package/lib-es/e2e/families/solana.d.ts.map +1 -1
  222. package/lib-es/e2e/families/solana.js +4 -4
  223. package/lib-es/e2e/families/solana.js.map +1 -1
  224. package/lib-es/e2e/index.d.ts +5 -0
  225. package/lib-es/e2e/index.d.ts.map +1 -1
  226. package/lib-es/e2e/speculos.d.ts.map +1 -1
  227. package/lib-es/e2e/speculos.js +4 -5
  228. package/lib-es/e2e/speculos.js.map +1 -1
  229. package/lib-es/e2e/speculosCI.d.ts +4 -0
  230. package/lib-es/e2e/speculosCI.d.ts.map +1 -1
  231. package/lib-es/e2e/speculosCI.js +14 -5
  232. package/lib-es/e2e/speculosCI.js.map +1 -1
  233. package/lib-es/env.react.d.ts +1 -1
  234. package/lib-es/env.react.d.ts.map +1 -1
  235. package/lib-es/exchange/swap/api/v5/actions.js +1 -1
  236. package/lib-es/exchange/swap/api/v5/actions.js.map +1 -1
  237. package/lib-es/exchange/swap/types.d.ts +1 -1
  238. package/lib-es/exchange/swap/types.d.ts.map +1 -1
  239. package/lib-es/families/evm/setup.d.ts.map +1 -1
  240. package/lib-es/families/evm/setup.js +11 -1
  241. package/lib-es/families/evm/setup.js.map +1 -1
  242. package/lib-es/families/hedera/constants.d.ts +2 -0
  243. package/lib-es/families/hedera/constants.d.ts.map +1 -0
  244. package/lib-es/families/hedera/constants.js +3 -0
  245. package/lib-es/families/hedera/constants.js.map +1 -0
  246. package/lib-es/families/hedera/setup.d.ts +5 -5
  247. package/lib-es/families/hedera/setup.d.ts.map +1 -1
  248. package/lib-es/families/hedera/setup.js.map +1 -1
  249. package/lib-es/families/solana/setup.d.ts.map +1 -1
  250. package/lib-es/families/solana/setup.js +2 -1
  251. package/lib-es/families/solana/setup.js.map +1 -1
  252. package/lib-es/families/sui/constants.d.ts +2 -0
  253. package/lib-es/families/sui/constants.d.ts.map +1 -0
  254. package/lib-es/families/sui/constants.js +3 -0
  255. package/lib-es/families/sui/constants.js.map +1 -0
  256. package/lib-es/families/sui/logic.d.ts +2 -0
  257. package/lib-es/families/sui/logic.d.ts.map +1 -0
  258. package/lib-es/families/sui/logic.js +3 -0
  259. package/lib-es/families/sui/logic.js.map +1 -0
  260. package/lib-es/families/sui/react.d.ts +8 -0
  261. package/lib-es/families/sui/react.d.ts.map +1 -0
  262. package/lib-es/families/sui/react.js +78 -0
  263. package/lib-es/families/sui/react.js.map +1 -0
  264. package/lib-es/families/sui/types.d.ts +2 -0
  265. package/lib-es/families/sui/types.d.ts.map +1 -0
  266. package/lib-es/families/sui/types.js +3 -0
  267. package/lib-es/families/sui/types.js.map +1 -0
  268. package/lib-es/featureFlags/defaultFeatures.d.ts.map +1 -1
  269. package/lib-es/featureFlags/defaultFeatures.js +1 -0
  270. package/lib-es/featureFlags/defaultFeatures.js.map +1 -1
  271. package/lib-es/featureFlags/useFeature.d.ts +1 -1
  272. package/lib-es/featureFlags/useFeature.d.ts.map +1 -1
  273. package/lib-es/generated/bridge/js.d.ts +1 -1
  274. package/lib-es/market/utils/countervalueFormatter.d.ts.map +1 -1
  275. package/lib-es/market/utils/countervalueFormatter.js.map +1 -1
  276. package/lib-es/market/utils/types.d.ts +2 -0
  277. package/lib-es/market/utils/types.d.ts.map +1 -1
  278. package/lib-es/modularDrawer/__mocks__/currencies.mock.d.ts.map +1 -1
  279. package/lib-es/modularDrawer/__mocks__/currencies.mock.js +1 -1
  280. package/lib-es/modularDrawer/__mocks__/currencies.mock.js.map +1 -1
  281. package/lib-es/modularDrawer/__mocks__/useGroupedCurrenciesByProvider.mock.js +1 -1
  282. package/lib-es/modularDrawer/__mocks__/useGroupedCurrenciesByProvider.mock.js.map +1 -1
  283. package/lib-es/modularDrawer/data/entities/index.d.ts +68 -0
  284. package/lib-es/modularDrawer/data/entities/index.d.ts.map +1 -0
  285. package/lib-es/modularDrawer/data/entities/index.js +2 -0
  286. package/lib-es/modularDrawer/data/entities/index.js.map +1 -0
  287. package/lib-es/modularDrawer/data/state-manager/api.d.ts +152 -0
  288. package/lib-es/modularDrawer/data/state-manager/api.d.ts.map +1 -0
  289. package/lib-es/modularDrawer/data/state-manager/api.js +42 -0
  290. package/lib-es/modularDrawer/data/state-manager/api.js.map +1 -0
  291. package/lib-es/modularDrawer/hooks/__test__/useAssetsData.test.d.ts +5 -0
  292. package/lib-es/modularDrawer/hooks/__test__/useAssetsData.test.d.ts.map +1 -0
  293. package/lib-es/modularDrawer/hooks/__test__/useAssetsData.test.js +118 -0
  294. package/lib-es/modularDrawer/hooks/__test__/useAssetsData.test.js.map +1 -0
  295. package/lib-es/modularDrawer/hooks/modules/useAssetAccountCounts.d.ts +19 -0
  296. package/lib-es/modularDrawer/hooks/modules/useAssetAccountCounts.d.ts.map +1 -0
  297. package/lib-es/modularDrawer/hooks/modules/useAssetAccountCounts.js +12 -0
  298. package/lib-es/modularDrawer/hooks/modules/useAssetAccountCounts.js.map +1 -0
  299. package/lib-es/modularDrawer/hooks/modules/useLeftApyModule.d.ts +52 -0
  300. package/lib-es/modularDrawer/hooks/modules/useLeftApyModule.d.ts.map +1 -0
  301. package/lib-es/modularDrawer/hooks/modules/useLeftApyModule.js +11 -0
  302. package/lib-es/modularDrawer/hooks/modules/useLeftApyModule.js.map +1 -0
  303. package/lib-es/modularDrawer/hooks/useAssetsData.d.ts +13 -0
  304. package/lib-es/modularDrawer/hooks/useAssetsData.d.ts.map +1 -0
  305. package/lib-es/modularDrawer/hooks/useAssetsData.js +27 -0
  306. package/lib-es/modularDrawer/hooks/useAssetsData.js.map +1 -0
  307. package/lib-es/modularDrawer/types.d.ts +2 -0
  308. package/lib-es/modularDrawer/types.d.ts.map +1 -0
  309. package/lib-es/modularDrawer/types.js +2 -0
  310. package/lib-es/modularDrawer/types.js.map +1 -0
  311. package/lib-es/modularDrawer/utils/__tests__/counterValueFormatter.test.d.ts +2 -0
  312. package/lib-es/modularDrawer/utils/__tests__/counterValueFormatter.test.d.ts.map +1 -0
  313. package/lib-es/modularDrawer/utils/__tests__/counterValueFormatter.test.js +494 -0
  314. package/lib-es/modularDrawer/utils/__tests__/counterValueFormatter.test.js.map +1 -0
  315. package/lib-es/modularDrawer/utils/__tests__/currencyUtils.test.js +1 -1
  316. package/lib-es/modularDrawer/utils/__tests__/currencyUtils.test.js.map +1 -1
  317. package/lib-es/modularDrawer/utils/__tests__/haveOneCommonProvider.test.js +1 -1
  318. package/lib-es/modularDrawer/utils/__tests__/haveOneCommonProvider.test.js.map +1 -1
  319. package/lib-es/modularDrawer/utils/calculateProviderTotal.d.ts +9 -0
  320. package/lib-es/modularDrawer/utils/calculateProviderTotal.d.ts.map +1 -0
  321. package/lib-es/modularDrawer/utils/calculateProviderTotal.js +16 -0
  322. package/lib-es/modularDrawer/utils/calculateProviderTotal.js.map +1 -0
  323. package/lib-es/modularDrawer/utils/counterValueFormatter.d.ts +14 -0
  324. package/lib-es/modularDrawer/utils/counterValueFormatter.d.ts.map +1 -0
  325. package/lib-es/modularDrawer/utils/counterValueFormatter.js +103 -0
  326. package/lib-es/modularDrawer/utils/counterValueFormatter.js.map +1 -0
  327. package/lib-es/modularDrawer/utils/getBalanceAndFiatValueByAssets.d.ts +11 -0
  328. package/lib-es/modularDrawer/utils/getBalanceAndFiatValueByAssets.d.ts.map +1 -0
  329. package/lib-es/modularDrawer/utils/getBalanceAndFiatValueByAssets.js +41 -0
  330. package/lib-es/modularDrawer/utils/getBalanceAndFiatValueByAssets.js.map +1 -0
  331. package/lib-es/modularDrawer/utils/getProviderCurrency.d.ts +3 -0
  332. package/lib-es/modularDrawer/utils/getProviderCurrency.d.ts.map +1 -0
  333. package/lib-es/modularDrawer/utils/getProviderCurrency.js +10 -0
  334. package/lib-es/modularDrawer/utils/getProviderCurrency.js.map +1 -0
  335. package/lib-es/modularDrawer/utils/groupAccountsByAsset.d.ts +11 -0
  336. package/lib-es/modularDrawer/utils/groupAccountsByAsset.d.ts.map +1 -0
  337. package/lib-es/modularDrawer/utils/groupAccountsByAsset.js +25 -0
  338. package/lib-es/modularDrawer/utils/groupAccountsByAsset.js.map +1 -0
  339. package/lib-es/modularDrawer/utils/parseToBigNumber.d.ts +9 -0
  340. package/lib-es/modularDrawer/utils/parseToBigNumber.d.ts.map +1 -0
  341. package/lib-es/modularDrawer/utils/parseToBigNumber.js +17 -0
  342. package/lib-es/modularDrawer/utils/parseToBigNumber.js.map +1 -0
  343. package/lib-es/modularDrawer/utils/type.d.ts +21 -0
  344. package/lib-es/modularDrawer/utils/type.d.ts.map +1 -0
  345. package/lib-es/modularDrawer/utils/type.js +2 -0
  346. package/lib-es/modularDrawer/utils/type.js.map +1 -0
  347. package/lib-es/utils/__tests__/getAccountTuplesForCurrency.test.js +1 -1
  348. package/lib-es/utils/__tests__/getAccountTuplesForCurrency.test.js.map +1 -1
  349. package/lib-es/wallet-api/Exchange/error.d.ts +1 -0
  350. package/lib-es/wallet-api/Exchange/error.d.ts.map +1 -1
  351. package/lib-es/wallet-api/Exchange/error.js +9 -0
  352. package/lib-es/wallet-api/Exchange/error.js.map +1 -1
  353. package/lib-es/wallet-api/Exchange/server.d.ts +2 -0
  354. package/lib-es/wallet-api/Exchange/server.d.ts.map +1 -1
  355. package/lib-es/wallet-api/Exchange/server.js +30 -6
  356. package/lib-es/wallet-api/Exchange/server.js.map +1 -1
  357. package/lib-es/wallet-api/Exchange/server.test.js +3 -0
  358. package/lib-es/wallet-api/Exchange/server.test.js.map +1 -1
  359. package/package.json +36 -34
  360. package/src/DataModel.test.ts +1 -1
  361. package/src/__tests__/accounts/groupPerDay.ts +1 -1
  362. package/src/__tests__/test-helpers/setup.ts +1 -1
  363. package/src/account/serialization.test.ts +1 -1
  364. package/src/bridge/crypto-assets/index.test.ts +1 -1
  365. package/src/bridge/crypto-assets/index.ts +3 -2
  366. package/src/bridge/generic-alpaca/estimateMaxSpendable.ts +11 -5
  367. package/src/bridge/generic-alpaca/getTransactionStatus.ts +2 -1
  368. package/src/bridge/generic-alpaca/prepareTransaction.ts +20 -16
  369. package/src/bridge/generic-alpaca/signOperation.ts +3 -2
  370. package/src/bridge/generic-alpaca/tests/prepareTransaction.test.ts +1 -1
  371. package/src/bridge/generic-alpaca/utils.ts +0 -2
  372. package/src/bridge/impl.ts +1 -1
  373. package/src/currencies/index.ts +0 -1
  374. package/src/currencies/sortByMarketcap.test.ts +3 -2
  375. package/src/domain/getTokensWithFunds.test.ts +1 -1
  376. package/src/e2e/enum/AppInfos.ts +1 -1
  377. package/src/e2e/enum/DeviceLabels.ts +2 -1
  378. package/src/e2e/enum/Provider.ts +2 -2
  379. package/src/e2e/families/solana.ts +7 -4
  380. package/src/e2e/speculos.ts +4 -5
  381. package/src/e2e/speculosCI.ts +18 -6
  382. package/src/exchange/swap/api/v5/actions.ts +1 -1
  383. package/src/exchange/swap/types.ts +1 -1
  384. package/src/families/bitcoin/__snapshots__/bridge.integration.test.ts.snap +7 -0
  385. package/src/families/bitcoin/satstack.test.ts +1 -1
  386. package/src/families/evm/setup.ts +12 -1
  387. package/src/families/hedera/__snapshots__/bridge.integration.test.ts.snap +464 -1135
  388. package/src/families/hedera/constants.ts +2 -0
  389. package/src/families/hedera/setup.ts +7 -3
  390. package/src/families/solana/setup.ts +2 -0
  391. package/src/families/sui/__snapshots__/bridge.integration.test.ts.snap +3 -1
  392. package/src/families/sui/constants.ts +2 -0
  393. package/src/families/sui/logic.ts +2 -0
  394. package/src/families/sui/react.ts +115 -0
  395. package/src/families/sui/types.ts +2 -0
  396. package/src/families/tron/data.mock.ts +1 -1
  397. package/src/featureFlags/defaultFeatures.ts +1 -0
  398. package/src/market/utils/countervalueFormatter.ts +0 -1
  399. package/src/market/utils/types.ts +4 -0
  400. package/src/modularDrawer/__mocks__/currencies.mock.ts +1 -1
  401. package/src/modularDrawer/__mocks__/useGroupedCurrenciesByProvider.mock.ts +1 -1
  402. package/src/modularDrawer/data/entities/index.ts +79 -0
  403. package/src/modularDrawer/data/state-manager/api.ts +62 -0
  404. package/src/modularDrawer/hooks/__test__/useAssetsData.test.ts +139 -0
  405. package/src/modularDrawer/hooks/modules/useAssetAccountCounts.tsx +36 -0
  406. package/src/modularDrawer/hooks/modules/useLeftApyModule.tsx +26 -0
  407. package/src/modularDrawer/hooks/useAssetsData.ts +36 -0
  408. package/src/modularDrawer/types.ts +1 -0
  409. package/src/modularDrawer/utils/__tests__/counterValueFormatter.test.ts +549 -0
  410. package/src/modularDrawer/utils/__tests__/currencyUtils.test.ts +1 -1
  411. package/src/modularDrawer/utils/__tests__/haveOneCommonProvider.test.ts +2 -2
  412. package/src/modularDrawer/utils/calculateProviderTotal.ts +23 -0
  413. package/src/modularDrawer/utils/counterValueFormatter.ts +165 -0
  414. package/src/modularDrawer/utils/getBalanceAndFiatValueByAssets.ts +76 -0
  415. package/src/modularDrawer/utils/getProviderCurrency.ts +13 -0
  416. package/src/modularDrawer/utils/groupAccountsByAsset.ts +51 -0
  417. package/src/modularDrawer/utils/parseToBigNumber.ts +17 -0
  418. package/src/modularDrawer/utils/type.ts +22 -0
  419. package/src/utils/__tests__/getAccountTuplesForCurrency.test.ts +1 -1
  420. package/src/wallet-api/Exchange/error.ts +10 -0
  421. package/src/wallet-api/Exchange/server.test.ts +5 -1
  422. package/src/wallet-api/Exchange/server.ts +44 -5
@@ -0,0 +1,118 @@
1
+ /**
2
+ * @jest-environment jsdom
3
+ */
4
+ import { renderHook } from "@testing-library/react";
5
+ import { useAssetsData } from "../useAssetsData";
6
+ import { useGetAssetsDataQuery } from "../../data/state-manager/api";
7
+ jest.mock("../../data/state-manager/api", () => ({
8
+ useGetAssetsDataQuery: jest.fn(),
9
+ }));
10
+ const mockSetCursor = jest.fn();
11
+ jest.mock("react", () => ({
12
+ ...jest.requireActual("react"),
13
+ useState: jest.fn(() => [undefined, mockSetCursor]),
14
+ useCallback: jest.fn(fn => fn),
15
+ useMemo: jest.fn(fn => fn()),
16
+ }));
17
+ const mockUseGetAssetsDataQuery = jest.mocked(useGetAssetsDataQuery);
18
+ describe("useAssetsData", () => {
19
+ beforeEach(() => {
20
+ jest.clearAllMocks();
21
+ });
22
+ it("should return loading state when API is loading", () => {
23
+ mockUseGetAssetsDataQuery.mockReturnValue({
24
+ data: undefined,
25
+ isLoading: true,
26
+ error: undefined,
27
+ refetch: jest.fn(),
28
+ isFetching: false,
29
+ isSuccess: false,
30
+ isError: false,
31
+ currentData: undefined,
32
+ });
33
+ const { result } = renderHook(() => useAssetsData({}));
34
+ expect(result.current.isLoading).toBe(true);
35
+ expect(result.current.data).toBe(undefined);
36
+ expect(result.current.hasMore).toBe(false);
37
+ });
38
+ it("should return data and hasMore when API returns data", () => {
39
+ const mockData = {
40
+ assetsData: [],
41
+ pagination: { nextCursor: "test-cursor" },
42
+ };
43
+ mockUseGetAssetsDataQuery.mockReturnValue({
44
+ data: mockData,
45
+ isLoading: false,
46
+ error: undefined,
47
+ refetch: jest.fn(),
48
+ isFetching: false,
49
+ isSuccess: true,
50
+ isError: false,
51
+ currentData: mockData,
52
+ });
53
+ const { result } = renderHook(() => useAssetsData({}));
54
+ expect(result.current.data).toBe(mockData);
55
+ expect(result.current.isLoading).toBe(false);
56
+ expect(result.current.hasMore).toBe(true);
57
+ });
58
+ it("should return error when API has error", () => {
59
+ const mockError = new Error("API Error");
60
+ mockUseGetAssetsDataQuery.mockReturnValue({
61
+ data: undefined,
62
+ isLoading: false,
63
+ error: mockError,
64
+ refetch: jest.fn(),
65
+ isFetching: false,
66
+ isSuccess: false,
67
+ isError: true,
68
+ currentData: undefined,
69
+ });
70
+ const { result } = renderHook(() => useAssetsData({}));
71
+ expect(result.current.error).toBe(mockError);
72
+ expect(result.current.isLoading).toBe(false);
73
+ });
74
+ it("should call setCursor when loadNext is called and there's a nextCursor", () => {
75
+ const nextCursor = "next-cursor-456";
76
+ mockUseGetAssetsDataQuery.mockReturnValue({
77
+ data: {
78
+ assetsData: [],
79
+ pagination: { nextCursor },
80
+ },
81
+ isLoading: false,
82
+ error: undefined,
83
+ refetch: jest.fn(),
84
+ isFetching: false,
85
+ isSuccess: true,
86
+ isError: false,
87
+ currentData: {
88
+ assetsData: [],
89
+ pagination: { nextCursor },
90
+ },
91
+ });
92
+ const { result } = renderHook(() => useAssetsData({}));
93
+ result.current.loadNext();
94
+ expect(mockSetCursor).toHaveBeenCalledWith(nextCursor);
95
+ });
96
+ it("should not call setCursor when there's no nextCursor", () => {
97
+ mockUseGetAssetsDataQuery.mockReturnValue({
98
+ data: {
99
+ assetsData: [],
100
+ pagination: { nextCursor: undefined },
101
+ },
102
+ isLoading: false,
103
+ error: undefined,
104
+ refetch: jest.fn(),
105
+ isFetching: false,
106
+ isSuccess: true,
107
+ isError: false,
108
+ currentData: {
109
+ assetsData: [],
110
+ pagination: { nextCursor: undefined },
111
+ },
112
+ });
113
+ const { result } = renderHook(() => useAssetsData({}));
114
+ result.current.loadNext();
115
+ expect(mockSetCursor).not.toHaveBeenCalled();
116
+ });
117
+ });
118
+ //# sourceMappingURL=useAssetsData.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAssetsData.test.js","sourceRoot":"","sources":["../../../../src/modularDrawer/hooks/__test__/useAssetsData.test.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAErE,IAAI,CAAC,IAAI,CAAC,8BAA8B,EAAE,GAAG,EAAE,CAAC,CAAC;IAC/C,qBAAqB,EAAE,IAAI,CAAC,EAAE,EAAE;CACjC,CAAC,CAAC,CAAC;AAEJ,MAAM,aAAa,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;AAChC,IAAI,CA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AChB,KAAK,EAAE,SAAS;YAChB,OAAO,EAAE,IAAI,CAAC,EAAE,EAAE;YAClB,UAAU,EAAE,KAAK;YACjB,SAAS,EAAE,IAAI;YACf,OAAO,EAAE,KAAK;YACd,WAAW,EAAE;gBACX,UAAU,EAAE,EAAE;gBACd,UAAU,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE;aACtC;SACF,CAAC,CAAC;QAEH,MAAM,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC,CAAC;QAEvD,MAAM,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;QAE1B,MAAM,CAAC,aAAa,CAAC,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAC;IAC/C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { Observable } from "rxjs";
2
+ import { CryptoOrTokenCurrency } from "@ledgerhq/types-cryptoassets";
3
+ import type { Account } from "@ledgerhq/types-live";
4
+ import { WalletAPIAccount } from "../../../wallet-api/types";
5
+ type AccountModuleParams = {
6
+ assets: CryptoOrTokenCurrency[];
7
+ nestedAccounts: Account[];
8
+ accountIds: Map<string, boolean> | undefined;
9
+ formatLabel: (count: number) => string;
10
+ accounts$?: Observable<WalletAPIAccount[]>;
11
+ };
12
+ export type AssetCountItem = {
13
+ asset: CryptoOrTokenCurrency;
14
+ label: string;
15
+ count: number;
16
+ };
17
+ export declare const useAssetAccountCounts: ({ assets, nestedAccounts, accountIds, formatLabel, }: AccountModuleParams) => AssetCountItem[];
18
+ export {};
19
+ //# sourceMappingURL=useAssetAccountCounts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAssetAccountCounts.d.ts","sourceRoot":"","sources":["../../../../src/modularDrawer/hooks/modules/useAssetAccountCounts.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAClC,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAErE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAE7D,KAAK,mBAAmB,GAAG;IACzB,MAAM,EAAE,qBAAqB,EAAE,CAAC;IAChC,cAAc,EAAE,OAAO,EAAE,CAAC;IAC1B,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC;IAC7C,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IACvC,SAAS,CAAC,EAAE,UAAU,CAAC,gBAAgB,EAAE,CAAC,CAAC;CAC5C,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,EAAE,qBAAqB,CAAC;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,qBAAqB,yDAK/B,mBAAmB,KAAG,cAAc,EAUD,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { getAccountTuplesForCurrency } from "../../../utils/getAccountTuplesForCurrency";
2
+ export const useAssetAccountCounts = ({ assets, nestedAccounts, accountIds, formatLabel, }) => assets
3
+ .map(asset => {
4
+ const { length } = getAccountTuplesForCurrency(asset, nestedAccounts, accountIds);
5
+ return {
6
+ asset,
7
+ label: formatLabel(length),
8
+ count: length,
9
+ };
10
+ })
11
+ .sort((a, b) => b.count - a.count);
12
+ //# sourceMappingURL=useAssetAccountCounts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAssetAccountCounts.js","sourceRoot":"","sources":["../../../../src/modularDrawer/hooks/modules/useAssetAccountCounts.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,2BAA2B,EAAE,MAAM,4CAA4C,CAAC;AAkBzF,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,EACpC,MAAM,EACN,cAAc,EACd,UAAU,EACV,WAAW,GACS,EAAoB,EAAE,CAC1C,MAAM;KACH,GAAG,CAAC,KAAK,CAAC,EAAE;IACX,MAAM,EAAE,MAAM,EAAE,GAAG,2BAA2B,CAAC,KAAK,EAAE,cAAc,EAAE,UAAU,CAAC,CAAC;IAClF,OAAO;QACL,KAAK;QACL,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC;QAC1B,KAAK,EAAE,MAAM;KACd,CAAC;AACJ,CAAC,CAAC;KACD,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC"}
@@ -0,0 +1,52 @@
1
+ import React from "react";
2
+ import { CryptoOrTokenCurrency } from "@ledgerhq/types-cryptoassets";
3
+ import { ApyType } from "../../types";
4
+ export declare const useLeftApyModule: (assets: CryptoOrTokenCurrency[], ApyIndicator: React.ComponentType<{
5
+ value: number;
6
+ type: ApyType;
7
+ }>) => ({
8
+ leftElement: React.JSX.Element;
9
+ name: string;
10
+ ticker: string;
11
+ units: import("@ledgerhq/types-cryptoassets").Unit[];
12
+ symbol?: string | undefined;
13
+ disableCountervalue?: boolean | undefined;
14
+ delisted?: boolean | undefined;
15
+ keywords?: string[] | undefined;
16
+ type: "CryptoCurrency";
17
+ id: import("@ledgerhq/types-cryptoassets").CryptoCurrencyId | "LBRY" | "groestcoin" | "osmo";
18
+ forkedFrom?: string | undefined;
19
+ managerAppName: string;
20
+ coinType: import("@ledgerhq/types-cryptoassets").CoinType;
21
+ scheme: string;
22
+ color: string;
23
+ family: string;
24
+ blockAvgTime?: number | undefined;
25
+ supportsSegwit?: boolean | undefined;
26
+ supportsNativeSegwit?: boolean | undefined;
27
+ isTestnetFor?: string | undefined;
28
+ bitcoinLikeInfo?: import("@ledgerhq/types-cryptoassets").BitcoinLikeInfo | undefined;
29
+ ethereumLikeInfo?: import("@ledgerhq/types-cryptoassets").EthereumLikeInfo | undefined;
30
+ explorerViews: import("@ledgerhq/types-cryptoassets").ExplorerView[];
31
+ terminated?: {
32
+ link: string;
33
+ } | undefined;
34
+ deviceTicker?: string | undefined;
35
+ explorerId?: import("@ledgerhq/types-cryptoassets").LedgerExplorerId | undefined;
36
+ } | {
37
+ leftElement: React.JSX.Element;
38
+ name: string;
39
+ ticker: string;
40
+ units: import("@ledgerhq/types-cryptoassets").Unit[];
41
+ symbol?: string | undefined;
42
+ disableCountervalue?: boolean | undefined;
43
+ delisted?: boolean | undefined;
44
+ keywords?: string[] | undefined;
45
+ type: "TokenCurrency";
46
+ id: string;
47
+ ledgerSignature?: string | undefined;
48
+ contractAddress: string;
49
+ parentCurrency: import("@ledgerhq/types-cryptoassets").CryptoCurrency;
50
+ tokenType: string;
51
+ })[];
52
+ //# sourceMappingURL=useLeftApyModule.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useLeftApyModule.d.ts","sourceRoot":"","sources":["../../../../src/modularDrawer/hooks/modules/useLeftApyModule.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAYtC,eAAO,MAAM,gBAAgB,WACnB,qBAAqB,EAAE,gBACjB,MAAM,aAAa,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IASpE,CAAC"}
@@ -0,0 +1,11 @@
1
+ import React from "react";
2
+ const createApyItem = ({ value, type, ApyIndicator, }) => React.createElement(ApyIndicator, { value: value, type: type });
3
+ export const useLeftApyModule = (assets, ApyIndicator) => {
4
+ const value = 5.11; // TODO to be retrieved from DADA
5
+ const type = "APY"; // TODO to be retrieved from DADA
6
+ return assets.map(asset => ({
7
+ ...asset,
8
+ leftElement: createApyItem({ value, type, ApyIndicator }),
9
+ }));
10
+ };
11
+ //# sourceMappingURL=useLeftApyModule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useLeftApyModule.js","sourceRoot":"","sources":["../../../../src/modularDrawer/hooks/modules/useLeftApyModule.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,MAAM,aAAa,GAAG,CAAC,EACrB,KAAK,EACL,IAAI,EACJ,YAAY,GAKb,EAAE,EAAE,CAAC,oBAAC,YAAY,IAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,GAAI,CAAC;AAEjD,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAC9B,MAA+B,EAC/B,YAAmE,EACnE,EAAE;IACF,MAAM,KAAK,GAAG,IAAI,CAAC,CAAC,iCAAiC;IACrD,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,iCAAiC;IAErD,OAAO,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QAC1B,GAAG,KAAK;QACR,WAAW,EAAE,aAAa,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;KAC1D,CAAC,CAAC,CAAC;AACN,CAAC,CAAC"}
@@ -0,0 +1,13 @@
1
+ export declare function useAssetsData({ search, currencyIds, }: {
2
+ search?: string;
3
+ currencyIds?: string[];
4
+ }): {
5
+ data: import("../data/state-manager/api").AssetsDataWithPagination | undefined;
6
+ error: import("@reduxjs/toolkit/query").FetchBaseQueryError | import("@reduxjs/toolkit").SerializedError | undefined;
7
+ isLoading: boolean;
8
+ isSuccess: boolean;
9
+ hasMore: boolean;
10
+ cursor: string | undefined;
11
+ loadNext: () => void;
12
+ };
13
+ //# sourceMappingURL=useAssetsData.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAssetsData.d.ts","sourceRoot":"","sources":["../../../src/modularDrawer/hooks/useAssetsData.ts"],"names":[],"mappings":"AAGA,wBAAgB,aAAa,CAAC,EAC5B,MAAM,EACN,WAAW,GACZ,EAAE;IACD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;CACxB;;;;;;;;EA0BA"}
@@ -0,0 +1,27 @@
1
+ import { useState, useCallback } from "react";
2
+ import { useGetAssetsDataQuery } from "../data/state-manager/api";
3
+ export function useAssetsData({ search, currencyIds, }) {
4
+ const [cursor, setCursor] = useState(undefined);
5
+ const { data, error, isLoading, isSuccess } = useGetAssetsDataQuery({
6
+ cursor,
7
+ search,
8
+ currencyIds,
9
+ });
10
+ const loadNext = useCallback(() => {
11
+ const nextCursor = data?.pagination?.nextCursor;
12
+ if (nextCursor) {
13
+ setCursor(nextCursor);
14
+ }
15
+ }, [data?.pagination?.nextCursor]);
16
+ const hasMore = Boolean(data?.pagination?.nextCursor);
17
+ return {
18
+ data,
19
+ error,
20
+ isLoading,
21
+ isSuccess,
22
+ hasMore,
23
+ cursor,
24
+ loadNext,
25
+ };
26
+ }
27
+ //# sourceMappingURL=useAssetsData.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAssetsData.js","sourceRoot":"","sources":["../../../src/modularDrawer/hooks/useAssetsData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAC9C,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAElE,MAAM,UAAU,aAAa,CAAC,EAC5B,MAAM,EACN,WAAW,GAIZ;IACC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAqB,SAAS,CAAC,CAAC;IACpE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,qBAAqB,CAAC;QAClE,MAAM;QACN,MAAM;QACN,WAAW;KACZ,CAAC,CAAC;IAEH,MAAM,QAAQ,GAAG,WAAW,CAAC,GAAG,EAAE;QAChC,MAAM,UAAU,GAAG,IAAI,EAAE,UAAU,EAAE,UAAU,CAAC;QAChD,IAAI,UAAU,EAAE;YACd,SAAS,CAAC,UAAU,CAAC,CAAC;SACvB;IACH,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC;IAEnC,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;IAEtD,OAAO;QACL,IAAI;QACJ,KAAK;QACL,SAAS;QACT,SAAS;QACT,OAAO;QACP,MAAM;QACN,QAAQ;KACT,CAAC;AACJ,CAAC"}
@@ -0,0 +1,2 @@
1
+ export type ApyType = "NRR" | "APY" | "APR";
2
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/modularDrawer/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,OAAO,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/modularDrawer/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=counterValueFormatter.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"counterValueFormatter.test.d.ts","sourceRoot":"","sources":["../../../../src/modularDrawer/utils/__tests__/counterValueFormatter.test.ts"],"names":[],"mappings":""}