viem 2.10.9 → 2.11.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 (338) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/_cjs/actions/public/call.js +3 -60
  3. package/_cjs/actions/public/call.js.map +1 -1
  4. package/_cjs/actions/public/estimateGas.js +8 -2
  5. package/_cjs/actions/public/estimateGas.js.map +1 -1
  6. package/_cjs/celo/formatters.js +1 -10
  7. package/_cjs/celo/formatters.js.map +1 -1
  8. package/_cjs/celo/serializers.js +0 -25
  9. package/_cjs/celo/serializers.js.map +1 -1
  10. package/_cjs/celo/utils.js +2 -15
  11. package/_cjs/celo/utils.js.map +1 -1
  12. package/_cjs/chains/definitions/bob.js +33 -0
  13. package/_cjs/chains/definitions/bob.js.map +1 -0
  14. package/_cjs/chains/definitions/funkiSepolia.js +34 -0
  15. package/_cjs/chains/definitions/funkiSepolia.js.map +1 -0
  16. package/_cjs/chains/definitions/lisk.js +34 -0
  17. package/_cjs/chains/definitions/lisk.js.map +1 -0
  18. package/_cjs/chains/definitions/metalL2.js +53 -0
  19. package/_cjs/chains/definitions/metalL2.js.map +1 -0
  20. package/_cjs/chains/index.js +14 -6
  21. package/_cjs/chains/index.js.map +1 -1
  22. package/_cjs/errors/version.js +1 -1
  23. package/_cjs/op-stack/chains.js +3 -1
  24. package/_cjs/op-stack/chains.js.map +1 -1
  25. package/_cjs/utils/stateOverride.js +63 -0
  26. package/_cjs/utils/stateOverride.js.map +1 -0
  27. package/_cjs/zksync/actions/estimateFee.js +26 -0
  28. package/_cjs/zksync/actions/estimateFee.js.map +1 -0
  29. package/_cjs/zksync/actions/estimateGasL1ToL2.js +20 -0
  30. package/_cjs/zksync/actions/estimateGasL1ToL2.js.map +1 -0
  31. package/_cjs/zksync/actions/getAllBalances.js +19 -0
  32. package/_cjs/zksync/actions/getAllBalances.js.map +1 -0
  33. package/_cjs/zksync/actions/getBaseTokenL1Address.js +9 -0
  34. package/_cjs/zksync/actions/getBaseTokenL1Address.js.map +1 -0
  35. package/_cjs/zksync/actions/getBlockDetails.js +12 -0
  36. package/_cjs/zksync/actions/getBlockDetails.js.map +1 -0
  37. package/_cjs/zksync/actions/getBridgehubContractAddress.js +9 -0
  38. package/_cjs/zksync/actions/getBridgehubContractAddress.js.map +1 -0
  39. package/_cjs/zksync/actions/getDefaultBridgeAddresses.js +13 -0
  40. package/_cjs/zksync/actions/getDefaultBridgeAddresses.js.map +1 -0
  41. package/_cjs/zksync/actions/getL1Allowance.js +19 -0
  42. package/_cjs/zksync/actions/getL1Allowance.js.map +1 -0
  43. package/_cjs/zksync/actions/getL1Balance.js +23 -0
  44. package/_cjs/zksync/actions/getL1Balance.js.map +1 -0
  45. package/_cjs/zksync/actions/getL1BatchBlockRange.js +13 -0
  46. package/_cjs/zksync/actions/getL1BatchBlockRange.js.map +1 -0
  47. package/_cjs/zksync/actions/getL1BatchDetails.js +12 -0
  48. package/_cjs/zksync/actions/getL1BatchDetails.js.map +1 -0
  49. package/_cjs/zksync/actions/getL1BatchNumber.js +9 -0
  50. package/_cjs/zksync/actions/getL1BatchNumber.js.map +1 -0
  51. package/_cjs/zksync/actions/getL1ChainId.js +9 -0
  52. package/_cjs/zksync/actions/getL1ChainId.js.map +1 -0
  53. package/_cjs/zksync/actions/getL1TokenBalance.js +24 -0
  54. package/_cjs/zksync/actions/getL1TokenBalance.js.map +1 -0
  55. package/_cjs/zksync/actions/getLogProof.js +12 -0
  56. package/_cjs/zksync/actions/getLogProof.js.map +1 -0
  57. package/_cjs/zksync/actions/getMainContractAddress.js +9 -0
  58. package/_cjs/zksync/actions/getMainContractAddress.js.map +1 -0
  59. package/_cjs/zksync/actions/getRawBlockTransactions.js +13 -0
  60. package/_cjs/zksync/actions/getRawBlockTransactions.js.map +1 -0
  61. package/_cjs/zksync/actions/getTestnetPaymasterAddress.js +9 -0
  62. package/_cjs/zksync/actions/getTestnetPaymasterAddress.js.map +1 -0
  63. package/_cjs/zksync/actions/getTransactionDetails.js +12 -0
  64. package/_cjs/zksync/actions/getTransactionDetails.js.map +1 -0
  65. package/_cjs/zksync/constants/address.js +4 -1
  66. package/_cjs/zksync/constants/address.js.map +1 -1
  67. package/_cjs/zksync/decorators/publicL1.js +15 -0
  68. package/_cjs/zksync/decorators/publicL1.js.map +1 -0
  69. package/_cjs/zksync/decorators/publicL2.js +43 -0
  70. package/_cjs/zksync/decorators/publicL2.js.map +1 -0
  71. package/_cjs/zksync/errors/token-is-eth.js +17 -0
  72. package/_cjs/zksync/errors/token-is-eth.js.map +1 -0
  73. package/_cjs/zksync/index.js +41 -3
  74. package/_cjs/zksync/index.js.map +1 -1
  75. package/_cjs/zksync/types/eip1193.js +3 -0
  76. package/_cjs/zksync/types/eip1193.js.map +1 -0
  77. package/_cjs/zksync/types/proof.js +3 -0
  78. package/_cjs/zksync/types/proof.js.map +1 -0
  79. package/_cjs/zksync/utils/camelCaseKeys.js +17 -0
  80. package/_cjs/zksync/utils/camelCaseKeys.js.map +1 -0
  81. package/_cjs/zksync/utils/isEth.js +17 -0
  82. package/_cjs/zksync/utils/isEth.js.map +1 -0
  83. package/_cjs/zksync/utils/paymaster/getApprovalBasedPaymasterInput.js +4 -3
  84. package/_cjs/zksync/utils/paymaster/getApprovalBasedPaymasterInput.js.map +1 -1
  85. package/_cjs/zksync/utils/paymaster/getGeneralPaymasterInput.js +4 -3
  86. package/_cjs/zksync/utils/paymaster/getGeneralPaymasterInput.js.map +1 -1
  87. package/_esm/actions/public/call.js +2 -56
  88. package/_esm/actions/public/call.js.map +1 -1
  89. package/_esm/actions/public/estimateGas.js +8 -2
  90. package/_esm/actions/public/estimateGas.js.map +1 -1
  91. package/_esm/celo/formatters.js +2 -11
  92. package/_esm/celo/formatters.js.map +1 -1
  93. package/_esm/celo/serializers.js +1 -29
  94. package/_esm/celo/serializers.js.map +1 -1
  95. package/_esm/celo/utils.js +1 -15
  96. package/_esm/celo/utils.js.map +1 -1
  97. package/_esm/chains/definitions/bob.js +30 -0
  98. package/_esm/chains/definitions/bob.js.map +1 -0
  99. package/_esm/chains/definitions/funkiSepolia.js +31 -0
  100. package/_esm/chains/definitions/funkiSepolia.js.map +1 -0
  101. package/_esm/chains/definitions/lisk.js +31 -0
  102. package/_esm/chains/definitions/lisk.js.map +1 -0
  103. package/_esm/chains/definitions/metalL2.js +50 -0
  104. package/_esm/chains/definitions/metalL2.js.map +1 -0
  105. package/_esm/chains/index.js +4 -0
  106. package/_esm/chains/index.js.map +1 -1
  107. package/_esm/errors/version.js +1 -1
  108. package/_esm/op-stack/chains.js +1 -0
  109. package/_esm/op-stack/chains.js.map +1 -1
  110. package/_esm/utils/stateOverride.js +57 -0
  111. package/_esm/utils/stateOverride.js.map +1 -0
  112. package/_esm/zksync/actions/estimateFee.js +22 -0
  113. package/_esm/zksync/actions/estimateFee.js.map +1 -0
  114. package/_esm/zksync/actions/estimateGasL1ToL2.js +16 -0
  115. package/_esm/zksync/actions/estimateGasL1ToL2.js.map +1 -0
  116. package/_esm/zksync/actions/getAllBalances.js +15 -0
  117. package/_esm/zksync/actions/getAllBalances.js.map +1 -0
  118. package/_esm/zksync/actions/getBaseTokenL1Address.js +5 -0
  119. package/_esm/zksync/actions/getBaseTokenL1Address.js.map +1 -0
  120. package/_esm/zksync/actions/getBlockDetails.js +8 -0
  121. package/_esm/zksync/actions/getBlockDetails.js.map +1 -0
  122. package/_esm/zksync/actions/getBridgehubContractAddress.js +5 -0
  123. package/_esm/zksync/actions/getBridgehubContractAddress.js.map +1 -0
  124. package/_esm/zksync/actions/getDefaultBridgeAddresses.js +9 -0
  125. package/_esm/zksync/actions/getDefaultBridgeAddresses.js.map +1 -0
  126. package/_esm/zksync/actions/getL1Allowance.js +15 -0
  127. package/_esm/zksync/actions/getL1Allowance.js.map +1 -0
  128. package/_esm/zksync/actions/getL1Balance.js +19 -0
  129. package/_esm/zksync/actions/getL1Balance.js.map +1 -0
  130. package/_esm/zksync/actions/getL1BatchBlockRange.js +9 -0
  131. package/_esm/zksync/actions/getL1BatchBlockRange.js.map +1 -0
  132. package/_esm/zksync/actions/getL1BatchDetails.js +8 -0
  133. package/_esm/zksync/actions/getL1BatchDetails.js.map +1 -0
  134. package/_esm/zksync/actions/getL1BatchNumber.js +5 -0
  135. package/_esm/zksync/actions/getL1BatchNumber.js.map +1 -0
  136. package/_esm/zksync/actions/getL1ChainId.js +5 -0
  137. package/_esm/zksync/actions/getL1ChainId.js.map +1 -0
  138. package/_esm/zksync/actions/getL1TokenBalance.js +20 -0
  139. package/_esm/zksync/actions/getL1TokenBalance.js.map +1 -0
  140. package/_esm/zksync/actions/getLogProof.js +8 -0
  141. package/_esm/zksync/actions/getLogProof.js.map +1 -0
  142. package/_esm/zksync/actions/getMainContractAddress.js +5 -0
  143. package/_esm/zksync/actions/getMainContractAddress.js.map +1 -0
  144. package/_esm/zksync/actions/getRawBlockTransactions.js +9 -0
  145. package/_esm/zksync/actions/getRawBlockTransactions.js.map +1 -0
  146. package/_esm/zksync/actions/getTestnetPaymasterAddress.js +5 -0
  147. package/_esm/zksync/actions/getTestnetPaymasterAddress.js.map +1 -0
  148. package/_esm/zksync/actions/getTransactionDetails.js +8 -0
  149. package/_esm/zksync/actions/getTransactionDetails.js.map +1 -0
  150. package/_esm/zksync/constants/address.js +3 -0
  151. package/_esm/zksync/constants/address.js.map +1 -1
  152. package/_esm/zksync/decorators/publicL1.js +12 -0
  153. package/_esm/zksync/decorators/publicL1.js.map +1 -0
  154. package/_esm/zksync/decorators/publicL2.js +39 -0
  155. package/_esm/zksync/decorators/publicL2.js.map +1 -0
  156. package/_esm/zksync/errors/token-is-eth.js +13 -0
  157. package/_esm/zksync/errors/token-is-eth.js.map +1 -0
  158. package/_esm/zksync/index.js +20 -1
  159. package/_esm/zksync/index.js.map +1 -1
  160. package/_esm/zksync/types/eip1193.js +2 -0
  161. package/_esm/zksync/types/eip1193.js.map +1 -0
  162. package/_esm/zksync/types/proof.js +2 -0
  163. package/_esm/zksync/types/proof.js.map +1 -0
  164. package/_esm/zksync/utils/camelCaseKeys.js +13 -0
  165. package/_esm/zksync/utils/camelCaseKeys.js.map +1 -0
  166. package/_esm/zksync/utils/isEth.js +13 -0
  167. package/_esm/zksync/utils/isEth.js.map +1 -0
  168. package/_esm/zksync/utils/paymaster/getApprovalBasedPaymasterInput.js +2 -1
  169. package/_esm/zksync/utils/paymaster/getApprovalBasedPaymasterInput.js.map +1 -1
  170. package/_esm/zksync/utils/paymaster/getGeneralPaymasterInput.js +2 -1
  171. package/_esm/zksync/utils/paymaster/getGeneralPaymasterInput.js.map +1 -1
  172. package/_types/actions/public/call.d.ts +3 -12
  173. package/_types/actions/public/call.d.ts.map +1 -1
  174. package/_types/actions/public/estimateGas.d.ts +2 -0
  175. package/_types/actions/public/estimateGas.d.ts.map +1 -1
  176. package/_types/celo/chainConfig.d.ts +58 -526
  177. package/_types/celo/chainConfig.d.ts.map +1 -1
  178. package/_types/celo/formatters.d.ts +29 -263
  179. package/_types/celo/formatters.d.ts.map +1 -1
  180. package/_types/celo/index.d.ts +1 -1
  181. package/_types/celo/index.d.ts.map +1 -1
  182. package/_types/celo/serializers.d.ts +2 -3
  183. package/_types/celo/serializers.d.ts.map +1 -1
  184. package/_types/celo/types.d.ts +7 -31
  185. package/_types/celo/types.d.ts.map +1 -1
  186. package/_types/celo/utils.d.ts +1 -2
  187. package/_types/celo/utils.d.ts.map +1 -1
  188. package/_types/chains/definitions/bob.d.ts +34 -0
  189. package/_types/chains/definitions/bob.d.ts.map +1 -0
  190. package/_types/chains/definitions/celo.d.ts +58 -526
  191. package/_types/chains/definitions/celo.d.ts.map +1 -1
  192. package/_types/chains/definitions/celoAlfajores.d.ts +58 -526
  193. package/_types/chains/definitions/celoAlfajores.d.ts.map +1 -1
  194. package/_types/chains/definitions/funkiSepolia.d.ts +1064 -0
  195. package/_types/chains/definitions/funkiSepolia.d.ts.map +1 -0
  196. package/_types/chains/definitions/lisk.d.ts +1453 -0
  197. package/_types/chains/definitions/lisk.d.ts.map +1 -0
  198. package/_types/chains/definitions/metalL2.d.ts +1080 -0
  199. package/_types/chains/definitions/metalL2.d.ts.map +1 -0
  200. package/_types/chains/definitions/playfiAlbireo.d.ts +8 -8
  201. package/_types/chains/definitions/zkSync.d.ts +8 -8
  202. package/_types/chains/definitions/zkSyncInMemoryNode.d.ts +8 -8
  203. package/_types/chains/definitions/zkSyncLocalNode.d.ts +8 -8
  204. package/_types/chains/definitions/zkSyncSepoliaTestnet.d.ts +8 -8
  205. package/_types/chains/definitions/zkSyncTestnet.d.ts +8 -8
  206. package/_types/chains/index.d.ts +5 -1
  207. package/_types/chains/index.d.ts.map +1 -1
  208. package/_types/errors/version.d.ts +1 -1
  209. package/_types/op-stack/chains.d.ts +1 -0
  210. package/_types/op-stack/chains.d.ts.map +1 -1
  211. package/_types/op-stack/types/transaction.d.ts +2 -2
  212. package/_types/op-stack/types/transaction.d.ts.map +1 -1
  213. package/_types/types/eip1193.d.ts +11 -3
  214. package/_types/types/eip1193.d.ts.map +1 -1
  215. package/_types/utils/stateOverride.d.ts +16 -0
  216. package/_types/utils/stateOverride.d.ts.map +1 -0
  217. package/_types/zksync/actions/estimateFee.d.ts +11 -0
  218. package/_types/zksync/actions/estimateFee.d.ts.map +1 -0
  219. package/_types/zksync/actions/estimateGasL1ToL2.d.ts +10 -0
  220. package/_types/zksync/actions/estimateGasL1ToL2.d.ts.map +1 -0
  221. package/_types/zksync/actions/getAllBalances.d.ts +12 -0
  222. package/_types/zksync/actions/getAllBalances.d.ts.map +1 -0
  223. package/_types/zksync/actions/getBaseTokenL1Address.d.ts +9 -0
  224. package/_types/zksync/actions/getBaseTokenL1Address.d.ts.map +1 -0
  225. package/_types/zksync/actions/getBlockDetails.d.ts +10 -0
  226. package/_types/zksync/actions/getBlockDetails.d.ts.map +1 -0
  227. package/_types/zksync/actions/getBridgehubContractAddress.d.ts +9 -0
  228. package/_types/zksync/actions/getBridgehubContractAddress.d.ts.map +1 -0
  229. package/_types/zksync/actions/getDefaultBridgeAddresses.d.ts +9 -0
  230. package/_types/zksync/actions/getDefaultBridgeAddresses.d.ts.map +1 -0
  231. package/_types/zksync/actions/getL1Allowance.d.ts +17 -0
  232. package/_types/zksync/actions/getL1Allowance.d.ts.map +1 -0
  233. package/_types/zksync/actions/getL1Balance.d.ts +23 -0
  234. package/_types/zksync/actions/getL1Balance.d.ts.map +1 -0
  235. package/_types/zksync/actions/getL1BatchBlockRange.d.ts +11 -0
  236. package/_types/zksync/actions/getL1BatchBlockRange.d.ts.map +1 -0
  237. package/_types/zksync/actions/getL1BatchDetails.d.ts +10 -0
  238. package/_types/zksync/actions/getL1BatchDetails.d.ts.map +1 -0
  239. package/_types/zksync/actions/getL1BatchNumber.d.ts +9 -0
  240. package/_types/zksync/actions/getL1BatchNumber.d.ts.map +1 -0
  241. package/_types/zksync/actions/getL1ChainId.d.ts +9 -0
  242. package/_types/zksync/actions/getL1ChainId.d.ts.map +1 -0
  243. package/_types/zksync/actions/getL1TokenBalance.d.ts +24 -0
  244. package/_types/zksync/actions/getL1TokenBalance.d.ts.map +1 -0
  245. package/_types/zksync/actions/getLogProof.d.ts +14 -0
  246. package/_types/zksync/actions/getLogProof.d.ts.map +1 -0
  247. package/_types/zksync/actions/getMainContractAddress.d.ts +9 -0
  248. package/_types/zksync/actions/getMainContractAddress.d.ts.map +1 -0
  249. package/_types/zksync/actions/getRawBlockTransactions.d.ts +11 -0
  250. package/_types/zksync/actions/getRawBlockTransactions.d.ts.map +1 -0
  251. package/_types/zksync/actions/getTestnetPaymasterAddress.d.ts +9 -0
  252. package/_types/zksync/actions/getTestnetPaymasterAddress.d.ts.map +1 -0
  253. package/_types/zksync/actions/getTransactionDetails.d.ts +13 -0
  254. package/_types/zksync/actions/getTransactionDetails.d.ts.map +1 -0
  255. package/_types/zksync/chainConfig.d.ts +8 -8
  256. package/_types/zksync/constants/address.d.ts +3 -0
  257. package/_types/zksync/constants/address.d.ts.map +1 -1
  258. package/_types/zksync/decorators/publicL1.d.ts +145 -0
  259. package/_types/zksync/decorators/publicL1.d.ts.map +1 -0
  260. package/_types/zksync/decorators/publicL2.d.ts +322 -0
  261. package/_types/zksync/decorators/publicL2.d.ts.map +1 -0
  262. package/_types/zksync/errors/token-is-eth.d.ts +9 -0
  263. package/_types/zksync/errors/token-is-eth.d.ts.map +1 -0
  264. package/_types/zksync/formatters.d.ts +8 -8
  265. package/_types/zksync/index.d.ts +21 -2
  266. package/_types/zksync/index.d.ts.map +1 -1
  267. package/_types/zksync/types/block.d.ts +30 -1
  268. package/_types/zksync/types/block.d.ts.map +1 -1
  269. package/_types/zksync/types/contract.d.ts +6 -0
  270. package/_types/zksync/types/contract.d.ts.map +1 -1
  271. package/_types/zksync/types/eip1193.d.ts +152 -0
  272. package/_types/zksync/types/eip1193.d.ts.map +1 -0
  273. package/_types/zksync/types/fee.d.ts +6 -0
  274. package/_types/zksync/types/fee.d.ts.map +1 -1
  275. package/_types/zksync/types/proof.d.ts +7 -0
  276. package/_types/zksync/types/proof.d.ts.map +1 -0
  277. package/_types/zksync/types/transaction.d.ts +66 -6
  278. package/_types/zksync/types/transaction.d.ts.map +1 -1
  279. package/_types/zksync/utils/camelCaseKeys.d.ts +2 -0
  280. package/_types/zksync/utils/camelCaseKeys.d.ts.map +1 -0
  281. package/_types/zksync/utils/isEth.d.ts +3 -0
  282. package/_types/zksync/utils/isEth.d.ts.map +1 -0
  283. package/_types/zksync/utils/paymaster/getApprovalBasedPaymasterInput.d.ts +1 -1
  284. package/_types/zksync/utils/paymaster/getApprovalBasedPaymasterInput.d.ts.map +1 -1
  285. package/_types/zksync/utils/paymaster/getGeneralPaymasterInput.d.ts +1 -1
  286. package/_types/zksync/utils/paymaster/getGeneralPaymasterInput.d.ts.map +1 -1
  287. package/actions/public/call.ts +8 -91
  288. package/actions/public/estimateGas.ts +11 -1
  289. package/celo/formatters.ts +3 -11
  290. package/celo/index.ts +0 -2
  291. package/celo/serializers.ts +2 -50
  292. package/celo/types.ts +6 -41
  293. package/celo/utils.ts +1 -24
  294. package/chains/definitions/bob.ts +30 -0
  295. package/chains/definitions/funkiSepolia.ts +32 -0
  296. package/chains/definitions/lisk.ts +31 -0
  297. package/chains/definitions/metalL2.ts +51 -0
  298. package/chains/index.ts +4 -2
  299. package/errors/version.ts +1 -1
  300. package/op-stack/chains.ts +1 -0
  301. package/op-stack/types/transaction.ts +2 -2
  302. package/package.json +1 -1
  303. package/types/eip1193.ts +11 -1
  304. package/utils/stateOverride.ts +98 -0
  305. package/zksync/actions/estimateFee.ts +46 -0
  306. package/zksync/actions/estimateGasL1ToL2.ts +38 -0
  307. package/zksync/actions/getAllBalances.ts +33 -0
  308. package/zksync/actions/getBaseTokenL1Address.ts +18 -0
  309. package/zksync/actions/getBlockDetails.ts +27 -0
  310. package/zksync/actions/getBridgehubContractAddress.ts +18 -0
  311. package/zksync/actions/getDefaultBridgeAddresses.ts +22 -0
  312. package/zksync/actions/getL1Allowance.ts +43 -0
  313. package/zksync/actions/getL1Balance.ts +68 -0
  314. package/zksync/actions/getL1BatchBlockRange.ts +26 -0
  315. package/zksync/actions/getL1BatchDetails.ts +27 -0
  316. package/zksync/actions/getL1BatchNumber.ts +18 -0
  317. package/zksync/actions/getL1ChainId.ts +18 -0
  318. package/zksync/actions/getL1TokenBalance.ts +63 -0
  319. package/zksync/actions/getLogProof.ts +28 -0
  320. package/zksync/actions/getMainContractAddress.ts +18 -0
  321. package/zksync/actions/getRawBlockTransactions.ts +26 -0
  322. package/zksync/actions/getTestnetPaymasterAddress.ts +18 -0
  323. package/zksync/actions/getTransactionDetails.ts +27 -0
  324. package/zksync/constants/address.ts +9 -0
  325. package/zksync/decorators/publicL1.ts +180 -0
  326. package/zksync/decorators/publicL2.ts +443 -0
  327. package/zksync/errors/token-is-eth.ts +16 -0
  328. package/zksync/index.ts +85 -6
  329. package/zksync/types/block.ts +37 -1
  330. package/zksync/types/contract.ts +8 -0
  331. package/zksync/types/eip1193.ts +155 -0
  332. package/zksync/types/fee.ts +7 -0
  333. package/zksync/types/proof.ts +7 -0
  334. package/zksync/types/transaction.ts +86 -12
  335. package/zksync/utils/camelCaseKeys.ts +11 -0
  336. package/zksync/utils/isEth.ts +20 -0
  337. package/zksync/utils/paymaster/getApprovalBasedPaymasterInput.ts +5 -2
  338. package/zksync/utils/paymaster/getGeneralPaymasterInput.ts +5 -2
