@ledgerhq/coin-evm 5.3.1 → 5.3.3

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 (255) hide show
  1. package/.oxlintrc.json +3 -13
  2. package/CHANGELOG.md +13 -0
  3. package/lib/adapters/blockOperations.d.ts +2 -2
  4. package/lib/adapters/blockOperations.d.ts.map +1 -1
  5. package/lib/adapters/blockOperations.js.map +1 -1
  6. package/lib/api/index.d.ts +1 -1
  7. package/lib/api/index.d.ts.map +1 -1
  8. package/lib/config.d.ts +1 -1
  9. package/lib/config.d.ts.map +1 -1
  10. package/lib/logic/combine.d.ts +2 -1
  11. package/lib/logic/combine.d.ts.map +1 -1
  12. package/lib/logic/combine.js.map +1 -1
  13. package/lib/logic/common.d.ts +2 -1
  14. package/lib/logic/common.d.ts.map +1 -1
  15. package/lib/logic/common.js.map +1 -1
  16. package/lib/logic/craftTransaction.d.ts +1 -1
  17. package/lib/logic/craftTransaction.d.ts.map +1 -1
  18. package/lib/logic/craftTransaction.js.map +1 -1
  19. package/lib/logic/craftTransactionData.d.ts +1 -1
  20. package/lib/logic/craftTransactionData.d.ts.map +1 -1
  21. package/lib/logic/estimateFees.d.ts +1 -1
  22. package/lib/logic/estimateFees.d.ts.map +1 -1
  23. package/lib/logic/estimateFees.js.map +1 -1
  24. package/lib/logic/getBalance.d.ts +1 -1
  25. package/lib/logic/getBalance.d.ts.map +1 -1
  26. package/lib/logic/getBalance.js.map +1 -1
  27. package/lib/logic/getBlock.d.ts +1 -1
  28. package/lib/logic/getBlock.d.ts.map +1 -1
  29. package/lib/logic/getBlock.js.map +1 -1
  30. package/lib/logic/getStakes.d.ts +1 -1
  31. package/lib/logic/getStakes.d.ts.map +1 -1
  32. package/lib/logic/internalTransactionsFetcher.d.ts +1 -1
  33. package/lib/logic/internalTransactionsFetcher.d.ts.map +1 -1
  34. package/lib/logic/internalTransactionsFetcher.js.map +1 -1
  35. package/lib/logic/validateIntent.d.ts +1 -1
  36. package/lib/logic/validateIntent.d.ts.map +1 -1
  37. package/lib/logic/validateIntent.js.map +1 -1
  38. package/lib/logic.d.ts +1 -1
  39. package/lib/logic.d.ts.map +1 -1
  40. package/lib/network/explorer/etherscan.d.ts +4 -4
  41. package/lib/network/explorer/etherscan.d.ts.map +1 -1
  42. package/lib/network/explorer/etherscan.js.map +1 -1
  43. package/lib/network/explorer/index.d.ts +2 -2
  44. package/lib/network/explorer/index.d.ts.map +1 -1
  45. package/lib/network/explorer/index.js.map +1 -1
  46. package/lib/network/explorer/ledger.d.ts +2 -2
  47. package/lib/network/explorer/ledger.d.ts.map +1 -1
  48. package/lib/network/explorer/ledger.js.map +1 -1
  49. package/lib/network/explorer/none.d.ts +1 -1
  50. package/lib/network/explorer/none.d.ts.map +1 -1
  51. package/lib/network/explorer/none.js.map +1 -1
  52. package/lib/network/explorer/types.d.ts +1 -1
  53. package/lib/network/explorer/types.d.ts.map +1 -1
  54. package/lib/network/gasTracker/index.d.ts +2 -2
  55. package/lib/network/gasTracker/index.d.ts.map +1 -1
  56. package/lib/network/gasTracker/index.js.map +1 -1
  57. package/lib/network/gasTracker/ledger.d.ts +3 -3
  58. package/lib/network/gasTracker/ledger.d.ts.map +1 -1
  59. package/lib/network/gasTracker/ledger.js.map +1 -1
  60. package/lib/network/gasTracker/types.d.ts +2 -2
  61. package/lib/network/gasTracker/types.d.ts.map +1 -1
  62. package/lib/network/node/ledger.d.ts +2 -2
  63. package/lib/network/node/ledger.d.ts.map +1 -1
  64. package/lib/network/node/ledger.js.map +1 -1
  65. package/lib/network/node/rpc.common.d.ts +1 -1
  66. package/lib/network/node/rpc.common.d.ts.map +1 -1
  67. package/lib/network/node/rpc.common.js.map +1 -1
  68. package/lib/network/node/types.d.ts +3 -3
  69. package/lib/network/node/types.d.ts.map +1 -1
  70. package/lib/staking/validators/monad.d.ts +2 -1
  71. package/lib/staking/validators/monad.d.ts.map +1 -1
  72. package/lib/staking/validators/monad.js.map +1 -1
  73. package/lib/staking/validators/monadResolver.d.ts +2 -1
  74. package/lib/staking/validators/monadResolver.d.ts.map +1 -1
  75. package/lib/staking/validators/monadResolver.js.map +1 -1
  76. package/lib/staking/validators/somnia.d.ts.map +1 -1
  77. package/lib/staking/validators/somnia.js.map +1 -1
  78. package/lib/staking/validators/zero_gravity.d.ts.map +1 -1
  79. package/lib/staking/validators/zero_gravity.js.map +1 -1
  80. package/lib/types/assets.d.ts +1 -1
  81. package/lib/types/assets.d.ts.map +1 -1
  82. package/lib/types/transaction.d.ts +1 -1
  83. package/lib/types/transaction.d.ts.map +1 -1
  84. package/lib-es/adapters/blockOperations.d.ts +2 -2
  85. package/lib-es/adapters/blockOperations.d.ts.map +1 -1
  86. package/lib-es/adapters/blockOperations.js.map +1 -1
  87. package/lib-es/api/index.d.ts +1 -1
  88. package/lib-es/api/index.d.ts.map +1 -1
  89. package/lib-es/config.d.ts +1 -1
  90. package/lib-es/config.d.ts.map +1 -1
  91. package/lib-es/logic/combine.d.ts +2 -1
  92. package/lib-es/logic/combine.d.ts.map +1 -1
  93. package/lib-es/logic/combine.js.map +1 -1
  94. package/lib-es/logic/common.d.ts +2 -1
  95. package/lib-es/logic/common.d.ts.map +1 -1
  96. package/lib-es/logic/common.js +1 -1
  97. package/lib-es/logic/common.js.map +1 -1
  98. package/lib-es/logic/craftTransaction.d.ts +1 -1
  99. package/lib-es/logic/craftTransaction.d.ts.map +1 -1
  100. package/lib-es/logic/craftTransaction.js.map +1 -1
  101. package/lib-es/logic/craftTransactionData.d.ts +1 -1
  102. package/lib-es/logic/craftTransactionData.d.ts.map +1 -1
  103. package/lib-es/logic/estimateFees.d.ts +1 -1
  104. package/lib-es/logic/estimateFees.d.ts.map +1 -1
  105. package/lib-es/logic/estimateFees.js.map +1 -1
  106. package/lib-es/logic/getBalance.d.ts +1 -1
  107. package/lib-es/logic/getBalance.d.ts.map +1 -1
  108. package/lib-es/logic/getBalance.js.map +1 -1
  109. package/lib-es/logic/getBlock.d.ts +1 -1
  110. package/lib-es/logic/getBlock.d.ts.map +1 -1
  111. package/lib-es/logic/getBlock.js.map +1 -1
  112. package/lib-es/logic/getStakes.d.ts +1 -1
  113. package/lib-es/logic/getStakes.d.ts.map +1 -1
  114. package/lib-es/logic/internalTransactionsFetcher.d.ts +1 -1
  115. package/lib-es/logic/internalTransactionsFetcher.d.ts.map +1 -1
  116. package/lib-es/logic/internalTransactionsFetcher.js.map +1 -1
  117. package/lib-es/logic/validateIntent.d.ts +1 -1
  118. package/lib-es/logic/validateIntent.d.ts.map +1 -1
  119. package/lib-es/logic/validateIntent.js.map +1 -1
  120. package/lib-es/logic.d.ts +1 -1
  121. package/lib-es/logic.d.ts.map +1 -1
  122. package/lib-es/network/explorer/etherscan.d.ts +4 -4
  123. package/lib-es/network/explorer/etherscan.d.ts.map +1 -1
  124. package/lib-es/network/explorer/etherscan.js.map +1 -1
  125. package/lib-es/network/explorer/index.d.ts +2 -2
  126. package/lib-es/network/explorer/index.d.ts.map +1 -1
  127. package/lib-es/network/explorer/index.js.map +1 -1
  128. package/lib-es/network/explorer/ledger.d.ts +2 -2
  129. package/lib-es/network/explorer/ledger.d.ts.map +1 -1
  130. package/lib-es/network/explorer/ledger.js.map +1 -1
  131. package/lib-es/network/explorer/none.d.ts +1 -1
  132. package/lib-es/network/explorer/none.d.ts.map +1 -1
  133. package/lib-es/network/explorer/none.js.map +1 -1
  134. package/lib-es/network/explorer/types.d.ts +1 -1
  135. package/lib-es/network/explorer/types.d.ts.map +1 -1
  136. package/lib-es/network/gasTracker/index.d.ts +2 -2
  137. package/lib-es/network/gasTracker/index.d.ts.map +1 -1
  138. package/lib-es/network/gasTracker/index.js.map +1 -1
  139. package/lib-es/network/gasTracker/ledger.d.ts +3 -3
  140. package/lib-es/network/gasTracker/ledger.d.ts.map +1 -1
  141. package/lib-es/network/gasTracker/ledger.js +1 -1
  142. package/lib-es/network/gasTracker/ledger.js.map +1 -1
  143. package/lib-es/network/gasTracker/types.d.ts +2 -2
  144. package/lib-es/network/gasTracker/types.d.ts.map +1 -1
  145. package/lib-es/network/node/ledger.d.ts +2 -2
  146. package/lib-es/network/node/ledger.d.ts.map +1 -1
  147. package/lib-es/network/node/ledger.js.map +1 -1
  148. package/lib-es/network/node/rpc.common.d.ts +1 -1
  149. package/lib-es/network/node/rpc.common.d.ts.map +1 -1
  150. package/lib-es/network/node/rpc.common.js +1 -1
  151. package/lib-es/network/node/rpc.common.js.map +1 -1
  152. package/lib-es/network/node/types.d.ts +3 -3
  153. package/lib-es/network/node/types.d.ts.map +1 -1
  154. package/lib-es/staking/validators/monad.d.ts +2 -1
  155. package/lib-es/staking/validators/monad.d.ts.map +1 -1
  156. package/lib-es/staking/validators/monad.js.map +1 -1
  157. package/lib-es/staking/validators/monadResolver.d.ts +2 -1
  158. package/lib-es/staking/validators/monadResolver.d.ts.map +1 -1
  159. package/lib-es/staking/validators/monadResolver.js.map +1 -1
  160. package/lib-es/staking/validators/somnia.d.ts.map +1 -1
  161. package/lib-es/staking/validators/somnia.js.map +1 -1
  162. package/lib-es/staking/validators/zero_gravity.d.ts.map +1 -1
  163. package/lib-es/staking/validators/zero_gravity.js.map +1 -1
  164. package/lib-es/types/assets.d.ts +1 -1
  165. package/lib-es/types/assets.d.ts.map +1 -1
  166. package/lib-es/types/transaction.d.ts +1 -1
  167. package/lib-es/types/transaction.d.ts.map +1 -1
  168. package/package.json +2 -2
  169. package/src/adapters/blockOperations.test.ts +29 -31
  170. package/src/adapters/blockOperations.ts +3 -2
  171. package/src/adapters/etherscan.test.ts +7 -7
  172. package/src/adapters/ledger.test.ts +2 -2
  173. package/src/api/getBlock.integ.test.ts +1 -1
  174. package/src/api/index.fantom.integ.test.ts +1 -1
  175. package/src/api/index.flare.integ.test.ts +2 -14
  176. package/src/api/index.integ.test.ts +330 -246
  177. package/src/api/index.linea.integ.test.ts +1 -1
  178. package/src/api/index.optimism.integ.test.ts +1 -1
  179. package/src/api/index.shape.integ.test.ts +1 -1
  180. package/src/api/index.ts +1 -1
  181. package/src/config.ts +1 -1
  182. package/src/fixtures/context.fixtures.ts +79 -1
  183. package/src/fixtures/ethers.fixtures.ts +26 -0
  184. package/src/fixtures/ledger.fixtures.ts +1 -1
  185. package/src/internalTxSources.test.ts +3 -6
  186. package/src/logic/broadcast.integ.test.ts +6 -18
  187. package/src/logic/broadcast.test.ts +19 -31
  188. package/src/logic/broadcastSource.test.ts +6 -7
  189. package/src/logic/combine.test.ts +2 -2
  190. package/src/logic/combine.ts +2 -1
  191. package/src/logic/common.test.ts +120 -112
  192. package/src/logic/common.ts +2 -7
  193. package/src/logic/craftTransaction.test.ts +163 -200
  194. package/src/logic/craftTransaction.ts +3 -2
  195. package/src/logic/craftTransactionData.test.ts +6 -6
  196. package/src/logic/craftTransactionData.ts +1 -1
  197. package/src/logic/estimateFees.test.ts +19 -15
  198. package/src/logic/estimateFees.ts +6 -3
  199. package/src/logic/getBalance.test.ts +16 -15
  200. package/src/logic/getBalance.ts +4 -3
  201. package/src/logic/getBlock.test.ts +379 -388
  202. package/src/logic/getBlock.ts +3 -2
  203. package/src/logic/getBlockInfo.test.ts +7 -9
  204. package/src/logic/getNextSequence.test.ts +5 -5
  205. package/src/logic/getStakes.test.ts +35 -35
  206. package/src/logic/getStakes.ts +1 -1
  207. package/src/logic/internalTransactionsFetcher.test.ts +26 -24
  208. package/src/logic/internalTransactionsFetcher.ts +1 -1
  209. package/src/logic/lastBlock.test.ts +29 -20
  210. package/src/logic/listOperations.test.ts +44 -40
  211. package/src/logic/validateIntent.test.ts +152 -101
  212. package/src/logic/validateIntent.ts +4 -2
  213. package/src/logic.test.ts +13 -18
  214. package/src/logic.ts +1 -1
  215. package/src/network/explorer/etherscan.test.ts +6 -6
  216. package/src/network/explorer/etherscan.ts +12 -10
  217. package/src/network/explorer/index.test.ts +52 -22
  218. package/src/network/explorer/index.ts +2 -2
  219. package/src/network/explorer/ledger.test.ts +17 -5
  220. package/src/network/explorer/ledger.ts +3 -2
  221. package/src/network/explorer/none.ts +2 -1
  222. package/src/network/explorer/types.ts +1 -1
  223. package/src/network/gasTracker/index.test.ts +14 -8
  224. package/src/network/gasTracker/index.ts +2 -2
  225. package/src/network/gasTracker/ledger.test.ts +34 -29
  226. package/src/network/gasTracker/ledger.ts +5 -7
  227. package/src/network/gasTracker/types.ts +2 -2
  228. package/src/network/node/index.memoization.test.ts +25 -31
  229. package/src/network/node/index.test.ts +14 -25
  230. package/src/network/node/ledger.test.ts +45 -60
  231. package/src/network/node/ledger.ts +6 -5
  232. package/src/network/node/node.fixtures.ts +0 -2
  233. package/src/network/node/rpc.common.ts +14 -14
  234. package/src/network/node/rpc.test.ts +153 -184
  235. package/src/network/node/types.ts +3 -3
  236. package/src/staking/detectOperationType.test.ts +1 -1
  237. package/src/staking/encoder.test.ts +14 -22
  238. package/src/staking/logic.test.ts +20 -14
  239. package/src/staking/operations/index.test.ts +29 -29
  240. package/src/staking/prepareIntents.test.ts +26 -20
  241. package/src/staking/redelegations.test.ts +50 -33
  242. package/src/staking/rewards.test.ts +29 -17
  243. package/src/staking/rewardsFromReceipt.test.ts +20 -21
  244. package/src/staking/transactionData.test.ts +23 -23
  245. package/src/staking/validators/monad.test.ts +65 -24
  246. package/src/staking/validators/monad.ts +2 -1
  247. package/src/staking/validators/monadResolver.ts +2 -1
  248. package/src/staking/validators/somnia.test.ts +21 -13
  249. package/src/staking/validators/somnia.ts +2 -1
  250. package/src/staking/validators/zero_gravity.test.ts +118 -48
  251. package/src/staking/validators/zero_gravity.ts +2 -1
  252. package/src/staking/validators.integ.test.ts +13 -25
  253. package/src/staking/validators.test.ts +7 -2
  254. package/src/types/assets.ts +1 -1
  255. package/src/types/transaction.ts +1 -1
