@ledgerhq/live-common 21.29.0 → 21.32.0-hotfix.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 (428) hide show
  1. package/lib/__tests__/families/bitcoin/wallet-btc/wallet.integration.test.js +1 -0
  2. package/lib/__tests__/families/bitcoin/wallet-btc/wallet.integration.test.js.map +1 -1
  3. package/lib/__tests__/families/bitcoin/wallet-btc/xpub.getAddress.d.ts +2 -0
  4. package/lib/__tests__/families/bitcoin/wallet-btc/xpub.getAddress.d.ts.map +1 -0
  5. package/lib/__tests__/families/bitcoin/wallet-btc/xpub.getAddress.js +126 -0
  6. package/lib/__tests__/families/bitcoin/wallet-btc/xpub.getAddress.js.map +1 -0
  7. package/lib/__tests__/families/bitcoin/wallet-btc/xpub.pickingStrategies.integration.test.js +0 -10
  8. package/lib/__tests__/families/bitcoin/wallet-btc/xpub.pickingStrategies.integration.test.js.map +1 -1
  9. package/lib/__tests__/test-helpers/bridge.js +1 -1
  10. package/lib/__tests__/test-helpers/bridge.js.map +1 -1
  11. package/lib/__tests__/test-helpers/setup.js +1 -0
  12. package/lib/__tests__/test-helpers/setup.js.map +1 -1
  13. package/lib/account/support.d.ts.map +1 -1
  14. package/lib/account/support.js.map +1 -1
  15. package/lib/api/Ethereum.d.ts.map +1 -1
  16. package/lib/api/Ethereum.js +1 -0
  17. package/lib/api/Ethereum.js.map +1 -1
  18. package/lib/apps/hw.d.ts.map +1 -1
  19. package/lib/apps/hw.js +8 -3
  20. package/lib/apps/hw.js.map +1 -1
  21. package/lib/apps/logic.d.ts.map +1 -1
  22. package/lib/apps/logic.js +7 -5
  23. package/lib/apps/logic.js.map +1 -1
  24. package/lib/apps/polyfill.d.ts.map +1 -1
  25. package/lib/apps/polyfill.js +1 -0
  26. package/lib/apps/polyfill.js.map +1 -1
  27. package/lib/bot/engine.d.ts.map +1 -1
  28. package/lib/bot/engine.js +4 -1
  29. package/lib/bot/engine.js.map +1 -1
  30. package/lib/bridge/jsHelpers.js +1 -1
  31. package/lib/data/icons/react/celo.d.ts +8 -0
  32. package/lib/data/icons/react/celo.d.ts.map +1 -0
  33. package/lib/data/icons/react/celo.js +32 -0
  34. package/lib/data/icons/react/celo.js.map +1 -0
  35. package/lib/data/icons/react/index.d.ts +1 -0
  36. package/lib/data/icons/react/index.d.ts.map +1 -1
  37. package/lib/data/icons/react/index.js +11 -8
  38. package/lib/data/icons/react/index.js.map +1 -1
  39. package/lib/data/icons/reactNative/celo.d.ts +8 -0
  40. package/lib/data/icons/reactNative/celo.d.ts.map +1 -0
  41. package/lib/data/icons/reactNative/celo.js +33 -0
  42. package/lib/data/icons/reactNative/celo.js.map +1 -0
  43. package/lib/data/icons/reactNative/index.d.ts +1 -0
  44. package/lib/data/icons/reactNative/index.d.ts.map +1 -1
  45. package/lib/data/icons/reactNative/index.js +11 -8
  46. package/lib/data/icons/reactNative/index.js.map +1 -1
  47. package/lib/env.d.ts +25 -5
  48. package/lib/env.d.ts.map +1 -1
  49. package/lib/env.js +20 -0
  50. package/lib/env.js.map +1 -1
  51. package/lib/env.react.d.ts +1 -1
  52. package/lib/env.react.d.ts.map +1 -1
  53. package/lib/errors.d.ts +3 -0
  54. package/lib/errors.d.ts.map +1 -1
  55. package/lib/errors.js +3 -2
  56. package/lib/errors.js.map +1 -1
  57. package/lib/exchange/platform/transfer/index.d.ts.map +1 -1
  58. package/lib/exchange/platform/transfer/index.js +15 -1
  59. package/lib/exchange/platform/transfer/index.js.map +1 -1
  60. package/lib/families/algorand/buildTransaction.d.ts +2 -2
  61. package/lib/families/algorand/buildTransaction.d.ts.map +1 -1
  62. package/lib/families/algorand/buildTransaction.js +13 -19
  63. package/lib/families/algorand/buildTransaction.js.map +1 -1
  64. package/lib/families/algorand/js-getFeesForTransaction.js +4 -6
  65. package/lib/families/algorand/js-getFeesForTransaction.js.map +1 -1
  66. package/lib/families/algorand/js-signOperation.js +3 -7
  67. package/lib/families/algorand/js-signOperation.js.map +1 -1
  68. package/lib/families/algorand/js-synchronization.d.ts.map +1 -1
  69. package/lib/families/algorand/js-synchronization.js +1 -0
  70. package/lib/families/algorand/js-synchronization.js.map +1 -1
  71. package/lib/families/bitcoin/js-signOperation.d.ts.map +1 -1
  72. package/lib/families/bitcoin/js-signOperation.js +3 -5
  73. package/lib/families/bitcoin/js-signOperation.js.map +1 -1
  74. package/lib/families/bitcoin/js-synchronisation.js +4 -4
  75. package/lib/families/bitcoin/js-synchronisation.js.map +1 -1
  76. package/lib/families/bitcoin/wallet-btc/crypto/base.d.ts +4 -3
  77. package/lib/families/bitcoin/wallet-btc/crypto/base.d.ts.map +1 -1
  78. package/lib/families/bitcoin/wallet-btc/crypto/base.js +8 -7
  79. package/lib/families/bitcoin/wallet-btc/crypto/base.js.map +1 -1
  80. package/lib/families/bitcoin/wallet-btc/crypto/bip32.js +2 -2
  81. package/lib/families/bitcoin/wallet-btc/crypto/bip32.js.map +1 -1
  82. package/lib/families/bitcoin/wallet-btc/crypto/bitcoin.d.ts +1 -1
  83. package/lib/families/bitcoin/wallet-btc/crypto/bitcoin.d.ts.map +1 -1
  84. package/lib/families/bitcoin/wallet-btc/crypto/bitcoin.js +3 -7
  85. package/lib/families/bitcoin/wallet-btc/crypto/bitcoin.js.map +1 -1
  86. package/lib/families/bitcoin/wallet-btc/crypto/bitcoincash.d.ts +3 -4
  87. package/lib/families/bitcoin/wallet-btc/crypto/bitcoincash.d.ts.map +1 -1
  88. package/lib/families/bitcoin/wallet-btc/crypto/bitcoincash.js +27 -53
  89. package/lib/families/bitcoin/wallet-btc/crypto/bitcoincash.js.map +1 -1
  90. package/lib/families/bitcoin/wallet-btc/crypto/decred.d.ts +1 -1
  91. package/lib/families/bitcoin/wallet-btc/crypto/decred.d.ts.map +1 -1
  92. package/lib/families/bitcoin/wallet-btc/crypto/decred.js +2 -7
  93. package/lib/families/bitcoin/wallet-btc/crypto/decred.js.map +1 -1
  94. package/lib/families/bitcoin/wallet-btc/crypto/litecoin.d.ts +1 -6
  95. package/lib/families/bitcoin/wallet-btc/crypto/litecoin.d.ts.map +1 -1
  96. package/lib/families/bitcoin/wallet-btc/crypto/litecoin.js +0 -51
  97. package/lib/families/bitcoin/wallet-btc/crypto/litecoin.js.map +1 -1
  98. package/lib/families/bitcoin/wallet-btc/crypto/types.d.ts +1 -0
  99. package/lib/families/bitcoin/wallet-btc/crypto/types.d.ts.map +1 -1
  100. package/lib/families/bitcoin/wallet-btc/crypto/zec.d.ts +5 -6
  101. package/lib/families/bitcoin/wallet-btc/crypto/zec.d.ts.map +1 -1
  102. package/lib/families/bitcoin/wallet-btc/crypto/zec.js +63 -33
  103. package/lib/families/bitcoin/wallet-btc/crypto/zec.js.map +1 -1
  104. package/lib/families/bitcoin/wallet-btc/crypto/zen.d.ts +3 -5
  105. package/lib/families/bitcoin/wallet-btc/crypto/zen.d.ts.map +1 -1
  106. package/lib/families/bitcoin/wallet-btc/crypto/zen.js +77 -46
  107. package/lib/families/bitcoin/wallet-btc/crypto/zen.js.map +1 -1
  108. package/lib/families/bitcoin/wallet-btc/explorer/index.d.ts.map +1 -1
  109. package/lib/families/bitcoin/wallet-btc/explorer/index.js +20 -0
  110. package/lib/families/bitcoin/wallet-btc/explorer/index.js.map +1 -1
  111. package/lib/families/bitcoin/wallet-btc/storage/types.d.ts +0 -1
  112. package/lib/families/bitcoin/wallet-btc/storage/types.d.ts.map +1 -1
  113. package/lib/families/celo/api/hubble.d.ts +8 -0
  114. package/lib/families/celo/api/hubble.d.ts.map +1 -0
  115. package/lib/families/celo/api/hubble.js +144 -0
  116. package/lib/families/celo/api/hubble.js.map +1 -0
  117. package/lib/families/celo/api/index.d.ts +2 -0
  118. package/lib/families/celo/api/index.d.ts.map +1 -0
  119. package/lib/families/celo/api/index.js +13 -0
  120. package/lib/families/celo/api/index.js.map +1 -0
  121. package/lib/families/celo/api/sdk.d.ts +3 -0
  122. package/lib/families/celo/api/sdk.d.ts.map +1 -0
  123. package/lib/families/celo/api/sdk.js +13 -0
  124. package/lib/families/celo/api/sdk.js.map +1 -0
  125. package/lib/families/celo/bridge/js.d.ts +8 -0
  126. package/lib/families/celo/bridge/js.d.ts.map +1 -0
  127. package/lib/families/celo/bridge/js.js +87 -0
  128. package/lib/families/celo/bridge/js.js.map +1 -0
  129. package/lib/families/celo/cli-transaction.d.ts +14 -0
  130. package/lib/families/celo/cli-transaction.d.ts.map +1 -0
  131. package/lib/families/celo/cli-transaction.js +37 -0
  132. package/lib/families/celo/cli-transaction.js.map +1 -0
  133. package/lib/families/celo/datasets/celo.scanAccounts.1.d.ts +5 -0
  134. package/lib/families/celo/datasets/celo.scanAccounts.1.d.ts.map +1 -0
  135. package/lib/families/celo/datasets/celo.scanAccounts.1.js +12 -0
  136. package/lib/families/celo/datasets/celo.scanAccounts.1.js.map +1 -0
  137. package/lib/families/celo/deviceTransactionConfig.d.ts +4 -0
  138. package/lib/families/celo/deviceTransactionConfig.d.ts.map +1 -0
  139. package/lib/families/celo/deviceTransactionConfig.js +16 -0
  140. package/lib/families/celo/deviceTransactionConfig.js.map +1 -0
  141. package/lib/families/celo/hw-app-celo.d.ts +19 -0
  142. package/lib/families/celo/hw-app-celo.d.ts.map +1 -0
  143. package/lib/families/celo/hw-app-celo.js +147 -0
  144. package/lib/families/celo/hw-app-celo.js.map +1 -0
  145. package/lib/families/celo/hw-getAddress.d.ts +2 -0
  146. package/lib/families/celo/hw-getAddress.d.ts.map +1 -0
  147. package/lib/families/celo/hw-getAddress.js +13 -0
  148. package/lib/families/celo/hw-getAddress.js.map +1 -0
  149. package/lib/families/celo/js-broadcast.d.ts +8 -0
  150. package/lib/families/celo/js-broadcast.d.ts.map +1 -0
  151. package/lib/families/celo/js-broadcast.js +58 -0
  152. package/lib/families/celo/js-broadcast.js.map +1 -0
  153. package/lib/families/celo/js-buildTransaction.d.ts +6 -0
  154. package/lib/families/celo/js-buildTransaction.d.ts.map +1 -0
  155. package/lib/families/celo/js-buildTransaction.js +89 -0
  156. package/lib/families/celo/js-buildTransaction.js.map +1 -0
  157. package/lib/families/celo/js-createTransaction.d.ts +4 -0
  158. package/lib/families/celo/js-createTransaction.d.ts.map +1 -0
  159. package/lib/families/celo/js-createTransaction.js +12 -0
  160. package/lib/families/celo/js-createTransaction.js.map +1 -0
  161. package/lib/families/celo/js-estimateMaxSpendable.d.ts +10 -0
  162. package/lib/families/celo/js-estimateMaxSpendable.d.ts.map +1 -0
  163. package/lib/families/celo/js-estimateMaxSpendable.js +77 -0
  164. package/lib/families/celo/js-estimateMaxSpendable.js.map +1 -0
  165. package/lib/families/celo/js-getFeesForTransaction.d.ts +8 -0
  166. package/lib/families/celo/js-getFeesForTransaction.d.ts.map +1 -0
  167. package/lib/families/celo/js-getFeesForTransaction.js +76 -0
  168. package/lib/families/celo/js-getFeesForTransaction.js.map +1 -0
  169. package/lib/families/celo/js-getTransactionStatus.d.ts +5 -0
  170. package/lib/families/celo/js-getTransactionStatus.d.ts.map +1 -0
  171. package/lib/families/celo/js-getTransactionStatus.js +86 -0
  172. package/lib/families/celo/js-getTransactionStatus.js.map +1 -0
  173. package/lib/families/celo/js-prepareTransaction.d.ts +5 -0
  174. package/lib/families/celo/js-prepareTransaction.d.ts.map +1 -0
  175. package/lib/families/celo/js-prepareTransaction.js +76 -0
  176. package/lib/families/celo/js-prepareTransaction.js.map +1 -0
  177. package/lib/families/celo/js-signOperation.d.ts +13 -0
  178. package/lib/families/celo/js-signOperation.d.ts.map +1 -0
  179. package/lib/families/celo/js-signOperation.js +150 -0
  180. package/lib/families/celo/js-signOperation.js.map +1 -0
  181. package/lib/families/celo/js-synchronisation.d.ts +10 -0
  182. package/lib/families/celo/js-synchronisation.d.ts.map +1 -0
  183. package/lib/families/celo/js-synchronisation.js +88 -0
  184. package/lib/families/celo/js-synchronisation.js.map +1 -0
  185. package/lib/families/celo/specs.d.ts +7 -0
  186. package/lib/families/celo/specs.d.ts.map +1 -0
  187. package/lib/families/celo/specs.js +56 -0
  188. package/lib/families/celo/specs.js.map +1 -0
  189. package/lib/families/celo/speculos-deviceActions.d.ts +7 -0
  190. package/lib/families/celo/speculos-deviceActions.d.ts.map +1 -0
  191. package/lib/families/celo/speculos-deviceActions.js +52 -0
  192. package/lib/families/celo/speculos-deviceActions.js.map +1 -0
  193. package/lib/families/celo/transaction.d.ts +11 -0
  194. package/lib/families/celo/transaction.d.ts.map +1 -0
  195. package/lib/families/celo/transaction.js +39 -0
  196. package/lib/families/celo/transaction.js.map +1 -0
  197. package/lib/families/celo/types.d.ts +16 -0
  198. package/lib/families/celo/types.d.ts.map +1 -0
  199. package/lib/families/celo/types.js +6 -0
  200. package/lib/families/celo/types.js.map +1 -0
  201. package/lib/families/ethereum/datasets/ethereum.scanAccounts.1.d.ts +1 -0
  202. package/lib/families/ethereum/datasets/ethereum.scanAccounts.1.d.ts.map +1 -1
  203. package/lib/families/ethereum/datasets/ethereum.scanAccounts.1.js +1 -0
  204. package/lib/families/ethereum/datasets/ethereum.scanAccounts.1.js.map +1 -1
  205. package/lib/families/ethereum/modules/erc1155.d.ts.map +1 -1
  206. package/lib/families/ethereum/modules/erc1155.js +8 -2
  207. package/lib/families/ethereum/modules/erc1155.js.map +1 -1
  208. package/lib/families/ethereum/signOperation.d.ts.map +1 -1
  209. package/lib/families/ethereum/signOperation.js +26 -15
  210. package/lib/families/ethereum/signOperation.js.map +1 -1
  211. package/lib/families/ethereum/specs.d.ts.map +1 -1
  212. package/lib/families/ethereum/specs.js +2 -4
  213. package/lib/families/ethereum/specs.js.map +1 -1
  214. package/lib/families/ethereum/transaction.d.ts +4 -1
  215. package/lib/families/ethereum/transaction.d.ts.map +1 -1
  216. package/lib/families/ethereum/transaction.js +15 -27
  217. package/lib/families/ethereum/transaction.js.map +1 -1
  218. package/lib/families/polkadot/cache.d.ts +1 -1
  219. package/lib/families/polkadot/cache.js +1 -1
  220. package/lib/families/solana/api/chain/index.d.ts +2 -2
  221. package/lib/families/solana/api/chain/index.d.ts.map +1 -1
  222. package/lib/families/solana/api/chain/index.js +1 -3
  223. package/lib/families/solana/api/chain/index.js.map +1 -1
  224. package/lib/families/solana/api/chain/instruction/token/types.d.ts +1 -1
  225. package/lib/families/solana/bridge/bridge.js +5 -5
  226. package/lib/families/solana/bridge/bridge.js.map +1 -1
  227. package/lib/families/solana/bridge/js.js +3 -3
  228. package/lib/families/solana/bridge/js.js.map +1 -1
  229. package/lib/families/solana/bridge/mock.js +1 -1
  230. package/lib/families/solana/bridge/mock.js.map +1 -1
  231. package/lib/families/solana/specs.js +1 -1
  232. package/lib/families/solana/specs.js.map +1 -1
  233. package/lib/families/solana/test-dataset.d.ts.map +1 -1
  234. package/lib/families/solana/test-dataset.js +210 -209
  235. package/lib/families/solana/test-dataset.js.map +1 -1
  236. package/lib/families/solana/utils.d.ts +1 -2
  237. package/lib/families/solana/utils.d.ts.map +1 -1
  238. package/lib/families/solana/utils.js +11 -9
  239. package/lib/families/solana/utils.js.map +1 -1
  240. package/lib/families/tezos/bakers.whitelist-default.d.ts.map +1 -1
  241. package/lib/families/tezos/bakers.whitelist-default.js +1 -1
  242. package/lib/families/tezos/bakers.whitelist-default.js.map +1 -1
  243. package/lib/families/tezos/bridge/js.d.ts.map +1 -1
  244. package/lib/families/tezos/bridge/js.js +2 -1
  245. package/lib/families/tezos/bridge/js.js.map +1 -1
  246. package/lib/families/tezos/synchronisation.d.ts.map +1 -1
  247. package/lib/families/tezos/synchronisation.js +2 -0
  248. package/lib/families/tezos/synchronisation.js.map +1 -1
  249. package/lib/families/tezos/test-specifics.d.ts.map +1 -1
  250. package/lib/families/tezos/test-specifics.js +1 -0
  251. package/lib/families/tezos/test-specifics.js.map +1 -1
  252. package/lib/families/tron/synchronisation.test.js +1 -0
  253. package/lib/families/tron/synchronisation.test.js.map +1 -1
  254. package/lib/featureFlags/FeatureToggle.d.ts +10 -0
  255. package/lib/featureFlags/FeatureToggle.d.ts.map +1 -0
  256. package/lib/featureFlags/FeatureToggle.js +17 -0
  257. package/lib/featureFlags/FeatureToggle.js.map +1 -0
  258. package/lib/featureFlags/defaultFeatures.d.ts +3 -0
  259. package/lib/featureFlags/defaultFeatures.d.ts.map +1 -0
  260. package/lib/featureFlags/defaultFeatures.js +9 -0
  261. package/lib/featureFlags/defaultFeatures.js.map +1 -0
  262. package/lib/featureFlags/index.d.ts +5 -0
  263. package/lib/featureFlags/index.d.ts.map +1 -0
  264. package/lib/featureFlags/index.js +17 -0
  265. package/lib/featureFlags/index.js.map +1 -0
  266. package/lib/featureFlags/provider.d.ts +13 -0
  267. package/lib/featureFlags/provider.d.ts.map +1 -0
  268. package/lib/featureFlags/provider.js +68 -0
  269. package/lib/featureFlags/provider.js.map +1 -0
  270. package/lib/featureFlags/types.d.ts +8 -0
  271. package/lib/featureFlags/types.d.ts.map +1 -0
  272. package/lib/featureFlags/types.js +3 -0
  273. package/lib/featureFlags/types.js.map +1 -0
  274. package/lib/featureFlags/useFeature.d.ts +3 -0
  275. package/lib/featureFlags/useFeature.d.ts.map +1 -0
  276. package/lib/featureFlags/useFeature.js +9 -0
  277. package/lib/featureFlags/useFeature.js.map +1 -0
  278. package/lib/generated/bridge/js.d.ts +4 -0
  279. package/lib/generated/bridge/js.d.ts.map +1 -1
  280. package/lib/generated/bridge/js.js +24 -22
  281. package/lib/generated/bridge/js.js.map +1 -1
  282. package/lib/generated/cli-transaction.d.ts +9 -0
  283. package/lib/generated/cli-transaction.d.ts.map +1 -1
  284. package/lib/generated/cli-transaction.js +24 -22
  285. package/lib/generated/cli-transaction.js.map +1 -1
  286. package/lib/generated/deviceTransactionConfig.d.ts +2 -0
  287. package/lib/generated/deviceTransactionConfig.d.ts.map +1 -1
  288. package/lib/generated/deviceTransactionConfig.js +22 -20
  289. package/lib/generated/deviceTransactionConfig.js.map +1 -1
  290. package/lib/generated/hw-getAddress.d.ts +1 -0
  291. package/lib/generated/hw-getAddress.d.ts.map +1 -1
  292. package/lib/generated/hw-getAddress.js +26 -24
  293. package/lib/generated/hw-getAddress.js.map +1 -1
  294. package/lib/generated/specs.d.ts +3 -0
  295. package/lib/generated/specs.d.ts.map +1 -1
  296. package/lib/generated/specs.js +24 -22
  297. package/lib/generated/specs.js.map +1 -1
  298. package/lib/generated/speculos-deviceActions.d.ts +3 -0
  299. package/lib/generated/speculos-deviceActions.d.ts.map +1 -1
  300. package/lib/generated/speculos-deviceActions.js +24 -22
  301. package/lib/generated/speculos-deviceActions.js.map +1 -1
  302. package/lib/generated/transaction.d.ts +5 -0
  303. package/lib/generated/transaction.d.ts.map +1 -1
  304. package/lib/generated/transaction.js +26 -24
  305. package/lib/generated/transaction.js.map +1 -1
  306. package/lib/generated/types.d.ts +12 -6
  307. package/lib/generated/types.d.ts.map +1 -1
  308. package/lib/generated/types.js +14 -12
  309. package/lib/generated/types.js.map +1 -1
  310. package/lib/load/speculos.d.ts +7 -0
  311. package/lib/load/speculos.d.ts.map +1 -1
  312. package/lib/load/speculos.js +27 -11
  313. package/lib/load/speculos.js.map +1 -1
  314. package/lib/platform/PlatformAppProvider/helpers.d.ts +1 -0
  315. package/lib/platform/PlatformAppProvider/helpers.d.ts.map +1 -1
  316. package/lib/platform/PlatformAppProvider/helpers.js +23 -1
  317. package/lib/platform/PlatformAppProvider/helpers.js.map +1 -1
  318. package/lib/platform/PlatformAppProvider/index.d.ts.map +1 -1
  319. package/lib/platform/PlatformAppProvider/index.js +2 -1
  320. package/lib/platform/PlatformAppProvider/index.js.map +1 -1
  321. package/lib/types/index.d.ts +1 -0
  322. package/lib/types/index.d.ts.map +1 -1
  323. package/lib/types/index.js +1 -0
  324. package/lib/types/index.js.map +1 -1
  325. package/lib/types/manager.d.ts +7 -0
  326. package/lib/types/manager.d.ts.map +1 -1
  327. package/lib/types/manager.js +7 -0
  328. package/lib/types/manager.js.map +1 -1
  329. package/package.json +24 -21
  330. package/src/.DS_Store +0 -0
  331. package/src/__tests__/.DS_Store +0 -0
  332. package/src/__tests__/__snapshots__/all.libcore.ts.snap +457 -33597
  333. package/src/__tests__/families/bitcoin/wallet-btc/wallet.integration.test.ts +2 -0
  334. package/src/__tests__/families/bitcoin/wallet-btc/xpub.getAddress.ts +78 -0
  335. package/src/__tests__/families/bitcoin/wallet-btc/xpub.pickingStrategies.integration.test.ts +0 -11
  336. package/src/__tests__/test-helpers/bridge.ts +1 -1
  337. package/src/__tests__/test-helpers/setup.ts +1 -0
  338. package/src/account/support.ts +1 -0
  339. package/src/api/Ethereum.ts +1 -0
  340. package/src/apps/hw.ts +7 -0
  341. package/src/apps/logic.ts +6 -3
  342. package/src/apps/polyfill.ts +1 -0
  343. package/src/bot/engine.ts +4 -1
  344. package/src/bridge/jsHelpers.ts +1 -1
  345. package/src/data/icons/react/celo.tsx +12 -0
  346. package/src/data/icons/react/index.tsx +1 -0
  347. package/src/data/icons/reactNative/celo.tsx +13 -0
  348. package/src/data/icons/reactNative/index.tsx +1 -0
  349. package/src/data/icons/svg/CELO.svg +5 -0
  350. package/src/env.ts +20 -0
  351. package/src/errors.ts +3 -0
  352. package/src/exchange/platform/transfer/index.ts +21 -1
  353. package/src/families/algorand/buildTransaction.ts +4 -8
  354. package/src/families/algorand/js-getFeesForTransaction.ts +1 -1
  355. package/src/families/algorand/js-signOperation.ts +2 -2
  356. package/src/families/algorand/js-synchronization.ts +1 -0
  357. package/src/families/bitcoin/js-signOperation.ts +3 -5
  358. package/src/families/bitcoin/js-synchronisation.ts +4 -4
  359. package/src/families/bitcoin/wallet-btc/crypto/base.ts +31 -18
  360. package/src/families/bitcoin/wallet-btc/crypto/bip32.ts +2 -2
  361. package/src/families/bitcoin/wallet-btc/crypto/bitcoin.ts +3 -17
  362. package/src/families/bitcoin/wallet-btc/crypto/bitcoincash.ts +5 -39
  363. package/src/families/bitcoin/wallet-btc/crypto/decred.ts +2 -15
  364. package/src/families/bitcoin/wallet-btc/crypto/litecoin.ts +1 -71
  365. package/src/families/bitcoin/wallet-btc/crypto/types.ts +7 -0
  366. package/src/families/bitcoin/wallet-btc/crypto/zec.ts +23 -41
  367. package/src/families/bitcoin/wallet-btc/crypto/zen.ts +30 -49
  368. package/src/families/bitcoin/wallet-btc/explorer/index.ts +20 -0
  369. package/src/families/bitcoin/wallet-btc/storage/types.ts +0 -1
  370. package/src/families/celo/api/hubble.ts +93 -0
  371. package/src/families/celo/api/index.ts +1 -0
  372. package/src/families/celo/api/sdk.ts +8 -0
  373. package/src/families/celo/bridge/js.ts +38 -0
  374. package/src/families/celo/cli-transaction.ts +41 -0
  375. package/src/families/celo/datasets/celo.scanAccounts.1.ts +20 -0
  376. package/src/families/celo/deviceTransactionConfig.ts +19 -0
  377. package/src/families/celo/hw-app-celo.ts +108 -0
  378. package/src/families/celo/hw-getAddress.ts +1 -0
  379. package/src/families/celo/js-broadcast.ts +12 -0
  380. package/src/families/celo/js-buildTransaction.ts +32 -0
  381. package/src/families/celo/js-createTransaction.ts +12 -0
  382. package/src/families/celo/js-estimateMaxSpendable.ts +28 -0
  383. package/src/families/celo/js-getFeesForTransaction.ts +38 -0
  384. package/src/families/celo/js-getTransactionStatus.ts +67 -0
  385. package/src/families/celo/js-prepareTransaction.ts +28 -0
  386. package/src/families/celo/js-signOperation.ts +149 -0
  387. package/src/families/celo/js-synchronisation.ts +40 -0
  388. package/src/families/celo/specs.ts +53 -0
  389. package/src/families/celo/speculos-deviceActions.ts +50 -0
  390. package/src/families/celo/transaction.ts +39 -0
  391. package/src/families/celo/types.ts +20 -0
  392. package/src/families/ethereum/datasets/ethereum.scanAccounts.1.ts +1 -0
  393. package/src/families/ethereum/modules/erc1155.ts +9 -0
  394. package/src/families/ethereum/signOperation.ts +21 -20
  395. package/src/families/ethereum/specs.ts +0 -2
  396. package/src/families/ethereum/transaction.ts +10 -24
  397. package/src/families/polkadot/cache.ts +1 -1
  398. package/src/families/solana/api/chain/index.ts +2 -5
  399. package/src/families/solana/bridge/bridge.ts +11 -11
  400. package/src/families/solana/bridge/js.ts +3 -3
  401. package/src/families/solana/bridge/mock.ts +1 -1
  402. package/src/families/solana/specs.ts +1 -1
  403. package/src/families/solana/test-dataset.ts +340 -338
  404. package/src/families/solana/utils.ts +9 -8
  405. package/src/families/tezos/bakers.whitelist-default.ts +0 -2
  406. package/src/families/tezos/bridge/js.ts +6 -1
  407. package/src/families/tezos/synchronisation.ts +2 -0
  408. package/src/families/tezos/test-specifics.ts +1 -0
  409. package/src/families/tron/synchronisation.test.ts +2 -0
  410. package/src/featureFlags/FeatureToggle.tsx +24 -0
  411. package/src/featureFlags/defaultFeatures.ts +7 -0
  412. package/src/featureFlags/index.ts +4 -0
  413. package/src/featureFlags/provider.tsx +48 -0
  414. package/src/featureFlags/types.ts +9 -0
  415. package/src/featureFlags/useFeature.ts +8 -0
  416. package/src/generated/bridge/js.ts +3 -0
  417. package/src/generated/cli-transaction.ts +3 -0
  418. package/src/generated/deviceTransactionConfig.ts +3 -0
  419. package/src/generated/hw-getAddress.ts +3 -0
  420. package/src/generated/specs.ts +3 -0
  421. package/src/generated/speculos-deviceActions.ts +3 -0
  422. package/src/generated/transaction.ts +3 -0
  423. package/src/generated/types.ts +14 -0
  424. package/src/load/speculos.ts +23 -10
  425. package/src/platform/PlatformAppProvider/helpers.ts +29 -0
  426. package/src/platform/PlatformAppProvider/index.tsx +3 -2
  427. package/src/types/index.ts +1 -0
  428. package/src/types/manager.ts +7 -0
