viem 0.3.5 → 0.3.6

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 (582) hide show
  1. package/dist/cjs/errors/version.js +1 -1
  2. package/dist/esm/errors/version.js +1 -1
  3. package/dist/types/abi.d.ts +3 -0
  4. package/dist/types/abi.d.ts.map +1 -0
  5. package/dist/types/accounts/generateMnemonic.d.ts +9 -0
  6. package/dist/types/accounts/generateMnemonic.d.ts.map +1 -0
  7. package/dist/types/accounts/generatePrivateKey.d.ts +8 -0
  8. package/dist/types/accounts/generatePrivateKey.d.ts.map +1 -0
  9. package/dist/types/accounts/hdKeyToAccount.d.ts +9 -0
  10. package/dist/types/accounts/hdKeyToAccount.d.ts.map +1 -0
  11. package/dist/types/accounts/index.d.ts +21 -0
  12. package/dist/types/accounts/index.d.ts.map +1 -0
  13. package/dist/types/accounts/mnemonicToAccount.d.ts +8 -0
  14. package/dist/types/accounts/mnemonicToAccount.d.ts.map +1 -0
  15. package/dist/types/accounts/privateKeyToAccount.d.ts +9 -0
  16. package/dist/types/accounts/privateKeyToAccount.d.ts.map +1 -0
  17. package/dist/types/accounts/toAccount.d.ts +11 -0
  18. package/dist/types/accounts/toAccount.d.ts.map +1 -0
  19. package/dist/types/accounts/types.d.ts +45 -0
  20. package/dist/types/accounts/types.d.ts.map +1 -0
  21. package/dist/types/accounts/utils/index.d.ts +10 -0
  22. package/dist/types/accounts/utils/index.d.ts.map +1 -0
  23. package/dist/types/accounts/utils/parseAccount.d.ts +4 -0
  24. package/dist/types/accounts/utils/parseAccount.d.ts.map +1 -0
  25. package/dist/types/accounts/utils/publicKeyToAddress.d.ts +10 -0
  26. package/dist/types/accounts/utils/publicKeyToAddress.d.ts.map +1 -0
  27. package/dist/types/accounts/utils/sign.d.ts +16 -0
  28. package/dist/types/accounts/utils/sign.d.ts.map +1 -0
  29. package/dist/types/accounts/utils/signMessage.d.ts +16 -0
  30. package/dist/types/accounts/utils/signMessage.d.ts.map +1 -0
  31. package/dist/types/accounts/utils/signTransaction.d.ts +9 -0
  32. package/dist/types/accounts/utils/signTransaction.d.ts.map +1 -0
  33. package/dist/types/accounts/utils/signTypedData.d.ts +19 -0
  34. package/dist/types/accounts/utils/signTypedData.d.ts.map +1 -0
  35. package/dist/types/accounts/utils/signatureToHex.d.ts +3 -0
  36. package/dist/types/accounts/utils/signatureToHex.d.ts.map +1 -0
  37. package/dist/types/accounts/wordlists/czech.d.ts +2 -0
  38. package/dist/types/accounts/wordlists/czech.d.ts.map +1 -0
  39. package/dist/types/accounts/wordlists/english.d.ts +2 -0
  40. package/dist/types/accounts/wordlists/english.d.ts.map +1 -0
  41. package/dist/types/accounts/wordlists/french.d.ts +2 -0
  42. package/dist/types/accounts/wordlists/french.d.ts.map +1 -0
  43. package/dist/types/accounts/wordlists/italian.d.ts +2 -0
  44. package/dist/types/accounts/wordlists/italian.d.ts.map +1 -0
  45. package/dist/types/accounts/wordlists/japanese.d.ts +2 -0
  46. package/dist/types/accounts/wordlists/japanese.d.ts.map +1 -0
  47. package/dist/types/accounts/wordlists/korean.d.ts +2 -0
  48. package/dist/types/accounts/wordlists/korean.d.ts.map +1 -0
  49. package/dist/types/accounts/wordlists/simplifiedChinese.d.ts +2 -0
  50. package/dist/types/accounts/wordlists/simplifiedChinese.d.ts.map +1 -0
  51. package/dist/types/accounts/wordlists/spanish.d.ts +2 -0
  52. package/dist/types/accounts/wordlists/spanish.d.ts.map +1 -0
  53. package/dist/types/accounts/wordlists/traditionalChinese.d.ts +2 -0
  54. package/dist/types/accounts/wordlists/traditionalChinese.d.ts.map +1 -0
  55. package/dist/types/actions/ens/getEnsAddress.d.ts +40 -0
  56. package/dist/types/actions/ens/getEnsAddress.d.ts.map +1 -0
  57. package/dist/types/actions/ens/getEnsAvatar.d.ts +38 -0
  58. package/dist/types/actions/ens/getEnsAvatar.d.ts.map +1 -0
  59. package/dist/types/actions/ens/getEnsName.d.ts +38 -0
  60. package/dist/types/actions/ens/getEnsName.d.ts.map +1 -0
  61. package/dist/types/actions/ens/getEnsResolver.d.ts +40 -0
  62. package/dist/types/actions/ens/getEnsResolver.d.ts.map +1 -0
  63. package/dist/types/actions/ens/getEnsText.d.ts +43 -0
  64. package/dist/types/actions/ens/getEnsText.d.ts.map +1 -0
  65. package/dist/types/actions/ens/index.d.ts +6 -0
  66. package/dist/types/actions/ens/index.d.ts.map +1 -0
  67. package/dist/types/actions/getContract.d.ts +261 -0
  68. package/dist/types/actions/getContract.d.ts.map +1 -0
  69. package/dist/types/actions/index.d.ts +11 -0
  70. package/dist/types/actions/index.d.ts.map +1 -0
  71. package/dist/types/actions/public/call.d.ts +49 -0
  72. package/dist/types/actions/public/call.d.ts.map +1 -0
  73. package/dist/types/actions/public/createBlockFilter.d.ts +26 -0
  74. package/dist/types/actions/public/createBlockFilter.d.ts.map +1 -0
  75. package/dist/types/actions/public/createContractEventFilter.d.ts +41 -0
  76. package/dist/types/actions/public/createContractEventFilter.d.ts.map +1 -0
  77. package/dist/types/actions/public/createEventFilter.d.ts +46 -0
  78. package/dist/types/actions/public/createEventFilter.d.ts.map +1 -0
  79. package/dist/types/actions/public/createPendingTransactionFilter.d.ts +26 -0
  80. package/dist/types/actions/public/createPendingTransactionFilter.d.ts.map +1 -0
  81. package/dist/types/actions/public/estimateContractGas.d.ts +35 -0
  82. package/dist/types/actions/public/estimateContractGas.d.ts.map +1 -0
  83. package/dist/types/actions/public/estimateGas.d.ts +45 -0
  84. package/dist/types/actions/public/estimateGas.d.ts.map +1 -0
  85. package/dist/types/actions/public/getBalance.d.ts +52 -0
  86. package/dist/types/actions/public/getBalance.d.ts.map +1 -0
  87. package/dist/types/actions/public/getBlock.d.ts +52 -0
  88. package/dist/types/actions/public/getBlock.d.ts.map +1 -0
  89. package/dist/types/actions/public/getBlockNumber.d.ts +54 -0
  90. package/dist/types/actions/public/getBlockNumber.d.ts.map +1 -0
  91. package/dist/types/actions/public/getBlockTransactionCount.d.ts +44 -0
  92. package/dist/types/actions/public/getBlockTransactionCount.d.ts.map +1 -0
  93. package/dist/types/actions/public/getBytecode.d.ts +37 -0
  94. package/dist/types/actions/public/getBytecode.d.ts.map +1 -0
  95. package/dist/types/actions/public/getChainId.d.ts +26 -0
  96. package/dist/types/actions/public/getChainId.d.ts.map +1 -0
  97. package/dist/types/actions/public/getFeeHistory.d.ts +50 -0
  98. package/dist/types/actions/public/getFeeHistory.d.ts.map +1 -0
  99. package/dist/types/actions/public/getFilterChanges.d.ts +91 -0
  100. package/dist/types/actions/public/getFilterChanges.d.ts.map +1 -0
  101. package/dist/types/actions/public/getFilterLogs.d.ts +36 -0
  102. package/dist/types/actions/public/getFilterLogs.d.ts.map +1 -0
  103. package/dist/types/actions/public/getGasPrice.d.ts +25 -0
  104. package/dist/types/actions/public/getGasPrice.d.ts.map +1 -0
  105. package/dist/types/actions/public/getLogs.d.ts +49 -0
  106. package/dist/types/actions/public/getLogs.d.ts.map +1 -0
  107. package/dist/types/actions/public/getStorageAt.d.ts +39 -0
  108. package/dist/types/actions/public/getStorageAt.d.ts.map +1 -0
  109. package/dist/types/actions/public/getTransaction.d.ts +62 -0
  110. package/dist/types/actions/public/getTransaction.d.ts.map +1 -0
  111. package/dist/types/actions/public/getTransactionConfirmations.d.ts +39 -0
  112. package/dist/types/actions/public/getTransactionConfirmations.d.ts.map +1 -0
  113. package/dist/types/actions/public/getTransactionCount.d.ts +40 -0
  114. package/dist/types/actions/public/getTransactionCount.d.ts.map +1 -0
  115. package/dist/types/actions/public/getTransactionReceipt.d.ts +34 -0
  116. package/dist/types/actions/public/getTransactionReceipt.d.ts.map +1 -0
  117. package/dist/types/actions/public/index.d.ts +67 -0
  118. package/dist/types/actions/public/index.d.ts.map +1 -0
  119. package/dist/types/actions/public/multicall.d.ts +52 -0
  120. package/dist/types/actions/public/multicall.d.ts.map +1 -0
  121. package/dist/types/actions/public/readContract.d.ts +39 -0
  122. package/dist/types/actions/public/readContract.d.ts.map +1 -0
  123. package/dist/types/actions/public/simulateContract.d.ts +47 -0
  124. package/dist/types/actions/public/simulateContract.d.ts.map +1 -0
  125. package/dist/types/actions/public/uninstallFilter.d.ts +32 -0
  126. package/dist/types/actions/public/uninstallFilter.d.ts.map +1 -0
  127. package/dist/types/actions/public/waitForTransactionReceipt.d.ts +69 -0
  128. package/dist/types/actions/public/waitForTransactionReceipt.d.ts.map +1 -0
  129. package/dist/types/actions/public/watchBlockNumber.d.ts +57 -0
  130. package/dist/types/actions/public/watchBlockNumber.d.ts.map +1 -0
  131. package/dist/types/actions/public/watchBlocks.d.ts +64 -0
  132. package/dist/types/actions/public/watchBlocks.d.ts.map +1 -0
  133. package/dist/types/actions/public/watchContractEvent.d.ts +55 -0
  134. package/dist/types/actions/public/watchContractEvent.d.ts.map +1 -0
  135. package/dist/types/actions/public/watchEvent.d.ts +61 -0
  136. package/dist/types/actions/public/watchEvent.d.ts.map +1 -0
  137. package/dist/types/actions/public/watchPendingTransactions.d.ts +71 -0
  138. package/dist/types/actions/public/watchPendingTransactions.d.ts.map +1 -0
  139. package/dist/types/actions/test/dropTransaction.d.ts +30 -0
  140. package/dist/types/actions/test/dropTransaction.d.ts.map +1 -0
  141. package/dist/types/actions/test/getAutomine.d.ts +25 -0
  142. package/dist/types/actions/test/getAutomine.d.ts.map +1 -0
  143. package/dist/types/actions/test/getTxpoolContent.d.ts +31 -0
  144. package/dist/types/actions/test/getTxpoolContent.d.ts.map +1 -0
  145. package/dist/types/actions/test/getTxpoolStatus.d.ts +28 -0
  146. package/dist/types/actions/test/getTxpoolStatus.d.ts.map +1 -0
  147. package/dist/types/actions/test/impersonateAccount.d.ts +30 -0
  148. package/dist/types/actions/test/impersonateAccount.d.ts.map +1 -0
  149. package/dist/types/actions/test/increaseTime.d.ts +30 -0
  150. package/dist/types/actions/test/increaseTime.d.ts.map +1 -0
  151. package/dist/types/actions/test/index.d.ts +52 -0
  152. package/dist/types/actions/test/index.d.ts.map +1 -0
  153. package/dist/types/actions/test/inspectTxpool.d.ts +28 -0
  154. package/dist/types/actions/test/inspectTxpool.d.ts.map +1 -0
  155. package/dist/types/actions/test/mine.d.ts +30 -0
  156. package/dist/types/actions/test/mine.d.ts.map +1 -0
  157. package/dist/types/actions/test/removeBlockTimestampInterval.d.ts +23 -0
  158. package/dist/types/actions/test/removeBlockTimestampInterval.d.ts.map +1 -0
  159. package/dist/types/actions/test/reset.d.ts +30 -0
  160. package/dist/types/actions/test/reset.d.ts.map +1 -0
  161. package/dist/types/actions/test/revert.d.ts +28 -0
  162. package/dist/types/actions/test/revert.d.ts.map +1 -0
  163. package/dist/types/actions/test/sendUnsignedTransaction.d.ts +31 -0
  164. package/dist/types/actions/test/sendUnsignedTransaction.d.ts.map +1 -0
  165. package/dist/types/actions/test/setAutomine.d.ts +23 -0
  166. package/dist/types/actions/test/setAutomine.d.ts.map +1 -0
  167. package/dist/types/actions/test/setBalance.d.ts +33 -0
  168. package/dist/types/actions/test/setBalance.d.ts.map +1 -0
  169. package/dist/types/actions/test/setBlockGasLimit.d.ts +28 -0
  170. package/dist/types/actions/test/setBlockGasLimit.d.ts.map +1 -0
  171. package/dist/types/actions/test/setBlockTimestampInterval.d.ts +28 -0
  172. package/dist/types/actions/test/setBlockTimestampInterval.d.ts.map +1 -0
  173. package/dist/types/actions/test/setCode.d.ts +33 -0
  174. package/dist/types/actions/test/setCode.d.ts.map +1 -0
  175. package/dist/types/actions/test/setCoinbase.d.ts +30 -0
  176. package/dist/types/actions/test/setCoinbase.d.ts.map +1 -0
  177. package/dist/types/actions/test/setIntervalMining.d.ts +28 -0
  178. package/dist/types/actions/test/setIntervalMining.d.ts.map +1 -0
  179. package/dist/types/actions/test/setLoggingEnabled.d.ts +23 -0
  180. package/dist/types/actions/test/setLoggingEnabled.d.ts.map +1 -0
  181. package/dist/types/actions/test/setMinGasPrice.d.ts +32 -0
  182. package/dist/types/actions/test/setMinGasPrice.d.ts.map +1 -0
  183. package/dist/types/actions/test/setNextBlockBaseFeePerGas.d.ts +30 -0
  184. package/dist/types/actions/test/setNextBlockBaseFeePerGas.d.ts.map +1 -0
  185. package/dist/types/actions/test/setNextBlockTimestamp.d.ts +28 -0
  186. package/dist/types/actions/test/setNextBlockTimestamp.d.ts.map +1 -0
  187. package/dist/types/actions/test/setNonce.d.ts +33 -0
  188. package/dist/types/actions/test/setNonce.d.ts.map +1 -0
  189. package/dist/types/actions/test/setRpcUrl.d.ts +24 -0
  190. package/dist/types/actions/test/setRpcUrl.d.ts.map +1 -0
  191. package/dist/types/actions/test/setStorageAt.d.ts +36 -0
  192. package/dist/types/actions/test/setStorageAt.d.ts.map +1 -0
  193. package/dist/types/actions/test/snapshot.d.ts +23 -0
  194. package/dist/types/actions/test/snapshot.d.ts.map +1 -0
  195. package/dist/types/actions/test/stopImpersonatingAccount.d.ts +30 -0
  196. package/dist/types/actions/test/stopImpersonatingAccount.d.ts.map +1 -0
  197. package/dist/types/actions/wallet/addChain.d.ts +27 -0
  198. package/dist/types/actions/wallet/addChain.d.ts.map +1 -0
  199. package/dist/types/actions/wallet/deployContract.d.ts +38 -0
  200. package/dist/types/actions/wallet/deployContract.d.ts.map +1 -0
  201. package/dist/types/actions/wallet/getAddresses.d.ts +26 -0
  202. package/dist/types/actions/wallet/getAddresses.d.ts.map +1 -0
  203. package/dist/types/actions/wallet/getPermissions.d.ts +26 -0
  204. package/dist/types/actions/wallet/getPermissions.d.ts.map +1 -0
  205. package/dist/types/actions/wallet/index.d.ts +27 -0
  206. package/dist/types/actions/wallet/index.d.ts.map +1 -0
  207. package/dist/types/actions/wallet/requestAddresses.d.ts +30 -0
  208. package/dist/types/actions/wallet/requestAddresses.d.ts.map +1 -0
  209. package/dist/types/actions/wallet/requestPermissions.d.ts +34 -0
  210. package/dist/types/actions/wallet/requestPermissions.d.ts.map +1 -0
  211. package/dist/types/actions/wallet/sendTransaction.d.ts +53 -0
  212. package/dist/types/actions/wallet/sendTransaction.d.ts.map +1 -0
  213. package/dist/types/actions/wallet/signMessage.d.ts +54 -0
  214. package/dist/types/actions/wallet/signMessage.d.ts.map +1 -0
  215. package/dist/types/actions/wallet/signTypedData.d.ts +109 -0
  216. package/dist/types/actions/wallet/signTypedData.d.ts.map +1 -0
  217. package/dist/types/actions/wallet/switchChain.d.ts +28 -0
  218. package/dist/types/actions/wallet/switchChain.d.ts.map +1 -0
  219. package/dist/types/actions/wallet/watchAsset.d.ts +35 -0
  220. package/dist/types/actions/wallet/watchAsset.d.ts.map +1 -0
  221. package/dist/types/actions/wallet/writeContract.d.ts +58 -0
  222. package/dist/types/actions/wallet/writeContract.d.ts.map +1 -0
  223. package/dist/types/adapters/ethers.d.ts +27 -0
  224. package/dist/types/adapters/ethers.d.ts.map +1 -0
  225. package/dist/types/chains.d.ts +2487 -0
  226. package/dist/types/chains.d.ts.map +1 -0
  227. package/dist/types/clients/createClient.d.ts +43 -0
  228. package/dist/types/clients/createClient.d.ts.map +1 -0
  229. package/dist/types/clients/createPublicClient.d.ts +40 -0
  230. package/dist/types/clients/createPublicClient.d.ts.map +1 -0
  231. package/dist/types/clients/createTestClient.d.ts +38 -0
  232. package/dist/types/clients/createTestClient.d.ts.map +1 -0
  233. package/dist/types/clients/createWalletClient.d.ts +51 -0
  234. package/dist/types/clients/createWalletClient.d.ts.map +1 -0
  235. package/dist/types/clients/decorators/index.d.ts +7 -0
  236. package/dist/types/clients/decorators/index.d.ts.map +1 -0
  237. package/dist/types/clients/decorators/public.d.ts +1043 -0
  238. package/dist/types/clients/decorators/public.d.ts.map +1 -0
  239. package/dist/types/clients/decorators/test.d.ts +572 -0
  240. package/dist/types/clients/decorators/test.d.ts.map +1 -0
  241. package/dist/types/clients/decorators/wallet.d.ts +436 -0
  242. package/dist/types/clients/decorators/wallet.d.ts.map +1 -0
  243. package/dist/types/clients/index.d.ts +11 -0
  244. package/dist/types/clients/index.d.ts.map +1 -0
  245. package/dist/types/clients/transports/createTransport.d.ts +37 -0
  246. package/dist/types/clients/transports/createTransport.d.ts.map +1 -0
  247. package/dist/types/clients/transports/custom.d.ts +21 -0
  248. package/dist/types/clients/transports/custom.d.ts.map +1 -0
  249. package/dist/types/clients/transports/fallback.d.ts +75 -0
  250. package/dist/types/clients/transports/fallback.d.ts.map +1 -0
  251. package/dist/types/clients/transports/http.d.ts +29 -0
  252. package/dist/types/clients/transports/http.d.ts.map +1 -0
  253. package/dist/types/clients/transports/index.d.ts +11 -0
  254. package/dist/types/clients/transports/index.d.ts.map +1 -0
  255. package/dist/types/clients/transports/webSocket.d.ts +46 -0
  256. package/dist/types/clients/transports/webSocket.d.ts.map +1 -0
  257. package/dist/types/constants/abis.d.ts +79 -0
  258. package/dist/types/constants/abis.d.ts.map +1 -0
  259. package/dist/types/constants/contract.d.ts +2 -0
  260. package/dist/types/constants/contract.d.ts.map +1 -0
  261. package/dist/types/constants/index.d.ts +5 -0
  262. package/dist/types/constants/index.d.ts.map +1 -0
  263. package/dist/types/constants/solidity.d.ts +15 -0
  264. package/dist/types/constants/solidity.d.ts.map +1 -0
  265. package/dist/types/constants/unit.d.ts +13 -0
  266. package/dist/types/constants/unit.d.ts.map +1 -0
  267. package/dist/types/contract.d.ts +7 -0
  268. package/dist/types/contract.d.ts.map +1 -0
  269. package/dist/types/ens.d.ts +5 -0
  270. package/dist/types/ens.d.ts.map +1 -0
  271. package/dist/types/errors/abi.d.ts +165 -0
  272. package/dist/types/errors/abi.d.ts.map +1 -0
  273. package/dist/types/errors/account.d.ts +8 -0
  274. package/dist/types/errors/account.d.ts.map +1 -0
  275. package/dist/types/errors/address.d.ts +8 -0
  276. package/dist/types/errors/address.d.ts.map +1 -0
  277. package/dist/types/errors/base.d.ts +22 -0
  278. package/dist/types/errors/base.d.ts.map +1 -0
  279. package/dist/types/errors/block.d.ts +10 -0
  280. package/dist/types/errors/block.d.ts.map +1 -0
  281. package/dist/types/errors/chain.d.ts +35 -0
  282. package/dist/types/errors/chain.d.ts.map +1 -0
  283. package/dist/types/errors/contract.d.ts +58 -0
  284. package/dist/types/errors/contract.d.ts.map +1 -0
  285. package/dist/types/errors/data.d.ts +10 -0
  286. package/dist/types/errors/data.d.ts.map +1 -0
  287. package/dist/types/errors/encoding.d.ts +53 -0
  288. package/dist/types/errors/encoding.d.ts.map +1 -0
  289. package/dist/types/errors/ens.d.ts +26 -0
  290. package/dist/types/errors/ens.d.ts.map +1 -0
  291. package/dist/types/errors/estimateGas.d.ts +13 -0
  292. package/dist/types/errors/estimateGas.d.ts.map +1 -0
  293. package/dist/types/errors/index.d.ts +18 -0
  294. package/dist/types/errors/index.d.ts.map +1 -0
  295. package/dist/types/errors/log.d.ts +6 -0
  296. package/dist/types/errors/log.d.ts.map +1 -0
  297. package/dist/types/errors/node.d.ts +105 -0
  298. package/dist/types/errors/node.d.ts.map +1 -0
  299. package/dist/types/errors/request.d.ts +53 -0
  300. package/dist/types/errors/request.d.ts.map +1 -0
  301. package/dist/types/errors/rpc.d.ts +199 -0
  302. package/dist/types/errors/rpc.d.ts.map +1 -0
  303. package/dist/types/errors/transaction.d.ts +75 -0
  304. package/dist/types/errors/transaction.d.ts.map +1 -0
  305. package/dist/types/errors/transport.d.ts +5 -0
  306. package/dist/types/errors/transport.d.ts.map +1 -0
  307. package/dist/types/errors/utils.d.ts +5 -0
  308. package/dist/types/errors/utils.d.ts.map +1 -0
  309. package/dist/types/errors/version.d.ts +2 -0
  310. package/dist/types/errors/version.d.ts.map +1 -0
  311. package/dist/types/ethers.d.ts +2 -0
  312. package/dist/types/ethers.d.ts.map +1 -0
  313. package/dist/types/index.d.ts +12 -0
  314. package/dist/types/index.d.ts.map +1 -0
  315. package/dist/types/public.d.ts +3 -0
  316. package/dist/types/public.d.ts.map +1 -0
  317. package/dist/types/test.d.ts +3 -0
  318. package/dist/types/test.d.ts.map +1 -0
  319. package/dist/types/types/account.d.ts +11 -0
  320. package/dist/types/types/account.d.ts.map +1 -0
  321. package/dist/types/types/block.d.ts +62 -0
  322. package/dist/types/types/block.d.ts.map +1 -0
  323. package/dist/types/types/chain.d.ts +17 -0
  324. package/dist/types/types/chain.d.ts.map +1 -0
  325. package/dist/types/types/contract.d.ts +159 -0
  326. package/dist/types/types/contract.d.ts.map +1 -0
  327. package/dist/types/types/eip1193.d.ts +1002 -0
  328. package/dist/types/types/eip1193.d.ts.map +1 -0
  329. package/dist/types/types/ens.d.ts +5 -0
  330. package/dist/types/types/ens.d.ts.map +1 -0
  331. package/dist/types/types/fee.d.ts +28 -0
  332. package/dist/types/types/fee.d.ts.map +1 -0
  333. package/dist/types/types/filter.d.ts +27 -0
  334. package/dist/types/types/filter.d.ts.map +1 -0
  335. package/dist/types/types/formatter.d.ts +13 -0
  336. package/dist/types/types/formatter.d.ts.map +1 -0
  337. package/dist/types/types/index.d.ts +19 -0
  338. package/dist/types/types/index.d.ts.map +1 -0
  339. package/dist/types/types/log.d.ts +42 -0
  340. package/dist/types/types/log.d.ts.map +1 -0
  341. package/dist/types/types/misc.d.ts +10 -0
  342. package/dist/types/types/misc.d.ts.map +1 -0
  343. package/dist/types/types/multicall.d.ts +48 -0
  344. package/dist/types/types/multicall.d.ts.map +1 -0
  345. package/dist/types/types/rpc.d.ts +19 -0
  346. package/dist/types/types/rpc.d.ts.map +1 -0
  347. package/dist/types/types/transaction.d.ts +132 -0
  348. package/dist/types/types/transaction.d.ts.map +1 -0
  349. package/dist/types/types/transport.d.ts +3 -0
  350. package/dist/types/types/transport.d.ts.map +1 -0
  351. package/dist/types/types/typedData.d.ts +47 -0
  352. package/dist/types/types/typedData.d.ts.map +1 -0
  353. package/dist/types/types/utils.d.ts +156 -0
  354. package/dist/types/types/utils.d.ts.map +1 -0
  355. package/dist/types/types/window.d.ts +7 -0
  356. package/dist/types/types/window.d.ts.map +1 -0
  357. package/dist/types/utils/abi/decodeAbiParameters.d.ts +5 -0
  358. package/dist/types/utils/abi/decodeAbiParameters.d.ts.map +1 -0
  359. package/dist/types/utils/abi/decodeDeployData.d.ts +13 -0
  360. package/dist/types/utils/abi/decodeDeployData.d.ts.map +1 -0
  361. package/dist/types/utils/abi/decodeErrorResult.d.ts +13 -0
  362. package/dist/types/utils/abi/decodeErrorResult.d.ts.map +1 -0
  363. package/dist/types/utils/abi/decodeEventLog.d.ts +13 -0
  364. package/dist/types/utils/abi/decodeEventLog.d.ts.map +1 -0
  365. package/dist/types/utils/abi/decodeFunctionData.d.ts +14 -0
  366. package/dist/types/utils/abi/decodeFunctionData.d.ts.map +1 -0
  367. package/dist/types/utils/abi/decodeFunctionResult.d.ts +10 -0
  368. package/dist/types/utils/abi/decodeFunctionResult.d.ts.map +1 -0
  369. package/dist/types/utils/abi/encodeAbiParameters.d.ts +9 -0
  370. package/dist/types/utils/abi/encodeAbiParameters.d.ts.map +1 -0
  371. package/dist/types/utils/abi/encodeDeployData.d.ts +8 -0
  372. package/dist/types/utils/abi/encodeDeployData.d.ts.map +1 -0
  373. package/dist/types/utils/abi/encodeErrorResult.d.ts +8 -0
  374. package/dist/types/utils/abi/encodeErrorResult.d.ts.map +1 -0
  375. package/dist/types/utils/abi/encodeEventTopics.d.ts +9 -0
  376. package/dist/types/utils/abi/encodeEventTopics.d.ts.map +1 -0
  377. package/dist/types/utils/abi/encodeFunctionData.d.ts +8 -0
  378. package/dist/types/utils/abi/encodeFunctionData.d.ts.map +1 -0
  379. package/dist/types/utils/abi/encodeFunctionResult.d.ts +9 -0
  380. package/dist/types/utils/abi/encodeFunctionResult.d.ts.map +1 -0
  381. package/dist/types/utils/abi/encodePacked.d.ts +11 -0
  382. package/dist/types/utils/abi/encodePacked.d.ts.map +1 -0
  383. package/dist/types/utils/abi/formatAbiItem.d.ts +9 -0
  384. package/dist/types/utils/abi/formatAbiItem.d.ts.map +1 -0
  385. package/dist/types/utils/abi/formatAbiItemWithArgs.d.ts +8 -0
  386. package/dist/types/utils/abi/formatAbiItemWithArgs.d.ts.map +1 -0
  387. package/dist/types/utils/abi/getAbiItem.d.ts +12 -0
  388. package/dist/types/utils/abi/getAbiItem.d.ts.map +1 -0
  389. package/dist/types/utils/abi/index.d.ts +30 -0
  390. package/dist/types/utils/abi/index.d.ts.map +1 -0
  391. package/dist/types/utils/accounts.d.ts +3 -0
  392. package/dist/types/utils/accounts.d.ts.map +1 -0
  393. package/dist/types/utils/address/getAddress.d.ts +4 -0
  394. package/dist/types/utils/address/getAddress.d.ts.map +1 -0
  395. package/dist/types/utils/address/getContractAddress.d.ts +19 -0
  396. package/dist/types/utils/address/getContractAddress.d.ts.map +1 -0
  397. package/dist/types/utils/address/index.d.ts +6 -0
  398. package/dist/types/utils/address/index.d.ts.map +1 -0
  399. package/dist/types/utils/address/isAddress.d.ts +3 -0
  400. package/dist/types/utils/address/isAddress.d.ts.map +1 -0
  401. package/dist/types/utils/address/isAddressEqual.d.ts +3 -0
  402. package/dist/types/utils/address/isAddressEqual.d.ts.map +1 -0
  403. package/dist/types/utils/buildRequest.d.ts +6 -0
  404. package/dist/types/utils/buildRequest.d.ts.map +1 -0
  405. package/dist/types/utils/chain.d.ts +8 -0
  406. package/dist/types/utils/chain.d.ts.map +1 -0
  407. package/dist/types/utils/contract/extractFunctionParts.d.ts +13 -0
  408. package/dist/types/utils/contract/extractFunctionParts.d.ts.map +1 -0
  409. package/dist/types/utils/contract/index.d.ts +2 -0
  410. package/dist/types/utils/contract/index.d.ts.map +1 -0
  411. package/dist/types/utils/data/concat.d.ts +6 -0
  412. package/dist/types/utils/data/concat.d.ts.map +1 -0
  413. package/dist/types/utils/data/index.d.ts +8 -0
  414. package/dist/types/utils/data/index.d.ts.map +1 -0
  415. package/dist/types/utils/data/isBytes.d.ts +3 -0
  416. package/dist/types/utils/data/isBytes.d.ts.map +1 -0
  417. package/dist/types/utils/data/isHex.d.ts +3 -0
  418. package/dist/types/utils/data/isHex.d.ts.map +1 -0
  419. package/dist/types/utils/data/pad.d.ts +11 -0
  420. package/dist/types/utils/data/pad.d.ts.map +1 -0
  421. package/dist/types/utils/data/size.d.ts +9 -0
  422. package/dist/types/utils/data/size.d.ts.map +1 -0
  423. package/dist/types/utils/data/slice.d.ts +27 -0
  424. package/dist/types/utils/data/slice.d.ts.map +1 -0
  425. package/dist/types/utils/data/trim.d.ts +8 -0
  426. package/dist/types/utils/data/trim.d.ts.map +1 -0
  427. package/dist/types/utils/encoding/fromBytes.d.ts +110 -0
  428. package/dist/types/utils/encoding/fromBytes.d.ts.map +1 -0
  429. package/dist/types/utils/encoding/fromHex.d.ts +138 -0
  430. package/dist/types/utils/encoding/fromHex.d.ts.map +1 -0
  431. package/dist/types/utils/encoding/fromRlp.d.ts +6 -0
  432. package/dist/types/utils/encoding/fromRlp.d.ts.map +1 -0
  433. package/dist/types/utils/encoding/index.d.ts +8 -0
  434. package/dist/types/utils/encoding/index.d.ts.map +1 -0
  435. package/dist/types/utils/encoding/toBytes.d.ts +125 -0
  436. package/dist/types/utils/encoding/toBytes.d.ts.map +1 -0
  437. package/dist/types/utils/encoding/toHex.d.ts +139 -0
  438. package/dist/types/utils/encoding/toHex.d.ts.map +1 -0
  439. package/dist/types/utils/encoding/toRlp.d.ts +8 -0
  440. package/dist/types/utils/encoding/toRlp.d.ts.map +1 -0
  441. package/dist/types/utils/ens/avatar/index.d.ts +2 -0
  442. package/dist/types/utils/ens/avatar/index.d.ts.map +1 -0
  443. package/dist/types/utils/ens/avatar/parseAvatarRecord.d.ts +7 -0
  444. package/dist/types/utils/ens/avatar/parseAvatarRecord.d.ts.map +1 -0
  445. package/dist/types/utils/ens/avatar/utils.d.ts +34 -0
  446. package/dist/types/utils/ens/avatar/utils.d.ts.map +1 -0
  447. package/dist/types/utils/ens/index.d.ts +5 -0
  448. package/dist/types/utils/ens/index.d.ts.map +1 -0
  449. package/dist/types/utils/ens/labelhash.d.ts +11 -0
  450. package/dist/types/utils/ens/labelhash.d.ts.map +1 -0
  451. package/dist/types/utils/ens/namehash.d.ts +13 -0
  452. package/dist/types/utils/ens/namehash.d.ts.map +1 -0
  453. package/dist/types/utils/ens/normalize.d.ts +12 -0
  454. package/dist/types/utils/ens/normalize.d.ts.map +1 -0
  455. package/dist/types/utils/ens/packetToBytes.d.ts +3 -0
  456. package/dist/types/utils/ens/packetToBytes.d.ts.map +1 -0
  457. package/dist/types/utils/errors/getCallError.d.ts +9 -0
  458. package/dist/types/utils/errors/getCallError.d.ts.map +1 -0
  459. package/dist/types/utils/errors/getContractError.d.ts +13 -0
  460. package/dist/types/utils/errors/getContractError.d.ts.map +1 -0
  461. package/dist/types/utils/errors/getEstimateGasError.d.ts +10 -0
  462. package/dist/types/utils/errors/getEstimateGasError.d.ts.map +1 -0
  463. package/dist/types/utils/errors/getNodeError.d.ts +6 -0
  464. package/dist/types/utils/errors/getNodeError.d.ts.map +1 -0
  465. package/dist/types/utils/errors/getTransactionError.d.ts +10 -0
  466. package/dist/types/utils/errors/getTransactionError.d.ts.map +1 -0
  467. package/dist/types/utils/errors/index.d.ts +6 -0
  468. package/dist/types/utils/errors/index.d.ts.map +1 -0
  469. package/dist/types/utils/filters/createFilterRequestScope.d.ts +16 -0
  470. package/dist/types/utils/filters/createFilterRequestScope.d.ts.map +1 -0
  471. package/dist/types/utils/formatters/block.d.ts +14 -0
  472. package/dist/types/utils/formatters/block.d.ts.map +1 -0
  473. package/dist/types/utils/formatters/extract.d.ts +8 -0
  474. package/dist/types/utils/formatters/extract.d.ts.map +1 -0
  475. package/dist/types/utils/formatters/feeHistory.d.ts +3 -0
  476. package/dist/types/utils/formatters/feeHistory.d.ts.map +1 -0
  477. package/dist/types/utils/formatters/format.d.ts +36 -0
  478. package/dist/types/utils/formatters/format.d.ts.map +1 -0
  479. package/dist/types/utils/formatters/index.d.ts +13 -0
  480. package/dist/types/utils/formatters/index.d.ts.map +1 -0
  481. package/dist/types/utils/formatters/log.d.ts +16 -0
  482. package/dist/types/utils/formatters/log.d.ts.map +1 -0
  483. package/dist/types/utils/formatters/transaction.d.ts +19 -0
  484. package/dist/types/utils/formatters/transaction.d.ts.map +1 -0
  485. package/dist/types/utils/formatters/transactionReceipt.d.ts +14 -0
  486. package/dist/types/utils/formatters/transactionReceipt.d.ts.map +1 -0
  487. package/dist/types/utils/formatters/transactionRequest.d.ts +14 -0
  488. package/dist/types/utils/formatters/transactionRequest.d.ts.map +1 -0
  489. package/dist/types/utils/hash/getEventSelector.d.ts +3 -0
  490. package/dist/types/utils/hash/getEventSelector.d.ts.map +1 -0
  491. package/dist/types/utils/hash/getFunctionSelector.d.ts +2 -0
  492. package/dist/types/utils/hash/getFunctionSelector.d.ts.map +1 -0
  493. package/dist/types/utils/hash/hashFunction.d.ts +2 -0
  494. package/dist/types/utils/hash/hashFunction.d.ts.map +1 -0
  495. package/dist/types/utils/hash/index.d.ts +5 -0
  496. package/dist/types/utils/hash/index.d.ts.map +1 -0
  497. package/dist/types/utils/hash/isHash.d.ts +3 -0
  498. package/dist/types/utils/hash/isHash.d.ts.map +1 -0
  499. package/dist/types/utils/hash/keccak256.d.ts +6 -0
  500. package/dist/types/utils/hash/keccak256.d.ts.map +1 -0
  501. package/dist/types/utils/index.d.ts +26 -0
  502. package/dist/types/utils/index.d.ts.map +1 -0
  503. package/dist/types/utils/observe.d.ts +17 -0
  504. package/dist/types/utils/observe.d.ts.map +1 -0
  505. package/dist/types/utils/poll.d.ts +13 -0
  506. package/dist/types/utils/poll.d.ts.map +1 -0
  507. package/dist/types/utils/promise/createBatchScheduler.d.ts +15 -0
  508. package/dist/types/utils/promise/createBatchScheduler.d.ts.map +1 -0
  509. package/dist/types/utils/promise/index.d.ts +5 -0
  510. package/dist/types/utils/promise/index.d.ts.map +1 -0
  511. package/dist/types/utils/promise/withCache.d.ts +36 -0
  512. package/dist/types/utils/promise/withCache.d.ts.map +1 -0
  513. package/dist/types/utils/promise/withRetry.d.ts +12 -0
  514. package/dist/types/utils/promise/withRetry.d.ts.map +1 -0
  515. package/dist/types/utils/promise/withTimeout.d.ts +8 -0
  516. package/dist/types/utils/promise/withTimeout.d.ts.map +1 -0
  517. package/dist/types/utils/regex.d.ts +4 -0
  518. package/dist/types/utils/regex.d.ts.map +1 -0
  519. package/dist/types/utils/rpc.d.ts +64 -0
  520. package/dist/types/utils/rpc.d.ts.map +1 -0
  521. package/dist/types/utils/signature/hashMessage.d.ts +6 -0
  522. package/dist/types/utils/signature/hashMessage.d.ts.map +1 -0
  523. package/dist/types/utils/signature/hashTypedData.d.ts +10 -0
  524. package/dist/types/utils/signature/hashTypedData.d.ts.map +1 -0
  525. package/dist/types/utils/signature/index.d.ts +16 -0
  526. package/dist/types/utils/signature/index.d.ts.map +1 -0
  527. package/dist/types/utils/signature/recoverAddress.d.ts +8 -0
  528. package/dist/types/utils/signature/recoverAddress.d.ts.map +1 -0
  529. package/dist/types/utils/signature/recoverMessageAddress.d.ts +8 -0
  530. package/dist/types/utils/signature/recoverMessageAddress.d.ts.map +1 -0
  531. package/dist/types/utils/signature/recoverPublicKey.d.ts +8 -0
  532. package/dist/types/utils/signature/recoverPublicKey.d.ts.map +1 -0
  533. package/dist/types/utils/signature/recoverTypedDataAddress.d.ts +12 -0
  534. package/dist/types/utils/signature/recoverTypedDataAddress.d.ts.map +1 -0
  535. package/dist/types/utils/signature/verifyMessage.d.ts +10 -0
  536. package/dist/types/utils/signature/verifyMessage.d.ts.map +1 -0
  537. package/dist/types/utils/signature/verifyTypedData.d.ts +13 -0
  538. package/dist/types/utils/signature/verifyTypedData.d.ts.map +1 -0
  539. package/dist/types/utils/stringify.d.ts +2 -0
  540. package/dist/types/utils/stringify.d.ts.map +1 -0
  541. package/dist/types/utils/transaction/assertRequest.d.ts +4 -0
  542. package/dist/types/utils/transaction/assertRequest.d.ts.map +1 -0
  543. package/dist/types/utils/transaction/assertTransaction.d.ts +5 -0
  544. package/dist/types/utils/transaction/assertTransaction.d.ts.map +1 -0
  545. package/dist/types/utils/transaction/getSerializedTransactionType.d.ts +4 -0
  546. package/dist/types/utils/transaction/getSerializedTransactionType.d.ts.map +1 -0
  547. package/dist/types/utils/transaction/getTransactionType.d.ts +4 -0
  548. package/dist/types/utils/transaction/getTransactionType.d.ts.map +1 -0
  549. package/dist/types/utils/transaction/index.d.ts +10 -0
  550. package/dist/types/utils/transaction/index.d.ts.map +1 -0
  551. package/dist/types/utils/transaction/parseTransaction.d.ts +5 -0
  552. package/dist/types/utils/transaction/parseTransaction.d.ts.map +1 -0
  553. package/dist/types/utils/transaction/prepareRequest.d.ts +21 -0
  554. package/dist/types/utils/transaction/prepareRequest.d.ts.map +1 -0
  555. package/dist/types/utils/transaction/serializeTransaction.d.ts +5 -0
  556. package/dist/types/utils/transaction/serializeTransaction.d.ts.map +1 -0
  557. package/dist/types/utils/typedData.d.ts +6 -0
  558. package/dist/types/utils/typedData.d.ts.map +1 -0
  559. package/dist/types/utils/uid.d.ts +2 -0
  560. package/dist/types/utils/uid.d.ts.map +1 -0
  561. package/dist/types/utils/unit/formatEther.d.ts +2 -0
  562. package/dist/types/utils/unit/formatEther.d.ts.map +1 -0
  563. package/dist/types/utils/unit/formatGwei.d.ts +2 -0
  564. package/dist/types/utils/unit/formatGwei.d.ts.map +1 -0
  565. package/dist/types/utils/unit/formatUnits.d.ts +2 -0
  566. package/dist/types/utils/unit/formatUnits.d.ts.map +1 -0
  567. package/dist/types/utils/unit/index.d.ts +7 -0
  568. package/dist/types/utils/unit/index.d.ts.map +1 -0
  569. package/dist/types/utils/unit/parseEther.d.ts +2 -0
  570. package/dist/types/utils/unit/parseEther.d.ts.map +1 -0
  571. package/dist/types/utils/unit/parseGwei.d.ts +2 -0
  572. package/dist/types/utils/unit/parseGwei.d.ts.map +1 -0
  573. package/dist/types/utils/unit/parseUnits.d.ts +2 -0
  574. package/dist/types/utils/unit/parseUnits.d.ts.map +1 -0
  575. package/dist/types/utils/wait.d.ts +2 -0
  576. package/dist/types/utils/wait.d.ts.map +1 -0
  577. package/dist/types/wallet.d.ts +3 -0
  578. package/dist/types/wallet.d.ts.map +1 -0
  579. package/dist/types/window.d.ts +2 -0
  580. package/dist/types/window.d.ts.map +1 -0
  581. package/package.json +1 -1
  582. package/src/errors/version.ts +1 -1
