@ledgerhq/live-common 34.51.0-nightly.9 → 34.52.0-nightly.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (397) hide show
  1. package/lib/account/helpers.d.ts +10 -0
  2. package/lib/account/helpers.d.ts.map +1 -1
  3. package/lib/account/helpers.js +43 -16
  4. package/lib/account/helpers.js.map +1 -1
  5. package/lib/bridge/generic-alpaca/estimateMaxSpendable.js +1 -1
  6. package/lib/bridge/generic-alpaca/estimateMaxSpendable.js.map +1 -1
  7. package/lib/bridge/generic-alpaca/prepareTransaction.d.ts.map +1 -1
  8. package/lib/bridge/generic-alpaca/prepareTransaction.js +45 -37
  9. package/lib/bridge/generic-alpaca/prepareTransaction.js.map +1 -1
  10. package/lib/bridge/generic-alpaca/signOperation.d.ts.map +1 -1
  11. package/lib/bridge/generic-alpaca/signOperation.js +20 -0
  12. package/lib/bridge/generic-alpaca/signOperation.js.map +1 -1
  13. package/lib/bridge/generic-alpaca/utils.js +1 -1
  14. package/lib/bridge/generic-alpaca/utils.js.map +1 -1
  15. package/lib/config/index.d.ts +2 -2
  16. package/lib/config/index.d.ts.map +1 -1
  17. package/lib/config/index.js.map +1 -1
  18. package/lib/dada-client/hooks/useDrawerConfiguration.d.ts +19 -0
  19. package/lib/dada-client/hooks/useDrawerConfiguration.d.ts.map +1 -0
  20. package/lib/dada-client/hooks/useDrawerConfiguration.js +45 -0
  21. package/lib/dada-client/hooks/useDrawerConfiguration.js.map +1 -0
  22. package/lib/e2e/data/deviceLabelsData.d.ts +8 -0
  23. package/lib/e2e/data/deviceLabelsData.d.ts.map +1 -1
  24. package/lib/e2e/data/deviceLabelsData.js +62 -2
  25. package/lib/e2e/data/deviceLabelsData.js.map +1 -1
  26. package/lib/e2e/deviceInteraction/ButtonDeviceSimulator.d.ts +3 -0
  27. package/lib/e2e/deviceInteraction/ButtonDeviceSimulator.d.ts.map +1 -0
  28. package/lib/e2e/deviceInteraction/ButtonDeviceSimulator.js +26 -0
  29. package/lib/e2e/deviceInteraction/ButtonDeviceSimulator.js.map +1 -0
  30. package/lib/e2e/deviceInteraction/TouchDeviceSimulator.d.ts +4 -0
  31. package/lib/e2e/deviceInteraction/TouchDeviceSimulator.d.ts.map +1 -0
  32. package/lib/e2e/deviceInteraction/TouchDeviceSimulator.js +50 -0
  33. package/lib/e2e/deviceInteraction/TouchDeviceSimulator.js.map +1 -0
  34. package/lib/e2e/enum/Account.d.ts +2 -4
  35. package/lib/e2e/enum/Account.d.ts.map +1 -1
  36. package/lib/e2e/enum/Account.js +5 -8
  37. package/lib/e2e/enum/Account.js.map +1 -1
  38. package/lib/e2e/enum/Device.d.ts +1 -0
  39. package/lib/e2e/enum/Device.d.ts.map +1 -1
  40. package/lib/e2e/enum/Device.js +1 -0
  41. package/lib/e2e/enum/Device.js.map +1 -1
  42. package/lib/e2e/enum/DeviceLabels.d.ts +10 -2
  43. package/lib/e2e/enum/DeviceLabels.d.ts.map +1 -1
  44. package/lib/e2e/enum/DeviceLabels.js +9 -1
  45. package/lib/e2e/enum/DeviceLabels.js.map +1 -1
  46. package/lib/e2e/families/algorand.d.ts.map +1 -1
  47. package/lib/e2e/families/algorand.js +10 -2
  48. package/lib/e2e/families/algorand.js.map +1 -1
  49. package/lib/e2e/families/aptos.d.ts +2 -1
  50. package/lib/e2e/families/aptos.d.ts.map +1 -1
  51. package/lib/e2e/families/aptos.js +12 -4
  52. package/lib/e2e/families/aptos.js.map +1 -1
  53. package/lib/e2e/families/bitcoin.d.ts.map +1 -1
  54. package/lib/e2e/families/bitcoin.js +25 -15
  55. package/lib/e2e/families/bitcoin.js.map +1 -1
  56. package/lib/e2e/families/cardano.d.ts.map +1 -1
  57. package/lib/e2e/families/cardano.js +122 -46
  58. package/lib/e2e/families/cardano.js.map +1 -1
  59. package/lib/e2e/families/celo.d.ts.map +1 -1
  60. package/lib/e2e/families/celo.js +11 -1
  61. package/lib/e2e/families/celo.js.map +1 -1
  62. package/lib/e2e/families/cosmos.d.ts.map +1 -1
  63. package/lib/e2e/families/cosmos.js +16 -3
  64. package/lib/e2e/families/cosmos.js.map +1 -1
  65. package/lib/e2e/families/evm.d.ts +1 -2
  66. package/lib/e2e/families/evm.d.ts.map +1 -1
  67. package/lib/e2e/families/evm.js +28 -13
  68. package/lib/e2e/families/evm.js.map +1 -1
  69. package/lib/e2e/families/hedera.d.ts.map +1 -1
  70. package/lib/e2e/families/hedera.js +3 -2
  71. package/lib/e2e/families/hedera.js.map +1 -1
  72. package/lib/e2e/families/kaspa.d.ts +2 -1
  73. package/lib/e2e/families/kaspa.d.ts.map +1 -1
  74. package/lib/e2e/families/kaspa.js +12 -4
  75. package/lib/e2e/families/kaspa.js.map +1 -1
  76. package/lib/e2e/families/multiversX.d.ts.map +1 -1
  77. package/lib/e2e/families/multiversX.js +11 -1
  78. package/lib/e2e/families/multiversX.js.map +1 -1
  79. package/lib/e2e/families/near.d.ts.map +1 -1
  80. package/lib/e2e/families/near.js +15 -4
  81. package/lib/e2e/families/near.js.map +1 -1
  82. package/lib/e2e/families/osmosis.d.ts.map +1 -1
  83. package/lib/e2e/families/osmosis.js +11 -1
  84. package/lib/e2e/families/osmosis.js.map +1 -1
  85. package/lib/e2e/families/polkadot.d.ts.map +1 -1
  86. package/lib/e2e/families/polkadot.js +10 -2
  87. package/lib/e2e/families/polkadot.js.map +1 -1
  88. package/lib/e2e/families/solana.d.ts.map +1 -1
  89. package/lib/e2e/families/solana.js +16 -3
  90. package/lib/e2e/families/solana.js.map +1 -1
  91. package/lib/e2e/families/stellar.d.ts.map +1 -1
  92. package/lib/e2e/families/stellar.js +10 -2
  93. package/lib/e2e/families/stellar.js.map +1 -1
  94. package/lib/e2e/families/sui.d.ts +2 -1
  95. package/lib/e2e/families/sui.d.ts.map +1 -1
  96. package/lib/e2e/families/sui.js +11 -3
  97. package/lib/e2e/families/sui.js.map +1 -1
  98. package/lib/e2e/families/tezos.d.ts.map +1 -1
  99. package/lib/e2e/families/tezos.js +12 -3
  100. package/lib/e2e/families/tezos.js.map +1 -1
  101. package/lib/e2e/families/tron.d.ts.map +1 -1
  102. package/lib/e2e/families/tron.js +10 -2
  103. package/lib/e2e/families/tron.js.map +1 -1
  104. package/lib/e2e/families/xrp.d.ts.map +1 -1
  105. package/lib/e2e/families/xrp.js +10 -2
  106. package/lib/e2e/families/xrp.js.map +1 -1
  107. package/lib/e2e/index.d.ts +4 -2
  108. package/lib/e2e/index.d.ts.map +1 -1
  109. package/lib/e2e/models/Transaction.d.ts +0 -5
  110. package/lib/e2e/models/Transaction.d.ts.map +1 -1
  111. package/lib/e2e/models/Transaction.js +1 -9
  112. package/lib/e2e/models/Transaction.js.map +1 -1
  113. package/lib/e2e/speculos.d.ts +13 -4
  114. package/lib/e2e/speculos.d.ts.map +1 -1
  115. package/lib/e2e/speculos.js +141 -75
  116. package/lib/e2e/speculos.js.map +1 -1
  117. package/lib/e2e/speculosAppVersion.d.ts +1 -0
  118. package/lib/e2e/speculosAppVersion.d.ts.map +1 -1
  119. package/lib/e2e/speculosAppVersion.js +9 -1
  120. package/lib/e2e/speculosAppVersion.js.map +1 -1
  121. package/lib/exchange/index.d.ts.map +1 -1
  122. package/lib/exchange/index.js +4 -15
  123. package/lib/exchange/index.js.map +1 -1
  124. package/lib/exchange/swap/getCompleteSwapHistory.d.ts +1 -1
  125. package/lib/exchange/swap/getCompleteSwapHistory.d.ts.map +1 -1
  126. package/lib/exchange/swap/getCompleteSwapHistory.js +5 -5
  127. package/lib/exchange/swap/getCompleteSwapHistory.js.map +1 -1
  128. package/lib/exchange/swap/hooks/useSelectableCurrencies.d.ts.map +1 -1
  129. package/lib/exchange/swap/hooks/useSelectableCurrencies.js +16 -4
  130. package/lib/exchange/swap/hooks/useSelectableCurrencies.js.map +1 -1
  131. package/lib/featureFlags/defaultFeatures.d.ts +3 -0
  132. package/lib/featureFlags/defaultFeatures.d.ts.map +1 -1
  133. package/lib/featureFlags/defaultFeatures.js +2 -1
  134. package/lib/featureFlags/defaultFeatures.js.map +1 -1
  135. package/lib/featureFlags/useFeature.d.ts +1 -1
  136. package/lib/featureFlags/useFeature.d.ts.map +1 -1
  137. package/lib/generated/specs.d.ts +1 -1
  138. package/lib/load/speculos.d.ts.map +1 -1
  139. package/lib/load/speculos.js +1 -0
  140. package/lib/load/speculos.js.map +1 -1
  141. package/lib/market/hooks/useLargeMoverChartData.d.ts +1 -2
  142. package/lib/market/hooks/useLargeMoverChartData.d.ts.map +1 -1
  143. package/lib/market/hooks/useLargeMoverChartData.js.map +1 -1
  144. package/lib/market/hooks/useLargeMoverCurrencies.d.ts +1 -2
  145. package/lib/market/hooks/useLargeMoverCurrencies.d.ts.map +1 -1
  146. package/lib/market/hooks/useLargeMoverCurrencies.js +1 -3
  147. package/lib/market/hooks/useLargeMoverCurrencies.js.map +1 -1
  148. package/lib/market/utils/currencyFormatter.d.ts +1 -1
  149. package/lib/market/utils/currencyFormatter.d.ts.map +1 -1
  150. package/lib/market/utils/currencyFormatter.js +1 -1
  151. package/lib/market/utils/currencyFormatter.js.map +1 -1
  152. package/lib/modularDrawer/hooks/modules/useLeftApyModule.d.ts +1 -1
  153. package/lib/modularDrawer/hooks/modules/useLeftMarketTrendModule.d.ts +1 -1
  154. package/lib/modularDrawer/hooks/modules/useRightMarketTrendModule.d.ts +1 -1
  155. package/lib/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.d.ts +1 -2
  156. package/lib/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.d.ts.map +1 -1
  157. package/lib/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.js +3 -0
  158. package/lib/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.js.map +1 -1
  159. package/lib/modularDrawer/hooks/useRightBalanceAsset.d.ts +1 -1
  160. package/lib/wallet-api/constants.d.ts +2 -2
  161. package/lib-es/account/helpers.d.ts +10 -0
  162. package/lib-es/account/helpers.d.ts.map +1 -1
  163. package/lib-es/account/helpers.js +26 -0
  164. package/lib-es/account/helpers.js.map +1 -1
  165. package/lib-es/bridge/generic-alpaca/estimateMaxSpendable.js +1 -1
  166. package/lib-es/bridge/generic-alpaca/estimateMaxSpendable.js.map +1 -1
  167. package/lib-es/bridge/generic-alpaca/prepareTransaction.d.ts.map +1 -1
  168. package/lib-es/bridge/generic-alpaca/prepareTransaction.js +45 -37
  169. package/lib-es/bridge/generic-alpaca/prepareTransaction.js.map +1 -1
  170. package/lib-es/bridge/generic-alpaca/signOperation.d.ts.map +1 -1
  171. package/lib-es/bridge/generic-alpaca/signOperation.js +17 -0
  172. package/lib-es/bridge/generic-alpaca/signOperation.js.map +1 -1
  173. package/lib-es/bridge/generic-alpaca/utils.js +1 -1
  174. package/lib-es/bridge/generic-alpaca/utils.js.map +1 -1
  175. package/lib-es/config/index.d.ts +2 -2
  176. package/lib-es/config/index.d.ts.map +1 -1
  177. package/lib-es/config/index.js.map +1 -1
  178. package/lib-es/dada-client/hooks/useDrawerConfiguration.d.ts +19 -0
  179. package/lib-es/dada-client/hooks/useDrawerConfiguration.d.ts.map +1 -0
  180. package/lib-es/dada-client/hooks/useDrawerConfiguration.js +38 -0
  181. package/lib-es/dada-client/hooks/useDrawerConfiguration.js.map +1 -0
  182. package/lib-es/e2e/data/deviceLabelsData.d.ts +8 -0
  183. package/lib-es/e2e/data/deviceLabelsData.d.ts.map +1 -1
  184. package/lib-es/e2e/data/deviceLabelsData.js +62 -2
  185. package/lib-es/e2e/data/deviceLabelsData.js.map +1 -1
  186. package/lib-es/e2e/deviceInteraction/ButtonDeviceSimulator.d.ts +3 -0
  187. package/lib-es/e2e/deviceInteraction/ButtonDeviceSimulator.d.ts.map +1 -0
  188. package/lib-es/e2e/deviceInteraction/ButtonDeviceSimulator.js +18 -0
  189. package/lib-es/e2e/deviceInteraction/ButtonDeviceSimulator.js.map +1 -0
  190. package/lib-es/e2e/deviceInteraction/TouchDeviceSimulator.d.ts +4 -0
  191. package/lib-es/e2e/deviceInteraction/TouchDeviceSimulator.d.ts.map +1 -0
  192. package/lib-es/e2e/deviceInteraction/TouchDeviceSimulator.js +41 -0
  193. package/lib-es/e2e/deviceInteraction/TouchDeviceSimulator.js.map +1 -0
  194. package/lib-es/e2e/enum/Account.d.ts +2 -4
  195. package/lib-es/e2e/enum/Account.d.ts.map +1 -1
  196. package/lib-es/e2e/enum/Account.js +5 -8
  197. package/lib-es/e2e/enum/Account.js.map +1 -1
  198. package/lib-es/e2e/enum/Device.d.ts +1 -0
  199. package/lib-es/e2e/enum/Device.d.ts.map +1 -1
  200. package/lib-es/e2e/enum/Device.js +1 -0
  201. package/lib-es/e2e/enum/Device.js.map +1 -1
  202. package/lib-es/e2e/enum/DeviceLabels.d.ts +10 -2
  203. package/lib-es/e2e/enum/DeviceLabels.d.ts.map +1 -1
  204. package/lib-es/e2e/enum/DeviceLabels.js +9 -1
  205. package/lib-es/e2e/enum/DeviceLabels.js.map +1 -1
  206. package/lib-es/e2e/families/algorand.d.ts.map +1 -1
  207. package/lib-es/e2e/families/algorand.js +11 -3
  208. package/lib-es/e2e/families/algorand.js.map +1 -1
  209. package/lib-es/e2e/families/aptos.d.ts +2 -1
  210. package/lib-es/e2e/families/aptos.d.ts.map +1 -1
  211. package/lib-es/e2e/families/aptos.js +12 -4
  212. package/lib-es/e2e/families/aptos.js.map +1 -1
  213. package/lib-es/e2e/families/bitcoin.d.ts.map +1 -1
  214. package/lib-es/e2e/families/bitcoin.js +27 -17
  215. package/lib-es/e2e/families/bitcoin.js.map +1 -1
  216. package/lib-es/e2e/families/cardano.d.ts.map +1 -1
  217. package/lib-es/e2e/families/cardano.js +121 -45
  218. package/lib-es/e2e/families/cardano.js.map +1 -1
  219. package/lib-es/e2e/families/celo.d.ts.map +1 -1
  220. package/lib-es/e2e/families/celo.js +12 -2
  221. package/lib-es/e2e/families/celo.js.map +1 -1
  222. package/lib-es/e2e/families/cosmos.d.ts.map +1 -1
  223. package/lib-es/e2e/families/cosmos.js +17 -4
  224. package/lib-es/e2e/families/cosmos.js.map +1 -1
  225. package/lib-es/e2e/families/evm.d.ts +1 -2
  226. package/lib-es/e2e/families/evm.d.ts.map +1 -1
  227. package/lib-es/e2e/families/evm.js +25 -9
  228. package/lib-es/e2e/families/evm.js.map +1 -1
  229. package/lib-es/e2e/families/hedera.d.ts.map +1 -1
  230. package/lib-es/e2e/families/hedera.js +2 -1
  231. package/lib-es/e2e/families/hedera.js.map +1 -1
  232. package/lib-es/e2e/families/kaspa.d.ts +2 -1
  233. package/lib-es/e2e/families/kaspa.d.ts.map +1 -1
  234. package/lib-es/e2e/families/kaspa.js +12 -4
  235. package/lib-es/e2e/families/kaspa.js.map +1 -1
  236. package/lib-es/e2e/families/multiversX.d.ts.map +1 -1
  237. package/lib-es/e2e/families/multiversX.js +12 -2
  238. package/lib-es/e2e/families/multiversX.js.map +1 -1
  239. package/lib-es/e2e/families/near.d.ts.map +1 -1
  240. package/lib-es/e2e/families/near.js +16 -5
  241. package/lib-es/e2e/families/near.js.map +1 -1
  242. package/lib-es/e2e/families/osmosis.d.ts.map +1 -1
  243. package/lib-es/e2e/families/osmosis.js +12 -2
  244. package/lib-es/e2e/families/osmosis.js.map +1 -1
  245. package/lib-es/e2e/families/polkadot.d.ts.map +1 -1
  246. package/lib-es/e2e/families/polkadot.js +11 -3
  247. package/lib-es/e2e/families/polkadot.js.map +1 -1
  248. package/lib-es/e2e/families/solana.d.ts.map +1 -1
  249. package/lib-es/e2e/families/solana.js +17 -4
  250. package/lib-es/e2e/families/solana.js.map +1 -1
  251. package/lib-es/e2e/families/stellar.d.ts.map +1 -1
  252. package/lib-es/e2e/families/stellar.js +11 -3
  253. package/lib-es/e2e/families/stellar.js.map +1 -1
  254. package/lib-es/e2e/families/sui.d.ts +2 -1
  255. package/lib-es/e2e/families/sui.d.ts.map +1 -1
  256. package/lib-es/e2e/families/sui.js +12 -4
  257. package/lib-es/e2e/families/sui.js.map +1 -1
  258. package/lib-es/e2e/families/tezos.d.ts.map +1 -1
  259. package/lib-es/e2e/families/tezos.js +12 -3
  260. package/lib-es/e2e/families/tezos.js.map +1 -1
  261. package/lib-es/e2e/families/tron.d.ts.map +1 -1
  262. package/lib-es/e2e/families/tron.js +11 -3
  263. package/lib-es/e2e/families/tron.js.map +1 -1
  264. package/lib-es/e2e/families/xrp.d.ts.map +1 -1
  265. package/lib-es/e2e/families/xrp.js +11 -3
  266. package/lib-es/e2e/families/xrp.js.map +1 -1
  267. package/lib-es/e2e/index.d.ts +4 -2
  268. package/lib-es/e2e/index.d.ts.map +1 -1
  269. package/lib-es/e2e/models/Transaction.d.ts +0 -5
  270. package/lib-es/e2e/models/Transaction.d.ts.map +1 -1
  271. package/lib-es/e2e/models/Transaction.js +0 -7
  272. package/lib-es/e2e/models/Transaction.js.map +1 -1
  273. package/lib-es/e2e/speculos.d.ts +13 -4
  274. package/lib-es/e2e/speculos.d.ts.map +1 -1
  275. package/lib-es/e2e/speculos.js +134 -71
  276. package/lib-es/e2e/speculos.js.map +1 -1
  277. package/lib-es/e2e/speculosAppVersion.d.ts +1 -0
  278. package/lib-es/e2e/speculosAppVersion.d.ts.map +1 -1
  279. package/lib-es/e2e/speculosAppVersion.js +7 -0
  280. package/lib-es/e2e/speculosAppVersion.js.map +1 -1
  281. package/lib-es/exchange/index.d.ts.map +1 -1
  282. package/lib-es/exchange/index.js +4 -15
  283. package/lib-es/exchange/index.js.map +1 -1
  284. package/lib-es/exchange/swap/getCompleteSwapHistory.d.ts +1 -1
  285. package/lib-es/exchange/swap/getCompleteSwapHistory.d.ts.map +1 -1
  286. package/lib-es/exchange/swap/getCompleteSwapHistory.js +5 -5
  287. package/lib-es/exchange/swap/getCompleteSwapHistory.js.map +1 -1
  288. package/lib-es/exchange/swap/hooks/useSelectableCurrencies.d.ts.map +1 -1
  289. package/lib-es/exchange/swap/hooks/useSelectableCurrencies.js +18 -6
  290. package/lib-es/exchange/swap/hooks/useSelectableCurrencies.js.map +1 -1
  291. package/lib-es/featureFlags/defaultFeatures.d.ts +3 -0
  292. package/lib-es/featureFlags/defaultFeatures.d.ts.map +1 -1
  293. package/lib-es/featureFlags/defaultFeatures.js +2 -1
  294. package/lib-es/featureFlags/defaultFeatures.js.map +1 -1
  295. package/lib-es/featureFlags/useFeature.d.ts +1 -1
  296. package/lib-es/featureFlags/useFeature.d.ts.map +1 -1
  297. package/lib-es/generated/specs.d.ts +1 -1
  298. package/lib-es/load/speculos.d.ts.map +1 -1
  299. package/lib-es/load/speculos.js +1 -0
  300. package/lib-es/load/speculos.js.map +1 -1
  301. package/lib-es/market/hooks/useLargeMoverChartData.d.ts +1 -2
  302. package/lib-es/market/hooks/useLargeMoverChartData.d.ts.map +1 -1
  303. package/lib-es/market/hooks/useLargeMoverChartData.js.map +1 -1
  304. package/lib-es/market/hooks/useLargeMoverCurrencies.d.ts +1 -2
  305. package/lib-es/market/hooks/useLargeMoverCurrencies.d.ts.map +1 -1
  306. package/lib-es/market/hooks/useLargeMoverCurrencies.js +1 -3
  307. package/lib-es/market/hooks/useLargeMoverCurrencies.js.map +1 -1
  308. package/lib-es/market/utils/currencyFormatter.d.ts +1 -1
  309. package/lib-es/market/utils/currencyFormatter.d.ts.map +1 -1
  310. package/lib-es/market/utils/currencyFormatter.js +1 -1
  311. package/lib-es/market/utils/currencyFormatter.js.map +1 -1
  312. package/lib-es/modularDrawer/hooks/modules/useLeftApyModule.d.ts +1 -1
  313. package/lib-es/modularDrawer/hooks/modules/useLeftMarketTrendModule.d.ts +1 -1
  314. package/lib-es/modularDrawer/hooks/modules/useRightMarketTrendModule.d.ts +1 -1
  315. package/lib-es/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.d.ts +1 -2
  316. package/lib-es/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.d.ts.map +1 -1
  317. package/lib-es/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.js +3 -0
  318. package/lib-es/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.js.map +1 -1
  319. package/lib-es/modularDrawer/hooks/useRightBalanceAsset.d.ts +1 -1
  320. package/lib-es/wallet-api/constants.d.ts +2 -2
  321. package/package.json +55 -55
  322. package/src/account/helpers.test.ts +209 -0
  323. package/src/account/helpers.ts +34 -0
  324. package/src/bridge/cache.test.ts +2 -2
  325. package/src/bridge/generic-alpaca/estimateMaxSpendable.ts +1 -1
  326. package/src/bridge/generic-alpaca/prepareTransaction.ts +69 -46
  327. package/src/bridge/generic-alpaca/signOperation.ts +20 -0
  328. package/src/bridge/generic-alpaca/tests/prepareTransaction.test.ts +109 -191
  329. package/src/bridge/generic-alpaca/utils.test.ts +15 -12
  330. package/src/bridge/generic-alpaca/utils.ts +1 -1
  331. package/src/config/index.ts +2 -4
  332. package/src/currencies/sortByMarketcap.test.ts +10 -7
  333. package/src/dada-client/hooks/useDrawerConfiguration.ts +65 -0
  334. package/src/e2e/data/deviceLabelsData.ts +70 -2
  335. package/src/e2e/deviceInteraction/ButtonDeviceSimulator.ts +23 -0
  336. package/src/e2e/deviceInteraction/TouchDeviceSimulator.ts +52 -0
  337. package/src/e2e/enum/Account.ts +1 -16
  338. package/src/e2e/enum/Device.ts +1 -0
  339. package/src/e2e/enum/DeviceLabels.ts +9 -1
  340. package/src/e2e/families/algorand.ts +10 -4
  341. package/src/e2e/families/aptos.ts +12 -4
  342. package/src/e2e/families/bitcoin.ts +25 -18
  343. package/src/e2e/families/cardano.ts +137 -50
  344. package/src/e2e/families/celo.ts +11 -2
  345. package/src/e2e/families/cosmos.ts +15 -9
  346. package/src/e2e/families/evm.ts +28 -11
  347. package/src/e2e/families/hedera.ts +2 -1
  348. package/src/e2e/families/kaspa.ts +12 -4
  349. package/src/e2e/families/multiversX.ts +11 -2
  350. package/src/e2e/families/near.ts +15 -6
  351. package/src/e2e/families/osmosis.ts +11 -2
  352. package/src/e2e/families/polkadot.ts +10 -3
  353. package/src/e2e/families/solana.ts +15 -9
  354. package/src/e2e/families/stellar.ts +10 -3
  355. package/src/e2e/families/sui.ts +12 -4
  356. package/src/e2e/families/tezos.ts +11 -3
  357. package/src/e2e/families/tron.ts +10 -3
  358. package/src/e2e/families/xrp.ts +10 -3
  359. package/src/e2e/models/Transaction.ts +0 -13
  360. package/src/e2e/speculos.ts +160 -89
  361. package/src/e2e/speculosAppVersion.ts +8 -0
  362. package/src/exchange/index.ts +4 -15
  363. package/src/exchange/swap/getCompleteSwapHistory.ts +5 -5
  364. package/src/exchange/swap/hooks/useFromState.test.ts +11 -4
  365. package/src/exchange/swap/hooks/useReverseAccounts.test.ts +11 -4
  366. package/src/exchange/swap/hooks/useSelectableCurrencies.test.ts +14 -8
  367. package/src/exchange/swap/hooks/useSelectableCurrencies.ts +23 -6
  368. package/src/exchange/swap/hooks/useToState.test.ts +11 -4
  369. package/src/exchange/swap/hooks/useUpdateMaxAmount.test.ts +11 -4
  370. package/src/exchange/swap/utils/index.test.ts +10 -4
  371. package/src/families/algorand/bridge.integration.test.ts +1 -1
  372. package/src/families/bitcoin/__snapshots__/bridge.integration.test.ts.snap +3 -3
  373. package/src/families/cardano/bridge.integration.test.ts +1 -1
  374. package/src/families/cosmos/datasets/__snapshots__/cosmos.integration.test.ts.snap +25 -2
  375. package/src/families/evm/bridge.integration.test.ts +1 -1
  376. package/src/families/hedera/__snapshots__/bridge.integration.test.ts.snap +25 -5
  377. package/src/families/icon/bridge.integration.test.ts +1 -1
  378. package/src/families/multiversx/bridge.integration.test.ts +1 -2
  379. package/src/families/near/bridge.integration.test.ts +1 -1
  380. package/src/families/solana/bridge.integration.test.ts +1 -1
  381. package/src/families/sui/bridge.integration.test.ts +1 -1
  382. package/src/families/ton/bridge.integration.test.ts +1 -1
  383. package/src/featureFlags/defaultFeatures.ts +2 -1
  384. package/src/load/speculos.ts +1 -0
  385. package/src/market/hooks/useLargeMoverChartData.ts +1 -2
  386. package/src/market/hooks/useLargeMoverCurrencies.ts +3 -6
  387. package/src/market/utils/currencyFormatter.ts +2 -2
  388. package/src/modularDrawer/hooks/useCurrenciesUnderFeatureFlag.ts +3 -0
  389. package/lib/e2e/enum/Nft.d.ts +0 -15
  390. package/lib/e2e/enum/Nft.d.ts.map +0 -1
  391. package/lib/e2e/enum/Nft.js +0 -25
  392. package/lib/e2e/enum/Nft.js.map +0 -1
  393. package/lib-es/e2e/enum/Nft.d.ts +0 -15
  394. package/lib-es/e2e/enum/Nft.d.ts.map +0 -1
  395. package/lib-es/e2e/enum/Nft.js +0 -21
  396. package/lib-es/e2e/enum/Nft.js.map +0 -1
  397. package/src/e2e/enum/Nft.ts +0 -57
