@ledgerhq/live-common 34.45.0-nightly.2 → 34.45.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (289) hide show
  1. package/lib/__tests__/test-helpers/bridge.d.ts.map +1 -1
  2. package/lib/__tests__/test-helpers/bridge.js +1 -3
  3. package/lib/__tests__/test-helpers/bridge.js.map +1 -1
  4. package/lib/bridge/generic-alpaca/accountBridge.d.ts +1 -1
  5. package/lib/bridge/generic-alpaca/accountBridge.d.ts.map +1 -1
  6. package/lib/bridge/generic-alpaca/accountBridge.js.map +1 -1
  7. package/lib/bridge/generic-alpaca/alpaca/index.d.ts +1 -1
  8. package/lib/bridge/generic-alpaca/alpaca/index.d.ts.map +1 -1
  9. package/lib/bridge/generic-alpaca/alpaca/index.js +2 -4
  10. package/lib/bridge/generic-alpaca/alpaca/index.js.map +1 -1
  11. package/lib/bridge/generic-alpaca/alpaca/network/network-alpaca.d.ts +4 -4
  12. package/lib/bridge/generic-alpaca/alpaca/network/network-alpaca.d.ts.map +1 -1
  13. package/lib/bridge/generic-alpaca/alpaca/network/network-alpaca.js +10 -10
  14. package/lib/bridge/generic-alpaca/alpaca/network/network-alpaca.js.map +1 -1
  15. package/lib/bridge/generic-alpaca/broadcast.d.ts +1 -1
  16. package/lib/bridge/generic-alpaca/broadcast.d.ts.map +1 -1
  17. package/lib/bridge/generic-alpaca/broadcast.js.map +1 -1
  18. package/lib/bridge/generic-alpaca/createTransaction.d.ts +9 -17
  19. package/lib/bridge/generic-alpaca/createTransaction.d.ts.map +1 -1
  20. package/lib/bridge/generic-alpaca/createTransaction.js +10 -36
  21. package/lib/bridge/generic-alpaca/createTransaction.js.map +1 -1
  22. package/lib/bridge/generic-alpaca/currencyBridge.d.ts +1 -1
  23. package/lib/bridge/generic-alpaca/currencyBridge.d.ts.map +1 -1
  24. package/lib/bridge/generic-alpaca/currencyBridge.js.map +1 -1
  25. package/lib/bridge/generic-alpaca/estimateMaxSpendable.d.ts +1 -1
  26. package/lib/bridge/generic-alpaca/estimateMaxSpendable.d.ts.map +1 -1
  27. package/lib/bridge/generic-alpaca/estimateMaxSpendable.js +0 -9
  28. package/lib/bridge/generic-alpaca/estimateMaxSpendable.js.map +1 -1
  29. package/lib/bridge/generic-alpaca/getAccountShape.d.ts +1 -1
  30. package/lib/bridge/generic-alpaca/getAccountShape.d.ts.map +1 -1
  31. package/lib/bridge/generic-alpaca/getAccountShape.js +37 -66
  32. package/lib/bridge/generic-alpaca/getAccountShape.js.map +1 -1
  33. package/lib/bridge/generic-alpaca/getTransactionStatus.d.ts +1 -1
  34. package/lib/bridge/generic-alpaca/getTransactionStatus.d.ts.map +1 -1
  35. package/lib/bridge/generic-alpaca/getTransactionStatus.js +15 -27
  36. package/lib/bridge/generic-alpaca/getTransactionStatus.js.map +1 -1
  37. package/lib/bridge/generic-alpaca/prepareTransaction.d.ts +1 -5
  38. package/lib/bridge/generic-alpaca/prepareTransaction.d.ts.map +1 -1
  39. package/lib/bridge/generic-alpaca/prepareTransaction.js +5 -28
  40. package/lib/bridge/generic-alpaca/prepareTransaction.js.map +1 -1
  41. package/lib/bridge/generic-alpaca/signOperation.d.ts +1 -1
  42. package/lib/bridge/generic-alpaca/signOperation.d.ts.map +1 -1
  43. package/lib/bridge/generic-alpaca/signOperation.js +13 -64
  44. package/lib/bridge/generic-alpaca/signOperation.js.map +1 -1
  45. package/lib/bridge/generic-alpaca/signer/index.d.ts +1 -1
  46. package/lib/bridge/generic-alpaca/signer/index.d.ts.map +1 -1
  47. package/lib/bridge/generic-alpaca/signer/index.js +5 -38
  48. package/lib/bridge/generic-alpaca/signer/index.js.map +1 -1
  49. package/lib/bridge/generic-alpaca/signer/signTransaction.d.ts +0 -2
  50. package/lib/bridge/generic-alpaca/signer/signTransaction.d.ts.map +1 -1
  51. package/lib/bridge/generic-alpaca/signer/signTransaction.js +1 -8
  52. package/lib/bridge/generic-alpaca/signer/signTransaction.js.map +1 -1
  53. package/lib/bridge/generic-alpaca/signer/types.d.ts +0 -3
  54. package/lib/bridge/generic-alpaca/signer/types.d.ts.map +1 -1
  55. package/lib/bridge/generic-alpaca/tests/estimateMaxSpendable.test.js +46 -70
  56. package/lib/bridge/generic-alpaca/tests/estimateMaxSpendable.test.js.map +1 -1
  57. package/lib/bridge/generic-alpaca/tests/prepareTransaction.test.js +1 -1
  58. package/lib/bridge/generic-alpaca/tests/prepareTransaction.test.js.map +1 -1
  59. package/lib/bridge/generic-alpaca/tests/signOperation.test.js +22 -25
  60. package/lib/bridge/generic-alpaca/tests/signOperation.test.js.map +1 -1
  61. package/lib/bridge/generic-alpaca/utils.d.ts +1 -36
  62. package/lib/bridge/generic-alpaca/utils.d.ts.map +1 -1
  63. package/lib/bridge/generic-alpaca/utils.js +14 -130
  64. package/lib/bridge/generic-alpaca/utils.js.map +1 -1
  65. package/lib/bridge/generic-alpaca/utils.test.d.ts.map +1 -0
  66. package/lib/bridge/generic-alpaca/{tests/utils.test.js → utils.test.js} +1 -1
  67. package/lib/bridge/generic-alpaca/utils.test.js.map +1 -0
  68. package/lib/bridge/impl.d.ts.map +1 -1
  69. package/lib/bridge/impl.js +4 -5
  70. package/lib/bridge/impl.js.map +1 -1
  71. package/lib/e2e/enum/Account.js +4 -4
  72. package/lib/e2e/enum/Account.js.map +1 -1
  73. package/lib/e2e/enum/AppInfos.d.ts +1 -1
  74. package/lib/e2e/enum/AppInfos.d.ts.map +1 -1
  75. package/lib/e2e/enum/AppInfos.js +1 -1
  76. package/lib/e2e/enum/AppInfos.js.map +1 -1
  77. package/lib/e2e/enum/Currency.d.ts.map +1 -1
  78. package/lib/e2e/enum/Currency.js +3 -3
  79. package/lib/e2e/enum/Currency.js.map +1 -1
  80. package/lib/e2e/speculos.js +2 -2
  81. package/lib/e2e/speculos.js.map +1 -1
  82. package/lib/exchange/index.d.ts.map +1 -1
  83. package/lib/exchange/index.js +0 -1
  84. package/lib/exchange/index.js.map +1 -1
  85. package/lib/families/canton/bridge.integration.test.d.ts +2 -0
  86. package/lib/families/canton/bridge.integration.test.d.ts.map +1 -0
  87. package/lib/families/canton/bridge.integration.test.js +7 -0
  88. package/lib/families/canton/bridge.integration.test.js.map +1 -0
  89. package/lib/families/stellar/bridge/logic.d.ts +1 -1
  90. package/lib/families/stellar/bridge/logic.d.ts.map +1 -1
  91. package/lib/families/stellar/bridge/logic.js +1 -1
  92. package/lib/families/stellar/bridge/logic.js.map +1 -1
  93. package/lib/families/stellar/bridge/mock.js +2 -2
  94. package/lib/families/stellar/bridge/mock.js.map +1 -1
  95. package/lib/families/stellar/setup.d.ts +6 -3
  96. package/lib/families/stellar/setup.d.ts.map +1 -1
  97. package/lib/families/stellar/setup.js +12 -3
  98. package/lib/families/stellar/setup.js.map +1 -1
  99. package/lib/families/xrp/bridge/mock.js +2 -2
  100. package/lib/families/xrp/bridge/mock.js.map +1 -1
  101. package/lib/featureFlags/defaultFeatures.d.ts.map +1 -1
  102. package/lib/featureFlags/defaultFeatures.js +2 -4
  103. package/lib/featureFlags/defaultFeatures.js.map +1 -1
  104. package/lib/generated/bridge/js.d.ts +1 -0
  105. package/lib/generated/bridge/js.d.ts.map +1 -1
  106. package/lib/generated/bridge/js.js +14 -12
  107. package/lib/generated/bridge/js.js.map +1 -1
  108. package/lib/generated/transaction.d.ts +1 -1
  109. package/lib/modularDrawer/__test__/useModularDrawerVisibility.test.js +14 -229
  110. package/lib/modularDrawer/__test__/useModularDrawerVisibility.test.js.map +1 -1
  111. package/lib/modularDrawer/enums.d.ts +1 -0
  112. package/lib/modularDrawer/enums.d.ts.map +1 -1
  113. package/lib/modularDrawer/enums.js +1 -0
  114. package/lib/modularDrawer/enums.js.map +1 -1
  115. package/lib/modularDrawer/useModularDrawerVisibility.d.ts +1 -7
  116. package/lib/modularDrawer/useModularDrawerVisibility.d.ts.map +1 -1
  117. package/lib/modularDrawer/useModularDrawerVisibility.js +2 -18
  118. package/lib/modularDrawer/useModularDrawerVisibility.js.map +1 -1
  119. package/lib-es/__tests__/test-helpers/bridge.d.ts.map +1 -1
  120. package/lib-es/__tests__/test-helpers/bridge.js +1 -3
  121. package/lib-es/__tests__/test-helpers/bridge.js.map +1 -1
  122. package/lib-es/bridge/generic-alpaca/accountBridge.d.ts +1 -1
  123. package/lib-es/bridge/generic-alpaca/accountBridge.d.ts.map +1 -1
  124. package/lib-es/bridge/generic-alpaca/accountBridge.js.map +1 -1
  125. package/lib-es/bridge/generic-alpaca/alpaca/index.d.ts +1 -1
  126. package/lib-es/bridge/generic-alpaca/alpaca/index.d.ts.map +1 -1
  127. package/lib-es/bridge/generic-alpaca/alpaca/index.js +2 -4
  128. package/lib-es/bridge/generic-alpaca/alpaca/index.js.map +1 -1
  129. package/lib-es/bridge/generic-alpaca/alpaca/network/network-alpaca.d.ts +4 -4
  130. package/lib-es/bridge/generic-alpaca/alpaca/network/network-alpaca.d.ts.map +1 -1
  131. package/lib-es/bridge/generic-alpaca/alpaca/network/network-alpaca.js +10 -10
  132. package/lib-es/bridge/generic-alpaca/alpaca/network/network-alpaca.js.map +1 -1
  133. package/lib-es/bridge/generic-alpaca/broadcast.d.ts +1 -1
  134. package/lib-es/bridge/generic-alpaca/broadcast.d.ts.map +1 -1
  135. package/lib-es/bridge/generic-alpaca/broadcast.js.map +1 -1
  136. package/lib-es/bridge/generic-alpaca/createTransaction.d.ts +9 -17
  137. package/lib-es/bridge/generic-alpaca/createTransaction.d.ts.map +1 -1
  138. package/lib-es/bridge/generic-alpaca/createTransaction.js +9 -35
  139. package/lib-es/bridge/generic-alpaca/createTransaction.js.map +1 -1
  140. package/lib-es/bridge/generic-alpaca/currencyBridge.d.ts +1 -1
  141. package/lib-es/bridge/generic-alpaca/currencyBridge.d.ts.map +1 -1
  142. package/lib-es/bridge/generic-alpaca/currencyBridge.js.map +1 -1
  143. package/lib-es/bridge/generic-alpaca/estimateMaxSpendable.d.ts +1 -1
  144. package/lib-es/bridge/generic-alpaca/estimateMaxSpendable.d.ts.map +1 -1
  145. package/lib-es/bridge/generic-alpaca/estimateMaxSpendable.js +0 -9
  146. package/lib-es/bridge/generic-alpaca/estimateMaxSpendable.js.map +1 -1
  147. package/lib-es/bridge/generic-alpaca/getAccountShape.d.ts +1 -1
  148. package/lib-es/bridge/generic-alpaca/getAccountShape.d.ts.map +1 -1
  149. package/lib-es/bridge/generic-alpaca/getAccountShape.js +37 -66
  150. package/lib-es/bridge/generic-alpaca/getAccountShape.js.map +1 -1
  151. package/lib-es/bridge/generic-alpaca/getTransactionStatus.d.ts +1 -1
  152. package/lib-es/bridge/generic-alpaca/getTransactionStatus.d.ts.map +1 -1
  153. package/lib-es/bridge/generic-alpaca/getTransactionStatus.js +15 -27
  154. package/lib-es/bridge/generic-alpaca/getTransactionStatus.js.map +1 -1
  155. package/lib-es/bridge/generic-alpaca/prepareTransaction.d.ts +1 -5
  156. package/lib-es/bridge/generic-alpaca/prepareTransaction.d.ts.map +1 -1
  157. package/lib-es/bridge/generic-alpaca/prepareTransaction.js +4 -26
  158. package/lib-es/bridge/generic-alpaca/prepareTransaction.js.map +1 -1
  159. package/lib-es/bridge/generic-alpaca/signOperation.d.ts +1 -1
  160. package/lib-es/bridge/generic-alpaca/signOperation.d.ts.map +1 -1
  161. package/lib-es/bridge/generic-alpaca/signOperation.js +13 -61
  162. package/lib-es/bridge/generic-alpaca/signOperation.js.map +1 -1
  163. package/lib-es/bridge/generic-alpaca/signer/index.d.ts +1 -1
  164. package/lib-es/bridge/generic-alpaca/signer/index.d.ts.map +1 -1
  165. package/lib-es/bridge/generic-alpaca/signer/index.js +6 -39
  166. package/lib-es/bridge/generic-alpaca/signer/index.js.map +1 -1
  167. package/lib-es/bridge/generic-alpaca/signer/signTransaction.d.ts +0 -2
  168. package/lib-es/bridge/generic-alpaca/signer/signTransaction.d.ts.map +1 -1
  169. package/lib-es/bridge/generic-alpaca/signer/signTransaction.js +0 -6
  170. package/lib-es/bridge/generic-alpaca/signer/signTransaction.js.map +1 -1
  171. package/lib-es/bridge/generic-alpaca/signer/types.d.ts +0 -3
  172. package/lib-es/bridge/generic-alpaca/signer/types.d.ts.map +1 -1
  173. package/lib-es/bridge/generic-alpaca/tests/estimateMaxSpendable.test.js +46 -70
  174. package/lib-es/bridge/generic-alpaca/tests/estimateMaxSpendable.test.js.map +1 -1
  175. package/lib-es/bridge/generic-alpaca/tests/prepareTransaction.test.js +1 -1
  176. package/lib-es/bridge/generic-alpaca/tests/prepareTransaction.test.js.map +1 -1
  177. package/lib-es/bridge/generic-alpaca/tests/signOperation.test.js +22 -25
  178. package/lib-es/bridge/generic-alpaca/tests/signOperation.test.js.map +1 -1
  179. package/lib-es/bridge/generic-alpaca/utils.d.ts +1 -36
  180. package/lib-es/bridge/generic-alpaca/utils.d.ts.map +1 -1
  181. package/lib-es/bridge/generic-alpaca/utils.js +14 -130
  182. package/lib-es/bridge/generic-alpaca/utils.js.map +1 -1
  183. package/lib-es/bridge/generic-alpaca/utils.test.d.ts.map +1 -0
  184. package/lib-es/bridge/generic-alpaca/{tests/utils.test.js → utils.test.js} +1 -1
  185. package/lib-es/bridge/generic-alpaca/utils.test.js.map +1 -0
  186. package/lib-es/bridge/impl.d.ts.map +1 -1
  187. package/lib-es/bridge/impl.js +4 -5
  188. package/lib-es/bridge/impl.js.map +1 -1
  189. package/lib-es/e2e/enum/Account.js +4 -4
  190. package/lib-es/e2e/enum/Account.js.map +1 -1
  191. package/lib-es/e2e/enum/AppInfos.d.ts +1 -1
  192. package/lib-es/e2e/enum/AppInfos.d.ts.map +1 -1
  193. package/lib-es/e2e/enum/AppInfos.js +1 -1
  194. package/lib-es/e2e/enum/AppInfos.js.map +1 -1
  195. package/lib-es/e2e/enum/Currency.d.ts.map +1 -1
  196. package/lib-es/e2e/enum/Currency.js +3 -3
  197. package/lib-es/e2e/enum/Currency.js.map +1 -1
  198. package/lib-es/e2e/speculos.js +2 -2
  199. package/lib-es/e2e/speculos.js.map +1 -1
  200. package/lib-es/exchange/index.d.ts.map +1 -1
  201. package/lib-es/exchange/index.js +0 -1
  202. package/lib-es/exchange/index.js.map +1 -1
  203. package/lib-es/families/canton/bridge.integration.test.d.ts +2 -0
  204. package/lib-es/families/canton/bridge.integration.test.d.ts.map +1 -0
  205. package/lib-es/families/canton/bridge.integration.test.js +5 -0
  206. package/lib-es/families/canton/bridge.integration.test.js.map +1 -0
  207. package/lib-es/families/stellar/bridge/logic.d.ts +1 -1
  208. package/lib-es/families/stellar/bridge/logic.d.ts.map +1 -1
  209. package/lib-es/families/stellar/bridge/logic.js +1 -1
  210. package/lib-es/families/stellar/bridge/logic.js.map +1 -1
  211. package/lib-es/families/stellar/bridge/mock.js +2 -2
  212. package/lib-es/families/stellar/bridge/mock.js.map +1 -1
  213. package/lib-es/families/stellar/setup.d.ts +6 -3
  214. package/lib-es/families/stellar/setup.d.ts.map +1 -1
  215. package/lib-es/families/stellar/setup.js +10 -2
  216. package/lib-es/families/stellar/setup.js.map +1 -1
  217. package/lib-es/families/xrp/bridge/mock.js +2 -2
  218. package/lib-es/families/xrp/bridge/mock.js.map +1 -1
  219. package/lib-es/featureFlags/defaultFeatures.d.ts.map +1 -1
  220. package/lib-es/featureFlags/defaultFeatures.js +2 -4
  221. package/lib-es/featureFlags/defaultFeatures.js.map +1 -1
  222. package/lib-es/generated/bridge/js.d.ts +1 -0
  223. package/lib-es/generated/bridge/js.d.ts.map +1 -1
  224. package/lib-es/generated/bridge/js.js +2 -0
  225. package/lib-es/generated/bridge/js.js.map +1 -1
  226. package/lib-es/generated/transaction.d.ts +1 -1
  227. package/lib-es/modularDrawer/__test__/useModularDrawerVisibility.test.js +14 -229
  228. package/lib-es/modularDrawer/__test__/useModularDrawerVisibility.test.js.map +1 -1
  229. package/lib-es/modularDrawer/enums.d.ts +1 -0
  230. package/lib-es/modularDrawer/enums.d.ts.map +1 -1
  231. package/lib-es/modularDrawer/enums.js +1 -0
  232. package/lib-es/modularDrawer/enums.js.map +1 -1
  233. package/lib-es/modularDrawer/useModularDrawerVisibility.d.ts +1 -7
  234. package/lib-es/modularDrawer/useModularDrawerVisibility.d.ts.map +1 -1
  235. package/lib-es/modularDrawer/useModularDrawerVisibility.js +2 -18
  236. package/lib-es/modularDrawer/useModularDrawerVisibility.js.map +1 -1
  237. package/package.json +70 -71
  238. package/src/__tests__/test-helpers/bridge.ts +1 -3
  239. package/src/bridge/generic-alpaca/accountBridge.ts +4 -1
  240. package/src/bridge/generic-alpaca/alpaca/index.ts +2 -7
  241. package/src/bridge/generic-alpaca/alpaca/network/network-alpaca.ts +22 -17
  242. package/src/bridge/generic-alpaca/broadcast.ts +4 -1
  243. package/src/bridge/generic-alpaca/createTransaction.ts +18 -48
  244. package/src/bridge/generic-alpaca/currencyBridge.ts +1 -1
  245. package/src/bridge/generic-alpaca/estimateMaxSpendable.ts +4 -13
  246. package/src/bridge/generic-alpaca/getAccountShape.ts +46 -84
  247. package/src/bridge/generic-alpaca/getTransactionStatus.ts +22 -46
  248. package/src/bridge/generic-alpaca/prepareTransaction.ts +7 -41
  249. package/src/bridge/generic-alpaca/signOperation.ts +18 -85
  250. package/src/bridge/generic-alpaca/signer/index.ts +7 -43
  251. package/src/bridge/generic-alpaca/signer/signTransaction.ts +0 -11
  252. package/src/bridge/generic-alpaca/signer/types.ts +0 -1
  253. package/src/bridge/generic-alpaca/tests/estimateMaxSpendable.test.ts +47 -72
  254. package/src/bridge/generic-alpaca/tests/prepareTransaction.test.ts +1 -1
  255. package/src/bridge/generic-alpaca/tests/signOperation.test.ts +26 -28
  256. package/src/bridge/generic-alpaca/{tests/utils.test.ts → utils.test.ts} +1 -1
  257. package/src/bridge/generic-alpaca/utils.ts +18 -158
  258. package/src/bridge/impl.ts +4 -5
  259. package/src/e2e/enum/Account.ts +4 -4
  260. package/src/e2e/enum/AppInfos.ts +1 -1
  261. package/src/e2e/enum/Currency.ts +13 -3
  262. package/src/e2e/speculos.ts +2 -2
  263. package/src/exchange/index.ts +0 -1
  264. package/src/families/canton/bridge.integration.test.ts +6 -0
  265. package/src/families/stellar/__snapshots__/bridge.integration.test.ts.snap +2009 -202
  266. package/src/families/stellar/bridge/logic.ts +1 -1
  267. package/src/families/stellar/bridge/mock.ts +2 -2
  268. package/src/families/stellar/setup.ts +22 -2
  269. package/src/families/xrp/bridge/mock.ts +2 -2
  270. package/src/featureFlags/defaultFeatures.ts +2 -4
  271. package/src/generated/bridge/js.ts +2 -0
  272. package/src/modularDrawer/__test__/useModularDrawerVisibility.test.ts +14 -345
  273. package/src/modularDrawer/enums.ts +1 -0
  274. package/src/modularDrawer/useModularDrawerVisibility.ts +2 -26
  275. package/lib/bridge/generic-alpaca/buildSubAccounts.d.ts +0 -17
  276. package/lib/bridge/generic-alpaca/buildSubAccounts.d.ts.map +0 -1
  277. package/lib/bridge/generic-alpaca/buildSubAccounts.js +0 -75
  278. package/lib/bridge/generic-alpaca/buildSubAccounts.js.map +0 -1
  279. package/lib/bridge/generic-alpaca/tests/utils.test.d.ts.map +0 -1
  280. package/lib/bridge/generic-alpaca/tests/utils.test.js.map +0 -1
  281. package/lib-es/bridge/generic-alpaca/buildSubAccounts.d.ts +0 -17
  282. package/lib-es/bridge/generic-alpaca/buildSubAccounts.d.ts.map +0 -1
  283. package/lib-es/bridge/generic-alpaca/buildSubAccounts.js +0 -65
  284. package/lib-es/bridge/generic-alpaca/buildSubAccounts.js.map +0 -1
  285. package/lib-es/bridge/generic-alpaca/tests/utils.test.d.ts.map +0 -1
  286. package/lib-es/bridge/generic-alpaca/tests/utils.test.js.map +0 -1
  287. package/src/bridge/generic-alpaca/buildSubAccounts.ts +0 -110
  288. /package/lib/bridge/generic-alpaca/{tests/utils.test.d.ts → utils.test.d.ts} +0 -0
  289. /package/lib-es/bridge/generic-alpaca/{tests/utils.test.d.ts → utils.test.d.ts} +0 -0
