@ledgerhq/coin-evm 0.3.0 → 0.4.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 (582) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/jest.config.js +4 -0
  3. package/lib/__tests__/fixtures/common.fixtures.d.ts +9 -0
  4. package/lib/__tests__/fixtures/common.fixtures.d.ts.map +1 -0
  5. package/lib/{testUtils.js → __tests__/fixtures/common.fixtures.js} +40 -9
  6. package/lib/__tests__/fixtures/common.fixtures.js.map +1 -0
  7. package/lib/__tests__/fixtures/etherscan.fixtures.d.ts +86 -0
  8. package/lib/__tests__/fixtures/etherscan.fixtures.d.ts.map +1 -0
  9. package/lib/__tests__/fixtures/etherscan.fixtures.js +267 -0
  10. package/lib/__tests__/fixtures/etherscan.fixtures.js.map +1 -0
  11. package/lib/__tests__/fixtures/prepareTransaction.fixtures.d.ts +10 -0
  12. package/lib/__tests__/fixtures/prepareTransaction.fixtures.d.ts.map +1 -0
  13. package/lib/__tests__/fixtures/prepareTransaction.fixtures.js +69 -0
  14. package/lib/__tests__/fixtures/prepareTransaction.fixtures.js.map +1 -0
  15. package/lib/__tests__/fixtures/synchronization.fixtures.d.ts +44 -0
  16. package/lib/__tests__/fixtures/synchronization.fixtures.d.ts.map +1 -0
  17. package/lib/__tests__/fixtures/synchronization.fixtures.js +219 -0
  18. package/lib/__tests__/fixtures/synchronization.fixtures.js.map +1 -0
  19. package/lib/__tests__/fixtures/transaction.fixtures.d.ts +47 -0
  20. package/lib/__tests__/fixtures/transaction.fixtures.d.ts.map +1 -0
  21. package/lib/__tests__/fixtures/transaction.fixtures.js +182 -0
  22. package/lib/__tests__/fixtures/transaction.fixtures.js.map +1 -0
  23. package/lib/__tests__/integration/bridge.integration.test.d.ts +7 -0
  24. package/lib/__tests__/integration/bridge.integration.test.d.ts.map +1 -0
  25. package/lib/__tests__/integration/bridge.integration.test.js +74 -0
  26. package/lib/__tests__/integration/bridge.integration.test.js.map +1 -0
  27. package/lib/__tests__/unit/adapters.unit.test.d.ts.map +1 -0
  28. package/lib/__tests__/unit/adapters.unit.test.js +989 -0
  29. package/lib/__tests__/unit/adapters.unit.test.js.map +1 -0
  30. package/lib/__tests__/unit/api/explorer/etherscan.unit.test.d.ts +2 -0
  31. package/lib/__tests__/unit/api/explorer/etherscan.unit.test.d.ts.map +1 -0
  32. package/lib/__tests__/unit/api/explorer/etherscan.unit.test.js +430 -0
  33. package/lib/__tests__/unit/api/explorer/etherscan.unit.test.js.map +1 -0
  34. package/lib/__tests__/unit/api/explorer/index.unit.test.d.ts +2 -0
  35. package/lib/__tests__/unit/api/explorer/index.unit.test.d.ts.map +1 -0
  36. package/lib/__tests__/unit/api/explorer/index.unit.test.js +49 -0
  37. package/lib/__tests__/unit/api/explorer/index.unit.test.js.map +1 -0
  38. package/lib/__tests__/unit/api/gasTracker/index.unit.test.d.ts +2 -0
  39. package/lib/__tests__/unit/api/gasTracker/index.unit.test.d.ts.map +1 -0
  40. package/lib/__tests__/{gasTracker → unit/api/gasTracker}/index.unit.test.js +3 -3
  41. package/lib/__tests__/unit/api/gasTracker/index.unit.test.js.map +1 -0
  42. package/lib/__tests__/unit/api/gasTracker/ledger.unit.test.d.ts.map +1 -0
  43. package/lib/__tests__/{gasTracker → unit/api/gasTracker}/ledger.unit.test.js +2 -2
  44. package/lib/__tests__/unit/api/gasTracker/ledger.unit.test.js.map +1 -0
  45. package/lib/__tests__/unit/api/rpc/rpc.unit.test.d.ts.map +1 -0
  46. package/lib/__tests__/{rpc.unit.test.js → unit/api/rpc/rpc.unit.test.js} +14 -14
  47. package/lib/__tests__/unit/api/rpc/rpc.unit.test.js.map +1 -0
  48. package/lib/__tests__/unit/broadcast.unit.test.d.ts.map +1 -0
  49. package/lib/__tests__/unit/broadcast.unit.test.js +335 -0
  50. package/lib/__tests__/unit/broadcast.unit.test.js.map +1 -0
  51. package/lib/__tests__/unit/buildOptimisticOperation.unit.test.d.ts.map +1 -0
  52. package/lib/__tests__/{buildOptimisticOperation.unit.test.js → unit/buildOptimisticOperation.unit.test.js} +132 -6
  53. package/lib/__tests__/unit/buildOptimisticOperation.unit.test.js.map +1 -0
  54. package/lib/__tests__/unit/createTransaction.unit.test.d.ts.map +1 -0
  55. package/lib/__tests__/{createTransaction.unit.test.js → unit/createTransaction.unit.test.js} +5 -5
  56. package/lib/__tests__/unit/createTransaction.unit.test.js.map +1 -0
  57. package/lib/__tests__/unit/deviceTransactionConfig.unit.test.d.ts.map +1 -0
  58. package/lib/__tests__/{deviceTransactionConfig.unit.test.js → unit/deviceTransactionConfig.unit.test.js} +123 -6
  59. package/lib/__tests__/unit/deviceTransactionConfig.unit.test.js.map +1 -0
  60. package/lib/__tests__/unit/estimateMaxSpendable.unit.test.d.ts.map +1 -0
  61. package/lib/__tests__/{estimateMaxSpendable.unit.test.js → unit/estimateMaxSpendable.unit.test.js} +6 -6
  62. package/lib/__tests__/unit/estimateMaxSpendable.unit.test.js.map +1 -0
  63. package/lib/__tests__/unit/getTransactionStatus.unit.test.d.ts.map +1 -0
  64. package/lib/__tests__/{getTransactionStatus.unit.test.js → unit/getTransactionStatus.unit.test.js} +76 -6
  65. package/lib/__tests__/unit/getTransactionStatus.unit.test.js.map +1 -0
  66. package/lib/__tests__/unit/hw-getAddress.unit.test.d.ts.map +1 -0
  67. package/lib/__tests__/{hw-getAddress.unit.test.js → unit/hw-getAddress.unit.test.js} +5 -1
  68. package/lib/__tests__/unit/hw-getAddress.unit.test.js.map +1 -0
  69. package/lib/__tests__/unit/hw-signMessage.unit.test.d.ts +2 -0
  70. package/lib/__tests__/unit/hw-signMessage.unit.test.d.ts.map +1 -0
  71. package/lib/__tests__/unit/hw-signMessage.unit.test.js +188 -0
  72. package/lib/__tests__/unit/hw-signMessage.unit.test.js.map +1 -0
  73. package/lib/__tests__/unit/logic.unit.test.d.ts.map +1 -0
  74. package/lib/__tests__/{logic.unit.test.js → unit/logic.unit.test.js} +111 -20
  75. package/lib/__tests__/unit/logic.unit.test.js.map +1 -0
  76. package/lib/__tests__/unit/nftResolvers.unit.test.d.ts +2 -0
  77. package/lib/__tests__/unit/nftResolvers.unit.test.d.ts.map +1 -0
  78. package/lib/__tests__/unit/nftResolvers.unit.test.js +163 -0
  79. package/lib/__tests__/unit/nftResolvers.unit.test.js.map +1 -0
  80. package/lib/__tests__/unit/preload.unit.test.d.ts.map +1 -0
  81. package/lib/__tests__/{preload.unit.test.js → unit/preload.unit.test.js} +3 -3
  82. package/lib/__tests__/unit/preload.unit.test.js.map +1 -0
  83. package/lib/__tests__/unit/prepareTransaction.unit.test.d.ts.map +1 -0
  84. package/lib/__tests__/unit/prepareTransaction.unit.test.js +300 -0
  85. package/lib/__tests__/unit/prepareTransaction.unit.test.js.map +1 -0
  86. package/lib/__tests__/unit/signOperation.unit.test.d.ts.map +1 -0
  87. package/lib/__tests__/{signOperation.unit.test.js → unit/signOperation.unit.test.js} +14 -17
  88. package/lib/__tests__/unit/signOperation.unit.test.js.map +1 -0
  89. package/lib/__tests__/unit/synchronization.unit.test.d.ts.map +1 -0
  90. package/lib/__tests__/{synchronization.unit.test.js → unit/synchronization.unit.test.js} +139 -231
  91. package/lib/__tests__/unit/synchronization.unit.test.js.map +1 -0
  92. package/lib/__tests__/unit/transaction.unit.test.d.ts.map +1 -0
  93. package/lib/__tests__/{transaction.unit.test.js → unit/transaction.unit.test.js} +48 -80
  94. package/lib/__tests__/unit/transaction.unit.test.js.map +1 -0
  95. package/lib/abis/erc1155.abi.json +314 -0
  96. package/lib/abis/erc721.abi.json +346 -0
  97. package/lib/adapters.d.ts +18 -7
  98. package/lib/adapters.d.ts.map +1 -1
  99. package/lib/adapters.js +131 -46
  100. package/lib/adapters.js.map +1 -1
  101. package/lib/api/explorer/etherscan.d.ts +39 -11
  102. package/lib/api/explorer/etherscan.d.ts.map +1 -1
  103. package/lib/api/explorer/etherscan.js +151 -9
  104. package/lib/api/explorer/etherscan.js.map +1 -1
  105. package/lib/api/explorer/index.d.ts +7 -16
  106. package/lib/api/explorer/index.d.ts.map +1 -1
  107. package/lib/api/explorer/index.js.map +1 -1
  108. package/lib/api/nft/index.d.ts +24 -0
  109. package/lib/api/nft/index.d.ts.map +1 -0
  110. package/lib/api/nft/index.js +54 -0
  111. package/lib/api/nft/index.js.map +1 -0
  112. package/lib/api/rpc/index.native.d.ts.map +1 -1
  113. package/lib/api/rpc/index.native.js +1 -0
  114. package/lib/api/rpc/index.native.js.map +1 -1
  115. package/lib/api/rpc/rpc.common.d.ts +2 -2
  116. package/lib/api/rpc/rpc.common.d.ts.map +1 -1
  117. package/lib/api/rpc/rpc.common.js +3 -3
  118. package/lib/api/rpc/rpc.common.js.map +1 -1
  119. package/lib/bridge/js.d.ts +1 -1
  120. package/lib/bridge/js.d.ts.map +1 -1
  121. package/lib/bridge/js.js +10 -10
  122. package/lib/bridge/js.js.map +1 -1
  123. package/lib/broadcast.d.ts.map +1 -1
  124. package/lib/broadcast.js +9 -2
  125. package/lib/broadcast.js.map +1 -1
  126. package/lib/buildOptimisticOperation.d.ts +5 -1
  127. package/lib/buildOptimisticOperation.d.ts.map +1 -1
  128. package/lib/buildOptimisticOperation.js +46 -4
  129. package/lib/buildOptimisticOperation.js.map +1 -1
  130. package/lib/cli-transaction.d.ts.map +1 -1
  131. package/lib/cli-transaction.js +1 -0
  132. package/lib/cli-transaction.js.map +1 -1
  133. package/lib/datasets/ethereum1.d.ts.map +1 -1
  134. package/lib/datasets/ethereum1.js +3 -2
  135. package/lib/datasets/ethereum1.js.map +1 -1
  136. package/lib/deviceTransactionConfig.d.ts.map +1 -1
  137. package/lib/deviceTransactionConfig.js +50 -0
  138. package/lib/deviceTransactionConfig.js.map +1 -1
  139. package/lib/errors.d.ts +9 -0
  140. package/lib/errors.d.ts.map +1 -1
  141. package/lib/errors.js +7 -1
  142. package/lib/errors.js.map +1 -1
  143. package/lib/getTransactionStatus.d.ts +1 -0
  144. package/lib/getTransactionStatus.d.ts.map +1 -1
  145. package/lib/getTransactionStatus.js +25 -3
  146. package/lib/getTransactionStatus.js.map +1 -1
  147. package/lib/hw-signMessage.d.ts +15 -0
  148. package/lib/hw-signMessage.d.ts.map +1 -0
  149. package/lib/hw-signMessage.js +86 -0
  150. package/lib/hw-signMessage.js.map +1 -0
  151. package/lib/logic.d.ts +63 -1
  152. package/lib/logic.d.ts.map +1 -1
  153. package/lib/logic.js +98 -2
  154. package/lib/logic.js.map +1 -1
  155. package/lib/nftResolvers.d.ts +19 -0
  156. package/lib/nftResolvers.d.ts.map +1 -0
  157. package/lib/nftResolvers.js +58 -0
  158. package/lib/nftResolvers.js.map +1 -0
  159. package/lib/preload.d.ts.map +1 -1
  160. package/lib/preload.js +7 -3
  161. package/lib/preload.js.map +1 -1
  162. package/lib/prepareTransaction.d.ts +6 -1
  163. package/lib/prepareTransaction.d.ts.map +1 -1
  164. package/lib/prepareTransaction.js +69 -18
  165. package/lib/prepareTransaction.js.map +1 -1
  166. package/lib/signOperation.d.ts +1 -1
  167. package/lib/signOperation.d.ts.map +1 -1
  168. package/lib/signOperation.js +17 -6
  169. package/lib/signOperation.js.map +1 -1
  170. package/lib/signer.d.ts +24 -1
  171. package/lib/signer.d.ts.map +1 -1
  172. package/lib/specs.d.ts +3 -1
  173. package/lib/specs.d.ts.map +1 -1
  174. package/lib/specs.js +3 -3
  175. package/lib/specs.js.map +1 -1
  176. package/lib/speculos-deviceActions.d.ts.map +1 -1
  177. package/lib/speculos-deviceActions.js +2 -1
  178. package/lib/speculos-deviceActions.js.map +1 -1
  179. package/lib/synchronization.d.ts +7 -2
  180. package/lib/synchronization.d.ts.map +1 -1
  181. package/lib/synchronization.js +45 -45
  182. package/lib/synchronization.js.map +1 -1
  183. package/lib/transaction.d.ts +3 -4
  184. package/lib/transaction.d.ts.map +1 -1
  185. package/lib/transaction.js +58 -12
  186. package/lib/transaction.js.map +1 -1
  187. package/lib/types.d.ts +85 -10
  188. package/lib/types.d.ts.map +1 -1
  189. package/lib-es/__tests__/fixtures/common.fixtures.d.ts +9 -0
  190. package/lib-es/__tests__/fixtures/common.fixtures.d.ts.map +1 -0
  191. package/lib-es/{testUtils.js → __tests__/fixtures/common.fixtures.js} +36 -8
  192. package/lib-es/__tests__/fixtures/common.fixtures.js.map +1 -0
  193. package/lib-es/__tests__/fixtures/etherscan.fixtures.d.ts +86 -0
  194. package/lib-es/__tests__/fixtures/etherscan.fixtures.d.ts.map +1 -0
  195. package/lib-es/__tests__/fixtures/etherscan.fixtures.js +264 -0
  196. package/lib-es/__tests__/fixtures/etherscan.fixtures.js.map +1 -0
  197. package/lib-es/__tests__/fixtures/prepareTransaction.fixtures.d.ts +10 -0
  198. package/lib-es/__tests__/fixtures/prepareTransaction.fixtures.d.ts.map +1 -0
  199. package/lib-es/__tests__/fixtures/prepareTransaction.fixtures.js +62 -0
  200. package/lib-es/__tests__/fixtures/prepareTransaction.fixtures.js.map +1 -0
  201. package/lib-es/__tests__/fixtures/synchronization.fixtures.d.ts +44 -0
  202. package/lib-es/__tests__/fixtures/synchronization.fixtures.d.ts.map +1 -0
  203. package/lib-es/__tests__/fixtures/synchronization.fixtures.js +190 -0
  204. package/lib-es/__tests__/fixtures/synchronization.fixtures.js.map +1 -0
  205. package/lib-es/__tests__/fixtures/transaction.fixtures.d.ts +47 -0
  206. package/lib-es/__tests__/fixtures/transaction.fixtures.d.ts.map +1 -0
  207. package/lib-es/__tests__/fixtures/transaction.fixtures.js +176 -0
  208. package/lib-es/__tests__/fixtures/transaction.fixtures.js.map +1 -0
  209. package/lib-es/__tests__/integration/bridge.integration.test.d.ts +7 -0
  210. package/lib-es/__tests__/integration/bridge.integration.test.d.ts.map +1 -0
  211. package/lib-es/__tests__/integration/bridge.integration.test.js +71 -0
  212. package/lib-es/__tests__/integration/bridge.integration.test.js.map +1 -0
  213. package/lib-es/__tests__/unit/adapters.unit.test.d.ts.map +1 -0
  214. package/lib-es/__tests__/unit/adapters.unit.test.js +984 -0
  215. package/lib-es/__tests__/unit/adapters.unit.test.js.map +1 -0
  216. package/lib-es/__tests__/unit/api/explorer/etherscan.unit.test.d.ts +2 -0
  217. package/lib-es/__tests__/unit/api/explorer/etherscan.unit.test.d.ts.map +1 -0
  218. package/lib-es/__tests__/unit/api/explorer/etherscan.unit.test.js +402 -0
  219. package/lib-es/__tests__/unit/api/explorer/etherscan.unit.test.js.map +1 -0
  220. package/lib-es/__tests__/unit/api/explorer/index.unit.test.d.ts.map +1 -0
  221. package/lib-es/__tests__/unit/api/explorer/index.unit.test.js +44 -0
  222. package/lib-es/__tests__/unit/api/explorer/index.unit.test.js.map +1 -0
  223. package/lib-es/__tests__/unit/api/gasTracker/index.unit.test.d.ts.map +1 -0
  224. package/lib-es/__tests__/{gasTracker → unit/api/gasTracker}/index.unit.test.js +3 -3
  225. package/lib-es/__tests__/unit/api/gasTracker/index.unit.test.js.map +1 -0
  226. package/lib-es/__tests__/unit/api/gasTracker/ledger.unit.test.d.ts.map +1 -0
  227. package/lib-es/__tests__/{gasTracker → unit/api/gasTracker}/ledger.unit.test.js +2 -2
  228. package/lib-es/__tests__/unit/api/gasTracker/ledger.unit.test.js.map +1 -0
  229. package/lib-es/__tests__/unit/api/rpc/rpc.unit.test.d.ts.map +1 -0
  230. package/lib-es/__tests__/{rpc.unit.test.js → unit/api/rpc/rpc.unit.test.js} +13 -13
  231. package/lib-es/__tests__/unit/api/rpc/rpc.unit.test.js.map +1 -0
  232. package/lib-es/__tests__/unit/broadcast.unit.test.d.ts.map +1 -0
  233. package/lib-es/__tests__/unit/broadcast.unit.test.js +307 -0
  234. package/lib-es/__tests__/unit/broadcast.unit.test.js.map +1 -0
  235. package/lib-es/__tests__/unit/buildOptimisticOperation.unit.test.d.ts.map +1 -0
  236. package/lib-es/__tests__/{buildOptimisticOperation.unit.test.js → unit/buildOptimisticOperation.unit.test.js} +130 -4
  237. package/lib-es/__tests__/unit/buildOptimisticOperation.unit.test.js.map +1 -0
  238. package/lib-es/__tests__/unit/createTransaction.unit.test.d.ts.map +1 -0
  239. package/lib-es/__tests__/{createTransaction.unit.test.js → unit/createTransaction.unit.test.js} +3 -3
  240. package/lib-es/__tests__/unit/createTransaction.unit.test.js.map +1 -0
  241. package/lib-es/__tests__/unit/deviceTransactionConfig.unit.test.d.ts.map +1 -0
  242. package/lib-es/__tests__/{deviceTransactionConfig.unit.test.js → unit/deviceTransactionConfig.unit.test.js} +121 -4
  243. package/lib-es/__tests__/unit/deviceTransactionConfig.unit.test.js.map +1 -0
  244. package/lib-es/__tests__/unit/estimateMaxSpendable.unit.test.d.ts.map +1 -0
  245. package/lib-es/__tests__/{estimateMaxSpendable.unit.test.js → unit/estimateMaxSpendable.unit.test.js} +4 -4
  246. package/lib-es/__tests__/unit/estimateMaxSpendable.unit.test.js.map +1 -0
  247. package/lib-es/__tests__/unit/getTransactionStatus.unit.test.d.ts.map +1 -0
  248. package/lib-es/__tests__/{getTransactionStatus.unit.test.js → unit/getTransactionStatus.unit.test.js} +74 -4
  249. package/lib-es/__tests__/unit/getTransactionStatus.unit.test.js.map +1 -0
  250. package/lib-es/__tests__/unit/hw-getAddress.unit.test.d.ts.map +1 -0
  251. package/lib-es/__tests__/{hw-getAddress.unit.test.js → unit/hw-getAddress.unit.test.js} +5 -1
  252. package/lib-es/__tests__/unit/hw-getAddress.unit.test.js.map +1 -0
  253. package/lib-es/__tests__/unit/hw-signMessage.unit.test.d.ts +2 -0
  254. package/lib-es/__tests__/unit/hw-signMessage.unit.test.d.ts.map +1 -0
  255. package/lib-es/__tests__/unit/hw-signMessage.unit.test.js +186 -0
  256. package/lib-es/__tests__/unit/hw-signMessage.unit.test.js.map +1 -0
  257. package/lib-es/__tests__/unit/logic.unit.test.d.ts.map +1 -0
  258. package/lib-es/__tests__/{logic.unit.test.js → unit/logic.unit.test.js} +97 -6
  259. package/lib-es/__tests__/unit/logic.unit.test.js.map +1 -0
  260. package/lib-es/__tests__/unit/nftResolvers.unit.test.d.ts +2 -0
  261. package/lib-es/__tests__/unit/nftResolvers.unit.test.d.ts.map +1 -0
  262. package/lib-es/__tests__/unit/nftResolvers.unit.test.js +158 -0
  263. package/lib-es/__tests__/unit/nftResolvers.unit.test.js.map +1 -0
  264. package/lib-es/__tests__/unit/preload.unit.test.d.ts.map +1 -0
  265. package/lib-es/__tests__/{preload.unit.test.js → unit/preload.unit.test.js} +3 -3
  266. package/lib-es/__tests__/unit/preload.unit.test.js.map +1 -0
  267. package/lib-es/__tests__/unit/prepareTransaction.unit.test.d.ts.map +1 -0
  268. package/lib-es/__tests__/{prepareTransaction.unit.test.js → unit/prepareTransaction.unit.test.js} +134 -82
  269. package/lib-es/__tests__/unit/prepareTransaction.unit.test.js.map +1 -0
  270. package/lib-es/__tests__/unit/signOperation.unit.test.d.ts.map +1 -0
  271. package/lib-es/__tests__/{signOperation.unit.test.js → unit/signOperation.unit.test.js} +13 -16
  272. package/lib-es/__tests__/unit/signOperation.unit.test.js.map +1 -0
  273. package/lib-es/__tests__/unit/synchronization.unit.test.d.ts.map +1 -0
  274. package/lib-es/__tests__/{synchronization.unit.test.js → unit/synchronization.unit.test.js} +115 -207
  275. package/lib-es/__tests__/unit/synchronization.unit.test.js.map +1 -0
  276. package/lib-es/__tests__/unit/transaction.unit.test.d.ts.map +1 -0
  277. package/lib-es/__tests__/{transaction.unit.test.js → unit/transaction.unit.test.js} +40 -72
  278. package/lib-es/__tests__/unit/transaction.unit.test.js.map +1 -0
  279. package/lib-es/abis/erc1155.abi.json +314 -0
  280. package/lib-es/abis/erc721.abi.json +346 -0
  281. package/lib-es/adapters.d.ts +18 -7
  282. package/lib-es/adapters.d.ts.map +1 -1
  283. package/lib-es/adapters.js +127 -44
  284. package/lib-es/adapters.js.map +1 -1
  285. package/lib-es/api/explorer/etherscan.d.ts +39 -11
  286. package/lib-es/api/explorer/etherscan.d.ts.map +1 -1
  287. package/lib-es/api/explorer/etherscan.js +146 -10
  288. package/lib-es/api/explorer/etherscan.js.map +1 -1
  289. package/lib-es/api/explorer/index.d.ts +7 -16
  290. package/lib-es/api/explorer/index.d.ts.map +1 -1
  291. package/lib-es/api/explorer/index.js.map +1 -1
  292. package/lib-es/api/nft/index.d.ts +24 -0
  293. package/lib-es/api/nft/index.d.ts.map +1 -0
  294. package/lib-es/api/nft/index.js +46 -0
  295. package/lib-es/api/nft/index.js.map +1 -0
  296. package/lib-es/api/rpc/index.native.d.ts.map +1 -1
  297. package/lib-es/api/rpc/index.native.js +1 -0
  298. package/lib-es/api/rpc/index.native.js.map +1 -1
  299. package/lib-es/api/rpc/rpc.common.d.ts +2 -2
  300. package/lib-es/api/rpc/rpc.common.d.ts.map +1 -1
  301. package/lib-es/api/rpc/rpc.common.js +3 -3
  302. package/lib-es/api/rpc/rpc.common.js.map +1 -1
  303. package/lib-es/bridge/js.d.ts +1 -1
  304. package/lib-es/bridge/js.d.ts.map +1 -1
  305. package/lib-es/bridge/js.js +10 -10
  306. package/lib-es/bridge/js.js.map +1 -1
  307. package/lib-es/broadcast.d.ts.map +1 -1
  308. package/lib-es/broadcast.js +9 -2
  309. package/lib-es/broadcast.js.map +1 -1
  310. package/lib-es/buildOptimisticOperation.d.ts +5 -1
  311. package/lib-es/buildOptimisticOperation.d.ts.map +1 -1
  312. package/lib-es/buildOptimisticOperation.js +45 -4
  313. package/lib-es/buildOptimisticOperation.js.map +1 -1
  314. package/lib-es/cli-transaction.d.ts.map +1 -1
  315. package/lib-es/cli-transaction.js +1 -0
  316. package/lib-es/cli-transaction.js.map +1 -1
  317. package/lib-es/datasets/ethereum1.d.ts.map +1 -1
  318. package/lib-es/datasets/ethereum1.js +3 -2
  319. package/lib-es/datasets/ethereum1.js.map +1 -1
  320. package/lib-es/deviceTransactionConfig.d.ts.map +1 -1
  321. package/lib-es/deviceTransactionConfig.js +50 -0
  322. package/lib-es/deviceTransactionConfig.js.map +1 -1
  323. package/lib-es/errors.d.ts +9 -0
  324. package/lib-es/errors.d.ts.map +1 -1
  325. package/lib-es/errors.js +6 -0
  326. package/lib-es/errors.js.map +1 -1
  327. package/lib-es/getTransactionStatus.d.ts +1 -0
  328. package/lib-es/getTransactionStatus.d.ts.map +1 -1
  329. package/lib-es/getTransactionStatus.js +23 -2
  330. package/lib-es/getTransactionStatus.js.map +1 -1
  331. package/lib-es/hw-signMessage.d.ts +15 -0
  332. package/lib-es/hw-signMessage.d.ts.map +1 -0
  333. package/lib-es/hw-signMessage.js +81 -0
  334. package/lib-es/hw-signMessage.js.map +1 -0
  335. package/lib-es/logic.d.ts +63 -1
  336. package/lib-es/logic.d.ts.map +1 -1
  337. package/lib-es/logic.js +95 -1
  338. package/lib-es/logic.js.map +1 -1
  339. package/lib-es/nftResolvers.d.ts +19 -0
  340. package/lib-es/nftResolvers.d.ts.map +1 -0
  341. package/lib-es/nftResolvers.js +50 -0
  342. package/lib-es/nftResolvers.js.map +1 -0
  343. package/lib-es/preload.d.ts.map +1 -1
  344. package/lib-es/preload.js +7 -3
  345. package/lib-es/preload.js.map +1 -1
  346. package/lib-es/prepareTransaction.d.ts +6 -1
  347. package/lib-es/prepareTransaction.d.ts.map +1 -1
  348. package/lib-es/prepareTransaction.js +68 -18
  349. package/lib-es/prepareTransaction.js.map +1 -1
  350. package/lib-es/signOperation.d.ts +1 -1
  351. package/lib-es/signOperation.d.ts.map +1 -1
  352. package/lib-es/signOperation.js +17 -6
  353. package/lib-es/signOperation.js.map +1 -1
  354. package/lib-es/signer.d.ts +24 -1
  355. package/lib-es/signer.d.ts.map +1 -1
  356. package/lib-es/specs.d.ts +3 -1
  357. package/lib-es/specs.d.ts.map +1 -1
  358. package/lib-es/specs.js +3 -3
  359. package/lib-es/specs.js.map +1 -1
  360. package/lib-es/speculos-deviceActions.d.ts.map +1 -1
  361. package/lib-es/speculos-deviceActions.js +2 -1
  362. package/lib-es/speculos-deviceActions.js.map +1 -1
  363. package/lib-es/synchronization.d.ts +7 -2
  364. package/lib-es/synchronization.d.ts.map +1 -1
  365. package/lib-es/synchronization.js +46 -46
  366. package/lib-es/synchronization.js.map +1 -1
  367. package/lib-es/transaction.d.ts +3 -4
  368. package/lib-es/transaction.d.ts.map +1 -1
  369. package/lib-es/transaction.js +58 -12
  370. package/lib-es/transaction.js.map +1 -1
  371. package/lib-es/types.d.ts +85 -10
  372. package/lib-es/types.d.ts.map +1 -1
  373. package/package.json +13 -12
  374. package/src/{testUtils.ts → __tests__/fixtures/common.fixtures.ts} +78 -11
  375. package/src/__tests__/fixtures/etherscan.fixtures.ts +266 -0
  376. package/src/__tests__/fixtures/prepareTransaction.fixtures.ts +86 -0
  377. package/src/__tests__/fixtures/synchronization.fixtures.ts +229 -0
  378. package/src/__tests__/fixtures/transaction.fixtures.ts +229 -0
  379. package/src/__tests__/integration/bridge.integration.test.ts +74 -0
  380. package/src/__tests__/unit/adapters.unit.test.ts +1076 -0
  381. package/src/__tests__/unit/api/explorer/etherscan.unit.test.ts +563 -0
  382. package/src/__tests__/unit/api/explorer/index.unit.test.ts +36 -0
  383. package/src/__tests__/{gasTracker → unit/api/gasTracker}/index.unit.test.ts +3 -3
  384. package/src/__tests__/{gasTracker → unit/api/gasTracker}/ledger.unit.test.ts +3 -3
  385. package/src/__tests__/{rpc.unit.test.ts → unit/api/rpc/rpc.unit.test.ts} +17 -14
  386. package/src/__tests__/unit/broadcast.unit.test.ts +332 -0
  387. package/src/__tests__/{buildOptimisticOperation.unit.test.ts → unit/buildOptimisticOperation.unit.test.ts} +144 -5
  388. package/src/__tests__/{createTransaction.unit.test.ts → unit/createTransaction.unit.test.ts} +4 -4
  389. package/src/__tests__/{deviceTransactionConfig.unit.test.ts → unit/deviceTransactionConfig.unit.test.ts} +130 -5
  390. package/src/__tests__/{estimateMaxSpendable.unit.test.ts → unit/estimateMaxSpendable.unit.test.ts} +5 -5
  391. package/src/__tests__/{getTransactionStatus.unit.test.ts → unit/getTransactionStatus.unit.test.ts} +121 -5
  392. package/src/__tests__/{hw-getAddress.unit.test.ts → unit/hw-getAddress.unit.test.ts} +6 -2
  393. package/src/__tests__/unit/hw-signMessage.unit.test.ts +192 -0
  394. package/src/__tests__/{logic.unit.test.ts → unit/logic.unit.test.ts} +143 -8
  395. package/src/__tests__/unit/nftResolvers.unit.test.ts +179 -0
  396. package/src/__tests__/{preload.unit.test.ts → unit/preload.unit.test.ts} +4 -4
  397. package/src/__tests__/{prepareTransaction.unit.test.ts → unit/prepareTransaction.unit.test.ts} +284 -109
  398. package/src/__tests__/{signOperation.unit.test.ts → unit/signOperation.unit.test.ts} +18 -20
  399. package/src/__tests__/{synchronization.unit.test.ts → unit/synchronization.unit.test.ts} +202 -280
  400. package/src/__tests__/unit/transaction.unit.test.ts +198 -0
  401. package/src/abis/erc1155.abi.json +314 -0
  402. package/src/abis/erc20.abi.json +4 -12
  403. package/src/abis/erc721.abi.json +346 -0
  404. package/src/adapters.ts +177 -64
  405. package/src/api/explorer/etherscan.ts +265 -49
  406. package/src/api/explorer/index.ts +24 -10
  407. package/src/api/nft/index.ts +49 -0
  408. package/src/api/rpc/index.native.ts +2 -0
  409. package/src/api/rpc/rpc.common.ts +3 -3
  410. package/src/bridge/js.ts +13 -16
  411. package/src/broadcast.ts +29 -2
  412. package/src/buildOptimisticOperation.ts +71 -6
  413. package/src/cli-transaction.ts +2 -0
  414. package/src/datasets/ethereum1.ts +4 -2
  415. package/src/deviceTransactionConfig.ts +65 -0
  416. package/src/errors.ts +8 -0
  417. package/src/getTransactionStatus.ts +26 -0
  418. package/src/hw-signMessage.ts +92 -0
  419. package/src/logic.ts +118 -2
  420. package/src/nftResolvers.ts +71 -0
  421. package/src/preload.ts +9 -3
  422. package/src/prepareTransaction.ts +102 -24
  423. package/src/signOperation.ts +21 -8
  424. package/src/signer.ts +44 -1
  425. package/src/specs.ts +11 -6
  426. package/src/speculos-deviceActions.ts +3 -1
  427. package/src/synchronization.ts +73 -59
  428. package/src/transaction.ts +68 -15
  429. package/src/types.ts +108 -10
  430. package/.eslintrc.js +0 -22
  431. package/lib/__tests__/adapters.unit.test.d.ts.map +0 -1
  432. package/lib/__tests__/adapters.unit.test.js +0 -455
  433. package/lib/__tests__/adapters.unit.test.js.map +0 -1
  434. package/lib/__tests__/broadcast.unit.test.d.ts.map +0 -1
  435. package/lib/__tests__/broadcast.unit.test.js +0 -181
  436. package/lib/__tests__/broadcast.unit.test.js.map +0 -1
  437. package/lib/__tests__/buildOptimisticOperation.unit.test.d.ts.map +0 -1
  438. package/lib/__tests__/buildOptimisticOperation.unit.test.js.map +0 -1
  439. package/lib/__tests__/createTransaction.unit.test.d.ts.map +0 -1
  440. package/lib/__tests__/createTransaction.unit.test.js.map +0 -1
  441. package/lib/__tests__/deviceTransactionConfig.unit.test.d.ts.map +0 -1
  442. package/lib/__tests__/deviceTransactionConfig.unit.test.js.map +0 -1
  443. package/lib/__tests__/estimateMaxSpendable.unit.test.d.ts.map +0 -1
  444. package/lib/__tests__/estimateMaxSpendable.unit.test.js.map +0 -1
  445. package/lib/__tests__/gasTracker/index.unit.test.d.ts.map +0 -1
  446. package/lib/__tests__/gasTracker/index.unit.test.js.map +0 -1
  447. package/lib/__tests__/gasTracker/ledger.unit.test.d.ts.map +0 -1
  448. package/lib/__tests__/gasTracker/ledger.unit.test.js.map +0 -1
  449. package/lib/__tests__/getTransactionStatus.unit.test.d.ts.map +0 -1
  450. package/lib/__tests__/getTransactionStatus.unit.test.js.map +0 -1
  451. package/lib/__tests__/hw-getAddress.unit.test.d.ts.map +0 -1
  452. package/lib/__tests__/hw-getAddress.unit.test.js.map +0 -1
  453. package/lib/__tests__/logic.unit.test.d.ts.map +0 -1
  454. package/lib/__tests__/logic.unit.test.js.map +0 -1
  455. package/lib/__tests__/preload.unit.test.d.ts.map +0 -1
  456. package/lib/__tests__/preload.unit.test.js.map +0 -1
  457. package/lib/__tests__/prepareTransaction.unit.test.d.ts.map +0 -1
  458. package/lib/__tests__/prepareTransaction.unit.test.js +0 -248
  459. package/lib/__tests__/prepareTransaction.unit.test.js.map +0 -1
  460. package/lib/__tests__/rpc.unit.test.d.ts.map +0 -1
  461. package/lib/__tests__/rpc.unit.test.js.map +0 -1
  462. package/lib/__tests__/signOperation.unit.test.d.ts.map +0 -1
  463. package/lib/__tests__/signOperation.unit.test.js.map +0 -1
  464. package/lib/__tests__/synchronization.unit.test.d.ts.map +0 -1
  465. package/lib/__tests__/synchronization.unit.test.js.map +0 -1
  466. package/lib/__tests__/transaction.unit.test.d.ts.map +0 -1
  467. package/lib/__tests__/transaction.unit.test.js.map +0 -1
  468. package/lib/bridge.integration.test.d.ts +0 -14
  469. package/lib/bridge.integration.test.d.ts.map +0 -1
  470. package/lib/bridge.integration.test.js +0 -85
  471. package/lib/bridge.integration.test.js.map +0 -1
  472. package/lib/datasets/ethereum.scanAccounts.1.d.ts +0 -7
  473. package/lib/datasets/ethereum.scanAccounts.1.d.ts.map +0 -1
  474. package/lib/datasets/ethereum.scanAccounts.1.js +0 -51
  475. package/lib/datasets/ethereum.scanAccounts.1.js.map +0 -1
  476. package/lib/datasets/ethereum2.d.ts +0 -3
  477. package/lib/datasets/ethereum2.d.ts.map +0 -1
  478. package/lib/datasets/ethereum2.js +0 -22
  479. package/lib/datasets/ethereum2.js.map +0 -1
  480. package/lib/datasets/ethereum_classic.d.ts +0 -5
  481. package/lib/datasets/ethereum_classic.d.ts.map +0 -1
  482. package/lib/datasets/ethereum_classic.js +0 -69
  483. package/lib/datasets/ethereum_classic.js.map +0 -1
  484. package/lib/testUtils.d.ts +0 -6
  485. package/lib/testUtils.d.ts.map +0 -1
  486. package/lib/testUtils.js.map +0 -1
  487. package/lib-es/__tests__/adapters.unit.test.d.ts.map +0 -1
  488. package/lib-es/__tests__/adapters.unit.test.js +0 -450
  489. package/lib-es/__tests__/adapters.unit.test.js.map +0 -1
  490. package/lib-es/__tests__/broadcast.unit.test.d.ts.map +0 -1
  491. package/lib-es/__tests__/broadcast.unit.test.js +0 -153
  492. package/lib-es/__tests__/broadcast.unit.test.js.map +0 -1
  493. package/lib-es/__tests__/buildOptimisticOperation.unit.test.d.ts.map +0 -1
  494. package/lib-es/__tests__/buildOptimisticOperation.unit.test.js.map +0 -1
  495. package/lib-es/__tests__/createTransaction.unit.test.d.ts.map +0 -1
  496. package/lib-es/__tests__/createTransaction.unit.test.js.map +0 -1
  497. package/lib-es/__tests__/deviceTransactionConfig.unit.test.d.ts.map +0 -1
  498. package/lib-es/__tests__/deviceTransactionConfig.unit.test.js.map +0 -1
  499. package/lib-es/__tests__/estimateMaxSpendable.unit.test.d.ts.map +0 -1
  500. package/lib-es/__tests__/estimateMaxSpendable.unit.test.js.map +0 -1
  501. package/lib-es/__tests__/gasTracker/index.unit.test.d.ts.map +0 -1
  502. package/lib-es/__tests__/gasTracker/index.unit.test.js.map +0 -1
  503. package/lib-es/__tests__/gasTracker/ledger.unit.test.d.ts.map +0 -1
  504. package/lib-es/__tests__/gasTracker/ledger.unit.test.js.map +0 -1
  505. package/lib-es/__tests__/getTransactionStatus.unit.test.d.ts.map +0 -1
  506. package/lib-es/__tests__/getTransactionStatus.unit.test.js.map +0 -1
  507. package/lib-es/__tests__/hw-getAddress.unit.test.d.ts.map +0 -1
  508. package/lib-es/__tests__/hw-getAddress.unit.test.js.map +0 -1
  509. package/lib-es/__tests__/logic.unit.test.d.ts.map +0 -1
  510. package/lib-es/__tests__/logic.unit.test.js.map +0 -1
  511. package/lib-es/__tests__/preload.unit.test.d.ts.map +0 -1
  512. package/lib-es/__tests__/preload.unit.test.js.map +0 -1
  513. package/lib-es/__tests__/prepareTransaction.unit.test.d.ts.map +0 -1
  514. package/lib-es/__tests__/prepareTransaction.unit.test.js.map +0 -1
  515. package/lib-es/__tests__/rpc.unit.test.d.ts.map +0 -1
  516. package/lib-es/__tests__/rpc.unit.test.js.map +0 -1
  517. package/lib-es/__tests__/signOperation.unit.test.d.ts.map +0 -1
  518. package/lib-es/__tests__/signOperation.unit.test.js.map +0 -1
  519. package/lib-es/__tests__/synchronization.unit.test.d.ts.map +0 -1
  520. package/lib-es/__tests__/synchronization.unit.test.js.map +0 -1
  521. package/lib-es/__tests__/transaction.unit.test.d.ts.map +0 -1
  522. package/lib-es/__tests__/transaction.unit.test.js.map +0 -1
  523. package/lib-es/bridge.integration.test.d.ts +0 -14
  524. package/lib-es/bridge.integration.test.d.ts.map +0 -1
  525. package/lib-es/bridge.integration.test.js +0 -79
  526. package/lib-es/bridge.integration.test.js.map +0 -1
  527. package/lib-es/datasets/ethereum.scanAccounts.1.d.ts +0 -7
  528. package/lib-es/datasets/ethereum.scanAccounts.1.d.ts.map +0 -1
  529. package/lib-es/datasets/ethereum.scanAccounts.1.js +0 -49
  530. package/lib-es/datasets/ethereum.scanAccounts.1.js.map +0 -1
  531. package/lib-es/datasets/ethereum2.d.ts +0 -3
  532. package/lib-es/datasets/ethereum2.d.ts.map +0 -1
  533. package/lib-es/datasets/ethereum2.js +0 -19
  534. package/lib-es/datasets/ethereum2.js.map +0 -1
  535. package/lib-es/datasets/ethereum_classic.d.ts +0 -5
  536. package/lib-es/datasets/ethereum_classic.d.ts.map +0 -1
  537. package/lib-es/datasets/ethereum_classic.js +0 -67
  538. package/lib-es/datasets/ethereum_classic.js.map +0 -1
  539. package/lib-es/testUtils.d.ts +0 -6
  540. package/lib-es/testUtils.d.ts.map +0 -1
  541. package/lib-es/testUtils.js.map +0 -1
  542. package/src/__tests__/adapters.unit.test.ts +0 -497
  543. package/src/__tests__/broadcast.unit.test.ts +0 -163
  544. package/src/__tests__/transaction.unit.test.ts +0 -188
  545. package/src/bridge.integration.test.ts +0 -86
  546. package/src/datasets/ethereum.scanAccounts.1.ts +0 -48
  547. package/src/datasets/ethereum2.ts +0 -20
  548. package/src/datasets/ethereum_classic.ts +0 -68
  549. /package/lib/__tests__/{adapters.unit.test.d.ts → unit/adapters.unit.test.d.ts} +0 -0
  550. /package/lib/__tests__/{gasTracker → unit/api/gasTracker}/ledger.unit.test.d.ts +0 -0
  551. /package/lib/__tests__/{rpc.unit.test.d.ts → unit/api/rpc/rpc.unit.test.d.ts} +0 -0
  552. /package/lib/__tests__/{broadcast.unit.test.d.ts → unit/broadcast.unit.test.d.ts} +0 -0
  553. /package/lib/__tests__/{buildOptimisticOperation.unit.test.d.ts → unit/buildOptimisticOperation.unit.test.d.ts} +0 -0
  554. /package/lib/__tests__/{createTransaction.unit.test.d.ts → unit/createTransaction.unit.test.d.ts} +0 -0
  555. /package/lib/__tests__/{deviceTransactionConfig.unit.test.d.ts → unit/deviceTransactionConfig.unit.test.d.ts} +0 -0
  556. /package/lib/__tests__/{estimateMaxSpendable.unit.test.d.ts → unit/estimateMaxSpendable.unit.test.d.ts} +0 -0
  557. /package/lib/__tests__/{getTransactionStatus.unit.test.d.ts → unit/getTransactionStatus.unit.test.d.ts} +0 -0
  558. /package/lib/__tests__/{hw-getAddress.unit.test.d.ts → unit/hw-getAddress.unit.test.d.ts} +0 -0
  559. /package/lib/__tests__/{logic.unit.test.d.ts → unit/logic.unit.test.d.ts} +0 -0
  560. /package/lib/__tests__/{preload.unit.test.d.ts → unit/preload.unit.test.d.ts} +0 -0
  561. /package/lib/__tests__/{prepareTransaction.unit.test.d.ts → unit/prepareTransaction.unit.test.d.ts} +0 -0
  562. /package/lib/__tests__/{signOperation.unit.test.d.ts → unit/signOperation.unit.test.d.ts} +0 -0
  563. /package/lib/__tests__/{synchronization.unit.test.d.ts → unit/synchronization.unit.test.d.ts} +0 -0
  564. /package/lib/__tests__/{transaction.unit.test.d.ts → unit/transaction.unit.test.d.ts} +0 -0
  565. /package/lib-es/__tests__/{adapters.unit.test.d.ts → unit/adapters.unit.test.d.ts} +0 -0
  566. /package/lib-es/__tests__/{gasTracker → unit/api/explorer}/index.unit.test.d.ts +0 -0
  567. /package/{lib/__tests__ → lib-es/__tests__/unit/api}/gasTracker/index.unit.test.d.ts +0 -0
  568. /package/lib-es/__tests__/{gasTracker → unit/api/gasTracker}/ledger.unit.test.d.ts +0 -0
  569. /package/lib-es/__tests__/{rpc.unit.test.d.ts → unit/api/rpc/rpc.unit.test.d.ts} +0 -0
  570. /package/lib-es/__tests__/{broadcast.unit.test.d.ts → unit/broadcast.unit.test.d.ts} +0 -0
  571. /package/lib-es/__tests__/{buildOptimisticOperation.unit.test.d.ts → unit/buildOptimisticOperation.unit.test.d.ts} +0 -0
  572. /package/lib-es/__tests__/{createTransaction.unit.test.d.ts → unit/createTransaction.unit.test.d.ts} +0 -0
  573. /package/lib-es/__tests__/{deviceTransactionConfig.unit.test.d.ts → unit/deviceTransactionConfig.unit.test.d.ts} +0 -0
  574. /package/lib-es/__tests__/{estimateMaxSpendable.unit.test.d.ts → unit/estimateMaxSpendable.unit.test.d.ts} +0 -0
  575. /package/lib-es/__tests__/{getTransactionStatus.unit.test.d.ts → unit/getTransactionStatus.unit.test.d.ts} +0 -0
  576. /package/lib-es/__tests__/{hw-getAddress.unit.test.d.ts → unit/hw-getAddress.unit.test.d.ts} +0 -0
  577. /package/lib-es/__tests__/{logic.unit.test.d.ts → unit/logic.unit.test.d.ts} +0 -0
  578. /package/lib-es/__tests__/{preload.unit.test.d.ts → unit/preload.unit.test.d.ts} +0 -0
  579. /package/lib-es/__tests__/{prepareTransaction.unit.test.d.ts → unit/prepareTransaction.unit.test.d.ts} +0 -0
  580. /package/lib-es/__tests__/{signOperation.unit.test.d.ts → unit/signOperation.unit.test.d.ts} +0 -0
  581. /package/lib-es/__tests__/{synchronization.unit.test.d.ts → unit/synchronization.unit.test.d.ts} +0 -0
  582. /package/lib-es/__tests__/{transaction.unit.test.d.ts → unit/transaction.unit.test.d.ts} +0 -0