@@ -0,0 +1,1043 @@
1
+ import type { Abi, AbiEvent } from 'abitype';
2
+ import type { GetEnsAddressParameters, GetEnsAddressReturnType, GetEnsAvatarParameters, GetEnsAvatarReturnType, GetEnsNameParameters, GetEnsNameReturnType, GetEnsResolverParameters, GetEnsResolverReturnType, GetEnsTextParameters, GetEnsTextReturnType } from '../../actions/ens/index.js';
3
+ import type { CallParameters, CallReturnType, CreateBlockFilterReturnType, CreateContractEventFilterParameters, CreateContractEventFilterReturnType, CreateEventFilterParameters, CreateEventFilterReturnType, CreatePendingTransactionFilterReturnType, EstimateContractGasParameters, EstimateContractGasReturnType, EstimateGasParameters, EstimateGasReturnType, GetBalanceParameters, GetBalanceReturnType, GetBlockNumberParameters, GetBlockNumberReturnType, GetBlockParameters, GetBlockReturnType, GetBlockTransactionCountParameters, GetBlockTransactionCountReturnType, GetBytecodeParameters, GetBytecodeReturnType, GetChainIdReturnType, GetFeeHistoryParameters, GetFeeHistoryReturnType, GetFilterChangesParameters, GetFilterChangesReturnType, GetFilterLogsParameters, GetFilterLogsReturnType, GetGasPriceReturnType, GetLogsParameters, GetLogsReturnType, GetStorageAtParameters, GetStorageAtReturnType, GetTransactionConfirmationsParameters, GetTransactionConfirmationsReturnType, GetTransactionCountParameters, GetTransactionCountReturnType, GetTransactionParameters, GetTransactionReceiptParameters, GetTransactionReceiptReturnType, GetTransactionReturnType, MulticallParameters, MulticallReturnType, ReadContractParameters, ReadContractReturnType, SimulateContractParameters, SimulateContractReturnType, UninstallFilterParameters, UninstallFilterReturnType, WaitForTransactionReceiptParameters, WaitForTransactionReceiptReturnType, WatchBlockNumberParameters, WatchBlockNumberReturnType, WatchBlocksParameters, WatchBlocksReturnType, WatchContractEventParameters, WatchContractEventReturnType, WatchEventParameters, WatchEventReturnType, WatchPendingTransactionsParameters, WatchPendingTransactionsReturnType } from '../../actions/public/index.js';
4
+ import type { Chain, ContractFunctionConfig, FilterType, MaybeExtractEventArgsFromAbi } from '../../types/index.js';
5
+ import type { PublicClient } from '../createPublicClient.js';
6
+ import type { Transport } from '../transports/index.js';
7
+ export type PublicActions<TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined> = {
8
+ /**
9
+ * Executes a new message call immediately without submitting a transaction to the network.
10
+ *
11
+ * - Docs: https://viem.sh/docs/actions/public/call.html
12
+ * - JSON-RPC Methods: [`eth_call`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_call)
13
+ *
14
+ * @param args - {@link CallParameters}
15
+ * @returns The call data. {@link CallReturnType}
16
+ *
17
+ * @example
18
+ * import { createPublicClient, http } from 'viem'
19
+ * import { mainnet } from 'viem/chains'
20
+ *
21
+ * const client = createPublicClient({
22
+ * chain: mainnet,
23
+ * transport: http(),
24
+ * })
25
+ * const data = await client.call({
26
+ * account: '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266',
27
+ * data: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
28
+ * to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',
29
+ * })
30
+ */
31
+ call: (parameters: CallParameters<TChain>) => Promise<CallReturnType>;
32
+ /**
33
+ * Creates a Filter to listen for new block hashes that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges).
34
+ *
35
+ * - Docs: https://viem.sh/docs/actions/public/createBlockFilter.html
36
+ * - JSON-RPC Methods: [`eth_newBlockFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newBlockFilter)
37
+ *
38
+ * @returns Filter. {@link CreateBlockFilterReturnType}
39
+ *
40
+ * @example
41
+ * import { createPublicClient, createBlockFilter, http } from 'viem'
42
+ * import { mainnet } from 'viem/chains'
43
+ *
44
+ * const client = createPublicClient({
45
+ * chain: mainnet,
46
+ * transport: http(),
47
+ * })
48
+ * const filter = await createBlockFilter(client)
49
+ * // { id: "0x345a6572337856574a76364e457a4366", type: 'block' }
50
+ */
51
+ createBlockFilter: () => Promise<CreateBlockFilterReturnType>;
52
+ /**
53
+ * Creates a Filter to retrieve event logs that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges) or [`getFilterLogs`](https://viem.sh/docs/actions/public/getFilterLogs).
54
+ *
55
+ * - Docs: https://viem.sh/docs/contract/createContractEventFilter.html
56
+ *
57
+ * @param args - {@link CreateContractEventFilterParameters}
58
+ * @returns [`Filter`](https://viem.sh/docs/glossary/types.html#filter). {@link CreateContractEventFilterReturnType}
59
+ *
60
+ * @example
61
+ * import { createPublicClient, http, parseAbi } from 'viem'
62
+ * import { mainnet } from 'viem/chains'
63
+ *
64
+ * const client = createPublicClient({
65
+ * chain: mainnet,
66
+ * transport: http(),
67
+ * })
68
+ * const filter = await client.createContractEventFilter({
69
+ * abi: parseAbi(['event Transfer(address indexed, address indexed, uint256)']),
70
+ * })
71
+ */
72
+ createContractEventFilter: <TAbi extends Abi | readonly unknown[], TEventName extends string | undefined, TArgs extends MaybeExtractEventArgsFromAbi<TAbi, TEventName> | undefined>(args: CreateContractEventFilterParameters<TAbi, TEventName, TArgs>) => Promise<CreateContractEventFilterReturnType<TAbi, TEventName, TArgs>>;
73
+ /**
74
+ * Creates a [`Filter`](https://viem.sh/docs/glossary/types.html#filter) to listen for new events that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges).
75
+ *
76
+ * - Docs: https://viem.sh/docs/actions/public/createEventFilter.html
77
+ * - JSON-RPC Methods: [`eth_newFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newfilter)
78
+ *
79
+ * @param args - {@link CreateEventFilterParameters}
80
+ * @returns [`Filter`](https://viem.sh/docs/glossary/types.html#filter). {@link CreateEventFilterReturnType}
81
+ *
82
+ * @example
83
+ * import { createPublicClient, http } from 'viem'
84
+ * import { mainnet } from 'viem/chains'
85
+ *
86
+ * const client = createPublicClient({
87
+ * chain: mainnet,
88
+ * transport: http(),
89
+ * })
90
+ * const filter = await client.createEventFilter({
91
+ * address: '0xfba3912ca04dd458c843e2ee08967fc04f3579c2',
92
+ * })
93
+ */
94
+ createEventFilter: <TAbiEvent extends AbiEvent | undefined, TAbi extends Abi | readonly unknown[], TEventName extends string | undefined, TArgs extends MaybeExtractEventArgsFromAbi<TAbi, TEventName> | undefined>(args?: CreateEventFilterParameters<TAbiEvent, TAbi, TEventName, TArgs>) => Promise<CreateEventFilterReturnType<TAbiEvent, TAbi, TEventName, TArgs>>;
95
+ /**
96
+ * Creates a Filter to listen for new pending transaction hashes that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges).
97
+ *
98
+ * - Docs: https://viem.sh/docs/actions/public/createPendingTransactionFilter.html
99
+ * - JSON-RPC Methods: [`eth_newPendingTransactionFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newpendingtransactionfilter)
100
+ *
101
+ * @returns [`Filter`](https://viem.sh/docs/glossary/types.html#filter). {@link CreateBlockFilterReturnType}
102
+ *
103
+ * @example
104
+ * import { createPublicClient, http } from 'viem'
105
+ * import { mainnet } from 'viem/chains'
106
+ *
107
+ * const client = createPublicClient({
108
+ * chain: mainnet,
109
+ * transport: http(),
110
+ * })
111
+ * const filter = await client.createPendingTransactionFilter()
112
+ * // { id: "0x345a6572337856574a76364e457a4366", type: 'transaction' }
113
+ */
114
+ createPendingTransactionFilter: () => Promise<CreatePendingTransactionFilterReturnType>;
115
+ /**
116
+ * Estimates the gas required to successfully execute a contract write function call.
117
+ *
118
+ * - Docs: https://viem.sh/docs/contract/estimateContractGas.html
119
+ *
120
+ * @remarks
121
+ * Internally, uses a [Public Client](https://viem.sh/docs/clients/public) to call the [`estimateGas` action](https://viem.sh/docs/actions/public/estimateGas) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData).
122
+ *
123
+ * @param args - {@link EstimateContractGasParameters}
124
+ * @returns The gas estimate (in wei). {@link EstimateContractGasReturnType}
125
+ *
126
+ * @example
127
+ * import { createPublicClient, http, parseAbi } from 'viem'
128
+ * import { mainnet } from 'viem/chains'
129
+ *
130
+ * const client = createPublicClient({
131
+ * chain: mainnet,
132
+ * transport: http(),
133
+ * })
134
+ * const gas = await client.estimateContractGas({
135
+ * address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
136
+ * abi: parseAbi(['function mint() public']),
137
+ * functionName: 'mint',
138
+ * account: '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266',
139
+ * })
140
+ */
141
+ estimateContractGas: <TChain extends Chain | undefined, TAbi extends Abi | readonly unknown[], TFunctionName extends string>(args: EstimateContractGasParameters<TAbi, TFunctionName, TChain>) => Promise<EstimateContractGasReturnType>;
142
+ /**
143
+ * Estimates the gas necessary to complete a transaction without submitting it to the network.
144
+ *
145
+ * - Docs: https://viem.sh/docs/actions/public/estimateGas.html
146
+ * - JSON-RPC Methods: [`eth_estimateGas`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_estimategas)
147
+ *
148
+ * @param args - {@link EstimateGasParameters}
149
+ * @returns The gas estimate (in wei). {@link EstimateGasReturnType}
150
+ *
151
+ * @example
152
+ * import { createPublicClient, http, parseEther } from 'viem'
153
+ * import { mainnet } from 'viem/chains'
154
+ *
155
+ * const client = createPublicClient({
156
+ * chain: mainnet,
157
+ * transport: http(),
158
+ * })
159
+ * const gasEstimate = await client.estimateGas({
160
+ * account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',
161
+ * to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',
162
+ * value: parseEther('1'),
163
+ * })
164
+ */
165
+ estimateGas: (args: EstimateGasParameters<TChain>) => Promise<EstimateGasReturnType>;
166
+ /**
167
+ * Returns the balance of an address in wei.
168
+ *
169
+ * - Docs: https://viem.sh/docs/actions/public/getBalance.html
170
+ * - JSON-RPC Methods: [`eth_getBalance`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getbalance)
171
+ *
172
+ * @remarks
173
+ * You can convert the balance to ether units with [`formatEther`](https://viem.sh/docs/utilities/formatEther.html).
174
+ *
175
+ * ```ts
176
+ * const balance = await getBalance(client, {
177
+ * address: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',
178
+ * blockTag: 'safe'
179
+ * })
180
+ * const balanceAsEther = formatEther(balance)
181
+ * // "6.942"
182
+ * ```
183
+ *
184
+ * @param args - {@link GetBalanceParameters}
185
+ * @returns The balance of the address in wei. {@link GetBalanceReturnType}
186
+ *
187
+ * @example
188
+ * import { createPublicClient, http } from 'viem'
189
+ * import { mainnet } from 'viem/chains'
190
+ *
191
+ * const client = createPublicClient({
192
+ * chain: mainnet,
193
+ * transport: http(),
194
+ * })
195
+ * const balance = await client.getBalance({
196
+ * address: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',
197
+ * })
198
+ * // 10000000000000000000000n (wei)
199
+ */
200
+ getBalance: (args: GetBalanceParameters) => Promise<GetBalanceReturnType>;
201
+ /**
202
+ * Returns information about a block at a block number, hash, or tag.
203
+ *
204
+ * - Docs: https://viem.sh/docs/actions/public/getBlock.html
205
+ * - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/blocks/fetching-blocks
206
+ * - JSON-RPC Methods:
207
+ * - Calls [`eth_getBlockByNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblockbynumber) for `blockNumber` & `blockTag`.
208
+ * - Calls [`eth_getBlockByHash`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblockbyhash) for `blockHash`.
209
+ *
210
+ * @param args - {@link GetBlockParameters}
211
+ * @returns Information about the block. {@link GetBlockReturnType}
212
+ *
213
+ * @example
214
+ * import { createPublicClient, http } from 'viem'
215
+ * import { mainnet } from 'viem/chains'
216
+ *
217
+ * const client = createPublicClient({
218
+ * chain: mainnet,
219
+ * transport: http(),
220
+ * })
221
+ * const block = await client.getBlock()
222
+ */
223
+ getBlock: (args?: GetBlockParameters) => Promise<GetBlockReturnType<TChain>>;
224
+ /**
225
+ * Returns the number of the most recent block seen.
226
+ *
227
+ * - Docs: https://viem.sh/docs/actions/public/getBlockNumber.html
228
+ * - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/blocks/fetching-blocks
229
+ * - JSON-RPC Methods: [`eth_blockNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_blocknumber)
230
+ *
231
+ * @param args - {@link GetBlockNumberParameters}
232
+ * @returns The number of the block. {@link GetBlockNumberReturnType}
233
+ *
234
+ * @example
235
+ * import { createPublicClient, http } from 'viem'
236
+ * import { mainnet } from 'viem/chains'
237
+ *
238
+ * const client = createPublicClient({
239
+ * chain: mainnet,
240
+ * transport: http(),
241
+ * })
242
+ * const blockNumber = await client.getBlockNumber()
243
+ * // 69420n
244
+ */
245
+ getBlockNumber: (args?: GetBlockNumberParameters) => Promise<GetBlockNumberReturnType>;
246
+ /**
247
+ * Returns the number of Transactions at a block number, hash, or tag.
248
+ *
249
+ * - Docs: https://viem.sh/docs/actions/public/getBlockTransactionCount.html
250
+ * - JSON-RPC Methods:
251
+ * - Calls [`eth_getBlockTransactionCountByNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblocktransactioncountbynumber) for `blockNumber` & `blockTag`.
252
+ * - Calls [`eth_getBlockTransactionCountByHash`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblocktransactioncountbyhash) for `blockHash`.
253
+ *
254
+ * @param args - {@link GetBlockTransactionCountParameters}
255
+ * @returns The block transaction count. {@link GetBlockTransactionCountReturnType}
256
+ *
257
+ * @example
258
+ * import { createPublicClient, http } from 'viem'
259
+ * import { mainnet } from 'viem/chains'
260
+ *
261
+ * const client = createPublicClient({
262
+ * chain: mainnet,
263
+ * transport: http(),
264
+ * })
265
+ * const count = await client.getBlockTransactionCount()
266
+ */
267
+ getBlockTransactionCount: (args?: GetBlockTransactionCountParameters) => Promise<GetBlockTransactionCountReturnType>;
268
+ /**
269
+ * Retrieves the bytecode at an address.
270
+ *
271
+ * - Docs: https://viem.sh/docs/contract/getBytecode.html
272
+ * - JSON-RPC Methods: [`eth_getCode`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getcode)
273
+ *
274
+ * @param args - {@link GetBytecodeParameters}
275
+ * @returns The contract's bytecode. {@link GetBytecodeReturnType}
276
+ *
277
+ * @example
278
+ * import { createPublicClient, http } from 'viem'
279
+ * import { mainnet } from 'viem/chains'
280
+ *
281
+ * const client = createPublicClient({
282
+ * chain: mainnet,
283
+ * transport: http(),
284
+ * })
285
+ * const code = await client.getBytecode({
286
+ * address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
287
+ * })
288
+ */
289
+ getBytecode: (args: GetBytecodeParameters) => Promise<GetBytecodeReturnType>;
290
+ /**
291
+ * Returns the chain ID associated with the current network.
292
+ *
293
+ * - Docs: https://viem.sh/docs/actions/public/getChainId.html
294
+ * - JSON-RPC Methods: [`eth_chainId`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_chainid)
295
+ *
296
+ * @returns The current chain ID. {@link GetChainIdReturnType}
297
+ *
298
+ * @example
299
+ * import { createPublicClient, http } from 'viem'
300
+ * import { mainnet } from 'viem/chains'
301
+ *
302
+ * const client = createPublicClient({
303
+ * chain: mainnet,
304
+ * transport: http(),
305
+ * })
306
+ * const chainId = await client.getChainId()
307
+ * // 1
308
+ */
309
+ getChainId: () => Promise<GetChainIdReturnType>;
310
+ /**
311
+ * Gets address for ENS name.
312
+ *
313
+ * - Docs: https://viem.sh/docs/ens/actions/getEnsAddress.html
314
+ * - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/ens
315
+ *
316
+ * @remarks
317
+ * Calls `resolve(bytes, bytes)` on ENS Universal Resolver Contract.
318
+ *
319
+ * Since ENS names prohibit certain forbidden characters (e.g. underscore) and have other validation rules, you likely want to [normalize ENS names](https://docs.ens.domains/contract-api-reference/name-processing#normalising-names) with [UTS-46 normalization](https://unicode.org/reports/tr46) before passing them to `getEnsAddress`. You can use the built-in [`normalize`](https://viem.sh/docs/ens/utilities/normalize.html) function for this.
320
+ *
321
+ * @param args - {@link GetEnsAddressParameters}
322
+ * @returns Address for ENS name or `null` if not found. {@link GetEnsAddressReturnType}
323
+ *
324
+ * @example
325
+ * import { createPublicClient, http } from 'viem'
326
+ * import { mainnet } from 'viem/chains'
327
+ * import { normalize } from 'viem/ens'
328
+ *
329
+ * const client = createPublicClient({
330
+ * chain: mainnet,
331
+ * transport: http(),
332
+ * })
333
+ * const ensAddress = await client.getEnsAddress({
334
+ * name: normalize('wagmi-dev.eth'),
335
+ * })
336
+ * // '0xd2135CfB216b74109775236E36d4b433F1DF507B'
337
+ */
338
+ getEnsAddress: (args: GetEnsAddressParameters) => Promise<GetEnsAddressReturnType>;
339
+ /**
340
+ * Gets the avatar of an ENS name.
341
+ *
342
+ * - Docs: https://viem.sh/docs/ens/actions/getEnsAvatar.html
343
+ * - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/ens
344
+ *
345
+ * @remarks
346
+ * Calls [`getEnsText`](https://viem.sh/docs/ens/actions/getEnsText.html) with `key` set to `'avatar'`.
347
+ *
348
+ * Since ENS names prohibit certain forbidden characters (e.g. underscore) and have other validation rules, you likely want to [normalize ENS names](https://docs.ens.domains/contract-api-reference/name-processing#normalising-names) with [UTS-46 normalization](https://unicode.org/reports/tr46) before passing them to `getEnsAddress`. You can use the built-in [`normalize`](https://viem.sh/docs/ens/utilities/normalize.html) function for this.
349
+ *
350
+ * @param args - {@link GetEnsAvatarParameters}
351
+ * @returns Avatar URI or `null` if not found. {@link GetEnsAvatarReturnType}
352
+ *
353
+ * @example
354
+ * import { createPublicClient, http } from 'viem'
355
+ * import { mainnet } from 'viem/chains'
356
+ * import { normalize } from 'viem/ens'
357
+ *
358
+ * const client = createPublicClient({
359
+ * chain: mainnet,
360
+ * transport: http(),
361
+ * })
362
+ * const ensAvatar = await client.getEnsAvatar({
363
+ * name: normalize('wagmi-dev.eth'),
364
+ * })
365
+ * // 'https://ipfs.io/ipfs/Qma8mnp6xV3J2cRNf3mTth5C8nV11CAnceVinc3y8jSbio'
366
+ */
367
+ getEnsAvatar: (args: GetEnsAvatarParameters) => Promise<GetEnsAvatarReturnType>;
368
+ /**
369
+ * Gets primary name for specified address.
370
+ *
371
+ * - Docs: https://viem.sh/docs/ens/actions/getEnsName.html
372
+ * - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/ens
373
+ *
374
+ * @remarks
375
+ * Calls `reverse(bytes)` on ENS Universal Resolver Contract to "reverse resolve" the address to the primary ENS name.
376
+ *
377
+ * @param args - {@link GetEnsNameParameters}
378
+ * @returns Name or `null` if not found. {@link GetEnsNameReturnType}
379
+ *
380
+ * @example
381
+ * import { createPublicClient, http } from 'viem'
382
+ * import { mainnet } from 'viem/chains'
383
+ *
384
+ * const client = createPublicClient({
385
+ * chain: mainnet,
386
+ * transport: http(),
387
+ * })
388
+ * const ensName = await client.getEnsName({
389
+ * address: '0xd2135CfB216b74109775236E36d4b433F1DF507B',
390
+ * })
391
+ * // 'wagmi-dev.eth'
392
+ */
393
+ getEnsName: (args: GetEnsNameParameters) => Promise<GetEnsNameReturnType>;
394
+ /**
395
+ * Gets resolver for ENS name.
396
+ *
397
+ * - Docs: https://viem.sh/docs/ens/actions/getEnsResolver.html
398
+ * - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/ens
399
+ *
400
+ * @remarks
401
+ * Calls `findResolver(bytes)` on ENS Universal Resolver Contract to retrieve the resolver of an ENS name.
402
+ *
403
+ * Since ENS names prohibit certain forbidden characters (e.g. underscore) and have other validation rules, you likely want to [normalize ENS names](https://docs.ens.domains/contract-api-reference/name-processing#normalising-names) with [UTS-46 normalization](https://unicode.org/reports/tr46) before passing them to `getEnsAddress`. You can use the built-in [`normalize`](https://viem.sh/docs/ens/utilities/normalize.html) function for this.
404
+ *
405
+ * @param args - {@link GetEnsResolverParameters}
406
+ * @returns Address for ENS resolver. {@link GetEnsResolverReturnType}
407
+ *
408
+ * @example
409
+ * import { createPublicClient, http } from 'viem'
410
+ * import { mainnet } from 'viem/chains'
411
+ * import { normalize } from 'viem/ens'
412
+ *
413
+ * const client = createPublicClient({
414
+ * chain: mainnet,
415
+ * transport: http(),
416
+ * })
417
+ * const resolverAddress = await client.getEnsResolver({
418
+ * name: normalize('wagmi-dev.eth'),
419
+ * })
420
+ * // '0x4976fb03C32e5B8cfe2b6cCB31c09Ba78EBaBa41'
421
+ */
422
+ getEnsResolver: (args: GetEnsResolverParameters) => Promise<GetEnsResolverReturnType>;
423
+ /**
424
+ * Gets a text record for specified ENS name.
425
+ *
426
+ * - Docs: https://viem.sh/docs/ens/actions/getEnsResolver.html
427
+ * - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/ens
428
+ *
429
+ * @remarks
430
+ * Calls `resolve(bytes, bytes)` on ENS Universal Resolver Contract.
431
+ *
432
+ * Since ENS names prohibit certain forbidden characters (e.g. underscore) and have other validation rules, you likely want to [normalize ENS names](https://docs.ens.domains/contract-api-reference/name-processing#normalising-names) with [UTS-46 normalization](https://unicode.org/reports/tr46) before passing them to `getEnsAddress`. You can use the built-in [`normalize`](https://viem.sh/docs/ens/utilities/normalize.html) function for this.
433
+ *
434
+ * @param args - {@link GetEnsTextParameters}
435
+ * @returns Address for ENS resolver. {@link GetEnsTextReturnType}
436
+ *
437
+ * @example
438
+ * import { createPublicClient, http } from 'viem'
439
+ * import { mainnet } from 'viem/chains'
440
+ * import { normalize } from 'viem/ens'
441
+ *
442
+ * const client = createPublicClient({
443
+ * chain: mainnet,
444
+ * transport: http(),
445
+ * })
446
+ * const twitterRecord = await client.getEnsText({
447
+ * name: normalize('wagmi-dev.eth'),
448
+ * key: 'com.twitter',
449
+ * })
450
+ * // 'wagmi_sh'
451
+ */
452
+ getEnsText: (args: GetEnsTextParameters) => Promise<GetEnsTextReturnType>;
453
+ /**
454
+ * Returns a collection of historical gas information.
455
+ *
456
+ * - Docs: https://viem.sh/docs/actions/public/getFeeHistory.html
457
+ * - JSON-RPC Methods: [`eth_feeHistory`](https://docs.alchemy.com/reference/eth-feehistory)
458
+ *
459
+ * @param args - {@link GetFeeHistoryParameters}
460
+ * @returns The gas estimate (in wei). {@link GetFeeHistoryReturnType}
461
+ *
462
+ * @example
463
+ * import { createPublicClient, http } from 'viem'
464
+ * import { mainnet } from 'viem/chains'
465
+ *
466
+ * const client = createPublicClient({
467
+ * chain: mainnet,
468
+ * transport: http(),
469
+ * })
470
+ * const feeHistory = await client.getFeeHistory({
471
+ * blockCount: 4,
472
+ * rewardPercentiles: [25, 75],
473
+ * })
474
+ */
475
+ getFeeHistory: (args: GetFeeHistoryParameters) => Promise<GetFeeHistoryReturnType>;
476
+ /**
477
+ * Returns a list of logs or hashes based on a [Filter](/docs/glossary/terms#filter) since the last time it was called.
478
+ *
479
+ * - Docs: https://viem.sh/docs/actions/public/getFilterChanges.html
480
+ * - JSON-RPC Methods: [`eth_getFilterChanges`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getfilterchanges)
481
+ *
482
+ * @remarks
483
+ * A Filter can be created from the following actions:
484
+ *
485
+ * - [`createBlockFilter`](https://viem.sh/docs/actions/public/createBlockFilter)
486
+ * - [`createContractEventFilter`](https://viem.sh/docs/contract/createContractEventFilter)
487
+ * - [`createEventFilter`](https://viem.sh/docs/actions/public/createEventFilter)
488
+ * - [`createPendingTransactionFilter`](https://viem.sh/docs/actions/public/createPendingTransactionFilter)
489
+ *
490
+ * Depending on the type of filter, the return value will be different:
491
+ *
492
+ * - If the filter was created with `createContractEventFilter` or `createEventFilter`, it returns a list of logs.
493
+ * - If the filter was created with `createPendingTransactionFilter`, it returns a list of transaction hashes.
494
+ * - If the filter was created with `createBlockFilter`, it returns a list of block hashes.
495
+ *
496
+ * @param args - {@link GetFilterChangesParameters}
497
+ * @returns Logs or hashes. {@link GetFilterChangesReturnType}
498
+ *
499
+ * @example
500
+ * // Blocks
501
+ * import { createPublicClient, http } from 'viem'
502
+ * import { mainnet } from 'viem/chains'
503
+ *
504
+ * const client = createPublicClient({
505
+ * chain: mainnet,
506
+ * transport: http(),
507
+ * })
508
+ * const filter = await client.createBlockFilter()
509
+ * const hashes = await client.getFilterChanges({ filter })
510
+ *
511
+ * @example
512
+ * // Contract Events
513
+ * import { createPublicClient, http, parseAbi } from 'viem'
514
+ * import { mainnet } from 'viem/chains'
515
+ *
516
+ * const client = createPublicClient({
517
+ * chain: mainnet,
518
+ * transport: http(),
519
+ * })
520
+ * const filter = await client.createContractEventFilter({
521
+ * address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
522
+ * abi: parseAbi(['event Transfer(address indexed, address indexed, uint256)']),
523
+ * eventName: 'Transfer',
524
+ * })
525
+ * const logs = await client.getFilterChanges({ filter })
526
+ *
527
+ * @example
528
+ * // Raw Events
529
+ * import { createPublicClient, http, parseAbiItem } from 'viem'
530
+ * import { mainnet } from 'viem/chains'
531
+ *
532
+ * const client = createPublicClient({
533
+ * chain: mainnet,
534
+ * transport: http(),
535
+ * })
536
+ * const filter = await client.createEventFilter({
537
+ * address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
538
+ * event: parseAbiItem('event Transfer(address indexed, address indexed, uint256)'),
539
+ * })
540
+ * const logs = await client.getFilterChanges({ filter })
541
+ *
542
+ * @example
543
+ * // Transactions
544
+ * import { createPublicClient, http } from 'viem'
545
+ * import { mainnet } from 'viem/chains'
546
+ *
547
+ * const client = createPublicClient({
548
+ * chain: mainnet,
549
+ * transport: http(),
550
+ * })
551
+ * const filter = await client.createPendingTransactionFilter()
552
+ * const hashes = await client.getFilterChanges({ filter })
553
+ */
554
+ getFilterChanges: <TFilterType extends FilterType, TAbiEvent extends AbiEvent | undefined, TAbi extends Abi | readonly unknown[], TEventName extends string | undefined>(args: GetFilterChangesParameters<TFilterType, TAbiEvent, TAbi, TEventName>) => Promise<GetFilterChangesReturnType<TFilterType, TAbiEvent, TAbi, TEventName>>;
555
+ /**
556
+ * Returns a list of event logs since the filter was created.
557
+ *
558
+ * - Docs: https://viem.sh/docs/actions/public/getFilterLogs.html
559
+ * - JSON-RPC Methods: [`eth_getFilterLogs`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getfilterlogs)
560
+ *
561
+ * @remarks
562
+ * `getFilterLogs` is only compatible with **event filters**.
563
+ *
564
+ * @param args - {@link GetFilterLogsParameters}
565
+ * @returns A list of event logs. {@link GetFilterLogsReturnType}
566
+ *
567
+ * @example
568
+ * import { createPublicClient, http, parseAbiItem } from 'viem'
569
+ * import { mainnet } from 'viem/chains'
570
+ *
571
+ * const client = createPublicClient({
572
+ * chain: mainnet,
573
+ * transport: http(),
574
+ * })
575
+ * const filter = await client.createEventFilter({
576
+ * address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
577
+ * event: parseAbiItem('event Transfer(address indexed, address indexed, uint256)'),
578
+ * })
579
+ * const logs = await client.getFilterLogs({ filter })
580
+ */
581
+ getFilterLogs: <TAbiEvent extends AbiEvent | undefined, TAbi extends Abi | readonly unknown[], TEventName extends string | undefined>(args: GetFilterLogsParameters<TAbiEvent, TAbi, TEventName>) => Promise<GetFilterLogsReturnType<TAbiEvent, TAbi, TEventName>>;
582
+ /**
583
+ * Returns the current price of gas (in wei).
584
+ *
585
+ * - Docs: https://viem.sh/docs/actions/public/getGasPrice.html
586
+ * - JSON-RPC Methods: [`eth_gasPrice`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_gasprice)
587
+ *
588
+ * @returns The gas price (in wei). {@link GetGasPriceReturnType}
589
+ *
590
+ * @example
591
+ * import { createPublicClient, http } from 'viem'
592
+ * import { mainnet } from 'viem/chains'
593
+ *
594
+ * const client = createPublicClient({
595
+ * chain: mainnet,
596
+ * transport: http(),
597
+ * })
598
+ * const gasPrice = await client.getGasPrice()
599
+ */
600
+ getGasPrice: () => Promise<GetGasPriceReturnType>;
601
+ /**
602
+ * Returns a list of event logs matching the provided parameters.
603
+ *
604
+ * - Docs: https://viem.sh/docs/actions/public/getLogs.html
605
+ * - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/filters-and-logs/event-logs
606
+ * - JSON-RPC Methods: [`eth_getLogs`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getlogs)
607
+ *
608
+ * @param args - {@link GetLogsParameters}
609
+ * @returns A list of event logs. {@link GetLogsReturnType}
610
+ *
611
+ * @example
612
+ * import { createPublicClient, http, parseAbiItem } from 'viem'
613
+ * import { mainnet } from 'viem/chains'
614
+ *
615
+ * const client = createPublicClient({
616
+ * chain: mainnet,
617
+ * transport: http(),
618
+ * })
619
+ * const logs = await client.getLogs()
620
+ */
621
+ getLogs: <TAbiEvent extends AbiEvent | undefined>(args?: GetLogsParameters<TAbiEvent>) => Promise<GetLogsReturnType<TAbiEvent>>;
622
+ /**
623
+ * Returns the value from a storage slot at a given address.
624
+ *
625
+ * - Docs: https://viem.sh/docs/contract/getStorageAt.html
626
+ * - JSON-RPC Methods: [`eth_getStorageAt`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getstorageat)
627
+ *
628
+ * @param args - {@link GetStorageAtParameters}
629
+ * @returns The value of the storage slot. {@link GetStorageAtReturnType}
630
+ *
631
+ * @example
632
+ * import { createPublicClient, http } from 'viem'
633
+ * import { mainnet } from 'viem/chains'
634
+ * import { getStorageAt } from 'viem/contract'
635
+ *
636
+ * const client = createPublicClient({
637
+ * chain: mainnet,
638
+ * transport: http(),
639
+ * })
640
+ * const code = await client.getStorageAt({
641
+ * address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
642
+ * slot: toHex(0),
643
+ * })
644
+ */
645
+ getStorageAt: (args: GetStorageAtParameters) => Promise<GetStorageAtReturnType>;
646
+ /**
647
+ * Returns information about a [Transaction](https://viem.sh/docs/glossary/terms#transaction) given a hash or block identifier.
648
+ *
649
+ * - Docs: https://viem.sh/docs/actions/public/getTransaction.html
650
+ * - Example: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/transactions/fetching-transactions
651
+ * - JSON-RPC Methods: [`eth_getTransactionByHash`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getTransactionByHash)
652
+ *
653
+ * @param args - {@link GetTransactionParameters}
654
+ * @returns The transaction information. {@link GetTransactionReturnType}
655
+ *
656
+ * @example
657
+ * import { createPublicClient, http } from 'viem'
658
+ * import { mainnet } from 'viem/chains'
659
+ *
660
+ * const client = createPublicClient({
661
+ * chain: mainnet,
662
+ * transport: http(),
663
+ * })
664
+ * const transaction = await client.getTransaction({
665
+ * hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d',
666
+ * })
667
+ */
668
+ getTransaction: (args: GetTransactionParameters) => Promise<GetTransactionReturnType<TChain>>;
669
+ /**
670
+ * Returns the number of blocks passed (confirmations) since the transaction was processed on a block.
671
+ *
672
+ * - Docs: https://viem.sh/docs/actions/public/getTransactionConfirmations.html
673
+ * - Example: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/transactions/fetching-transactions
674
+ * - JSON-RPC Methods: [`eth_getTransactionConfirmations`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getTransactionConfirmations)
675
+ *
676
+ * @param args - {@link GetTransactionConfirmationsParameters}
677
+ * @returns The number of blocks passed since the transaction was processed. If confirmations is 0, then the Transaction has not been confirmed & processed yet. {@link GetTransactionConfirmationsReturnType}
678
+ *
679
+ * @example
680
+ * import { createPublicClient, http } from 'viem'
681
+ * import { mainnet } from 'viem/chains'
682
+ *
683
+ * const client = createPublicClient({
684
+ * chain: mainnet,
685
+ * transport: http(),
686
+ * })
687
+ * const confirmations = await client.getTransactionConfirmations({
688
+ * hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d',
689
+ * })
690
+ */
691
+ getTransactionConfirmations: (args: GetTransactionConfirmationsParameters<TChain>) => Promise<GetTransactionConfirmationsReturnType>;
692
+ /**
693
+ * Returns the number of [Transactions](https://viem.sh/docs/glossary/terms#transaction) an Account has broadcast / sent.
694
+ *
695
+ * - Docs: https://viem.sh/docs/actions/public/getTransactionCount.html
696
+ * - JSON-RPC Methods: [`eth_getTransactionCount`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_gettransactioncount)
697
+ *
698
+ * @param args - {@link GetTransactionCountParameters}
699
+ * @returns The number of transactions an account has sent. {@link GetTransactionCountReturnType}
700
+ *
701
+ * @example
702
+ * import { createPublicClient, http } from 'viem'
703
+ * import { mainnet } from 'viem/chains'
704
+ *
705
+ * const client = createPublicClient({
706
+ * chain: mainnet,
707
+ * transport: http(),
708
+ * })
709
+ * const transactionCount = await client.getTransactionCount({
710
+ * address: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',
711
+ * })
712
+ */
713
+ getTransactionCount: (args: GetTransactionCountParameters) => Promise<GetTransactionCountReturnType>;
714
+ /**
715
+ * Returns the [Transaction Receipt](https://viem.sh/docs/glossary/terms#transaction-receipt) given a [Transaction](https://viem.sh/docs/glossary/terms#transaction) hash.
716
+ *
717
+ * - Docs: https://viem.sh/docs/actions/public/getTransactionReceipt.html
718
+ * - Example: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/transactions/fetching-transactions
719
+ * - JSON-RPC Methods: [`eth_getTransactionReceipt`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getTransactionReceipt)
720
+ *
721
+ * @param args - {@link GetTransactionReceiptParameters}
722
+ * @returns The transaction receipt. {@link GetTransactionReceiptReturnType}
723
+ *
724
+ * @example
725
+ * import { createPublicClient, http } from 'viem'
726
+ * import { mainnet } from 'viem/chains'
727
+ *
728
+ * const client = createPublicClient({
729
+ * chain: mainnet,
730
+ * transport: http(),
731
+ * })
732
+ * const transactionReceipt = await client.getTransactionReceipt({
733
+ * hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d',
734
+ * })
735
+ */
736
+ getTransactionReceipt: (args: GetTransactionReceiptParameters) => Promise<GetTransactionReceiptReturnType<TChain>>;
737
+ /**
738
+ * Similar to [`readContract`](https://viem.sh/docs/contract/readContract), but batches up multiple functions on a contract in a single RPC call via the [`multicall3` contract](https://github.com/mds1/multicall).
739
+ *
740
+ * - Docs: https://viem.sh/docs/contract/multicall.html
741
+ *
742
+ * @param args - {@link MulticallParameters}
743
+ * @returns An array of results with accompanying status. {@link MulticallReturnType}
744
+ *
745
+ * @example
746
+ * import { createPublicClient, http, parseAbi } from 'viem'
747
+ * import { mainnet } from 'viem/chains'
748
+ *
749
+ * const client = createPublicClient({
750
+ * chain: mainnet,
751
+ * transport: http(),
752
+ * })
753
+ * const abi = parseAbi([
754
+ * 'function balanceOf(address) view returns (uint256)',
755
+ * 'function totalSupply() view returns (uint256)',
756
+ * ])
757
+ * const result = await client.multicall({
758
+ * contracts: [
759
+ * {
760
+ * address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
761
+ * abi,
762
+ * functionName: 'balanceOf',
763
+ * args: ['0xA0Cf798816D4b9b9866b5330EEa46a18382f251e'],
764
+ * },
765
+ * {
766
+ * address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
767
+ * abi,
768
+ * functionName: 'totalSupply',
769
+ * },
770
+ * ],
771
+ * })
772
+ * // [{ result: 424122n, status: 'success' }, { result: 1000000n, status: 'success' }]
773
+ */
774
+ multicall: <TContracts extends ContractFunctionConfig[], TAllowFailure extends boolean = true>(args: MulticallParameters<TContracts, TAllowFailure>) => Promise<MulticallReturnType<TContracts, TAllowFailure>>;
775
+ /**
776
+ * Calls a read-only function on a contract, and returns the response.
777
+ *
778
+ * - Docs: https://viem.sh/docs/contract/readContract.html
779
+ * - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/contracts/reading-contracts
780
+ *
781
+ * @remarks
782
+ * A "read-only" function (constant function) on a Solidity contract is denoted by a `view` or `pure` keyword. They can only read the state of the contract, and cannot make any changes to it. Since read-only methods do not change the state of the contract, they do not require any gas to be executed, and can be called by any user without the need to pay for gas.
783
+ *
784
+ * Internally, uses a [Public Client](https://viem.sh/docs/clients/public) to call the [`call` action](https://viem.sh/docs/actions/public/call) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData).
785
+ *
786
+ * @param args - {@link ReadContractParameters}
787
+ * @returns The response from the contract. Type is inferred. {@link ReadContractReturnType}
788
+ *
789
+ * @example
790
+ * import { createPublicClient, http, parseAbi } from 'viem'
791
+ * import { mainnet } from 'viem/chains'
792
+ * import { readContract } from 'viem/contract'
793
+ *
794
+ * const client = createPublicClient({
795
+ * chain: mainnet,
796
+ * transport: http(),
797
+ * })
798
+ * const result = await client.readContract({
799
+ * address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
800
+ * abi: parseAbi(['function balanceOf(address) view returns (uint256)']),
801
+ * functionName: 'balanceOf',
802
+ * args: ['0xA0Cf798816D4b9b9866b5330EEa46a18382f251e'],
803
+ * })
804
+ * // 424122n
805
+ */
806
+ readContract: <TAbi extends Abi | readonly unknown[], TFunctionName extends string>(args: ReadContractParameters<TAbi, TFunctionName>) => Promise<ReadContractReturnType<TAbi, TFunctionName>>;
807
+ /**
808
+ * Simulates/validates a contract interaction. This is useful for retrieving **return data** and **revert reasons** of contract write functions.
809
+ *
810
+ * - Docs: https://viem.sh/docs/contract/simulateContract.html
811
+ * - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/contracts/writing-to-contracts
812
+ *
813
+ * @remarks
814
+ * This function does not require gas to execute and _**does not**_ change the state of the blockchain. It is almost identical to [`readContract`](https://viem.sh/docs/contract/readContract), but also supports contract write functions.
815
+ *
816
+ * Internally, uses a [Public Client](https://viem.sh/docs/clients/public) to call the [`call` action](https://viem.sh/docs/actions/public/call) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData).
817
+ *
818
+ * @param args - {@link SimulateContractParameters}
819
+ * @returns The simulation result and write request. {@link SimulateContractReturnType}
820
+ *
821
+ * @example
822
+ * import { createPublicClient, http } from 'viem'
823
+ * import { mainnet } from 'viem/chains'
824
+ *
825
+ * const client = createPublicClient({
826
+ * chain: mainnet,
827
+ * transport: http(),
828
+ * })
829
+ * const result = await client.simulateContract({
830
+ * address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
831
+ * abi: parseAbi(['function mint(uint32) view returns (uint32)']),
832
+ * functionName: 'mint',
833
+ * args: ['69420'],
834
+ * account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',
835
+ * })
836
+ */
837
+ simulateContract: <TAbi extends Abi | readonly unknown[] = Abi, TFunctionName extends string = any, TChainOverride extends Chain | undefined = undefined>(args: SimulateContractParameters<TAbi, TFunctionName, TChain, TChainOverride>) => Promise<SimulateContractReturnType<TAbi, TFunctionName, TChain, TChainOverride>>;
838
+ /**
839
+ * Destroys a Filter that was created from one of the following Actions:
840
+ *
841
+ * - [`createBlockFilter`](https://viem.sh/docs/actions/public/createBlockFilter)
842
+ * - [`createEventFilter`](https://viem.sh/docs/actions/public/createEventFilter)
843
+ * - [`createPendingTransactionFilter`](https://viem.sh/docs/actions/public/createPendingTransactionFilter)
844
+ *
845
+ * - Docs: https://viem.sh/docs/actions/public/uninstallFilter.html
846
+ * - JSON-RPC Methods: [`eth_uninstallFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_uninstallFilter)
847
+ *
848
+ * @param args - {@link UninstallFilterParameters}
849
+ * @returns A boolean indicating if the Filter was successfully uninstalled. {@link UninstallFilterReturnType}
850
+ *
851
+ * @example
852
+ * import { createPublicClient, http } from 'viem'
853
+ * import { mainnet } from 'viem/chains'
854
+ * import { createPendingTransactionFilter, uninstallFilter } from 'viem/public'
855
+ *
856
+ * const filter = await client.createPendingTransactionFilter()
857
+ * const uninstalled = await client.uninstallFilter({ filter })
858
+ * // true
859
+ */
860
+ uninstallFilter: (args: UninstallFilterParameters) => Promise<UninstallFilterReturnType>;
861
+ /**
862
+ * Waits for the [Transaction](https://viem.sh/docs/glossary/terms.html#transaction) to be included on a [Block](https://viem.sh/docs/glossary/terms.html#block) (one confirmation), and then returns the [Transaction Receipt](https://viem.sh/docs/glossary/terms.html#transaction-receipt). If the Transaction reverts, then the action will throw an error.
863
+ *
864
+ * - Docs: https://viem.sh/docs/actions/public/waitForTransactionReceipt.html
865
+ * - Example: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/transactions/sending-transactions
866
+ * - JSON-RPC Methods:
867
+ * - Polls [`eth_getTransactionReceipt`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getTransactionReceipt) on each block until it has been processed.
868
+ * - If a Transaction has been replaced:
869
+ * - Calls [`eth_getBlockByNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblockbynumber) and extracts the transactions
870
+ * - Checks if one of the Transactions is a replacement
871
+ * - If so, calls [`eth_getTransactionReceipt`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getTransactionReceipt).
872
+ *
873
+ * @remarks
874
+ * The `waitForTransactionReceipt` action additionally supports Replacement detection (e.g. sped up Transactions).
875
+ *
876
+ * Transactions can be replaced when a user modifies their transaction in their wallet (to speed up or cancel). Transactions are replaced when they are sent from the same nonce.
877
+ *
878
+ * There are 3 types of Transaction Replacement reasons:
879
+ *
880
+ * - `repriced`: The gas price has been modified (e.g. different `maxFeePerGas`)
881
+ * - `cancelled`: The Transaction has been cancelled (e.g. `value === 0n`)
882
+ * - `replaced`: The Transaction has been replaced (e.g. different `value` or `data`)
883
+ *
884
+ * @param args - {@link WaitForTransactionReceiptParameters}
885
+ * @returns The transaction receipt. {@link WaitForTransactionReceiptReturnType}
886
+ *
887
+ * @example
888
+ * import { createPublicClient, http } from 'viem'
889
+ * import { mainnet } from 'viem/chains'
890
+ *
891
+ * const client = createPublicClient({
892
+ * chain: mainnet,
893
+ * transport: http(),
894
+ * })
895
+ * const transactionReceipt = await client.waitForTransactionReceipt({
896
+ * hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d',
897
+ * })
898
+ */
899
+ waitForTransactionReceipt: (args: WaitForTransactionReceiptParameters<TChain>) => Promise<WaitForTransactionReceiptReturnType<TChain>>;
900
+ /**
901
+ * Watches and returns incoming block numbers.
902
+ *
903
+ * - Docs: https://viem.sh/docs/actions/public/watchBlockNumber.html
904
+ * - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/blocks/watching-blocks
905
+ * - JSON-RPC Methods:
906
+ * - When `poll: true`, calls [`eth_blockNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_blocknumber) on a polling interval.
907
+ * - When `poll: false` & WebSocket Transport, uses a WebSocket subscription via [`eth_subscribe`](https://docs.alchemy.com/reference/eth-subscribe-polygon) and the `"newHeads"` event.
908
+ *
909
+ * @param args - {@link WatchBlockNumberParameters}
910
+ * @returns A function that can be invoked to stop watching for new block numbers. {@link WatchBlockNumberReturnType}
911
+ *
912
+ * @example
913
+ * import { createPublicClient, http } from 'viem'
914
+ * import { mainnet } from 'viem/chains'
915
+ *
916
+ * const client = createPublicClient({
917
+ * chain: mainnet,
918
+ * transport: http(),
919
+ * })
920
+ * const unwatch = await client.watchBlockNumber({
921
+ * onBlockNumber: (blockNumber) => console.log(blockNumber),
922
+ * })
923
+ */
924
+ watchBlockNumber: (args: WatchBlockNumberParameters) => WatchBlockNumberReturnType;
925
+ /**
926
+ * Watches and returns information for incoming blocks.
927
+ *
928
+ * - Docs: https://viem.sh/docs/actions/public/watchBlocks.html
929
+ * - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/blocks/watching-blocks
930
+ * - JSON-RPC Methods:
931
+ * - When `poll: true`, calls [`eth_getBlockByNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getBlockByNumber) on a polling interval.
932
+ * - When `poll: false` & WebSocket Transport, uses a WebSocket subscription via [`eth_subscribe`](https://docs.alchemy.com/reference/eth-subscribe-polygon) and the `"newHeads"` event.
933
+ *
934
+ * @param args - {@link WatchBlocksParameters}
935
+ * @returns A function that can be invoked to stop watching for new block numbers. {@link WatchBlocksReturnType}
936
+ *
937
+ * @example
938
+ * import { createPublicClient, http } from 'viem'
939
+ * import { mainnet } from 'viem/chains'
940
+ *
941
+ * const client = createPublicClient({
942
+ * chain: mainnet,
943
+ * transport: http(),
944
+ * })
945
+ * const unwatch = await client.watchBlocks({
946
+ * onBlock: (block) => console.log(block),
947
+ * })
948
+ */
949
+ watchBlocks: (args: WatchBlocksParameters<TTransport, TChain>) => WatchBlocksReturnType;
950
+ /**
951
+ * Watches and returns emitted contract event logs.
952
+ *
953
+ * - Docs: https://viem.sh/docs/contract/watchContractEvent.html
954
+ *
955
+ * @remarks
956
+ * This Action will batch up all the event logs found within the [`pollingInterval`](https://viem.sh/docs/contract/watchContractEvent.html#pollinginterval-optional), and invoke them via [`onLogs`](https://viem.sh/docs/contract/watchContractEvent.html#onLogs).
957
+ *
958
+ * `watchContractEvent` will attempt to create an [Event Filter](https://viem.sh/docs/contract/createContractEventFilter) and listen to changes to the Filter per polling interval, however, if the RPC Provider does not support Filters (e.g. `eth_newFilter`), then `watchContractEvent` will fall back to using [`getLogs`](https://viem.sh/docs/actions/public/getLogs) instead.
959
+ *
960
+ * @param args - {@link WatchContractEventParameters}
961
+ * @returns A function that can be invoked to stop watching for new event logs. {@link WatchContractEventReturnType}
962
+ *
963
+ * @example
964
+ * import { createPublicClient, http, parseAbi } from 'viem'
965
+ * import { mainnet } from 'viem/chains'
966
+ *
967
+ * const client = createPublicClient({
968
+ * chain: mainnet,
969
+ * transport: http(),
970
+ * })
971
+ * const unwatch = client.watchContractEvent({
972
+ * address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
973
+ * abi: parseAbi(['event Transfer(address indexed from, address indexed to, uint256 value)']),
974
+ * eventName: 'Transfer',
975
+ * args: { from: '0xc961145a54C96E3aE9bAA048c4F4D6b04C13916b' },
976
+ * onLogs: (logs) => console.log(logs),
977
+ * })
978
+ */
979
+ watchContractEvent: <TAbi extends Abi | readonly unknown[], TEventName extends string>(args: WatchContractEventParameters<TAbi, TEventName>) => WatchContractEventReturnType;
980
+ /**
981
+ * Watches and returns emitted [Event Logs](https://viem.sh/docs/glossary/terms#event-log).
982
+ *
983
+ * - Docs: https://viem.sh/docs/actions/public/watchEvent.html
984
+ * - JSON-RPC Methods:
985
+ * - **RPC Provider supports `eth_newFilter`:**
986
+ * - Calls [`eth_newFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newfilter) to create a filter (called on initialize).
987
+ * - On a polling interval, it will call [`eth_getFilterChanges`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getfilterchanges).
988
+ * - **RPC Provider does not support `eth_newFilter`:**
989
+ * - Calls [`eth_getLogs`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getlogs) for each block between the polling interval.
990
+ *
991
+ * @remarks
992
+ * This Action will batch up all the Event Logs found within the [`pollingInterval`](https://viem.sh/docs/actions/public/watchEvent.html#pollinginterval-optional), and invoke them via [`onLogs`](https://viem.sh/docs/actions/public/watchEvent.html#onLogs).
993
+ *
994
+ * `watchEvent` will attempt to create an [Event Filter](https://viem.sh/docs/actions/public/createEventFilter.html) and listen to changes to the Filter per polling interval, however, if the RPC Provider does not support Filters (e.g. `eth_newFilter`), then `watchEvent` will fall back to using [`getLogs`](https://viem.sh/docs/actions/public/getLogs) instead.
995
+ *
996
+ * @param args - {@link WatchEventParameters}
997
+ * @returns A function that can be invoked to stop watching for new Event Logs. {@link WatchEventReturnType}
998
+ *
999
+ * @example
1000
+ * import { createPublicClient, http } from 'viem'
1001
+ * import { mainnet } from 'viem/chains'
1002
+ *
1003
+ * const client = createPublicClient({
1004
+ * chain: mainnet,
1005
+ * transport: http(),
1006
+ * })
1007
+ * const unwatch = client.watchEvent({
1008
+ * onLogs: (logs) => console.log(logs),
1009
+ * })
1010
+ */
1011
+ watchEvent: <TAbiEvent extends AbiEvent | undefined>(args: WatchEventParameters<TAbiEvent>) => WatchEventReturnType;
1012
+ /**
1013
+ * Watches and returns pending transaction hashes.
1014
+ *
1015
+ * - Docs: https://viem.sh/docs/actions/public/watchPendingTransactions.html
1016
+ * - JSON-RPC Methods:
1017
+ * - When `poll: true`
1018
+ * - Calls [`eth_newPendingTransactionFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newpendingtransactionfilter) to initialize the filter.
1019
+ * - Calls [`eth_getFilterChanges`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getFilterChanges) on a polling interval.
1020
+ * - When `poll: false` & WebSocket Transport, uses a WebSocket subscription via [`eth_subscribe`](https://docs.alchemy.com/reference/eth-subscribe-polygon) and the `"newPendingTransactions"` event.
1021
+ *
1022
+ * @remarks
1023
+ * This Action will batch up all the pending transactions found within the [`pollingInterval`](https://viem.sh/docs/actions/public/watchPendingTransactions.html#pollinginterval-optional), and invoke them via [`onTransactions`](https://viem.sh/docs/actions/public/watchPendingTransactions.html#ontransactions).
1024
+ *
1025
+ * @param args - {@link WatchPendingTransactionsParameters}
1026
+ * @returns A function that can be invoked to stop watching for new pending transaction hashes. {@link WatchPendingTransactionsReturnType}
1027
+ *
1028
+ * @example
1029
+ * import { createPublicClient, http } from 'viem'
1030
+ * import { mainnet } from 'viem/chains'
1031
+ *
1032
+ * const client = createPublicClient({
1033
+ * chain: mainnet,
1034
+ * transport: http(),
1035
+ * })
1036
+ * const unwatch = await client.watchPendingTransactions({
1037
+ * onTransactions: (hashes) => console.log(hashes),
1038
+ * })
1039
+ */
1040
+ watchPendingTransactions: (args: WatchPendingTransactionsParameters<TTransport>) => WatchPendingTransactionsReturnType;
1041
+ };
1042
+ export declare const publicActions: <TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined>(client: PublicClient<TTransport, TChain>) => PublicActions<TTransport, TChain>;
1043
+ //# sourceMappingURL=public.d.ts.map