@ledgerhq/live-common 34.48.0-nightly.2 → 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 (329) 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/generic-alpaca/accountBridge.d.ts +2 -1
  16. package/lib/bridge/generic-alpaca/accountBridge.d.ts.map +1 -1
  17. package/lib/bridge/generic-alpaca/accountBridge.js +2 -2
  18. package/lib/bridge/generic-alpaca/accountBridge.js.map +1 -1
  19. package/lib/bridge/generic-alpaca/alpaca/index.d.ts +1 -1
  20. package/lib/bridge/generic-alpaca/alpaca/index.d.ts.map +1 -1
  21. package/lib/bridge/generic-alpaca/alpaca/index.js +10 -6
  22. package/lib/bridge/generic-alpaca/alpaca/index.js.map +1 -1
  23. package/lib/bridge/generic-alpaca/alpaca/index.unit.test.js +37 -9
  24. package/lib/bridge/generic-alpaca/alpaca/index.unit.test.js.map +1 -1
  25. package/lib/bridge/generic-alpaca/createTransaction.d.ts +1 -1
  26. package/lib/bridge/generic-alpaca/createTransaction.d.ts.map +1 -1
  27. package/lib/bridge/generic-alpaca/createTransaction.js +8 -0
  28. package/lib/bridge/generic-alpaca/createTransaction.js.map +1 -1
  29. package/lib/bridge/generic-alpaca/currencyBridge.d.ts +2 -1
  30. package/lib/bridge/generic-alpaca/currencyBridge.d.ts.map +1 -1
  31. package/lib/bridge/generic-alpaca/currencyBridge.js +3 -2
  32. package/lib/bridge/generic-alpaca/currencyBridge.js.map +1 -1
  33. package/lib/bridge/generic-alpaca/getAccountShape.d.ts.map +1 -1
  34. package/lib/bridge/generic-alpaca/getAccountShape.js +4 -4
  35. package/lib/bridge/generic-alpaca/getAccountShape.js.map +1 -1
  36. package/lib/bridge/generic-alpaca/signer/Eth.d.ts +8 -0
  37. package/lib/bridge/generic-alpaca/signer/Eth.d.ts.map +1 -0
  38. package/lib/bridge/generic-alpaca/signer/Eth.js +51 -0
  39. package/lib/bridge/generic-alpaca/signer/Eth.js.map +1 -0
  40. package/lib/bridge/generic-alpaca/signer/index.d.ts +2 -10
  41. package/lib/bridge/generic-alpaca/signer/index.d.ts.map +1 -1
  42. package/lib/bridge/generic-alpaca/signer/index.js +2 -2
  43. package/lib/bridge/generic-alpaca/signer/index.js.map +1 -1
  44. package/lib/bridge/generic-alpaca/signer/signTransaction.d.ts +2 -3
  45. package/lib/bridge/generic-alpaca/signer/signTransaction.d.ts.map +1 -1
  46. package/lib/bridge/generic-alpaca/signer/signTransaction.js.map +1 -1
  47. package/lib/bridge/generic-alpaca/signer/types.d.ts +11 -0
  48. package/lib/bridge/generic-alpaca/signer/types.d.ts.map +1 -1
  49. package/lib/bridge/generic-alpaca/utils.d.ts +2 -0
  50. package/lib/bridge/generic-alpaca/utils.d.ts.map +1 -1
  51. package/lib/bridge/generic-alpaca/utils.js +15 -1
  52. package/lib/bridge/generic-alpaca/utils.js.map +1 -1
  53. package/lib/bridge/generic-alpaca/utils.test.js +21 -0
  54. package/lib/bridge/generic-alpaca/utils.test.js.map +1 -1
  55. package/lib/config/sharedConfig.d.ts.map +1 -1
  56. package/lib/config/sharedConfig.js +30 -28
  57. package/lib/config/sharedConfig.js.map +1 -1
  58. package/lib/e2e/enum/Account.d.ts +2 -0
  59. package/lib/e2e/enum/Account.d.ts.map +1 -1
  60. package/lib/e2e/enum/Account.js +2 -0
  61. package/lib/e2e/enum/Account.js.map +1 -1
  62. package/lib/e2e/enum/AppInfos.d.ts +1 -0
  63. package/lib/e2e/enum/AppInfos.d.ts.map +1 -1
  64. package/lib/e2e/enum/AppInfos.js +1 -0
  65. package/lib/e2e/enum/AppInfos.js.map +1 -1
  66. package/lib/e2e/enum/Currency.d.ts +1 -0
  67. package/lib/e2e/enum/Currency.d.ts.map +1 -1
  68. package/lib/e2e/enum/Currency.js +1 -0
  69. package/lib/e2e/enum/Currency.js.map +1 -1
  70. package/lib/e2e/enum/Network.d.ts +2 -1
  71. package/lib/e2e/enum/Network.d.ts.map +1 -1
  72. package/lib/e2e/enum/Network.js +1 -0
  73. package/lib/e2e/enum/Network.js.map +1 -1
  74. package/lib/e2e/families/kaspa.d.ts +4 -0
  75. package/lib/e2e/families/kaspa.d.ts.map +1 -0
  76. package/lib/e2e/families/kaspa.js +23 -0
  77. package/lib/e2e/families/kaspa.js.map +1 -0
  78. package/lib/e2e/index.d.ts +0 -2
  79. package/lib/e2e/index.d.ts.map +1 -1
  80. package/lib/e2e/speculos.d.ts.map +1 -1
  81. package/lib/e2e/speculos.js +12 -0
  82. package/lib/e2e/speculos.js.map +1 -1
  83. package/lib/families/evm/config.js +2 -2
  84. package/lib/families/evm/config.js.map +1 -1
  85. package/lib/families/kaspa/bridge.integration.test.d.ts +2 -0
  86. package/lib/families/kaspa/bridge.integration.test.d.ts.map +1 -0
  87. package/lib/families/kaspa/bridge.integration.test.js +7 -0
  88. package/lib/families/kaspa/bridge.integration.test.js.map +1 -0
  89. package/lib/families/kaspa/config.d.ts +3 -0
  90. package/lib/families/kaspa/config.d.ts.map +1 -0
  91. package/lib/families/kaspa/config.js +14 -0
  92. package/lib/families/kaspa/config.js.map +1 -0
  93. package/lib/families/kaspa/react.d.ts +4 -0
  94. package/lib/families/kaspa/react.d.ts.map +1 -0
  95. package/lib/families/kaspa/react.js +18 -0
  96. package/lib/families/kaspa/react.js.map +1 -0
  97. package/lib/families/kaspa/setup.d.ts +18 -0
  98. package/lib/families/kaspa/setup.d.ts.map +1 -0
  99. package/lib/families/kaspa/setup.js +24 -0
  100. package/lib/families/kaspa/setup.js.map +1 -0
  101. package/lib/families/kaspa/types.d.ts +2 -0
  102. package/lib/families/kaspa/types.d.ts.map +1 -0
  103. package/lib/families/kaspa/types.js +18 -0
  104. package/lib/families/kaspa/types.js.map +1 -0
  105. package/lib/families/xrp/setup.d.ts +2 -2
  106. package/lib/featureFlags/defaultFeatures.d.ts.map +1 -1
  107. package/lib/featureFlags/defaultFeatures.js +0 -1
  108. package/lib/featureFlags/defaultFeatures.js.map +1 -1
  109. package/lib/featureFlags/useFeature.d.ts +1 -1
  110. package/lib/featureFlags/useFeature.d.ts.map +1 -1
  111. package/lib/generated/bridge/js.d.ts +1 -0
  112. package/lib/generated/bridge/js.d.ts.map +1 -1
  113. package/lib/generated/bridge/js.js +24 -22
  114. package/lib/generated/bridge/js.js.map +1 -1
  115. package/lib/generated/bridge/mock.d.ts +1 -1
  116. package/lib/generated/cli-transaction.d.ts +13 -2
  117. package/lib/generated/cli-transaction.d.ts.map +1 -1
  118. package/lib/generated/cli-transaction.js +28 -26
  119. package/lib/generated/cli-transaction.js.map +1 -1
  120. package/lib/generated/deviceTransactionConfig.d.ts +2 -0
  121. package/lib/generated/deviceTransactionConfig.d.ts.map +1 -1
  122. package/lib/generated/deviceTransactionConfig.js +24 -22
  123. package/lib/generated/deviceTransactionConfig.js.map +1 -1
  124. package/lib/generated/hw-getAddress.d.ts +1 -0
  125. package/lib/generated/hw-getAddress.d.ts.map +1 -1
  126. package/lib/generated/hw-getAddress.js +28 -26
  127. package/lib/generated/hw-getAddress.js.map +1 -1
  128. package/lib/generated/platformAdapter.d.ts +1 -1
  129. package/lib/generated/specs.d.ts +1 -1
  130. package/lib/generated/transaction.d.ts +11 -3
  131. package/lib/generated/transaction.d.ts.map +1 -1
  132. package/lib/generated/transaction.js +28 -26
  133. package/lib/generated/transaction.js.map +1 -1
  134. package/lib/generated/types.d.ts +5 -4
  135. package/lib/generated/types.d.ts.map +1 -1
  136. package/lib/generated/walletApiAdapter.d.ts +1 -1
  137. package/lib/hw/actions/app.d.ts.map +1 -1
  138. package/lib/hw/actions/app.js +11 -8
  139. package/lib/hw/actions/app.js.map +1 -1
  140. package/lib/hw/getDeviceNameMaxLength.d.ts.map +1 -1
  141. package/lib/hw/getDeviceNameMaxLength.js +2 -0
  142. package/lib/hw/getDeviceNameMaxLength.js.map +1 -1
  143. package/lib/hw/getDeviceNameMaxLength.test.js +12 -0
  144. package/lib/hw/getDeviceNameMaxLength.test.js.map +1 -1
  145. package/lib-es/__tests__/test-helpers/environment.js +1 -0
  146. package/lib-es/__tests__/test-helpers/environment.js.map +1 -1
  147. package/lib-es/apps/inlineAppInstall.d.ts +1 -3
  148. package/lib-es/apps/inlineAppInstall.d.ts.map +1 -1
  149. package/lib-es/apps/inlineAppInstall.js +2 -2
  150. package/lib-es/apps/inlineAppInstall.js.map +1 -1
  151. package/lib-es/apps/react.d.ts +1 -2
  152. package/lib-es/apps/react.d.ts.map +1 -1
  153. package/lib-es/apps/react.js +2 -2
  154. package/lib-es/apps/react.js.map +1 -1
  155. package/lib-es/apps/runner.d.ts +2 -4
  156. package/lib-es/apps/runner.d.ts.map +1 -1
  157. package/lib-es/apps/runner.js +3 -4
  158. package/lib-es/apps/runner.js.map +1 -1
  159. package/lib-es/bridge/generic-alpaca/accountBridge.d.ts +2 -1
  160. package/lib-es/bridge/generic-alpaca/accountBridge.d.ts.map +1 -1
  161. package/lib-es/bridge/generic-alpaca/accountBridge.js +2 -2
  162. package/lib-es/bridge/generic-alpaca/accountBridge.js.map +1 -1
  163. package/lib-es/bridge/generic-alpaca/alpaca/index.d.ts +1 -1
  164. package/lib-es/bridge/generic-alpaca/alpaca/index.d.ts.map +1 -1
  165. package/lib-es/bridge/generic-alpaca/alpaca/index.js +10 -6
  166. package/lib-es/bridge/generic-alpaca/alpaca/index.js.map +1 -1
  167. package/lib-es/bridge/generic-alpaca/alpaca/index.unit.test.js +37 -9
  168. package/lib-es/bridge/generic-alpaca/alpaca/index.unit.test.js.map +1 -1
  169. package/lib-es/bridge/generic-alpaca/createTransaction.d.ts +1 -1
  170. package/lib-es/bridge/generic-alpaca/createTransaction.d.ts.map +1 -1
  171. package/lib-es/bridge/generic-alpaca/createTransaction.js +8 -0
  172. package/lib-es/bridge/generic-alpaca/createTransaction.js.map +1 -1
  173. package/lib-es/bridge/generic-alpaca/currencyBridge.d.ts +2 -1
  174. package/lib-es/bridge/generic-alpaca/currencyBridge.d.ts.map +1 -1
  175. package/lib-es/bridge/generic-alpaca/currencyBridge.js +3 -2
  176. package/lib-es/bridge/generic-alpaca/currencyBridge.js.map +1 -1
  177. package/lib-es/bridge/generic-alpaca/getAccountShape.d.ts.map +1 -1
  178. package/lib-es/bridge/generic-alpaca/getAccountShape.js +4 -4
  179. package/lib-es/bridge/generic-alpaca/getAccountShape.js.map +1 -1
  180. package/lib-es/bridge/generic-alpaca/signer/Eth.d.ts +8 -0
  181. package/lib-es/bridge/generic-alpaca/signer/Eth.d.ts.map +1 -0
  182. package/lib-es/bridge/generic-alpaca/signer/Eth.js +47 -0
  183. package/lib-es/bridge/generic-alpaca/signer/Eth.js.map +1 -0
  184. package/lib-es/bridge/generic-alpaca/signer/index.d.ts +2 -10
  185. package/lib-es/bridge/generic-alpaca/signer/index.d.ts.map +1 -1
  186. package/lib-es/bridge/generic-alpaca/signer/index.js +2 -2
  187. package/lib-es/bridge/generic-alpaca/signer/index.js.map +1 -1
  188. package/lib-es/bridge/generic-alpaca/signer/signTransaction.d.ts +2 -3
  189. package/lib-es/bridge/generic-alpaca/signer/signTransaction.d.ts.map +1 -1
  190. package/lib-es/bridge/generic-alpaca/signer/signTransaction.js.map +1 -1
  191. package/lib-es/bridge/generic-alpaca/signer/types.d.ts +11 -0
  192. package/lib-es/bridge/generic-alpaca/signer/types.d.ts.map +1 -1
  193. package/lib-es/bridge/generic-alpaca/utils.d.ts +2 -0
  194. package/lib-es/bridge/generic-alpaca/utils.d.ts.map +1 -1
  195. package/lib-es/bridge/generic-alpaca/utils.js +13 -0
  196. package/lib-es/bridge/generic-alpaca/utils.js.map +1 -1
  197. package/lib-es/bridge/generic-alpaca/utils.test.js +22 -1
  198. package/lib-es/bridge/generic-alpaca/utils.test.js.map +1 -1
  199. package/lib-es/config/sharedConfig.d.ts.map +1 -1
  200. package/lib-es/config/sharedConfig.js +2 -0
  201. package/lib-es/config/sharedConfig.js.map +1 -1
  202. package/lib-es/e2e/enum/Account.d.ts +2 -0
  203. package/lib-es/e2e/enum/Account.d.ts.map +1 -1
  204. package/lib-es/e2e/enum/Account.js +2 -0
  205. package/lib-es/e2e/enum/Account.js.map +1 -1
  206. package/lib-es/e2e/enum/AppInfos.d.ts +1 -0
  207. package/lib-es/e2e/enum/AppInfos.d.ts.map +1 -1
  208. package/lib-es/e2e/enum/AppInfos.js +1 -0
  209. package/lib-es/e2e/enum/AppInfos.js.map +1 -1
  210. package/lib-es/e2e/enum/Currency.d.ts +1 -0
  211. package/lib-es/e2e/enum/Currency.d.ts.map +1 -1
  212. package/lib-es/e2e/enum/Currency.js +1 -0
  213. package/lib-es/e2e/enum/Currency.js.map +1 -1
  214. package/lib-es/e2e/enum/Network.d.ts +2 -1
  215. package/lib-es/e2e/enum/Network.d.ts.map +1 -1
  216. package/lib-es/e2e/enum/Network.js +1 -0
  217. package/lib-es/e2e/enum/Network.js.map +1 -1
  218. package/lib-es/e2e/families/kaspa.d.ts +4 -0
  219. package/lib-es/e2e/families/kaspa.d.ts.map +1 -0
  220. package/lib-es/e2e/families/kaspa.js +15 -0
  221. package/lib-es/e2e/families/kaspa.js.map +1 -0
  222. package/lib-es/e2e/index.d.ts +0 -2
  223. package/lib-es/e2e/index.d.ts.map +1 -1
  224. package/lib-es/e2e/speculos.d.ts.map +1 -1
  225. package/lib-es/e2e/speculos.js +12 -0
  226. package/lib-es/e2e/speculos.js.map +1 -1
  227. package/lib-es/families/evm/config.js +2 -2
  228. package/lib-es/families/evm/config.js.map +1 -1
  229. package/lib-es/families/kaspa/bridge.integration.test.d.ts +2 -0
  230. package/lib-es/families/kaspa/bridge.integration.test.d.ts.map +1 -0
  231. package/lib-es/families/kaspa/bridge.integration.test.js +5 -0
  232. package/lib-es/families/kaspa/bridge.integration.test.js.map +1 -0
  233. package/lib-es/families/kaspa/config.d.ts +3 -0
  234. package/lib-es/families/kaspa/config.d.ts.map +1 -0
  235. package/lib-es/families/kaspa/config.js +11 -0
  236. package/lib-es/families/kaspa/config.js.map +1 -0
  237. package/lib-es/families/kaspa/react.d.ts +4 -0
  238. package/lib-es/families/kaspa/react.d.ts.map +1 -0
  239. package/lib-es/families/kaspa/react.js +14 -0
  240. package/lib-es/families/kaspa/react.js.map +1 -0
  241. package/lib-es/families/kaspa/setup.d.ts +18 -0
  242. package/lib-es/families/kaspa/setup.d.ts.map +1 -0
  243. package/lib-es/families/kaspa/setup.js +16 -0
  244. package/lib-es/families/kaspa/setup.js.map +1 -0
  245. package/lib-es/families/kaspa/types.d.ts +2 -0
  246. package/lib-es/families/kaspa/types.d.ts.map +1 -0
  247. package/lib-es/families/kaspa/types.js +2 -0
  248. package/lib-es/families/kaspa/types.js.map +1 -0
  249. package/lib-es/families/xrp/setup.d.ts +2 -2
  250. package/lib-es/featureFlags/defaultFeatures.d.ts.map +1 -1
  251. package/lib-es/featureFlags/defaultFeatures.js +0 -1
  252. package/lib-es/featureFlags/defaultFeatures.js.map +1 -1
  253. package/lib-es/featureFlags/useFeature.d.ts +1 -1
  254. package/lib-es/featureFlags/useFeature.d.ts.map +1 -1
  255. package/lib-es/generated/bridge/js.d.ts +1 -0
  256. package/lib-es/generated/bridge/js.d.ts.map +1 -1
  257. package/lib-es/generated/bridge/js.js +2 -0
  258. package/lib-es/generated/bridge/js.js.map +1 -1
  259. package/lib-es/generated/bridge/mock.d.ts +1 -1
  260. package/lib-es/generated/cli-transaction.d.ts +13 -2
  261. package/lib-es/generated/cli-transaction.d.ts.map +1 -1
  262. package/lib-es/generated/cli-transaction.js +2 -0
  263. package/lib-es/generated/cli-transaction.js.map +1 -1
  264. package/lib-es/generated/deviceTransactionConfig.d.ts +2 -0
  265. package/lib-es/generated/deviceTransactionConfig.d.ts.map +1 -1
  266. package/lib-es/generated/deviceTransactionConfig.js +2 -0
  267. package/lib-es/generated/deviceTransactionConfig.js.map +1 -1
  268. package/lib-es/generated/hw-getAddress.d.ts +1 -0
  269. package/lib-es/generated/hw-getAddress.d.ts.map +1 -1
  270. package/lib-es/generated/hw-getAddress.js +2 -0
  271. package/lib-es/generated/hw-getAddress.js.map +1 -1
  272. package/lib-es/generated/platformAdapter.d.ts +1 -1
  273. package/lib-es/generated/specs.d.ts +1 -1
  274. package/lib-es/generated/transaction.d.ts +11 -3
  275. package/lib-es/generated/transaction.d.ts.map +1 -1
  276. package/lib-es/generated/transaction.js +2 -0
  277. package/lib-es/generated/transaction.js.map +1 -1
  278. package/lib-es/generated/types.d.ts +5 -4
  279. package/lib-es/generated/types.d.ts.map +1 -1
  280. package/lib-es/generated/walletApiAdapter.d.ts +1 -1
  281. package/lib-es/hw/actions/app.d.ts.map +1 -1
  282. package/lib-es/hw/actions/app.js +11 -8
  283. package/lib-es/hw/actions/app.js.map +1 -1
  284. package/lib-es/hw/getDeviceNameMaxLength.d.ts.map +1 -1
  285. package/lib-es/hw/getDeviceNameMaxLength.js +2 -0
  286. package/lib-es/hw/getDeviceNameMaxLength.js.map +1 -1
  287. package/lib-es/hw/getDeviceNameMaxLength.test.js +12 -0
  288. package/lib-es/hw/getDeviceNameMaxLength.test.js.map +1 -1
  289. package/package.json +42 -39
  290. package/src/__tests__/test-helpers/environment.ts +1 -0
  291. package/src/apps/inlineAppInstall.ts +1 -4
  292. package/src/apps/react.ts +1 -3
  293. package/src/apps/runner.ts +1 -8
  294. package/src/bridge/generic-alpaca/accountBridge.ts +8 -3
  295. package/src/bridge/generic-alpaca/alpaca/index.ts +13 -18
  296. package/src/bridge/generic-alpaca/alpaca/index.unit.test.ts +38 -10
  297. package/src/bridge/generic-alpaca/createTransaction.ts +9 -1
  298. package/src/bridge/generic-alpaca/currencyBridge.ts +8 -2
  299. package/src/bridge/generic-alpaca/getAccountShape.ts +4 -5
  300. package/src/bridge/generic-alpaca/signer/Eth.ts +70 -0
  301. package/src/bridge/generic-alpaca/signer/index.ts +5 -15
  302. package/src/bridge/generic-alpaca/signer/signTransaction.ts +4 -3
  303. package/src/bridge/generic-alpaca/signer/types.ts +14 -0
  304. package/src/bridge/generic-alpaca/utils.test.ts +29 -1
  305. package/src/bridge/generic-alpaca/utils.ts +15 -0
  306. package/src/config/sharedConfig.ts +2 -0
  307. package/src/e2e/enum/Account.ts +14 -0
  308. package/src/e2e/enum/AppInfos.ts +2 -0
  309. package/src/e2e/enum/Currency.ts +2 -0
  310. package/src/e2e/enum/Network.ts +1 -0
  311. package/src/e2e/families/kaspa.ts +17 -0
  312. package/src/e2e/speculos.ts +12 -0
  313. package/src/families/evm/config.ts +2 -2
  314. package/src/families/kaspa/__snapshots__/bridge.integration.test.ts.snap +66 -0
  315. package/src/families/kaspa/bridge.integration.test.ts +5 -0
  316. package/src/families/kaspa/config.ts +12 -0
  317. package/src/families/kaspa/react.ts +19 -0
  318. package/src/families/kaspa/setup.ts +27 -0
  319. package/src/families/kaspa/types.ts +1 -0
  320. package/src/featureFlags/defaultFeatures.ts +0 -1
  321. package/src/generated/bridge/js.ts +2 -0
  322. package/src/generated/cli-transaction.ts +2 -0
  323. package/src/generated/deviceTransactionConfig.ts +2 -0
  324. package/src/generated/hw-getAddress.ts +2 -0
  325. package/src/generated/transaction.ts +2 -0
  326. package/src/generated/types.ts +10 -0
  327. package/src/hw/actions/app.ts +12 -10
  328. package/src/hw/getDeviceNameMaxLength.test.ts +16 -0
  329. package/src/hw/getDeviceNameMaxLength.ts +2 -0
