@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
@@ -0,0 +1,125 @@
1
+ import { renderHook, act } from "@testing-library/react-hooks";
2
+ import {
3
+ UseToggleOnboardingEarlyCheckArgs,
4
+ useToggleOnboardingEarlyCheck,
5
+ } from "./useToggleOnboardingEarlyChecks";
6
+ import { of } from "rxjs";
7
+ import { delay } from "rxjs/operators";
8
+
9
+ jest.useFakeTimers();
10
+
11
+ const mockedToggleOnboardingEarlyCheckAction = jest.fn();
12
+
13
+ describe("useToggleOnboardingEarlyCheck", () => {
14
+ beforeEach(() => {
15
+ mockedToggleOnboardingEarlyCheckAction.mockClear();
16
+ });
17
+
18
+ it("should return a success state when the toggle action is successful", async () => {
19
+ mockedToggleOnboardingEarlyCheckAction.mockReturnValue(
20
+ of({ toggleStatus: "success" })
21
+ );
22
+ const { result } = renderHook(() =>
23
+ useToggleOnboardingEarlyCheck({
24
+ toggleOnboardingEarlyCheckAction:
25
+ mockedToggleOnboardingEarlyCheckAction,
26
+ deviceId: "",
27
+ toggleType: "enter",
28
+ })
29
+ );
30
+
31
+ await act(async () => {
32
+ jest.advanceTimersByTime(1);
33
+ });
34
+
35
+ expect(result.current.state).toEqual({
36
+ toggleStatus: "success",
37
+ });
38
+ });
39
+
40
+ it("should return a state initialized and reset at null when successively triggering the hook", async () => {
41
+ const delayMs = 1000;
42
+ mockedToggleOnboardingEarlyCheckAction.mockReturnValue(
43
+ of({ toggleStatus: "success" }).pipe(delay(delayMs))
44
+ );
45
+
46
+ // Step 1: enter
47
+ let toggleType: UseToggleOnboardingEarlyCheckArgs["toggleType"] = "enter";
48
+
49
+ const { result, rerender } = renderHook(() =>
50
+ useToggleOnboardingEarlyCheck({
51
+ toggleOnboardingEarlyCheckAction:
52
+ mockedToggleOnboardingEarlyCheckAction,
53
+ deviceId: "",
54
+ toggleType,
55
+ })
56
+ );
57
+
58
+ // No response for now from the action -> reset to `none` value
59
+ expect(result.current.state).toEqual(
60
+ expect.objectContaining({
61
+ toggleStatus: "none",
62
+ })
63
+ );
64
+
65
+ await act(async () => {
66
+ jest.advanceTimersByTime(delayMs);
67
+ });
68
+
69
+ expect(result.current.state).toEqual({
70
+ toggleStatus: "success",
71
+ });
72
+
73
+ // Step 2: exit
74
+ toggleType = "exit";
75
+ rerender();
76
+
77
+ // No response for now from the action -> reset to `none` value
78
+ expect(result.current.state).toEqual(
79
+ expect.objectContaining({
80
+ toggleStatus: "none",
81
+ })
82
+ );
83
+
84
+ await act(async () => {
85
+ jest.advanceTimersByTime(delayMs);
86
+ });
87
+
88
+ expect(result.current.state).toEqual({
89
+ toggleStatus: "success",
90
+ });
91
+
92
+ // Step 3: consumer reset manually with a `null` value
93
+ toggleType = null;
94
+ rerender();
95
+
96
+ await act(async () => {
97
+ jest.advanceTimersByTime(1);
98
+ });
99
+
100
+ expect(result.current.state).toEqual(
101
+ expect.objectContaining({
102
+ toggleStatus: "none",
103
+ })
104
+ );
105
+
106
+ // Step 4: again an enter
107
+ toggleType = "enter";
108
+ rerender();
109
+
110
+ // No response for now from the action -> reset to `none` value
111
+ expect(result.current.state).toEqual(
112
+ expect.objectContaining({
113
+ toggleStatus: "none",
114
+ })
115
+ );
116
+
117
+ await act(async () => {
118
+ jest.advanceTimersByTime(delayMs);
119
+ });
120
+
121
+ expect(result.current.state).toEqual({
122
+ toggleStatus: "success",
123
+ });
124
+ });
125
+ });
@@ -0,0 +1,71 @@
1
+ import { useEffect, useState } from "react";
2
+ import { log } from "@ledgerhq/logs";
3
+ import {
4
+ ToggleOnboardingEarlyCheckActionArgs,
5
+ ToggleOnboardingEarlyCheckActionState,
6
+ toggleOnboardingEarlyCheckAction as defaultToggleOnboardingEarlyCheckAction,
7
+ initialState,
8
+ } from "../actions/toggleOnboardingEarlyCheck";
9
+
10
+ export type UseToggleOnboardingEarlyCheckArgs = {
11
+ toggleOnboardingEarlyCheckAction?: typeof defaultToggleOnboardingEarlyCheckAction;
12
+ deviceId: string;
13
+ toggleType: ToggleOnboardingEarlyCheckActionArgs["toggleType"] | null;
14
+ };
15
+
16
+ /**
17
+ * Hook making the device enter or exit the early security check steps, during the onboarding
18
+ *
19
+ * This hook only puts (or moves out) the device to the state/step of the early security check.
20
+ * It does not starts any "security checks".
21
+ *
22
+ * If the device is not in the WELCOME or WELCOME_STEP2 onboarding state, this hook will update
23
+ * its `toggleStatus` to `failure`.
24
+ *
25
+ * You can reset the result state by updating `toggleType` to null
26
+ *
27
+ * @param deviceId The id of the targeted device that can be
28
+ * @param toggleType either null, "enter" or "exit".
29
+ * If null, the hook does not subscribe to the underlying device action, and nothing happens.
30
+ * Useful to enable/disable this hook.
31
+ * @param toggleOnboardingEarlyCheckAction dependency injected action. A default implementation is provided.
32
+ * @returns an object containing the state of the onboarding early check toggling with possible error.
33
+ * The resulting state is reset to its initial state on each new triggering of the toggle action (when `toggleType` is updated):
34
+ * {
35
+ * toggleStatus: "none",
36
+ * ...initialSharedActionState,
37
+ * }
38
+ */
39
+ export const useToggleOnboardingEarlyCheck = ({
40
+ toggleOnboardingEarlyCheckAction = defaultToggleOnboardingEarlyCheckAction,
41
+ deviceId,
42
+ toggleType,
43
+ }: UseToggleOnboardingEarlyCheckArgs): {
44
+ state: ToggleOnboardingEarlyCheckActionState;
45
+ } => {
46
+ const [state, setState] =
47
+ useState<ToggleOnboardingEarlyCheckActionState>(initialState);
48
+
49
+ useEffect(() => {
50
+ if (toggleType === null) return;
51
+
52
+ const subscription = toggleOnboardingEarlyCheckAction({
53
+ deviceId,
54
+ toggleType,
55
+ }).subscribe({
56
+ next: setState,
57
+ error: (error: unknown) => {
58
+ log("useToggleOnboardingEarlyCheck", "Unknown error", error);
59
+ },
60
+ });
61
+
62
+ return () => {
63
+ // Resets the resulting state on each new triggering
64
+ setState(initialState);
65
+
66
+ subscription.unsubscribe();
67
+ };
68
+ }, [deviceId, toggleOnboardingEarlyCheckAction, toggleType]);
69
+
70
+ return { state };
71
+ };
@@ -55,7 +55,7 @@ export function sharedLogicTaskWrapper<TaskArgsType, TaskEventsType>(
55
55
  error instanceof TransportRaceCondition
56
56
  ) {
57
57
  // Emits to the action a locked device error event so it is aware of it before retrying
58
- subscriber.next({ type: "error", error });
58
+ subscriber.next({ type: "error" as const, error });
59
59
  acceptedError = true;
60
60
  }
