@ledgerhq/live-common 23.1.0 → 24.0.0-next.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 (341) hide show
  1. package/lib/__tests__/mocks/account.js +3 -3
  2. package/lib/__tests__/mocks/account.js.map +1 -1
  3. package/lib/__tests__/test-helpers/bridge.d.ts +1 -4
  4. package/lib/__tests__/test-helpers/bridge.d.ts.map +1 -1
  5. package/lib/__tests__/test-helpers/bridge.js +1 -28
  6. package/lib/__tests__/test-helpers/bridge.js.map +1 -1
  7. package/lib/__tests__/test-helpers/setup.js +51 -0
  8. package/lib/__tests__/test-helpers/setup.js.map +1 -1
  9. package/lib/api/Ripple.d.ts.map +1 -1
  10. package/lib/api/Ripple.js +113 -68
  11. package/lib/api/Ripple.js.map +1 -1
  12. package/lib/apps/support.d.ts.map +1 -1
  13. package/lib/apps/support.js +6 -2
  14. package/lib/apps/support.js.map +1 -1
  15. package/lib/bot/index.d.ts.map +1 -1
  16. package/lib/bot/index.js +13 -19
  17. package/lib/bot/index.js.map +1 -1
  18. package/lib/bot/test.bot.d.ts +1 -1
  19. package/lib/bot/test.bot.d.ts.map +1 -1
  20. package/lib/bot/test.bot.js +1 -2
  21. package/lib/bot/test.bot.js.map +1 -1
  22. package/lib/countervalues/logic.integration.test.d.ts +2 -0
  23. package/lib/countervalues/logic.integration.test.d.ts.map +1 -0
  24. package/lib/countervalues/{logic.test.js → logic.integration.test.js} +1 -1
  25. package/lib/countervalues/logic.integration.test.js.map +1 -0
  26. package/lib/countervalues/react.d.ts +1 -21
  27. package/lib/countervalues/react.d.ts.map +1 -1
  28. package/lib/countervalues/react.js +1 -77
  29. package/lib/countervalues/react.js.map +1 -1
  30. package/lib/derivation.d.ts +1 -0
  31. package/lib/derivation.d.ts.map +1 -1
  32. package/lib/derivation.js +3 -2
  33. package/lib/derivation.js.map +1 -1
  34. package/lib/exchange/swap/getExchangeRates.test.js +1 -2
  35. package/lib/exchange/swap/getExchangeRates.test.js.map +1 -1
  36. package/lib/exchange/swap/hooks/usePollKYCStatus.test.js +4 -5
  37. package/lib/exchange/swap/hooks/usePollKYCStatus.test.js.map +1 -1
  38. package/lib/exchange/swap/hooks/useProviderRates.test.js +1 -2
  39. package/lib/exchange/swap/hooks/useProviderRates.test.js.map +1 -1
  40. package/lib/exchange/swap/hooks/useSwapProviders.test.js +1 -2
  41. package/lib/exchange/swap/hooks/useSwapProviders.test.js.map +1 -1
  42. package/lib/exchange/swap/hooks/useUpdateMaxAmount.test.js +2 -3
  43. package/lib/exchange/swap/hooks/useUpdateMaxAmount.test.js.map +1 -1
  44. package/lib/families/algorand/bridge.integration.test.d.ts +2 -0
  45. package/lib/families/algorand/bridge.integration.test.d.ts.map +1 -0
  46. package/lib/families/algorand/{test-dataset.js → bridge.integration.test.js} +12 -11
  47. package/lib/families/algorand/bridge.integration.test.js.map +1 -0
  48. package/lib/families/bitcoin/bridge.integration.test.d.ts +2 -0
  49. package/lib/families/bitcoin/bridge.integration.test.d.ts.map +1 -0
  50. package/lib/families/bitcoin/{test-dataset.js → bridge.integration.test.js} +17 -14
  51. package/lib/families/bitcoin/bridge.integration.test.js.map +1 -0
  52. package/lib/families/bitcoin/descriptor.d.ts.map +1 -1
  53. package/lib/families/bitcoin/descriptor.js +2 -1
  54. package/lib/families/bitcoin/descriptor.js.map +1 -1
  55. package/lib/families/bitcoin/satstack.d.ts.map +1 -1
  56. package/lib/families/bitcoin/satstack.js +5 -6
  57. package/lib/families/bitcoin/satstack.js.map +1 -1
  58. package/lib/families/bitcoin/satstack.test.js +4 -1
  59. package/lib/families/bitcoin/satstack.test.js.map +1 -1
  60. package/lib/families/bitcoin/specs.d.ts.map +1 -1
  61. package/lib/families/bitcoin/specs.js +1 -2
  62. package/lib/families/bitcoin/specs.js.map +1 -1
  63. package/lib/families/cardano/bridge.integration.test.d.ts +2 -0
  64. package/lib/families/cardano/bridge.integration.test.d.ts.map +1 -0
  65. package/lib/families/cardano/{test-dataset.js → bridge.integration.test.js} +4 -2
  66. package/lib/families/cardano/bridge.integration.test.js.map +1 -0
  67. package/lib/families/celo/bridge.integration.test.d.ts +2 -0
  68. package/lib/families/celo/bridge.integration.test.d.ts.map +1 -0
  69. package/lib/families/celo/bridge.integration.test.js +16 -0
  70. package/lib/families/celo/bridge.integration.test.js.map +1 -0
  71. package/lib/families/cosmos/bridge.integration.test.d.ts +2 -0
  72. package/lib/families/cosmos/bridge.integration.test.d.ts.map +1 -0
  73. package/lib/families/cosmos/{test-dataset.js → bridge.integration.test.js} +5 -4
  74. package/lib/families/cosmos/bridge.integration.test.js.map +1 -0
  75. package/lib/families/cosmos/speculos-deviceActions.js +2 -2
  76. package/lib/families/crypto_org/bridge.integration.test.d.ts +2 -0
  77. package/lib/families/crypto_org/bridge.integration.test.d.ts.map +1 -0
  78. package/lib/families/crypto_org/bridge.integration.test.js +16 -0
  79. package/lib/families/crypto_org/bridge.integration.test.js.map +1 -0
  80. package/lib/families/elrond/bridge.integration.test.d.ts +2 -0
  81. package/lib/families/elrond/bridge.integration.test.d.ts.map +1 -0
  82. package/lib/families/elrond/{test-dataset.js → bridge.integration.test.js} +5 -5
  83. package/lib/families/elrond/bridge.integration.test.js.map +1 -0
  84. package/lib/families/ethereum/bridge.integration.test.d.ts +2 -0
  85. package/lib/families/ethereum/bridge.integration.test.d.ts.map +1 -0
  86. package/lib/families/ethereum/{test-dataset.js → bridge.integration.test.js} +8 -24
  87. package/lib/families/ethereum/bridge.integration.test.js.map +1 -0
  88. package/lib/families/ethereum/datasets/ethereum1.d.ts +3 -0
  89. package/lib/families/ethereum/datasets/ethereum1.d.ts.map +1 -0
  90. package/lib/families/ethereum/datasets/ethereum1.js +22 -0
  91. package/lib/families/ethereum/datasets/ethereum1.js.map +1 -0
  92. package/lib/families/ethereum/modules/compound.resilience.integration.test.d.ts +2 -0
  93. package/lib/families/ethereum/modules/compound.resilience.integration.test.d.ts.map +1 -0
  94. package/lib/families/ethereum/modules/{compound.resilience.test.js → compound.resilience.integration.test.js} +3 -3
  95. package/lib/families/ethereum/modules/compound.resilience.integration.test.js.map +1 -0
  96. package/lib/families/ethereum/synchronisation.integration.test.d.ts +2 -0
  97. package/lib/families/ethereum/synchronisation.integration.test.d.ts.map +1 -0
  98. package/lib/families/ethereum/{synchronisation.test.js → synchronisation.integration.test.js} +4 -4
  99. package/lib/families/ethereum/synchronisation.integration.test.js.map +1 -0
  100. package/lib/families/filecoin/bridge.integration.test.d.ts +2 -0
  101. package/lib/families/filecoin/bridge.integration.test.d.ts.map +1 -0
  102. package/lib/families/filecoin/{test-dataset.js → bridge.integration.test.js} +84 -3
  103. package/lib/families/filecoin/bridge.integration.test.js.map +1 -0
  104. package/lib/families/hedera/bridge.integration.test.d.ts +2 -0
  105. package/lib/families/hedera/bridge.integration.test.d.ts.map +1 -0
  106. package/lib/families/hedera/{test-dataset.js → bridge.integration.test.js} +5 -3
  107. package/lib/families/hedera/bridge.integration.test.js.map +1 -0
  108. package/lib/families/polkadot/bridge.integration.test.d.ts +2 -0
  109. package/lib/families/polkadot/bridge.integration.test.d.ts.map +1 -0
  110. package/lib/families/polkadot/{test-dataset.js → bridge.integration.test.js} +138 -4
  111. package/lib/families/polkadot/bridge.integration.test.js.map +1 -0
  112. package/lib/families/ripple/bridge.integration.test.d.ts +2 -0
  113. package/lib/families/ripple/bridge.integration.test.d.ts.map +1 -0
  114. package/lib/families/ripple/{test-dataset.js → bridge.integration.test.js} +4 -2
  115. package/lib/families/ripple/bridge.integration.test.js.map +1 -0
  116. package/lib/families/solana/bridge.integration.test.d.ts +2 -0
  117. package/lib/families/solana/bridge.integration.test.d.ts.map +1 -0
  118. package/lib/families/solana/{test-dataset.js → bridge.integration.test.js} +289 -73
  119. package/lib/families/solana/bridge.integration.test.js.map +1 -0
  120. package/lib/families/stellar/bridge.integration.test.d.ts +2 -0
  121. package/lib/families/stellar/bridge.integration.test.d.ts.map +1 -0
  122. package/lib/families/stellar/{test-dataset.js → bridge.integration.test.js} +9 -8
  123. package/lib/families/stellar/bridge.integration.test.js.map +1 -0
  124. package/lib/families/stellar/js-estimateMaxSpendable.d.ts.map +1 -1
  125. package/lib/families/stellar/js-estimateMaxSpendable.js +2 -2
  126. package/lib/families/stellar/js-estimateMaxSpendable.js.map +1 -1
  127. package/lib/families/tezos/{test-dataset.d.ts → bridge.integration.test.d.ts} +2 -5
  128. package/lib/families/tezos/bridge.integration.test.d.ts.map +1 -0
  129. package/lib/families/tezos/{test-dataset.js → bridge.integration.test.js} +73 -2
  130. package/lib/families/tezos/bridge.integration.test.js.map +1 -0
  131. package/lib/families/tezos/synchronisation.js +2 -2
  132. package/lib/families/tezos/synchronisation.js.map +1 -1
  133. package/lib/families/tron/bridge.integration.test.d.ts +2 -0
  134. package/lib/families/tron/bridge.integration.test.d.ts.map +1 -0
  135. package/lib/families/tron/{test-dataset.js → bridge.integration.test.js} +5 -4
  136. package/lib/families/tron/bridge.integration.test.js.map +1 -0
  137. package/lib/load/speculos.d.ts.map +1 -1
  138. package/lib/load/speculos.js +5 -2
  139. package/lib/load/speculos.js.map +1 -1
  140. package/lib/portfolio/v2/index.d.ts +6 -1
  141. package/lib/portfolio/v2/index.d.ts.map +1 -1
  142. package/lib/portfolio/v2/index.js +7 -3
  143. package/lib/portfolio/v2/index.js.map +1 -1
  144. package/lib/portfolio/v2/range.d.ts +7 -1
  145. package/lib/portfolio/v2/range.d.ts.map +1 -1
  146. package/lib/portfolio/v2/range.js +37 -18
  147. package/lib/portfolio/v2/range.js.map +1 -1
  148. package/lib/portfolio/v2/range.test.d.ts +2 -0
  149. package/lib/portfolio/v2/range.test.d.ts.map +1 -0
  150. package/lib/portfolio/v2/range.test.js +51 -0
  151. package/lib/portfolio/v2/range.test.js.map +1 -0
  152. package/package.json +11 -10
  153. package/src/__tests__/mocks/account.ts +3 -3
  154. package/src/__tests__/test-helpers/bridge.ts +2 -35
  155. package/src/__tests__/test-helpers/setup.ts +39 -0
  156. package/src/api/Ripple.ts +97 -52
  157. package/src/apps/support.ts +6 -2
  158. package/src/bot/index.ts +26 -24
  159. package/src/bot/test.bot.ts +2 -2
  160. package/src/countervalues/{logic.test.ts → logic.integration.test.ts} +0 -0
  161. package/src/countervalues/react.tsx +2 -131
  162. package/src/currencies/__snapshots__/sortByMarketcap.test.ts.snap +15 -1
  163. package/src/derivation.ts +2 -1
  164. package/src/exchange/swap/getExchangeRates.test.ts +1 -2
  165. package/src/exchange/swap/hooks/usePollKYCStatus.test.ts +1 -3
  166. package/src/exchange/swap/hooks/useProviderRates.test.ts +1 -2
  167. package/src/exchange/swap/hooks/useSwapProviders.test.ts +1 -3
  168. package/src/exchange/swap/hooks/useUpdateMaxAmount.test.ts +2 -3
  169. package/src/families/algorand/{test-dataset.ts → bridge.integration.test.ts} +13 -10
  170. package/src/families/bitcoin/__snapshots__/bridge.integration.test.ts.snap +27607 -0
  171. package/src/families/bitcoin/{test-dataset.ts → bridge.integration.test.ts} +18 -13
  172. package/src/families/bitcoin/descriptor.ts +1 -0
  173. package/src/families/bitcoin/satstack.test.ts +4 -1
  174. package/src/families/bitcoin/satstack.ts +9 -5
  175. package/src/families/bitcoin/specs.ts +0 -1
  176. package/src/families/cardano/__snapshots__/{bridge.test.ts.snap → bridge.integration.test.ts.snap} +0 -0
  177. package/src/families/cardano/{test-dataset.ts → bridge.integration.test.ts} +3 -1
  178. package/src/families/celo/bridge.integration.test.ts +14 -0
  179. package/src/families/cosmos/__snapshots__/{bridge.test.ts.snap → bridge.integration.test.ts.snap} +0 -0
  180. package/src/families/cosmos/{test-dataset.ts → bridge.integration.test.ts} +17 -15
  181. package/src/families/cosmos/speculos-deviceActions.ts +2 -2
  182. package/src/families/crypto_org/__snapshots__/bridge.integration.test.ts.snap +2968 -0
  183. package/src/families/crypto_org/bridge.integration.test.ts +14 -0
  184. package/src/families/elrond/__snapshots__/bridge.integration.test.ts.snap +207 -0
  185. package/src/families/elrond/{test-dataset.ts → bridge.integration.test.ts} +6 -4
  186. package/src/families/ethereum/__snapshots__/bridge.integration.test.ts.snap +3263 -0
  187. package/src/families/ethereum/{test-dataset.ts → bridge.integration.test.ts} +6 -19
  188. package/src/families/ethereum/datasets/ethereum1.ts +20 -0
  189. package/src/families/ethereum/modules/{compound.resilience.test.ts → compound.resilience.integration.test.ts} +1 -1
  190. package/src/families/ethereum/{synchronisation.test.ts → synchronisation.integration.test.ts} +1 -1
  191. package/src/families/filecoin/__snapshots__/{bridge.test.ts.snap → bridge.integration.test.ts.snap} +0 -0
  192. package/src/families/filecoin/{test-dataset.ts → bridge.integration.test.ts} +35 -3
  193. package/src/families/hedera/__snapshots__/bridge.integration.test.ts.snap +5 -0
  194. package/src/families/hedera/{test-dataset.ts → bridge.integration.test.ts} +5 -2
  195. package/src/families/polkadot/{test-dataset.ts → bridge.integration.test.ts} +81 -5
  196. package/src/families/ripple/{test-dataset.ts → bridge.integration.test.ts} +5 -1
  197. package/src/families/solana/__snapshots__/{bridge.test.ts.snap → bridge.integration.test.ts.snap} +0 -0
  198. package/src/families/solana/{test-dataset.ts → bridge.integration.test.ts} +170 -5
  199. package/src/families/stellar/__snapshots__/{bridge.test.ts.snap → bridge.integration.test.ts.snap} +0 -0
  200. package/src/families/stellar/{test-dataset.ts → bridge.integration.test.ts} +5 -3
  201. package/src/families/stellar/js-estimateMaxSpendable.ts +3 -1
  202. package/src/families/tezos/{test-dataset.ts → bridge.integration.test.ts} +22 -1
  203. package/src/families/tezos/synchronisation.ts +1 -1
  204. package/src/families/tron/{test-dataset.ts → bridge.integration.test.ts} +6 -5
  205. package/src/load/speculos.ts +5 -2
  206. package/src/portfolio/v2/index.ts +7 -2
  207. package/src/portfolio/v2/range.test.ts +66 -0
  208. package/src/portfolio/v2/range.ts +22 -8
  209. package/lib/__tests__/portfolio.d.ts +0 -2
  210. package/lib/__tests__/portfolio.d.ts.map +0 -1
  211. package/lib/__tests__/portfolio.js +0 -297
  212. package/lib/__tests__/portfolio.js.map +0 -1
  213. package/lib/__tests__/test-helpers/libcore-setup.d.ts +0 -3
  214. package/lib/__tests__/test-helpers/libcore-setup.d.ts.map +0 -1
  215. package/lib/__tests__/test-helpers/libcore-setup.js +0 -68
  216. package/lib/__tests__/test-helpers/libcore-setup.js.map +0 -1
  217. package/lib/__tests__/test-helpers/libcore-setup.native.d.ts +0 -10
  218. package/lib/__tests__/test-helpers/libcore-setup.native.d.ts.map +0 -1
  219. package/lib/__tests__/test-helpers/libcore-setup.native.js +0 -16
  220. package/lib/__tests__/test-helpers/libcore-setup.native.js.map +0 -1
  221. package/lib/countervalues/logic.test.d.ts +0 -2
  222. package/lib/countervalues/logic.test.d.ts.map +0 -1
  223. package/lib/countervalues/logic.test.js.map +0 -1
  224. package/lib/families/algorand/test-dataset.d.ts +0 -5
  225. package/lib/families/algorand/test-dataset.d.ts.map +0 -1
  226. package/lib/families/algorand/test-dataset.js.map +0 -1
  227. package/lib/families/bitcoin/test-dataset.d.ts +0 -5
  228. package/lib/families/bitcoin/test-dataset.d.ts.map +0 -1
  229. package/lib/families/bitcoin/test-dataset.js.map +0 -1
  230. package/lib/families/cardano/bridge.test.d.ts +0 -2
  231. package/lib/families/cardano/bridge.test.d.ts.map +0 -1
  232. package/lib/families/cardano/bridge.test.js +0 -11
  233. package/lib/families/cardano/bridge.test.js.map +0 -1
  234. package/lib/families/cardano/test-dataset.d.ts +0 -5
  235. package/lib/families/cardano/test-dataset.d.ts.map +0 -1
  236. package/lib/families/cardano/test-dataset.js.map +0 -1
  237. package/lib/families/cosmos/bridge.test.d.ts +0 -2
  238. package/lib/families/cosmos/bridge.test.d.ts.map +0 -1
  239. package/lib/families/cosmos/bridge.test.js +0 -11
  240. package/lib/families/cosmos/bridge.test.js.map +0 -1
  241. package/lib/families/cosmos/test-dataset.d.ts +0 -5
  242. package/lib/families/cosmos/test-dataset.d.ts.map +0 -1
  243. package/lib/families/cosmos/test-dataset.js.map +0 -1
  244. package/lib/families/crypto_org/test-dataset.d.ts +0 -5
  245. package/lib/families/crypto_org/test-dataset.d.ts.map +0 -1
  246. package/lib/families/crypto_org/test-dataset.js +0 -12
  247. package/lib/families/crypto_org/test-dataset.js.map +0 -1
  248. package/lib/families/elrond/test-dataset.d.ts +0 -5
  249. package/lib/families/elrond/test-dataset.d.ts.map +0 -1
  250. package/lib/families/elrond/test-dataset.js.map +0 -1
  251. package/lib/families/ethereum/modules/compound.resilience.test.d.ts +0 -2
  252. package/lib/families/ethereum/modules/compound.resilience.test.d.ts.map +0 -1
  253. package/lib/families/ethereum/modules/compound.resilience.test.js.map +0 -1
  254. package/lib/families/ethereum/synchronisation.test.d.ts +0 -2
  255. package/lib/families/ethereum/synchronisation.test.d.ts.map +0 -1
  256. package/lib/families/ethereum/synchronisation.test.js.map +0 -1
  257. package/lib/families/ethereum/test-dataset.d.ts +0 -6
  258. package/lib/families/ethereum/test-dataset.d.ts.map +0 -1
  259. package/lib/families/ethereum/test-dataset.js.map +0 -1
  260. package/lib/families/filecoin/bridge.test.d.ts +0 -2
  261. package/lib/families/filecoin/bridge.test.d.ts.map +0 -1
  262. package/lib/families/filecoin/bridge.test.js +0 -92
  263. package/lib/families/filecoin/bridge.test.js.map +0 -1
  264. package/lib/families/filecoin/test-dataset.d.ts +0 -5
  265. package/lib/families/filecoin/test-dataset.d.ts.map +0 -1
  266. package/lib/families/filecoin/test-dataset.js.map +0 -1
  267. package/lib/families/hedera/test-dataset.d.ts +0 -5
  268. package/lib/families/hedera/test-dataset.d.ts.map +0 -1
  269. package/lib/families/hedera/test-dataset.js.map +0 -1
  270. package/lib/families/polkadot/bridge.test.d.ts +0 -2
  271. package/lib/families/polkadot/bridge.test.d.ts.map +0 -1
  272. package/lib/families/polkadot/bridge.test.js +0 -145
  273. package/lib/families/polkadot/bridge.test.js.map +0 -1
  274. package/lib/families/polkadot/test-dataset.d.ts +0 -5
  275. package/lib/families/polkadot/test-dataset.d.ts.map +0 -1
  276. package/lib/families/polkadot/test-dataset.js.map +0 -1
  277. package/lib/families/ripple/bridge.test.d.ts +0 -2
  278. package/lib/families/ripple/bridge.test.d.ts.map +0 -1
  279. package/lib/families/ripple/bridge.test.js +0 -11
  280. package/lib/families/ripple/bridge.test.js.map +0 -1
  281. package/lib/families/ripple/test-dataset.d.ts +0 -5
  282. package/lib/families/ripple/test-dataset.d.ts.map +0 -1
  283. package/lib/families/ripple/test-dataset.js.map +0 -1
  284. package/lib/families/solana/bridge.test.d.ts +0 -2
  285. package/lib/families/solana/bridge.test.d.ts.map +0 -1
  286. package/lib/families/solana/bridge.test.js +0 -11
  287. package/lib/families/solana/bridge.test.js.map +0 -1
  288. package/lib/families/solana/test-dataset.d.ts +0 -23
  289. package/lib/families/solana/test-dataset.d.ts.map +0 -1
  290. package/lib/families/solana/test-dataset.js.map +0 -1
  291. package/lib/families/solana/test-specifics.d.ts +0 -9
  292. package/lib/families/solana/test-specifics.d.ts.map +0 -1
  293. package/lib/families/solana/test-specifics.js +0 -237
  294. package/lib/families/solana/test-specifics.js.map +0 -1
  295. package/lib/families/stellar/bridge.test.d.ts +0 -2
  296. package/lib/families/stellar/bridge.test.d.ts.map +0 -1
  297. package/lib/families/stellar/bridge.test.js +0 -11
  298. package/lib/families/stellar/bridge.test.js.map +0 -1
  299. package/lib/families/stellar/test-dataset.d.ts +0 -7
  300. package/lib/families/stellar/test-dataset.d.ts.map +0 -1
  301. package/lib/families/stellar/test-dataset.js.map +0 -1
  302. package/lib/families/tezos/bridge.test.d.ts +0 -2
  303. package/lib/families/tezos/bridge.test.d.ts.map +0 -1
  304. package/lib/families/tezos/bridge.test.js +0 -81
  305. package/lib/families/tezos/bridge.test.js.map +0 -1
  306. package/lib/families/tezos/test-dataset.d.ts.map +0 -1
  307. package/lib/families/tezos/test-dataset.js.map +0 -1
  308. package/lib/families/tron/test-dataset.d.ts +0 -5
  309. package/lib/families/tron/test-dataset.d.ts.map +0 -1
  310. package/lib/families/tron/test-dataset.js.map +0 -1
  311. package/lib/generated/test-dataset.d.ts +0 -19
  312. package/lib/generated/test-dataset.d.ts.map +0 -1
  313. package/lib/generated/test-dataset.js +0 -38
  314. package/lib/generated/test-dataset.js.map +0 -1
  315. package/lib/portfolio/index.d.ts +0 -30
  316. package/lib/portfolio/index.d.ts.map +0 -1
  317. package/lib/portfolio/index.js +0 -399
  318. package/lib/portfolio/index.js.map +0 -1
  319. package/lib/portfolio/range.d.ts +0 -12
  320. package/lib/portfolio/range.d.ts.map +0 -1
  321. package/lib/portfolio/range.js +0 -73
  322. package/lib/portfolio/range.js.map +0 -1
  323. package/src/__tests__/__snapshots__/portfolio.ts.snap +0 -2770
  324. package/src/__tests__/portfolio.ts +0 -360
  325. package/src/__tests__/test-helpers/libcore-setup.native.ts +0 -19
  326. package/src/__tests__/test-helpers/libcore-setup.ts +0 -51
  327. package/src/families/bitcoin/bridge.test.ts.bak +0 -6
  328. package/src/families/cardano/bridge.test.ts +0 -6
  329. package/src/families/cosmos/bridge.test.ts +0 -6
  330. package/src/families/crypto_org/test-dataset.ts +0 -13
  331. package/src/families/ethereum/bridge.test.ts.bak +0 -8
  332. package/src/families/filecoin/bridge.test.ts +0 -39
  333. package/src/families/polkadot/bridge.test.ts +0 -81
  334. package/src/families/ripple/bridge.test.ts +0 -6
  335. package/src/families/solana/bridge.test.ts +0 -6
  336. package/src/families/solana/test-specifics.ts +0 -170
  337. package/src/families/stellar/bridge.test.ts +0 -6
  338. package/src/families/tezos/bridge.test.ts +0 -24
  339. package/src/generated/test-dataset.ts +0 -48
  340. package/src/portfolio/index.ts +0 -505
  341. package/src/portfolio/range.ts +0 -71