@@ -9,10 +9,6 @@ import type { Client } from '../../clients/createClient.js'
9
9
  import type { Transport } from '../../clients/transports/createTransport.js'
10
10
  import { multicall3Abi } from '../../constants/abis.js'
11
11
  import { aggregate3Signature } from '../../constants/contract.js'
12
- import {
13
- InvalidAddressError,
14
- type InvalidAddressErrorType,
15
- } from '../../errors/address.js'
16
12
  import { BaseError } from '../../errors/base.js'
17
13
  import {
18
14
  ChainDoesNotSupportContract,
@@ -22,27 +18,12 @@ import {
22
18
  RawContractError,
23
19
  type RawContractErrorType,
24
20
  } from '../../errors/contract.js'
25
- import {
26
- InvalidBytesLengthError,
27
- type InvalidBytesLengthErrorType,
28
- } from '../../errors/data.js'
29
- import {
30
- AccountStateConflictError,
31
- type AccountStateConflictErrorType,
32
- StateAssignmentConflictError,
33
- type StateAssignmentConflictErrorType,
34
- } from '../../errors/stateOverride.js'
35
21
  import type { ErrorType } from '../../errors/utils.js'
36
22
  import type { BlockTag } from '../../types/block.js'
37
23
  import type { Chain } from '../../types/chain.js'
38
24
  import type { Hex } from '../../types/misc.js'
39
- import type {
40
- RpcAccountStateOverride,
41
- RpcStateMapping,
42
- RpcStateOverride,
43
- RpcTransactionRequest,
44
- } from '../../types/rpc.js'
45
- import type { StateMapping, StateOverride } from '../../types/stateOverride.js'
25
+ import type { RpcTransactionRequest } from '../../types/rpc.js'
26
+ import type { StateOverride } from '../../types/stateOverride.js'
46
27
  import type { TransactionRequest } from '../../types/transaction.js'
47
28
  import type { ExactPartial, UnionOmit } from '../../types/utils.js'
48
29
  import {
@@ -53,7 +34,6 @@ import {
53
34
  type EncodeFunctionDataErrorType,
54
35
  encodeFunctionData,
55
36
  } from '../../utils/abi/encodeFunctionData.js'
56
- import { isAddress } from '../../utils/address/isAddress.js'
57
37
  import type { RequestErrorType } from '../../utils/buildRequest.js'
58
38
  import {
59
39
  type GetChainContractAddressErrorType,
@@ -77,6 +57,10 @@ import {
77
57
  type CreateBatchSchedulerErrorType,
78
58
  createBatchScheduler,
79
59
  } from '../../utils/promise/createBatchScheduler.js'
60
+ import {
61
+ type SerializeStateOverrideErrorType,
62
+ serializeStateOverride,
63
+ } from '../../utils/stateOverride.js'
80
64
  import { assertRequest } from '../../utils/transaction/assertRequest.js'
81
65
  import type {
82
66
  AssertRequestErrorType,
@@ -113,7 +97,7 @@ export type CallReturnType = { data: Hex | undefined }
113
97
 
114
98
  export type CallErrorType = GetCallErrorReturnType<
115
99
  | ParseAccountErrorType
116
- | ParseStateOverrideErrorType
100
+ | SerializeStateOverrideErrorType
117
101
  | AssertRequestErrorType
118
102
  | NumberToHexErrorType
119
103
  | FormatTransactionRequestErrorType
@@ -177,7 +161,7 @@ export async function call<TChain extends Chain | undefined>(
177
161
  const blockNumberHex = blockNumber ? numberToHex(blockNumber) : undefined
178
162
  const block = blockNumberHex || blockTag
179
163
 
180
- const rpcStateOverride = parseStateOverride(stateOverride)
164
+ const rpcStateOverride = serializeStateOverride(stateOverride)
181
165
 
182
166
  const chainFormat = client.chain?.formatters?.transactionRequest?.format
183
167
  const format = chainFormat || formatTransactionRequest
@@ -368,70 +352,3 @@ export function getRevertErrorData(err: unknown) {
368
352
  const error = err.walk() as RawContractError
369
353
  return typeof error?.data === 'object' ? error.data?.data : error.data
370
354
  }
371
-
372
- export type ParseStateMappingErrorType = InvalidBytesLengthErrorType
373
-
374
- export function parseStateMapping(
375
- stateMapping: StateMapping | undefined,
376
- ): RpcStateMapping | undefined {
377
- if (!stateMapping || stateMapping.length === 0) return undefined
378
- return stateMapping.reduce((acc, { slot, value }) => {
379
- if (slot.length !== 66)
380
- throw new InvalidBytesLengthError({
381
- size: slot.length,
382
- targetSize: 66,
383
- type: 'hex',
384
- })
385
- if (value.length !== 66)
386
- throw new InvalidBytesLengthError({
387
- size: value.length,
388
- targetSize: 66,
389
- type: 'hex',
390
- })
391
- acc[slot] = value
392
- return acc
393
- }, {} as RpcStateMapping)
394
- }
395
-
396
- export type ParseAccountStateOverrideErrorType =
397
- | NumberToHexErrorType
398
- | StateAssignmentConflictErrorType
399
- | ParseStateMappingErrorType
400
-
401
- export function parseAccountStateOverride(
402
- args: Omit<StateOverride[number], 'address'>,
403
- ): RpcAccountStateOverride {
404
- const { balance, nonce, state, stateDiff, code } = args
405
- const rpcAccountStateOverride: RpcAccountStateOverride = {}
406
- if (code !== undefined) rpcAccountStateOverride.code = code
407
- if (balance !== undefined)
408
- rpcAccountStateOverride.balance = numberToHex(balance)
409
- if (nonce !== undefined) rpcAccountStateOverride.nonce = numberToHex(nonce)
410
- if (state !== undefined)
411
- rpcAccountStateOverride.state = parseStateMapping(state)
412
- if (stateDiff !== undefined) {
413
- if (rpcAccountStateOverride.state) throw new StateAssignmentConflictError()
414
- rpcAccountStateOverride.stateDiff = parseStateMapping(stateDiff)
415
- }
416
- return rpcAccountStateOverride
417
- }
418
-
419
- export type ParseStateOverrideErrorType =
420
- | InvalidAddressErrorType
421
- | AccountStateConflictErrorType
422
- | ParseAccountStateOverrideErrorType
423
-
424
- export function parseStateOverride(
425
- args?: StateOverride | undefined,
426
- ): RpcStateOverride | undefined {
427
- if (!args) return undefined
428
- const rpcStateOverride: RpcStateOverride = {}
429
- for (const { address, ...accountState } of args) {
430
- if (!isAddress(address, { strict: false }))
431
- throw new InvalidAddressError({ address })
432
- if (rpcStateOverride[address])
433
- throw new AccountStateConflictError({ address: address })
434
- rpcStateOverride[address] = parseAccountStateOverride(accountState)
435
- }
436
- return rpcStateOverride
437
- }
@@ -9,6 +9,7 @@ import type { Transport } from '../../clients/transports/createTransport.js'
9
9
  import type { BaseError } from '../../errors/base.js'
10
10
  import type { BlockTag } from '../../types/block.js'
11
11
  import type { Chain } from '../../types/chain.js'
12
+ import type { StateOverride } from '../../types/stateOverride.js'
12
13
  import type { TransactionRequest } from '../../types/transaction.js'
13
14
  import type { UnionOmit } from '../../types/utils.js'
14
15
  import type { RequestErrorType } from '../../utils/buildRequest.js'
@@ -25,6 +26,7 @@ import {
25
26
  type FormattedTransactionRequest,
26
27
  formatTransactionRequest,
27
28
  } from '../../utils/formatters/transactionRequest.js'
29
+ import { serializeStateOverride } from '../../utils/stateOverride.js'
28
30
  import {
29
31
  type AssertRequestErrorType,
30
32
  type AssertRequestParameters,
@@ -43,6 +45,7 @@ export type EstimateGasParameters<
43
45
  TChain extends Chain | undefined = Chain | undefined,
44
46
  > = UnionOmit<FormattedEstimateGas<TChain>, 'from'> & {
45
47
  account?: Account | Address | undefined
48
+ stateOverride?: StateOverride | undefined
46
49
  } & (
47
50
  | {
48
51
  /** The balance of the account at a block number. */
@@ -119,6 +122,7 @@ export async function estimateGas<
119
122
  nonce,
120
123
  to,
121
124
  value,
125
+ stateOverride,
122
126
  ...rest
123
127
  } = (await prepareTransactionRequest(client, {
124
128
  ...args,
@@ -131,6 +135,8 @@ export async function estimateGas<
131
135
  const blockNumberHex = blockNumber ? numberToHex(blockNumber) : undefined
132
136
  const block = blockNumberHex || blockTag
133
137
 
138
+ const rpcStateOverride = serializeStateOverride(stateOverride)
139
+
134
140
  assertRequest(args as AssertRequestParameters)
135
141
 
136
142
  const chainFormat = client.chain?.formatters?.transactionRequest?.format
@@ -156,7 +162,11 @@ export async function estimateGas<
156
162
 
157
163
  const balance = await client.request({
158
164
  method: 'eth_estimateGas',
159
- params: block ? [request, block] : [request],
165
+ params: rpcStateOverride
166
+ ? [request, block ?? 'latest', rpcStateOverride]
167
+ : block
168
+ ? [request, block]
169
+ : [request],
160
170
  })
161
171
  return BigInt(balance)
162
172
  } catch (err) {
@@ -2,7 +2,6 @@ import type { ChainFormatters } from '../types/chain.js'
2
2
  import type { Hash } from '../types/misc.js'
3
3
  import type { RpcTransaction } from '../types/rpc.js'
4
4
  import { hexToBigInt } from '../utils/encoding/fromHex.js'
5
- import { numberToHex } from '../utils/encoding/toHex.js'
6
5
  import { defineBlock } from '../utils/formatters/block.js'
7
6
  import {
8
7
  defineTransaction,
@@ -16,7 +15,7 @@ import type {
16
15
  CeloTransaction,
17
16
  CeloTransactionRequest,
18
17
  } from './types.js'
19
- import { isCIP42, isCIP64 } from './utils.js'
18
+ import { isCIP64 } from './utils.js'
20
19
 
21
20
  export const formatters = {
22
21
  block: /*#__PURE__*/ defineBlock({
@@ -73,15 +72,8 @@ export const formatters = {
73
72
  feeCurrency: args.feeCurrency,
74
73
  } as CeloRpcTransactionRequest
75
74
 
76
- if (isCIP64(args)) request.type = '0x7b'
77
- else {
78
- if (isCIP42(args)) request.type = '0x7c'
79
-
80
- request.gatewayFee =
81
- typeof args.gatewayFee !== 'undefined'
82
- ? numberToHex(args.gatewayFee)
83
- : undefined
84
- request.gatewayFeeRecipient = args.gatewayFeeRecipient
75
+ if (isCIP64(args)) {
76
+ request.type = '0x7b'
85
77
  }
86
78
 
87
79
  return request
package/celo/index.ts CHANGED
@@ -18,11 +18,9 @@ export type {
18
18
  CeloTransactionType,
19
19
  RpcTransactionCIP42,
20
20
  RpcTransactionCIP64,
21
- RpcTransactionRequestCIP42,
22
21
  RpcTransactionRequestCIP64,
23
22
  TransactionCIP42,
24
23
  TransactionCIP64,
25
- TransactionRequestCIP42,
26
24
  TransactionRequestCIP64,
27
25
  TransactionSerializableCIP42,
28
26
  TransactionSerializableCIP64,
@@ -17,10 +17,9 @@ import type {
17
17
  CeloTransactionSerializable,
18
18
  TransactionSerializableCIP42,
19
19
  TransactionSerializableCIP64,
20
- TransactionSerializedCIP42,
21
20
  TransactionSerializedCIP64,
22
21
  } from './types.js'
23
- import { isCIP42, isCIP64, isEmpty, isPresent } from './utils.js'
22
+ import { isCIP64, isEmpty, isPresent } from './utils.js'
24
23
 
25
24
  export function serializeTransaction(
26
25
  transaction: CeloTransactionSerializable,
@@ -28,8 +27,7 @@ export function serializeTransaction(
28
27
  ) {
29
28
  if (isCIP64(transaction))
30
29
  return serializeTransactionCIP64(transaction, signature)
31
- if (isCIP42(transaction))
32
- return serializeTransactionCIP42(transaction, signature)
30
+
33
31
  return serializeTransaction_(transaction, signature)
34
32
  }
35
33
 
@@ -40,54 +38,8 @@ export const serializers = {
40
38
  //////////////////////////////////////////////////////////////////////////////
41
39
  // Serializers
42
40
 
43
- export type SerializeTransactionCIP42ReturnType = TransactionSerializedCIP42
44
41
  export type SerializeTransactionCIP64ReturnType = TransactionSerializedCIP64
45
42
 
46
- // There shall be a typed transaction with the code 0x7c that has the following format:
47
- // 0x7c || rlp([chain_id, nonce, max_priority_fee_per_gas, max_fee_per_gas, gas_limit, feecurrency, gatewayFeeRecipient, gatewayfee, destination, amount, data, access_list, signature_y_parity, signature_r, signature_s]).
48
- // This will be in addition to the type 0x02 transaction as specified in EIP-1559.
49
- function serializeTransactionCIP42(
50
- transaction: TransactionSerializableCIP42,
51
- signature?: Signature | undefined,
52
- ): SerializeTransactionCIP42ReturnType {
53
- assertTransactionCIP42(transaction)
54
- const {
55
- chainId,
56
- gas,
57
- nonce,
58
- to,
59
- value,
60
- maxFeePerGas,
61
- maxPriorityFeePerGas,
62
- accessList,
63
- feeCurrency,
64
- gatewayFeeRecipient,
65
- gatewayFee,
66
- data,
67
- } = transaction
68
-
69
- const serializedTransaction = [
70
- toHex(chainId),
71
- nonce ? toHex(nonce) : '0x',
72
- maxPriorityFeePerGas ? toHex(maxPriorityFeePerGas) : '0x',
73
- maxFeePerGas ? toHex(maxFeePerGas) : '0x',
74
- gas ? toHex(gas) : '0x',
75
- feeCurrency ?? '0x',
76
- gatewayFeeRecipient ?? '0x',
77
- gatewayFee ? toHex(gatewayFee) : '0x',
78
- to ?? '0x',
79
- value ? toHex(value) : '0x',
80
- data ?? '0x',
81
- serializeAccessList(accessList),
82
- ...toYParitySignatureArray(transaction, signature),
83
- ]
84
-
85
- return concatHex([
86
- '0x7c',
87
- toRlp(serializedTransaction),
88
- ]) as SerializeTransactionCIP42ReturnType
89
- }
90
-
91
43
  function serializeTransactionCIP64(
92
44
  transaction: TransactionSerializableCIP64,
93
45
  signature?: Signature | undefined,
package/celo/types.ts CHANGED
@@ -7,19 +7,19 @@ import type {
7
7
  Index,
8
8
  Quantity,
9
9
  RpcBlock,
10
- RpcTransaction as RpcTransaction_,
11
10
  RpcTransactionRequest as RpcTransactionRequest_,
11
+ RpcTransaction as RpcTransaction_,
12
12
  TransactionType,
13
13
  } from '../types/rpc.js'
14
14
  import type {
15
15
  AccessList,
16
- Transaction as Transaction_,
17
16
  TransactionBase,
18
- TransactionRequest as TransactionRequest_,
19
17
  TransactionRequestBase,
18
+ TransactionRequest as TransactionRequest_,
20
19
  TransactionSerializable,
21
20
  TransactionSerializableBase,
22
21
  TransactionSerialized,
22
+ Transaction as Transaction_,
23
23
  } from '../types/transaction.js'
24
24
  import type { ExactPartial, NeverBy, OneOf } from '../types/utils.js'
25
25
 
@@ -76,7 +76,6 @@ export type CeloRpcTransaction<TPending extends boolean = boolean> =
76
76
 
77
77
  export type CeloRpcTransactionRequest =
78
78
  | RpcTransactionRequest
79
- | RpcTransactionRequestCIP42
80
79
  | RpcTransactionRequestCIP64
81
80
 
82
81
  export type CeloTransaction<TPending extends boolean = boolean> =
@@ -86,13 +85,10 @@ export type CeloTransaction<TPending extends boolean = boolean> =
86
85
 
87
86
  export type CeloTransactionRequest =
88
87
  | TransactionRequest
89
- | TransactionRequestCIP42
90
88
  | TransactionRequestCIP64
91
89
 
92
90
  export type CeloTransactionSerializable = OneOf<
93
- | TransactionSerializable
94
- | TransactionSerializableCIP42
95
- | TransactionSerializableCIP64
91
+ TransactionSerializable | TransactionSerializableCIP64
96
92
  >
97
93
 
98
94
  export type CeloTransactionSerialized<
@@ -113,8 +109,6 @@ type RpcTransaction<TPending extends boolean = boolean> =
113
109
 
114
110
  type RpcTransactionRequest = RpcTransactionRequest_ & {
115
111
  feeCurrency?: Address | undefined
116
- gatewayFee?: Hex | undefined
117
- gatewayFeeRecipient?: Address | undefined
118
112
  }
119
113
 
120
114
  export type RpcTransactionCIP42<TPending extends boolean = boolean> = Omit<
@@ -139,18 +133,6 @@ export type RpcTransactionCIP64<TPending extends boolean = boolean> = Omit<
139
133
  type: '0x7b'
140
134
  }
141
135
 
142
- export type RpcTransactionRequestCIP42 = TransactionRequestBase<
143
- Quantity,
144
- Index
145
- > &
146
- ExactPartial<FeeValuesEIP1559<Quantity>> & {
147
- accessList?: AccessList | undefined
148
- feeCurrency?: Address | undefined
149
- gatewayFee?: Hex | undefined
150
- gatewayFeeRecipient?: Address | undefined
151
- type?: '0x7c' | undefined
152
- }
153
-
154
136
  export type RpcTransactionRequestCIP64 = TransactionRequestBase<
155
137
  Quantity,
156
138
  Index
@@ -158,8 +140,6 @@ export type RpcTransactionRequestCIP64 = TransactionRequestBase<
158
140
  ExactPartial<FeeValuesEIP1559<Quantity>> & {
159
141
  accessList?: AccessList | undefined
160
142
  feeCurrency?: Address | undefined
161
- gatewayFee?: undefined
162
- gatewayFeeRecipient?: undefined
163
143
  type?: '0x7b' | undefined
164
144
  }
165
145
 
@@ -169,8 +149,8 @@ type Transaction<TPending extends boolean = boolean> = Transaction_<
169
149
  TPending
170
150
  > & {
171
151
  feeCurrency: Address | null
172
- gatewayFee: bigint | null
173
- gatewayFeeRecipient: Address | null
152
+ gatewayFee?: undefined
153
+ gatewayFeeRecipient?: undefined
174
154
  }
175
155
 
176
156
  export type TransactionCIP42<TPending extends boolean = boolean> =
@@ -193,25 +173,12 @@ export type TransactionCIP64<TPending extends boolean = boolean> =
193
173
 
194
174
  type TransactionRequest = TransactionRequest_ & {
195
175
  feeCurrency?: Address | undefined
196
- gatewayFee?: bigint | undefined
197
- gatewayFeeRecipient?: Address | undefined
198
176
  }
199
177
 
200
- export type TransactionRequestCIP42 = TransactionRequestBase &
201
- ExactPartial<FeeValuesEIP1559> & {
202
- accessList?: AccessList | undefined
203
- feeCurrency?: Address | undefined
204
- gatewayFee?: bigint | undefined
205
- gatewayFeeRecipient?: Address | undefined
206
- type?: 'cip42' | undefined
207
- }
208
-
209
178
  export type TransactionRequestCIP64 = TransactionRequestBase &
210
179
  ExactPartial<FeeValuesEIP1559> & {
211
180
  accessList?: AccessList | undefined
212
181
  feeCurrency?: Address | undefined
213
- gatewayFee?: undefined
214
- gatewayFeeRecipient?: undefined
215
182
  type?: 'cip64' | undefined
216
183
  }
217
184
 
@@ -235,8 +202,6 @@ export type TransactionSerializableCIP64<
235
202
  ExactPartial<FeeValuesEIP1559<TQuantity>> & {
236
203
  accessList?: AccessList | undefined
237
204
  feeCurrency?: Address | undefined
238
- gatewayFee?: undefined
239
- gatewayFeeRecipient?: undefined
240
205
  chainId: number
241
206
  type?: 'cip64' | undefined
242
207
  }
package/celo/utils.ts CHANGED
@@ -3,7 +3,6 @@ import { trim } from '../utils/data/trim.js'
3
3
  import type {
4
4
  CeloTransactionRequest,
5
5
  CeloTransactionSerializable,
6
- TransactionSerializableCIP42,
7
6
  TransactionSerializableCIP64,
8
7
  } from './types.js'
9
8
 
@@ -38,23 +37,6 @@ export function isEIP1559(
38
37
  )
39
38
  }
40
39
 
41
- // process as CIP42 if any of these fields are present. realistically gatewayfee is not used but is part of spec
42
- export function isCIP42(
43
- transaction: CeloTransactionSerializable | CeloTransactionRequest,
44
- ): transaction is TransactionSerializableCIP42 {
45
- // Enable end-user to force the tx to be considered as a cip42
46
- if (transaction.type === 'cip42') {
47
- return true
48
- }
49
-
50
- return (
51
- isEIP1559(transaction) &&
52
- (isPresent(transaction.feeCurrency) ||
53
- isPresent(transaction.gatewayFeeRecipient) ||
54
- isPresent(transaction.gatewayFee))
55
- )
56
- }
57
-
58
40
  export function isCIP64(
59
41
  transaction: CeloTransactionSerializable | CeloTransactionRequest,
60
42
  ): transaction is TransactionSerializableCIP64 {
@@ -72,10 +54,5 @@ export function isCIP64(
72
54
  return true
73
55
  }
74
56
 
75
- return (
76
- isEIP1559(transaction) &&
77
- isPresent(transaction.feeCurrency) &&
78
- isEmpty(transaction.gatewayFee) &&
79
- isEmpty(transaction.gatewayFeeRecipient)
80
- )
57
+ return isEIP1559(transaction) && isPresent(transaction.feeCurrency)
81
58
  }
@@ -0,0 +1,30 @@
1
+ import { defineChain } from '../../utils/chain/defineChain.js'
2
+
3
+ export const bob = defineChain({
4
+ id: 60808,
5
+ name: 'BOB',
6
+ nativeCurrency: {
7
+ decimals: 18,
8
+ name: 'ETH',
9
+ symbol: 'ETH',
10
+ },
11
+ rpcUrls: {
12
+ default: {
13
+ http: ['https://rpc.gobob.xyz'],
14
+ webSocket: ['wss://rpc.gobob.xyz'],
15
+ },
16
+ },
17
+ blockExplorers: {
18
+ default: {
19
+ name: 'Blockscout',
20
+ url: 'https://explorer.gobob.xyz',
21
+ },
22
+ },
23
+ contracts: {
24
+ multicall3: {
25
+ address: '0x63f8279bccDb75c0F38e0CD6B6A0c72a0a760FF9',
26
+ blockCreated: 457045,
27
+ },
28
+ },
29
+ testnet: false,
30
+ })
@@ -0,0 +1,32 @@
1
+ import { chainConfig } from '../../op-stack/chainConfig.js'
2
+ import { defineChain } from '../../utils/chain/defineChain.js'
3
+
4
+ const sourceId = 11_155_111 // sepolia
5
+
6
+ export const funkiSepolia = defineChain({
7
+ ...chainConfig,
8
+ id: 3397901,
9
+ network: 'funkiSepolia',
10
+ name: 'Funki Sepolia Sandbox',
11
+ nativeCurrency: { name: 'Ether', symbol: 'ETH', decimals: 18 },
12
+ rpcUrls: {
13
+ default: {
14
+ http: ['https://funki-testnet.alt.technology'],
15
+ },
16
+ },
17
+ blockExplorers: {
18
+ default: {
19
+ name: 'Funki Sepolia Sandbox Explorer',
20
+ url: 'https://sepolia-sandbox.funkichain.com/',
21
+ },
22
+ },
23
+ testnet: true,
24
+ contracts: {
25
+ ...chainConfig.contracts,
26
+ multicall3: {
27
+ address: '0xca11bde05977b3631167028862be2a173976ca11',
28
+ blockCreated: 1620204,
29
+ },
30
+ },
31
+ sourceId,
32
+ })
@@ -0,0 +1,31 @@
1
+ import { defineChain } from '../../utils/chain/defineChain.js'
2
+ import { chainConfig } from '../../zksync/chainConfig.js'
3
+
4
+ export const lisk = /*#__PURE__*/ defineChain({
5
+ ...chainConfig,
6
+ id: 1135,
7
+ name: 'Lisk',
8
+ network: 'lisk',
9
+ nativeCurrency: {
10
+ decimals: 18,
11
+ name: 'Ether',
12
+ symbol: 'ETH',
13
+ },
14
+ rpcUrls: {
15
+ default: {
16
+ http: ['https://rpc.api.lisk.com'],
17
+ },
18
+ },
19
+ blockExplorers: {
20
+ default: {
21
+ name: 'Blockscout',
22
+ url: 'https://blockscout.lisk.com',
23
+ apiUrl: 'https://blockscout.lisk.com/api',
24
+ },
25
+ },
26
+ contracts: {
27
+ multicall3: {
28
+ address: '0xA9d71E1dd7ca26F26e656E66d6AA81ed7f745bf0',
29
+ },
30
+ },
31
+ })
@@ -0,0 +1,51 @@
1
+ import { chainConfig } from '../../op-stack/chainConfig.js'
2
+ import { defineChain } from '../../utils/chain/defineChain.js'
3
+
4
+ const sourceId = 1 // mainnet
5
+
6
+ export const metalL2 = /*#__PURE__*/ defineChain({
7
+ ...chainConfig,
8
+ id: 1750,
9
+ name: 'Metal L2',
10
+ nativeCurrency: {
11
+ decimals: 18,
12
+ name: 'Ether',
13
+ symbol: 'ETH',
14
+ },
15
+ rpcUrls: {
16
+ default: {
17
+ http: ['https://rpc.metall2.com'],
18
+ webSocket: ['wss://rpc.metall2.com'],
19
+ },
20
+ },
21
+ blockExplorers: {
22
+ default: {
23
+ name: 'Explorer',
24
+ url: 'https://explorer.metall2.com',
25
+ apiUrl: 'https://explorer.metall2.com/api',
26
+ },
27
+ },
28
+ contracts: {
29
+ ...chainConfig.contracts,
30
+ l2OutputOracle: {
31
+ [sourceId]: {
32
+ address: '0x3B1F7aDa0Fcc26B13515af752Dd07fB1CAc11426',
33
+ },
34
+ },
35
+ multicall3: {
36
+ address: '0xcA11bde05977b3631167028862bE2a173976CA11',
37
+ blockCreated: 0,
38
+ },
39
+ portal: {
40
+ [sourceId]: {
41
+ address: '0x3F37aBdE2C6b5B2ed6F8045787Df1ED1E3753956',
42
+ },
43
+ },
44
+ l1StandardBridge: {
45
+ [sourceId]: {
46
+ address: '0x6d0f65D59b55B0FEC5d2d15365154DcADC140BF3',
47
+ },
48
+ },
49
+ },
50
+ sourceId,
51
+ })
package/chains/index.ts CHANGED
@@ -33,6 +33,7 @@ export { bitTorrent } from './definitions/bitTorrent.js'
33
33
  export { bitTorrentTestnet } from './definitions/bitTorrentTestnet.js'
34
34
  export { blast } from './definitions/blast.js'
35
35
  export { blastSepolia } from './definitions/blastSepolia.js'
36
+ export { bob } from './definitions/bob.js'
36
37
  export { boba } from './definitions/boba.js'
37
38
  export { bronos } from './definitions/bronos.js'
38
39
  export { bronosTestnet } from './definitions/bronosTestnet.js'
@@ -92,6 +93,7 @@ export { flowTestnet } from './definitions/flowTestnet.js'
92
93
  export { foundry } from './definitions/foundry.js'
93
94
  export { fraxtal } from './definitions/fraxtal.js'
94
95
  export { fraxtalTestnet } from './definitions/fraxtalTestnet.js'
96
+ export { funkiSepolia } from './definitions/funkiSepolia.js'
95
97
  export { fuse } from './definitions/fuse.js'
96
98
  export { fuseSparknet } from './definitions/fuseSparknet.js'
97
99
  export { iotex } from './definitions/iotex.js'
@@ -129,6 +131,7 @@ export { lineaGoerli } from './definitions/lineaGoerli.js'
129
131
  export { lineaSepolia } from './definitions/lineaSepolia.js'
130
132
  /** @deprecated Use `lineaGoerli` instead. */
131
133
  export { lineaTestnet } from './definitions/lineaTestnet.js'
134
+ export { lisk } from './definitions/lisk.js'
132
135
  export { liskSepolia } from './definitions/liskSepolia.js'
133
136
  export { localhost } from './definitions/localhost.js'
134
137
  export { lukso } from './definitions/lukso.js'
@@ -144,6 +147,7 @@ export { mantleTestnet } from './definitions/mantleTestnet.js'
144
147
  export { merlin } from './definitions/merlin.js'
145
148
  export { metachain } from './definitions/metachain.js'
146
149
  export { metachainIstanbul } from './definitions/metachainIstanbul.js'
150
+ export { metalL2 } from './definitions/metalL2.js'
147
151
  export { meter } from './definitions/meter.js'
148
152
  export { meterTestnet } from './definitions/meterTestnet.js'
149
153
  export { metis } from './definitions/metis.js'
@@ -298,11 +302,9 @@ export type {
298
302
  CeloTransactionSerialized,
299
303
  RpcTransactionCIP42,
300
304
  RpcTransactionCIP64,
301
- RpcTransactionRequestCIP42,
302
305
  RpcTransactionRequestCIP64,
303
306
  TransactionCIP42,
304
307
  TransactionCIP64,
305
- TransactionRequestCIP42,
306
308
  TransactionRequestCIP64,
307
309
  TransactionSerializableCIP42,
308
310
  TransactionSerializableCIP64,
package/errors/version.ts CHANGED
@@ -1 +1 @@
1
- export const version = '2.10.9'
1
+ export const version = '2.11.0'