@ledgerhq/live-common 34.47.0 → 34.48.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/cal-integration.d.ts +4 -0
  2. package/lib/bridge/crypto-assets/cal-integration.d.ts.map +1 -0
  3. package/lib/bridge/crypto-assets/cal-integration.js +26 -0
  4. package/lib/bridge/crypto-assets/cal-integration.js.map +1 -0
  5. package/lib/bridge/crypto-assets/cal-integration.test.d.ts +2 -0
  6. package/lib/bridge/crypto-assets/cal-integration.test.d.ts.map +1 -0
  7. package/lib/bridge/crypto-assets/cal-integration.test.js +45 -0
  8. package/lib/bridge/crypto-assets/cal-integration.test.js.map +1 -0
  9. package/lib/bridge/crypto-assets/cal-store.d.ts +14 -0
  10. package/lib/bridge/crypto-assets/cal-store.d.ts.map +1 -0
  11. package/lib/bridge/crypto-assets/cal-store.js +58 -0
  12. package/lib/bridge/crypto-assets/cal-store.js.map +1 -0
  13. package/lib/bridge/crypto-assets/cal-store.test.d.ts +2 -0
  14. package/lib/bridge/crypto-assets/cal-store.test.d.ts.map +1 -0
  15. package/lib/bridge/crypto-assets/cal-store.test.js +70 -0
  16. package/lib/bridge/crypto-assets/cal-store.test.js.map +1 -0
  17. package/lib/bridge/crypto-assets/index.d.ts.map +1 -1
  18. package/lib/bridge/crypto-assets/index.js +4 -0
  19. package/lib/bridge/crypto-assets/index.js.map +1 -1
  20. package/lib/bridge/crypto-assets/index.test.js +36 -0
  21. package/lib/bridge/crypto-assets/index.test.js.map +1 -1
  22. package/lib/bridge/generic-alpaca/alpaca/index.d.ts.map +1 -1
  23. package/lib/bridge/generic-alpaca/alpaca/index.js +6 -1
  24. package/lib/bridge/generic-alpaca/alpaca/index.js.map +1 -1
  25. package/lib/bridge/generic-alpaca/alpaca/index.unit.test.d.ts +2 -0
  26. package/lib/bridge/generic-alpaca/alpaca/index.unit.test.d.ts.map +1 -0
  27. package/lib/bridge/generic-alpaca/alpaca/index.unit.test.js +89 -0
  28. package/lib/bridge/generic-alpaca/alpaca/index.unit.test.js.map +1 -0
  29. package/lib/bridge/generic-alpaca/alpaca/network/network-alpaca.js +1 -1
  30. package/lib/bridge/generic-alpaca/alpaca/network/network-alpaca.js.map +1 -1
  31. package/lib/bridge/generic-alpaca/buildSubAccounts.d.ts +2 -3
  32. package/lib/bridge/generic-alpaca/buildSubAccounts.d.ts.map +1 -1
  33. package/lib/bridge/generic-alpaca/buildSubAccounts.js +4 -14
  34. package/lib/bridge/generic-alpaca/buildSubAccounts.js.map +1 -1
  35. package/lib/bridge/generic-alpaca/getAccountShape.d.ts.map +1 -1
  36. package/lib/bridge/generic-alpaca/getAccountShape.js +4 -4
  37. package/lib/bridge/generic-alpaca/getAccountShape.js.map +1 -1
  38. package/lib/bridge/generic-alpaca/getTransactionStatus.d.ts.map +1 -1
  39. package/lib/bridge/generic-alpaca/getTransactionStatus.js +0 -1
  40. package/lib/bridge/generic-alpaca/getTransactionStatus.js.map +1 -1
  41. package/lib/bridge/generic-alpaca/prepareTransaction.d.ts +14 -3
  42. package/lib/bridge/generic-alpaca/prepareTransaction.d.ts.map +1 -1
  43. package/lib/bridge/generic-alpaca/prepareTransaction.js +21 -5
  44. package/lib/bridge/generic-alpaca/prepareTransaction.js.map +1 -1
  45. package/lib/bridge/generic-alpaca/utils.d.ts.map +1 -1
  46. package/lib/bridge/generic-alpaca/utils.js +6 -5
  47. package/lib/bridge/generic-alpaca/utils.js.map +1 -1
  48. package/lib/bridge/generic-alpaca/utils.test.d.ts.map +1 -0
  49. package/lib/bridge/generic-alpaca/utils.test.js +123 -0
  50. package/lib/bridge/generic-alpaca/utils.test.js.map +1 -0
  51. package/lib/e2e/enum/DeviceLabels.d.ts +9 -6
  52. package/lib/e2e/enum/DeviceLabels.d.ts.map +1 -1
  53. package/lib/e2e/enum/DeviceLabels.js +8 -5
  54. package/lib/e2e/enum/DeviceLabels.js.map +1 -1
  55. package/lib/e2e/families/tezos.d.ts.map +1 -1
  56. package/lib/e2e/families/tezos.js +2 -0
  57. package/lib/e2e/families/tezos.js.map +1 -1
  58. package/lib/e2e/index.d.ts +6 -6
  59. package/lib/e2e/index.d.ts.map +1 -1
  60. package/lib/e2e/speculos.d.ts +2 -1
  61. package/lib/e2e/speculos.d.ts.map +1 -1
  62. package/lib/e2e/speculos.js +25 -17
  63. package/lib/e2e/speculos.js.map +1 -1
  64. package/lib/env.react.d.ts +1 -1
  65. package/lib/env.react.d.ts.map +1 -1
  66. package/lib/exchange/platform/transfer/completeExchange.d.ts.map +1 -1
  67. package/lib/exchange/platform/transfer/completeExchange.js +3 -5
  68. package/lib/exchange/platform/transfer/completeExchange.js.map +1 -1
  69. package/lib/exchange/swap/completeExchange.d.ts.map +1 -1
  70. package/lib/exchange/swap/completeExchange.js +5 -2
  71. package/lib/exchange/swap/completeExchange.js.map +1 -1
  72. package/lib/exchange/swap/initSwap.d.ts.map +1 -1
  73. package/lib/exchange/swap/initSwap.js +5 -2
  74. package/lib/exchange/swap/initSwap.js.map +1 -1
  75. package/lib/families/canton/config.d.ts.map +1 -1
  76. package/lib/families/canton/config.js +4 -0
  77. package/lib/families/canton/config.js.map +1 -1
  78. package/lib/families/solana/setup.d.ts.map +1 -1
  79. package/lib/families/solana/setup.js +9 -0
  80. package/lib/families/solana/setup.js.map +1 -1
  81. package/lib/featureFlags/defaultFeatures.d.ts.map +1 -1
  82. package/lib/featureFlags/defaultFeatures.js +1 -2
  83. package/lib/featureFlags/defaultFeatures.js.map +1 -1
  84. package/lib/featureFlags/useFeature.d.ts +1 -1
  85. package/lib/featureFlags/useFeature.d.ts.map +1 -1
  86. package/lib/modularDrawer/__mocks__/dada.mock.d.ts +3336 -0
  87. package/lib/modularDrawer/__mocks__/dada.mock.d.ts.map +1 -0
  88. package/lib/modularDrawer/__mocks__/dada.mock.js +3879 -0
  89. package/lib/modularDrawer/__mocks__/dada.mock.js.map +1 -0
  90. package/lib/modularDrawer/data/entities/interestRateSelectors.d.ts +16 -0
  91. package/lib/modularDrawer/data/entities/interestRateSelectors.d.ts.map +1 -0
  92. package/lib/modularDrawer/data/entities/interestRateSelectors.js +21 -0
  93. package/lib/modularDrawer/data/entities/interestRateSelectors.js.map +1 -0
  94. package/lib/modularDrawer/data/state-manager/api.d.ts +727 -37
  95. package/lib/modularDrawer/data/state-manager/api.d.ts.map +1 -1
  96. package/lib/modularDrawer/data/state-manager/api.js +38 -17
  97. package/lib/modularDrawer/data/state-manager/api.js.map +1 -1
  98. package/lib/modularDrawer/data/state-manager/types.d.ts +24 -0
  99. package/lib/modularDrawer/data/state-manager/types.d.ts.map +1 -0
  100. package/lib/modularDrawer/data/state-manager/types.js +13 -0
  101. package/lib/modularDrawer/data/state-manager/types.js.map +1 -0
  102. package/lib/modularDrawer/hooks/__test__/useAssetsData.test.js +134 -78
  103. package/lib/modularDrawer/hooks/__test__/useAssetsData.test.js.map +1 -1
  104. package/lib/modularDrawer/hooks/modules/useLeftApyModule.d.ts +3 -3
  105. package/lib/modularDrawer/hooks/modules/useLeftApyModule.d.ts.map +1 -1
  106. package/lib/modularDrawer/hooks/modules/useLeftApyModule.js +43 -10
  107. package/lib/modularDrawer/hooks/modules/useLeftApyModule.js.map +1 -1
  108. package/lib/modularDrawer/hooks/{modules/useAssetAccountCounts.d.ts → useAssetAccountCounts.d.ts} +1 -1
  109. package/lib/modularDrawer/hooks/useAssetAccountCounts.d.ts.map +1 -0
  110. package/lib/modularDrawer/hooks/{modules/useAssetAccountCounts.js → useAssetAccountCounts.js} +1 -1
  111. package/lib/modularDrawer/hooks/useAssetAccountCounts.js.map +1 -0
  112. package/lib/modularDrawer/hooks/useAssetsData.d.ts +10 -6
  113. package/lib/modularDrawer/hooks/useAssetsData.d.ts.map +1 -1
  114. package/lib/modularDrawer/hooks/useAssetsData.js +40 -17
  115. package/lib/modularDrawer/hooks/useAssetsData.js.map +1 -1
  116. package/lib/modularDrawer/hooks/useInterestRatesByCurrencies.d.ts +3 -0
  117. package/lib/modularDrawer/hooks/useInterestRatesByCurrencies.d.ts.map +1 -0
  118. package/lib/modularDrawer/hooks/useInterestRatesByCurrencies.js +23 -0
  119. package/lib/modularDrawer/hooks/useInterestRatesByCurrencies.js.map +1 -0
  120. package/lib/modularDrawer/hooks/useLeftAccounts.d.ts +13 -0
  121. package/lib/modularDrawer/hooks/useLeftAccounts.d.ts.map +1 -0
  122. package/lib/modularDrawer/hooks/useLeftAccounts.js +15 -0
  123. package/lib/modularDrawer/hooks/useLeftAccounts.js.map +1 -0
  124. package/lib/modularDrawer/hooks/useLeftAccountsApy.d.ts +4 -0
  125. package/lib/modularDrawer/hooks/useLeftAccountsApy.d.ts.map +1 -0
  126. package/lib/modularDrawer/hooks/useLeftAccountsApy.js +30 -0
  127. package/lib/modularDrawer/hooks/useLeftAccountsApy.js.map +1 -0
  128. package/lib/modularDrawer/hooks/useRightBalanceAsset.d.ts +57 -0
  129. package/lib/modularDrawer/hooks/useRightBalanceAsset.d.ts.map +1 -0
  130. package/lib/modularDrawer/hooks/useRightBalanceAsset.js +87 -0
  131. package/lib/modularDrawer/hooks/useRightBalanceAsset.js.map +1 -0
  132. package/lib/modularDrawer/hooks/useRightBalanceNetwork.d.ts +63 -0
  133. package/lib/modularDrawer/hooks/useRightBalanceNetwork.d.ts.map +1 -0
  134. package/lib/modularDrawer/hooks/useRightBalanceNetwork.js +66 -0
  135. package/lib/modularDrawer/hooks/useRightBalanceNetwork.js.map +1 -0
  136. package/lib/modularDrawer/modules/createAssetConfiguration.d.ts +4 -0
  137. package/lib/modularDrawer/modules/createAssetConfiguration.d.ts.map +1 -0
  138. package/lib/modularDrawer/modules/createAssetConfiguration.js +41 -0
  139. package/lib/modularDrawer/modules/createAssetConfiguration.js.map +1 -0
  140. package/lib/modularDrawer/modules/createNetworkConfiguration.d.ts +6 -0
  141. package/lib/modularDrawer/modules/createNetworkConfiguration.d.ts.map +1 -0
  142. package/lib/modularDrawer/modules/createNetworkConfiguration.js +54 -0
  143. package/lib/modularDrawer/modules/createNetworkConfiguration.js.map +1 -0
  144. package/lib/modularDrawer/utils/__tests__/getInterestRateForAsset.test.d.ts +2 -0
  145. package/lib/modularDrawer/utils/__tests__/getInterestRateForAsset.test.d.ts.map +1 -0
  146. package/lib/modularDrawer/utils/__tests__/getInterestRateForAsset.test.js +36 -0
  147. package/lib/modularDrawer/utils/__tests__/getInterestRateForAsset.test.js.map +1 -0
  148. package/lib/modularDrawer/utils/buildProviderCurrenciesMap.d.ts +9 -0
  149. package/lib/modularDrawer/utils/buildProviderCurrenciesMap.d.ts.map +1 -0
  150. package/lib/modularDrawer/utils/buildProviderCurrenciesMap.js +17 -0
  151. package/lib/modularDrawer/utils/buildProviderCurrenciesMap.js.map +1 -0
  152. package/lib/modularDrawer/utils/getInterestRateForAsset.d.ts +13 -0
  153. package/lib/modularDrawer/utils/getInterestRateForAsset.d.ts.map +1 -0
  154. package/lib/modularDrawer/utils/getInterestRateForAsset.js +20 -0
  155. package/lib/modularDrawer/utils/getInterestRateForAsset.js.map +1 -0
  156. package/lib/modularDrawer/utils/getLoadingStatus.d.ts +9 -0
  157. package/lib/modularDrawer/utils/getLoadingStatus.d.ts.map +1 -0
  158. package/lib/modularDrawer/utils/getLoadingStatus.js +18 -0
  159. package/lib/modularDrawer/utils/getLoadingStatus.js.map +1 -0
  160. package/lib/modularDrawer/utils/sortByBalance.d.ts +6 -0
  161. package/lib/modularDrawer/utils/sortByBalance.d.ts.map +1 -0
  162. package/lib/modularDrawer/utils/sortByBalance.js +32 -0
  163. package/lib/modularDrawer/utils/sortByBalance.js.map +1 -0
  164. package/lib/modularDrawer/utils/type.d.ts +90 -1
  165. package/lib/modularDrawer/utils/type.d.ts.map +1 -1
  166. package/lib/wallet-api/Exchange/server.js +2 -2
  167. package/lib/wallet-api/Exchange/server.js.map +1 -1
  168. package/lib/wallet-api/ModularDrawer/types.d.ts +6 -6
  169. package/lib/wallet-api/ModularDrawer/types.d.ts.map +1 -1
  170. package/lib/wallet-api/ModularDrawer/types.js +1 -1
  171. package/lib/wallet-api/ModularDrawer/types.js.map +1 -1
  172. package/lib/wallet-api/react.d.ts +2 -0
  173. package/lib/wallet-api/react.d.ts.map +1 -1
  174. package/lib/wallet-api/react.js +3 -1
  175. package/lib/wallet-api/react.js.map +1 -1
  176. package/lib-es/bridge/crypto-assets/cal-integration.d.ts +4 -0
  177. package/lib-es/bridge/crypto-assets/cal-integration.d.ts.map +1 -0
  178. package/lib-es/bridge/crypto-assets/cal-integration.js +21 -0
  179. package/lib-es/bridge/crypto-assets/cal-integration.js.map +1 -0
  180. package/lib-es/bridge/crypto-assets/cal-integration.test.d.ts +2 -0
  181. package/lib-es/bridge/crypto-assets/cal-integration.test.d.ts.map +1 -0
  182. package/lib-es/bridge/crypto-assets/cal-integration.test.js +43 -0
  183. package/lib-es/bridge/crypto-assets/cal-integration.test.js.map +1 -0
  184. package/lib-es/bridge/crypto-assets/cal-store.d.ts +14 -0
  185. package/lib-es/bridge/crypto-assets/cal-store.d.ts.map +1 -0
  186. package/lib-es/bridge/crypto-assets/cal-store.js +54 -0
  187. package/lib-es/bridge/crypto-assets/cal-store.js.map +1 -0
  188. package/lib-es/bridge/crypto-assets/cal-store.test.d.ts +2 -0
  189. package/lib-es/bridge/crypto-assets/cal-store.test.d.ts.map +1 -0
  190. package/lib-es/bridge/crypto-assets/cal-store.test.js +68 -0
  191. package/lib-es/bridge/crypto-assets/cal-store.test.js.map +1 -0
  192. package/lib-es/bridge/crypto-assets/index.d.ts.map +1 -1
  193. package/lib-es/bridge/crypto-assets/index.js +4 -0
  194. package/lib-es/bridge/crypto-assets/index.js.map +1 -1
  195. package/lib-es/bridge/crypto-assets/index.test.js +36 -0
  196. package/lib-es/bridge/crypto-assets/index.test.js.map +1 -1
  197. package/lib-es/bridge/generic-alpaca/alpaca/index.d.ts.map +1 -1
  198. package/lib-es/bridge/generic-alpaca/alpaca/index.js +6 -1
  199. package/lib-es/bridge/generic-alpaca/alpaca/index.js.map +1 -1
  200. package/lib-es/bridge/generic-alpaca/alpaca/index.unit.test.d.ts +2 -0
  201. package/lib-es/bridge/generic-alpaca/alpaca/index.unit.test.d.ts.map +1 -0
  202. package/lib-es/bridge/generic-alpaca/alpaca/index.unit.test.js +64 -0
  203. package/lib-es/bridge/generic-alpaca/alpaca/index.unit.test.js.map +1 -0
  204. package/lib-es/bridge/generic-alpaca/alpaca/network/network-alpaca.js +1 -1
  205. package/lib-es/bridge/generic-alpaca/alpaca/network/network-alpaca.js.map +1 -1
  206. package/lib-es/bridge/generic-alpaca/buildSubAccounts.d.ts +2 -3
  207. package/lib-es/bridge/generic-alpaca/buildSubAccounts.d.ts.map +1 -1
  208. package/lib-es/bridge/generic-alpaca/buildSubAccounts.js +4 -12
  209. package/lib-es/bridge/generic-alpaca/buildSubAccounts.js.map +1 -1
  210. package/lib-es/bridge/generic-alpaca/getAccountShape.d.ts.map +1 -1
  211. package/lib-es/bridge/generic-alpaca/getAccountShape.js +3 -3
  212. package/lib-es/bridge/generic-alpaca/getAccountShape.js.map +1 -1
  213. package/lib-es/bridge/generic-alpaca/getTransactionStatus.d.ts.map +1 -1
  214. package/lib-es/bridge/generic-alpaca/getTransactionStatus.js +0 -1
  215. package/lib-es/bridge/generic-alpaca/getTransactionStatus.js.map +1 -1
  216. package/lib-es/bridge/generic-alpaca/prepareTransaction.d.ts +14 -3
  217. package/lib-es/bridge/generic-alpaca/prepareTransaction.d.ts.map +1 -1
  218. package/lib-es/bridge/generic-alpaca/prepareTransaction.js +21 -5
  219. package/lib-es/bridge/generic-alpaca/prepareTransaction.js.map +1 -1
  220. package/lib-es/bridge/generic-alpaca/utils.d.ts.map +1 -1
  221. package/lib-es/bridge/generic-alpaca/utils.js +6 -5
  222. package/lib-es/bridge/generic-alpaca/utils.js.map +1 -1
  223. package/lib-es/bridge/generic-alpaca/utils.test.d.ts.map +1 -0
  224. package/lib-es/bridge/generic-alpaca/utils.test.js +118 -0
  225. package/lib-es/bridge/generic-alpaca/utils.test.js.map +1 -0
  226. package/lib-es/e2e/enum/DeviceLabels.d.ts +9 -6
  227. package/lib-es/e2e/enum/DeviceLabels.d.ts.map +1 -1
  228. package/lib-es/e2e/enum/DeviceLabels.js +8 -5
  229. package/lib-es/e2e/enum/DeviceLabels.js.map +1 -1
  230. package/lib-es/e2e/families/tezos.d.ts.map +1 -1
  231. package/lib-es/e2e/families/tezos.js +2 -0
  232. package/lib-es/e2e/families/tezos.js.map +1 -1
  233. package/lib-es/e2e/index.d.ts +6 -6
  234. package/lib-es/e2e/index.d.ts.map +1 -1
  235. package/lib-es/e2e/speculos.d.ts +2 -1
  236. package/lib-es/e2e/speculos.d.ts.map +1 -1
  237. package/lib-es/e2e/speculos.js +23 -16
  238. package/lib-es/e2e/speculos.js.map +1 -1
  239. package/lib-es/env.react.d.ts +1 -1
  240. package/lib-es/env.react.d.ts.map +1 -1
  241. package/lib-es/exchange/platform/transfer/completeExchange.d.ts.map +1 -1
  242. package/lib-es/exchange/platform/transfer/completeExchange.js +3 -2
  243. package/lib-es/exchange/platform/transfer/completeExchange.js.map +1 -1
  244. package/lib-es/exchange/swap/completeExchange.d.ts.map +1 -1
  245. package/lib-es/exchange/swap/completeExchange.js +5 -2
  246. package/lib-es/exchange/swap/completeExchange.js.map +1 -1
  247. package/lib-es/exchange/swap/initSwap.d.ts.map +1 -1
  248. package/lib-es/exchange/swap/initSwap.js +5 -2
  249. package/lib-es/exchange/swap/initSwap.js.map +1 -1
  250. package/lib-es/families/canton/config.d.ts.map +1 -1
  251. package/lib-es/families/canton/config.js +4 -0
  252. package/lib-es/families/canton/config.js.map +1 -1
  253. package/lib-es/families/solana/setup.d.ts.map +1 -1
  254. package/lib-es/families/solana/setup.js +9 -0
  255. package/lib-es/families/solana/setup.js.map +1 -1
  256. package/lib-es/featureFlags/defaultFeatures.d.ts.map +1 -1
  257. package/lib-es/featureFlags/defaultFeatures.js +1 -2
  258. package/lib-es/featureFlags/defaultFeatures.js.map +1 -1
  259. package/lib-es/featureFlags/useFeature.d.ts +1 -1
  260. package/lib-es/featureFlags/useFeature.d.ts.map +1 -1
  261. package/lib-es/modularDrawer/__mocks__/dada.mock.d.ts +3336 -0
  262. package/lib-es/modularDrawer/__mocks__/dada.mock.d.ts.map +1 -0
  263. package/lib-es/modularDrawer/__mocks__/dada.mock.js +3876 -0
  264. package/lib-es/modularDrawer/__mocks__/dada.mock.js.map +1 -0
  265. package/lib-es/modularDrawer/data/entities/interestRateSelectors.d.ts +16 -0
  266. package/lib-es/modularDrawer/data/entities/interestRateSelectors.d.ts.map +1 -0
  267. package/lib-es/modularDrawer/data/entities/interestRateSelectors.js +18 -0
  268. package/lib-es/modularDrawer/data/entities/interestRateSelectors.js.map +1 -0
  269. package/lib-es/modularDrawer/data/state-manager/api.d.ts +727 -37
  270. package/lib-es/modularDrawer/data/state-manager/api.d.ts.map +1 -1
  271. package/lib-es/modularDrawer/data/state-manager/api.js +35 -14
  272. package/lib-es/modularDrawer/data/state-manager/api.js.map +1 -1
  273. package/lib-es/modularDrawer/data/state-manager/types.d.ts +24 -0
  274. package/lib-es/modularDrawer/data/state-manager/types.d.ts.map +1 -0
  275. package/lib-es/modularDrawer/data/state-manager/types.js +10 -0
  276. package/lib-es/modularDrawer/data/state-manager/types.js.map +1 -0
  277. package/lib-es/modularDrawer/hooks/__test__/useAssetsData.test.js +135 -79
  278. package/lib-es/modularDrawer/hooks/__test__/useAssetsData.test.js.map +1 -1
  279. package/lib-es/modularDrawer/hooks/modules/useLeftApyModule.d.ts +3 -3
  280. package/lib-es/modularDrawer/hooks/modules/useLeftApyModule.d.ts.map +1 -1
  281. package/lib-es/modularDrawer/hooks/modules/useLeftApyModule.js +21 -8
  282. package/lib-es/modularDrawer/hooks/modules/useLeftApyModule.js.map +1 -1
  283. package/lib-es/modularDrawer/hooks/{modules/useAssetAccountCounts.d.ts → useAssetAccountCounts.d.ts} +1 -1
  284. package/lib-es/modularDrawer/hooks/useAssetAccountCounts.d.ts.map +1 -0
  285. package/lib-es/modularDrawer/hooks/{modules/useAssetAccountCounts.js → useAssetAccountCounts.js} +1 -1
  286. package/lib-es/modularDrawer/hooks/useAssetAccountCounts.js.map +1 -0
  287. package/lib-es/modularDrawer/hooks/useAssetsData.d.ts +10 -6
  288. package/lib-es/modularDrawer/hooks/useAssetsData.d.ts.map +1 -1
  289. package/lib-es/modularDrawer/hooks/useAssetsData.js +42 -19
  290. package/lib-es/modularDrawer/hooks/useAssetsData.js.map +1 -1
  291. package/lib-es/modularDrawer/hooks/useInterestRatesByCurrencies.d.ts +3 -0
  292. package/lib-es/modularDrawer/hooks/useInterestRatesByCurrencies.d.ts.map +1 -0
  293. package/lib-es/modularDrawer/hooks/useInterestRatesByCurrencies.js +19 -0
  294. package/lib-es/modularDrawer/hooks/useInterestRatesByCurrencies.js.map +1 -0
  295. package/lib-es/modularDrawer/hooks/useLeftAccounts.d.ts +13 -0
  296. package/lib-es/modularDrawer/hooks/useLeftAccounts.d.ts.map +1 -0
  297. package/lib-es/modularDrawer/hooks/useLeftAccounts.js +11 -0
  298. package/lib-es/modularDrawer/hooks/useLeftAccounts.js.map +1 -0
  299. package/lib-es/modularDrawer/hooks/useLeftAccountsApy.d.ts +4 -0
  300. package/lib-es/modularDrawer/hooks/useLeftAccountsApy.d.ts.map +1 -0
  301. package/lib-es/modularDrawer/hooks/useLeftAccountsApy.js +26 -0
  302. package/lib-es/modularDrawer/hooks/useLeftAccountsApy.js.map +1 -0
  303. package/lib-es/modularDrawer/hooks/useRightBalanceAsset.d.ts +57 -0
  304. package/lib-es/modularDrawer/hooks/useRightBalanceAsset.d.ts.map +1 -0
  305. package/lib-es/modularDrawer/hooks/useRightBalanceAsset.js +83 -0
  306. package/lib-es/modularDrawer/hooks/useRightBalanceAsset.js.map +1 -0
  307. package/lib-es/modularDrawer/hooks/useRightBalanceNetwork.d.ts +63 -0
  308. package/lib-es/modularDrawer/hooks/useRightBalanceNetwork.d.ts.map +1 -0
  309. package/lib-es/modularDrawer/hooks/useRightBalanceNetwork.js +62 -0
  310. package/lib-es/modularDrawer/hooks/useRightBalanceNetwork.js.map +1 -0
  311. package/lib-es/modularDrawer/modules/createAssetConfiguration.d.ts +4 -0
  312. package/lib-es/modularDrawer/modules/createAssetConfiguration.d.ts.map +1 -0
  313. package/lib-es/modularDrawer/modules/createAssetConfiguration.js +39 -0
  314. package/lib-es/modularDrawer/modules/createAssetConfiguration.js.map +1 -0
  315. package/lib-es/modularDrawer/modules/createNetworkConfiguration.d.ts +6 -0
  316. package/lib-es/modularDrawer/modules/createNetworkConfiguration.d.ts.map +1 -0
  317. package/lib-es/modularDrawer/modules/createNetworkConfiguration.js +48 -0
  318. package/lib-es/modularDrawer/modules/createNetworkConfiguration.js.map +1 -0
  319. package/lib-es/modularDrawer/utils/__tests__/getInterestRateForAsset.test.d.ts +2 -0
  320. package/lib-es/modularDrawer/utils/__tests__/getInterestRateForAsset.test.d.ts.map +1 -0
  321. package/lib-es/modularDrawer/utils/__tests__/getInterestRateForAsset.test.js +34 -0
  322. package/lib-es/modularDrawer/utils/__tests__/getInterestRateForAsset.test.js.map +1 -0
  323. package/lib-es/modularDrawer/utils/buildProviderCurrenciesMap.d.ts +9 -0
  324. package/lib-es/modularDrawer/utils/buildProviderCurrenciesMap.d.ts.map +1 -0
  325. package/lib-es/modularDrawer/utils/buildProviderCurrenciesMap.js +13 -0
  326. package/lib-es/modularDrawer/utils/buildProviderCurrenciesMap.js.map +1 -0
  327. package/lib-es/modularDrawer/utils/getInterestRateForAsset.d.ts +13 -0
  328. package/lib-es/modularDrawer/utils/getInterestRateForAsset.d.ts.map +1 -0
  329. package/lib-es/modularDrawer/utils/getInterestRateForAsset.js +16 -0
  330. package/lib-es/modularDrawer/utils/getInterestRateForAsset.js.map +1 -0
  331. package/lib-es/modularDrawer/utils/getLoadingStatus.d.ts +9 -0
  332. package/lib-es/modularDrawer/utils/getLoadingStatus.d.ts.map +1 -0
  333. package/lib-es/modularDrawer/utils/getLoadingStatus.js +14 -0
  334. package/lib-es/modularDrawer/utils/getLoadingStatus.js.map +1 -0
  335. package/lib-es/modularDrawer/utils/sortByBalance.d.ts +6 -0
  336. package/lib-es/modularDrawer/utils/sortByBalance.d.ts.map +1 -0
  337. package/lib-es/modularDrawer/utils/sortByBalance.js +25 -0
  338. package/lib-es/modularDrawer/utils/sortByBalance.js.map +1 -0
  339. package/lib-es/modularDrawer/utils/type.d.ts +90 -1
  340. package/lib-es/modularDrawer/utils/type.d.ts.map +1 -1
  341. package/lib-es/wallet-api/Exchange/server.js +2 -2
  342. package/lib-es/wallet-api/Exchange/server.js.map +1 -1
  343. package/lib-es/wallet-api/ModularDrawer/types.d.ts +6 -6
  344. package/lib-es/wallet-api/ModularDrawer/types.d.ts.map +1 -1
  345. package/lib-es/wallet-api/ModularDrawer/types.js +1 -1
  346. package/lib-es/wallet-api/ModularDrawer/types.js.map +1 -1
  347. package/lib-es/wallet-api/react.d.ts +2 -0
  348. package/lib-es/wallet-api/react.d.ts.map +1 -1
  349. package/lib-es/wallet-api/react.js +3 -1
  350. package/lib-es/wallet-api/react.js.map +1 -1
  351. package/package.json +41 -41
  352. package/src/bridge/crypto-assets/cal-integration.test.ts +53 -0
  353. package/src/bridge/crypto-assets/cal-integration.ts +23 -0
  354. package/src/bridge/crypto-assets/cal-store.test.ts +93 -0
  355. package/src/bridge/crypto-assets/cal-store.ts +63 -0
  356. package/src/bridge/crypto-assets/index.test.ts +47 -0
  357. package/src/bridge/crypto-assets/index.ts +5 -0
  358. package/src/bridge/generic-alpaca/alpaca/index.ts +14 -1
  359. package/src/bridge/generic-alpaca/alpaca/index.unit.test.ts +78 -0
  360. package/src/bridge/generic-alpaca/alpaca/network/network-alpaca.ts +1 -1
  361. package/src/bridge/generic-alpaca/buildSubAccounts.ts +5 -14
  362. package/src/bridge/generic-alpaca/getAccountShape.ts +3 -4
  363. package/src/bridge/generic-alpaca/getTransactionStatus.ts +0 -1
  364. package/src/bridge/generic-alpaca/prepareTransaction.ts +44 -17
  365. package/src/bridge/generic-alpaca/utils.test.ts +133 -0
  366. package/src/bridge/generic-alpaca/utils.ts +7 -5
  367. package/src/e2e/enum/DeviceLabels.ts +8 -5
  368. package/src/e2e/families/tezos.ts +2 -0
  369. package/src/e2e/speculos.ts +24 -17
  370. package/src/exchange/platform/transfer/completeExchange.ts +3 -2
  371. package/src/exchange/swap/completeExchange.ts +5 -2
  372. package/src/exchange/swap/initSwap.ts +5 -4
  373. package/src/families/canton/config.ts +5 -0
  374. package/src/families/hedera/__snapshots__/bridge.integration.test.ts.snap +27 -7
  375. package/src/families/solana/setup.ts +9 -0
  376. package/src/featureFlags/defaultFeatures.ts +1 -2
  377. package/src/modularDrawer/__mocks__/dada.mock.ts +3890 -0
  378. package/src/modularDrawer/data/entities/interestRateSelectors.ts +39 -0
  379. package/src/modularDrawer/data/state-manager/api.ts +42 -27
  380. package/src/modularDrawer/data/state-manager/types.ts +28 -0
  381. package/src/modularDrawer/hooks/__test__/useAssetsData.test.ts +141 -80
  382. package/src/modularDrawer/hooks/modules/useLeftApyModule.tsx +27 -9
  383. package/src/modularDrawer/hooks/{modules/useAssetAccountCounts.tsx → useAssetAccountCounts.tsx} +2 -2
  384. package/src/modularDrawer/hooks/useAssetsData.ts +59 -22
  385. package/src/modularDrawer/hooks/useInterestRatesByCurrencies.ts +23 -0
  386. package/src/modularDrawer/hooks/useLeftAccounts.tsx +23 -0
  387. package/src/modularDrawer/hooks/useLeftAccountsApy.tsx +44 -0
  388. package/src/modularDrawer/hooks/useRightBalanceAsset.tsx +140 -0
  389. package/src/modularDrawer/hooks/useRightBalanceNetwork.tsx +116 -0
  390. package/src/modularDrawer/modules/createAssetConfiguration.ts +62 -0
  391. package/src/modularDrawer/modules/createNetworkConfiguration.ts +87 -0
  392. package/src/modularDrawer/utils/__tests__/getInterestRateForAsset.test.ts +58 -0
  393. package/src/modularDrawer/utils/buildProviderCurrenciesMap.tsx +25 -0
  394. package/src/modularDrawer/utils/getInterestRateForAsset.ts +32 -0
  395. package/src/modularDrawer/utils/getLoadingStatus.ts +24 -0
  396. package/src/modularDrawer/utils/sortByBalance.tsx +32 -0
  397. package/src/modularDrawer/utils/type.ts +98 -0
  398. package/src/wallet-api/Exchange/server.ts +2 -2
  399. package/src/wallet-api/ModularDrawer/types.ts +1 -1
  400. package/src/wallet-api/react.ts +5 -1
  401. package/lib/bridge/generic-alpaca/tests/utils.test.d.ts.map +0 -1
  402. package/lib/bridge/generic-alpaca/tests/utils.test.js +0 -20
  403. package/lib/bridge/generic-alpaca/tests/utils.test.js.map +0 -1
  404. package/lib/modularDrawer/hooks/modules/useAssetAccountCounts.d.ts.map +0 -1
  405. package/lib/modularDrawer/hooks/modules/useAssetAccountCounts.js.map +0 -1
  406. package/lib/modularDrawer/types.d.ts +0 -2
  407. package/lib/modularDrawer/types.d.ts.map +0 -1
  408. package/lib/modularDrawer/types.js +0 -3
  409. package/lib/modularDrawer/types.js.map +0 -1
  410. package/lib-es/bridge/generic-alpaca/tests/utils.test.d.ts.map +0 -1
  411. package/lib-es/bridge/generic-alpaca/tests/utils.test.js +0 -18
  412. package/lib-es/bridge/generic-alpaca/tests/utils.test.js.map +0 -1
  413. package/lib-es/modularDrawer/hooks/modules/useAssetAccountCounts.d.ts.map +0 -1
  414. package/lib-es/modularDrawer/hooks/modules/useAssetAccountCounts.js.map +0 -1
  415. package/lib-es/modularDrawer/types.d.ts +0 -2
  416. package/lib-es/modularDrawer/types.d.ts.map +0 -1
  417. package/lib-es/modularDrawer/types.js +0 -2
  418. package/lib-es/modularDrawer/types.js.map +0 -1
  419. package/src/bridge/generic-alpaca/tests/utils.test.ts +0 -19
  420. package/src/modularDrawer/types.ts +0 -1
  421. /package/lib/bridge/generic-alpaca/{tests/utils.test.d.ts → utils.test.d.ts} +0 -0
  422. /package/lib-es/bridge/generic-alpaca/{tests/utils.test.d.ts → utils.test.d.ts} +0 -0
