@ledgerhq/live-common 31.0.0 → 31.1.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 (418) hide show
  1. package/lib/countervalues/api/api.d.ts.map +1 -1
  2. package/lib/countervalues/api/api.js +12 -18
  3. package/lib/countervalues/api/api.js.map +1 -1
  4. package/lib/countervalues/helpers.d.ts +2 -0
  5. package/lib/countervalues/helpers.d.ts.map +1 -1
  6. package/lib/countervalues/helpers.js +19 -5
  7. package/lib/countervalues/helpers.js.map +1 -1
  8. package/lib/countervalues/logic.d.ts.map +1 -1
  9. package/lib/countervalues/logic.integration.test.js.map +1 -1
  10. package/lib/countervalues/logic.js +1 -0
  11. package/lib/countervalues/logic.js.map +1 -1
  12. package/lib/countervalues/react.d.ts.map +1 -1
  13. package/lib/countervalues/react.js +9 -7
  14. package/lib/countervalues/react.js.map +1 -1
  15. package/lib/countervalues/react.test.d.ts +2 -0
  16. package/lib/countervalues/react.test.d.ts.map +1 -0
  17. package/lib/countervalues/react.test.js +107 -0
  18. package/lib/countervalues/react.test.js.map +1 -0
  19. package/lib/data/icons/react/euroc.d.ts +8 -0
  20. package/lib/data/icons/react/euroc.d.ts.map +1 -0
  21. package/lib/data/icons/react/euroc.js +36 -0
  22. package/lib/data/icons/react/euroc.js.map +1 -0
  23. package/lib/data/icons/react/index.d.ts +1 -0
  24. package/lib/data/icons/react/index.d.ts.map +1 -1
  25. package/lib/data/icons/react/index.js +9 -7
  26. package/lib/data/icons/react/index.js.map +1 -1
  27. package/lib/data/icons/reactNative/euroc.d.ts +8 -0
  28. package/lib/data/icons/reactNative/euroc.d.ts.map +1 -0
  29. package/lib/data/icons/reactNative/euroc.js +37 -0
  30. package/lib/data/icons/reactNative/euroc.js.map +1 -0
  31. package/lib/data/icons/reactNative/index.d.ts +1 -0
  32. package/lib/data/icons/reactNative/index.d.ts.map +1 -1
  33. package/lib/data/icons/reactNative/index.js +9 -7
  34. package/lib/data/icons/reactNative/index.js.map +1 -1
  35. package/lib/deviceSDK/actions/toggleOnboardingEarlyCheck.d.ts +32 -0
  36. package/lib/deviceSDK/actions/toggleOnboardingEarlyCheck.d.ts.map +1 -0
  37. package/lib/deviceSDK/actions/toggleOnboardingEarlyCheck.js +39 -0
  38. package/lib/deviceSDK/actions/toggleOnboardingEarlyCheck.js.map +1 -0
  39. package/lib/deviceSDK/commands/toggleOnboardingEarlyCheck.d.ts +27 -0
  40. package/lib/deviceSDK/commands/toggleOnboardingEarlyCheck.d.ts.map +1 -0
  41. package/lib/deviceSDK/commands/toggleOnboardingEarlyCheck.js +37 -0
  42. package/lib/deviceSDK/commands/toggleOnboardingEarlyCheck.js.map +1 -0
  43. package/lib/deviceSDK/commands/toggleOnboardingEarlyCheck.test.d.ts +2 -0
  44. package/lib/deviceSDK/commands/toggleOnboardingEarlyCheck.test.d.ts.map +1 -0
  45. package/lib/deviceSDK/commands/toggleOnboardingEarlyCheck.test.js +81 -0
  46. package/lib/deviceSDK/commands/toggleOnboardingEarlyCheck.test.js.map +1 -0
  47. package/lib/deviceSDK/hooks/useToggleOnboardingEarlyChecks.d.ts +33 -0
  48. package/lib/deviceSDK/hooks/useToggleOnboardingEarlyChecks.d.ts.map +1 -0
  49. package/lib/deviceSDK/hooks/useToggleOnboardingEarlyChecks.js +53 -0
  50. package/lib/deviceSDK/hooks/useToggleOnboardingEarlyChecks.js.map +1 -0
  51. package/lib/deviceSDK/hooks/useToggleOnboardingEarlyChecks.test.d.ts +2 -0
  52. package/lib/deviceSDK/hooks/useToggleOnboardingEarlyChecks.test.d.ts.map +1 -0
  53. package/lib/deviceSDK/hooks/useToggleOnboardingEarlyChecks.test.js +93 -0
  54. package/lib/deviceSDK/hooks/useToggleOnboardingEarlyChecks.test.js.map +1 -0
  55. package/lib/deviceSDK/tasks/core.js.map +1 -1
  56. package/lib/deviceSDK/tasks/toggleOnboardingEarlyCheck.d.ts +30 -0
  57. package/lib/deviceSDK/tasks/toggleOnboardingEarlyCheck.d.ts.map +1 -0
  58. package/lib/deviceSDK/tasks/toggleOnboardingEarlyCheck.js +64 -0
  59. package/lib/deviceSDK/tasks/toggleOnboardingEarlyCheck.js.map +1 -0
  60. package/lib/deviceSDK/tasks/toggleOnboardingEarlyCheck.test.d.ts +2 -0
  61. package/lib/deviceSDK/tasks/toggleOnboardingEarlyCheck.test.d.ts.map +1 -0
  62. package/lib/deviceSDK/tasks/toggleOnboardingEarlyCheck.test.js +100 -0
  63. package/lib/deviceSDK/tasks/toggleOnboardingEarlyCheck.test.js.map +1 -0
  64. package/lib/families/bitcoin/descriptor.d.ts.map +1 -1
  65. package/lib/families/bitcoin/descriptor.js.map +1 -1
  66. package/lib/families/bitcoin/satstack.d.ts +1 -0
  67. package/lib/families/bitcoin/satstack.d.ts.map +1 -1
  68. package/lib/families/bitcoin/satstack.js.map +1 -1
  69. package/lib/families/bitcoin/walletApiAdapter.js +4 -4
  70. package/lib/families/bitcoin/walletApiAdapter.js.map +1 -1
  71. package/lib/families/bitcoin/walletApiAdapter.test.js +9 -2
  72. package/lib/families/bitcoin/walletApiAdapter.test.js.map +1 -1
  73. package/lib/families/cosmos/api/Cosmos.d.ts +2 -0
  74. package/lib/families/cosmos/api/Cosmos.d.ts.map +1 -1
  75. package/lib/families/cosmos/api/Cosmos.js +34 -10
  76. package/lib/families/cosmos/api/Cosmos.js.map +1 -1
  77. package/lib/families/cosmos/helpers.d.ts +2 -8
  78. package/lib/families/cosmos/helpers.d.ts.map +1 -1
  79. package/lib/families/cosmos/helpers.js.map +1 -1
  80. package/lib/families/cosmos/helpers.unit.test.js +8 -8
  81. package/lib/families/cosmos/js-synchronisation.d.ts.map +1 -1
  82. package/lib/families/cosmos/js-synchronisation.js +40 -22
  83. package/lib/families/cosmos/js-synchronisation.js.map +1 -1
  84. package/lib/families/cosmos/js-synchronisation.unit.test.d.ts +2 -0
  85. package/lib/families/cosmos/js-synchronisation.unit.test.d.ts.map +1 -0
  86. package/lib/families/cosmos/js-synchronisation.unit.test.js +309 -0
  87. package/lib/families/cosmos/js-synchronisation.unit.test.js.map +1 -0
  88. package/lib/families/cosmos/react.d.ts +1 -1
  89. package/lib/families/cosmos/react.d.ts.map +1 -1
  90. package/lib/families/cosmos/react.js +7 -3
  91. package/lib/families/cosmos/react.js.map +1 -1
  92. package/lib/families/cosmos/types.d.ts +9 -8
  93. package/lib/families/cosmos/types.d.ts.map +1 -1
  94. package/lib/families/ethereum/walletApiAdapter.d.ts +3 -1
  95. package/lib/families/ethereum/walletApiAdapter.d.ts.map +1 -1
  96. package/lib/families/ethereum/walletApiAdapter.js +24 -6
  97. package/lib/families/ethereum/walletApiAdapter.js.map +1 -1
  98. package/lib/families/ethereum/walletApiAdapter.test.js +10 -3
  99. package/lib/families/ethereum/walletApiAdapter.test.js.map +1 -1
  100. package/lib/families/near/api/archive-node-sdk.d.ts.map +1 -1
  101. package/lib/families/near/api/archive-node-sdk.js +1 -2
  102. package/lib/families/near/api/archive-node-sdk.js.map +1 -1
  103. package/lib/families/polkadot/walletApiAdapter.js +3 -3
  104. package/lib/families/polkadot/walletApiAdapter.js.map +1 -1
  105. package/lib/families/polkadot/walletApiAdapter.test.js +10 -3
  106. package/lib/families/polkadot/walletApiAdapter.test.js.map +1 -1
  107. package/lib/families/ripple/walletApiAdapter.d.ts.map +1 -1
  108. package/lib/families/ripple/walletApiAdapter.js +2 -5
  109. package/lib/families/ripple/walletApiAdapter.js.map +1 -1
  110. package/lib/families/ripple/walletApiAdapter.test.js +10 -3
  111. package/lib/families/ripple/walletApiAdapter.test.js.map +1 -1
  112. package/lib/families/solana/api/chain/account/stake.d.ts +0 -1
  113. package/lib/families/solana/api/chain/account/stake.d.ts.map +1 -1
  114. package/lib/families/solana/api/chain/account/token.d.ts +0 -1
  115. package/lib/families/solana/api/chain/account/token.d.ts.map +1 -1
  116. package/lib/families/solana/api/chain/account/vote.d.ts +0 -1
  117. package/lib/families/solana/api/chain/account/vote.d.ts.map +1 -1
  118. package/lib/families/solana/api/chain/index.d.ts +2 -2
  119. package/lib/families/solana/api/chain/index.d.ts.map +1 -1
  120. package/lib/families/solana/api/chain/index.js +5 -1
  121. package/lib/families/solana/api/chain/index.js.map +1 -1
  122. package/lib/families/solana/api/chain/instruction/associated-token-account/types.d.ts +0 -1
  123. package/lib/families/solana/api/chain/instruction/associated-token-account/types.d.ts.map +1 -1
  124. package/lib/families/solana/api/chain/instruction/stake/types.d.ts +0 -1
  125. package/lib/families/solana/api/chain/instruction/stake/types.d.ts.map +1 -1
  126. package/lib/families/solana/api/chain/instruction/system/types.d.ts +0 -1
  127. package/lib/families/solana/api/chain/instruction/system/types.d.ts.map +1 -1
  128. package/lib/families/solana/api/chain/instruction/token/types.d.ts +0 -1
  129. package/lib/families/solana/api/chain/instruction/token/types.d.ts.map +1 -1
  130. package/lib/families/solana/js-buildTransaction.d.ts +1 -1
  131. package/lib/families/solana/js-buildTransaction.d.ts.map +1 -1
  132. package/lib/families/solana/js-buildTransaction.js +4 -3
  133. package/lib/families/solana/js-buildTransaction.js.map +1 -1
  134. package/lib/families/solana/js-signOperation.js +2 -2
  135. package/lib/families/solana/js-signOperation.js.map +1 -1
  136. package/lib/families/solana/tx-fees.js +4 -4
  137. package/lib/families/solana/tx-fees.js.map +1 -1
  138. package/lib/generated/walletApiAdapter.d.ts +1 -1
  139. package/lib/hw/actions/implementations.d.ts.map +1 -1
  140. package/lib/hw/actions/implementations.js +16 -2
  141. package/lib/hw/actions/implementations.js.map +1 -1
  142. package/lib/hw/extractOnboardingState.d.ts +2 -1
  143. package/lib/hw/extractOnboardingState.d.ts.map +1 -1
  144. package/lib/hw/extractOnboardingState.js +3 -1
  145. package/lib/hw/extractOnboardingState.js.map +1 -1
  146. package/lib/hw/extractOnboardingState.test.js +10 -0
  147. package/lib/hw/extractOnboardingState.test.js.map +1 -1
  148. package/lib/hw/staxRemoveImage.d.ts.map +1 -1
  149. package/lib/hw/staxRemoveImage.js +4 -0
  150. package/lib/hw/staxRemoveImage.js.map +1 -1
  151. package/lib/hw/staxRemoveImage.test.js +5 -0
  152. package/lib/hw/staxRemoveImage.test.js.map +1 -1
  153. package/lib/mock/fixtures/cryptoCurrencies.d.ts.map +1 -1
  154. package/lib/mock/fixtures/cryptoCurrencies.js +0 -1
  155. package/lib/mock/fixtures/cryptoCurrencies.js.map +1 -1
  156. package/lib/platform/logic.d.ts +2 -2
  157. package/lib/platform/logic.d.ts.map +1 -1
  158. package/lib/platform/logic.js +2 -1
  159. package/lib/platform/logic.js.map +1 -1
  160. package/lib/wallet-api/converters.d.ts.map +1 -1
  161. package/lib/wallet-api/converters.js +7 -3
  162. package/lib/wallet-api/converters.js.map +1 -1
  163. package/lib/wallet-api/converters.test.d.ts.map +1 -1
  164. package/lib/wallet-api/converters.test.js +3 -2
  165. package/lib/wallet-api/converters.test.js.map +1 -1
  166. package/lib/wallet-api/helpers.d.ts.map +1 -1
  167. package/lib/wallet-api/helpers.js +1 -1
  168. package/lib/wallet-api/helpers.js.map +1 -1
  169. package/lib/wallet-api/logic.d.ts +1 -1
  170. package/lib/wallet-api/logic.d.ts.map +1 -1
  171. package/lib/wallet-api/logic.js +12 -3
  172. package/lib/wallet-api/logic.js.map +1 -1
  173. package/lib/wallet-api/react.js +1 -1
  174. package/lib/wallet-api/react.js.map +1 -1
  175. package/lib/wallet-api/types.d.ts +11 -3
  176. package/lib/wallet-api/types.d.ts.map +1 -1
  177. package/lib-es/countervalues/api/api.d.ts.map +1 -1
  178. package/lib-es/countervalues/api/api.js +13 -19
  179. package/lib-es/countervalues/api/api.js.map +1 -1
  180. package/lib-es/countervalues/helpers.d.ts +2 -0
  181. package/lib-es/countervalues/helpers.d.ts.map +1 -1
  182. package/lib-es/countervalues/helpers.js +16 -4
  183. package/lib-es/countervalues/helpers.js.map +1 -1
  184. package/lib-es/countervalues/logic.d.ts.map +1 -1
  185. package/lib-es/countervalues/logic.integration.test.js.map +1 -1
  186. package/lib-es/countervalues/logic.js +1 -0
  187. package/lib-es/countervalues/logic.js.map +1 -1
  188. package/lib-es/countervalues/react.d.ts.map +1 -1
  189. package/lib-es/countervalues/react.js +10 -8
  190. package/lib-es/countervalues/react.js.map +1 -1
  191. package/lib-es/countervalues/react.test.d.ts +2 -0
  192. package/lib-es/countervalues/react.test.d.ts.map +1 -0
  193. package/lib-es/countervalues/react.test.js +105 -0
  194. package/lib-es/countervalues/react.test.js.map +1 -0
  195. package/lib-es/data/icons/react/euroc.d.ts +8 -0
  196. package/lib-es/data/icons/react/euroc.d.ts.map +1 -0
  197. package/lib-es/data/icons/react/euroc.js +11 -0
  198. package/lib-es/data/icons/react/euroc.js.map +1 -0
  199. package/lib-es/data/icons/react/index.d.ts +1 -0
  200. package/lib-es/data/icons/react/index.d.ts.map +1 -1
  201. package/lib-es/data/icons/react/index.js +1 -0
  202. package/lib-es/data/icons/react/index.js.map +1 -1
  203. package/lib-es/data/icons/reactNative/euroc.d.ts +8 -0
  204. package/lib-es/data/icons/reactNative/euroc.d.ts.map +1 -0
  205. package/lib-es/data/icons/reactNative/euroc.js +12 -0
  206. package/lib-es/data/icons/reactNative/euroc.js.map +1 -0
  207. package/lib-es/data/icons/reactNative/index.d.ts +1 -0
  208. package/lib-es/data/icons/reactNative/index.d.ts.map +1 -1
  209. package/lib-es/data/icons/reactNative/index.js +1 -0
  210. package/lib-es/data/icons/reactNative/index.js.map +1 -1
  211. package/lib-es/deviceSDK/actions/toggleOnboardingEarlyCheck.d.ts +32 -0
  212. package/lib-es/deviceSDK/actions/toggleOnboardingEarlyCheck.d.ts.map +1 -0
  213. package/lib-es/deviceSDK/actions/toggleOnboardingEarlyCheck.js +35 -0
  214. package/lib-es/deviceSDK/actions/toggleOnboardingEarlyCheck.js.map +1 -0
  215. package/lib-es/deviceSDK/commands/toggleOnboardingEarlyCheck.d.ts +27 -0
  216. package/lib-es/deviceSDK/commands/toggleOnboardingEarlyCheck.d.ts.map +1 -0
  217. package/lib-es/deviceSDK/commands/toggleOnboardingEarlyCheck.js +33 -0
  218. package/lib-es/deviceSDK/commands/toggleOnboardingEarlyCheck.js.map +1 -0
  219. package/lib-es/deviceSDK/commands/toggleOnboardingEarlyCheck.test.d.ts +2 -0
  220. package/lib-es/deviceSDK/commands/toggleOnboardingEarlyCheck.test.d.ts.map +1 -0
  221. package/lib-es/deviceSDK/commands/toggleOnboardingEarlyCheck.test.js +79 -0
  222. package/lib-es/deviceSDK/commands/toggleOnboardingEarlyCheck.test.js.map +1 -0
  223. package/lib-es/deviceSDK/hooks/useToggleOnboardingEarlyChecks.d.ts +33 -0
  224. package/lib-es/deviceSDK/hooks/useToggleOnboardingEarlyChecks.d.ts.map +1 -0
  225. package/lib-es/deviceSDK/hooks/useToggleOnboardingEarlyChecks.js +49 -0
  226. package/lib-es/deviceSDK/hooks/useToggleOnboardingEarlyChecks.js.map +1 -0
  227. package/lib-es/deviceSDK/hooks/useToggleOnboardingEarlyChecks.test.d.ts +2 -0
  228. package/lib-es/deviceSDK/hooks/useToggleOnboardingEarlyChecks.test.d.ts.map +1 -0
  229. package/lib-es/deviceSDK/hooks/useToggleOnboardingEarlyChecks.test.js +91 -0
  230. package/lib-es/deviceSDK/hooks/useToggleOnboardingEarlyChecks.test.js.map +1 -0
  231. package/lib-es/deviceSDK/tasks/core.js.map +1 -1
  232. package/lib-es/deviceSDK/tasks/toggleOnboardingEarlyCheck.d.ts +30 -0
  233. package/lib-es/deviceSDK/tasks/toggleOnboardingEarlyCheck.d.ts.map +1 -0
  234. package/lib-es/deviceSDK/tasks/toggleOnboardingEarlyCheck.js +60 -0
  235. package/lib-es/deviceSDK/tasks/toggleOnboardingEarlyCheck.js.map +1 -0
  236. package/lib-es/deviceSDK/tasks/toggleOnboardingEarlyCheck.test.d.ts +2 -0
  237. package/lib-es/deviceSDK/tasks/toggleOnboardingEarlyCheck.test.d.ts.map +1 -0
  238. package/lib-es/deviceSDK/tasks/toggleOnboardingEarlyCheck.test.js +98 -0
  239. package/lib-es/deviceSDK/tasks/toggleOnboardingEarlyCheck.test.js.map +1 -0
  240. package/lib-es/families/bitcoin/descriptor.d.ts.map +1 -1
  241. package/lib-es/families/bitcoin/descriptor.js.map +1 -1
  242. package/lib-es/families/bitcoin/satstack.d.ts +1 -0
  243. package/lib-es/families/bitcoin/satstack.d.ts.map +1 -1
  244. package/lib-es/families/bitcoin/satstack.js.map +1 -1
  245. package/lib-es/families/bitcoin/walletApiAdapter.js +4 -4
  246. package/lib-es/families/bitcoin/walletApiAdapter.js.map +1 -1
  247. package/lib-es/families/bitcoin/walletApiAdapter.test.js +9 -2
  248. package/lib-es/families/bitcoin/walletApiAdapter.test.js.map +1 -1
  249. package/lib-es/families/cosmos/api/Cosmos.d.ts +2 -0
  250. package/lib-es/families/cosmos/api/Cosmos.d.ts.map +1 -1
  251. package/lib-es/families/cosmos/api/Cosmos.js +34 -10
  252. package/lib-es/families/cosmos/api/Cosmos.js.map +1 -1
  253. package/lib-es/families/cosmos/helpers.d.ts +2 -8
  254. package/lib-es/families/cosmos/helpers.d.ts.map +1 -1
  255. package/lib-es/families/cosmos/helpers.js.map +1 -1
  256. package/lib-es/families/cosmos/helpers.unit.test.js +8 -8
  257. package/lib-es/families/cosmos/js-synchronisation.d.ts.map +1 -1
  258. package/lib-es/families/cosmos/js-synchronisation.js +40 -22
  259. package/lib-es/families/cosmos/js-synchronisation.js.map +1 -1
  260. package/lib-es/families/cosmos/js-synchronisation.unit.test.d.ts +2 -0
  261. package/lib-es/families/cosmos/js-synchronisation.unit.test.d.ts.map +1 -0
  262. package/lib-es/families/cosmos/js-synchronisation.unit.test.js +281 -0
  263. package/lib-es/families/cosmos/js-synchronisation.unit.test.js.map +1 -0
  264. package/lib-es/families/cosmos/react.d.ts +1 -1
  265. package/lib-es/families/cosmos/react.d.ts.map +1 -1
  266. package/lib-es/families/cosmos/react.js +7 -3
  267. package/lib-es/families/cosmos/react.js.map +1 -1
  268. package/lib-es/families/cosmos/types.d.ts +9 -8
  269. package/lib-es/families/cosmos/types.d.ts.map +1 -1
  270. package/lib-es/families/ethereum/walletApiAdapter.d.ts +3 -1
  271. package/lib-es/families/ethereum/walletApiAdapter.d.ts.map +1 -1
  272. package/lib-es/families/ethereum/walletApiAdapter.js +24 -6
  273. package/lib-es/families/ethereum/walletApiAdapter.js.map +1 -1
  274. package/lib-es/families/ethereum/walletApiAdapter.test.js +10 -3
  275. package/lib-es/families/ethereum/walletApiAdapter.test.js.map +1 -1
  276. package/lib-es/families/near/api/archive-node-sdk.d.ts.map +1 -1
  277. package/lib-es/families/near/api/archive-node-sdk.js +1 -2
  278. package/lib-es/families/near/api/archive-node-sdk.js.map +1 -1
  279. package/lib-es/families/polkadot/walletApiAdapter.js +3 -3
  280. package/lib-es/families/polkadot/walletApiAdapter.js.map +1 -1
  281. package/lib-es/families/polkadot/walletApiAdapter.test.js +10 -3
  282. package/lib-es/families/polkadot/walletApiAdapter.test.js.map +1 -1
  283. package/lib-es/families/ripple/walletApiAdapter.d.ts.map +1 -1
  284. package/lib-es/families/ripple/walletApiAdapter.js +2 -5
  285. package/lib-es/families/ripple/walletApiAdapter.js.map +1 -1
  286. package/lib-es/families/ripple/walletApiAdapter.test.js +10 -3
  287. package/lib-es/families/ripple/walletApiAdapter.test.js.map +1 -1
  288. package/lib-es/families/solana/api/chain/account/stake.d.ts +0 -1
  289. package/lib-es/families/solana/api/chain/account/stake.d.ts.map +1 -1
  290. package/lib-es/families/solana/api/chain/account/token.d.ts +0 -1
  291. package/lib-es/families/solana/api/chain/account/token.d.ts.map +1 -1
  292. package/lib-es/families/solana/api/chain/account/vote.d.ts +0 -1
  293. package/lib-es/families/solana/api/chain/account/vote.d.ts.map +1 -1
  294. package/lib-es/families/solana/api/chain/index.d.ts +2 -2
  295. package/lib-es/families/solana/api/chain/index.d.ts.map +1 -1
  296. package/lib-es/families/solana/api/chain/index.js +5 -1
  297. package/lib-es/families/solana/api/chain/index.js.map +1 -1
  298. package/lib-es/families/solana/api/chain/instruction/associated-token-account/types.d.ts +0 -1
  299. package/lib-es/families/solana/api/chain/instruction/associated-token-account/types.d.ts.map +1 -1
  300. package/lib-es/families/solana/api/chain/instruction/stake/types.d.ts +0 -1
  301. package/lib-es/families/solana/api/chain/instruction/stake/types.d.ts.map +1 -1
  302. package/lib-es/families/solana/api/chain/instruction/system/types.d.ts +0 -1
  303. package/lib-es/families/solana/api/chain/instruction/system/types.d.ts.map +1 -1
  304. package/lib-es/families/solana/api/chain/instruction/token/types.d.ts +0 -1
  305. package/lib-es/families/solana/api/chain/instruction/token/types.d.ts.map +1 -1
  306. package/lib-es/families/solana/js-buildTransaction.d.ts +1 -1
  307. package/lib-es/families/solana/js-buildTransaction.d.ts.map +1 -1
  308. package/lib-es/families/solana/js-buildTransaction.js +5 -4
  309. package/lib-es/families/solana/js-buildTransaction.js.map +1 -1
  310. package/lib-es/families/solana/js-signOperation.js +2 -2
  311. package/lib-es/families/solana/js-signOperation.js.map +1 -1
  312. package/lib-es/families/solana/tx-fees.js +4 -4
  313. package/lib-es/families/solana/tx-fees.js.map +1 -1
  314. package/lib-es/generated/walletApiAdapter.d.ts +1 -1
  315. package/lib-es/hw/actions/implementations.d.ts.map +1 -1
  316. package/lib-es/hw/actions/implementations.js +18 -4
  317. package/lib-es/hw/actions/implementations.js.map +1 -1
  318. package/lib-es/hw/extractOnboardingState.d.ts +2 -1
  319. package/lib-es/hw/extractOnboardingState.d.ts.map +1 -1
  320. package/lib-es/hw/extractOnboardingState.js +3 -1
  321. package/lib-es/hw/extractOnboardingState.js.map +1 -1
  322. package/lib-es/hw/extractOnboardingState.test.js +10 -0
  323. package/lib-es/hw/extractOnboardingState.test.js.map +1 -1
  324. package/lib-es/hw/staxRemoveImage.d.ts.map +1 -1
  325. package/lib-es/hw/staxRemoveImage.js +4 -0
  326. package/lib-es/hw/staxRemoveImage.js.map +1 -1
  327. package/lib-es/hw/staxRemoveImage.test.js +5 -0
  328. package/lib-es/hw/staxRemoveImage.test.js.map +1 -1
  329. package/lib-es/mock/fixtures/cryptoCurrencies.d.ts.map +1 -1
  330. package/lib-es/mock/fixtures/cryptoCurrencies.js +0 -1
  331. package/lib-es/mock/fixtures/cryptoCurrencies.js.map +1 -1
  332. package/lib-es/platform/logic.d.ts +2 -2
  333. package/lib-es/platform/logic.d.ts.map +1 -1
  334. package/lib-es/platform/logic.js +2 -1
  335. package/lib-es/platform/logic.js.map +1 -1
  336. package/lib-es/wallet-api/converters.d.ts.map +1 -1
  337. package/lib-es/wallet-api/converters.js +7 -3
  338. package/lib-es/wallet-api/converters.js.map +1 -1
  339. package/lib-es/wallet-api/converters.test.d.ts.map +1 -1
  340. package/lib-es/wallet-api/converters.test.js +3 -2
  341. package/lib-es/wallet-api/converters.test.js.map +1 -1
  342. package/lib-es/wallet-api/helpers.d.ts.map +1 -1
  343. package/lib-es/wallet-api/helpers.js +1 -1
  344. package/lib-es/wallet-api/helpers.js.map +1 -1
  345. package/lib-es/wallet-api/logic.d.ts +1 -1
  346. package/lib-es/wallet-api/logic.d.ts.map +1 -1
  347. package/lib-es/wallet-api/logic.js +12 -3
  348. package/lib-es/wallet-api/logic.js.map +1 -1
  349. package/lib-es/wallet-api/react.js +1 -1
  350. package/lib-es/wallet-api/react.js.map +1 -1
  351. package/lib-es/wallet-api/types.d.ts +11 -3
  352. package/lib-es/wallet-api/types.d.ts.map +1 -1
  353. package/package.json +14 -14
  354. package/src/countervalues/api/api.ts +25 -23
  355. package/src/countervalues/helpers.ts +21 -3
  356. package/src/countervalues/logic.integration.test.ts +1 -0
  357. package/src/countervalues/logic.ts +1 -0
  358. package/src/countervalues/react.test.ts +120 -0
  359. package/src/countervalues/react.tsx +10 -13
  360. package/src/currencies/__snapshots__/sortByMarketcap.test.ts.snap +44 -4
  361. package/src/data/icons/react/euroc.tsx +12 -0
  362. package/src/data/icons/react/index.tsx +1 -0
  363. package/src/data/icons/reactNative/euroc.tsx +13 -0
  364. package/src/data/icons/reactNative/index.tsx +1 -0
  365. package/src/data/icons/svg/EUROC.svg +5 -0
  366. package/src/deviceSDK/actions/toggleOnboardingEarlyCheck.ts +86 -0
  367. package/src/deviceSDK/commands/toggleOnboardingEarlyCheck.test.ts +85 -0
  368. package/src/deviceSDK/commands/toggleOnboardingEarlyCheck.ts +42 -0
  369. package/src/deviceSDK/hooks/useToggleOnboardingEarlyChecks.test.ts +125 -0
  370. package/src/deviceSDK/hooks/useToggleOnboardingEarlyChecks.ts +71 -0
  371. package/src/deviceSDK/tasks/core.ts +1 -1
  372. package/src/deviceSDK/tasks/toggleOnboardingEarlyCheck.test.ts +111 -0
  373. package/src/deviceSDK/tasks/toggleOnboardingEarlyCheck.ts +92 -0
  374. package/src/families/bitcoin/descriptor.ts +5 -2
  375. package/src/families/bitcoin/satstack.ts +1 -0
  376. package/src/families/bitcoin/walletApiAdapter.test.ts +11 -2
  377. package/src/families/bitcoin/walletApiAdapter.ts +4 -4
  378. package/src/families/cosmos/__snapshots__/bridge.integration.test.ts.snap +664 -19
  379. package/src/families/cosmos/api/Cosmos.ts +34 -6
  380. package/src/families/cosmos/helpers.ts +2 -5
  381. package/src/families/cosmos/helpers.unit.test.ts +8 -8
  382. package/src/families/cosmos/js-synchronisation.ts +74 -27
  383. package/src/families/cosmos/js-synchronisation.unit.test.ts +339 -0
  384. package/src/families/cosmos/react.ts +8 -6
  385. package/src/families/cosmos/types.ts +6 -4
  386. package/src/families/ethereum/walletApiAdapter.test.ts +12 -3
  387. package/src/families/ethereum/walletApiAdapter.ts +44 -13
  388. package/src/families/near/api/archive-node-sdk.ts +2 -3
  389. package/src/families/polkadot/walletApiAdapter.test.ts +13 -4
  390. package/src/families/polkadot/walletApiAdapter.ts +3 -3
  391. package/src/families/ripple/walletApiAdapter.test.ts +12 -3
  392. package/src/families/ripple/walletApiAdapter.ts +2 -10
  393. package/src/families/solana/api/chain/index.ts +8 -4
  394. package/src/families/solana/js-buildTransaction.ts +6 -4
  395. package/src/families/solana/js-signOperation.ts +2 -2
  396. package/src/families/solana/tx-fees.ts +6 -6
  397. package/src/hw/actions/implementations.ts +20 -0
  398. package/src/hw/extractOnboardingState.test.ts +15 -0
  399. package/src/hw/extractOnboardingState.ts +3 -1
  400. package/src/hw/staxRemoveImage.test.ts +10 -0
  401. package/src/hw/staxRemoveImage.ts +4 -0
  402. package/src/mock/fixtures/cryptoCurrencies.ts +0 -1
  403. package/src/platform/logic.ts +5 -3
  404. package/src/wallet-api/converters.test.ts +5 -2
  405. package/src/wallet-api/converters.ts +8 -3
  406. package/src/wallet-api/helpers.ts +2 -1
  407. package/src/wallet-api/logic.ts +15 -4
  408. package/src/wallet-api/react.ts +1 -1
  409. package/src/wallet-api/types.ts +19 -3
  410. package/lib/countervalues/api/api.legacy.d.ts +0 -4
  411. package/lib/countervalues/api/api.legacy.d.ts.map +0 -1
  412. package/lib/countervalues/api/api.legacy.js +0 -96
  413. package/lib/countervalues/api/api.legacy.js.map +0 -1
  414. package/lib-es/countervalues/api/api.legacy.d.ts +0 -4
  415. package/lib-es/countervalues/api/api.legacy.d.ts.map +0 -1
  416. package/lib-es/countervalues/api/api.legacy.js +0 -91
  417. package/lib-es/countervalues/api/api.legacy.js.map +0 -1
  418. package/src/countervalues/api/api.legacy.ts +0 -91
