@ledgerhq/coin-evm 10.1.0 → 15.2.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 (463) hide show
  1. package/CHANGELOG.md +58 -0
  2. package/docs/getBlock-internal-txs-schema.md +2 -2
  3. package/docs/network/node/index.md +1 -1
  4. package/lib/adapters/etherscan.d.ts +2 -1
  5. package/lib/adapters/etherscan.d.ts.map +1 -1
  6. package/lib/adapters/etherscan.js +16 -2
  7. package/lib/adapters/etherscan.js.map +1 -1
  8. package/lib/adapters/ledger.d.ts +2 -1
  9. package/lib/adapters/ledger.d.ts.map +1 -1
  10. package/lib/adapters/ledger.js +4 -2
  11. package/lib/adapters/ledger.js.map +1 -1
  12. package/lib/api/index.d.ts.map +1 -1
  13. package/lib/api/index.js +1 -2
  14. package/lib/api/index.js.map +1 -1
  15. package/lib/chains.d.ts +95 -0
  16. package/lib/chains.d.ts.map +1 -0
  17. package/lib/chains.js +99 -0
  18. package/lib/chains.js.map +1 -0
  19. package/lib/config.d.ts +4 -1
  20. package/lib/config.d.ts.map +1 -1
  21. package/lib/config.js +3 -1
  22. package/lib/config.js.map +1 -1
  23. package/lib/logic/broadcast.js +2 -2
  24. package/lib/logic/broadcast.js.map +1 -1
  25. package/lib/logic/common.d.ts +1 -1
  26. package/lib/logic/common.d.ts.map +1 -1
  27. package/lib/logic/common.js +11 -11
  28. package/lib/logic/common.js.map +1 -1
  29. package/lib/logic/craftTransaction.d.ts.map +1 -1
  30. package/lib/logic/craftTransaction.js +3 -3
  31. package/lib/logic/craftTransaction.js.map +1 -1
  32. package/lib/logic/estimateFees.d.ts.map +1 -1
  33. package/lib/logic/estimateFees.js +7 -7
  34. package/lib/logic/estimateFees.js.map +1 -1
  35. package/lib/logic/getBalance.d.ts.map +1 -1
  36. package/lib/logic/getBalance.js +9 -9
  37. package/lib/logic/getBalance.js.map +1 -1
  38. package/lib/logic/getBlock.d.ts.map +1 -1
  39. package/lib/logic/getBlock.js +38 -21
  40. package/lib/logic/getBlock.js.map +1 -1
  41. package/lib/logic/getBlockInfo.js +2 -2
  42. package/lib/logic/getBlockInfo.js.map +1 -1
  43. package/lib/logic/getNextSequence.d.ts.map +1 -1
  44. package/lib/logic/getNextSequence.js +1 -1
  45. package/lib/logic/getNextSequence.js.map +1 -1
  46. package/lib/logic/getStakes.d.ts.map +1 -1
  47. package/lib/logic/getStakes.js +10 -10
  48. package/lib/logic/getStakes.js.map +1 -1
  49. package/lib/logic/internalTransactionsFetcher.d.ts +2 -2
  50. package/lib/logic/internalTransactionsFetcher.d.ts.map +1 -1
  51. package/lib/logic/internalTransactionsFetcher.js +8 -8
  52. package/lib/logic/internalTransactionsFetcher.js.map +1 -1
  53. package/lib/logic/lastBlock.js +2 -2
  54. package/lib/logic/lastBlock.js.map +1 -1
  55. package/lib/logic/listOperations.d.ts.map +1 -1
  56. package/lib/logic/listOperations.js +3 -1
  57. package/lib/logic/listOperations.js.map +1 -1
  58. package/lib/logic/validateIntent.d.ts.map +1 -1
  59. package/lib/logic/validateIntent.js +9 -9
  60. package/lib/logic/validateIntent.js.map +1 -1
  61. package/lib/logic.d.ts +1 -1
  62. package/lib/logic.d.ts.map +1 -1
  63. package/lib/logic.js +14 -13
  64. package/lib/logic.js.map +1 -1
  65. package/lib/network/explorer/etherscan.d.ts +2 -3
  66. package/lib/network/explorer/etherscan.d.ts.map +1 -1
  67. package/lib/network/explorer/etherscan.js +6 -8
  68. package/lib/network/explorer/etherscan.js.map +1 -1
  69. package/lib/network/explorer/ledger.d.ts.map +1 -1
  70. package/lib/network/explorer/ledger.js +5 -5
  71. package/lib/network/explorer/ledger.js.map +1 -1
  72. package/lib/network/explorer/types.d.ts +2 -2
  73. package/lib/network/explorer/types.d.ts.map +1 -1
  74. package/lib/network/explorer/types.js.map +1 -1
  75. package/lib/network/node/explorerProxy.d.ts.map +1 -1
  76. package/lib/network/node/explorerProxy.js +14 -12
  77. package/lib/network/node/explorerProxy.js.map +1 -1
  78. package/lib/network/node/index.d.ts +1 -1
  79. package/lib/network/node/index.d.ts.map +1 -1
  80. package/lib/network/node/index.js +7 -7
  81. package/lib/network/node/index.js.map +1 -1
  82. package/lib/network/node/ledger.d.ts +3 -1
  83. package/lib/network/node/ledger.d.ts.map +1 -1
  84. package/lib/network/node/ledger.js +32 -22
  85. package/lib/network/node/ledger.js.map +1 -1
  86. package/lib/network/node/rpc.common.d.ts +1 -1
  87. package/lib/network/node/rpc.common.d.ts.map +1 -1
  88. package/lib/network/node/rpc.common.js +67 -39
  89. package/lib/network/node/rpc.common.js.map +1 -1
  90. package/lib/network/node/types.d.ts +18 -16
  91. package/lib/network/node/types.d.ts.map +1 -1
  92. package/lib/network/node/types.js.map +1 -1
  93. package/lib/network/node/withNodeSources.d.ts.map +1 -1
  94. package/lib/network/node/withNodeSources.js +15 -15
  95. package/lib/network/node/withNodeSources.js.map +1 -1
  96. package/lib/staking/abis.d.ts +3 -2
  97. package/lib/staking/abis.d.ts.map +1 -1
  98. package/lib/staking/abis.js +10 -9
  99. package/lib/staking/abis.js.map +1 -1
  100. package/lib/staking/contracts.d.ts +3 -2
  101. package/lib/staking/contracts.d.ts.map +1 -1
  102. package/lib/staking/contracts.js +11 -10
  103. package/lib/staking/contracts.js.map +1 -1
  104. package/lib/staking/detectOperationType.d.ts +2 -1
  105. package/lib/staking/detectOperationType.d.ts.map +1 -1
  106. package/lib/staking/detectOperationType.js +7 -7
  107. package/lib/staking/detectOperationType.js.map +1 -1
  108. package/lib/staking/encoder.d.ts +2 -1
  109. package/lib/staking/encoder.d.ts.map +1 -1
  110. package/lib/staking/encoder.js +8 -8
  111. package/lib/staking/encoder.js.map +1 -1
  112. package/lib/staking/fetchers.d.ts +2 -1
  113. package/lib/staking/fetchers.d.ts.map +1 -1
  114. package/lib/staking/fetchers.js +27 -27
  115. package/lib/staking/fetchers.js.map +1 -1
  116. package/lib/staking/logic.d.ts +6 -6
  117. package/lib/staking/logic.d.ts.map +1 -1
  118. package/lib/staking/logic.js +14 -13
  119. package/lib/staking/logic.js.map +1 -1
  120. package/lib/staking/operations/index.d.ts +2 -1
  121. package/lib/staking/operations/index.d.ts.map +1 -1
  122. package/lib/staking/operations/index.js +30 -28
  123. package/lib/staking/operations/index.js.map +1 -1
  124. package/lib/staking/prepareIntents.d.ts +1 -1
  125. package/lib/staking/prepareIntents.d.ts.map +1 -1
  126. package/lib/staking/prepareIntents.js +11 -10
  127. package/lib/staking/prepareIntents.js.map +1 -1
  128. package/lib/staking/redelegations.d.ts +4 -4
  129. package/lib/staking/redelegations.d.ts.map +1 -1
  130. package/lib/staking/redelegations.js +18 -20
  131. package/lib/staking/redelegations.js.map +1 -1
  132. package/lib/staking/rewards.d.ts +1 -1
  133. package/lib/staking/rewards.d.ts.map +1 -1
  134. package/lib/staking/rewards.js +2 -2
  135. package/lib/staking/rewards.js.map +1 -1
  136. package/lib/staking/rewardsFromReceipt.d.ts +2 -1
  137. package/lib/staking/rewardsFromReceipt.d.ts.map +1 -1
  138. package/lib/staking/rewardsFromReceipt.js +2 -2
  139. package/lib/staking/rewardsFromReceipt.js.map +1 -1
  140. package/lib/staking/transactionData.d.ts +2 -1
  141. package/lib/staking/transactionData.d.ts.map +1 -1
  142. package/lib/staking/transactionData.js +6 -6
  143. package/lib/staking/transactionData.js.map +1 -1
  144. package/lib/staking/unbondings.d.ts +1 -1
  145. package/lib/staking/unbondings.d.ts.map +1 -1
  146. package/lib/staking/unbondings.js +2 -2
  147. package/lib/staking/unbondings.js.map +1 -1
  148. package/lib/staking/validators/index.d.ts +14 -14
  149. package/lib/staking/validators/index.d.ts.map +1 -1
  150. package/lib/staking/validators/index.js +39 -38
  151. package/lib/staking/validators/index.js.map +1 -1
  152. package/lib/staking/validators/monad.d.ts +5 -5
  153. package/lib/staking/validators/monad.d.ts.map +1 -1
  154. package/lib/staking/validators/monad.js +31 -33
  155. package/lib/staking/validators/monad.js.map +1 -1
  156. package/lib/staking/validators/monadResolver.d.ts +1 -1
  157. package/lib/staking/validators/monadResolver.d.ts.map +1 -1
  158. package/lib/staking/validators/monadResolver.js +4 -4
  159. package/lib/staking/validators/monadResolver.js.map +1 -1
  160. package/lib/staking/validators/sei.js +2 -2
  161. package/lib/staking/validators/sei.js.map +1 -1
  162. package/lib/staking/validators/somnia.d.ts +4 -4
  163. package/lib/staking/validators/somnia.d.ts.map +1 -1
  164. package/lib/staking/validators/somnia.js +22 -22
  165. package/lib/staking/validators/somnia.js.map +1 -1
  166. package/lib/staking/validators/types.d.ts +1 -1
  167. package/lib/staking/validators/types.d.ts.map +1 -1
  168. package/lib/staking/validators/zero_gravity.d.ts +1 -1
  169. package/lib/staking/validators/zero_gravity.d.ts.map +1 -1
  170. package/lib/staking/validators/zero_gravity.js +7 -7
  171. package/lib/staking/validators/zero_gravity.js.map +1 -1
  172. package/lib/types/staking.d.ts +5 -6
  173. package/lib/types/staking.d.ts.map +1 -1
  174. package/lib-es/adapters/etherscan.d.ts +2 -1
  175. package/lib-es/adapters/etherscan.d.ts.map +1 -1
  176. package/lib-es/adapters/etherscan.js +16 -2
  177. package/lib-es/adapters/etherscan.js.map +1 -1
  178. package/lib-es/adapters/ledger.d.ts +2 -1
  179. package/lib-es/adapters/ledger.d.ts.map +1 -1
  180. package/lib-es/adapters/ledger.js +4 -2
  181. package/lib-es/adapters/ledger.js.map +1 -1
  182. package/lib-es/api/index.d.ts.map +1 -1
  183. package/lib-es/api/index.js +1 -2
  184. package/lib-es/api/index.js.map +1 -1
  185. package/lib-es/chains.d.ts +95 -0
  186. package/lib-es/chains.d.ts.map +1 -0
  187. package/lib-es/chains.js +96 -0
  188. package/lib-es/chains.js.map +1 -0
  189. package/lib-es/config.d.ts +4 -1
  190. package/lib-es/config.d.ts.map +1 -1
  191. package/lib-es/config.js +1 -0
  192. package/lib-es/config.js.map +1 -1
  193. package/lib-es/logic/broadcast.js +2 -2
  194. package/lib-es/logic/broadcast.js.map +1 -1
  195. package/lib-es/logic/common.d.ts +1 -1
  196. package/lib-es/logic/common.d.ts.map +1 -1
  197. package/lib-es/logic/common.js +11 -11
  198. package/lib-es/logic/common.js.map +1 -1
  199. package/lib-es/logic/craftTransaction.d.ts.map +1 -1
  200. package/lib-es/logic/craftTransaction.js +3 -3
  201. package/lib-es/logic/craftTransaction.js.map +1 -1
  202. package/lib-es/logic/estimateFees.d.ts.map +1 -1
  203. package/lib-es/logic/estimateFees.js +7 -7
  204. package/lib-es/logic/estimateFees.js.map +1 -1
  205. package/lib-es/logic/getBalance.d.ts.map +1 -1
  206. package/lib-es/logic/getBalance.js +9 -9
  207. package/lib-es/logic/getBalance.js.map +1 -1
  208. package/lib-es/logic/getBlock.d.ts.map +1 -1
  209. package/lib-es/logic/getBlock.js +39 -22
  210. package/lib-es/logic/getBlock.js.map +1 -1
  211. package/lib-es/logic/getBlockInfo.js +2 -2
  212. package/lib-es/logic/getBlockInfo.js.map +1 -1
  213. package/lib-es/logic/getNextSequence.d.ts.map +1 -1
  214. package/lib-es/logic/getNextSequence.js +1 -1
  215. package/lib-es/logic/getNextSequence.js.map +1 -1
  216. package/lib-es/logic/getStakes.d.ts.map +1 -1
  217. package/lib-es/logic/getStakes.js +10 -10
  218. package/lib-es/logic/getStakes.js.map +1 -1
  219. package/lib-es/logic/internalTransactionsFetcher.d.ts +2 -2
  220. package/lib-es/logic/internalTransactionsFetcher.d.ts.map +1 -1
  221. package/lib-es/logic/internalTransactionsFetcher.js +8 -8
  222. package/lib-es/logic/internalTransactionsFetcher.js.map +1 -1
  223. package/lib-es/logic/lastBlock.js +2 -2
  224. package/lib-es/logic/lastBlock.js.map +1 -1
  225. package/lib-es/logic/listOperations.d.ts.map +1 -1
  226. package/lib-es/logic/listOperations.js +3 -1
  227. package/lib-es/logic/listOperations.js.map +1 -1
  228. package/lib-es/logic/validateIntent.d.ts.map +1 -1
  229. package/lib-es/logic/validateIntent.js +9 -9
  230. package/lib-es/logic/validateIntent.js.map +1 -1
  231. package/lib-es/logic.d.ts +1 -1
  232. package/lib-es/logic.d.ts.map +1 -1
  233. package/lib-es/logic.js +14 -13
  234. package/lib-es/logic.js.map +1 -1
  235. package/lib-es/network/explorer/etherscan.d.ts +2 -3
  236. package/lib-es/network/explorer/etherscan.d.ts.map +1 -1
  237. package/lib-es/network/explorer/etherscan.js +6 -8
  238. package/lib-es/network/explorer/etherscan.js.map +1 -1
  239. package/lib-es/network/explorer/ledger.d.ts.map +1 -1
  240. package/lib-es/network/explorer/ledger.js +5 -5
  241. package/lib-es/network/explorer/ledger.js.map +1 -1
  242. package/lib-es/network/explorer/types.d.ts +2 -2
  243. package/lib-es/network/explorer/types.d.ts.map +1 -1
  244. package/lib-es/network/explorer/types.js.map +1 -1
  245. package/lib-es/network/node/explorerProxy.d.ts.map +1 -1
  246. package/lib-es/network/node/explorerProxy.js +14 -12
  247. package/lib-es/network/node/explorerProxy.js.map +1 -1
  248. package/lib-es/network/node/index.d.ts +1 -1
  249. package/lib-es/network/node/index.d.ts.map +1 -1
  250. package/lib-es/network/node/index.js +7 -7
  251. package/lib-es/network/node/index.js.map +1 -1
  252. package/lib-es/network/node/ledger.d.ts +3 -1
  253. package/lib-es/network/node/ledger.d.ts.map +1 -1
  254. package/lib-es/network/node/ledger.js +32 -22
  255. package/lib-es/network/node/ledger.js.map +1 -1
  256. package/lib-es/network/node/rpc.common.d.ts +1 -1
  257. package/lib-es/network/node/rpc.common.d.ts.map +1 -1
  258. package/lib-es/network/node/rpc.common.js +67 -39
  259. package/lib-es/network/node/rpc.common.js.map +1 -1
  260. package/lib-es/network/node/types.d.ts +18 -16
  261. package/lib-es/network/node/types.d.ts.map +1 -1
  262. package/lib-es/network/node/types.js.map +1 -1
  263. package/lib-es/network/node/withNodeSources.d.ts.map +1 -1
  264. package/lib-es/network/node/withNodeSources.js +15 -15
  265. package/lib-es/network/node/withNodeSources.js.map +1 -1
  266. package/lib-es/staking/abis.d.ts +3 -2
  267. package/lib-es/staking/abis.d.ts.map +1 -1
  268. package/lib-es/staking/abis.js +10 -9
  269. package/lib-es/staking/abis.js.map +1 -1
  270. package/lib-es/staking/contracts.d.ts +3 -2
  271. package/lib-es/staking/contracts.d.ts.map +1 -1
  272. package/lib-es/staking/contracts.js +11 -10
  273. package/lib-es/staking/contracts.js.map +1 -1
  274. package/lib-es/staking/detectOperationType.d.ts +2 -1
  275. package/lib-es/staking/detectOperationType.d.ts.map +1 -1
  276. package/lib-es/staking/detectOperationType.js +7 -7
  277. package/lib-es/staking/detectOperationType.js.map +1 -1
  278. package/lib-es/staking/encoder.d.ts +2 -1
  279. package/lib-es/staking/encoder.d.ts.map +1 -1
  280. package/lib-es/staking/encoder.js +8 -8
  281. package/lib-es/staking/encoder.js.map +1 -1
  282. package/lib-es/staking/fetchers.d.ts +2 -1
  283. package/lib-es/staking/fetchers.d.ts.map +1 -1
  284. package/lib-es/staking/fetchers.js +27 -27
  285. package/lib-es/staking/fetchers.js.map +1 -1
  286. package/lib-es/staking/logic.d.ts +6 -6
  287. package/lib-es/staking/logic.d.ts.map +1 -1
  288. package/lib-es/staking/logic.js +14 -13
  289. package/lib-es/staking/logic.js.map +1 -1
  290. package/lib-es/staking/operations/index.d.ts +2 -1
  291. package/lib-es/staking/operations/index.d.ts.map +1 -1
  292. package/lib-es/staking/operations/index.js +30 -28
  293. package/lib-es/staking/operations/index.js.map +1 -1
  294. package/lib-es/staking/prepareIntents.d.ts +1 -1
  295. package/lib-es/staking/prepareIntents.d.ts.map +1 -1
  296. package/lib-es/staking/prepareIntents.js +11 -10
  297. package/lib-es/staking/prepareIntents.js.map +1 -1
  298. package/lib-es/staking/redelegations.d.ts +4 -4
  299. package/lib-es/staking/redelegations.d.ts.map +1 -1
  300. package/lib-es/staking/redelegations.js +18 -20
  301. package/lib-es/staking/redelegations.js.map +1 -1
  302. package/lib-es/staking/rewards.d.ts +1 -1
  303. package/lib-es/staking/rewards.d.ts.map +1 -1
  304. package/lib-es/staking/rewards.js +2 -2
  305. package/lib-es/staking/rewards.js.map +1 -1
  306. package/lib-es/staking/rewardsFromReceipt.d.ts +2 -1
  307. package/lib-es/staking/rewardsFromReceipt.d.ts.map +1 -1
  308. package/lib-es/staking/rewardsFromReceipt.js +2 -2
  309. package/lib-es/staking/rewardsFromReceipt.js.map +1 -1
  310. package/lib-es/staking/transactionData.d.ts +2 -1
  311. package/lib-es/staking/transactionData.d.ts.map +1 -1
  312. package/lib-es/staking/transactionData.js +6 -6
  313. package/lib-es/staking/transactionData.js.map +1 -1
  314. package/lib-es/staking/unbondings.d.ts +1 -1
  315. package/lib-es/staking/unbondings.d.ts.map +1 -1
  316. package/lib-es/staking/unbondings.js +2 -2
  317. package/lib-es/staking/unbondings.js.map +1 -1
  318. package/lib-es/staking/validators/index.d.ts +14 -14
  319. package/lib-es/staking/validators/index.d.ts.map +1 -1
  320. package/lib-es/staking/validators/index.js +39 -38
  321. package/lib-es/staking/validators/index.js.map +1 -1
  322. package/lib-es/staking/validators/monad.d.ts +5 -5
  323. package/lib-es/staking/validators/monad.d.ts.map +1 -1
  324. package/lib-es/staking/validators/monad.js +31 -33
  325. package/lib-es/staking/validators/monad.js.map +1 -1
  326. package/lib-es/staking/validators/monadResolver.d.ts +1 -1
  327. package/lib-es/staking/validators/monadResolver.d.ts.map +1 -1
  328. package/lib-es/staking/validators/monadResolver.js +4 -4
  329. package/lib-es/staking/validators/monadResolver.js.map +1 -1
  330. package/lib-es/staking/validators/sei.js +2 -2
  331. package/lib-es/staking/validators/sei.js.map +1 -1
  332. package/lib-es/staking/validators/somnia.d.ts +4 -4
  333. package/lib-es/staking/validators/somnia.d.ts.map +1 -1
  334. package/lib-es/staking/validators/somnia.js +22 -22
  335. package/lib-es/staking/validators/somnia.js.map +1 -1
  336. package/lib-es/staking/validators/types.d.ts +1 -1
  337. package/lib-es/staking/validators/types.d.ts.map +1 -1
  338. package/lib-es/staking/validators/zero_gravity.d.ts +1 -1
  339. package/lib-es/staking/validators/zero_gravity.d.ts.map +1 -1
  340. package/lib-es/staking/validators/zero_gravity.js +7 -7
  341. package/lib-es/staking/validators/zero_gravity.js.map +1 -1
  342. package/lib-es/types/staking.d.ts +5 -6
  343. package/lib-es/types/staking.d.ts.map +1 -1
  344. package/package.json +2 -2
  345. package/src/adapters/etherscan.test.ts +91 -43
  346. package/src/adapters/etherscan.ts +18 -2
  347. package/src/adapters/ledger.test.ts +106 -31
  348. package/src/adapters/ledger.ts +5 -2
  349. package/src/api/index.ts +1 -2
  350. package/src/api/{getBlock.integ.test.ts → tests/getBlock.integ.test.ts} +5 -4
  351. package/src/api/{index.arbitrum.integ.test.ts → tests/index.arbitrum.integ.test.ts} +3 -3
  352. package/src/api/{index.arc.integ.test.ts → tests/index.arc.integ.test.ts} +3 -3
  353. package/src/api/{index.avalanche_c_chain_fuji.integ.test.ts → tests/index.avalanche_c_chain_fuji.integ.test.ts} +3 -3
  354. package/src/api/{index.cronos.integ.test.ts → tests/index.cronos.integ.test.ts} +3 -3
  355. package/src/api/{index.flare.integ.test.ts → tests/index.flare.integ.test.ts} +3 -3
  356. package/src/api/{index.integ.test.ts → tests/index.integ.test.ts} +3 -3
  357. package/src/api/{index.linea.integ.test.ts → tests/index.linea.integ.test.ts} +3 -3
  358. package/src/api/{index.monad_testnet.integ.test.ts → tests/index.monad_testnet.integ.test.ts} +6 -6
  359. package/src/api/{index.optimism.integ.test.ts → tests/index.optimism.integ.test.ts} +3 -3
  360. package/src/api/{index.rsk.integ.test.ts → tests/index.rsk.integ.test.ts} +3 -3
  361. package/src/api/{index.shape.integ.test.ts → tests/index.shape.integ.test.ts} +3 -3
  362. package/src/api/{index.somnia.integ.test.ts → tests/index.somnia.integ.test.ts} +3 -3
  363. package/src/api/{index.test.ts → tests/index.test.ts} +4 -4
  364. package/src/api/{index.zksync.integ.test.ts → tests/index.zksync.integ.test.ts} +2 -2
  365. package/src/chains.test.ts +12 -0
  366. package/src/chains.ts +98 -0
  367. package/src/config.ts +5 -1
  368. package/src/fixtures/staking.fixtures.ts +13 -0
  369. package/src/logic/broadcast.ts +2 -2
  370. package/src/logic/common.ts +10 -11
  371. package/src/logic/craftTransaction.ts +2 -3
  372. package/src/logic/estimateFees.ts +6 -23
  373. package/src/logic/getBalance.ts +7 -13
  374. package/src/logic/getBlock.ts +59 -23
  375. package/src/logic/getBlockInfo.ts +2 -2
  376. package/src/logic/getNextSequence.ts +1 -4
  377. package/src/logic/getStakes.ts +11 -12
  378. package/src/logic/internalTransactionsFetcher.ts +6 -8
  379. package/src/logic/lastBlock.ts +2 -2
  380. package/src/logic/listOperations.ts +2 -1
  381. package/src/logic/tests/broadcast.test.ts +5 -5
  382. package/src/logic/tests/broadcastSource.test.ts +1 -4
  383. package/src/logic/tests/common.test.ts +18 -34
  384. package/src/logic/tests/craftTransaction.test.ts +14 -7
  385. package/src/logic/tests/estimateFees.test.ts +17 -8
  386. package/src/logic/tests/getBalance.test.ts +18 -34
  387. package/src/logic/tests/getBlock.test.ts +195 -80
  388. package/src/logic/tests/getBlockInfo.test.ts +2 -2
  389. package/src/logic/tests/getNextSequence.test.ts +2 -2
  390. package/src/logic/tests/getStakes.test.ts +28 -16
  391. package/src/logic/tests/internalTransactionsFetcher.test.ts +6 -6
  392. package/src/logic/tests/lastBlock.test.ts +4 -7
  393. package/src/logic/tests/listOperations.test.ts +8 -7
  394. package/src/logic/tests/validateIntent.test.ts +49 -3
  395. package/src/logic/validateIntent.ts +8 -10
  396. package/src/logic.test.ts +13 -5
  397. package/src/logic.ts +13 -13
  398. package/src/network/explorer/etherscan.ts +8 -24
  399. package/src/network/explorer/ledger.ts +2 -5
  400. package/src/network/explorer/types.ts +0 -2
  401. package/src/network/node/explorerProxy.ts +14 -12
  402. package/src/network/node/index.ts +11 -8
  403. package/src/network/node/ledger.ts +32 -34
  404. package/src/network/node/rpc.common.ts +79 -86
  405. package/src/network/node/types.ts +16 -31
  406. package/src/network/node/withNodeSources.ts +23 -26
  407. package/src/network/{explorer → tests/explorer}/etherscan.test.ts +16 -65
  408. package/src/network/{explorer → tests/explorer}/index.test.ts +8 -8
  409. package/src/network/{explorer → tests/explorer}/ledger.test.ts +34 -142
  410. package/src/network/{explorer → tests/explorer}/types.test.ts +1 -1
  411. package/src/network/{gasTracker → tests/gasTracker}/index.test.ts +3 -3
  412. package/src/network/{gasTracker → tests/gasTracker}/ledger.test.ts +4 -4
  413. package/src/network/{gasTracker → tests/gasTracker}/types.test.ts +1 -1
  414. package/src/network/{node → tests/node}/explorerProxy.test.ts +22 -24
  415. package/src/network/{node → tests/node}/gethCallTracerToTraceBlockItems.test.ts +4 -4
  416. package/src/network/tests/node/index.memoization.test.ts +70 -0
  417. package/src/network/{node → tests/node}/index.test.ts +4 -6
  418. package/src/network/{node → tests/node}/ledger.test.ts +69 -74
  419. package/src/network/{node → tests/node}/node.fixtures.ts +1 -1
  420. package/src/network/{node → tests/node}/rpc.errors.test.ts +1 -1
  421. package/src/network/{node → tests/node}/rpc.test.ts +100 -119
  422. package/src/network/{node → tests/node}/types.test.ts +1 -1
  423. package/src/network/{node → tests/node}/withNodeSources.test.ts +10 -12
  424. package/src/network/{withRetries.test.ts → tests/withRetries.test.ts} +2 -2
  425. package/src/staking/abis.test.ts +24 -28
  426. package/src/staking/abis.ts +12 -10
  427. package/src/staking/contracts.test.ts +20 -8
  428. package/src/staking/contracts.ts +12 -11
  429. package/src/staking/detectOperationType.test.ts +16 -13
  430. package/src/staking/detectOperationType.ts +9 -8
  431. package/src/staking/encoder.test.ts +38 -27
  432. package/src/staking/encoder.ts +9 -8
  433. package/src/staking/fetchers.ts +28 -39
  434. package/src/staking/logic.test.ts +34 -32
  435. package/src/staking/logic.ts +14 -14
  436. package/src/staking/operations/index.test.ts +48 -39
  437. package/src/staking/operations/index.ts +31 -28
  438. package/src/staking/prepareIntents.test.ts +14 -34
  439. package/src/staking/prepareIntents.ts +10 -13
  440. package/src/staking/redelegations.test.ts +73 -131
  441. package/src/staking/redelegations.ts +12 -26
  442. package/src/staking/rewards.test.ts +19 -21
  443. package/src/staking/rewards.ts +1 -2
  444. package/src/staking/rewardsFromReceipt.test.ts +9 -8
  445. package/src/staking/rewardsFromReceipt.ts +3 -2
  446. package/src/staking/transactionData.test.ts +35 -25
  447. package/src/staking/transactionData.ts +7 -6
  448. package/src/staking/unbondings.test.ts +26 -20
  449. package/src/staking/unbondings.ts +1 -2
  450. package/src/staking/validators/index.ts +45 -51
  451. package/src/staking/validators/monad.test.ts +52 -54
  452. package/src/staking/validators/monad.ts +31 -37
  453. package/src/staking/validators/monadResolver.ts +2 -4
  454. package/src/staking/validators/sei.ts +2 -2
  455. package/src/staking/validators/somnia.test.ts +22 -19
  456. package/src/staking/validators/somnia.ts +20 -27
  457. package/src/staking/validators/types.ts +0 -1
  458. package/src/staking/validators/zero_gravity.test.ts +34 -49
  459. package/src/staking/validators/zero_gravity.ts +5 -11
  460. package/src/staking/validators.integ.test.ts +3 -5
  461. package/src/staking/validators.test.ts +56 -53
  462. package/src/types/staking.ts +3 -6
  463. package/src/network/node/index.memoization.test.ts +0 -63