61
61
 
@@ -0,0 +1,111 @@
1
+ import { from, of, throwError } from "rxjs";
2
+ import { StatusCodes, TransportStatusError } from "@ledgerhq/errors";
3
+ import { toggleOnboardingEarlyCheckTask } from "./toggleOnboardingEarlyCheck";
4
+ import { toggleOnboardingEarlyCheckCmd } from "../commands/toggleOnboardingEarlyCheck";
5
+ import { withTransport } from "../transports/core";
6
+ import { aTransportRefBuilder } from "../mocks/aTransportRef";
7
+
8
+ jest.mock("../commands/toggleOnboardingEarlyCheck");
9
+ const mockedToggleOnboardingEarlyCheckCmd = jest.mocked(
10
+ toggleOnboardingEarlyCheckCmd
11
+ );
12
+
13
+ jest.mock("../transports/core");
14
+ const mockedWithTransport = jest.mocked(withTransport);
15
+
16
+ describe("@deviceSDK/tasks/toggleOnboardingEarlyCheckTask", () => {
17
+ beforeAll(async () => {
18
+ const transportRef = await aTransportRefBuilder();
19
+ mockedWithTransport.mockReturnValue((job) => from(job({ transportRef })));
20
+ });
21
+
22
+ describe("When the device is in the expected onboarding state", () => {
23
+ it("should emit a success event after being able to enter or exit the onboarding early checks step successfully", (done) => {
24
+ mockedToggleOnboardingEarlyCheckCmd.mockReturnValue(
25
+ of({ type: "success" })
26
+ );
27
+
28
+ // `enter` and `exit` have the same behavior
29
+ toggleOnboardingEarlyCheckTask({
30
+ deviceId: "",
31
+ toggleType: "exit",
32
+ }).subscribe({
33
+ next: (event) => {
34
+ expect(event.type).toBe("success");
35
+ done();
36
+ },
37
+ error: (error: unknown) => {
38
+ done(`No error should have been thrown: ${JSON.stringify(error)}`);
39
+ },
40
+ });
41
+ });
42
+ });
43
+
44
+ describe("When the device is neither in the WELCOME and WELCOME_STEP2 onboarding state, and it returns 0x6982", () => {
45
+ it("should emit a task error event with the correct error type", (done) => {
46
+ mockedToggleOnboardingEarlyCheckCmd.mockReturnValue(
47
+ throwError(
48
+ new TransportStatusError(StatusCodes.SECURITY_STATUS_NOT_SATISFIED)
49
+ )
50
+ );
51
+
52
+ toggleOnboardingEarlyCheckTask({
53
+ deviceId: "",
54
+ toggleType: "enter",
55
+ }).subscribe({
56
+ next: (event) => {
57
+ try {
58
+ if (event.type === "taskError") {
59
+ expect(event.error).toBe("DeviceInInvalidState");
60
+ done();
61
+ } else {
62
+ done(`The event is incorrect: ${JSON.stringify(event)}`);
63
+ }
64
+ } catch (expectError) {
65
+ done(expectError);
66
+ }
67
+ },
68
+ error: (error: unknown) => {
69
+ done(
70
+ `The error should have been mapped to an event, not thrown: ${JSON.stringify(
71
+ error
72
+ )}`
73
+ );
74
+ },
75
+ });
76
+ });
77
+ });
78
+
79
+ describe("When the command is not respected the expected APDU format", () => {
80
+ it("should emit a task error event with the correct error type", (done) => {
81
+ mockedToggleOnboardingEarlyCheckCmd.mockReturnValue(
82
+ throwError(new TransportStatusError(StatusCodes.INCORRECT_LENGTH))
83
+ );
84
+
85
+ toggleOnboardingEarlyCheckTask({
86
+ deviceId: "",
87
+ toggleType: "enter",
88
+ }).subscribe({
89
+ next: (event) => {
90
+ try {
91
+ if (event.type === "taskError") {
92
+ expect(event.error).toBe("InternalError");
93
+ done();
94
+ } else {
95
+ done(`The event is incorrect: ${JSON.stringify(event)}`);
96
+ }
97
+ } catch (expectError) {
98
+ done(expectError);
99
+ }
100
+ },
101
+ error: (error: unknown) => {
102
+ done(
103
+ `The error should have been mapped to an event, not thrown: ${JSON.stringify(
104
+ error
105
+ )}`
106
+ );
107
+ },
108
+ });
109
+ });
110
+ });
111
+ });
@@ -0,0 +1,92 @@
1
+ import { Observable } from "rxjs";
2
+ import { log } from "@ledgerhq/logs";
3
+ import type { DeviceId } from "@ledgerhq/types-live";
4
+ import { SharedTaskEvent } from "./core";
5
+ import { withTransport } from "../transports/core";
6
+ import {
7
+ toggleOnboardingEarlyCheckCmd,
8
+ ToggleTypeP2,
9
+ } from "../commands/toggleOnboardingEarlyCheck";
10
+ import { StatusCodes, TransportStatusError } from "@ledgerhq/errors";
11
+
12
+ export type ToggleOnboardingEarlyCheckTaskError =
13
+ | "DeviceInInvalidState"
14
+ | "InternalError"
15
+ | "Unknown";
16
+
17
+ export type ToggleOnboardingEarlyCheckTaskErrorEvent = {
18
+ type: "taskError";
19
+ error: ToggleOnboardingEarlyCheckTaskError;
20
+ };
21
+
22
+ export type ToggleOnboardingEarlyCheckTaskEvent =
23
+ | { type: "success" }
24
+ | ToggleOnboardingEarlyCheckTaskErrorEvent
25
+ | SharedTaskEvent;
26
+
27
+ export type ToggleOnboardingEarlyCheckTaskArgs = {
28
+ deviceId: DeviceId;
29
+ toggleType: "enter" | "exit";
30
+ };
31
+
32
+ /**
33
+ * During the onboarding, makes the device enter or exit the early security check steps
34
+ *
35
+ * This task only puts (or moves out) the device to the state/step of the early security check.
36
+ * It does not starts any "security checks".
37
+ *
38
+ * If the device is not in the WELCOME or WELCOME_STEP2 onboarding state, this task will emit
39
+ * a "DeviceInInvalidState" event.
40
+ *
41
+ * @param deviceId The id of the targeted device
42
+ * @param toggleType either "enter" or "exit"
43
+ * @returns An observable that emits a success, error or shared-task event
44
+ */
45
+ export function toggleOnboardingEarlyCheckTask({
46
+ deviceId,
47
+ toggleType,
48
+ }: ToggleOnboardingEarlyCheckTaskArgs): Observable<ToggleOnboardingEarlyCheckTaskEvent> {
49
+ const p2 =
50
+ toggleType === "enter"
51
+ ? ToggleTypeP2.EnterChecking
52
+ : ToggleTypeP2.ExitChecking;
53
+
54
+ return new Observable((subscriber) => {
55
+ withTransport(deviceId)(({ transportRef }) =>
56
+ toggleOnboardingEarlyCheckCmd({
57
+ transport: transportRef.current,
58
+ p2,
59
+ })
60
+ ).subscribe({
61
+ next: (_) => subscriber.next({ type: "success" }),
62
+ error: (error: unknown) => {
63
+ if (error instanceof TransportStatusError) {
64
+ // @ts-expect-error TransportStatusError not typed correctly
65
+ if (error.statusCode === StatusCodes.SECURITY_STATUS_NOT_SATISFIED) {
66
+ subscriber.next({
67
+ type: "taskError",
68
+ error: "DeviceInInvalidState",
69
+ });
70
+ return;
71
+ }
72
+ // @ts-expect-error TransportStatusError not typed correctly
73
+ else if (error.statusCode === StatusCodes.INCORRECT_LENGTH) {
74
+ subscriber.next({
75
+ type: "taskError",
76
+ error: "InternalError",
77
+ });
78
+ return;
79
+ }
80
+ }
81
+ // Otherwise unknown error
82
+ let message = "";
83
+ if (error instanceof Error) {
84
+ message = `${error.name}: ${error.message}`;
85
+ }
86
+ log("toggleOnboardingEarlyCheckTask", `Error: ${message}`);
87
+ subscriber.next({ type: "taskError", error: "Unknown" });
88
+ },
89
+ complete: () => subscriber.complete(),
90
+ });
91
+ });
92
+ }
@@ -2,7 +2,10 @@ import { Observable, from, of, EMPTY } from "rxjs";
2
2
  import { concatMap } from "rxjs/operators";