@@ -1,6 +1,13 @@
1
1
  // SPDX-FileCopyrightText: © 2026 LEDGER SAS
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
+ import type {
5
+ EtherscanERC1155Event,
6
+ EtherscanERC20Event,
7
+ EtherscanERC721Event,
8
+ EtherscanInternalTransaction,
9
+ EtherscanOperation,
10
+ } from '../types'
4
11
  import BigNumber from 'bignumber.js'
5
12
  import {
6
13
  etherscanERC1155EventToOperations,
@@ -15,13 +22,6 @@ import {
15
22
  serializePagingToken,
16
23
  } from '../adapters'
17
24
  import { NO_TOKEN } from '../network/explorer/types'
18
- import {
19
- EtherscanERC1155Event,
20
- EtherscanERC20Event,
21
- EtherscanERC721Event,
22
- EtherscanInternalTransaction,
23
- EtherscanOperation,
24
- } from '../types'
25
25
 
26
26
  describe('EVM Family', () => {
27
27
  describe('adapters', () => {
@@ -1,14 +1,14 @@
1
1
  // SPDX-FileCopyrightText: © 2026 LEDGER SAS
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
- import type { MemoNotSupported, Operation } from '@ledgerhq/coin-module-framework/api/types'
5
- import {
4
+ import type {
6
5
  LedgerExplorerER1155TransferEvent,
7
6
  LedgerExplorerER721TransferEvent,
8
7
  LedgerExplorerERC20TransferEvent,
9
8
  LedgerExplorerInternalTransaction,
10
9
  LedgerExplorerOperation,
11
10
  } from './../types'
11
+ import type { MemoNotSupported, Operation } from '@ledgerhq/coin-module-framework/api/types'
12
12
  import {
13
13
  ledgerERC1155EventToOperations,
14
14
  ledgerERC20EventToOperations,
@@ -1,7 +1,7 @@
1
1
  // SPDX-FileCopyrightText: © 2026 LEDGER SAS
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
- import { EvmConfig } from '../config'
4
+ import type { EvmConfig } from '../config'
5
5
  import { createMockEvmContext } from '../fixtures/context.fixtures'
6
6
  import { createApi } from './index'
7
7
 
@@ -1,7 +1,7 @@
1
1
  // SPDX-FileCopyrightText: © 2026 LEDGER SAS
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
- import { EvmConfig } from '../config'
4
+ import type { EvmConfig } from '../config'
5
5
  import { createMockEvmContext } from '../fixtures/context.fixtures'
6
6
  import { safeEncodeEIP55 } from '../utils'
7
7
  import { createApi } from './index'
@@ -1,7 +1,7 @@
1
1
  // SPDX-FileCopyrightText: © 2026 LEDGER SAS
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
- import { EvmConfig } from '../config'
4
+ import type { EvmConfig } from '../config'
5
5
  import { createMockEvmContext } from '../fixtures/context.fixtures'
6
6
  import { createApi } from './index'
7
7
 
@@ -30,19 +30,7 @@ describe('Flare (external node)', () => {
30
30
  // - test on the tip of the chain without guarantees there is actually internal txs
31
31
  // - test that the call is not failing (getBlock should not reject)
32
32
  const info = await module.lastBlock(createMockEvmContext(flareConfig))
33
- const block = await module
34
- .getBlock(createMockEvmContext(flareConfig), info.height)
35
- .catch((e: unknown) => {
36
- if (
37
- e &&
38
- typeof e === 'object' &&
39
- 'rawError' in e &&
40
- (e as { rawError?: unknown }).rawError
41
- ) {
42
- throw (e as { rawError: unknown }).rawError
43
- }
44
- throw e
45
- })
33
+ const block = await module.getBlock(createMockEvmContext(flareConfig), info.height)
46
34
  expect(block.info.height).toBe(info.height)
47
35
  })
48
36
  })