@ledgerhq/coin-evm 2.28.0-nightly.3 → 2.28.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 (260) hide show
  1. package/.eslintrc.js +0 -1
  2. package/.turbo/turbo-build.log +1 -1
  3. package/CHANGELOG.md +20 -32
  4. package/{lib-es/__fixtures__/ethereum-erc20-weth.json → lib/__fixtures__/ethereum-erc20-usd_tether__erc20_.json} +8 -8
  5. package/lib/__fixtures__/{optimism-erc20-usd_coin.json → scroll_sepolia-erc20-new_token_mock.json} +20 -21
  6. package/lib/__tests__/fixtures/accounts.fixtures.d.ts +1 -1
  7. package/lib/__tests__/fixtures/accounts.fixtures.d.ts.map +1 -1
  8. package/lib/__tests__/fixtures/accounts.fixtures.js +19 -2
  9. package/lib/__tests__/fixtures/accounts.fixtures.js.map +1 -1
  10. package/lib/__tests__/fixtures/common.fixtures.d.ts +0 -1
  11. package/lib/__tests__/fixtures/common.fixtures.d.ts.map +1 -1
  12. package/lib/__tests__/fixtures/common.fixtures.js +0 -1
  13. package/lib/__tests__/fixtures/common.fixtures.js.map +1 -1
  14. package/lib/__tests__/fixtures/prepareTransaction.fixtures.d.ts.map +1 -1
  15. package/lib/__tests__/fixtures/prepareTransaction.fixtures.js +2 -3
  16. package/lib/__tests__/fixtures/prepareTransaction.fixtures.js.map +1 -1
  17. package/lib/__tests__/fixtures/synchronization.fixtures.d.ts +1 -1
  18. package/lib/__tests__/fixtures/synchronization.fixtures.d.ts.map +1 -1
  19. package/lib/__tests__/fixtures/synchronization.fixtures.js +18 -3
  20. package/lib/__tests__/fixtures/synchronization.fixtures.js.map +1 -1
  21. package/lib/__tests__/fixtures/transaction.fixtures.d.ts +2 -2
  22. package/lib/__tests__/fixtures/transaction.fixtures.d.ts.map +1 -1
  23. package/lib/__tests__/fixtures/transaction.fixtures.js +2 -3
  24. package/lib/__tests__/fixtures/transaction.fixtures.js.map +1 -1
  25. package/lib/__tests__/unit/accounts.unit.test.js +27 -0
  26. package/lib/__tests__/unit/accounts.unit.test.js.map +1 -1
  27. package/lib/__tests__/unit/adapters/etherscan.unit.test.js +7 -72
  28. package/lib/__tests__/unit/adapters/etherscan.unit.test.js.map +1 -1
  29. package/lib/__tests__/unit/adapters/ledger.unit.test.js +2 -15
  30. package/lib/__tests__/unit/adapters/ledger.unit.test.js.map +1 -1
  31. package/lib/__tests__/unit/api/explorer/etherscan.unit.test.js +0 -8
  32. package/lib/__tests__/unit/api/explorer/etherscan.unit.test.js.map +1 -1
  33. package/lib/__tests__/unit/api/explorer/ledger.unit.test.js +0 -12
  34. package/lib/__tests__/unit/api/explorer/ledger.unit.test.js.map +1 -1
  35. package/lib/__tests__/unit/broadcast.unit.test.js +1 -3
  36. package/lib/__tests__/unit/broadcast.unit.test.js.map +1 -1
  37. package/lib/__tests__/unit/buildOptimisticOperation.unit.test.js +1 -3
  38. package/lib/__tests__/unit/buildOptimisticOperation.unit.test.js.map +1 -1
  39. package/lib/__tests__/unit/deviceTransactionConfig.unit.test.d.ts +1 -1
  40. package/lib/__tests__/unit/deviceTransactionConfig.unit.test.d.ts.map +1 -1
  41. package/lib/__tests__/unit/deviceTransactionConfig.unit.test.js +0 -1
  42. package/lib/__tests__/unit/deviceTransactionConfig.unit.test.js.map +1 -1
  43. package/lib/__tests__/unit/estimateMaxSpendable.unit.test.js +1 -3
  44. package/lib/__tests__/unit/estimateMaxSpendable.unit.test.js.map +1 -1
  45. package/lib/__tests__/unit/getTransactionStatus.unit.test.js +1 -3
  46. package/lib/__tests__/unit/getTransactionStatus.unit.test.js.map +1 -1
  47. package/lib/__tests__/unit/logic.unit.test.js +18 -22
  48. package/lib/__tests__/unit/logic.unit.test.js.map +1 -1
  49. package/lib/__tests__/unit/operation.test.js +2 -6
  50. package/lib/__tests__/unit/operation.test.js.map +1 -1
  51. package/lib/__tests__/unit/prepareTransaction.unit.test.js +17 -4
  52. package/lib/__tests__/unit/prepareTransaction.unit.test.js.map +1 -1
  53. package/lib/adapters/etherscan.d.ts.map +1 -1
  54. package/lib/adapters/etherscan.js +2 -2
  55. package/lib/adapters/etherscan.js.map +1 -1
  56. package/lib/adapters/ledger.d.ts.map +1 -1
  57. package/lib/adapters/ledger.js +2 -2
  58. package/lib/adapters/ledger.js.map +1 -1
  59. package/lib/api/index.d.ts.map +1 -1
  60. package/lib/api/index.js +4 -2
  61. package/lib/api/index.js.map +1 -1
  62. package/lib/bridge/js.d.ts +1 -2
  63. package/lib/bridge/js.d.ts.map +1 -1
  64. package/lib/bridge/js.js +1 -3
  65. package/lib/bridge/js.js.map +1 -1
  66. package/lib/bridge/preload.d.ts +0 -1
  67. package/lib/bridge/preload.d.ts.map +1 -1
  68. package/lib/bridge/preload.js +1 -10
  69. package/lib/bridge/preload.js.map +1 -1
  70. package/lib/deviceTransactionConfig.d.ts.map +1 -1
  71. package/lib/deviceTransactionConfig.js +2 -2
  72. package/lib/deviceTransactionConfig.js.map +1 -1
  73. package/lib/logic/common.d.ts +0 -18
  74. package/lib/logic/common.d.ts.map +1 -1
  75. package/lib/logic/common.js +1 -35
  76. package/lib/logic/common.js.map +1 -1
  77. package/lib/logic/estimateFees.d.ts +1 -1
  78. package/lib/logic/estimateFees.d.ts.map +1 -1
  79. package/lib/logic/estimateFees.js +12 -25
  80. package/lib/logic/estimateFees.js.map +1 -1
  81. package/lib/logic/estimateFees.test.js +41 -93
  82. package/lib/logic/estimateFees.test.js.map +1 -1
  83. package/lib/logic/index.d.ts +0 -1
  84. package/lib/logic/index.d.ts.map +1 -1
  85. package/lib/logic/index.js +0 -1
  86. package/lib/logic/index.js.map +1 -1
  87. package/lib/types/transaction.d.ts +0 -9
  88. package/lib/types/transaction.d.ts.map +1 -1
  89. package/{lib/__fixtures__/ethereum-erc20-weth.json → lib-es/__fixtures__/ethereum-erc20-usd_tether__erc20_.json} +8 -8
  90. package/lib-es/__fixtures__/{optimism-erc20-usd_coin.json → scroll_sepolia-erc20-new_token_mock.json} +20 -21
  91. package/lib-es/__tests__/fixtures/accounts.fixtures.d.ts +1 -1
  92. package/lib-es/__tests__/fixtures/accounts.fixtures.d.ts.map +1 -1
  93. package/lib-es/__tests__/fixtures/accounts.fixtures.js +18 -1
  94. package/lib-es/__tests__/fixtures/accounts.fixtures.js.map +1 -1
  95. package/lib-es/__tests__/fixtures/common.fixtures.d.ts +0 -1
  96. package/lib-es/__tests__/fixtures/common.fixtures.d.ts.map +1 -1
  97. package/lib-es/__tests__/fixtures/common.fixtures.js +0 -1
  98. package/lib-es/__tests__/fixtures/common.fixtures.js.map +1 -1
  99. package/lib-es/__tests__/fixtures/prepareTransaction.fixtures.d.ts.map +1 -1
  100. package/lib-es/__tests__/fixtures/prepareTransaction.fixtures.js +2 -3
  101. package/lib-es/__tests__/fixtures/prepareTransaction.fixtures.js.map +1 -1
  102. package/lib-es/__tests__/fixtures/synchronization.fixtures.d.ts +1 -1
  103. package/lib-es/__tests__/fixtures/synchronization.fixtures.d.ts.map +1 -1
  104. package/lib-es/__tests__/fixtures/synchronization.fixtures.js +18 -3
  105. package/lib-es/__tests__/fixtures/synchronization.fixtures.js.map +1 -1
  106. package/lib-es/__tests__/fixtures/transaction.fixtures.d.ts +2 -2
  107. package/lib-es/__tests__/fixtures/transaction.fixtures.d.ts.map +1 -1
  108. package/lib-es/__tests__/fixtures/transaction.fixtures.js +2 -3
  109. package/lib-es/__tests__/fixtures/transaction.fixtures.js.map +1 -1
  110. package/lib-es/__tests__/unit/accounts.unit.test.js +27 -0
  111. package/lib-es/__tests__/unit/accounts.unit.test.js.map +1 -1
  112. package/lib-es/__tests__/unit/adapters/etherscan.unit.test.js +7 -72
  113. package/lib-es/__tests__/unit/adapters/etherscan.unit.test.js.map +1 -1
  114. package/lib-es/__tests__/unit/adapters/ledger.unit.test.js +2 -15
  115. package/lib-es/__tests__/unit/adapters/ledger.unit.test.js.map +1 -1
  116. package/lib-es/__tests__/unit/api/explorer/etherscan.unit.test.js +0 -8
  117. package/lib-es/__tests__/unit/api/explorer/etherscan.unit.test.js.map +1 -1
  118. package/lib-es/__tests__/unit/api/explorer/ledger.unit.test.js +0 -12
  119. package/lib-es/__tests__/unit/api/explorer/ledger.unit.test.js.map +1 -1
  120. package/lib-es/__tests__/unit/broadcast.unit.test.js +2 -4
  121. package/lib-es/__tests__/unit/broadcast.unit.test.js.map +1 -1
  122. package/lib-es/__tests__/unit/buildOptimisticOperation.unit.test.js +2 -4
  123. package/lib-es/__tests__/unit/buildOptimisticOperation.unit.test.js.map +1 -1
  124. package/lib-es/__tests__/unit/deviceTransactionConfig.unit.test.d.ts +1 -1
  125. package/lib-es/__tests__/unit/deviceTransactionConfig.unit.test.d.ts.map +1 -1
  126. package/lib-es/__tests__/unit/deviceTransactionConfig.unit.test.js +0 -1
  127. package/lib-es/__tests__/unit/deviceTransactionConfig.unit.test.js.map +1 -1
  128. package/lib-es/__tests__/unit/estimateMaxSpendable.unit.test.js +2 -4
  129. package/lib-es/__tests__/unit/estimateMaxSpendable.unit.test.js.map +1 -1
  130. package/lib-es/__tests__/unit/getTransactionStatus.unit.test.js +2 -4
  131. package/lib-es/__tests__/unit/getTransactionStatus.unit.test.js.map +1 -1
  132. package/lib-es/__tests__/unit/logic.unit.test.js +19 -23
  133. package/lib-es/__tests__/unit/logic.unit.test.js.map +1 -1
  134. package/lib-es/__tests__/unit/operation.test.js +3 -7
  135. package/lib-es/__tests__/unit/operation.test.js.map +1 -1
  136. package/lib-es/__tests__/unit/prepareTransaction.unit.test.js +17 -4
  137. package/lib-es/__tests__/unit/prepareTransaction.unit.test.js.map +1 -1
  138. package/lib-es/adapters/etherscan.d.ts.map +1 -1
  139. package/lib-es/adapters/etherscan.js +2 -2
  140. package/lib-es/adapters/etherscan.js.map +1 -1
  141. package/lib-es/adapters/ledger.d.ts.map +1 -1
  142. package/lib-es/adapters/ledger.js +2 -2
  143. package/lib-es/adapters/ledger.js.map +1 -1
  144. package/lib-es/api/index.d.ts.map +1 -1
  145. package/lib-es/api/index.js +5 -3
  146. package/lib-es/api/index.js.map +1 -1
  147. package/lib-es/bridge/js.d.ts +1 -2
  148. package/lib-es/bridge/js.d.ts.map +1 -1
  149. package/lib-es/bridge/js.js +1 -3
  150. package/lib-es/bridge/js.js.map +1 -1
  151. package/lib-es/bridge/preload.d.ts +0 -1
  152. package/lib-es/bridge/preload.d.ts.map +1 -1
  153. package/lib-es/bridge/preload.js +0 -8
  154. package/lib-es/bridge/preload.js.map +1 -1
  155. package/lib-es/deviceTransactionConfig.d.ts.map +1 -1
  156. package/lib-es/deviceTransactionConfig.js +2 -2
  157. package/lib-es/deviceTransactionConfig.js.map +1 -1
  158. package/lib-es/logic/common.d.ts +0 -18
  159. package/lib-es/logic/common.d.ts.map +1 -1
  160. package/lib-es/logic/common.js +0 -30
  161. package/lib-es/logic/common.js.map +1 -1
  162. package/lib-es/logic/estimateFees.d.ts +1 -1
  163. package/lib-es/logic/estimateFees.d.ts.map +1 -1
  164. package/lib-es/logic/estimateFees.js +12 -25
  165. package/lib-es/logic/estimateFees.js.map +1 -1
  166. package/lib-es/logic/estimateFees.test.js +41 -93
  167. package/lib-es/logic/estimateFees.test.js.map +1 -1
  168. package/lib-es/logic/index.d.ts +0 -1
  169. package/lib-es/logic/index.d.ts.map +1 -1
  170. package/lib-es/logic/index.js +0 -1
  171. package/lib-es/logic/index.js.map +1 -1
  172. package/lib-es/types/transaction.d.ts +0 -9
  173. package/lib-es/types/transaction.d.ts.map +1 -1
  174. package/package.json +13 -13
  175. package/src/__tests__/fixtures/accounts.fixtures.ts +23 -1
  176. package/src/__tests__/fixtures/common.fixtures.ts +0 -1
  177. package/src/__tests__/fixtures/prepareTransaction.fixtures.ts +4 -4
  178. package/src/__tests__/fixtures/synchronization.fixtures.ts +20 -3
  179. package/src/__tests__/fixtures/transaction.fixtures.ts +3 -4
  180. package/src/__tests__/unit/accounts.unit.test.ts +36 -0
  181. package/src/__tests__/unit/adapters/etherscan.unit.test.ts +7 -87
  182. package/src/__tests__/unit/adapters/ledger.unit.test.ts +2 -20
  183. package/src/__tests__/unit/api/explorer/etherscan.unit.test.ts +0 -12
  184. package/src/__tests__/unit/api/explorer/ledger.unit.test.ts +0 -16
  185. package/src/__tests__/unit/broadcast.unit.test.ts +3 -5
  186. package/src/__tests__/unit/buildOptimisticOperation.unit.test.ts +2 -5
  187. package/src/__tests__/unit/deviceTransactionConfig.unit.test.ts +0 -1
  188. package/src/__tests__/unit/estimateMaxSpendable.unit.test.ts +3 -5
  189. package/src/__tests__/unit/getTransactionStatus.unit.test.ts +2 -5
  190. package/src/__tests__/unit/logic.unit.test.ts +29 -41
  191. package/src/__tests__/unit/operation.test.ts +5 -9
  192. package/src/__tests__/unit/prepareTransaction.unit.test.ts +18 -4
  193. package/src/adapters/etherscan.ts +2 -5
  194. package/src/adapters/ledger.ts +2 -5
  195. package/src/api/index.ts +5 -4
  196. package/src/bridge/js.ts +0 -4
  197. package/src/bridge/preload.ts +0 -8
  198. package/src/deviceTransactionConfig.ts +2 -3
  199. package/src/logic/common.ts +0 -52
  200. package/src/logic/estimateFees.test.ts +57 -98
  201. package/src/logic/estimateFees.ts +18 -28
  202. package/src/logic/index.ts +0 -1
  203. package/src/types/transaction.ts +0 -12
  204. package/lib/__fixtures__/cardano-native-8654e8b350e298c80d2451beb5ed80fc9eee9f38ce6b039fb8706bc34c4f4253544552.json +0 -52
  205. package/lib/__fixtures__/ethereum-erc20-usd__coin-0x02b972f304dc24c9bc362e6435c4ad654241f9af916689a4790145c9bcbdf4cf-IN-i0.json +0 -20
  206. package/lib/__fixtures__/ethereum-erc20-usd__coin-0x02b972f304dc24c9bc362e6435c4ad654241f9af916689a4790145c9bcbdf4cf-OUT-i0.json +0 -19
  207. package/lib/__tests__/fixtures/cryptoAssetsStore.fixtures.d.ts +0 -2
  208. package/lib/__tests__/fixtures/cryptoAssetsStore.fixtures.d.ts.map +0 -1
  209. package/lib/__tests__/fixtures/cryptoAssetsStore.fixtures.js +0 -44
  210. package/lib/__tests__/fixtures/cryptoAssetsStore.fixtures.js.map +0 -1
  211. package/lib/cryptoAssetsStore.d.ts +0 -5
  212. package/lib/cryptoAssetsStore.d.ts.map +0 -1
  213. package/lib/cryptoAssetsStore.js +0 -17
  214. package/lib/cryptoAssetsStore.js.map +0 -1
  215. package/lib/cryptoAssetsStore.test.d.ts +0 -2
  216. package/lib/cryptoAssetsStore.test.d.ts.map +0 -1
  217. package/lib/cryptoAssetsStore.test.js +0 -15
  218. package/lib/cryptoAssetsStore.test.js.map +0 -1
  219. package/lib/logic/validateIntent.d.ts +0 -4
  220. package/lib/logic/validateIntent.d.ts.map +0 -1
  221. package/lib/logic/validateIntent.js +0 -192
  222. package/lib/logic/validateIntent.js.map +0 -1
  223. package/lib/logic/validateIntent.test.d.ts +0 -2
  224. package/lib/logic/validateIntent.test.d.ts.map +0 -1
  225. package/lib/logic/validateIntent.test.js +0 -485
  226. package/lib/logic/validateIntent.test.js.map +0 -1
  227. package/lib-es/__fixtures__/cardano-native-8654e8b350e298c80d2451beb5ed80fc9eee9f38ce6b039fb8706bc34c4f4253544552.json +0 -52
  228. package/lib-es/__fixtures__/ethereum-erc20-usd__coin-0x02b972f304dc24c9bc362e6435c4ad654241f9af916689a4790145c9bcbdf4cf-IN-i0.json +0 -20
  229. package/lib-es/__fixtures__/ethereum-erc20-usd__coin-0x02b972f304dc24c9bc362e6435c4ad654241f9af916689a4790145c9bcbdf4cf-OUT-i0.json +0 -19
  230. package/lib-es/__tests__/fixtures/cryptoAssetsStore.fixtures.d.ts +0 -2
  231. package/lib-es/__tests__/fixtures/cryptoAssetsStore.fixtures.d.ts.map +0 -1
  232. package/lib-es/__tests__/fixtures/cryptoAssetsStore.fixtures.js +0 -19
  233. package/lib-es/__tests__/fixtures/cryptoAssetsStore.fixtures.js.map +0 -1
  234. package/lib-es/cryptoAssetsStore.d.ts +0 -5
  235. package/lib-es/cryptoAssetsStore.d.ts.map +0 -1
  236. package/lib-es/cryptoAssetsStore.js +0 -12
  237. package/lib-es/cryptoAssetsStore.js.map +0 -1
  238. package/lib-es/cryptoAssetsStore.test.d.ts +0 -2
  239. package/lib-es/cryptoAssetsStore.test.d.ts.map +0 -1
  240. package/lib-es/cryptoAssetsStore.test.js +0 -13
  241. package/lib-es/cryptoAssetsStore.test.js.map +0 -1
  242. package/lib-es/logic/validateIntent.d.ts +0 -4
  243. package/lib-es/logic/validateIntent.d.ts.map +0 -1
  244. package/lib-es/logic/validateIntent.js +0 -185
  245. package/lib-es/logic/validateIntent.js.map +0 -1
  246. package/lib-es/logic/validateIntent.test.d.ts +0 -2
  247. package/lib-es/logic/validateIntent.test.d.ts.map +0 -1
  248. package/lib-es/logic/validateIntent.test.js +0 -480
  249. package/lib-es/logic/validateIntent.test.js.map +0 -1
  250. package/src/__fixtures__/cardano-native-8654e8b350e298c80d2451beb5ed80fc9eee9f38ce6b039fb8706bc34c4f4253544552.json +0 -52
  251. package/src/__fixtures__/ethereum-erc20-usd__coin-0x02b972f304dc24c9bc362e6435c4ad654241f9af916689a4790145c9bcbdf4cf-IN-i0.json +0 -20
  252. package/src/__fixtures__/ethereum-erc20-usd__coin-0x02b972f304dc24c9bc362e6435c4ad654241f9af916689a4790145c9bcbdf4cf-OUT-i0.json +0 -19
  253. package/src/__fixtures__/ethereum-erc20-usd__coin-0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48.json +0 -73
  254. package/src/__fixtures__/ethereum-erc20-weth.json +0 -73
  255. package/src/__fixtures__/optimism-erc20-usd_coin.json +0 -69
  256. package/src/__tests__/fixtures/cryptoAssetsStore.fixtures.ts +0 -24
  257. package/src/cryptoAssetsStore.test.ts +0 -19
  258. package/src/cryptoAssetsStore.ts +0 -16
  259. package/src/logic/validateIntent.test.ts +0 -659
  260. package/src/logic/validateIntent.ts +0 -274
