@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
@@ -351,7 +351,6 @@ type AdaptedLedgerOperations = {
351
351
  function adaptLedgerRecords(
352
352
  config: EvmConfigInfo,
353
353
  logger: Logger,
354
- currencyId: string,
355
354
  address: string,
356
355
  records: LedgerExplorerOperation[]
357
356
  ): AdaptedLedgerOperations {
@@ -366,7 +365,7 @@ function adaptLedgerRecords(
366
365
  nativeContractsSet.has(contract.toLowerCase())
367
366
 
368
367
  for (const ledgerOp of records) {
369
- const coinOps = ledgerOperationToOperations(address, currencyId, ledgerOp, logger)
368
+ const coinOps = ledgerOperationToOperations(address, config.chainId, ledgerOp, logger)
370
369
 
371
370
  const erc20TransferEvents =
372
371
  nativeContractsSet.size === 0
@@ -411,7 +410,6 @@ function adaptLedgerRecords(
411
410
  export const getOperations: ExplorerApi['getOperations'] = async (
412
411
  config,
413
412
  logger,
414
- currencyId,
415
413
  address,
416
414
  fromBlock,
417
415
  toBlock,
@@ -463,7 +461,7 @@ export const getOperations: ExplorerApi['getOperations'] = async (
463
461
  }
464
462
 
465
463
  return {
466
- ...adaptLedgerRecords(config, logger, currencyId, address, records),
464
+ ...adaptLedgerRecords(config, logger, address, records),
467
465
  nextPagingToken,
468
466
  }
469
467
  }
@@ -481,7 +479,6 @@ export const getOperations: ExplorerApi['getOperations'] = async (
481
479
  export const discoverTokenAssets: ExplorerApi['discoverTokenAssets'] = async (
482
480
  config,
483
481
  logger,
484
- _currencyId,
485
482
  address,
486
483
  fromBlock
487
484
  ) => {
@@ -17,7 +17,6 @@ export type ExplorerApi = {
17
17
  getOperations: (
18
18
  config: EvmConfigInfo,
19
19
  logger: Logger,
20
- currencyId: string,
21
20
  address: string,
22
21
  fromBlock: number,
23
22
  toBlock: number | undefined,
@@ -46,7 +45,6 @@ export type ExplorerApi = {
46
45
  discoverTokenAssets: (
47
46
  config: EvmConfigInfo,
48
47
  logger: Logger,
49
- currencyId: string,
50
48
  address: string,
51
49
  fromBlock?: number
52
50
  ) => Promise<AssetInfo[]>
@@ -187,6 +187,7 @@ export async function getTransactionFromExplorerProxy(
187
187
  parseHexBigInt(receipt.gasPrice) ??
188
188
  parseHexBigInt(tx.gasPrice) ??
189
189
  0n
190
+ const gasLimitBig = parseHexBigInt(tx.gas)
190
191
  const statusBig = parseHexBigInt(receipt.status)
191
192
  const blockNumberBig = parseHexBigInt(tx.blockNumber)
192
193
  const txTypeBig = parseHexBigInt(receipt.type) ?? parseHexBigInt(tx.type)
@@ -241,6 +242,7 @@ export async function getTransactionFromExplorerProxy(
241
242
  nonce: Number(nonceBig),
242
243
  gasUsed: gasUsedBig.toString(),
243
244
  gasPrice: gasPriceBig.toString(),
245
+ ...(gasLimitBig !== null ? { gasLimit: gasLimitBig.toString() } : {}),
244
246
  status: statusBig !== null ? Number(statusBig) : null,
245
247
  value: valueBig.toString(),
246
248
  from,
@@ -276,17 +278,17 @@ export function createExplorerProxyNodeApi(
276
278
  logger: Logger
277
279
  ): NodeApi {
278
280
  return {
279
- call: (_c, _p) => notSupported('call'),
280
- getCoinBalance: (_c, _a) => notSupported('getCoinBalance'),
281
- getTokenBalance: (_c, _a, _ca) => notSupported('getTokenBalance'),
282
- getTokenAllowance: (_c, _o, _ca, _s) => notSupported('getTokenAllowance'),
283
- getTransactionCount: (_c, _a) => notSupported('getTransactionCount'),
284
- getGasEstimation: (_c, _a, _t) => notSupported('getGasEstimation'),
285
- getFeeData: (_cfg, _c, _t) => notSupported('getFeeData'),
286
- broadcastTransaction: (_c, _tx) => notSupported('broadcastTransaction'),
287
- getOptimismAdditionalFees: (_c, _t) => notSupported('getOptimismAdditionalFees'),
288
- getScrollAdditionalFees: (_c, _t) => notSupported('getScrollAdditionalFees'),
289
- getBlockByHeight: async (_c, height) => {
281
+ call: (_p) => notSupported('call'),
282
+ getCoinBalance: (_a) => notSupported('getCoinBalance'),
283
+ getTokenBalance: (_a, _ca) => notSupported('getTokenBalance'),
284
+ getTokenAllowance: (_o, _ca, _s) => notSupported('getTokenAllowance'),
285
+ getTransactionCount: (_a) => notSupported('getTransactionCount'),
286
+ getGasEstimation: (_a, _t) => notSupported('getGasEstimation'),
287
+ getFeeData: (_cfg, _t) => notSupported('getFeeData'),
288
+ broadcastTransaction: (_tx) => notSupported('broadcastTransaction'),
289
+ getOptimismAdditionalFees: (_t) => notSupported('getOptimismAdditionalFees'),
290
+ getScrollAdditionalFees: (_t) => notSupported('getScrollAdditionalFees'),
291
+ getBlockByHeight: async (height) => {
290
292
  if (typeof height !== 'number')
291
293
  throw new Error('EVM getBlockByHeight: explorer proxy only supports numeric heights')
292
294
  const result = await getBlockFromExplorerProxy(explorerUri, height, explorerRetries, logger)
@@ -296,7 +298,7 @@ export function createExplorerProxyNodeApi(
296
298
  )
297
299
  return result
298
300
  },
299
- getTransaction: async (_c, hash) => {
301
+ getTransaction: async (hash) => {
300
302
  const result = await getTransactionFromExplorerProxy(
301
303
  explorerUri,
302
304
  hash,
@@ -1,7 +1,7 @@
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 { ChainId, EvmConfigInfo } from '../../config'
5
5
  import type { NodeApi } from './types'
6
6
  import type { Logger } from '@ledgerhq/coin-module-framework/config'
7
7
  import { DEFAULT_LEDGER_EXPLORER_URI } from '../../config'
@@ -13,23 +13,23 @@ import { withNodeSources } from './withNodeSources'
13
13
  /**
14
14
  * Memoized NodeApi instances for both ledger and external nodes.
15
15
  * Key includes all config dimensions that affect the API instance's behavior.
16
- * Unbounded growth is acceptable: the number of entries is at most (currencies × distinct
17
- * node configs). In practice there are few EVM chains and config is static per currency,
16
+ * Unbounded growth is acceptable: the number of entries is at most (chains × distinct
17
+ * node configs). In practice there are few EVM chains and config is static per chain,
18
18
  * so the cache stays small.
19
19
  */
20
20
  const nodeApiCache = new Map<string, NodeApi>()
21
21
 
22
22
  function cacheKey(
23
- currencyId: string,
23
+ chainId: ChainId,
24
24
  node: { type: string; [key: string]: unknown },
25
25
  explorerUri: string,
26
26
  clientVersion: string,
27
27
  nodeSources: string
28
28
  ): string {
29
- return `${currencyId}:${JSON.stringify(node)}:${explorerUri}:${clientVersion}:${nodeSources}`
29
+ return `${chainId}:${JSON.stringify(node)}:${explorerUri}:${clientVersion}:${nodeSources}`
30
30
  }
31
31
 
32
- export const getNodeApi = (config: EvmConfigInfo, currencyId: string, logger: Logger): NodeApi => {
32
+ export const getNodeApi = (config: EvmConfigInfo, logger: Logger): NodeApi => {
33
33
  const node = config?.node
34
34
  const type = node?.type
35
35
 
@@ -40,13 +40,16 @@ export const getNodeApi = (config: EvmConfigInfo, currencyId: string, logger: Lo
40
40
  const explorerUri = config.ledgerExplorerUri ?? DEFAULT_LEDGER_EXPLORER_URI
41
41
  const clientVersion = config.ledgerClientVersion ?? ''
42
42
  const nodeSources = JSON.stringify(config.nodeSources ?? ['node'])
43
- const key = cacheKey(currencyId, node, explorerUri, clientVersion, nodeSources)
43
+ const key = cacheKey(config.chainId, node, explorerUri, clientVersion, nodeSources)
44
44
 
45
45
  let api = nodeApiCache.get(key)
46
46
  if (api === undefined) {
47
47
  const raw =
48
48
  type === 'ledger'
49
- ? createLedgerNodeApi({ ...node, explorerUri, clientVersion }, logger)
49
+ ? createLedgerNodeApi(
50
+ { ...node, explorerUri, clientVersion, chainId: config.chainId },
51
+ logger
52
+ )
50
53
  : createNodeApi(config, node, logger)
51
54
  api = withNodeSources(raw, config, logger)
52
55
  nodeApiCache.set(key, api)
@@ -1,7 +1,7 @@
1
1
  // SPDX-FileCopyrightText: © 2026 LEDGER SAS
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
- import type { BlockFinalizationTag, LedgerNodeConfig } from '../../config'
4
+ import type { BlockFinalizationTag, ChainId, LedgerNodeConfig } from '../../config'
5
5
  import type { LedgerExplorerOperation } from '../../types'
6
6
  import type { BlockByHeightResult, EvmCallParams, NodeApi, TransactionInfo } from './types'
7
7
  import type { Logger } from '@ledgerhq/coin-module-framework/config'
@@ -14,6 +14,7 @@ import { ethers } from 'ethers'
14
14
  import { toInterfaceAbi } from '../../abis'
15
15
  import ERC20Abi from '../../abis/erc20.abi.json'
16
16
  import OptimismGasPriceOracleAbi from '../../abis/optimismGasPriceOracle.abi.json'
17
+ import { CHAIN_ID } from '../../config'
17
18
  import { GasEstimationError } from '../../errors'
18
19
  import { normalizeAddress, padHexString, safeEncodeEIP55 } from '../../logic-public'
19
20
  import { getGasOptions } from '../gasTracker/ledger'
@@ -25,6 +26,8 @@ const DEFAULT_RETRIES_API = 2
25
26
 
26
27
  /** The node config, narrowed and defaulted, as the request builders need it. */
27
28
  export type LedgerNodeApiConfig = LedgerNodeConfig & {
29
+ /** The chain this node API serves, to key its per-chain caches. */
30
+ chainId: ChainId
28
31
  explorerUri: string
29
32
  clientVersion?: string
30
33
  }
@@ -52,17 +55,16 @@ function makeFetchWithRetries(config: LedgerNodeApiConfig): LedgerFetch {
52
55
  }
53
56
 
54
57
  function make<Args extends readonly unknown[], R>(
55
- f: (fetch: LedgerFetch, config: LedgerNodeApiConfig, currencyId: string, ...args: Args) => R,
58
+ f: (fetch: LedgerFetch, config: LedgerNodeApiConfig, ...args: Args) => R,
56
59
  config: LedgerNodeApiConfig,
57
60
  fetch: LedgerFetch
58
- ): (currencyId: string, ...args: Args) => R {
59
- return (currencyId, ...args) => f(fetch, config, currencyId, ...args)
61
+ ): (...args: Args) => R {
62
+ return (...args) => f(fetch, config, ...args)
60
63
  }
61
64
 
62
65
  async function getTransaction(
63
66
  fetch: LedgerFetch,
64
67
  config: LedgerNodeApiConfig,
65
- _currencyId: string,
66
68
  hash: string,
67
69
  logger: Logger
68
70
  ): Promise<TransactionInfo> {
@@ -77,6 +79,7 @@ async function getTransaction(
77
79
  blockHash: ledgerTransaction.block?.hash,
78
80
  nonce: ledgerTransaction.nonce_value,
79
81
  gasPrice: ledgerTransaction.gas_price,
82
+ ...(ledgerTransaction.gas ? { gasLimit: ledgerTransaction.gas } : {}),
80
83
  gasUsed: ledgerTransaction.gas_used,
81
84
  value: ledgerTransaction.value,
82
85
  status: ledgerTransaction.status,
@@ -98,7 +101,7 @@ function makeGetTokenBalance(
98
101
  config: LedgerNodeApiConfig,
99
102
  fetch: LedgerFetch,
100
103
  tokenBalancesBatchersMap: Map<
101
- string,
104
+ ChainId,
102
105
  Batcher<
103
106
  {
104
107
  address: string
@@ -108,12 +111,12 @@ function makeGetTokenBalance(
108
111
  >
109
112
  >
110
113
  ): NodeApi['getTokenBalance'] {
111
- return async (currencyId, address, contractAddress) => {
112
- if (!tokenBalancesBatchersMap.has(currencyId)) {
114
+ return async (address, contractAddress) => {
115
+ if (!tokenBalancesBatchersMap.has(config.chainId)) {
113
116
  const batcher = makeBatcher(makeGetBatchTokenBalances(config, fetch), {})
114
- tokenBalancesBatchersMap.set(currencyId, batcher)
117
+ tokenBalancesBatchersMap.set(config.chainId, batcher)
115
118
  }
116
- const requestBatcher = tokenBalancesBatchersMap.get(currencyId)!
119
+ const requestBatcher = tokenBalancesBatchersMap.get(config.chainId)!
117
120
  return requestBatcher({ address, contract: contractAddress })
118
121
  }
119
122
  }
@@ -121,7 +124,6 @@ function makeGetTokenBalance(
121
124
  async function getCoinBalance(
122
125
  fetch: LedgerFetch,
123
126
  config: LedgerNodeApiConfig,
124
- _currencyId: string,
125
127
  address: string
126
128
  ): Promise<BigNumber> {
127
129
  const { balance } = await fetch<{ address: string; balance: string }>({
@@ -157,7 +159,6 @@ function makeGetBatchTokenBalances(
157
159
  async function getTransactionCount(
158
160
  fetch: LedgerFetch,
159
161
  config: LedgerNodeApiConfig,
160
- _currencyId: string,
161
162
  address: string
162
163
  ): Promise<number> {
163
164
  const { nonce } = await fetch<{ address: string; nonce: number }>({
@@ -172,7 +173,7 @@ function makeGetGasEstimation(
172
173
  fetch: LedgerFetch,
173
174
  logger: Logger
174
175
  ): NodeApi['getGasEstimation'] {
175
- return async (_currencyId, address, transaction) => {
176
+ return async (address, transaction) => {
176
177
  const { recipient: to, amount: value, data } = transaction
177
178
  try {
178
179
  const { estimated_gas_limit: gasEstimation } = await fetch<{
@@ -201,8 +202,7 @@ async function getFeeData(
201
202
  _fetch: LedgerFetch,
202
203
  config: LedgerNodeApiConfig,
203
204
  evmConfig: Parameters<NodeApi['getFeeData']>[0],
204
- _currencyId: Parameters<NodeApi['getFeeData']>[1],
205
- transaction: Parameters<NodeApi['getFeeData']>[2]
205
+ transaction: Parameters<NodeApi['getFeeData']>[1]
206
206
  ): Promise<Awaited<ReturnType<NodeApi['getFeeData']>>> {
207
207
  const options = await getGasOptions({
208
208
  config: evmConfig,
@@ -221,9 +221,8 @@ async function getFeeData(
221
221
  async function broadcastTransaction(
222
222
  fetch: LedgerFetch,
223
223
  config: LedgerNodeApiConfig,
224
- _currencyId: string,
225
224
  signedTxHex: string,
226
- broadcastConfig?: Parameters<NodeApi['broadcastTransaction']>[2]
225
+ broadcastConfig?: Parameters<NodeApi['broadcastTransaction']>[1]
227
226
  ): Promise<string> {
228
227
  const params: Record<string, boolean> = {
229
228
  mevProtected: Boolean(broadcastConfig?.mevProtected),
@@ -247,7 +246,6 @@ async function broadcastTransaction(
247
246
  async function getBlockByHeight(
248
247
  fetch: LedgerFetch,
249
248
  config: LedgerNodeApiConfig,
250
- _currencyId: string,
251
249
  blockHeight: number | BlockFinalizationTag = 'latest',
252
250
  _prefetchTxs = false
253
251
  ): Promise<BlockByHeightResult> {
@@ -288,14 +286,17 @@ async function getBlockByHeight(
288
286
  async function getOptimismAdditionalFees(
289
287
  fetch: LedgerFetch,
290
288
  config: LedgerNodeApiConfig,
291
- currencyId: string,
292
289
  transaction: string
293
290
  ): Promise<BigNumber> {
294
- if (
295
- !['optimism', 'optimism_sepolia', 'blast', 'blast_sepolia', 'base', 'base_sepolia'].includes(
296
- currencyId
297
- )
298
- ) {
291
+ const optimismFeeChainIds: readonly ChainId[] = [
292
+ CHAIN_ID.OPTIMISM,
293
+ CHAIN_ID.OPTIMISM_SEPOLIA,
294
+ CHAIN_ID.BLAST,
295
+ CHAIN_ID.BLAST_SEPOLIA,
296
+ CHAIN_ID.BASE,
297
+ CHAIN_ID.BASE_SEPOLIA,
298
+ ]
299
+ if (!optimismFeeChainIds.includes(config.chainId)) {
299
300
  return new BigNumber(0)
300
301
  }
301
302
  if (!transaction) {
@@ -338,7 +339,6 @@ type ContractReadResult = {
338
339
  async function call(
339
340
  fetch: LedgerFetch,
340
341
  config: LedgerNodeApiConfig,
341
- _currencyId: string,
342
342
  params: EvmCallParams
343
343
  ): Promise<string> {
344
344
  // `contract/read` accepts a decimal block height or a tag ("latest"/"earliest"/"pending"); it
@@ -374,7 +374,7 @@ function makeGetTokenAllowance(
374
374
  fetch: LedgerFetch
375
375
  ): NodeApi['getTokenAllowance'] {
376
376
  const iface = new ethers.Interface(toInterfaceAbi(ERC20Abi))
377
- return async (_currencyId, ownerAddress, contractAddress, spenderAddress) => {
377
+ return async (ownerAddress, contractAddress, spenderAddress) => {
378
378
  const data = iface.encodeFunctionData('allowance', [
379
379
  ethers.getAddress(ownerAddress),
380
380
  ethers.getAddress(spenderAddress),
@@ -396,10 +396,9 @@ function makeGetTokenAllowance(
396
396
  async function getScrollAdditionalFees(
397
397
  fetch: LedgerFetch,
398
398
  config: LedgerNodeApiConfig,
399
- currencyId: string,
400
399
  transaction: string
401
400
  ): Promise<BigNumber> {
402
- if (currencyId !== 'scroll') {
401
+ if (config.chainId !== CHAIN_ID.SCROLL) {
403
402
  return new BigNumber(0)
404
403
  }
405
404
  if (!transaction) {
@@ -428,7 +427,7 @@ async function getScrollAdditionalFees(
428
427
  export function createLedgerNodeApi(config: LedgerNodeApiConfig, logger: Logger): NodeApi {
429
428
  const fetch = makeFetchWithRetries(config)
430
429
  const tokenBalancesBatchersMap = new Map<
431
- string,
430
+ ChainId,
432
431
  Batcher<{ address: string; contract: string }, BigNumber>
433
432
  >()
434
433
  return {
@@ -438,12 +437,11 @@ export function createLedgerNodeApi(config: LedgerNodeApiConfig, logger: Logger)
438
437
  getTokenBalance: makeGetTokenBalance(config, fetch, tokenBalancesBatchersMap),
439
438
  getTokenAllowance: makeGetTokenAllowance(config, fetch),
440
439
  getTransactionCount: make(getTransactionCount, config, fetch),
441
- getTransaction: (currencyId, hash) => getTransaction(fetch, config, currencyId, hash, logger),
440
+ getTransaction: (hash) => getTransaction(fetch, config, hash, logger),
442
441
  getGasEstimation: makeGetGasEstimation(config, fetch, logger),
443
- // getFeeData takes `config` (EvmConfigInfo) first, not `currency`, so it doesn't fit the
444
- // currency-first `make` type bound; bind it directly (same fetch/config passthrough as `make`).
445
- getFeeData: (evmConfig, currencyId, transaction) =>
446
- getFeeData(fetch, config, evmConfig, currencyId, transaction),
442
+ // getFeeData takes `config` (EvmConfigInfo) first, so it doesn't fit the `make` wrapper;
443
+ // bind it directly (same fetch/config passthrough as `make`).
444
+ getFeeData: (evmConfig, transaction) => getFeeData(fetch, config, evmConfig, transaction),
447
445
  broadcastTransaction: make(broadcastTransaction, config, fetch),
448
446
  getOptimismAdditionalFees: make(getOptimismAdditionalFees, config, fetch),
449
447
  getScrollAdditionalFees: make(getScrollAdditionalFees, config, fetch),