@@ -1,10 +1,13 @@
1
- import eth from "./walletApiAdapter";
2
1
  import { EthereumTransaction as WalletAPITransaction } from "@ledgerhq/wallet-api-core";
2
+ import { Account } from "@ledgerhq/types-live";
3
3
  import BigNumber from "bignumber.js";
4
+ import eth from "./walletApiAdapter";
4
5
  import { Transaction } from "./types";
5
6
 
6
7
  describe("getPlatformTransactionSignFlowInfos", () => {
7
8
  describe("should properly get infos for ETH platform tx", () => {
9
+ const dummyAccount = { currency: { family: "ethereum" } } as Account;
10
+
8
11
  test("without fees provided", () => {
9
12
  const ethPlatformTx: WalletAPITransaction = {
10
13
  family: "ethereum",
@@ -19,7 +22,10 @@ describe("getPlatformTransactionSignFlowInfos", () => {
19
22
  };
20
23
 
21
24
  const { canEditFees, hasFeesProvided, liveTx } =
22
- eth.getWalletAPITransactionSignFlowInfos(ethPlatformTx);
25
+ eth.getWalletAPITransactionSignFlowInfos({
26
+ tx: ethPlatformTx,
27
+ account: dummyAccount,
28
+ });
23
29
 
24
30
  expect(canEditFees).toBe(true);
25
31
 
@@ -47,7 +53,10 @@ describe("getPlatformTransactionSignFlowInfos", () => {
47
53
  };
48
54
 
49
55
  const { canEditFees, hasFeesProvided, liveTx } =
50
- eth.getWalletAPITransactionSignFlowInfos(ethPlatformTx);
56
+ eth.getWalletAPITransactionSignFlowInfos({
57
+ tx: ethPlatformTx,
58
+ account: dummyAccount,
59
+ });
51
60
 
52
61
  expect(canEditFees).toBe(true);
53
62
 
@@ -1,31 +1,42 @@
1
1
  import { EthereumTransaction as WalletAPIEthereumTransaction } from "@ledgerhq/wallet-api-core";
2
+ import { Account } from "@ledgerhq/types-live";
3
+ import { Transaction as EvmTx } from "@ledgerhq/coin-evm/types";
2
4
  import {
3
5
  AreFeesProvided,
4
6
  ConvertToLiveTransaction,
5
7
  GetWalletAPITransactionSignFlowInfos,
6
8
  } from "../../wallet-api/types";
7
- import { Transaction } from "./types";
9
+ import { Transaction as EthTx } from "./types";
10
+ import { isTokenAccount } from "../../account";
8
11
 
9
12
  const CAN_EDIT_FEES = true;
10
13
 
14
+ type Transaction = EthTx | EvmTx;
15
+
11
16
  const areFeesProvided: AreFeesProvided<WalletAPIEthereumTransaction> = (tx) =>
12
- !!(tx.gasLimit || tx.gasPrice);
17
+ !!(
18
+ (tx.gasLimit && tx.gasPrice) ||
19
+ (tx.gasLimit && tx.maxFeePerGas && tx.maxPriorityFeePerGas)
20
+ );
13
21
 
14
22
  const convertToLiveTransaction: ConvertToLiveTransaction<
15
23
  WalletAPIEthereumTransaction,
16
24
  Transaction
17
- > = (tx) => {
25
+ > = ({ tx, account, parentAccount }) => {
18
26
  const hasFeesProvided = areFeesProvided(tx);
19
27
 
28
+ const accountFamily = isTokenAccount(account)
29
+ ? (parentAccount as Account).currency.family
30
+ : account.currency.family;
20
31
  const { gasLimit, ...restTx } = tx;
21
32
 
22
- const liveTx: Partial<Transaction> = {
23
- ...restTx,
24
- amount: tx.amount,
25
- recipient: tx.recipient,
26
- gasPrice: tx.gasPrice,
27
- userGasLimit: gasLimit,
28
- };
33
+ const liveTx: Partial<Transaction> =
34
+ accountFamily === "ethereum"
35
+ ? {
36
+ ...restTx,
37
+ userGasLimit: gasLimit,
38
+ }
39
+ : convertToEvmLiveTransaction(tx);
29
40
 
30
41
  return hasFeesProvided ? { ...liveTx, feesStrategy: "custom" } : liveTx;
31
42
  };
@@ -33,12 +44,32 @@ const convertToLiveTransaction: ConvertToLiveTransaction<
33
44
  const getWalletAPITransactionSignFlowInfos: GetWalletAPITransactionSignFlowInfos<
34
45
  WalletAPIEthereumTransaction,
35
46
  Transaction
36
- > = (tx) => {
47
+ > = (params) => {
37
48
  return {
38
49
  canEditFees: CAN_EDIT_FEES,
39
- liveTx: convertToLiveTransaction(tx),
40
- hasFeesProvided: areFeesProvided(tx),
50
+ liveTx: convertToLiveTransaction(params),
51
+ hasFeesProvided: areFeesProvided(params.tx),
41
52
  };
42
53
  };
43
54
 
44
55
  export default { getWalletAPITransactionSignFlowInfos };
56
+
57
+ function convertToEvmLiveTransaction(
58
+ tx: WalletAPIEthereumTransaction
59
+ ): Partial<EvmTx> {
60
+ const params = {
61
+ family: "evm" as const,
62
+ nonce: tx.nonce,
63
+ amount: tx.amount,
64
+ recipient: tx.recipient,
65
+ data: tx.data,
66
+ gasLimit: tx.gasLimit,
67
+ };
68
+
69
+ return tx.maxPriorityFeePerGas || tx.maxFeePerGas
70
+ ? {
71
+ ...params,
72
+ type: 2,
73
+ }
74
+ : { ...params, type: 0 };
75
+ }
@@ -294,9 +294,8 @@ export const getCommission = async (
294
294
  if (Array.isArray(result) && result.length) {
295
295
  const parsedResult = JSON.parse(Buffer.from(result).toString());
296
296
 
297
- return (
298
- Math.round((parsedResult.numerator / parsedResult.denominator) * 100) /
299
- 100
297
+ return Math.round(
298
+ (parsedResult.numerator / parsedResult.denominator) * 100
300
299
  );
301
300
  }
302
301
 
@@ -1,10 +1,13 @@
1
- import dot from "./walletApiAdapter";
1
+ import { Account } from "@ledgerhq/types-live";
2
2
  import { PolkadotTransaction as PlatformTransaction } from "@ledgerhq/wallet-api-core";
3
- import BigNumber from "bignumber.js";
4
3
  import { Transaction } from "@ledgerhq/coin-polkadot/types";
4
+ import BigNumber from "bignumber.js";
5
+ import dot from "./walletApiAdapter";
5
6
 
6
7
  describe("getWalletAPITransactionSignFlowInfos", () => {
7
8
  describe("should properly get infos for DOT platform tx", () => {
9
+ const dummyAccount = {} as Account;
10
+
8
11
  it("with most basic tx", () => {
9
12
  const dotPlatformTx: PlatformTransaction = {
10
13
  family: "polkadot",
@@ -21,7 +24,10 @@ describe("getWalletAPITransactionSignFlowInfos", () => {
21
24
  };
22
25
 
23
26
  const { canEditFees, hasFeesProvided, liveTx } =
24
- dot.getWalletAPITransactionSignFlowInfos(dotPlatformTx);
27
+ dot.getWalletAPITransactionSignFlowInfos({
28
+ tx: dotPlatformTx,
29
+ account: dummyAccount,
30
+ });
25
31
 
26
32
  expect(canEditFees).toBe(false);
27
33
 
@@ -48,7 +54,10 @@ describe("getWalletAPITransactionSignFlowInfos", () => {
48
54
  };
49
55
 
50
56
  const { canEditFees, hasFeesProvided, liveTx } =
51
- dot.getWalletAPITransactionSignFlowInfos(dotPlatformTx);
57
+ dot.getWalletAPITransactionSignFlowInfos({
58
+ tx: dotPlatformTx,
59
+ account: dummyAccount,
60
+ });
52
61
 
53
62
  expect(canEditFees).toBe(false);
54
63
 
@@ -11,7 +11,7 @@ const CAN_EDIT_FEES = false;
11
11
  const convertToLiveTransaction: ConvertToLiveTransaction<
12
12
  WalletAPIPolkadotTransaction,
13
13
  Transaction
14
- > = (tx) => ({
14
+ > = ({ tx }) => ({
15
15
  ...tx,
16
16
  era: tx.era ? `${tx.era}` : undefined,
17
17
  });
@@ -19,10 +19,10 @@ const convertToLiveTransaction: ConvertToLiveTransaction<
19
19
  const getWalletAPITransactionSignFlowInfos: GetWalletAPITransactionSignFlowInfos<
20
20
  WalletAPIPolkadotTransaction,
21
21
  Transaction
22
- > = (tx) => {
22
+ > = (params) => {
23
23
  return {
24
24
  canEditFees: CAN_EDIT_FEES,
25
- liveTx: convertToLiveTransaction(tx),
25
+ liveTx: convertToLiveTransaction(params),
26
26
  hasFeesProvided: false,
27
27
  };
28
28
  };
@@ -1,10 +1,13 @@
1
- import xrp from "./walletApiAdapter";
1
+ import { Account } from "@ledgerhq/types-live";
2
2
  import { RippleTransaction as WalletAPITransaction } from "@ledgerhq/wallet-api-core";
3
3
  import BigNumber from "bignumber.js";
4
+ import xrp from "./walletApiAdapter";
4
5
  import { Transaction } from "./types";
5
6
 
6
7
  describe("getWalletAPITransactionSignFlowInfos", () => {
7
8
  describe("should properly get infos for XRP platform tx", () => {
9
+ const dummyAccount = {} as Account;
10
+
8
11
  it("without fees provided", () => {
9
12
  const xrpPlatformTx: WalletAPITransaction = {
10
13
  family: "ripple",
@@ -18,7 +21,10 @@ describe("getWalletAPITransactionSignFlowInfos", () => {
18
21
  };
19
22
 
20
23
  const { canEditFees, hasFeesProvided, liveTx } =
21
- xrp.getWalletAPITransactionSignFlowInfos(xrpPlatformTx);
24
+ xrp.getWalletAPITransactionSignFlowInfos({
25
+ tx: xrpPlatformTx,
26
+ account: dummyAccount,
27
+ });
22
28
 
23
29
  expect(canEditFees).toBe(true);
24
30
 
@@ -41,7 +47,10 @@ describe("getWalletAPITransactionSignFlowInfos", () => {
41
47
  };
42
48
 
43
49
  const { canEditFees, hasFeesProvided, liveTx } =
44
- xrp.getWalletAPITransactionSignFlowInfos(xrpPlatformTx);
50
+ xrp.getWalletAPITransactionSignFlowInfos({
51
+ tx: xrpPlatformTx,
52
+ account: dummyAccount,
53
+ });
45
54
 
46
55
  expect(canEditFees).toBe(true);
47
56
 
@@ -1,7 +1,6 @@
1
1
  import { RippleTransaction as WalletAPIRippleTransaction } from "@ledgerhq/wallet-api-core";
2
2
  import {
3
3
  AreFeesProvided,
4
- ConvertToLiveTransaction,
5
4
  GetWalletAPITransactionSignFlowInfos,
6
5
  } from "../../wallet-api/types";
7
6
 
@@ -12,20 +11,13 @@ const CAN_EDIT_FEES = true;
12
11
  const areFeesProvided: AreFeesProvided<WalletAPIRippleTransaction> = (tx) =>
13
12
  !!tx.fee;
14
13
 
15
- const convertToLiveTransaction: ConvertToLiveTransaction<
16
- WalletAPIRippleTransaction,
17
- Transaction
18
- > = (tx) => {
19
- return tx;
20
- };
21
-
22
14
  const getWalletAPITransactionSignFlowInfos: GetWalletAPITransactionSignFlowInfos<
23
15
  WalletAPIRippleTransaction,
24
16
  Transaction
25
- > = (tx) => {
17
+ > = ({ tx }) => {
26
18
  return {
27
19
  canEditFees: CAN_EDIT_FEES,
28
- liveTx: convertToLiveTransaction(tx),
20
+ liveTx: tx,
29
21
  hasFeesProvided: areFeesProvided(tx),
30
22
  };
31
23
  };
@@ -6,7 +6,7 @@ import {
6
6
  import {
7
7
  Connection,
8
8
  FetchMiddleware,
9
- Message,
9
+ VersionedMessage,
10
10
  PublicKey,
11
11
  sendAndConfirmRawTransaction,
12
12
  SignaturesForAddressOptions,
@@ -25,7 +25,7 @@ export type ChainAPI = Readonly<{
25
25
 
26
26
  getLatestBlockhash: () => Promise<string>;
27
27
 
28
- getFeeForMessage: (message: Message) => Promise<number>;
28
+ getFeeForMessage: (message: VersionedMessage) => Promise<number | null>;
29
29
 
30
30
  getBalanceAndContext: (
31
31
  address: string
@@ -120,7 +120,7 @@ export function getChainAPI(
120
120
  .then((r) => r.blockhash)
121
121
  .catch(remapErrors),
122
122
 
123
- getFeeForMessage: (msg: Message) =>
123
+ getFeeForMessage: (msg: VersionedMessage) =>
124
124
  connection()
125
125
  .getFeeForMessage(msg)
126
126
  .then((r) => r.value)
@@ -187,7 +187,11 @@ export function getChainAPI(
187
187
  .catch(remapErrors),
188
188
 
189
189
  getParsedTransactions: (signatures: string[]) =>
190
- connection().getParsedTransactions(signatures).catch(remapErrors),
190
+ connection()
191
+ .getParsedTransactions(signatures, {
192
+ maxSupportedTransactionVersion: 0,
193
+ })
194
+ .catch(remapErrors),
191
195
 
192
196
  getAccountInfo: (address: string) =>
193
197
  connection()
@@ -13,8 +13,9 @@ import {
13
13
  import { assertUnreachable } from "./utils";
14
14
  import {
15
15
  PublicKey,
16
- Transaction as OnChainTransaction,
16
+ VersionedTransaction as OnChainTransaction,
17
17
  TransactionInstruction,
18
+ TransactionMessage,
18
19
  } from "@solana/web3.js";
19
20
  import { ChainAPI } from "./api";
20
21
 
@@ -31,12 +32,13 @@ export const buildTransactionWithAPI = async (
31
32
 
32
33
  const feePayer = new PublicKey(account.freshAddress);
33
34
 
34
- const tx = new OnChainTransaction({
35
- feePayer,
35
+ const tm = new TransactionMessage({
36
+ payerKey: feePayer,
36
37
  recentBlockhash,
38
+ instructions,
37
39
  });
38
40
 
39
- tx.add(...instructions);
41
+ const tx = new OnChainTransaction(tm.compileToLegacyMessage());
40
42
 
41
43
  return [
42
44
  tx,
@@ -85,7 +85,7 @@ export const signOperationWithAPI = (
85
85
 
86
86
  const { signature } = await hwApp.signTransaction(
87
87
  account.freshAddressPath,
88
- tx.compileMessage().serialize()
88
+ Buffer.from(tx.message.serialize())
89
89
  );
90
90
 
91
91
  subscriber.next({
@@ -98,7 +98,7 @@ export const signOperationWithAPI = (
98
98
  type: "signed",
99
99
  signedOperation: {
100
100
  operation: buildOptimisticOperation(account, transaction),
101
- signature: signedTx.serialize().toString("hex"),
101
+ signature: Buffer.from(signedTx.serialize()).toString("hex"),
102
102
  expirationDate: null,
103
103
  },
104
104
  });
@@ -4,7 +4,7 @@ import { buildTransactionWithAPI } from "./js-buildTransaction";
4
4
  import createTransaction from "./js-createTransaction";
5
5
  import { Transaction, TransactionModel } from "./types";
6
6
  import { assertUnreachable } from "./utils";
7
- import { Transaction as OnChainTransaction } from "@solana/web3.js";
7
+ import { VersionedTransaction as OnChainTransaction } from "@solana/web3.js";
8
8
  import { log } from "@ledgerhq/logs";
9
9
 
10
10
  export async function estimateTxFee(
@@ -15,7 +15,7 @@ export async function estimateTxFee(
15
15
  const tx = createDummyTx(account, kind);
16
16
  const [onChainTx] = await buildTransactionWithAPI(account, tx, api);
17
17
 
18
- const fee = await api.getFeeForMessage(onChainTx.compileMessage());
18
+ const fee = await api.getFeeForMessage(onChainTx.message);
19
19
 
20
20
  if (typeof fee !== "number") {
21
21
  log("error", `api.getFeeForMessage returned invalid fee: <${fee}>`);
@@ -165,16 +165,16 @@ async function retryWithNewBlockhash(
165
165
  api: ChainAPI,
166
166
  onChainTx: OnChainTransaction
167
167
  ) {
168
- if (onChainTx.recentBlockhash === undefined) {
168
+ if (onChainTx.message.recentBlockhash === undefined) {
169
169
  throw new Error("expected recentBlockhash");
170
170
  }
171
171
 
172
- onChainTx.recentBlockhash = await waitNextBlockhash(
172
+ onChainTx.message.recentBlockhash = await waitNextBlockhash(
173
173
  api,
174
- onChainTx.recentBlockhash
174
+ onChainTx.message.recentBlockhash
175
175
  );
176
176
 
177
- const fee = await api.getFeeForMessage(onChainTx.compileMessage());
177
+ const fee = await api.getFeeForMessage(onChainTx.message);
178
178
 
179
179
  if (typeof fee !== "number") {
180
180
  throw new Error(
@@ -6,6 +6,7 @@ import {
6
6
  Subscription,
7
7
  TimeoutError,
8
8
  concat,
9
+ interval,
9
10
  of,
10
11
  timer,
11
12
  } from "rxjs";
@@ -16,6 +17,7 @@ import {
16
17
  import {
17
18
  catchError,
18
19
  debounce,
20
+ delayWhen,
19
21
  filter,
20
22
  switchMap,
21
23
  tap,
@@ -188,6 +190,15 @@ const pollingImplementation: Implementation = <
188
190
  // All other events pass through.
189
191
  return EMPTY;
190
192
  }
193
+ ),
194
+ // NB An error is a dead-end as far as the task is concerned, and by delaying
195
+ // the emission of the event we prevent instant failures from showing flashing
196
+ // UI that looks like a glitch. For instance, if the device is locked and we retry
197
+ // this would allow a better UX, 800ms before a failure is totally acceptable.
198
+ delayWhen((e: any) =>
199
+ e.type === "error" || e.type === "lockedDevice"
200
+ ? interval(800)
201
+ : interval(0)
191
202
  )
192
203
  )
193
204
  .subscribe({
@@ -260,6 +271,15 @@ const eventImplementation: Implementation = <SpecificType, GenericRequestType>(
260
271
  type: "error",
261
272
  error,
262
273
  })
274
+ ),
275
+ // NB An error is a dead-end as far as the task is concerned, and by delaying
276
+ // the emission of the event we prevent instant failures from showing flashing
277
+ // UI that looks like a glitch. For instance, if the device is locked and we retry
278
+ // this would allow a better UX, 800ms before a failure is totally acceptable.
279
+ delayWhen((e: any) =>
280
+ e.type === "error" || e.type === "lockedDevice"
281
+ ? interval(800)
282
+ : interval(0)
263
283
  )
264
284
  )
265
285
  .subscribe({
@@ -77,6 +77,21 @@ describe("@hw/extractOnboardingState", () => {
77
77
  });
78
78
  });
79
79
 
80
+ describe("and the user is on the onboarding early check screen", () => {
81
+ beforeEach(() => {
82
+ flagsBytes[3] = 15;
83
+ });
84
+
85
+ it("should return an onboarding step that is set at the onboarding early check screen", () => {
86
+ const onboardingState = extractOnboardingState(flagsBytes);
87
+
88
+ expect(onboardingState).not.toBeNull();
89
+ expect(onboardingState?.currentOnboardingStep).toBe(
90
+ OnboardingStep.OnboardingEarlyCheck
91
+ );
92
+ });
93
+ });
94
+
80
95
  describe("and the user is on 'choose name' step", () => {
81
96
  beforeEach(() => {
82
97
  flagsBytes[3] = 12;
@@ -30,6 +30,7 @@ export enum OnboardingStep {
30
30
  WelcomeScreen3 = "WELCOME_SCREEN_3",
31
31
  WelcomeScreen4 = "WELCOME_SCREEN_4",
32
32
  WelcomeScreenReminder = "WELCOME_SCREEN_REMINDER",
33
+ OnboardingEarlyCheck = "ONBOARDING_EARLY_CHECK",
33
34
  ChooseName = "CHOOSE_NAME",
34
35
  Pin = "PIN",
35
36
  SetupChoice = "SETUP_CHOICE",
@@ -58,6 +59,7 @@ const fromBitsToOnboardingStep = new Map<number, OnboardingStep>([
58
59
  [12, OnboardingStep.ChooseName],
59
60
  [13, OnboardingStep.RecoverRestore],
60
61
  [14, OnboardingStep.SetupChoiceRestore],
62
+ [15, OnboardingStep.OnboardingEarlyCheck],
61
63
  ]);
62
64
 
63
65
  export type OnboardingState = {
@@ -74,7 +76,7 @@ export type OnboardingState = {
74
76
 
75
77
  /**
76
78
  * Extracts the onboarding state of the device
77
- * @param flagsBytes Buffer of bytes of length onboardingFlagsBytesLength reprensenting the device state flags
79
+ * @param flagsBytes Buffer of bytes of length onboardingFlagsBytesLength representing the device state flags
78
80
  * @returns An OnboardingState
79
81
  */
80
82
  export const extractOnboardingState = (flagsBytes: Buffer): OnboardingState => {
@@ -5,6 +5,7 @@ import {
5
5
  } from "@ledgerhq/errors";
6
6
  import { command as staxRemoveImage } from "./staxRemoveImage";
7
7
  import Transport from "@ledgerhq/hw-transport";
8
+ import { ImageDoesNotExistOnDevice } from "../errors";
8
9
 
9
10
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
10
11
  // @ts-ignore next-line
@@ -34,6 +35,15 @@ describe("staxRemoveImage", () => {
34
35
  await expect(staxRemoveImage(mockedTransport)).rejects.toThrow(Error);
35
36
  });
36
37
 
38
+ test("missing image, should throw", async () => {
39
+ const mockedTransport = mockTransportGenerator(
40
+ Buffer.from(StatusCodes.CUSTOM_IMAGE_EMPTY.toString(16), "hex")
41
+ );
42
+ await expect(staxRemoveImage(mockedTransport)).rejects.toThrow(
43
+ ImageDoesNotExistOnDevice
44
+ );
45
+ });
46
+
37
47
  test("unexpected bootloader or any other code, should throw", async () => {
38
48
  const mockedTransport = mockTransportGenerator(
39
49
  Buffer.from(StatusCodes.CUSTOM_IMAGE_BOOTLOADER.toString(16), "hex")
@@ -9,6 +9,7 @@ import { Observable, from, of } from "rxjs";
9
9
  import { withDevice } from "./deviceAccess";
10
10
  import { delay, mergeMap } from "rxjs/operators";
11
11
  import getDeviceInfo from "./getDeviceInfo";
12
+ import { ImageDoesNotExistOnDevice } from "../errors";
12
13
 
13
14
  export type RemoveImageEvent =
14
15
  | {
@@ -36,6 +37,7 @@ export const command = async (transport: Transport): Promise<void> => {
36
37
  StatusCodes.OK,
37
38
  StatusCodes.CUSTOM_IMAGE_BOOTLOADER,
38
39
  StatusCodes.USER_REFUSED_ON_DEVICE,
40
+ StatusCodes.CUSTOM_IMAGE_EMPTY,
39
41
  StatusCodes.UNKNOWN_APDU,
40
42
  ]);
41
43
 
@@ -44,6 +46,8 @@ export const command = async (transport: Transport): Promise<void> => {
44
46
  switch (status) {
45
47
  case StatusCodes.OK:
46
48
  return;
49
+ case StatusCodes.CUSTOM_IMAGE_EMPTY:
50
+ throw new ImageDoesNotExistOnDevice();
47
51
  case StatusCodes.CUSTOM_IMAGE_BOOTLOADER:
48
52
  throw new UnexpectedBootloader();
49
53
  case StatusCodes.USER_REFUSED_ON_DEVICE:
@@ -15,7 +15,6 @@ export function createFixtureCryptoCurrency(family: string): CryptoCurrency {
15
15
  name: "MyCoin",
16
16
  managerAppName: "MyCoin",
17
17
  ticker: "MYC",
18
- countervalueTicker: "MYC",
19
18
  scheme: "mycoin",
20
19
  color: "#ff0000",
21
20
  family,
@@ -3,7 +3,6 @@ import {
3
3
  AccountLike,
4
4
  Operation,
5
5
  SignedOperation,
6
- TransactionCommon,
7
6
  } from "@ledgerhq/types-live";
8
7
 
9
8
  import {
@@ -113,7 +112,10 @@ export function signTransactionLogic(
113
112
  ? parentAccount?.currency.family
114
113
  : account.currency.family;
115
114
 
116
- if (accountFamily !== platformTransaction.family) {
115
+ if (
116
+ accountFamily !== platformTransaction.family &&
117
+ !(accountFamily === "evm" && transaction.family === "ethereum")
118
+ ) {
117
119
  return Promise.reject(
118
120
  new Error(`Transaction family not matching account currency family. Account family: ${accountFamily}, Transaction family: ${platformTransaction.family}
119
121
  `)
@@ -174,7 +176,7 @@ export type CompleteExchangeRequest = {
174
176
  export type CompleteExchangeUiRequest = {
175
177
  provider: string;
176
178
  exchange: Exchange;
177
- transaction: TransactionCommon;
179
+ transaction: Transaction;
178
180
  binaryPayload: string;
179
181
  signature: string;
180
182
  feesStrategy: string;
@@ -1,3 +1,4 @@
1
+ import { Account } from "@ledgerhq/types-live";
1
2
  import BigNumber from "bignumber.js";
2
3
  import "../__tests__/test-helpers/setup";
3
4
 
@@ -21,6 +22,8 @@ describe("getWalletAPITransactionSignFlowInfos", () => {
21
22
  ethBridge.mockClear();
22
23
  });
23
24
 
25
+ const dummyAccount = {} as Account;
26
+
24
27
  it("calls the bridge if the implementation exists", () => {
25
28
  // Given
26
29
  const tx: WalletAPITransaction = {
@@ -30,7 +33,7 @@ describe("getWalletAPITransactionSignFlowInfos", () => {
30
33
  };
31
34
 
32
35
  // When
33
- getWalletAPITransactionSignFlowInfos(tx);
36
+ getWalletAPITransactionSignFlowInfos({ tx, account: dummyAccount });
34
37
 
35
38
  // Then
36
39
  expect(ethBridge).toBeCalledTimes(1);
@@ -54,7 +57,7 @@ describe("getWalletAPITransactionSignFlowInfos", () => {
54
57
 
55
58
  // When
56
59
  const { canEditFees, hasFeesProvided, liveTx } =
57
- getWalletAPITransactionSignFlowInfos(tx);
60
+ getWalletAPITransactionSignFlowInfos({ tx, account: dummyAccount });
58
61
 
59
62
  // Then
60
63
  expect(ethBridge).toBeCalledTimes(0);
@@ -86,7 +86,8 @@ export function currencyToWalletAPICurrency(
86
86
  id: currency.id,
87
87
  ticker: currency.ticker,
88
88
  name: currency.name,
89
- family: currency.family as Families,
89
+ family:
90
+ currency.family === "evm" ? "ethereum" : (currency.family as Families),
90
91
  color: currency.color,
91
92
  decimals: currency.units[0].magnitude,
92
93
  };
@@ -95,11 +96,15 @@ export function currencyToWalletAPICurrency(
95
96
  export const getWalletAPITransactionSignFlowInfos: GetWalletAPITransactionSignFlowInfos<
96
97
  WalletAPITransaction,
97
98
  Transaction
98
- > = (tx) => {
99
+ > = ({ tx, account, parentAccount }) => {
99
100
  const family = byFamily[tx.family];
100
101
 
101
102
  if (family) {
102
- return family.getWalletAPITransactionSignFlowInfos(tx);
103
+ return family.getWalletAPITransactionSignFlowInfos({
104
+ tx,
105
+ account,
106
+ parentAccount,
107
+ });
103
108
  }
104
109
 
105
110
  return {
@@ -13,8 +13,9 @@ export function isWalletAPISupportedCurrency(
13
13
  currency: Currency
14
14
  ): currency is WalletAPISupportedCurrency {
15
15
  if (isCryptoCurrency(currency)) {
16
- return includes(WALLET_API_FAMILIES, currency.family);
16
+ return includes([...WALLET_API_FAMILIES, "evm"], currency.family);
17
17
  }
18
+
18
19
  if (isTokenCurrency(currency)) {
19
20
  return includes(WALLET_API_FAMILIES, currency.parentCurrency.family);
20
21
  }