@@ -4,7 +4,6 @@ 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";
8
7
  import { buildSubAccounts, OperationCommon } from "./buildSubAccounts";
9
8
 
10
9
  export function genericGetAccountShape(network: string, kind: string): GetAccountShape {
@@ -33,8 +32,7 @@ export function genericGetAccountShape(network: string, kind: string): GetAccoun
33
32
 
34
33
  const assetsBalance = balanceRes
35
34
  .filter(b => b.asset.type !== "native")
36
- .filter(b => findToken(currency, b));
37
-
35
+ .filter(b => alpacaApi.getTokenFromAsset && alpacaApi.getTokenFromAsset(b.asset));
38
36
  const nativeBalance = BigInt(nativeAsset?.value ?? "0");
39
37
 
40
38
  const spendableBalance = BigInt(nativeBalance - BigInt(nativeAsset?.locked ?? "0"));
@@ -43,7 +41,7 @@ export function genericGetAccountShape(network: string, kind: string): GetAccoun
43
41
  const lastPagingToken = oldOps[0]?.extra?.pagingToken || "";
44
42
 
45
43
  const blockHeight = oldOps.length ? (oldOps[0].blockHeight ?? 0) + 1 : 0;
46
- const paginationParams: any = { minHeight: blockHeight };
44
+ const paginationParams: any = { minHeight: blockHeight, order: "asc" };
47
45
  if (lastPagingToken) {
48
46
  paginationParams.lastPagingToken = lastPagingToken;
49
47
  }
@@ -72,6 +70,7 @@ export function genericGetAccountShape(network: string, kind: string): GetAccoun
72
70
  assetsBalance,
73
71
  syncConfig,
74
72
  operations: assetOperations,
73
+ getTokenFromAsset: alpacaApi.getTokenFromAsset,
75
74
  }) || [];
