@ledgerhq/live-common 34.51.0-nightly.2 → 34.51.0-nightly.3

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 (281) hide show
  1. package/lib/bridge/crypto-assets/index.d.ts.map +1 -1
  2. package/lib/bridge/crypto-assets/index.js +0 -2
  3. package/lib/bridge/crypto-assets/index.js.map +1 -1
  4. package/lib/bridge/crypto-assets/index.test.js +0 -4
  5. package/lib/bridge/crypto-assets/index.test.js.map +1 -1
  6. package/lib/currencies/index.d.ts +1 -1
  7. package/lib/currencies/index.d.ts.map +1 -1
  8. package/lib/currencies/index.js +2 -3
  9. package/lib/currencies/index.js.map +1 -1
  10. package/lib/currencies/sortByMarketcap.test.js +1 -3
  11. package/lib/currencies/sortByMarketcap.test.js.map +1 -1
  12. package/lib/e2e/enum/Account.d.ts +4 -0
  13. package/lib/e2e/enum/Account.d.ts.map +1 -1
  14. package/lib/e2e/enum/Account.js +4 -0
  15. package/lib/e2e/enum/Account.js.map +1 -1
  16. package/lib/e2e/enum/AppInfos.d.ts +1 -0
  17. package/lib/e2e/enum/AppInfos.d.ts.map +1 -1
  18. package/lib/e2e/enum/AppInfos.js +1 -0
  19. package/lib/e2e/enum/AppInfos.js.map +1 -1
  20. package/lib/e2e/enum/Currency.d.ts +2 -0
  21. package/lib/e2e/enum/Currency.d.ts.map +1 -1
  22. package/lib/e2e/enum/Currency.js +2 -0
  23. package/lib/e2e/enum/Currency.js.map +1 -1
  24. package/lib/e2e/enum/Network.d.ts +2 -1
  25. package/lib/e2e/enum/Network.d.ts.map +1 -1
  26. package/lib/e2e/enum/Network.js +1 -0
  27. package/lib/e2e/enum/Network.js.map +1 -1
  28. package/lib/e2e/enum/TokenType.d.ts +2 -1
  29. package/lib/e2e/enum/TokenType.d.ts.map +1 -1
  30. package/lib/e2e/enum/TokenType.js +1 -0
  31. package/lib/e2e/enum/TokenType.js.map +1 -1
  32. package/lib/e2e/enum/TransactionStatus.d.ts +4 -1
  33. package/lib/e2e/enum/TransactionStatus.d.ts.map +1 -1
  34. package/lib/e2e/enum/TransactionStatus.js +3 -0
  35. package/lib/e2e/enum/TransactionStatus.js.map +1 -1
  36. package/lib/e2e/families/sui.d.ts +2 -0
  37. package/lib/e2e/families/sui.d.ts.map +1 -0
  38. package/lib/e2e/families/sui.js +11 -0
  39. package/lib/e2e/families/sui.js.map +1 -0
  40. package/lib/e2e/index.d.ts +3 -0
  41. package/lib/e2e/index.d.ts.map +1 -1
  42. package/lib/e2e/speculos.d.ts +1 -0
  43. package/lib/e2e/speculos.d.ts.map +1 -1
  44. package/lib/e2e/speculos.js +23 -1
  45. package/lib/e2e/speculos.js.map +1 -1
  46. package/lib/env.react.d.ts +1 -1
  47. package/lib/env.react.d.ts.map +1 -1
  48. package/lib/exchange/providers/swap.js +4 -4
  49. package/lib/exchange/providers/swap.js.map +1 -1
  50. package/lib/exchange/swap/api/v5/__mocks__/fetchRates.mocks.d.ts.map +1 -1
  51. package/lib/exchange/swap/api/v5/__mocks__/fetchRates.mocks.js +1 -1
  52. package/lib/exchange/swap/api/v5/__mocks__/fetchRates.mocks.js.map +1 -1
  53. package/lib/exchange/swap/mock.js +1 -1
  54. package/lib/exchange/swap/mock.js.map +1 -1
  55. package/lib/featureFlags/defaultFeatures.d.ts.map +1 -1
  56. package/lib/featureFlags/defaultFeatures.js +4 -0
  57. package/lib/featureFlags/defaultFeatures.js.map +1 -1
  58. package/lib/featureFlags/useFeature.d.ts +1 -1
  59. package/lib/featureFlags/useFeature.d.ts.map +1 -1
  60. package/lib/hooks/useManifestWithSessionId.d.ts +12 -0
  61. package/lib/hooks/useManifestWithSessionId.d.ts.map +1 -0
  62. package/lib/hooks/useManifestWithSessionId.js +67 -0
  63. package/lib/hooks/useManifestWithSessionId.js.map +1 -0
  64. package/lib/hooks/useManifestWithSessionId.test.d.ts +2 -0
  65. package/lib/hooks/useManifestWithSessionId.test.d.ts.map +1 -0
  66. package/lib/hooks/useManifestWithSessionId.test.js +71 -0
  67. package/lib/hooks/useManifestWithSessionId.test.js.map +1 -0
  68. package/lib/market/utils/index.d.ts +1 -0
  69. package/lib/market/utils/index.d.ts.map +1 -1
  70. package/lib/market/utils/index.js +16 -0
  71. package/lib/market/utils/index.js.map +1 -1
  72. package/lib/modularDrawer/hooks/__tests__/useDetailedAccountsCore.test.d.ts +2 -0
  73. package/lib/modularDrawer/hooks/__tests__/useDetailedAccountsCore.test.d.ts.map +1 -0
  74. package/lib/modularDrawer/hooks/__tests__/useDetailedAccountsCore.test.js +350 -0
  75. package/lib/modularDrawer/hooks/__tests__/useDetailedAccountsCore.test.js.map +1 -0
  76. package/lib/modularDrawer/hooks/index.d.ts +2 -0
  77. package/lib/modularDrawer/hooks/index.d.ts.map +1 -0
  78. package/lib/modularDrawer/hooks/index.js +6 -0
  79. package/lib/modularDrawer/hooks/index.js.map +1 -0
  80. package/lib/modularDrawer/hooks/useDetailedAccountsCore.d.ts +14 -0
  81. package/lib/modularDrawer/hooks/useDetailedAccountsCore.d.ts.map +1 -0
  82. package/lib/modularDrawer/hooks/useDetailedAccountsCore.js +119 -0
  83. package/lib/modularDrawer/hooks/useDetailedAccountsCore.js.map +1 -0
  84. package/lib/modularDrawer/hooks/useRightBalanceAsset.d.ts.map +1 -1
  85. package/lib/modularDrawer/hooks/useRightBalanceAsset.js +9 -1
  86. package/lib/modularDrawer/hooks/useRightBalanceAsset.js.map +1 -1
  87. package/lib/modularDrawer/hooks/useRightBalanceNetwork.d.ts +6 -1
  88. package/lib/modularDrawer/hooks/useRightBalanceNetwork.d.ts.map +1 -1
  89. package/lib/modularDrawer/hooks/useRightBalanceNetwork.js +12 -4
  90. package/lib/modularDrawer/hooks/useRightBalanceNetwork.js.map +1 -1
  91. package/lib/modularDrawer/index.d.ts +4 -0
  92. package/lib/modularDrawer/index.d.ts.map +1 -0
  93. package/lib/modularDrawer/index.js +20 -0
  94. package/lib/modularDrawer/index.js.map +1 -0
  95. package/lib/modularDrawer/types/detailedAccount.d.ts +46 -0
  96. package/lib/modularDrawer/types/detailedAccount.d.ts.map +1 -0
  97. package/lib/modularDrawer/types/detailedAccount.js +3 -0
  98. package/lib/modularDrawer/types/detailedAccount.js.map +1 -0
  99. package/lib/modularDrawer/types/index.d.ts +2 -0
  100. package/lib/modularDrawer/types/index.d.ts.map +1 -0
  101. package/lib/modularDrawer/types/index.js +18 -0
  102. package/lib/modularDrawer/types/index.js.map +1 -0
  103. package/lib/modularDrawer/utils/__tests__/sortAccountsByFiatValue.test.d.ts +2 -0
  104. package/lib/modularDrawer/utils/__tests__/sortAccountsByFiatValue.test.d.ts.map +1 -0
  105. package/lib/modularDrawer/utils/__tests__/sortAccountsByFiatValue.test.js +106 -0
  106. package/lib/modularDrawer/utils/__tests__/sortAccountsByFiatValue.test.js.map +1 -0
  107. package/lib/modularDrawer/utils/getBalanceAndFiatValueByAssets.d.ts +3 -4
  108. package/lib/modularDrawer/utils/getBalanceAndFiatValueByAssets.d.ts.map +1 -1
  109. package/lib/modularDrawer/utils/getBalanceAndFiatValueByAssets.js +7 -0
  110. package/lib/modularDrawer/utils/getBalanceAndFiatValueByAssets.js.map +1 -1
  111. package/lib/modularDrawer/utils/index.d.ts +1 -0
  112. package/lib/modularDrawer/utils/index.d.ts.map +1 -1
  113. package/lib/modularDrawer/utils/index.js +3 -1
  114. package/lib/modularDrawer/utils/index.js.map +1 -1
  115. package/lib/modularDrawer/utils/sortAccountsByFiatValue.d.ts +8 -0
  116. package/lib/modularDrawer/utils/sortAccountsByFiatValue.d.ts.map +1 -0
  117. package/lib/modularDrawer/utils/sortAccountsByFiatValue.js +17 -0
  118. package/lib/modularDrawer/utils/sortAccountsByFiatValue.js.map +1 -0
  119. package/lib/modularDrawer/utils/type.d.ts +2 -2
  120. package/lib/modularDrawer/utils/type.d.ts.map +1 -1
  121. package/lib/platform/providers/RemoteLiveAppProvider/api/mock.json +3 -3
  122. package/lib/wallet-api/useDappLogic.js +1 -1
  123. package/lib/wallet-api/useDappLogic.js.map +1 -1
  124. package/lib-es/bridge/crypto-assets/index.d.ts.map +1 -1
  125. package/lib-es/bridge/crypto-assets/index.js +0 -2
  126. package/lib-es/bridge/crypto-assets/index.js.map +1 -1
  127. package/lib-es/bridge/crypto-assets/index.test.js +0 -4
  128. package/lib-es/bridge/crypto-assets/index.test.js.map +1 -1
  129. package/lib-es/currencies/index.d.ts +1 -1
  130. package/lib-es/currencies/index.d.ts.map +1 -1
  131. package/lib-es/currencies/index.js +1 -1
  132. package/lib-es/currencies/index.js.map +1 -1
  133. package/lib-es/currencies/sortByMarketcap.test.js +1 -3
  134. package/lib-es/currencies/sortByMarketcap.test.js.map +1 -1
  135. package/lib-es/e2e/enum/Account.d.ts +4 -0
  136. package/lib-es/e2e/enum/Account.d.ts.map +1 -1
  137. package/lib-es/e2e/enum/Account.js +4 -0
  138. package/lib-es/e2e/enum/Account.js.map +1 -1
  139. package/lib-es/e2e/enum/AppInfos.d.ts +1 -0
  140. package/lib-es/e2e/enum/AppInfos.d.ts.map +1 -1
  141. package/lib-es/e2e/enum/AppInfos.js +1 -0
  142. package/lib-es/e2e/enum/AppInfos.js.map +1 -1
  143. package/lib-es/e2e/enum/Currency.d.ts +2 -0
  144. package/lib-es/e2e/enum/Currency.d.ts.map +1 -1
  145. package/lib-es/e2e/enum/Currency.js +2 -0
  146. package/lib-es/e2e/enum/Currency.js.map +1 -1
  147. package/lib-es/e2e/enum/Network.d.ts +2 -1
  148. package/lib-es/e2e/enum/Network.d.ts.map +1 -1
  149. package/lib-es/e2e/enum/Network.js +1 -0
  150. package/lib-es/e2e/enum/Network.js.map +1 -1
  151. package/lib-es/e2e/enum/TokenType.d.ts +2 -1
  152. package/lib-es/e2e/enum/TokenType.d.ts.map +1 -1
  153. package/lib-es/e2e/enum/TokenType.js +1 -0
  154. package/lib-es/e2e/enum/TokenType.js.map +1 -1
  155. package/lib-es/e2e/enum/TransactionStatus.d.ts +4 -1
  156. package/lib-es/e2e/enum/TransactionStatus.d.ts.map +1 -1
  157. package/lib-es/e2e/enum/TransactionStatus.js +3 -0
  158. package/lib-es/e2e/enum/TransactionStatus.js.map +1 -1
  159. package/lib-es/e2e/families/sui.d.ts +2 -0
  160. package/lib-es/e2e/families/sui.d.ts.map +1 -0
  161. package/lib-es/e2e/families/sui.js +7 -0
  162. package/lib-es/e2e/families/sui.js.map +1 -0
  163. package/lib-es/e2e/index.d.ts +3 -0
  164. package/lib-es/e2e/index.d.ts.map +1 -1
  165. package/lib-es/e2e/speculos.d.ts +1 -0
  166. package/lib-es/e2e/speculos.d.ts.map +1 -1
  167. package/lib-es/e2e/speculos.js +21 -0
  168. package/lib-es/e2e/speculos.js.map +1 -1
  169. package/lib-es/env.react.d.ts +1 -1
  170. package/lib-es/env.react.d.ts.map +1 -1
  171. package/lib-es/exchange/providers/swap.js +4 -4
  172. package/lib-es/exchange/providers/swap.js.map +1 -1
  173. package/lib-es/exchange/swap/api/v5/__mocks__/fetchRates.mocks.d.ts.map +1 -1
  174. package/lib-es/exchange/swap/api/v5/__mocks__/fetchRates.mocks.js +1 -1
  175. package/lib-es/exchange/swap/api/v5/__mocks__/fetchRates.mocks.js.map +1 -1
  176. package/lib-es/exchange/swap/mock.js +1 -1
  177. package/lib-es/exchange/swap/mock.js.map +1 -1
  178. package/lib-es/featureFlags/defaultFeatures.d.ts.map +1 -1
  179. package/lib-es/featureFlags/defaultFeatures.js +4 -0
  180. package/lib-es/featureFlags/defaultFeatures.js.map +1 -1
  181. package/lib-es/featureFlags/useFeature.d.ts +1 -1
  182. package/lib-es/featureFlags/useFeature.d.ts.map +1 -1
  183. package/lib-es/hooks/useManifestWithSessionId.d.ts +12 -0
  184. package/lib-es/hooks/useManifestWithSessionId.d.ts.map +1 -0
  185. package/lib-es/hooks/useManifestWithSessionId.js +60 -0
  186. package/lib-es/hooks/useManifestWithSessionId.js.map +1 -0
  187. package/lib-es/hooks/useManifestWithSessionId.test.d.ts +2 -0
  188. package/lib-es/hooks/useManifestWithSessionId.test.d.ts.map +1 -0
  189. package/lib-es/hooks/useManifestWithSessionId.test.js +69 -0
  190. package/lib-es/hooks/useManifestWithSessionId.test.js.map +1 -0
  191. package/lib-es/market/utils/index.d.ts +1 -0
  192. package/lib-es/market/utils/index.d.ts.map +1 -1
  193. package/lib-es/market/utils/index.js +2 -0
  194. package/lib-es/market/utils/index.js.map +1 -1
  195. package/lib-es/modularDrawer/hooks/__tests__/useDetailedAccountsCore.test.d.ts +2 -0
  196. package/lib-es/modularDrawer/hooks/__tests__/useDetailedAccountsCore.test.d.ts.map +1 -0
  197. package/lib-es/modularDrawer/hooks/__tests__/useDetailedAccountsCore.test.js +345 -0
  198. package/lib-es/modularDrawer/hooks/__tests__/useDetailedAccountsCore.test.js.map +1 -0
  199. package/lib-es/modularDrawer/hooks/index.d.ts +2 -0
  200. package/lib-es/modularDrawer/hooks/index.d.ts.map +1 -0
  201. package/lib-es/modularDrawer/hooks/index.js +2 -0
  202. package/lib-es/modularDrawer/hooks/index.js.map +1 -0
  203. package/lib-es/modularDrawer/hooks/useDetailedAccountsCore.d.ts +14 -0
  204. package/lib-es/modularDrawer/hooks/useDetailedAccountsCore.d.ts.map +1 -0
  205. package/lib-es/modularDrawer/hooks/useDetailedAccountsCore.js +115 -0
  206. package/lib-es/modularDrawer/hooks/useDetailedAccountsCore.js.map +1 -0
  207. package/lib-es/modularDrawer/hooks/useRightBalanceAsset.d.ts.map +1 -1
  208. package/lib-es/modularDrawer/hooks/useRightBalanceAsset.js +6 -1
  209. package/lib-es/modularDrawer/hooks/useRightBalanceAsset.js.map +1 -1
  210. package/lib-es/modularDrawer/hooks/useRightBalanceNetwork.d.ts +6 -1
  211. package/lib-es/modularDrawer/hooks/useRightBalanceNetwork.d.ts.map +1 -1
  212. package/lib-es/modularDrawer/hooks/useRightBalanceNetwork.js +9 -4
  213. package/lib-es/modularDrawer/hooks/useRightBalanceNetwork.js.map +1 -1
  214. package/lib-es/modularDrawer/index.d.ts +4 -0
  215. package/lib-es/modularDrawer/index.d.ts.map +1 -0
  216. package/lib-es/modularDrawer/index.js +4 -0
  217. package/lib-es/modularDrawer/index.js.map +1 -0
  218. package/lib-es/modularDrawer/types/detailedAccount.d.ts +46 -0
  219. package/lib-es/modularDrawer/types/detailedAccount.d.ts.map +1 -0
  220. package/lib-es/modularDrawer/types/detailedAccount.js +2 -0
  221. package/lib-es/modularDrawer/types/detailedAccount.js.map +1 -0
  222. package/lib-es/modularDrawer/types/index.d.ts +2 -0
  223. package/lib-es/modularDrawer/types/index.d.ts.map +1 -0
  224. package/lib-es/modularDrawer/types/index.js +2 -0
  225. package/lib-es/modularDrawer/types/index.js.map +1 -0
  226. package/lib-es/modularDrawer/utils/__tests__/sortAccountsByFiatValue.test.d.ts +2 -0
  227. package/lib-es/modularDrawer/utils/__tests__/sortAccountsByFiatValue.test.d.ts.map +1 -0
  228. package/lib-es/modularDrawer/utils/__tests__/sortAccountsByFiatValue.test.js +101 -0
  229. package/lib-es/modularDrawer/utils/__tests__/sortAccountsByFiatValue.test.js.map +1 -0
  230. package/lib-es/modularDrawer/utils/getBalanceAndFiatValueByAssets.d.ts +3 -4
  231. package/lib-es/modularDrawer/utils/getBalanceAndFiatValueByAssets.d.ts.map +1 -1
  232. package/lib-es/modularDrawer/utils/getBalanceAndFiatValueByAssets.js +4 -0
  233. package/lib-es/modularDrawer/utils/getBalanceAndFiatValueByAssets.js.map +1 -1
  234. package/lib-es/modularDrawer/utils/index.d.ts +1 -0
  235. package/lib-es/modularDrawer/utils/index.d.ts.map +1 -1
  236. package/lib-es/modularDrawer/utils/index.js +1 -0
  237. package/lib-es/modularDrawer/utils/index.js.map +1 -1
  238. package/lib-es/modularDrawer/utils/sortAccountsByFiatValue.d.ts +8 -0
  239. package/lib-es/modularDrawer/utils/sortAccountsByFiatValue.d.ts.map +1 -0
  240. package/lib-es/modularDrawer/utils/sortAccountsByFiatValue.js +13 -0
  241. package/lib-es/modularDrawer/utils/sortAccountsByFiatValue.js.map +1 -0
  242. package/lib-es/modularDrawer/utils/type.d.ts +2 -2
  243. package/lib-es/modularDrawer/utils/type.d.ts.map +1 -1
  244. package/lib-es/platform/providers/RemoteLiveAppProvider/api/mock.json +3 -3
  245. package/lib-es/wallet-api/useDappLogic.js +2 -2
  246. package/lib-es/wallet-api/useDappLogic.js.map +1 -1
  247. package/package.json +51 -51
  248. package/src/bridge/crypto-assets/index.test.ts +0 -4
  249. package/src/bridge/crypto-assets/index.ts +0 -2
  250. package/src/currencies/index.ts +1 -2
  251. package/src/currencies/sortByMarketcap.test.ts +1 -3
  252. package/src/e2e/enum/Account.ts +31 -0
  253. package/src/e2e/enum/AppInfos.ts +2 -0
  254. package/src/e2e/enum/Currency.ts +11 -0
  255. package/src/e2e/enum/Network.ts +1 -0
  256. package/src/e2e/enum/TokenType.ts +1 -0
  257. package/src/e2e/enum/TransactionStatus.ts +3 -0
  258. package/src/e2e/families/sui.ts +7 -0
  259. package/src/e2e/speculos.ts +23 -0
  260. package/src/exchange/providers/swap.ts +4 -4
  261. package/src/exchange/swap/api/v5/__mocks__/fetchRates.mocks.ts +1 -2
  262. package/src/exchange/swap/mock.ts +1 -1
  263. package/src/featureFlags/defaultFeatures.ts +5 -0
  264. package/src/hooks/useManifestWithSessionId.test.ts +105 -0
  265. package/src/hooks/useManifestWithSessionId.ts +83 -0
  266. package/src/market/utils/index.ts +3 -0
  267. package/src/modularDrawer/hooks/__tests__/useDetailedAccountsCore.test.ts +472 -0
  268. package/src/modularDrawer/hooks/index.ts +1 -0
  269. package/src/modularDrawer/hooks/useDetailedAccountsCore.ts +146 -0
  270. package/src/modularDrawer/hooks/useRightBalanceAsset.tsx +5 -1
  271. package/src/modularDrawer/hooks/useRightBalanceNetwork.tsx +10 -4
  272. package/src/modularDrawer/index.ts +3 -0
  273. package/src/modularDrawer/types/detailedAccount.ts +49 -0
  274. package/src/modularDrawer/types/index.ts +1 -0
  275. package/src/modularDrawer/utils/__tests__/sortAccountsByFiatValue.test.ts +117 -0
  276. package/src/modularDrawer/utils/getBalanceAndFiatValueByAssets.ts +6 -3
  277. package/src/modularDrawer/utils/index.ts +1 -0
  278. package/src/modularDrawer/utils/sortAccountsByFiatValue.ts +14 -0
  279. package/src/modularDrawer/utils/type.ts +3 -2
  280. package/src/platform/providers/RemoteLiveAppProvider/api/mock.json +3 -3
  281. package/src/wallet-api/useDappLogic.ts +3 -3
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ledgerhq/live-common",
3
3
  "description": "Common ground for the Ledger Live apps",
