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
@@ -570,7 +570,7 @@ export declare const chainConfig: {
570
570
  blobVersionedHashes?: undefined;
571
571
  kzg?: undefined;
572
572
  sidecars?: undefined;
573
- } & Omit<import("../index.js").TransactionRequestBase, "type"> & import("../index.js").ExactPartial<import("../index.js").FeeValuesEIP1559> & {
573
+ } & Omit<import("../index.js").TransactionRequestBase<bigint, number>, "type"> & import("../index.js").ExactPartial<import("../index.js").FeeValuesEIP1559> & {
574
574
  gasPerPubdata?: bigint | undefined;
575
575
  customSignature?: `0x${string}` | undefined;
576
576
  factoryDeps?: `0x${string}`[] | undefined;
@@ -595,7 +595,7 @@ export declare const chainConfig: {
595
595
  blobVersionedHashes?: undefined;
596
596
  kzg?: undefined;
597
597
  sidecars?: undefined;
598
- } & Omit<import("../index.js").TransactionRequestBase, "type"> & import("../index.js").ExactPartial<import("../index.js").FeeValuesEIP1559> & {
598
+ } & Omit<import("../index.js").TransactionRequestBase<bigint, number>, "type"> & import("../index.js").ExactPartial<import("../index.js").FeeValuesEIP1559> & {
599
599
  gasPerPubdata?: bigint | undefined;
600
600
  customSignature?: `0x${string}` | undefined;
601
601
  factoryDeps?: `0x${string}`[] | undefined;
@@ -740,7 +740,7 @@ export declare const chainConfig: {
740
740
  blobVersionedHashes?: undefined;
741
741
  kzg?: undefined;
742
742
  sidecars?: undefined;
743
- } & Omit<import("../index.js").TransactionRequestBase, "type"> & import("../index.js").ExactPartial<import("../index.js").FeeValuesEIP1559> & {
743
+ } & Omit<import("../index.js").TransactionRequestBase<bigint, number>, "type"> & import("../index.js").ExactPartial<import("../index.js").FeeValuesEIP1559> & {
744
744
  gasPerPubdata?: bigint | undefined;
745
745
  customSignature?: `0x${string}` | undefined;
746
746
  factoryDeps?: `0x${string}`[] | undefined;
@@ -765,7 +765,7 @@ export declare const chainConfig: {
765
765
  blobVersionedHashes?: undefined;
766
766
  kzg?: undefined;
767
767
  sidecars?: undefined;
768
- } & Omit<import("../index.js").TransactionRequestBase, "type"> & import("../index.js").ExactPartial<import("../index.js").FeeValuesEIP1559> & {
768
+ } & Omit<import("../index.js").TransactionRequestBase<bigint, number>, "type"> & import("../index.js").ExactPartial<import("../index.js").FeeValuesEIP1559> & {
769
769
  gasPerPubdata?: bigint | undefined;
770
770
  customSignature?: `0x${string}` | undefined;
771
771
  factoryDeps?: `0x${string}`[] | undefined;
@@ -910,7 +910,7 @@ export declare const chainConfig: {
910
910
  blobVersionedHashes?: undefined;
911
911
  kzg?: undefined;
912
912
  sidecars?: undefined;
913
- } & Omit<import("../index.js").TransactionRequestBase, "type"> & import("../index.js").ExactPartial<import("../index.js").FeeValuesEIP1559> & {
913
+ } & Omit<import("../index.js").TransactionRequestBase<bigint, number>, "type"> & import("../index.js").ExactPartial<import("../index.js").FeeValuesEIP1559> & {
914
914
  gasPerPubdata?: bigint | undefined;
915
915
  customSignature?: `0x${string}` | undefined;
916
916
  factoryDeps?: `0x${string}`[] | undefined;
@@ -935,7 +935,7 @@ export declare const chainConfig: {
935
935
  blobVersionedHashes?: undefined;
936
936
  kzg?: undefined;
937
937
  sidecars?: undefined;
938
- } & Omit<import("../index.js").TransactionRequestBase, "type"> & import("../index.js").ExactPartial<import("../index.js").FeeValuesEIP1559> & {
938
+ } & Omit<import("../index.js").TransactionRequestBase<bigint, number>, "type"> & import("../index.js").ExactPartial<import("../index.js").FeeValuesEIP1559> & {
939
939
  gasPerPubdata?: bigint | undefined;
940
940
  customSignature?: `0x${string}` | undefined;
941
941
  factoryDeps?: `0x${string}`[] | undefined;
@@ -1120,7 +1120,7 @@ export declare const chainConfig: {
1120
1120
  kzg?: import("../index.js").Kzg | undefined;
1121
1121
  sidecars?: readonly import("../index.js").BlobSidecar<`0x${string}`>[] | undefined;
1122
1122
  type?: "legacy" | "eip1559" | "eip4844" | "eip2930" | "priority" | "eip712" | undefined;
1123
- } & Omit<import("../index.js").TransactionRequestBase, "type"> & import("../index.js").ExactPartial<import("../index.js").FeeValuesEIP1559> & {
1123
+ } & Omit<import("../index.js").TransactionRequestBase<bigint, number>, "type"> & import("../index.js").ExactPartial<import("../index.js").FeeValuesEIP1559> & {
1124
1124
  gasPerPubdata?: bigint | undefined;
1125
1125
  customSignature?: `0x${string}` | undefined;
1126
1126
  factoryDeps?: `0x${string}`[] | undefined;
@@ -1145,7 +1145,7 @@ export declare const chainConfig: {
1145
1145
  kzg?: import("../index.js").Kzg | undefined;
1146
1146
  sidecars?: readonly import("../index.js").BlobSidecar<`0x${string}`>[] | undefined;
1147
1147
  type?: "legacy" | "eip1559" | "eip4844" | "eip2930" | "priority" | "eip712" | undefined;
1148
- } & Omit<import("../index.js").TransactionRequestBase, "type"> & import("../index.js").ExactPartial<import("../index.js").FeeValuesEIP1559> & {
1148
+ } & Omit<import("../index.js").TransactionRequestBase<bigint, number>, "type"> & import("../index.js").ExactPartial<import("../index.js").FeeValuesEIP1559> & {
1149
1149
  gasPerPubdata?: bigint | undefined;
1150
1150
  customSignature?: `0x${string}` | undefined;
1151
1151
  factoryDeps?: `0x${string}`[] | undefined;
@@ -1,2 +1,5 @@
1
1
  export declare const contractDeployerAddress: "0x0000000000000000000000000000000000008006";
2
+ export declare const legacyEthAddress: "0x0000000000000000000000000000000000000000";
3
+ export declare const ethAddressInContracts: "0x0000000000000000000000000000000000000001";
4
+ export declare const l2BaseTokenAddress: "0x000000000000000000000000000000000000800a";
2
5
  //# sourceMappingURL=address.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../../../zksync/constants/address.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,uBAAuB,8CACmB,CAAA"}
1
+ {"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../../../zksync/constants/address.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,uBAAuB,8CACmB,CAAA;AAEvD,eAAO,MAAM,gBAAgB,8CAC0B,CAAA;AAEvD,eAAO,MAAM,qBAAqB,8CACqB,CAAA;AAEvD,eAAO,MAAM,kBAAkB,8CACwB,CAAA"}
@@ -0,0 +1,145 @@
1
+ import type { Chain } from '../../chains/index.js';
2
+ import type { Client } from '../../clients/createClient.js';
3
+ import type { Transport } from '../../clients/transports/createTransport.js';
4
+ import type { Account } from '../../types/account.js';
5
+ import { type GetL1AllowanceParameters, type GetL1AllowanceReturnType } from '../actions/getL1Allowance.js';
6
+ import { type GetL1BalanceParameters, type GetL1BalanceReturnType } from '../actions/getL1Balance.js';
7
+ import { type GetL1TokenBalanceParameters, type GetL1TokenBalanceReturnType } from '../actions/getL1TokenBalance.js';
8
+ export type PublicActionsL1<TAccount extends Account | undefined = Account | undefined> = {
9
+ /**
10
+ * Returns the amount of approved tokens for a specific L1 bridge.
11
+ *
12
+ * - Docs: https://viem.sh/zksync/actions/getL1Allowance
13
+ *
14
+ * @param client - Client to use
15
+ * @param parameters - {@link AllowanceL1Parameters}
16
+ * @returns The amount of approved tokens for a specific L1 bridge. {@link GetL1AllowanceReturnType}
17
+ *
18
+ * @example
19
+ * import { createPublicClient, custom, parseEther } from 'viem'
20
+ * import { base, mainnet } from 'viem/chains'
21
+ * import { publicActionsL1 } from 'viem/zksync'
22
+ *
23
+ * const client = createPublicClient({
24
+ * chain: mainnet,
25
+ * transport: custom(window.ethereum),
26
+ * }).extend(publicActionsL1())
27
+ *
28
+ * const data = await client.getL1Allowance({
29
+ * account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',
30
+ * token: '0x5C221E77624690fff6dd741493D735a17716c26B'
31
+ * bridgeAddress: '0x84DbCC0B82124bee38e3Ce9a92CdE2f943bab60D',
32
+ * })
33
+ *
34
+ * @example
35
+ * // Account Hoisting
36
+ * import { createWalletClient, http } from 'viem'
37
+ * import { privateKeyToAccount } from 'viem/accounts'
38
+ * import { base, mainnet } from 'viem/chains'
39
+ * import { publicActionsL1 } from 'viem/zksync'
40
+ *
41
+ * const client = createWalletClient({
42
+ * account: privateKeyToAccount('0x…'),
43
+ * chain: mainnet,
44
+ * transport: http(),
45
+ * }).extend(publicActionsL1())
46
+ *
47
+ * const data = await client.getL1Allowance({
48
+ * token: '0x5C221E77624690fff6dd741493D735a17716c26B'
49
+ * bridgeAddress: '0x84DbCC0B82124bee38e3Ce9a92CdE2f943bab60D',
50
+ * })
51
+ */
52
+ getL1Allowance: (parameters: GetL1AllowanceParameters<TAccount>) => Promise<GetL1AllowanceReturnType>;
53
+ /**
54
+ * Returns the amount of the ERC20 token the client has on specific address.
55
+ *
56
+ * - Docs: https://viem.sh/zksync/actions/getL1TokenBalance
57
+ *
58
+ * @param client - Client to use
59
+ * @param parameters - {@link GetL1TokenBalanceParameters}
60
+ * @returns The amount of the ERC20 token the client has on specific addresse. {@link GetL1TokenBalanceReturnType}
61
+ *
62
+ * @example
63
+ * import { createPublicClient, custom, parseEther } from 'viem'
64
+ * import { base, mainnet } from 'viem/chains'
65
+ * import { publicActionsL1 } from 'viem/zksync'
66
+ *
67
+ * const client = createPublicClient({
68
+ * chain: mainnet,
69
+ * transport: custom(window.ethereum),
70
+ * }).extend(publicActionsL1())
71
+ *
72
+ * const data = await client.getL1TokenBalance({
73
+ * account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',
74
+ * token: '0x5C221E77624690fff6dd741493D735a17716c26B'
75
+ * })
76
+ *
77
+ * @example
78
+ * // Account Hoisting
79
+ * import { createWalletClient, http } from 'viem'
80
+ * import { privateKeyToAccount } from 'viem/accounts'
81
+ * import { base, mainnet } from 'viem/chains'
82
+ * import { publicActionsL1 } from 'viem/zksync'
83
+ *
84
+ * const client = createWalletClient({
85
+ * account: privateKeyToAccount('0x…'),
86
+ * chain: mainnet,
87
+ * transport: http(),
88
+ * }).extend(publicActionsL1())
89
+ *
90
+ * const data = await client.getL1TokenBalance({
91
+ * token: '0x5C221E77624690fff6dd741493D735a17716c26B'
92
+ * })
93
+ */
94
+ getL1TokenBalance: (parameters: GetL1TokenBalanceParameters<TAccount>) => Promise<GetL1TokenBalanceReturnType>;
95
+ /**
96
+ * Returns the amount of the token held by the account on the L1 network.
97
+ *
98
+ * - Docs: https://viem.sh/zksync/actions/getL1TokenBalance
99
+ *
100
+ * @param client - Client to use
101
+ * @param parameters - {@link BalanceL1Parameters}
102
+ * @returns Returns the amount of the token held by the account on the L1 network. {@link GetL1BalanceReturnType}
103
+ *
104
+ * @example
105
+ * import { createPublicClient, custom, parseEther } from 'viem'
106
+ * import { base, mainnet } from 'viem/chains'
107
+ * import { publicActionsL1 } from 'viem/zksync'
108
+ *
109
+ * const client = createPublicClient({
110
+ * chain: mainnet,
111
+ * transport: custom(window.ethereum),
112
+ * }).extend(publicActionsL1())
113
+ *
114
+ * const data = await client.getL1Balance({
115
+ * account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e'
116
+ * })
117
+ *
118
+ * const data = await client.getL1Balance({
119
+ * account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',
120
+ * token: '0x5C221E77624690fff6dd741493D735a17716c26B'
121
+ * })
122
+ *
123
+ * @example
124
+ * // Account Hoisting
125
+ * import { createWalletClient, http } from 'viem'
126
+ * import { privateKeyToAccount } from 'viem/accounts'
127
+ * import { base, mainnet } from 'viem/chains'
128
+ * import { publicActionsL1 } from 'viem/zksync'
129
+ *
130
+ * const client = createWalletClient({
131
+ * account: privateKeyToAccount('0x…'),
132
+ * chain: mainnet,
133
+ * transport: http(),
134
+ * }).extend(publicActionsL1())
135
+ *
136
+ * const data = await client.getL1Balance({})
137
+ *
138
+ * const data = await client.getL1Balance({
139
+ * token: '0x5C221E77624690fff6dd741493D735a17716c26B'
140
+ * })
141
+ */
142
+ getL1Balance: (...parameters: TAccount extends undefined ? [GetL1BalanceParameters<TAccount>] : [GetL1BalanceParameters<TAccount>] | []) => Promise<GetL1BalanceReturnType>;
143
+ };
144
+ export declare function publicActionsL1(): <TChain extends Chain | undefined = Chain | undefined, TAccount extends Account | undefined = Account | undefined>(client: Client<Transport, TChain, TAccount>) => PublicActionsL1<TAccount>;
145
+ //# sourceMappingURL=publicL1.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"publicL1.d.ts","sourceRoot":"","sources":["../../../zksync/decorators/publicL1.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAA;AAClD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAA;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAA;AAC5E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AACrD,OAAO,EACL,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAE9B,MAAM,8BAA8B,CAAA;AACrC,OAAO,EACL,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAE5B,MAAM,4BAA4B,CAAA;AACnC,OAAO,EACL,KAAK,2BAA2B,EAChC,KAAK,2BAA2B,EAEjC,MAAM,iCAAiC,CAAA;AAExC,MAAM,MAAM,eAAe,CACzB,QAAQ,SAAS,OAAO,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,IACxD;IACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA0CG;IACH,cAAc,EAAE,CACd,UAAU,EAAE,wBAAwB,CAAC,QAAQ,CAAC,KAC3C,OAAO,CAAC,wBAAwB,CAAC,CAAA;IACtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAwCG;IACH,iBAAiB,EAAE,CACjB,UAAU,EAAE,2BAA2B,CAAC,QAAQ,CAAC,KAC9C,OAAO,CAAC,2BAA2B,CAAC,CAAA;IACzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8CG;IACH,YAAY,EAAE,CACZ,GAAG,UAAU,EAAE,QAAQ,SAAS,SAAS,GACrC,CAAC,sBAAsB,CAAC,QAAQ,CAAC,CAAC,GAClC,CAAC,sBAAsB,CAAC,QAAQ,CAAC,CAAC,GAAG,EAAE,KACxC,OAAO,CAAC,sBAAsB,CAAC,CAAA;CACrC,CAAA;AAED,wBAAgB,eAAe,+HAKnB,OAAO,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,KAC1C,gBAAgB,QAAQ,CAAC,CAM7B"}
@@ -0,0 +1,322 @@
1
+ import type { Client } from '../../clients/createClient.js';
2
+ import type { Transport } from '../../clients/transports/createTransport.js';
3
+ import type { Account } from '../../types/account.js';
4
+ import type { EstimateFeeParameters, EstimateFeeReturnType } from '../actions/estimateFee.js';
5
+ import { type EstimateGasL1ToL2Parameters, type EstimateGasL1ToL2ReturnType } from '../actions/estimateGasL1ToL2.js';
6
+ import { type GetAllBalancesParameters, type GetAllBalancesReturnType } from '../actions/getAllBalances.js';
7
+ import { type GetBaseTokenL1AddressReturnType } from '../actions/getBaseTokenL1Address.js';
8
+ import { type GetBlockDetailsParameters, type GetBlockDetailsReturnType } from '../actions/getBlockDetails.js';
9
+ import { type GetBridgehubContractAddressReturnType } from '../actions/getBridgehubContractAddress.js';
10
+ import { type GetDefaultBridgeAddressesReturnType } from '../actions/getDefaultBridgeAddresses.js';
11
+ import { type GetL1BatchBlockRangeParameters, type GetL1BatchBlockRangeReturnParameters } from '../actions/getL1BatchBlockRange.js';
12
+ import { type GetL1BatchDetailsParameters, type GetL1BatchDetailsReturnType } from '../actions/getL1BatchDetails.js';
13
+ import { type GetL1BatchNumberReturnType } from '../actions/getL1BatchNumber.js';
14
+ import { type GetL1ChainIdReturnType } from '../actions/getL1ChainId.js';
15
+ import { type GetLogProofParameters, type GetLogProofReturnType } from '../actions/getLogProof.js';
16
+ import { type GetMainContractAddressReturnType } from '../actions/getMainContractAddress.js';
17
+ import { type GetRawBlockTransactionsParameters, type GetRawBlockTransactionsReturnType } from '../actions/getRawBlockTransactions.js';
18
+ import { type GetTestnetPaymasterAddressReturnType } from '../actions/getTestnetPaymasterAddress.js';
19
+ import { type GetTransactionDetailsParameters, type GetTransactionDetailsReturnType } from '../actions/getTransactionDetails.js';
20
+ import type { ChainEIP712 } from '../types/chain.js';
21
+ export type PublicActionsL2<TChain extends ChainEIP712 | undefined = ChainEIP712 | undefined, TAccount extends Account | undefined = Account | undefined> = {
22
+ /**
23
+ * Returns the addresses of the default zkSync Era bridge contracts on both L1 and L2.
24
+ *
25
+ * @returns The Addresses of the default zkSync Era bridge contracts on both L1 and L2. {@link DefaultBridgeAddressesReturnType}
26
+ *
27
+ * @example
28
+ * import { createPublicClient, http } from 'viem'
29
+ * import { zkSyncLocalNode } from 'viem/chains'
30
+ * import { publicActionsL2 } from 'viem/zksync'
31
+ *
32
+ * const client = createPublicClient({
33
+ * chain: zkSyncLocalNode,
34
+ * transport: http(),
35
+ * }).extend(publicActionsL2())
36
+ *
37
+ * const addresses = await client.getDefaultBridgeAddresses();
38
+ */
39
+ getDefaultBridgeAddresses: () => Promise<GetDefaultBridgeAddressesReturnType>;
40
+ /**
41
+ * Returns Testnet Paymaster Address.
42
+ *
43
+ * @returns The Address. {@link Address}
44
+ *
45
+ * @example
46
+ * import { createPublicClient, http } from 'viem'
47
+ * import { zkSyncLocalNode } from 'viem/chains'
48
+ * import { publicActionsL2 } from 'viem/zksync'
49
+ *
50
+ * const client = createPublicClient({
51
+ * chain: zkSyncLocalNode,
52
+ * transport: http(),
53
+ * }).extend(publicActionsL2())
54
+ *
55
+ * const address = await client.getTestnetPaymasterAddress();
56
+ */
57
+ getTestnetPaymasterAddress: () => Promise<GetTestnetPaymasterAddressReturnType>;
58
+ /**
59
+ * Returns the Chain Id of underlying L1 network.
60
+ *
61
+ * @returns number
62
+ *
63
+ * @example
64
+ * import { createPublicClient, http } from 'viem'
65
+ * import { zkSyncLocalNode } from 'viem/chains'
66
+ * import { publicActionsL2 } from 'viem/zksync'
67
+ *
68
+ * const client = createPublicClient({
69
+ * chain: zkSyncLocalNode,
70
+ * transport: http(),
71
+ * }).extend(publicActionsL2())
72
+ *
73
+ * const chainId = await client.getL1ChainId();
74
+ */
75
+ getL1ChainId: () => Promise<GetL1ChainIdReturnType>;
76
+ /**
77
+ * Returns the address of a Main zkSync Contract.
78
+ *
79
+ * @returns The Address. {@link Address}
80
+ *
81
+ * @example
82
+ * import { createPublicClient, http } from 'viem'
83
+ * import { zkSyncLocalNode } from 'viem/chains'
84
+ * import { publicActionsL2 } from 'viem/zksync'
85
+ *
86
+ * const client = createPublicClient({
87
+ * chain: zkSyncLocalNode,
88
+ * transport: http(),
89
+ * }).extend(publicActionsL2())
90
+ *
91
+ * const address = await client.getMainContractAddress();
92
+ */
93
+ getMainContractAddress: () => Promise<GetMainContractAddressReturnType>;
94
+ /**
95
+ * Returns all known balances for a given account.
96
+ *
97
+ * @returns The balances for a given account. {@link GetAllBalancesReturnType}
98
+ * @param args - {@link GetAllBalancesParameters}
99
+ *
100
+ * @example
101
+ * import { createPublicClient, http } from 'viem'
102
+ * import { zkSyncLocalNode } from 'viem/chains'
103
+ * import { publicActionsL2 } from 'viem/zksync'
104
+ *
105
+ * const client = createPublicClient({
106
+ * chain: zkSyncLocalNode,
107
+ * transport: http(),
108
+ * }).extend(publicActionsL2())
109
+ *
110
+ * const balances = await client.getAllBalances({account: "0x36615Cf349d7F6344891B1e7CA7C72883F5dc049"});
111
+ */
112
+ getAllBalances: (args: GetAllBalancesParameters) => Promise<GetAllBalancesReturnType>;
113
+ /**
114
+ * Returns data of transactions in a block.
115
+ *
116
+ * @returns data of transactions {@link RawBlockTransactions}
117
+ * @param args - {@link GetRawBlockTransactionsParameters}
118
+ *
119
+ * @example
120
+ * import { createPublicClient, http } from 'viem'
121
+ * import { zkSyncLocalNode } from 'viem/chains'
122
+ * import { publicActionsL2 } from 'viem/zksync'
123
+ *
124
+ * const client = createPublicClient({
125
+ * chain: zkSyncLocalNode,
126
+ * transport: http(),
127
+ * }).extend(publicActionsL2())
128
+ *
129
+ * const rawTx = await client.getRawBlockTransaction({number: 1});
130
+ */
131
+ getRawBlockTransaction: (args: GetRawBlockTransactionsParameters) => Promise<GetRawBlockTransactionsReturnType>;
132
+ /**
133
+ * Returns additional zkSync-specific information about the L2 block.
134
+ *
135
+ * @returns zkSync-specific information about the L2 block {@link BaseBlockDetails}
136
+ * @param args - {@link GetBlockDetailsParameters}
137
+ *
138
+ * @example
139
+ * import { createPublicClient, http } from 'viem'
140
+ * import { zkSyncLocalNode } from 'viem/chains'
141
+ * import { publicActionsL2 } from 'viem/zksync'
142
+ *
143
+ * const client = createPublicClient({
144
+ * chain: zkSyncLocalNode,
145
+ * transport: http(),
146
+ * }).extend(publicActionsL2())
147
+ *
148
+ * const blockDetails = await client.getBlockDetails({number: 1});
149
+ */
150
+ getBlockDetails: (args: GetBlockDetailsParameters) => Promise<GetBlockDetailsReturnType>;
151
+ /**
152
+ * Returns data pertaining to a given batch.
153
+ *
154
+ * @returns data pertaining to a given batch {@link BatchDetails}
155
+ * @param args - {@link GetL1BatchDetailsParameters}
156
+ *
157
+ * @example
158
+ * import { createPublicClient, http } from 'viem'
159
+ * import { zkSyncLocalNode } from 'viem/chains'
160
+ * import { publicActionsL2 } from 'viem/zksync'
161
+ *
162
+ * const client = createPublicClient({
163
+ * chain: zkSyncLocalNode,
164
+ * transport: http(),
165
+ * }).extend(publicActionsL2())
166
+ *
167
+ * const batchDetails = await client.getL1BatchDetails({number: 1});
168
+ */
169
+ getL1BatchDetails: (args: GetL1BatchDetailsParameters) => Promise<GetL1BatchDetailsReturnType>;
170
+ /**
171
+ * Returns the range of blocks contained within a batch given by batch number.
172
+ *
173
+ * @returns range of blocks contained withing a batch {@link GetL1BatchBlockRangeReturnParameters}
174
+ * @param args - {@link GetL1BatchBlockRangeParameters}
175
+ *
176
+ * @example
177
+ * import { createPublicClient, http } from 'viem'
178
+ * import { zkSyncLocalNode } from 'viem/chains'
179
+ * import { publicActionsL2 } from 'viem/zksync'
180
+ *
181
+ * const client = createPublicClient({
182
+ * chain: zkSyncLocalNode,
183
+ * transport: http(),
184
+ * }).extend(publicActionsL2())
185
+ *
186
+ * const batchBlockRange = await client.getL1BatchBlockRange({number: 1});
187
+ */
188
+ getL1BatchBlockRange: (args: GetL1BatchBlockRangeParameters) => Promise<GetL1BatchBlockRangeReturnParameters>;
189
+ /**
190
+ * Returns the latest L1 batch number
191
+ *
192
+ * @returns latest L1 batch number
193
+ *
194
+ * @example
195
+ * import { createPublicClient, http } from 'viem'
196
+ * import { zkSyncLocalNode } from 'viem/chains'
197
+ * import { publicActionsL2 } from 'viem/zksync'
198
+ *
199
+ * const client = createPublicClient({
200
+ * chain: zkSyncLocalNode,
201
+ * transport: http(),
202
+ * }).extend(publicActionsL2())
203
+ *
204
+ * const latestNumber = await client.getL1BatchNumber({number: 1});
205
+ */
206
+ getL1BatchNumber: () => Promise<GetL1BatchNumberReturnType>;
207
+ /**
208
+ * Given a transaction hash, and an index of the L2 to L1 log produced within the transaction, it returns the proof for the corresponding L2 to L1 log.
209
+ *
210
+ * @returns the proof for the corresponding L2 to L1 log.
211
+ *
212
+ * @example
213
+ * import { createPublicClient, http } from 'viem'
214
+ * import { zkSyncLocalNode } from 'viem/chains'
215
+ * import { publicActionsL2 } from 'viem/zksync'
216
+ *
217
+ * const client = createPublicClient({
218
+ * chain: zkSyncLocalNode,
219
+ * transport: http(),
220
+ * }).extend(publicActionsL2())
221
+ *
222
+ * const proof = await client.getLogProof({txHash: "0x...",index:1});
223
+ */
224
+ getLogProof: (args: GetLogProofParameters) => Promise<GetLogProofReturnType>;
225
+ /**
226
+ * Returns data from a specific transaction given by the transaction hash
227
+ *
228
+ * @returns data from a specific transaction given by the transaction hash
229
+ *
230
+ *
231
+ * @example
232
+ * import { createPublicClient, http } from 'viem'
233
+ * import { zkSyncLocalNode } from 'viem/chains'
234
+ * import { publicActionsL2 } from 'viem/zksync'
235
+ *
236
+ * const client = createPublicClient({
237
+ * chain: zkSyncLocalNode,
238
+ * transport: http(),
239
+ * }).extend(publicActionsL2())
240
+ *
241
+ * const details = await client.getTransactionDetails({txHash: "0x..."});
242
+ */
243
+ getTransactionDetails: (args: GetTransactionDetailsParameters) => Promise<GetTransactionDetailsReturnType>;
244
+ /**
245
+ * Returns an estimated Fee for requested transaction.
246
+ *
247
+ * @returns an estimated {@link Fee} for requested transaction.
248
+ * @param args - {@link EstimateFeeParameters}
249
+ *
250
+ * @example
251
+ * import { createPublicClient, http } from 'viem'
252
+ * import { zkSyncLocalNode } from 'viem/chains'
253
+ * import { publicActionsL2 } from 'viem/zksync'
254
+ *
255
+ * const client = createPublicClient({
256
+ * chain: zkSyncLocalNode,
257
+ * transport: http(),
258
+ * }).extend(publicActionsL2())
259
+ *
260
+ * const details = await client.estimateFee({transactionRequest: {...}}});
261
+ */
262
+ estimateFee: (args: EstimateFeeParameters<TChain, TAccount>) => Promise<EstimateFeeReturnType>;
263
+ /**
264
+ * Returns an estimated gas for L1 to L2 execution.
265
+ *
266
+ * @returns an estimated gas.
267
+ * @param args - {@link EstimateGasL1ToL2Parameters}
268
+ *
269
+ * @example
270
+ * import { createPublicClient, http } from 'viem'
271
+ * import { zkSyncLocalNode } from 'viem/chains'
272
+ * import { publicActionsL2 } from 'viem/zksync'
273
+ *
274
+ * const client = createPublicClient({
275
+ * chain: zkSyncLocalNode,
276
+ * transport: http(),
277
+ * }).extend(publicActionsL2())
278
+ *
279
+ * const details = await client.estimateGasL1ToL2({transactionRequest: {...}}});
280
+ */
281
+ estimateGasL1ToL2: (args: EstimateGasL1ToL2Parameters<TChain, TAccount>) => Promise<EstimateGasL1ToL2ReturnType>;
282
+ /**
283
+ * Returns the Bridgehub smart contract address.
284
+ *
285
+ * @returns address of the Bridgehub smart contract address.
286
+ *
287
+ *
288
+ * @example
289
+ * import { createPublicClient, http } from 'viem'
290
+ * import { zkSyncLocalNode } from 'viem/chains'
291
+ * import { publicActionsL2 } from 'viem/zksync'
292
+ *
293
+ * const client = createPublicClient({
294
+ * chain: zkSyncLocalNode,
295
+ * transport: http(),
296
+ * }).extend(publicActionsL2())
297
+ *
298
+ * const address = await client.getBridgehubContractAddress();
299
+ */
300
+ getBridgehubContractAddress: () => Promise<GetBridgehubContractAddressReturnType>;
301
+ /**
302
+ * Returns the address of the base L1 token.
303
+ *
304
+ * @returns address of the base L1 token.
305
+ *
306
+ *
307
+ * @example
308
+ * import { createPublicClient, http } from 'viem'
309
+ * import { zkSyncLocalNode } from 'viem/chains'
310
+ * import { publicActionsL2 } from 'viem/zksync'
311
+ *
312
+ * const client = createPublicClient({
313
+ * chain: zkSyncLocalNode,
314
+ * transport: http(),
315
+ * }).extend(publicActionsL2())
316
+ *
317
+ * const address = await client.getBaseTokenL1Address();
318
+ */
319
+ getBaseTokenL1Address: () => Promise<GetBaseTokenL1AddressReturnType>;
320
+ };
321
+ export declare function publicActionsL2(): <TTransport extends Transport = Transport, TChain extends ChainEIP712 | undefined = ChainEIP712 | undefined, TAccount extends Account | undefined = Account | undefined>(client: Client<TTransport, TChain, TAccount>) => PublicActionsL2<TChain, TAccount>;
322
+ //# sourceMappingURL=publicL2.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"publicL2.d.ts","sourceRoot":"","sources":["../../../zksync/decorators/publicL2.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,9 @@
1
+ import { BaseError } from '../../errors/base.js';
2
+ export type TokenIsEthErrorType = TokenIsEthError & {
3
+ name: 'TokenIsEthError';
4
+ };
5
+ export declare class TokenIsEthError extends BaseError {
6
+ name: string;
7
+ constructor();
8
+ }
9
+ //# sourceMappingURL=token-is-eth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"token-is-eth.d.ts","sourceRoot":"","sources":["../../../zksync/errors/token-is-eth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAEhD,MAAM,MAAM,mBAAmB,GAAG,eAAe,GAAG;IAClD,IAAI,EAAE,iBAAiB,CAAA;CACxB,CAAA;AACD,qBAAa,eAAgB,SAAQ,SAAS;IACnC,IAAI,SAAoB;;CASlC"}
@@ -573,7 +573,7 @@ export declare const formatters: {
573
573
  blobVersionedHashes?: undefined;
574
574
  kzg?: undefined;
575
575
  sidecars?: undefined;
576
- } & Omit<import("../index.js").TransactionRequestBase, "type"> & import("../index.js").ExactPartial<import("../index.js").FeeValuesEIP1559> & {
576
+ } & Omit<import("../index.js").TransactionRequestBase<bigint, number>, "type"> & import("../index.js").ExactPartial<import("../index.js").FeeValuesEIP1559> & {
577
577
  gasPerPubdata?: bigint | undefined;
578
578
  customSignature?: `0x${string}` | undefined;
579
579
  factoryDeps?: `0x${string}`[] | undefined;
@@ -598,7 +598,7 @@ export declare const formatters: {
598
598
  blobVersionedHashes?: undefined;
599
599
  kzg?: undefined;
600
600
  sidecars?: undefined;
601
- } & Omit<import("../index.js").TransactionRequestBase, "type"> & import("../index.js").ExactPartial<import("../index.js").FeeValuesEIP1559> & {
601
+ } & Omit<import("../index.js").TransactionRequestBase<bigint, number>, "type"> & import("../index.js").ExactPartial<import("../index.js").FeeValuesEIP1559> & {
602
602
  gasPerPubdata?: bigint | undefined;
603
603
  customSignature?: `0x${string}` | undefined;
604
604
  factoryDeps?: `0x${string}`[] | undefined;
@@ -743,7 +743,7 @@ export declare const formatters: {
743
743
  blobVersionedHashes?: undefined;
744
744
  kzg?: undefined;
745
745
  sidecars?: undefined;
746
- } & Omit<import("../index.js").TransactionRequestBase, "type"> & import("../index.js").ExactPartial<import("../index.js").FeeValuesEIP1559> & {
746
+ } & Omit<import("../index.js").TransactionRequestBase<bigint, number>, "type"> & import("../index.js").ExactPartial<import("../index.js").FeeValuesEIP1559> & {
747
747
  gasPerPubdata?: bigint | undefined;
748
748
  customSignature?: `0x${string}` | undefined;
749
749
  factoryDeps?: `0x${string}`[] | undefined;
@@ -768,7 +768,7 @@ export declare const formatters: {
768
768
  blobVersionedHashes?: undefined;
769
769
  kzg?: undefined;
770
770
  sidecars?: undefined;
771
- } & Omit<import("../index.js").TransactionRequestBase, "type"> & import("../index.js").ExactPartial<import("../index.js").FeeValuesEIP1559> & {
771
+ } & Omit<import("../index.js").TransactionRequestBase<bigint, number>, "type"> & import("../index.js").ExactPartial<import("../index.js").FeeValuesEIP1559> & {
772
772
  gasPerPubdata?: bigint | undefined;
773
773
  customSignature?: `0x${string}` | undefined;
774
774
  factoryDeps?: `0x${string}`[] | undefined;
@@ -913,7 +913,7 @@ export declare const formatters: {
913
913
  blobVersionedHashes?: undefined;
914
914
  kzg?: undefined;
915
915
  sidecars?: undefined;
916
- } & Omit<import("../index.js").TransactionRequestBase, "type"> & import("../index.js").ExactPartial<import("../index.js").FeeValuesEIP1559> & {
916
+ } & Omit<import("../index.js").TransactionRequestBase<bigint, number>, "type"> & import("../index.js").ExactPartial<import("../index.js").FeeValuesEIP1559> & {
917
917
  gasPerPubdata?: bigint | undefined;
918
918
  customSignature?: `0x${string}` | undefined;
919
919
  factoryDeps?: `0x${string}`[] | undefined;
@@ -938,7 +938,7 @@ export declare const formatters: {
938
938
  blobVersionedHashes?: undefined;
939
939
  kzg?: undefined;
940
940
  sidecars?: undefined;
941
- } & Omit<import("../index.js").TransactionRequestBase, "type"> & import("../index.js").ExactPartial<import("../index.js").FeeValuesEIP1559> & {
941
+ } & Omit<import("../index.js").TransactionRequestBase<bigint, number>, "type"> & import("../index.js").ExactPartial<import("../index.js").FeeValuesEIP1559> & {
942
942
  gasPerPubdata?: bigint | undefined;
943
943
  customSignature?: `0x${string}` | undefined;
944
944
  factoryDeps?: `0x${string}`[] | undefined;
@@ -1123,7 +1123,7 @@ export declare const formatters: {
1123
1123
  kzg?: import("../index.js").Kzg | undefined;
1124
1124
  sidecars?: readonly import("../index.js").BlobSidecar<`0x${string}`>[] | undefined;
1125
1125
  type?: "legacy" | "eip1559" | "eip4844" | "eip2930" | "priority" | "eip712" | undefined;
1126
- } & Omit<import("../index.js").TransactionRequestBase, "type"> & import("../index.js").ExactPartial<import("../index.js").FeeValuesEIP1559> & {
1126
+ } & Omit<import("../index.js").TransactionRequestBase<bigint, number>, "type"> & import("../index.js").ExactPartial<import("../index.js").FeeValuesEIP1559> & {
1127
1127
  gasPerPubdata?: bigint | undefined;
1128
1128
  customSignature?: `0x${string}` | undefined;
1129
1129
  factoryDeps?: `0x${string}`[] | undefined;
@@ -1148,7 +1148,7 @@ export declare const formatters: {
1148
1148
  kzg?: import("../index.js").Kzg | undefined;
1149
1149
  sidecars?: readonly import("../index.js").BlobSidecar<`0x${string}`>[] | undefined;
1150
1150
  type?: "legacy" | "eip1559" | "eip4844" | "eip2930" | "priority" | "eip712" | undefined;
1151
- } & Omit<import("../index.js").TransactionRequestBase, "type"> & import("../index.js").ExactPartial<import("../index.js").FeeValuesEIP1559> & {
1151
+ } & Omit<import("../index.js").TransactionRequestBase<bigint, number>, "type"> & import("../index.js").ExactPartial<import("../index.js").FeeValuesEIP1559> & {
1152
1152
  gasPerPubdata?: bigint | undefined;
1153
1153
  customSignature?: `0x${string}` | undefined;
1154
1154
  factoryDeps?: `0x${string}`[] | undefined;