@@ -7,33 +7,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
- import { getCryptoCurrencyById, getTokenById } from "@ledgerhq/cryptoassets";
11
10
  import BigNumber from "bignumber.js";
12
- import { ethers } from "ethers";
13
- import ERC20ABI from "../abis/erc20.abi.json";
14
- import * as rpcAPI from "../api/rpc/rpc.common";
15
- import { prepareForSignOperation, prepareTransaction } from "../prepareTransaction";
16
- import { makeAccount, makeTokenAccount } from "../testUtils";
17
- const currency = getCryptoCurrencyById("ethereum");
18
- const tokenAccount = makeTokenAccount("0xkvn", getTokenById("ethereum/erc20/usd__coin"));
19
- const account = makeAccount("0xkvn", currency, [tokenAccount]);
20
- const transaction = {
21
- amount: new BigNumber(100),
22
- useAllAmount: false,
23
- subAccountId: "id",
24
- recipient: "0x6bfD74C0996F269Bcece59191EFf667b3dFD73b9",
25
- feesStrategy: "medium",
26
- family: "evm",
27
- mode: "send",
28
- gasPrice: new BigNumber(0),
29
- gasLimit: new BigNumber(21000),
30
- nonce: 0,
31
- chainId: 1,
32
- };
33
- const tokenTransaction = Object.assign(Object.assign({}, transaction), { subAccountId: tokenAccount.id });
34
- const expectedData = (recipient, amount) => Buffer.from(new ethers.utils.Interface(ERC20ABI)
35
- .encodeFunctionData("transfer", [recipient, amount.toFixed()])
36
- .slice(2), "hex");
11
+ import { prepareForSignOperation, prepareTransaction } from "../../prepareTransaction";
12
+ import * as rpcAPI from "../../api/rpc/rpc.common";
13
+ import { account, expectedData, nftTransaction, tokenAccount, tokenTransaction, transaction, } from "../fixtures/prepareTransaction.fixtures";
14
+ import * as nftAPI from "../../api/nft";
37
15
  describe("EVM Family", () => {
38
16
  describe("prepareTransaction.ts", () => {
39
17
  beforeEach(() => {
@@ -47,11 +25,32 @@ describe("EVM Family", () => {
47
25
  maxPriorityFeePerGas: new BigNumber(1),
48
26
  });
49
27
  }));
28
+ jest.spyOn(nftAPI, "getNftCollectionMetadata").mockImplementation((input) => __awaiter(void 0, void 0, void 0, function* () {
29
+ var _a;
30
+ if (((_a = input[0]) === null || _a === void 0 ? void 0 : _a.contract) === "0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D" &&
31
+ input.length === 1) {
32
+ return [
33
+ {
34
+ status: 200,
35
+ result: {
36
+ contract: "0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D",
37
+ tokenName: "Bored Ape",
38
+ },
39
+ },
40
+ ];
41
+ }
42
+ return [];
43
+ }));
50
44
  });
51
45
  afterEach(() => {
52
46
  jest.restoreAllMocks();
53
47
  });
54
48
  describe("prepareTransaction", () => {
49
+ it("should preserve the reference when no change is detected on the transaction", () => __awaiter(void 0, void 0, void 0, function* () {
50
+ const tx = yield prepareTransaction(account, Object.assign({}, transaction));
51
+ const tx2 = yield prepareTransaction(account, tx);
52
+ expect(tx).toBe(tx2);
53
+ }));
55
54
  describe("Coins", () => {
56
55
  it("should have a gasLimit = 0 when recipient has an error", () => __awaiter(void 0, void 0, void 0, function* () {
57
56
  jest.spyOn(rpcAPI, "getGasEstimation").mockImplementation(() => __awaiter(void 0, void 0, void 0, function* () {
@@ -68,8 +67,8 @@ describe("EVM Family", () => {
68
67
  expect(tx).toEqual(Object.assign(Object.assign({}, transaction), { amount: new BigNumber(0), maxFeePerGas: new BigNumber(1), maxPriorityFeePerGas: new BigNumber(1), gasPrice: undefined, gasLimit: new BigNumber(0), type: 2 }));
69
68
  }));
70
69
  it("should return an EIP1559 coin transaction", () => __awaiter(void 0, void 0, void 0, function* () {
71
- const tx = yield prepareTransaction(account, transaction);
72
- expect(tx).toEqual(Object.assign(Object.assign({}, transaction), { maxFeePerGas: new BigNumber(1), maxPriorityFeePerGas: new BigNumber(1), type: 2 }));
70
+ const tx = yield prepareTransaction(account, Object.assign({}, transaction));
71
+ expect(tx).toEqual(Object.assign(Object.assign({}, transaction), { gasPrice: undefined, maxFeePerGas: new BigNumber(1), maxPriorityFeePerGas: new BigNumber(1), type: 2 }));
73
72
  }));
74
73
  it("should return a legacy coin transaction", () => __awaiter(void 0, void 0, void 0, function* () {
75
74
  jest.spyOn(rpcAPI, "getFeesEstimation").mockImplementationOnce(() => __awaiter(void 0, void 0, void 0, function* () {
@@ -79,15 +78,15 @@ describe("EVM Family", () => {
79
78
  maxPriorityFeePerGas: null,
80
79
  });
81
80
  }));
82
- const tx = yield prepareTransaction(account, transaction);
83
- expect(tx).toEqual(Object.assign(Object.assign({}, transaction), { gasPrice: new BigNumber(1), type: 0 }));
81
+ const tx = yield prepareTransaction(account, Object.assign({}, transaction));
82
+ expect(tx).toEqual(Object.assign(Object.assign({}, transaction), { gasPrice: new BigNumber(1), maxFeePerGas: undefined, maxPriorityFeePerGas: undefined, type: 0 }));
84
83
  }));
85
84
  it("should create a coin transaction using all amount in the account", () => __awaiter(void 0, void 0, void 0, function* () {
86
85
  const accountWithBalance = Object.assign(Object.assign({}, account), { balance: new BigNumber(4206900) });
87
86
  const transactionWithUseAllAmount = Object.assign(Object.assign({}, transaction), { useAllAmount: true });
88
- const tx = yield prepareTransaction(accountWithBalance, transactionWithUseAllAmount);
87
+ const tx = yield prepareTransaction(accountWithBalance, Object.assign({}, transactionWithUseAllAmount));
89
88
  const estimatedFees = new BigNumber(21000); // 21000 gasLimit * 1 maxFeePerGas
90
- expect(tx).toEqual(Object.assign(Object.assign({}, transactionWithUseAllAmount), { amount: accountWithBalance.balance.minus(estimatedFees), maxFeePerGas: new BigNumber(1), maxPriorityFeePerGas: new BigNumber(1), type: 2 }));
89
+ expect(tx).toEqual(Object.assign(Object.assign({}, transactionWithUseAllAmount), { amount: accountWithBalance.balance.minus(estimatedFees), gasPrice: undefined, maxFeePerGas: new BigNumber(1), maxPriorityFeePerGas: new BigNumber(1), type: 2 }));
91
90
  }));
92
91
  it("should do a gas estimation when data has been added to the coin transaction", () => __awaiter(void 0, void 0, void 0, function* () {
93
92
  jest
@@ -95,7 +94,7 @@ describe("EVM Family", () => {
95
94
  .mockImplementationOnce(() => __awaiter(void 0, void 0, void 0, function* () { return new BigNumber(12); }));
96
95
  const accountWithBalance = Object.assign(Object.assign({}, account), { balance: new BigNumber(4206900) });
97
96
  const tx = yield prepareTransaction(accountWithBalance, Object.assign(Object.assign({}, transaction), { data: Buffer.from("Sm4rTC0ntr4ct", "hex") }));
98
- expect(tx).toEqual(Object.assign(Object.assign({}, transaction), { data: Buffer.from("Sm4rTC0ntr4ct", "hex"), maxFeePerGas: new BigNumber(1), maxPriorityFeePerGas: new BigNumber(1), gasLimit: new BigNumber(12), type: 2 }));
97
+ expect(tx).toEqual(Object.assign(Object.assign({}, transaction), { data: Buffer.from("Sm4rTC0ntr4ct", "hex"), gasPrice: undefined, maxFeePerGas: new BigNumber(1), maxPriorityFeePerGas: new BigNumber(1), gasLimit: new BigNumber(12), type: 2 }));
99
98
  }));
100
99
  });
101
100
  describe("Tokens", () => {
@@ -111,7 +110,7 @@ describe("EVM Family", () => {
111
110
  throw new Error();
112
111
  }));
113
112
  const tx = yield prepareTransaction(account, Object.assign(Object.assign({}, tokenTransaction), { amount: new BigNumber(0) }));
114
- expect(tx).toEqual(Object.assign(Object.assign({}, tokenTransaction), { amount: new BigNumber(0), maxFeePerGas: new BigNumber(1), maxPriorityFeePerGas: new BigNumber(1), gasPrice: undefined, gasLimit: new BigNumber(0), data: expectedData(tokenTransaction.recipient, new BigNumber(0)), type: 2 }));
113
+ expect(tx).toEqual(Object.assign(Object.assign({}, tokenTransaction), { amount: new BigNumber(0), maxFeePerGas: new BigNumber(1), maxPriorityFeePerGas: new BigNumber(1), gasPrice: undefined, gasLimit: new BigNumber(0), data: expectedData(account, tx, "erc20"), type: 2 }));
115
114
  }));
116
115
  it("should create a token transaction using all amount in the token account", () => __awaiter(void 0, void 0, void 0, function* () {
117
116
  jest
@@ -120,7 +119,7 @@ describe("EVM Family", () => {
120
119
  const tokenAccountWithBalance = Object.assign(Object.assign({}, tokenAccount), { balance: new BigNumber(200) });
121
120
  const account2 = Object.assign(Object.assign({}, account), { subAccounts: [tokenAccountWithBalance] });
122
121
  const tx = yield prepareTransaction(account2, Object.assign(Object.assign({}, tokenTransaction), { amount: new BigNumber(0), useAllAmount: true, subAccountId: tokenAccountWithBalance.id }));
123
- expect(tx).toEqual(Object.assign(Object.assign({}, tokenTransaction), { amount: tokenAccountWithBalance.balance, useAllAmount: true, subAccountId: tokenAccountWithBalance.id, data: expectedData(tokenTransaction.recipient, tokenAccountWithBalance.balance), maxFeePerGas: new BigNumber(1), maxPriorityFeePerGas: new BigNumber(1), gasPrice: undefined, gasLimit: new BigNumber(12), type: 2 }));
122
+ expect(tx).toEqual(Object.assign(Object.assign({}, tokenTransaction), { amount: tokenAccountWithBalance.balance, useAllAmount: true, subAccountId: tokenAccountWithBalance.id, data: expectedData(account, tx, "erc20"), maxFeePerGas: new BigNumber(1), maxPriorityFeePerGas: new BigNumber(1), gasPrice: undefined, gasLimit: new BigNumber(12), type: 2 }));
124
123
  }));
125
124
  it("should go to gas estimation with a transaction without 0 amount", () => __awaiter(void 0, void 0, void 0, function* () {
126
125
  jest
@@ -128,18 +127,18 @@ describe("EVM Family", () => {
128
127
  .mockImplementationOnce(() => __awaiter(void 0, void 0, void 0, function* () { return new BigNumber(12); }));
129
128
  const tokenAccountWithBalance = Object.assign(Object.assign({}, tokenAccount), { balance: new BigNumber(200) });
130
129
  const account2 = Object.assign(Object.assign({}, account), { subAccounts: [tokenAccountWithBalance] });
131
- yield prepareTransaction(account2, Object.assign(Object.assign({}, tokenTransaction), { useAllAmount: true, subAccountId: tokenAccountWithBalance.id }));
130
+ const tx = yield prepareTransaction(account2, Object.assign(Object.assign({}, tokenTransaction), { useAllAmount: true, subAccountId: tokenAccountWithBalance.id }));
132
131
  expect(rpcAPI.getGasEstimation).toBeCalledWith(account2, expect.objectContaining({
133
132
  recipient: tokenAccount.token.contractAddress,
134
133
  amount: new BigNumber(0),
135
- data: expectedData(tokenTransaction.recipient, tokenAccountWithBalance.balance),
134
+ data: expectedData(account, tx, "erc20"),
136
135
  }));
137
136
  }));
138
137
  it("should return an EIP1559 token transaction", () => __awaiter(void 0, void 0, void 0, function* () {
139
138
  const tokenAccountWithBalance = Object.assign(Object.assign({}, tokenAccount), { balance: new BigNumber(200) });
140
139
  const account2 = Object.assign(Object.assign({}, account), { subAccounts: [tokenAccountWithBalance] });
141
- const tx = yield prepareTransaction(account2, tokenTransaction);
142
- expect(tx).toEqual(Object.assign(Object.assign({}, tokenTransaction), { data: expectedData(tokenTransaction.recipient, tokenTransaction.amount), maxFeePerGas: new BigNumber(1), maxPriorityFeePerGas: new BigNumber(1), type: 2 }));
140
+ const tx = yield prepareTransaction(account2, Object.assign({}, tokenTransaction));
141
+ expect(tx).toEqual(Object.assign(Object.assign({}, tokenTransaction), { data: expectedData(account, tokenTransaction, "erc20"), gasPrice: undefined, maxFeePerGas: new BigNumber(1), maxPriorityFeePerGas: new BigNumber(1), type: 2 }));
143
142
  }));
144
143
  it("should return a legacy token transaction", () => __awaiter(void 0, void 0, void 0, function* () {
145
144
  jest.spyOn(rpcAPI, "getFeesEstimation").mockImplementationOnce(() => __awaiter(void 0, void 0, void 0, function* () {
@@ -151,54 +150,104 @@ describe("EVM Family", () => {
151
150
  }));
152
151
  const tokenAccountWithBalance = Object.assign(Object.assign({}, tokenAccount), { balance: new BigNumber(200) });
153
152
  const account2 = Object.assign(Object.assign({}, account), { subAccounts: [tokenAccountWithBalance] });
154
- const tx = yield prepareTransaction(account2, tokenTransaction);
155
- expect(tx).toEqual(Object.assign(Object.assign({}, tokenTransaction), { data: expectedData(tokenTransaction.recipient, tokenTransaction.amount), gasPrice: new BigNumber(1), type: 0 }));
156
- }));
157
- });
158
- describe("When feesStrategy provided", () => {
159
- it("should call getFeesEstimation once", () => __awaiter(void 0, void 0, void 0, function* () {
160
- const tx = yield prepareTransaction(account, Object.assign(Object.assign({}, transaction), { feesStrategy: undefined }));
161
- expect(rpcAPI.getFeesEstimation).toBeCalledTimes(1);
162
- expect(tx).toEqual(Object.assign(Object.assign({}, transaction), { feesStrategy: undefined, additionalFees: undefined, maxFeePerGas: new BigNumber(1), maxPriorityFeePerGas: new BigNumber(1), type: 2 }));
153
+ const tx = yield prepareTransaction(account2, Object.assign({}, tokenTransaction));
154
+ expect(tx).toEqual(Object.assign(Object.assign({}, tokenTransaction), { data: expectedData(account, tokenTransaction, "erc20"), maxFeePerGas: undefined, maxPriorityFeePerGas: undefined, gasPrice: new BigNumber(1), type: 0 }));
163
155
  }));
164
156
  });
165
- describe("When custom feesStrategy provided", () => {
166
- it("should use transaction provided data for fees", () => __awaiter(void 0, void 0, void 0, function* () {
167
- const tx = yield prepareTransaction(account, Object.assign(Object.assign({}, transaction), { feesStrategy: "custom" }));
168
- expect(rpcAPI.getFeesEstimation).toBeCalledTimes(0);
169
- expect(tx).toEqual(Object.assign(Object.assign({}, transaction), { additionalFees: undefined, feesStrategy: "custom", gasPrice: new BigNumber(0), type: 0 }));
170
- }));
157
+ describe("Gas", () => {
158
+ describe("When feesStrategy provided", () => {
159
+ it("should call getFeesEstimation once", () => __awaiter(void 0, void 0, void 0, function* () {
160
+ const tx = yield prepareTransaction(account, Object.assign(Object.assign({}, transaction), { feesStrategy: undefined }));
161
+ expect(rpcAPI.getFeesEstimation).toBeCalledTimes(1);
162
+ expect(tx).toEqual(Object.assign(Object.assign({}, transaction), { feesStrategy: undefined, additionalFees: undefined, gasPrice: undefined, maxFeePerGas: new BigNumber(1), maxPriorityFeePerGas: new BigNumber(1), type: 2 }));
163
+ }));
164
+ });
165
+ describe("When custom feesStrategy provided", () => {
166
+ it("should use transaction provided data for fees", () => __awaiter(void 0, void 0, void 0, function* () {
167
+ const tx = yield prepareTransaction(account, Object.assign(Object.assign({}, transaction), { feesStrategy: "custom" }));
168
+ expect(rpcAPI.getFeesEstimation).toBeCalledTimes(0);
169
+ expect(tx).toEqual(Object.assign(Object.assign({}, transaction), { additionalFees: undefined, feesStrategy: "custom", gasPrice: new BigNumber(0), type: 0 }));
170
+ }));
171
+ });
172
+ describe("When gasOptions provided", () => {
173
+ it("should call getFeesEstimation once", () => __awaiter(void 0, void 0, void 0, function* () {
174
+ const tx = yield prepareTransaction(account, Object.assign(Object.assign({}, transaction), { gasOptions: undefined }));
175
+ expect(rpcAPI.getFeesEstimation).toBeCalledTimes(1);
176
+ expect(tx).toEqual(Object.assign(Object.assign({}, transaction), { gasPrice: undefined, maxFeePerGas: new BigNumber(1), maxPriorityFeePerGas: new BigNumber(1), type: 2 }));
177
+ }));
178
+ it("should use gasOptions values for fee data", () => __awaiter(void 0, void 0, void 0, function* () {
179
+ const gasOptions = {
180
+ slow: {
181
+ maxFeePerGas: new BigNumber(10),
182
+ maxPriorityFeePerGas: new BigNumber(1),
183
+ gasPrice: null,
184
+ },
185
+ medium: {
186
+ maxFeePerGas: new BigNumber(20),
187
+ maxPriorityFeePerGas: new BigNumber(2),
188
+ gasPrice: null,
189
+ },
190
+ fast: {
191
+ maxFeePerGas: new BigNumber(30),
192
+ maxPriorityFeePerGas: new BigNumber(3),
193
+ gasPrice: null,
194
+ },
195
+ };
196
+ const tx = yield prepareTransaction(account, Object.assign(Object.assign({}, transaction), { gasOptions }));
197
+ expect(rpcAPI.getFeesEstimation).toBeCalledTimes(0);
198
+ expect(tx).toEqual(Object.assign(Object.assign({}, transaction), { additionalFees: undefined, gasPrice: undefined, gasOptions, maxFeePerGas: new BigNumber(20), maxPriorityFeePerGas: new BigNumber(2), type: 2 }));
199
+ }));
200
+ });
171
201
  });
172
- describe("When gasOptions provided", () => {
173
- it("should call getFeesEstimation once", () => __awaiter(void 0, void 0, void 0, function* () {
174
- const tx = yield prepareTransaction(account, Object.assign(Object.assign({}, transaction), { gasOptions: undefined }));
175
- expect(rpcAPI.getFeesEstimation).toBeCalledTimes(1);
176
- expect(tx).toEqual(Object.assign(Object.assign({}, transaction), { maxFeePerGas: new BigNumber(1), maxPriorityFeePerGas: new BigNumber(1), type: 2 }));
202
+ describe("Nfts", () => {
203
+ it("should have a gasLimit = 0 and no data when recipient has an error", () => __awaiter(void 0, void 0, void 0, function* () {
204
+ jest.spyOn(rpcAPI, "getGasEstimation").mockImplementation(() => __awaiter(void 0, void 0, void 0, function* () {
205
+ throw new Error();
206
+ }));
207
+ const tx = yield prepareTransaction(account, Object.assign(Object.assign({}, nftTransaction), { recipient: "notValid" }));
208
+ expect(tx).toEqual(Object.assign(Object.assign({}, nftTransaction), { nft: Object.assign(Object.assign({}, nftTransaction.nft), { collectionName: "Bored Ape" }), recipient: "notValid", maxFeePerGas: new BigNumber(1), maxPriorityFeePerGas: new BigNumber(1), gasPrice: undefined, gasLimit: new BigNumber(0), data: undefined, type: 2 }));
177
209
  }));
178
- });
179
- describe("When gasOptions provided", () => {
180
- const gasOptions = {
181
- slow: {
182
- maxFeePerGas: new BigNumber(10),
183
- maxPriorityFeePerGas: new BigNumber(1),
184
- gasPrice: null,
185
- },
186
- medium: {
187
- maxFeePerGas: new BigNumber(20),
188
- maxPriorityFeePerGas: new BigNumber(2),
189
- gasPrice: null,
190
- },
191
- fast: {
192
- maxFeePerGas: new BigNumber(30),
193
- maxPriorityFeePerGas: new BigNumber(3),
194
- gasPrice: null,
195
- },
196
- };
197
- it("should use gasOptions values for fee data", () => __awaiter(void 0, void 0, void 0, function* () {
198
- const tx = yield prepareTransaction(account, Object.assign(Object.assign({}, transaction), { gasOptions }));
199
- expect(rpcAPI.getFeesEstimation).toBeCalledTimes(0);
200
- expect(tx).toEqual(Object.assign(Object.assign({}, transaction), { gasOptions, additionalFees: undefined, maxFeePerGas: new BigNumber(20), maxPriorityFeePerGas: new BigNumber(2), type: 2 }));
210
+ it("should have a gasLimit = 0 when amount has an error", () => __awaiter(void 0, void 0, void 0, function* () {
211
+ jest.spyOn(rpcAPI, "getGasEstimation").mockImplementation(() => __awaiter(void 0, void 0, void 0, function* () {
212
+ throw new Error();
213
+ }));
214
+ const tx = yield prepareTransaction(account, Object.assign(Object.assign({}, nftTransaction), { amount: new BigNumber(0) }));
215
+ expect(tx).toEqual(Object.assign(Object.assign({}, nftTransaction), { nft: Object.assign(Object.assign({}, nftTransaction.nft), { collectionName: "Bored Ape" }), amount: new BigNumber(0), maxFeePerGas: new BigNumber(1), maxPriorityFeePerGas: new BigNumber(1), gasPrice: undefined, gasLimit: new BigNumber(0), data: expectedData(account, nftTransaction, "erc721"), type: 2 }));
201
216
  }));
217
+ describe("ERC721", () => {
218
+ it("should return an EIP1559 erc721 nft transaction", () => __awaiter(void 0, void 0, void 0, function* () {
219
+ const tx = yield prepareTransaction(account, Object.assign({}, nftTransaction));
220
+ expect(tx).toEqual(Object.assign(Object.assign({}, nftTransaction), { data: expectedData(account, tx, "erc721"), nft: Object.assign(Object.assign({}, nftTransaction.nft), { collectionName: "Bored Ape" }), gasPrice: undefined, maxFeePerGas: new BigNumber(1), maxPriorityFeePerGas: new BigNumber(1), type: 2 }));
221
+ }));
222
+ it("should return a legacy erc721 nft transaction", () => __awaiter(void 0, void 0, void 0, function* () {
223
+ jest.spyOn(rpcAPI, "getFeesEstimation").mockImplementationOnce(() => __awaiter(void 0, void 0, void 0, function* () {
224
+ return ({
225
+ gasPrice: new BigNumber(1),
226
+ maxFeePerGas: null,
227
+ maxPriorityFeePerGas: null,
228
+ });
229
+ }));
230
+ const tx = yield prepareTransaction(account, Object.assign({}, nftTransaction));
231
+ expect(tx).toEqual(Object.assign(Object.assign({}, nftTransaction), { data: expectedData(account, tx, "erc721"), nft: Object.assign(Object.assign({}, nftTransaction.nft), { collectionName: "Bored Ape" }), maxFeePerGas: undefined, maxPriorityFeePerGas: undefined, gasPrice: new BigNumber(1), type: 0 }));
232
+ }));
233
+ });
234
+ describe("ERC1155", () => {
235
+ it("should return an EIP1559 erc1155 nft transaction", () => __awaiter(void 0, void 0, void 0, function* () {
236
+ const tx = yield prepareTransaction(account, Object.assign(Object.assign({}, nftTransaction), { mode: "erc1155" }));
237
+ expect(tx).toEqual(Object.assign(Object.assign({}, nftTransaction), { mode: "erc1155", data: expectedData(account, tx, "erc1155"), nft: Object.assign(Object.assign({}, nftTransaction.nft), { collectionName: "Bored Ape" }), gasPrice: undefined, maxFeePerGas: new BigNumber(1), maxPriorityFeePerGas: new BigNumber(1), type: 2 }));
238
+ }));
239
+ it("should return a legacy erc1155 nft transaction", () => __awaiter(void 0, void 0, void 0, function* () {
240
+ jest.spyOn(rpcAPI, "getFeesEstimation").mockImplementationOnce(() => __awaiter(void 0, void 0, void 0, function* () {
241
+ return ({
242
+ gasPrice: new BigNumber(1),
243
+ maxFeePerGas: null,
244
+ maxPriorityFeePerGas: null,
245
+ });
246
+ }));
247
+ const tx = yield prepareTransaction(account, Object.assign(Object.assign({}, nftTransaction), { mode: "erc1155" }));
248
+ expect(tx).toEqual(Object.assign(Object.assign({}, nftTransaction), { mode: "erc1155", data: expectedData(account, tx, "erc1155"), nft: Object.assign(Object.assign({}, nftTransaction.nft), { collectionName: "Bored Ape" }), maxFeePerGas: undefined, maxPriorityFeePerGas: undefined, gasPrice: new BigNumber(1), type: 0 }));
249
+ }));
250
+ });
202
251
  });
203
252
  });
204
253
  describe("prepareForSignOperation", () => {
@@ -214,6 +263,9 @@ describe("EVM Family", () => {
214
263
  it("should update a token transaction with the correct recipient", () => __awaiter(void 0, void 0, void 0, function* () {
215
264
  expect(yield prepareForSignOperation(account, tokenTransaction)).toEqual(Object.assign(Object.assign({}, tokenTransaction), { amount: new BigNumber(0), recipient: tokenAccount.token.contractAddress, nonce: 10 }));
216
265
  }));
266
+ it("should update an NFT transaction with the correct recipient", () => __awaiter(void 0, void 0, void 0, function* () {
267
+ expect(yield prepareForSignOperation(account, nftTransaction)).toEqual(Object.assign(Object.assign({}, nftTransaction), { amount: new BigNumber(0), recipient: nftTransaction.nft.contract, nonce: 10 }));
268
+ }));
217
269
  });
218
270
  });
219
271
  });
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prepareTransaction.unit.test.js","sourceRoot":"","sources":["../../../src/__tests__/unit/prepareTransaction.unit.test.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AACvF,OAAO,KAAK,MAAM,MAAM,0BAA0B,CAAC;AACnD,OAAO,EACL,OAAO,EACP,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,gBAAgB,EAChB,WAAW,GACZ,MAAM,yCAAyC,CAAC;AAEjD,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE;IAC1B,QAAQ,CAAC,uBAAuB,EAA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,EAAE,CAAC,CAAC,CAAC;YAC1F,CAAC,CAAC,CAAC;YACH,SAAS,CAAC,GAAG,EAAE;gBACb,IAAI,CAAC,eAAe,EAAE,CAAC;YACzB,CAAC,CAAC,CAAC;YAEH,EAAE,CAAC,sCAAsC,EAAE,GAAS,EAAE;gBACpD,MAAM,CAAC,MAAM,uBAAuB,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC,OAAO,iCAC9D,WAAW,KACd,KAAK,EAAE,EAAE,IACT,CAAC;YACL,CAAC,CAAA,CAAC,CAAC;YAEH,EAAE,CAAC,8DAA8D,EAAE,GAAS,EAAE;gBAC5E,MAAM,CAAC,MAAM,uBAAuB,CAAC,OAAO,EAAE,gBAAgB,CAAC,CAAC,CAAC,OAAO,iCACnE,gBAAgB,KACnB,MAAM,EAAE,IAAI,SAAS,CAAC,CAAC,CAAC,EACxB,SAAS,EAAE,YAAY,CAAC,KAAK,CAAC,eAAe,EAC7C,KAAK,EAAE,EAAE,IACT,CAAC;YACL,CAAC,CAAA,CAAC,CAAC;YAEH,EAAE,CAAC,6DAA6D,EAAE,GAAS,EAAE;gBAC3E,MAAM,CAAC,MAAM,uBAAuB,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC,OAAO,iCACjE,cAAc,KACjB,MAAM,EAAE,IAAI,SAAS,CAAC,CAAC,CAAC,EACxB,SAAS,EAAE,cAAc,CAAC,GAAG,CAAC,QAAQ,EACtC,KAAK,EAAE,EAAE,IACT,CAAC;YACL,CAAC,CAAA,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signOperation.unit.test.d.ts","sourceRoot":"","sources":["../../../src/__tests__/unit/signOperation.unit.test.ts"],"names":[],"mappings":""}
@@ -7,12 +7,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
- import { getCryptoCurrencyById } from "@ledgerhq/cryptoassets";
11
10
  import BigNumber from "bignumber.js";
12
- import { buildSignOperation, applyEIP155 } from "../signOperation";
13
- import * as rpcAPI from "../api/rpc/rpc.common";
14
- import { getEstimatedFees } from "../logic";
15
- import { makeAccount } from "../testUtils";
11
+ import { getCryptoCurrencyById, listCryptoCurrencies } from "@ledgerhq/cryptoassets";
12
+ import { buildSignOperation, applyEIP155 } from "../../signOperation";
13
+ import { makeAccount } from "../fixtures/common.fixtures";
14
+ import * as rpcAPI from "../../api/rpc/rpc.common";
15
+ import { getEstimatedFees } from "../../logic";
16
16
  const currency = Object.assign(Object.assign({}, getCryptoCurrencyById("ethereum")), { ethereumLikeInfo: {
17
17
  chainId: 1,
18
18
  rpc: "my-rpc.com",
@@ -37,12 +37,16 @@ const transactionEIP1559 = {
37
37
  const estimatedFees = getEstimatedFees(transactionEIP1559);
38
38
  const mockSignerContext = (_, fn) => {
39
39
  return fn({
40
+ setLoadConfig: jest.fn(),
40
41
  getAddress: jest.fn(),
41
42
  signTransaction: () => Promise.resolve({
42
43
  r: "123",
43
44
  s: "abc",
44
45
  v: "27",
45
46
  }),
47
+ signEIP712HashedMessage: jest.fn(),
48
+ signEIP712Message: jest.fn(),
49
+ signPersonalMessage: jest.fn(),
46
50
  });
47
51
  };
48
52
  // Mocking here in order to be ack by the signOperation.ts file
@@ -98,17 +102,10 @@ describe("EVM Family", () => {
98
102
  });
99
103
  });
100
104
  describe("applyEIP155", () => {
101
- const chainIds = [
102
- 1,
103
- 5,
104
- 10,
105
- 14,
106
- 19,
107
- 56,
108
- 137,
109
- 250,
110
- 1284, // moonbeam
111
- ];
105
+ const chainIds = listCryptoCurrencies(true)
106
+ .filter(c => c.family === "evm")
107
+ .map(c => c.ethereumLikeInfo.chainId)
108
+ .sort((a, b) => a - b);
112
109
  const possibleHexV = [
113
110
  "00",
114
111
  "01",
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sign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