4
- "version": "34.51.0-nightly.2",
4
+ "version": "34.51.0-nightly.3",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/LedgerHQ/ledger-live.git"
@@ -166,45 +166,45 @@
166
166
  "xstate": "^5.19.2",
167
167
  "yargs": "^17.0.0",
168
168
  "zod": "^3.22.4",
169
- "@ledgerhq/coin-algorand": "^0.11.0-nightly.0",
170
- "@ledgerhq/coin-aptos": "^3.4.0-nightly.0",
171
- "@ledgerhq/coin-bitcoin": "^0.23.0-nightly.0",
172
- "@ledgerhq/coin-canton": "^0.8.0-nightly.0",
173
- "@ledgerhq/coin-cardano": "^0.13.0-nightly.0",
174
- "@ledgerhq/coin-casper": "^2.2.0-nightly.0",
175
- "@ledgerhq/coin-celo": "^1.6.0-nightly.0",
176
- "@ledgerhq/coin-cosmos": "^0.18.0-nightly.0",
177
- "@ledgerhq/coin-evm": "^2.33.0-nightly.0",
178
- "@ledgerhq/coin-filecoin": "^1.13.0-nightly.0",
179
- "@ledgerhq/coin-framework": "^6.7.0-nightly.0",
180
- "@ledgerhq/coin-hedera": "^1.12.0-nightly.0",
181
- "@ledgerhq/coin-icon": "^0.13.0-nightly.0",
182
- "@ledgerhq/coin-internet_computer": "^1.9.0-nightly.0",
183
- "@ledgerhq/coin-kaspa": "^1.3.0-nightly.0",
184
- "@ledgerhq/coin-mina": "^1.3.0-nightly.0",
185
- "@ledgerhq/coin-multiversx": "^0.6.0-nightly.0",
186
- "@ledgerhq/coin-near": "^0.14.0-nightly.0",
187
- "@ledgerhq/coin-polkadot": "^6.11.0-nightly.0",
188
- "@ledgerhq/coin-solana": "^0.35.0-nightly.0",
189
- "@ledgerhq/coin-stacks": "^0.10.0-nightly.0",
190
- "@ledgerhq/coin-stellar": "^6.5.0-nightly.0",
191
- "@ledgerhq/coin-sui": "^0.16.0-nightly.1",
192
- "@ledgerhq/coin-tezos": "^6.7.0-nightly.0",
193
- "@ledgerhq/coin-ton": "^0.15.0-nightly.0",
194
- "@ledgerhq/coin-tron": "^5.5.0-nightly.0",
195
- "@ledgerhq/coin-vechain": "^2.11.0-nightly.0",
196
- "@ledgerhq/coin-xrp": "^7.6.0-nightly.0",
197
- "@ledgerhq/crypto-icons-ui": "^1.21.0-nightly.0",
198
- "@ledgerhq/cryptoassets": "^13.31.0-nightly.0",
199
- "@ledgerhq/device-core": "^0.6.6-nightly.0",
169
+ "@ledgerhq/coin-algorand": "^0.11.0-nightly.1",
170
+ "@ledgerhq/coin-aptos": "^3.4.0-nightly.1",
171
+ "@ledgerhq/coin-bitcoin": "^0.23.0-nightly.1",
172
+ "@ledgerhq/coin-canton": "^0.8.0-nightly.1",
173
+ "@ledgerhq/coin-cardano": "^0.13.0-nightly.1",
174
+ "@ledgerhq/coin-casper": "^2.2.0-nightly.1",
175
+ "@ledgerhq/coin-celo": "^1.6.0-nightly.1",
176
+ "@ledgerhq/coin-cosmos": "^0.18.0-nightly.1",
177
+ "@ledgerhq/coin-evm": "^2.33.0-nightly.1",
178
+ "@ledgerhq/coin-filecoin": "^1.13.0-nightly.1",
179
+ "@ledgerhq/coin-framework": "^6.7.0-nightly.1",
180
+ "@ledgerhq/coin-hedera": "^1.12.0-nightly.1",
181
+ "@ledgerhq/coin-icon": "^0.13.0-nightly.1",
182
+ "@ledgerhq/coin-internet_computer": "^1.9.0-nightly.1",
183
+ "@ledgerhq/coin-kaspa": "^1.3.0-nightly.1",
184
+ "@ledgerhq/coin-mina": "^1.3.0-nightly.1",
185
+ "@ledgerhq/coin-multiversx": "^0.6.0-nightly.1",
186
+ "@ledgerhq/coin-near": "^0.14.0-nightly.1",
187
+ "@ledgerhq/coin-polkadot": "^6.11.0-nightly.1",
188
+ "@ledgerhq/coin-solana": "^0.35.0-nightly.1",
189
+ "@ledgerhq/coin-stacks": "^0.10.0-nightly.1",
190
+ "@ledgerhq/coin-stellar": "^6.5.0-nightly.1",
191
+ "@ledgerhq/coin-sui": "^0.16.0-nightly.2",
192
+ "@ledgerhq/coin-tezos": "^6.7.0-nightly.1",
193
+ "@ledgerhq/coin-ton": "^0.15.0-nightly.1",
194
+ "@ledgerhq/coin-tron": "^5.5.0-nightly.1",
195
+ "@ledgerhq/coin-vechain": "^2.11.0-nightly.1",
196
+ "@ledgerhq/coin-xrp": "^7.6.0-nightly.1",
197
+ "@ledgerhq/crypto-icons-ui": "^1.21.0-nightly.1",
198
+ "@ledgerhq/cryptoassets": "^13.31.0-nightly.1",
199
+ "@ledgerhq/device-core": "^0.6.6-nightly.1",
200
200
  "@ledgerhq/devices": "8.6.1",