@@ -1,3 +1,6 @@
1
+ import "../../__tests__/test-helpers/setup";
2
+ import { testBridge } from "../../__tests__/test-helpers/bridge";
3
+
1
4
  import invariant from "invariant";
2
5
  import { BigNumber } from "bignumber.js";
3
6
  import type { AccountRaw, DatasetTest } from "../../types";
@@ -11,24 +14,7 @@ import type { Transaction } from "./types";
11
14
  import ethereumScanAccounts1 from "./datasets/ethereum.scanAccounts.1";
12
15
  import ethereum_classic from "./datasets/ethereum_classic";
13
16
  import { syncAccount } from "../../__tests__/test-helpers/bridge";
14
- export const ethereum1: AccountRaw = {
15
- id: "js:1:ethereum:0x0E3F0bb9516F01f2C34c25E0957518b8aC9414c5:",
16
- seedIdentifier: "0x0E3F0bb9516F01f2C34c25E0957518b8aC9414c5",
17
- name: "Ethereum legacy xpub6Bem...JyAdpYZy",
18
- derivationMode: "",
19
- index: 0,
20
- freshAddress: "0x0E3F0bb9516F01f2C34c25E0957518b8aC9414c5",
21
- freshAddressPath: "44'/60'/0'/0/0",
22
- freshAddresses: [],
23
- pendingOperations: [],
24
- operations: [],
25
- currencyId: "ethereum",
26
- unitMagnitude: 18,
27
- balance: "",
28
- blockHeight: 0,
29
- lastSyncDate: "",
30
- xpub: "",
31
- };
17
+ import { ethereum1 } from "./datasets/ethereum1";
32
18
 
