@ledgerhq/live-common 34.50.0 → 34.51.0-nightly.1

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 (710) hide show
  1. package/lib/__tests__/test-helpers/bridge.js +1 -1
  2. package/lib/__tests__/test-helpers/bridge.js.map +1 -1
  3. package/lib/__tests__/test-helpers/environment.js +1 -1
  4. package/lib/__tests__/test-helpers/environment.js.map +1 -1
  5. package/lib/bridge/generic-alpaca/alpaca/index.d.ts.map +1 -1
  6. package/lib/bridge/generic-alpaca/alpaca/index.js +3 -0
  7. package/lib/bridge/generic-alpaca/alpaca/index.js.map +1 -1
  8. package/lib/bridge/generic-alpaca/buildSubAccounts.d.ts +4 -4
  9. package/lib/bridge/generic-alpaca/buildSubAccounts.d.ts.map +1 -1
  10. package/lib/bridge/generic-alpaca/buildSubAccounts.js +7 -9
  11. package/lib/bridge/generic-alpaca/buildSubAccounts.js.map +1 -1
  12. package/lib/bridge/generic-alpaca/createTransaction.d.ts.map +1 -1
  13. package/lib/bridge/generic-alpaca/createTransaction.js +11 -0
  14. package/lib/bridge/generic-alpaca/createTransaction.js.map +1 -1
  15. package/lib/bridge/generic-alpaca/getAccountShape.d.ts.map +1 -1
  16. package/lib/bridge/generic-alpaca/getAccountShape.js +15 -9
  17. package/lib/bridge/generic-alpaca/getAccountShape.js.map +1 -1
  18. package/lib/bridge/generic-alpaca/getTransactionStatus.js +1 -1
  19. package/lib/bridge/generic-alpaca/getTransactionStatus.js.map +1 -1
  20. package/lib/bridge/generic-alpaca/prepareTransaction.d.ts.map +1 -1
  21. package/lib/bridge/generic-alpaca/prepareTransaction.js +29 -4
  22. package/lib/bridge/generic-alpaca/prepareTransaction.js.map +1 -1
  23. package/lib/bridge/generic-alpaca/signer/index.d.ts.map +1 -1
  24. package/lib/bridge/generic-alpaca/signer/index.js +37 -0
  25. package/lib/bridge/generic-alpaca/signer/index.js.map +1 -1
  26. package/lib/bridge/generic-alpaca/signer/signTransaction.d.ts +2 -0
  27. package/lib/bridge/generic-alpaca/signer/signTransaction.d.ts.map +1 -1
  28. package/lib/bridge/generic-alpaca/signer/signTransaction.js +8 -1
  29. package/lib/bridge/generic-alpaca/signer/signTransaction.js.map +1 -1
  30. package/lib/bridge/generic-alpaca/tests/estimateMaxSpendable.test.js +15 -1
  31. package/lib/bridge/generic-alpaca/tests/estimateMaxSpendable.test.js.map +1 -1
  32. package/lib/bridge/generic-alpaca/tests/getAccountShape.test.js +5 -3
  33. package/lib/bridge/generic-alpaca/tests/getAccountShape.test.js.map +1 -1
  34. package/lib/bridge/generic-alpaca/tests/prepareTransaction.test.js +60 -0
  35. package/lib/bridge/generic-alpaca/tests/prepareTransaction.test.js.map +1 -1
  36. package/lib/bridge/generic-alpaca/tests/signOperation.test.js +1 -1
  37. package/lib/bridge/generic-alpaca/tests/signOperation.test.js.map +1 -1
  38. package/lib/bridge/generic-alpaca/types.d.ts +1 -2
  39. package/lib/bridge/generic-alpaca/types.d.ts.map +1 -1
  40. package/lib/bridge/generic-alpaca/utils.d.ts +2 -2
  41. package/lib/bridge/generic-alpaca/utils.d.ts.map +1 -1
  42. package/lib/bridge/generic-alpaca/utils.js +23 -4
  43. package/lib/bridge/generic-alpaca/utils.js.map +1 -1
  44. package/lib/bridge/impl.d.ts.map +1 -1
  45. package/lib/bridge/impl.js +1 -0
  46. package/lib/bridge/impl.js.map +1 -1
  47. package/lib/dada-client/entities/index.d.ts.map +1 -0
  48. package/lib/dada-client/entities/index.js.map +1 -0
  49. package/lib/{modularDrawer/data → dada-client}/entities/interestRateSelectors.d.ts +1 -1
  50. package/lib/dada-client/entities/interestRateSelectors.d.ts.map +1 -0
  51. package/lib/dada-client/entities/interestRateSelectors.js.map +1 -0
  52. package/lib/{modularDrawer/data → dada-client}/entities/marketSelectors.d.ts +1 -1
  53. package/lib/dada-client/entities/marketSelectors.d.ts.map +1 -0
  54. package/lib/dada-client/entities/marketSelectors.js.map +1 -0
  55. package/lib/dada-client/entities/selectorUtils.d.ts.map +1 -0
  56. package/lib/dada-client/entities/selectorUtils.js.map +1 -0
  57. package/lib/dada-client/hooks/__tests__/useAssetsData.test.d.ts.map +1 -0
  58. package/lib/{modularDrawer/hooks/__test__ → dada-client/hooks/__tests__}/useAssetsData.test.js +2 -2
  59. package/lib/dada-client/hooks/__tests__/useAssetsData.test.js.map +1 -0
  60. package/lib/dada-client/hooks/useAssetData.d.ts +10 -0
  61. package/lib/dada-client/hooks/useAssetData.d.ts.map +1 -0
  62. package/lib/dada-client/hooks/useAssetData.js +23 -0
  63. package/lib/dada-client/hooks/useAssetData.js.map +1 -0
  64. package/lib/dada-client/hooks/useAssetsData.d.ts +19 -0
  65. package/lib/dada-client/hooks/useAssetsData.d.ts.map +1 -0
  66. package/lib/{modularDrawer → dada-client}/hooks/useAssetsData.js +1 -1
  67. package/lib/dada-client/hooks/useAssetsData.js.map +1 -0
  68. package/lib/dada-client/hooks/useInterestRatesByCurrencies.d.ts.map +1 -0
  69. package/lib/{modularDrawer → dada-client}/hooks/useInterestRatesByCurrencies.js +3 -3
  70. package/lib/dada-client/hooks/useInterestRatesByCurrencies.js.map +1 -0
  71. package/lib/dada-client/hooks/useMarketByCurrencies.d.ts.map +1 -0
  72. package/lib/{modularDrawer → dada-client}/hooks/useMarketByCurrencies.js +5 -6
  73. package/lib/dada-client/hooks/useMarketByCurrencies.js.map +1 -0
  74. package/lib/{modularDrawer/data → dada-client}/state-manager/api.d.ts +134 -1
  75. package/lib/{modularDrawer/data → dada-client}/state-manager/api.d.ts.map +1 -1
  76. package/lib/{modularDrawer/data → dada-client}/state-manager/api.js +21 -2
  77. package/lib/dada-client/state-manager/api.js.map +1 -0
  78. package/lib/dada-client/state-manager/types.d.ts.map +1 -0
  79. package/lib/dada-client/state-manager/types.js.map +1 -0
  80. package/lib/dada-client/types/trend.d.ts +2 -0
  81. package/lib/dada-client/types/trend.d.ts.map +1 -0
  82. package/lib/dada-client/types/trend.js +3 -0
  83. package/lib/dada-client/types/trend.js.map +1 -0
  84. package/lib/deposit/useGroupedCurrenciesByProvider.hook.d.ts.map +1 -1
  85. package/lib/deposit/useGroupedCurrenciesByProvider.hook.js +6 -1
  86. package/lib/deposit/useGroupedCurrenciesByProvider.hook.js.map +1 -1
  87. package/lib/e2e/enum/Account.d.ts +2 -0
  88. package/lib/e2e/enum/Account.d.ts.map +1 -1
  89. package/lib/e2e/enum/Account.js +4 -0
  90. package/lib/e2e/enum/Account.js.map +1 -1
  91. package/lib/e2e/enum/AppInfos.d.ts +1 -0
  92. package/lib/e2e/enum/AppInfos.d.ts.map +1 -1
  93. package/lib/e2e/enum/AppInfos.js +1 -0
  94. package/lib/e2e/enum/AppInfos.js.map +1 -1
  95. package/lib/e2e/enum/Currency.d.ts +2 -0
  96. package/lib/e2e/enum/Currency.d.ts.map +1 -1
  97. package/lib/e2e/enum/Currency.js +4 -0
  98. package/lib/e2e/enum/Currency.js.map +1 -1
  99. package/lib/e2e/enum/Network.d.ts +2 -1
  100. package/lib/e2e/enum/Network.d.ts.map +1 -1
  101. package/lib/e2e/enum/Network.js +1 -0
  102. package/lib/e2e/enum/Network.js.map +1 -1
  103. package/lib/e2e/enum/Provider.d.ts +1 -0
  104. package/lib/e2e/enum/Provider.d.ts.map +1 -1
  105. package/lib/e2e/enum/Provider.js +1 -0
  106. package/lib/e2e/enum/Provider.js.map +1 -1
  107. package/lib/e2e/families/hedera.d.ts +2 -0
  108. package/lib/e2e/families/hedera.d.ts.map +1 -0
  109. package/lib/e2e/families/hedera.js +11 -0
  110. package/lib/e2e/families/hedera.js.map +1 -0
  111. package/lib/e2e/speculos.d.ts.map +1 -1
  112. package/lib/e2e/speculos.js +12 -0
  113. package/lib/e2e/speculos.js.map +1 -1
  114. package/lib/e2e/swap.d.ts +1 -1
  115. package/lib/e2e/swap.d.ts.map +1 -1
  116. package/lib/e2e/swap.js +6 -5
  117. package/lib/e2e/swap.js.map +1 -1
  118. package/lib/exchange/platform/types.d.ts +2 -0
  119. package/lib/exchange/platform/types.d.ts.map +1 -1
  120. package/lib/exchange/swap/completeExchange.d.ts.map +1 -1
  121. package/lib/exchange/swap/completeExchange.js +22 -1
  122. package/lib/exchange/swap/completeExchange.js.map +1 -1
  123. package/lib/exchange/swap/getIncompatibleCurrencyKeys.d.ts.map +1 -1
  124. package/lib/exchange/swap/getIncompatibleCurrencyKeys.js +8 -0
  125. package/lib/exchange/swap/getIncompatibleCurrencyKeys.js.map +1 -1
  126. package/lib/exchange/swap/postSwapState.d.ts.map +1 -1
  127. package/lib/exchange/swap/postSwapState.js +19 -23
  128. package/lib/exchange/swap/postSwapState.js.map +1 -1
  129. package/lib/exchange/swap/setBroadcastTransaction.d.ts +4 -4
  130. package/lib/exchange/swap/setBroadcastTransaction.js +7 -7
  131. package/lib/exchange/swap/setBroadcastTransaction.js.map +1 -1
  132. package/lib/exchange/swap/types.d.ts +3 -3
  133. package/lib/exchange/swap/types.d.ts.map +1 -1
  134. package/lib/exchange/swap/updateAccountSwapStatus.d.ts.map +1 -1
  135. package/lib/exchange/swap/updateAccountSwapStatus.js +6 -4
  136. package/lib/exchange/swap/updateAccountSwapStatus.js.map +1 -1
  137. package/lib/families/canton/config.js +10 -10
  138. package/lib/families/canton/config.js.map +1 -1
  139. package/lib/families/evm/shouldUseReceiveOptions.d.ts +3 -0
  140. package/lib/families/evm/shouldUseReceiveOptions.d.ts.map +1 -0
  141. package/lib/families/evm/shouldUseReceiveOptions.js +5 -0
  142. package/lib/families/evm/shouldUseReceiveOptions.js.map +1 -0
  143. package/lib/families/evm/shouldUseReceiveOptions.test.d.ts +2 -0
  144. package/lib/families/evm/shouldUseReceiveOptions.test.d.ts.map +1 -0
  145. package/lib/families/evm/shouldUseReceiveOptions.test.js +26 -0
  146. package/lib/families/evm/shouldUseReceiveOptions.test.js.map +1 -0
  147. package/lib/families/hedera/exchange.d.ts +9 -0
  148. package/lib/families/hedera/exchange.d.ts.map +1 -0
  149. package/lib/families/hedera/exchange.js +36 -0
  150. package/lib/families/hedera/exchange.js.map +1 -0
  151. package/lib/families/tezos/config.js +2 -2
  152. package/lib/families/tezos/react.d.ts +2 -1
  153. package/lib/families/tezos/react.d.ts.map +1 -1
  154. package/lib/families/tezos/react.js +19 -1
  155. package/lib/families/tezos/react.js.map +1 -1
  156. package/lib/families/tezos/setup.d.ts +1 -4
  157. package/lib/families/tezos/setup.d.ts.map +1 -1
  158. package/lib/families/tezos/setup.js +3 -11
  159. package/lib/families/tezos/setup.js.map +1 -1
  160. package/lib/generated/bridge/js.d.ts +0 -1
  161. package/lib/generated/bridge/js.d.ts.map +1 -1
  162. package/lib/generated/bridge/js.js +10 -12
  163. package/lib/generated/bridge/js.js.map +1 -1
  164. package/lib/hw/actions/completeExchange.d.ts +2 -0
  165. package/lib/hw/actions/completeExchange.d.ts.map +1 -1
  166. package/lib/hw/actions/completeExchange.js +1 -0
  167. package/lib/hw/actions/completeExchange.js.map +1 -1
  168. package/lib/hw/signMessage/index.d.ts.map +1 -1
  169. package/lib/hw/signMessage/index.js +7 -0
  170. package/lib/hw/signMessage/index.js.map +1 -1
  171. package/lib/modularDrawer/hooks/modules/useLeftApyModule.d.ts +1 -1
  172. package/lib/modularDrawer/hooks/modules/useLeftApyModule.d.ts.map +1 -1
  173. package/lib/modularDrawer/hooks/modules/useLeftApyModule.js +1 -1
  174. package/lib/modularDrawer/hooks/modules/useLeftApyModule.js.map +1 -1
  175. package/lib/modularDrawer/hooks/modules/useLeftMarketTrendModule.js +1 -1
  176. package/lib/modularDrawer/hooks/modules/useLeftMarketTrendModule.js.map +1 -1
  177. package/lib/modularDrawer/hooks/modules/useRightMarketTrendModule.js +6 -3
  178. package/lib/modularDrawer/hooks/modules/useRightMarketTrendModule.js.map +1 -1
  179. package/lib/modularDrawer/hooks/useAssetAccountCounts.d.ts.map +1 -1
  180. package/lib/modularDrawer/hooks/useAssetAccountCounts.js +2 -4
  181. package/lib/modularDrawer/hooks/useAssetAccountCounts.js.map +1 -1
  182. package/lib/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.d.ts +7 -0
  183. package/lib/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.d.ts.map +1 -0
  184. package/lib/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.js +224 -0
  185. package/lib/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.js.map +1 -0
  186. package/lib/modularDrawer/hooks/useLeftAccountsApy.js +1 -1
  187. package/lib/modularDrawer/hooks/useLeftAccountsApy.js.map +1 -1
  188. package/lib/modularDrawer/hooks/useRightBalanceAsset.d.ts +8 -10
  189. package/lib/modularDrawer/hooks/useRightBalanceAsset.d.ts.map +1 -1
  190. package/lib/modularDrawer/hooks/useRightBalanceAsset.js +21 -64
  191. package/lib/modularDrawer/hooks/useRightBalanceAsset.js.map +1 -1
  192. package/lib/modularDrawer/hooks/useRightBalanceNetwork.d.ts +7 -28
  193. package/lib/modularDrawer/hooks/useRightBalanceNetwork.d.ts.map +1 -1
  194. package/lib/modularDrawer/hooks/useRightBalanceNetwork.js +12 -56
  195. package/lib/modularDrawer/hooks/useRightBalanceNetwork.js.map +1 -1
  196. package/lib/modularDrawer/modules/createAssetConfiguration.d.ts.map +1 -1
  197. package/lib/modularDrawer/modules/createAssetConfiguration.js +2 -2
  198. package/lib/modularDrawer/modules/createAssetConfiguration.js.map +1 -1
  199. package/lib/modularDrawer/modules/createNetworkConfiguration.d.ts +1 -1
  200. package/lib/modularDrawer/modules/createNetworkConfiguration.d.ts.map +1 -1
  201. package/lib/modularDrawer/modules/createNetworkConfiguration.js +15 -4
  202. package/lib/modularDrawer/modules/createNetworkConfiguration.js.map +1 -1
  203. package/lib/modularDrawer/utils/__tests__/calculateProviderTotal.test.d.ts +2 -0
  204. package/lib/modularDrawer/utils/__tests__/calculateProviderTotal.test.d.ts.map +1 -0
  205. package/lib/modularDrawer/utils/__tests__/calculateProviderTotal.test.js +212 -0
  206. package/lib/modularDrawer/utils/__tests__/calculateProviderTotal.test.js.map +1 -0
  207. package/lib/modularDrawer/utils/__tests__/groupAccountsByAsset.test.d.ts +2 -0
  208. package/lib/modularDrawer/utils/__tests__/groupAccountsByAsset.test.d.ts.map +1 -0
  209. package/lib/modularDrawer/utils/__tests__/groupAccountsByAsset.test.js +202 -0
  210. package/lib/modularDrawer/utils/__tests__/groupAccountsByAsset.test.js.map +1 -0
  211. package/lib/modularDrawer/utils/calculateProviderTotal.d.ts +1 -0
  212. package/lib/modularDrawer/utils/calculateProviderTotal.d.ts.map +1 -1
  213. package/lib/modularDrawer/utils/calculateProviderTotal.js +10 -2
  214. package/lib/modularDrawer/utils/calculateProviderTotal.js.map +1 -1
  215. package/lib/modularDrawer/utils/currencyUtils.d.ts.map +1 -1
  216. package/lib/modularDrawer/utils/currencyUtils.js.map +1 -1
  217. package/lib/modularDrawer/utils/getBalanceAndFiatValueByAssets.d.ts +6 -4
  218. package/lib/modularDrawer/utils/getBalanceAndFiatValueByAssets.d.ts.map +1 -1
  219. package/lib/modularDrawer/utils/getBalanceAndFiatValueByAssets.js +9 -22
  220. package/lib/modularDrawer/utils/getBalanceAndFiatValueByAssets.js.map +1 -1
  221. package/lib/modularDrawer/utils/getInterestRateForAsset.d.ts +1 -1
  222. package/lib/modularDrawer/utils/getInterestRateForAsset.d.ts.map +1 -1
  223. package/lib/modularDrawer/utils/groupAccountsByAsset.d.ts +4 -3
  224. package/lib/modularDrawer/utils/groupAccountsByAsset.d.ts.map +1 -1
  225. package/lib/modularDrawer/utils/groupAccountsByAsset.js +27 -11
  226. package/lib/modularDrawer/utils/groupAccountsByAsset.js.map +1 -1
  227. package/lib/modularDrawer/utils/index.d.ts +2 -6
  228. package/lib/modularDrawer/utils/index.d.ts.map +1 -1
  229. package/lib/modularDrawer/utils/index.js +2 -13
  230. package/lib/modularDrawer/utils/index.js.map +1 -1
  231. package/lib/modularDrawer/utils/index.test.js +0 -26
  232. package/lib/modularDrawer/utils/index.test.js.map +1 -1
  233. package/lib/modularDrawer/utils/sortByBalance.d.ts +1 -3
  234. package/lib/modularDrawer/utils/sortByBalance.d.ts.map +1 -1
  235. package/lib/modularDrawer/utils/sortByBalance.js +6 -18
  236. package/lib/modularDrawer/utils/sortByBalance.js.map +1 -1
  237. package/lib/modularDrawer/utils/type.d.ts +15 -17
  238. package/lib/modularDrawer/utils/type.d.ts.map +1 -1
  239. package/lib/wallet-api/CustomDeeplink/server.d.ts +16 -0
  240. package/lib/wallet-api/CustomDeeplink/server.d.ts.map +1 -0
  241. package/lib/wallet-api/CustomDeeplink/server.js +10 -0
  242. package/lib/wallet-api/CustomDeeplink/server.js.map +1 -0
  243. package/lib/wallet-api/Exchange/server.js +6 -6
  244. package/lib/wallet-api/Exchange/server.js.map +1 -1
  245. package/lib/wallet-api/constants.d.ts +1 -1
  246. package/lib/wallet-api/constants.d.ts.map +1 -1
  247. package/lib-es/__tests__/test-helpers/bridge.js +1 -1
  248. package/lib-es/__tests__/test-helpers/bridge.js.map +1 -1
  249. package/lib-es/__tests__/test-helpers/environment.js +1 -1
  250. package/lib-es/__tests__/test-helpers/environment.js.map +1 -1
  251. package/lib-es/bridge/generic-alpaca/alpaca/index.d.ts.map +1 -1
  252. package/lib-es/bridge/generic-alpaca/alpaca/index.js +3 -0
  253. package/lib-es/bridge/generic-alpaca/alpaca/index.js.map +1 -1
  254. package/lib-es/bridge/generic-alpaca/buildSubAccounts.d.ts +4 -4
  255. package/lib-es/bridge/generic-alpaca/buildSubAccounts.d.ts.map +1 -1
  256. package/lib-es/bridge/generic-alpaca/buildSubAccounts.js +7 -9
  257. package/lib-es/bridge/generic-alpaca/buildSubAccounts.js.map +1 -1
  258. package/lib-es/bridge/generic-alpaca/createTransaction.d.ts.map +1 -1
  259. package/lib-es/bridge/generic-alpaca/createTransaction.js +11 -0
  260. package/lib-es/bridge/generic-alpaca/createTransaction.js.map +1 -1
  261. package/lib-es/bridge/generic-alpaca/getAccountShape.d.ts.map +1 -1
  262. package/lib-es/bridge/generic-alpaca/getAccountShape.js +15 -9
  263. package/lib-es/bridge/generic-alpaca/getAccountShape.js.map +1 -1
  264. package/lib-es/bridge/generic-alpaca/getTransactionStatus.js +1 -1
  265. package/lib-es/bridge/generic-alpaca/getTransactionStatus.js.map +1 -1
  266. package/lib-es/bridge/generic-alpaca/prepareTransaction.d.ts.map +1 -1
  267. package/lib-es/bridge/generic-alpaca/prepareTransaction.js +29 -4
  268. package/lib-es/bridge/generic-alpaca/prepareTransaction.js.map +1 -1
  269. package/lib-es/bridge/generic-alpaca/signer/index.d.ts.map +1 -1
  270. package/lib-es/bridge/generic-alpaca/signer/index.js +38 -1
  271. package/lib-es/bridge/generic-alpaca/signer/index.js.map +1 -1
  272. package/lib-es/bridge/generic-alpaca/signer/signTransaction.d.ts +2 -0
  273. package/lib-es/bridge/generic-alpaca/signer/signTransaction.d.ts.map +1 -1
  274. package/lib-es/bridge/generic-alpaca/signer/signTransaction.js +6 -0
  275. package/lib-es/bridge/generic-alpaca/signer/signTransaction.js.map +1 -1
  276. package/lib-es/bridge/generic-alpaca/tests/estimateMaxSpendable.test.js +15 -1
  277. package/lib-es/bridge/generic-alpaca/tests/estimateMaxSpendable.test.js.map +1 -1
  278. package/lib-es/bridge/generic-alpaca/tests/getAccountShape.test.js +5 -3
  279. package/lib-es/bridge/generic-alpaca/tests/getAccountShape.test.js.map +1 -1
  280. package/lib-es/bridge/generic-alpaca/tests/prepareTransaction.test.js +60 -0
  281. package/lib-es/bridge/generic-alpaca/tests/prepareTransaction.test.js.map +1 -1
  282. package/lib-es/bridge/generic-alpaca/tests/signOperation.test.js +1 -1
  283. package/lib-es/bridge/generic-alpaca/tests/signOperation.test.js.map +1 -1
  284. package/lib-es/bridge/generic-alpaca/types.d.ts +1 -2
  285. package/lib-es/bridge/generic-alpaca/types.d.ts.map +1 -1
  286. package/lib-es/bridge/generic-alpaca/utils.d.ts +2 -2
  287. package/lib-es/bridge/generic-alpaca/utils.d.ts.map +1 -1
  288. package/lib-es/bridge/generic-alpaca/utils.js +23 -4
  289. package/lib-es/bridge/generic-alpaca/utils.js.map +1 -1
  290. package/lib-es/bridge/impl.d.ts.map +1 -1
  291. package/lib-es/bridge/impl.js +1 -0
  292. package/lib-es/bridge/impl.js.map +1 -1
  293. package/lib-es/dada-client/entities/index.d.ts.map +1 -0
  294. package/lib-es/dada-client/entities/index.js.map +1 -0
  295. package/lib-es/{modularDrawer/data → dada-client}/entities/interestRateSelectors.d.ts +1 -1
  296. package/lib-es/dada-client/entities/interestRateSelectors.d.ts.map +1 -0
  297. package/lib-es/dada-client/entities/interestRateSelectors.js.map +1 -0
  298. package/lib-es/{modularDrawer/data → dada-client}/entities/marketSelectors.d.ts +1 -1
  299. package/lib-es/dada-client/entities/marketSelectors.d.ts.map +1 -0
  300. package/lib-es/dada-client/entities/marketSelectors.js.map +1 -0
  301. package/lib-es/dada-client/entities/selectorUtils.d.ts.map +1 -0
  302. package/lib-es/dada-client/entities/selectorUtils.js.map +1 -0
  303. package/lib-es/dada-client/hooks/__tests__/useAssetsData.test.d.ts.map +1 -0
  304. package/lib-es/{modularDrawer/hooks/__test__ → dada-client/hooks/__tests__}/useAssetsData.test.js +2 -2
  305. package/lib-es/dada-client/hooks/__tests__/useAssetsData.test.js.map +1 -0
  306. package/lib-es/dada-client/hooks/useAssetData.d.ts +10 -0
  307. package/lib-es/dada-client/hooks/useAssetData.d.ts.map +1 -0
  308. package/lib-es/dada-client/hooks/useAssetData.js +19 -0
  309. package/lib-es/dada-client/hooks/useAssetData.js.map +1 -0
  310. package/lib-es/dada-client/hooks/useAssetsData.d.ts +19 -0
  311. package/lib-es/dada-client/hooks/useAssetsData.d.ts.map +1 -0
  312. package/lib-es/{modularDrawer → dada-client}/hooks/useAssetsData.js +1 -1
  313. package/lib-es/dada-client/hooks/useAssetsData.js.map +1 -0
  314. package/lib-es/dada-client/hooks/useInterestRatesByCurrencies.d.ts.map +1 -0
  315. package/lib-es/{modularDrawer → dada-client}/hooks/useInterestRatesByCurrencies.js +3 -3
  316. package/lib-es/dada-client/hooks/useInterestRatesByCurrencies.js.map +1 -0
  317. package/lib-es/dada-client/hooks/useMarketByCurrencies.d.ts.map +1 -0
  318. package/lib-es/{modularDrawer → dada-client}/hooks/useMarketByCurrencies.js +5 -6
  319. package/lib-es/dada-client/hooks/useMarketByCurrencies.js.map +1 -0
  320. package/lib-es/{modularDrawer/data → dada-client}/state-manager/api.d.ts +134 -1
  321. package/lib-es/{modularDrawer/data → dada-client}/state-manager/api.d.ts.map +1 -1
  322. package/lib-es/{modularDrawer/data → dada-client}/state-manager/api.js +20 -1
  323. package/lib-es/dada-client/state-manager/api.js.map +1 -0
  324. package/lib-es/dada-client/state-manager/types.d.ts.map +1 -0
  325. package/lib-es/dada-client/state-manager/types.js.map +1 -0
  326. package/lib-es/dada-client/types/trend.d.ts +2 -0
  327. package/lib-es/dada-client/types/trend.d.ts.map +1 -0
  328. package/lib-es/dada-client/types/trend.js +2 -0
  329. package/lib-es/dada-client/types/trend.js.map +1 -0
  330. package/lib-es/deposit/useGroupedCurrenciesByProvider.hook.d.ts.map +1 -1
  331. package/lib-es/deposit/useGroupedCurrenciesByProvider.hook.js +6 -1
  332. package/lib-es/deposit/useGroupedCurrenciesByProvider.hook.js.map +1 -1
  333. package/lib-es/e2e/enum/Account.d.ts +2 -0
  334. package/lib-es/e2e/enum/Account.d.ts.map +1 -1
  335. package/lib-es/e2e/enum/Account.js +4 -0
  336. package/lib-es/e2e/enum/Account.js.map +1 -1
  337. package/lib-es/e2e/enum/AppInfos.d.ts +1 -0
  338. package/lib-es/e2e/enum/AppInfos.d.ts.map +1 -1
  339. package/lib-es/e2e/enum/AppInfos.js +1 -0
  340. package/lib-es/e2e/enum/AppInfos.js.map +1 -1
  341. package/lib-es/e2e/enum/Currency.d.ts +2 -0
  342. package/lib-es/e2e/enum/Currency.d.ts.map +1 -1
  343. package/lib-es/e2e/enum/Currency.js +4 -0
  344. package/lib-es/e2e/enum/Currency.js.map +1 -1
  345. package/lib-es/e2e/enum/Network.d.ts +2 -1
  346. package/lib-es/e2e/enum/Network.d.ts.map +1 -1
  347. package/lib-es/e2e/enum/Network.js +1 -0
  348. package/lib-es/e2e/enum/Network.js.map +1 -1
  349. package/lib-es/e2e/enum/Provider.d.ts +1 -0
  350. package/lib-es/e2e/enum/Provider.d.ts.map +1 -1
  351. package/lib-es/e2e/enum/Provider.js +1 -0
  352. package/lib-es/e2e/enum/Provider.js.map +1 -1
  353. package/lib-es/e2e/families/hedera.d.ts +2 -0
  354. package/lib-es/e2e/families/hedera.d.ts.map +1 -0
  355. package/lib-es/e2e/families/hedera.js +7 -0
  356. package/lib-es/e2e/families/hedera.js.map +1 -0
  357. package/lib-es/e2e/speculos.d.ts.map +1 -1
  358. package/lib-es/e2e/speculos.js +12 -0
  359. package/lib-es/e2e/speculos.js.map +1 -1
  360. package/lib-es/e2e/swap.d.ts +1 -1
  361. package/lib-es/e2e/swap.d.ts.map +1 -1
  362. package/lib-es/e2e/swap.js +6 -5
  363. package/lib-es/e2e/swap.js.map +1 -1
  364. package/lib-es/exchange/platform/types.d.ts +2 -0
  365. package/lib-es/exchange/platform/types.d.ts.map +1 -1
  366. package/lib-es/exchange/swap/completeExchange.d.ts.map +1 -1
  367. package/lib-es/exchange/swap/completeExchange.js +22 -1
  368. package/lib-es/exchange/swap/completeExchange.js.map +1 -1
  369. package/lib-es/exchange/swap/getIncompatibleCurrencyKeys.d.ts.map +1 -1
  370. package/lib-es/exchange/swap/getIncompatibleCurrencyKeys.js +8 -0
  371. package/lib-es/exchange/swap/getIncompatibleCurrencyKeys.js.map +1 -1
  372. package/lib-es/exchange/swap/postSwapState.d.ts.map +1 -1
  373. package/lib-es/exchange/swap/postSwapState.js +19 -23
  374. package/lib-es/exchange/swap/postSwapState.js.map +1 -1
  375. package/lib-es/exchange/swap/setBroadcastTransaction.d.ts +4 -4
  376. package/lib-es/exchange/swap/setBroadcastTransaction.js +7 -7
  377. package/lib-es/exchange/swap/setBroadcastTransaction.js.map +1 -1
  378. package/lib-es/exchange/swap/types.d.ts +3 -3
  379. package/lib-es/exchange/swap/types.d.ts.map +1 -1
  380. package/lib-es/exchange/swap/updateAccountSwapStatus.d.ts.map +1 -1
  381. package/lib-es/exchange/swap/updateAccountSwapStatus.js +6 -4
  382. package/lib-es/exchange/swap/updateAccountSwapStatus.js.map +1 -1
  383. package/lib-es/families/canton/config.js +10 -10
  384. package/lib-es/families/canton/config.js.map +1 -1
  385. package/lib-es/families/evm/shouldUseReceiveOptions.d.ts +3 -0
  386. package/lib-es/families/evm/shouldUseReceiveOptions.d.ts.map +1 -0
  387. package/lib-es/families/evm/shouldUseReceiveOptions.js +3 -0
  388. package/lib-es/families/evm/shouldUseReceiveOptions.js.map +1 -0
  389. package/lib-es/families/evm/shouldUseReceiveOptions.test.d.ts +2 -0
  390. package/lib-es/families/evm/shouldUseReceiveOptions.test.d.ts.map +1 -0
  391. package/lib-es/families/evm/shouldUseReceiveOptions.test.js +21 -0
  392. package/lib-es/families/evm/shouldUseReceiveOptions.test.js.map +1 -0
  393. package/lib-es/families/hedera/exchange.d.ts +9 -0
  394. package/lib-es/families/hedera/exchange.d.ts.map +1 -0
  395. package/lib-es/families/hedera/exchange.js +29 -0
  396. package/lib-es/families/hedera/exchange.js.map +1 -0
  397. package/lib-es/families/tezos/config.js +2 -2
  398. package/lib-es/families/tezos/react.d.ts +2 -1
  399. package/lib-es/families/tezos/react.d.ts.map +1 -1
  400. package/lib-es/families/tezos/react.js +17 -0
  401. package/lib-es/families/tezos/react.js.map +1 -1
  402. package/lib-es/families/tezos/setup.d.ts +1 -4
  403. package/lib-es/families/tezos/setup.d.ts.map +1 -1
  404. package/lib-es/families/tezos/setup.js +2 -9
  405. package/lib-es/families/tezos/setup.js.map +1 -1
  406. package/lib-es/generated/bridge/js.d.ts +0 -1
  407. package/lib-es/generated/bridge/js.d.ts.map +1 -1
  408. package/lib-es/generated/bridge/js.js +0 -2
  409. package/lib-es/generated/bridge/js.js.map +1 -1
  410. package/lib-es/hw/actions/completeExchange.d.ts +2 -0
  411. package/lib-es/hw/actions/completeExchange.d.ts.map +1 -1
  412. package/lib-es/hw/actions/completeExchange.js +1 -0
  413. package/lib-es/hw/actions/completeExchange.js.map +1 -1
  414. package/lib-es/hw/signMessage/index.d.ts.map +1 -1
  415. package/lib-es/hw/signMessage/index.js +7 -0
  416. package/lib-es/hw/signMessage/index.js.map +1 -1
  417. package/lib-es/modularDrawer/hooks/modules/useLeftApyModule.d.ts +1 -1
  418. package/lib-es/modularDrawer/hooks/modules/useLeftApyModule.d.ts.map +1 -1
  419. package/lib-es/modularDrawer/hooks/modules/useLeftApyModule.js +1 -1
  420. package/lib-es/modularDrawer/hooks/modules/useLeftApyModule.js.map +1 -1
  421. package/lib-es/modularDrawer/hooks/modules/useLeftMarketTrendModule.js +1 -1
  422. package/lib-es/modularDrawer/hooks/modules/useLeftMarketTrendModule.js.map +1 -1
  423. package/lib-es/modularDrawer/hooks/modules/useRightMarketTrendModule.js +2 -2
  424. package/lib-es/modularDrawer/hooks/modules/useRightMarketTrendModule.js.map +1 -1
  425. package/lib-es/modularDrawer/hooks/useAssetAccountCounts.d.ts.map +1 -1
  426. package/lib-es/modularDrawer/hooks/useAssetAccountCounts.js +2 -4
  427. package/lib-es/modularDrawer/hooks/useAssetAccountCounts.js.map +1 -1
  428. package/lib-es/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.d.ts +7 -0
  429. package/lib-es/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.d.ts.map +1 -0
  430. package/lib-es/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.js +217 -0
  431. package/lib-es/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.js.map +1 -0
  432. package/lib-es/modularDrawer/hooks/useLeftAccountsApy.js +1 -1
  433. package/lib-es/modularDrawer/hooks/useLeftAccountsApy.js.map +1 -1
  434. package/lib-es/modularDrawer/hooks/useRightBalanceAsset.d.ts +8 -10
  435. package/lib-es/modularDrawer/hooks/useRightBalanceAsset.d.ts.map +1 -1
  436. package/lib-es/modularDrawer/hooks/useRightBalanceAsset.js +21 -64
  437. package/lib-es/modularDrawer/hooks/useRightBalanceAsset.js.map +1 -1
  438. package/lib-es/modularDrawer/hooks/useRightBalanceNetwork.d.ts +7 -28
  439. package/lib-es/modularDrawer/hooks/useRightBalanceNetwork.d.ts.map +1 -1
  440. package/lib-es/modularDrawer/hooks/useRightBalanceNetwork.js +12 -56
  441. package/lib-es/modularDrawer/hooks/useRightBalanceNetwork.js.map +1 -1
  442. package/lib-es/modularDrawer/modules/createAssetConfiguration.d.ts.map +1 -1
  443. package/lib-es/modularDrawer/modules/createAssetConfiguration.js +2 -2
  444. package/lib-es/modularDrawer/modules/createAssetConfiguration.js.map +1 -1
  445. package/lib-es/modularDrawer/modules/createNetworkConfiguration.d.ts +1 -1
  446. package/lib-es/modularDrawer/modules/createNetworkConfiguration.d.ts.map +1 -1
  447. package/lib-es/modularDrawer/modules/createNetworkConfiguration.js +15 -4
  448. package/lib-es/modularDrawer/modules/createNetworkConfiguration.js.map +1 -1
  449. package/lib-es/modularDrawer/utils/__tests__/calculateProviderTotal.test.d.ts +2 -0
  450. package/lib-es/modularDrawer/utils/__tests__/calculateProviderTotal.test.d.ts.map +1 -0
  451. package/lib-es/modularDrawer/utils/__tests__/calculateProviderTotal.test.js +207 -0
  452. package/lib-es/modularDrawer/utils/__tests__/calculateProviderTotal.test.js.map +1 -0
  453. package/lib-es/modularDrawer/utils/__tests__/currencyUtils.test.js +1 -1
  454. package/lib-es/modularDrawer/utils/__tests__/currencyUtils.test.js.map +1 -1
  455. package/lib-es/modularDrawer/utils/__tests__/groupAccountsByAsset.test.d.ts +2 -0
  456. package/lib-es/modularDrawer/utils/__tests__/groupAccountsByAsset.test.d.ts.map +1 -0
  457. package/lib-es/modularDrawer/utils/__tests__/groupAccountsByAsset.test.js +197 -0
  458. package/lib-es/modularDrawer/utils/__tests__/groupAccountsByAsset.test.js.map +1 -0
  459. package/lib-es/modularDrawer/utils/calculateProviderTotal.d.ts +1 -0
  460. package/lib-es/modularDrawer/utils/calculateProviderTotal.d.ts.map +1 -1
  461. package/lib-es/modularDrawer/utils/calculateProviderTotal.js +10 -2
  462. package/lib-es/modularDrawer/utils/calculateProviderTotal.js.map +1 -1
  463. package/lib-es/modularDrawer/utils/currencyUtils.d.ts.map +1 -1
  464. package/lib-es/modularDrawer/utils/currencyUtils.js.map +1 -1
  465. package/lib-es/modularDrawer/utils/getBalanceAndFiatValueByAssets.d.ts +6 -4
  466. package/lib-es/modularDrawer/utils/getBalanceAndFiatValueByAssets.d.ts.map +1 -1
  467. package/lib-es/modularDrawer/utils/getBalanceAndFiatValueByAssets.js +9 -22
  468. package/lib-es/modularDrawer/utils/getBalanceAndFiatValueByAssets.js.map +1 -1
  469. package/lib-es/modularDrawer/utils/getInterestRateForAsset.d.ts +1 -1
  470. package/lib-es/modularDrawer/utils/getInterestRateForAsset.d.ts.map +1 -1
  471. package/lib-es/modularDrawer/utils/groupAccountsByAsset.d.ts +4 -3
  472. package/lib-es/modularDrawer/utils/groupAccountsByAsset.d.ts.map +1 -1
  473. package/lib-es/modularDrawer/utils/groupAccountsByAsset.js +27 -11
  474. package/lib-es/modularDrawer/utils/groupAccountsByAsset.js.map +1 -1
  475. package/lib-es/modularDrawer/utils/index.d.ts +2 -6
  476. package/lib-es/modularDrawer/utils/index.d.ts.map +1 -1
  477. package/lib-es/modularDrawer/utils/index.js +2 -10
  478. package/lib-es/modularDrawer/utils/index.js.map +1 -1
  479. package/lib-es/modularDrawer/utils/index.test.js +1 -27
  480. package/lib-es/modularDrawer/utils/index.test.js.map +1 -1
  481. package/lib-es/modularDrawer/utils/sortByBalance.d.ts +1 -3
  482. package/lib-es/modularDrawer/utils/sortByBalance.d.ts.map +1 -1
  483. package/lib-es/modularDrawer/utils/sortByBalance.js +5 -15
  484. package/lib-es/modularDrawer/utils/sortByBalance.js.map +1 -1
  485. package/lib-es/modularDrawer/utils/type.d.ts +15 -17
  486. package/lib-es/modularDrawer/utils/type.d.ts.map +1 -1
  487. package/lib-es/wallet-api/CustomDeeplink/server.d.ts +16 -0
  488. package/lib-es/wallet-api/CustomDeeplink/server.d.ts.map +1 -0
  489. package/lib-es/wallet-api/CustomDeeplink/server.js +6 -0
  490. package/lib-es/wallet-api/CustomDeeplink/server.js.map +1 -0
  491. package/lib-es/wallet-api/Exchange/server.js +6 -6
  492. package/lib-es/wallet-api/Exchange/server.js.map +1 -1
  493. package/lib-es/wallet-api/constants.d.ts +1 -1
  494. package/lib-es/wallet-api/constants.d.ts.map +1 -1
  495. package/package.json +9 -7
  496. package/src/__tests__/test-helpers/bridge.ts +1 -1
  497. package/src/__tests__/test-helpers/environment.ts +1 -1
  498. package/src/bridge/generic-alpaca/alpaca/index.ts +4 -0
  499. package/src/bridge/generic-alpaca/buildSubAccounts.ts +28 -28
  500. package/src/bridge/generic-alpaca/createTransaction.ts +11 -0
  501. package/src/bridge/generic-alpaca/getAccountShape.ts +22 -15
  502. package/src/bridge/generic-alpaca/getTransactionStatus.ts +1 -1
  503. package/src/bridge/generic-alpaca/prepareTransaction.ts +47 -5
  504. package/src/bridge/generic-alpaca/signer/index.ts +44 -1
  505. package/src/bridge/generic-alpaca/signer/signTransaction.ts +10 -0
  506. package/src/bridge/generic-alpaca/tests/estimateMaxSpendable.test.ts +15 -1
  507. package/src/bridge/generic-alpaca/tests/getAccountShape.test.ts +5 -3
  508. package/src/bridge/generic-alpaca/tests/prepareTransaction.test.ts +78 -0
  509. package/src/bridge/generic-alpaca/tests/signOperation.test.ts +1 -1
  510. package/src/bridge/generic-alpaca/types.ts +10 -2
  511. package/src/bridge/generic-alpaca/utils.ts +25 -6
  512. package/src/bridge/impl.ts +1 -0
  513. package/src/dada-client/README.md +93 -0
  514. package/src/{modularDrawer/data → dada-client}/entities/interestRateSelectors.ts +1 -1
  515. package/src/{modularDrawer/data → dada-client}/entities/marketSelectors.ts +1 -1
  516. package/src/{modularDrawer/hooks/__test__ → dada-client/hooks/__tests__}/useAssetsData.test.ts +2 -2
  517. package/src/dada-client/hooks/useAssetData.ts +22 -0
  518. package/src/{modularDrawer → dada-client}/hooks/useAssetsData.ts +2 -2
  519. package/src/{modularDrawer → dada-client}/hooks/useInterestRatesByCurrencies.ts +4 -4
  520. package/src/{modularDrawer → dada-client}/hooks/useMarketByCurrencies.ts +5 -6
  521. package/src/{modularDrawer/data → dada-client}/state-manager/api.ts +22 -1
  522. package/src/dada-client/types/trend.ts +1 -0
  523. package/src/deposit/useGroupedCurrenciesByProvider.hook.ts +8 -2
  524. package/src/e2e/enum/Account.ts +10 -0
  525. package/src/e2e/enum/AppInfos.ts +2 -0
  526. package/src/e2e/enum/Currency.ts +11 -0
  527. package/src/e2e/enum/Network.ts +1 -0
  528. package/src/e2e/enum/Provider.ts +1 -0
  529. package/src/e2e/families/hedera.ts +7 -0
  530. package/src/e2e/speculos.ts +12 -0
  531. package/src/e2e/swap.ts +6 -6
  532. package/src/exchange/platform/types.ts +2 -0
  533. package/src/exchange/swap/completeExchange.ts +32 -2
  534. package/src/exchange/swap/getIncompatibleCurrencyKeys.ts +8 -0
  535. package/src/exchange/swap/postSwapState.ts +28 -32
  536. package/src/exchange/swap/setBroadcastTransaction.ts +12 -12
  537. package/src/exchange/swap/types.ts +3 -3
  538. package/src/exchange/swap/updateAccountSwapStatus.ts +8 -6
  539. package/src/families/canton/config.ts +10 -10
  540. package/src/families/evm/shouldUseReceiveOptions.test.ts +25 -0
  541. package/src/families/evm/shouldUseReceiveOptions.ts +4 -0
  542. package/src/families/hedera/exchange.ts +48 -0
  543. package/src/families/tezos/config.ts +2 -2
  544. package/src/families/tezos/react.ts +20 -1
  545. package/src/families/tezos/setup.ts +3 -22
  546. package/src/generated/bridge/js.ts +0 -2
  547. package/src/hw/actions/completeExchange.ts +3 -0
  548. package/src/hw/signMessage/index.ts +10 -0
  549. package/src/modularDrawer/hooks/modules/useLeftApyModule.tsx +2 -2
  550. package/src/modularDrawer/hooks/modules/useLeftMarketTrendModule.tsx +1 -1
  551. package/src/modularDrawer/hooks/modules/useRightMarketTrendModule.tsx +2 -2
  552. package/src/modularDrawer/hooks/useAssetAccountCounts.tsx +8 -10
  553. package/src/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.ts +231 -0
  554. package/src/modularDrawer/hooks/useLeftAccountsApy.tsx +1 -1
  555. package/src/modularDrawer/hooks/useRightBalanceAsset.tsx +26 -102
  556. package/src/modularDrawer/hooks/useRightBalanceNetwork.tsx +19 -100
  557. package/src/modularDrawer/modules/createAssetConfiguration.ts +3 -11
  558. package/src/modularDrawer/modules/createNetworkConfiguration.ts +26 -10
  559. package/src/modularDrawer/utils/__tests__/calculateProviderTotal.test.ts +237 -0
  560. package/src/modularDrawer/utils/__tests__/currencyUtils.test.ts +1 -1
  561. package/src/modularDrawer/utils/__tests__/getInterestRateForAsset.test.ts +1 -1
  562. package/src/modularDrawer/utils/__tests__/groupAccountsByAsset.test.ts +228 -0
  563. package/src/modularDrawer/utils/calculateProviderTotal.ts +13 -2
  564. package/src/modularDrawer/utils/currencyUtils.ts +0 -1
  565. package/src/modularDrawer/utils/getBalanceAndFiatValueByAssets.ts +13 -37
  566. package/src/modularDrawer/utils/getInterestRateForAsset.ts +1 -1
  567. package/src/modularDrawer/utils/groupAccountsByAsset.ts +38 -19
  568. package/src/modularDrawer/utils/index.test.ts +1 -32
  569. package/src/modularDrawer/utils/index.ts +2 -23
  570. package/src/modularDrawer/utils/sortByBalance.tsx +5 -18
  571. package/src/modularDrawer/utils/type.ts +18 -14
  572. package/src/wallet-api/CustomDeeplink/server.ts +23 -0
  573. package/src/wallet-api/Exchange/server.ts +6 -6
  574. package/lib/modularDrawer/data/entities/index.d.ts.map +0 -1
  575. package/lib/modularDrawer/data/entities/index.js.map +0 -1
  576. package/lib/modularDrawer/data/entities/interestRateSelectors.d.ts.map +0 -1
  577. package/lib/modularDrawer/data/entities/interestRateSelectors.js.map +0 -1
  578. package/lib/modularDrawer/data/entities/marketSelectors.d.ts.map +0 -1
  579. package/lib/modularDrawer/data/entities/marketSelectors.js.map +0 -1
  580. package/lib/modularDrawer/data/entities/selectorUtils.d.ts.map +0 -1
  581. package/lib/modularDrawer/data/entities/selectorUtils.js.map +0 -1
  582. package/lib/modularDrawer/data/state-manager/api.js.map +0 -1
  583. package/lib/modularDrawer/data/state-manager/types.d.ts.map +0 -1
  584. package/lib/modularDrawer/data/state-manager/types.js.map +0 -1
  585. package/lib/modularDrawer/hooks/__test__/useAssetsData.test.d.ts.map +0 -1
  586. package/lib/modularDrawer/hooks/__test__/useAssetsData.test.js.map +0 -1
  587. package/lib/modularDrawer/hooks/useAssetsData.d.ts +0 -19
  588. package/lib/modularDrawer/hooks/useAssetsData.d.ts.map +0 -1
  589. package/lib/modularDrawer/hooks/useAssetsData.js.map +0 -1
  590. package/lib/modularDrawer/hooks/useInterestRatesByCurrencies.d.ts.map +0 -1
  591. package/lib/modularDrawer/hooks/useInterestRatesByCurrencies.js.map +0 -1
  592. package/lib/modularDrawer/hooks/useMarketByCurrencies.d.ts.map +0 -1
  593. package/lib/modularDrawer/hooks/useMarketByCurrencies.js.map +0 -1
  594. package/lib/modularDrawer/utils/__tests__/counterValueFormatter.test.d.ts +0 -2
  595. package/lib/modularDrawer/utils/__tests__/counterValueFormatter.test.d.ts.map +0 -1
  596. package/lib/modularDrawer/utils/__tests__/counterValueFormatter.test.js +0 -496
  597. package/lib/modularDrawer/utils/__tests__/counterValueFormatter.test.js.map +0 -1
  598. package/lib/modularDrawer/utils/__tests__/haveOneCommonProvider.test.d.ts +0 -2
  599. package/lib/modularDrawer/utils/__tests__/haveOneCommonProvider.test.d.ts.map +0 -1
  600. package/lib/modularDrawer/utils/__tests__/haveOneCommonProvider.test.js +0 -28
  601. package/lib/modularDrawer/utils/__tests__/haveOneCommonProvider.test.js.map +0 -1
  602. package/lib/modularDrawer/utils/buildProviderCurrenciesMap.d.ts +0 -9
  603. package/lib/modularDrawer/utils/buildProviderCurrenciesMap.d.ts.map +0 -1
  604. package/lib/modularDrawer/utils/buildProviderCurrenciesMap.js +0 -17
  605. package/lib/modularDrawer/utils/buildProviderCurrenciesMap.js.map +0 -1
  606. package/lib/modularDrawer/utils/counterValueFormatter.d.ts +0 -14
  607. package/lib/modularDrawer/utils/counterValueFormatter.d.ts.map +0 -1
  608. package/lib/modularDrawer/utils/counterValueFormatter.js +0 -107
  609. package/lib/modularDrawer/utils/counterValueFormatter.js.map +0 -1
  610. package/lib/modularDrawer/utils/getBalanceAndFiatValue.d.ts +0 -20
  611. package/lib/modularDrawer/utils/getBalanceAndFiatValue.d.ts.map +0 -1
  612. package/lib/modularDrawer/utils/getBalanceAndFiatValue.js +0 -39
  613. package/lib/modularDrawer/utils/getBalanceAndFiatValue.js.map +0 -1
  614. package/lib/modularDrawer/utils/getProviderCurrency.d.ts +0 -3
  615. package/lib/modularDrawer/utils/getProviderCurrency.d.ts.map +0 -1
  616. package/lib/modularDrawer/utils/getProviderCurrency.js +0 -14
  617. package/lib/modularDrawer/utils/getProviderCurrency.js.map +0 -1
  618. package/lib/modularDrawer/utils/haveOneCommonProvider.d.ts +0 -11
  619. package/lib/modularDrawer/utils/haveOneCommonProvider.d.ts.map +0 -1
  620. package/lib/modularDrawer/utils/haveOneCommonProvider.js +0 -29
  621. package/lib/modularDrawer/utils/haveOneCommonProvider.js.map +0 -1
  622. package/lib/modularDrawer/utils/parseToBigNumber.d.ts +0 -9
  623. package/lib/modularDrawer/utils/parseToBigNumber.d.ts.map +0 -1
  624. package/lib/modularDrawer/utils/parseToBigNumber.js +0 -24
  625. package/lib/modularDrawer/utils/parseToBigNumber.js.map +0 -1
  626. package/lib-es/modularDrawer/data/entities/index.d.ts.map +0 -1
  627. package/lib-es/modularDrawer/data/entities/index.js.map +0 -1
  628. package/lib-es/modularDrawer/data/entities/interestRateSelectors.d.ts.map +0 -1
  629. package/lib-es/modularDrawer/data/entities/interestRateSelectors.js.map +0 -1
  630. package/lib-es/modularDrawer/data/entities/marketSelectors.d.ts.map +0 -1
  631. package/lib-es/modularDrawer/data/entities/marketSelectors.js.map +0 -1
  632. package/lib-es/modularDrawer/data/entities/selectorUtils.d.ts.map +0 -1
  633. package/lib-es/modularDrawer/data/entities/selectorUtils.js.map +0 -1
  634. package/lib-es/modularDrawer/data/state-manager/api.js.map +0 -1
  635. package/lib-es/modularDrawer/data/state-manager/types.d.ts.map +0 -1
  636. package/lib-es/modularDrawer/data/state-manager/types.js.map +0 -1
  637. package/lib-es/modularDrawer/hooks/__test__/useAssetsData.test.d.ts.map +0 -1
  638. package/lib-es/modularDrawer/hooks/__test__/useAssetsData.test.js.map +0 -1
  639. package/lib-es/modularDrawer/hooks/useAssetsData.d.ts +0 -19
  640. package/lib-es/modularDrawer/hooks/useAssetsData.d.ts.map +0 -1
  641. package/lib-es/modularDrawer/hooks/useAssetsData.js.map +0 -1
  642. package/lib-es/modularDrawer/hooks/useInterestRatesByCurrencies.d.ts.map +0 -1
  643. package/lib-es/modularDrawer/hooks/useInterestRatesByCurrencies.js.map +0 -1
  644. package/lib-es/modularDrawer/hooks/useMarketByCurrencies.d.ts.map +0 -1
  645. package/lib-es/modularDrawer/hooks/useMarketByCurrencies.js.map +0 -1
  646. package/lib-es/modularDrawer/utils/__tests__/counterValueFormatter.test.d.ts +0 -2
  647. package/lib-es/modularDrawer/utils/__tests__/counterValueFormatter.test.d.ts.map +0 -1
  648. package/lib-es/modularDrawer/utils/__tests__/counterValueFormatter.test.js +0 -494
  649. package/lib-es/modularDrawer/utils/__tests__/counterValueFormatter.test.js.map +0 -1
  650. package/lib-es/modularDrawer/utils/__tests__/haveOneCommonProvider.test.d.ts +0 -2
  651. package/lib-es/modularDrawer/utils/__tests__/haveOneCommonProvider.test.d.ts.map +0 -1
  652. package/lib-es/modularDrawer/utils/__tests__/haveOneCommonProvider.test.js +0 -26
  653. package/lib-es/modularDrawer/utils/__tests__/haveOneCommonProvider.test.js.map +0 -1
  654. package/lib-es/modularDrawer/utils/buildProviderCurrenciesMap.d.ts +0 -9
  655. package/lib-es/modularDrawer/utils/buildProviderCurrenciesMap.d.ts.map +0 -1
  656. package/lib-es/modularDrawer/utils/buildProviderCurrenciesMap.js +0 -13
  657. package/lib-es/modularDrawer/utils/buildProviderCurrenciesMap.js.map +0 -1
  658. package/lib-es/modularDrawer/utils/counterValueFormatter.d.ts +0 -14
  659. package/lib-es/modularDrawer/utils/counterValueFormatter.d.ts.map +0 -1
  660. package/lib-es/modularDrawer/utils/counterValueFormatter.js +0 -103
  661. package/lib-es/modularDrawer/utils/counterValueFormatter.js.map +0 -1
  662. package/lib-es/modularDrawer/utils/getBalanceAndFiatValue.d.ts +0 -20
  663. package/lib-es/modularDrawer/utils/getBalanceAndFiatValue.d.ts.map +0 -1
  664. package/lib-es/modularDrawer/utils/getBalanceAndFiatValue.js +0 -32
  665. package/lib-es/modularDrawer/utils/getBalanceAndFiatValue.js.map +0 -1
  666. package/lib-es/modularDrawer/utils/getProviderCurrency.d.ts +0 -3
  667. package/lib-es/modularDrawer/utils/getProviderCurrency.d.ts.map +0 -1
  668. package/lib-es/modularDrawer/utils/getProviderCurrency.js +0 -10
  669. package/lib-es/modularDrawer/utils/getProviderCurrency.js.map +0 -1
  670. package/lib-es/modularDrawer/utils/haveOneCommonProvider.d.ts +0 -11
  671. package/lib-es/modularDrawer/utils/haveOneCommonProvider.d.ts.map +0 -1
  672. package/lib-es/modularDrawer/utils/haveOneCommonProvider.js +0 -25
  673. package/lib-es/modularDrawer/utils/haveOneCommonProvider.js.map +0 -1
  674. package/lib-es/modularDrawer/utils/parseToBigNumber.d.ts +0 -9
  675. package/lib-es/modularDrawer/utils/parseToBigNumber.d.ts.map +0 -1
  676. package/lib-es/modularDrawer/utils/parseToBigNumber.js +0 -17
  677. package/lib-es/modularDrawer/utils/parseToBigNumber.js.map +0 -1
  678. package/src/modularDrawer/utils/__tests__/counterValueFormatter.test.ts +0 -549
  679. package/src/modularDrawer/utils/__tests__/haveOneCommonProvider.test.ts +0 -34
  680. package/src/modularDrawer/utils/buildProviderCurrenciesMap.tsx +0 -25
  681. package/src/modularDrawer/utils/counterValueFormatter.ts +0 -165
  682. package/src/modularDrawer/utils/getBalanceAndFiatValue.ts +0 -53
  683. package/src/modularDrawer/utils/getProviderCurrency.ts +0 -13
  684. package/src/modularDrawer/utils/haveOneCommonProvider.ts +0 -31
  685. package/src/modularDrawer/utils/parseToBigNumber.ts +0 -17
  686. /package/lib/{modularDrawer/data → dada-client}/entities/index.d.ts +0 -0
  687. /package/lib/{modularDrawer/data → dada-client}/entities/index.js +0 -0
  688. /package/lib/{modularDrawer/data → dada-client}/entities/interestRateSelectors.js +0 -0
  689. /package/lib/{modularDrawer/data → dada-client}/entities/marketSelectors.js +0 -0
  690. /package/lib/{modularDrawer/data → dada-client}/entities/selectorUtils.d.ts +0 -0
  691. /package/lib/{modularDrawer/data → dada-client}/entities/selectorUtils.js +0 -0
  692. /package/lib/{modularDrawer/hooks/__test__ → dada-client/hooks/__tests__}/useAssetsData.test.d.ts +0 -0
  693. /package/lib/{modularDrawer → dada-client}/hooks/useInterestRatesByCurrencies.d.ts +0 -0
  694. /package/lib/{modularDrawer → dada-client}/hooks/useMarketByCurrencies.d.ts +0 -0
  695. /package/lib/{modularDrawer/data → dada-client}/state-manager/types.d.ts +0 -0
  696. /package/lib/{modularDrawer/data → dada-client}/state-manager/types.js +0 -0
  697. /package/lib-es/{modularDrawer/data → dada-client}/entities/index.d.ts +0 -0
  698. /package/lib-es/{modularDrawer/data → dada-client}/entities/index.js +0 -0
  699. /package/lib-es/{modularDrawer/data → dada-client}/entities/interestRateSelectors.js +0 -0
  700. /package/lib-es/{modularDrawer/data → dada-client}/entities/marketSelectors.js +0 -0
  701. /package/lib-es/{modularDrawer/data → dada-client}/entities/selectorUtils.d.ts +0 -0
  702. /package/lib-es/{modularDrawer/data → dada-client}/entities/selectorUtils.js +0 -0
  703. /package/lib-es/{modularDrawer/hooks/__test__ → dada-client/hooks/__tests__}/useAssetsData.test.d.ts +0 -0
  704. /package/lib-es/{modularDrawer → dada-client}/hooks/useInterestRatesByCurrencies.d.ts +0 -0
  705. /package/lib-es/{modularDrawer → dada-client}/hooks/useMarketByCurrencies.d.ts +0 -0
  706. /package/lib-es/{modularDrawer/data → dada-client}/state-manager/types.d.ts +0 -0
  707. /package/lib-es/{modularDrawer/data → dada-client}/state-manager/types.js +0 -0
  708. /package/src/{modularDrawer/data → dada-client}/entities/index.ts +0 -0
  709. /package/src/{modularDrawer/data → dada-client}/entities/selectorUtils.ts +0 -0
  710. /package/src/{modularDrawer/data → dada-client}/state-manager/types.ts +0 -0