201
201
  "@ledgerhq/errors": "^6.26.0",
202
202
  "@ledgerhq/hw-app-algorand": "^6.31.8",
203
203
  "@ledgerhq/hw-app-aptos": "^6.34.8",
204
204
  "@ledgerhq/hw-app-btc": "^10.11.2",
205
- "@ledgerhq/hw-app-celo": "^6.35.1-nightly.0",
205
+ "@ledgerhq/hw-app-celo": "^6.35.1-nightly.1",
206
206
  "@ledgerhq/hw-app-cosmos": "^6.32.8",
207
- "@ledgerhq/hw-app-eth": "^6.46.1-nightly.0",
207
+ "@ledgerhq/hw-app-eth": "^6.46.1-nightly.1",
208
208
  "@ledgerhq/hw-app-exchange": "^0.15.0",
209
209
  "@ledgerhq/hw-app-hedera": "^1.2.8",
210
210
  "@ledgerhq/hw-app-icon": "^1.3.8",
@@ -216,27 +216,27 @@
216
216
  "@ledgerhq/hw-app-sui": "^1.4.0",
217
217
  "@ledgerhq/hw-app-tezos": "^6.31.8",
218
218
  "@ledgerhq/hw-app-trx": "^6.31.8",
219
- "@ledgerhq/hw-app-vet": "^0.6.2-nightly.0",
219
+ "@ledgerhq/hw-app-vet": "^0.6.2-nightly.1",
220
220
  "@ledgerhq/hw-app-xrp": "^6.32.6",
