@ledgerhq/coin-evm 7.0.0 → 9.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 (297) hide show
  1. package/.oxlintrc.json +1 -1
  2. package/CHANGELOG.md +62 -0
  3. package/docs/getBlock-internal-txs-schema.md +1 -1
  4. package/docs/network/node/index.md +3 -1
  5. package/lib/adapters/blockOperations.d.ts +4 -3
  6. package/lib/adapters/blockOperations.d.ts.map +1 -1
  7. package/lib/adapters/blockOperations.js +17 -17
  8. package/lib/adapters/blockOperations.js.map +1 -1
  9. package/lib/adapters/etherscan.d.ts +7 -6
  10. package/lib/adapters/etherscan.d.ts.map +1 -1
  11. package/lib/adapters/etherscan.js +19 -19
  12. package/lib/adapters/etherscan.js.map +1 -1
  13. package/lib/adapters/ledger.d.ts +6 -5
  14. package/lib/adapters/ledger.d.ts.map +1 -1
  15. package/lib/adapters/ledger.js +15 -15
  16. package/lib/adapters/ledger.js.map +1 -1
  17. package/lib/api/index.d.ts.map +1 -1
  18. package/lib/api/index.js +1 -2
  19. package/lib/api/index.js.map +1 -1
  20. package/lib/config.d.ts +0 -1
  21. package/lib/config.d.ts.map +1 -1
  22. package/lib/logic/common.js +1 -1
  23. package/lib/logic/common.js.map +1 -1
  24. package/lib/logic/getBalance.d.ts.map +1 -1
  25. package/lib/logic/getBalance.js +3 -3
  26. package/lib/logic/getBalance.js.map +1 -1
  27. package/lib/logic/getBlock.d.ts.map +1 -1
  28. package/lib/logic/getBlock.js +22 -23
  29. package/lib/logic/getBlock.js.map +1 -1
  30. package/lib/logic/getStakes.d.ts.map +1 -1
  31. package/lib/logic/getStakes.js +2 -2
  32. package/lib/logic/getStakes.js.map +1 -1
  33. package/lib/logic/internalTransactionsFetcher.d.ts +3 -2
  34. package/lib/logic/internalTransactionsFetcher.d.ts.map +1 -1
  35. package/lib/logic/internalTransactionsFetcher.js +13 -10
  36. package/lib/logic/internalTransactionsFetcher.js.map +1 -1
  37. package/lib/logic/listOperations.js +1 -1
  38. package/lib/logic/listOperations.js.map +1 -1
  39. package/lib/logic-public/utils.d.ts +3 -2
  40. package/lib/logic-public/utils.d.ts.map +1 -1
  41. package/lib/logic-public/utils.js +7 -6
  42. package/lib/logic-public/utils.js.map +1 -1
  43. package/lib/network/explorer/etherscan.d.ts +3 -2
  44. package/lib/network/explorer/etherscan.d.ts.map +1 -1
  45. package/lib/network/explorer/etherscan.js +13 -12
  46. package/lib/network/explorer/etherscan.js.map +1 -1
  47. package/lib/network/explorer/ledger.d.ts.map +1 -1
  48. package/lib/network/explorer/ledger.js +11 -11
  49. package/lib/network/explorer/ledger.js.map +1 -1
  50. package/lib/network/explorer/types.d.ts +2 -2
  51. package/lib/network/explorer/types.d.ts.map +1 -1
  52. package/lib/network/explorer/types.js.map +1 -1
  53. package/lib/network/node/explorerProxy.js +3 -3
  54. package/lib/network/node/explorerProxy.js.map +1 -1
  55. package/lib/network/node/index.d.ts.map +1 -1
  56. package/lib/network/node/index.js +2 -2
  57. package/lib/network/node/index.js.map +1 -1
  58. package/lib/network/node/ledger.d.ts +2 -1
  59. package/lib/network/node/ledger.d.ts.map +1 -1
  60. package/lib/network/node/ledger.js +9 -10
  61. package/lib/network/node/ledger.js.map +1 -1
  62. package/lib/network/node/rpc.common.d.ts +3 -2
  63. package/lib/network/node/rpc.common.d.ts.map +1 -1
  64. package/lib/network/node/rpc.common.js +37 -29
  65. package/lib/network/node/rpc.common.js.map +1 -1
  66. package/lib/staking/contracts.js +2 -2
  67. package/lib/staking/contracts.js.map +1 -1
  68. package/lib/staking/fetchers.d.ts.map +1 -1
  69. package/lib/staking/fetchers.js +7 -7
  70. package/lib/staking/fetchers.js.map +1 -1
  71. package/lib/staking/prepareIntents.d.ts +2 -1
  72. package/lib/staking/prepareIntents.d.ts.map +1 -1
  73. package/lib/staking/prepareIntents.js +4 -4
  74. package/lib/staking/prepareIntents.js.map +1 -1
  75. package/lib/staking/redelegations.d.ts +5 -4
  76. package/lib/staking/redelegations.d.ts.map +1 -1
  77. package/lib/staking/redelegations.js +13 -14
  78. package/lib/staking/redelegations.js.map +1 -1
  79. package/lib/staking/rewards.d.ts +2 -1
  80. package/lib/staking/rewards.d.ts.map +1 -1
  81. package/lib/staking/rewards.js +4 -5
  82. package/lib/staking/rewards.js.map +1 -1
  83. package/lib/staking/rewardsFromReceipt.d.ts +2 -1
  84. package/lib/staking/rewardsFromReceipt.d.ts.map +1 -1
  85. package/lib/staking/rewardsFromReceipt.js +2 -3
  86. package/lib/staking/rewardsFromReceipt.js.map +1 -1
  87. package/lib/staking/unbondings.d.ts +2 -1
  88. package/lib/staking/unbondings.d.ts.map +1 -1
  89. package/lib/staking/unbondings.js +4 -5
  90. package/lib/staking/unbondings.js.map +1 -1
  91. package/lib/staking/validators/index.d.ts +9 -4
  92. package/lib/staking/validators/index.d.ts.map +1 -1
  93. package/lib/staking/validators/index.js +19 -10
  94. package/lib/staking/validators/index.js.map +1 -1
  95. package/lib/staking/validators/monad.d.ts +6 -5
  96. package/lib/staking/validators/monad.d.ts.map +1 -1
  97. package/lib/staking/validators/monad.js +33 -29
  98. package/lib/staking/validators/monad.js.map +1 -1
  99. package/lib/staking/validators/monadResolver.d.ts +2 -1
  100. package/lib/staking/validators/monadResolver.d.ts.map +1 -1
  101. package/lib/staking/validators/monadResolver.js +2 -3
  102. package/lib/staking/validators/monadResolver.js.map +1 -1
  103. package/lib/staking/validators/somnia.d.ts +3 -2
  104. package/lib/staking/validators/somnia.d.ts.map +1 -1
  105. package/lib/staking/validators/somnia.js +16 -15
  106. package/lib/staking/validators/somnia.js.map +1 -1
  107. package/lib/staking/validators/types.d.ts +2 -1
  108. package/lib/staking/validators/types.d.ts.map +1 -1
  109. package/lib/staking/validators/zero_gravity.d.ts +2 -1
  110. package/lib/staking/validators/zero_gravity.d.ts.map +1 -1
  111. package/lib/staking/validators/zero_gravity.js +7 -8
  112. package/lib/staking/validators/zero_gravity.js.map +1 -1
  113. package/lib/types/staking.d.ts +4 -3
  114. package/lib/types/staking.d.ts.map +1 -1
  115. package/lib-es/adapters/blockOperations.d.ts +4 -3
  116. package/lib-es/adapters/blockOperations.d.ts.map +1 -1
  117. package/lib-es/adapters/blockOperations.js +17 -17
  118. package/lib-es/adapters/blockOperations.js.map +1 -1
  119. package/lib-es/adapters/etherscan.d.ts +7 -6
  120. package/lib-es/adapters/etherscan.d.ts.map +1 -1
  121. package/lib-es/adapters/etherscan.js +19 -19
  122. package/lib-es/adapters/etherscan.js.map +1 -1
  123. package/lib-es/adapters/ledger.d.ts +6 -5
  124. package/lib-es/adapters/ledger.d.ts.map +1 -1
  125. package/lib-es/adapters/ledger.js +15 -15
  126. package/lib-es/adapters/ledger.js.map +1 -1
  127. package/lib-es/api/index.d.ts.map +1 -1
  128. package/lib-es/api/index.js +1 -2
  129. package/lib-es/api/index.js.map +1 -1
  130. package/lib-es/config.d.ts +0 -1
  131. package/lib-es/config.d.ts.map +1 -1
  132. package/lib-es/logic/common.js +1 -1
  133. package/lib-es/logic/common.js.map +1 -1
  134. package/lib-es/logic/getBalance.d.ts.map +1 -1
  135. package/lib-es/logic/getBalance.js +3 -3
  136. package/lib-es/logic/getBalance.js.map +1 -1
  137. package/lib-es/logic/getBlock.d.ts.map +1 -1
  138. package/lib-es/logic/getBlock.js +22 -23
  139. package/lib-es/logic/getBlock.js.map +1 -1
  140. package/lib-es/logic/getStakes.d.ts.map +1 -1
  141. package/lib-es/logic/getStakes.js +2 -2
  142. package/lib-es/logic/getStakes.js.map +1 -1
  143. package/lib-es/logic/internalTransactionsFetcher.d.ts +3 -2
  144. package/lib-es/logic/internalTransactionsFetcher.d.ts.map +1 -1
  145. package/lib-es/logic/internalTransactionsFetcher.js +13 -10
  146. package/lib-es/logic/internalTransactionsFetcher.js.map +1 -1
  147. package/lib-es/logic/listOperations.js +1 -1
  148. package/lib-es/logic/listOperations.js.map +1 -1
  149. package/lib-es/logic-public/utils.d.ts +3 -2
  150. package/lib-es/logic-public/utils.d.ts.map +1 -1
  151. package/lib-es/logic-public/utils.js +7 -6
  152. package/lib-es/logic-public/utils.js.map +1 -1
  153. package/lib-es/network/explorer/etherscan.d.ts +3 -2
  154. package/lib-es/network/explorer/etherscan.d.ts.map +1 -1
  155. package/lib-es/network/explorer/etherscan.js +13 -12
  156. package/lib-es/network/explorer/etherscan.js.map +1 -1
  157. package/lib-es/network/explorer/ledger.d.ts.map +1 -1
  158. package/lib-es/network/explorer/ledger.js +11 -11
  159. package/lib-es/network/explorer/ledger.js.map +1 -1
  160. package/lib-es/network/explorer/types.d.ts +2 -2
  161. package/lib-es/network/explorer/types.d.ts.map +1 -1
  162. package/lib-es/network/explorer/types.js.map +1 -1
  163. package/lib-es/network/node/explorerProxy.js +3 -3
  164. package/lib-es/network/node/explorerProxy.js.map +1 -1
  165. package/lib-es/network/node/index.d.ts.map +1 -1
  166. package/lib-es/network/node/index.js +2 -2
  167. package/lib-es/network/node/index.js.map +1 -1
  168. package/lib-es/network/node/ledger.d.ts +2 -1
  169. package/lib-es/network/node/ledger.d.ts.map +1 -1
  170. package/lib-es/network/node/ledger.js +9 -10
  171. package/lib-es/network/node/ledger.js.map +1 -1
  172. package/lib-es/network/node/rpc.common.d.ts +3 -2
  173. package/lib-es/network/node/rpc.common.d.ts.map +1 -1
  174. package/lib-es/network/node/rpc.common.js +37 -29
  175. package/lib-es/network/node/rpc.common.js.map +1 -1
  176. package/lib-es/staking/contracts.js +2 -2
  177. package/lib-es/staking/contracts.js.map +1 -1
  178. package/lib-es/staking/fetchers.d.ts.map +1 -1
  179. package/lib-es/staking/fetchers.js +7 -7
  180. package/lib-es/staking/fetchers.js.map +1 -1
  181. package/lib-es/staking/prepareIntents.d.ts +2 -1
  182. package/lib-es/staking/prepareIntents.d.ts.map +1 -1
  183. package/lib-es/staking/prepareIntents.js +4 -4
  184. package/lib-es/staking/prepareIntents.js.map +1 -1
  185. package/lib-es/staking/redelegations.d.ts +5 -4
  186. package/lib-es/staking/redelegations.d.ts.map +1 -1
  187. package/lib-es/staking/redelegations.js +13 -14
  188. package/lib-es/staking/redelegations.js.map +1 -1
  189. package/lib-es/staking/rewards.d.ts +2 -1
  190. package/lib-es/staking/rewards.d.ts.map +1 -1
  191. package/lib-es/staking/rewards.js +4 -5
  192. package/lib-es/staking/rewards.js.map +1 -1
  193. package/lib-es/staking/rewardsFromReceipt.d.ts +2 -1
  194. package/lib-es/staking/rewardsFromReceipt.d.ts.map +1 -1
  195. package/lib-es/staking/rewardsFromReceipt.js +2 -3
  196. package/lib-es/staking/rewardsFromReceipt.js.map +1 -1
  197. package/lib-es/staking/unbondings.d.ts +2 -1
  198. package/lib-es/staking/unbondings.d.ts.map +1 -1
  199. package/lib-es/staking/unbondings.js +4 -5
  200. package/lib-es/staking/unbondings.js.map +1 -1
  201. package/lib-es/staking/validators/index.d.ts +9 -4
  202. package/lib-es/staking/validators/index.d.ts.map +1 -1
  203. package/lib-es/staking/validators/index.js +18 -10
  204. package/lib-es/staking/validators/index.js.map +1 -1
  205. package/lib-es/staking/validators/monad.d.ts +6 -5
  206. package/lib-es/staking/validators/monad.d.ts.map +1 -1
  207. package/lib-es/staking/validators/monad.js +33 -29
  208. package/lib-es/staking/validators/monad.js.map +1 -1
  209. package/lib-es/staking/validators/monadResolver.d.ts +2 -1
  210. package/lib-es/staking/validators/monadResolver.d.ts.map +1 -1
  211. package/lib-es/staking/validators/monadResolver.js +2 -3
  212. package/lib-es/staking/validators/monadResolver.js.map +1 -1
  213. package/lib-es/staking/validators/somnia.d.ts +3 -2
  214. package/lib-es/staking/validators/somnia.d.ts.map +1 -1
  215. package/lib-es/staking/validators/somnia.js +16 -15
  216. package/lib-es/staking/validators/somnia.js.map +1 -1
  217. package/lib-es/staking/validators/types.d.ts +2 -1
  218. package/lib-es/staking/validators/types.d.ts.map +1 -1
  219. package/lib-es/staking/validators/zero_gravity.d.ts +2 -1
  220. package/lib-es/staking/validators/zero_gravity.d.ts.map +1 -1
  221. package/lib-es/staking/validators/zero_gravity.js +7 -8
  222. package/lib-es/staking/validators/zero_gravity.js.map +1 -1
  223. package/lib-es/types/staking.d.ts +4 -3
  224. package/lib-es/types/staking.d.ts.map +1 -1
  225. package/package.json +4 -4
  226. package/src/adapters/blockOperations.test.ts +86 -67
  227. package/src/adapters/blockOperations.ts +28 -17
  228. package/src/adapters/etherscan.test.ts +151 -85
  229. package/src/adapters/etherscan.ts +27 -18
  230. package/src/adapters/ledger.test.ts +210 -83
  231. package/src/adapters/ledger.ts +21 -15
  232. package/src/api/getBlock.integ.test.ts +10 -4
  233. package/src/api/index.arbitrum.integ.test.ts +1 -0
  234. package/src/api/index.arc.integ.test.ts +1 -0
  235. package/src/api/index.avalanche_c_chain_fuji.integ.test.ts +1 -0
  236. package/src/api/index.cronos.integ.test.ts +1 -0
  237. package/src/api/index.flare.integ.test.ts +4 -2
  238. package/src/api/index.integ.test.ts +7 -6
  239. package/src/api/index.linea.integ.test.ts +4 -2
  240. package/src/api/index.optimism.integ.test.ts +1 -0
  241. package/src/api/index.rsk.integ.test.ts +1 -0
  242. package/src/api/index.shape.integ.test.ts +4 -2
  243. package/src/api/index.somnia.integ.test.ts +1 -0
  244. package/src/api/index.test.ts +2 -2
  245. package/src/api/index.ts +1 -2
  246. package/src/config.ts +0 -1
  247. package/src/fixtures/context.fixtures.ts +5 -5
  248. package/src/logic/common.ts +1 -1
  249. package/src/logic/getBalance.ts +4 -3
  250. package/src/logic/getBlock.ts +43 -27
  251. package/src/logic/getStakes.ts +2 -1
  252. package/src/logic/internalTransactionsFetcher.ts +16 -10
  253. package/src/logic/listOperations.ts +2 -2
  254. package/src/logic/tests/getBalance.test.ts +5 -3
  255. package/src/logic/tests/getBlock.test.ts +16 -15
  256. package/src/logic/tests/internalTransactionsFetcher.test.ts +6 -5
  257. package/src/logic/tests/listOperations.test.ts +4 -4
  258. package/src/logic-public/tests/utils.test.ts +6 -5
  259. package/src/logic-public/utils.ts +8 -5
  260. package/src/logic.test.ts +5 -5
  261. package/src/network/explorer/etherscan.test.ts +169 -55
  262. package/src/network/explorer/etherscan.ts +27 -16
  263. package/src/network/explorer/index.test.ts +2 -1
  264. package/src/network/explorer/ledger.test.ts +208 -35
  265. package/src/network/explorer/ledger.ts +12 -8
  266. package/src/network/explorer/types.ts +3 -2
  267. package/src/network/node/explorerProxy.ts +3 -3
  268. package/src/network/node/index.ts +3 -2
  269. package/src/network/node/ledger.test.ts +25 -25
  270. package/src/network/node/ledger.ts +13 -10
  271. package/src/network/node/node.fixtures.ts +2 -1
  272. package/src/network/node/rpc.common.ts +84 -28
  273. package/src/network/node/rpc.test.ts +45 -31
  274. package/src/staking/contracts.ts +2 -2
  275. package/src/staking/fetchers.ts +20 -8
  276. package/src/staking/prepareIntents.test.ts +33 -12
  277. package/src/staking/prepareIntents.ts +9 -5
  278. package/src/staking/redelegations.test.ts +98 -35
  279. package/src/staking/redelegations.ts +20 -12
  280. package/src/staking/rewards.test.ts +15 -10
  281. package/src/staking/rewards.ts +8 -5
  282. package/src/staking/rewardsFromReceipt.test.ts +5 -4
  283. package/src/staking/rewardsFromReceipt.ts +4 -3
  284. package/src/staking/unbondings.test.ts +16 -12
  285. package/src/staking/unbondings.ts +7 -5
  286. package/src/staking/validators/index.ts +30 -10
  287. package/src/staking/validators/monad.test.ts +57 -43
  288. package/src/staking/validators/monad.ts +55 -32
  289. package/src/staking/validators/monadResolver.ts +4 -3
  290. package/src/staking/validators/somnia.test.ts +14 -13
  291. package/src/staking/validators/somnia.ts +35 -19
  292. package/src/staking/validators/types.ts +2 -0
  293. package/src/staking/validators/zero_gravity.test.ts +48 -26
  294. package/src/staking/validators/zero_gravity.ts +14 -8
  295. package/src/staking/validators.integ.test.ts +2 -2
  296. package/src/staking/validators.test.ts +31 -26
  297. package/src/types/staking.ts +9 -2