@@ -120,7 +120,7 @@ setSupportedCurrencies([
120
120
  "babylon",
121
121
  "canton_network",
122
122
  "canton_network_devnet",
123
- "canton_network_localnet",
123
+ "canton_network_testnet",
124
124
  "kaspa",
125
125
  ]);
126
126
  LiveConfig.setConfig(liveConfig);
@@ -3,6 +3,7 @@ import { createApi as createStellarApi } from "@ledgerhq/coin-stellar/api/index"
3
3
  import { createApi as createCantonApi } from "@ledgerhq/coin-canton/api/index";
4
4
  import { createApi as createTronApi } from "@ledgerhq/coin-tron/api/index";
5
5
  import { createApi as createEvmApi } from "@ledgerhq/coin-evm/api/index";
6
+ import { createApi as createTezosApi } from "@ledgerhq/coin-tezos/api/index";
6
7
  import { getCurrencyConfiguration } from "../../../config";
7
8
  import { getNetworkAlpacaApi } from "./network/network-alpaca";
8
9
  import { Api } from "@ledgerhq/coin-framework/api/types";
@@ -11,6 +12,7 @@ import { StellarCoinConfig } from "@ledgerhq/coin-stellar/config";
11
12
  import { CantonCoinConfig } from "@ledgerhq/coin-canton/config";