@@ -0,0 +1,52 @@
1
+ import { retryAxiosRequest, getSpeculosAddress, getDeviceLabelCoordinates } from "../speculos";
2
+ import axios from "axios";
3
+ import { getEnv } from "@ledgerhq/live-env";
4
+
5
+ function getSpeculosInfo(): {
6
+ speculosApiPort: number;
7
+ speculosAddress: string;
8
+ } {
9
+ const speculosApiPort = getEnv("SPECULOS_API_PORT");
10
+ const speculosAddress = getSpeculosAddress();
11
+ return { speculosApiPort, speculosAddress };
12
+ }
13
+ export async function pressAndRelease(deviceLabel: string, x?: number, y?: number) {
14
+ const { speculosApiPort, speculosAddress } = getSpeculosInfo();
15
+ const { x: coordX, y: coordY } = await getDeviceLabelCoordinates(deviceLabel, speculosApiPort);
16
+ x = x === undefined ? coordX : x;
17
+ y = y === undefined ? coordY : y;
18
+ await retryAxiosRequest(() =>
19
+ axios.post(`${speculosAddress}:${speculosApiPort}/finger`, {
20
+ action: "press-and-release",
21
+ x: x,
22
+ y: y,
23
+ }),
24
+ );
25
+ }
26
+
27
+ export async function longPressAndRelease(deviceLabel: string, delay: number) {
28
+ const { speculosApiPort, speculosAddress } = getSpeculosInfo();
29
+ const deviceLabelCoordinates = await getDeviceLabelCoordinates(deviceLabel, speculosApiPort);
30
+ await retryAxiosRequest(() =>
31
+ axios.post(`${speculosAddress}:${speculosApiPort}/finger`, {
32
+ action: "press-and-release",
33
+ x: deviceLabelCoordinates.x,
34
+ y: deviceLabelCoordinates.y,
35
+ delay: delay,
36
+ }),
37
+ );
38
+ }
39
+
40
+ export async function swipeRight() {
41
+ const { speculosApiPort, speculosAddress } = getSpeculosInfo();
42
+ await retryAxiosRequest(() =>
43
+ axios.post(`${speculosAddress}:${speculosApiPort}/finger`, {
44
+ action: "press-and-release",
45
+ x: 100,
46
+ y: 100,
47
+ x2: 50,
48
+ y2: 100,
49
+ delay: 0.5,
50
+ }),
51
+ );
52
+ }
@@ -1,6 +1,5 @@
1
1
  import { Currency } from "./Currency";