@@ -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 type { Logger } from '@ledgerhq/coin-module-framework/config'
12
13
  import eip55 from 'eip55'
13
14
  import { safeBigInt, safeEncodeEIP55 } from '../logic-public'
14
15
  import { detectEvmStakingOperationType } from '../staking/detectOperationType'
@@ -20,11 +21,12 @@ import { detectEvmStakingOperationType } from '../staking/detectOperationType'
20
21
  export const ledgerOperationToOperations = (
21
22
  address: string,
22
23
  currencyId: string,
23
- ledgerOp: LedgerExplorerOperation
24
+ ledgerOp: LedgerExplorerOperation,
25
+ logger: Logger
24
26
  ): Array<Operation<MemoNotSupported>> => {
25
27
  const checksummedAddress = eip55.encode(address)
26
- const from = safeEncodeEIP55(ledgerOp.from)
27
- const to = safeEncodeEIP55(ledgerOp.to)
28
+ const from = safeEncodeEIP55(ledgerOp.from, logger)
29
+ const to = safeEncodeEIP55(ledgerOp.to, logger)
28
30
  const input = ledgerOp.input ?? undefined
29
31
  const methodId = input ? input.slice(0, 10) : undefined // 0x + 4-byte selector
30
32
  const failed = !ledgerOp.status
@@ -82,11 +84,12 @@ export const ledgerERC20EventToOperations = (
82
84
  address: string,
83
85
  coinOperation: Operation<MemoNotSupported>,
84
86
  event: LedgerExplorerERC20TransferEvent,
85
- index = 0
87
+ index = 0,
88
+ logger: Logger
86
89
  ): Array<Operation<MemoNotSupported>> => {
87
90
  const checksummedAddress = eip55.encode(address)
88
- const from = safeEncodeEIP55(event.from)
89
- const to = safeEncodeEIP55(event.to)
91
+ const from = safeEncodeEIP55(event.from, logger)
92
+ const to = safeEncodeEIP55(event.to, logger)
90
93
  const contract = eip55.encode(event.contract)
91
94
  const types: string[] = []
92
95
 
@@ -122,11 +125,12 @@ export const ledgerERC721EventToOperations = (
122
125
  address: string,
123
126
  coinOperation: Operation<MemoNotSupported>,
124
127
  event: LedgerExplorerER721TransferEvent,
125
- index = 0
128
+ index = 0,
129
+ logger: Logger
126
130
  ): Array<Operation<MemoNotSupported>> => {
127
131
  const checksummedAddress = eip55.encode(address)
128
- const from = safeEncodeEIP55(event.sender)
129
- const to = safeEncodeEIP55(event.receiver)
132
+ const from = safeEncodeEIP55(event.sender, logger)
133
+ const to = safeEncodeEIP55(event.receiver, logger)
130
134
  const contract = eip55.encode(event.contract)
131
135
  const types: string[] = []
132
136
 
@@ -163,11 +167,12 @@ export const ledgerERC1155EventToOperations = (
163
167
  address: string,
164
168
  coinOperation: Operation<MemoNotSupported>,
165
169
  event: LedgerExplorerER1155TransferEvent,
166
- index = 0
170
+ index = 0,
171
+ logger: Logger
167
172
  ): Array<Operation<MemoNotSupported>> => {
168
173
  const checksummedAddress = eip55.encode(address)
169
- const from = safeEncodeEIP55(event.sender)
170
- const to = safeEncodeEIP55(event.receiver)
174
+ const from = safeEncodeEIP55(event.sender, logger)
175
+ const to = safeEncodeEIP55(event.receiver, logger)
171
176
  const contract = eip55.encode(event.contract)
172
177
  const types: string[] = []
173
178
 
@@ -208,13 +213,14 @@ export const ledgerInternalTransactionToOperations = (
208
213
  address: string,
209
214
  coinOperation: Operation<MemoNotSupported>,
210
215
  action: LedgerExplorerInternalTransaction,
211
- index = 0
216
+ index = 0,
217
+ logger: Logger
212
218
  ): Array<Operation<MemoNotSupported>> => {
213
219
  if (coinOperation.tx.failed) return []
214
220
 
215
221
  const checksummedAddress = eip55.encode(address)
216
- const from = safeEncodeEIP55(action.from)
217
- const to = safeEncodeEIP55(action.to)
222
+ const from = safeEncodeEIP55(action.from, logger)
223
+ const to = safeEncodeEIP55(action.to, logger)
218
224
  const hasFailed = !!action.error // AFAIK this is not working, all actions contain error = null even when it reverted
219
225
  const value = safeBigInt(action.value)
220
226
  const types: string[] = []
@@ -1,7 +1,7 @@
1
1
  // SPDX-FileCopyrightText: © 2026 LEDGER SAS
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
- import type { EvmConfig } from '../config'
4
+ import type { EvmConfigInfo } from '../config'
5
5
  import { createMockEvmContext } from '../fixtures/context.fixtures'
6
6
  import { createApi } from './index'
7
7
 
@@ -25,9 +25,11 @@ describe('getBlock ERC20 transfers', () => {
25
25
 
26
26
  let module: ReturnType<typeof createApi>
27
27
 
28
- const velasEvmConfig: EvmConfig = {
28
+ const velasEvmConfig: EvmConfigInfo = {
29
+ status: { type: 'active' },
29
30
  chainId: 111,
30
31
  name: 'Velas EVM',
32
+ unit: { name: 'VLX', code: 'VLX', magnitude: 18 },
31
33
  node: {
32
34
  type: 'external',
33
35
  uri: 'https://evmexplorer.velas.com/rpc',
@@ -87,9 +89,11 @@ describe('getBlock ERC20 transfers', () => {
87
89
 
88
90
  let module: ReturnType<typeof createApi>
89
91
 
90
- const bscConfig: EvmConfig = {
92
+ const bscConfig: EvmConfigInfo = {
93
+ status: { type: 'active' },
91
94
  chainId: 56,
92
95
  name: 'Binance Smart Chain',
96
+ unit: { name: 'BNB', code: 'BNB', magnitude: 18 },
93
97
  node: {
94
98
  type: 'ledger',
95
99
  explorerId: 'bnb',
@@ -143,9 +147,11 @@ describe('getBlock ERC20 transfers', () => {
143
147
  describe.skip('External RPC Node (zkSync)', () => {
144
148
  let module: ReturnType<typeof createApi>
145
149
 
146
- const zkSyncConfig: EvmConfig = {
150
+ const zkSyncConfig: EvmConfigInfo = {
151
+ status: { type: 'active' },
147
152
  chainId: 324,
148
153
  name: 'zkSync Era',
154
+ unit: { name: 'ETH', code: 'ETH', magnitude: 18 },
149
155
  node: {
150
156
  type: 'external',
151
157
  uri: 'https://zksync.coin.ledger.com',
@@ -9,6 +9,7 @@ describe('EVM Arbitrum Network', () => {
9
9
  let module: ReturnType<typeof createApi>
10
10
 
11
11
  const config: Partial<EvmConfigInfo> = {
12
+ chainId: 42161,
12
13
  node: {
13
14
  type: 'external',
14
15
  uri: 'https://arbitrum.coin.ledger.com',
@@ -20,6 +20,7 @@ describe('EVM Api (Arc)', () => {
20
20
  let operations: Operation[]
21
21
 
22
22
  const config: Partial<EvmConfigInfo> = {
23
+ chainId: 5042,
23
24
  node: {
24
25
  type: 'external',
25
26
  uri: 'https://arc.coin.ledger.com',
@@ -9,6 +9,7 @@ describe('EVM Avalanche C-Chain Fuji', () => {
9
9
  let module: ReturnType<typeof createApi>
10
10
 
11
11
  const config: Partial<EvmConfigInfo> = {
12
+ chainId: 43113,
12
13
  node: {
13
14
  type: 'external',
14
15
  uri: 'https://avalanche-fuji-c-chain-rpc.publicnode.com',
@@ -9,6 +9,7 @@ describe('EVM Cronos Network (blockscout explorer)', () => {
9
9
  let module: ReturnType<typeof createApi>
10
10
 
11
11
  const config: Partial<EvmConfigInfo> = {
12
+ chainId: 25,
12
13
  node: {
13
14
  type: 'external',
14
15
  uri: 'https://cronos.coin.ledger.com',
@@ -1,7 +1,7 @@
1
1
  // SPDX-FileCopyrightText: © 2026 LEDGER SAS
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
- import type { EvmConfig } from '../config'
4
+ import type { EvmConfigInfo } from '../config'
5
5
  import { createMockEvmContext } from '../fixtures/context.fixtures'
6
6
  import { createApi } from './index'
7
7
 
@@ -9,9 +9,11 @@ describe('Flare (external node)', () => {
9
9
  describe('getBlock', () => {
10
10
  let module: ReturnType<typeof createApi>
11
11
 
12
- const flareConfig: EvmConfig = {
12
+ const flareConfig: EvmConfigInfo = {
13
+ status: { type: 'active' },
13
14
  chainId: 14,
14
15
  name: 'Flare',
16
+ unit: { name: 'FLR', code: 'FLR', magnitude: 18 },
15
17
  node: {
16
18
  type: 'external',
17
19
  uri: 'https://rpc.au.cc/flare',
@@ -11,6 +11,7 @@ import {
11
11
  mkLedgerExplorer,
12
12
  mkLedgerNode,
13
13
  } from '../fixtures/context.fixtures'
14
+ import { isNative } from '../types/assets'
14
15
  import { createApi } from './index'
15
16
 
16
17
  describe.each([
@@ -643,11 +644,11 @@ describe.each([
643
644
  tx: { feesPayer: expect.any(String) },
644
645
  })
645
646
  const senderAsset = senderTxOps[0].asset
646
- if (senderAsset.type !== 'native') {
647
+ if (!isNative(senderAsset)) {
647
648
  expect(senderAsset.assetReference?.toLowerCase()).toBe(contract.toLowerCase())
648
649
  expectAddressEq(senderTxOps[0].senders[0], sender)
649
650
  expectAddressEq(senderTxOps[0].recipients[0], recipient)
650
- expectAddressEq(senderAsset.assetOwner, sender)
651
+ expectAddressEq(senderAsset.assetOwner!, sender)
651
652
  }
652
653
  expectAddressEq(senderTxOps[0].tx.feesPayer!, sender)
653
654
  expect(senderTxOps[0].value).toBeGreaterThan(0n)
@@ -658,11 +659,11 @@ describe.each([
658
659
  asset: { type: 'erc20' },
659
660
  })
660
661
  const recipientAsset = recipientTxOps[0].asset
661
- if (recipientAsset.type !== 'native') {
662
+ if (!isNative(recipientAsset)) {
662
663
  expect(recipientAsset.assetReference?.toLowerCase()).toBe(contract.toLowerCase())
663
664
  expectAddressEq(recipientTxOps[0].senders[0], sender)
664
665
  expectAddressEq(recipientTxOps[0].recipients[0], recipient)
665
- expectAddressEq(recipientAsset.assetOwner, recipient)
666
+ expectAddressEq(recipientAsset.assetOwner!, recipient)
666
667
  }
667
668
  expect(recipientTxOps[0].value).toBe(senderTxOps[0].value)
668
669
  })
@@ -705,9 +706,9 @@ describe.each([
705
706
  tx: { feesPayer: expect.any(String) },
706
707
  })
707
708
  const tokenOpAsset = tokenOp!.asset
708
- if (tokenOpAsset.type !== 'native') {
709
+ if (!isNative(tokenOpAsset)) {
709
710
  expect(tokenOpAsset.assetReference?.toLowerCase()).toBe(lidoContract.toLowerCase())
710
- expectAddressEq(tokenOpAsset.assetOwner, sender)
711
+ expectAddressEq(tokenOpAsset.assetOwner!, sender)
711
712
  }
712
713
  expect(tokenOp!.senders[0].toLowerCase()).toBe(zeroAddress.toLowerCase())
713
714
  expectAddressEq(tokenOp!.recipients[0], sender)
@@ -1,7 +1,7 @@
1
1
  // SPDX-FileCopyrightText: © 2026 LEDGER SAS
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
- import type { EvmConfig } from '../config'
4
+ import type { EvmConfigInfo } from '../config'
5
5
  import { createMockEvmContext } from '../fixtures/context.fixtures'
6
6
  import { createApi } from './index'
7
7
 
@@ -25,9 +25,11 @@ describe('Linea (etherscan explorer)', () => {
25
25
  const TO = '0x9F41fE989C556d8b312Ce398b7f7B5Ac90919a73'
26
26
 
27
27
  let module: ReturnType<typeof createApi>
28
- const lineaConfig: EvmConfig = {
28
+ const lineaConfig: EvmConfigInfo = {
29
+ status: { type: 'active' },
29
30
  chainId: 59144,
30
31
  name: 'Linea',
32
+ unit: { name: 'ETH', code: 'ETH', magnitude: 18 },
31
33
  node: {
32
34
  type: 'external',
33
35
  uri: 'https://linea.coin.ledger.com',
@@ -10,6 +10,7 @@ describe('EVM Optimism Network', () => {
10
10
  let module: ReturnType<typeof createApi>
11
11
 
12
12
  const config: Partial<EvmConfigInfo> = {
13
+ chainId: 10,
13
14
  node: {
14
15
  type: 'external',
15
16
  uri: 'https://optimism.coin.ledger.com',
@@ -9,6 +9,7 @@ describe('EVM RSK Network', () => {
9
9
  let module: ReturnType<typeof createApi>
10
10
 
11
11
  const config: Partial<EvmConfigInfo> = {
12
+ chainId: 30,
12
13
  node: {
13
14
  type: 'external',
14
15
  uri: 'https://rsk.coin.ledger.com',
@@ -1,16 +1,18 @@
1
1
  // SPDX-FileCopyrightText: © 2026 LEDGER SAS
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
- import type { EvmConfig } from '../config'
4
+ import type { EvmConfigInfo } from '../config'
5
5
  import { fail } from 'assert'
6
6
  import { createMockEvmContext } from '../fixtures/context.fixtures'
7
7
  import { createApi } from './index'
8
8
 
9
9
  describe('Shape (external node)', () => {
10
10
  describe('getBlock', () => {
11
- const shapeConfig: EvmConfig = {
11
+ const shapeConfig: EvmConfigInfo = {
12
+ status: { type: 'active' },
12
13
  chainId: 360,
13
14
  name: 'Shape',
15
+ unit: { name: 'ETH', code: 'ETH', magnitude: 18 },
14
16
  node: {
15
17
  type: 'external',
16
18
  uri: 'https://mainnet.shape.network',
@@ -9,6 +9,7 @@ describe('EVM Api (Somnia)', () => {
9
9
  let module: ReturnType<typeof createApi>
10
10
 
11
11
  const config: Partial<EvmConfigInfo> = {
12
+ chainId: 5031,
12
13
  node: { type: 'external', uri: 'https://api.infra.mainnet.somnia.network' },
13
14
  explorer: { type: 'blockscout', uri: 'https://explorer.somnia.network/api/' },
14
15
  }
@@ -144,9 +144,9 @@ describe('staking support capability', () => {
144
144
  const api = createApi('sei_evm')
145
145
 
146
146
  await expect(api.getValidators(mockEvmContext)).resolves.toEqual(expectedPage)
147
- expect(mockGetValidatorsPage).toHaveBeenCalledWith(expect.anything(), 'sei_evm', undefined)
147
+ expect(mockGetValidatorsPage).toHaveBeenCalledWith(mockEvmContext, 'sei_evm', undefined)
148
148
 
149
149
  await expect(api.getValidators(mockEvmContext, { cursor: '42' })).resolves.toEqual(expectedPage)
150
- expect(mockGetValidatorsPage).toHaveBeenCalledWith(expect.anything(), 'sei_evm', '42')
150
+ expect(mockGetValidatorsPage).toHaveBeenCalledWith(mockEvmContext, 'sei_evm', '42')
151
151
  })
152
152
  })
package/src/api/index.ts CHANGED
@@ -121,8 +121,7 @@ export function createApi(currencyId: string) {
121
121
  context: EvmContext,
122
122
  options?: { cursor?: Cursor }
123
123
  ): Promise<Page<Validator>> => {
124
- const config = await context.config(currencyId)
125
- return getValidatorsPage(config, currencyId, options?.cursor)
124
+ return getValidatorsPage(context, currencyId, options?.cursor)
126
125
  },
127
126
  getNextSequence: (context: EvmContext, address: string): Promise<bigint> =>
128
127
  getNextSequence(context, currencyId, address),
package/src/config.ts CHANGED
@@ -28,7 +28,6 @@ export const DEFAULT_EIP1559_BASE_FEE_MULTIPLIER = 1.6
28
28
 
29
29
  export type EvmConfig = {
30
30
  chainId: number
31
- name: string
32
31
  node:
33
32
  | {
34
33
  type: 'external'
@@ -10,7 +10,6 @@ import type {
10
10
  LedgerNodeConfig,
11
11
  } from '../config'
12
12
  import type { Logger } from '@ledgerhq/coin-module-framework/config'
13
- import { log } from '@ledgerhq/logs'
14
13
 
15
14
  /** Returns an external (JSON-RPC) node config for use in tests. */
16
15
  export const mkExternalNode = (partial?: {
@@ -70,6 +69,7 @@ export const createMockEvmConfigInfo = (
70
69
  ): EvmConfigInfo => ({
71
70
  status: { type: 'active' },
72
71
  name: 'test',
72
+ unit: { name: 'test', code: 'TEST', magnitude: 18 },
73
73
  explorer: { type: 'none' },
74
74
  ...config,
75
75
  })
@@ -96,12 +96,12 @@ export const createMockEvmCoinConfig = (
96
96
  */
97
97
  export const createMockEvmContext = (config?: Partial<EvmConfigInfo>): EvmContext => ({
98
98
  config: async (_currencyId?: string): Promise<EvmConfigInfo> =>
99
- ({ status: { type: 'active' }, ...config }) as EvmConfigInfo,
100
- logger: log as unknown as Logger,
99
+ createMockEvmConfigInfo({ chainId: 1, node: mkExternalNode(), ...config }),
100
+ logger: jest.fn(),
101
101
  })
102
102
 
103
103
  /** A ready-to-use mock {@link EvmContext} for tests that don't need a custom config. */
104
104
  export const mockEvmContext: EvmContext = createMockEvmContext()
105
105
 
106
- /** A real logger for use in tests — emits to the @ledgerhq/logs sink instead of being a no-op. */
107
- export const testLogger: Logger = log as unknown as Logger
106
+ /** A mock {@link Logger} for use in tests. */
107
+ export const testLogger: Logger = jest.fn()
@@ -167,7 +167,7 @@ export async function prepareUnsignedTxParams(
167
167
  // Prepare staking intents once (can require async on-chain lookups). See: LIVE-32750
168
168
  const preparedStakingIntent = isSend
169
169
  ? undefined
170
- : await prepareStakingIntent(config, currencyId, transactionIntent)
170
+ : await prepareStakingIntent(config, currencyId, transactionIntent, logger)
171
171
 
172
172
  const { to, data, value } = isSend
173
173
  ? buildSendTxParams(transactionIntent)
@@ -81,16 +81,16 @@ async function getTokenBalances(
81
81
  if (extractKnownValIds) {
82
82
  const ops = await explorerApi.getOperations(
83
83
  config,
84
+ context.logger,
84
85
  currencyId,
85
86
  address,
86
87
  0,
87
88
  undefined,
88
89
  undefined,
89
90
  undefined,
90
- undefined,
91
- context.logger
91
+ undefined
92
92
  )
93
- knownValidatorIds = extractKnownValIds(currencyId, ops.lastCoinOperations)
93
+ knownValidatorIds = extractKnownValIds(currencyId, ops.lastCoinOperations, context.logger)
94
94
 
95
95
  discoveredAssets = []
96
96
  for (const operation of ops.lastTokenOperations) {
@@ -105,6 +105,7 @@ async function getTokenBalances(
105
105
 
106
106
  discoveredAssets = await explorerApi.discoverTokenAssets(
107
107
  config,
108
+ context.logger,
108
109
  currencyId,
109
110
  address,
110
111
  scanMinHeight
@@ -11,8 +11,8 @@ import type {
11
11
  BlockTransaction,
12
12
  TransferBlockOperation,
13
13
  } from '@ledgerhq/coin-module-framework/api/index'
14
+ import type { Logger } from '@ledgerhq/coin-module-framework/config'
14
15
  import { promiseAllBatched } from '@ledgerhq/coin-module-framework/promises'
15
- import { log } from '@ledgerhq/logs'
16
16
  import { rpcTransactionToBlockOperations } from '../adapters/blockOperations'
17
17
  import { DEFAULT_INTERNAL_TX_SOURCES } from '../config'
18
18
  import { UnsupportedRpcMethodError } from '../errors'
@@ -41,7 +41,8 @@ export async function getBlock(
41
41
  config,
42
42
  nodeApi,
43
43
  currencyId,
44
- internalTxSources
44
+ internalTxSources,
45
+ context.logger
45
46
  )
46
47
 
47
48
  const result = await nodeApi.getBlockByHeight(currencyId, height, true)
@@ -71,6 +72,7 @@ export async function getBlock(
71
72
  transactionHashes,
72
73
  nodeApi,
73
74
  result.height,
75
+ context.logger,
74
76
  result.transactions
75
77
  ),
76
78
  transactionHashes.length === 0
@@ -127,6 +129,7 @@ async function getTransactionsFromNode(
127
129
  transactionHashes: string[],
128
130
  nodeApi: ReturnType<typeof getNodeApi>,
129
131
  blockHeight: number,
132
+ logger: Logger,
130
133
  prefetchedTransactions?: PrefetchedBlockTransaction[]
131
134
  ): Promise<BlockTransaction[]> {
132
135
  if (transactionHashes.length === 0) return []
@@ -135,7 +138,8 @@ async function getTransactionsFromNode(
135
138
  currencyId,
136
139
  blockHeight,
137
140
  prefetchedTransactions,
138
- nodeApi
141
+ nodeApi,
142
+ logger
139
143
  )
140
144
  if (bulkTransactions) return bulkTransactions
141
145
 
@@ -150,7 +154,7 @@ async function getTransactionsFromNode(
150
154
  const transactionResults = await promiseAllBatched(
151
155
  MAX_CONCURRENCY,
152
156
  transactionHashes,
153
- (txHash: string) => getTransactionFromHash(currencyId, txHash, nodeApi)
157
+ (txHash: string) => getTransactionFromHash(currencyId, txHash, nodeApi, logger)
154
158
  )
155
159
 
156
160
  return transactionResults.filter((tx): tx is BlockTransaction => tx !== null)
@@ -160,7 +164,8 @@ async function getTransactionsFromPrefetchedData(
160
164
  currencyId: string,
161
165
  blockHeight: number,
162
166
  prefetchedTransactions: PrefetchedBlockTransaction[] | undefined,
163
- nodeApi: ReturnType<typeof getNodeApi>
167
+ nodeApi: ReturnType<typeof getNodeApi>,
168
+ logger: Logger
164
169
  ): Promise<BlockTransaction[] | null> {
165
170
  if (!prefetchedTransactions || prefetchedTransactions.length === 0 || !nodeApi.getBlockReceipts)
166
171
  return null
@@ -173,10 +178,15 @@ async function getTransactionsFromPrefetchedData(
173
178
  for (const tx of prefetchedTransactions) {
174
179
  const receipt = receiptsByHash.get(tx.hash)
175
180
  if (!receipt) return null
176
- const blockTx = prefetchedTransactionToBlockTransaction(tx, receipt)
181
+ const blockTx = prefetchedTransactionToBlockTransaction(tx, receipt, logger)
177
182
  transactions.push({
178
183
  ...blockTx,
179
- operations: applyChainSpecificCorrections(currencyId, blockTx.operations, receipt.type),
184
+ operations: applyChainSpecificCorrections(
185
+ currencyId,
186
+ blockTx.operations,
187
+ receipt.type,
188
+ logger
189
+ ),
180
190
  })
181
191
  }
182
192
 
@@ -185,7 +195,7 @@ async function getTransactionsFromPrefetchedData(
185
195
  if (!(error instanceof UnsupportedRpcMethodError) || error.method !== 'eth_getBlockReceipts')
186
196
  throw error
187
197
 
188
- log('warn', 'EVM getBlock fallback: eth_getBlockReceipts unsupported', {
198
+ logger('warn', 'EVM getBlock fallback: eth_getBlockReceipts unsupported', {
189
199
  currencyId,
190
200
  blockHeight,
191
201
  error: error.rawError,
@@ -196,7 +206,8 @@ async function getTransactionsFromPrefetchedData(
196
206
 
197
207
  function prefetchedTransactionToBlockTransaction(
198
208
  tx: PrefetchedBlockTransaction,
199
- receipt: BlockReceiptInfo
209
+ receipt: BlockReceiptInfo,
210
+ logger: Logger
200
211
  ): BlockTransaction {
201
212
  const failed = receipt.status === 0
202
213
  // Some EVM chains (e.g. Cronos) omit `gasPrice` from transaction
@@ -205,14 +216,17 @@ function prefetchedTransactionToBlockTransaction(
205
216
  const receiptGasPrice = BigInt(receipt.gasPrice)
206
217
  const gasPrice = receiptGasPrice > 0n ? receiptGasPrice : BigInt(tx.gasPrice)
207
218
  const fees = BigInt(receipt.gasUsed) * gasPrice + (receipt.l1Fee ? BigInt(receipt.l1Fee) : 0n)
208
- const operations = rpcTransactionToBlockOperations({
209
- from: tx.from,
210
- to: tx.to,
211
- value: tx.value,
212
- erc20Transfers: receipt.erc20Transfers,
213
- })
219
+ const operations = rpcTransactionToBlockOperations(
220
+ {
221
+ from: tx.from,
222
+ to: tx.to,
223
+ value: tx.value,
224
+ erc20Transfers: receipt.erc20Transfers,
225
+ },
226
+ logger
227
+ )
214
228
 
215
- const details = buildSmartContractDetails(tx.to, tx.input, receipt.contractAddress)
229
+ const details = buildSmartContractDetails(tx.to, tx.input, logger, receipt.contractAddress)
216
230
 
217
231
  return {
218
232
  hash: tx.hash,
@@ -227,7 +241,8 @@ function prefetchedTransactionToBlockTransaction(
227
241
  async function getTransactionFromHash(
228
242
  currencyId: string,
229
243
  txHash: string,
230
- nodeApi: ReturnType<typeof getNodeApi>
244
+ nodeApi: ReturnType<typeof getNodeApi>,
245
+ logger: Logger
231
246
  ): Promise<BlockTransaction | null> {
232
247
  const txInfo = await nodeApi.getTransaction(currencyId, txHash)
233
248
 
@@ -235,10 +250,10 @@ async function getTransactionFromHash(
235
250
  const fees =
236
251
  BigInt(txInfo.gasUsed) * BigInt(txInfo.gasPrice) + (txInfo.l1Fee ? BigInt(txInfo.l1Fee) : 0n)
237
252
 
238
- const rawOperations = rpcTransactionToBlockOperations(txInfo)
239
- const operations = applyChainSpecificCorrections(currencyId, rawOperations, txInfo.type)
253
+ const rawOperations = rpcTransactionToBlockOperations(txInfo, logger)
254
+ const operations = applyChainSpecificCorrections(currencyId, rawOperations, txInfo.type, logger)
240
255
 
241
- const details = buildSmartContractDetails(txInfo.to, txInfo.input, txInfo.contractAddress)
256
+ const details = buildSmartContractDetails(txInfo.to, txInfo.input, logger, txInfo.contractAddress)
242
257
 
243
258
  return {
244
259
  hash: txHash,
@@ -250,16 +265,15 @@ async function getTransactionFromHash(
250
265
  }
251
266
  }
252
267
 
253
- const ZKSYNC_MINT_PEER = safeEncodeEIP55('0x0000000000000000000000000000000000000000')
254
-
255
268
  function applyChainSpecificCorrections(
256
269
  currencyId: string,
257
270
  operations: BlockOperation[],
258
- receiptType: number | undefined
271
+ receiptType: number | undefined,
272
+ logger: Logger
259
273
  ): BlockOperation[] {
260
274
  switch (currencyId) {
261
275
  case 'zksync':
262
- return rewriteZkSyncL1ToL2DepositOps(operations, receiptType)
276
+ return rewriteZkSyncL1ToL2DepositOps(operations, receiptType, logger)
263
277
  default:
264
278
  return operations
265
279
  }
@@ -272,11 +286,13 @@ function applyChainSpecificCorrections(
272
286
  */
273
287
  function rewriteZkSyncL1ToL2DepositOps(
274
288
  operations: BlockOperation[],
275
- receiptType: number | undefined
289
+ receiptType: number | undefined,
290
+ logger: Logger
276
291
  ): BlockOperation[] {
277
292
  if (receiptType !== 0xff) return operations
293
+ const zkSyncMintPeer = safeEncodeEIP55('0x0000000000000000000000000000000000000000', logger)
278
294
  const withoutMintSource = operations.filter(
279
- (op) => op.type !== 'transfer' || op.address.toLowerCase() !== ZKSYNC_MINT_PEER.toLowerCase()
295
+ (op) => op.type !== 'transfer' || op.address.toLowerCase() !== zkSyncMintPeer.toLowerCase()
280
296
  )
281
297
  const nativeSelf = withoutMintSource.find(
282
298
  (op): op is TransferBlockOperation =>
@@ -290,7 +306,7 @@ function rewriteZkSyncL1ToL2DepositOps(
290
306
  const nativeCredit: TransferBlockOperation = {
291
307
  type: 'transfer',
292
308
  address: nativeSelf.address,
293
- peer: ZKSYNC_MINT_PEER,
309
+ peer: zkSyncMintPeer,
294
310
  asset: { type: 'native' },
295
311
  amount: nativeSelf.amount,
296
312
  }
@@ -30,9 +30,10 @@ export const getStakes = async (
30
30
  address,
31
31
  contractConfig,
32
32
  currencyId,
33
+ context.logger,
33
34
  options?.knownValidatorIds
34
35
  ),
35
- fetchUnbondings(config, currencyId, address).catch(() => []),
36
+ fetchUnbondings(config, currencyId, address, context.logger).catch(() => []),
36
37
  ])
37
38
  return { items: [...stakes, ...unbondings] }
38
39
  } catch {