12
13
  import { TronCoinConfig } from "@ledgerhq/coin-tron/config";
13
14
  import { EvmConfigInfo } from "@ledgerhq/coin-evm/config";
15
+ import { TezosCoinConfig } from "@ledgerhq/coin-tezos/config";
14
16
  import { findCryptoCurrencyByNetwork } from "../utils";
15
17
 
16
18
  export function getAlpacaApi(network: string, kind: string): Api<any> {
@@ -30,6 +32,8 @@ export function getAlpacaApi(network: string, kind: string): Api<any> {
30
32
  getCurrencyConfiguration<EvmConfigInfo>(currency),
31
33
  currency.id,
32
34
  ) as Api<any>;
35
+ case "tezos":
36
+ return createTezosApi(getCurrencyConfiguration<TezosCoinConfig>(currency)) as Api<any>;
33
37
  }
34
38
  }
35
39
  return getNetworkAlpacaApi(network) satisfies Partial<Api<any>>;
@@ -55,47 +55,47 @@ function buildTokenAccount({
55
55
  };
56
56
  }
57
57
 
58
- export function buildSubAccounts({
58
+ export async function buildSubAccounts({
59
59
  currency,
60
60
  accountId,
61
- assetsBalance,
61
+ allTokenAssetsBalances,
62
62
  syncConfig,
63
63
  operations,
64
64
  getTokenFromAsset,
65
65
  }: {
66
66
  currency: CryptoCurrency;
67
67
  accountId: string;
68
- assetsBalance: Balance[];
68
+ allTokenAssetsBalances: Balance[];
69
69
  syncConfig: SyncConfig;
70
70
  operations: OperationCommon[];
71
- getTokenFromAsset?: (asset: AssetInfo) => TokenCurrency | undefined;
72
- }): TokenAccount[] | undefined {
71
+ getTokenFromAsset?: (asset: AssetInfo) => Promise<TokenCurrency | undefined>;
72
+ }): Promise<TokenAccount[]> {
73
73
  const { blacklistedTokenIds = [] } = syncConfig;
74
74
  const allTokens = listTokensForCryptoCurrency(currency);
75
+ const tokenAccounts: TokenAccount[] = [];
75
76
 
76
- if (allTokens.length === 0 || assetsBalance.length === 0) {
77
- return undefined;
77
+ if (allTokens.length === 0 || allTokenAssetsBalances.length === 0) {
78
+ return tokenAccounts;
78
79
  }
79
- const tokenAccounts: TokenAccount[] = [];
80
- assetsBalance
81
- .filter(b => b.asset.type !== "native") // NOTE: this could be removed, keeping here while fixing things up
82
- .map(balance => {
83
- const token = getTokenFromAsset && getTokenFromAsset(balance.asset);
84
- // NOTE: for future tokens, will need to check over currencyName/standard(erc20,trc10,trc20, etc)/id
85
- if (token && !blacklistedTokenIds.includes(token.id)) {
86
- tokenAccounts.push(
87
- buildTokenAccount({
88
- parentAccountId: accountId,
89
- assetBalance: balance,
90
- token,
91
- operations: operations.filter(
92
- op =>
93
- op.extra.assetReference === balance.asset?.["assetReference"] &&
94
- op.extra.assetOwner === balance.asset?.["assetOwner"], // NOTE: we could narrow type
95
- ),
96
- }),
97
- );
98
- }
99
- });
80
+
81
+ for (const balance of allTokenAssetsBalances) {
82
+ const token = getTokenFromAsset && (await getTokenFromAsset(balance.asset));
83
+ // NOTE: for future tokens, will need to check over currencyName/standard(erc20,trc10,trc20, etc)/id
84
+ if (token && !blacklistedTokenIds.includes(token.id)) {
85
+ tokenAccounts.push(
86
+ buildTokenAccount({
87
+ parentAccountId: accountId,
88
+ assetBalance: balance,
89
+ token,
90
+ operations: operations.filter(
91
+ op =>
92
+ op.extra.assetReference === balance.asset?.["assetReference"] &&
93
+ op.extra.assetOwner === balance.asset?.["assetOwner"], // NOTE: we could narrow type
94
+ ),
95
+ }),
96
+ );
97
+ }
98
+ }
99
+
100
100
  return tokenAccounts;
101
101
  }
@@ -30,6 +30,17 @@ export function createTransaction(account: Account | TokenAccount): GenericTrans
30
30
  assetOwner: "",
31
31
  networkInfo: null,
32
32
  };
33
+ case "tezos":
34
+ // note: default transaction for tezos, mode will be set by UI (send, stake, unstake)
35
+ return {
36
+ family: currency.family,
37
+ amount: new BigNumber(0),
38
+ fees: null,
39
+ recipient: "",
40
+ useAllAmount: false,
41
+ mode: "send",
42
+ networkInfo: null,
43
+ };
33
44
  case "evm": {
34
45
  return {
35
46
  mode: "send-eip1559",
@@ -1,5 +1,6 @@
1
1
  import { encodeAccountId } from "@ledgerhq/coin-framework/account/index";
2
2
  import { GetAccountShape, mergeOps } from "@ledgerhq/coin-framework/bridge/jsHelpers";
3
+ import { encodeOperationId } from "@ledgerhq/coin-framework/operation";
3
4
  import BigNumber from "bignumber.js";
4
5
  import { getAlpacaApi } from "./alpaca";
5
6
  import { adaptCoreOperationToLiveOperation, extractBalance } from "./utils";
@@ -31,18 +32,25 @@ export function genericGetAccountShape(network: string, kind: string): GetAccoun
31
32
  const balanceRes = await alpacaApi.getBalance(address);
32
33
  const nativeAsset = extractBalance(balanceRes, "native");
33
34
 
34
- const assetsBalance = balanceRes
35
- .filter(b => b.asset.type !== "native")
36
- .filter(b => alpacaApi.getTokenFromAsset && alpacaApi.getTokenFromAsset(b.asset));
35
+ const allTokenAssetsBalances = balanceRes.filter(b => b.asset.type !== "native");
37
36
  const nativeBalance = BigInt(nativeAsset?.value ?? "0");
38
37
 
39
38
  const spendableBalance = BigInt(nativeBalance - BigInt(nativeAsset?.locked ?? "0"));
40
39
 
41
- const oldOps = (initialAccount?.operations || []) as OperationCommon[];
40
+ // Normalize pre-alpaca operations to the new accountId to keep UI rendering consistent
41
+ const oldOps = ((initialAccount?.operations || []) as OperationCommon[]).map(op =>
42
+ op.accountId === accountId
43
+ ? op
44
+ : { ...op, accountId, id: encodeOperationId(accountId, op.hash, op.type) },
45
+ );
42
46
  const lastPagingToken = oldOps[0]?.extra?.pagingToken || "";
43
47
 
44
- const blockHeight = oldOps.length ? (oldOps[0].blockHeight ?? 0) + 1 : 0;
45
- const paginationParams: Pagination = { minHeight: blockHeight, order: "asc" };
48
+ // Calculate minHeight for pagination
49
+ let minHeight: number = 0;
50
+ if (oldOps.length > 0 && initialAccount?.blockHeight !== 0) {
51
+ minHeight = (oldOps[0].blockHeight ?? 0) + 1;
52
+ }
53
+ const paginationParams: Pagination = { minHeight, order: "asc" };
46
54
  if (lastPagingToken) {
47
55
  paginationParams.lastPagingToken = lastPagingToken;
48
56
  }
@@ -64,15 +72,14 @@ export function genericGetAccountShape(network: string, kind: string): GetAccoun
64
72
  }
65
73
  });