@@ -1,485 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const errors_1 = require("@ledgerhq/errors");
7
- const bignumber_js_1 = __importDefault(require("bignumber.js"));
8
- const config_1 = require("../config");
9
- const ledger_1 = __importDefault(require("../network/node/ledger"));
10
- const ledger_2 = __importDefault(require("../network/explorer/ledger"));
11
- const ledger_3 = __importDefault(require("../network/gasTracker/ledger"));
12
- const validateIntent_1 = require("./validateIntent");
13
- function legacyIntent(intent) {
14
- return {
15
- type: "send-legacy",
16
- sender: "",
17
- recipient: "",
18
- amount: 0n,
19
- asset: { type: "native" },
20
- ...intent,
21
- };
22
- }
23
- function eip1559Intent(intent) {
24
- return {
25
- type: "send-eip1559",
26
- sender: "",
27
- recipient: "",
28
- amount: 0n,
29
- asset: { type: "native" },
30
- ...intent,
31
- };
32
- }
33
- describe("validateIntent", () => {
34
- beforeEach(() => {
35
- (0, config_1.setCoinConfig)(() => ({
36
- info: {
37
- node: { type: "ledger" },
38
- explorer: { type: "ledger" },
39
- gasTracker: { type: "ledger", explorerId: "eth" },
40
- },
41
- }));
42
- jest.spyOn(ledger_1.default, "getGasEstimation").mockResolvedValue(new bignumber_js_1.default(0));
43
- jest.spyOn(ledger_1.default, "getFeeData").mockResolvedValue({
44
- maxFeePerGas: null,
45
- maxPriorityFeePerGas: null,
46
- gasPrice: null,
47
- nextBaseFee: null,
48
- });
49
- jest.spyOn(ledger_2.default, "getLastOperations").mockResolvedValue({
50
- lastCoinOperations: [],
51
- lastInternalOperations: [],
52
- lastNftOperations: [],
53
- lastTokenOperations: [],
54
- });
55
- jest.spyOn(ledger_1.default, "getCoinBalance").mockResolvedValue(new bignumber_js_1.default(50));
56
- jest.spyOn(ledger_3.default, "getGasOptions").mockResolvedValue({
57
- slow: {
58
- maxFeePerGas: null,
59
- maxPriorityFeePerGas: null,
60
- gasPrice: null,
61
- nextBaseFee: null,
62
- },
63
- medium: {
64
- maxFeePerGas: null,
65
- maxPriorityFeePerGas: null,
66
- gasPrice: null,
67
- nextBaseFee: null,
68
- },
69
- fast: {
70
- maxFeePerGas: null,
71
- maxPriorityFeePerGas: null,
72
- gasPrice: null,
73
- nextBaseFee: null,
74
- },
75
- });
76
- });
77
- afterEach(() => {
78
- jest.restoreAllMocks();
79
- });
80
- describe("recipient", () => {
81
- it("detects the missing recipient with an error", async () => {
82
- const res = await (0, validateIntent_1.validateIntent)({}, eip1559Intent({ amount: 1n, recipient: "" }));
83
- expect(res.errors).toEqual(expect.objectContaining({
84
- recipient: new errors_1.RecipientRequired(),
85
- }));
86
- });
87
- it("detects the incorrect recipient not being an eth address with an error", async () => {
88
- const res = await (0, validateIntent_1.validateIntent)({ name: "Ethereum" }, eip1559Intent({ amount: 1n, recipient: "invalid-address" }));
89
- expect(res.errors).toEqual(expect.objectContaining({
90
- recipient: new errors_1.InvalidAddress("", {
91
- currencyName: "Ethereum",
92
- }),
93
- }));
94
- });
95
- it("detects the recipient being an ICAP with an error", async () => {
96
- const res = await (0, validateIntent_1.validateIntent)({ name: "Ethereum" }, eip1559Intent({
97
- amount: 1n,
98
- recipient: "XE89MW3Y75UITCQ4F53YDKR25UFLB1640YM", // ICAP version of recipient address
99
- }));
100
- expect(res.errors).toEqual(expect.objectContaining({
101
- recipient: new errors_1.InvalidAddress("", {
102
- currencyName: "Ethereum",
103
- }),
104
- }));
105
- });
106
- it("detects the recipient not being an EIP55 address with a warning", async () => {
107
- const res = await (0, validateIntent_1.validateIntent)({ name: "Ethereum" }, eip1559Intent({ amount: 1n, recipient: "0xe2ca7390e76c5a992749bb622087310d2e63ca29" }));
108
- expect(res.warnings).toEqual(expect.objectContaining({
109
- recipient: new errors_1.ETHAddressNonEIP(),
110
- }));
111
- });
112
- });
113
- describe("amount", () => {
114
- it("detects an intent for native asset sending without amount with an error", async () => {
115
- const res = await (0, validateIntent_1.validateIntent)({}, eip1559Intent({
116
- amount: 0n,
117
- asset: { type: "native" },
118
- }));
119
- expect(res.errors).toEqual(expect.objectContaining({
120
- amount: new errors_1.AmountRequired(),
121
- }));
122
- });
123
- it("detects an intent for token asset sending without amount with an error", async () => {
124
- const res = await (0, validateIntent_1.validateIntent)({}, eip1559Intent({
125
- recipient: "0xe2ca7390e76c5A992749bB622087310d2e63ca29",
126
- amount: 0n,
127
- asset: { type: "erc20" },
128
- }));
129
- expect(res.errors).toEqual(expect.objectContaining({
130
- amount: new errors_1.AmountRequired(),
131
- }));
132
- });
133
- it("detects native asset sending intent with an error", async () => {
134
- jest.spyOn(ledger_1.default, "getCoinBalance").mockResolvedValue(new bignumber_js_1.default(10));
135
- const res = await (0, validateIntent_1.validateIntent)({}, eip1559Intent({
136
- amount: 20n,
137
- asset: { type: "native" },
138
- }));
139
- expect(res.errors).toEqual(expect.objectContaining({
140
- amount: new errors_1.NotEnoughBalance(),
141
- }));
142
- });
143
- it("detects token asset sending intent with an error", async () => {
144
- jest.spyOn(ledger_2.default, "getLastOperations").mockResolvedValue({
145
- lastCoinOperations: [],
146
- lastInternalOperations: [],
147
- lastNftOperations: [],
148
- lastTokenOperations: [{ contract: "contract-address" }],
149
- });
150
- const getTokenBalance = jest
151
- .spyOn(ledger_1.default, "getTokenBalance")
152
- .mockResolvedValue(new bignumber_js_1.default(10));
153
- const res = await (0, validateIntent_1.validateIntent)({}, eip1559Intent({
154
- sender: "sender-address",
155
- recipient: "0xe2ca7390e76c5A992749bB622087310d2e63ca29",
156
- amount: 20n,
157
- asset: { type: "erc20", assetReference: "contract-adress" },
158
- }));
159
- expect(res.errors).toEqual(expect.objectContaining({
160
- amount: new errors_1.NotEnoughBalance(),
161
- }));
162
- expect(getTokenBalance).toHaveBeenCalledWith({}, "sender-address", "contract-address");
163
- });
164
- });
165
- describe("gas", () => {
166
- describe("common", () => {
167
- describe.each([
168
- ["a legacy intent", legacyIntent],
169
- ["an eip1559 intent", eip1559Intent],
170
- ])("for %s", (_s, createIntent) => {
171
- it("detects missing fees with an error", async () => {
172
- const res = await (0, validateIntent_1.validateIntent)({}, createIntent({}), { value: 0n });
173
- expect(res.errors).toEqual(expect.objectContaining({
174
- gasPrice: new errors_1.FeeNotLoaded(),
175
- }));
176
- });
177
- it("detects a missing gasLimit with an error", async () => {
178
- const res = await (0, validateIntent_1.validateIntent)({}, createIntent({}), {
179
- value: 0n,
180
- parameters: { gasLimit: undefined },
181
- });
182
- expect(res.errors).toEqual(expect.objectContaining({
183
- gasLimit: new errors_1.FeeNotLoaded(),
184
- }));
185
- });
186
- it("detects a gasLimit = 0 with an error", async () => {
187
- const res = await (0, validateIntent_1.validateIntent)({}, createIntent({}), {
188
- value: 0n,
189
- parameters: { gasLimit: 0n },
190
- });
191
- expect(res.errors).toEqual(expect.objectContaining({
192
- gasLimit: new errors_1.FeeNotLoaded(),
193
- }));
194
- });
195
- it("detects a customGasLimit = 0 with an error", async () => {
196
- const res = await (0, validateIntent_1.validateIntent)({}, createIntent({}), {
197
- value: 0n,
198
- parameters: { customGasLimit: 0n },
199
- });
200
- expect(res.errors).toEqual(expect.objectContaining({
201
- gasLimit: new errors_1.FeeNotLoaded(),
202
- }));
203
- });
204
- it("if the recipient has been set, detects fees being too high for the account balance with an error", async () => {
205
- jest.spyOn(ledger_1.default, "getCoinBalance").mockResolvedValue(new bignumber_js_1.default(10));
206
- const notEnoughBalanceRes = await (0, validateIntent_1.validateIntent)({ units: [{ code: "ETH", name: "ETH", magnitude: 18 }] }, createIntent({ recipient: "recipient-address" }), {
207
- value: 11n,
208
- parameters: { gasPrice: 1n, maxFeePerGas: 1n, maxPriorityFeePerGas: 1n },
209
- });
210
- const enoughBalanceRes = await (0, validateIntent_1.validateIntent)({ units: [{ code: "ETH", name: "ETH", magnitude: 18 }] }, createIntent({ recipient: "recipient-address" }), {
211
- value: 9n,
212
- parameters: { gasPrice: 1n, maxFeePerGas: 1n, maxPriorityFeePerGas: 1n },
213
- });
214
- expect(notEnoughBalanceRes.errors).toEqual(expect.objectContaining({
215
- gasPrice: new errors_1.NotEnoughGas(),
216
- }));
217
- expect(enoughBalanceRes.errors).not.toEqual(expect.objectContaining({
218
- gasPrice: new errors_1.NotEnoughGas(),
219
- }));
220
- });
221
- it("if the recipient has not been set, does not detect gas being too high", async () => {
222
- jest.spyOn(ledger_1.default, "getCoinBalance").mockResolvedValue(new bignumber_js_1.default(10));
223
- const notEnoughBalanceRes = await (0, validateIntent_1.validateIntent)({ units: [{ code: "ETH", name: "ETH", magnitude: 18 }] }, createIntent({ recipient: "" }), {
224
- value: 11n,
225
- parameters: { gasPrice: 1n, maxFeePerGas: 1n, maxPriorityFeePerGas: 1n },
226
- });
227
- const enoughBalanceRes = await (0, validateIntent_1.validateIntent)({ units: [{ code: "ETH", name: "ETH", magnitude: 18 }] }, createIntent({ recipient: "" }), {
228
- value: 9n,
229
- parameters: { gasPrice: 1n, maxFeePerGas: 1n, maxPriorityFeePerGas: 1n },
230
- });
231
- expect(notEnoughBalanceRes.errors).not.toEqual(expect.objectContaining({
232
- gasPrice: new errors_1.NotEnoughGas(),
233
- }));
234
- expect(enoughBalanceRes.errors).not.toEqual(expect.objectContaining({
235
- gasPrice: new errors_1.NotEnoughGas(),
236
- }));
237
- });
238
- it("detects gas limit being too low in a tx with an error", async () => {
239
- const res = await (0, validateIntent_1.validateIntent)({}, createIntent({}), {
240
- value: 0n,
241
- parameters: { gasLimit: 20000n }, // min should be 21000
242
- });
243
- expect(res.errors).toEqual(expect.objectContaining({
244
- gasLimit: new errors_1.GasLessThanEstimate(),
245
- }));
246
- });
247
- it("detects custom gas limit being too low in a tx with an error", async () => {
248
- const res = await (0, validateIntent_1.validateIntent)({}, createIntent({}), {
249
- value: 0n,
250
- parameters: { customGasLimit: 20000n }, // min should be 21000
251
- });
252
- expect(res.errors).toEqual(expect.objectContaining({
253
- gasLimit: new errors_1.GasLessThanEstimate(),
254
- }));
255
- });
256
- it("detects customGasLimit being lower than gasLimit with a warning", async () => {
257
- const res = await (0, validateIntent_1.validateIntent)({}, createIntent({}), {
258
- value: 0n,
259
- parameters: {
260
- gasLimit: 22000n,
261
- customGasLimit: 21000n,
262
- },
263
- });
264
- expect(res.warnings).toEqual(expect.objectContaining({
265
- gasLimit: new errors_1.GasLessThanEstimate(),
266
- }));
267
- });
268
- });
269
- });
270
- describe("eip1559 specific", () => {
271
- it("detects a maxPriorityFeePerGas = 0 with an error", async () => {
272
- const res = await (0, validateIntent_1.validateIntent)({}, eip1559Intent({}), {
273
- value: 0n,
274
- parameters: { maxPriorityFeePerGas: 0n, maxFeePerGas: 2n },
275
- });
276
- expect(res.errors).toEqual(expect.objectContaining({
277
- maxPriorityFee: new errors_1.PriorityFeeTooLow(),
278
- }));
279
- });
280
- it("detects maxFeePerGas being greater than max gasOptions maxFeePerGas with an error", async () => {
281
- const res = await (0, validateIntent_1.validateIntent)({}, eip1559Intent({}), {
282
- value: 0n,
283
- parameters: { maxPriorityFeePerGas: 6n, maxFeePerGas: 5n },
284
- });
285
- expect(res.errors).toEqual(expect.objectContaining({
286
- maxPriorityFee: new errors_1.PriorityFeeHigherThanMaxFee(),
287
- }));
288
- });
289
- it("detects maxPriorityFeePerGas being greater than max gasOptions maxPriorityFeePerGas with a warning", async () => {
290
- jest.spyOn(ledger_3.default, "getGasOptions").mockResolvedValue({
291
- slow: {
292
- maxFeePerGas: null,
293
- maxPriorityFeePerGas: null,
294
- gasPrice: null,
295
- nextBaseFee: null,
296
- },
297
- medium: {
298
- maxFeePerGas: null,
299
- maxPriorityFeePerGas: null,
300
- gasPrice: null,
301
- nextBaseFee: null,
302
- },
303
- fast: {
304
- maxFeePerGas: null,
305
- maxPriorityFeePerGas: (0, bignumber_js_1.default)(3),
306
- gasPrice: null,
307
- nextBaseFee: null,
308
- },
309
- });
310
- const res = await (0, validateIntent_1.validateIntent)({}, eip1559Intent({}), {
311
- value: 0n,
312
- parameters: { maxPriorityFeePerGas: 4n, maxFeePerGas: 5n },
313
- });
314
- expect(res.warnings).toEqual(expect.objectContaining({
315
- maxPriorityFee: new errors_1.PriorityFeeTooHigh(),
316
- }));
317
- });
318
- it("detects maxPriorityFeePerGas being lower than min gasOptions maxPriorityFeePerGas with a warning", async () => {
319
- jest.spyOn(ledger_3.default, "getGasOptions").mockResolvedValue({
320
- slow: {
321
- maxFeePerGas: null,
322
- maxPriorityFeePerGas: (0, bignumber_js_1.default)(3),
323
- gasPrice: null,
324
- nextBaseFee: null,
325
- },
326
- medium: {
327
- maxFeePerGas: null,
328
- maxPriorityFeePerGas: null,
329
- gasPrice: null,
330
- nextBaseFee: null,
331
- },
332
- fast: {
333
- maxFeePerGas: null,
334
- maxPriorityFeePerGas: null,
335
- gasPrice: null,
336
- nextBaseFee: null,
337
- },
338
- });
339
- const res = await (0, validateIntent_1.validateIntent)({}, eip1559Intent({}), {
340
- value: 0n,
341
- parameters: { maxPriorityFeePerGas: 1n, maxFeePerGas: 5n },
342
- });
343
- expect(res.warnings).toEqual(expect.objectContaining({
344
- maxPriorityFee: new errors_1.PriorityFeeTooLow(),
345
- }));
346
- });
347
- it("detects maxFeePerGas being lower than recommanded next base fee with a warning", async () => {
348
- jest.spyOn(ledger_3.default, "getGasOptions").mockResolvedValue({
349
- slow: {
350
- maxFeePerGas: null,
351
- maxPriorityFeePerGas: null,
352
- gasPrice: null,
353
- nextBaseFee: null,
354
- },
355
- medium: {
356
- maxFeePerGas: null,
357
- maxPriorityFeePerGas: null,
358
- gasPrice: null,
359
- nextBaseFee: (0, bignumber_js_1.default)(6),
360
- },
361
- fast: {
362
- maxFeePerGas: null,
363
- maxPriorityFeePerGas: null,
364
- gasPrice: null,
365
- nextBaseFee: null,
366
- },
367
- });
368
- const res = await (0, validateIntent_1.validateIntent)({}, eip1559Intent({}), {
369
- value: 0n,
370
- parameters: { maxPriorityFeePerGas: 1n, maxFeePerGas: 5n },
371
- });
372
- expect(res.warnings).toEqual(expect.objectContaining({
373
- maxFee: new errors_1.MaxFeeTooLow(),
374
- }));
375
- });
376
- });
377
- });
378
- describe("valid intent", () => {
379
- it("does not return any error of warning for a valid legacy intent", async () => {
380
- const res = await (0, validateIntent_1.validateIntent)({}, legacyIntent({ amount: 2n, recipient: "0xe2ca7390e76c5A992749bB622087310d2e63ca29" }), {
381
- value: 4n,
382
- parameters: { gasLimit: 21000n, gasPrice: 10n },
383
- });
384
- expect(res).toEqual({
385
- estimatedFees: 4n,
386
- totalSpent: 6n,
387
- amount: 2n,
388
- errors: {},
389
- warnings: {},
390
- });
391
- });
392
- it("does not return any error of warning for a valid eip1559 intent", async () => {
393
- jest.spyOn(ledger_3.default, "getGasOptions").mockResolvedValue({
394
- slow: {
395
- maxFeePerGas: null,
396
- maxPriorityFeePerGas: (0, bignumber_js_1.default)(2),
397
- gasPrice: null,
398
- nextBaseFee: null,
399
- },
400
- medium: {
401
- maxFeePerGas: null,
402
- maxPriorityFeePerGas: null,
403
- gasPrice: null,
404
- nextBaseFee: (0, bignumber_js_1.default)(4),
405
- },
406
- fast: {
407
- maxFeePerGas: null,
408
- maxPriorityFeePerGas: (0, bignumber_js_1.default)(6),
409
- gasPrice: null,
410
- nextBaseFee: null,
411
- },
412
- });
413
- const res = await (0, validateIntent_1.validateIntent)({}, eip1559Intent({ amount: 2n, recipient: "0xe2ca7390e76c5A992749bB622087310d2e63ca29" }), {
414
- value: 4n,
415
- parameters: { gasLimit: 21000n, maxPriorityFeePerGas: 3n, maxFeePerGas: 5n },
416
- });
417
- expect(res).toEqual({
418
- estimatedFees: 4n,
419
- totalSpent: 6n,
420
- amount: 2n,
421
- errors: {},
422
- warnings: {},
423
- });
424
- });
425
- it("does not call the gas tracker if unnecessary", async () => {
426
- const getGasOptions = jest.spyOn(ledger_3.default, "getGasOptions").mockResolvedValue({
427
- slow: {
428
- maxFeePerGas: null,
429
- maxPriorityFeePerGas: null,
430
- gasPrice: null,
431
- nextBaseFee: null,
432
- },
433
- medium: {
434
- maxFeePerGas: null,
435
- maxPriorityFeePerGas: null,
436
- gasPrice: null,
437
- nextBaseFee: null,
438
- },
439
- fast: {
440
- maxFeePerGas: null,
441
- maxPriorityFeePerGas: null,
442
- gasPrice: null,
443
- nextBaseFee: null,
444
- },
445
- });
446
- const res = await (0, validateIntent_1.validateIntent)({}, eip1559Intent({ amount: 2n, recipient: "0xe2ca7390e76c5A992749bB622087310d2e63ca29" }), {
447
- value: 4n,
448
- parameters: {
449
- gasLimit: 21000n,
450
- maxPriorityFeePerGas: 3n,
451
- maxFeePerGas: 5n,
452
- gasOptions: {
453
- slow: {
454
- maxFeePerGas: null,
455
- maxPriorityFeePerGas: 2n,
456
- gasPrice: null,
457
- nextBaseFee: null,
458
- },
459
- medium: {
460
- maxFeePerGas: null,
461
- maxPriorityFeePerGas: null,
462
- gasPrice: null,
463
- nextBaseFee: 4n,
464
- },
465
- fast: {
466
- maxFeePerGas: null,
467
- maxPriorityFeePerGas: 6n,
468
- gasPrice: null,
469
- nextBaseFee: null,
470
- },
471
- },
472
- },
473
- });
474
- expect(res).toEqual({
475
- estimatedFees: 4n,
476
- totalSpent: 6n,
477
- amount: 2n,
478
- errors: {},
479
- warnings: {},
480
- });
481
- expect(getGasOptions).not.toHaveBeenCalled();
482
- });
483
- });
484
- });
485
- //# sourceMappingURL=validateIntent.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"validateIntent.test.js","sourceRoot":"","sources":["../../src/logic/validateIntent.test.ts"],"names":[],"mappings":";;;;;AACA,6CAa0B;AAE1B,gEAAqC;AAErC,sCAAyD;AACzD,oEAAgD;AAChD,wEAAwD;AACxD,0EAA4D;AAC5D,qDAAkD;AAElD,SAAS,YAAY,CAAC,MAAgD;IACpE,OAAO;QACL,IAAI,EAAE,aAAa;QACnB,MAAM,EAAE,EAAE;QACV,SAAS,EAAE,EAAE;QACb,MAAM,EAAE,EAAE;QACV,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QACzB,GAAG,MAAM;KACV,CAAC;AACJ,CAAC;AAED,SAAS,aAAa,CAAC,MAAgD;IACrE,OAAO;QACL,IAAI,EAAE,cAAc;QACpB,MAAM,EAAE,EAAE;QACV,SAAS,EAAE,EAAE;QACb,MAAM,EAAE,EAAE;QACV,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QACzB,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,CAAC;YACH,MAAM,CAAC,aAAa,CAAC,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAC;QAC/C,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,52 +0,0 @@
1
- {
2
- "type": "TokenCurrency",
3
- "id": "cardano/native/8654e8b350e298c80d2451beb5ed80fc9eee9f38ce6b039fb8706bc34c4f4253544552",
4
- "contractAddress": "8654e8b350e298c80d2451beb5ed80fc9eee9f38ce6b039fb8706bc34c4f4253544552",
5
- "parentCurrency": {
6
- "type": "CryptoCurrency",
7
- "id": "cardano",
8
- "coinType": 1815,
9
- "name": "Cardano",
10
- "managerAppName": "Cardano ADA",
11
- "ticker": "ADA",
12
- "scheme": "cardano",
13
- "color": "#0A1D2C",
14
- "family": "cardano",
15
- "blockAvgTime": 20,
16
- "units": [
17
- {
18
- "name": "ada",
19
- "code": "ADA",
20
- "magnitude": 6
21
- },
22
- {
23
- "name": "Lovelace",
24
- "code": "Lovelace",
25
- "magnitude": 0
26
- }
27
- ],
28
- "explorerViews": [
29
- {
30
- "tx": "https://cardanoscan.io/transaction/$hash",
31
- "address": "https://cardanoscan.io/address/$address",
32
- "stakePool": "https://cardanoscan.io/pool/$poolId"
33
- }
34
- ],
35
- "keywords": [
36
- "ada",
37
- "cardano"
38
- ]
39
- },
40
- "tokenType": "native",
41
- "name": "LOBSTER",
42
- "ticker": "$LOBSTER",
43
- "delisted": false,
44
- "disableCountervalue": false,
45
- "units": [
46
- {
47
- "name": "LOBSTER",
48
- "code": "$LOBSTER",
49
- "magnitude": 0
50
- }
51
- ]
52
- }
@@ -1,20 +0,0 @@
1
- {
2
- "accountId": "js:2:ethereum:0x6cbcd73cd8e8a42844662f0a0e76d7f79afd933d:+ethereum%2Ferc20%2Fusd~!underscore!~~!underscore!~coin",
3
- "blockHash": "0x58ee7556044cd139e569c87c173a6dedbfbeb9ada6693ee6090fd510acee9c21",
4
- "blockHeight": 16240731,
5
- "contract": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
6
- "date": "2022-12-22T14:06:23.000Z",
7
- "extra": {},
8
- "fee": "1595338583295225",
9
- "hash": "0x02b972f304dc24c9bc362e6435c4ad654241f9af916689a4790145c9bcbdf4cf",
10
- "id": "js:2:ethereum:0x6cbcd73cd8e8a42844662f0a0e76d7f79afd933d:+js%3A2%3Aethereum%3A0x6cbcd73cd8e8a42844662f0a0e76d7f79afd933d%3A%2Bethereum%252Ferc20%252Fusd~!underscore!~~!underscore!~coin~!dash!~0x02b972f304dc24c9bc362e6435c4ad654241f9af916689a4790145c9bcbdf4cf~!dash!~OUT~!dash!~i0-0x02b972f304dc24c9bc362e6435c4ad654241f9af916689a4790145c9bcbdf4cf-IN-i0",
11
- "recipients": [
12
- "0xC2907EFccE4011C491BbedA8A0fA63BA7aab596C"
13
- ],
14
- "senders": [
15
- "0x6cBCD73CD8e8a42844662f0A0e76D7F79Afd933d"
16
- ],
17
- "transactionSequenceNumber": 53,
18
- "type": "OUT",
19
- "value": "2000000"
20
- }
@@ -1,19 +0,0 @@
1
- {
2
- "accountId": "js:2:ethereum:0x6cbcd73cd8e8a42844662f0a0e76d7f79afd933d:+js%3A2%3Aethereum%3A0x6cbcd73cd8e8a42844662f0a0e76d7f79afd933d%3A%2Bethereum%252Ferc20%252Fusd~!underscore!~~!underscore!~coin~!dash!~0x02b972f304dc24c9bc362e6435c4ad654241f9af916689a4790145c9bcbdf4cf~!dash!~OUT~!dash!~i0",
3
- "blockHash": "0x58ee7556044cd139e569c87c173a6dedbfbeb9ada6693ee6090fd510acee9c21",
4
- "blockHeight": 16240731,
5
- "date": "2022-12-22T14:06:23.000Z",
6
- "extra": {},
7
- "fee": "1595338583295225",
8
- "hash": "0x02b972f304dc24c9bc362e6435c4ad654241f9af916689a4790145c9bcbdf4cf",
9
- "id": "js:2:ethereum:0x6cbcd73cd8e8a42844662f0a0e76d7f79afd933d:+js%3A2%3Aethereum%3A0x6cbcd73cd8e8a42844662f0a0e76d7f79afd933d%3A%2Bethereum%252Ferc20%252Fusd~!underscore!~~!underscore!~coin~!dash!~0x02b972f304dc24c9bc362e6435c4ad654241f9af916689a4790145c9bcbdf4cf~!dash!~OUT~!dash!~i0-0x02b972f304dc24c9bc362e6435c4ad654241f9af916689a4790145c9bcbdf4cf-OUT-i0",
10
- "recipients": [
11
- "0xC2907EFccE4011C491BbedA8A0fA63BA7aab596C"
12
- ],
13
- "senders": [
14
- "0x6cBCD73CD8e8a42844662f0A0e76D7F79Afd933d"
15
- ],
16
- "transactionSequenceNumber": 53,
17
- "type": "OUT",
18
- "value": "2000000"
19
- }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=cryptoAssetsStore.fixtures.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cryptoAssetsStore.fixtures.d.ts","sourceRoot":"","sources":["../../../src/__tests__/fixtures/cryptoAssetsStore.fixtures.ts"],"names":[],"mappings":""}
@@ -1,19 +0,0 @@
1
- import * as legacyTokens from "@ledgerhq/cryptoassets/tokens";
2
- import { setCryptoAssetsStore as setCryptoAssetsStoreForCoinFramework } from "@ledgerhq/coin-framework/crypto-assets/index";
3
- import { setCryptoAssetsStoreGetter } from "../../cryptoAssetsStore";
4
- /*
5
- * TODO change implementation when new CryptoAssesStore implemented with DADA
6
- */
7
- // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
8
- setCryptoAssetsStoreForCoinFramework({
9
- findTokenById: legacyTokens.findTokenById,
10
- findTokenByAddressInCurrency: legacyTokens.findTokenByAddressInCurrency,
11
- });
12
- setCryptoAssetsStoreGetter(() =>
13
- // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
14
- ({
15
- findTokenById: legacyTokens.findTokenById,
16
- findTokenByAddressInCurrency: legacyTokens.findTokenByAddressInCurrency,
17
- findTokenByAddress: legacyTokens.findTokenByAddress,
18
- }));
19
- //# sourceMappingURL=cryptoAssetsStore.fixtures.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cryptoAssetsStore.fixtures.js","sourceRoot":"","sources":["../../../src/__tests__/fixtures/cryptoAssetsStore.fixtures.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,YAAY,MAAM,+BAA+B,CAAC;AAE9D,OAAO,EAAE,oBAAoB,IAAI,oCAAoC,EAAE,MAAM,8CAA8C,CAAC;AAC5H,OAAO,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AAErE;;GAEG;AAEH,yEAAyE;AACzE,oCAAoC,CAAC;IACnC,aAAa,EAAE,YAAY,CAAC,aAAa;IACzC,4BAA4B,EAAE,YAAY,CAAC,4BAA4B;CACnD,CAAC,CAAC;AAExB,0BAA0B,CACxB,GAAG,EAAE;AACH,yEAAyE;AACzE,CAAC;IACC,aAAa,EAAE,YAAY,CAAC,aAAa;IACzC,4BAA4B,EAAE,YAAY,CAAC,4BAA4B;IACvE,kBAAkB,EAAE,YAAY,CAAC,kBAAkB;CACpD,CAAsB,CAC1B,CAAC"}
@@ -1,5 +0,0 @@
1
- import type { CryptoAssetsStore, CryptoAssetsStoreGetter } from "@ledgerhq/types-live";
2
- export declare const CRYPTO_ASSETS_STORE_NO_SET_ERROR_MESSAGE = "CryptoAssetsStore is not set. Please call setCryptoAssetsStore first on coin EVM";
3
- export declare function setCryptoAssetsStoreGetter(cryptoAssetsStoreGetter: CryptoAssetsStoreGetter): void;
4
- export declare function getCryptoAssetsStore(): CryptoAssetsStore;
5
- //# sourceMappingURL=cryptoAssetsStore.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cryptoAssetsStore.d.ts","sourceRoot":"","sources":["../src/cryptoAssetsStore.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAEvF,eAAO,MAAM,wCAAwC,qFAC+B,CAAC;AAGrF,wBAAgB,0BAA0B,CAAC,uBAAuB,EAAE,uBAAuB,GAAG,IAAI,CAEjG;AAED,wBAAgB,oBAAoB,IAAI,iBAAiB,CAKxD"}