33
19
  const expectedTokenAccount = (a) => {
34
20
  invariant(a && a.type === "TokenAccount", "expected token account");
@@ -171,4 +157,5 @@ const dataset: DatasetTest<Transaction> = {
171
157
  ethereum_classic,
172
158
  },
173
159
  };
174
- export default dataset;
160
+
161
+ testBridge(dataset);
@@ -0,0 +1,20 @@
1
+ import type { AccountRaw } from "../../../types";
2
+
3
+ export const ethereum1: AccountRaw = {
4
+ id: "js:1:ethereum:0x0E3F0bb9516F01f2C34c25E0957518b8aC9414c5:",
5
+ seedIdentifier: "0x0E3F0bb9516F01f2C34c25E0957518b8aC9414c5",
6
+ name: "Ethereum legacy xpub6Bem...JyAdpYZy",
7
+ derivationMode: "",
8
+ index: 0,
9
+ freshAddress: "0x0E3F0bb9516F01f2C34c25E0957518b8aC9414c5",
10
+ freshAddressPath: "44'/60'/0'/0/0",
11
+ freshAddresses: [],
12
+ pendingOperations: [],
13
+ operations: [],
14
+ currencyId: "ethereum",
15
+ unitMagnitude: 18,
16
+ balance: "",
17
+ blockHeight: 0,
18
+ lastSyncDate: "",
19
+ xpub: "",
20
+ };
@@ -4,7 +4,7 @@ import { fromAccountRaw } from "../../../account";
4
4
  import type { Account } from "../../../types";
