@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
@@ -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',
@@ -77,6 +77,8 @@ describe('EVM Family', () => {
77
77
  },
78
78
  details: {
79
79
  sequence: '7',
80
+ gasPrice: '125521409858',
81
+ gasLimit: '6000000',
80
82
  contractInteraction: 'SmartContractDeployment',
81
83
  contractAddress: '0x4969D9fD2542e71e6b3EA87bE54EA9a736bcC4E9',
82
84
  contractPayload:
@@ -85,7 +87,7 @@ describe('EVM Family', () => {
85
87
  }
86
88
 
87
89
  expect(
88
- etherscanOperationToOperations(address, currencyId, etherscanOp, testLogger)
90
+ etherscanOperationToOperations(address, CHAIN_ID.ETHEREUM, etherscanOp, testLogger)
89
91
  ).toEqual([expectedOperation])
90
92
  })
91
93
 
@@ -115,7 +117,6 @@ describe('EVM Family', () => {
115
117
  }
116
118
 
117
119
  const address = '0x9aa99c23f67c81701c772b106b4f83f6e858dd2e'
118
- const currencyId = 'ethereum'
119
120
 
120
121
  const expectedOperation = {
121
122
  id: '0x9aa99c23f67c81701c772b106b4f83f6e858dd2e-0xaa45b4858ba44230a5fce5a29570a5dec2bf1f0ba95bacdec4fe8f2c4fa99338-FEES',
@@ -138,6 +139,8 @@ describe('EVM Family', () => {
138
139
  },
139
140
  details: {
140
141
  sequence: '7',
142
+ gasPrice: '125521409858',
143
+ gasLimit: '6000000',
141
144
  contractInteraction: 'SmartContractInteraction',
142
145
  contractAddress: '0xc5102fE9359FD9a28f877a67E36B0F050d81a3CC',
143
146
  contractPayload:
@@ -146,7 +149,7 @@ describe('EVM Family', () => {
146
149
  }
147
150
 
148
151
  expect(
149
- etherscanOperationToOperations(address, currencyId, etherscanOp, testLogger)
152
+ etherscanOperationToOperations(address, CHAIN_ID.ETHEREUM, etherscanOp, testLogger)
150
153
  ).toEqual([expectedOperation])
151
154
  })
152
155
 
@@ -175,7 +178,6 @@ describe('EVM Family', () => {
175
178
  }
176
179
 
177
180
  const address = '0x829BD824B016326A401d083B33D092293333A830'
178
- const currencyId = 'ethereum'
179
181
 
180
182
  const expectedOperation = {
181
183
  id: '0x829BD824B016326A401d083B33D092293333A830-0x8d3e871469ce549c5a80b8c8beaae0d502ecea85bb43eb84703cebeea7d25944-OUT',
@@ -196,11 +198,11 @@ describe('EVM Family', () => {
196
198
  failed: false,
197
199
  feesPayer: '0x829BD824B016326A401d083B33D092293333A830',
198
200
  },
199
- details: { sequence: '11898499' },
201
+ details: { sequence: '11898499', gasPrice: '68363841693', gasLimit: '210000' },
200
202
  }
201
203
 
202
204
  expect(
203
- etherscanOperationToOperations(address, currencyId, etherscanOp, testLogger)
205
+ etherscanOperationToOperations(address, CHAIN_ID.ETHEREUM, etherscanOp, testLogger)
204
206
  ).toEqual([expectedOperation])
205
207
  })
206
208
 
@@ -229,7 +231,6 @@ describe('EVM Family', () => {
229
231
  }
230
232
 
231
233
  const address = '0x829BD824B016326A401d083B33D092293333A830'
232
- const currencyId = 'ethereum'
233
234
 
234
235
  const expectedOperation = {
235
236
  id: '0x829BD824B016326A401d083B33D092293333A830-0x8d3e871469ce549c5a80b8c8beaae0d502ecea85bb43eb84703cebeea7d25944-IN',
@@ -250,11 +251,11 @@ describe('EVM Family', () => {
250
251
  failed: false,
251
252
  feesPayer: '0x26E3fd2dEc89bF645BA7b41c4DdFad8454Ee6245',
252
253
  },
253
- details: { sequence: '11898499' },
254
+ details: { sequence: '11898499', gasPrice: '68363841693', gasLimit: '210000' },
254
255
  }
255
256
 
256
257
  expect(
257
- etherscanOperationToOperations(address, currencyId, etherscanOp, testLogger)
258
+ etherscanOperationToOperations(address, CHAIN_ID.ETHEREUM, etherscanOp, testLogger)
258
259
  ).toEqual([expectedOperation])
259
260
  })
260
261
 
@@ -283,7 +284,6 @@ describe('EVM Family', () => {
283
284
  }
284
285
 
285
286
  const address = '0x829BD824B016326A401d083B33D092293333A830'
286
- const currencyId = 'ethereum'
287
287
 
288
288
  const expectedOperation = {
289
289
  id: '0x829BD824B016326A401d083B33D092293333A830-0x8d3e871469ce549c5a80b8c8beaae0d502ecea85bb43eb84703cebeea7d25944-NONE',
@@ -304,11 +304,11 @@ describe('EVM Family', () => {
304
304
  failed: false,
305
305
  feesPayer: '0x6bfD74C0996F269Bcece59191EFf667b3dFD73b9',
306
306
  },
307
- details: { sequence: '11898499' },
307
+ details: { sequence: '11898499', gasPrice: '68363841693', gasLimit: '210000' },
308
308
  }
309
309
 
310
310
  expect(
311
- etherscanOperationToOperations(address, currencyId, etherscanOp, testLogger)
311
+ etherscanOperationToOperations(address, CHAIN_ID.ETHEREUM, etherscanOp, testLogger)
312
312
  ).toEqual([expectedOperation])
313
313
  })
314
314
 
@@ -337,7 +337,6 @@ describe('EVM Family', () => {
337
337
  }
338
338
 
339
339
  const address = '0x9aa99c23f67c81701c772b106b4f83f6e858dd2e'
340
- const currencyId = 'ethereum'
341
340
 
342
341
  const selfSendTx = {
343
342
  hash: '0xaa45b4858ba44230a5fce5a29570a5dec2bf1f0ba95bacdec4fe8f2c4fa99338',
@@ -361,7 +360,7 @@ describe('EVM Family', () => {
361
360
  value: 1000n,
362
361
  asset: { type: 'native' },
363
362
  tx: selfSendTx,
364
- details: { sequence: '7' },
363
+ details: { sequence: '7', gasPrice: '125521409858', gasLimit: '21000' },
365
364
  },
366
365
  {
367
366
  id: '0x9aa99c23f67c81701c772b106b4f83f6e858dd2e-0xaa45b4858ba44230a5fce5a29570a5dec2bf1f0ba95bacdec4fe8f2c4fa99338-OUT',
@@ -371,18 +370,17 @@ describe('EVM Family', () => {
371
370
  value: 1000n,
372
371
  asset: { type: 'native' },
373
372
  tx: selfSendTx,
374
- details: { sequence: '7' },
373
+ details: { sequence: '7', gasPrice: '125521409858', gasLimit: '21000' },
375
374
  },
376
375
  ]
377
376
 
378
377
  expect(
379
- etherscanOperationToOperations(address, currencyId, etherscanOp, testLogger)
378
+ etherscanOperationToOperations(address, CHAIN_ID.ETHEREUM, etherscanOp, testLogger)
380
379
  ).toEqual(expectedOperations)
381
380
  })
382
381
 
383
382
  it('should return an operation with the expected amount', () => {
384
383
  const address = '0x9aa99c23f67c81701c772b106b4f83f6e858dd2e'
385
- const currencyId = 'ethereum'
386
384
 
387
385
  const etherscanOpFees: EtherscanOperation = {
388
386
  blockNumber: '14923692',
@@ -410,14 +408,18 @@ describe('EVM Family', () => {
410
408
 
411
409
  // Successful Op (value = transferred only; fee is separate; Ledger Wallet adds fee in bridge)
412
410
  expect(
413
- etherscanOperationToOperations(address, currencyId, etherscanOpFees, testLogger)[0]
414
- .value
411
+ etherscanOperationToOperations(
412
+ address,
413
+ CHAIN_ID.ETHEREUM,
414
+ etherscanOpFees,
415
+ testLogger
416
+ )[0].value
415
417
  ).toEqual(BigInt(etherscanOpFees.value))
416
418
  // Failing Op (value = tx value, same as success)
417
419
  expect(
418
420
  etherscanOperationToOperations(
419
421
  address,
420
- currencyId,
422
+ CHAIN_ID.ETHEREUM,
421
423
  {
422
424
  ...etherscanOpFees,
423
425
  isError: '1',
@@ -451,13 +453,18 @@ describe('EVM Family', () => {
451
453
 
452
454
  // Successful Op (value = transferred only; fee is separate; Ledger Wallet adds fee in bridge)
453
455
  expect(
454
- etherscanOperationToOperations(address, currencyId, etherscanOpOut, testLogger)[0].value
456
+ etherscanOperationToOperations(
457
+ address,
458
+ CHAIN_ID.ETHEREUM,
459
+ etherscanOpOut,
460
+ testLogger
461
+ )[0].value
455
462
  ).toEqual(BigInt(etherscanOpOut.value))
456
463
  // Failing Op (value = tx value, same as success)
457
464
  expect(
458
465
  etherscanOperationToOperations(
459
466
  address,
460
- currencyId,
467
+ CHAIN_ID.ETHEREUM,
461
468
  {
462
469
  ...etherscanOpOut,
463
470
  isError: '1',
@@ -491,13 +498,14 @@ describe('EVM Family', () => {
491
498
 
492
499
  // Successful Op
493
500
  expect(
494
- etherscanOperationToOperations(address, currencyId, etherscanOpIn, testLogger)[0].value
501
+ etherscanOperationToOperations(address, CHAIN_ID.ETHEREUM, etherscanOpIn, testLogger)[0]
502
+ .value
495
503
  ).toEqual(BigInt(etherscanOpIn.value))
496
504
  // Failing Op
497
505
  expect(
498
506
  etherscanOperationToOperations(
499
507
  address,
500
- currencyId,
508
+ CHAIN_ID.ETHEREUM,
501
509
  {
502
510
  ...etherscanOpIn,
503
511
  isError: '1',
@@ -535,11 +543,10 @@ describe('EVM Family', () => {
535
543
 
536
544
  it('should handle transaction with empty gasPrice without throwing (Blockscout Optimism)', () => {
537
545
  const address = '0xB10770cE9f8532634b6Ba156b8789f19935210F0'
538
- const currencyId = 'optimism'
539
546
 
540
547
  const result = etherscanOperationToOperations(
541
548
  address,
542
- currencyId,
549
+ CHAIN_ID.OPTIMISM,
543
550
  rawBlockscoutTransaction,
544
551
  testLogger
545
552
  )
@@ -551,11 +558,12 @@ describe('EVM Family', () => {
551
558
  '0xea18d674a91c9b7459baad0e138bcca25fa342d8fa692c66489248a3ebb4ca9d'
552
559
  )
553
560
  expect(result[0].type).toBe('OUT')
561
+ expect(result[0].details).not.toHaveProperty('gasPrice')
562
+ expect(result[0].details).toHaveProperty('gasLimit', '163840')
554
563
  })
555
564
 
556
565
  it('should handle failed transaction with empty gasPrice', () => {
557
566
  const address = '0xB10770cE9f8532634b6Ba156b8789f19935210F0'
558
- const currencyId = 'optimism'
559
567
 
560
568
  const failedTransaction: EtherscanOperation = {
561
569
  ...rawBlockscoutTransaction,
@@ -566,7 +574,7 @@ describe('EVM Family', () => {
566
574
 
567
575
  const result = etherscanOperationToOperations(
568
576
  address,
569
- currencyId,
577
+ CHAIN_ID.OPTIMISM,
570
578
  failedTransaction,
571
579
  testLogger
572
580
  )
@@ -579,7 +587,6 @@ describe('EVM Family', () => {
579
587
 
580
588
  it('should handle transaction with both empty gasPrice and empty value', () => {
581
589
  const address = '0xB10770cE9f8532634b6Ba156b8789f19935210F0'
582
- const currencyId = 'optimism'
583
590
 
584
591
  const txWithEmptyValue: EtherscanOperation = {
585
592
  ...rawBlockscoutTransaction,
@@ -588,7 +595,7 @@ describe('EVM Family', () => {
588
595
 
589
596
  const result = etherscanOperationToOperations(
590
597
  address,
591
- currencyId,
598
+ CHAIN_ID.OPTIMISM,
592
599
  txWithEmptyValue,
593
600
  testLogger
594
601
  )
@@ -598,6 +605,20 @@ describe('EVM Family', () => {
598
605
  expect(result[0].value).toEqual(0n)
599
606
  })
600
607
 
608
+ it('should omit an empty gas limit from details', () => {
609
+ const address = '0xB10770cE9f8532634b6Ba156b8789f19935210F0'
610
+
611
+ const [operation] = etherscanOperationToOperations(
612
+ address,
613
+ CHAIN_ID.OPTIMISM,
614
+ { ...rawBlockscoutTransaction, gasPrice: '1000', gas: '' },
615
+ testLogger
616
+ )
617
+
618
+ expect(operation.details).toHaveProperty('gasPrice', '1000')
619
+ expect(operation.details).not.toHaveProperty('gasLimit')
620
+ })
621
+
601
622
  it('should produce empty recipients when both to and contractAddress are empty strings', () => {
602
623
  const etherscanOp: EtherscanOperation = {
603
624
  blockNumber: '14923692',
@@ -622,11 +643,10 @@ describe('EVM Family', () => {
622
643
  }
623
644
 
624
645
  const address = '0x9aa99c23f67c81701c772b106b4f83f6e858dd2e'
625
- const currencyId = 'ethereum'
626
646
 
627
647
  const result = etherscanOperationToOperations(
628
648
  address,
629
- currencyId,
649
+ CHAIN_ID.ETHEREUM,
630
650
  etherscanOp,
631
651
  testLogger
632
652
  )
@@ -659,11 +679,10 @@ describe('EVM Family', () => {
659
679
  }
660
680
 
661
681
  const address = '0x9aa99c23f67c81701c772b106b4f83f6e858dd2e'
662
- const currencyId = 'ethereum'
663
682
 
664
683
  const result = etherscanOperationToOperations(
665
684
  address,
666
- currencyId,
685
+ CHAIN_ID.ETHEREUM,
667
686
  etherscanOp,
668
687
  testLogger
669
688
  )
@@ -701,7 +720,7 @@ describe('EVM Family', () => {
701
720
  const address = '0x83802741df938c6cd94c46481cadba5b1b0c2f70'
702
721
  const result = etherscanOperationToOperations(
703
722
  address,
704
- 'optimism',
723
+ CHAIN_ID.OPTIMISM,
705
724
  etherscanOp,
706
725
  testLogger
707
726
  )
@@ -737,7 +756,7 @@ describe('EVM Family', () => {
737
756
 
738
757
  const result = etherscanOperationToOperations(
739
758
  '0x9aa99c23f67c81701c772b106b4f83f6e858dd2e',
740
- 'ethereum',
759
+ CHAIN_ID.ETHEREUM,
741
760
  etherscanOp,
742
761
  testLogger
743
762
  )
@@ -796,6 +815,8 @@ describe('EVM Family', () => {
796
815
  },
797
816
  details: {
798
817
  sequence: '53',
818
+ gasPrice: '24314367325',
819
+ gasLimit: '79381',
799
820
  ledgerOpType: 'OUT',
800
821
  assetAmount: '2000000',
801
822
  assetSenders: ['0x6cBCD73CD8e8a42844662f0A0e76D7F79Afd933d'],
@@ -857,6 +878,8 @@ describe('EVM Family', () => {
857
878
  },
858
879
  details: {
859
880
  sequence: '53',
881
+ gasPrice: '24314367325',
882
+ gasLimit: '79381',
860
883
  ledgerOpType: 'IN',
861
884
  assetAmount: '2000000',
862
885
  assetSenders: ['0xC2907EFccE4011C491BbedA8A0fA63BA7aab596C'],
@@ -949,6 +972,8 @@ describe('EVM Family', () => {
949
972
  tx: sharedErc20Tx,
950
973
  details: {
951
974
  sequence: '53',
975
+ gasPrice: '24314367325',
976
+ gasLimit: '79381',
952
977
  ledgerOpType: 'IN',
953
978
  assetAmount: '2000000',
954
979
  assetSenders: ['0x6cBCD73CD8e8a42844662f0A0e76D7F79Afd933d'],
@@ -969,6 +994,8 @@ describe('EVM Family', () => {
969
994
  tx: sharedErc20Tx,
970
995
  details: {
971
996
  sequence: '53',
997
+ gasPrice: '24314367325',
998
+ gasLimit: '79381',
972
999
  ledgerOpType: 'OUT',
973
1000
  assetAmount: '2000000',
974
1001
  assetSenders: ['0x6cBCD73CD8e8a42844662f0A0e76D7F79Afd933d'],
@@ -1012,6 +1039,8 @@ describe('EVM Family', () => {
1012
1039
  expect(result).toHaveLength(1)
1013
1040
  expect(result[0].tx.fees).toEqual(0n)
1014
1041
  expect(result[0].value).toEqual(1000000000000000000n)
1042
+ expect(result[0].details).not.toHaveProperty('gasPrice')
1043
+ expect(result[0].details).toHaveProperty('gasLimit', '163840')
1015
1044
  })
1016
1045
 
1017
1046
  it('should produce empty recipients when to is an empty string', () => {
@@ -1095,6 +1124,8 @@ describe('EVM Family', () => {
1095
1124
  },
1096
1125
  details: {
1097
1126
  sequence: '0',
1127
+ gasPrice: '40000000000',
1128
+ gasLimit: '158820',
1098
1129
  tokenId: '202106',
1099
1130
  ledgerOpType: 'NFT_OUT',
1100
1131
  assetAmount: '1',
@@ -1153,6 +1184,8 @@ describe('EVM Family', () => {
1153
1184
  },
1154
1185
  details: {
1155
1186
  sequence: '0',
1187
+ gasPrice: '40000000000',
1188
+ gasLimit: '158820',
1156
1189
  tokenId: '202106',
1157
1190
  ledgerOpType: 'NFT_IN',
1158
1191
  assetAmount: '1',
@@ -1242,6 +1275,8 @@ describe('EVM Family', () => {
1242
1275
  tx: sharedErc721Tx,
1243
1276
  details: {
1244
1277
  sequence: '0',
1278
+ gasPrice: '40000000000',
1279
+ gasLimit: '158820',
1245
1280
  tokenId: '202106',
1246
1281
  ledgerOpType: 'NFT_IN',
1247
1282
  assetAmount: '1',
@@ -1259,6 +1294,8 @@ describe('EVM Family', () => {
1259
1294
  tx: sharedErc721Tx,
1260
1295
  details: {
1261
1296
  sequence: '0',
1297
+ gasPrice: '40000000000',
1298
+ gasLimit: '158820',
1262
1299
  tokenId: '202106',
1263
1300
  ledgerOpType: 'NFT_OUT',
1264
1301
  assetAmount: '1',
@@ -1355,6 +1392,8 @@ describe('EVM Family', () => {
1355
1392
  },
1356
1393
  details: {
1357
1394
  sequence: '41',
1395
+ gasPrice: '52898577246',
1396
+ gasLimit: '140000',
1358
1397
  tokenId: '10371',
1359
1398
  ledgerOpType: 'NFT_OUT',
1360
1399
  assetAmount: '1',
@@ -1413,6 +1452,8 @@ describe('EVM Family', () => {
1413
1452
  },
1414
1453
  details: {
1415
1454
  sequence: '41',
1455
+ gasPrice: '52898577246',
1456
+ gasLimit: '140000',
1416
1457
  tokenId: '10371',
1417
1458
  ledgerOpType: 'NFT_IN',
1418
1459
  assetAmount: '1',
@@ -1502,6 +1543,8 @@ describe('EVM Family', () => {
1502
1543
  tx: sharedErc1155Tx,
1503
1544
  details: {
1504
1545
  sequence: '41',
1546
+ gasPrice: '52898577246',
1547
+ gasLimit: '140000',
1505
1548
  tokenId: '10371',
1506
1549
  ledgerOpType: 'NFT_IN',
1507
1550
  assetAmount: '1',
@@ -1519,6 +1562,8 @@ describe('EVM Family', () => {
1519
1562
  tx: sharedErc1155Tx,
1520
1563
  details: {
1521
1564
  sequence: '41',
1565
+ gasPrice: '52898577246',
1566
+ gasLimit: '140000',
1522
1567
  tokenId: '10371',
1523
1568
  ledgerOpType: 'NFT_OUT',
1524
1569
  assetAmount: '1',
@@ -1853,7 +1898,6 @@ describe('EVM Family', () => {
1853
1898
  }
1854
1899
 
1855
1900
  const address = '0x9aa99c23f67c81701c772b106b4f83f6e858dd2e'
1856
- const currencyId = 'sei_evm'
1857
1901
 
1858
1902
  const expectedOperation = {
1859
1903
  id: `${address}-${stakingHash}-DELEGATE`,
@@ -1872,6 +1916,8 @@ describe('EVM Family', () => {
1872
1916
  },
1873
1917
  details: {
1874
1918
  sequence: '7',
1919
+ gasPrice: '125521409858',
1920
+ gasLimit: '6000000',
1875
1921
  contractInteraction: 'SmartContractInteraction',
1876
1922
  contractAddress: '0x0000000000000000000000000000000000001005',
1877
1923
  contractPayload:
@@ -1880,7 +1926,7 @@ describe('EVM Family', () => {
1880
1926
  }
1881
1927
 
1882
1928
  expect(
1883
- etherscanOperationToOperations(address, currencyId, etherscanOp, testLogger)
1929
+ etherscanOperationToOperations(address, CHAIN_ID.SEI_EVM, etherscanOp, testLogger)
1884
1930
  ).toEqual([expectedOperation])
1885
1931
  })
1886
1932
 
@@ -1910,7 +1956,6 @@ describe('EVM Family', () => {
1910
1956
  }
1911
1957
 
1912
1958
  const address = '0x9aa99c23f67c81701c772b106b4f83f6e858dd2e'
1913
- const currencyId = 'sei_evm'
1914
1959
 
1915
1960
  const expectedOperation = {
1916
1961
  id: `${address}-${stakingHash}-REDELEGATE`,
@@ -1929,6 +1974,8 @@ describe('EVM Family', () => {
1929
1974
  },
1930
1975
  details: {
1931
1976
  sequence: '7',
1977
+ gasPrice: '125521409858',
1978
+ gasLimit: '6000000',
1932
1979
  contractInteraction: 'SmartContractInteraction',
1933
1980
  contractAddress: '0x0000000000000000000000000000000000001005',
1934
1981
  contractPayload:
@@ -1937,7 +1984,7 @@ describe('EVM Family', () => {
1937
1984
  }
1938
1985
 
1939
1986
  expect(
1940
- etherscanOperationToOperations(address, currencyId, etherscanOp, testLogger)
1987
+ etherscanOperationToOperations(address, CHAIN_ID.SEI_EVM, etherscanOp, testLogger)
1941
1988
  ).toEqual([expectedOperation])
1942
1989
  })
1943
1990
 
@@ -1966,7 +2013,6 @@ describe('EVM Family', () => {
1966
2013
  }
1967
2014
 
1968
2015
  const address = '0x9aa99c23f67c81701c772b106b4f83f6e858dd2e'
1969
- const currencyId = 'sei_evm'
1970
2016
 
1971
2017
  const expectedOperation = {
1972
2018
  id: `${address}-${stakingHash}-UNDELEGATE`,
@@ -1985,6 +2031,8 @@ describe('EVM Family', () => {
1985
2031
  },
1986
2032
  details: {
1987
2033
  sequence: '7',
2034
+ gasPrice: '125521409858',
2035
+ gasLimit: '6000000',
1988
2036
  contractInteraction: 'SmartContractInteraction',
1989
2037
  contractAddress: '0x0000000000000000000000000000000000001005',
1990
2038
  contractPayload: '0x8dfc88970000000000000000000000',
@@ -1992,7 +2040,7 @@ describe('EVM Family', () => {
1992
2040
  }
1993
2041
 
1994
2042
  expect(
1995
- etherscanOperationToOperations(address, currencyId, etherscanOp, testLogger)
2043
+ etherscanOperationToOperations(address, CHAIN_ID.SEI_EVM, etherscanOp, testLogger)
1996
2044
  ).toEqual([expectedOperation])
1997
2045
  })
1998
2046
  })
@@ -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) {
@@ -121,6 +122,7 @@ export const etherscanOperationToOperations = (
121
122
  },
122
123
  details: {
123
124
  sequence: etherscanOp.nonce,
125
+ ...gasDetails(etherscanOp.gasPrice, etherscanOp.gas),
124
126
  ...(contractExtra ?? {}),
125
127
  },
126
128
  }))
@@ -174,6 +176,7 @@ export const etherscanERC20EventToOperations = (
174
176
  },
175
177
  details: {
176
178
  sequence: event.nonce,
179
+ ...gasDetails(event.gasPrice, event.gas),
177
180
  ledgerOpType: type,
178
181
  assetAmount: event.value,
179
182
  assetSenders: from ? [from] : [],
@@ -229,6 +232,7 @@ export const etherscanERC721EventToOperations = (
229
232
  },
230
233
  details: {
231
234
  sequence: event.nonce,
235
+ ...gasDetails(event.gasPrice, event.gas),
232
236
  tokenId: event.tokenID,
233
237
  ledgerOpType: type,
234
238
  assetAmount: '1',
@@ -284,6 +288,7 @@ export const etherscanERC1155EventToOperations = (
284
288
  },
285
289
  details: {
286
290
  sequence: event.nonce,
291
+ ...gasDetails(event.gasPrice, event.gas),
287
292
  tokenId: event.tokenID,
288
293
  ledgerOpType: type,
289
294
  assetAmount: event.tokenValue,
@@ -293,6 +298,17 @@ export const etherscanERC1155EventToOperations = (
293
298
  }))
294
299
  }
295
300
 
301
+ /**
302
+ * Gas price and gas limit details of a transaction. Some Blockscout explorers (e.g. Optimism)
303
+ * report an empty `gasPrice`, so empty values are omitted rather than emitted as `''`.
304
+ */
305
+ function gasDetails(gasPrice: string, gasLimit: string): Record<string, string> {
306
+ return {
307
+ ...(gasPrice ? { gasPrice } : {}),
308
+ ...(gasLimit ? { gasLimit } : {}),
309
+ }
310
+ }
311
+
296
312
  /**
297
313
  * `delegatecall`/`staticcall`/`callcode` cannot move native ETH, but both Blockscout and
298
314
  * Etherscan still report a non-zero `value` on those entries (it's the `msg.value` inherited