@ledgerhq/coin-evm 10.1.0 → 15.0.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 (436) hide show
  1. package/CHANGELOG.md +42 -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 +2 -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 +2 -2
  11. package/lib/adapters/ledger.js.map +1 -1
  12. package/lib/api/index.js +1 -1
  13. package/lib/api/index.js.map +1 -1
  14. package/lib/chains.d.ts +94 -0
  15. package/lib/chains.d.ts.map +1 -0
  16. package/lib/chains.js +98 -0
  17. package/lib/chains.js.map +1 -0
  18. package/lib/config.d.ts +4 -1
  19. package/lib/config.d.ts.map +1 -1
  20. package/lib/config.js +3 -1
  21. package/lib/config.js.map +1 -1
  22. package/lib/logic/broadcast.js +2 -2
  23. package/lib/logic/broadcast.js.map +1 -1
  24. package/lib/logic/common.d.ts +1 -1
  25. package/lib/logic/common.d.ts.map +1 -1
  26. package/lib/logic/common.js +11 -11
  27. package/lib/logic/common.js.map +1 -1
  28. package/lib/logic/craftTransaction.d.ts.map +1 -1
  29. package/lib/logic/craftTransaction.js +3 -3
  30. package/lib/logic/craftTransaction.js.map +1 -1
  31. package/lib/logic/estimateFees.d.ts.map +1 -1
  32. package/lib/logic/estimateFees.js +7 -7
  33. package/lib/logic/estimateFees.js.map +1 -1
  34. package/lib/logic/getBalance.d.ts.map +1 -1
  35. package/lib/logic/getBalance.js +9 -9
  36. package/lib/logic/getBalance.js.map +1 -1
  37. package/lib/logic/getBlock.d.ts.map +1 -1
  38. package/lib/logic/getBlock.js +17 -17
  39. package/lib/logic/getBlock.js.map +1 -1
  40. package/lib/logic/getBlockInfo.js +2 -2
  41. package/lib/logic/getBlockInfo.js.map +1 -1
  42. package/lib/logic/getNextSequence.d.ts.map +1 -1
  43. package/lib/logic/getNextSequence.js +1 -1
  44. package/lib/logic/getNextSequence.js.map +1 -1
  45. package/lib/logic/getStakes.d.ts.map +1 -1
  46. package/lib/logic/getStakes.js +10 -10
  47. package/lib/logic/getStakes.js.map +1 -1
  48. package/lib/logic/internalTransactionsFetcher.d.ts +2 -2
  49. package/lib/logic/internalTransactionsFetcher.d.ts.map +1 -1
  50. package/lib/logic/internalTransactionsFetcher.js +8 -8
  51. package/lib/logic/internalTransactionsFetcher.js.map +1 -1
  52. package/lib/logic/lastBlock.js +2 -2
  53. package/lib/logic/lastBlock.js.map +1 -1
  54. package/lib/logic/listOperations.d.ts.map +1 -1
  55. package/lib/logic/listOperations.js +1 -1
  56. package/lib/logic/listOperations.js.map +1 -1
  57. package/lib/logic/validateIntent.d.ts.map +1 -1
  58. package/lib/logic/validateIntent.js +9 -9
  59. package/lib/logic/validateIntent.js.map +1 -1
  60. package/lib/logic.d.ts +1 -1
  61. package/lib/logic.d.ts.map +1 -1
  62. package/lib/logic.js +14 -13
  63. package/lib/logic.js.map +1 -1
  64. package/lib/network/explorer/etherscan.d.ts +2 -3
  65. package/lib/network/explorer/etherscan.d.ts.map +1 -1
  66. package/lib/network/explorer/etherscan.js +6 -8
  67. package/lib/network/explorer/etherscan.js.map +1 -1
  68. package/lib/network/explorer/ledger.d.ts.map +1 -1
  69. package/lib/network/explorer/ledger.js +5 -5
  70. package/lib/network/explorer/ledger.js.map +1 -1
  71. package/lib/network/explorer/types.d.ts +2 -2
  72. package/lib/network/explorer/types.d.ts.map +1 -1
  73. package/lib/network/explorer/types.js.map +1 -1
  74. package/lib/network/node/explorerProxy.js +12 -12
  75. package/lib/network/node/explorerProxy.js.map +1 -1
  76. package/lib/network/node/index.d.ts +1 -1
  77. package/lib/network/node/index.d.ts.map +1 -1
  78. package/lib/network/node/index.js +7 -7
  79. package/lib/network/node/index.js.map +1 -1
  80. package/lib/network/node/ledger.d.ts +3 -1
  81. package/lib/network/node/ledger.d.ts.map +1 -1
  82. package/lib/network/node/ledger.js +31 -22
  83. package/lib/network/node/ledger.js.map +1 -1
  84. package/lib/network/node/rpc.common.d.ts +1 -1
  85. package/lib/network/node/rpc.common.d.ts.map +1 -1
  86. package/lib/network/node/rpc.common.js +50 -39
  87. package/lib/network/node/rpc.common.js.map +1 -1
  88. package/lib/network/node/types.d.ts +15 -15
  89. package/lib/network/node/types.d.ts.map +1 -1
  90. package/lib/network/node/types.js.map +1 -1
  91. package/lib/network/node/withNodeSources.d.ts.map +1 -1
  92. package/lib/network/node/withNodeSources.js +15 -15
  93. package/lib/network/node/withNodeSources.js.map +1 -1
  94. package/lib/staking/abis.d.ts +3 -2
  95. package/lib/staking/abis.d.ts.map +1 -1
  96. package/lib/staking/abis.js +10 -9
  97. package/lib/staking/abis.js.map +1 -1
  98. package/lib/staking/contracts.d.ts +3 -2
  99. package/lib/staking/contracts.d.ts.map +1 -1
  100. package/lib/staking/contracts.js +11 -10
  101. package/lib/staking/contracts.js.map +1 -1
  102. package/lib/staking/detectOperationType.d.ts +2 -1
  103. package/lib/staking/detectOperationType.d.ts.map +1 -1
  104. package/lib/staking/detectOperationType.js +7 -7
  105. package/lib/staking/detectOperationType.js.map +1 -1
  106. package/lib/staking/encoder.d.ts +2 -1
  107. package/lib/staking/encoder.d.ts.map +1 -1
  108. package/lib/staking/encoder.js +8 -8
  109. package/lib/staking/encoder.js.map +1 -1
  110. package/lib/staking/fetchers.d.ts +2 -1
  111. package/lib/staking/fetchers.d.ts.map +1 -1
  112. package/lib/staking/fetchers.js +27 -27
  113. package/lib/staking/fetchers.js.map +1 -1
  114. package/lib/staking/logic.d.ts +6 -6
  115. package/lib/staking/logic.d.ts.map +1 -1
  116. package/lib/staking/logic.js +14 -13
  117. package/lib/staking/logic.js.map +1 -1
  118. package/lib/staking/operations/index.d.ts +2 -1
  119. package/lib/staking/operations/index.d.ts.map +1 -1
  120. package/lib/staking/operations/index.js +30 -28
  121. package/lib/staking/operations/index.js.map +1 -1
  122. package/lib/staking/prepareIntents.d.ts +1 -1
  123. package/lib/staking/prepareIntents.d.ts.map +1 -1
  124. package/lib/staking/prepareIntents.js +11 -10
  125. package/lib/staking/prepareIntents.js.map +1 -1
  126. package/lib/staking/redelegations.d.ts +4 -4
  127. package/lib/staking/redelegations.d.ts.map +1 -1
  128. package/lib/staking/redelegations.js +18 -20
  129. package/lib/staking/redelegations.js.map +1 -1
  130. package/lib/staking/rewards.d.ts +1 -1
  131. package/lib/staking/rewards.d.ts.map +1 -1
  132. package/lib/staking/rewards.js +2 -2
  133. package/lib/staking/rewards.js.map +1 -1
  134. package/lib/staking/rewardsFromReceipt.d.ts +2 -1
  135. package/lib/staking/rewardsFromReceipt.d.ts.map +1 -1
  136. package/lib/staking/rewardsFromReceipt.js +2 -2
  137. package/lib/staking/rewardsFromReceipt.js.map +1 -1
  138. package/lib/staking/transactionData.d.ts +2 -1
  139. package/lib/staking/transactionData.d.ts.map +1 -1
  140. package/lib/staking/transactionData.js +6 -6
  141. package/lib/staking/transactionData.js.map +1 -1
  142. package/lib/staking/unbondings.d.ts +1 -1
  143. package/lib/staking/unbondings.d.ts.map +1 -1
  144. package/lib/staking/unbondings.js +2 -2
  145. package/lib/staking/unbondings.js.map +1 -1
  146. package/lib/staking/validators/index.d.ts +14 -14
  147. package/lib/staking/validators/index.d.ts.map +1 -1
  148. package/lib/staking/validators/index.js +39 -38
  149. package/lib/staking/validators/index.js.map +1 -1
  150. package/lib/staking/validators/monad.d.ts +5 -5
  151. package/lib/staking/validators/monad.d.ts.map +1 -1
  152. package/lib/staking/validators/monad.js +31 -33
  153. package/lib/staking/validators/monad.js.map +1 -1
  154. package/lib/staking/validators/monadResolver.d.ts +1 -1
  155. package/lib/staking/validators/monadResolver.d.ts.map +1 -1
  156. package/lib/staking/validators/monadResolver.js +4 -4
  157. package/lib/staking/validators/monadResolver.js.map +1 -1
  158. package/lib/staking/validators/sei.js +2 -2
  159. package/lib/staking/validators/sei.js.map +1 -1
  160. package/lib/staking/validators/somnia.d.ts +4 -4
  161. package/lib/staking/validators/somnia.d.ts.map +1 -1
  162. package/lib/staking/validators/somnia.js +22 -22
  163. package/lib/staking/validators/somnia.js.map +1 -1
  164. package/lib/staking/validators/types.d.ts +1 -1
  165. package/lib/staking/validators/types.d.ts.map +1 -1
  166. package/lib/staking/validators/zero_gravity.d.ts +1 -1
  167. package/lib/staking/validators/zero_gravity.d.ts.map +1 -1
  168. package/lib/staking/validators/zero_gravity.js +7 -7
  169. package/lib/staking/validators/zero_gravity.js.map +1 -1
  170. package/lib/types/staking.d.ts +5 -6
  171. package/lib/types/staking.d.ts.map +1 -1
  172. package/lib-es/adapters/etherscan.d.ts +2 -1
  173. package/lib-es/adapters/etherscan.d.ts.map +1 -1
  174. package/lib-es/adapters/etherscan.js +2 -2
  175. package/lib-es/adapters/etherscan.js.map +1 -1
  176. package/lib-es/adapters/ledger.d.ts +2 -1
  177. package/lib-es/adapters/ledger.d.ts.map +1 -1
  178. package/lib-es/adapters/ledger.js +2 -2
  179. package/lib-es/adapters/ledger.js.map +1 -1
  180. package/lib-es/api/index.js +1 -1
  181. package/lib-es/api/index.js.map +1 -1
  182. package/lib-es/chains.d.ts +94 -0
  183. package/lib-es/chains.d.ts.map +1 -0
  184. package/lib-es/chains.js +95 -0
  185. package/lib-es/chains.js.map +1 -0
  186. package/lib-es/config.d.ts +4 -1
  187. package/lib-es/config.d.ts.map +1 -1
  188. package/lib-es/config.js +1 -0
  189. package/lib-es/config.js.map +1 -1
  190. package/lib-es/logic/broadcast.js +2 -2
  191. package/lib-es/logic/broadcast.js.map +1 -1
  192. package/lib-es/logic/common.d.ts +1 -1
  193. package/lib-es/logic/common.d.ts.map +1 -1
  194. package/lib-es/logic/common.js +11 -11
  195. package/lib-es/logic/common.js.map +1 -1
  196. package/lib-es/logic/craftTransaction.d.ts.map +1 -1
  197. package/lib-es/logic/craftTransaction.js +3 -3
  198. package/lib-es/logic/craftTransaction.js.map +1 -1
  199. package/lib-es/logic/estimateFees.d.ts.map +1 -1
  200. package/lib-es/logic/estimateFees.js +7 -7
  201. package/lib-es/logic/estimateFees.js.map +1 -1
  202. package/lib-es/logic/getBalance.d.ts.map +1 -1
  203. package/lib-es/logic/getBalance.js +9 -9
  204. package/lib-es/logic/getBalance.js.map +1 -1
  205. package/lib-es/logic/getBlock.d.ts.map +1 -1
  206. package/lib-es/logic/getBlock.js +18 -18
  207. package/lib-es/logic/getBlock.js.map +1 -1
  208. package/lib-es/logic/getBlockInfo.js +2 -2
  209. package/lib-es/logic/getBlockInfo.js.map +1 -1
  210. package/lib-es/logic/getNextSequence.d.ts.map +1 -1
  211. package/lib-es/logic/getNextSequence.js +1 -1
  212. package/lib-es/logic/getNextSequence.js.map +1 -1
  213. package/lib-es/logic/getStakes.d.ts.map +1 -1
  214. package/lib-es/logic/getStakes.js +10 -10
  215. package/lib-es/logic/getStakes.js.map +1 -1
  216. package/lib-es/logic/internalTransactionsFetcher.d.ts +2 -2
  217. package/lib-es/logic/internalTransactionsFetcher.d.ts.map +1 -1
  218. package/lib-es/logic/internalTransactionsFetcher.js +8 -8
  219. package/lib-es/logic/internalTransactionsFetcher.js.map +1 -1
  220. package/lib-es/logic/lastBlock.js +2 -2
  221. package/lib-es/logic/lastBlock.js.map +1 -1
  222. package/lib-es/logic/listOperations.d.ts.map +1 -1
  223. package/lib-es/logic/listOperations.js +1 -1
  224. package/lib-es/logic/listOperations.js.map +1 -1
  225. package/lib-es/logic/validateIntent.d.ts.map +1 -1
  226. package/lib-es/logic/validateIntent.js +9 -9
  227. package/lib-es/logic/validateIntent.js.map +1 -1
  228. package/lib-es/logic.d.ts +1 -1
  229. package/lib-es/logic.d.ts.map +1 -1
  230. package/lib-es/logic.js +14 -13
  231. package/lib-es/logic.js.map +1 -1
  232. package/lib-es/network/explorer/etherscan.d.ts +2 -3
  233. package/lib-es/network/explorer/etherscan.d.ts.map +1 -1
  234. package/lib-es/network/explorer/etherscan.js +6 -8
  235. package/lib-es/network/explorer/etherscan.js.map +1 -1
  236. package/lib-es/network/explorer/ledger.d.ts.map +1 -1
  237. package/lib-es/network/explorer/ledger.js +5 -5
  238. package/lib-es/network/explorer/ledger.js.map +1 -1
  239. package/lib-es/network/explorer/types.d.ts +2 -2
  240. package/lib-es/network/explorer/types.d.ts.map +1 -1
  241. package/lib-es/network/explorer/types.js.map +1 -1
  242. package/lib-es/network/node/explorerProxy.js +12 -12
  243. package/lib-es/network/node/explorerProxy.js.map +1 -1
  244. package/lib-es/network/node/index.d.ts +1 -1
  245. package/lib-es/network/node/index.d.ts.map +1 -1
  246. package/lib-es/network/node/index.js +7 -7
  247. package/lib-es/network/node/index.js.map +1 -1
  248. package/lib-es/network/node/ledger.d.ts +3 -1
  249. package/lib-es/network/node/ledger.d.ts.map +1 -1
  250. package/lib-es/network/node/ledger.js +31 -22
  251. package/lib-es/network/node/ledger.js.map +1 -1
  252. package/lib-es/network/node/rpc.common.d.ts +1 -1
  253. package/lib-es/network/node/rpc.common.d.ts.map +1 -1
  254. package/lib-es/network/node/rpc.common.js +50 -39
  255. package/lib-es/network/node/rpc.common.js.map +1 -1
  256. package/lib-es/network/node/types.d.ts +15 -15
  257. package/lib-es/network/node/types.d.ts.map +1 -1
  258. package/lib-es/network/node/types.js.map +1 -1
  259. package/lib-es/network/node/withNodeSources.d.ts.map +1 -1
  260. package/lib-es/network/node/withNodeSources.js +15 -15
  261. package/lib-es/network/node/withNodeSources.js.map +1 -1
  262. package/lib-es/staking/abis.d.ts +3 -2
  263. package/lib-es/staking/abis.d.ts.map +1 -1
  264. package/lib-es/staking/abis.js +10 -9
  265. package/lib-es/staking/abis.js.map +1 -1
  266. package/lib-es/staking/contracts.d.ts +3 -2
  267. package/lib-es/staking/contracts.d.ts.map +1 -1
  268. package/lib-es/staking/contracts.js +11 -10
  269. package/lib-es/staking/contracts.js.map +1 -1
  270. package/lib-es/staking/detectOperationType.d.ts +2 -1
  271. package/lib-es/staking/detectOperationType.d.ts.map +1 -1
  272. package/lib-es/staking/detectOperationType.js +7 -7
  273. package/lib-es/staking/detectOperationType.js.map +1 -1
  274. package/lib-es/staking/encoder.d.ts +2 -1
  275. package/lib-es/staking/encoder.d.ts.map +1 -1
  276. package/lib-es/staking/encoder.js +8 -8
  277. package/lib-es/staking/encoder.js.map +1 -1
  278. package/lib-es/staking/fetchers.d.ts +2 -1
  279. package/lib-es/staking/fetchers.d.ts.map +1 -1
  280. package/lib-es/staking/fetchers.js +27 -27
  281. package/lib-es/staking/fetchers.js.map +1 -1
  282. package/lib-es/staking/logic.d.ts +6 -6
  283. package/lib-es/staking/logic.d.ts.map +1 -1
  284. package/lib-es/staking/logic.js +14 -13
  285. package/lib-es/staking/logic.js.map +1 -1
  286. package/lib-es/staking/operations/index.d.ts +2 -1
  287. package/lib-es/staking/operations/index.d.ts.map +1 -1
  288. package/lib-es/staking/operations/index.js +30 -28
  289. package/lib-es/staking/operations/index.js.map +1 -1
  290. package/lib-es/staking/prepareIntents.d.ts +1 -1
  291. package/lib-es/staking/prepareIntents.d.ts.map +1 -1
  292. package/lib-es/staking/prepareIntents.js +11 -10
  293. package/lib-es/staking/prepareIntents.js.map +1 -1
  294. package/lib-es/staking/redelegations.d.ts +4 -4
  295. package/lib-es/staking/redelegations.d.ts.map +1 -1
  296. package/lib-es/staking/redelegations.js +18 -20
  297. package/lib-es/staking/redelegations.js.map +1 -1
  298. package/lib-es/staking/rewards.d.ts +1 -1
  299. package/lib-es/staking/rewards.d.ts.map +1 -1
  300. package/lib-es/staking/rewards.js +2 -2
  301. package/lib-es/staking/rewards.js.map +1 -1
  302. package/lib-es/staking/rewardsFromReceipt.d.ts +2 -1
  303. package/lib-es/staking/rewardsFromReceipt.d.ts.map +1 -1
  304. package/lib-es/staking/rewardsFromReceipt.js +2 -2
  305. package/lib-es/staking/rewardsFromReceipt.js.map +1 -1
  306. package/lib-es/staking/transactionData.d.ts +2 -1
  307. package/lib-es/staking/transactionData.d.ts.map +1 -1
  308. package/lib-es/staking/transactionData.js +6 -6
  309. package/lib-es/staking/transactionData.js.map +1 -1
  310. package/lib-es/staking/unbondings.d.ts +1 -1
  311. package/lib-es/staking/unbondings.d.ts.map +1 -1
  312. package/lib-es/staking/unbondings.js +2 -2
  313. package/lib-es/staking/unbondings.js.map +1 -1
  314. package/lib-es/staking/validators/index.d.ts +14 -14
  315. package/lib-es/staking/validators/index.d.ts.map +1 -1
  316. package/lib-es/staking/validators/index.js +39 -38
  317. package/lib-es/staking/validators/index.js.map +1 -1
  318. package/lib-es/staking/validators/monad.d.ts +5 -5
  319. package/lib-es/staking/validators/monad.d.ts.map +1 -1
  320. package/lib-es/staking/validators/monad.js +31 -33
  321. package/lib-es/staking/validators/monad.js.map +1 -1
  322. package/lib-es/staking/validators/monadResolver.d.ts +1 -1
  323. package/lib-es/staking/validators/monadResolver.d.ts.map +1 -1
  324. package/lib-es/staking/validators/monadResolver.js +4 -4
  325. package/lib-es/staking/validators/monadResolver.js.map +1 -1
  326. package/lib-es/staking/validators/sei.js +2 -2
  327. package/lib-es/staking/validators/sei.js.map +1 -1
  328. package/lib-es/staking/validators/somnia.d.ts +4 -4
  329. package/lib-es/staking/validators/somnia.d.ts.map +1 -1
  330. package/lib-es/staking/validators/somnia.js +22 -22
  331. package/lib-es/staking/validators/somnia.js.map +1 -1
  332. package/lib-es/staking/validators/types.d.ts +1 -1
  333. package/lib-es/staking/validators/types.d.ts.map +1 -1
  334. package/lib-es/staking/validators/zero_gravity.d.ts +1 -1
  335. package/lib-es/staking/validators/zero_gravity.d.ts.map +1 -1
  336. package/lib-es/staking/validators/zero_gravity.js +7 -7
  337. package/lib-es/staking/validators/zero_gravity.js.map +1 -1
  338. package/lib-es/types/staking.d.ts +5 -6
  339. package/lib-es/types/staking.d.ts.map +1 -1
  340. package/package.json +1 -1
  341. package/src/adapters/etherscan.test.ts +34 -38
  342. package/src/adapters/etherscan.ts +3 -2
  343. package/src/adapters/ledger.test.ts +49 -22
  344. package/src/adapters/ledger.ts +3 -2
  345. package/src/api/getBlock.integ.test.ts +2 -1
  346. package/src/api/index.monad_testnet.integ.test.ts +2 -2
  347. package/src/api/index.ts +1 -1
  348. package/src/chains.test.ts +12 -0
  349. package/src/chains.ts +97 -0
  350. package/src/config.ts +5 -1
  351. package/src/fixtures/staking.fixtures.ts +13 -0
  352. package/src/logic/broadcast.ts +2 -2
  353. package/src/logic/common.ts +10 -11
  354. package/src/logic/craftTransaction.ts +2 -3
  355. package/src/logic/estimateFees.ts +6 -23
  356. package/src/logic/getBalance.ts +7 -13
  357. package/src/logic/getBlock.ts +22 -19
  358. package/src/logic/getBlockInfo.ts +2 -2
  359. package/src/logic/getNextSequence.ts +1 -4
  360. package/src/logic/getStakes.ts +11 -12
  361. package/src/logic/internalTransactionsFetcher.ts +6 -8
  362. package/src/logic/lastBlock.ts +2 -2
  363. package/src/logic/listOperations.ts +0 -1
  364. package/src/logic/tests/broadcast.test.ts +4 -4
  365. package/src/logic/tests/broadcastSource.test.ts +0 -3
  366. package/src/logic/tests/common.test.ts +17 -33
  367. package/src/logic/tests/craftTransaction.test.ts +13 -6
  368. package/src/logic/tests/estimateFees.test.ts +16 -7
  369. package/src/logic/tests/getBalance.test.ts +17 -33
  370. package/src/logic/tests/getBlock.test.ts +69 -75
  371. package/src/logic/tests/getBlockInfo.test.ts +1 -1
  372. package/src/logic/tests/getNextSequence.test.ts +1 -1
  373. package/src/logic/tests/getStakes.test.ts +28 -16
  374. package/src/logic/tests/internalTransactionsFetcher.test.ts +5 -5
  375. package/src/logic/tests/lastBlock.test.ts +3 -6
  376. package/src/logic/tests/listOperations.test.ts +3 -4
  377. package/src/logic/tests/validateIntent.test.ts +12 -2
  378. package/src/logic/validateIntent.ts +8 -10
  379. package/src/logic.test.ts +12 -4
  380. package/src/logic.ts +13 -13
  381. package/src/network/explorer/etherscan.test.ts +9 -58
  382. package/src/network/explorer/etherscan.ts +8 -24
  383. package/src/network/explorer/index.test.ts +1 -1
  384. package/src/network/explorer/ledger.test.ts +23 -131
  385. package/src/network/explorer/ledger.ts +2 -5
  386. package/src/network/explorer/types.ts +0 -2
  387. package/src/network/node/explorerProxy.test.ts +17 -22
  388. package/src/network/node/explorerProxy.ts +12 -12
  389. package/src/network/node/index.memoization.test.ts +29 -22
  390. package/src/network/node/index.test.ts +1 -3
  391. package/src/network/node/index.ts +11 -8
  392. package/src/network/node/ledger.test.ts +63 -69
  393. package/src/network/node/ledger.ts +31 -34
  394. package/src/network/node/rpc.common.ts +58 -86
  395. package/src/network/node/rpc.test.ts +86 -114
  396. package/src/network/node/types.ts +11 -29
  397. package/src/network/node/withNodeSources.test.ts +7 -9
  398. package/src/network/node/withNodeSources.ts +23 -26
  399. package/src/staking/abis.test.ts +24 -28
  400. package/src/staking/abis.ts +12 -10
  401. package/src/staking/contracts.test.ts +20 -8
  402. package/src/staking/contracts.ts +12 -11
  403. package/src/staking/detectOperationType.test.ts +16 -13
  404. package/src/staking/detectOperationType.ts +9 -8
  405. package/src/staking/encoder.test.ts +38 -27
  406. package/src/staking/encoder.ts +9 -8
  407. package/src/staking/fetchers.ts +28 -39
  408. package/src/staking/logic.test.ts +34 -32
  409. package/src/staking/logic.ts +14 -14
  410. package/src/staking/operations/index.test.ts +48 -39
  411. package/src/staking/operations/index.ts +31 -28
  412. package/src/staking/prepareIntents.test.ts +14 -34
  413. package/src/staking/prepareIntents.ts +10 -13
  414. package/src/staking/redelegations.test.ts +73 -131
  415. package/src/staking/redelegations.ts +12 -26
  416. package/src/staking/rewards.test.ts +19 -21
  417. package/src/staking/rewards.ts +1 -2
  418. package/src/staking/rewardsFromReceipt.test.ts +9 -8
  419. package/src/staking/rewardsFromReceipt.ts +3 -2
  420. package/src/staking/transactionData.test.ts +35 -25
  421. package/src/staking/transactionData.ts +7 -6
  422. package/src/staking/unbondings.test.ts +26 -20
  423. package/src/staking/unbondings.ts +1 -2
  424. package/src/staking/validators/index.ts +45 -51
  425. package/src/staking/validators/monad.test.ts +52 -54
  426. package/src/staking/validators/monad.ts +31 -37
  427. package/src/staking/validators/monadResolver.ts +2 -4
  428. package/src/staking/validators/sei.ts +2 -2
  429. package/src/staking/validators/somnia.test.ts +22 -19
  430. package/src/staking/validators/somnia.ts +20 -27
  431. package/src/staking/validators/types.ts +0 -1
  432. package/src/staking/validators/zero_gravity.test.ts +34 -49
  433. package/src/staking/validators/zero_gravity.ts +5 -11
  434. package/src/staking/validators.integ.test.ts +3 -5
  435. package/src/staking/validators.test.ts +56 -53
  436. package/src/types/staking.ts +3 -6