5
5
  import { getAccountBridge } from "../../../bridge";
6
6
  import { makeBridgeCacheSystem } from "../../../bridge/cache";
7
- import { ethereum1 } from "../test-dataset";
7
+ import { ethereum1 } from "../datasets/ethereum1";
8
8
  import { setEnv } from "../../../env";
9
9
  setEnv("COMPOUND_API", "https://status.ledger.com"); // hack to hit an endpoint that actually is going to 404
10
10
 
@@ -5,7 +5,7 @@ import { getAccountCurrency } from "../../account/helpers";
5
5
  import type { Account, SubAccount } from "../../types";
6
6
  import { getAccountBridge } from "../../bridge";
7
7
  import { makeBridgeCacheSystem } from "../../bridge/cache";
8
- import { ethereum1 } from "./test-dataset";
8
+ import { ethereum1 } from "./datasets/ethereum1";
9
9
 
10
10
  describe("blacklistedTokenIds functionality", () => {
11
11
  const account = fromAccountRaw(ethereum1);
@@ -1,10 +1,17 @@
1
+ import "../../__tests__/test-helpers/setup";
2
+ import { testBridge } from "../../__tests__/test-helpers/bridge";
3
+ import { getAccountBridge } from "../../bridge";
4
+ import {
5
+ decodeAccountId,
6
+ encodeAccountId,
7
+ fromAccountRaw,
8
+ } from "../../account";
1
9
  import { BigNumber } from "bignumber.js";
2
10
  import {
3
11
  AmountRequired,
4
12
  InvalidAddress,
5
13
  NotEnoughBalance,
6
14
  } from "@ledgerhq/errors";
7
-
8
15
  import type { DatasetTest } from "../../types";
9
16
  import type { Transaction } from "./types";
10
17
  import { fromTransactionRaw } from "../filecoin/transaction";
@@ -13,7 +20,6 @@ import { CurrenciesData } from "../../types";
13
20
  const SEED_IDENTIFIER = "f1p74d4mlmeyc4agflhjqsnvoyzyfdai7fmkyso2a";
14
21
  const ACCOUNT_1 = "f1p74d4mlmeyc4agflhjqsnvoyzyfdai7fmkyso2a";
15
22
 
16
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
17
23
  const filecoin: CurrenciesData<Transaction> = {
18
24
  FIXME_ignoreAccountFields: [],
19
25
  scanAccounts: [
@@ -150,4 +156,30 @@ const dataset: DatasetTest<Transaction> = {
150
156
  filecoin,
151
157
  },
152
158
  };
153
- export default dataset;
159
+
160
+ testBridge(dataset);
161
+
162
+ describe("estimateMaxSpendable", () => {
163
+ test("it should failed on invalid recipient", async () => {
164
+ const accounts = dataset.currencies["filecoin"].accounts || [];
165
+ const accountData = accounts[0];
166
+
167
+ const account = fromAccountRaw({
168
+ ...accountData.raw,
169
+ id: encodeAccountId({
170
+ ...decodeAccountId(accountData.raw.id),
171
+ type: dataset.implementations[0],
172
+ }),
173
+ });
174
+
175
+ const accountBridge = getAccountBridge(account);
176
+ const estimate = async () => {
177
+ await accountBridge.estimateMaxSpendable({
178
+ account,
179
+ transaction: { recipient: "notavalidrecipient" },
180
+ });
181
+ };
182
+
183
+ await expect(estimate).rejects.toThrowError(new InvalidAddress());
184
+ });
185
+ });
@@ -0,0 +1,5 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`hedera currency bridge scanAccounts hedera seed 1 1`] = `Array []`;
4
+
5
+ exports[`hedera currency bridge scanAccounts hedera seed 1 2`] = `Array []`;
@@ -1,3 +1,5 @@
1
+ import "../../__tests__/test-helpers/setup";
2
+ import { testBridge } from "../../__tests__/test-helpers/bridge";
1
3
  import type { CurrenciesData, DatasetTest } from "../../types";
2
4
  import type { Transaction } from "./types";
3
5
  import {
@@ -88,7 +90,8 @@ const hedera: CurrenciesData<Transaction> = {
88
90
  const dataset: DatasetTest<Transaction> = {
89
91
  implementations: ["js"],
90
92
  currencies: {
91
- // hedera, // LIVE-2376
93
+ hedera,
92
94
  },
93
95
  };
94
- export default dataset;
96
+
97
+ testBridge(dataset);
@@ -1,4 +1,9 @@
1
+ import "../../__tests__/test-helpers/setup";
2
+ import { testBridge } from "../../__tests__/test-helpers/bridge";
3
+ import { disconnect } from "./api";
1
4
  import { BigNumber } from "bignumber.js";
5
+ import { canUnbond, MAX_UNLOCKINGS } from "./logic";
6
+ import type { Account } from "../../types";
2
7
  import {
3
8
  NotEnoughBalance,
4
9
  RecipientRequired,
@@ -15,7 +20,7 @@ import {
15
20
  PolkadotAllFundsWarning,
16
21
  PolkadotDoMaxSendInstead,
17
22
  } from "./errors";
18
- import type { DatasetTest } from "../../types";
23
+ import type { DatasetTest, CurrenciesData } from "../../types";
19
24
  import { fromTransactionRaw } from "./transaction";
20
25
  import type { Transaction } from "./types";
21
26
  const ACCOUNT_SAME_STASHCONTROLLER =
@@ -26,8 +31,7 @@ const ACCOUNT_EMPTY = "111111111111111111111111111111111HC1";
26
31
  const ACCOUNT_WITH_NO_OPERATION =
27
32
  "12EsPA79dvhtjp1bYvCiEWPsQmmdKGss44GzE3CT9tTo9g4Q";
28
33
 
29
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
30
- const polkadot = {
34
+ const polkadot: CurrenciesData<Transaction> = {
31
35
  FIXME_ignoreAccountFields: [
32
36
  "polkadotResources.unlockings", // Due to completion date that change everyday (estimated time)
33
37
  "polkadotResources.nominations", // TODO: try to only ignore status
@@ -685,7 +689,79 @@ const polkadot = {
685
689
  const dataset: DatasetTest<Transaction> = {
686
690
  implementations: ["js"],
687
691
  currencies: {
688
- // polkadot, // LL-7806
692
+ polkadot,
689
693
  },
690
694
  };
691
- export default dataset;
695
+
696
+ // Disconnect all api clients that could be open.
697
+ afterAll(async () => {
698
+ await disconnect();
699
+ });
700
+
701
+ testBridge(dataset);
702
+
703
+ describe("canUnbond", () => {
704
+ test("can unbond", () => {
705
+ const account: Partial<Account> = {
706
+ polkadotResources: {
707
+ controller: "",
708
+ stash: "",
709
+ nonce: 0,
710
+ numSlashingSpans: 0,
711
+ lockedBalance: new BigNumber(10000),
712
+ unlockedBalance: new BigNumber(0),
713
+ unlockingBalance: new BigNumber(0),
714
+ nominations: [],
715
+ unlockings: [
716
+ ...Array(MAX_UNLOCKINGS - 1).map(() => ({
717
+ amount: new BigNumber(Math.random()),
718
+ completionDate: new Date(),
719
+ })),
720
+ ],
721
+ },
722
+ };
723
+ expect(canUnbond(account as Account)).toBeTruthy();
724
+ });
725
+ test("can't unbond because unlockings is too much", () => {
726
+ const account: Partial<Account> = {
727
+ polkadotResources: {
728
+ controller: "",
729
+ stash: "",
730
+ nonce: 0,
731
+ numSlashingSpans: 0,
732
+ lockedBalance: new BigNumber(1000000),
733
+ unlockedBalance: new BigNumber(0),
734
+ unlockingBalance: new BigNumber(0),
735
+ nominations: [],
736
+ unlockings: [
737
+ ...Array(MAX_UNLOCKINGS).map(() => ({
738
+ amount: new BigNumber(Math.random()),
739
+ completionDate: new Date(),
740
+ })),
741
+ ],
742
+ },
743
+ };
744
+ expect(canUnbond(account as Account)).toBeFalsy();
745
+ });
746
+ test("can't unbond because not enough lockedBalance", () => {
747
+ const account: Partial<Account> = {
748
+ polkadotResources: {
749
+ controller: "",
750
+ stash: "",
751
+ nonce: 0,
752
+ numSlashingSpans: 0,
753
+ lockedBalance: new BigNumber(100),
754
+ unlockedBalance: new BigNumber(0),
755
+ unlockingBalance: new BigNumber(100),
756
+ nominations: [],
757
+ unlockings: [
758
+ ...Array(MAX_UNLOCKINGS).map(() => ({
759
+ amount: new BigNumber(Math.random()),
760
+ completionDate: new Date(),
761
+ })),
762
+ ],
763
+ },
764
+ };
765
+ expect(canUnbond(account as Account)).toBeFalsy();
766
+ });
767
+ });
@@ -1,3 +1,6 @@
1
+ import "../../__tests__/test-helpers/setup";
2
+ import { testBridge } from "../../__tests__/test-helpers/bridge";
3
+
1
4
  // import { getCryptoCurrencyById } from "@ledgerhq/cryptoassets";
2
5
  import { BigNumber } from "bignumber.js";
3
6
  import type { DatasetTest } from "../../types";
@@ -160,4 +163,5 @@ const dataset: DatasetTest<Transaction> = {
160
163
  },
161
164
  },
162
165
  };
163
- export default dataset;
166
+
167
+ testBridge(dataset);
@@ -1,8 +1,8 @@
1
+ import "../../__tests__/test-helpers/setup";
2
+ import { testBridge } from "../../__tests__/test-helpers/bridge";
1
3
  import BigNumber from "bignumber.js";
2
4
  import { CurrenciesData, DatasetTest, encodeAccountId } from "../../types";
3
-
4
- import { Transaction, TransactionModel } from "./types";
5
-
5
+ import { SolanaStake, Transaction, TransactionModel } from "./types";
6
6
  import scanAccounts1 from "./datasets/solana.scanAccounts.1";
7
7
  import {
8
8
  AmountRequired,
@@ -32,9 +32,17 @@ import createTransaction from "./js-createTransaction";
32
32
  import { compact } from "lodash/fp";
33
33
  import { assertUnreachable } from "./utils";
34
34
  import { getEnv } from "../../env";
35
+ import { Account, TransactionStatus } from "../../types";
36
+ import { ChainAPI } from "./api";
37
+ import {
38
+ SolanaStakeAccountIsNotDelegatable,
39
+ SolanaStakeAccountValidatorIsUnchangeable,
40
+ } from "./errors";
41
+ import getTransactionStatus from "./js-getTransactionStatus";
42
+ import { prepareTransaction } from "./js-prepareTransaction";
35
43
 
36
44
  // do not change real properties or the test will break
37
- export const testOnChainData = {
45
+ const testOnChainData = {
38
46
  // --- real props ---
39
47
  unfundedAddress: "7b6Q3ap8qRzfyvDw1Qce3fUV8C7WgFNzJQwYNTJm3KQo",
40
48
  // 0/0
@@ -951,4 +959,161 @@ function stakingTests(): TransactionTestSpec[] {
951
959
  ];
952
960
  }
953
961
 
954
- export default dataset;
962
+ testBridge(dataset);
963
+
964
+ const baseAccount = {
965
+ balance: new BigNumber(0),
966
+ spendableBalance: new BigNumber(0),
967
+ } as Account;
968
+
969
+ const baseTx = {
970
+ family: "solana",
971
+ recipient: "",
972
+ amount: new BigNumber(0),
973
+ } as Transaction;
974
+
975
+ const baseAPI = {
976
+ getFeeForMessage: (_msg: unknown) =>
977
+ Promise.resolve(testOnChainData.fees.lamportsPerSignature),
978
+ } as ChainAPI;
979
+
980
+ type StakeTestSpec = {
981
+ activationState: SolanaStake["activation"]["state"];
982
+ txModel: Transaction["model"];
983
+ expectedErrors: Record<string, Error>;
984
+ };
985
+
986
+ /**
987
+ * Some business logic can not be described in terms of transactions and expected status
988
+ * in the test datasets, like stake activation/deactivation, because stake activation is
989
+ * not determenistic and changes with time. Hence the tests here to mock data
990
+ * to be determenistic.
991
+ */
992
+
993
+ describe("solana staking", () => {
994
+ test("stake.delegate :: status is error: stake account is not delegatable", async () => {
995
+ const stakeDelegateModel: Transaction["model"] & {
996
+ kind: "stake.delegate";
997
+ } = {
998
+ kind: "stake.delegate",
999
+ uiState: {
1000
+ stakeAccAddr: testOnChainData.unfundedAddress,
1001
+ voteAccAddr: testOnChainData.validatorAddress,
1002
+ },
1003
+ };
1004
+
1005
+ const stakeTests: StakeTestSpec[] = [
1006
+ {
1007
+ activationState: "activating",
1008
+ txModel: stakeDelegateModel,
1009
+ expectedErrors: {
1010
+ fee: new NotEnoughBalance(),
1011
+ stakeAccAddr: new SolanaStakeAccountIsNotDelegatable(),
1012
+ },
1013
+ },
1014
+ {
1015
+ activationState: "active",
1016
+ txModel: stakeDelegateModel,
1017
+ expectedErrors: {
1018
+ fee: new NotEnoughBalance(),
1019
+ stakeAccAddr: new SolanaStakeAccountIsNotDelegatable(),
1020
+ },
1021
+ },
1022
+ {
1023
+ activationState: "deactivating",
1024
+ txModel: {
1025
+ ...stakeDelegateModel,
1026
+ uiState: {
1027
+ ...stakeDelegateModel.uiState,
1028
+ voteAccAddr: testOnChainData.unfundedAddress,
1029
+ },
1030
+ },
1031
+ expectedErrors: {
1032
+ fee: new NotEnoughBalance(),
1033
+ stakeAccAddr: new SolanaStakeAccountValidatorIsUnchangeable(),
1034
+ },
1035
+ },
1036
+ ];
1037
+
1038
+ for (const stakeTest of stakeTests) {
1039
+ await runStakeTest(stakeTest);
1040
+ }
1041
+ });
1042
+ });
1043
+
1044
+ async function runStakeTest(stakeTestSpec: StakeTestSpec) {
1045
+ const api = {
1046
+ ...baseAPI,
1047
+ getMinimumBalanceForRentExemption: () =>
1048
+ Promise.resolve(testOnChainData.fees.stakeAccountRentExempt),
1049
+ getAccountInfo: () => {
1050
+ return Promise.resolve({ data: mockedVoteAccount } as any);
1051
+ },
1052
+ } as ChainAPI;
1053
+
1054
+ const account: Account = {
1055
+ ...baseAccount,
1056
+ solanaResources: {
1057
+ stakes: [
1058
+ {
1059
+ stakeAccAddr: testOnChainData.unfundedAddress,
1060
+ delegation: {
1061
+ stake: 1,
1062
+ voteAccAddr: testOnChainData.validatorAddress,
1063
+ },
1064
+ activation: {
1065
+ state: stakeTestSpec.activationState,
1066
+ },
1067
+ } as SolanaStake,
1068
+ ],
1069
+ },
1070
+ };
1071
+
1072
+ const tx: Transaction = {
1073
+ ...baseTx,
1074
+ model: stakeTestSpec.txModel,
1075
+ };
1076
+
1077
+ const preparedTx = await prepareTransaction(account, tx, api);
1078
+ const status = await getTransactionStatus(account, preparedTx);
1079
+
1080
+ const expectedStatus: TransactionStatus = {
1081
+ amount: new BigNumber(0),
1082
+ estimatedFees: new BigNumber(testOnChainData.fees.lamportsPerSignature),
1083
+ totalSpent: new BigNumber(testOnChainData.fees.lamportsPerSignature),
1084
+ errors: stakeTestSpec.expectedErrors,
1085
+ warnings: {},
1086
+ };
1087
+
1088
+ expect(status).toEqual(expectedStatus);
1089
+ }
1090
+
1091
+ const mockedVoteAccount = {
1092
+ parsed: {
1093
+ info: {
1094
+ authorizedVoters: [
1095
+ {
1096
+ authorizedVoter: "EvnRmnMrd69kFdbLMxWkTn1icZ7DCceRhvmb2SJXqDo4",
1097
+ epoch: 283,
1098
+ },
1099
+ ],
1100
+ authorizedWithdrawer: "EvnRmnMrd69kFdbLMxWkTn1icZ7DCceRhvmb2SJXqDo4",
1101
+ commission: 7,
1102
+ epochCredits: [
1103
+ {
1104
+ credits: "98854605",
1105
+ epoch: 283,
1106
+ previousCredits: "98728105",
1107
+ },
1108
+ ],
1109
+ lastTimestamp: { slot: 122422797, timestamp: 1645796249 },
1110
+ nodePubkey: "EvnRmnMrd69kFdbLMxWkTn1icZ7DCceRhvmb2SJXqDo4",
1111
+ priorVoters: [],
1112
+ rootSlot: 122422766,
1113
+ votes: [{ confirmationCount: 1, slot: 122422797 }],
1114
+ },
1115
+ type: "vote",
1116
+ },
1117
+ program: "vote",
1118
+ space: 3731,
1119
+ };
@@ -1,3 +1,5 @@
1
+ import "../../__tests__/test-helpers/setup";
2
+ import { testBridge } from "../../__tests__/test-helpers/bridge";
1
3
  import { BigNumber } from "bignumber.js";
2
4
  import type { DatasetTest } from "../../types";
3
5
  import {
@@ -13,10 +15,10 @@ import {
13
15
  addMultisignStellarMockAddresses,
14
16
  } from "./bridge/mock";
15
17
 
16
- export const notCreatedStellarMockAddress =
18
+ const notCreatedStellarMockAddress =
17
19
  "GAW46JE3SHIAYLNNNQCAZFQ437WB5ZH7LDRDWR5LVDWHCTHCKYB6RCCH";
18
20
 
19
- export const multisignStellarMockAddress =
21
+ const multisignStellarMockAddress =
20
22
  "GCDDN6T2LJN3T7SPWJQV6BCCL5KNY5GBN7X4CMSZLDEXDHXAH32TOAHS";
21
23
 
22
24
  addNotCreatedStellarMockAddresses(notCreatedStellarMockAddress);
@@ -347,4 +349,4 @@ const dataset: DatasetTest<Transaction> = {
347
349
  },
348
350
  };
349
351
 
350
- export default dataset;
352
+ testBridge(dataset);
@@ -2,11 +2,13 @@ import { getMainAccount } from "../../account";
2
2
  import createTransaction from "./js-createTransaction";
3
3
  import prepareTransaction from "./js-prepareTransaction";
4
4
  import getTransactionStatus from "./js-getTransactionStatus";
5
- import { notCreatedStellarMockAddress } from "./test-dataset";
6
5
  import type { Account, AccountLike } from "../../types";
7
6
  import type { Transaction } from "./types";
8
7
  import BigNumber from "bignumber.js";
9
8
 
9
+ const notCreatedStellarMockAddress =
10
+ "GAW46JE3SHIAYLNNNQCAZFQ437WB5ZH7LDRDWR5LVDWHCTHCKYB6RCCH";
11
+
10
12
  const estimateMaxSpendable = async ({
11
13
  account,
12
14
  parentAccount,
@@ -1,3 +1,9 @@
1
+ import "../../__tests__/test-helpers/setup";
2
+ import { testBridge } from "../../__tests__/test-helpers/bridge";
3
+ import { fromAccountRaw } from "../../account";
4
+ import { loadAccountDelegation, listBakers } from "./bakers";
5
+ import whitelist from "./bakers.whitelist-default";
6
+
1
7
  import { AmountRequired, NotEnoughBalance } from "@ledgerhq/errors";
2
8
  import type { DatasetTest } from "../../types";
3
9
  import type { Transaction } from "./types";
@@ -100,7 +106,6 @@ const dataset: DatasetTest<Transaction> = {
100
106
  },
101
107
  },
102
108
  };
103
- export default dataset;
104
109
 
105
110
  function makeAccount(name, pubkey, address, derivationMode) {
106
111
  return {
@@ -123,3 +128,19 @@ function makeAccount(name, pubkey, address, derivationMode) {
123
128
  subAccounts: [],
124
129
  };
125
130
  }
131
+
132
+ testBridge(dataset);
133
+
134
+ describe("tezos bakers", () => {
135
+ // FIXME Flaky test that will fail every time a Tezos baker is discontinued
136
+ test("getting the bakers", async () => {
137
+ const list = await listBakers(whitelist);
138
+ expect(list.map((o) => o.address)).toEqual(whitelist);
139
+ });
140
+ // TODO we'll need two accounts to test diff cases
141
+ test("load account baker info", async () => {
142
+ const account = fromAccountRaw(accountTZrevealedDelegating);
143
+ const delegation = await loadAccountDelegation(account);
144
+ expect(delegation).toBe(null);
145
+ });
146
+ });
@@ -208,7 +208,7 @@ const txToOp =
208
208
  type = "CREATE";
209
209
  maybeValue = new BigNumber(tx.contractBalance || 0);
210
210
  senders = [address];
211
- recipients = [tx.originatedContract.address];
211
+ recipients = [tx.originatedContract?.address || ""];
212
212
  break;
213
213
  case "activation":
214
214
  type = "IN";
@@ -1,6 +1,8 @@
1
+ import "../../__tests__/test-helpers/setup";
2
+ import { testBridge } from "../../__tests__/test-helpers/bridge";
1
3
  import invariant from "invariant";
2
4
  import { BigNumber } from "bignumber.js";
3
- import type { DatasetTest } from "../../types";
5
+ import type { CurrenciesData, DatasetTest } from "../../types";
4
6
  import { fromTransactionRaw } from "./transaction";
5
7
  import type { Transaction } from "./types";
6
8
  import { activationFees } from "./constants";
@@ -38,8 +40,7 @@ const getTokenAccountId = (account, id) =>
38
40
  )
39
41
  ).id;
40
42
 
41
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
42
- const tron = {
43
+ const tron: CurrenciesData<Transaction> = {
43
44
  FIXME_ignoreAccountFields: [
44
45
  "tronResources.cacheTransactionInfoById", // this is a cache, don't save it
45
46
  "tronResources.unwithdrawnReward", // it changes every vote cycles
@@ -771,8 +772,8 @@ const tron = {
771
772
  const dataset: DatasetTest<Transaction> = {
772
773
  implementations: ["tronjs"],
773
774
  currencies: {
774
- // tron, // LL-7611
775
+ tron,
775
776
  },
776
777
  };
777
778
 
778
- export default dataset;
779
+ testBridge(dataset);
@@ -316,8 +316,11 @@ export function appCandidatesMatches(
316
316
  hackBadSemver(appCandidate.firmware),
317
317
  searchFirmware
318
318
  ))) &&
319
- (!search.appVersion ||
320
- semver.satisfies(appCandidate.appVersion, search.appVersion))
319
+ ((!search.appVersion &&
320
+ !appCandidate.appVersion.includes("prerelease") &&
321
+ !appCandidate.appVersion.includes("rc")) ||
322
+ (search.appVersion &&
323
+ semver.satisfies(appCandidate.appVersion, search.appVersion)))
321
324
  );
322
325
  }
323
326
  export const findAppCandidate = (
@@ -24,8 +24,13 @@ import type {
24
24
  ValueChange,
25
25
  } from "./types";
26
26
  import { getPortfolioRangeConfig, getDates } from "./range";
27
- import { defaultAssetsDistribution } from "../";
28
- import type { AssetsDistributionOpts } from "../";
27
+
28
+ export const defaultAssetsDistribution = {
29
+ minShowFirst: 1,
30
+ maxShowFirst: 6,
31
+ showFirstThreshold: 0.95,
32
+ };
33
+ export type AssetsDistributionOpts = typeof defaultAssetsDistribution;
29
34
 
30
35
  export function getPortfolioCount(
31
36
  accounts: AccountLike[],