@@ -1,5 +1,5 @@
1
1
  import BigNumber from "bignumber.js";
2
- import { DatasetTest, encodeAccountId } from "../../types";
2
+ import { CurrenciesData, DatasetTest, encodeAccountId } from "../../types";
3
3
 
4
4
  import { Transaction, TransactionModel } from "./types";
5
5
 
@@ -75,367 +75,369 @@ const fees = (signatureCount: number) =>
75
75
 
76
76
  const zero = new BigNumber(0);
77
77
 
78
- const dataset: DatasetTest<Transaction> = {
79
- implementations: [getEnv("MOCK") ? "mock" : "js"],
80
- currencies: {
81
- solana: {
82
- scanAccounts: [scanAccounts1],
83
- accounts: [
78
+ const solana: CurrenciesData<Transaction> = {
79
+ scanAccounts: [scanAccounts1],
80
+ accounts: [
81
+ {
82
+ raw: makeAccount(testOnChainData.fundedSenderAddress),
83
+ /*
84
+ Solana integration is written in such a way that requires
85
+ prepareTransaction to be called before any meaningfull status
86
+ can be calculated. The general bridge tests do not run prepareTransaction
87
+ on all tests, so skip them in the general runner, but make alternatives for them.
88
+ */
89
+ FIXME_tests: [
90
+ "balance is sum of ops",
91
+ "Default empty recipient have a recipientError",
92
+ "invalid recipient have a recipientError",
93
+ "can be called on an empty transaction",
94
+ ],
95
+ transactions: [
96
+ ...recipientRequired(),
97
+ ...recipientNotValid(),
98
+ ...recipientIsSameAsSender(),
99
+ ...memoIsTooLong(),
84
100
  {
85
- raw: makeAccount(testOnChainData.fundedSenderAddress),
86
- /*
87
- Solana integration is written in such a way that requires
88
- prepareTransaction to be called before any meaningfull status
89
- can be calculated. The general bridge tests do not run prepareTransaction
90
- on all tests, so skip them in the general runner, but make alternatives for them.
91
- */
92
- FIXME_tests: [
93
- "balance is sum of ops",
94
- "Default empty recipient have a recipientError",
95
- "invalid recipient have a recipientError",
96
- "can be called on an empty transaction",
97
- ],
98
- transactions: [
99
- ...recipientRequired(),
100
- ...recipientNotValid(),
101
- ...recipientIsSameAsSender(),
102
- ...memoIsTooLong(),
103
- {
104
- name: "status is error: called on an empty transaction",
105
- transaction: createTransaction({} as any),
106
- expectedStatus: {
107
- errors: {
108
- recipient: new RecipientRequired(),
109
- },
110
- warnings: {},
111
- estimatedFees: fees(1),
112
- amount: zero,
113
- totalSpent: fees(1),
114
- },
101
+ name: "status is error: called on an empty transaction",
102
+ transaction: createTransaction({} as any),
103
+ expectedStatus: {
104
+ errors: {
105
+ recipient: new RecipientRequired(),
115
106
  },
116
- {
117
- name: "transfer :: status is success: not all amount",
118
- transaction: {
119
- model: {
120
- kind: "transfer",
121
- uiState: {},
122
- },
123
- amount: testOnChainData.fundedSenderBalance.dividedBy(2),
124
- recipient: testOnChainData.fundedAddress,
125
- feeCalculator: testOnChainData.feeCalculator,
126
- family: "solana",
127
- },
128
- expectedStatus: {
129
- errors: {},
130
- warnings: {},
131
- estimatedFees: fees(1),
132
- amount: testOnChainData.fundedSenderBalance.dividedBy(2),
133
- totalSpent: testOnChainData.fundedSenderBalance
134
- .dividedBy(2)
135
- .plus(fees(1)),
136
- },
107
+ warnings: {},
108
+ estimatedFees: fees(1),
109
+ amount: zero,
110
+ totalSpent: fees(1),
111
+ },
112
+ },
113
+ {
114
+ name: "transfer :: status is success: not all amount",
115
+ transaction: {
116
+ model: {
117
+ kind: "transfer",
118
+ uiState: {},
137
119
  },
138
- {
139
- name: "transfer :: status is success: all amount",
140
- transaction: {
141
- model: {
142
- kind: "transfer",
143
- uiState: {},
144
- },
145
- useAllAmount: true,
146
- amount: zero,
147
- recipient: testOnChainData.fundedAddress,
148
- feeCalculator: testOnChainData.feeCalculator,
149
- family: "solana",
150
- },
151
- expectedStatus: {
152
- errors: {},
153
- warnings: {},
154
- estimatedFees: fees(1),
155
- amount: testOnChainData.fundedSenderBalance.minus(fees(1)),
156
- totalSpent: testOnChainData.fundedSenderBalance,
157
- },
120
+ amount: testOnChainData.fundedSenderBalance.dividedBy(2),
121
+ recipient: testOnChainData.fundedAddress,
122
+ feeCalculator: testOnChainData.feeCalculator,
123
+ family: "solana",
124
+ },
125
+ expectedStatus: {
126
+ errors: {},
127
+ warnings: {},
128
+ estimatedFees: fees(1),
129
+ amount: testOnChainData.fundedSenderBalance.dividedBy(2),
130
+ totalSpent: testOnChainData.fundedSenderBalance
131
+ .dividedBy(2)
132
+ .plus(fees(1)),
133
+ },
134
+ },
135
+ {
136
+ name: "transfer :: status is success: all amount",
137
+ transaction: {
138
+ model: {
139
+ kind: "transfer",
140
+ uiState: {},
158
141
  },
159
- {
160
- name: "transfer :: status is error: not enough balance, not all amount",
161
- transaction: {
162
- model: {
163
- kind: "transfer",
164
- uiState: {},
165
- },
166
- amount: testOnChainData.fundedSenderBalance,
167
- recipient: testOnChainData.fundedAddress,
168
- feeCalculator: testOnChainData.feeCalculator,
169
- family: "solana",
170
- },
171
- expectedStatus: {
172
- errors: {
173
- amount: new NotEnoughBalance(),
174
- },
175
- warnings: {},
176
- estimatedFees: fees(1),
177
- amount: testOnChainData.fundedSenderBalance,
178
- totalSpent: testOnChainData.fundedSenderBalance.plus(fees(1)),
179
- },
142
+ useAllAmount: true,
143
+ amount: zero,
144
+ recipient: testOnChainData.fundedAddress,
145
+ feeCalculator: testOnChainData.feeCalculator,
146
+ family: "solana",
147
+ },
148
+ expectedStatus: {
149
+ errors: {},
150
+ warnings: {},
151
+ estimatedFees: fees(1),
152
+ amount: testOnChainData.fundedSenderBalance.minus(fees(1)),
153
+ totalSpent: testOnChainData.fundedSenderBalance,
154
+ },
155
+ },
156
+ {
157
+ name: "transfer :: status is error: not enough balance, not all amount",
158
+ transaction: {
159
+ model: {
160
+ kind: "transfer",
161
+ uiState: {},
180
162
  },
181
- {
182
- name: "transfer :: status is error: not enough balance, all amount",
183
- transaction: {
184
- model: {
185
- kind: "transfer",
186
- uiState: {
187
- memo: "a memo",
188
- },
189
- },
190
- useAllAmount: true,
191
- amount: zero,
192
- recipient: testOnChainData.fundedAddress,
193
- feeCalculator: {
194
- lamportsPerSignature: testOnChainData.fundedSenderBalance
195
- .plus(1)
196
- .toNumber(),
197
- },
198
- family: "solana",
199
- },
200
- expectedStatus: {
201
- errors: {
202
- amount: new NotEnoughBalance(),
203
- },
204
- warnings: {},
205
- estimatedFees: testOnChainData.fundedSenderBalance.plus(1),
206
- amount: zero,
207
- totalSpent: testOnChainData.fundedSenderBalance.plus(1),
208
- },
163
+ amount: testOnChainData.fundedSenderBalance,
164
+ recipient: testOnChainData.fundedAddress,
165
+ feeCalculator: testOnChainData.feeCalculator,
166
+ family: "solana",
167
+ },
168
+ expectedStatus: {
169
+ errors: {
170
+ amount: new NotEnoughBalance(),
209
171
  },
210
- {
211
- name: "transfer :: status is error: amount is 0",
212
- transaction: {
213
- model: {
214
- kind: "transfer",
215
- uiState: {},
216
- },
217
- amount: zero,
218
- recipient: testOnChainData.fundedAddress,
219
- feeCalculator: testOnChainData.feeCalculator,
220
- family: "solana",
221
- },
222
- expectedStatus: {
223
- errors: {
224
- amount: new AmountRequired(),
225
- },
226
- warnings: {},
227
- estimatedFees: fees(1),
228
- amount: zero,
229
- totalSpent: fees(1),
172
+ warnings: {},
173
+ estimatedFees: fees(1),
174
+ amount: testOnChainData.fundedSenderBalance,
175
+ totalSpent: testOnChainData.fundedSenderBalance.plus(fees(1)),
176
+ },
177
+ },
178
+ {
179
+ name: "transfer :: status is error: not enough balance, all amount",
180
+ transaction: {
181
+ model: {
182
+ kind: "transfer",
183
+ uiState: {
184
+ memo: "a memo",
230
185
  },
231
186
  },
232
- {
233
- name: "transfer :: status is error: amount is negative",
234
- transaction: {
235
- model: {
236
- kind: "transfer",
237
- uiState: {},
238
- },
239
- amount: new BigNumber(-1),
240
- recipient: testOnChainData.fundedAddress,
241
- feeCalculator: testOnChainData.feeCalculator,
242
- family: "solana",
243
- },
244
- expectedStatus: {
245
- errors: {
246
- amount: new AmountRequired(),
247
- },
248
- warnings: {},
249
- estimatedFees: fees(1),
250
- amount: new BigNumber(-1),
251
- totalSpent: new BigNumber(-1).plus(fees(1)),
252
- },
187
+ useAllAmount: true,
188
+ amount: zero,
189
+ recipient: testOnChainData.fundedAddress,
190
+ feeCalculator: {
191
+ lamportsPerSignature: testOnChainData.fundedSenderBalance
192
+ .plus(1)
193
+ .toNumber(),
253
194
  },
254
- {
255
- name: "transfer :: status is warning: recipient wallet not funded",
256
- transaction: {
257
- model: {
258
- kind: "transfer",
259
- uiState: {},
260
- },
261
- amount: new BigNumber(1),
262
- recipient: testOnChainData.unfundedAddress,
263
- feeCalculator: testOnChainData.feeCalculator,
264
- family: "solana",
265
- },
266
- expectedStatus: {
267
- errors: {},
268
- warnings: {
269
- recipient: new SolanaAccountNotFunded(),
270
- },
271
- estimatedFees: fees(1),
272
- amount: new BigNumber(1),
273
- totalSpent: fees(1).plus(1),
274
- },
195
+ family: "solana",
196
+ },
197
+ expectedStatus: {
198
+ errors: {
199
+ amount: new NotEnoughBalance(),
275
200
  },
276
- {
277
- name: "transfer :: status is warning: recipient address is off ed25519",
278
- transaction: {
279
- model: {
280
- kind: "transfer",
281
- uiState: {},
282
- },
283
- amount: new BigNumber(1),
284
- recipient: testOnChainData.offEd25519Address,
285
- feeCalculator: testOnChainData.feeCalculator,
286
- family: "solana",
287
- },
288
- expectedStatus: {
289
- errors: {},
290
- warnings: {
291
- recipient: new SolanaAccountNotFunded(),
292
- recipientOffCurve: new SolanaAddressOffEd25519(),
293
- },
294
- estimatedFees: fees(1),
295
- amount: new BigNumber(1),
296
- totalSpent: fees(1).plus(1),
297
- },
201
+ warnings: {},
202
+ estimatedFees: testOnChainData.fundedSenderBalance.plus(1),
203
+ amount: zero,
204
+ totalSpent: testOnChainData.fundedSenderBalance.plus(1),
205
+ },
206
+ },
207
+ {
208
+ name: "transfer :: status is error: amount is 0",
209
+ transaction: {
210
+ model: {
211
+ kind: "transfer",
212
+ uiState: {},
298
213
  },
299
- // no tokens for first release
300
- /*
301
- {
302
- name: "token.transfer :: status is success: recipient is funded wallet, assoc token acc exists",
303
- transaction: {
304
- model: {
305
- kind: "token.transfer",
306
- uiState: {
307
- subAccountId: wSolSubAccId,
308
- },
309
- },
310
- amount:
311
- testOnChainData.wSolSenderAssocTokenAccBalance.dividedBy(2),
312
- recipient: testOnChainData.fundedAddress,
313
- feeCalculator: testOnChainData.feeCalculator,
314
- family: "solana",
315
- },
316
- expectedStatus: {
317
- errors: {},
318
- warnings: {},
319
- estimatedFees: fees(1),
320
- amount:
321
- testOnChainData.wSolSenderAssocTokenAccBalance.dividedBy(2),
322
- totalSpent:
323
- testOnChainData.wSolSenderAssocTokenAccBalance.dividedBy(2),
324
- },
214
+ amount: zero,
215
+ recipient: testOnChainData.fundedAddress,
216
+ feeCalculator: testOnChainData.feeCalculator,
217
+ family: "solana",
218
+ },
219
+ expectedStatus: {
220
+ errors: {
221
+ amount: new AmountRequired(),
325
222
  },
326
- {
327
- name: "token.transfer :: status is success: recipient is correct mint token acc",
328
- transaction: {
329
- model: {
330
- kind: "token.transfer",
331
- uiState: {
332
- subAccountId: wSolSubAccId,
333
- },
334
- },
335
- amount:
336
- testOnChainData.wSolSenderAssocTokenAccBalance.dividedBy(2),
337
- recipient:
338
- testOnChainData.wSolFundedAccountAssocTokenAccAddress,
339
- feeCalculator: testOnChainData.feeCalculator,
340
- family: "solana",
341
- },
342
- expectedStatus: {
343
- errors: {},
344
- warnings: {},
345
- estimatedFees: fees(1),
346
- amount:
347
- testOnChainData.wSolSenderAssocTokenAccBalance.dividedBy(2),
348
- totalSpent:
349
- testOnChainData.wSolSenderAssocTokenAccBalance.dividedBy(2),
350
- },
223
+ warnings: {},
224
+ estimatedFees: fees(1),
225
+ amount: zero,
226
+ totalSpent: fees(1),
227
+ },
228
+ },
229
+ {
230
+ name: "transfer :: status is error: amount is negative",
231
+ transaction: {
232
+ model: {
233
+ kind: "transfer",
234
+ uiState: {},
351
235
  },
352
- {
353
- name: "token.transfer :: status is error: recipient is another mint token acc",
354
- transaction: {
355
- model: {
356
- kind: "token.transfer",
357
- uiState: {
358
- subAccountId: wSolSubAccId,
359
- },
360
- },
361
- amount:
362
- testOnChainData.wSolSenderAssocTokenAccBalance.dividedBy(2),
363
- recipient: testOnChainData.notWSolTokenAccAddress,
364
- feeCalculator: testOnChainData.feeCalculator,
365
- family: "solana",
366
- },
367
- expectedStatus: {
368
- errors: {
369
- recipient: new SolanaTokenAccountHoldsAnotherToken(),
370
- },
371
- warnings: {},
372
- estimatedFees: fees(1),
373
- amount:
374
- testOnChainData.wSolSenderAssocTokenAccBalance.dividedBy(2),
375
- totalSpent: zero,
236
+ amount: new BigNumber(-1),
237
+ recipient: testOnChainData.fundedAddress,
238
+ feeCalculator: testOnChainData.feeCalculator,
239
+ family: "solana",
240
+ },
241
+ expectedStatus: {
242
+ errors: {
243
+ amount: new AmountRequired(),
244
+ },
245
+ warnings: {},
246
+ estimatedFees: fees(1),
247
+ amount: new BigNumber(-1),
248
+ totalSpent: new BigNumber(-1).plus(fees(1)),
249
+ },
250
+ },
251
+ {
252
+ name: "transfer :: status is warning: recipient wallet not funded",
253
+ transaction: {
254
+ model: {
255
+ kind: "transfer",
256
+ uiState: {},
257
+ },
258
+ amount: new BigNumber(1),
259
+ recipient: testOnChainData.unfundedAddress,
260
+ feeCalculator: testOnChainData.feeCalculator,
261
+ family: "solana",
262
+ },
263
+ expectedStatus: {
264
+ errors: {},
265
+ warnings: {
266
+ recipient: new SolanaAccountNotFunded(),
267
+ },
268
+ estimatedFees: fees(1),
269
+ amount: new BigNumber(1),
270
+ totalSpent: fees(1).plus(1),
271
+ },
272
+ },
273
+ {
274
+ name: "transfer :: status is warning: recipient address is off ed25519",
275
+ transaction: {
276
+ model: {
277
+ kind: "transfer",
278
+ uiState: {},
279
+ },
280
+ amount: new BigNumber(1),
281
+ recipient: testOnChainData.offEd25519Address,
282
+ feeCalculator: testOnChainData.feeCalculator,
283
+ family: "solana",
284
+ },
285
+ expectedStatus: {
286
+ errors: {},
287
+ warnings: {
288
+ recipient: new SolanaAccountNotFunded(),
289
+ recipientOffCurve: new SolanaAddressOffEd25519(),
290
+ },
291
+ estimatedFees: fees(1),
292
+ amount: new BigNumber(1),
293
+ totalSpent: fees(1).plus(1),
294
+ },
295
+ },
296
+ // no tokens for first release
297
+ /*
298
+ {
299
+ name: "token.transfer :: status is success: recipient is funded wallet, assoc token acc exists",
300
+ transaction: {
301
+ model: {
302
+ kind: "token.transfer",
303
+ uiState: {
304
+ subAccountId: wSolSubAccId,
376
305
  },
377
306
  },
378
- {
379
- name: "token.transfer :: status is warning: recipient is off curve",
380
- transaction: {
381
- model: {
382
- kind: "token.transfer",
383
- uiState: {
384
- subAccountId: wSolSubAccId,
385
- },
386
- },
387
- amount:
388
- testOnChainData.wSolSenderAssocTokenAccBalance.dividedBy(2),
389
- recipient: testOnChainData.offEd25519Address,
390
- feeCalculator: testOnChainData.feeCalculator,
391
- family: "solana",
307
+ amount:
308
+ testOnChainData.wSolSenderAssocTokenAccBalance.dividedBy(2),
309
+ recipient: testOnChainData.fundedAddress,
310
+ feeCalculator: testOnChainData.feeCalculator,
311
+ family: "solana",
312
+ },
313
+ expectedStatus: {
314
+ errors: {},
315
+ warnings: {},
316
+ estimatedFees: fees(1),
317
+ amount:
318
+ testOnChainData.wSolSenderAssocTokenAccBalance.dividedBy(2),
319
+ totalSpent:
320
+ testOnChainData.wSolSenderAssocTokenAccBalance.dividedBy(2),
321
+ },
322
+ },
323
+ {
324
+ name: "token.transfer :: status is success: recipient is correct mint token acc",
325
+ transaction: {
326
+ model: {
327
+ kind: "token.transfer",
328
+ uiState: {
329
+ subAccountId: wSolSubAccId,
392
330
  },
393
- expectedStatus: {
394
- errors: {
395
- recipient: new SolanaAddressOffEd25519(),
396
- },
397
- warnings: {},
398
- estimatedFees: fees(1),
399
- amount:
400
- testOnChainData.wSolSenderAssocTokenAccBalance.dividedBy(2),
401
- totalSpent: zero,
331
+ },
332
+ amount:
333
+ testOnChainData.wSolSenderAssocTokenAccBalance.dividedBy(2),
334
+ recipient:
335
+ testOnChainData.wSolFundedAccountAssocTokenAccAddress,
336
+ feeCalculator: testOnChainData.feeCalculator,
337
+ family: "solana",
338
+ },
339
+ expectedStatus: {
340
+ errors: {},
341
+ warnings: {},
342
+ estimatedFees: fees(1),
343
+ amount:
344
+ testOnChainData.wSolSenderAssocTokenAccBalance.dividedBy(2),
345
+ totalSpent:
346
+ testOnChainData.wSolSenderAssocTokenAccBalance.dividedBy(2),
347
+ },
348
+ },
349
+ {
350
+ name: "token.transfer :: status is error: recipient is another mint token acc",
351
+ transaction: {
352
+ model: {
353
+ kind: "token.transfer",
354
+ uiState: {
355
+ subAccountId: wSolSubAccId,
402
356
  },
403
357
  },
404
- {
405
- name: "token.transfer :: status is success: recipient is wallet and no assoc token acc exists (will be created)",
406
- transaction: {
407
- model: {
408
- kind: "token.transfer",
409
- uiState: {
410
- subAccountId: wSolSubAccId,
411
- },
412
- },
413
- amount:
414
- testOnChainData.wSolSenderAssocTokenAccBalance.dividedBy(2),
415
- recipient: testOnChainData.unfundedAddress,
416
- feeCalculator: testOnChainData.feeCalculator,
417
- family: "solana",
358
+ amount:
359
+ testOnChainData.wSolSenderAssocTokenAccBalance.dividedBy(2),
360
+ recipient: testOnChainData.notWSolTokenAccAddress,
361
+ feeCalculator: testOnChainData.feeCalculator,
362
+ family: "solana",
363
+ },
364
+ expectedStatus: {
365
+ errors: {
366
+ recipient: new SolanaTokenAccountHoldsAnotherToken(),
367
+ },
368
+ warnings: {},
369
+ estimatedFees: fees(1),
370
+ amount:
371
+ testOnChainData.wSolSenderAssocTokenAccBalance.dividedBy(2),
372
+ totalSpent: zero,
373
+ },
374
+ },
375
+ {
376
+ name: "token.transfer :: status is warning: recipient is off curve",
377
+ transaction: {
378
+ model: {
379
+ kind: "token.transfer",
380
+ uiState: {
381
+ subAccountId: wSolSubAccId,
418
382
  },
419
- expectedStatus: {
420
- errors: {},
421
- warnings: {
422
- recipient: new SolanaAccountNotFunded(),
423
- recipientAssociatedTokenAccount:
424
- new SolanaRecipientAssociatedTokenAccountWillBeFunded(),
425
- },
426
- // this fee is dynamic, skip
427
- //estimatedFees: new BigNumber(2044280),
428
- amount:
429
- testOnChainData.wSolSenderAssocTokenAccBalance.dividedBy(2),
430
- totalSpent:
431
- testOnChainData.wSolSenderAssocTokenAccBalance.dividedBy(2),
383
+ },
384
+ amount:
385
+ testOnChainData.wSolSenderAssocTokenAccBalance.dividedBy(2),
386
+ recipient: testOnChainData.offEd25519Address,
387
+ feeCalculator: testOnChainData.feeCalculator,
388
+ family: "solana",
389
+ },
390
+ expectedStatus: {
391
+ errors: {
392
+ recipient: new SolanaAddressOffEd25519(),
393
+ },
394
+ warnings: {},
395
+ estimatedFees: fees(1),
396
+ amount:
397
+ testOnChainData.wSolSenderAssocTokenAccBalance.dividedBy(2),
398
+ totalSpent: zero,
399
+ },
400
+ },
401
+ {
402
+ name: "token.transfer :: status is success: recipient is wallet and no assoc token acc exists (will be created)",
403
+ transaction: {
404
+ model: {
405
+ kind: "token.transfer",
406
+ uiState: {
407
+ subAccountId: wSolSubAccId,
432
408
  },
433
409
  },
434
- */
435
- ],
410
+ amount:
411
+ testOnChainData.wSolSenderAssocTokenAccBalance.dividedBy(2),
412
+ recipient: testOnChainData.unfundedAddress,
413
+ feeCalculator: testOnChainData.feeCalculator,
414
+ family: "solana",
415
+ },
416
+ expectedStatus: {
417
+ errors: {},
418
+ warnings: {
419
+ recipient: new SolanaAccountNotFunded(),
420
+ recipientAssociatedTokenAccount:
421
+ new SolanaRecipientAssociatedTokenAccountWillBeFunded(),
422
+ },
423
+ // this fee is dynamic, skip
424
+ //estimatedFees: new BigNumber(2044280),
425
+ amount:
426
+ testOnChainData.wSolSenderAssocTokenAccBalance.dividedBy(2),
427
+ totalSpent:
428
+ testOnChainData.wSolSenderAssocTokenAccBalance.dividedBy(2),
429
+ },
436
430
  },
431
+ */
437
432
  ],
438
433
  },
434
+ ],
435
+ };
436
+
437
+ const dataset: DatasetTest<Transaction> = {
438
+ implementations: [getEnv("MOCK") ? "mock" : "js"], // FIXME we should actually put both mock and js like other dataset do
439
+ currencies: {
440
+ solana,
439
441
  },
440
442
  };
441
443