@@ -1,24 +1,19 @@
1
1
  import { createApi as createXrpApi } from "@ledgerhq/coin-xrp/api/index";
2
- import { createApi as createStellarApi } from "@ledgerhq/coin-stellar/api/index";
3
2
  import { getCurrencyConfiguration } from "../../../config";
4
3
  import { getCryptoCurrencyById } from "@ledgerhq/cryptoassets/currencies";
5
4
  import { getNetworkAlpacaApi } from "./network/network-alpaca";
6
5
  import { Api } from "@ledgerhq/coin-framework/api/types";
7
6
  import { XrpCoinConfig } from "@ledgerhq/coin-xrp/config";
8
- import { StellarCoinConfig } from "@ledgerhq/coin-stellar/config";
9
7
 
10
- export function getAlpacaApi(network, kind): Api<any> {
8
+ export function getAlpacaApi(network: string, kind: "local" | "remote"): Api<any> {
11
9
  if (kind === "local") {
12
10
  switch (network) {
13
11
  case "ripple":
14
12
  case "xrp":
15
13
  return createXrpApi(
16
14
  getCurrencyConfiguration<XrpCoinConfig>(getCryptoCurrencyById("ripple")),
17
- ) as Api<any>; // FIXME: createXrpApi returns a strongly typed Api<XrpSender>, fix Api<any> to allow it
18
- case "stellar":
19
- return createStellarApi(
20
- getCurrencyConfiguration<StellarCoinConfig>(getCryptoCurrencyById("stellar")),
21
15
  ) as Api<any>;
16
+ // as unknown as Api<any>; // FIXME: createXrpApi returns a strongly typed Api<XrpSender>, fix Api<any> to allow it
22
17
  }
23
18
  }
24
19
  return getNetworkAlpacaApi(network) satisfies Partial<Api<any>> as Api<any>;
@@ -1,4 +1,5 @@
1
- import type {
1
+ import {
2
+ Account,
2
3
  Balance,
3
4
  Block,
4
5
  BlockInfo,
@@ -6,9 +7,10 @@ import type {
6
7
  FeeEstimation,
7
8
  Pagination,
8
9
  TransactionIntent,
10
+ Transaction,
9
11
  TransactionValidation,
12
+ AccountInfo,
10
13
  Api,
11
- AssetInfo,
12
14
  Cursor,
13
15
  Page,
14
16
  Stake,
@@ -16,7 +18,7 @@ import type {
16
18
  } from "@ledgerhq/coin-framework/api/index";
17
19
  import network from "@ledgerhq/live-network";
18
20
 
19
- function adaptOp<T extends AssetInfo>(backendOp: Operation<T>): Operation<T> {
21
+ function adaptOp(backendOp: any): Operation<any> {
20
22
  const { date } = backendOp.tx;
21
23
  const newDate = new Date(date);
22
24
 
@@ -29,7 +31,7 @@ function adaptOp<T extends AssetInfo>(backendOp: Operation<T>): Operation<T> {
29
31
 
30
32
  const ALPACA_URL = "http://0.0.0.0:3000";
31
33
 
32
- const buildBroadcast = networkFamily =>
34
+ const buildBroadcast = (networkFamily: string) =>
33
35
  async function broadcast(signedOperation: string): Promise<string> {
34
36
  const { data } = await network<
35
37
  {
@@ -48,7 +50,7 @@ const buildBroadcast = networkFamily =>
48
50
  return data.transactionIdentifier;
49
51
  };
50
52
 
51
- const buildCombine = networkFamily =>
53
+ const buildCombine = (networkFamily: string) =>
52
54
  async function combine(tx: string, signature: string, pubKey?: string): Promise<string> {
53
55
  const { data } = await network<
54
56
  {
@@ -67,7 +69,7 @@ const buildCombine = networkFamily =>
67
69
  return data.signedTransaction;
68
70
  };
69
71
 
70
- const buildEstimateFees = networkFamily =>
72
+ const buildEstimateFees = (networkFamily: string) =>
71
73
  async function estimateFees(intent: TransactionIntent<any>): Promise<FeeEstimation> {
72
74
  const { data } = await network<{ fee: string }, unknown>({
73
75
  method: "POST",
@@ -84,8 +86,11 @@ const buildEstimateFees = networkFamily =>
84
86
  };
85
87
  };
86
88
 
87
- const buildValidateIntent = networkFamily =>
88
- async function validateIntent(transaction: TransactionIntent): Promise<TransactionValidation> {
89
+ const buildValidateIntent = (networkFamily: string) =>
90
+ async function validateIntent(
91
+ account: Account,
92
+ transaction: Transaction,
93
+ ): Promise<TransactionValidation> {
89
94
  const { data } = await network<
90
95
  {
91
96
  errors: Record<string, Error>;
@@ -100,6 +105,7 @@ const buildValidateIntent = networkFamily =>
100
105
  url: `${ALPACA_URL}/${networkFamily}/transaction/validate`,
101
106
  data: {
102
107
  transaction,
108
+ account,
103
109
  },
104
110
  });
105
111
  return data;
@@ -116,14 +122,13 @@ const buildGetBalance = (networkFamily: string) =>
116
122
  {
117
123
  value: BigInt(data.value),
118
124
  asset: data.asset,
119
- locked: BigInt(data?.locked ?? "0"),
120
125
  },
121
126
  ];
122
127
  };
123
128
 
124
- const buildGetSequence = (networkFamily: string) =>
125
- async function getSequence(address: string): Promise<number> {
126
- const { data } = await network<number, unknown>({
129
+ const buildGetAccountInfo = (networkFamily: string) =>
130
+ async function getBalance(address: string): Promise<AccountInfo> {
131
+ const { data } = await network<AccountInfo, unknown>({
127
132
  method: "GET",
128
133
  url: `${ALPACA_URL}/${networkFamily}/account/${address}/info`,
129
134
  });
@@ -131,10 +136,10 @@ const buildGetSequence = (networkFamily: string) =>
131
136
  return data;
132
137
  };
133
138
 
134
- const buildListOperations = networkFamily =>
139
+ const buildListOperations = (networkFamily: string) =>
135
140
  async function listOperations(
136
141
  address: string,
137
- pagination: Pagination = { minHeight: 0 },
142
+ pagination: Pagination,
138
143
  ): Promise<[Operation<any>[], string]> {
139
144
  const { data } = await network<{ operations: Operation<any>[] }, unknown>({
140
145
  method: "GET",
@@ -146,7 +151,7 @@ const buildListOperations = networkFamily =>
146
151
  return [data.operations.map(op => adaptOp(op)), ""];
147
152
  };
148
153
 
149
- const buildLastBlock = networkFamily =>
154
+ const buildLastBlock = (networkFamily: string) =>
150
155
  async function lastBlock(): Promise<BlockInfo> {
151
156
  const { data } = await network<any, unknown>({
152
157
  method: "GET",
@@ -159,7 +164,7 @@ const buildLastBlock = networkFamily =>
159
164
  };
160
165
  };
161
166
 
162
- const buildCraftTransaction = networkFamily =>
167
+ const buildCraftTransaction = (networkFamily: string) =>
163
168
  async function craftTransaction(intent: TransactionIntent<any>): Promise<string> {
164
169
  const { data } = await network<any, unknown>({
165
170
  method: "POST",
@@ -181,7 +186,7 @@ export const getNetworkAlpacaApi = (networkFamily: string) =>
181
186
  validateIntent: buildValidateIntent(networkFamily),
182
187
  estimateFees: buildEstimateFees(networkFamily),
183
188
  getBalance: buildGetBalance(networkFamily),
184
- getSequence: buildGetSequence(networkFamily),
189
+ getAccountInfo: buildGetAccountInfo(networkFamily),
185
190
  listOperations: buildListOperations(networkFamily),
186
191
  lastBlock: buildLastBlock(networkFamily),
187
192
  craftTransaction: buildCraftTransaction(networkFamily),
@@ -2,7 +2,10 @@ import { AccountBridge, TransactionCommon } from "@ledgerhq/types-live";
2
2
  import { patchOperationWithHash } from "../../operation";
3
3
  import { getAlpacaApi } from "./alpaca";
4
4
 
5
- export const genericBroadcast: (network, kind) => AccountBridge<TransactionCommon>["broadcast"] =
5
+ export const genericBroadcast: (
6
+ network: string,
7
+ kind: "local" | "remote",
8
+ ) => AccountBridge<TransactionCommon>["broadcast"] =
6
9
  (network, kind) =>
7
10
  async ({ signedOperation: { signature, operation } }) => {
8
11
  const hash = await getAlpacaApi(network, kind).broadcast(signature);
@@ -1,57 +1,27 @@
1
- import { Account, TokenAccount, TransactionCommon } from "@ledgerhq/types-live";
1
+ import { Account, TransactionCommon } from "@ledgerhq/types-live";
2
2
  import BigNumber from "bignumber.js";
3
3
  import type { Unit } from "@ledgerhq/types-cryptoassets";
4
4
 
5
- export enum NetworkCongestionLevel {
6
- LOW = "LOW",
7
- MEDIUM = "MEDIUM",
8
- HIGH = "HIGH",
9
- }
10
-
11
5
  export type NetworkInfo = {
12
- fees: BigNumber;
6
+ family: "xrp";
7
+ serverFee: BigNumber;
8
+ baseReserve: BigNumber;
13
9
  };
14
10
 
15
- export function createTransaction(account: Account | TokenAccount): TransactionCommon & {
11
+ export function createTransaction(account: Account): TransactionCommon & {
16
12
  family: string;
17
- fees?: BigNumber | null;
18
- tag?: number | null | undefined;
19
- feeCustomUnit?: Unit | null | undefined;
20
- memoType?: string | null;
21
- memoValue?: string | null;
22
- mode?: "send" | "changeTrust";
23
- assetReference?: string;
24
- assetOwner?: string;
25
- networkInfo?: NetworkInfo | null;
13
+ fee: BigNumber | null | undefined;
14
+ networkInfo: NetworkInfo | null | undefined;
15
+ tag: number | null | undefined;
16
+ feeCustomUnit: Unit | null | undefined;
26
17
  } {
27
- const currency =
28
- account.type === "TokenAccount" ? account.token.parentCurrency : account.currency;
29
- switch (currency.family) {
30
- case "xrp":
31
- case "ripple":
32
- return {
33
- family: currency.family,
34
- amount: BigNumber(0),
35
- recipient: "",
36
- fees: null,
37
- tag: undefined,
38
- feeCustomUnit: null, // NOTE: XRP does not use custom units for fees anymore
39
- };
40
- case "stellar":
41
- return {
42
- family: currency.family,
43
- amount: new BigNumber(0),
44
- fees: null,
45
- recipient: "",
46
- memoValue: null,
47
- memoType: null,
48
- useAllAmount: false,
49
- mode: "send",
50
- assetReference: "",
51
- assetOwner: "",
52
- networkInfo: null,
53
- };
54
- default:
55
- throw new Error(`Unsupported currency family: ${currency.family}`);
56
- }
18
+ return {
19
+ family: account.currency.family,
20
+ amount: BigNumber(0),
21
+ recipient: "",
22
+ fee: null,
23
+ tag: undefined,
24
+ networkInfo: null,
25
+ feeCustomUnit: null,
26
+ };
57
27
  }
@@ -3,7 +3,7 @@ import { CurrencyBridge } from "@ledgerhq/types-live";
3
3
  import { genericGetAccountShape } from "./getAccountShape";
4
4
  import { getSigner } from "./signer";
5
5
 
6
- export function getAlpacaCurrencyBridge(network: string, kind: string): CurrencyBridge {
6
+ export function getAlpacaCurrencyBridge(network: string, kind: "local" | "remote"): CurrencyBridge {
7
7
  return {
8
8
  preload: () => Promise.resolve({}),
9
9
  hydrate: () => {
@@ -6,30 +6,21 @@ import { transactionToIntent } from "./utils";
6
6
  import BigNumber from "bignumber.js";
7
7
 
8
8
  export function genericEstimateMaxSpendable(
9
- network,
10
- kind,
9
+ network: string,
10
+ kind: "local" | "remote",
11
11
  ): AccountBridge<any>["estimateMaxSpendable"] {
12
12
  return async ({ account, parentAccount, transaction }) => {
13
- if (account.type === "TokenAccount") {
14
- return account.spendableBalance;
15
- }
16
13
  const mainAccount = getMainAccount(account, parentAccount);
14
+
17
15
  const draftTransaction = {
18
16
  ...createTransaction(account as any),
19
17
  ...transaction,
20
18
  amount: mainAccount.spendableBalance,
21
- useAllAmount: true,
22
- fees: transaction?.fees ? BigInt(transaction.fees.toString()) : 0n,
23
19
  };
24
20
  const fees = await getAlpacaApi(network, kind).estimateFees(
25
21
  transactionToIntent(mainAccount, draftTransaction),
26
22
  );
27
- const { amount } = await getAlpacaApi(network, kind).validateIntent(
28
- transactionToIntent(account, { ...draftTransaction }),
29
- );
30
- if (network === "stellar") {
31
- return amount > 0 ? new BigNumber(amount.toString()) : new BigNumber(0);
32
- }
23
+
33
24
  const bnFee = BigNumber(fees.value.toString());
34
25
  return BigNumber.max(0, account.spendableBalance.minus(bnFee));
35
26
  };
@@ -3,97 +3,59 @@ import { GetAccountShape, mergeOps } from "@ledgerhq/coin-framework/bridge/jsHel
3
3
  import BigNumber from "bignumber.js";
4
4
  import { getAlpacaApi } from "./alpaca";
5
5
  import { adaptCoreOperationToLiveOperation, extractBalance } from "./utils";
6
- import { inferSubOperations } from "@ledgerhq/coin-framework/serialization";
7
- import { findToken } from "./buildSubAccounts";
8
- import { buildSubAccounts, OperationCommon } from "./buildSubAccounts";
9
6
 
10
- export function genericGetAccountShape(network: string, kind: string): GetAccountShape {
11
- return async (info, syncConfig) => {
12
- const { address, initialAccount, currency, derivationMode } = info;
13
- const alpacaApi = getAlpacaApi(network, kind);
14
-
15
- if (alpacaApi.getChainSpecificRules) {
16
- const chainSpecificValidation = alpacaApi.getChainSpecificRules();
17
- if (chainSpecificValidation.getAccountShape) {
18
- chainSpecificValidation.getAccountShape(address);
7
+ export function genericGetAccountShape(network: string, kind: "local" | "remote"): GetAccountShape {
8
+ return async info => {
9
+ try {
10
+ const { address, initialAccount, currency, derivationMode } = info;
11
+ const accountId = encodeAccountId({
12
+ type: "js",
13
+ version: "2",
14
+ currencyId: currency.id,
15
+ xpubOrAddress: address,
16
+ derivationMode,
17
+ });
18
+
19
+ const blockInfo = await getAlpacaApi(network, kind).lastBlock();
20
+
21
+ const balances = await getAlpacaApi(network, kind).getBalance(address);
22
+ const nativeBalance = extractBalance(balances, "native");
23
+ const balance = BigNumber(nativeBalance.value.toString());
24
+
25
+ let spendableBalance: BigNumber;
26
+ if (nativeBalance.locked) {
27
+ spendableBalance = BigNumber.max(
28
+ balance.minus(BigNumber(nativeBalance.locked.toString())),
29
+ BigNumber(0),
30
+ );
31
+ } else {
32
+ spendableBalance = initialAccount?.spendableBalance || balance;
19
33
  }
20
- }
21
-
22
- const accountId = encodeAccountId({
23
- type: "js",
24
- version: "2",
25
- currencyId: currency.id,
26
- xpubOrAddress: address,
27
- derivationMode,
28
- });
29
-
30
- const blockInfo = await alpacaApi.lastBlock();
31
- const balanceRes = await alpacaApi.getBalance(address);
32
- const nativeAsset = extractBalance(balanceRes, "native");
33
-
34
- const assetsBalance = balanceRes
35
- .filter(b => b.asset.type !== "native")
36
- .filter(b => findToken(currency, b));
37
-
38
- const nativeBalance = BigInt(nativeAsset?.value ?? "0");
39
-
40
- const spendableBalance = BigInt(nativeBalance - BigInt(nativeAsset?.locked ?? "0"));
34
+ const oldOperations = initialAccount?.operations || [];
41
35
 
42
- const oldOps = (initialAccount?.operations || []) as OperationCommon[];
43
- const lastPagingToken = oldOps[0]?.extra?.pagingToken || "";
36
+ const blockHeight = oldOperations.length ? (oldOperations[0].blockHeight ?? 0) + 1 : 0;
44
37
 
45
- const blockHeight = oldOps.length ? (oldOps[0].blockHeight ?? 0) + 1 : 0;
46
- const paginationParams: any = { minHeight: blockHeight };
47
- if (lastPagingToken) {
48
- paginationParams.lastPagingToken = lastPagingToken;
49
- }
50
-
51
- const [newCoreOps] = await alpacaApi.listOperations(address, paginationParams);
52
- const newOps = newCoreOps.map(op =>
53
- adaptCoreOperationToLiveOperation(accountId, op),
54
- ) as OperationCommon[];
55
- const mergedOps = mergeOps(oldOps, newOps) as OperationCommon[];
56
-
57
- const assetOperations: OperationCommon[] = [];
58
- mergedOps.forEach(operation => {
59
- if (
60
- operation?.extra?.assetReference &&
61
- operation?.extra?.assetOwner &&
62
- !["OPT_IN", "OPT_OUT"].includes(operation.type)
63
- ) {
64
- assetOperations.push(operation);
65
- }
66
- });
38
+ const [newOperations] = await getAlpacaApi(network, kind).listOperations(address, {
39
+ minHeight: blockHeight,
40
+ });
67
41
 
68
- const subAccounts =
69
- buildSubAccounts({
70
- currency,
71
- accountId,
72
- assetsBalance,
73
- syncConfig,
74
- operations: assetOperations,
75
- }) || [];
76
-
77
- const operationsWithSubs = mergedOps.map(op => {
78
- const subOperations = inferSubOperations(op.hash, subAccounts);
42
+ const operations = mergeOps(
43
+ oldOperations,
44
+ newOperations.map(op => adaptCoreOperationToLiveOperation(accountId, op)),
45
+ );
79
46
 
80
47
  return {
81
- ...op,
82
- subOperations,
48
+ id: accountId,
49
+ xpub: address,
50
+ blockHeight: operations.length === 0 ? 0 : blockInfo.height || initialAccount?.blockHeight,
51
+ balance,
52
+ spendableBalance,
53
+ operations,
54
+ operationsCount: operations.length,
83
55
  };
84
- });
85
-
86
- const res = {
87
- id: accountId,
88
- xpub: address,
89
- blockHeight:
90
- operationsWithSubs.length === 0 ? 0 : blockInfo.height || initialAccount?.blockHeight,
91
- balance: new BigNumber(nativeBalance.toString()),
92
- spendableBalance: new BigNumber(spendableBalance.toString()),
93
- operations: operationsWithSubs,
94
- subAccounts,
95
- operationsCount: operationsWithSubs.length,
96
- };
97
- return res;
56
+ } catch (e) {
57
+ console.error("Error in getAccountShape", e);
58
+ throw e;
59
+ }
98
60
  };
99
61
  }
@@ -1,62 +1,38 @@
1
1
  import { AccountBridge, TransactionCommon } from "@ledgerhq/types-live";
2
- import { AccountAwaitingSendPendingOperations } from "@ledgerhq/errors";
3
2
  import BigNumber from "bignumber.js";
4
3
  import { getAlpacaApi } from "./alpaca";
5
- import { transactionToIntent } from "./utils";
6
4
 
7
5
  // => alpaca validateIntent
8
6
  export function genericGetTransactionStatus(
9
- network,
10
- kind,
7
+ network: string,
8
+ kind: "local" | "remote",
11
9
  ): AccountBridge<any>["getTransactionStatus"] {
12
- return async (
13
- account,
14
- transaction: TransactionCommon & {
15
- fees: BigNumber | null | undefined;
16
- assetReference?: string;
17
- assetOwner?: string;
18
- mode?: string;
19
- subAccountId?: string;
20
- memoType?: string;
21
- memoValue?: string;
22
- },
23
- ) => {
10
+ return async (account, transaction: TransactionCommon & { fees: BigNumber }) => {
11
+ const { freshAddress, balance, currency } = account;
24
12
  const alpacaApi = getAlpacaApi(network, kind);
25
- const draftTransaction = {
26
- mode: transaction?.mode,
27
- recipient: transaction.recipient,
28
- amount: transaction.amount ?? new BigNumber(0),
29
- fees: transaction.fees ? BigInt(transaction.fees.toString()) : 0n,
30
- useAllAmount: !!transaction.useAllAmount,
31
- assetReference: transaction.assetReference || "",
32
- assetOwner: transaction.assetOwner || "",
33
- subAccountId: transaction.subAccountId || "",
34
- memoType: transaction.memoType || "",
35
- memoValue: transaction.memoValue || "",
36
- };
37
-
38
- if (alpacaApi.getChainSpecificRules) {
39
- const chainSpecificValidation = alpacaApi.getChainSpecificRules();
40
- if (chainSpecificValidation.getTransactionStatus.throwIfPendingOperation) {
41
- if (account.pendingOperations.length > 0) {
42
- throw new AccountAwaitingSendPendingOperations();
43
- }
44
- }
45
- }
46
-
47
- const { errors, warnings, estimatedFees, amount, totalSpent } = await alpacaApi.validateIntent(
48
- transactionToIntent(account, draftTransaction),
13
+ const { errors, warnings } = await alpacaApi.validateIntent(
14
+ {
15
+ currencyName: currency.name,
16
+ address: freshAddress,
17
+ balance: BigInt(balance.toString()),
18
+ currencyUnit: currency.units[0],
19
+ },
20
+ {
21
+ type: "PAYMENT", // NOTE: assuming payment by default here
22
+ recipient: transaction.recipient,
23
+ amount: BigInt(transaction.amount?.toString() ?? "0"),
24
+ fee: BigInt(transaction.fees?.toString() ?? "0"),
25
+ },
49
26
  );
50
27
 
28
+ const estimatedFees = transaction.fees || new BigNumber(0);
29
+
51
30
  return Promise.resolve({
52
31
  errors,
53
32
  warnings,
54
- estimatedFees:
55
- !transaction.fees || transaction.fees.isZero()
56
- ? new BigNumber(estimatedFees.toString())
57
- : transaction.fees,
58
- amount: transaction.amount.eq(0) ? new BigNumber(amount.toString()) : transaction.amount,
59
- totalSpent: new BigNumber(totalSpent.toString()),
33
+ estimatedFees,
34
+ amount: transaction.amount,
35
+ totalSpent: transaction.amount.plus(transaction.fees),
60
36
  });
61
37
  };
62
38
  }
@@ -2,7 +2,6 @@ import { Account, AccountBridge, TransactionCommon } from "@ledgerhq/types-live"
2
2
  import { getAlpacaApi } from "./alpaca";
3
3
  import { transactionToIntent } from "./utils";
4
4
  import BigNumber from "bignumber.js";
5
- import { NetworkInfo } from "./createTransaction";
6
5
 
7
6
  function bnEq(a: BigNumber | null | undefined, b: BigNumber | null | undefined): boolean {
8
7
  return !a && !b ? true : !a || !b ? false : a.eq(b);
@@ -10,51 +9,18 @@ function bnEq(a: BigNumber | null | undefined, b: BigNumber | null | undefined):
10
9
 
11
10
  export function genericPrepareTransaction(
12
11
  network: string,
13
- kind,
12
+ kind: "local" | "remote",
14
13
  ): AccountBridge<TransactionCommon, Account, any, any>["prepareTransaction"] {
15
- return async (
16
- account,
17
- transaction: TransactionCommon & {
18
- fees: BigNumber | null | undefined;
19
- assetReference?: string;
20
- assetOwner?: string;
21
- subAccountId?: string;
22
- networkInfo?: NetworkInfo | null;
23
- },
24
- ) => {
25
- const [assetReference, assetOwner] = getAssetInfos(transaction);
14
+ return async (account, transaction: TransactionCommon & { fees: BigNumber }) => {
26
15
  const fees = await getAlpacaApi(network, kind).estimateFees(
27
- transactionToIntent(account, {
28
- ...transaction,
29
- fees: transaction.fees ? BigInt(transaction.fees.toString()) : 0n,
30
- }),
16
+ transactionToIntent(account, transaction),
31
17
  );
32
- // NOTE: this is problematic, we should maybe have a method / object that lists what field warrant an update per chain
33
- // for reference, stellar checked this:
34
- // transaction.networkInfo !== networkInfo ||
35
- // transaction.baseReserve !== baseReserve
36
- if (!bnEq(transaction.fees, new BigNumber(fees.value.toString()))) {
37
- return {
38
- ...transaction,
39
- fees: new BigNumber(fees.value.toString()),
40
- assetReference,
41
- assetOwner,
42
- networkInfo: {
43
- fees: new BigNumber(fees.value.toString()),
44
- },
45
- };
18
+ const bnFee = BigNumber(fees.value.toString());
19
+
20
+ if (!bnEq(transaction.fees, bnFee)) {
21
+ return { ...transaction, fees: bnFee };
46
22
  }
47
23
 
48
24
  return transaction;
49
25
  };
50
26
  }
51
-
52
- export function getAssetInfos(
53
- tr: TransactionCommon & { assetReference?: string; assetOwner?: string },
54
- ): string[] {
55
- if (tr.subAccountId) {
56
- const assetString = tr.subAccountId.split("+")[1];
57
- return assetString.split(":");
58
- }
59
- return [tr.assetReference || "", tr.assetOwner || ""];
60
- }