@@ -9,6 +9,7 @@ import type {
9
9
  LedgerExplorerOperation,
10
10
  } from './../types'
11
11
  import type { MemoNotSupported, Operation } from '@ledgerhq/coin-module-framework/api/types'
12
+ import { CHAIN_ID } from '../config'
12
13
  import { testLogger } from '../fixtures/context.fixtures'
13
14
  import {
14
15
  ledgerERC1155EventToOperations,
@@ -19,7 +20,6 @@ import {
19
20
  } from './ledger'
20
21
 
21
22
  const address = '0x6cbcd73cd8e8a42844662f0a0e76d7f79afd933d'
22
- const currencyId = 'ethereum'
23
23
 
24
24
  const coinOperation: Operation<MemoNotSupported> = {
25
25
  id: '0x6cbcd73cd8e8a42844662f0a0e76d7f79afd933d-0xf350d4f8e910419e2d5cec294d44e69af8c6185b7089061d33bb4fc246cefb79-FEES',
@@ -39,7 +39,7 @@ const coinOperation: Operation<MemoNotSupported> = {
39
39
  date: new Date('2023-01-24T17:11:45Z'),
40
40
  failed: false,
41
41
  },
42
- details: { sequence: 75 },
42
+ details: { sequence: 75, gasPrice: '81876963401', gasLimit: '62350' },
43
43
  }
44
44
 
45
45
  describe('EVM Family', () => {
@@ -106,11 +106,16 @@ describe('EVM Family', () => {
106
106
  failed: false,
107
107
  feesPayer: '0x6cBCD73CD8e8a42844662f0A0e76D7F79Afd933d',
108
108
  },
109
- details: { sequence: 75 },
109
+ details: { sequence: 75, gasPrice: '81876963401', gasLimit: '62350' },
110
110
  }
111
111
 
112
112
  expect(
113
- ledgerOperationToOperations(unrelatedAddress, 'ethereum', ledgerExplorerOp, testLogger)
113
+ ledgerOperationToOperations(
114
+ unrelatedAddress,
115
+ CHAIN_ID.ETHEREUM,
116
+ ledgerExplorerOp,
117
+ testLogger
118
+ )
114
119
  ).toEqual([expectedOperation])
115
120
  })
116
121
 
@@ -171,11 +176,11 @@ describe('EVM Family', () => {
171
176
  failed: false,
172
177
  feesPayer: '0x6cBCD73CD8e8a42844662f0A0e76D7F79Afd933d',
173
178
  },
174
- details: { sequence: 75 },
179
+ details: { sequence: 75, gasPrice: '81876963401', gasLimit: '62350' },
175
180
  }
176
181
 
177
182
  expect(
178
- ledgerOperationToOperations(address, currencyId, ledgerOperation, testLogger)
183
+ ledgerOperationToOperations(address, CHAIN_ID.ETHEREUM, ledgerOperation, testLogger)
179
184
  ).toEqual([expectedOperation])
180
185
  })
