@ledgerhq/live-common 34.47.0-nightly.8 → 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 (390) 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 +14 -4
  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/getTransactionStatus.d.ts.map +1 -1
  19. package/lib/bridge/generic-alpaca/getTransactionStatus.js +1 -0
  20. package/lib/bridge/generic-alpaca/getTransactionStatus.js.map +1 -1
  21. package/lib/bridge/generic-alpaca/prepareTransaction.d.ts +3 -14
  22. package/lib/bridge/generic-alpaca/prepareTransaction.d.ts.map +1 -1
  23. package/lib/bridge/generic-alpaca/prepareTransaction.js +5 -21
  24. package/lib/bridge/generic-alpaca/prepareTransaction.js.map +1 -1
  25. package/lib/bridge/generic-alpaca/tests/utils.test.d.ts.map +1 -0
  26. package/lib/bridge/generic-alpaca/tests/utils.test.js +20 -0
  27. package/lib/bridge/generic-alpaca/tests/utils.test.js.map +1 -0
  28. package/lib/bridge/generic-alpaca/utils.d.ts.map +1 -1
  29. package/lib/bridge/generic-alpaca/utils.js +5 -6
  30. package/lib/bridge/generic-alpaca/utils.js.map +1 -1
  31. package/lib/e2e/enum/DeviceLabels.d.ts +1 -3
  32. package/lib/e2e/enum/DeviceLabels.d.ts.map +1 -1
  33. package/lib/e2e/enum/DeviceLabels.js +0 -2
  34. package/lib/e2e/enum/DeviceLabels.js.map +1 -1
  35. package/lib/e2e/families/tezos.d.ts.map +1 -1
  36. package/lib/e2e/families/tezos.js +0 -2
  37. package/lib/e2e/families/tezos.js.map +1 -1
  38. package/lib/e2e/index.d.ts +6 -4
  39. package/lib/e2e/index.d.ts.map +1 -1
  40. package/lib/e2e/speculos.d.ts +0 -1
  41. package/lib/e2e/speculos.d.ts.map +1 -1
  42. package/lib/e2e/speculos.js +2 -12
  43. package/lib/e2e/speculos.js.map +1 -1
  44. package/lib/exchange/platform/transfer/completeExchange.d.ts.map +1 -1
  45. package/lib/exchange/platform/transfer/completeExchange.js +5 -3
  46. package/lib/exchange/platform/transfer/completeExchange.js.map +1 -1
  47. package/lib/exchange/swap/completeExchange.d.ts.map +1 -1
  48. package/lib/exchange/swap/completeExchange.js +2 -5
  49. package/lib/exchange/swap/completeExchange.js.map +1 -1
  50. package/lib/exchange/swap/initSwap.d.ts.map +1 -1
  51. package/lib/exchange/swap/initSwap.js +2 -5
  52. package/lib/exchange/swap/initSwap.js.map +1 -1
  53. package/lib/families/canton/config.d.ts.map +1 -1
  54. package/lib/families/canton/config.js +0 -4
  55. package/lib/families/canton/config.js.map +1 -1
  56. package/lib/families/solana/setup.d.ts.map +1 -1
  57. package/lib/families/solana/setup.js +0 -9
  58. package/lib/families/solana/setup.js.map +1 -1
  59. package/lib/featureFlags/defaultFeatures.d.ts.map +1 -1
  60. package/lib/featureFlags/defaultFeatures.js +2 -1
  61. package/lib/featureFlags/defaultFeatures.js.map +1 -1
  62. package/lib/featureFlags/useFeature.d.ts +1 -1
  63. package/lib/featureFlags/useFeature.d.ts.map +1 -1
  64. package/lib/modularDrawer/data/state-manager/api.d.ts +37 -727
  65. package/lib/modularDrawer/data/state-manager/api.d.ts.map +1 -1
  66. package/lib/modularDrawer/data/state-manager/api.js +17 -38
  67. package/lib/modularDrawer/data/state-manager/api.js.map +1 -1
  68. package/lib/modularDrawer/hooks/__test__/useAssetsData.test.js +78 -134
  69. package/lib/modularDrawer/hooks/__test__/useAssetsData.test.js.map +1 -1
  70. package/{lib-es/modularDrawer/hooks → lib/modularDrawer/hooks/modules}/useAssetAccountCounts.d.ts +1 -1
  71. package/lib/modularDrawer/hooks/modules/useAssetAccountCounts.d.ts.map +1 -0
  72. package/lib/modularDrawer/hooks/{useAssetAccountCounts.js → modules/useAssetAccountCounts.js} +1 -1
  73. package/lib/modularDrawer/hooks/modules/useAssetAccountCounts.js.map +1 -0
  74. package/lib/modularDrawer/hooks/modules/useLeftApyModule.d.ts +3 -3
  75. package/lib/modularDrawer/hooks/modules/useLeftApyModule.d.ts.map +1 -1
  76. package/lib/modularDrawer/hooks/modules/useLeftApyModule.js +10 -59
  77. package/lib/modularDrawer/hooks/modules/useLeftApyModule.js.map +1 -1
  78. package/lib/modularDrawer/hooks/useAssetsData.d.ts +6 -10
  79. package/lib/modularDrawer/hooks/useAssetsData.d.ts.map +1 -1
  80. package/lib/modularDrawer/hooks/useAssetsData.js +17 -40
  81. package/lib/modularDrawer/hooks/useAssetsData.js.map +1 -1
  82. package/lib/modularDrawer/types.d.ts +2 -0
  83. package/lib/modularDrawer/types.d.ts.map +1 -0
  84. package/lib/modularDrawer/types.js +3 -0
  85. package/lib/modularDrawer/types.js.map +1 -0
  86. package/lib/modularDrawer/utils/type.d.ts +1 -89
  87. package/lib/modularDrawer/utils/type.d.ts.map +1 -1
  88. package/lib/wallet-api/Exchange/server.js +2 -2
  89. package/lib/wallet-api/Exchange/server.js.map +1 -1
  90. package/lib/wallet-api/react.d.ts +0 -2
  91. package/lib/wallet-api/react.d.ts.map +1 -1
  92. package/lib/wallet-api/react.js +1 -3
  93. package/lib/wallet-api/react.js.map +1 -1
  94. package/lib-es/bridge/crypto-assets/index.d.ts.map +1 -1
  95. package/lib-es/bridge/crypto-assets/index.js +0 -4
  96. package/lib-es/bridge/crypto-assets/index.js.map +1 -1
  97. package/lib-es/bridge/crypto-assets/index.test.js +0 -36
  98. package/lib-es/bridge/crypto-assets/index.test.js.map +1 -1
  99. package/lib-es/bridge/generic-alpaca/alpaca/index.d.ts.map +1 -1
  100. package/lib-es/bridge/generic-alpaca/alpaca/index.js +1 -6
  101. package/lib-es/bridge/generic-alpaca/alpaca/index.js.map +1 -1
  102. package/lib-es/bridge/generic-alpaca/alpaca/network/network-alpaca.js +1 -1
  103. package/lib-es/bridge/generic-alpaca/alpaca/network/network-alpaca.js.map +1 -1
  104. package/lib-es/bridge/generic-alpaca/buildSubAccounts.d.ts +3 -2
  105. package/lib-es/bridge/generic-alpaca/buildSubAccounts.d.ts.map +1 -1
  106. package/lib-es/bridge/generic-alpaca/buildSubAccounts.js +12 -4
  107. package/lib-es/bridge/generic-alpaca/buildSubAccounts.js.map +1 -1
  108. package/lib-es/bridge/generic-alpaca/getAccountShape.d.ts.map +1 -1
  109. package/lib-es/bridge/generic-alpaca/getAccountShape.js +3 -3
  110. package/lib-es/bridge/generic-alpaca/getAccountShape.js.map +1 -1
  111. package/lib-es/bridge/generic-alpaca/getTransactionStatus.d.ts.map +1 -1
  112. package/lib-es/bridge/generic-alpaca/getTransactionStatus.js +1 -0
  113. package/lib-es/bridge/generic-alpaca/getTransactionStatus.js.map +1 -1
  114. package/lib-es/bridge/generic-alpaca/prepareTransaction.d.ts +3 -14
  115. package/lib-es/bridge/generic-alpaca/prepareTransaction.d.ts.map +1 -1
  116. package/lib-es/bridge/generic-alpaca/prepareTransaction.js +5 -21
  117. package/lib-es/bridge/generic-alpaca/prepareTransaction.js.map +1 -1
  118. package/lib-es/bridge/generic-alpaca/tests/utils.test.d.ts.map +1 -0
  119. package/lib-es/bridge/generic-alpaca/tests/utils.test.js +18 -0
  120. package/lib-es/bridge/generic-alpaca/tests/utils.test.js.map +1 -0
  121. package/lib-es/bridge/generic-alpaca/utils.d.ts.map +1 -1
  122. package/lib-es/bridge/generic-alpaca/utils.js +5 -6
  123. package/lib-es/bridge/generic-alpaca/utils.js.map +1 -1
  124. package/lib-es/e2e/enum/DeviceLabels.d.ts +1 -3
  125. package/lib-es/e2e/enum/DeviceLabels.d.ts.map +1 -1
  126. package/lib-es/e2e/enum/DeviceLabels.js +0 -2
  127. package/lib-es/e2e/enum/DeviceLabels.js.map +1 -1
  128. package/lib-es/e2e/families/tezos.d.ts.map +1 -1
  129. package/lib-es/e2e/families/tezos.js +0 -2
  130. package/lib-es/e2e/families/tezos.js.map +1 -1
  131. package/lib-es/e2e/index.d.ts +6 -4
  132. package/lib-es/e2e/index.d.ts.map +1 -1
  133. package/lib-es/e2e/speculos.d.ts +0 -1
  134. package/lib-es/e2e/speculos.d.ts.map +1 -1
  135. package/lib-es/e2e/speculos.js +1 -10
  136. package/lib-es/e2e/speculos.js.map +1 -1
  137. package/lib-es/exchange/platform/transfer/completeExchange.d.ts.map +1 -1
  138. package/lib-es/exchange/platform/transfer/completeExchange.js +2 -3
  139. package/lib-es/exchange/platform/transfer/completeExchange.js.map +1 -1
  140. package/lib-es/exchange/swap/completeExchange.d.ts.map +1 -1
  141. package/lib-es/exchange/swap/completeExchange.js +2 -5
  142. package/lib-es/exchange/swap/completeExchange.js.map +1 -1
  143. package/lib-es/exchange/swap/initSwap.d.ts.map +1 -1
  144. package/lib-es/exchange/swap/initSwap.js +2 -5
  145. package/lib-es/exchange/swap/initSwap.js.map +1 -1
  146. package/lib-es/families/canton/config.d.ts.map +1 -1
  147. package/lib-es/families/canton/config.js +0 -4
  148. package/lib-es/families/canton/config.js.map +1 -1
  149. package/lib-es/families/solana/setup.d.ts.map +1 -1
  150. package/lib-es/families/solana/setup.js +0 -9
  151. package/lib-es/families/solana/setup.js.map +1 -1
  152. package/lib-es/featureFlags/defaultFeatures.d.ts.map +1 -1
  153. package/lib-es/featureFlags/defaultFeatures.js +2 -1
  154. package/lib-es/featureFlags/defaultFeatures.js.map +1 -1
  155. package/lib-es/featureFlags/useFeature.d.ts +1 -1
  156. package/lib-es/featureFlags/useFeature.d.ts.map +1 -1
  157. package/lib-es/modularDrawer/data/state-manager/api.d.ts +37 -727
  158. package/lib-es/modularDrawer/data/state-manager/api.d.ts.map +1 -1
  159. package/lib-es/modularDrawer/data/state-manager/api.js +14 -35
  160. package/lib-es/modularDrawer/data/state-manager/api.js.map +1 -1
  161. package/lib-es/modularDrawer/hooks/__test__/useAssetsData.test.js +79 -135
  162. package/lib-es/modularDrawer/hooks/__test__/useAssetsData.test.js.map +1 -1
  163. package/{lib/modularDrawer/hooks → lib-es/modularDrawer/hooks/modules}/useAssetAccountCounts.d.ts +1 -1
  164. package/lib-es/modularDrawer/hooks/modules/useAssetAccountCounts.d.ts.map +1 -0
  165. package/lib-es/modularDrawer/hooks/{useAssetAccountCounts.js → modules/useAssetAccountCounts.js} +1 -1
  166. package/lib-es/modularDrawer/hooks/modules/useAssetAccountCounts.js.map +1 -0
  167. package/lib-es/modularDrawer/hooks/modules/useLeftApyModule.d.ts +3 -3
  168. package/lib-es/modularDrawer/hooks/modules/useLeftApyModule.d.ts.map +1 -1
  169. package/lib-es/modularDrawer/hooks/modules/useLeftApyModule.js +8 -37
  170. package/lib-es/modularDrawer/hooks/modules/useLeftApyModule.js.map +1 -1
  171. package/lib-es/modularDrawer/hooks/useAssetsData.d.ts +6 -10
  172. package/lib-es/modularDrawer/hooks/useAssetsData.d.ts.map +1 -1
  173. package/lib-es/modularDrawer/hooks/useAssetsData.js +19 -42
  174. package/lib-es/modularDrawer/hooks/useAssetsData.js.map +1 -1
  175. package/lib-es/modularDrawer/types.d.ts +2 -0
  176. package/lib-es/modularDrawer/types.d.ts.map +1 -0
  177. package/lib-es/modularDrawer/types.js +2 -0
  178. package/lib-es/modularDrawer/types.js.map +1 -0
  179. package/lib-es/modularDrawer/utils/type.d.ts +1 -89
  180. package/lib-es/modularDrawer/utils/type.d.ts.map +1 -1
  181. package/lib-es/wallet-api/Exchange/server.js +2 -2
  182. package/lib-es/wallet-api/Exchange/server.js.map +1 -1
  183. package/lib-es/wallet-api/react.d.ts +0 -2
  184. package/lib-es/wallet-api/react.d.ts.map +1 -1
  185. package/lib-es/wallet-api/react.js +1 -3
  186. package/lib-es/wallet-api/react.js.map +1 -1
  187. package/package.json +77 -77
  188. package/src/bridge/crypto-assets/index.test.ts +0 -47
  189. package/src/bridge/crypto-assets/index.ts +0 -5
  190. package/src/bridge/generic-alpaca/alpaca/index.ts +1 -14
  191. package/src/bridge/generic-alpaca/alpaca/network/network-alpaca.ts +1 -1
  192. package/src/bridge/generic-alpaca/buildSubAccounts.ts +14 -5
  193. package/src/bridge/generic-alpaca/getAccountShape.ts +4 -3
  194. package/src/bridge/generic-alpaca/getTransactionStatus.ts +1 -0
  195. package/src/bridge/generic-alpaca/prepareTransaction.ts +17 -44
  196. package/src/bridge/generic-alpaca/tests/utils.test.ts +19 -0
  197. package/src/bridge/generic-alpaca/utils.ts +5 -7
  198. package/src/e2e/enum/DeviceLabels.ts +0 -2
  199. package/src/e2e/families/tezos.ts +0 -2
  200. package/src/e2e/speculos.ts +1 -11
  201. package/src/exchange/platform/transfer/completeExchange.ts +2 -3
  202. package/src/exchange/swap/completeExchange.ts +2 -5
  203. package/src/exchange/swap/initSwap.ts +4 -5
  204. package/src/families/canton/config.ts +0 -5
  205. package/src/families/solana/setup.ts +0 -9
  206. package/src/featureFlags/defaultFeatures.ts +2 -1
  207. package/src/modularDrawer/data/state-manager/api.ts +27 -42
  208. package/src/modularDrawer/hooks/__test__/useAssetsData.test.ts +80 -141
  209. package/src/modularDrawer/hooks/{useAssetAccountCounts.tsx → modules/useAssetAccountCounts.tsx} +2 -2
  210. package/src/modularDrawer/hooks/modules/useLeftApyModule.tsx +9 -42
  211. package/src/modularDrawer/hooks/useAssetsData.ts +22 -59
  212. package/src/modularDrawer/types.ts +1 -0
  213. package/src/modularDrawer/utils/type.ts +0 -97
  214. package/src/wallet-api/Exchange/server.ts +2 -2
  215. package/src/wallet-api/react.ts +1 -5
  216. package/lib/bridge/crypto-assets/cal-integration.d.ts +0 -4
  217. package/lib/bridge/crypto-assets/cal-integration.d.ts.map +0 -1
  218. package/lib/bridge/crypto-assets/cal-integration.js +0 -26
  219. package/lib/bridge/crypto-assets/cal-integration.js.map +0 -1
  220. package/lib/bridge/crypto-assets/cal-integration.test.d.ts +0 -2
  221. package/lib/bridge/crypto-assets/cal-integration.test.d.ts.map +0 -1
  222. package/lib/bridge/crypto-assets/cal-integration.test.js +0 -45
  223. package/lib/bridge/crypto-assets/cal-integration.test.js.map +0 -1
  224. package/lib/bridge/crypto-assets/cal-store.d.ts +0 -14
  225. package/lib/bridge/crypto-assets/cal-store.d.ts.map +0 -1
  226. package/lib/bridge/crypto-assets/cal-store.js +0 -58
  227. package/lib/bridge/crypto-assets/cal-store.js.map +0 -1
  228. package/lib/bridge/crypto-assets/cal-store.test.d.ts +0 -2
  229. package/lib/bridge/crypto-assets/cal-store.test.d.ts.map +0 -1
  230. package/lib/bridge/crypto-assets/cal-store.test.js +0 -70
  231. package/lib/bridge/crypto-assets/cal-store.test.js.map +0 -1
  232. package/lib/bridge/generic-alpaca/alpaca/index.unit.test.d.ts +0 -2
  233. package/lib/bridge/generic-alpaca/alpaca/index.unit.test.d.ts.map +0 -1
  234. package/lib/bridge/generic-alpaca/alpaca/index.unit.test.js +0 -89
  235. package/lib/bridge/generic-alpaca/alpaca/index.unit.test.js.map +0 -1
  236. package/lib/bridge/generic-alpaca/utils.test.d.ts.map +0 -1
  237. package/lib/bridge/generic-alpaca/utils.test.js +0 -123
  238. package/lib/bridge/generic-alpaca/utils.test.js.map +0 -1
  239. package/lib/modularDrawer/__mocks__/dada.mock.d.ts +0 -3336
  240. package/lib/modularDrawer/__mocks__/dada.mock.d.ts.map +0 -1
  241. package/lib/modularDrawer/__mocks__/dada.mock.js +0 -3879
  242. package/lib/modularDrawer/__mocks__/dada.mock.js.map +0 -1
  243. package/lib/modularDrawer/data/entities/interestRateSelectors.d.ts +0 -16
  244. package/lib/modularDrawer/data/entities/interestRateSelectors.d.ts.map +0 -1
  245. package/lib/modularDrawer/data/entities/interestRateSelectors.js +0 -21
  246. package/lib/modularDrawer/data/entities/interestRateSelectors.js.map +0 -1
  247. package/lib/modularDrawer/data/state-manager/types.d.ts +0 -24
  248. package/lib/modularDrawer/data/state-manager/types.d.ts.map +0 -1
  249. package/lib/modularDrawer/data/state-manager/types.js +0 -13
  250. package/lib/modularDrawer/data/state-manager/types.js.map +0 -1
  251. package/lib/modularDrawer/hooks/useAssetAccountCounts.d.ts.map +0 -1
  252. package/lib/modularDrawer/hooks/useAssetAccountCounts.js.map +0 -1
  253. package/lib/modularDrawer/hooks/useLeftAccounts.d.ts +0 -13
  254. package/lib/modularDrawer/hooks/useLeftAccounts.d.ts.map +0 -1
  255. package/lib/modularDrawer/hooks/useLeftAccounts.js +0 -15
  256. package/lib/modularDrawer/hooks/useLeftAccounts.js.map +0 -1
  257. package/lib/modularDrawer/hooks/useLeftAccountsApy.d.ts +0 -6
  258. package/lib/modularDrawer/hooks/useLeftAccountsApy.d.ts.map +0 -1
  259. package/lib/modularDrawer/hooks/useLeftAccountsApy.js +0 -19
  260. package/lib/modularDrawer/hooks/useLeftAccountsApy.js.map +0 -1
  261. package/lib/modularDrawer/hooks/useLeftApy.d.ts +0 -54
  262. package/lib/modularDrawer/hooks/useLeftApy.d.ts.map +0 -1
  263. package/lib/modularDrawer/hooks/useLeftApy.js +0 -15
  264. package/lib/modularDrawer/hooks/useLeftApy.js.map +0 -1
  265. package/lib/modularDrawer/hooks/useRightBalanceAsset.d.ts +0 -57
  266. package/lib/modularDrawer/hooks/useRightBalanceAsset.d.ts.map +0 -1
  267. package/lib/modularDrawer/hooks/useRightBalanceAsset.js +0 -87
  268. package/lib/modularDrawer/hooks/useRightBalanceAsset.js.map +0 -1
  269. package/lib/modularDrawer/hooks/useRightBalanceNetwork.d.ts +0 -63
  270. package/lib/modularDrawer/hooks/useRightBalanceNetwork.d.ts.map +0 -1
  271. package/lib/modularDrawer/hooks/useRightBalanceNetwork.js +0 -66
  272. package/lib/modularDrawer/hooks/useRightBalanceNetwork.js.map +0 -1
  273. package/lib/modularDrawer/modules/createAssetConfiguration.d.ts +0 -4
  274. package/lib/modularDrawer/modules/createAssetConfiguration.d.ts.map +0 -1
  275. package/lib/modularDrawer/modules/createAssetConfiguration.js +0 -41
  276. package/lib/modularDrawer/modules/createAssetConfiguration.js.map +0 -1
  277. package/lib/modularDrawer/modules/createNetworkConfiguration.d.ts +0 -6
  278. package/lib/modularDrawer/modules/createNetworkConfiguration.d.ts.map +0 -1
  279. package/lib/modularDrawer/modules/createNetworkConfiguration.js +0 -56
  280. package/lib/modularDrawer/modules/createNetworkConfiguration.js.map +0 -1
  281. package/lib/modularDrawer/utils/buildProviderCurrenciesMap.d.ts +0 -9
  282. package/lib/modularDrawer/utils/buildProviderCurrenciesMap.d.ts.map +0 -1
  283. package/lib/modularDrawer/utils/buildProviderCurrenciesMap.js +0 -17
  284. package/lib/modularDrawer/utils/buildProviderCurrenciesMap.js.map +0 -1
  285. package/lib/modularDrawer/utils/getLoadingStatus.d.ts +0 -9
  286. package/lib/modularDrawer/utils/getLoadingStatus.d.ts.map +0 -1
  287. package/lib/modularDrawer/utils/getLoadingStatus.js +0 -18
  288. package/lib/modularDrawer/utils/getLoadingStatus.js.map +0 -1
  289. package/lib/modularDrawer/utils/sortByBalance.d.ts +0 -6
  290. package/lib/modularDrawer/utils/sortByBalance.d.ts.map +0 -1
  291. package/lib/modularDrawer/utils/sortByBalance.js +0 -32
  292. package/lib/modularDrawer/utils/sortByBalance.js.map +0 -1
  293. package/lib-es/bridge/crypto-assets/cal-integration.d.ts +0 -4
  294. package/lib-es/bridge/crypto-assets/cal-integration.d.ts.map +0 -1
  295. package/lib-es/bridge/crypto-assets/cal-integration.js +0 -21
  296. package/lib-es/bridge/crypto-assets/cal-integration.js.map +0 -1
  297. package/lib-es/bridge/crypto-assets/cal-integration.test.d.ts +0 -2
  298. package/lib-es/bridge/crypto-assets/cal-integration.test.d.ts.map +0 -1
  299. package/lib-es/bridge/crypto-assets/cal-integration.test.js +0 -43
  300. package/lib-es/bridge/crypto-assets/cal-integration.test.js.map +0 -1
  301. package/lib-es/bridge/crypto-assets/cal-store.d.ts +0 -14
  302. package/lib-es/bridge/crypto-assets/cal-store.d.ts.map +0 -1
  303. package/lib-es/bridge/crypto-assets/cal-store.js +0 -54
  304. package/lib-es/bridge/crypto-assets/cal-store.js.map +0 -1
  305. package/lib-es/bridge/crypto-assets/cal-store.test.d.ts +0 -2
  306. package/lib-es/bridge/crypto-assets/cal-store.test.d.ts.map +0 -1
  307. package/lib-es/bridge/crypto-assets/cal-store.test.js +0 -68
  308. package/lib-es/bridge/crypto-assets/cal-store.test.js.map +0 -1
  309. package/lib-es/bridge/generic-alpaca/alpaca/index.unit.test.d.ts +0 -2
  310. package/lib-es/bridge/generic-alpaca/alpaca/index.unit.test.d.ts.map +0 -1
  311. package/lib-es/bridge/generic-alpaca/alpaca/index.unit.test.js +0 -64
  312. package/lib-es/bridge/generic-alpaca/alpaca/index.unit.test.js.map +0 -1
  313. package/lib-es/bridge/generic-alpaca/utils.test.d.ts.map +0 -1
  314. package/lib-es/bridge/generic-alpaca/utils.test.js +0 -118
  315. package/lib-es/bridge/generic-alpaca/utils.test.js.map +0 -1
  316. package/lib-es/modularDrawer/__mocks__/dada.mock.d.ts +0 -3336
  317. package/lib-es/modularDrawer/__mocks__/dada.mock.d.ts.map +0 -1
  318. package/lib-es/modularDrawer/__mocks__/dada.mock.js +0 -3876
  319. package/lib-es/modularDrawer/__mocks__/dada.mock.js.map +0 -1
  320. package/lib-es/modularDrawer/data/entities/interestRateSelectors.d.ts +0 -16
  321. package/lib-es/modularDrawer/data/entities/interestRateSelectors.d.ts.map +0 -1
  322. package/lib-es/modularDrawer/data/entities/interestRateSelectors.js +0 -18
  323. package/lib-es/modularDrawer/data/entities/interestRateSelectors.js.map +0 -1
  324. package/lib-es/modularDrawer/data/state-manager/types.d.ts +0 -24
  325. package/lib-es/modularDrawer/data/state-manager/types.d.ts.map +0 -1
  326. package/lib-es/modularDrawer/data/state-manager/types.js +0 -10
  327. package/lib-es/modularDrawer/data/state-manager/types.js.map +0 -1
  328. package/lib-es/modularDrawer/hooks/useAssetAccountCounts.d.ts.map +0 -1
  329. package/lib-es/modularDrawer/hooks/useAssetAccountCounts.js.map +0 -1
  330. package/lib-es/modularDrawer/hooks/useLeftAccounts.d.ts +0 -13
  331. package/lib-es/modularDrawer/hooks/useLeftAccounts.d.ts.map +0 -1
  332. package/lib-es/modularDrawer/hooks/useLeftAccounts.js +0 -11
  333. package/lib-es/modularDrawer/hooks/useLeftAccounts.js.map +0 -1
  334. package/lib-es/modularDrawer/hooks/useLeftAccountsApy.d.ts +0 -6
  335. package/lib-es/modularDrawer/hooks/useLeftAccountsApy.d.ts.map +0 -1
  336. package/lib-es/modularDrawer/hooks/useLeftAccountsApy.js +0 -15
  337. package/lib-es/modularDrawer/hooks/useLeftAccountsApy.js.map +0 -1
  338. package/lib-es/modularDrawer/hooks/useLeftApy.d.ts +0 -54
  339. package/lib-es/modularDrawer/hooks/useLeftApy.d.ts.map +0 -1
  340. package/lib-es/modularDrawer/hooks/useLeftApy.js +0 -11
  341. package/lib-es/modularDrawer/hooks/useLeftApy.js.map +0 -1
  342. package/lib-es/modularDrawer/hooks/useRightBalanceAsset.d.ts +0 -57
  343. package/lib-es/modularDrawer/hooks/useRightBalanceAsset.d.ts.map +0 -1
  344. package/lib-es/modularDrawer/hooks/useRightBalanceAsset.js +0 -83
  345. package/lib-es/modularDrawer/hooks/useRightBalanceAsset.js.map +0 -1
  346. package/lib-es/modularDrawer/hooks/useRightBalanceNetwork.d.ts +0 -63
  347. package/lib-es/modularDrawer/hooks/useRightBalanceNetwork.d.ts.map +0 -1
  348. package/lib-es/modularDrawer/hooks/useRightBalanceNetwork.js +0 -62
  349. package/lib-es/modularDrawer/hooks/useRightBalanceNetwork.js.map +0 -1
  350. package/lib-es/modularDrawer/modules/createAssetConfiguration.d.ts +0 -4
  351. package/lib-es/modularDrawer/modules/createAssetConfiguration.d.ts.map +0 -1
  352. package/lib-es/modularDrawer/modules/createAssetConfiguration.js +0 -39
  353. package/lib-es/modularDrawer/modules/createAssetConfiguration.js.map +0 -1
  354. package/lib-es/modularDrawer/modules/createNetworkConfiguration.d.ts +0 -6
  355. package/lib-es/modularDrawer/modules/createNetworkConfiguration.d.ts.map +0 -1
  356. package/lib-es/modularDrawer/modules/createNetworkConfiguration.js +0 -50
  357. package/lib-es/modularDrawer/modules/createNetworkConfiguration.js.map +0 -1
  358. package/lib-es/modularDrawer/utils/buildProviderCurrenciesMap.d.ts +0 -9
  359. package/lib-es/modularDrawer/utils/buildProviderCurrenciesMap.d.ts.map +0 -1
  360. package/lib-es/modularDrawer/utils/buildProviderCurrenciesMap.js +0 -13
  361. package/lib-es/modularDrawer/utils/buildProviderCurrenciesMap.js.map +0 -1
  362. package/lib-es/modularDrawer/utils/getLoadingStatus.d.ts +0 -9
  363. package/lib-es/modularDrawer/utils/getLoadingStatus.d.ts.map +0 -1
  364. package/lib-es/modularDrawer/utils/getLoadingStatus.js +0 -14
  365. package/lib-es/modularDrawer/utils/getLoadingStatus.js.map +0 -1
  366. package/lib-es/modularDrawer/utils/sortByBalance.d.ts +0 -6
  367. package/lib-es/modularDrawer/utils/sortByBalance.d.ts.map +0 -1
  368. package/lib-es/modularDrawer/utils/sortByBalance.js +0 -25
  369. package/lib-es/modularDrawer/utils/sortByBalance.js.map +0 -1
  370. package/src/bridge/crypto-assets/cal-integration.test.ts +0 -53
  371. package/src/bridge/crypto-assets/cal-integration.ts +0 -23
  372. package/src/bridge/crypto-assets/cal-store.test.ts +0 -93
  373. package/src/bridge/crypto-assets/cal-store.ts +0 -63
  374. package/src/bridge/generic-alpaca/alpaca/index.unit.test.ts +0 -78
  375. package/src/bridge/generic-alpaca/utils.test.ts +0 -133
  376. package/src/modularDrawer/__mocks__/dada.mock.ts +0 -3890
  377. package/src/modularDrawer/data/entities/interestRateSelectors.ts +0 -39
  378. package/src/modularDrawer/data/state-manager/types.ts +0 -28
  379. package/src/modularDrawer/hooks/useLeftAccounts.tsx +0 -23
  380. package/src/modularDrawer/hooks/useLeftAccountsApy.tsx +0 -28
  381. package/src/modularDrawer/hooks/useLeftApy.tsx +0 -19
  382. package/src/modularDrawer/hooks/useRightBalanceAsset.tsx +0 -140
  383. package/src/modularDrawer/hooks/useRightBalanceNetwork.tsx +0 -116
  384. package/src/modularDrawer/modules/createAssetConfiguration.ts +0 -61
  385. package/src/modularDrawer/modules/createNetworkConfiguration.ts +0 -79
  386. package/src/modularDrawer/utils/buildProviderCurrenciesMap.tsx +0 -25
  387. package/src/modularDrawer/utils/getLoadingStatus.ts +0 -24
  388. package/src/modularDrawer/utils/sortByBalance.tsx +0 -32
  389. /package/lib/bridge/generic-alpaca/{utils.test.d.ts → tests/utils.test.d.ts} +0 -0
  390. /package/lib-es/bridge/generic-alpaca/{utils.test.d.ts → tests/utils.test.d.ts} +0 -0
