@ledgerhq/live-common 34.48.0-nightly.0 → 34.48.0-nightly.10

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 (557) hide show
  1. package/lib/__tests__/test-helpers/environment.js +1 -0
  2. package/lib/__tests__/test-helpers/environment.js.map +1 -1
  3. package/lib/apps/inlineAppInstall.d.ts +1 -3
  4. package/lib/apps/inlineAppInstall.d.ts.map +1 -1
  5. package/lib/apps/inlineAppInstall.js +2 -2
  6. package/lib/apps/inlineAppInstall.js.map +1 -1
  7. package/lib/apps/react.d.ts +1 -2
  8. package/lib/apps/react.d.ts.map +1 -1
  9. package/lib/apps/react.js +2 -2
  10. package/lib/apps/react.js.map +1 -1
  11. package/lib/apps/runner.d.ts +2 -4
  12. package/lib/apps/runner.d.ts.map +1 -1
  13. package/lib/apps/runner.js +3 -4
  14. package/lib/apps/runner.js.map +1 -1
  15. package/lib/bridge/crypto-assets/index.d.ts.map +1 -1
  16. package/lib/bridge/crypto-assets/index.js +0 -4
  17. package/lib/bridge/crypto-assets/index.js.map +1 -1
  18. package/lib/bridge/crypto-assets/index.test.js +0 -36
  19. package/lib/bridge/crypto-assets/index.test.js.map +1 -1
  20. package/lib/bridge/generic-alpaca/accountBridge.d.ts +2 -1
  21. package/lib/bridge/generic-alpaca/accountBridge.d.ts.map +1 -1
  22. package/lib/bridge/generic-alpaca/accountBridge.js +2 -2
  23. package/lib/bridge/generic-alpaca/accountBridge.js.map +1 -1
  24. package/lib/bridge/generic-alpaca/alpaca/index.d.ts +1 -1
  25. package/lib/bridge/generic-alpaca/alpaca/index.d.ts.map +1 -1
  26. package/lib/bridge/generic-alpaca/alpaca/index.js +10 -6
  27. package/lib/bridge/generic-alpaca/alpaca/index.js.map +1 -1
  28. package/lib/bridge/generic-alpaca/alpaca/index.unit.test.js +37 -9
  29. package/lib/bridge/generic-alpaca/alpaca/index.unit.test.js.map +1 -1
  30. package/lib/bridge/generic-alpaca/alpaca/network/network-alpaca.d.ts +2 -2
  31. package/lib/bridge/generic-alpaca/alpaca/network/network-alpaca.d.ts.map +1 -1
  32. package/lib/bridge/generic-alpaca/alpaca/network/network-alpaca.js +1 -1
  33. package/lib/bridge/generic-alpaca/alpaca/network/network-alpaca.js.map +1 -1
  34. package/lib/bridge/generic-alpaca/createTransaction.d.ts +1 -1
  35. package/lib/bridge/generic-alpaca/createTransaction.d.ts.map +1 -1
  36. package/lib/bridge/generic-alpaca/createTransaction.js +8 -0
  37. package/lib/bridge/generic-alpaca/createTransaction.js.map +1 -1
  38. package/lib/bridge/generic-alpaca/currencyBridge.d.ts +2 -1
  39. package/lib/bridge/generic-alpaca/currencyBridge.d.ts.map +1 -1
  40. package/lib/bridge/generic-alpaca/currencyBridge.js +3 -2
  41. package/lib/bridge/generic-alpaca/currencyBridge.js.map +1 -1
  42. package/lib/bridge/generic-alpaca/getAccountShape.d.ts.map +1 -1
  43. package/lib/bridge/generic-alpaca/getAccountShape.js +4 -4
  44. package/lib/bridge/generic-alpaca/getAccountShape.js.map +1 -1
  45. package/lib/bridge/generic-alpaca/signOperation.js +1 -1
  46. package/lib/bridge/generic-alpaca/signOperation.js.map +1 -1
  47. package/lib/bridge/generic-alpaca/signer/Eth.d.ts +8 -0
  48. package/lib/bridge/generic-alpaca/signer/Eth.d.ts.map +1 -0
  49. package/lib/bridge/generic-alpaca/signer/Eth.js +51 -0
  50. package/lib/bridge/generic-alpaca/signer/Eth.js.map +1 -0
  51. package/lib/bridge/generic-alpaca/signer/index.d.ts +2 -10
  52. package/lib/bridge/generic-alpaca/signer/index.d.ts.map +1 -1
  53. package/lib/bridge/generic-alpaca/signer/index.js +2 -2
  54. package/lib/bridge/generic-alpaca/signer/index.js.map +1 -1
  55. package/lib/bridge/generic-alpaca/signer/signTransaction.d.ts +2 -3
  56. package/lib/bridge/generic-alpaca/signer/signTransaction.d.ts.map +1 -1
  57. package/lib/bridge/generic-alpaca/signer/signTransaction.js.map +1 -1
  58. package/lib/bridge/generic-alpaca/signer/types.d.ts +11 -0
  59. package/lib/bridge/generic-alpaca/signer/types.d.ts.map +1 -1
  60. package/lib/bridge/generic-alpaca/tests/getAccountShape.test.d.ts +2 -0
  61. package/lib/bridge/generic-alpaca/tests/getAccountShape.test.d.ts.map +1 -0
  62. package/lib/bridge/generic-alpaca/tests/getAccountShape.test.js +144 -0
  63. package/lib/bridge/generic-alpaca/tests/getAccountShape.test.js.map +1 -0
  64. package/lib/bridge/generic-alpaca/utils.d.ts +2 -0
  65. package/lib/bridge/generic-alpaca/utils.d.ts.map +1 -1
  66. package/lib/bridge/generic-alpaca/utils.js +15 -1
  67. package/lib/bridge/generic-alpaca/utils.js.map +1 -1
  68. package/lib/bridge/generic-alpaca/utils.test.js +21 -0
  69. package/lib/bridge/generic-alpaca/utils.test.js.map +1 -1
  70. package/lib/config/sharedConfig.d.ts.map +1 -1
  71. package/lib/config/sharedConfig.js +30 -26
  72. package/lib/config/sharedConfig.js.map +1 -1
  73. package/lib/e2e/enum/Account.d.ts +2 -0
  74. package/lib/e2e/enum/Account.d.ts.map +1 -1
  75. package/lib/e2e/enum/Account.js +2 -0
  76. package/lib/e2e/enum/Account.js.map +1 -1
  77. package/lib/e2e/enum/AppInfos.d.ts +1 -0
  78. package/lib/e2e/enum/AppInfos.d.ts.map +1 -1
  79. package/lib/e2e/enum/AppInfos.js +1 -0
  80. package/lib/e2e/enum/AppInfos.js.map +1 -1
  81. package/lib/e2e/enum/Currency.d.ts +1 -0
  82. package/lib/e2e/enum/Currency.d.ts.map +1 -1
  83. package/lib/e2e/enum/Currency.js +1 -0
  84. package/lib/e2e/enum/Currency.js.map +1 -1
  85. package/lib/e2e/enum/DeviceLabels.d.ts +2 -1
  86. package/lib/e2e/enum/DeviceLabels.d.ts.map +1 -1
  87. package/lib/e2e/enum/DeviceLabels.js +1 -0
  88. package/lib/e2e/enum/DeviceLabels.js.map +1 -1
  89. package/lib/e2e/enum/Network.d.ts +2 -1
  90. package/lib/e2e/enum/Network.d.ts.map +1 -1
  91. package/lib/e2e/enum/Network.js +1 -0
  92. package/lib/e2e/enum/Network.js.map +1 -1
  93. package/lib/e2e/families/kaspa.d.ts +4 -0
  94. package/lib/e2e/families/kaspa.d.ts.map +1 -0
  95. package/lib/e2e/families/kaspa.js +23 -0
  96. package/lib/e2e/families/kaspa.js.map +1 -0
  97. package/lib/e2e/index.d.ts +4 -8
  98. package/lib/e2e/index.d.ts.map +1 -1
  99. package/lib/e2e/speculos.d.ts.map +1 -1
  100. package/lib/e2e/speculos.js +13 -0
  101. package/lib/e2e/speculos.js.map +1 -1
  102. package/lib/env.react.d.ts +1 -1
  103. package/lib/env.react.d.ts.map +1 -1
  104. package/lib/exchange/swap/transactionStrategies.d.ts +38 -11
  105. package/lib/exchange/swap/transactionStrategies.d.ts.map +1 -1
  106. package/lib/exchange/swap/transactionStrategies.js +93 -47
  107. package/lib/exchange/swap/transactionStrategies.js.map +1 -1
  108. package/lib/families/canton/bridge/mock-data.d.ts +6 -0
  109. package/lib/families/canton/bridge/mock-data.d.ts.map +1 -0
  110. package/lib/families/canton/bridge/mock-data.js +120 -0
  111. package/lib/families/canton/bridge/mock-data.js.map +1 -0
  112. package/lib/families/canton/bridge/mock.d.ts +12 -0
  113. package/lib/families/canton/bridge/mock.d.ts.map +1 -0
  114. package/lib/families/canton/bridge/mock.js +154 -0
  115. package/lib/families/canton/bridge/mock.js.map +1 -0
  116. package/lib/families/canton/config.js +7 -6
  117. package/lib/families/canton/config.js.map +1 -1
  118. package/lib/families/canton/setup.d.ts.map +1 -1
  119. package/lib/families/canton/setup.js +10 -4
  120. package/lib/families/canton/setup.js.map +1 -1
  121. package/lib/families/evm/config.js +2 -2
  122. package/lib/families/evm/config.js.map +1 -1
  123. package/lib/families/kaspa/bridge.integration.test.d.ts +2 -0
  124. package/lib/families/kaspa/bridge.integration.test.d.ts.map +1 -0
  125. package/lib/families/kaspa/bridge.integration.test.js +7 -0
  126. package/lib/families/kaspa/bridge.integration.test.js.map +1 -0
  127. package/lib/families/kaspa/config.d.ts +3 -0
  128. package/lib/families/kaspa/config.d.ts.map +1 -0
  129. package/lib/families/kaspa/config.js +14 -0
  130. package/lib/families/kaspa/config.js.map +1 -0
  131. package/lib/families/kaspa/react.d.ts +4 -0
  132. package/lib/families/kaspa/react.d.ts.map +1 -0
  133. package/lib/families/kaspa/react.js +18 -0
  134. package/lib/families/kaspa/react.js.map +1 -0
  135. package/lib/families/kaspa/setup.d.ts +18 -0
  136. package/lib/families/kaspa/setup.d.ts.map +1 -0
  137. package/lib/families/kaspa/setup.js +24 -0
  138. package/lib/families/kaspa/setup.js.map +1 -0
  139. package/lib/families/kaspa/types.d.ts +2 -0
  140. package/lib/families/kaspa/types.d.ts.map +1 -0
  141. package/lib/families/kaspa/types.js +18 -0
  142. package/lib/families/kaspa/types.js.map +1 -0
  143. package/lib/families/xrp/setup.d.ts +2 -2
  144. package/lib/featureFlags/defaultFeatures.d.ts.map +1 -1
  145. package/lib/featureFlags/defaultFeatures.js +4 -3
  146. package/lib/featureFlags/defaultFeatures.js.map +1 -1
  147. package/lib/featureFlags/useFeature.d.ts +1 -1
  148. package/lib/featureFlags/useFeature.d.ts.map +1 -1
  149. package/lib/generated/bridge/js.d.ts +1 -0
  150. package/lib/generated/bridge/js.d.ts.map +1 -1
  151. package/lib/generated/bridge/js.js +24 -22
  152. package/lib/generated/bridge/js.js.map +1 -1
  153. package/lib/generated/bridge/mock.d.ts +9 -1
  154. package/lib/generated/bridge/mock.d.ts.map +1 -1
  155. package/lib/generated/bridge/mock.js +26 -24
  156. package/lib/generated/bridge/mock.js.map +1 -1
  157. package/lib/generated/cli-transaction.d.ts +13 -2
  158. package/lib/generated/cli-transaction.d.ts.map +1 -1
  159. package/lib/generated/cli-transaction.js +28 -26
  160. package/lib/generated/cli-transaction.js.map +1 -1
  161. package/lib/generated/deviceTransactionConfig.d.ts +2 -0
  162. package/lib/generated/deviceTransactionConfig.d.ts.map +1 -1
  163. package/lib/generated/deviceTransactionConfig.js +24 -22
  164. package/lib/generated/deviceTransactionConfig.js.map +1 -1
  165. package/lib/generated/hw-getAddress.d.ts +1 -0
  166. package/lib/generated/hw-getAddress.d.ts.map +1 -1
  167. package/lib/generated/hw-getAddress.js +28 -26
  168. package/lib/generated/hw-getAddress.js.map +1 -1
  169. package/lib/generated/platformAdapter.d.ts +1 -1
  170. package/lib/generated/specs.d.ts +1 -1
  171. package/lib/generated/transaction.d.ts +11 -3
  172. package/lib/generated/transaction.d.ts.map +1 -1
  173. package/lib/generated/transaction.js +28 -26
  174. package/lib/generated/transaction.js.map +1 -1
  175. package/lib/generated/types.d.ts +5 -4
  176. package/lib/generated/types.d.ts.map +1 -1
  177. package/lib/generated/walletApiAdapter.d.ts +1 -1
  178. package/lib/hw/actions/app.d.ts.map +1 -1
  179. package/lib/hw/actions/app.js.map +1 -1
  180. package/lib/hw/getDeviceNameMaxLength.d.ts.map +1 -1
  181. package/lib/hw/getDeviceNameMaxLength.js +2 -0
  182. package/lib/hw/getDeviceNameMaxLength.js.map +1 -1
  183. package/lib/hw/getDeviceNameMaxLength.test.js +12 -0
  184. package/lib/hw/getDeviceNameMaxLength.test.js.map +1 -1
  185. package/lib/modularDrawer/data/state-manager/api.d.ts.map +1 -1
  186. package/lib/modularDrawer/data/state-manager/api.js +3 -2
  187. package/lib/modularDrawer/data/state-manager/api.js.map +1 -1
  188. package/lib/modularDrawer/data/state-manager/types.d.ts +1 -0
  189. package/lib/modularDrawer/data/state-manager/types.d.ts.map +1 -1
  190. package/lib/modularDrawer/hooks/__test__/useModularDrawerConfiguration.test.d.ts +2 -0
  191. package/lib/modularDrawer/hooks/__test__/useModularDrawerConfiguration.test.d.ts.map +1 -0
  192. package/lib/modularDrawer/hooks/__test__/useModularDrawerConfiguration.test.js +206 -0
  193. package/lib/modularDrawer/hooks/__test__/useModularDrawerConfiguration.test.js.map +1 -0
  194. package/lib/modularDrawer/hooks/useAssetsData.d.ts +3 -1
  195. package/lib/modularDrawer/hooks/useAssetsData.d.ts.map +1 -1
  196. package/lib/modularDrawer/hooks/useAssetsData.js +6 -3
  197. package/lib/modularDrawer/hooks/useAssetsData.js.map +1 -1
  198. package/lib/modularDrawer/hooks/useModularDrawerConfiguration.d.ts +13 -0
  199. package/lib/modularDrawer/hooks/useModularDrawerConfiguration.d.ts.map +1 -0
  200. package/lib/modularDrawer/hooks/useModularDrawerConfiguration.js +29 -0
  201. package/lib/modularDrawer/hooks/useModularDrawerConfiguration.js.map +1 -0
  202. package/lib/modularDrawer/hooks/useSearch.d.ts +16 -0
  203. package/lib/modularDrawer/hooks/useSearch.d.ts.map +1 -0
  204. package/lib/modularDrawer/hooks/useSearch.js +24 -0
  205. package/lib/modularDrawer/hooks/useSearch.js.map +1 -0
  206. package/lib/notifications/ServiceStatusProvider/index.d.ts +16 -1
  207. package/lib/notifications/ServiceStatusProvider/index.d.ts.map +1 -1
  208. package/lib/notifications/ServiceStatusProvider/index.js +31 -7
  209. package/lib/notifications/ServiceStatusProvider/index.js.map +1 -1
  210. package/lib/notifications/ServiceStatusProvider/index.test.d.ts +2 -0
  211. package/lib/notifications/ServiceStatusProvider/index.test.d.ts.map +1 -0
  212. package/lib/notifications/ServiceStatusProvider/index.test.js +88 -0
  213. package/lib/notifications/ServiceStatusProvider/index.test.js.map +1 -0
  214. package/lib/notifications/ServiceStatusProvider/ledger-components.d.ts +2 -0
  215. package/lib/notifications/ServiceStatusProvider/ledger-components.d.ts.map +1 -0
  216. package/lib/notifications/ServiceStatusProvider/ledger-components.js +16 -0
  217. package/lib/notifications/ServiceStatusProvider/ledger-components.js.map +1 -0
  218. package/lib/wallet-api/ACRE/server.d.ts +13 -6
  219. package/lib/wallet-api/ACRE/server.d.ts.map +1 -1
  220. package/lib/wallet-api/ACRE/server.js +142 -1
  221. package/lib/wallet-api/ACRE/server.js.map +1 -1
  222. package/lib/wallet-api/ACRE/server.test.d.ts +2 -0
  223. package/lib/wallet-api/ACRE/server.test.d.ts.map +1 -0
  224. package/lib/wallet-api/ACRE/server.test.js +393 -0
  225. package/lib/wallet-api/ACRE/server.test.js.map +1 -0
  226. package/lib/wallet-api/Exchange/server.d.ts.map +1 -1
  227. package/lib/wallet-api/Exchange/server.js +16 -13
  228. package/lib/wallet-api/Exchange/server.js.map +1 -1
  229. package/lib-es/__tests__/test-helpers/environment.js +1 -0
  230. package/lib-es/__tests__/test-helpers/environment.js.map +1 -1
  231. package/lib-es/apps/inlineAppInstall.d.ts +1 -3
  232. package/lib-es/apps/inlineAppInstall.d.ts.map +1 -1
  233. package/lib-es/apps/inlineAppInstall.js +2 -2
  234. package/lib-es/apps/inlineAppInstall.js.map +1 -1
  235. package/lib-es/apps/react.d.ts +1 -2
  236. package/lib-es/apps/react.d.ts.map +1 -1
  237. package/lib-es/apps/react.js +2 -2
  238. package/lib-es/apps/react.js.map +1 -1
  239. package/lib-es/apps/runner.d.ts +2 -4
  240. package/lib-es/apps/runner.d.ts.map +1 -1
  241. package/lib-es/apps/runner.js +3 -4
  242. package/lib-es/apps/runner.js.map +1 -1
  243. package/lib-es/bridge/crypto-assets/index.d.ts.map +1 -1
  244. package/lib-es/bridge/crypto-assets/index.js +0 -4
  245. package/lib-es/bridge/crypto-assets/index.js.map +1 -1
  246. package/lib-es/bridge/crypto-assets/index.test.js +0 -36
  247. package/lib-es/bridge/crypto-assets/index.test.js.map +1 -1
  248. package/lib-es/bridge/generic-alpaca/accountBridge.d.ts +2 -1
  249. package/lib-es/bridge/generic-alpaca/accountBridge.d.ts.map +1 -1
  250. package/lib-es/bridge/generic-alpaca/accountBridge.js +2 -2
  251. package/lib-es/bridge/generic-alpaca/accountBridge.js.map +1 -1
  252. package/lib-es/bridge/generic-alpaca/alpaca/index.d.ts +1 -1
  253. package/lib-es/bridge/generic-alpaca/alpaca/index.d.ts.map +1 -1
  254. package/lib-es/bridge/generic-alpaca/alpaca/index.js +10 -6
  255. package/lib-es/bridge/generic-alpaca/alpaca/index.js.map +1 -1
  256. package/lib-es/bridge/generic-alpaca/alpaca/index.unit.test.js +37 -9
  257. package/lib-es/bridge/generic-alpaca/alpaca/index.unit.test.js.map +1 -1
  258. package/lib-es/bridge/generic-alpaca/alpaca/network/network-alpaca.d.ts +2 -2
  259. package/lib-es/bridge/generic-alpaca/alpaca/network/network-alpaca.d.ts.map +1 -1
  260. package/lib-es/bridge/generic-alpaca/alpaca/network/network-alpaca.js +1 -1
  261. package/lib-es/bridge/generic-alpaca/alpaca/network/network-alpaca.js.map +1 -1
  262. package/lib-es/bridge/generic-alpaca/createTransaction.d.ts +1 -1
  263. package/lib-es/bridge/generic-alpaca/createTransaction.d.ts.map +1 -1
  264. package/lib-es/bridge/generic-alpaca/createTransaction.js +8 -0
  265. package/lib-es/bridge/generic-alpaca/createTransaction.js.map +1 -1
  266. package/lib-es/bridge/generic-alpaca/currencyBridge.d.ts +2 -1
  267. package/lib-es/bridge/generic-alpaca/currencyBridge.d.ts.map +1 -1
  268. package/lib-es/bridge/generic-alpaca/currencyBridge.js +3 -2
  269. package/lib-es/bridge/generic-alpaca/currencyBridge.js.map +1 -1
  270. package/lib-es/bridge/generic-alpaca/getAccountShape.d.ts.map +1 -1
  271. package/lib-es/bridge/generic-alpaca/getAccountShape.js +4 -4
  272. package/lib-es/bridge/generic-alpaca/getAccountShape.js.map +1 -1
  273. package/lib-es/bridge/generic-alpaca/signOperation.js +1 -1
  274. package/lib-es/bridge/generic-alpaca/signOperation.js.map +1 -1
  275. package/lib-es/bridge/generic-alpaca/signer/Eth.d.ts +8 -0
  276. package/lib-es/bridge/generic-alpaca/signer/Eth.d.ts.map +1 -0
  277. package/lib-es/bridge/generic-alpaca/signer/Eth.js +47 -0
  278. package/lib-es/bridge/generic-alpaca/signer/Eth.js.map +1 -0
  279. package/lib-es/bridge/generic-alpaca/signer/index.d.ts +2 -10
  280. package/lib-es/bridge/generic-alpaca/signer/index.d.ts.map +1 -1
  281. package/lib-es/bridge/generic-alpaca/signer/index.js +2 -2
  282. package/lib-es/bridge/generic-alpaca/signer/index.js.map +1 -1
  283. package/lib-es/bridge/generic-alpaca/signer/signTransaction.d.ts +2 -3
  284. package/lib-es/bridge/generic-alpaca/signer/signTransaction.d.ts.map +1 -1
  285. package/lib-es/bridge/generic-alpaca/signer/signTransaction.js.map +1 -1
  286. package/lib-es/bridge/generic-alpaca/signer/types.d.ts +11 -0
  287. package/lib-es/bridge/generic-alpaca/signer/types.d.ts.map +1 -1
  288. package/lib-es/bridge/generic-alpaca/tests/getAccountShape.test.d.ts +2 -0
  289. package/lib-es/bridge/generic-alpaca/tests/getAccountShape.test.d.ts.map +1 -0
  290. package/lib-es/bridge/generic-alpaca/tests/getAccountShape.test.js +139 -0
  291. package/lib-es/bridge/generic-alpaca/tests/getAccountShape.test.js.map +1 -0
  292. package/lib-es/bridge/generic-alpaca/utils.d.ts +2 -0
  293. package/lib-es/bridge/generic-alpaca/utils.d.ts.map +1 -1
  294. package/lib-es/bridge/generic-alpaca/utils.js +13 -0
  295. package/lib-es/bridge/generic-alpaca/utils.js.map +1 -1
  296. package/lib-es/bridge/generic-alpaca/utils.test.js +22 -1
  297. package/lib-es/bridge/generic-alpaca/utils.test.js.map +1 -1
  298. package/lib-es/config/sharedConfig.d.ts.map +1 -1
  299. package/lib-es/config/sharedConfig.js +4 -0
  300. package/lib-es/config/sharedConfig.js.map +1 -1
  301. package/lib-es/e2e/enum/Account.d.ts +2 -0
  302. package/lib-es/e2e/enum/Account.d.ts.map +1 -1
  303. package/lib-es/e2e/enum/Account.js +2 -0
  304. package/lib-es/e2e/enum/Account.js.map +1 -1
  305. package/lib-es/e2e/enum/AppInfos.d.ts +1 -0
  306. package/lib-es/e2e/enum/AppInfos.d.ts.map +1 -1
  307. package/lib-es/e2e/enum/AppInfos.js +1 -0
  308. package/lib-es/e2e/enum/AppInfos.js.map +1 -1
  309. package/lib-es/e2e/enum/Currency.d.ts +1 -0
  310. package/lib-es/e2e/enum/Currency.d.ts.map +1 -1
  311. package/lib-es/e2e/enum/Currency.js +1 -0
  312. package/lib-es/e2e/enum/Currency.js.map +1 -1
  313. package/lib-es/e2e/enum/DeviceLabels.d.ts +2 -1
  314. package/lib-es/e2e/enum/DeviceLabels.d.ts.map +1 -1
  315. package/lib-es/e2e/enum/DeviceLabels.js +1 -0
  316. package/lib-es/e2e/enum/DeviceLabels.js.map +1 -1
  317. package/lib-es/e2e/enum/Network.d.ts +2 -1
  318. package/lib-es/e2e/enum/Network.d.ts.map +1 -1
  319. package/lib-es/e2e/enum/Network.js +1 -0
  320. package/lib-es/e2e/enum/Network.js.map +1 -1
  321. package/lib-es/e2e/families/kaspa.d.ts +4 -0
  322. package/lib-es/e2e/families/kaspa.d.ts.map +1 -0
  323. package/lib-es/e2e/families/kaspa.js +15 -0
  324. package/lib-es/e2e/families/kaspa.js.map +1 -0
  325. package/lib-es/e2e/index.d.ts +4 -8
  326. package/lib-es/e2e/index.d.ts.map +1 -1
  327. package/lib-es/e2e/speculos.d.ts.map +1 -1
  328. package/lib-es/e2e/speculos.js +13 -0
  329. package/lib-es/e2e/speculos.js.map +1 -1
  330. package/lib-es/env.react.d.ts +1 -1
  331. package/lib-es/env.react.d.ts.map +1 -1
  332. package/lib-es/exchange/swap/transactionStrategies.d.ts +38 -11
  333. package/lib-es/exchange/swap/transactionStrategies.d.ts.map +1 -1
  334. package/lib-es/exchange/swap/transactionStrategies.js +87 -44
  335. package/lib-es/exchange/swap/transactionStrategies.js.map +1 -1
  336. package/lib-es/families/canton/bridge/mock-data.d.ts +6 -0
  337. package/lib-es/families/canton/bridge/mock-data.d.ts.map +1 -0
  338. package/lib-es/families/canton/bridge/mock-data.js +116 -0
  339. package/lib-es/families/canton/bridge/mock-data.js.map +1 -0
  340. package/lib-es/families/canton/bridge/mock.d.ts +12 -0
  341. package/lib-es/families/canton/bridge/mock.d.ts.map +1 -0
  342. package/lib-es/families/canton/bridge/mock.js +152 -0
  343. package/lib-es/families/canton/bridge/mock.js.map +1 -0
  344. package/lib-es/families/canton/config.js +7 -6
  345. package/lib-es/families/canton/config.js.map +1 -1
  346. package/lib-es/families/canton/setup.d.ts.map +1 -1
  347. package/lib-es/families/canton/setup.js +10 -4
  348. package/lib-es/families/canton/setup.js.map +1 -1
  349. package/lib-es/families/evm/config.js +2 -2
  350. package/lib-es/families/evm/config.js.map +1 -1
  351. package/lib-es/families/kaspa/bridge.integration.test.d.ts +2 -0
  352. package/lib-es/families/kaspa/bridge.integration.test.d.ts.map +1 -0
  353. package/lib-es/families/kaspa/bridge.integration.test.js +5 -0
  354. package/lib-es/families/kaspa/bridge.integration.test.js.map +1 -0
  355. package/lib-es/families/kaspa/config.d.ts +3 -0
  356. package/lib-es/families/kaspa/config.d.ts.map +1 -0
  357. package/lib-es/families/kaspa/config.js +11 -0
  358. package/lib-es/families/kaspa/config.js.map +1 -0
  359. package/lib-es/families/kaspa/react.d.ts +4 -0
  360. package/lib-es/families/kaspa/react.d.ts.map +1 -0
  361. package/lib-es/families/kaspa/react.js +14 -0
  362. package/lib-es/families/kaspa/react.js.map +1 -0
  363. package/lib-es/families/kaspa/setup.d.ts +18 -0
  364. package/lib-es/families/kaspa/setup.d.ts.map +1 -0
  365. package/lib-es/families/kaspa/setup.js +16 -0
  366. package/lib-es/families/kaspa/setup.js.map +1 -0
  367. package/lib-es/families/kaspa/types.d.ts +2 -0
  368. package/lib-es/families/kaspa/types.d.ts.map +1 -0
  369. package/lib-es/families/kaspa/types.js +2 -0
  370. package/lib-es/families/kaspa/types.js.map +1 -0
  371. package/lib-es/families/xrp/setup.d.ts +2 -2
  372. package/lib-es/featureFlags/defaultFeatures.d.ts.map +1 -1
  373. package/lib-es/featureFlags/defaultFeatures.js +4 -3
  374. package/lib-es/featureFlags/defaultFeatures.js.map +1 -1
  375. package/lib-es/featureFlags/useFeature.d.ts +1 -1
  376. package/lib-es/featureFlags/useFeature.d.ts.map +1 -1
  377. package/lib-es/generated/bridge/js.d.ts +1 -0
  378. package/lib-es/generated/bridge/js.d.ts.map +1 -1
  379. package/lib-es/generated/bridge/js.js +2 -0
  380. package/lib-es/generated/bridge/js.js.map +1 -1
  381. package/lib-es/generated/bridge/mock.d.ts +9 -1
  382. package/lib-es/generated/bridge/mock.d.ts.map +1 -1
  383. package/lib-es/generated/bridge/mock.js +2 -0
  384. package/lib-es/generated/bridge/mock.js.map +1 -1
  385. package/lib-es/generated/cli-transaction.d.ts +13 -2
  386. package/lib-es/generated/cli-transaction.d.ts.map +1 -1
  387. package/lib-es/generated/cli-transaction.js +2 -0
  388. package/lib-es/generated/cli-transaction.js.map +1 -1
  389. package/lib-es/generated/deviceTransactionConfig.d.ts +2 -0
  390. package/lib-es/generated/deviceTransactionConfig.d.ts.map +1 -1
  391. package/lib-es/generated/deviceTransactionConfig.js +2 -0
  392. package/lib-es/generated/deviceTransactionConfig.js.map +1 -1
  393. package/lib-es/generated/hw-getAddress.d.ts +1 -0
  394. package/lib-es/generated/hw-getAddress.d.ts.map +1 -1
  395. package/lib-es/generated/hw-getAddress.js +2 -0
  396. package/lib-es/generated/hw-getAddress.js.map +1 -1
  397. package/lib-es/generated/platformAdapter.d.ts +1 -1
  398. package/lib-es/generated/specs.d.ts +1 -1
  399. package/lib-es/generated/transaction.d.ts +11 -3
  400. package/lib-es/generated/transaction.d.ts.map +1 -1
  401. package/lib-es/generated/transaction.js +2 -0
  402. package/lib-es/generated/transaction.js.map +1 -1
  403. package/lib-es/generated/types.d.ts +5 -4
  404. package/lib-es/generated/types.d.ts.map +1 -1
  405. package/lib-es/generated/walletApiAdapter.d.ts +1 -1
  406. package/lib-es/hw/actions/app.d.ts.map +1 -1
  407. package/lib-es/hw/actions/app.js.map +1 -1
  408. package/lib-es/hw/getDeviceNameMaxLength.d.ts.map +1 -1
  409. package/lib-es/hw/getDeviceNameMaxLength.js +2 -0
  410. package/lib-es/hw/getDeviceNameMaxLength.js.map +1 -1
  411. package/lib-es/hw/getDeviceNameMaxLength.test.js +12 -0
  412. package/lib-es/hw/getDeviceNameMaxLength.test.js.map +1 -1
  413. package/lib-es/modularDrawer/data/state-manager/api.d.ts.map +1 -1
  414. package/lib-es/modularDrawer/data/state-manager/api.js +3 -2
  415. package/lib-es/modularDrawer/data/state-manager/api.js.map +1 -1
  416. package/lib-es/modularDrawer/data/state-manager/types.d.ts +1 -0
  417. package/lib-es/modularDrawer/data/state-manager/types.d.ts.map +1 -1
  418. package/lib-es/modularDrawer/hooks/__test__/useModularDrawerConfiguration.test.d.ts +2 -0
  419. package/lib-es/modularDrawer/hooks/__test__/useModularDrawerConfiguration.test.d.ts.map +1 -0
  420. package/lib-es/modularDrawer/hooks/__test__/useModularDrawerConfiguration.test.js +204 -0
  421. package/lib-es/modularDrawer/hooks/__test__/useModularDrawerConfiguration.test.js.map +1 -0
  422. package/lib-es/modularDrawer/hooks/useAssetsData.d.ts +3 -1
  423. package/lib-es/modularDrawer/hooks/useAssetsData.d.ts.map +1 -1
  424. package/lib-es/modularDrawer/hooks/useAssetsData.js +6 -3
  425. package/lib-es/modularDrawer/hooks/useAssetsData.js.map +1 -1
  426. package/lib-es/modularDrawer/hooks/useModularDrawerConfiguration.d.ts +13 -0
  427. package/lib-es/modularDrawer/hooks/useModularDrawerConfiguration.d.ts.map +1 -0
  428. package/lib-es/modularDrawer/hooks/useModularDrawerConfiguration.js +25 -0
  429. package/lib-es/modularDrawer/hooks/useModularDrawerConfiguration.js.map +1 -0
  430. package/lib-es/modularDrawer/hooks/useSearch.d.ts +16 -0
  431. package/lib-es/modularDrawer/hooks/useSearch.d.ts.map +1 -0
  432. package/lib-es/modularDrawer/hooks/useSearch.js +20 -0
  433. package/lib-es/modularDrawer/hooks/useSearch.js.map +1 -0
  434. package/lib-es/notifications/ServiceStatusProvider/index.d.ts +16 -1
  435. package/lib-es/notifications/ServiceStatusProvider/index.d.ts.map +1 -1
  436. package/lib-es/notifications/ServiceStatusProvider/index.js +31 -7
  437. package/lib-es/notifications/ServiceStatusProvider/index.js.map +1 -1
  438. package/lib-es/notifications/ServiceStatusProvider/index.test.d.ts +2 -0
  439. package/lib-es/notifications/ServiceStatusProvider/index.test.d.ts.map +1 -0
  440. package/lib-es/notifications/ServiceStatusProvider/index.test.js +86 -0
  441. package/lib-es/notifications/ServiceStatusProvider/index.test.js.map +1 -0
  442. package/lib-es/notifications/ServiceStatusProvider/ledger-components.d.ts +2 -0
  443. package/lib-es/notifications/ServiceStatusProvider/ledger-components.d.ts.map +1 -0
  444. package/lib-es/notifications/ServiceStatusProvider/ledger-components.js +13 -0
  445. package/lib-es/notifications/ServiceStatusProvider/ledger-components.js.map +1 -0
  446. package/lib-es/wallet-api/ACRE/server.d.ts +13 -6
  447. package/lib-es/wallet-api/ACRE/server.d.ts.map +1 -1
  448. package/lib-es/wallet-api/ACRE/server.js +140 -2
  449. package/lib-es/wallet-api/ACRE/server.js.map +1 -1
  450. package/lib-es/wallet-api/ACRE/server.test.d.ts +2 -0
  451. package/lib-es/wallet-api/ACRE/server.test.d.ts.map +1 -0
  452. package/lib-es/wallet-api/ACRE/server.test.js +388 -0
  453. package/lib-es/wallet-api/ACRE/server.test.js.map +1 -0
  454. package/lib-es/wallet-api/Exchange/server.d.ts.map +1 -1
  455. package/lib-es/wallet-api/Exchange/server.js +16 -13
  456. package/lib-es/wallet-api/Exchange/server.js.map +1 -1
  457. package/package.json +55 -52
  458. package/src/__tests__/test-helpers/environment.ts +1 -0
  459. package/src/apps/inlineAppInstall.ts +1 -4
  460. package/src/apps/react.ts +1 -3
  461. package/src/apps/runner.ts +1 -8
  462. package/src/bridge/crypto-assets/index.test.ts +0 -47
  463. package/src/bridge/crypto-assets/index.ts +0 -5
  464. package/src/bridge/generic-alpaca/accountBridge.ts +8 -3
  465. package/src/bridge/generic-alpaca/alpaca/index.ts +13 -18
  466. package/src/bridge/generic-alpaca/alpaca/index.unit.test.ts +38 -10
  467. package/src/bridge/generic-alpaca/alpaca/network/network-alpaca.ts +4 -3
  468. package/src/bridge/generic-alpaca/createTransaction.ts +9 -1
  469. package/src/bridge/generic-alpaca/currencyBridge.ts +8 -2
  470. package/src/bridge/generic-alpaca/getAccountShape.ts +4 -5
  471. package/src/bridge/generic-alpaca/signOperation.ts +1 -1
  472. package/src/bridge/generic-alpaca/signer/Eth.ts +70 -0
  473. package/src/bridge/generic-alpaca/signer/index.ts +5 -15
  474. package/src/bridge/generic-alpaca/signer/signTransaction.ts +4 -3
  475. package/src/bridge/generic-alpaca/signer/types.ts +14 -0
  476. package/src/bridge/generic-alpaca/tests/getAccountShape.test.ts +173 -0
  477. package/src/bridge/generic-alpaca/utils.test.ts +29 -1
  478. package/src/bridge/generic-alpaca/utils.ts +15 -0
  479. package/src/config/sharedConfig.ts +4 -0
  480. package/src/e2e/enum/Account.ts +14 -0
  481. package/src/e2e/enum/AppInfos.ts +2 -0
  482. package/src/e2e/enum/Currency.ts +2 -0
  483. package/src/e2e/enum/DeviceLabels.ts +1 -0
  484. package/src/e2e/enum/Network.ts +1 -0
  485. package/src/e2e/families/kaspa.ts +17 -0
  486. package/src/e2e/speculos.ts +13 -0
  487. package/src/exchange/swap/transactionStrategies.ts +121 -73
  488. package/src/families/canton/bridge/mock-data.ts +175 -0
  489. package/src/families/canton/bridge/mock.ts +180 -0
  490. package/src/families/canton/config.ts +7 -7
  491. package/src/families/canton/setup.ts +11 -7
  492. package/src/families/evm/config.ts +2 -2
  493. package/src/families/kaspa/__snapshots__/bridge.integration.test.ts.snap +66 -0
  494. package/src/families/kaspa/bridge.integration.test.ts +5 -0
  495. package/src/families/kaspa/config.ts +12 -0
  496. package/src/families/kaspa/react.ts +19 -0
  497. package/src/families/kaspa/setup.ts +27 -0
  498. package/src/families/kaspa/types.ts +1 -0
  499. package/src/featureFlags/defaultFeatures.ts +4 -3
  500. package/src/generated/bridge/js.ts +2 -0
  501. package/src/generated/bridge/mock.ts +2 -0
  502. package/src/generated/cli-transaction.ts +2 -0
  503. package/src/generated/deviceTransactionConfig.ts +2 -0
  504. package/src/generated/hw-getAddress.ts +2 -0
  505. package/src/generated/transaction.ts +2 -0
  506. package/src/generated/types.ts +10 -0
  507. package/src/hw/actions/app.ts +0 -1
  508. package/src/hw/getDeviceNameMaxLength.test.ts +16 -0
  509. package/src/hw/getDeviceNameMaxLength.ts +2 -0
  510. package/src/modularDrawer/data/state-manager/api.ts +4 -2
  511. package/src/modularDrawer/data/state-manager/types.ts +1 -0
  512. package/src/modularDrawer/hooks/__test__/useModularDrawerConfiguration.test.ts +251 -0
  513. package/src/modularDrawer/hooks/useAssetsData.ts +24 -9
  514. package/src/modularDrawer/hooks/useModularDrawerConfiguration.ts +33 -0
  515. package/src/modularDrawer/hooks/useSearch.ts +52 -0
  516. package/src/notifications/ServiceStatusProvider/index.test.ts +102 -0
  517. package/src/notifications/ServiceStatusProvider/index.tsx +37 -12
  518. package/src/notifications/ServiceStatusProvider/ledger-components.ts +12 -0
  519. package/src/wallet-api/ACRE/server.test.ts +470 -0
  520. package/src/wallet-api/ACRE/server.ts +202 -14
  521. package/src/wallet-api/Exchange/server.ts +17 -14
  522. package/lib/bridge/crypto-assets/cal-integration.d.ts +0 -4
  523. package/lib/bridge/crypto-assets/cal-integration.d.ts.map +0 -1
  524. package/lib/bridge/crypto-assets/cal-integration.js +0 -26
  525. package/lib/bridge/crypto-assets/cal-integration.js.map +0 -1
  526. package/lib/bridge/crypto-assets/cal-integration.test.d.ts +0 -2
  527. package/lib/bridge/crypto-assets/cal-integration.test.d.ts.map +0 -1
  528. package/lib/bridge/crypto-assets/cal-integration.test.js +0 -45
  529. package/lib/bridge/crypto-assets/cal-integration.test.js.map +0 -1
  530. package/lib/bridge/crypto-assets/cal-store.d.ts +0 -14
  531. package/lib/bridge/crypto-assets/cal-store.d.ts.map +0 -1
  532. package/lib/bridge/crypto-assets/cal-store.js +0 -58
  533. package/lib/bridge/crypto-assets/cal-store.js.map +0 -1
  534. package/lib/bridge/crypto-assets/cal-store.test.d.ts +0 -2
  535. package/lib/bridge/crypto-assets/cal-store.test.d.ts.map +0 -1
  536. package/lib/bridge/crypto-assets/cal-store.test.js +0 -70
  537. package/lib/bridge/crypto-assets/cal-store.test.js.map +0 -1
  538. package/lib-es/bridge/crypto-assets/cal-integration.d.ts +0 -4
  539. package/lib-es/bridge/crypto-assets/cal-integration.d.ts.map +0 -1
  540. package/lib-es/bridge/crypto-assets/cal-integration.js +0 -21
  541. package/lib-es/bridge/crypto-assets/cal-integration.js.map +0 -1
  542. package/lib-es/bridge/crypto-assets/cal-integration.test.d.ts +0 -2
  543. package/lib-es/bridge/crypto-assets/cal-integration.test.d.ts.map +0 -1
  544. package/lib-es/bridge/crypto-assets/cal-integration.test.js +0 -43
  545. package/lib-es/bridge/crypto-assets/cal-integration.test.js.map +0 -1
  546. package/lib-es/bridge/crypto-assets/cal-store.d.ts +0 -14
  547. package/lib-es/bridge/crypto-assets/cal-store.d.ts.map +0 -1
  548. package/lib-es/bridge/crypto-assets/cal-store.js +0 -54
  549. package/lib-es/bridge/crypto-assets/cal-store.js.map +0 -1
  550. package/lib-es/bridge/crypto-assets/cal-store.test.d.ts +0 -2
  551. package/lib-es/bridge/crypto-assets/cal-store.test.d.ts.map +0 -1
  552. package/lib-es/bridge/crypto-assets/cal-store.test.js +0 -68
  553. package/lib-es/bridge/crypto-assets/cal-store.test.js.map +0 -1
  554. package/src/bridge/crypto-assets/cal-integration.test.ts +0 -53
  555. package/src/bridge/crypto-assets/cal-integration.ts +0 -23
  556. package/src/bridge/crypto-assets/cal-store.test.ts +0 -93
  557. package/src/bridge/crypto-assets/cal-store.ts +0 -63