181
186
 
@@ -236,14 +241,62 @@ describe('EVM Family', () => {
236
241
  failed: false,
237
242
  feesPayer: '0x6cBCD73CD8e8a42844662f0A0e76D7F79Afd933d',
238
243
  },
239
- details: { sequence: 75 },
244
+ details: { sequence: 75, gasPrice: '81876963401', gasLimit: '62350' },
240
245
  }
241
246
 
242
247
  expect(
243
- ledgerOperationToOperations(address, currencyId, ledgerOperation, testLogger)
248
+ ledgerOperationToOperations(address, CHAIN_ID.ETHEREUM, ledgerOperation, testLogger)
244
249
  ).toEqual([expectedOperation])
245
250
  })
246
251
 
252
+ it('should omit empty gas price and gas limit from details', () => {
253
+ const ledgerOperation: LedgerExplorerOperation = {
254
+ hash: '0xf350d4f8e910419e2d5cec294d44e69af8c6185b7089061d33bb4fc246cefb79',
255
+ transaction_type: 2,
256
+ nonce: '0x4b',
257
+ nonce_value: 75,
258
+ value: '1',
259
+ gas: '',
260
+ gas_price: '',
261
+ max_fee_per_gas: '125263305914',
262
+ max_priority_fee_per_gas: '33000000000',
263
+ from: '0x6cbcd73cd8e8a42844662f0a0e76d7f79afd933d',
264
+ to: '0x7ceb23fd6bc0add59e62ac25578270cff1b9f619',
265
+ transfer_events: [
266
+ {
267
+ contract: '0x7ceb23fd6bc0add59e62ac25578270cff1b9f619',
268
+ from: '0x6cbcd73cd8e8a42844662f0a0e76d7f79afd933d',
269
+ to: '0xc2907efcce4011c491bbeda8a0fa63ba7aab596c',
270
+ count: '100000000000000',
271
+ },
272
+ ],
273
+ erc721_transfer_events: [],
274
+ erc1155_transfer_events: [],
275
+ approval_events: [],
276
+ actions: [],
277
+ confirmations: 5968364,
278
+ input: null,
279
+ gas_used: '51958',
280
+ cumulative_gas_used: '16087064',
281
+ status: 1,
282
+ received_at: '2023-01-24T17:11:45Z',
283
+ block: {
284
+ hash: '0xcbd52de09904fd89a94b0638a8e39107e247d761e92411fd5b7b7d8b88641ddd',
285
+ height: 38476740,
286
+ time: '2023-01-24T17:11:45Z',
287
+ },
288
+ }
289
+
290
+ const [operation] = ledgerOperationToOperations(
291
+ address,
292
+ CHAIN_ID.ETHEREUM,
293
+ ledgerOperation,
294
+ testLogger
295
+ )
296
+
297
+ expect(operation.details).toEqual({ sequence: 75 })
298
+ })
299
+
247
300
  it('should convert ledger explorer coin in operation to an Operation', () => {
248
301
  const ledgerOperation: LedgerExplorerOperation = {
249
302
  hash: '0xf350d4f8e910419e2d5cec294d44e69af8c6185b7089061d33bb4fc246cefb79',
@@ -301,11 +354,11 @@ describe('EVM Family', () => {
301
354
  failed: false,
302
355
  feesPayer: '0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619',
303
356
  },
304
- details: { sequence: 75 },
357
+ details: { sequence: 75, gasPrice: '81876963401', gasLimit: '62350' },
305
358
  }
306
359
 
307
360
  expect(
308
- ledgerOperationToOperations(address, currencyId, ledgerOperation, testLogger)
361
+ ledgerOperationToOperations(address, CHAIN_ID.ETHEREUM, ledgerOperation, testLogger)
309
362
  ).toEqual([expectedOperation])
310
363
  })
311
364
 
@@ -366,11 +419,11 @@ describe('EVM Family', () => {
366
419
  failed: false,
367
420
  feesPayer: '0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619',
368
421
  },
369
- details: { sequence: 75 },
422
+ details: { sequence: 75, gasPrice: '81876963401', gasLimit: '62350' },
370
423
  }
371
424
 
372
425
  expect(
373
- ledgerOperationToOperations(address, currencyId, ledgerOperation, testLogger)
426
+ ledgerOperationToOperations(address, CHAIN_ID.ETHEREUM, ledgerOperation, testLogger)
374
427
  ).toEqual([expectedOperation])
375
428
  })