@@ -2,22 +2,8 @@ import { LiveConfig } from "@ledgerhq/live-config/LiveConfig";
2
2
  import { getCryptoAssetsStore, setCryptoAssetsStore } from ".";
3
3
  import * as legacy from "@ledgerhq/cryptoassets/tokens";
4
4
  import type { CryptoAssetsStore } from "@ledgerhq/types-live";
5
- import * as calIntegration from "./cal-integration";
6
5
 
7
6
  describe("Testing CryptoAssetStore", () => {
8
- let isCALIntegrationEnabledSpy: jest.SpyInstance;
9
- let getCALStoreSpy: jest.SpyInstance;
10
-
11
- beforeEach(() => {
12
- isCALIntegrationEnabledSpy = jest
13
- .spyOn(calIntegration, "isCALIntegrationEnabled")
14
- .mockReturnValue(false);
15
- getCALStoreSpy = jest.spyOn(calIntegration, "getCALStore");
16
- });
17
-
18
- afterEach(() => {
19
- jest.restoreAllMocks();
20
- });
21
7
  it("should return the default methods from cryptoassets libs when feature flag does not exists", () => {
22
8
  LiveConfig.setConfig({
23
9
  some_other_feature: {
@@ -82,37 +68,4 @@ describe("Testing CryptoAssetStore", () => {
82
68
  const store = getCryptoAssetsStore();
83
69
  expect(store).toBe(newStore);
84
70
  });
85
-
86
- it("should return CAL store when CAL integration is enabled", () => {
87
- isCALIntegrationEnabledSpy.mockReturnValue(true);
88
-
89
- const mockCALStore = {} as unknown as CryptoAssetsStore;
90
- getCALStoreSpy.mockReturnValue(mockCALStore);
91
-
92
- const store = getCryptoAssetsStore();
93
-
94
- expect(isCALIntegrationEnabledSpy).toHaveBeenCalled();
95
- expect(getCALStoreSpy).toHaveBeenCalled();
96
- expect(store).toBe(mockCALStore);
97
- });
98
-
99
- it("should prioritize CAL integration over feature flags", () => {
100
- isCALIntegrationEnabledSpy.mockReturnValue(true);
101
-
102
- LiveConfig.setConfig({
103
- feature_cal_lazy_loading: {
104
- type: "boolean",
105
- default: true,
106
- },
107
- });
108
-
109
- const mockCALStore = {} as unknown as CryptoAssetsStore;
110
- getCALStoreSpy.mockReturnValue(mockCALStore);
111
-
112
- const store = getCryptoAssetsStore();
113
-
114
- expect(store).toBe(mockCALStore);
115
- expect(isCALIntegrationEnabledSpy).toHaveBeenCalled();
116
- expect(getCALStoreSpy).toHaveBeenCalled();
117
- });
118
71
  });
@@ -1,7 +1,6 @@
1
1
  import { LiveConfig } from "@ledgerhq/live-config/LiveConfig";
2
2
  import * as legacy from "@ledgerhq/cryptoassets/tokens";
3
3
  import type { CryptoAssetsStore } from "@ledgerhq/types-live";
4
- import { isCALIntegrationEnabled, getCALStore } from "./cal-integration";
5
4
 
6
5
  const legacyStore: CryptoAssetsStore = {
7
6
  findTokenByAddress: legacy.findTokenByAddress,
@@ -18,10 +17,6 @@ export function setCryptoAssetsStore(store: CryptoAssetsStore) {
18
17
  }
19
18
 
20
19
  export function getCryptoAssetsStore(): CryptoAssetsStore {
21
- if (isCALIntegrationEnabled()) {
22
- return getCALStore();
23
- }
24
-
25
20
  const featureEnabled =
26
21
  LiveConfig.isConfigSet() && LiveConfig.getValueByKey("feature_cal_lazy_loading");
27
22
  if (!featureEnabled) {
@@ -1,19 +1,16 @@
1
1
  import { createApi as createXrpApi } from "@ledgerhq/coin-xrp/api/index";
2
2
  import { createApi as createStellarApi } from "@ledgerhq/coin-stellar/api/index";
3
- import { createApi as createCantonApi } from "@ledgerhq/coin-canton/api/index";
4
- import { createApi as createTronApi } from "@ledgerhq/coin-tron/api/index";
5
3
  import { getCurrencyConfiguration } from "../../../config";
6
4
  import { getCryptoCurrencyById } from "@ledgerhq/cryptoassets/currencies";
7
5
  import { getNetworkAlpacaApi } from "./network/network-alpaca";
8
6
  import { Api } from "@ledgerhq/coin-framework/api/types";
9
7
  import { XrpCoinConfig } from "@ledgerhq/coin-xrp/config";
10
8
  import { StellarCoinConfig } from "@ledgerhq/coin-stellar/config";
11
- import { CantonCoinConfig } from "@ledgerhq/coin-canton/config";
12
- import { TronCoinConfig } from "@ledgerhq/coin-tron/config";
13
9
 
14
10
  export function getAlpacaApi(network, kind): Api<any> {
15
11
  if (kind === "local") {
16
12
  switch (network) {
13
+ case "ripple":
17
14
  case "xrp":
18
15
  return createXrpApi(
19
16
  getCurrencyConfiguration<XrpCoinConfig>(getCryptoCurrencyById("ripple")),
@@ -22,16 +19,6 @@ export function getAlpacaApi(network, kind): Api<any> {
22
19
  return createStellarApi(
23
20
  getCurrencyConfiguration<StellarCoinConfig>(getCryptoCurrencyById("stellar")),
24
21
  ) as Api<any>;
25
- case "canton":
26
- return createCantonApi(
27
- getCurrencyConfiguration<CantonCoinConfig>(
28
- getCryptoCurrencyById("canton_network_devnet"),
29
- ),
30
- ) as Api<any>;
31
- case "tron":
32
- return createTronApi(
33
- getCurrencyConfiguration<TronCoinConfig>(getCryptoCurrencyById("tron")),
34
- ) as Api<any>;
35
22
  }
36
23
  }
37
24
  return getNetworkAlpacaApi(network) satisfies Partial<Api<any>> as Api<any>;
@@ -134,7 +134,7 @@ const buildGetSequence = (networkFamily: string) =>
134
134
  const buildListOperations = networkFamily =>
135
135
  async function listOperations(
136
136
  address: string,
137
- pagination: Pagination = { minHeight: 0, order: "asc" },
137
+ pagination: Pagination = { minHeight: 0 },
138
138
  ): Promise<[Operation<any>[], string]> {
139
139
  const { data } = await network<{ operations: Operation<any>[] }, unknown>({
140
140
  method: "GET",
@@ -1,10 +1,11 @@
1
1
  import BigNumber from "bignumber.js";
2
- import { emptyHistoryCache, encodeTokenAccountId } from "@ledgerhq/coin-framework/account/index";
2
+ import { emptyHistoryCache } from "@ledgerhq/coin-framework/account/index";
3
3
  import type { CryptoCurrency, TokenCurrency } from "@ledgerhq/types-cryptoassets";
4
4
  import type { Operation, SyncConfig, TokenAccount } from "@ledgerhq/types-live";
5
5
  import { encodeOperationId } from "@ledgerhq/coin-framework/operation";
6
6
  import { listTokensForCryptoCurrency } from "@ledgerhq/cryptoassets";
7
7
  import { AssetInfo, Balance } from "@ledgerhq/coin-framework/api/types";
8
+ import { findTokenById } from "@ledgerhq/cryptoassets/tokens";
8
9
 
9
10
  export interface OperationCommon extends Operation {
10
11
  extra: Record<string, any>;
@@ -12,6 +13,11 @@ export interface OperationCommon extends Operation {
12
13
 
13
14
  export const getAssetIdFromTokenId = (tokenId: string): string => tokenId.split("/")[2];
14
15
 
16
+ export const getAssetIdFromAsset = (asset: AssetInfo) =>
17
+ asset.type !== "native" && "assetReference" in asset && "assetOwner" in asset
18
+ ? `${asset.assetReference}:${asset.assetOwner}`
19
+ : "";
20
+
15
21
  function buildTokenAccount({
16
22
  parentAccountId,
17
23
  assetBalance,
@@ -23,7 +29,8 @@ function buildTokenAccount({
23
29
  token: TokenCurrency;
24
30
  operations: OperationCommon[];
25
31
  }): TokenAccount {
26
- const id = encodeTokenAccountId(parentAccountId, token);
32
+ const assetId = getAssetIdFromTokenId(token.id);
33
+ const id = `${parentAccountId}+${assetId}`;
27
34
  const balance = new BigNumber(assetBalance.value.toString() || "0");
28
35
 
29
36
  // TODO: recheck this logic
@@ -61,14 +68,12 @@ export function buildSubAccounts({
61
68
  assetsBalance,
62
69
  syncConfig,
63
70
  operations,
64
- getTokenFromAsset,
65
71
  }: {
66
72
  currency: CryptoCurrency;
67
73
  accountId: string;
68
74
  assetsBalance: Balance[];
69
75
  syncConfig: SyncConfig;
70
76
  operations: OperationCommon[];
71
- getTokenFromAsset?: (asset: AssetInfo) => TokenCurrency | undefined;
72
77
  }): TokenAccount[] | undefined {
73
78
  const { blacklistedTokenIds = [] } = syncConfig;
74
79
  const allTokens = listTokensForCryptoCurrency(currency);
@@ -80,7 +85,7 @@ export function buildSubAccounts({
80
85
  assetsBalance
81
86
  .filter(b => b.asset.type !== "native") // NOTE: this could be removed, keeping here while fixing things up
82
87
  .map(balance => {
83
- const token = getTokenFromAsset && getTokenFromAsset(balance.asset);
88
+ const token = findToken(currency, balance);
84
89
  // NOTE: for future tokens, will need to check over currencyName/standard(erc20,trc10,trc20, etc)/id
85
90
  if (token && !blacklistedTokenIds.includes(token.id)) {
86
91
  tokenAccounts.push(
@@ -99,3 +104,7 @@ export function buildSubAccounts({
99
104
  });
100
105
  return tokenAccounts;
101
106
  }
107
+
108
+ export function findToken(currency: CryptoCurrency, balance: Balance): TokenCurrency | undefined {
109
+ return findTokenById(`${currency.family}/asset/${getAssetIdFromAsset(balance.asset)}`);
110
+ }
@@ -4,6 +4,7 @@ import BigNumber from "bignumber.js";
4
4
  import { getAlpacaApi } from "./alpaca";
5
5
  import { adaptCoreOperationToLiveOperation, extractBalance } from "./utils";
6
6
  import { inferSubOperations } from "@ledgerhq/coin-framework/serialization";
7
+ import { findToken } from "./buildSubAccounts";
7
8
  import { buildSubAccounts, OperationCommon } from "./buildSubAccounts";
8
9
 
9
10
  export function genericGetAccountShape(network: string, kind: string): GetAccountShape {
@@ -32,7 +33,8 @@ export function genericGetAccountShape(network: string, kind: string): GetAccoun
32
33
 
33
34
  const assetsBalance = balanceRes
34
35
  .filter(b => b.asset.type !== "native")
35
- .filter(b => alpacaApi.getTokenFromAsset && alpacaApi.getTokenFromAsset(b.asset));
36
+ .filter(b => findToken(currency, b));
37
+
36
38
  const nativeBalance = BigInt(nativeAsset?.value ?? "0");
37
39
 
38
40
  const spendableBalance = BigInt(nativeBalance - BigInt(nativeAsset?.locked ?? "0"));
@@ -41,7 +43,7 @@ export function genericGetAccountShape(network: string, kind: string): GetAccoun
41
43
  const lastPagingToken = oldOps[0]?.extra?.pagingToken || "";
42
44
 
43
45
  const blockHeight = oldOps.length ? (oldOps[0].blockHeight ?? 0) + 1 : 0;
44
- const paginationParams: any = { minHeight: blockHeight, order: "asc" };
46
+ const paginationParams: any = { minHeight: blockHeight };
45
47
  if (lastPagingToken) {
46
48
  paginationParams.lastPagingToken = lastPagingToken;
47
49
  }
@@ -70,7 +72,6 @@ export function genericGetAccountShape(network: string, kind: string): GetAccoun
70
72
  assetsBalance,
71
73
  syncConfig,
72
74
  operations: assetOperations,
73
- getTokenFromAsset: alpacaApi.getTokenFromAsset,
74
75
  }) || [];
75
76
 
76
77
  const operationsWithSubs = mergedOps.map(op => {
@@ -3,6 +3,7 @@ import { AccountAwaitingSendPendingOperations } from "@ledgerhq/errors";
3
3
  import BigNumber from "bignumber.js";
4
4
  import { getAlpacaApi } from "./alpaca";
5
5
  import { transactionToIntent } from "./utils";
6
+ // import { FeeEstimation } from "@ledgerhq/coin-framework/api/types";
6
7
 
7
8
  // => alpaca validateIntent
8
9
  export function genericGetTransactionStatus(
@@ -2,41 +2,27 @@ import { Account, AccountBridge, TransactionCommon } from "@ledgerhq/types-live"
2
2
  import { getAlpacaApi } from "./alpaca";
3
3
  import { transactionToIntent } from "./utils";
4
4
  import BigNumber from "bignumber.js";
5
- import { AssetInfo, FeeEstimation } from "@ledgerhq/coin-framework/api/types";
6
- import { decodeTokenAccountId } from "@ledgerhq/coin-framework/account/index";
7
- import { TokenCurrency } from "@ledgerhq/types-cryptoassets";
5
+ import { FeeEstimation } from "@ledgerhq/coin-framework/api/types";
8
6
 
9
7
  function bnEq(a: BigNumber | null | undefined, b: BigNumber | null | undefined): boolean {
10
8
  return !a && !b ? true : !a || !b ? false : a.eq(b);
11
9
  }
12
10
 
13
- type TransactionParam = TransactionCommon & {
14
- fees: BigNumber | null | undefined;
15
- customFees?: FeeEstimation;
16
- assetReference?: string;
17
- assetOwner?: string;
18
- subAccountId?: string;
19
- };
20
-
21
- function assetInfosFallback(transaction: TransactionParam): {
22
- assetReference: string;
23
- assetOwner: string;
24
- } {
25
- return {
26
- assetReference: transaction.assetReference ?? "",
27
- assetOwner: transaction.assetOwner ?? "",
28
- };
29
- }
30
-
31
11
  export function genericPrepareTransaction(
32
12
  network: string,
33
13
  kind,
34
14
  ): AccountBridge<TransactionCommon, Account, any, any>["prepareTransaction"] {
35
- return async (account, transaction: TransactionParam) => {
36
- const { getAssetFromToken } = getAlpacaApi(network, kind);
37
- const { assetReference, assetOwner } = getAssetFromToken
38
- ? getAssetInfos(transaction, account.freshAddress, getAssetFromToken)
39
- : assetInfosFallback(transaction);
15
+ return async (
16
+ account,
17
+ transaction: TransactionCommon & {
18
+ fees: BigNumber | null | undefined;
19
+ customFees?: FeeEstimation;
20
+ assetReference?: string;
21
+ assetOwner?: string;
22
+ subAccountId?: string;
23
+ },
24
+ ) => {
25
+ const [assetReference, assetOwner] = getAssetInfos(transaction);
40
26
 
41
27
  let fees = transaction.customFees?.parameters?.fees || null;
42
28
  if (fees === null) {
@@ -68,24 +54,11 @@ export function genericPrepareTransaction(
68
54
  }
69
55
 
70
56
  export function getAssetInfos(
71
- tr: TransactionParam,
72
- owner: string,
73
- getAssetFromToken: (token: TokenCurrency, owner: string) => AssetInfo,
74
- ): {
75
- assetReference: string;
76
- assetOwner: string;
77
- } {
57
+ tr: TransactionCommon & { assetReference?: string; assetOwner?: string },
58
+ ): string[] {
78
59
  if (tr.subAccountId) {
79
- const { token } = decodeTokenAccountId(tr.subAccountId);
80
-
81
- if (!token) return assetInfosFallback(tr);
82
-
83
- const asset = getAssetFromToken(token, owner);
84
-
85
- return {
86
- assetOwner: ("assetOwner" in asset && asset.assetOwner) || "",
87
- assetReference: ("assetReference" in asset && asset.assetReference) || "",
88
- };
60
+ const assetString = tr.subAccountId.split("+")[1];
61
+ return assetString.split(":");
89
62
  }
90
- return assetInfosFallback(tr);
63
+ return [tr.assetReference || "", tr.assetOwner || ""];
91
64
  }
@@ -0,0 +1,19 @@
1
+ import { extractBalance } from "../utils";
2
+
3
+ describe("Alpaca utils", () => {
4
+ describe("extractBalance", () => {
5
+ it("extracts an existing balance", () => {
6
+ expect(extractBalance([{ value: 4n, asset: { type: "type1" } }], "type1")).toEqual({
7
+ value: 4n,
8
+ asset: { type: "type1" },
9
+ });
10
+ });
11
+
12
+ it("generates an empty balance for a missing type", () => {
13
+ expect(extractBalance([{ value: 4n, asset: { type: "type1" } }], "type2")).toEqual({
14
+ value: 0n,
15
+ asset: { type: "type2" },
16
+ });
17
+ });
18
+ });
19
+ });
@@ -44,17 +44,15 @@ export function adaptCoreOperationToLiveOperation(accountId: string, op: CoreOpe
44
44
  if (op.details?.memo) {
45
45
  extra.memo = op.details.memo as string;
46
46
  }
47
- const bnFees = new BigNumber(op.tx.fees.toString());
48
47
  const res = {
49
- id: encodeOperationId(accountId, op.tx.hash, op.type),
48
+ id: extra.ledgerOpType
49
+ ? encodeOperationId(accountId, op.tx.hash, extra.ledgerOpType)
50
+ : encodeOperationId(accountId, op.tx.hash, op.type),
50
51
  hash: op.tx.hash,
51
52
  accountId,
52
53
  type: opType,
53
- value:
54
- op.asset.type === "native" && ["OUT", "FEES"].includes(opType)
55
- ? new BigNumber(op.value.toString()).plus(bnFees)
56
- : new BigNumber(op.value.toString()),
57
- fee: bnFees,
54
+ value: new BigNumber(op.value.toString()),
55
+ fee: new BigNumber(op.tx.fees.toString()),
58
56
  blockHash: op.tx.block.hash,
59
57
  blockHeight: op.tx.block.height,
60
58
  senders: op.senders,
@@ -6,7 +6,6 @@ export enum DeviceLabels {
6
6
  SIGN = "Sign",
7
7
  APPROVE = "Approve",
8
8
  ACCEPT = "Accept",
9
- ACCEPT_RISK = "Accept risk",
10
9
  TRANSFER = "Transfer",
11
10
  RECIPIENT = "Recipient",
12
11
  DEST = "Dest",
@@ -55,5 +54,4 @@ export enum DeviceLabels {
55
54
  VERIFY_POLYGON = "Verify Polygon",
56
55
  VERIFY_SOLANA_ADDRESS = "Verify Solana address",
57
56
  REVIEW_TRANSACTION = "Review transaction",
58
- I_UNDERSTAND = "I understand",
59
57
  }
@@ -3,8 +3,6 @@ import { DeviceLabels } from "../enum/DeviceLabels";
3
3
 
4
4
  export async function delegateTezos() {
5
5
  await waitFor(DeviceLabels.REVIEW_OPERATION);
6
- await pressUntilTextFound(DeviceLabels.ACCEPT_RISK);
7
- await pressBoth();
8
6
  await pressUntilTextFound(DeviceLabels.ACCEPT);
9
7
  await pressBoth();
10
8
  }
@@ -460,7 +460,7 @@ async function retryAxiosRequest<T>(
460
460
  throw lastError!;
461
461
  }
462
462
 
463
- export async function waitFor(text: string, maxAttempts = 60): Promise<string[]> {
463
+ export async function waitFor(text: string, maxAttempts = 15): Promise<string[]> {
464
464
  const port = getEnv("SPECULOS_API_PORT");
465
465
  const address = getSpeculosAddress();
466
466
  const url = `${address}:${port}/events?stream=false&currentscreenonly=true`;
@@ -731,22 +731,12 @@ export async function signDelegationTransaction(delegatingAccount: Delegate) {
731
731
  }
732
732
 
733
733
  export async function verifyAmountsAndAcceptSwap(swap: Swap, amount: string) {
734
- await waitFor(DeviceLabels.REVIEW_TRANSACTION);
735
- const events = await pressUntilTextFound(DeviceLabels.SIGN_TRANSACTION);
736
- await verifySwapData(swap, events, amount);
737
- await pressBoth();
738
- }
739
-
740
- export async function verifyAmountsAndAcceptSwapForDifferentSeed(swap: Swap, amount: string) {
741
- await pressUntilTextFound(DeviceLabels.I_UNDERSTAND);
742
- await pressBoth();
743
734
  const events = await pressUntilTextFound(DeviceLabels.SIGN_TRANSACTION);
744
735
  await verifySwapData(swap, events, amount);
745
736
  await pressBoth();
746
737
  }
747
738
 
748
739
  export async function verifyAmountsAndRejectSwap(swap: Swap, amount: string) {
749
- await waitFor(DeviceLabels.REVIEW_TRANSACTION);
750
740
  const events = await pressUntilTextFound(DeviceLabels.REJECT);
751
741
  await verifySwapData(swap, events, amount);
752
742
  await pressBoth();
@@ -1,4 +1,4 @@
1
- import { secp256k1 } from "@noble/curves/secp256k1";
1
+ import secp256k1 from "secp256k1";
2
2
  import { firstValueFrom, from, Observable } from "rxjs";
3
3
  import { TransportStatusError, WrongDeviceForAccount } from "@ledgerhq/errors";
4
4
 
@@ -187,8 +187,7 @@ function convertSignature(signature: string, exchangeType: ExchangeTypes): Buffe
187
187
  return Buffer.from(base64Signature, "base64");
188
188
  }
189
189
  if (exchangeType === ExchangeTypes.Sell) return Buffer.from(signature, "hex");
190
- const sig = secp256k1.Signature.fromCompact(Buffer.from(signature, "hex"));
191
- return Buffer.from(sig.toDERRawBytes());
190
+ return <Buffer>secp256k1.signatureExport(Buffer.from(signature, "hex"));
192
191
  }
193
192
 
194
193
  export default completeExchange;
@@ -14,7 +14,7 @@ import { getDefaultAccountName } from "@ledgerhq/live-wallet/accountName";
14
14
  import { log } from "@ledgerhq/logs";
15
15
  import BigNumber from "bignumber.js";
16
16
  import { Observable } from "rxjs";
17
- import { secp256k1 } from "@noble/curves/secp256k1";
17
+ import secp256k1 from "secp256k1";
18
18
  import { getCurrencyExchangeConfig } from "../";
19
19
  import { getAccountCurrency, getMainAccount } from "../../account";
20
20
  import { getAccountBridge } from "../../bridge";
@@ -271,10 +271,7 @@ const completeExchange = (
271
271
  function convertSignature(signature: string, exchangeType: ExchangeTypes): Buffer {
272
272
  return exchangeType === ExchangeTypes.SwapNg
273
273
  ? base64UrlDecode(signature)
274
- : (() => {
275
- const sig = secp256k1.Signature.fromCompact(Buffer.from(signature, "hex"));
276
- return Buffer.from(sig.toDERRawBytes());
277
- })();
274
+ : <Buffer>secp256k1.signatureExport(Buffer.from(signature, "hex"));
278
275
  }
279
276
 
280
277
  function base64UrlDecode(base64Url: string): Buffer {
@@ -14,7 +14,7 @@ import { log } from "@ledgerhq/logs";
14
14
  import { BigNumber } from "bignumber.js";
15
15
  import invariant from "invariant";
16
16
  import { firstValueFrom, from, Observable } from "rxjs";
17
- import { secp256k1 } from "@noble/curves/secp256k1";
17
+ import secp256k1 from "secp256k1";
18
18
  import { getCurrencyExchangeConfig } from "../";
19
19
  import { getAccountCurrency, getMainAccount } from "../../account";
20
20
  import { getAccountBridge } from "../../bridge";
@@ -184,10 +184,9 @@ const initSwap = (input: InitSwapInput): Observable<SwapRequestEvent> => {
184
184
 
185
185
  await swap.processTransaction(Buffer.from(swapResult.binaryPayload, "hex"), estimatedFees);
186
186
  if (unsubscribed) return;
187
- const goodSign = <Buffer>(() => {
188
- const sig = secp256k1.Signature.fromCompact(Buffer.from(swapResult.signature, "hex"));
189
- return Buffer.from(sig.toDERRawBytes());
190
- })();
187
+ const goodSign = <Buffer>(
188
+ secp256k1.signatureExport(Buffer.from(swapResult.signature, "hex"))
189
+ );
191
190
  await swap.checkTransactionSignature(goodSign);
192
191
  if (unsubscribed) return;
193
192
  const mainPayoutCurrency = getAccountCurrency(payoutAccount);
@@ -9,7 +9,6 @@ export const cantonConfig: Record<string, ConfigInfo> = {
9
9
  },
10
10
  // TBC
11
11
  nodeUrl: "https://wallet-validator-canton.ledger.com",
12
- nodeId: "figment",
13
12
  // TBC
14
13
  gatewayUrl: "https://canton-gateway.api.live.ledger.com",
15
14
  minReserve: 0,
@@ -23,12 +22,9 @@ export const cantonConfig: Record<string, ConfigInfo> = {
23
22
  type: "active",
24
23
  },
25
24
  nodeUrl: "https://wallet-validator-devnet-canton.ledger-test.com",
26
- nodeId: "ledger-live-devnet-prd",
27
25
  gatewayUrl: "https://canton-gateway.api.live.ledger-test.com",
28
26
  minReserve: 0,
29
27
  useGateway: true,
30
- nativeInstrumentId:
31
- "6e9fc50fb94e56751b49f09ba2dc84da53a9d7cff08115ebb4f6b7a12d0c990c:Splice.Amulet:Amulet",
32
28
  },
33
29
  },
34
30
  config_currency_canton_network_localnet: {
@@ -38,7 +34,6 @@ export const cantonConfig: Record<string, ConfigInfo> = {
38
34
  type: "active",
39
35
  },
40
36
  nodeUrl: "http://localhost:2975/v2",
41
- nodeId: undefined,
42
37
  gatewayUrl: undefined,
43
38
  minReserve: 0,
44
39
  useGateway: false,
@@ -19,8 +19,6 @@ import { SolanaCoinConfig } from "@ledgerhq/coin-solana/config";
19
19
  import { getCryptoCurrencyById } from "../../currencies";
20
20
  import { signMessage } from "@ledgerhq/coin-solana/hw-signMessage";
21
21
  import { LegacySignerSolana } from "@ledgerhq/live-signer-solana";
22
- import { setShouldSkipTokenLoading } from "@ledgerhq/coin-solana/preload";
23
- import { LiveConfig } from "@ledgerhq/live-config/LiveConfig";
24
22
  import { getCryptoAssetsStore } from "../../bridge/crypto-assets";
25
23
 
26
24
  const createSigner: CreateSigner<SolanaSigner> = (transport: Transport) =>
@@ -30,13 +28,6 @@ const getCurrencyConfig = () => {
30
28
  return getCurrencyConfiguration<SolanaCoinConfig>(getCryptoCurrencyById("solana"));
31
29
  };
32
30
 
33
- try {
34
- const isCALLazyLoadingEnabled = LiveConfig.getValueByKey("feature_cal_lazy_loading");
35
- setShouldSkipTokenLoading(Boolean(isCALLazyLoadingEnabled));
36
- } catch (error) {
37
- setShouldSkipTokenLoading(false);
38
- }
39
-
40
31
  const bridge: Bridge<Transaction, SolanaAccount, TransactionStatus> = createBridges(
41
32
  executeWithSigner(createSigner),
42
33
  getCurrencyConfig,
@@ -108,7 +108,6 @@ export const DEFAULT_FEATURES: Features = {
108
108
  postOnboardingAssetsTransfer: DEFAULT_FEATURE,
109
109
  counterValue: DEFAULT_FEATURE,
110
110
  mockFeature: DEFAULT_FEATURE,
111
- calLedgerService: DEFAULT_FEATURE,
112
111
  ptxServiceCtaExchangeDrawer: DEFAULT_FEATURE,
113
112
  ptxServiceCtaScreens: DEFAULT_FEATURE,
114
113
  ptxSwapReceiveTRC20WithoutTrx: DEFAULT_FEATURE,
@@ -625,6 +624,8 @@ export const DEFAULT_FEATURES: Features = {
625
624
  enableModularization: false,
626
625
  },
627
626
  },
627
+ lldModularDrawerBackendData: DEFAULT_FEATURE,
628
+ llmModularDrawerBackendData: DEFAULT_FEATURE,
628
629
  llmModularDrawer: {
629
630
  ...DEFAULT_FEATURE,
630
631
  params: {
@@ -1,14 +1,23 @@
1
1
  import { createApi, fetchBaseQuery, FetchBaseQueryMeta } from "@reduxjs/toolkit/query/react";
2
2
  import { convertApiAssets } from "@ledgerhq/cryptoassets";
3
- import { RawApiResponse } from "../entities";
3
+ import { AssetsData, RawApiResponse } from "../entities";
4
4
  import { getEnv } from "@ledgerhq/live-env";
5
- import {
6
- AssetsAdditionalData,
7
- AssetsDataTags,
8
- AssetsDataWithPagination,
9
- GetAssetsDataParams,
10
- PageParam,
11
- } from "./types";
5
+
6
+ export enum AssetsDataTags {
7
+ Assets = "Assets",
8
+ }
9
+
10
+ export interface GetAssetsDataParams {
11
+ cursor?: string;
12
+ search?: string;
13
+ currencyIds?: string[];
14
+ }
15
+
16
+ export interface AssetsDataWithPagination extends AssetsData {
17
+ pagination: {
18
+ nextCursor?: string;
19
+ };
20
+ }
12
21
 
13
22
  function transformAssetsResponse(
14
23
  response: RawApiResponse,
@@ -34,44 +43,20 @@ export const assetsDataApi = createApi({
34
43
  }),
35
44
  tagTypes: [AssetsDataTags.Assets],
36
45
  endpoints: build => ({
37
- getAssetsData: build.infiniteQuery<AssetsDataWithPagination, GetAssetsDataParams, PageParam>({
38
- query: ({ pageParam, queryArg }) => {
39
- const params = {
46
+ getAssetsData: build.query<AssetsDataWithPagination, GetAssetsDataParams>({
47
+ query: ({ cursor, search, currencyIds: _currencyIds }) => ({
48
+ url: "assets",
49
+ params: {
50
+ ...(cursor && { cursor }),
51
+ ...(search && { search }),
52
+ // ...(currencyIds && currencyIds.length > 0 && { currencyIds }),
40
53
  pageSize: 100,
41
- ...(pageParam?.cursor && { cursor: pageParam.cursor }),
42
- ...(queryArg?.useCase && { transaction: queryArg.useCase }),
43
- ...(queryArg?.currencyIds &&
44
- queryArg?.currencyIds.length > 0 &&
45
- !queryArg?.useCase && { currencyIds: queryArg.currencyIds }),
46
- ...(queryArg?.search && { search: queryArg.search }),
47
- product: queryArg.product,
48
- minVersion: queryArg.version,
49
- additionalData: [AssetsAdditionalData.Apy, AssetsAdditionalData.MarketTrend],
50
- };
51
-
52
- return {
53
- url: "assets",
54
- params,
55
- };
56
- },
54
+ },
55
+ }),
57
56
  providesTags: [AssetsDataTags.Assets],
58
57
  transformResponse: transformAssetsResponse,
59
- infiniteQueryOptions: {
60
- initialPageParam: {
61
- cursor: "",
62
- },
63
- getNextPageParam: lastPage => {
64
- if (lastPage.pagination.nextCursor) {
65
- return {
66
- cursor: lastPage.pagination.nextCursor,
67
- };
68
- } else {
69
- return undefined;
70
- }
71
- },
72
- },
73
58
  }),
74
59
  }),
75
60
  });
76
61
 
77
- export const { useGetAssetsDataInfiniteQuery } = assetsDataApi;
62
+ export const { useGetAssetsDataQuery } = assetsDataApi;