76
75
 
77
76
  const operationsWithSubs = mergedOps.map(op => {
@@ -3,7 +3,6 @@ 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";
7
6
 
8
7
  // => alpaca validateIntent
9
8
  export function genericGetTransactionStatus(
@@ -2,27 +2,41 @@ 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 { FeeEstimation } from "@ledgerhq/coin-framework/api/types";
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";
6
8
 
7
9
  function bnEq(a: BigNumber | null | undefined, b: BigNumber | null | undefined): boolean {
8
10
  return !a && !b ? true : !a || !b ? false : a.eq(b);
9
11
  }
10
12
 
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
+
11
31
  export function genericPrepareTransaction(
12
32
  network: string,
13
33
  kind,
14
34
  ): AccountBridge<TransactionCommon, Account, any, any>["prepareTransaction"] {
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);
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);
26
40
 
27
41
  let fees = transaction.customFees?.parameters?.fees || null;
28
42
  if (fees === null) {
@@ -54,11 +68,24 @@ export function genericPrepareTransaction(
54
68
  }
55
69
 
56
70
  export function getAssetInfos(
57
- tr: TransactionCommon & { assetReference?: string; assetOwner?: string },
58
- ): string[] {
71
+ tr: TransactionParam,
72
+ owner: string,
73
+ getAssetFromToken: (token: TokenCurrency, owner: string) => AssetInfo,
74
+ ): {
75
+ assetReference: string;
76
+ assetOwner: string;
77
+ } {
59
78
  if (tr.subAccountId) {
60
- const assetString = tr.subAccountId.split("+")[1];
61
- return assetString.split(":");
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
+ };
62
89
  }
63
- return [tr.assetReference || "", tr.assetOwner || ""];
90
+ return assetInfosFallback(tr);
64
91
  }
@@ -0,0 +1,133 @@
1
+ import { adaptCoreOperationToLiveOperation, extractBalance } from "./utils";
2
+ import BigNumber from "bignumber.js";
3
+ import { Operation as CoreOperation } from "@ledgerhq/coin-framework/api/types";
4
+
5
+ describe("Alpaca utils", () => {
6
+ describe("extractBalance", () => {
7
+ it("extracts an existing balance", () => {
8
+ expect(extractBalance([{ value: 4n, asset: { type: "type1" } }], "type1")).toEqual({
9
+ value: 4n,
10
+ asset: { type: "type1" },
11
+ });
12
+ });
13
+
14
+ it("generates an empty balance for a missing type", () => {
15
+ expect(extractBalance([{ value: 4n, asset: { type: "type1" } }], "type2")).toEqual({
16
+ value: 0n,
17
+ asset: { type: "type2" },
18
+ });
19
+ });
20
+ });
21
+
22
+ jest.mock("@ledgerhq/coin-framework/operation", () => ({
23
+ encodeOperationId: jest.fn((accountId, txHash, opType) => `${accountId}-${txHash}-${opType}`),
24
+ }));
25
+
26
+ describe("adaptCoreOperationToLiveOperation", () => {
27
+ const accountId = "acc_123";
28
+ const baseOp: CoreOperation = {
29
+ id: "op_123",
30
+ asset: { type: "native" },
31
+ type: "OUT",
32
+ value: BigInt(100),
33
+ tx: {
34
+ hash: "txhash123",
35
+ fees: BigInt(10),
36
+ block: {
37
+ hash: "blockhash123",
38
+ height: 123456,
39
+ },
40
+ date: new Date("2025-08-29T12:00:00Z"),
41
+ },
42
+ senders: ["sender1"],
43
+ recipients: ["recipient1"],
44
+ };
45
+
46
+ it("does not include fees in non native asset value", () => {
47
+ expect(
48
+ adaptCoreOperationToLiveOperation("account", {
49
+ id: "operation",
50
+ asset: { type: "token", assetOwner: "owner", assetReference: "reference" },
51
+ type: "OUT",
52
+ value: BigInt(100),
53
+ tx: {
54
+ hash: "hash",
55
+ fees: BigInt(10),
56
+ block: {
57
+ hash: "block_hash",
58
+ height: 123456,
59
+ },
60
+ date: new Date("2025-08-29T12:00:00Z"),
61
+ },
62
+ senders: ["sender"],
63
+ recipients: ["recipient"],
64
+ }),
65
+ ).toEqual({
66
+ id: "account-hash-OUT",
67
+ hash: "hash",
68
+ accountId: "account",
69
+ type: "OUT",
70
+ value: new BigNumber(100), // value only
71
+ fee: new BigNumber(10),
72
+ extra: {
73
+ assetOwner: "owner",
74
+ assetReference: "reference",
75
+ },
76
+ blockHash: "block_hash",
77
+ blockHeight: 123456,
78
+ senders: ["sender"],
79
+ recipients: ["recipient"],
80
+ date: new Date("2025-08-29T12:00:00Z"),
81
+ transactionSequenceNumber: undefined,
82
+ hasFailed: false,
83
+ });
84
+ });
85
+
86
+ it("adapts a basic OUT operation", () => {
87
+ const result = adaptCoreOperationToLiveOperation(accountId, baseOp);
88
+
89
+ expect(result).toEqual({
90
+ id: "acc_123-txhash123-OUT",
91
+ hash: "txhash123",
92
+ accountId,
93
+ type: "OUT",
94
+ value: new BigNumber(110), // value + fee
95
+ fee: new BigNumber(10),
96
+ blockHash: "blockhash123",
97
+ blockHeight: 123456,
98
+ senders: ["sender1"],
99
+ recipients: ["recipient1"],
100
+ date: new Date("2025-08-29T12:00:00Z"),
101
+ transactionSequenceNumber: undefined,
102
+ hasFailed: false,
103
+ extra: {},
104
+ });
105
+ });
106
+
107
+ it("handles FEES operation where value = value + fees", () => {
108
+ const op = {
109
+ ...baseOp,
110
+ type: "FEES",
111
+ value: BigInt(5),
112
+ tx: { ...baseOp.tx, fees: BigInt(2) },
113
+ };
114
+
115
+ const result = adaptCoreOperationToLiveOperation(accountId, op);
116
+
117
+ expect(result.value.toString()).toEqual("7");
118
+ });
119
+
120
+ it("handles non-FEES/OUT operation where value = value only", () => {
121
+ const op = {
122
+ ...baseOp,
123
+ type: "IN",
124
+ value: BigInt(50),
125
+ tx: { ...baseOp.tx, fees: BigInt(2) },
126
+ };
127
+
128
+ const result = adaptCoreOperationToLiveOperation(accountId, op);
129
+
130
+ expect(result.value.toString()).toEqual("50");
131
+ });
132
+ });
133
+ });
@@ -44,15 +44,17 @@ 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());
47
48
  const res = {
48
- id: extra.ledgerOpType
49
- ? encodeOperationId(accountId, op.tx.hash, extra.ledgerOpType)
50
- : encodeOperationId(accountId, op.tx.hash, op.type),
49
+ id: encodeOperationId(accountId, op.tx.hash, op.type),
51
50
  hash: op.tx.hash,
52
51
  accountId,
53
52
  type: opType,
54
- value: new BigNumber(op.value.toString()),
55
- fee: new BigNumber(op.tx.fees.toString()),
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,
56
58
  blockHash: op.tx.block.hash,
57
59
  blockHeight: op.tx.block.height,
58
60
  senders: op.senders,
@@ -6,6 +6,7 @@ export enum DeviceLabels {
6
6
  SIGN = "Sign",
7
7
  APPROVE = "Approve",
8
8
  ACCEPT = "Accept",
9
+ ACCEPT_RISK = "Accept risk",
9
10
  TRANSFER = "Transfer",
10
11
  RECIPIENT = "Recipient",
11
12
  DEST = "Dest",
@@ -33,10 +34,11 @@ export enum DeviceLabels {
33
34
  DELEGATE_FROM = "Delegate from",
34
35
  PLEASE_REVIEW = "Please",
35
36
  VALUE = "Value",
36
- CONNECT_WITH = "Connect with",
37
- MAKE_SURE_TO_USE = "Make sure to use",
38
- YOUR_CRYPTO_ACCOUNTS = "Your crypto accounts",
37
+ CONNECT_TO = "Connect to",
38
+ CONNECT = "Connect",
39
+ LEDGER_LIVE_WILL_BE = "Ledger Live will be",
39
40
  TURN_ON_SYNC = "Turn on sync",
41
+ TURN_ON_SYNC2 = "Turn On sync",
40
42
  NEW_ORDINARY = "New ordinary",
41
43
  SEND_TO_ADDRESS_2 = "Send to address (2/2)",
42
44
  REVIEW_OPERATION = "Review",
@@ -46,12 +48,13 @@ export enum DeviceLabels {
46
48
  DELEGATE_STAKE = "Delegate stake",
47
49
  SETTINGS = "Settings",
48
50
  CONTRACT_DATA = "Contract data",
49
- REMOVE_PHONE_OR_COMPUTER = "Remove phone or",
50
- AFTER_REMOVING = "After removing, you",
51
+ REMOVE_FROM_LEDGER_SYNC = "Remove from",
52
+ REMOVE = "Remove",
51
53
  VERIFY_ETHEREUM = "Verify Ethereum",
52
54
  VERIFY_BSC = "Verify BSC",
53
55
  SIGN_TRANSACTION = "Sign transaction",
54
56
  VERIFY_POLYGON = "Verify Polygon",
55
57
  VERIFY_SOLANA_ADDRESS = "Verify Solana address",
56
58
  REVIEW_TRANSACTION = "Review transaction",
59
+ I_UNDERSTAND = "I understand",
57
60
  }
@@ -3,6 +3,8 @@ 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();
6
8
  await pressUntilTextFound(DeviceLabels.ACCEPT);
7
9
  await pressBoth();
8
10
  }
@@ -460,7 +460,7 @@ async function retryAxiosRequest<T>(
460
460
  throw lastError!;
461
461
  }
462
462
 
463
- export async function waitFor(text: string, maxAttempts = 15): Promise<string[]> {
463
+ export async function waitFor(text: string, maxAttempts = 60): 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`;
@@ -491,14 +491,14 @@ export async function pressBoth() {
491
491
 
492
492
  export async function pressUntilTextFound(
493
493
  targetText: string,
494
- maxAttempts: number = 15,
494
+ strictMatch: boolean = false,
495
495
  ): Promise<string[]> {
496
+ const maxAttempts = 15;
496
497
  const speculosApiPort = getEnv("SPECULOS_API_PORT");
497
498
 
498
499
  for (let attempts = 0; attempts < maxAttempts; attempts++) {
499
500
  const texts = await fetchCurrentScreenTexts(speculosApiPort);
500
-
501
- if (texts.includes(targetText)) {
501
+ if (strictMatch ? texts === targetText : texts.includes(targetText)) {
502
502
  return await fetchAllEvents(speculosApiPort);
503
503
  }
504
504
 
@@ -575,28 +575,25 @@ export async function waitForTimeOut(ms: number) {
575
575
  }
576
576
 
577
577
  export async function removeMemberLedgerSync() {
578
- await waitFor(DeviceLabels.CONNECT_WITH);
579
- await pressUntilTextFound(DeviceLabels.MAKE_SURE_TO_USE);
580
- await pressUntilTextFound(DeviceLabels.CONNECT_WITH);
578
+ await waitFor(DeviceLabels.CONNECT_TO);
579
+ await pressUntilTextFound(DeviceLabels.CONNECT, true);
581
580
  await pressBoth();
582
- await waitFor(DeviceLabels.REMOVE_PHONE_OR_COMPUTER);
583
- await pressUntilTextFound(DeviceLabels.AFTER_REMOVING);
584
- await pressUntilTextFound(DeviceLabels.REMOVE_PHONE_OR_COMPUTER);
581
+ await waitFor(DeviceLabels.REMOVE_FROM_LEDGER_SYNC);
582
+ await pressUntilTextFound(DeviceLabels.REMOVE, true);
585
583
  await pressBoth();
586
584
  await waitFor(DeviceLabels.TURN_ON_SYNC);
587
- await pressUntilTextFound(DeviceLabels.YOUR_CRYPTO_ACCOUNTS);
588
- await pressUntilTextFound(DeviceLabels.TURN_ON_SYNC);
585
+ await pressUntilTextFound(DeviceLabels.LEDGER_LIVE_WILL_BE);
586
+ await pressUntilTextFound(DeviceLabels.TURN_ON_SYNC2);
589
587
  await pressBoth();
590
588
  }
591
589
 
592
590
  export async function activateLedgerSync() {
593
- await waitFor(DeviceLabels.CONNECT_WITH);
594
- await pressUntilTextFound(DeviceLabels.MAKE_SURE_TO_USE);
595
- await pressUntilTextFound(DeviceLabels.CONNECT_WITH);
591
+ await waitFor(DeviceLabels.CONNECT_TO);
592
+ await pressUntilTextFound(DeviceLabels.CONNECT, true);
596
593
  await pressBoth();
597
594
  await waitFor(DeviceLabels.TURN_ON_SYNC);
598
- await pressUntilTextFound(DeviceLabels.YOUR_CRYPTO_ACCOUNTS);
599
- await pressUntilTextFound(DeviceLabels.TURN_ON_SYNC);
595
+ await pressUntilTextFound(DeviceLabels.LEDGER_LIVE_WILL_BE);
596
+ await pressUntilTextFound(DeviceLabels.TURN_ON_SYNC2);
600
597
  await pressBoth();
601
598
  }
602
599
 
@@ -731,12 +728,22 @@ export async function signDelegationTransaction(delegatingAccount: Delegate) {
731
728
  }
732
729
 
733
730
  export async function verifyAmountsAndAcceptSwap(swap: Swap, amount: string) {
731
+ await waitFor(DeviceLabels.REVIEW_TRANSACTION);
732
+ const events = await pressUntilTextFound(DeviceLabels.SIGN_TRANSACTION);
733
+ await verifySwapData(swap, events, amount);
734
+ await pressBoth();
735
+ }
736
+
737
+ export async function verifyAmountsAndAcceptSwapForDifferentSeed(swap: Swap, amount: string) {
738
+ await pressUntilTextFound(DeviceLabels.I_UNDERSTAND);
739
+ await pressBoth();
734
740
  const events = await pressUntilTextFound(DeviceLabels.SIGN_TRANSACTION);
735
741
  await verifySwapData(swap, events, amount);
736
742
  await pressBoth();
737
743
  }
738
744
 
739
745
  export async function verifyAmountsAndRejectSwap(swap: Swap, amount: string) {
746
+ await waitFor(DeviceLabels.REVIEW_TRANSACTION);
740
747
  const events = await pressUntilTextFound(DeviceLabels.REJECT);
741
748
  await verifySwapData(swap, events, amount);
742
749
  await pressBoth();
@@ -1,4 +1,4 @@
1
- import secp256k1 from "secp256k1";
1
+ import { secp256k1 } from "@noble/curves/secp256k1";
2
2
  import { firstValueFrom, from, Observable } from "rxjs";
3
3
  import { TransportStatusError, WrongDeviceForAccount } from "@ledgerhq/errors";
4
4
 
@@ -187,7 +187,8 @@ 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
- return <Buffer>secp256k1.signatureExport(Buffer.from(signature, "hex"));
190
+ const sig = secp256k1.Signature.fromCompact(Buffer.from(signature, "hex"));
191
+ return Buffer.from(sig.toDERRawBytes());
191
192
  }
192
193
 
193
194
  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 "secp256k1";
17
+ import { secp256k1 } from "@noble/curves/secp256k1";
18
18
  import { getCurrencyExchangeConfig } from "../";
19
19
  import { getAccountCurrency, getMainAccount } from "../../account";
20
20
  import { getAccountBridge } from "../../bridge";
@@ -271,7 +271,10 @@ const completeExchange = (
271
271
  function convertSignature(signature: string, exchangeType: ExchangeTypes): Buffer {
272
272
  return exchangeType === ExchangeTypes.SwapNg
273
273
  ? base64UrlDecode(signature)
274
- : <Buffer>secp256k1.signatureExport(Buffer.from(signature, "hex"));
274
+ : (() => {
275
+ const sig = secp256k1.Signature.fromCompact(Buffer.from(signature, "hex"));
276
+ return Buffer.from(sig.toDERRawBytes());
277
+ })();
275
278
  }
276
279
 
277
280
  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 "secp256k1";
17
+ import { secp256k1 } from "@noble/curves/secp256k1";
18
18
  import { getCurrencyExchangeConfig } from "../";
19
19
  import { getAccountCurrency, getMainAccount } from "../../account";
20
20
  import { getAccountBridge } from "../../bridge";
@@ -184,9 +184,10 @@ 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
- secp256k1.signatureExport(Buffer.from(swapResult.signature, "hex"))
189
- );
187
+ const goodSign = <Buffer>(() => {
188
+ const sig = secp256k1.Signature.fromCompact(Buffer.from(swapResult.signature, "hex"));
189
+ return Buffer.from(sig.toDERRawBytes());
190
+ })();
190
191
  await swap.checkTransactionSignature(goodSign);
191
192
  if (unsubscribed) return;
192
193
  const mainPayoutCurrency = getAccountCurrency(payoutAccount);
@@ -9,6 +9,7 @@ export const cantonConfig: Record<string, ConfigInfo> = {
9
9
  },
10
10
  // TBC
11
11
  nodeUrl: "https://wallet-validator-canton.ledger.com",
12
+ nodeId: "figment",
12
13
  // TBC
13
14
  gatewayUrl: "https://canton-gateway.api.live.ledger.com",
14
15
  minReserve: 0,
@@ -22,9 +23,12 @@ export const cantonConfig: Record<string, ConfigInfo> = {
22
23
  type: "active",
23
24
  },
24
25
  nodeUrl: "https://wallet-validator-devnet-canton.ledger-test.com",
26
+ nodeId: "ledger-live-devnet-prd",
25
27
  gatewayUrl: "https://canton-gateway.api.live.ledger-test.com",
26
28
  minReserve: 0,
27
29
  useGateway: true,
30
+ nativeInstrumentId:
31
+ "6e9fc50fb94e56751b49f09ba2dc84da53a9d7cff08115ebb4f6b7a12d0c990c:Splice.Amulet:Amulet",
28
32
  },
29
33
  },
30
34
  config_currency_canton_network_localnet: {
@@ -34,6 +38,7 @@ export const cantonConfig: Record<string, ConfigInfo> = {
34
38
  type: "active",
35
39
  },
36
40
  nodeUrl: "http://localhost:2975/v2",
41
+ nodeId: undefined,
37
42
  gatewayUrl: undefined,
38
43
  minReserve: 0,
39
44
  useGateway: false,
@@ -3,7 +3,7 @@
3
3
  exports[`hedera currency bridge scanAccounts hedera seed 1 1`] = `
4
4
  [
5
5
  {
6
- "balance": "942529312",
6
+ "balance": "942076781",
7
7
  "currencyId": "hedera",
8
8
  "derivationMode": "hederaBip44",
9
9
  "freshAddress": "0.0.1040977",
@@ -14,22 +14,22 @@ exports[`hedera currency bridge scanAccounts hedera seed 1 1`] = `
14
14
  },
15
15
  "id": "js:2:hedera:0.0.1040977:hederaBip44",
16
16
  "index": 0,
17
- "operationsCount": 40,
17
+ "operationsCount": 41,
18
18
  "pendingOperations": [],
19
19
  "seedIdentifier": "9e92a312233d5fd6b5a723875aeea2cea81a8e48ffc00341cff6dffcfd3ab7f2",
20
- "spendableBalance": "942529312",
20
+ "spendableBalance": "942076781",
21
21
  "subAccounts": [],
22
22
  "swapHistory": [],
23
23
  "syncHash": "0x30c71e3f",
24
24
  "used": true,
25
25
  },
26
26
  {
27
- "balance": "30000000",
27
+ "balance": "20000000",
28
28
  "id": "js:2:hedera:0.0.1040977:hederaBip44+hedera%2Fhts%2Ftune~!underscore!~fm~!underscore!~0.0.127877",
29
29
  "operationsCount": 0,
30
30
  "parentId": "js:2:hedera:0.0.1040977:hederaBip44",
31
31
  "pendingOperations": [],
32
- "spendableBalance": "30000000",
32
+ "spendableBalance": "20000000",
33
33
  "swapHistory": [],
34
34
  "tokenId": "hedera/hts/tune_fm_0.0.127877",
35
35
  "type": "TokenAccountRaw",
@@ -141,12 +141,12 @@ exports[`hedera currency bridge scanAccounts hedera seed 1 1`] = `
141
141
  "used": true,
142
142
  },
143
143
  {
144
- "balance": "328000000",
144
+ "balance": "338000000",
145
145
  "id": "js:2:hedera:0.0.8313485:hederaBip44+hedera%2Fhts%2Ftune~!underscore!~fm~!underscore!~0.0.127877",
146
146
  "operationsCount": 0,
147
147
  "parentId": "js:2:hedera:0.0.8313485:hederaBip44",
148
148
  "pendingOperations": [],
149
- "spendableBalance": "328000000",
149
+ "spendableBalance": "338000000",
150
150
  "swapHistory": [],
151
151
  "tokenId": "hedera/hts/tune_fm_0.0.127877",
152
152
  "type": "TokenAccountRaw",
@@ -724,6 +724,26 @@ exports[`hedera currency bridge scanAccounts hedera seed 1 2`] = `
724
724
  "type": "OUT",
725
725
  "value": "1000054816",
726
726
  },
727
+ {
728
+ "accountId": "js:2:hedera:0.0.1040977:hederaBip44",
729
+ "blockHash": null,
730
+ "blockHeight": 5,
731
+ "extra": {
732
+ "consensusTimestamp": "1756718310.549818000",
733
+ },
734
+ "fee": "452531",
735
+ "hasFailed": false,
736
+ "hash": "QDUwQqgrOgB4aPkMprRe3yiux277A7_PJVfpbv-P4GBMT33ahyXp8NQXbblLDA0c",
737
+ "id": "js:2:hedera:0.0.1040977:hederaBip44-QDUwQqgrOgB4aPkMprRe3yiux277A7_PJVfpbv-P4GBMT33ahyXp8NQXbblLDA0c-FEES",
738
+ "recipients": [
739
+ "0.0.8313485",
740
+ ],
741
+ "senders": [
742
+ "0.0.1040977",
743
+ ],
744
+ "type": "FEES",
745
+ "value": "452531",
746
+ },
727
747
  {
728
748
  "accountId": "js:2:hedera:0.0.1040977:hederaBip44",
729
749
  "blockHash": null,
@@ -19,6 +19,8 @@ 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";
22
24
  import { getCryptoAssetsStore } from "../../bridge/crypto-assets";
23
25
 
24
26
  const createSigner: CreateSigner<SolanaSigner> = (transport: Transport) =>
@@ -28,6 +30,13 @@ const getCurrencyConfig = () => {
28
30
  return getCurrencyConfiguration<SolanaCoinConfig>(getCryptoCurrencyById("solana"));
29
31
  };
30
32
 
33
+ try {
34
+ const isCALLazyLoadingEnabled = LiveConfig.getValueByKey("feature_cal_lazy_loading");
35
+ setShouldSkipTokenLoading(Boolean(isCALLazyLoadingEnabled));
36
+ } catch (error) {
37
+ setShouldSkipTokenLoading(false);
38
+ }
39
+
31
40
  const bridge: Bridge<Transaction, SolanaAccount, TransactionStatus> = createBridges(
32
41
  executeWithSigner(createSigner),
33
42
  getCurrencyConfig,
@@ -108,6 +108,7 @@ export const DEFAULT_FEATURES: Features = {
108
108
  postOnboardingAssetsTransfer: DEFAULT_FEATURE,
109
109
  counterValue: DEFAULT_FEATURE,
110
110
  mockFeature: DEFAULT_FEATURE,
111
+ calLedgerService: DEFAULT_FEATURE,
111
112
  ptxServiceCtaExchangeDrawer: DEFAULT_FEATURE,
112
113
  ptxServiceCtaScreens: DEFAULT_FEATURE,
113
114
  ptxSwapReceiveTRC20WithoutTrx: DEFAULT_FEATURE,
@@ -624,8 +625,6 @@ export const DEFAULT_FEATURES: Features = {
624
625
  enableModularization: false,
625
626
  },
626
627
  },
627
- lldModularDrawerBackendData: DEFAULT_FEATURE,
628
- llmModularDrawerBackendData: DEFAULT_FEATURE,
629
628
  llmModularDrawer: {
630
629
  ...DEFAULT_FEATURE,
631
630
  params: {