3
3
  import invariant from "invariant";
4
4
  import bs58 from "bs58";
5
- import type { DerivationMode } from "@ledgerhq/coin-framework/derivation";
5
+ import type {
6
+ DerivationMode,
7
+ GetAddressOptions,
8
+ } from "@ledgerhq/coin-framework/derivation";
6
9
  import type { Result } from "../../hw/getAddress/types";
7
10
  import { hash256, hash160 } from "../../crypto";
8
11
  import {
@@ -159,7 +162,7 @@ export function scanDescriptors(
159
162
  currency: CryptoCurrency,
160
163
  limit = 10
161
164
  ): Observable<AccountDescriptor> {
162
- const derivateAddress = (opts) =>
165
+ const derivateAddress = (opts: GetAddressOptions) =>
163
166
  withDevice(deviceId)((transport) => from(getAddress(transport, opts)));
164
167
 
165
168
  function stepAddress({
@@ -35,6 +35,7 @@ export type RPCNodeConfig = {
35
35
  username: string;
36
36
  password: string;
37
37
  tls?: boolean;
38
+ notls?: boolean;
38
39
  };
39
40
 
40
41
  export function isValidHost(host: string): boolean {
@@ -1,9 +1,12 @@
1
1
  import btc from "./walletApiAdapter";
2
2
  import { BitcoinTransaction as WalletAPITransaction } from "@ledgerhq/wallet-api-core";
3
+ import { Account } from "@ledgerhq/types-live";
3
4
  import BigNumber from "bignumber.js";
4
5
  import { Transaction } from "./types";
5
6
 
6
7
  describe("getPlatformTransactionSignFlowInfos", () => {
8
+ const dummyAccount = {} as Account;
9
+
7
10
  describe("should properly get infos for BTC platform tx", () => {
8
11
  test("without fees provided", () => {
9
12
  const btcPlatformTx: WalletAPITransaction = {
@@ -19,7 +22,10 @@ describe("getPlatformTransactionSignFlowInfos", () => {
19
22
  };
20
23
 
21
24
  const { canEditFees, hasFeesProvided, liveTx } =
22
- btc.getWalletAPITransactionSignFlowInfos(btcPlatformTx);
25
+ btc.getWalletAPITransactionSignFlowInfos({
26
+ tx: btcPlatformTx,
27
+ account: dummyAccount,
28
+ });
23
29
 
24
30
  expect(canEditFees).toBe(true);
25
31
 
@@ -45,7 +51,10 @@ describe("getPlatformTransactionSignFlowInfos", () => {
45
51
  };
46
52
 
47
53
  const { canEditFees, hasFeesProvided, liveTx } =
48
- btc.getWalletAPITransactionSignFlowInfos(btcPlatformTx);
54
+ btc.getWalletAPITransactionSignFlowInfos({
55
+ tx: btcPlatformTx,
56
+ account: dummyAccount,
57
+ });
49
58
 
50
59
  expect(canEditFees).toBe(true);
51
60
 
@@ -14,7 +14,7 @@ const areFeesProvided: AreFeesProvided<WalletAPIBitcoinTransaction> = (tx) =>
14
14
  const convertToLiveTransaction: ConvertToLiveTransaction<
15
15
  WalletAPIBitcoinTransaction,
16
16
  Transaction
17
- > = (tx) => {
17
+ > = ({ tx }) => {
18
18
  const hasFeesProvided = areFeesProvided(tx);
19
19
 
20
20
  const liveTx: Partial<Transaction> = {
@@ -30,11 +30,11 @@ const convertToLiveTransaction: ConvertToLiveTransaction<
30
30
  const getWalletAPITransactionSignFlowInfos: GetWalletAPITransactionSignFlowInfos<
31
31
  WalletAPIBitcoinTransaction,
32
32
  Transaction
33
- > = (tx) => {
33
+ > = (params) => {
34
34
  return {
35
35
  canEditFees: CAN_EDIT_FEES,
36
- liveTx: convertToLiveTransaction(tx),
37
- hasFeesProvided: areFeesProvided(tx),
36
+ liveTx: convertToLiveTransaction(params),
37
+ hasFeesProvided: areFeesProvided(params.tx),
38
38
  };
39
39
  };
40
40