221
221
  "@ledgerhq/hw-bolos": "^6.32.8",
222
222
  "@ledgerhq/hw-transport": "6.31.12",
223
223
  "@ledgerhq/hw-transport-mocker": "^6.29.12",
224
- "@ledgerhq/ledger-cal-service": "^1.6.0",
225
- "@ledgerhq/ledger-trust-service": "^0.3.14",
224
+ "@ledgerhq/ledger-cal-service": "^1.7.0-nightly.0",
225
+ "@ledgerhq/ledger-trust-service": "^0.3.15-nightly.0",
226
226
  "@ledgerhq/live-config": "^3.2.0",
227
- "@ledgerhq/live-countervalues": "^0.7.4-nightly.0",
228
- "@ledgerhq/live-countervalues-react": "^0.6.3-nightly.0",
229
- "@ledgerhq/live-dmk-shared": "^0.13.1",
230
- "@ledgerhq/live-env": "^2.18.0",
231
- "@ledgerhq/live-hooks": "0.1.0",
232
- "@ledgerhq/live-network": "^2.0.19",
227
+ "@ledgerhq/live-countervalues": "^0.8.0-nightly.1",
228
+ "@ledgerhq/live-countervalues-react": "^0.7.0-nightly.1",
229
+ "@ledgerhq/live-dmk-shared": "^0.14.0-nightly.0",
230
+ "@ledgerhq/live-env": "^2.19.0-nightly.0",
231
+ "@ledgerhq/live-hooks": "0.2.0-nightly.0",
232
+ "@ledgerhq/live-network": "^2.0.20-nightly.0",
233
233
  "@ledgerhq/live-promise": "^0.1.1",