376
429
 
@@ -436,11 +489,11 @@ describe('EVM Family', () => {
436
489
  failed: false,
437
490
  feesPayer: '0x787aCF62fFC81Bb171d1f46fB8b3Fc6503D503e8',
438
491
  },
439
- details: { sequence: 3 },
492
+ details: { sequence: 3, gasPrice: '42392511388', gasLimit: '21356033' },
440
493
  }
441
494
 
442
495
  expect(
443
- ledgerOperationToOperations(address, currencyId, ledgerOperation, testLogger)
496
+ ledgerOperationToOperations(address, CHAIN_ID.ETHEREUM, ledgerOperation, testLogger)
444
497
  ).toEqual([expectedOperation])
445
498
  })
446
499
 
@@ -503,7 +556,7 @@ describe('EVM Family', () => {
503
556
  value: 1n,
504
557
  asset: { type: 'native' },
505
558
  tx: selfSendTx,
506
- details: { sequence: 75 },
559
+ details: { sequence: 75, gasPrice: '81876963401', gasLimit: '62350' },
507
560
  }
508
561
  const expectedOperation2 = {
509
562
  id: '0x6cbcd73cd8e8a42844662f0a0e76d7f79afd933d-0xf350d4f8e910419e2d5cec294d44e69af8c6185b7089061d33bb4fc246cefb79-OUT',
@@ -513,11 +566,11 @@ describe('EVM Family', () => {
513
566
  value: 1n,
514
567
  asset: { type: 'native' },
515
568
  tx: selfSendTx,
516
- details: { sequence: 75 },
569
+ details: { sequence: 75, gasPrice: '81876963401', gasLimit: '62350' },
517
570
  }
518
571
 
519
572
  expect(
520
- ledgerOperationToOperations(address, currencyId, ledgerOperation, testLogger)
573
+ ledgerOperationToOperations(address, CHAIN_ID.ETHEREUM, ledgerOperation, testLogger)
521
574
  ).toEqual([expectedOperation1, expectedOperation2])
522
575
  })
523
576
 
@@ -566,7 +619,7 @@ describe('EVM Family', () => {
566
619
  expect(
567
620
  ledgerOperationToOperations(
568
621
  unrelatedAddress,
569
- 'ethereum',
622
+ CHAIN_ID.ETHEREUM,
570
623
  ledgerExplorerNoneOp,
571
624
  testLogger
572
625
  )[0].value
@@ -575,7 +628,7 @@ describe('EVM Family', () => {
575
628
  expect(
576
629
  ledgerOperationToOperations(
577
630
  unrelatedAddress,
578
- 'ethereum',
631
+ CHAIN_ID.ETHEREUM,
579
632
  {
580
633
  ...ledgerExplorerNoneOp,
581
634
  status: 0,
@@ -624,14 +677,18 @@ describe('EVM Family', () => {
624
677
 
625
678
  // Successful Op (value = transferred only; fee is separate; Ledger Wallet adds fee in bridge)
626
679
  expect(
627
- ledgerOperationToOperations(address, currencyId, ledgerExplorerFeesOp, testLogger)[0]
628
- .value
680
+ ledgerOperationToOperations(
681
+ address,
682
+ CHAIN_ID.ETHEREUM,
683
+ ledgerExplorerFeesOp,
684
+ testLogger
685
+ )[0].value
629
686
  ).toEqual(BigInt(ledgerExplorerFeesOp.value))
630
687
  // Failing Op (value = tx value, same as success)
631
688
  expect(
632
689
  ledgerOperationToOperations(
633
690
  address,
634
- currencyId,
691
+ CHAIN_ID.ETHEREUM,
635
692
  {
636
693
  ...ledgerExplorerFeesOp,
637
694
  status: 0,
@@ -679,14 +736,18 @@ describe('EVM Family', () => {
679
736
 
680
737
  // Successful Op (value = transferred only; fee is separate; Ledger Wallet adds fee in bridge)
681
738
  expect(
682
- ledgerOperationToOperations(address, currencyId, ledgerOperationOut, testLogger)[0]
683
- .value
739
+ ledgerOperationToOperations(
740
+ address,
741
+ CHAIN_ID.ETHEREUM,
742
+ ledgerOperationOut,
743
+ testLogger
744
+ )[0].value
684
745
  ).toEqual(BigInt(ledgerOperationOut.value))
685
746
  // Failing Op (value = tx value, same as success)
686
747
  expect(
687
748
  ledgerOperationToOperations(
688
749
  address,
689
- currencyId,
750
+ CHAIN_ID.ETHEREUM,
690
751
  {
691
752
  ...ledgerOperationOut,
692
753
  status: 0,
@@ -734,13 +795,18 @@ describe('EVM Family', () => {
734
795
 
735
796
  // Successful Op
736
797
  expect(
737
- ledgerOperationToOperations(address, currencyId, ledgerOperationIn, testLogger)[0].value
798
+ ledgerOperationToOperations(
799
+ address,
800
+ CHAIN_ID.ETHEREUM,
801
+ ledgerOperationIn,
802
+ testLogger
803
+ )[0].value
738
804
  ).toEqual(BigInt(ledgerOperationOut.value))
739
805
  // Failing Op
740
806
  expect(
741
807
  ledgerOperationToOperations(
742
808
  address,
743
- currencyId,
809
+ CHAIN_ID.ETHEREUM,
744
810
  { ...ledgerOperationIn, status: 0 },
745
811
  testLogger
746
812
  )[0].value
@@ -778,7 +844,12 @@ describe('EVM Family', () => {
778
844
  },
779
845
  }
780
846
 
781
- const result = ledgerOperationToOperations(address, currencyId, ledgerOp, testLogger)
847
+ const result = ledgerOperationToOperations(
848
+ address,
849
+ CHAIN_ID.ETHEREUM,
850
+ ledgerOp,
851
+ testLogger
852
+ )
782
853
 
783
854
  expect(result).toHaveLength(1)
784
855
  expect(result[0].recipients).toEqual([])
@@ -815,7 +886,12 @@ describe('EVM Family', () => {
815
886
  },
816
887
  }
817
888
 
818
- const result = ledgerOperationToOperations(address, currencyId, ledgerOp, testLogger)
889
+ const result = ledgerOperationToOperations(
890
+ address,
891
+ CHAIN_ID.ETHEREUM,
892
+ ledgerOp,
893
+ testLogger
894
+ )
819
895
 
820
896
  expect(result).toHaveLength(1)
821
897
  expect(result[0].senders).toEqual([])
@@ -823,7 +899,6 @@ describe('EVM Family', () => {
823
899
 
824
900
  it('should detect a Monad staking withdraw (value 0 contract call) as a WITHDRAW_UNBONDED operation instead of FEES', () => {
825
901
  const monadAddress = '0x6cbcd73cd8e8a42844662f0a0e76d7f79afd933d'
826
- const monadCurrencyId = 'monad'
827
902
 
828
903
  const ledgerOp: LedgerExplorerOperation = {
829
904
  hash: '0xf350d4f8e910419e2d5cec294d44e69af8c6185b7089061d33bb4fc246cefb79',
@@ -862,7 +937,7 @@ describe('EVM Family', () => {
862
937
 
863
938
  const result = ledgerOperationToOperations(
864
939
  monadAddress,
865
- monadCurrencyId,
940
+ CHAIN_ID.MONAD,
866
941
  ledgerOp,
867
942
  testLogger
868
943
  )
@@ -1,6 +1,7 @@
1
1
  // SPDX-FileCopyrightText: © 2026 LEDGER SAS
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
+ import type { ChainId } from '../config'
4
5
  import type {
5
6
  LedgerExplorerERC20TransferEvent,
6
7
  LedgerExplorerER1155TransferEvent,
@@ -20,7 +21,7 @@ import { detectEvmStakingOperationType } from '../staking/detectOperationType'
20
21
  */
21
22
  export const ledgerOperationToOperations = (
22
23
  address: string,
23
- currencyId: string,
24
+ chainId: ChainId,
24
25
  ledgerOp: LedgerExplorerOperation,
25
26
  logger: Logger
26
27
  ): Array<Operation<MemoNotSupported>> => {
@@ -41,7 +42,7 @@ export const ledgerOperationToOperations = (
41
42
  if (from === checksummedAddress) {
42
43
  // Recognize staking calls (delegate/undelegate/withdraw/reward) so they are not
43
44
  // collapsed into a generic FEES/OUT operation, mirroring the etherscan adapter.
44
- const stakingType = detectEvmStakingOperationType(currencyId, to, methodId)
45
+ const stakingType = detectEvmStakingOperationType(chainId, to, methodId)
45
46
  types.push(stakingType ?? (safeBigInt(ledgerOp.value) === 0n ? 'FEES' : 'OUT'))
46
47
  }
47
48
  if (!types.length) {
@@ -72,6 +73,8 @@ export const ledgerOperationToOperations = (
72
73
  },
73
74
  details: {
74
75
  sequence: ledgerOp.nonce_value,
76
+ ...(ledgerOp.gas_price ? { gasPrice: ledgerOp.gas_price } : {}),
77
+ ...(ledgerOp.gas ? { gasLimit: ledgerOp.gas } : {}),
75
78
  },
76
79
  }))
77
80
  }
package/src/api/index.ts CHANGED
@@ -45,7 +45,6 @@ import { getValidatorsPage } from '../staking/validators'
45
45
 
46
46
  // NOTE Celo still relies on the EVM coin config and injects its own
47
47
  // while creating an unused instance of API
48
- // TODO Change to Record<string, EvmConfig> once Celo bridge is removed
49
48
 
50
49
  // The framework contract passes opaque params (object or array); EVM only accepts the object
51
50
  // form { to, data, block? }, and parseCallParams rejects arrays defensively at runtime. `call`
@@ -77,7 +76,7 @@ export function createApi(currencyId: string) {
77
76
  call: async (context: EvmContext, params: CallParams): Promise<string> => {
78
77
  const config = await context.config(currencyId)
79
78
  const callParams = parseCallParams(params)
80
- return getNodeApi(config, currencyId, context.logger).call(currencyId, callParams)
79
+ return getNodeApi(config, context.logger).call(callParams)
81
80
  },
82
81
  combine: (
83
82
  _context: EvmContext,
@@ -1,9 +1,10 @@
1
1
  // SPDX-FileCopyrightText: © 2026 LEDGER SAS
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
- import type { EvmConfigInfo } from '../config'
5
- import { createMockEvmContext } from '../fixtures/context.fixtures'
6
- import { createApi } from './index'
4
+ import type { EvmConfigInfo } from '../../config'
5
+ import { CHAIN_ID } from '../../config'
6
+ import { createMockEvmContext } from '../../fixtures/context.fixtures'
7
+ import { createApi } from '../index'
7
8
 
8
9
  /**
9
10
  * Integration tests for getBlock API method with ERC20 transfers
@@ -27,7 +28,7 @@ describe('getBlock ERC20 transfers', () => {
27
28
 
28
29
  const velasEvmConfig: EvmConfigInfo = {
29
30
  status: { type: 'active' },
30
- chainId: 111,
31
+ chainId: CHAIN_ID.VELAS_EVM,
31
32
  name: 'Velas EVM',
32
33
  unit: { name: 'VLX', code: 'VLX', magnitude: 18 },
33
34
  node: {
@@ -1,9 +1,9 @@
1
1
  // SPDX-FileCopyrightText: © 2026 LEDGER SAS
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
- import type { EvmConfigInfo } from '../config'
5
- import { createMockEvmContext } from '../fixtures/context.fixtures'
6
- import { createApi } from './index'
4
+ import type { EvmConfigInfo } from '../../config'
5
+ import { createMockEvmContext } from '../../fixtures/context.fixtures'
6
+ import { createApi } from '../index'
7
7
 
8
8
  describe('EVM Arbitrum Network', () => {
9
9
  let module: ReturnType<typeof createApi>
@@ -1,10 +1,10 @@
1
1
  // SPDX-FileCopyrightText: © 2026 LEDGER SAS
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
- import type { EvmConfigInfo } from '../config'
4
+ import type { EvmConfigInfo } from '../../config'
5
5
  import type { Operation } from '@ledgerhq/coin-module-framework/api/types'
6
- import { createMockEvmContext } from '../fixtures/context.fixtures'
7
- import { createApi } from './index'
6
+ import { createMockEvmContext } from '../../fixtures/context.fixtures'
7
+ import { createApi } from '../index'
8
8
 
9
9
  // Arc exposes its native unit (USDC) as an ERC20 at this fixed precompile
10
10
  // address. The explorer indexes native transfers as BOTH a native tx AND a synthetic
@@ -1,9 +1,9 @@
1
1
  // SPDX-FileCopyrightText: © 2026 LEDGER SAS
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
- import type { EvmConfigInfo } from '../config'
5
- import { createMockEvmContext } from '../fixtures/context.fixtures'
6
- import { createApi } from './index'
4
+ import type { EvmConfigInfo } from '../../config'
5
+ import { createMockEvmContext } from '../../fixtures/context.fixtures'
6
+ import { createApi } from '../index'
7
7
 
8
8
  describe('EVM Avalanche C-Chain Fuji', () => {
9
9
  let module: ReturnType<typeof createApi>
@@ -1,9 +1,9 @@
1
1
  // SPDX-FileCopyrightText: © 2026 LEDGER SAS
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
- import type { EvmConfigInfo } from '../config'
5
- import { createMockEvmContext } from '../fixtures/context.fixtures'
6
- import { createApi } from './index'
4
+ import type { EvmConfigInfo } from '../../config'
5
+ import { createMockEvmContext } from '../../fixtures/context.fixtures'
6
+ import { createApi } from '../index'
7
7
 
8
8
  describe('EVM Cronos Network (blockscout explorer)', () => {
9
9
  let module: ReturnType<typeof createApi>
@@ -1,9 +1,9 @@
1
1
  // SPDX-FileCopyrightText: © 2026 LEDGER SAS
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
- import type { EvmConfigInfo } from '../config'
5
- import { createMockEvmContext } from '../fixtures/context.fixtures'
6
- import { createApi } from './index'
4
+ import type { EvmConfigInfo } from '../../config'
5
+ import { createMockEvmContext } from '../../fixtures/context.fixtures'
6
+ import { createApi } from '../index'
7
7
 
8
8
  describe('Flare (external node)', () => {
9
9
  describe('getBlock', () => {
@@ -12,9 +12,9 @@ import {
12
12
  mkExternalNode,
13
13
  mkLedgerExplorer,
14
14
  mkLedgerNode,
15
- } from '../fixtures/context.fixtures'
16
- import { isNative } from '../types/assets'
17
- import { createApi } from './index'
15
+ } from '../../fixtures/context.fixtures'
16
+ import { isNative } from '../../types/assets'
17
+ import { createApi } from '../index'
18
18
 
19
19
  describe.each([
20
20
  [
@@ -1,9 +1,9 @@
1
1
  // SPDX-FileCopyrightText: © 2026 LEDGER SAS
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
- import type { EvmConfigInfo } from '../config'
5
- import { createMockEvmContext } from '../fixtures/context.fixtures'
6
- import { createApi } from './index'
4
+ import type { EvmConfigInfo } from '../../config'
5
+ import { createMockEvmContext } from '../../fixtures/context.fixtures'
6
+ import { createApi } from '../index'
7
7
 
8
8
  /**
9
9
  * Integration tests for getBlock with internal transactions (etherscan/blockscout).
@@ -5,10 +5,10 @@ import {
5
5
  createMockEvmConfigInfo,
6
6
  createMockEvmContext,
7
7
  testLogger,
8
- } from '../fixtures/context.fixtures'
9
- import { getNodeApi } from '../network/node'
10
- import { nodeSourcesFromList } from '../nodeSources'
11
- import { createApi } from './index'
8
+ } from '../../fixtures/context.fixtures'
9
+ import { getNodeApi } from '../../network/node'
10
+ import { nodeSourcesFromList } from '../../nodeSources'
11
+ import { createApi } from '../index'
12
12
 
13
13
  describe('EVM Api (Monad Testnet)', () => {
14
14
  let module: ReturnType<typeof createApi>
@@ -128,8 +128,8 @@ describe('EVM Api (Monad Testnet)', () => {
128
128
  expect(items.length).toBeGreaterThan(0)
129
129
  const txHash = items[0].tx.hash
130
130
 
131
- const api = getNodeApi(config, 'monad_testnet', testLogger)
132
- const txInfo = await api.getTransaction('monad_testnet', txHash)
131
+ const api = getNodeApi(config, testLogger)
132
+ const txInfo = await api.getTransaction(txHash)
133
133
 
134
134
  expect(txInfo.hash).toBe(txHash)
135
135
  expect(txInfo.from).toMatch(/^0x[A-Fa-f0-9]{40}$/i)
@@ -1,10 +1,10 @@
1
1
  // SPDX-FileCopyrightText: © 2026 LEDGER SAS
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
- import type { EvmConfigInfo } from '../config'
4
+ import type { EvmConfigInfo } from '../../config'
5
5
  import type { Operation } from '@ledgerhq/coin-module-framework/api/types'
6
- import { createMockEvmContext } from '../fixtures/context.fixtures'
7
- import { createApi } from './index'
6
+ import { createMockEvmContext } from '../../fixtures/context.fixtures'
7
+ import { createApi } from '../index'
8
8
 
9
9
  describe('EVM Optimism Network', () => {
10
10
  let module: ReturnType<typeof createApi>
@@ -1,9 +1,9 @@
1
1
  // SPDX-FileCopyrightText: © 2026 LEDGER SAS
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
- import type { EvmConfigInfo } from '../config'
5
- import { createMockEvmContext } from '../fixtures/context.fixtures'
6
- import { createApi } from './index'
4
+ import type { EvmConfigInfo } from '../../config'
5
+ import { createMockEvmContext } from '../../fixtures/context.fixtures'
6
+ import { createApi } from '../index'
7
7
 
8
8
  describe('EVM RSK Network', () => {
9
9
  let module: ReturnType<typeof createApi>
@@ -1,10 +1,10 @@
1
1
  // SPDX-FileCopyrightText: © 2026 LEDGER SAS
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
- import type { EvmConfigInfo } from '../config'
4
+ import type { EvmConfigInfo } from '../../config'
5
5
  import { fail } from 'assert'
6
- import { createMockEvmContext } from '../fixtures/context.fixtures'
7
- import { createApi } from './index'
6
+ import { createMockEvmContext } from '../../fixtures/context.fixtures'
7
+ import { createApi } from '../index'
8
8
 
9
9
  describe('Shape (external node)', () => {
10
10
  describe('getBlock', () => {
@@ -1,9 +1,9 @@
1
1
  // SPDX-FileCopyrightText: © 2026 LEDGER SAS
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
- import type { EvmConfigInfo } from '../config'
5
- import { createMockEvmContext } from '../fixtures/context.fixtures'
6
- import { createApi } from './index'
4
+ import type { EvmConfigInfo } from '../../config'
5
+ import { createMockEvmContext } from '../../fixtures/context.fixtures'
6
+ import { createApi } from '../index'
7
7
 
8
8
  describe('EVM Api (Somnia)', () => {
9
9
  let module: ReturnType<typeof createApi>
@@ -1,11 +1,11 @@
1
1
  // SPDX-FileCopyrightText: © 2026 LEDGER SAS
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
- import { mockEvmContext } from '../fixtures/context.fixtures'
5
- import { getValidatorsPage } from '../staking/validators'
6
- import { createApi, parseCallParams } from './index'
4
+ import { mockEvmContext } from '../../fixtures/context.fixtures'
5
+ import { getValidatorsPage } from '../../staking/validators'
6
+ import { createApi, parseCallParams } from '../index'
7
7
 
8
- jest.mock('../staking/validators', () => ({
8
+ jest.mock('../../staking/validators', () => ({
9
9
  getValidatorsPage: jest.fn(),
10
10
  }))
11
11
 
@@ -1,8 +1,8 @@
1
1
  // SPDX-FileCopyrightText: © 2026 LEDGER SAS
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
- import { createMockEvmContext, mkExternalNode } from '../fixtures/context.fixtures'
5
- import { createApi } from './index'
4
+ import { createMockEvmContext, mkExternalNode } from '../../fixtures/context.fixtures'
5
+ import { createApi } from '../index'
6
6
 
7
7
  /**
8
8
  * Non regression for GET /v1/zksync/account/{address}/operations?minHeight=0&order=asc&limit=1,
@@ -0,0 +1,12 @@
1
+ // SPDX-FileCopyrightText: © 2026 LEDGER SAS
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ import { CHAIN_ID } from './chains'
5
+
6
+ describe('CHAIN_ID', () => {
7
+ it('has no duplicate chain id', () => {
8
+ const values = Object.values(CHAIN_ID)
9
+
10
+ expect(new Set(values).size).toBe(values.length)
11
+ })
12
+ })