@@ -21,6 +21,7 @@ import {
21
21
  deserializePagingToken,
22
22
  serializePagingToken,
23
23
  } from '../adapters'
24
+ import { CHAIN_ID } from '../config'
24
25
  import { testLogger } from '../fixtures/context.fixtures'
25
26
  import { NO_TOKEN } from '../network/explorer/types'
26
27
 
@@ -54,7 +55,6 @@ describe('EVM Family', () => {
54
55
  }
55
56
 
56
57
  const address = '0x9aa99c23f67c81701c772b106b4f83f6e858dd2e'
57
- const currencyId = 'ethereum'
58
58
 
59
59
  const expectedOperation = {
60
60
  id: '0x9aa99c23f67c81701c772b106b4f83f6e858dd2e-0xaa45b4858ba44230a5fce5a29570a5dec2bf1f0ba95bacdec4fe8f2c4fa99338-FEES',
@@ -85,7 +85,7 @@ describe('EVM Family', () => {
85
85
  }
86
86
 
87
87
  expect(
88
- etherscanOperationToOperations(address, currencyId, etherscanOp, testLogger)
88
+ etherscanOperationToOperations(address, CHAIN_ID.ETHEREUM, etherscanOp, testLogger)
89
89
  ).toEqual([expectedOperation])
90
90
  })
91
91
 
@@ -115,7 +115,6 @@ describe('EVM Family', () => {
115
115
  }
116
116
 
117
117
  const address = '0x9aa99c23f67c81701c772b106b4f83f6e858dd2e'
118
- const currencyId = 'ethereum'
119
118
 
120
119
  const expectedOperation = {
121
120
  id: '0x9aa99c23f67c81701c772b106b4f83f6e858dd2e-0xaa45b4858ba44230a5fce5a29570a5dec2bf1f0ba95bacdec4fe8f2c4fa99338-FEES',
@@ -146,7 +145,7 @@ describe('EVM Family', () => {
146
145
  }
147
146
 
148
147
  expect(
149
- etherscanOperationToOperations(address, currencyId, etherscanOp, testLogger)
148
+ etherscanOperationToOperations(address, CHAIN_ID.ETHEREUM, etherscanOp, testLogger)
150
149
  ).toEqual([expectedOperation])
151
150
  })
152
151
 
@@ -175,7 +174,6 @@ describe('EVM Family', () => {
175
174
  }
176
175
 
177
176
  const address = '0x829BD824B016326A401d083B33D092293333A830'
178
- const currencyId = 'ethereum'
179
177
 
180
178
  const expectedOperation = {
181
179
  id: '0x829BD824B016326A401d083B33D092293333A830-0x8d3e871469ce549c5a80b8c8beaae0d502ecea85bb43eb84703cebeea7d25944-OUT',
@@ -200,7 +198,7 @@ describe('EVM Family', () => {
200
198
  }
201
199
 
202
200
  expect(
203
- etherscanOperationToOperations(address, currencyId, etherscanOp, testLogger)
201
+ etherscanOperationToOperations(address, CHAIN_ID.ETHEREUM, etherscanOp, testLogger)
204
202
  ).toEqual([expectedOperation])
205
203
  })
206
204
 
@@ -229,7 +227,6 @@ describe('EVM Family', () => {
229
227
  }
230
228
 
231
229
  const address = '0x829BD824B016326A401d083B33D092293333A830'
232
- const currencyId = 'ethereum'
233
230
 
234
231
  const expectedOperation = {
235
232
  id: '0x829BD824B016326A401d083B33D092293333A830-0x8d3e871469ce549c5a80b8c8beaae0d502ecea85bb43eb84703cebeea7d25944-IN',
@@ -254,7 +251,7 @@ describe('EVM Family', () => {
254
251
  }
255
252
 
256
253
  expect(
257
- etherscanOperationToOperations(address, currencyId, etherscanOp, testLogger)
254
+ etherscanOperationToOperations(address, CHAIN_ID.ETHEREUM, etherscanOp, testLogger)
258
255
  ).toEqual([expectedOperation])
259
256
  })
260
257
 
@@ -283,7 +280,6 @@ describe('EVM Family', () => {
283
280
  }
284
281
 
285
282
  const address = '0x829BD824B016326A401d083B33D092293333A830'
286
- const currencyId = 'ethereum'
287
283
 
288
284
  const expectedOperation = {
289
285
  id: '0x829BD824B016326A401d083B33D092293333A830-0x8d3e871469ce549c5a80b8c8beaae0d502ecea85bb43eb84703cebeea7d25944-NONE',
@@ -308,7 +304,7 @@ describe('EVM Family', () => {
308
304
  }
309
305
 
310
306
  expect(
311
- etherscanOperationToOperations(address, currencyId, etherscanOp, testLogger)
307
+ etherscanOperationToOperations(address, CHAIN_ID.ETHEREUM, etherscanOp, testLogger)
312
308
  ).toEqual([expectedOperation])
313
309
  })
314
310
 
@@ -337,7 +333,6 @@ describe('EVM Family', () => {
337
333
  }
338
334
 
339
335
  const address = '0x9aa99c23f67c81701c772b106b4f83f6e858dd2e'
340
- const currencyId = 'ethereum'
341
336
 
342
337
  const selfSendTx = {
343
338
  hash: '0xaa45b4858ba44230a5fce5a29570a5dec2bf1f0ba95bacdec4fe8f2c4fa99338',
@@ -376,13 +371,12 @@ describe('EVM Family', () => {
376
371
  ]
377
372
 
378
373
  expect(
379
- etherscanOperationToOperations(address, currencyId, etherscanOp, testLogger)
374
+ etherscanOperationToOperations(address, CHAIN_ID.ETHEREUM, etherscanOp, testLogger)
380
375
  ).toEqual(expectedOperations)
381
376
  })
382
377
 
383
378
  it('should return an operation with the expected amount', () => {
384
379
  const address = '0x9aa99c23f67c81701c772b106b4f83f6e858dd2e'
385
- const currencyId = 'ethereum'
386
380
 
387
381
  const etherscanOpFees: EtherscanOperation = {
388
382
  blockNumber: '14923692',
@@ -410,14 +404,18 @@ describe('EVM Family', () => {
410
404
 
411
405
  // Successful Op (value = transferred only; fee is separate; Ledger Wallet adds fee in bridge)
412
406
  expect(
413
- etherscanOperationToOperations(address, currencyId, etherscanOpFees, testLogger)[0]
414
- .value
407
+ etherscanOperationToOperations(
408
+ address,
409
+ CHAIN_ID.ETHEREUM,
410
+ etherscanOpFees,
411
+ testLogger
412
+ )[0].value
415
413
  ).toEqual(BigInt(etherscanOpFees.value))
416
414
  // Failing Op (value = tx value, same as success)
417
415
  expect(
418
416
  etherscanOperationToOperations(
419
417
  address,
420
- currencyId,
418
+ CHAIN_ID.ETHEREUM,
421
419
  {
422
420
  ...etherscanOpFees,
423
421
  isError: '1',
@@ -451,13 +449,18 @@ describe('EVM Family', () => {
451
449
 
452
450
  // Successful Op (value = transferred only; fee is separate; Ledger Wallet adds fee in bridge)
453
451
  expect(
454
- etherscanOperationToOperations(address, currencyId, etherscanOpOut, testLogger)[0].value
452
+ etherscanOperationToOperations(
453
+ address,
454
+ CHAIN_ID.ETHEREUM,
455
+ etherscanOpOut,
456
+ testLogger
457
+ )[0].value
455
458
  ).toEqual(BigInt(etherscanOpOut.value))
456
459
  // Failing Op (value = tx value, same as success)
457
460
  expect(
458
461
  etherscanOperationToOperations(
459
462
  address,
460
- currencyId,
463
+ CHAIN_ID.ETHEREUM,
461
464
  {
462
465
  ...etherscanOpOut,
463
466
  isError: '1',
@@ -491,13 +494,14 @@ describe('EVM Family', () => {
491
494
 
492
495
  // Successful Op
493
496
  expect(
494
- etherscanOperationToOperations(address, currencyId, etherscanOpIn, testLogger)[0].value
497
+ etherscanOperationToOperations(address, CHAIN_ID.ETHEREUM, etherscanOpIn, testLogger)[0]
498
+ .value
495
499
  ).toEqual(BigInt(etherscanOpIn.value))
496
500
  // Failing Op
497
501
  expect(
498
502
  etherscanOperationToOperations(
499
503
  address,
500
- currencyId,
504
+ CHAIN_ID.ETHEREUM,
501
505
  {
502
506
  ...etherscanOpIn,
503
507
  isError: '1',
@@ -535,11 +539,10 @@ describe('EVM Family', () => {
535
539
 
536
540
  it('should handle transaction with empty gasPrice without throwing (Blockscout Optimism)', () => {
537
541
  const address = '0xB10770cE9f8532634b6Ba156b8789f19935210F0'
538
- const currencyId = 'optimism'
539
542
 
540
543
  const result = etherscanOperationToOperations(
541
544
  address,
542
- currencyId,
545
+ CHAIN_ID.OPTIMISM,
543
546
  rawBlockscoutTransaction,
544
547
  testLogger
545
548
  )
@@ -555,7 +558,6 @@ describe('EVM Family', () => {
555
558
 
556
559
  it('should handle failed transaction with empty gasPrice', () => {
557
560
  const address = '0xB10770cE9f8532634b6Ba156b8789f19935210F0'
558
- const currencyId = 'optimism'
559
561
 
560
562
  const failedTransaction: EtherscanOperation = {
561
563
  ...rawBlockscoutTransaction,
@@ -566,7 +568,7 @@ describe('EVM Family', () => {
566
568
 
567
569
  const result = etherscanOperationToOperations(
568
570
  address,
569
- currencyId,
571
+ CHAIN_ID.OPTIMISM,
570
572
  failedTransaction,
571
573
  testLogger
572
574
  )
@@ -579,7 +581,6 @@ describe('EVM Family', () => {
579
581
 
580
582
  it('should handle transaction with both empty gasPrice and empty value', () => {
581
583
  const address = '0xB10770cE9f8532634b6Ba156b8789f19935210F0'
582
- const currencyId = 'optimism'
583
584
 
584
585
  const txWithEmptyValue: EtherscanOperation = {
585
586
  ...rawBlockscoutTransaction,
@@ -588,7 +589,7 @@ describe('EVM Family', () => {
588
589
 
589
590
  const result = etherscanOperationToOperations(
590
591
  address,
591
- currencyId,
592
+ CHAIN_ID.OPTIMISM,
592
593
  txWithEmptyValue,
593
594
  testLogger
594
595
  )
@@ -622,11 +623,10 @@ describe('EVM Family', () => {
622
623
  }
623
624
 
624
625
  const address = '0x9aa99c23f67c81701c772b106b4f83f6e858dd2e'
625
- const currencyId = 'ethereum'
626
626
 
627
627
  const result = etherscanOperationToOperations(
628
628
  address,
629
- currencyId,
629
+ CHAIN_ID.ETHEREUM,
630
630
  etherscanOp,
631
631
  testLogger
632
632
  )
@@ -659,11 +659,10 @@ describe('EVM Family', () => {
659
659
  }
660
660
 
661
661
  const address = '0x9aa99c23f67c81701c772b106b4f83f6e858dd2e'
662
- const currencyId = 'ethereum'
663
662
 
664
663
  const result = etherscanOperationToOperations(
665
664
  address,
666
- currencyId,
665
+ CHAIN_ID.ETHEREUM,
667
666
  etherscanOp,
668
667
  testLogger
669
668
  )
@@ -701,7 +700,7 @@ describe('EVM Family', () => {
701
700
  const address = '0x83802741df938c6cd94c46481cadba5b1b0c2f70'
702
701
  const result = etherscanOperationToOperations(
703
702
  address,
704
- 'optimism',
703
+ CHAIN_ID.OPTIMISM,
705
704
  etherscanOp,
706
705
  testLogger
707
706
  )
@@ -737,7 +736,7 @@ describe('EVM Family', () => {
737
736
 
738
737
  const result = etherscanOperationToOperations(
739
738
  '0x9aa99c23f67c81701c772b106b4f83f6e858dd2e',
740
- 'ethereum',
739
+ CHAIN_ID.ETHEREUM,
741
740
  etherscanOp,
742
741
  testLogger
743
742
  )
@@ -1853,7 +1852,6 @@ describe('EVM Family', () => {
1853
1852
  }
1854
1853
 
1855
1854
  const address = '0x9aa99c23f67c81701c772b106b4f83f6e858dd2e'
1856
- const currencyId = 'sei_evm'
1857
1855
 
1858
1856
  const expectedOperation = {
1859
1857
  id: `${address}-${stakingHash}-DELEGATE`,
@@ -1880,7 +1878,7 @@ describe('EVM Family', () => {
1880
1878
  }
1881
1879
 
1882
1880
  expect(
1883
- etherscanOperationToOperations(address, currencyId, etherscanOp, testLogger)
1881
+ etherscanOperationToOperations(address, CHAIN_ID.SEI_EVM, etherscanOp, testLogger)
1884
1882
  ).toEqual([expectedOperation])
1885
1883
  })
1886
1884
 
@@ -1910,7 +1908,6 @@ describe('EVM Family', () => {
1910
1908
  }
1911
1909
 
1912
1910
  const address = '0x9aa99c23f67c81701c772b106b4f83f6e858dd2e'
1913
- const currencyId = 'sei_evm'
1914
1911
 
1915
1912
  const expectedOperation = {
1916
1913
  id: `${address}-${stakingHash}-REDELEGATE`,
@@ -1937,7 +1934,7 @@ describe('EVM Family', () => {
1937
1934
  }
1938
1935
 
1939
1936
  expect(
1940
- etherscanOperationToOperations(address, currencyId, etherscanOp, testLogger)
1937
+ etherscanOperationToOperations(address, CHAIN_ID.SEI_EVM, etherscanOp, testLogger)
1941
1938
  ).toEqual([expectedOperation])
1942
1939
  })
1943
1940
 
@@ -1966,7 +1963,6 @@ describe('EVM Family', () => {
1966
1963
  }
1967
1964
 
1968
1965
  const address = '0x9aa99c23f67c81701c772b106b4f83f6e858dd2e'
1969
- const currencyId = 'sei_evm'
1970
1966
 
1971
1967
  const expectedOperation = {
1972
1968
  id: `${address}-${stakingHash}-UNDELEGATE`,
@@ -1992,7 +1988,7 @@ describe('EVM Family', () => {
1992
1988
  }
1993
1989
 
1994
1990
  expect(
1995
- etherscanOperationToOperations(address, currencyId, etherscanOp, testLogger)
1991
+ etherscanOperationToOperations(address, CHAIN_ID.SEI_EVM, etherscanOp, testLogger)
1996
1992
  ).toEqual([expectedOperation])
1997
1993
  })
1998
1994
  })
@@ -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
  EtherscanERC1155Event,
6
7
  EtherscanERC20Event,
@@ -59,7 +60,7 @@ export const safeDate = (op: { timeStamp?: string; timestamp?: string }): Date =
59
60
  */
60
61
  export const etherscanOperationToOperations = (
61
62
  address: string,
62
- currencyId: string,
63
+ chainId: ChainId,
63
64
  etherscanOp: EtherscanOperation,
64
65
  logger: Logger
65
66
  ): Array<Operation<MemoNotSupported>> => {
@@ -82,7 +83,7 @@ export const etherscanOperationToOperations = (
82
83
  if (from === checksummedAddress) {
83
84
  const methodId = etherscanOp.methodId || etherscanOp.input?.slice(0, 10) || ''
84
85
  const isContractInteraction = new RegExp(/0[xX][0-9a-fA-F]{8}/).test(methodId) // 0x + 4 bytes selector
85
- const stakingType = detectEvmStakingOperationType(currencyId, to, methodId)
86
+ const stakingType = detectEvmStakingOperationType(chainId, to, methodId)
86
87
  types.push(stakingType ?? (isContractInteraction ? 'FEES' : 'OUT'))
87
88
  }
88
89
  if (!types.length) {
@@ -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',
@@ -110,7 +110,12 @@ describe('EVM Family', () => {
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
 
@@ -175,7 +180,7 @@ describe('EVM Family', () => {
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
 
@@ -240,7 +245,7 @@ describe('EVM Family', () => {
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
 
@@ -305,7 +310,7 @@ describe('EVM Family', () => {
305
310
  }
306
311
 
307
312
  expect(
308
- ledgerOperationToOperations(address, currencyId, ledgerOperation, testLogger)
313
+ ledgerOperationToOperations(address, CHAIN_ID.ETHEREUM, ledgerOperation, testLogger)
309
314
  ).toEqual([expectedOperation])
310
315
  })
311
316
 
@@ -370,7 +375,7 @@ describe('EVM Family', () => {
370
375
  }
371
376
 
372
377
  expect(
373
- ledgerOperationToOperations(address, currencyId, ledgerOperation, testLogger)
378
+ ledgerOperationToOperations(address, CHAIN_ID.ETHEREUM, ledgerOperation, testLogger)
374
379
  ).toEqual([expectedOperation])
375
380
  })
376
381
 
@@ -440,7 +445,7 @@ describe('EVM Family', () => {
440
445
  }
441
446
 
442
447
  expect(
443
- ledgerOperationToOperations(address, currencyId, ledgerOperation, testLogger)
448
+ ledgerOperationToOperations(address, CHAIN_ID.ETHEREUM, ledgerOperation, testLogger)
444
449
  ).toEqual([expectedOperation])
445
450
  })
446
451
 
@@ -517,7 +522,7 @@ describe('EVM Family', () => {
517
522
  }
518
523
 
519
524
  expect(
520
- ledgerOperationToOperations(address, currencyId, ledgerOperation, testLogger)
525
+ ledgerOperationToOperations(address, CHAIN_ID.ETHEREUM, ledgerOperation, testLogger)
521
526
  ).toEqual([expectedOperation1, expectedOperation2])
522
527
  })
523
528
 
@@ -566,7 +571,7 @@ describe('EVM Family', () => {
566
571
  expect(
567
572
  ledgerOperationToOperations(
568
573
  unrelatedAddress,
569
- 'ethereum',
574
+ CHAIN_ID.ETHEREUM,
570
575
  ledgerExplorerNoneOp,
571
576
  testLogger
572
577
  )[0].value
@@ -575,7 +580,7 @@ describe('EVM Family', () => {
575
580
  expect(
576
581
  ledgerOperationToOperations(
577
582
  unrelatedAddress,
578
- 'ethereum',
583
+ CHAIN_ID.ETHEREUM,
579
584
  {
580
585
  ...ledgerExplorerNoneOp,
581
586
  status: 0,
@@ -624,14 +629,18 @@ describe('EVM Family', () => {
624
629
 
625
630
  // Successful Op (value = transferred only; fee is separate; Ledger Wallet adds fee in bridge)
626
631
  expect(
627
- ledgerOperationToOperations(address, currencyId, ledgerExplorerFeesOp, testLogger)[0]
628
- .value
632
+ ledgerOperationToOperations(
633
+ address,
634
+ CHAIN_ID.ETHEREUM,
635
+ ledgerExplorerFeesOp,
636
+ testLogger
637
+ )[0].value
629
638
  ).toEqual(BigInt(ledgerExplorerFeesOp.value))
630
639
  // Failing Op (value = tx value, same as success)
631
640
  expect(
632
641
  ledgerOperationToOperations(
633
642
  address,
634
- currencyId,
643
+ CHAIN_ID.ETHEREUM,
635
644
  {
636
645
  ...ledgerExplorerFeesOp,
637
646
  status: 0,
@@ -679,14 +688,18 @@ describe('EVM Family', () => {
679
688
 
680
689
  // Successful Op (value = transferred only; fee is separate; Ledger Wallet adds fee in bridge)
681
690
  expect(
682
- ledgerOperationToOperations(address, currencyId, ledgerOperationOut, testLogger)[0]
683
- .value
691
+ ledgerOperationToOperations(
692
+ address,
693
+ CHAIN_ID.ETHEREUM,
694
+ ledgerOperationOut,
695
+ testLogger
696
+ )[0].value
684
697
  ).toEqual(BigInt(ledgerOperationOut.value))
685
698
  // Failing Op (value = tx value, same as success)
686
699
  expect(
687
700
  ledgerOperationToOperations(
688
701
  address,
689
- currencyId,
702
+ CHAIN_ID.ETHEREUM,
690
703
  {
691
704
  ...ledgerOperationOut,
692
705
  status: 0,
@@ -734,13 +747,18 @@ describe('EVM Family', () => {
734
747
 
735
748
  // Successful Op
736
749
  expect(
737
- ledgerOperationToOperations(address, currencyId, ledgerOperationIn, testLogger)[0].value
750
+ ledgerOperationToOperations(
751
+ address,
752
+ CHAIN_ID.ETHEREUM,
753
+ ledgerOperationIn,
754
+ testLogger
755
+ )[0].value
738
756
  ).toEqual(BigInt(ledgerOperationOut.value))
739
757
  // Failing Op
740
758
  expect(
741
759
  ledgerOperationToOperations(
742
760
  address,
743
- currencyId,
761
+ CHAIN_ID.ETHEREUM,
744
762
  { ...ledgerOperationIn, status: 0 },
745
763
  testLogger
746
764
  )[0].value
@@ -778,7 +796,12 @@ describe('EVM Family', () => {
778
796
  },
779
797
  }
780
798
 
781
- const result = ledgerOperationToOperations(address, currencyId, ledgerOp, testLogger)
799
+ const result = ledgerOperationToOperations(
800
+ address,
801
+ CHAIN_ID.ETHEREUM,
802
+ ledgerOp,
803
+ testLogger
804
+ )
782
805
 
783
806
  expect(result).toHaveLength(1)
784
807
  expect(result[0].recipients).toEqual([])
@@ -815,7 +838,12 @@ describe('EVM Family', () => {
815
838
  },
816
839
  }
817
840
 
818
- const result = ledgerOperationToOperations(address, currencyId, ledgerOp, testLogger)
841
+ const result = ledgerOperationToOperations(
842
+ address,
843
+ CHAIN_ID.ETHEREUM,
844
+ ledgerOp,
845
+ testLogger
846
+ )
819
847
 
820
848
  expect(result).toHaveLength(1)
821
849
  expect(result[0].senders).toEqual([])
@@ -823,7 +851,6 @@ describe('EVM Family', () => {
823
851
 
824
852
  it('should detect a Monad staking withdraw (value 0 contract call) as a WITHDRAW_UNBONDED operation instead of FEES', () => {
825
853
  const monadAddress = '0x6cbcd73cd8e8a42844662f0a0e76d7f79afd933d'
826
- const monadCurrencyId = 'monad'
827
854
 
828
855
  const ledgerOp: LedgerExplorerOperation = {
829
856
  hash: '0xf350d4f8e910419e2d5cec294d44e69af8c6185b7089061d33bb4fc246cefb79',
@@ -862,7 +889,7 @@ describe('EVM Family', () => {
862
889
 
863
890
  const result = ledgerOperationToOperations(
864
891
  monadAddress,
865
- monadCurrencyId,
892
+ CHAIN_ID.MONAD,
866
893
  ledgerOp,
867
894
  testLogger
868
895
  )
@@ -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) {
@@ -2,6 +2,7 @@
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
4
  import type { EvmConfigInfo } from '../config'
5
+ import { CHAIN_ID } from '../config'
5
6
  import { createMockEvmContext } from '../fixtures/context.fixtures'
6
7
  import { createApi } from './index'
7
8
 
@@ -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: {
@@ -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)
package/src/api/index.ts CHANGED
@@ -77,7 +77,7 @@ export function createApi(currencyId: string) {
77
77
  call: async (context: EvmContext, params: CallParams): Promise<string> => {
78
78
  const config = await context.config(currencyId)
79
79
  const callParams = parseCallParams(params)
80
- return getNodeApi(config, currencyId, context.logger).call(currencyId, callParams)
80
+ return getNodeApi(config, context.logger).call(callParams)
81
81
  },
82
82
  combine: (
83
83
  _context: EvmContext,
@@ -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
+ })