@@ -1,16 +1,7 @@
1
1
  import { BigNumber } from "bignumber.js";
2
2
 
3
- import {
4
- CosmosTransaction,
5
- ElrondTransaction,
6
- RippleTransaction,
7
- SolanaTransaction,
8
- StellarTransaction,
9
- TonTransaction,
10
- Transaction,
11
- TransactionCommon,
12
- } from "@ledgerhq/wallet-api-client";
13
-
3
+ import { Transaction } from "../../generated/types";
4
+ import { TransactionCommon } from "@ledgerhq/types-live";
14
5
  export type { SwapLiveError } from "@ledgerhq/wallet-api-exchange-module";
15
6
 
16
7
  export function defaultTransaction({
@@ -18,35 +9,81 @@ export function defaultTransaction({
18
9
  amount,
19
10
  recipient,
20
11
  customFeeConfig,
21
- }: TransactionWithCustomFee): Transaction {
22
- return <Transaction>{
12
+ }: TransactionWithCustomFee): Partial<Transaction> {
13
+ // Type assertion needed because each Transaction family has different required properties
14
+ // This function provides base properties that are then extended by family-specific functions
15
+ // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
16
+ return {
23
17
  family,
24
18
  amount,
25
19
  recipient,
26
20
  ...customFeeConfig,
21
+ } as Partial<Transaction>;
22
+ }
23
+
24
+ export function cardanoTransaction({
25
+ amount,
26
+ recipient,
27
+ customFeeConfig,
28
+ }: TransactionWithCustomFee): Partial<Extract<Transaction, { family: "cardano" }>> {
29
+ return {
30
+ family: "cardano",
31
+ amount,
32
+ recipient,
33
+ mode: "send",
34
+ ...customFeeConfig,
27
35
  };
28
36
  }
29
37
 
30
- export function modeSendTransaction({
31
- family,
38
+ export function nearTransaction({
32
39
  amount,
33
40
  recipient,
34
41
  customFeeConfig,
35
- }: TransactionWithCustomFee): Transaction {
42
+ }: TransactionWithCustomFee): Extract<Transaction, { family: "near" }> {
36
43
  return {
37
- ...defaultTransaction({ family, amount, recipient, customFeeConfig }),
44
+ family: "near",
45
+ amount,
46
+ recipient,
38
47
  mode: "send",
48
+ ...customFeeConfig,
49
+ };
50
+ }
51
+
52
+ export function tezosTransaction({
53
+ amount,
54
+ recipient,
55
+ customFeeConfig,
56
+ }: TransactionWithCustomFee): Partial<Extract<Transaction, { family: "tezos" }>> {
57
+ return {
58
+ family: "tezos",
59
+ amount,
60
+ recipient,
61
+ mode: "send",
62
+ ...customFeeConfig,
63
+ };
64
+ }
65
+
66
+ export function tronTransaction({
67
+ amount,
68
+ recipient,
69
+ customFeeConfig,
70
+ }: TransactionWithCustomFee): Partial<Extract<Transaction, { family: "tron" }>> {
71
+ return {
72
+ family: "tron",
73
+ amount,
74
+ recipient,
75
+ mode: "send",
76
+ ...customFeeConfig,
39
77
  };
40
78
  }
41
79
 
42
80
  export function stellarTransaction({
43
- family,
44
81
  amount,
45
82
  recipient,
46
83
  customFeeConfig,
47
84
  payinExtraId,
48
85
  customErrorType,
49
- }: TransactionWithCustomFee): StellarTransaction {
86
+ }: TransactionWithCustomFee): Extract<Transaction, { family: "stellar" }> {
50
87
  if (!payinExtraId)
51
88
  throw {
52
89
  error: new Error("Missing payinExtraId"),
@@ -55,8 +92,11 @@ export function stellarTransaction({
55
92
  };
56
93
 
57
94
  return {
58
- ...defaultTransaction({ family, amount, recipient, customFeeConfig }),
59
95
  family: "stellar",
96
+ mode: "send",
97
+ amount,
98
+ recipient,
99
+ ...customFeeConfig,
60
100
  memoValue: payinExtraId,
61
101
  memoType: "MEMO_TEXT",
62
102
  };
@@ -68,7 +108,7 @@ export function rippleTransaction({
68
108
  customFeeConfig,
69
109
  payinExtraId,
70
110
  customErrorType,
71
- }: TransactionWithCustomFee): RippleTransaction {
111
+ }: TransactionWithCustomFee): Partial<Extract<Transaction, { family: "xrp" }>> {
72
112
  if (!payinExtraId)
73
113
  throw {
74
114
  error: new Error("Missing payinExtraId"),
@@ -76,38 +116,40 @@ export function rippleTransaction({
76
116
  customErrorType,
77
117
  };
78
118
 
79
- const transaction: RippleTransaction = {
80
- family: "ripple",
119
+ return {
120
+ family: "xrp",
81
121
  amount,
82
122
  recipient,
83
123
  ...customFeeConfig,
84
124
  tag: new BigNumber(payinExtraId).toNumber(),
85
125
  };
86
- return transaction;
87
126
  }
88
127
 
89
- // Function to remove gasLimit from customFeeConfig for Ethereum or Bitcoin
90
- export function withoutGasLimitTransaction({
91
- family,
128
+ export function evmTransaction({
92
129
  amount,
93
130
  recipient,
94
131
  customFeeConfig,
95
132
  extraTransactionParameters,
96
- }: TransactionWithCustomFee): Transaction {
133
+ }: TransactionWithCustomFee): Partial<Extract<Transaction, { family: "evm" }>> {
97
134
  if (customFeeConfig?.gasLimit) {
98
135
  delete customFeeConfig.gasLimit;
99
136
  }
100
137
 
101
138
  if (extraTransactionParameters) {
102
- return <Transaction>{
103
- family,
139
+ return {
140
+ family: "evm" as const,
104
141
  amount,
105
142
  recipient,
106
143
  ...customFeeConfig,
107
144
  data: Buffer.from(extraTransactionParameters, "hex"),
108
145
  };
109
146
  }
110
- return defaultTransaction({ family, amount, recipient, customFeeConfig });
147
+ return {
148
+ family: "evm" as const,
149
+ amount,
150
+ recipient,
151
+ ...customFeeConfig,
152
+ };
111
153
  }
112
154
 
113
155
  export function bitcoinTransaction({
@@ -115,33 +157,33 @@ export function bitcoinTransaction({
115
157
  recipient,
116
158
  customFeeConfig,
117
159
  extraTransactionParameters,
118
- }: TransactionWithCustomFee): Transaction {
160
+ }: TransactionWithCustomFee): Partial<Extract<Transaction, { family: "bitcoin" }>> {
161
+ const baseTransaction = {
162
+ family: "bitcoin" as const,
163
+ amount,
164
+ recipient,
165
+ ...customFeeConfig,
166
+ };
167
+
119
168
  if (extraTransactionParameters) {
120
169
  return {
121
- family: "bitcoin",
122
- amount,
123
- recipient,
124
- ...customFeeConfig,
170
+ ...baseTransaction,
125
171
  opReturnData: Buffer.from(extraTransactionParameters, "utf-8"),
126
172
  };
127
173
  }
128
- return {
129
- family: "bitcoin",
130
- amount,
131
- recipient,
132
- ...customFeeConfig,
133
- };
174
+
175
+ return baseTransaction;
134
176
  }
135
177
 
136
178
  export function solanaTransaction({
137
- family,
138
179
  amount,
139
180
  recipient,
140
- customFeeConfig,
141
- }: TransactionWithCustomFee): SolanaTransaction {
181
+ customFeeConfig: _customFeeConfig,
182
+ }: TransactionWithCustomFee): Extract<Transaction, { family: "solana" }> {
142
183
  return {
143
- ...defaultTransaction({ family, amount, recipient, customFeeConfig }),
144
184
  family: "solana",
185
+ amount,
186
+ recipient,
145
187
  model: { kind: "transfer", uiState: {} },
146
188
  };
147
189
  }
@@ -150,43 +192,44 @@ export function elrondTransaction({
150
192
  amount,
151
193
  recipient,
152
194
  customFeeConfig,
153
- }: TransactionWithCustomFee): ElrondTransaction {
154
- const transaction: ElrondTransaction = {
155
- family: "elrond",
195
+ }: TransactionWithCustomFee): Extract<Transaction, { family: "multiversx" }> {
196
+ return {
197
+ family: "multiversx",
156
198
  amount,
157
199
  recipient,
158
200
  mode: "send",
159
- ...customFeeConfig,
160
- gasLimit: 0, // FIXME: Placeholder, adjust as needed
201
+ fees: customFeeConfig.fees || null,
202
+ gasLimit: customFeeConfig.gasLimit ? Number(customFeeConfig.gasLimit) : 0,
161
203
  };
162
- return transaction;
163
204
  }
164
205
 
165
206
  function tonTransaction({
166
- family,
167
207
  amount,
168
208
  recipient,
169
- customFeeConfig,
170
- }: TransactionWithCustomFee): TonTransaction {
209
+ customFeeConfig: _customFeeConfig,
210
+ }: TransactionWithCustomFee): Extract<Transaction, { family: "ton" }> {
171
211
  return {
172
- ...defaultTransaction({ family, amount, recipient, customFeeConfig }),
173
212
  family: "ton",
213
+ amount,
214
+ recipient,
174
215
  comment: { isEncrypted: false, text: "" },
175
216
  fees: new BigNumber(0), // Set default value as completeExchange call prepareTransaction, which set again fees.
176
217
  };
177
218
  }
178
219
 
179
220
  export function cosmosTransaction({
180
- family,
181
221
  amount,
182
222
  recipient,
183
223
  customFeeConfig,
184
224
  payinExtraId,
185
- }: TransactionWithCustomFee): CosmosTransaction {
186
- return <CosmosTransaction>{
187
- ...defaultTransaction({ family, amount, recipient, customFeeConfig }),
225
+ }: TransactionWithCustomFee): Partial<Extract<Transaction, { family: "cosmos" }>> {
226
+ return {
188
227
  family: "cosmos",
228
+ amount,
229
+ recipient,
189
230
  mode: "send",
231
+ networkInfo: null,
232
+ ...customFeeConfig,
190
233
  memo: payinExtraId ?? undefined,
191
234
  };
192
235
  }
@@ -198,10 +241,13 @@ export type TransactionWithCustomFee = TransactionCommon & {
198
241
  payinExtraId?: string;
199
242
  customErrorType?: "swap";
200
243
  extraTransactionParameters?: string;
244
+ family: string;
201
245
  };
202
246
 
203
247
  // Define a specific type for the strategy functions, assuming they might need parameters
204
- export type TransactionStrategyFunction = (params: TransactionWithCustomFee) => Transaction;
248
+ export type TransactionStrategyFunction = (
249
+ params: TransactionWithCustomFee,
250
+ ) => Partial<Transaction>;
205
251
 
206
252
  export const transactionStrategy: {
207
253
  [K in Transaction["family"]]: TransactionStrategyFunction;
@@ -209,26 +255,28 @@ export const transactionStrategy: {
209
255
  algorand: defaultTransaction,
210
256
  aptos: defaultTransaction,
211
257
  bitcoin: bitcoinTransaction,
212
- cardano: modeSendTransaction,
258
+ canton: defaultTransaction,
259
+ cardano: cardanoTransaction,
260
+ casper: defaultTransaction,
213
261
  celo: defaultTransaction,
214
262
  cosmos: cosmosTransaction,
215
- crypto_org: defaultTransaction,
216
- elrond: elrondTransaction,
217
- ethereum: withoutGasLimitTransaction,
263
+ evm: evmTransaction,
218
264
  filecoin: defaultTransaction,
219
265
  hedera: defaultTransaction,
220
- near: modeSendTransaction,
221
- neo: defaultTransaction,
266
+ icon: defaultTransaction,
267
+ internet_computer: defaultTransaction,
268
+ mina: defaultTransaction,
269
+ multiversx: elrondTransaction,
270
+ near: nearTransaction,
222
271
  polkadot: defaultTransaction,
223
- ripple: rippleTransaction,
224
272
  solana: solanaTransaction,
225
273
  stacks: defaultTransaction,
226
274
  stellar: stellarTransaction,
227
- tezos: modeSendTransaction,
275
+ sui: defaultTransaction,
276
+ tezos: tezosTransaction,
228
277
  ton: tonTransaction,
229
- tron: modeSendTransaction,
278
+ tron: tronTransaction,
230
279
  vechain: defaultTransaction,
231
- casper: defaultTransaction,
232
- sui: defaultTransaction,
233
- internet_computer: defaultTransaction,
280
+ kaspa: defaultTransaction,
281
+ xrp: rippleTransaction,
234
282
  };
@@ -0,0 +1,175 @@
1
+ type MockTransactionOperation = {
2
+ meta: {
3
+ delivered_amount: string;
4
+ };
5
+ tx: {
6
+ Account: string;
7
+ Amount: string;
8
+ Destination: string;
9
+ Fee: string;
10
+ Memo: string;
11
+ Sequence: number;
12
+ SigningPubKey: string;
13
+ TransactionType: string;
14
+ TxnSignature: string;
15
+ date: number;
16
+ hash: string;
17
+ inLedger: number;
18
+ };
19
+ validated: boolean;
20
+ };
21
+
22
+ const generateMockTransaction = (
23
+ account: string,
24
+ destination: string,
25
+ amount: string,
26
+ fee: string,
27
+ hash: string,
28
+ sequence: number,
29
+ timestamp: number,
30
+ inLedger: number,
31
+ ): MockTransactionOperation => ({
32
+ meta: {
33
+ delivered_amount: amount,
34
+ },
35
+ tx: {
36
+ Account: account,
37
+ Amount: amount,
38
+ Destination: destination,
39
+ Fee: fee,
40
+ Memo: "",
41
+ Sequence: sequence,
42
+ SigningPubKey: "ED" + account.slice(0, 32),
43
+ TransactionType: "Payment",
44
+ TxnSignature: hash.slice(0, 32),
45
+ date: timestamp,
46
+ hash,
47
+ inLedger,
48
+ },
49
+ validated: true,
50
+ });
51
+
52
+ export const getMockedMethods = (): {
53
+ method: string;
54
+ params: unknown[];
55
+ answer: unknown;
56
+ }[] => [
57
+ // Account balance lookup
58
+ {
59
+ method: "getBalance",
60
+ params: ["rLSn6Z3T5uGRdL5jzKLj2rKqRfQMT5JZRG"],
61
+ answer: {
62
+ account_data: {
63
+ Account: "rLSn6Z3T5uGRdL5jzKLj2rKqRfQMT5JZRG",
64
+ Balance: "1000000000",
65
+ },
66
+ ledger_hash: "4BC50C9B0D8515D3EAAE1E74B29A95804346C491EE1A95BF25E4AAB854A6A652",
67
+ ledger_index: 32570,
68
+ validated: true,
69
+ status: "success",
70
+ },
71
+ },
72
+
73
+ // Empty account (new account)
74
+ {
75
+ method: "getBalance",
76
+ params: ["rKj2N4jSSB8QMLq3VnvLcZj4QdKhzSkTZW"],
77
+ answer: {
78
+ error: "actNotFound",
79
+ },
80
+ },
81
+
82
+ // Account transactions
83
+ {
84
+ method: "getTransactions",
85
+ params: ["rLSn6Z3T5uGRdL5jzKLj2rKqRfQMT5JZRG", { from: 0, size: 100 }],
86
+ answer: [
87
+ generateMockTransaction(
88
+ "rLSn6Z3T5uGRdL5jzKLj2rKqRfQMT5JZRG",
89
+ "rKj2N4jSSB8QMLq3VnvLcZj4QdKhzSkTZW",
90
+ "100000000",
91
+ "10000",
92
+ "E3FE6EA3C48F0C2B639448020EA4F03D4F4F8BDCFDC8882B7B20DBD3A3A5B3A6",
93
+ 1,
94
+ Date.now() - 3600000, // 1 hour ago
95
+ 32569,
96
+ ),
97
+ generateMockTransaction(
98
+ "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
99
+ "rLSn6Z3T5uGRdL5jzKLj2rKqRfQMT5JZRG",
100
+ "200000000",
101
+ "10000",
102
+ "B7FDE3B1D3C2F4A9638448020EA4F03D4F4F8BDCFDC8882B7B20DBD3A3A5B3C8",
103
+ 5,
104
+ Date.now() - 7200000, // 2 hours ago
105
+ 32568,
106
+ ),
107
+ ],
108
+ },
109
+
110
+ // Empty transactions for new account
111
+ {
112
+ method: "getTransactions",
113
+ params: ["rKj2N4jSSB8QMLq3VnvLcZj4QdKhzSkTZW", { from: 0, size: 100 }],
114
+ answer: [],
115
+ },
116
+
117
+ // Fee estimation
118
+ {
119
+ method: "estimateFees",
120
+ params: ["12000400020000000000000000"], // sample serialized transaction
121
+ answer: "12000",
122
+ },
123
+
124
+ // Transaction submission
125
+ {
126
+ method: "submitTransaction",
127
+ params: ["12000400020000000000000000"], // sample signed transaction
128
+ answer: {
129
+ accepted: true,
130
+ tx_hash: "F4AB442A6D4CBB935D66E1DA7309A5FC71C7143ED4049053EC14E3875B0CF9BF",
131
+ },
132
+ },
133
+
134
+ // Network info
135
+ {
136
+ method: "getServerInfo",
137
+ params: [],
138
+ answer: {
139
+ info: {
140
+ complete_ledgers: "32570-32570",
141
+ ledger_index: 32570,
142
+ validated_ledger: {
143
+ hash: "4BC50C9B0D8515D3EAAE1E74B29A95804346C491EE1A95BF25E4AAB854A6A652",
144
+ seq: 32570,
145
+ },
146
+ },
147
+ status: "success",
148
+ },
149
+ },
150
+
151
+ // Account sequence number
152
+ {
153
+ method: "getNextValidSequence",
154
+ params: ["rLSn6Z3T5uGRdL5jzKLj2rKqRfQMT5JZRG"],
155
+ answer: 2,
156
+ },
157
+
158
+ // New account sequence
159
+ {
160
+ method: "getNextValidSequence",
161
+ params: ["rKj2N4jSSB8QMLq3VnvLcZj4QdKhzSkTZW"],
162
+ answer: 1,
163
+ },
164
+
165
+ // Last block
166
+ {
167
+ method: "lastBlock",
168
+ params: [],
169
+ answer: {
170
+ height: 32570,
171
+ hash: "4BC50C9B0D8515D3EAAE1E74B29A95804346C491EE1A95BF25E4AAB854A6A652",
172
+ time: Date.now(),
173
+ },
174
+ },
175
+ ];
@@ -0,0 +1,180 @@
1
+ import { makeLRUCache, minutes } from "@ledgerhq/live-network/cache";
2
+ import { createApi } from "@ledgerhq/coin-canton/api/index";
3
+ import { Transaction as CantonTransaction } from "@ledgerhq/coin-canton/types";
4
+ import type { AccountBridge } from "@ledgerhq/types-live";
5
+ import { BigNumber } from "bignumber.js";
6
+
7
+ // The calls data can be copied to mock-data.ts from the file.
8
+ // This function creates a live API with logging for generating mock data
9
+ /* eslint-disable-next-line @typescript-eslint/no-unused-vars */
10
+ function createMockDataForAPI() {
11
+ const signerContext = {};
12
+
13
+ const apiGetter = makeLRUCache(
14
+ config => Promise.resolve(createApi(config)),
15
+ config => config.nodeUrl || "",
16
+ minutes(1000),
17
+ );
18
+
19
+ return {
20
+ getAPI: apiGetter,
21
+ getQueuedAPI: apiGetter,
22
+ getQueuedAndCachedAPI: apiGetter,
23
+ signerContext,
24
+ };
25
+ }
26
+
27
+ const createTransaction = (): CantonTransaction => {
28
+ return {
29
+ family: "canton",
30
+ amount: new BigNumber(0),
31
+ recipient: "",
32
+ fee: null,
33
+ };
34
+ };
35
+
36
+ const updateTransaction = (
37
+ t: CantonTransaction,
38
+ patch: Partial<CantonTransaction>,
39
+ ): CantonTransaction => {
40
+ return { ...t, ...patch };
41
+ };
42
+
43
+ const getTransactionStatus = async (): Promise<any> => {
44
+ return {
45
+ errors: {},
46
+ warnings: {},
47
+ estimatedFees: new BigNumber(0),
48
+ amount: new BigNumber(0),
49
+ totalSpent: new BigNumber(0),
50
+ };
51
+ };
52
+
53
+ const estimateMaxSpendable = ({ account }: { account: any }): Promise<BigNumber> => {
54
+ return Promise.resolve(account.balance || new BigNumber(0));
55
+ };
56
+
57
+ const prepareTransaction = async (
58
+ _account: any,
59
+ transaction: CantonTransaction,
60
+ ): Promise<CantonTransaction> => {
61
+ return {
62
+ ...transaction,
63
+ fee: transaction.fee || new BigNumber(100),
64
+ };
65
+ };
66
+
67
+ const sync = (_initialAccount: any): any => {
68
+ return {
69
+ subscribe: (observer: any) => {
70
+ observer.next((acc: any) => acc);
71
+ observer.complete();
72
+ return { unsubscribe: () => {} };
73
+ },
74
+ };
75
+ };
76
+
77
+ const receive = (_account: any, _opts: { deviceId: string }): any => {
78
+ return {
79
+ subscribe: (observer: any) => {
80
+ observer.next({
81
+ address: "mock-address",
82
+ path: "44'/60'/0'/0/0",
83
+ publicKey: "mock-public-key",
84
+ });
85
+ observer.complete();
86
+ return { unsubscribe: () => {} };
87
+ },
88
+ };
89
+ };
90
+
91
+ const signOperation = (): any => {
92
+ return {
93
+ subscribe: (observer: any) => {
94
+ observer.next({
95
+ operation: {
96
+ id: "mock-operation-id",
97
+ hash: "mock-hash",
98
+ type: "OUT",
99
+ value: new BigNumber(0),
100
+ fee: new BigNumber(100),
101
+ blockHash: "mock-block-hash",
102
+ blockHeight: 12345,
103
+ accountId: "mock-account-id",
104
+ date: new Date(),
105
+ extra: {},
106
+ },
107
+ signature: "mock-signature",
108
+ });
109
+ observer.complete();
110
+ return { unsubscribe: () => {} };
111
+ },
112
+ };
113
+ };
114
+
115
+ const broadcast = async (): Promise<any> => {
116
+ return {
117
+ id: "mock-operation-id",
118
+ hash: "mock-hash",
119
+ type: "OUT",
120
+ value: new BigNumber(0),
121
+ fee: new BigNumber(100),
122
+ blockHash: "mock-block-hash",
123
+ blockHeight: 12345,
124
+ accountId: "mock-account-id",
125
+ date: new Date(),
126
+ extra: {},
127
+ };
128
+ };
129
+
130
+ const scanAccounts = (): any => {
131
+ return {
132
+ subscribe: (observer: any) => {
133
+ observer.next({
134
+ type: "discovered",
135
+ account: {
136
+ id: "mock-account-id",
137
+ name: "Mock Canton Account",
138
+ address: "mock-address",
139
+ currency: { id: "canton_network_devnet" },
140
+ balance: new BigNumber(0),
141
+ spendableBalance: new BigNumber(0),
142
+ blockHeight: 0,
143
+ lastSyncDate: new Date(),
144
+ operations: [],
145
+ pendingOperations: [],
146
+ },
147
+ });
148
+ observer.complete();
149
+ return { unsubscribe: () => {} };
150
+ },
151
+ };
152
+ };
153
+
154
+ const getSerializedAddressParameters = (): Buffer => {
155
+ return Buffer.from("mock-address-params");
156
+ };
157
+
158
+ const accountBridge: AccountBridge<CantonTransaction> = {
159
+ createTransaction,
160
+ updateTransaction,
161
+ getTransactionStatus,
162
+ estimateMaxSpendable,
163
+ prepareTransaction,
164
+ sync,
165
+ receive,
166
+ signOperation,
167
+ broadcast,
168
+ getSerializedAddressParameters,
169
+ };
170
+
171
+ const currencyBridge = {
172
+ preload: () => Promise.resolve({}),
173
+ hydrate: () => {},
174
+ scanAccounts,
175
+ };
176
+
177
+ export default {
178
+ accountBridge,
179
+ currencyBridge,
180
+ };