66
74
 
67
- const subAccounts =
68
- buildSubAccounts({
69
- currency,
70
- accountId,
71
- assetsBalance,
72
- syncConfig,
73
- operations: assetOperations,
74
- getTokenFromAsset: alpacaApi.getTokenFromAsset,
75
- }) || [];
75
+ const subAccounts = await buildSubAccounts({
76
+ currency,
77
+ accountId,
78
+ allTokenAssetsBalances,
79
+ syncConfig,
80
+ operations: assetOperations,
81
+ getTokenFromAsset: alpacaApi.getTokenFromAsset,
82
+ });
76
83
 
77
84
  const operations = mergedOps.map(op => {
78
85
  const subOperations = inferSubOperations(op.hash, subAccounts);
@@ -13,7 +13,7 @@ export function genericGetTransactionStatus(
13
13
  return async (account, transaction: GenericTransaction) => {
14
14
  const alpacaApi = getAlpacaApi(account.currency.id, kind);
15
15
  const draftTransaction = {
16
- mode: transaction?.mode,
16
+ mode: transaction?.mode ?? "send",
17
17
  recipient: transaction.recipient,
18
18
  amount: transaction.amount ?? new BigNumber(0),
19
19
  useAllAmount: !!transaction.useAllAmount,
@@ -26,15 +26,15 @@ export function genericPrepareTransaction(
26
26
  kind,
27
27
  ): AccountBridge<GenericTransaction, Account>["prepareTransaction"] {
28
28
  return async (account, transaction: GenericTransaction) => {
29
- const { getAssetFromToken, computeIntentType, estimateFees } = getAlpacaApi(
29
+ const { getAssetFromToken, computeIntentType, estimateFees, validateIntent } = getAlpacaApi(
30
30
  account.currency.id,
31
31
  kind,
32
32
  );
33
33
  const { assetReference, assetOwner } = getAssetFromToken
34
34
  ? getAssetInfos(transaction, account.freshAddress, getAssetFromToken)
35
35
  : assetInfosFallback(transaction);
36
-
37
- let fees: BigNumber | bigint | null = transaction.customFees?.parameters?.fees || null;
36
+ const customParametersFees = transaction.customFees?.parameters?.fees;
37
+ let fees: BigNumber | bigint | null = customParametersFees || null;
38
38
  if (fees === null) {
39
39
  fees = (
40
40
  await estimateFees(
@@ -50,17 +50,59 @@ export function genericPrepareTransaction(
50
50
  }
51
51
 
52
52
  if (!bnEq(transaction.fees, new BigNumber(fees.toString()))) {
53
- return {
53
+ const next: GenericTransaction = {
54
54
  ...transaction,
55
55
  fees: new BigNumber(fees.toString()),
56
56
  assetReference,
57
57
  assetOwner,
58
58
  customFees: {
59
59
  parameters: {
60
- fees: new BigNumber(fees.toString()),
60
+ fees: customParametersFees ? new BigNumber(customParametersFees.toString()) : undefined,
61
61
  },
62
62
  },
63
63
  };
64
+
65
+ // propagate storageLimit fee parameter when present (ex: tezos)
66
+ const feeEstimation = await estimateFees(
67
+ transactionToIntent(
68
+ account,
69
+ {
70
+ ...transaction,
71
+ },
72
+ computeIntentType,
73
+ ),
74
+ );
75
+ const params = feeEstimation?.parameters;
76
+ if (params) {
77
+ const storageLimit = params["storageLimit"];
78
+ if (
79
+ storageLimit !== undefined &&
80
+ (typeof storageLimit === "bigint" ||
81
+ typeof storageLimit === "number" ||
82
+ typeof storageLimit === "string")
83
+ ) {
84
+ next.storageLimit = new BigNumber(storageLimit.toString());
85
+ }
86
+ }
87
+
88
+ // align with stellar/xrp: when send max (or staking intents), reflect validated amount in UI
89
+ if (
90
+ transaction.useAllAmount ||
91
+ transaction["mode"] === "stake" ||
92
+ transaction["mode"] === "unstake"
93
+ ) {
94
+ const { amount } = await validateIntent(
95
+ transactionToIntent(
96
+ account,
97
+ {
98
+ ...transaction,
99
+ },
100
+ computeIntentType,
101
+ ),
102
+ );
103
+ next.amount = new BigNumber(amount.toString());
104
+ }
105
+ return next;
64
106
  }
65
107
 
66
108
  return transaction;
@@ -1,12 +1,15 @@
1
1
  import xrpGetAddress from "@ledgerhq/coin-xrp/signer/getAddress";
2
2
  import stellarGetAddress from "@ledgerhq/coin-stellar/signer/getAddress";
3
3
  import Stellar from "@ledgerhq/hw-app-str";
4
- import { signTransaction, stellarSignTransaction } from "./signTransaction";
4
+ import { signTransaction, stellarSignTransaction, tezosSignTransaction } from "./signTransaction";
5
5
  import { StrKey } from "@stellar/stellar-sdk";
6
6
  import { CreateSigner, executeWithSigner } from "../../setup";
7
7
  import Xrp from "@ledgerhq/hw-app-xrp";
8
8
  import Transport from "@ledgerhq/hw-transport";
9
9
  import { AlpacaSigner } from "./types";
10
+ import { DerivationType, LedgerSigner as TaquitoLedgerSigner } from "@taquito/ledger-signer";
11
+ import tezosGetAddress from "@ledgerhq/coin-tezos/signer/getAddress";
12
+ import Tezos from "@ledgerhq/hw-app-tezos";
10
13
 
11
14
  const createSignerXrp: CreateSigner<Xrp> = (transport: Transport) => {
12
15
  return new Xrp(transport);
@@ -37,6 +40,39 @@ const createSignerStellar: CreateSigner<Stellar> = (transport: Transport) => {
37
40
 
38
41
  const signerContextStellar = executeWithSigner(createSignerStellar);
39
42
 
43
+ const createSignerTezos: CreateSigner<
44
+ Tezos & { createLedgerSigner: (path: string, prompt: boolean, derivationType: number) => any }
45
+ > = (transport: Transport) => {
46
+ const tezos = new Tezos(transport);
47
+ // align with genericSignOperation that calls signer.signTransaction
48
+ return Object.assign(tezos, {
49
+ async signTransaction(path: string, rawTxHex: string) {
50
+ const { signature } = await tezos.signOperation(path, rawTxHex, {});
51
+ return signature;
52
+ },
53
+ async getAddress(path: string, { verify }: { verify?: boolean } = {}) {
54
+ // Use Taquito LedgerSigner to retrieve base58 public key and matching pkh (like oldbridge)
55
+ const ledgerSigner = new TaquitoLedgerSigner(
56
+ transport,
57
+ path,
58
+ !!verify,
59
+ DerivationType.ED25519,
60
+ );
61
+ const address = await ledgerSigner.publicKeyHash();
62
+ const publicKey = await ledgerSigner.publicKey();
63
+ return { path, address, publicKey };
64
+ },
65
+ createLedgerSigner(path: string, prompt: boolean, derivationType: number) {
66
+ // Map 0 -> ED25519, 1 -> SECP256K1, 2 -> P256 by convention
67
+ let dt: DerivationType = DerivationType.ED25519;
68
+ if (derivationType === 1) dt = DerivationType.SECP256K1;
69
+ else if (derivationType === 2) dt = DerivationType.P256;
70
+ return new TaquitoLedgerSigner(transport, path, prompt, dt);
71
+ },
72
+ });
73
+ };
74
+ const signerContextTezos = executeWithSigner(createSignerTezos);
75
+
40
76
  export function getSigner(network: string): AlpacaSigner {
41
77
  switch (network) {
42
78
  case "ripple":
@@ -54,6 +90,13 @@ export function getSigner(network: string): AlpacaSigner {
54
90
  context: signerContextStellar,
55
91
  };
56
92
  }
93
+ case "tezos": {
94
+ return {
95
+ getAddress: tezosGetAddress(signerContextTezos),
96
+ signTransaction: tezosSignTransaction(executeWithSigner(createSignerTezos)),
97
+ context: signerContextTezos,
98
+ };
99
+ }
57
100
  }
58
101
  throw new Error(`signer for ${network} not implemented`);
59
102
  }
@@ -1,5 +1,6 @@
1
1
  import { SignerContext } from "@ledgerhq/coin-framework/signer";
2
2
  import { StellarSigner } from "@ledgerhq/coin-stellar/types/signer";
3
+ import { TezosSigner } from "@ledgerhq/coin-tezos/types/signer";
3
4
  import { LegacySigner, SignTransactionOptions } from "./types";
4
5
 
5
6
  export const signTransaction = <Signer extends LegacySigner>(
@@ -23,3 +24,12 @@ export const stellarSignTransaction = (signerContext: SignerContext<StellarSigne
23
24
  return signedTx.signature.toString("base64"); // It should return a Buffer
24
25
  };
25
26
  };
27
+
28
+ export const tezosSignTransaction = (signerContext: SignerContext<TezosSigner>) => {
29
+ return async (deviceId: string, { path, rawTxHex }: SignTransactionOptions) => {
30
+ const signed = await signerContext(deviceId, signer =>
31
+ signer.signOperation(path, rawTxHex, {}),
32
+ );
33
+ return signed.signature;
34
+ };
35
+ };
@@ -35,9 +35,23 @@ const dummyAccounts = [
35
35
  freshAddress: "s123",
36
36
  pendingOperations: [],
37
37
  },
38
+ {
39
+ id: "js:2:tezos:t123",
40
+ type: "Account",
41
+ spendableBalance: new BigNumber(50000000),
42
+ balance: new BigNumber(60000000),
43
+ currency: {
44
+ id: "tezos",
45
+ family: "tezos",
46
+ name: "Tezos",
47
+ units: [{ name: "XTZ", magnitude: 6 }],
48
+ },
49
+ freshAddress: "t123",
50
+ pendingOperations: [],
51
+ },
38
52
  ] as unknown as Account[];
39
53
 
40
- ["xrp", "stellar"].forEach((currencyName, idx) => {
54
+ ["xrp", "stellar", "tezos"].forEach((currencyName, idx) => {
41
55
  describe(`genericEstimateMaxSpendable for ${currencyName}`, () => {
42
56
  const dummyAccount = dummyAccounts[idx];
43
57
 
@@ -117,9 +117,11 @@ describe("genericGetAccountShape (stellar & xrp)", () => {
117
117
  lastPagingToken: "pt1",
118
118
  });
119
119
 
120
- const assetsBalancePassed = buildSubAccountsMock.mock.calls[0][0].assetsBalance;
121
- expect(assetsBalancePassed).toHaveLength(1);
122
- expect(assetsBalancePassed[0].asset.symbol).toBe("TOK1");
120
+ const assetsBalancePassed = buildSubAccountsMock.mock.calls[0][0].allTokenAssetsBalances;
121
+ expect(assetsBalancePassed).toEqual([
122
+ { asset: { symbol: "TOK1", type: "token" }, value: "42" },
123
+ { asset: { symbol: "TOK_IGNORE", type: "token" }, value: "5" },
124
+ ]);
123
125
 
124
126
  const assetOpsPassed = buildSubAccountsMock.mock.calls[0][0].operations;
125
127
  expect(assetOpsPassed).toHaveLength(1);
@@ -91,4 +91,82 @@ describe("genericPrepareTransaction", () => {
91
91
 
92
92
  expect(result).toBe(baseTransaction); // still same reference
93
93
  });
94
+
95
+ it("propagates storageLimit from second estimation", async () => {
96
+ const estimatedFee = new BigNumber(491);
97
+
98
+ const estimateFeesFirstCall = jest.fn().mockResolvedValue({
99
+ value: estimatedFee,
100
+ parameters: { storageLimit: 300 },
101
+ });
102
+
103
+ const estimateFeesSecondCall = jest.fn().mockResolvedValue({
104
+ value: estimatedFee,
105
+ parameters: { storageLimit: 0 },
106
+ });
107
+
108
+ (getAlpacaApi as jest.Mock).mockReturnValue({
109
+ estimateFees: jest
110
+ .fn()
111
+ .mockImplementationOnce(() => estimateFeesFirstCall())
112
+ .mockImplementationOnce(() => estimateFeesSecondCall()),
113
+ });
114
+
115
+ const txWithoutCustomFees = { ...baseTransaction, customFees: undefined };
116
+ const prepareTransaction = genericPrepareTransaction(network, kind);
117
+ const result = await prepareTransaction(account, txWithoutCustomFees);
118
+
119
+ expect(result).toEqual(
120
+ expect.objectContaining({
121
+ fees: estimatedFee,
122
+ storageLimit: new BigNumber(0),
123
+ customFees: {
124
+ parameters: {
125
+ fees: undefined,
126
+ },
127
+ },
128
+ }),
129
+ );
130
+
131
+ expect((getAlpacaApi as jest.Mock)().estimateFees).toHaveBeenCalledTimes(2);
132
+ });
133
+
134
+ it("propagates storageLimit showing new account scenario", async () => {
135
+ const estimatedFee = new BigNumber(491);
136
+
137
+ const estimateFeesFirstCall = jest.fn().mockResolvedValue({
138
+ value: estimatedFee,
139
+ parameters: { storageLimit: 300 },
140
+ });
141
+
142
+ const estimateFeesSecondCall = jest.fn().mockResolvedValue({
143
+ value: estimatedFee,
144
+ parameters: { storageLimit: 277 },
145
+ });
146
+
147
+ (getAlpacaApi as jest.Mock).mockReturnValue({
148
+ estimateFees: jest
149
+ .fn()
150
+ .mockImplementationOnce(() => estimateFeesFirstCall())
151
+ .mockImplementationOnce(() => estimateFeesSecondCall()),
152
+ });
153
+
154
+ const txWithoutCustomFees = { ...baseTransaction, customFees: undefined };
155
+ const prepareTransaction = genericPrepareTransaction(network, kind);
156
+ const result = await prepareTransaction(account, txWithoutCustomFees);
157
+
158
+ expect(result).toEqual(
159
+ expect.objectContaining({
160
+ fees: estimatedFee,
161
+ storageLimit: new BigNumber(277),
162
+ customFees: {
163
+ parameters: {
164
+ fees: undefined,
165
+ },
166
+ },
167
+ }),
168
+ );
169
+
170
+ expect((getAlpacaApi as jest.Mock)().estimateFees).toHaveBeenCalledTimes(2);
171
+ });
94
172
  });
@@ -14,7 +14,7 @@ jest.mock("../utils", () => ({
14
14
  transactionToIntent: jest.fn(),
15
15
  }));
16
16
  describe("genericSignOperation", () => {
17
- const networks = ["xrp", "stellar"];
17
+ const networks = ["xrp", "stellar", "tezos"];
18
18
  const kind = "local";
19
19
 
20
20
  const mockSignerContext = jest.fn();
@@ -11,15 +11,23 @@ export type GenericTransaction = TransactionCommon & {
11
11
  fees?: BigNumber | null;
12
12
  storageLimit?: BigNumber | null;
13
13
  customFees?: {
14
- parameters: { fees?: BigNumber | null; storageLimit?: BigNumber | null };
14
+ parameters: { fees?: BigNumber | null };
15
15
  };
16
16
  tag?: number | null | undefined;
17
17
  feeCustomUnit?: Unit | null | undefined;
18
18
  memoType?: string | null;
19
19
  memoValue?: string | null;
20
20
  data?: Buffer;
21
+ mode?:
22
+ | "send"
23
+ | "changeTrust"
24
+ | "send-legacy"
25
+ | "send-eip1559"
26
+ | "delegate"
27
+ | "stake"
28
+ | "undelegate"
29
+ | "unstake";
21
30
  type?: number;
22
- mode?: "send" | "changeTrust" | "send-legacy" | "send-eip1559";
23
31
  assetReference?: string;
24
32
  assetOwner?: string;
25
33
  networkInfo?: NetworkInfo | null;
@@ -1,5 +1,5 @@
1
1
  import { encodeOperationId } from "@ledgerhq/coin-framework/operation";
2
- import { Account, Operation, OperationType, TransactionCommon } from "@ledgerhq/types-live";
2
+ import { Account, Operation, OperationType } from "@ledgerhq/types-live";
3
3
  import BigNumber from "bignumber.js";
4
4
  import { fromBigNumberToBigInt } from "@ledgerhq/coin-framework/utils";
5
5
  import {
@@ -128,15 +128,18 @@ export function transactionToIntent(
128
128
  data?: { type: string; value?: unknown };
129
129
  } {
130
130
  const intentType = (computeIntentType ?? defaultComputeIntentType)(transaction);
131
+ const isStaking = ["stake", "unstake"].includes(intentType);
132
+ const amount = isStaking ? 0n : fromBigNumberToBigInt(transaction.amount, 0n);
133
+ const useAllAmount = isStaking || !!transaction.useAllAmount;
131
134
  const res: TransactionIntent & { memo?: { type: string; value?: string } } & {
132
135
  data?: { type: string; value?: unknown };
133
136
  } = {
134
137
  type: intentType,
135
138
  sender: account.freshAddress,
136
139
  recipient: transaction.recipient,
137
- amount: fromBigNumberToBigInt(transaction.amount, BigInt(0)),
140
+ amount,
138
141
  asset: { type: "native", name: account.currency.name, unit: account.currency.units[0] },
139
- useAllAmount: !!transaction.useAllAmount,
142
+ useAllAmount,
140
143
  feesStrategy:
141
144
  transaction.feesStrategy === "custom" ? undefined : transaction.feesStrategy ?? undefined,
142
145
  data: Buffer.isBuffer(transaction.data)
@@ -171,11 +174,27 @@ export function transactionToIntent(
171
174
 
172
175
  export const buildOptimisticOperation = (
173
176
  account: Account,
174
- transaction: TransactionCommon,
177
+ transaction: GenericTransaction,
175
178
  sequenceNumber?: number,
176
179
  ): Operation => {
177
- const type = transaction["mode"] === "changeTrust" ? "OPT_IN" : "OUT";
178
- const fees = BigInt(transaction["fees"]?.toString() || "0");
180
+ let type: OperationType;
181
+ switch (transaction.mode) {
182
+ case "changeTrust":
183
+ type = "OPT_IN";
184
+ break;
185
+ case "delegate":
186
+ case "stake":
187
+ type = "DELEGATE";
188
+ break;
189
+ case "undelegate":
190
+ case "unstake":
191
+ type = "UNDELEGATE";
192
+ break;
193
+ default:
194
+ type = "OUT";
195
+ break;
196
+ }
197
+ const fees = BigInt(transaction.fees?.toString() || "0");
179
198
  const { subAccountId } = transaction;
180
199
  const { subAccounts } = account;
181
200
 
@@ -27,6 +27,7 @@ import { getCryptoAssetsStore, setCryptoAssetsStore } from "./crypto-assets";
27
27
  const alpacaized = {
28
28
  xrp: true,
29
29
  stellar: true,
30
+ tezos: true,
30
31
  };
31
32
 
32
33
  // let accountBridgeInstance: AccountBridge<any> | null = null;