@ledgerhq/live-common 34.48.0-nightly.1 → 34.48.0-nightly.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (483) 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/createTransaction.d.ts +1 -1
  31. package/lib/bridge/generic-alpaca/createTransaction.d.ts.map +1 -1
  32. package/lib/bridge/generic-alpaca/createTransaction.js +8 -0
  33. package/lib/bridge/generic-alpaca/createTransaction.js.map +1 -1
  34. package/lib/bridge/generic-alpaca/currencyBridge.d.ts +2 -1
  35. package/lib/bridge/generic-alpaca/currencyBridge.d.ts.map +1 -1
  36. package/lib/bridge/generic-alpaca/currencyBridge.js +3 -2
  37. package/lib/bridge/generic-alpaca/currencyBridge.js.map +1 -1
  38. package/lib/bridge/generic-alpaca/getAccountShape.d.ts.map +1 -1
  39. package/lib/bridge/generic-alpaca/getAccountShape.js +4 -4
  40. package/lib/bridge/generic-alpaca/getAccountShape.js.map +1 -1
  41. package/lib/bridge/generic-alpaca/signer/Eth.d.ts +8 -0
  42. package/lib/bridge/generic-alpaca/signer/Eth.d.ts.map +1 -0
  43. package/lib/bridge/generic-alpaca/signer/Eth.js +51 -0
  44. package/lib/bridge/generic-alpaca/signer/Eth.js.map +1 -0
  45. package/lib/bridge/generic-alpaca/signer/index.d.ts +2 -10
  46. package/lib/bridge/generic-alpaca/signer/index.d.ts.map +1 -1
  47. package/lib/bridge/generic-alpaca/signer/index.js +2 -2
  48. package/lib/bridge/generic-alpaca/signer/index.js.map +1 -1
  49. package/lib/bridge/generic-alpaca/signer/signTransaction.d.ts +2 -3
  50. package/lib/bridge/generic-alpaca/signer/signTransaction.d.ts.map +1 -1
  51. package/lib/bridge/generic-alpaca/signer/signTransaction.js.map +1 -1
  52. package/lib/bridge/generic-alpaca/signer/types.d.ts +11 -0
  53. package/lib/bridge/generic-alpaca/signer/types.d.ts.map +1 -1
  54. package/lib/bridge/generic-alpaca/utils.d.ts +2 -0
  55. package/lib/bridge/generic-alpaca/utils.d.ts.map +1 -1
  56. package/lib/bridge/generic-alpaca/utils.js +15 -1
  57. package/lib/bridge/generic-alpaca/utils.js.map +1 -1
  58. package/lib/bridge/generic-alpaca/utils.test.js +21 -0
  59. package/lib/bridge/generic-alpaca/utils.test.js.map +1 -1
  60. package/lib/config/sharedConfig.d.ts.map +1 -1
  61. package/lib/config/sharedConfig.js +30 -26
  62. package/lib/config/sharedConfig.js.map +1 -1
  63. package/lib/e2e/enum/Account.d.ts +2 -0
  64. package/lib/e2e/enum/Account.d.ts.map +1 -1
  65. package/lib/e2e/enum/Account.js +2 -0
  66. package/lib/e2e/enum/Account.js.map +1 -1
  67. package/lib/e2e/enum/AppInfos.d.ts +1 -0
  68. package/lib/e2e/enum/AppInfos.d.ts.map +1 -1
  69. package/lib/e2e/enum/AppInfos.js +1 -0
  70. package/lib/e2e/enum/AppInfos.js.map +1 -1
  71. package/lib/e2e/enum/Currency.d.ts +1 -0
  72. package/lib/e2e/enum/Currency.d.ts.map +1 -1
  73. package/lib/e2e/enum/Currency.js +1 -0
  74. package/lib/e2e/enum/Currency.js.map +1 -1
  75. package/lib/e2e/enum/Network.d.ts +2 -1
  76. package/lib/e2e/enum/Network.d.ts.map +1 -1
  77. package/lib/e2e/enum/Network.js +1 -0
  78. package/lib/e2e/enum/Network.js.map +1 -1
  79. package/lib/e2e/families/kaspa.d.ts +4 -0
  80. package/lib/e2e/families/kaspa.d.ts.map +1 -0
  81. package/lib/e2e/families/kaspa.js +23 -0
  82. package/lib/e2e/families/kaspa.js.map +1 -0
  83. package/lib/e2e/index.d.ts +3 -6
  84. package/lib/e2e/index.d.ts.map +1 -1
  85. package/lib/e2e/speculos.d.ts.map +1 -1
  86. package/lib/e2e/speculos.js +12 -0
  87. package/lib/e2e/speculos.js.map +1 -1
  88. package/lib/env.react.d.ts +1 -1
  89. package/lib/env.react.d.ts.map +1 -1
  90. package/lib/families/canton/bridge/mock-data.d.ts +6 -0
  91. package/lib/families/canton/bridge/mock-data.d.ts.map +1 -0
  92. package/lib/families/canton/bridge/mock-data.js +120 -0
  93. package/lib/families/canton/bridge/mock-data.js.map +1 -0
  94. package/lib/families/canton/bridge/mock.d.ts +12 -0
  95. package/lib/families/canton/bridge/mock.d.ts.map +1 -0
  96. package/lib/families/canton/bridge/mock.js +154 -0
  97. package/lib/families/canton/bridge/mock.js.map +1 -0
  98. package/lib/families/canton/config.d.ts.map +1 -1
  99. package/lib/families/canton/config.js +5 -2
  100. package/lib/families/canton/config.js.map +1 -1
  101. package/lib/families/canton/setup.d.ts.map +1 -1
  102. package/lib/families/canton/setup.js +8 -2
  103. package/lib/families/canton/setup.js.map +1 -1
  104. package/lib/families/evm/config.js +2 -2
  105. package/lib/families/evm/config.js.map +1 -1
  106. package/lib/families/kaspa/bridge.integration.test.d.ts +2 -0
  107. package/lib/families/kaspa/bridge.integration.test.d.ts.map +1 -0
  108. package/lib/families/kaspa/bridge.integration.test.js +7 -0
  109. package/lib/families/kaspa/bridge.integration.test.js.map +1 -0
  110. package/lib/families/kaspa/config.d.ts +3 -0
  111. package/lib/families/kaspa/config.d.ts.map +1 -0
  112. package/lib/families/kaspa/config.js +14 -0
  113. package/lib/families/kaspa/config.js.map +1 -0
  114. package/lib/families/kaspa/react.d.ts +4 -0
  115. package/lib/families/kaspa/react.d.ts.map +1 -0
  116. package/lib/families/kaspa/react.js +18 -0
  117. package/lib/families/kaspa/react.js.map +1 -0
  118. package/lib/families/kaspa/setup.d.ts +18 -0
  119. package/lib/families/kaspa/setup.d.ts.map +1 -0
  120. package/lib/families/kaspa/setup.js +24 -0
  121. package/lib/families/kaspa/setup.js.map +1 -0
  122. package/lib/families/kaspa/types.d.ts +2 -0
  123. package/lib/families/kaspa/types.d.ts.map +1 -0
  124. package/lib/families/kaspa/types.js +18 -0
  125. package/lib/families/kaspa/types.js.map +1 -0
  126. package/lib/families/xrp/setup.d.ts +2 -2
  127. package/lib/featureFlags/defaultFeatures.d.ts.map +1 -1
  128. package/lib/featureFlags/defaultFeatures.js +0 -2
  129. package/lib/featureFlags/defaultFeatures.js.map +1 -1
  130. package/lib/featureFlags/useFeature.d.ts +1 -1
  131. package/lib/featureFlags/useFeature.d.ts.map +1 -1
  132. package/lib/generated/bridge/js.d.ts +1 -0
  133. package/lib/generated/bridge/js.d.ts.map +1 -1
  134. package/lib/generated/bridge/js.js +24 -22
  135. package/lib/generated/bridge/js.js.map +1 -1
  136. package/lib/generated/bridge/mock.d.ts +9 -1
  137. package/lib/generated/bridge/mock.d.ts.map +1 -1
  138. package/lib/generated/bridge/mock.js +26 -24
  139. package/lib/generated/bridge/mock.js.map +1 -1
  140. package/lib/generated/cli-transaction.d.ts +13 -2
  141. package/lib/generated/cli-transaction.d.ts.map +1 -1
  142. package/lib/generated/cli-transaction.js +28 -26
  143. package/lib/generated/cli-transaction.js.map +1 -1
  144. package/lib/generated/deviceTransactionConfig.d.ts +2 -0
  145. package/lib/generated/deviceTransactionConfig.d.ts.map +1 -1
  146. package/lib/generated/deviceTransactionConfig.js +24 -22
  147. package/lib/generated/deviceTransactionConfig.js.map +1 -1
  148. package/lib/generated/hw-getAddress.d.ts +1 -0
  149. package/lib/generated/hw-getAddress.d.ts.map +1 -1
  150. package/lib/generated/hw-getAddress.js +28 -26
  151. package/lib/generated/hw-getAddress.js.map +1 -1
  152. package/lib/generated/platformAdapter.d.ts +1 -1
  153. package/lib/generated/specs.d.ts +1 -1
  154. package/lib/generated/transaction.d.ts +11 -3
  155. package/lib/generated/transaction.d.ts.map +1 -1
  156. package/lib/generated/transaction.js +28 -26
  157. package/lib/generated/transaction.js.map +1 -1
  158. package/lib/generated/types.d.ts +5 -4
  159. package/lib/generated/types.d.ts.map +1 -1
  160. package/lib/generated/walletApiAdapter.d.ts +1 -1
  161. package/lib/hw/actions/app.d.ts.map +1 -1
  162. package/lib/hw/actions/app.js +11 -8
  163. package/lib/hw/actions/app.js.map +1 -1
  164. package/lib/hw/getDeviceNameMaxLength.d.ts.map +1 -1
  165. package/lib/hw/getDeviceNameMaxLength.js +2 -0
  166. package/lib/hw/getDeviceNameMaxLength.js.map +1 -1
  167. package/lib/hw/getDeviceNameMaxLength.test.js +12 -0
  168. package/lib/hw/getDeviceNameMaxLength.test.js.map +1 -1
  169. package/lib/modularDrawer/hooks/useAssetsData.d.ts +1 -0
  170. package/lib/modularDrawer/hooks/useAssetsData.d.ts.map +1 -1
  171. package/lib/modularDrawer/hooks/useAssetsData.js +3 -2
  172. package/lib/modularDrawer/hooks/useAssetsData.js.map +1 -1
  173. package/lib/modularDrawer/hooks/useSearch.d.ts +16 -0
  174. package/lib/modularDrawer/hooks/useSearch.d.ts.map +1 -0
  175. package/lib/modularDrawer/hooks/useSearch.js +24 -0
  176. package/lib/modularDrawer/hooks/useSearch.js.map +1 -0
  177. package/lib/notifications/ServiceStatusProvider/index.d.ts +16 -1
  178. package/lib/notifications/ServiceStatusProvider/index.d.ts.map +1 -1
  179. package/lib/notifications/ServiceStatusProvider/index.js +31 -7
  180. package/lib/notifications/ServiceStatusProvider/index.js.map +1 -1
  181. package/lib/notifications/ServiceStatusProvider/index.test.d.ts +2 -0
  182. package/lib/notifications/ServiceStatusProvider/index.test.d.ts.map +1 -0
  183. package/lib/notifications/ServiceStatusProvider/index.test.js +88 -0
  184. package/lib/notifications/ServiceStatusProvider/index.test.js.map +1 -0
  185. package/lib/notifications/ServiceStatusProvider/ledger-components.d.ts +2 -0
  186. package/lib/notifications/ServiceStatusProvider/ledger-components.d.ts.map +1 -0
  187. package/lib/notifications/ServiceStatusProvider/ledger-components.js +16 -0
  188. package/lib/notifications/ServiceStatusProvider/ledger-components.js.map +1 -0
  189. package/lib/wallet-api/ACRE/server.d.ts +13 -6
  190. package/lib/wallet-api/ACRE/server.d.ts.map +1 -1
  191. package/lib/wallet-api/ACRE/server.js +142 -1
  192. package/lib/wallet-api/ACRE/server.js.map +1 -1
  193. package/lib/wallet-api/ACRE/server.test.d.ts +2 -0
  194. package/lib/wallet-api/ACRE/server.test.d.ts.map +1 -0
  195. package/lib/wallet-api/ACRE/server.test.js +393 -0
  196. package/lib/wallet-api/ACRE/server.test.js.map +1 -0
  197. package/lib-es/__tests__/test-helpers/environment.js +1 -0
  198. package/lib-es/__tests__/test-helpers/environment.js.map +1 -1
  199. package/lib-es/apps/inlineAppInstall.d.ts +1 -3
  200. package/lib-es/apps/inlineAppInstall.d.ts.map +1 -1
  201. package/lib-es/apps/inlineAppInstall.js +2 -2
  202. package/lib-es/apps/inlineAppInstall.js.map +1 -1
  203. package/lib-es/apps/react.d.ts +1 -2
  204. package/lib-es/apps/react.d.ts.map +1 -1
  205. package/lib-es/apps/react.js +2 -2
  206. package/lib-es/apps/react.js.map +1 -1
  207. package/lib-es/apps/runner.d.ts +2 -4
  208. package/lib-es/apps/runner.d.ts.map +1 -1
  209. package/lib-es/apps/runner.js +3 -4
  210. package/lib-es/apps/runner.js.map +1 -1
  211. package/lib-es/bridge/crypto-assets/index.d.ts.map +1 -1
  212. package/lib-es/bridge/crypto-assets/index.js +0 -4
  213. package/lib-es/bridge/crypto-assets/index.js.map +1 -1
  214. package/lib-es/bridge/crypto-assets/index.test.js +0 -36
  215. package/lib-es/bridge/crypto-assets/index.test.js.map +1 -1
  216. package/lib-es/bridge/generic-alpaca/accountBridge.d.ts +2 -1
  217. package/lib-es/bridge/generic-alpaca/accountBridge.d.ts.map +1 -1
  218. package/lib-es/bridge/generic-alpaca/accountBridge.js +2 -2
  219. package/lib-es/bridge/generic-alpaca/accountBridge.js.map +1 -1
  220. package/lib-es/bridge/generic-alpaca/alpaca/index.d.ts +1 -1
  221. package/lib-es/bridge/generic-alpaca/alpaca/index.d.ts.map +1 -1
  222. package/lib-es/bridge/generic-alpaca/alpaca/index.js +10 -6
  223. package/lib-es/bridge/generic-alpaca/alpaca/index.js.map +1 -1
  224. package/lib-es/bridge/generic-alpaca/alpaca/index.unit.test.js +37 -9
  225. package/lib-es/bridge/generic-alpaca/alpaca/index.unit.test.js.map +1 -1
  226. package/lib-es/bridge/generic-alpaca/createTransaction.d.ts +1 -1
  227. package/lib-es/bridge/generic-alpaca/createTransaction.d.ts.map +1 -1
  228. package/lib-es/bridge/generic-alpaca/createTransaction.js +8 -0
  229. package/lib-es/bridge/generic-alpaca/createTransaction.js.map +1 -1
  230. package/lib-es/bridge/generic-alpaca/currencyBridge.d.ts +2 -1
  231. package/lib-es/bridge/generic-alpaca/currencyBridge.d.ts.map +1 -1
  232. package/lib-es/bridge/generic-alpaca/currencyBridge.js +3 -2
  233. package/lib-es/bridge/generic-alpaca/currencyBridge.js.map +1 -1
  234. package/lib-es/bridge/generic-alpaca/getAccountShape.d.ts.map +1 -1
  235. package/lib-es/bridge/generic-alpaca/getAccountShape.js +4 -4
  236. package/lib-es/bridge/generic-alpaca/getAccountShape.js.map +1 -1
  237. package/lib-es/bridge/generic-alpaca/signer/Eth.d.ts +8 -0
  238. package/lib-es/bridge/generic-alpaca/signer/Eth.d.ts.map +1 -0
  239. package/lib-es/bridge/generic-alpaca/signer/Eth.js +47 -0
  240. package/lib-es/bridge/generic-alpaca/signer/Eth.js.map +1 -0
  241. package/lib-es/bridge/generic-alpaca/signer/index.d.ts +2 -10
  242. package/lib-es/bridge/generic-alpaca/signer/index.d.ts.map +1 -1
  243. package/lib-es/bridge/generic-alpaca/signer/index.js +2 -2
  244. package/lib-es/bridge/generic-alpaca/signer/index.js.map +1 -1
  245. package/lib-es/bridge/generic-alpaca/signer/signTransaction.d.ts +2 -3
  246. package/lib-es/bridge/generic-alpaca/signer/signTransaction.d.ts.map +1 -1
  247. package/lib-es/bridge/generic-alpaca/signer/signTransaction.js.map +1 -1
  248. package/lib-es/bridge/generic-alpaca/signer/types.d.ts +11 -0
  249. package/lib-es/bridge/generic-alpaca/signer/types.d.ts.map +1 -1
  250. package/lib-es/bridge/generic-alpaca/utils.d.ts +2 -0
  251. package/lib-es/bridge/generic-alpaca/utils.d.ts.map +1 -1
  252. package/lib-es/bridge/generic-alpaca/utils.js +13 -0
  253. package/lib-es/bridge/generic-alpaca/utils.js.map +1 -1
  254. package/lib-es/bridge/generic-alpaca/utils.test.js +22 -1
  255. package/lib-es/bridge/generic-alpaca/utils.test.js.map +1 -1
  256. package/lib-es/config/sharedConfig.d.ts.map +1 -1
  257. package/lib-es/config/sharedConfig.js +4 -0
  258. package/lib-es/config/sharedConfig.js.map +1 -1
  259. package/lib-es/e2e/enum/Account.d.ts +2 -0
  260. package/lib-es/e2e/enum/Account.d.ts.map +1 -1
  261. package/lib-es/e2e/enum/Account.js +2 -0
  262. package/lib-es/e2e/enum/Account.js.map +1 -1
  263. package/lib-es/e2e/enum/AppInfos.d.ts +1 -0
  264. package/lib-es/e2e/enum/AppInfos.d.ts.map +1 -1
  265. package/lib-es/e2e/enum/AppInfos.js +1 -0
  266. package/lib-es/e2e/enum/AppInfos.js.map +1 -1
  267. package/lib-es/e2e/enum/Currency.d.ts +1 -0
  268. package/lib-es/e2e/enum/Currency.d.ts.map +1 -1
  269. package/lib-es/e2e/enum/Currency.js +1 -0
  270. package/lib-es/e2e/enum/Currency.js.map +1 -1
  271. package/lib-es/e2e/enum/Network.d.ts +2 -1
  272. package/lib-es/e2e/enum/Network.d.ts.map +1 -1
  273. package/lib-es/e2e/enum/Network.js +1 -0
  274. package/lib-es/e2e/enum/Network.js.map +1 -1
  275. package/lib-es/e2e/families/kaspa.d.ts +4 -0
  276. package/lib-es/e2e/families/kaspa.d.ts.map +1 -0
  277. package/lib-es/e2e/families/kaspa.js +15 -0
  278. package/lib-es/e2e/families/kaspa.js.map +1 -0
  279. package/lib-es/e2e/index.d.ts +3 -6
  280. package/lib-es/e2e/index.d.ts.map +1 -1
  281. package/lib-es/e2e/speculos.d.ts.map +1 -1
  282. package/lib-es/e2e/speculos.js +12 -0
  283. package/lib-es/e2e/speculos.js.map +1 -1
  284. package/lib-es/env.react.d.ts +1 -1
  285. package/lib-es/env.react.d.ts.map +1 -1
  286. package/lib-es/families/canton/bridge/mock-data.d.ts +6 -0
  287. package/lib-es/families/canton/bridge/mock-data.d.ts.map +1 -0
  288. package/lib-es/families/canton/bridge/mock-data.js +116 -0
  289. package/lib-es/families/canton/bridge/mock-data.js.map +1 -0
  290. package/lib-es/families/canton/bridge/mock.d.ts +12 -0
  291. package/lib-es/families/canton/bridge/mock.d.ts.map +1 -0
  292. package/lib-es/families/canton/bridge/mock.js +152 -0
  293. package/lib-es/families/canton/bridge/mock.js.map +1 -0
  294. package/lib-es/families/canton/config.d.ts.map +1 -1
  295. package/lib-es/families/canton/config.js +5 -2
  296. package/lib-es/families/canton/config.js.map +1 -1
  297. package/lib-es/families/canton/setup.d.ts.map +1 -1
  298. package/lib-es/families/canton/setup.js +8 -2
  299. package/lib-es/families/canton/setup.js.map +1 -1
  300. package/lib-es/families/evm/config.js +2 -2
  301. package/lib-es/families/evm/config.js.map +1 -1
  302. package/lib-es/families/kaspa/bridge.integration.test.d.ts +2 -0
  303. package/lib-es/families/kaspa/bridge.integration.test.d.ts.map +1 -0
  304. package/lib-es/families/kaspa/bridge.integration.test.js +5 -0
  305. package/lib-es/families/kaspa/bridge.integration.test.js.map +1 -0
  306. package/lib-es/families/kaspa/config.d.ts +3 -0
  307. package/lib-es/families/kaspa/config.d.ts.map +1 -0
  308. package/lib-es/families/kaspa/config.js +11 -0
  309. package/lib-es/families/kaspa/config.js.map +1 -0
  310. package/lib-es/families/kaspa/react.d.ts +4 -0
  311. package/lib-es/families/kaspa/react.d.ts.map +1 -0
  312. package/lib-es/families/kaspa/react.js +14 -0
  313. package/lib-es/families/kaspa/react.js.map +1 -0
  314. package/lib-es/families/kaspa/setup.d.ts +18 -0
  315. package/lib-es/families/kaspa/setup.d.ts.map +1 -0
  316. package/lib-es/families/kaspa/setup.js +16 -0
  317. package/lib-es/families/kaspa/setup.js.map +1 -0
  318. package/lib-es/families/kaspa/types.d.ts +2 -0
  319. package/lib-es/families/kaspa/types.d.ts.map +1 -0
  320. package/lib-es/families/kaspa/types.js +2 -0
  321. package/lib-es/families/kaspa/types.js.map +1 -0
  322. package/lib-es/families/xrp/setup.d.ts +2 -2
  323. package/lib-es/featureFlags/defaultFeatures.d.ts.map +1 -1
  324. package/lib-es/featureFlags/defaultFeatures.js +0 -2
  325. package/lib-es/featureFlags/defaultFeatures.js.map +1 -1
  326. package/lib-es/featureFlags/useFeature.d.ts +1 -1
  327. package/lib-es/featureFlags/useFeature.d.ts.map +1 -1
  328. package/lib-es/generated/bridge/js.d.ts +1 -0
  329. package/lib-es/generated/bridge/js.d.ts.map +1 -1
  330. package/lib-es/generated/bridge/js.js +2 -0
  331. package/lib-es/generated/bridge/js.js.map +1 -1
  332. package/lib-es/generated/bridge/mock.d.ts +9 -1
  333. package/lib-es/generated/bridge/mock.d.ts.map +1 -1
  334. package/lib-es/generated/bridge/mock.js +2 -0
  335. package/lib-es/generated/bridge/mock.js.map +1 -1
  336. package/lib-es/generated/cli-transaction.d.ts +13 -2
  337. package/lib-es/generated/cli-transaction.d.ts.map +1 -1
  338. package/lib-es/generated/cli-transaction.js +2 -0
  339. package/lib-es/generated/cli-transaction.js.map +1 -1
  340. package/lib-es/generated/deviceTransactionConfig.d.ts +2 -0
  341. package/lib-es/generated/deviceTransactionConfig.d.ts.map +1 -1
  342. package/lib-es/generated/deviceTransactionConfig.js +2 -0
  343. package/lib-es/generated/deviceTransactionConfig.js.map +1 -1
  344. package/lib-es/generated/hw-getAddress.d.ts +1 -0
  345. package/lib-es/generated/hw-getAddress.d.ts.map +1 -1
  346. package/lib-es/generated/hw-getAddress.js +2 -0
  347. package/lib-es/generated/hw-getAddress.js.map +1 -1
  348. package/lib-es/generated/platformAdapter.d.ts +1 -1
  349. package/lib-es/generated/specs.d.ts +1 -1
  350. package/lib-es/generated/transaction.d.ts +11 -3
  351. package/lib-es/generated/transaction.d.ts.map +1 -1
  352. package/lib-es/generated/transaction.js +2 -0
  353. package/lib-es/generated/transaction.js.map +1 -1
  354. package/lib-es/generated/types.d.ts +5 -4
  355. package/lib-es/generated/types.d.ts.map +1 -1
  356. package/lib-es/generated/walletApiAdapter.d.ts +1 -1
  357. package/lib-es/hw/actions/app.d.ts.map +1 -1
  358. package/lib-es/hw/actions/app.js +11 -8
  359. package/lib-es/hw/actions/app.js.map +1 -1
  360. package/lib-es/hw/getDeviceNameMaxLength.d.ts.map +1 -1
  361. package/lib-es/hw/getDeviceNameMaxLength.js +2 -0
  362. package/lib-es/hw/getDeviceNameMaxLength.js.map +1 -1
  363. package/lib-es/hw/getDeviceNameMaxLength.test.js +12 -0
  364. package/lib-es/hw/getDeviceNameMaxLength.test.js.map +1 -1
  365. package/lib-es/modularDrawer/hooks/useAssetsData.d.ts +1 -0
  366. package/lib-es/modularDrawer/hooks/useAssetsData.d.ts.map +1 -1
  367. package/lib-es/modularDrawer/hooks/useAssetsData.js +3 -2
  368. package/lib-es/modularDrawer/hooks/useAssetsData.js.map +1 -1
  369. package/lib-es/modularDrawer/hooks/useSearch.d.ts +16 -0
  370. package/lib-es/modularDrawer/hooks/useSearch.d.ts.map +1 -0
  371. package/lib-es/modularDrawer/hooks/useSearch.js +20 -0
  372. package/lib-es/modularDrawer/hooks/useSearch.js.map +1 -0
  373. package/lib-es/notifications/ServiceStatusProvider/index.d.ts +16 -1
  374. package/lib-es/notifications/ServiceStatusProvider/index.d.ts.map +1 -1
  375. package/lib-es/notifications/ServiceStatusProvider/index.js +31 -7
  376. package/lib-es/notifications/ServiceStatusProvider/index.js.map +1 -1
  377. package/lib-es/notifications/ServiceStatusProvider/index.test.d.ts +2 -0
  378. package/lib-es/notifications/ServiceStatusProvider/index.test.d.ts.map +1 -0
  379. package/lib-es/notifications/ServiceStatusProvider/index.test.js +86 -0
  380. package/lib-es/notifications/ServiceStatusProvider/index.test.js.map +1 -0
  381. package/lib-es/notifications/ServiceStatusProvider/ledger-components.d.ts +2 -0
  382. package/lib-es/notifications/ServiceStatusProvider/ledger-components.d.ts.map +1 -0
  383. package/lib-es/notifications/ServiceStatusProvider/ledger-components.js +13 -0
  384. package/lib-es/notifications/ServiceStatusProvider/ledger-components.js.map +1 -0
  385. package/lib-es/wallet-api/ACRE/server.d.ts +13 -6
  386. package/lib-es/wallet-api/ACRE/server.d.ts.map +1 -1
  387. package/lib-es/wallet-api/ACRE/server.js +140 -2
  388. package/lib-es/wallet-api/ACRE/server.js.map +1 -1
  389. package/lib-es/wallet-api/ACRE/server.test.d.ts +2 -0
  390. package/lib-es/wallet-api/ACRE/server.test.d.ts.map +1 -0
  391. package/lib-es/wallet-api/ACRE/server.test.js +388 -0
  392. package/lib-es/wallet-api/ACRE/server.test.js.map +1 -0
  393. package/package.json +52 -49
  394. package/src/__tests__/test-helpers/environment.ts +1 -0
  395. package/src/apps/inlineAppInstall.ts +1 -4
  396. package/src/apps/react.ts +1 -3
  397. package/src/apps/runner.ts +1 -8
  398. package/src/bridge/crypto-assets/index.test.ts +0 -47
  399. package/src/bridge/crypto-assets/index.ts +0 -5
  400. package/src/bridge/generic-alpaca/accountBridge.ts +8 -3
  401. package/src/bridge/generic-alpaca/alpaca/index.ts +13 -18
  402. package/src/bridge/generic-alpaca/alpaca/index.unit.test.ts +38 -10
  403. package/src/bridge/generic-alpaca/createTransaction.ts +9 -1
  404. package/src/bridge/generic-alpaca/currencyBridge.ts +8 -2
  405. package/src/bridge/generic-alpaca/getAccountShape.ts +4 -5
  406. package/src/bridge/generic-alpaca/signer/Eth.ts +70 -0
  407. package/src/bridge/generic-alpaca/signer/index.ts +5 -15
  408. package/src/bridge/generic-alpaca/signer/signTransaction.ts +4 -3
  409. package/src/bridge/generic-alpaca/signer/types.ts +14 -0
  410. package/src/bridge/generic-alpaca/utils.test.ts +29 -1
  411. package/src/bridge/generic-alpaca/utils.ts +15 -0
  412. package/src/config/sharedConfig.ts +4 -0
  413. package/src/e2e/enum/Account.ts +14 -0
  414. package/src/e2e/enum/AppInfos.ts +2 -0
  415. package/src/e2e/enum/Currency.ts +2 -0
  416. package/src/e2e/enum/Network.ts +1 -0
  417. package/src/e2e/families/kaspa.ts +17 -0
  418. package/src/e2e/speculos.ts +12 -0
  419. package/src/families/canton/bridge/mock-data.ts +175 -0
  420. package/src/families/canton/bridge/mock.ts +180 -0
  421. package/src/families/canton/config.ts +5 -3
  422. package/src/families/canton/setup.ts +8 -5
  423. package/src/families/evm/config.ts +2 -2
  424. package/src/families/kaspa/__snapshots__/bridge.integration.test.ts.snap +66 -0
  425. package/src/families/kaspa/bridge.integration.test.ts +5 -0
  426. package/src/families/kaspa/config.ts +12 -0
  427. package/src/families/kaspa/react.ts +19 -0
  428. package/src/families/kaspa/setup.ts +27 -0
  429. package/src/families/kaspa/types.ts +1 -0
  430. package/src/featureFlags/defaultFeatures.ts +0 -2
  431. package/src/generated/bridge/js.ts +2 -0
  432. package/src/generated/bridge/mock.ts +2 -0
  433. package/src/generated/cli-transaction.ts +2 -0
  434. package/src/generated/deviceTransactionConfig.ts +2 -0
  435. package/src/generated/hw-getAddress.ts +2 -0
  436. package/src/generated/transaction.ts +2 -0
  437. package/src/generated/types.ts +10 -0
  438. package/src/hw/actions/app.ts +12 -10
  439. package/src/hw/getDeviceNameMaxLength.test.ts +16 -0
  440. package/src/hw/getDeviceNameMaxLength.ts +2 -0
  441. package/src/modularDrawer/hooks/useAssetsData.ts +3 -2
  442. package/src/modularDrawer/hooks/useSearch.ts +52 -0
  443. package/src/notifications/ServiceStatusProvider/index.test.ts +102 -0
  444. package/src/notifications/ServiceStatusProvider/index.tsx +37 -12
  445. package/src/notifications/ServiceStatusProvider/ledger-components.ts +12 -0
  446. package/src/wallet-api/ACRE/server.test.ts +470 -0
  447. package/src/wallet-api/ACRE/server.ts +202 -14
  448. package/lib/bridge/crypto-assets/cal-integration.d.ts +0 -4
  449. package/lib/bridge/crypto-assets/cal-integration.d.ts.map +0 -1
  450. package/lib/bridge/crypto-assets/cal-integration.js +0 -26
  451. package/lib/bridge/crypto-assets/cal-integration.js.map +0 -1
  452. package/lib/bridge/crypto-assets/cal-integration.test.d.ts +0 -2
  453. package/lib/bridge/crypto-assets/cal-integration.test.d.ts.map +0 -1
  454. package/lib/bridge/crypto-assets/cal-integration.test.js +0 -45
  455. package/lib/bridge/crypto-assets/cal-integration.test.js.map +0 -1
  456. package/lib/bridge/crypto-assets/cal-store.d.ts +0 -14
  457. package/lib/bridge/crypto-assets/cal-store.d.ts.map +0 -1
  458. package/lib/bridge/crypto-assets/cal-store.js +0 -58
  459. package/lib/bridge/crypto-assets/cal-store.js.map +0 -1
  460. package/lib/bridge/crypto-assets/cal-store.test.d.ts +0 -2
  461. package/lib/bridge/crypto-assets/cal-store.test.d.ts.map +0 -1
  462. package/lib/bridge/crypto-assets/cal-store.test.js +0 -70
  463. package/lib/bridge/crypto-assets/cal-store.test.js.map +0 -1
  464. package/lib-es/bridge/crypto-assets/cal-integration.d.ts +0 -4
  465. package/lib-es/bridge/crypto-assets/cal-integration.d.ts.map +0 -1
  466. package/lib-es/bridge/crypto-assets/cal-integration.js +0 -21
  467. package/lib-es/bridge/crypto-assets/cal-integration.js.map +0 -1
  468. package/lib-es/bridge/crypto-assets/cal-integration.test.d.ts +0 -2
  469. package/lib-es/bridge/crypto-assets/cal-integration.test.d.ts.map +0 -1
  470. package/lib-es/bridge/crypto-assets/cal-integration.test.js +0 -43
  471. package/lib-es/bridge/crypto-assets/cal-integration.test.js.map +0 -1
  472. package/lib-es/bridge/crypto-assets/cal-store.d.ts +0 -14
  473. package/lib-es/bridge/crypto-assets/cal-store.d.ts.map +0 -1
  474. package/lib-es/bridge/crypto-assets/cal-store.js +0 -54
  475. package/lib-es/bridge/crypto-assets/cal-store.js.map +0 -1
  476. package/lib-es/bridge/crypto-assets/cal-store.test.d.ts +0 -2
  477. package/lib-es/bridge/crypto-assets/cal-store.test.d.ts.map +0 -1
  478. package/lib-es/bridge/crypto-assets/cal-store.test.js +0 -68
  479. package/lib-es/bridge/crypto-assets/cal-store.test.js.map +0 -1
  480. package/src/bridge/crypto-assets/cal-integration.test.ts +0 -53
  481. package/src/bridge/crypto-assets/cal-integration.ts +0 -23
  482. package/src/bridge/crypto-assets/cal-store.test.ts +0 -93
  483. 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;
@@ -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",
@@ -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
  }
@@ -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
+ };