@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
@@ -0,0 +1,70 @@
1
+ import { filter, firstValueFrom } from "rxjs";
2
+ import { EvmAddress, EvmSignature, EvmSigner } from "@ledgerhq/coin-evm/types/signer";
3
+ import { CreateSigner } from "../../setup";
4
+ import { DeviceManagementKit } from "@ledgerhq/device-management-kit";
5
+ import { DmkSignerEth, LegacySignerEth } from "@ledgerhq/live-signer-evm";
6
+ import Transport from "@ledgerhq/hw-transport";
7
+ import { getEnv } from "@ledgerhq/live-env";
8
+ import { ResolutionConfig, LoadConfig } from "@ledgerhq/hw-app-eth/lib/services/types";
9
+ import { Signature } from "ethers";
10
+
11
+ export type Signer = {
12
+ getAddress: (path: string) => Promise<EvmAddress>;
13
+ signTransaction: (path: string, tx: string) => Promise<string>;
14
+ };
15
+
16
+ const isDmkTransport = (
17
+ transport: Transport,
18
+ ): transport is Transport & { dmk: DeviceManagementKit; sessionId: string } => {
19
+ return (
20
+ "dmk" in transport &&
21
+ transport.dmk !== undefined &&
22
+ "sessionId" in transport &&
23
+ transport.sessionId !== undefined
24
+ );
25
+ };
26
+
27
+ const createLiveSigner: CreateSigner<EvmSigner> = (transport: Transport) => {
28
+ if (isDmkTransport(transport)) {
29
+ return new DmkSignerEth(transport.dmk, transport.sessionId);
30
+ }
31
+
32
+ return new LegacySignerEth(transport);
33
+ };
34
+
35
+ export const createSigner: CreateSigner<Signer> = (transport: Transport) => {
36
+ const signer = createLiveSigner(transport);
37
+
38
+ return {
39
+ getAddress: signer.getAddress.bind(signer),
40
+ signTransaction: async (path, tx) => {
41
+ // Configure type of resolutions necessary for the clear signing
42
+ const resolutionConfig: ResolutionConfig = {
43
+ externalPlugins: true,
44
+ erc20: true,
45
+ nft: false,
46
+ uniswapV3: true,
47
+ };
48
+ const loadConfig: LoadConfig = {
49
+ cryptoassetsBaseURL: getEnv("DYNAMIC_CAL_BASE_URL"),
50
+ nftExplorerBaseURL: getEnv("NFT_METADATA_SERVICE") + "/v1/ethereum",
51
+ };
52
+
53
+ signer.setLoadConfig(loadConfig);
54
+
55
+ const observable = signer.clearSignTransaction(path, tx.substring(2), resolutionConfig, true);
56
+ const event = observable.pipe(
57
+ filter((event): event is { type: "signer.evm.signed"; value: EvmSignature } => {
58
+ return event.type === "signer.evm.signed";
59
+ }),
60
+ );
61
+ const { value } = await firstValueFrom(event);
62
+
63
+ return Signature.from({
64
+ r: "0x" + value.r,
65
+ s: "0x" + value.s,
66
+ v: typeof value.v === "number" ? value.v : parseInt(value.v, 16),
67
+ }).serialized;
68
+ },
69
+ };
70
+ };
@@ -1,22 +1,12 @@
1
- import { GetAddressFn } from "@ledgerhq/coin-framework/bridge/getAddressWrapper";
2
1
  import xrpGetAddress from "@ledgerhq/coin-xrp/signer/getAddress";
3
2
  import stellarGetAddress from "@ledgerhq/coin-stellar/signer/getAddress";
4
- import { CreateSigner, executeWithSigner } from "../../setup";
5
- import Xrp from "@ledgerhq/hw-app-xrp";
6
3
  import Stellar from "@ledgerhq/hw-app-str";
7
-
8
- import Transport from "@ledgerhq/hw-transport";
9
4
  import { signTransaction, stellarSignTransaction } from "./signTransaction";
10
- import { SignerContext } from "@ledgerhq/coin-framework/signer";
11
- import { SignTransactionOptions } from "./types";
12
5
  import { StrKey } from "@stellar/stellar-sdk";