234
- "@ledgerhq/live-signer-canton": "^0.4.2-nightly.0",
235
- "@ledgerhq/live-signer-evm": "^0.8.2-nightly.0",
236
- "@ledgerhq/live-signer-solana": "^0.5.8-nightly.0",
237
- "@ledgerhq/live-wallet": "^0.14.3-nightly.0",
234
+ "@ledgerhq/live-signer-canton": "^0.4.2-nightly.1",
235
+ "@ledgerhq/live-signer-evm": "^0.8.2-nightly.1",
236
+ "@ledgerhq/live-signer-solana": "^0.5.8-nightly.1",
237
+ "@ledgerhq/live-wallet": "^0.14.3-nightly.1",
238
238
  "@ledgerhq/logs": "^6.13.0",
239
- "@ledgerhq/speculos-transport": "^0.2.12",
239
+ "@ledgerhq/speculos-transport": "^0.2.13-nightly.0",
240
240
  "@ledgerhq/wallet-api-acre-module": "^0.8.0-nightly.1",
241
241
  "@ledgerhq/wallet-api-exchange-module": "^0.17.0-nightly.1"
242
242
  },
@@ -277,7 +277,7 @@
277
277
  "react-native": "0.77.2",
278
278
  "react-native-svg": "15.11.2",
279
279
  "react-redux": "^7.2.9",