2
2
  import { TokenType } from "./TokenType";
3
- import { Nft } from "./Nft";
4
3
 
5
4
  export class Account {
6
5
  constructor(
@@ -11,7 +10,6 @@ export class Account {
11
10
  public readonly tokenType?: TokenType,
12
11
  public readonly ensName?: string,
13
12
  public readonly derivationMode?: string,
14
- public readonly nft?: Nft[],
15
13
  public readonly parentAccount?: Account,
16
14
  ) {}
17
15
 
@@ -246,7 +244,6 @@ export class Account {
246
244
  undefined,
247
245
  undefined,
248
246
  undefined,
249
- [Nft.ANTITUS, Nft.PODIUM, Nft.NY_LA_MUSE],
250
247
  );
251
248
  // don't use this account as a recipient, it's balance
252
249
  // should stay close to null to allow for error message testing
@@ -361,7 +358,6 @@ export class Account {
361
358
  undefined,
362
359
  undefined,
363
360
  undefined,
364
- [Nft.ANIME_SHIPS_494, Nft.BISHOP_OF_STORMS, Nft.COMMON_TOWER_MAP],
365
361
  );
366
362
  static readonly POL_2 = new Account(
367
363
  Currency.POL,
@@ -552,19 +548,8 @@ export class TokenAccount extends Account {
552
548
  parentAccount: Account,
553
549
  ensName?: string,
554
550
  derivationMode?: string,
555
- nft?: Nft[],
556
551
  ) {
557
- super(
558
- currency,
559
- accountName,
560
- address,
561
- index,
562
- tokenType,
563
- ensName,
564
- derivationMode,
565
- nft,
566
- parentAccount,
567
- );
552
+ super(currency, accountName, address, index, tokenType, ensName, derivationMode, parentAccount);
568
553
  }
569
554
 
570
555
  static readonly ETH_LIDO = new TokenAccount(
@@ -7,4 +7,5 @@ export class Device {
7
7
  static readonly LNS = new Device("nanoS", 823132164);
8
8
  static readonly LNX = new Device("nanoX", 855638020);
9
9
  static readonly LNSP = new Device("nanoSP", 856686596);
10
+ static readonly STAX = new Device("stax", 857735172);
10
11
  }
@@ -12,6 +12,8 @@ export enum DeviceLabels {
12
12
  CONFIRM = "Confirm",
13
13
  CONNECT = "Connect",
14
14
  CONNECT_TO = "Connect to",
15
+ CONNECT_WITH = "Connect with",
16
+ CONNECT_WITH_LEDGER_SYNC = "Connect with Ledger Sync",
15
17
  CONTINUE = "Continue",
16
18
  CONTINUE_TO_ACTION = "Continue to actions",
17
19
  CONTRACT_DATA = "Contract data",
@@ -35,20 +37,22 @@ export enum DeviceLabels {
35
37
  REMOVE = "Remove",
36
38
  REMOVE_FROM_LEDGER_SYNC = "Remove from",
37
39
  REVIEW_OPERATION = "Review",
40
+ REMOVE_PHONE_OR_COMPUTER = "Remove phone or computer",
38
41
  REVIEW_TRANSACTION = "Review transaction",
39
42
  SEND = "Send",
40
43
  SEND_TO_ADDRESS = "Send to address",
41
44
  SEND_TO_ADDRESS_2 = "Send to address (2/2)",
42
45
  SETTINGS = "Settings",
46
+ SETTINGS_TOGGLE_1 = "Settings toggle 1",
43
47
  SIGN = "Sign",
44
48
  SIGN_TRANSACTION = "Sign transaction",
45
49
  STAKE_KEY = "Stake key",
46
50
  TO = "To",
47
51
  TRANSACTION_FEE = "Transaction fee",
48
52
  TRANSACTION_SIGNED = "Transaction Signed",
53
+ TRANSACTION_TYPE = "Transaction Type",
49
54
  TRANSFER = "Transfer",
50
55
  TURN_ON_SYNC = "Turn on sync",
51
- TURN_ON_SYNC2 = "Turn On sync",
52
56
  TYPE_DELEGATE = "Type Delegate",
53
57
  VALUE = "Value",
54
58
  VERIFY_ADDRESS = "Verify address",
@@ -58,4 +62,8 @@ export enum DeviceLabels {
58
62
  VERIFY_SOLANA_ADDRESS = "Verify Solana address",
59
63
  VIEW_ACTION = "View action",
60
64
  VIEW_HEADER = "View Header",
65
+ HOLD_TO_SIGN = "Hold to sign",
66
+ CONFIRM_HEADER = "Confirm header",
67
+ CONFIRM_CHANGE = "Confirm change",
68
+ TAP_TO_CONTINUE = "Tap to continue",
61
69
  }
@@ -1,14 +1,20 @@
1
1
  import expect from "expect";
2
2
  import { Transaction } from "../models/Transaction";
3
- import { pressBoth, pressUntilTextFound, containsSubstringInEvent } from "../speculos";
3
+ import { containsSubstringInEvent, getSendEvents } from "../speculos";
4
+ import { isTouchDevice } from "../speculosAppVersion";
5
+ import { pressBoth } from "../deviceInteraction/ButtonDeviceSimulator";
4
6
  import { DeviceLabels } from "../enum/DeviceLabels";
7
+ import { longPressAndRelease } from "../deviceInteraction/TouchDeviceSimulator";
5
8
 
6
9
  export async function sendAlgorand(tx: Transaction) {
7
- const events = await pressUntilTextFound(DeviceLabels.CAPS_APPROVE);
10
+ const events = await getSendEvents(tx);
8
11
  const isAmountCorrect = containsSubstringInEvent(tx.amount, events);
9
12
  expect(isAmountCorrect).toBeTruthy();
10
13
  const isAddressCorrect = containsSubstringInEvent(tx.accountToCredit.address, events);
11
14
  expect(isAddressCorrect).toBeTruthy();
12
-
13
- await pressBoth();
15
+ if (isTouchDevice()) {
16
+ await longPressAndRelease(DeviceLabels.HOLD_TO_SIGN, 3);
17
+ } else {
18
+ await pressBoth();
19
+ }
14
20
  }
@@ -1,11 +1,19 @@
1
1
  import expect from "expect";
2
- import { pressBoth, pressUntilTextFound, waitFor, containsSubstringInEvent } from "../speculos";
2
+ import { Transaction } from "../models/Transaction";
3
+ import { waitFor, pressUntilTextFound, containsSubstringInEvent, getSendEvents } from "../speculos";
4
+ import { isTouchDevice } from "../speculosAppVersion";
5
+ import { pressBoth } from "../deviceInteraction/ButtonDeviceSimulator";
3
6
  import { DeviceLabels } from "../enum/DeviceLabels";
4
7
  import { Delegate } from "../models/Delegate";
8
+ import { longPressAndRelease } from "../deviceInteraction/TouchDeviceSimulator";
5
9
 
6
- export async function sendAptos() {
7
- await pressUntilTextFound(DeviceLabels.APPROVE);
8
- await pressBoth();
10
+ export async function sendAptos(tx: Transaction) {
11
+ await getSendEvents(tx);
12
+ if (isTouchDevice()) {
13
+ await longPressAndRelease(DeviceLabels.HOLD_TO_SIGN, 3);
14
+ } else {
15
+ await pressBoth();
16
+ }
9
17
  }
10
18
 
11
19
  export async function delegateAptos(delegatingAccount: Delegate) {
@@ -1,41 +1,48 @@
1
1
  import expect from "expect";
2
2
  import { Transaction } from "../models/Transaction";
3
- import { pressBoth, pressUntilTextFound, waitFor, containsSubstringInEvent } from "../speculos";
4
- import { getSpeculosModel } from "../speculosAppVersion";
3
+ import { waitFor, containsSubstringInEvent, pressUntilTextFound, getSendEvents } from "../speculos";
4
+ import { getSpeculosModel, isTouchDevice } from "../speculosAppVersion";
5
+ import { pressBoth } from "../deviceInteraction/ButtonDeviceSimulator";
5
6
  import { DeviceLabels } from "../enum/DeviceLabels";
6
- import { Device } from "../enum/Device";
7
7
  import invariant from "invariant";
8
+ import { DeviceModelId } from "@ledgerhq/types-devices";
9
+ import { longPressAndRelease } from "../deviceInteraction/TouchDeviceSimulator";
8
10
 
9
11
  export async function sendBTCBasedCoin(tx: Transaction) {
10
- const events = await pressUntilTextFound(DeviceLabels.ACCEPT);
12
+ const events = await getSendEvents(tx);
11
13
  const isAmountCorrect = containsSubstringInEvent(tx.amount, events);
12
14
  expect(isAmountCorrect).toBeTruthy();
13
15
  const isAddressCorrect = containsSubstringInEvent(tx.accountToCredit.address, events);
14
16
  expect(isAddressCorrect).toBeTruthy();
15
- await pressBoth();
16
- await waitFor(DeviceLabels.CONFIRM);
17
- await pressUntilTextFound(DeviceLabels.ACCEPT);
18
- await pressBoth();
17
+ if (isTouchDevice()) {
18
+ await longPressAndRelease(DeviceLabels.HOLD_TO_SIGN, 3);
19
+ } else {
20
+ await pressBoth();
21
+ await waitFor(DeviceLabels.CONFIRM);
22
+ await pressUntilTextFound(DeviceLabels.ACCEPT);
23
+ await pressBoth();
24
+ }
19
25
  }
20
26
 
21
27
  export async function sendBTC(tx: Transaction) {
22
28
  const speculosDevice = getSpeculosModel();
23
29
  try {
24
- const events =
25
- speculosDevice === Device.LNS.name
26
- ? await pressUntilTextFound(DeviceLabels.CONTINUE)
27
- : await pressUntilTextFound(DeviceLabels.SIGN_TRANSACTION);
30
+ const events = await getSendEvents(tx);
28
31
  const isAmountCorrect = containsSubstringInEvent(tx.amount, events);
29
32
  expect(isAmountCorrect).toBeTruthy();
30
33
  const isAddressCorrect = containsSubstringInEvent(tx.accountToCredit.address, events);
31
34
  expect(isAddressCorrect).toBeTruthy();
32
- await pressBoth();
33
- if (speculosDevice === Device.LNS.name) {
34
- await pressUntilTextFound(DeviceLabels.SIGN);
35
- await pressBoth();
36
- await waitFor(DeviceLabels.BITCOIN_IS_READY);
35
+ if (speculosDevice === DeviceModelId.stax) {
36
+ await longPressAndRelease(DeviceLabels.HOLD_TO_SIGN, 3);
37
37
  } else {
38
- await waitFor(DeviceLabels.TRANSACTION_SIGNED);
38
+ await pressBoth();
39
+ if (speculosDevice === DeviceModelId.nanoS) {
40
+ await pressUntilTextFound(DeviceLabels.SIGN);
41
+ await pressBoth();
42
+ await waitFor(DeviceLabels.BITCOIN_IS_READY);
43
+ } else {
44
+ await waitFor(DeviceLabels.TRANSACTION_SIGNED);
45
+ }
39
46
  }
40
47
  } catch (e) {
41
48
  invariant(false, `Error while sending BTC transaction: ${e}`);
@@ -1,81 +1,168 @@
1
1
  import expect from "expect";
2
2
  import { Transaction } from "../models/Transaction";
3
+ import { pressUntilTextFound, containsSubstringInEvent, waitFor } from "../speculos";
4
+ import { getSpeculosModel } from "../speculosAppVersion";
5
+ import { pressBoth, pressRightButton } from "../deviceInteraction/ButtonDeviceSimulator";
3
6
  import {
4
- pressBoth,
5
- pressUntilTextFound,
6
- containsSubstringInEvent,
7
- waitFor,
8
- pressRightButton,
9
- } from "../speculos";
7
+ pressAndRelease,
8
+ longPressAndRelease,
9
+ swipeRight,
10
+ } from "../deviceInteraction/TouchDeviceSimulator";
10
11
  import { DeviceLabels } from "../enum/DeviceLabels";
11
- import { Device } from "../enum/Device";
12
+ import { DeviceModelId } from "@ledgerhq/types-devices";
12
13
 
13
- export async function sendCardano(tx: Transaction) {
14
- const isNanoS = process.env.SPECULOS_DEVICE === Device.LNS.name;
14
+ type ActionType = "both" | "right" | "tap" | "swipe" | "confirm" | "hold";
15
+
16
+ function validateTransactionData(tx: Transaction, events: string[]) {
17
+ const isAddressCorrect = containsSubstringInEvent(tx.accountToCredit.address, events);
18
+ expect(isAddressCorrect).toBeTruthy();
19
+ const isAmountCorrect = containsSubstringInEvent(tx.amount, events);
20
+ expect(isAmountCorrect).toBeTruthy();
21
+ }
22
+
23
+ async function sendCardanoStax(tx: Transaction) {
24
+ await waitFor(DeviceLabels.REVIEW_TRANSACTION);
25
+ const events = await pressUntilTextFound(DeviceLabels.TO);
26
+ validateTransactionData(tx, events);
27
+ await pressAndRelease(DeviceLabels.TAP_TO_CONTINUE);
28
+ await waitFor(DeviceLabels.FEES);
29
+ await pressAndRelease(DeviceLabels.TAP_TO_CONTINUE);
30
+ await waitFor(DeviceLabels.SIGN_TRANSACTION);
31
+ await longPressAndRelease(DeviceLabels.HOLD_TO_SIGN, 3);
32
+ }
33
+
34
+ async function sendCardanoNanoS(_tx: Transaction) {
15
35
  await waitFor(DeviceLabels.NEW_ORDINARY);
16
- await (isNanoS ? pressRightButton() : pressBoth());
17
- if (isNanoS) {
18
- await waitFor(DeviceLabels.SEND_TO_ADDRESS);
19
- await pressBoth();
20
- } else {
21
- await pressUntilTextFound(DeviceLabels.SEND_TO_ADDRESS_2);
22
- await pressBoth();
23
- }
36
+ await pressRightButton();
37
+ await waitFor(DeviceLabels.SEND_TO_ADDRESS);
38
+ await pressBoth();
39
+ await pressUntilTextFound(DeviceLabels.SEND);
40
+ await pressBoth();
41
+ await waitFor(DeviceLabels.TRANSACTION_FEE);
42
+ await pressBoth();
43
+ await waitFor(DeviceLabels.CONFIRM);
44
+ await pressRightButton();
45
+ }
46
+
47
+ async function sendCardanoButtonDevice(tx: Transaction) {
48
+ await waitFor(DeviceLabels.NEW_ORDINARY);
49
+ await pressBoth();
50
+ await pressUntilTextFound(DeviceLabels.SEND_TO_ADDRESS_2);
51
+ await pressBoth();
24
52
  const events = await pressUntilTextFound(DeviceLabels.SEND);
25
- if (!isNanoS) {
26
- const isAmountCorrect = containsSubstringInEvent(tx.amount, events);
27
- expect(isAmountCorrect).toBeTruthy();
28
- }
53
+ validateTransactionData(tx, events);
29
54
  await pressBoth();
30
55
  await waitFor(DeviceLabels.TRANSACTION_FEE);
31
56
  await pressBoth();
32
57
  await waitFor(DeviceLabels.CONFIRM);
33
- if (isNanoS) {
34
- await pressRightButton();
35
- } else {
36
- await pressBoth();
37
- const isAddressCorrect = containsSubstringInEvent(tx.accountToCredit.address, events);
38
- expect(isAddressCorrect).toBeTruthy();
58
+ await pressBoth();
59
+ }
60
+
61
+ export async function sendCardano(tx: Transaction) {
62
+ const speculosModel = getSpeculosModel();
63
+ if (speculosModel === DeviceModelId.stax) {
64
+ return sendCardanoStax(tx);
39
65
  }
66
+ if (speculosModel === DeviceModelId.nanoS) {
67
+ return sendCardanoNanoS(tx);
68
+ }
69
+ return sendCardanoButtonDevice(tx);
40
70
  }
41
71
 
42
- export async function delegateCardano() {
43
- const commonSteps = [
44
- [DeviceLabels.NEW_ORDINARY, "both"],
72
+ const DELEGATE_STEPS_CONFIG = {
73
+ [DeviceModelId.stax]: [
74
+ [DeviceLabels.REVIEW_TRANSACTION, "swipe"],
75
+ [DeviceLabels.TAP_TO_CONTINUE, "tap"],
76
+ [DeviceLabels.REGISTER, "swipe"],
77
+ [DeviceLabels.TAP_TO_CONTINUE, "tap"],
78
+ [DeviceLabels.CONFIRM, "confirm"],
79
+ [DeviceLabels.DELEGATE_STAKE, "swipe"],
80
+ [DeviceLabels.TAP_TO_CONTINUE, "tap"],
81
+ [DeviceLabels.CONFIRM, "confirm"],
82
+ [DeviceLabels.HOLD_TO_SIGN, "hold"],
83
+ ] as const,
84
+ [DeviceModelId.nanoS]: [
85
+ [DeviceLabels.NEW_ORDINARY, "right"],
45
86
  [DeviceLabels.TRANSACTION_FEE, "both"],
46
87
  [DeviceLabels.REGISTER, "both"],
47
88
  [DeviceLabels.STAKE_KEY, "both"],
48
89
  [DeviceLabels.DEPOSIT, "both"],
49
- [DeviceLabels.CONFIRM, "both"],
90
+ [DeviceLabels.CONFIRM, "right"],
50
91
  [DeviceLabels.DELEGATE_STAKE, "both"],
51
92
  [DeviceLabels.STAKE_KEY, "both"],
52
- [DeviceLabels.CONFIRM, "both"],
53
- [DeviceLabels.CONFIRM, "both"],
54
- ] as const;
55
-
56
- const LNSSpecificSteps = [
57
- [DeviceLabels.NEW_ORDINARY, "right"],
93
+ [DeviceLabels.CONFIRM, "right"],
94
+ [DeviceLabels.CONFIRM, "right"],
95
+ ] as const,
96
+ default: [
97
+ [DeviceLabels.NEW_ORDINARY, "both"],
58
98
  [DeviceLabels.TRANSACTION_FEE, "both"],
59
99
  [DeviceLabels.REGISTER, "both"],
60
100
  [DeviceLabels.STAKE_KEY, "both"],
61
101
  [DeviceLabels.DEPOSIT, "both"],
62
- [DeviceLabels.CONFIRM, "right"],
102
+ [DeviceLabels.CONFIRM, "both"],
63
103
  [DeviceLabels.DELEGATE_STAKE, "both"],
64
104
  [DeviceLabels.STAKE_KEY, "both"],
65
- [DeviceLabels.CONFIRM, "right"],
66
- [DeviceLabels.CONFIRM, "right"],
67
- ] as const;
68
-
69
- const steps = process.env.SPECULOS_DEVICE === Device.LNS.name ? LNSSpecificSteps : commonSteps;
105
+ [DeviceLabels.CONFIRM, "both"],
106
+ [DeviceLabels.CONFIRM, "both"],
107
+ ] as const,
108
+ };
70
109
 
71
- for (const [label, action] of steps) {
72
- try {
73
- await waitFor(label);
74
- action === "both" ? await pressBoth() : await pressRightButton();
75
- } catch (error) {
76
- const message = error instanceof Error ? error.message : String(error);
77
- console.error(`Error while waiting for "${label}":`, message);
110
+ async function delegateStaxAction(label: DeviceLabels) {
111
+ const CONFIRM_BUTTON_COORDS = { x: 139, y: 532 };
112
+ await waitFor(label);
113
+ switch (label) {
114
+ case DeviceLabels.TAP_TO_CONTINUE:
115
+ await pressAndRelease(DeviceLabels.TAP_TO_CONTINUE);
116
+ break;
117
+ case DeviceLabels.CONFIRM:
118
+ await pressAndRelease(DeviceLabels.CONFIRM, CONFIRM_BUTTON_COORDS.x, CONFIRM_BUTTON_COORDS.y);
119
+ break;
120
+ case DeviceLabels.HOLD_TO_SIGN:
121
+ await longPressAndRelease(DeviceLabels.HOLD_TO_SIGN, 3);
78
122
  break;
123
+ default:
124
+ await swipeRight();
125
+ break;
126
+ }
127
+ }
128
+
129
+ async function delegateNanoAction(label: DeviceLabels, action: ActionType) {
130
+ await waitFor(label);
131
+ if (action === "both") {
132
+ await pressBoth();
133
+ } else {
134
+ await pressRightButton();
135
+ }
136
+ }
137
+
138
+ async function executeDelegateStep(
139
+ label: DeviceLabels,
140
+ action: ActionType,
141
+ speculosModel: DeviceModelId,
142
+ ) {
143
+ try {
144
+ if (speculosModel === DeviceModelId.stax) {
145
+ await delegateStaxAction(label);
146
+ } else {
147
+ await delegateNanoAction(label, action);
79
148
  }
149
+ } catch (error) {
150
+ const message = error instanceof Error ? error.message : String(error);
151
+ console.error(`Error while waiting for "${label}":`, message);
152
+ throw error;
153
+ }
154
+ }
155
+
156
+ export async function delegateCardano() {
157
+ const speculosModel = getSpeculosModel();
158
+ const steps =
159
+ speculosModel === DeviceModelId.stax
160
+ ? DELEGATE_STEPS_CONFIG[DeviceModelId.stax]
161
+ : speculosModel === DeviceModelId.nanoS
162
+ ? DELEGATE_STEPS_CONFIG[DeviceModelId.nanoS]
163
+ : DELEGATE_STEPS_CONFIG.default;
164
+
165
+ for (const [label, action] of steps) {
166
+ await executeDelegateStep(label, action, speculosModel);
80
167
  }
81
168
  }
@@ -1,10 +1,19 @@
1
- import { pressBoth, containsSubstringInEvent, getDelegateEvents } from "../speculos";
1
+ import { containsSubstringInEvent, getDelegateEvents, pressUntilTextFound } from "../speculos";
2
+ import { isTouchDevice } from "../speculosAppVersion";
2
3
  import { Delegate } from "../models/Delegate";
3
4
  import expect from "expect";
5
+ import { pressBoth } from "../deviceInteraction/ButtonDeviceSimulator";
6
+ import { longPressAndRelease } from "../deviceInteraction/TouchDeviceSimulator";
7
+ import { DeviceLabels } from "../enum/DeviceLabels";
4
8
 
5
9
  export async function delegateCelo(delegatingAccount: Delegate) {
6
10
  const events = await getDelegateEvents(delegatingAccount);
7
11
  const isAmountCorrect = containsSubstringInEvent(delegatingAccount.amount, events);
8
12
  expect(isAmountCorrect).toBeTruthy();
9
- await pressBoth();
13
+ if (isTouchDevice()) {
14
+ await pressUntilTextFound(DeviceLabels.HOLD_TO_SIGN);
15
+ await longPressAndRelease(DeviceLabels.HOLD_TO_SIGN, 3);
16
+ } else {
17
+ await pressBoth();
18
+ }
10
19
  }
@@ -1,27 +1,33 @@
1
1
  import expect from "expect";
2
2
  import { Delegate } from "../models/Delegate";
3
3
  import { Transaction } from "../models/Transaction";
4
- import {
5
- pressBoth,
6
- pressUntilTextFound,
7
- containsSubstringInEvent,
8
- getDelegateEvents,
9
- } from "../speculos";
4
+ import { containsSubstringInEvent, getDelegateEvents, getSendEvents } from "../speculos";
5
+ import { pressBoth } from "../deviceInteraction/ButtonDeviceSimulator";
10
6
  import { DeviceLabels } from "../enum/DeviceLabels";
7
+ import { isTouchDevice } from "../speculosAppVersion";
8
+ import { longPressAndRelease } from "../deviceInteraction/TouchDeviceSimulator";
11
9
 
12
10
  export async function delegateCosmos(delegatingAccount: Delegate) {
13
11
  const events = await getDelegateEvents(delegatingAccount);
14
12
  const isAmountCorrect = containsSubstringInEvent(delegatingAccount.amount, events);
15
13
  expect(isAmountCorrect).toBeTruthy();
16
- await pressBoth();
14
+ if (isTouchDevice()) {
15
+ await longPressAndRelease(DeviceLabels.HOLD_TO_SIGN, 3);
16
+ } else {
17
+ await pressBoth();
18
+ }
17
19
  }
18
20
 
19
21
  export async function sendCosmos(tx: Transaction) {
20
- const events = await pressUntilTextFound(DeviceLabels.CAPS_APPROVE);
22
+ const events = await getSendEvents(tx);
21
23
  const isAmountCorrect = containsSubstringInEvent(tx.amount, events);
22
24
  expect(isAmountCorrect).toBeTruthy();
23
25
  const isAddressCorrect = containsSubstringInEvent(tx.accountToCredit.address, events);
24
26
  expect(isAddressCorrect).toBeTruthy();
25
27
 
26
- await pressBoth();
28
+ if (isTouchDevice()) {
29
+ await longPressAndRelease(DeviceLabels.HOLD_TO_SIGN, 3);
30
+ } else {
31
+ await pressBoth();
32
+ }
27
33
  }
@@ -1,16 +1,14 @@
1
1
  import expect from "expect";
2
- import { NFTTransaction, Transaction } from "../models/Transaction";
3
- import { pressBoth, pressUntilTextFound, containsSubstringInEvent, waitFor } from "../speculos";
2
+ import { Transaction } from "../models/Transaction";
3
+ import { containsSubstringInEvent, pressUntilTextFound } from "../speculos";
4
4
  import { getSpeculosModel } from "../speculosAppVersion";
5
+ import { pressBoth } from "../deviceInteraction/ButtonDeviceSimulator";
6
+ import { longPressAndRelease } from "../deviceInteraction/TouchDeviceSimulator";
5
7
  import { DeviceLabels } from "../enum/DeviceLabels";
6
8
  import { Device } from "../enum/Device";
7
9
  import { DeviceModelId } from "@ledgerhq/types-devices";
8
10
 
9
- export async function sendEVM(tx: Transaction) {
10
- const events =
11
- getSpeculosModel() !== DeviceModelId.nanoS
12
- ? await pressUntilTextFound(DeviceLabels.SIGN_TRANSACTION)
13
- : await pressUntilTextFound(DeviceLabels.ACCEPT);
11
+ function validateTransactionData(tx: Transaction, events: string[]) {
14
12
  const isAmountCorrect = containsSubstringInEvent(tx.amount, events);
15
13
  expect(isAmountCorrect).toBeTruthy();
16
14
  if (tx.accountToCredit.ensName && process.env.SPECULOS_DEVICE !== Device.LNS.name) {
@@ -20,14 +18,33 @@ export async function sendEVM(tx: Transaction) {
20
18
  const isAddressCorrect = containsSubstringInEvent(tx.accountToCredit.address, events);
21
19
  expect(isAddressCorrect).toBeTruthy();
22
20
  }
21
+ }
23
22
 
23
+ async function sendEvmStax(tx: Transaction) {
24
+ const events = await pressUntilTextFound(DeviceLabels.HOLD_TO_SIGN);
25
+ validateTransactionData(tx, events);
26
+ await longPressAndRelease(DeviceLabels.HOLD_TO_SIGN, 3);
27
+ }
28
+
29
+ async function sendEvmButtonDevice(tx: Transaction) {
30
+ const events = await pressUntilTextFound(DeviceLabels.SIGN_TRANSACTION);
31
+ validateTransactionData(tx, events);
24
32
  await pressBoth();
25
33
  }
26
34
 
27
- export async function sendEvmNFT(tx: NFTTransaction) {
28
- await waitFor(DeviceLabels.REVIEW_OPERATION);
35
+ async function sendEvmNanoS(tx: Transaction) {
29
36
  const events = await pressUntilTextFound(DeviceLabels.ACCEPT);
30
- const isAddressCorrect = containsSubstringInEvent(tx.accountToCredit.address, events);
31
- expect(isAddressCorrect).toBeTruthy();
37
+ validateTransactionData(tx, events);
32
38
  await pressBoth();
33
39
  }
40
+
41
+ export async function sendEVM(tx: Transaction) {
42
+ const speculosModel = getSpeculosModel();
43
+ if (speculosModel === DeviceModelId.stax) {
44
+ return sendEvmStax(tx);
45
+ }
46
+ if (speculosModel === DeviceModelId.nanoS) {
47
+ return sendEvmNanoS(tx);
48
+ }
49
+ return sendEvmButtonDevice(tx);
50
+ }
@@ -1,5 +1,6 @@
1
- import { pressBoth, pressUntilTextFound } from "../speculos";
1
+ import { pressBoth } from "../deviceInteraction/ButtonDeviceSimulator";
2
2
  import { DeviceLabels } from "../enum/DeviceLabels";
3
+ import { pressUntilTextFound } from "../speculos";
3
4
 
4
5
  export async function sendHedera() {
5
6
  await pressUntilTextFound(DeviceLabels.APPROVE);
@@ -1,11 +1,19 @@
1
1
  import expect from "expect";
2
- import { pressBoth, pressUntilTextFound, waitFor, containsSubstringInEvent } from "../speculos";
2
+ import { waitFor, containsSubstringInEvent, pressUntilTextFound, getSendEvents } from "../speculos";
3
+ import { isTouchDevice } from "../speculosAppVersion";
4
+ import { pressBoth } from "../deviceInteraction/ButtonDeviceSimulator";
3
5
  import { DeviceLabels } from "../enum/DeviceLabels";
4
6
  import { Delegate } from "../models/Delegate";
7
+ import { longPressAndRelease } from "../deviceInteraction/TouchDeviceSimulator";
8
+ import { Transaction } from "../models/Transaction";
5
9
 
6
- export async function sendKaspa() {
7
- await pressUntilTextFound(DeviceLabels.APPROVE);
8
- await pressBoth();
10
+ export async function sendKaspa(tx: Transaction) {
11
+ await getSendEvents(tx);
12
+ if (isTouchDevice()) {
13
+ await longPressAndRelease(DeviceLabels.HOLD_TO_SIGN, 3);
14
+ } else {
15
+ await pressBoth();
16
+ }
9
17
  }
10
18
 
11
19
  export async function delegateKaspa(delegatingAccount: Delegate) {