13
-
14
- export type AlpacaSigner = {
15
- getAddress: GetAddressFn;
16
- signTransaction?: (deviceId: string, opts: SignTransactionOptions) => Promise<string>;
17
- signMessage?: (message: string) => Promise<string>;
18
- context: SignerContext<any>;
19
- };
6
+ import { CreateSigner, executeWithSigner } from "../../setup";
7
+ import Xrp from "@ledgerhq/hw-app-xrp";
8
+ import Transport from "@ledgerhq/hw-transport";
9
+ import { AlpacaSigner } from "./types";
20
10
 
21
11
  const createSignerXrp: CreateSigner<Xrp> = (transport: Transport) => {
22
12
  return new Xrp(transport);
@@ -47,7 +37,7 @@ const createSignerStellar: CreateSigner<Stellar> = (transport: Transport) => {
47
37
 
48
38
  const signerContextStellar = executeWithSigner(createSignerStellar);
49
39
 
50
- export function getSigner(network): AlpacaSigner {
40
+ export function getSigner(network: string): AlpacaSigner {
51
41
  switch (network) {
52
42
  case "ripple":
53
43
  case "xrp": {
@@ -1,9 +1,10 @@
1
1
  import { SignerContext } from "@ledgerhq/coin-framework/signer";
2
- import { XrpSigner } from "@ledgerhq/coin-xrp/index";
3
- import { SignTransactionOptions } from "./types";
4
2
  import { StellarSigner } from "@ledgerhq/coin-stellar/types/signer";
3
+ import { LegacySigner, SignTransactionOptions } from "./types";
5
4
 
6
- export const signTransaction = (signerContext: SignerContext<XrpSigner>) => {
5
+ export const signTransaction = <Signer extends LegacySigner>(
6
+ signerContext: SignerContext<Signer>,
7
+ ) => {
7
8
  return async (deviceId: string, { path, rawTxHex }: SignTransactionOptions) => {
8
9
  const signedTx = await signerContext(deviceId, signer =>
9
10
  signer.signTransaction(path, rawTxHex),
@@ -1,3 +1,17 @@
1
+ import { GetAddressFn } from "@ledgerhq/coin-framework/bridge/getAddressWrapper";
2
+ import { SignerContext } from "@ledgerhq/coin-framework/signer";
3
+
4
+ export type LegacySigner = {
5
+ signTransaction: (path: string, rawTxHex: string) => Promise<string>;
6
+ };
7
+
8
+ export type AlpacaSigner<S = unknown> = {
9
+ getAddress: GetAddressFn;
10
+ signTransaction?: (deviceId: string, opts: SignTransactionOptions) => Promise<string>;
11
+ signMessage?: (message: string) => Promise<string>;
12
+ context: SignerContext<S>;
13
+ };
14
+
1
15
  export type SignTransactionOptions = {
2
16
  rawTxHex: string;
3
17
  path: string;
@@ -0,0 +1,173 @@
1
+ import BigNumber from "bignumber.js";
2
+ import { genericGetAccountShape } from "../getAccountShape";
3
+
4
+ jest.mock("@ledgerhq/coin-framework/account/index", () => ({
5
+ encodeAccountId: jest.fn(() => "accId"),
6
+ }));
7
+
8
+ const mergeOpsMock = jest.fn();
9
+ jest.mock("@ledgerhq/coin-framework/bridge/jsHelpers", () => ({
10
+ mergeOps: (...args: any[]) => mergeOpsMock(...args),
11
+ }));
12
+
13
+ const listOperationsMock = jest.fn();
14
+ const getBalanceMock = jest.fn();
15
+ const lastBlockMock = jest.fn();
16
+ const getTokenFromAssetMock = jest.fn();
17
+ const chainSpecificGetAccountShapeMock = jest.fn();
18
+ jest.mock("../alpaca", () => ({
19
+ getAlpacaApi: () => ({
20
+ lastBlock: (...a: any[]) => lastBlockMock(...a),
21
+ getBalance: (...a: any[]) => getBalanceMock(...a),
22
+ listOperations: (...a: any[]) => listOperationsMock(...a),
23
+ getTokenFromAsset: (...a: any[]) => getTokenFromAssetMock(...a),
24
+ getChainSpecificRules: () => ({
25
+ getAccountShape: (...a: any[]) => chainSpecificGetAccountShapeMock(...a),
26
+ }),
27
+ }),
28
+ }));
29
+
30
+ const adaptCoreOperationToLiveOperationMock = jest.fn();
31
+ const extractBalanceMock = jest.fn();
32
+ jest.mock("../utils", () => ({
33
+ adaptCoreOperationToLiveOperation: (...a: any[]) => adaptCoreOperationToLiveOperationMock(...a),
34
+ extractBalance: (...a: any[]) => extractBalanceMock(...a),
35
+ }));
36
+
37
+ const inferSubOperationsMock = jest.fn();
38
+ jest.mock("@ledgerhq/coin-framework/serialization", () => ({
39
+ inferSubOperations: (...a: any[]) => inferSubOperationsMock(...a),
40
+ }));
41
+
42
+ const buildSubAccountsMock = jest.fn();
43
+ jest.mock("../buildSubAccounts", () => ({
44
+ buildSubAccounts: (...a: any[]) => buildSubAccountsMock(...a),
45
+ }));
46
+
47
+ // Test matrix for Stellar & XRP
48
+ const chains = [
49
+ { currency: { id: "stellar", name: "Stellar" }, network: "testnet" },
50
+ { currency: { id: "ripple", name: "XRP" }, network: "mainnet" },
51
+ ];
52
+
53
+ describe("genericGetAccountShape (stellar & xrp)", () => {
54
+ beforeEach(() => {
55
+ jest.clearAllMocks();
56
+ });
57
+
58
+ describe.each(chains)("$currency.id", ({ currency, network }) => {
59
+ test("builds account shape with existing operations, pagination and sub accounts", async () => {
60
+ const oldOp = {
61
+ hash: "h1",
62
+ blockHeight: 10,
63
+ type: "OPT_IN",
64
+ extra: { pagingToken: "pt1", assetReference: "ar1", assetOwner: "ow1" },
65
+ };
66
+ const initialAccount = { operations: [oldOp], blockHeight: 10 };
67
+
68
+ extractBalanceMock.mockReturnValue({ value: "1000", locked: "300" });
69
+ getBalanceMock.mockResolvedValue([
70
+ { asset: { type: "native" }, value: "1000", locked: "300" },
71
+ { asset: { type: "token", symbol: "TOK1" }, value: "42" },
72
+ { asset: { type: "token", symbol: "TOK_IGNORE" }, value: "5" },
73
+ ]);
74
+
75
+ getTokenFromAssetMock.mockImplementation(asset =>
76
+ asset.symbol === "TOK1" ? { id: `${currency.id}_token1` } : null,
77
+ );
78
+
79
+ const coreOp = { hash: "h2", height: 12 };
80
+ listOperationsMock.mockResolvedValue([[coreOp]]);
81
+
82
+ adaptCoreOperationToLiveOperationMock.mockImplementation((_accId, op) => ({
83
+ hash: op.hash,
84
+ type: "IN",
85
+ blockHeight: 12,
86
+ extra: { assetReference: "ar2", assetOwner: "ow2" },
87
+ }));
88
+
89
+ mergeOpsMock.mockImplementation((oldOps, newOps) => [...newOps, ...oldOps]);
90
+
91
+ buildSubAccountsMock.mockReturnValue([
92
+ { id: `${currency.id}_subAcc1`, type: "TokenAccount" },
93
+ ]);
94
+
95
+ inferSubOperationsMock.mockImplementation(hash =>
96
+ hash === "h2" ? [{ id: `${currency.id}_subOp1` }] : [],
97
+ );
98
+
99
+ lastBlockMock.mockResolvedValue({ height: 123 });
100
+
101
+ const getShape = genericGetAccountShape(network, currency.id);
102
+ const result = await getShape(
103
+ {
104
+ address: `${currency.id}_addr1`,
105
+ initialAccount,
106
+ currency,
107
+ derivationMode: "",
108
+ } as any,
109
+ { paginationConfig: {} as any },
110
+ );
111
+
112
+ expect(chainSpecificGetAccountShapeMock).toHaveBeenCalledWith(`${currency.id}_addr1`);
113
+
114
+ expect(listOperationsMock).toHaveBeenCalledWith(`${currency.id}_addr1`, {
115
+ minHeight: 11,
116
+ order: "asc",
117
+ lastPagingToken: "pt1",
118
+ });
119
+
120
+ const assetsBalancePassed = buildSubAccountsMock.mock.calls[0][0].assetsBalance;
121
+ expect(assetsBalancePassed).toHaveLength(1);
122
+ expect(assetsBalancePassed[0].asset.symbol).toBe("TOK1");
123
+
124
+ const assetOpsPassed = buildSubAccountsMock.mock.calls[0][0].operations;
125
+ expect(assetOpsPassed).toHaveLength(1);
126
+ expect(assetOpsPassed[0].hash).toBe("h2");
127
+
128
+ expect(result).toMatchObject({
129
+ balance: new BigNumber(1000),
130
+ spendableBalance: new BigNumber(700),
131
+ blockHeight: 123,
132
+ operationsCount: 2,
133
+ subAccounts: [{ id: `${currency.id}_subAcc1`, type: "TokenAccount" }],
134
+ operations: [
135
+ {
136
+ hash: "h2",
137
+ type: "IN",
138
+ blockHeight: 12,
139
+ subOperations: [{ id: `${currency.id}_subOp1` }],
140
+ extra: { assetReference: "ar2", assetOwner: "ow2" },
141
+ },
142
+ oldOp,
143
+ ],
144
+ });
145
+ });
146
+
147
+ test("handles empty operations (no old ops, no new ops) and blockHeight=0", async () => {
148
+ getBalanceMock.mockResolvedValue([{ asset: { type: "native" }, value: "0", locked: "0" }]);
149
+ extractBalanceMock.mockReturnValue({ value: "0", locked: "0" });
150
+ listOperationsMock.mockResolvedValue([[]]);
151
+ buildSubAccountsMock.mockReturnValue([]);
152
+
153
+ const getShape = genericGetAccountShape(network, currency.id);
154
+ const result = await getShape(
155
+ {
156
+ address: `${currency.id}_addr2`,
157
+ initialAccount: undefined,
158
+ currency,
159
+ derivationMode: "",
160
+ } as any,
161
+ { paginationConfig: {} as any },
162
+ );
163
+ expect(result).toMatchObject({
164
+ operations: [], // Empty array check for `operations`
165
+ blockHeight: 0,
166
+ operationsCount: 0,
167
+ subAccounts: [], // Empty array check for `subAccounts`
168
+ balance: new BigNumber(0),
169
+ spendableBalance: new BigNumber(0),
170
+ });
171
+ });
172
+ });
173
+ });
@@ -1,8 +1,36 @@
1
- import { adaptCoreOperationToLiveOperation, extractBalance } from "./utils";
1
+ import {
2
+ adaptCoreOperationToLiveOperation,
3
+ extractBalance,
4
+ findCryptoCurrencyByNetwork,
5
+ } from "./utils";
2
6
  import BigNumber from "bignumber.js";
3
7
  import { Operation as CoreOperation } from "@ledgerhq/coin-framework/api/types";
4
8
 
5
9
  describe("Alpaca utils", () => {
10
+ describe("findCryptoCurrencyByNetwork", () => {
11
+ it("finds a crypto currency by id", () => {
12
+ expect(findCryptoCurrencyByNetwork("ethereum")).toMatchObject({
13
+ id: "ethereum",
14
+ family: "evm",
15
+ });
16
+ });
17
+
18
+ it("takes currency remapping into account", () => {
19
+ expect(findCryptoCurrencyByNetwork("ripple")).toMatchObject({
20
+ id: "ripple",
21
+ family: "xrp",
22
+ });
23
+ expect(findCryptoCurrencyByNetwork("xrp")).toMatchObject({
24
+ id: "ripple",
25
+ family: "xrp",
26
+ });
27
+ });
28
+
29
+ it("does not find non existing currencies", () => {
30
+ expect(findCryptoCurrencyByNetwork("non_existing_currency")).toBeUndefined();
31
+ });
32
+ });
33
+
6
34
  describe("extractBalance", () => {
7
35
  it("extracts an existing balance", () => {
8
36
  expect(extractBalance([{ value: 4n, asset: { type: "type1" } }], "type1")).toEqual({
@@ -7,6 +7,15 @@ import {
7
7
  Operation as CoreOperation,
8
8
  TransactionIntent,
9
9
  } from "@ledgerhq/coin-framework/api/types";
10
+ import { findCryptoCurrencyById } from "@ledgerhq/cryptoassets/currencies";
11
+ import { CryptoCurrency } from "@ledgerhq/types-cryptoassets";
12
+
13
+ export function findCryptoCurrencyByNetwork(network: string): CryptoCurrency | undefined {
14
+ const networksRemap = {
15
+ xrp: "ripple",
16
+ };
17
+ return findCryptoCurrencyById(networksRemap[network] ?? network);
18
+ }
10
19
 
11
20
  export function extractBalance(balances: Balance[], type: string): Balance {
12
21
  return (
@@ -110,6 +119,12 @@ export function transactionToIntent(
110
119
  case "send":
111
120
  transactionType = "send";
112
121
  break;
122
+ case "send-legacy":
123
+ transactionType = "send-legacy";
124
+ break;
125
+ case "send-eip1559":
126
+ transactionType = "send-eip1559";
127
+ break;
113
128
  default:
114
129
  throw new Error(`Unsupported transaction mode: ${transaction.mode}`);
115
130
  }
@@ -11,6 +11,7 @@ import { evmConfig } from "../families/evm/config";
11
11
  import { fileCoinConfig } from "../families/filecoin/config";
12
12
  import { hederaConfig } from "../families/hedera/config";
13
13
  import { internetComputerConfig } from "../families/internet_computer/config";
14
+ import { kaspaConfig } from "../families/kaspa/config";
14
15
  import { nearConfig } from "../families/near/config";
15
16
  import { minaConfig } from "../families/mina/config";
16
17
  import { polkadotConfig } from "../families/polkadot/config";
@@ -24,6 +25,7 @@ import { tronConfig } from "../families/tron/config";
24
25
  import { vechainConfig } from "../families/vechain/config";
25
26
  import { iconConfig } from "../families/icon/config";
26
27
  import { suiConfig } from "../families/sui/config";
28
+ import { cantonConfig } from "../families/canton/config";
27
29
 
28
30
  const countervaluesConfig: ConfigSchema = {
29
31
  config_countervalues_refreshRate: {
@@ -54,6 +56,7 @@ export const liveConfig: ConfigSchema = {
54
56
  ...fileCoinConfig,
55
57
  ...hederaConfig,
56
58
  ...internetComputerConfig,
59
+ ...kaspaConfig,
57
60
  ...nearConfig,
58
61
  ...minaConfig,
59
62
  ...polkadotConfig,
@@ -67,4 +70,5 @@ export const liveConfig: ConfigSchema = {
67
70
  ...iconConfig,
68
71
  ...tonConfig,
69
72
  ...suiConfig,
73
+ ...cantonConfig,
70
74
  };
@@ -276,6 +276,20 @@ export class Account {
276
276
  0,
277
277
  );
278
278
 
279
+ static readonly KASPA_1 = new Account(
280
+ Currency.KAS,
281
+ "KASPA 1",
282
+ "kaspa:kaspa:qqpqtujclz2usyj7rgmhghfu8e5echrh8t2pkz69tq37uclfrpu3g0w6laqqk",
283
+ 0,
284
+ );
285
+
286
+ static readonly KASPA_2 = new Account(
287
+ Currency.KAS,
288
+ "KASPA 2",
289
+ "kaspa:qrx2agwk93qyjvlcuzz5jy37knt298zupvw2ls05p4te55c29uwuyzzra5qkv",
290
+ 1,
291
+ );
292
+
279
293
  static readonly LTC_1 = new Account(
280
294
  Currency.LTC,
281
295
  "Litecoin 1",
@@ -60,4 +60,6 @@ export class AppInfos {
60
60
  static readonly CELO = new AppInfos("Celo");
61
61
 
62
62
  static readonly LTC = new AppInfos("Litecoin");
63
+
64
+ static readonly KASPA = new AppInfos("Kaspa");
63
65
  }
@@ -25,6 +25,8 @@ export class Currency {
25
25
 
26
26
  static readonly APT = new Currency("Aptos", "APT", "aptos", AppInfos.APTOS, [Network.APTOS]);
27
27
 
28
+ static readonly KAS = new Currency("Kaspa", "KAS", "kaspa", AppInfos.KASPA, [Network.KASPA]);
29
+
28
30
  static readonly tBTC = new Currency(
29
31
  "Bitcoin Testnet",
30
32
  "𝚝BTC",
@@ -57,4 +57,5 @@ export enum DeviceLabels {
57
57
  VERIFY_SOLANA_ADDRESS = "Verify Solana address",
58
58
  REVIEW_TRANSACTION = "Review transaction",
59
59
  I_UNDERSTAND = "I understand",
60
+ RECEIVE_ADDRESS_DOES_NOT_BELONG = "Receive address does",
60
61
  }
@@ -30,4 +30,5 @@ export enum Network {
30
30
  OSMOSIS = "Osmosis",
31
31
  MULTIVERS_X = "MultiversX",
32
32
  LITECOIN = "Litecoin",
33
+ KASPA = "Kaspa",
33
34
  }
@@ -0,0 +1,17 @@
1
+ import expect from "expect";
2
+ import { pressBoth, pressUntilTextFound, waitFor, containsSubstringInEvent } from "../speculos";
3
+ import { DeviceLabels } from "../enum/DeviceLabels";
4
+ import { Delegate } from "../models/Delegate";
5
+
6
+ export async function sendKaspa() {
7
+ await pressUntilTextFound(DeviceLabels.APPROVE);
8
+ await pressBoth();
9
+ }
10
+
11
+ export async function delegateKaspa(delegatingAccount: Delegate) {
12
+ await waitFor(DeviceLabels.REVIEW_OPERATION);
13
+ const events = await pressUntilTextFound(DeviceLabels.APPROVE);
14
+ const isAmountCorrect = containsSubstringInEvent(delegatingAccount.amount, events);
15
+ expect(isAmountCorrect).toBeTruthy();
16
+ await pressBoth();
17
+ }
@@ -30,6 +30,7 @@ import { sendXRP } from "./families/xrp";
30
30
  import { delegateAptos, sendAptos } from "./families/aptos";
31
31
  import { delegateNear } from "./families/near";
32
32
  import { delegateCosmos, sendCosmos } from "./families/cosmos";
33
+ import { sendKaspa } from "./families/kaspa";
33
34
  import { delegateSolana, sendSolana } from "./families/solana";
34
35
  import { delegateTezos } from "./families/tezos";
35
36
  import { delegateCelo } from "./families/celo";
@@ -325,6 +326,14 @@ export const specs: Specs = {
325
326
  },
326
327
  dependency: "",
327
328
  },
329
+ Kaspa: {
330
+ currency: getCryptoCurrencyById("kaspa"),
331
+ appQuery: {
332
+ model: getSpeculosModel(),
333
+ appName: "Kaspa",
334
+ },
335
+ dependency: "",
336
+ },
328
337
  };
329
338
 
330
339
  export async function startSpeculos(
@@ -677,6 +686,9 @@ export async function signSendTransaction(tx: Transaction) {
677
686
  case Currency.APT:
678
687
  await sendAptos();
679
688
  break;
689
+ case Currency.KAS:
690
+ await sendKaspa();
691
+ break;
680
692
  default:
681
693
  throw new Error(`Unsupported currency: ${currencyName.ticker}`);
682
694
  }
@@ -735,6 +747,7 @@ export async function verifyAmountsAndAcceptSwap(swap: Swap, amount: string) {
735
747
  }
736
748
 
737
749
  export async function verifyAmountsAndAcceptSwapForDifferentSeed(swap: Swap, amount: string) {
750
+ await waitFor(DeviceLabels.RECEIVE_ADDRESS_DOES_NOT_BELONG);
738
751
  await pressUntilTextFound(DeviceLabels.I_UNDERSTAND);
739
752
  await pressBoth();
740
753
  const events = await pressUntilTextFound(DeviceLabels.SIGN_TRANSACTION);