280
- "react-test-renderer": "^18.2.0",
280
+ "react-test-renderer": "18.3.1",
281
281
  "redux-actions": "2.6.5",
282
282
  "timemachine": "^0.3.2",
283
283
  "ts-jest": "^29.1.1",
@@ -286,10 +286,10 @@
286
286
  "undici": "6.19.2",
287
287
  "uuid": "^8.3.2",
288
288
  "ws": "7",
289
- "@ledgerhq/device-react": "^0.2.47-nightly.0",
289
+ "@ledgerhq/device-react": "^0.3.0-nightly.1",
290
290
  "@ledgerhq/types-cryptoassets": "^7.29.0-nightly.0",
291
291
  "@ledgerhq/types-devices": "^6.27.0",
292
- "@ledgerhq/types-live": "^6.87.0-nightly.0"
292
+ "@ledgerhq/types-live": "^6.87.0-nightly.1"
293
293
  },
294
294
  "scripts": {
295
295
  "build": "zx ./scripts/build-ts.mjs",
@@ -14,11 +14,9 @@ describe("Testing CryptoAssetStore", () => {
14
14
 
15
15
  const store = getCryptoAssetsStore();
16
16
  expect(store).toEqual({
17
- findTokenByAddress: legacy.findTokenByAddress,
18
17
  getTokenById: legacy.getTokenById,
19
18
  findTokenById: legacy.findTokenById,
20
19
  findTokenByAddressInCurrency: legacy.findTokenByAddressInCurrency,
21
- findTokenByTicker: legacy.findTokenByTicker,
22
20
  });
23
21
  });
24
22
 
@@ -32,11 +30,9 @@ describe("Testing CryptoAssetStore", () => {
32
30
 
33
31
  const store = getCryptoAssetsStore();
34
32
  expect(store).toEqual({
35
- findTokenByAddress: legacy.findTokenByAddress,
36
33
  getTokenById: legacy.getTokenById,
37
34
  findTokenById: legacy.findTokenById,
38
35
  findTokenByAddressInCurrency: legacy.findTokenByAddressInCurrency,
39
- findTokenByTicker: legacy.findTokenByTicker,
40
36
  });
41
37
  });
42
38
 
@@ -3,11 +3,9 @@ import * as legacy from "@ledgerhq/cryptoassets/tokens";
3
3
  import type { CryptoAssetsStore } from "@ledgerhq/types-live";
4
4
 
5
5
  const legacyStore: CryptoAssetsStore = {
6
- findTokenByAddress: legacy.findTokenByAddress,
7
6
  getTokenById: legacy.getTokenById,
8
7
  findTokenById: legacy.findTokenById,
9
8
  findTokenByAddressInCurrency: legacy.findTokenByAddressInCurrency,
10
- findTokenByTicker: legacy.findTokenByTicker,
11
9
  };
12
10
 
13
11
  let cryptoAssetsStore: CryptoAssetsStore | undefined = undefined;
@@ -14,9 +14,8 @@ export {
14
14
  listTokens,
15
15
  listTokensForCryptoCurrency,
16
16
  listTokenTypesForCryptoCurrency,
17
- findTokenByTicker,
18
17
  findTokenById,
19
- findTokenByAddress,
18
+ findTokenByAddressInCurrency,
20
19
  hasTokenId,
21
20
  getAbandonSeedAddress,
22
21
  getTokenById,
@@ -7,9 +7,7 @@ import type { CryptoAssetsStore } from "@ledgerhq/types-live";
7
7
  import { findCurrencyByTicker } from "@ledgerhq/live-countervalues/findCurrencyByTicker";
8
8
 
9
9
  // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
10
- setCryptoAssetsStoreForCoinFramework({
11
- findTokenByTicker: (_: string) => undefined,
12
- } as CryptoAssetsStore);
10
+ setCryptoAssetsStoreForCoinFramework({} as CryptoAssetsStore);
13
11
 
14
12
  test("sortCurrenciesByIds snapshot", () => {
15
13
  const list = [...listCryptoCurrencies(), ...listTokens()];
@@ -526,6 +526,19 @@ export class Account {
526
526
  1,
527
527
  );
528
528
 
529
+ static readonly SUI_1 = new Account(
530
+ Currency.SUI,
531
+ "Sui 1",
532
+ "0xc6169bcce8718609e43d179b087e6c1e2ac28e5325660af34d22fb5ce284031e",
533
+ 0,
534
+ );
535
+ static readonly SUI_2 = new Account(
536
+ Currency.SUI,
537
+ "Sui 2",
538
+ "0x6644c1ce77c5e5ef8d8bd3ae2a4e18239e5d418a5e0800ed5037818399e3a7f6",
539
+ 1,
540
+ );
541
+
529
542
  static readonly EMPTY = new Account(Currency.BTC, "Empty", "", 0);
530
543
  }
531
544
 
@@ -640,6 +653,24 @@ export class TokenAccount extends Account {
640
653
  TokenType.TRC20,
641
654
  Account.TRX_1,
642
655
  );
656
+
657
+ static readonly SUI_USDC_1 = new TokenAccount(
658
+ Currency.SUI_USDC,
659
+ "SUI USDC 1",
660
+ Account.SUI_1.address,
661
+ 0,
662
+ TokenType.ERC20,
663
+ Account.SUI_1,
664
+ );
665
+
666
+ static readonly SUI_USDC_2 = new TokenAccount(
667
+ Currency.SUI_USDC,
668
+ "SUI USDC 2",
669
+ Account.SUI_2.address,
670
+ 1,
671
+ TokenType.ERC20,
672
+ Account.SUI_2,
673
+ );
643
674
  }
644
675
 
645
676
  export type AccountType = Account | TokenAccount;
@@ -64,4 +64,6 @@ export class AppInfos {
64
64
  static readonly KASPA = new AppInfos("Kaspa");
65
65
 
66
66
  static readonly HEDERA = new AppInfos("Hedera");
67
+
68
+ static readonly SUI = new AppInfos("Sui");
67
69
  }
@@ -207,4 +207,15 @@ export class Currency {
207
207
  static readonly OP = new Currency("OP Mainnet", "OP", "optimism", AppInfos.ETHEREUM, [
208
208
  Network.OPTIMISM,
209
209
  ]);
210
+
211
+ static readonly SUI = new Currency("Sui", "SUI", "sui", AppInfos.SUI, [Network.SUI]);
212
+
213
+ static readonly SUI_USDC = new Currency(
214
+ "USDC",
215
+ "USDC",
216
+ "sui/coin/usdc_0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::usdc",
217
+ AppInfos.SUI,
218
+ [Network.SUI],
219
+ "0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7",
220
+ );
210
221
  }
@@ -33,4 +33,5 @@ export enum Network {
33
33
  LITECOIN = "Litecoin",
34
34
  KASPA = "Kaspa",
35
35
  HEDERA = "Hedera",
36
+ SUI = "Sui",
36
37
  }
@@ -2,4 +2,5 @@ export enum TokenType {
2
2
  ERC20 = "erc20",
3
3
  TRC20 = "trc20",
4
4
  SPL = "spl",
5
+ SUI = "sui",
5
6
  }
@@ -3,7 +3,10 @@ export enum TransactionStatus {
3
3
  DELEGATED = "Delegated",
4
4
  NFT_RECEIVED = "NFT Received",
5
5
  SENT = "Sent",
6
+ SEND = "Send",
6
7
  FEES = "Fees",
7
8
  STAKED = "Staked",
8
9
  SENDING = "Sending",
10
+ TRANSACTION_SENT = "Transaction sent",
11
+ CONFIRMED = "Confirmed",
9
12
  }
@@ -0,0 +1,7 @@
1
+ import { pressBoth, pressUntilTextFound } from "../speculos";
2
+ import { DeviceLabels } from "../enum/DeviceLabels";
3
+
4
+ export async function sendSui() {
5
+ await pressUntilTextFound(DeviceLabels.ACCEPT);
6
+ await pressBoth();
7
+ }
@@ -42,6 +42,7 @@ import { Swap } from "./models/Swap";
42
42
  import { delegateOsmosis } from "./families/osmosis";
43
43
  import { AppInfos } from "./enum/AppInfos";
44
44
  import { DEVICE_LABELS_CONFIG } from "./data/deviceLabelsData";
45
+ import { sendSui } from "./families/sui";
45
46
 
46
47
  const isSpeculosRemote = process.env.REMOTE_SPECULOS === "true";
47
48
 
@@ -344,6 +345,14 @@ export const specs: Specs = {
344
345
  },
345
346
  dependency: "",
346
347
  },
348
+ Sui: {
349
+ currency: getCryptoCurrencyById("sui"),
350
+ appQuery: {
351
+ model: getSpeculosModel(),
352
+ appName: "Sui",
353
+ },
354
+ dependency: "",
355
+ },
347
356
  };