@@ -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";
@@ -55,6 +56,7 @@ export const liveConfig: ConfigSchema = {
55
56
  ...fileCoinConfig,
56
57
  ...hederaConfig,
57
58
  ...internetComputerConfig,
59
+ ...kaspaConfig,
58
60
  ...nearConfig,
59
61
  ...minaConfig,
60
62
  ...polkadotConfig,
@@ -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
  }
@@ -674,8 +674,8 @@ const evmConfig: CurrencyLiveConfigDefinition = {
674
674
  uri: "https://zkevm-rpc.com",
675
675
  },
676
676
  explorer: {
677
- type: "blockscout",
678
- uri: "https://explorer-ui.cardona.zkevm-rpc.com/api",
677
+ type: "etherscan",
678
+ uri: "https://proxyetherscan.api.live.ledger.com/v2/api/1101",
679
679
  },
680
680
  showNfts: false,
681
681
  },
@@ -0,0 +1,66 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`kaspa currency bridge scanAccounts kaspa seed 1 1`] = `
4
+ [
5
+ {
6
+ "balance": "13370000",
7
+ "currencyId": "kaspa",
8
+ "derivationMode": "",
9
+ "freshAddress": "kaspa:qz49rpg0q6ywewxkwl76757ya79v6j556hcmrcy7mk9d36ewgp80cdrwlct2h",
10
+ "freshAddressPath": "44'/111111'/0'/0/1",
11
+ "id": "js:2:kaspa:41049d8002c08041d975ab58491c09cf8ced7b388a114ab2f5df73f2534d4d74d17ab8913b3cb3056bad63141cb63fb92e44401b691dee069dbdb2119861c18cc01b204340fcc305ab72e752cd347f4b6271ffe21da098d4f2a4749826857dda7a5576:",
12
+ "index": 0,
13
+ "operationsCount": 1,
14
+ "pendingOperations": [],
15
+ "seedIdentifier": "41049d8002c08041d975ab58491c09cf8ced7b388a114ab2f5df73f2534d4d74d17ab8913b3cb3056bad63141cb63fb92e44401b691dee069dbdb2119861c18cc01b204340fcc305ab72e752cd347f4b6271ffe21da098d4f2a4749826857dda7a5576",
16
+ "spendableBalance": "13370000",
17
+ "swapHistory": [],
18
+ "syncHash": undefined,
19
+ "used": true,
20
+ "xpub": "41049d8002c08041d975ab58491c09cf8ced7b388a114ab2f5df73f2534d4d74d17ab8913b3cb3056bad63141cb63fb92e44401b691dee069dbdb2119861c18cc01b204340fcc305ab72e752cd347f4b6271ffe21da098d4f2a4749826857dda7a5576",
21
+ },
22
+ {
23
+ "balance": "0",
24
+ "currencyId": "kaspa",
25
+ "derivationMode": "",
26
+ "freshAddress": "kaspa:qpncmme6ues25uk9umkqju4rtwtt33ud9lcrp7qn8jwv62m53m26jpjhar48j",
27
+ "freshAddressPath": "44'/111111'/1'/0/0",
28
+ "id": "js:2:kaspa:4104751b5ebd4a9d2a0a25d5c37cab4814a95335b8945cfcaa6a4138de418f581bb1d0d02f22081b3cda223a51e18a63ebdffd64803e0988b68a91802738a5a9f901206d4a2b989a82b5fb160f0151ea5d046451a291a0748f3038ecdc63d637cce00b:",
29
+ "index": 1,
30
+ "operationsCount": 0,
31
+ "pendingOperations": [],
32
+ "seedIdentifier": "41049d8002c08041d975ab58491c09cf8ced7b388a114ab2f5df73f2534d4d74d17ab8913b3cb3056bad63141cb63fb92e44401b691dee069dbdb2119861c18cc01b204340fcc305ab72e752cd347f4b6271ffe21da098d4f2a4749826857dda7a5576",
33
+ "spendableBalance": "0",
34
+ "swapHistory": [],
35
+ "syncHash": undefined,
36
+ "used": false,
37
+ "xpub": "4104751b5ebd4a9d2a0a25d5c37cab4814a95335b8945cfcaa6a4138de418f581bb1d0d02f22081b3cda223a51e18a63ebdffd64803e0988b68a91802738a5a9f901206d4a2b989a82b5fb160f0151ea5d046451a291a0748f3038ecdc63d637cce00b",
38
+ },
39
+ ]
40
+ `;
41
+
42
+ exports[`kaspa currency bridge scanAccounts kaspa seed 1 2`] = `
43
+ [
44
+ [
45
+ {
46
+ "accountId": "js:2:kaspa:41049d8002c08041d975ab58491c09cf8ced7b388a114ab2f5df73f2534d4d74d17ab8913b3cb3056bad63141cb63fb92e44401b691dee069dbdb2119861c18cc01b204340fcc305ab72e752cd347f4b6271ffe21da098d4f2a4749826857dda7a5576:",
47
+ "blockHash": "12166d40313b71447d4dd837f2e91e749407b0a1c8844e9e9d010390a67d6b52",
48
+ "blockHeight": 194187672,
49
+ "extra": {},
50
+ "fee": "2069",
51
+ "hash": "ed6dc5422558c3480e6a7809bf166e6ba1f2931ef39f24fe9b3bcf48253e4752",
52
+ "id": "ed6dc5422558c3480e6a7809bf166e6ba1f2931ef39f24fe9b3bcf48253e4752",
53
+ "recipients": [
54
+ "kaspa:qzavrhr9eg0k7pgr8mysfej34alfy8uj6vc9r84kgqfkqd8rtgxm5t0jvah73",
55
+ "kaspa:qqt874j85r5ga5av0q6tthj2tu89dfpchjmvjuvx5tyn2vpjjrhk7tcpsx2vu",
56
+ ],
57
+ "senders": [
58
+ "kaspa:qqt874j85r5ga5av0q6tthj2tu89dfpchjmvjuvx5tyn2vpjjrhk7tcpsx2vu",
59
+ ],
60
+ "type": "IN",
61
+ "value": "13370000",
62
+ },
63
+ ],
64
+ [],
65
+ ]
66
+ `;
@@ -0,0 +1,5 @@
1
+ import "../../__tests__/test-helpers/setup";
2
+ import { testBridge } from "../../__tests__/test-helpers/bridge";
3
+ import { dataset } from "@ledgerhq/coin-kaspa/test/index";
4
+
5
+ testBridge(dataset);
@@ -0,0 +1,12 @@
1
+ import { ConfigInfo } from "@ledgerhq/live-config/LiveConfig";
2
+
3
+ export const kaspaConfig: Record<string, ConfigInfo> = {
4
+ config_currency_kaspa: {
5
+ type: "object",
6
+ default: {
7
+ status: {
8
+ type: "active",
9
+ },
10
+ },
11
+ },
12
+ };
@@ -0,0 +1,19 @@
1
+ import type { Account, FeeStrategy } from "@ledgerhq/types-live";
2
+ import type { Transaction } from "@ledgerhq/coin-kaspa/types/index";
3
+ import { BigNumber } from "bignumber.js";
4
+
5
+ export const useFeesStrategy = (a: Account, t: Transaction): FeeStrategy[] => {
6
+ const allSameEstimatedSeconds: boolean = t.networkInfo.every(
7
+ ni => ni.estimatedSeconds === t.networkInfo[0].estimatedSeconds,
8
+ );
9
+
10
+ return t.networkInfo.map(ni => ({
11
+ label: ni.label,
12
+ amount: ni.amount,
13
+ disabled: (ni.label === "slow" || ni.label === "medium") && allSameEstimatedSeconds,
14
+ extra: {
15
+ estimatedMs: BigNumber(ni.estimatedSeconds * 1000),
16
+ },
17
+ unit: a.currency.units[a.currency.units.length - 1], // Should be sat
18
+ }));
19
+ };
@@ -0,0 +1,27 @@
1
+ // Goal of this file is to inject all necessary device/signer dependency to coin-modules
2
+
3
+ import kaspaResolver from "@ledgerhq/coin-kaspa/hw-getAddress";
4
+ import Kaspa from "@ledgerhq/hw-app-kaspa";
5
+ import Transport from "@ledgerhq/hw-transport";
6
+ import { createResolver, CreateSigner, executeWithSigner } from "../../bridge/setup";
7
+ import type { Resolver } from "../../hw/getAddress/types";
8
+ import { KaspaSigner } from "@ledgerhq/coin-kaspa/types/signer";
9
+ import { KaspaAccount, Transaction, TransactionStatus } from "@ledgerhq/coin-kaspa/types/bridge";
10
+ import { createBridges } from "@ledgerhq/coin-kaspa/bridge";
11
+ import type { Bridge } from "@ledgerhq/types-live";
12
+ import makeCliTools from "@ledgerhq/coin-kaspa/test/cli";
13
+
14
+ const createSigner: CreateSigner<KaspaSigner> = (transport: Transport) => {
15
+ return new Kaspa(transport);
16
+ };
17
+
18
+ // const kaspaCoin = getCryptoCurrencyById("kaspa");
19
+ const resolver: Resolver = createResolver(createSigner, kaspaResolver);
20
+ // const getCurrencyConfig = (): KaspaCoinConfig => getCurrencyConfiguration(kaspaCoin);
21
+
22
+ const bridge: Bridge<Transaction, KaspaAccount, TransactionStatus> = createBridges(
23
+ executeWithSigner(createSigner),
24
+ );
25
+ const cliTools = makeCliTools;
26
+
27
+ export { bridge, cliTools, resolver };
@@ -0,0 +1 @@
1
+ export * from "@ledgerhq/coin-kaspa/types/index";
@@ -103,7 +103,6 @@ export const CURRENCY_DEFAULT_FEATURES = {
103
103
  */
104
104
  export const DEFAULT_FEATURES: Features = {
105
105
  ...CURRENCY_DEFAULT_FEATURES,
106
- brazeLearn: DEFAULT_FEATURE,
107
106
  portfolioExchangeBanner: DEFAULT_FEATURE,
108
107
  postOnboardingAssetsTransfer: DEFAULT_FEATURE,
109
108
  counterValue: DEFAULT_FEATURE,
@@ -11,6 +11,7 @@ import { bridge as hedera } from "../../families/hedera/setup";
11
11
  import { bridge as filecoin } from "../../families/filecoin/setup";
12
12
  import { bridge as internet_computer } from "../../families/internet_computer/setup";
13
13
  import { bridge as icon } from "../../families/icon/setup";
14
+ import { bridge as kaspa } from "../../families/kaspa/setup";
14
15
  import { bridge as multiversx } from "../../families/multiversx/setup";
15
16
  import { bridge as near } from "../../families/near/setup";
16
17
  import { bridge as polkadot } from "../../families/polkadot/setup";
@@ -37,6 +38,7 @@ export default {
37
38
  filecoin,
38
39
  internet_computer,
39
40
  icon,
41
+ kaspa,
40
42
  multiversx,
41
43
  near,
42
44
  polkadot,
@@ -11,6 +11,7 @@ import { cliTools as hedera } from "../families/hedera/setup";
11
11
  import { cliTools as filecoin } from "../families/filecoin/setup";
12
12
  import { cliTools as internet_computer } from "../families/internet_computer/setup";
13
13
  import { cliTools as icon } from "../families/icon/setup";
14
+ import { cliTools as kaspa } from "../families/kaspa/setup";
14
15
  import { cliTools as multiversx } from "../families/multiversx/setup";
15
16
  import { cliTools as near } from "../families/near/setup";
16
17
  import { cliTools as polkadot } from "../families/polkadot/setup";
@@ -39,6 +40,7 @@ export default {
39
40
  filecoin,
40
41
  internet_computer,
41
42
  icon,
43
+ kaspa,
42
44
  multiversx,
43
45
  near,
44
46
  polkadot,
@@ -11,6 +11,7 @@ import hedera from "@ledgerhq/coin-hedera/deviceTransactionConfig";
11
11
  import filecoin from "@ledgerhq/coin-filecoin/deviceTransactionConfig";
12
12
  import internet_computer from "@ledgerhq/coin-internet_computer/deviceTransactionConfig";
13
13
  import icon from "@ledgerhq/coin-icon/deviceTransactionConfig";
14
+ import kaspa from "@ledgerhq/coin-kaspa/deviceTransactionConfig";
14
15
  import multiversx from "@ledgerhq/coin-multiversx/deviceTransactionConfig";
15
16
  import near from "@ledgerhq/coin-near/deviceTransactionConfig";
16
17
  import polkadot from "@ledgerhq/coin-polkadot/deviceTransactionConfig";
@@ -37,6 +38,7 @@ export default {
37
38
  filecoin,
38
39
  internet_computer,
39
40
  icon,
41
+ kaspa,
40
42
  multiversx,
41
43
  near,
42
44
  polkadot,
@@ -11,6 +11,7 @@ import { resolver as hedera } from "../families/hedera/setup";
11
11
  import { resolver as filecoin } from "../families/filecoin/setup";
12
12
  import { resolver as internet_computer } from "../families/internet_computer/setup";
13
13
  import { resolver as icon } from "../families/icon/setup";
14
+ import { resolver as kaspa } from "../families/kaspa/setup";
14
15
  import { resolver as multiversx } from "../families/multiversx/setup";
15
16
  import { resolver as near } from "../families/near/setup";
16
17
  import { resolver as polkadot } from "../families/polkadot/setup";
@@ -39,6 +40,7 @@ export default {
39
40
  filecoin,
40
41
  internet_computer,
41
42
  icon,
43
+ kaspa,
42
44
  multiversx,
43
45
  near,
44
46
  polkadot,
@@ -11,6 +11,7 @@ import hedera from "@ledgerhq/coin-hedera/transaction";
11
11
  import filecoin from "@ledgerhq/coin-filecoin/transaction";
12
12
  import internet_computer from "@ledgerhq/coin-internet_computer/transaction";
13
13
  import icon from "@ledgerhq/coin-icon/transaction";
14
+ import kaspa from "@ledgerhq/coin-kaspa/transaction";
14
15
  import multiversx from "@ledgerhq/coin-multiversx/transaction";
15
16
  import near from "@ledgerhq/coin-near/transaction";
16
17
  import polkadot from "@ledgerhq/coin-polkadot/transaction";
@@ -39,6 +40,7 @@ export default {
39
40
  filecoin,
40
41
  internet_computer,
41
42
  icon,
43
+ kaspa,
42
44
  multiversx,
43
45
  near,
44
46
  polkadot,
@@ -76,6 +76,12 @@ import type {
76
76
  TransactionStatus as internet_computerTransactionStatus,
77
77
  TransactionStatusRaw as internet_computerTransactionStatusRaw,
78
78
  } from "@ledgerhq/coin-internet_computer/types/index";
79
+ import type {
80
+ Transaction as kaspaTransaction,
81
+ TransactionRaw as kaspaTransactionRaw,
82
+ TransactionStatus as kaspaTransactionStatus,
83
+ TransactionStatusRaw as kaspaTransactionStatusRaw,
84
+ } from "@ledgerhq/coin-kaspa/types/index";
79
85
  import type {
80
86
  Transaction as minaTransaction,
81
87
  TransactionRaw as minaTransactionRaw,
@@ -169,6 +175,7 @@ export type Transaction =
169
175
  | hederaTransaction
170
176
  | iconTransaction
171
177
  | internet_computerTransaction
178
+ | kaspaTransaction
172
179
  | minaTransaction
173
180
  | multiversxTransaction
174
181
  | nearTransaction
@@ -197,6 +204,7 @@ export type TransactionRaw =
197
204
  | hederaTransactionRaw
198
205
  | iconTransactionRaw
199
206
  | internet_computerTransactionRaw
207
+ | kaspaTransactionRaw
200
208
  | minaTransactionRaw
201
209
  | multiversxTransactionRaw
202
210
  | nearTransactionRaw
@@ -225,6 +233,7 @@ export type TransactionStatus =
225
233
  | hederaTransactionStatus
226
234
  | iconTransactionStatus
227
235
  | internet_computerTransactionStatus
236
+ | kaspaTransactionStatus
228
237
  | minaTransactionStatus
229
238
  | multiversxTransactionStatus
230
239
  | nearTransactionStatus
@@ -253,6 +262,7 @@ export type TransactionStatusRaw =
253
262
  | hederaTransactionStatusRaw
254
263
  | iconTransactionStatusRaw
255
264
  | internet_computerTransactionStatusRaw
265
+ | kaspaTransactionStatusRaw
256
266
  | minaTransactionStatusRaw
257
267
  | multiversxTransactionStatusRaw
258
268
  | nearTransactionStatusRaw
@@ -540,18 +540,20 @@ export const createAction = (
540
540
  displayUpgradeWarning: false,
541
541
  }));
542
542
  }, []);
543
-
543
+ // TODO remove after fix
544
+ const isCanton = appRequest.account?.currency.id.includes("canton");
545
+ const wrongDevice =
546
+ state.derivation && appRequest.account
547
+ ? state.derivation.address !== appRequest.account.freshAddress &&
548
+ state.derivation.address !== appRequest.account.seedIdentifier // Use-case added for Hedera
549
+ ? {
550
+ accountName: getDefaultAccountName(appRequest.account),
551
+ }
552
+ : null
553
+ : null;
544
554
  return {
545
555
  ...state,
546
- inWrongDeviceForAccount:
547
- state.derivation && appRequest.account
548
- ? state.derivation.address !== appRequest.account.freshAddress &&
549
- state.derivation.address !== appRequest.account.seedIdentifier // Use-case added for Hedera
550
- ? {
551
- accountName: getDefaultAccountName(appRequest.account),
552
- }
553
- : null
554
- : null,
556
+ inWrongDeviceForAccount: isCanton ? null : wrongDevice,
555
557
  onRetry,
556
558
  passWarning,
557
559
  };
@@ -62,6 +62,22 @@ describe("getDeviceNameMaxLength", () => {
62
62
  }),
63
63
  ).toBe(20);
64
64
  });
65
+ test("Europa of any version should max at 20", async () => {
66
+ expect(
67
+ getDeviceNameMaxLength({
68
+ deviceModelId: DeviceModelId.europa,
69
+ version: "0.0.1",
70
+ }),
71
+ ).toBe(20);
72
+ });
73
+ test("Apex of any version should max at 20", async () => {
74
+ expect(
75
+ getDeviceNameMaxLength({
76
+ deviceModelId: DeviceModelId.apex,
77
+ version: "0.0.1",
78
+ }),
79
+ ).toBe(20);
80
+ });
65
81
  test("Other models should just return 17 as a fallback", async () => {
66
82
  expect(
67
83
  getDeviceNameMaxLength({
@@ -31,6 +31,8 @@ const getDeviceNameMaxLength = (props: Props): number => {
31
31
  }
32
32
 
33
33
  case DeviceModelId.stax:
34
+ case DeviceModelId.europa:
35
+ case DeviceModelId.apex:
34
36
  maxLength = 20;
35
37
  break;
36
38
  }