348
357
 
349
358
  export async function startSpeculos(
@@ -632,6 +641,10 @@ export async function goToSettings() {
632
641
  await pressBoth();
633
642
  }
634
643
 
644
+ export async function providePublicKey() {
645
+ await pressRightButton();
646
+ }
647
+
635
648
  type DeviceLabelsReturn = {
636
649
  delegateConfirmLabel: string;
637
650
  delegateVerifyLabel: string;
@@ -660,6 +673,10 @@ export function getDeviceLabels(appInfo: AppInfos): DeviceLabelsReturn {
660
673
  }
661
674
 
662
675
  export async function expectValidAddressDevice(account: Account, addressDisplayed: string) {
676
+ if (account.currency === Currency.SUI_USDC) {
677
+ providePublicKey();
678
+ }
679
+
663
680
  const { receiveVerifyLabel, receiveConfirmLabel } = getDeviceLabels(account.currency.speculosApp);
664
681
 
665
682
  await waitFor(receiveVerifyLabel);
@@ -721,6 +738,12 @@ export async function signSendTransaction(tx: Transaction) {
721
738
  case Currency.HBAR:
722
739
  await sendHedera();
723
740
  break;
741
+ case Currency.SUI:
742
+ await sendSui();
743
+ break;
744
+ case Currency.SUI_USDC:
745
+ await sendSui();
746
+ break;
724
747
  default:
725
748
  throw new Error(`Unsupported currency: ${currencyName.ticker}`);
726
749
  }
@@ -140,9 +140,9 @@ const DEFAULT_SWAP_PROVIDERS: Record<string, ProviderConfig & Partial<Additional
140
140
  type: "DEX",
141
141
  needsKYC: false,
142
142
  needsBearerToken: false,
143
- termsOfUseUrl: "https://1inch.io/assets/1inch_network_terms_of_use.pdf",
144
- supportUrl: "https://help.1inch.io/en/",
145
- mainUrl: "https://1inch.io/",
143
+ termsOfUseUrl: "https://1inch.com/assets/Widget_1inch.com_Terms_of_Use.pdf",
144
+ supportUrl: "https://help.1inch.com/en/",
145
+ mainUrl: "https://1inch.com/",
146
146
  },
147
147
  paraswap: {
148
148
  type: "DEX",
@@ -232,7 +232,7 @@ export const dexProvidersContractAddress: { [key: string]: string } = {
232
232
 
233
233
  export const termsOfUse: { [key: string]: string } = {
234
234
  paraswap: "https://paraswap.io/tos",
235
- "1inch": "https://1inch.io/assets/1inch_network_terms_of_use.pdf",
235
+ "1inch": "https://1inch.com/assets/Widget_1inch.com_Terms_of_Use.pdf",
236
236
  Uniswap: "https://uniswap.org/terms-of-service",
237
237
  };
238
238
 
@@ -58,8 +58,7 @@ export const fetchRatesMock = (
58
58
  {
59
59
  provider: "oneinch",
60
60
  providerType: "DEX",
61
- providerURL:
62
- "https://app.1inch.io/#/1/unified/swap/usdt/eth?ledgerLive=true&sourceTokenAmount=100",
61
+ providerURL: "https://1inch.com/swap/#/1/unified/swap/usdt/eth&sourceTokenAmount=100",
63
62
  from: "ethereum/erc20/usd_tether__erc20_",
64
63
  to: "ethereum",
65
64
  amountFrom: "100",
@@ -103,7 +103,7 @@ export const mockGetExchangeRates = async (
103
103
  providerType: "DEX",
104
104
  expirationDate: new Date(),
105
105
  tradeMethod: "float",
106
- providerURL: `https://app.1inch.io/#/1/unified/swap/eth/usdt?ledgerLive=true&sourceTokenAmount=${transaction.amount}`,
106
+ providerURL: `https://1inch.com/swap/#/1/unified/swap/eth/usdt&sourceTokenAmount=${transaction.amount}`,
107
107
  },
108
108
  ];
109
109
  };
@@ -439,6 +439,11 @@ export const DEFAULT_FEATURES: Features = {
439
439
  },
440
440
  },
441
441
 
442
+ ptxEarnDrawerApy: {
443
+ enabled: false,
444
+ params: {},
445
+ },
446
+
442
447
  ptxSwapLiveAppMobile: {
443
448
  enabled: false,
444
449
  params: {
@@ -0,0 +1,105 @@
1
+ /**
2
+ * @jest-environment jsdom
3
+ */
4
+ import { renderHook, waitFor } from "@testing-library/react";
5
+ import { useManifestWithSessionId } from "./useManifestWithSessionId";
6
+ import { LiveAppManifest } from "../platform/types";
7
+
8
+ const mockFetch = jest.fn();
9
+ // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
10
+ global.fetch = mockFetch as any;
11
+
12
+ // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
13
+ const baseManifest = {
14
+ id: "test-app",
15
+ name: "Test App",
16
+ url: "https://example.com",
17
+ } as LiveAppManifest;
18
+
19
+ describe("useManifestWithSessionId", () => {
20
+ beforeEach(() => {
21
+ jest.clearAllMocks();
22
+ });
23
+
24
+ it("returns null manifest during loading", async () => {
25
+ mockFetch.mockResolvedValueOnce({
26
+ ok: true,
27
+ json: async () => ({ providerSessionId: "abc123" }),
28
+ });
29
+
30
+ const { result } = renderHook(() =>
31
+ useManifestWithSessionId({ manifest: baseManifest, shareAnalytics: true }),
32
+ );
33
+
34
+ expect(result.current.loading).toBe(true);
35
+ expect(result.current.manifest).toBeNull();
36
+ });
37
+
38
+ it("returns manifest with externalID after success", async () => {
39
+ mockFetch.mockResolvedValueOnce({
40
+ ok: true,
41
+ json: async () => ({ providerSessionId: "abc123" }),
42
+ });
43
+
44
+ const { result } = renderHook(() =>
45
+ useManifestWithSessionId({ manifest: baseManifest, shareAnalytics: true }),
46
+ );
47
+
48
+ await waitFor(() =>
49
+ expect(result.current.manifest).toEqual({
50
+ ...baseManifest,
51
+ url: "https://example.com/?externalID=abc123",
52
+ }),
53
+ );
54
+
55
+ expect(result.current.loading).toBe(false);
56
+ });
57
+
58
+ it("falls back to original manifest if fetch rejects", async () => {
59
+ mockFetch.mockRejectedValueOnce(new Error("network error"));
60
+
61
+ const { result } = renderHook(() =>
62
+ useManifestWithSessionId({ manifest: baseManifest, shareAnalytics: true }),
63
+ );
64
+
65
+ await waitFor(() => {
66
+ expect(result.current.manifest).toEqual(baseManifest);
67
+ });
68
+
69
+ expect(result.current.loading).toBe(false);
70
+ });
71
+
72
+ it("falls back to original manifest if response is not ok", async () => {
73
+ mockFetch.mockResolvedValueOnce({ ok: false });
74
+
75
+ const { result } = renderHook(() =>
76
+ useManifestWithSessionId({ manifest: baseManifest, shareAnalytics: true }),
77
+ );
78
+
79
+ await waitFor(() => {
80
+ expect(result.current.manifest).toEqual(baseManifest);
81
+ });
82
+
83
+ expect(result.current.loading).toBe(false);
84
+ });
85
+
86
+ it("returns null if manifest is not provided", async () => {
87
+ const { result } = renderHook(() =>
88
+ useManifestWithSessionId({ manifest: null, shareAnalytics: true }),
89
+ );
90
+
91
+ expect(mockFetch).not.toHaveBeenCalled();
92
+ expect(result.current.manifest).toBeNull();
93
+ expect(result.current.loading).toBe(false);
94
+ });
95
+
96
+ it("skips fetch if shareAnalytics is false and just returns manifest", () => {
97
+ const { result } = renderHook(() =>
98
+ useManifestWithSessionId({ manifest: baseManifest, shareAnalytics: false }),
99
+ );
100
+
101
+ expect(mockFetch).not.toHaveBeenCalled();
102
+ expect(result.current.manifest).toEqual(baseManifest);
103
+ expect(result.current.loading).toBe(false);
104
+ });
105
+ });
@@ -0,0 +1,83 @@
1
+ import React from "react";
2
+ import { appendQueryParamsToManifestURL } from "../wallet-api/utils/appendQueryParamsToManifestURL";
3
+ import { LiveAppManifest } from "../platform/types";
4
+ import { getEnv } from "@ledgerhq/live-env";
5
+
6
+ type Options = {
7
+ manifest: LiveAppManifest | null | undefined;
8
+ shareAnalytics: boolean;
9
+ };
10
+
11
+ type HookResult = {
12
+ manifest?: LiveAppManifest | null;
13
+ loading: boolean;
14
+ };
15
+
16
+ export function useManifestWithSessionId({ manifest, shareAnalytics }: Options): HookResult {
17
+ const [id, setId] = React.useState<string | null>(null);
18
+ const [loading, setLoading] = React.useState<boolean>(false);
19
+
20
+ React.useEffect(() => {
21
+ let cancelled = false;
22
+
23
+ async function fetchId() {
24
+ if (!shareAnalytics || !manifest) {
25
+ setId(null);
26
+ setLoading(false);
27
+ return;
28
+ }
29
+
30
+ setLoading(true);
31
+
32
+ try {
33
+ const response = await fetch(getEnv("PROVIDER_SESSION_ID_ENDPOINT"), {
34
+ method: "GET",
35
+ headers: {
36
+ Accept: "application/json",
37
+ "Content-Type": "application/json",
38
+ },
39
+ });
40
+
41
+ if (!response.ok) throw new Error("Failed to fetch session ID");
42
+
43
+ const { providerSessionId } = await response.json();
44
+
45
+ if (!cancelled) {
46
+ setId(providerSessionId);
47
+ setLoading(false);
48
+ }
49
+ } catch {
50
+ if (!cancelled) {
51
+ setId(null);
52
+ setLoading(false);
53
+ }
54
+ }
55
+ }
56
+
57
+ fetchId();
58
+
59
+ return () => {
60
+ cancelled = true; // avoid setting state after unmount
61
+ };
62
+ }, [shareAnalytics]);
63
+
64
+ const customizedManifest = React.useMemo(() => {
65
+ if (!manifest) return null;
66
+
67
+ if (loading) {
68
+ return null;
69
+ }
70
+
71
+ if (id) {
72
+ const url = appendQueryParamsToManifestURL(manifest, {
73
+ externalID: id,
74
+ });
75
+
76
+ return url ? { ...manifest, url: url.toString() } : manifest;
77
+ }
78
+
79
+ return manifest;
80
+ }, [manifest, id, loading]);
81
+
82
+ return { manifest: customizedManifest, loading };
83
+ }
@@ -1,6 +1,9 @@
1
1
  import { PortfolioRange } from "@ledgerhq/types-live";
2
2
  import { Order } from "./types";
3
3
 
4
+ // Export all types from types.ts
5
+ export * from "./types";
6
+
4
7
  export function getRange(range: PortfolioRange | string) {
5
8
  switch (range) {
6
9
  case "day":