viem 0.0.0-portable-types-20230522163654 → 0.0.0-tmm-sign-typed-data-types.20230619T221425

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 (736) hide show
  1. package/README.md +12 -0
  2. package/dist/cjs/actions/ens/getEnsAddress.js +34 -23
  3. package/dist/cjs/actions/ens/getEnsAddress.js.map +1 -1
  4. package/dist/cjs/actions/getContract.js +22 -16
  5. package/dist/cjs/actions/getContract.js.map +1 -1
  6. package/dist/cjs/actions/public/call.js +1 -1
  7. package/dist/cjs/actions/public/call.js.map +1 -1
  8. package/dist/cjs/actions/public/createContractEventFilter.js +2 -1
  9. package/dist/cjs/actions/public/createContractEventFilter.js.map +1 -1
  10. package/dist/cjs/actions/public/createEventFilter.js +2 -1
  11. package/dist/cjs/actions/public/createEventFilter.js.map +1 -1
  12. package/dist/cjs/actions/public/estimateContractGas.js +1 -1
  13. package/dist/cjs/actions/public/estimateContractGas.js.map +1 -1
  14. package/dist/cjs/actions/public/estimateGas.js +3 -2
  15. package/dist/cjs/actions/public/estimateGas.js.map +1 -1
  16. package/dist/cjs/actions/public/getBlock.js.map +1 -1
  17. package/dist/cjs/actions/public/getBlockTransactionCount.js +1 -1
  18. package/dist/cjs/actions/public/getBlockTransactionCount.js.map +1 -1
  19. package/dist/cjs/actions/public/getChainId.js +3 -1
  20. package/dist/cjs/actions/public/getChainId.js.map +1 -1
  21. package/dist/cjs/actions/public/getFilterChanges.js +15 -3
  22. package/dist/cjs/actions/public/getFilterChanges.js.map +1 -1
  23. package/dist/cjs/actions/public/getFilterLogs.js +14 -2
  24. package/dist/cjs/actions/public/getFilterLogs.js.map +1 -1
  25. package/dist/cjs/actions/public/getGasPrice.js.map +1 -1
  26. package/dist/cjs/actions/public/getLogs.js +15 -3
  27. package/dist/cjs/actions/public/getLogs.js.map +1 -1
  28. package/dist/cjs/actions/public/getTransactionCount.js.map +1 -1
  29. package/dist/cjs/actions/public/verifyTypedData.js +6 -1
  30. package/dist/cjs/actions/public/verifyTypedData.js.map +1 -1
  31. package/dist/cjs/actions/public/watchContractEvent.js +3 -1
  32. package/dist/cjs/actions/public/watchContractEvent.js.map +1 -1
  33. package/dist/cjs/actions/public/watchEvent.js +3 -1
  34. package/dist/cjs/actions/public/watchEvent.js.map +1 -1
  35. package/dist/cjs/actions/test/getAutomine.js +4 -0
  36. package/dist/cjs/actions/test/getAutomine.js.map +1 -1
  37. package/dist/cjs/actions/test/mine.js +10 -4
  38. package/dist/cjs/actions/test/mine.js.map +1 -1
  39. package/dist/cjs/actions/test/sendUnsignedTransaction.js +21 -3
  40. package/dist/cjs/actions/test/sendUnsignedTransaction.js.map +1 -1
  41. package/dist/cjs/actions/test/setAutomine.js +11 -4
  42. package/dist/cjs/actions/test/setAutomine.js.map +1 -1
  43. package/dist/cjs/actions/test/setBalance.js +10 -4
  44. package/dist/cjs/actions/test/setBalance.js.map +1 -1
  45. package/dist/cjs/actions/wallet/sendTransaction.js +1 -1
  46. package/dist/cjs/actions/wallet/sendTransaction.js.map +1 -1
  47. package/dist/cjs/actions/wallet/signMessage.js +8 -1
  48. package/dist/cjs/actions/wallet/signMessage.js.map +1 -1
  49. package/dist/cjs/chains.js +14 -2
  50. package/dist/cjs/chains.js.map +1 -1
  51. package/dist/cjs/clients/createClient.js +1 -1
  52. package/dist/cjs/clients/createClient.js.map +1 -1
  53. package/dist/cjs/clients/createPublicClient.js.map +1 -1
  54. package/dist/cjs/clients/createTestClient.js.map +1 -1
  55. package/dist/cjs/clients/createWalletClient.js.map +1 -1
  56. package/dist/cjs/clients/decorators/public.js.map +1 -1
  57. package/dist/cjs/clients/decorators/test.js.map +1 -1
  58. package/dist/cjs/clients/transports/createTransport.js.map +1 -1
  59. package/dist/cjs/clients/transports/custom.js.map +1 -1
  60. package/dist/cjs/clients/transports/fallback.js.map +1 -1
  61. package/dist/cjs/clients/transports/http.js +25 -7
  62. package/dist/cjs/clients/transports/http.js.map +1 -1
  63. package/dist/cjs/clients/transports/webSocket.js +22 -14
  64. package/dist/cjs/clients/transports/webSocket.js.map +1 -1
  65. package/dist/cjs/errors/abi.js +15 -1
  66. package/dist/cjs/errors/abi.js.map +1 -1
  67. package/dist/cjs/errors/base.js +4 -11
  68. package/dist/cjs/errors/base.js.map +1 -1
  69. package/dist/cjs/errors/request.js.map +1 -1
  70. package/dist/cjs/errors/rpc.js +8 -2
  71. package/dist/cjs/errors/rpc.js.map +1 -1
  72. package/dist/cjs/errors/version.js +1 -1
  73. package/dist/cjs/errors/version.js.map +1 -1
  74. package/dist/cjs/index.js +26 -10
  75. package/dist/cjs/index.js.map +1 -1
  76. package/dist/cjs/types/eip1193.js +3 -3
  77. package/dist/cjs/types/eip1193.js.map +1 -1
  78. package/dist/cjs/utils/abi/decodeEventLog.js +33 -19
  79. package/dist/cjs/utils/abi/decodeEventLog.js.map +1 -1
  80. package/dist/cjs/utils/abi/encodeEventTopics.js +11 -7
  81. package/dist/cjs/utils/abi/encodeEventTopics.js.map +1 -1
  82. package/dist/cjs/utils/abi/getAbiItem.js +2 -0
  83. package/dist/cjs/utils/abi/getAbiItem.js.map +1 -1
  84. package/dist/cjs/utils/buildRequest.js.map +1 -1
  85. package/dist/cjs/utils/encoding/toBytes.js.map +1 -1
  86. package/dist/cjs/utils/encoding/toHex.js.map +1 -1
  87. package/dist/cjs/utils/ens/encodeLabelhash.js +8 -0
  88. package/dist/cjs/utils/ens/encodeLabelhash.js.map +1 -0
  89. package/dist/cjs/utils/ens/encodedLabelToLabelhash.js +18 -0
  90. package/dist/cjs/utils/ens/encodedLabelToLabelhash.js.map +1 -0
  91. package/dist/cjs/utils/ens/labelhash.js +2 -1
  92. package/dist/cjs/utils/ens/labelhash.js.map +1 -1
  93. package/dist/cjs/utils/ens/namehash.js +5 -1
  94. package/dist/cjs/utils/ens/namehash.js.map +1 -1
  95. package/dist/cjs/utils/ens/packetToBytes.js +10 -9
  96. package/dist/cjs/utils/ens/packetToBytes.js.map +1 -1
  97. package/dist/cjs/utils/filters/createFilterRequestScope.js.map +1 -1
  98. package/dist/cjs/utils/formatters/block.js +3 -1
  99. package/dist/cjs/utils/formatters/block.js.map +1 -1
  100. package/dist/cjs/utils/formatters/log.js +2 -2
  101. package/dist/cjs/utils/formatters/transaction.js +3 -1
  102. package/dist/cjs/utils/formatters/transaction.js.map +1 -1
  103. package/dist/cjs/utils/formatters/transactionReceipt.js +1 -1
  104. package/dist/cjs/utils/formatters/transactionReceipt.js.map +1 -1
  105. package/dist/cjs/utils/formatters/transactionRequest.js.map +1 -1
  106. package/dist/cjs/utils/hash/getEventSelector.js +5 -1
  107. package/dist/cjs/utils/hash/getEventSelector.js.map +1 -1
  108. package/dist/cjs/utils/hash/getFunctionSelector.js +5 -1
  109. package/dist/cjs/utils/hash/getFunctionSelector.js.map +1 -1
  110. package/dist/cjs/utils/hash/hashFunction.js +6 -4
  111. package/dist/cjs/utils/hash/hashFunction.js.map +1 -1
  112. package/dist/cjs/utils/index.js.map +1 -1
  113. package/dist/cjs/utils/observe.js.map +1 -1
  114. package/dist/cjs/utils/promise/createBatchScheduler.js.map +1 -1
  115. package/dist/cjs/utils/promise/withCache.js +8 -4
  116. package/dist/cjs/utils/promise/withCache.js.map +1 -1
  117. package/dist/cjs/utils/rpc.js +12 -17
  118. package/dist/cjs/utils/rpc.js.map +1 -1
  119. package/dist/cjs/utils/signature/hashMessage.js +7 -1
  120. package/dist/cjs/utils/signature/hashMessage.js.map +1 -1
  121. package/dist/cjs/utils/transaction/getTransactionType.js.map +1 -1
  122. package/dist/cjs/utils/transaction/prepareRequest.js +1 -2
  123. package/dist/cjs/utils/transaction/prepareRequest.js.map +1 -1
  124. package/dist/cjs/utils/transaction/serializeTransaction.js.map +1 -1
  125. package/dist/cjs/utils/typedData.js.map +1 -1
  126. package/dist/cjs/utils/unit/parseUnits.js +13 -3
  127. package/dist/cjs/utils/unit/parseUnits.js.map +1 -1
  128. package/dist/esm/accounts/generateMnemonic.js +7 -0
  129. package/dist/esm/accounts/generateMnemonic.js.map +1 -1
  130. package/dist/esm/accounts/generatePrivateKey.js +5 -0
  131. package/dist/esm/accounts/generatePrivateKey.js.map +1 -1
  132. package/dist/esm/accounts/hdKeyToAccount.js +5 -0
  133. package/dist/esm/accounts/hdKeyToAccount.js.map +1 -1
  134. package/dist/esm/accounts/mnemonicToAccount.js +5 -0
  135. package/dist/esm/accounts/mnemonicToAccount.js.map +1 -1
  136. package/dist/esm/accounts/privateKeyToAccount.js +5 -0
  137. package/dist/esm/accounts/privateKeyToAccount.js.map +1 -1
  138. package/dist/esm/accounts/toAccount.js +5 -0
  139. package/dist/esm/accounts/toAccount.js.map +1 -1
  140. package/dist/esm/accounts/utils/publicKeyToAddress.js +7 -0
  141. package/dist/esm/accounts/utils/publicKeyToAddress.js.map +1 -1
  142. package/dist/esm/accounts/utils/sign.js +8 -0
  143. package/dist/esm/accounts/utils/sign.js.map +1 -1
  144. package/dist/esm/accounts/utils/signMessage.js +6 -0
  145. package/dist/esm/accounts/utils/signMessage.js.map +1 -1
  146. package/dist/esm/accounts/utils/signTypedData.js +6 -0
  147. package/dist/esm/accounts/utils/signTypedData.js.map +1 -1
  148. package/dist/esm/actions/ens/getEnsAddress.js +62 -23
  149. package/dist/esm/actions/ens/getEnsAddress.js.map +1 -1
  150. package/dist/esm/actions/ens/getEnsAvatar.js +28 -0
  151. package/dist/esm/actions/ens/getEnsAvatar.js.map +1 -1
  152. package/dist/esm/actions/ens/getEnsName.js +27 -0
  153. package/dist/esm/actions/ens/getEnsName.js.map +1 -1
  154. package/dist/esm/actions/ens/getEnsResolver.js +28 -0
  155. package/dist/esm/actions/ens/getEnsResolver.js.map +1 -1
  156. package/dist/esm/actions/ens/getEnsText.js +29 -0
  157. package/dist/esm/actions/ens/getEnsText.js.map +1 -1
  158. package/dist/esm/actions/getContract.js +58 -16
  159. package/dist/esm/actions/getContract.js.map +1 -1
  160. package/dist/esm/actions/public/call.js +32 -1
  161. package/dist/esm/actions/public/call.js.map +1 -1
  162. package/dist/esm/actions/public/createBlockFilter.js +21 -0
  163. package/dist/esm/actions/public/createBlockFilter.js.map +1 -1
  164. package/dist/esm/actions/public/createContractEventFilter.js +24 -1
  165. package/dist/esm/actions/public/createContractEventFilter.js.map +1 -1
  166. package/dist/esm/actions/public/createEventFilter.js +25 -1
  167. package/dist/esm/actions/public/createEventFilter.js.map +1 -1
  168. package/dist/esm/actions/public/createPendingTransactionFilter.js +21 -0
  169. package/dist/esm/actions/public/createPendingTransactionFilter.js.map +1 -1
  170. package/dist/esm/actions/public/estimateContractGas.js +28 -1
  171. package/dist/esm/actions/public/estimateContractGas.js.map +1 -1
  172. package/dist/esm/actions/public/estimateGas.js +29 -2
  173. package/dist/esm/actions/public/estimateGas.js.map +1 -1
  174. package/dist/esm/actions/public/getBalance.js +35 -0
  175. package/dist/esm/actions/public/getBalance.js.map +1 -1
  176. package/dist/esm/actions/public/getBlock.js +24 -0
  177. package/dist/esm/actions/public/getBlock.js.map +1 -1
  178. package/dist/esm/actions/public/getBlockNumber.js +23 -0
  179. package/dist/esm/actions/public/getBlockNumber.js.map +1 -1
  180. package/dist/esm/actions/public/getBlockTransactionCount.js +24 -1
  181. package/dist/esm/actions/public/getBlockTransactionCount.js.map +1 -1
  182. package/dist/esm/actions/public/getBytecode.js +23 -0
  183. package/dist/esm/actions/public/getBytecode.js.map +1 -1
  184. package/dist/esm/actions/public/getChainId.js +24 -1
  185. package/dist/esm/actions/public/getChainId.js.map +1 -1
  186. package/dist/esm/actions/public/getFeeHistory.js +24 -0
  187. package/dist/esm/actions/public/getFeeHistory.js.map +1 -1
  188. package/dist/esm/actions/public/getFilterChanges.js +99 -3
  189. package/dist/esm/actions/public/getFilterChanges.js.map +1 -1
  190. package/dist/esm/actions/public/getFilterLogs.js +43 -2
  191. package/dist/esm/actions/public/getFilterLogs.js.map +1 -1
  192. package/dist/esm/actions/public/getGasPrice.js +20 -0
  193. package/dist/esm/actions/public/getGasPrice.js.map +1 -1
  194. package/dist/esm/actions/public/getLogs.js +39 -3
  195. package/dist/esm/actions/public/getLogs.js.map +1 -1
  196. package/dist/esm/actions/public/getStorageAt.js +24 -0
  197. package/dist/esm/actions/public/getStorageAt.js.map +1 -1
  198. package/dist/esm/actions/public/getTransaction.js +24 -0
  199. package/dist/esm/actions/public/getTransaction.js.map +1 -1
  200. package/dist/esm/actions/public/getTransactionConfirmations.js +24 -0
  201. package/dist/esm/actions/public/getTransactionConfirmations.js.map +1 -1
  202. package/dist/esm/actions/public/getTransactionCount.js +23 -0
  203. package/dist/esm/actions/public/getTransactionCount.js.map +1 -1
  204. package/dist/esm/actions/public/getTransactionReceipt.js +24 -0
  205. package/dist/esm/actions/public/getTransactionReceipt.js.map +1 -1
  206. package/dist/esm/actions/public/multicall.js +40 -0
  207. package/dist/esm/actions/public/multicall.js.map +1 -1
  208. package/dist/esm/actions/public/readContract.js +31 -0
  209. package/dist/esm/actions/public/readContract.js.map +1 -1
  210. package/dist/esm/actions/public/simulateContract.js +31 -0
  211. package/dist/esm/actions/public/simulateContract.js.map +1 -1
  212. package/dist/esm/actions/public/uninstallFilter.js +24 -0
  213. package/dist/esm/actions/public/uninstallFilter.js.map +1 -1
  214. package/dist/esm/actions/public/verifyHash.js +10 -0
  215. package/dist/esm/actions/public/verifyHash.js.map +1 -1
  216. package/dist/esm/actions/public/verifyMessage.js +11 -0
  217. package/dist/esm/actions/public/verifyMessage.js.map +1 -1
  218. package/dist/esm/actions/public/verifyTypedData.js +16 -2
  219. package/dist/esm/actions/public/verifyTypedData.js.map +1 -1
  220. package/dist/esm/actions/public/waitForTransactionReceipt.js +52 -0
  221. package/dist/esm/actions/public/waitForTransactionReceipt.js.map +1 -1
  222. package/dist/esm/actions/public/watchBlockNumber.js +31 -0
  223. package/dist/esm/actions/public/watchBlockNumber.js.map +1 -1
  224. package/dist/esm/actions/public/watchBlocks.js +35 -1
  225. package/dist/esm/actions/public/watchBlocks.js.map +1 -1
  226. package/dist/esm/actions/public/watchContractEvent.js +39 -1
  227. package/dist/esm/actions/public/watchContractEvent.js.map +1 -1
  228. package/dist/esm/actions/public/watchEvent.js +41 -1
  229. package/dist/esm/actions/public/watchEvent.js.map +1 -1
  230. package/dist/esm/actions/public/watchPendingTransactions.js +29 -0
  231. package/dist/esm/actions/public/watchPendingTransactions.js.map +1 -1
  232. package/dist/esm/actions/test/dropTransaction.js +22 -0
  233. package/dist/esm/actions/test/dropTransaction.js.map +1 -1
  234. package/dist/esm/actions/test/getAutomine.js +24 -0
  235. package/dist/esm/actions/test/getAutomine.js.map +1 -1
  236. package/dist/esm/actions/test/getTxpoolContent.js +20 -0
  237. package/dist/esm/actions/test/getTxpoolContent.js.map +1 -1
  238. package/dist/esm/actions/test/getTxpoolStatus.js +20 -0
  239. package/dist/esm/actions/test/getTxpoolStatus.js.map +1 -1
  240. package/dist/esm/actions/test/impersonateAccount.js +22 -0
  241. package/dist/esm/actions/test/impersonateAccount.js.map +1 -1
  242. package/dist/esm/actions/test/increaseTime.js +22 -0
  243. package/dist/esm/actions/test/increaseTime.js.map +1 -1
  244. package/dist/esm/actions/test/inspectTxpool.js +20 -0
  245. package/dist/esm/actions/test/inspectTxpool.js.map +1 -1
  246. package/dist/esm/actions/test/mine.js +30 -4
  247. package/dist/esm/actions/test/mine.js.map +1 -1
  248. package/dist/esm/actions/test/removeBlockTimestampInterval.js +19 -0
  249. package/dist/esm/actions/test/removeBlockTimestampInterval.js.map +1 -1
  250. package/dist/esm/actions/test/reset.js +20 -0
  251. package/dist/esm/actions/test/reset.js.map +1 -1
  252. package/dist/esm/actions/test/revert.js +20 -0
  253. package/dist/esm/actions/test/revert.js.map +1 -1
  254. package/dist/esm/actions/test/sendUnsignedTransaction.js +48 -4
  255. package/dist/esm/actions/test/sendUnsignedTransaction.js.map +1 -1
  256. package/dist/esm/actions/test/setAutomine.js +30 -4
  257. package/dist/esm/actions/test/setAutomine.js.map +1 -1
  258. package/dist/esm/actions/test/setBalance.js +33 -4
  259. package/dist/esm/actions/test/setBalance.js.map +1 -1
  260. package/dist/esm/actions/test/setBlockGasLimit.js +20 -0
  261. package/dist/esm/actions/test/setBlockGasLimit.js.map +1 -1
  262. package/dist/esm/actions/test/setBlockTimestampInterval.js +20 -0
  263. package/dist/esm/actions/test/setBlockTimestampInterval.js.map +1 -1
  264. package/dist/esm/actions/test/setCode.js +23 -0
  265. package/dist/esm/actions/test/setCode.js.map +1 -1
  266. package/dist/esm/actions/test/setCoinbase.js +22 -0
  267. package/dist/esm/actions/test/setCoinbase.js.map +1 -1
  268. package/dist/esm/actions/test/setIntervalMining.js +20 -0
  269. package/dist/esm/actions/test/setIntervalMining.js.map +1 -1
  270. package/dist/esm/actions/test/setLoggingEnabled.js +19 -0
  271. package/dist/esm/actions/test/setLoggingEnabled.js.map +1 -1
  272. package/dist/esm/actions/test/setMinGasPrice.js +24 -0
  273. package/dist/esm/actions/test/setMinGasPrice.js.map +1 -1
  274. package/dist/esm/actions/test/setNextBlockBaseFeePerGas.js +22 -0
  275. package/dist/esm/actions/test/setNextBlockBaseFeePerGas.js.map +1 -1
  276. package/dist/esm/actions/test/setNextBlockTimestamp.js +20 -0
  277. package/dist/esm/actions/test/setNextBlockTimestamp.js.map +1 -1
  278. package/dist/esm/actions/test/setNonce.js +23 -0
  279. package/dist/esm/actions/test/setNonce.js.map +1 -1
  280. package/dist/esm/actions/test/setRpcUrl.js +20 -0
  281. package/dist/esm/actions/test/setRpcUrl.js.map +1 -1
  282. package/dist/esm/actions/test/setStorageAt.js +24 -0
  283. package/dist/esm/actions/test/setStorageAt.js.map +1 -1
  284. package/dist/esm/actions/test/snapshot.js +19 -0
  285. package/dist/esm/actions/test/snapshot.js.map +1 -1
  286. package/dist/esm/actions/test/stopImpersonatingAccount.js +22 -0
  287. package/dist/esm/actions/test/stopImpersonatingAccount.js.map +1 -1
  288. package/dist/esm/actions/wallet/addChain.js +19 -0
  289. package/dist/esm/actions/wallet/addChain.js.map +1 -1
  290. package/dist/esm/actions/wallet/deployContract.js +27 -0
  291. package/dist/esm/actions/wallet/deployContract.js.map +1 -1
  292. package/dist/esm/actions/wallet/getAddresses.js +20 -0
  293. package/dist/esm/actions/wallet/getAddresses.js.map +1 -1
  294. package/dist/esm/actions/wallet/getPermissions.js +20 -0
  295. package/dist/esm/actions/wallet/getPermissions.js.map +1 -1
  296. package/dist/esm/actions/wallet/requestAddresses.js +24 -0
  297. package/dist/esm/actions/wallet/requestAddresses.js.map +1 -1
  298. package/dist/esm/actions/wallet/requestPermissions.js +23 -0
  299. package/dist/esm/actions/wallet/requestPermissions.js.map +1 -1
  300. package/dist/esm/actions/wallet/sendTransaction.js +48 -1
  301. package/dist/esm/actions/wallet/sendTransaction.js.map +1 -1
  302. package/dist/esm/actions/wallet/signMessage.js +55 -2
  303. package/dist/esm/actions/wallet/signMessage.js.map +1 -1
  304. package/dist/esm/actions/wallet/signTypedData.js +100 -0
  305. package/dist/esm/actions/wallet/signTypedData.js.map +1 -1
  306. package/dist/esm/actions/wallet/switchChain.js +20 -0
  307. package/dist/esm/actions/wallet/switchChain.js.map +1 -1
  308. package/dist/esm/actions/wallet/watchAsset.js +28 -0
  309. package/dist/esm/actions/wallet/watchAsset.js.map +1 -1
  310. package/dist/esm/actions/wallet/writeContract.js +50 -0
  311. package/dist/esm/actions/wallet/writeContract.js.map +1 -1
  312. package/dist/esm/chains.js +99 -87
  313. package/dist/esm/chains.js.map +1 -1
  314. package/dist/esm/clients/createClient.js +4 -1
  315. package/dist/esm/clients/createClient.js.map +1 -1
  316. package/dist/esm/clients/createPublicClient.js +19 -0
  317. package/dist/esm/clients/createPublicClient.js.map +1 -1
  318. package/dist/esm/clients/createTestClient.js +23 -0
  319. package/dist/esm/clients/createTestClient.js.map +1 -1
  320. package/dist/esm/clients/createWalletClient.js +36 -0
  321. package/dist/esm/clients/createWalletClient.js.map +1 -1
  322. package/dist/esm/clients/decorators/public.js.map +1 -1
  323. package/dist/esm/clients/decorators/test.js.map +1 -1
  324. package/dist/esm/clients/transports/createTransport.js +3 -0
  325. package/dist/esm/clients/transports/createTransport.js.map +1 -1
  326. package/dist/esm/clients/transports/custom.js +3 -0
  327. package/dist/esm/clients/transports/custom.js.map +1 -1
  328. package/dist/esm/clients/transports/fallback.js +11 -0
  329. package/dist/esm/clients/transports/fallback.js.map +1 -1
  330. package/dist/esm/clients/transports/http.js +31 -8
  331. package/dist/esm/clients/transports/http.js.map +1 -1
  332. package/dist/esm/clients/transports/webSocket.js +28 -15
  333. package/dist/esm/clients/transports/webSocket.js.map +1 -1
  334. package/dist/esm/constants/abis.js +6 -0
  335. package/dist/esm/constants/abis.js.map +1 -1
  336. package/dist/esm/constants/solidity.js +1 -0
  337. package/dist/esm/constants/solidity.js.map +1 -1
  338. package/dist/esm/contract.js +0 -1
  339. package/dist/esm/contract.js.map +1 -1
  340. package/dist/esm/errors/abi.js +15 -1
  341. package/dist/esm/errors/abi.js.map +1 -1
  342. package/dist/esm/errors/base.js +4 -11
  343. package/dist/esm/errors/base.js.map +1 -1
  344. package/dist/esm/errors/node.js +9 -0
  345. package/dist/esm/errors/node.js.map +1 -1
  346. package/dist/esm/errors/request.js.map +1 -1
  347. package/dist/esm/errors/rpc.js +111 -2
  348. package/dist/esm/errors/rpc.js.map +1 -1
  349. package/dist/esm/errors/version.js +1 -1
  350. package/dist/esm/errors/version.js.map +1 -1
  351. package/dist/esm/index.js +2 -51
  352. package/dist/esm/index.js.map +1 -1
  353. package/dist/esm/package.json +1 -1
  354. package/dist/esm/types/account.js +1 -1
  355. package/dist/esm/types/account.js.map +1 -1
  356. package/dist/esm/types/eip1193.js +3 -1
  357. package/dist/esm/types/eip1193.js.map +1 -1
  358. package/dist/esm/utils/abi/decodeAbiParameters.js +29 -0
  359. package/dist/esm/utils/abi/decodeAbiParameters.js.map +1 -1
  360. package/dist/esm/utils/abi/decodeEventLog.js +35 -19
  361. package/dist/esm/utils/abi/decodeEventLog.js.map +1 -1
  362. package/dist/esm/utils/abi/encodeAbiParameters.js +10 -1
  363. package/dist/esm/utils/abi/encodeAbiParameters.js.map +1 -1
  364. package/dist/esm/utils/abi/encodeEventTopics.js +11 -7
  365. package/dist/esm/utils/abi/encodeEventTopics.js.map +1 -1
  366. package/dist/esm/utils/abi/getAbiItem.js +9 -0
  367. package/dist/esm/utils/abi/getAbiItem.js.map +1 -1
  368. package/dist/esm/utils/accounts.js +3 -0
  369. package/dist/esm/utils/accounts.js.map +1 -1
  370. package/dist/esm/utils/buildRequest.js +2 -0
  371. package/dist/esm/utils/buildRequest.js.map +1 -1
  372. package/dist/esm/utils/data/size.js +6 -0
  373. package/dist/esm/utils/data/size.js.map +1 -1
  374. package/dist/esm/utils/data/slice.js +21 -0
  375. package/dist/esm/utils/data/slice.js.map +1 -1
  376. package/dist/esm/utils/encoding/fromBytes.js +79 -0
  377. package/dist/esm/utils/encoding/fromBytes.js.map +1 -1
  378. package/dist/esm/utils/encoding/fromHex.js +106 -0
  379. package/dist/esm/utils/encoding/fromHex.js.map +1 -1
  380. package/dist/esm/utils/encoding/toBytes.js +102 -1
  381. package/dist/esm/utils/encoding/toBytes.js.map +1 -1
  382. package/dist/esm/utils/encoding/toHex.js +108 -2
  383. package/dist/esm/utils/encoding/toHex.js.map +1 -1
  384. package/dist/esm/utils/ens/avatar/parseAvatarRecord.js +6 -2
  385. package/dist/esm/utils/ens/avatar/parseAvatarRecord.js.map +1 -1
  386. package/dist/esm/utils/ens/avatar/utils.js +10 -0
  387. package/dist/esm/utils/ens/avatar/utils.js.map +1 -1
  388. package/dist/esm/utils/ens/encodeLabelhash.js +4 -0
  389. package/dist/esm/utils/ens/encodeLabelhash.js.map +1 -0
  390. package/dist/esm/utils/ens/encodedLabelToLabelhash.js +14 -0
  391. package/dist/esm/utils/ens/encodedLabelToLabelhash.js.map +1 -0
  392. package/dist/esm/utils/ens/labelhash.js +11 -1
  393. package/dist/esm/utils/ens/labelhash.js.map +1 -1
  394. package/dist/esm/utils/ens/namehash.js +18 -2
  395. package/dist/esm/utils/ens/namehash.js.map +1 -1
  396. package/dist/esm/utils/ens/normalize.js +10 -0
  397. package/dist/esm/utils/ens/normalize.js.map +1 -1
  398. package/dist/esm/utils/ens/packetToBytes.js +16 -9
  399. package/dist/esm/utils/ens/packetToBytes.js.map +1 -1
  400. package/dist/esm/utils/filters/createFilterRequestScope.js +5 -0
  401. package/dist/esm/utils/filters/createFilterRequestScope.js.map +1 -1
  402. package/dist/esm/utils/formatters/block.js +4 -1
  403. package/dist/esm/utils/formatters/block.js.map +1 -1
  404. package/dist/esm/utils/formatters/extract.js +3 -0
  405. package/dist/esm/utils/formatters/extract.js.map +1 -1
  406. package/dist/esm/utils/formatters/format.js +3 -0
  407. package/dist/esm/utils/formatters/format.js.map +1 -1
  408. package/dist/esm/utils/formatters/log.js +2 -2
  409. package/dist/esm/utils/formatters/transaction.js +3 -1
  410. package/dist/esm/utils/formatters/transaction.js.map +1 -1
  411. package/dist/esm/utils/formatters/transactionReceipt.js +2 -2
  412. package/dist/esm/utils/formatters/transactionReceipt.js.map +1 -1
  413. package/dist/esm/utils/formatters/transactionRequest.js +1 -1
  414. package/dist/esm/utils/formatters/transactionRequest.js.map +1 -1
  415. package/dist/esm/utils/hash/getEventSelector.js +6 -2
  416. package/dist/esm/utils/hash/getEventSelector.js.map +1 -1
  417. package/dist/esm/utils/hash/getFunctionSelector.js +6 -2
  418. package/dist/esm/utils/hash/getFunctionSelector.js.map +1 -1
  419. package/dist/esm/utils/hash/hashFunction.js +4 -3
  420. package/dist/esm/utils/hash/hashFunction.js.map +1 -1
  421. package/dist/esm/utils/index.js.map +1 -1
  422. package/dist/esm/utils/observe.js +7 -2
  423. package/dist/esm/utils/observe.js.map +1 -1
  424. package/dist/esm/utils/poll.js +3 -0
  425. package/dist/esm/utils/poll.js.map +1 -1
  426. package/dist/esm/utils/promise/createBatchScheduler.js +1 -1
  427. package/dist/esm/utils/promise/createBatchScheduler.js.map +1 -1
  428. package/dist/esm/utils/promise/withCache.js +23 -6
  429. package/dist/esm/utils/promise/withCache.js.map +1 -1
  430. package/dist/esm/utils/regex.js +4 -0
  431. package/dist/esm/utils/regex.js.map +1 -1
  432. package/dist/esm/utils/rpc.js +27 -19
  433. package/dist/esm/utils/rpc.js.map +1 -1
  434. package/dist/esm/utils/signature/hashMessage.js +8 -2
  435. package/dist/esm/utils/signature/hashMessage.js.map +1 -1
  436. package/dist/esm/utils/signature/hashTypedData.js +3 -0
  437. package/dist/esm/utils/signature/hashTypedData.js.map +1 -1
  438. package/dist/esm/utils/signature/recoverPublicKey.js +2 -0
  439. package/dist/esm/utils/signature/recoverPublicKey.js.map +1 -1
  440. package/dist/esm/utils/signature/verifyMessage.js +12 -0
  441. package/dist/esm/utils/signature/verifyMessage.js.map +1 -1
  442. package/dist/esm/utils/signature/verifyTypedData.js +12 -0
  443. package/dist/esm/utils/signature/verifyTypedData.js.map +1 -1
  444. package/dist/esm/utils/transaction/getTransactionType.js.map +1 -1
  445. package/dist/esm/utils/transaction/prepareRequest.js +5 -2
  446. package/dist/esm/utils/transaction/prepareRequest.js.map +1 -1
  447. package/dist/esm/utils/transaction/serializeTransaction.js +4 -2
  448. package/dist/esm/utils/transaction/serializeTransaction.js.map +1 -1
  449. package/dist/esm/utils/typedData.js +4 -0
  450. package/dist/esm/utils/typedData.js.map +1 -1
  451. package/dist/esm/utils/unit/parseUnits.js +15 -3
  452. package/dist/esm/utils/unit/parseUnits.js.map +1 -1
  453. package/dist/types/accounts/types.d.ts +3 -5
  454. package/dist/types/accounts/types.d.ts.map +1 -1
  455. package/dist/types/accounts/utils/signMessage.d.ts +2 -2
  456. package/dist/types/accounts/utils/signMessage.d.ts.map +1 -1
  457. package/dist/types/accounts/utils/signTypedData.d.ts +3 -6
  458. package/dist/types/accounts/utils/signTypedData.d.ts.map +1 -1
  459. package/dist/types/actions/ens/getEnsAddress.d.ts.map +1 -1
  460. package/dist/types/actions/getContract.d.ts +65 -21
  461. package/dist/types/actions/getContract.d.ts.map +1 -1
  462. package/dist/types/actions/public/createBlockFilter.d.ts +1 -1
  463. package/dist/types/actions/public/createContractEventFilter.d.ts +9 -4
  464. package/dist/types/actions/public/createContractEventFilter.d.ts.map +1 -1
  465. package/dist/types/actions/public/createEventFilter.d.ts +18 -6
  466. package/dist/types/actions/public/createEventFilter.d.ts.map +1 -1
  467. package/dist/types/actions/public/createPendingTransactionFilter.d.ts +1 -1
  468. package/dist/types/actions/public/estimateContractGas.d.ts +5 -3
  469. package/dist/types/actions/public/estimateContractGas.d.ts.map +1 -1
  470. package/dist/types/actions/public/estimateGas.d.ts.map +1 -1
  471. package/dist/types/actions/public/getBlockNumber.d.ts +2 -2
  472. package/dist/types/actions/public/getBlockNumber.d.ts.map +1 -1
  473. package/dist/types/actions/public/getChainId.d.ts.map +1 -1
  474. package/dist/types/actions/public/getFilterChanges.d.ts +8 -8
  475. package/dist/types/actions/public/getFilterChanges.d.ts.map +1 -1
  476. package/dist/types/actions/public/getFilterLogs.d.ts +4 -4
  477. package/dist/types/actions/public/getFilterLogs.d.ts.map +1 -1
  478. package/dist/types/actions/public/getLogs.d.ts +10 -4
  479. package/dist/types/actions/public/getLogs.d.ts.map +1 -1
  480. package/dist/types/actions/public/getTransaction.d.ts +1 -1
  481. package/dist/types/actions/public/getTransactionCount.d.ts +1 -1
  482. package/dist/types/actions/public/getTransactionReceipt.d.ts +1 -1
  483. package/dist/types/actions/public/multicall.d.ts +1 -1
  484. package/dist/types/actions/public/readContract.d.ts +2 -2
  485. package/dist/types/actions/public/readContract.d.ts.map +1 -1
  486. package/dist/types/actions/public/simulateContract.d.ts +2 -2
  487. package/dist/types/actions/public/uninstallFilter.d.ts +3 -3
  488. package/dist/types/actions/public/verifyMessage.d.ts +2 -2
  489. package/dist/types/actions/public/verifyMessage.d.ts.map +1 -1
  490. package/dist/types/actions/public/verifyTypedData.d.ts +3 -4
  491. package/dist/types/actions/public/verifyTypedData.d.ts.map +1 -1
  492. package/dist/types/actions/public/watchContractEvent.d.ts +11 -6
  493. package/dist/types/actions/public/watchContractEvent.d.ts.map +1 -1
  494. package/dist/types/actions/public/watchEvent.d.ts +13 -7
  495. package/dist/types/actions/public/watchEvent.d.ts.map +1 -1
  496. package/dist/types/actions/test/getAutomine.d.ts.map +1 -1
  497. package/dist/types/actions/test/mine.d.ts.map +1 -1
  498. package/dist/types/actions/test/sendUnsignedTransaction.d.ts +8 -2
  499. package/dist/types/actions/test/sendUnsignedTransaction.d.ts.map +1 -1
  500. package/dist/types/actions/test/setAutomine.d.ts.map +1 -1
  501. package/dist/types/actions/test/setBalance.d.ts.map +1 -1
  502. package/dist/types/actions/test/setBlockTimestampInterval.d.ts +1 -1
  503. package/dist/types/actions/test/stopImpersonatingAccount.d.ts +1 -1
  504. package/dist/types/actions/wallet/deployContract.d.ts +1 -1
  505. package/dist/types/actions/wallet/signMessage.d.ts +4 -4
  506. package/dist/types/actions/wallet/signMessage.d.ts.map +1 -1
  507. package/dist/types/actions/wallet/signTypedData.d.ts +4 -7
  508. package/dist/types/actions/wallet/signTypedData.d.ts.map +1 -1
  509. package/dist/types/actions/wallet/writeContract.d.ts +3 -3
  510. package/dist/types/chains.d.ts +364 -16
  511. package/dist/types/chains.d.ts.map +1 -1
  512. package/dist/types/clients/createClient.d.ts +5 -5
  513. package/dist/types/clients/createClient.d.ts.map +1 -1
  514. package/dist/types/clients/createPublicClient.d.ts +4 -4
  515. package/dist/types/clients/createPublicClient.d.ts.map +1 -1
  516. package/dist/types/clients/createTestClient.d.ts +4 -4
  517. package/dist/types/clients/createTestClient.d.ts.map +1 -1
  518. package/dist/types/clients/createWalletClient.d.ts +4 -4
  519. package/dist/types/clients/createWalletClient.d.ts.map +1 -1
  520. package/dist/types/clients/decorators/public.d.ts +30 -30
  521. package/dist/types/clients/decorators/public.d.ts.map +1 -1
  522. package/dist/types/clients/decorators/test.d.ts +3 -3
  523. package/dist/types/clients/decorators/test.d.ts.map +1 -1
  524. package/dist/types/clients/decorators/wallet.d.ts +7 -9
  525. package/dist/types/clients/decorators/wallet.d.ts.map +1 -1
  526. package/dist/types/clients/transports/createTransport.d.ts +5 -8
  527. package/dist/types/clients/transports/createTransport.d.ts.map +1 -1
  528. package/dist/types/clients/transports/custom.d.ts +2 -2
  529. package/dist/types/clients/transports/custom.d.ts.map +1 -1
  530. package/dist/types/clients/transports/http.d.ts +11 -0
  531. package/dist/types/clients/transports/http.d.ts.map +1 -1
  532. package/dist/types/clients/transports/webSocket.d.ts.map +1 -1
  533. package/dist/types/contract.d.ts +1 -1
  534. package/dist/types/contract.d.ts.map +1 -1
  535. package/dist/types/errors/abi.d.ts +6 -4
  536. package/dist/types/errors/abi.d.ts.map +1 -1
  537. package/dist/types/errors/base.d.ts +0 -1
  538. package/dist/types/errors/base.d.ts.map +1 -1
  539. package/dist/types/errors/request.d.ts +16 -8
  540. package/dist/types/errors/request.d.ts.map +1 -1
  541. package/dist/types/errors/rpc.d.ts +12 -8
  542. package/dist/types/errors/rpc.d.ts.map +1 -1
  543. package/dist/types/errors/version.d.ts +1 -1
  544. package/dist/types/errors/version.d.ts.map +1 -1
  545. package/dist/types/index.d.ts +56 -53
  546. package/dist/types/index.d.ts.map +1 -1
  547. package/dist/types/types/account.d.ts +1 -1
  548. package/dist/types/types/account.d.ts.map +1 -1
  549. package/dist/types/types/contract.d.ts +11 -6
  550. package/dist/types/types/contract.d.ts.map +1 -1
  551. package/dist/types/types/eip1193.d.ts +1048 -834
  552. package/dist/types/types/eip1193.d.ts.map +1 -1
  553. package/dist/types/types/filter.d.ts +12 -3
  554. package/dist/types/types/filter.d.ts.map +1 -1
  555. package/dist/types/types/log.d.ts +5 -3
  556. package/dist/types/types/log.d.ts.map +1 -1
  557. package/dist/types/types/misc.d.ts +4 -0
  558. package/dist/types/types/misc.d.ts.map +1 -1
  559. package/dist/types/types/rpc.d.ts +1 -1
  560. package/dist/types/types/rpc.d.ts.map +1 -1
  561. package/dist/types/types/transaction.d.ts +14 -5
  562. package/dist/types/types/transaction.d.ts.map +1 -1
  563. package/dist/types/types/typedData.d.ts +17 -29
  564. package/dist/types/types/typedData.d.ts.map +1 -1
  565. package/dist/types/types/utils.d.ts +11 -0
  566. package/dist/types/types/utils.d.ts.map +1 -1
  567. package/dist/types/utils/abi/decodeEventLog.d.ts +6 -5
  568. package/dist/types/utils/abi/decodeEventLog.d.ts.map +1 -1
  569. package/dist/types/utils/abi/encodeEventTopics.d.ts.map +1 -1
  570. package/dist/types/utils/abi/getAbiItem.d.ts.map +1 -1
  571. package/dist/types/utils/buildRequest.d.ts.map +1 -1
  572. package/dist/types/utils/ens/encodeLabelhash.d.ts +3 -0
  573. package/dist/types/utils/ens/encodeLabelhash.d.ts.map +1 -0
  574. package/dist/types/utils/ens/encodedLabelToLabelhash.d.ts +3 -0
  575. package/dist/types/utils/ens/encodedLabelToLabelhash.d.ts.map +1 -0
  576. package/dist/types/utils/ens/labelhash.d.ts.map +1 -1
  577. package/dist/types/utils/ens/namehash.d.ts.map +1 -1
  578. package/dist/types/utils/ens/packetToBytes.d.ts.map +1 -1
  579. package/dist/types/utils/filters/createFilterRequestScope.d.ts +6 -2
  580. package/dist/types/utils/filters/createFilterRequestScope.d.ts.map +1 -1
  581. package/dist/types/utils/formatters/block.d.ts.map +1 -1
  582. package/dist/types/utils/formatters/transaction.d.ts +1 -1
  583. package/dist/types/utils/formatters/transaction.d.ts.map +1 -1
  584. package/dist/types/utils/formatters/transactionReceipt.d.ts.map +1 -1
  585. package/dist/types/utils/hash/getEventSelector.d.ts +2 -1
  586. package/dist/types/utils/hash/getEventSelector.d.ts.map +1 -1
  587. package/dist/types/utils/hash/getFunctionSelector.d.ts +2 -1
  588. package/dist/types/utils/hash/getFunctionSelector.d.ts.map +1 -1
  589. package/dist/types/utils/hash/hashFunction.d.ts +2 -0
  590. package/dist/types/utils/hash/hashFunction.d.ts.map +1 -1
  591. package/dist/types/utils/index.d.ts +1 -1
  592. package/dist/types/utils/index.d.ts.map +1 -1
  593. package/dist/types/utils/observe.d.ts.map +1 -1
  594. package/dist/types/utils/promise/withCache.d.ts.map +1 -1
  595. package/dist/types/utils/rpc.d.ts +18 -10
  596. package/dist/types/utils/rpc.d.ts.map +1 -1
  597. package/dist/types/utils/signature/hashMessage.d.ts +2 -2
  598. package/dist/types/utils/signature/hashMessage.d.ts.map +1 -1
  599. package/dist/types/utils/signature/hashTypedData.d.ts +3 -6
  600. package/dist/types/utils/signature/hashTypedData.d.ts.map +1 -1
  601. package/dist/types/utils/signature/recoverMessageAddress.d.ts +2 -2
  602. package/dist/types/utils/signature/recoverMessageAddress.d.ts.map +1 -1
  603. package/dist/types/utils/signature/recoverTypedDataAddress.d.ts +3 -6
  604. package/dist/types/utils/signature/recoverTypedDataAddress.d.ts.map +1 -1
  605. package/dist/types/utils/signature/verifyTypedData.d.ts +3 -6
  606. package/dist/types/utils/signature/verifyTypedData.d.ts.map +1 -1
  607. package/dist/types/utils/transaction/getTransactionType.d.ts +2 -2
  608. package/dist/types/utils/transaction/getTransactionType.d.ts.map +1 -1
  609. package/dist/types/utils/transaction/prepareRequest.d.ts +1 -1
  610. package/dist/types/utils/transaction/prepareRequest.d.ts.map +1 -1
  611. package/dist/types/utils/typedData.d.ts +2 -3
  612. package/dist/types/utils/typedData.d.ts.map +1 -1
  613. package/dist/types/utils/unit/parseUnits.d.ts.map +1 -1
  614. package/package.json +7 -13
  615. package/src/accounts/types.ts +4 -4
  616. package/src/accounts/utils/signMessage.ts +2 -2
  617. package/src/accounts/utils/signTypedData.ts +4 -4
  618. package/src/actions/ens/getEnsAddress.ts +37 -22
  619. package/src/actions/getContract.ts +133 -69
  620. package/src/actions/public/call.ts +1 -1
  621. package/src/actions/public/createBlockFilter.ts +1 -1
  622. package/src/actions/public/createContractEventFilter.ts +22 -5
  623. package/src/actions/public/createEventFilter.ts +35 -14
  624. package/src/actions/public/createPendingTransactionFilter.ts +1 -1
  625. package/src/actions/public/estimateContractGas.ts +11 -5
  626. package/src/actions/public/estimateGas.ts +4 -3
  627. package/src/actions/public/getBlock.ts +2 -2
  628. package/src/actions/public/getBlockTransactionCount.ts +1 -1
  629. package/src/actions/public/getChainId.ts +3 -1
  630. package/src/actions/public/getFilterChanges.ts +36 -11
  631. package/src/actions/public/getFilterLogs.ts +34 -8
  632. package/src/actions/public/getGasPrice.ts +1 -1
  633. package/src/actions/public/getLogs.ts +39 -10
  634. package/src/actions/public/getTransaction.ts +1 -1
  635. package/src/actions/public/getTransactionCount.ts +2 -2
  636. package/src/actions/public/getTransactionReceipt.ts +1 -1
  637. package/src/actions/public/multicall.ts +1 -1
  638. package/src/actions/public/readContract.ts +2 -2
  639. package/src/actions/public/simulateContract.ts +2 -2
  640. package/src/actions/public/uninstallFilter.ts +3 -3
  641. package/src/actions/public/verifyMessage.ts +2 -2
  642. package/src/actions/public/verifyTypedData.ts +18 -6
  643. package/src/actions/public/watchContractEvent.ts +17 -5
  644. package/src/actions/public/watchEvent.ts +19 -6
  645. package/src/actions/test/getAutomine.ts +4 -0
  646. package/src/actions/test/mine.ts +10 -4
  647. package/src/actions/test/sendUnsignedTransaction.ts +54 -5
  648. package/src/actions/test/setAutomine.ts +8 -4
  649. package/src/actions/test/setBalance.ts +10 -4
  650. package/src/actions/test/setBlockTimestampInterval.ts +1 -1
  651. package/src/actions/test/stopImpersonatingAccount.ts +1 -1
  652. package/src/actions/wallet/deployContract.ts +1 -1
  653. package/src/actions/wallet/sendTransaction.ts +1 -1
  654. package/src/actions/wallet/signMessage.ts +13 -6
  655. package/src/actions/wallet/signTypedData.ts +5 -5
  656. package/src/actions/wallet/writeContract.ts +3 -3
  657. package/src/chains.ts +123 -88
  658. package/src/clients/createClient.ts +13 -11
  659. package/src/clients/createPublicClient.ts +4 -5
  660. package/src/clients/createTestClient.ts +4 -5
  661. package/src/clients/createWalletClient.ts +4 -5
  662. package/src/clients/decorators/public.ts +65 -39
  663. package/src/clients/decorators/test.ts +6 -5
  664. package/src/clients/decorators/wallet.ts +8 -8
  665. package/src/clients/transports/createTransport.ts +5 -9
  666. package/src/clients/transports/custom.ts +1 -2
  667. package/src/clients/transports/fallback.ts +1 -1
  668. package/src/clients/transports/http.ts +44 -7
  669. package/src/clients/transports/webSocket.ts +23 -15
  670. package/src/contract.ts +3 -3
  671. package/src/errors/abi.ts +16 -4
  672. package/src/errors/base.ts +6 -6
  673. package/src/errors/request.ts +4 -4
  674. package/src/errors/rpc.ts +43 -15
  675. package/src/errors/version.ts +1 -1
  676. package/src/index.ts +266 -247
  677. package/src/types/account.ts +9 -9
  678. package/src/types/contract.ts +33 -15
  679. package/src/types/eip1193.ts +1093 -839
  680. package/src/types/filter.ts +15 -3
  681. package/src/types/log.ts +13 -3
  682. package/src/types/misc.ts +6 -0
  683. package/src/types/rpc.ts +1 -1
  684. package/src/types/transaction.ts +24 -6
  685. package/src/types/typedData.ts +36 -45
  686. package/src/types/utils.ts +15 -0
  687. package/src/utils/abi/decodeEventLog.ts +47 -22
  688. package/src/utils/abi/encodeEventTopics.ts +16 -11
  689. package/src/utils/abi/getAbiItem.ts +1 -0
  690. package/src/utils/buildRequest.ts +5 -1
  691. package/src/utils/encoding/toBytes.ts +1 -1
  692. package/src/utils/encoding/toHex.ts +2 -2
  693. package/src/utils/ens/encodeLabelhash.ts +5 -0
  694. package/src/utils/ens/encodedLabelToLabelhash.ts +11 -0
  695. package/src/utils/ens/labelhash.ts +2 -1
  696. package/src/utils/ens/namehash.ts +6 -2
  697. package/src/utils/ens/packetToBytes.ts +12 -8
  698. package/src/utils/filters/createFilterRequestScope.ts +12 -4
  699. package/src/utils/formatters/block.ts +3 -1
  700. package/src/utils/formatters/log.ts +2 -2
  701. package/src/utils/formatters/transaction.ts +3 -1
  702. package/src/utils/formatters/transactionReceipt.ts +4 -2
  703. package/src/utils/formatters/transactionRequest.ts +1 -1
  704. package/src/utils/hash/getEventSelector.ts +6 -2
  705. package/src/utils/hash/getFunctionSelector.ts +6 -2
  706. package/src/utils/hash/hashFunction.ts +6 -2
  707. package/src/utils/index.ts +6 -0
  708. package/src/utils/observe.ts +2 -2
  709. package/src/utils/promise/createBatchScheduler.ts +1 -1
  710. package/src/utils/promise/withCache.ts +13 -11
  711. package/src/utils/rpc.ts +53 -53
  712. package/src/utils/signature/hashMessage.ts +8 -4
  713. package/src/utils/signature/hashTypedData.ts +4 -4
  714. package/src/utils/signature/recoverMessageAddress.ts +2 -2
  715. package/src/utils/signature/recoverTypedDataAddress.ts +4 -4
  716. package/src/utils/signature/verifyTypedData.ts +4 -4
  717. package/src/utils/transaction/getTransactionType.ts +10 -9
  718. package/src/utils/transaction/prepareRequest.ts +1 -2
  719. package/src/utils/transaction/serializeTransaction.ts +3 -3
  720. package/src/utils/typedData.ts +3 -3
  721. package/src/utils/unit/parseUnits.ts +15 -5
  722. package/dist/cjs/adapters/ethers.js +0 -49
  723. package/dist/cjs/adapters/ethers.js.map +0 -1
  724. package/dist/cjs/ethers.js +0 -6
  725. package/dist/cjs/ethers.js.map +0 -1
  726. package/dist/esm/adapters/ethers.js +0 -45
  727. package/dist/esm/adapters/ethers.js.map +0 -1
  728. package/dist/esm/ethers.js +0 -2
  729. package/dist/esm/ethers.js.map +0 -1
  730. package/dist/types/adapters/ethers.d.ts +0 -27
  731. package/dist/types/adapters/ethers.d.ts.map +0 -1
  732. package/dist/types/ethers.d.ts +0 -2
  733. package/dist/types/ethers.d.ts.map +0 -1
  734. package/ethers/package.json +0 -5
  735. package/src/adapters/ethers.ts +0 -94
  736. package/src/ethers.ts +0 -1
@@ -1,11 +1,11 @@
1
1
  import type { Chain } from '../types/chain.js'
2
- import type { Requests } from '../types/eip1193.js'
3
- import { uid } from '../utils/uid.js'
4
-
5
2
  import type {
6
- BaseRpcRequests,
7
- Transport,
8
- } from './transports/createTransport.js'
3
+ EIP1193RequestFn,
4
+ EIP1474Methods,
5
+ RpcSchema,
6
+ } from '../types/eip1193.js'
7
+ import { uid } from '../utils/uid.js'
8
+ import type { Transport } from './transports/createTransport.js'
9
9
 
10
10
  export type ClientConfig<
11
11
  TTransport extends Transport = Transport,
@@ -30,7 +30,7 @@ export type ClientConfig<
30
30
 
31
31
  export type Client<
32
32
  TTransport extends Transport = Transport,
33
- TRequests extends BaseRpcRequests = Requests,
33
+ TRpcSchema extends RpcSchema | undefined = undefined,
34
34
  TChain extends Chain | undefined = Chain | undefined,
35
35
  > = {
36
36
  /** Chain for the client. */
@@ -42,7 +42,9 @@ export type Client<
42
42
  /** Frequency (in ms) for polling enabled actions & events. Defaults to 4_000 milliseconds. */
43
43
  pollingInterval: number
44
44
  /** Request function wrapped with friendly error handling */
45
- request: TRequests['request']
45
+ request: TRpcSchema extends undefined
46
+ ? EIP1193RequestFn<EIP1474Methods>
47
+ : EIP1193RequestFn<TRpcSchema>
46
48
  /** The RPC transport */
47
49
  transport: ReturnType<TTransport>['config'] & ReturnType<TTransport>['value']
48
50
  /** The type of client. */
@@ -56,7 +58,7 @@ export type Client<
56
58
  */
57
59
  export function createClient<
58
60
  TTransport extends Transport,
59
- TRequests extends BaseRpcRequests,
61
+ TRpcSchema extends RpcSchema | undefined = undefined,
60
62
  TChain extends Chain | undefined = undefined,
61
63
  >({
62
64
  chain,
@@ -65,14 +67,14 @@ export function createClient<
65
67
  pollingInterval = 4_000,
66
68
  transport,
67
69
  type = 'base',
68
- }: ClientConfig<TTransport, TChain>): Client<TTransport, TRequests, TChain> {
70
+ }: ClientConfig<TTransport, TChain>): Client<TTransport, TRpcSchema, TChain> {
69
71
  const { config, request, value } = transport({ chain, pollingInterval })
70
72
  return {
71
73
  chain: chain as TChain,
72
74
  key,
73
75
  name,
74
76
  pollingInterval,
75
- request,
77
+ request: request as any,
76
78
  transport: { ...config, ...value },
77
79
  type,
78
80
  uid: uid(),
@@ -1,7 +1,6 @@
1
1
  import type { Chain } from '../types/chain.js'
2
- import type { PublicRequests } from '../types/eip1193.js'
2
+ import type { PublicRpcSchema } from '../types/eip1193.js'
3
3
  import type { Prettify } from '../types/utils.js'
4
-
5
4
  import { type Client, type ClientConfig, createClient } from './createClient.js'
6
5
  import { type PublicActions, publicActions } from './decorators/public.js'
7
6
  import type { Transport } from './transports/createTransport.js'
@@ -9,7 +8,7 @@ import type { Transport } from './transports/createTransport.js'
9
8
  export type MulticallBatchOptions = {
10
9
  /** The maximum size (in bytes) for each calldata chunk. @default 1_024 */
11
10
  batchSize?: number
12
- /** The maximum number of milliseconds to wait before sending a batch. @default 16 */
11
+ /** The maximum number of milliseconds to wait before sending a batch. @default 0 */
13
12
  wait?: number
14
13
  }
15
14
 
@@ -32,13 +31,13 @@ export type PublicClient<
32
31
  TChain extends Chain | undefined = Chain | undefined,
33
32
  TIncludeActions extends boolean = true,
34
33
  > = Prettify<
35
- Client<TTransport, PublicRequests, TChain> &
34
+ Client<TTransport, PublicRpcSchema, TChain> &
36
35
  Pick<PublicClientConfig, 'batch'> &
37
36
  (TIncludeActions extends true ? PublicActions<TTransport, TChain> : unknown)
38
37
  >
39
38
 
40
39
  /**
41
- * Creates a Public Client with a given [Transport](https://viem.sh/docs/clients/intro) configured for a [Chain](https://viem.sh/docs/clients/chains).
40
+ * Creates a Public Client with a given [Transport](https://viem.sh/docs/clients/intro.html) configured for a [Chain](https://viem.sh/docs/clients/chains.html).
42
41
  *
43
42
  * - Docs: https://viem.sh/docs/clients/public.html
44
43
  *
@@ -1,6 +1,5 @@
1
1
  import type { Chain } from '../types/chain.js'
2
- import type { TestRequests } from '../types/eip1193.js'
3
-
2
+ import type { TestRpcSchema } from '../types/eip1193.js'
4
3
  import { type Client, type ClientConfig, createClient } from './createClient.js'
5
4
  import { type TestActions, testActions } from './decorators/test.js'
6
5
  import type { Transport } from './transports/createTransport.js'
@@ -24,7 +23,7 @@ export type TestClient<
24
23
  TTransport extends Transport = Transport,
25
24
  TChain extends Chain | undefined = Chain | undefined,
26
25
  TIncludeActions extends boolean = true,
27
- > = Client<TTransport, TestRequests<TMode>, TChain> &
26
+ > = Client<TTransport, TestRpcSchema<TMode>, TChain> &
28
27
  (TIncludeActions extends true ? TestActions : unknown) & {
29
28
  mode: TMode
30
29
  }
@@ -33,11 +32,11 @@ export type TestClient<
33
32
  * @description Creates a test client with a given transport.
34
33
  */
35
34
  /**
36
- * Creates a Test Client with a given [Transport](https://viem.sh/docs/clients/intro) configured for a [Chain](https://viem.sh/docs/clients/chains).
35
+ * Creates a Test Client with a given [Transport](https://viem.sh/docs/clients/intro.html) configured for a [Chain](https://viem.sh/docs/clients/chains.html).
37
36
  *
38
37
  * - Docs: https://viem.sh/docs/clients/test.html
39
38
  *
40
- * A Test Client is an interface to "test" JSON-RPC API methods accessible through a local Ethereum test node such as [Anvil](https://book.getfoundry.sh/anvil/) or [Hardhat](https://hardhat.org/) such as mining blocks, impersonating accounts, setting fees, etc through [Test Actions](https://viem.sh/docs/actions/test/introduction).
39
+ * A Test Client is an interface to "test" JSON-RPC API methods accessible through a local Ethereum test node such as [Anvil](https://book.getfoundry.sh/anvil/) or [Hardhat](https://hardhat.org/) such as mining blocks, impersonating accounts, setting fees, etc through [Test Actions](https://viem.sh/docs/actions/test/introduction.html).
41
40
  *
42
41
  * @param config - {@link TestClientConfig}
43
42
  * @returns A Test Client. {@link TestClient}
@@ -3,9 +3,8 @@ import type { Address } from 'abitype'
3
3
  import type { Account, JsonRpcAccount } from '../accounts/types.js'
4
4
  import { parseAccount } from '../accounts/utils/parseAccount.js'
5
5
  import type { Chain } from '../types/chain.js'
6
- import type { Requests } from '../types/eip1193.js'
6
+ import type { WalletRpcSchema } from '../types/eip1193.js'
7
7
  import type { Prettify } from '../types/utils.js'
8
-
9
8
  import { type Client, type ClientConfig, createClient } from './createClient.js'
10
9
  import { type WalletActions, walletActions } from './decorators/wallet.js'
11
10
  import type { Transport } from './transports/createTransport.js'
@@ -31,7 +30,7 @@ export type WalletClient<
31
30
  TAccount extends Account | undefined = Account | undefined,
32
31
  TIncludeActions extends boolean = true,
33
32
  > = Prettify<
34
- Client<TTransport, Requests, TChain> &
33
+ Client<TTransport, WalletRpcSchema, TChain> &
35
34
  (TIncludeActions extends true
36
35
  ? WalletActions<TChain, TAccount>
37
36
  : unknown) & {
@@ -41,11 +40,11 @@ export type WalletClient<
41
40
  >
42
41
 
43
42
  /**
44
- * Creates a Wallet Client with a given [Transport](https://viem.sh/docs/clients/intro) configured for a [Chain](https://viem.sh/docs/clients/chains).
43
+ * Creates a Wallet Client with a given [Transport](https://viem.sh/docs/clients/intro.html) configured for a [Chain](https://viem.sh/docs/clients/chains.html).
45
44
  *
46
45
  * - Docs: https://viem.sh/docs/clients/wallet.html
47
46
  *
48
- * A Wallet Client is an interface to interact with [Ethereum Account(s)](https://ethereum.org/en/glossary/#account) and provides the ability to retrieve accounts, execute transactions, sign messages, etc. through [Wallet Actions](https://viem.sh/docs/actions/wallet/introduction).
47
+ * A Wallet Client is an interface to interact with [Ethereum Account(s)](https://ethereum.org/en/glossary/#account) and provides the ability to retrieve accounts, execute transactions, sign messages, etc. through [Wallet Actions](https://viem.sh/docs/actions/wallet/introduction.html).
49
48
  *
50
49
  * The Wallet Client supports signing over:
51
50
  * - [JSON-RPC Accounts](https://viem.sh/docs/clients/wallet.html#json-rpc-accounts) (e.g. Browser Extension Wallets, WalletConnect, etc).
@@ -199,6 +199,7 @@ import {
199
199
  import type { Chain } from '../../types/chain.js'
200
200
  import type {
201
201
  ContractFunctionConfig,
202
+ MaybeAbiEventName,
202
203
  MaybeExtractEventArgsFromAbi,
203
204
  } from '../../types/contract.js'
204
205
  import type { FilterType } from '../../types/filter.js'
@@ -234,7 +235,7 @@ export type PublicActions<
234
235
  */
235
236
  call: (parameters: CallParameters<TChain>) => Promise<CallReturnType>
236
237
  /**
237
- * Creates a Filter to listen for new block hashes that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges).
238
+ * Creates a Filter to listen for new block hashes that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges.html).
238
239
  *
239
240
  * - Docs: https://viem.sh/docs/actions/public/createBlockFilter.html
240
241
  * - JSON-RPC Methods: [`eth_newBlockFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newBlockFilter)
@@ -254,7 +255,7 @@ export type PublicActions<
254
255
  */
255
256
  createBlockFilter: () => Promise<CreateBlockFilterReturnType>
256
257
  /**
257
- * 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).
258
+ * Creates a Filter to retrieve event logs that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges.html) or [`getFilterLogs`](https://viem.sh/docs/actions/public/getFilterLogs.html).
258
259
  *
259
260
  * - Docs: https://viem.sh/docs/contract/createContractEventFilter.html
260
261
  *
@@ -277,11 +278,14 @@ export type PublicActions<
277
278
  TAbi extends Abi | readonly unknown[],
278
279
  TEventName extends string | undefined,
279
280
  TArgs extends MaybeExtractEventArgsFromAbi<TAbi, TEventName> | undefined,
281
+ TStrict extends boolean | undefined = undefined,
280
282
  >(
281
- args: CreateContractEventFilterParameters<TAbi, TEventName, TArgs>,
282
- ) => Promise<CreateContractEventFilterReturnType<TAbi, TEventName, TArgs>>
283
+ args: CreateContractEventFilterParameters<TAbi, TEventName, TArgs, TStrict>,
284
+ ) => Promise<
285
+ CreateContractEventFilterReturnType<TAbi, TEventName, TArgs, TStrict>
286
+ >
283
287
  /**
284
- * 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).
288
+ * 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.html).
285
289
  *
286
290
  * - Docs: https://viem.sh/docs/actions/public/createEventFilter.html
287
291
  * - JSON-RPC Methods: [`eth_newFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newfilter)
@@ -303,14 +307,25 @@ export type PublicActions<
303
307
  */
304
308
  createEventFilter: <
305
309
  TAbiEvent extends AbiEvent | undefined,
306
- TAbi extends Abi | readonly unknown[],
307
- TEventName extends string | undefined,
308
- TArgs extends MaybeExtractEventArgsFromAbi<TAbi, TEventName> | undefined,
310
+ TStrict extends boolean | undefined = undefined,
311
+ _Abi extends Abi | readonly unknown[] = [TAbiEvent],
312
+ _EventName extends string | undefined = MaybeAbiEventName<TAbiEvent>,
313
+ _Args extends
314
+ | MaybeExtractEventArgsFromAbi<_Abi, _EventName>
315
+ | undefined = undefined,
309
316
  >(
310
- args?: CreateEventFilterParameters<TAbiEvent, TAbi, TEventName, TArgs>,
311
- ) => Promise<CreateEventFilterReturnType<TAbiEvent, TAbi, TEventName, TArgs>>
317
+ args?: CreateEventFilterParameters<
318
+ TAbiEvent,
319
+ TStrict,
320
+ _Abi,
321
+ _EventName,
322
+ _Args
323
+ >,
324
+ ) => Promise<
325
+ CreateEventFilterReturnType<TAbiEvent, TStrict, _Abi, _EventName, _Args>
326
+ >
312
327
  /**
313
- * Creates a Filter to listen for new pending transaction hashes that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges).
328
+ * Creates a Filter to listen for new pending transaction hashes that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges.html).
314
329
  *
315
330
  * - Docs: https://viem.sh/docs/actions/public/createPendingTransactionFilter.html
316
331
  * - JSON-RPC Methods: [`eth_newPendingTransactionFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newpendingtransactionfilter)
@@ -335,7 +350,7 @@ export type PublicActions<
335
350
  * - Docs: https://viem.sh/docs/contract/estimateContractGas.html
336
351
  *
337
352
  * @remarks
338
- * 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).
353
+ * Internally, uses a [Public Client](https://viem.sh/docs/clients/public.html) to call the [`estimateGas` action](https://viem.sh/docs/actions/public/estimateGas.html) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData.html).
339
354
  *
340
355
  * @param args - {@link EstimateContractGasParameters}
341
356
  * @returns The gas estimate (in wei). {@link EstimateContractGasReturnType}
@@ -719,10 +734,10 @@ export type PublicActions<
719
734
  * @remarks
720
735
  * A Filter can be created from the following actions:
721
736
  *
722
- * - [`createBlockFilter`](https://viem.sh/docs/actions/public/createBlockFilter)
723
- * - [`createContractEventFilter`](https://viem.sh/docs/contract/createContractEventFilter)
724
- * - [`createEventFilter`](https://viem.sh/docs/actions/public/createEventFilter)
725
- * - [`createPendingTransactionFilter`](https://viem.sh/docs/actions/public/createPendingTransactionFilter)
737
+ * - [`createBlockFilter`](https://viem.sh/docs/actions/public/createBlockFilter.html)
738
+ * - [`createContractEventFilter`](https://viem.sh/docs/contract/createContractEventFilter.html)
739
+ * - [`createEventFilter`](https://viem.sh/docs/actions/public/createEventFilter.html)
740
+ * - [`createPendingTransactionFilter`](https://viem.sh/docs/actions/public/createPendingTransactionFilter.html)
726
741
  *
727
742
  * Depending on the type of filter, the return value will be different:
728
743
  *
@@ -792,9 +807,12 @@ export type PublicActions<
792
807
  TFilterType extends FilterType,
793
808
  TAbi extends Abi | readonly unknown[],
794
809
  TEventName extends string | undefined,
810
+ TStrict extends boolean | undefined = undefined,
795
811
  >(
796
- args: GetFilterChangesParameters<TFilterType, TAbi, TEventName>,
797
- ) => Promise<GetFilterChangesReturnType<TFilterType, TAbi, TEventName>>
812
+ args: GetFilterChangesParameters<TFilterType, TAbi, TEventName, TStrict>,
813
+ ) => Promise<
814
+ GetFilterChangesReturnType<TFilterType, TAbi, TEventName, TStrict>
815
+ >
798
816
  /**
799
817
  * Returns a list of event logs since the filter was created.
800
818
  *
@@ -824,9 +842,10 @@ export type PublicActions<
824
842
  getFilterLogs: <
825
843
  TAbi extends Abi | readonly unknown[],
826
844
  TEventName extends string | undefined,
845
+ TStrict extends boolean | undefined = undefined,
827
846
  >(
828
- args: GetFilterLogsParameters<TAbi, TEventName>,
829
- ) => Promise<GetFilterLogsReturnType<TAbi, TEventName>>
847
+ args: GetFilterLogsParameters<TAbi, TEventName, TStrict>,
848
+ ) => Promise<GetFilterLogsReturnType<TAbi, TEventName, TStrict>>
830
849
  /**
831
850
  * Returns the current price of gas (in wei).
832
851
  *
@@ -866,9 +885,12 @@ export type PublicActions<
866
885
  * })
867
886
  * const logs = await client.getLogs()
868
887
  */
869
- getLogs: <TAbiEvent extends AbiEvent | undefined>(
870
- args?: GetLogsParameters<TAbiEvent>,
871
- ) => Promise<GetLogsReturnType<TAbiEvent>>
888
+ getLogs: <
889
+ TAbiEvent extends AbiEvent | undefined,
890
+ TStrict extends boolean | undefined = undefined,
891
+ >(
892
+ args?: GetLogsParameters<TAbiEvent, TStrict>,
893
+ ) => Promise<GetLogsReturnType<TAbiEvent, TStrict>>
872
894
  /**
873
895
  * Returns the value from a storage slot at a given address.
874
896
  *
@@ -896,7 +918,7 @@ export type PublicActions<
896
918
  args: GetStorageAtParameters,
897
919
  ) => Promise<GetStorageAtReturnType>
898
920
  /**
899
- * Returns information about a [Transaction](https://viem.sh/docs/glossary/terms#transaction) given a hash or block identifier.
921
+ * Returns information about a [Transaction](https://viem.sh/docs/glossary/terms.html#transaction) given a hash or block identifier.
900
922
  *
901
923
  * - Docs: https://viem.sh/docs/actions/public/getTransaction.html
902
924
  * - Example: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/transactions/fetching-transactions
@@ -946,7 +968,7 @@ export type PublicActions<
946
968
  args: GetTransactionConfirmationsParameters<TChain>,
947
969
  ) => Promise<GetTransactionConfirmationsReturnType>
948
970
  /**
949
- * Returns the number of [Transactions](https://viem.sh/docs/glossary/terms#transaction) an Account has broadcast / sent.
971
+ * Returns the number of [Transactions](https://viem.sh/docs/glossary/terms.html#transaction) an Account has broadcast / sent.
950
972
  *
951
973
  * - Docs: https://viem.sh/docs/actions/public/getTransactionCount.html
952
974
  * - JSON-RPC Methods: [`eth_getTransactionCount`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_gettransactioncount)
@@ -970,7 +992,7 @@ export type PublicActions<
970
992
  args: GetTransactionCountParameters,
971
993
  ) => Promise<GetTransactionCountReturnType>
972
994
  /**
973
- * Returns the [Transaction Receipt](https://viem.sh/docs/glossary/terms#transaction-receipt) given a [Transaction](https://viem.sh/docs/glossary/terms#transaction) hash.
995
+ * Returns the [Transaction Receipt](https://viem.sh/docs/glossary/terms.html#transaction-receipt) given a [Transaction](https://viem.sh/docs/glossary/terms.html#transaction) hash.
974
996
  *
975
997
  * - Docs: https://viem.sh/docs/actions/public/getTransactionReceipt.html
976
998
  * - Example: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/transactions/fetching-transactions
@@ -995,7 +1017,7 @@ export type PublicActions<
995
1017
  args: GetTransactionReceiptParameters,
996
1018
  ) => Promise<GetTransactionReceiptReturnType<TChain>>
997
1019
  /**
998
- * 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).
1020
+ * Similar to [`readContract`](https://viem.sh/docs/contract/readContract.html), but batches up multiple functions on a contract in a single RPC call via the [`multicall3` contract](https://github.com/mds1/multicall).
999
1021
  *
1000
1022
  * - Docs: https://viem.sh/docs/contract/multicall.html
1001
1023
  *
@@ -1046,7 +1068,7 @@ export type PublicActions<
1046
1068
  * @remarks
1047
1069
  * 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.
1048
1070
  *
1049
- * 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).
1071
+ * Internally, uses a [Public Client](https://viem.sh/docs/clients/public.html) to call the [`call` action](https://viem.sh/docs/actions/public/call.html) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData.html).
1050
1072
  *
1051
1073
  * @param args - {@link ReadContractParameters}
1052
1074
  * @returns The response from the contract. Type is inferred. {@link ReadContractReturnType}
@@ -1081,9 +1103,9 @@ export type PublicActions<
1081
1103
  * - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/contracts/writing-to-contracts
1082
1104
  *
1083
1105
  * @remarks
1084
- * 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.
1106
+ * 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.html), but also supports contract write functions.
1085
1107
  *
1086
- * 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).
1108
+ * Internally, uses a [Public Client](https://viem.sh/docs/clients/public.html) to call the [`call` action](https://viem.sh/docs/actions/public/call.html) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData.html).
1087
1109
  *
1088
1110
  * @param args - {@link SimulateContractParameters}
1089
1111
  * @returns The simulation result and write request. {@link SimulateContractReturnType}
@@ -1127,9 +1149,9 @@ export type PublicActions<
1127
1149
  /**
1128
1150
  * Destroys a Filter that was created from one of the following Actions:
1129
1151
  *
1130
- * - [`createBlockFilter`](https://viem.sh/docs/actions/public/createBlockFilter)
1131
- * - [`createEventFilter`](https://viem.sh/docs/actions/public/createEventFilter)
1132
- * - [`createPendingTransactionFilter`](https://viem.sh/docs/actions/public/createPendingTransactionFilter)
1152
+ * - [`createBlockFilter`](https://viem.sh/docs/actions/public/createBlockFilter.html)
1153
+ * - [`createEventFilter`](https://viem.sh/docs/actions/public/createEventFilter.html)
1154
+ * - [`createPendingTransactionFilter`](https://viem.sh/docs/actions/public/createPendingTransactionFilter.html)
1133
1155
  *
1134
1156
  * - Docs: https://viem.sh/docs/actions/public/uninstallFilter.html
1135
1157
  * - JSON-RPC Methods: [`eth_uninstallFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_uninstallFilter)
@@ -1252,7 +1274,7 @@ export type PublicActions<
1252
1274
  * @remarks
1253
1275
  * 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).
1254
1276
  *
1255
- * `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.
1277
+ * `watchContractEvent` will attempt to create an [Event Filter](https://viem.sh/docs/contract/createContractEventFilter.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 `watchContractEvent` will fall back to using [`getLogs`](https://viem.sh/docs/actions/public/getLogs.html) instead.
1256
1278
  *
1257
1279
  * @param args - {@link WatchContractEventParameters}
1258
1280
  * @returns A function that can be invoked to stop watching for new event logs. {@link WatchContractEventReturnType}
@@ -1276,11 +1298,12 @@ export type PublicActions<
1276
1298
  watchContractEvent: <
1277
1299
  TAbi extends Abi | readonly unknown[],
1278
1300
  TEventName extends string,
1301
+ TStrict extends boolean | undefined = undefined,
1279
1302
  >(
1280
- args: WatchContractEventParameters<TAbi, TEventName>,
1303
+ args: WatchContractEventParameters<TAbi, TEventName, TStrict>,
1281
1304
  ) => WatchContractEventReturnType
1282
1305
  /**
1283
- * Watches and returns emitted [Event Logs](https://viem.sh/docs/glossary/terms#event-log).
1306
+ * Watches and returns emitted [Event Logs](https://viem.sh/docs/glossary/terms.html#event-log).
1284
1307
  *
1285
1308
  * - Docs: https://viem.sh/docs/actions/public/watchEvent.html
1286
1309
  * - JSON-RPC Methods:
@@ -1293,7 +1316,7 @@ export type PublicActions<
1293
1316
  * @remarks
1294
1317
  * 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).
1295
1318
  *
1296
- * `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.
1319
+ * `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.html) instead.
1297
1320
  *
1298
1321
  * @param args - {@link WatchEventParameters}
1299
1322
  * @returns A function that can be invoked to stop watching for new Event Logs. {@link WatchEventReturnType}
@@ -1310,8 +1333,11 @@ export type PublicActions<
1310
1333
  * onLogs: (logs) => console.log(logs),
1311
1334
  * })
1312
1335
  */
1313
- watchEvent: <TAbiEvent extends AbiEvent | undefined>(
1314
- args: WatchEventParameters<TAbiEvent>,
1336
+ watchEvent: <
1337
+ TAbiEvent extends AbiEvent | undefined,
1338
+ TStrict extends boolean | undefined = undefined,
1339
+ >(
1340
+ args: WatchEventParameters<TAbiEvent, TStrict>,
1315
1341
  ) => WatchEventReturnType
1316
1342
  /**
1317
1343
  * Watches and returns pending transaction hashes.
@@ -328,8 +328,8 @@ export type TestActions = {
328
328
  * value: 1000000000000000000n,
329
329
  * })
330
330
  */
331
- sendUnsignedTransaction: (
332
- args: SendUnsignedTransactionParameters,
331
+ sendUnsignedTransaction: <TChain extends Chain | undefined>(
332
+ args: SendUnsignedTransactionParameters<TChain>,
333
333
  ) => Promise<SendUnsignedTransactionReturnType>
334
334
  /**
335
335
  * Enables or disables the automatic mining of new blocks with each new transaction submitted to the network.
@@ -390,7 +390,7 @@ export type TestActions = {
390
390
  */
391
391
  setBlockGasLimit: (args: SetBlockGasLimitParameters) => Promise<void>
392
392
  /**
393
- * Similar to [`increaseTime`](https://viem.sh/docs/actions/test/increaseTime), but sets a block timestamp `interval`. The timestamp of future blocks will be computed as `lastBlock_timestamp` + `interval`.
393
+ * Similar to [`increaseTime`](https://viem.sh/docs/actions/test/increaseTime.html), but sets a block timestamp `interval`. The timestamp of future blocks will be computed as `lastBlock_timestamp` + `interval`.
394
394
  *
395
395
  * - Docs: https://viem.sh/docs/actions/test/setBlockTimestampInterval.html
396
396
  *
@@ -641,7 +641,7 @@ export type TestActions = {
641
641
  */
642
642
  snapshot: () => Promise<Quantity>
643
643
  /**
644
- * Stop impersonating an account after having previously used [`impersonateAccount`](https://viem.sh/docs/actions/test/impersonateAccount).
644
+ * Stop impersonating an account after having previously used [`impersonateAccount`](https://viem.sh/docs/actions/test/impersonateAccount.html).
645
645
  *
646
646
  * - Docs: https://viem.sh/docs/actions/test/stopImpersonatingAccount.html
647
647
  *
@@ -681,7 +681,8 @@ export function testActions<TChain extends Chain | undefined>(
681
681
  removeBlockTimestampInterval: () => removeBlockTimestampInterval(client),
682
682
  reset: (args) => reset(client, args),
683
683
  revert: (args) => revert(client, args),
684
- sendUnsignedTransaction: (args) => sendUnsignedTransaction(client, args),
684
+ sendUnsignedTransaction: (args) =>
685
+ sendUnsignedTransaction(client, args as any),
685
686
  setAutomine: (args) => setAutomine(client, args),
686
687
  setBalance: (args) => setBalance(client, args),
687
688
  setBlockGasLimit: (args) => setBlockGasLimit(client, args),
@@ -93,7 +93,7 @@ export type WalletActions<
93
93
  * - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/contracts/deploying-contracts
94
94
  *
95
95
  * @param args - {@link DeployContractParameters}
96
- * @returns The [Transaction](https://viem.sh/docs/glossary/terms#transaction) hash. {@link DeployContractReturnType}
96
+ * @returns The [Transaction](https://viem.sh/docs/glossary/terms.html#transaction) hash. {@link DeployContractReturnType}
97
97
  *
98
98
  * @example
99
99
  * import { createWalletClient, http } from 'viem'
@@ -276,8 +276,8 @@ export type WalletActions<
276
276
  * - Local Accounts: Signs locally. No JSON-RPC request.
277
277
  *
278
278
  * With the calculated signature, you can:
279
- * - use [`verifyMessage`](https://viem.sh/docs/utilities/verifyMessage) to verify the signature,
280
- * - use [`recoverMessageAddress`](https://viem.sh/docs/utilities/recoverMessageAddress) to recover the signing address from a signature.
279
+ * - use [`verifyMessage`](https://viem.sh/docs/utilities/verifyMessage.html) to verify the signature,
280
+ * - use [`recoverMessageAddress`](https://viem.sh/docs/utilities/recoverMessageAddress.html) to recover the signing address from a signature.
281
281
  *
282
282
  * @param args - {@link SignMessageParameters}
283
283
  * @returns The signed message. {@link SignMessageReturnType}
@@ -410,8 +410,8 @@ export type WalletActions<
410
410
  * })
411
411
  */
412
412
  signTypedData: <
413
- TTypedData extends TypedData | { [key: string]: unknown },
414
- TPrimaryType extends string,
413
+ const TTypedData extends TypedData | Record<string, unknown>,
414
+ TPrimaryType extends keyof TTypedData,
415
415
  >(
416
416
  args: SignTypedDataParameters<TTypedData, TPrimaryType, TAccount>,
417
417
  ) => Promise<SignTypedDataReturnType>
@@ -467,14 +467,14 @@ export type WalletActions<
467
467
  * - Docs: https://viem.sh/docs/contract/writeContract.html
468
468
  * - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/contracts/writing-to-contracts
469
469
  *
470
- * A "write" function on a Solidity contract modifies the state of the blockchain. These types of functions require gas to be executed, and hence a [Transaction](https://viem.sh/docs/glossary/terms) is needed to be broadcast in order to change the state.
470
+ * A "write" function on a Solidity contract modifies the state of the blockchain. These types of functions require gas to be executed, and hence a [Transaction](https://viem.sh/docs/glossary/terms.html) is needed to be broadcast in order to change the state.
471
471
  *
472
- * Internally, uses a [Wallet Client](https://viem.sh/docs/clients/wallet) to call the [`sendTransaction` action](https://viem.sh/docs/actions/wallet/sendTransaction) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData).
472
+ * Internally, uses a [Wallet Client](https://viem.sh/docs/clients/wallet.html) to call the [`sendTransaction` action](https://viem.sh/docs/actions/wallet/sendTransaction.html) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData.html).
473
473
  *
474
474
  * __Warning: The `write` internally sends a transaction – it does not validate if the contract write will succeed (the contract may throw an error). It is highly recommended to [simulate the contract write with `contract.simulate`](https://viem.sh/docs/contract/writeContract.html#usage) before you execute it.__
475
475
  *
476
476
  * @param args - {@link WriteContractParameters}
477
- * @returns A [Transaction Hash](https://viem.sh/docs/glossary/terms#hash). {@link WriteContractReturnType}
477
+ * @returns A [Transaction Hash](https://viem.sh/docs/glossary/terms.html#hash). {@link WriteContractReturnType}
478
478
  *
479
479
  * @example
480
480
  * import { createWalletClient, custom, parseAbi } from 'viem'
@@ -1,22 +1,18 @@
1
1
  import type { Chain } from '../../types/chain.js'
2
- import type { Requests } from '../../types/eip1193.js'
2
+ import type { EIP1193RequestFn } from '../../types/eip1193.js'
3
3
  import { buildRequest } from '../../utils/buildRequest.js'
4
4
  import type { ClientConfig } from '../createClient.js'
5
5
 
6
- export type BaseRpcRequests = {
7
- request(...args: any): Promise<any>
8
- }
9
-
10
6
  export type TransportConfig<
11
7
  TType extends string = string,
12
- TRequests extends BaseRpcRequests['request'] = Requests['request'],
8
+ TEIP1193RequestFn extends EIP1193RequestFn = EIP1193RequestFn,
13
9
  > = {
14
10
  /** The name of the transport. */
15
11
  name: string
16
12
  /** The key of the transport. */
17
13
  key: string
18
14
  /** The JSON-RPC request function that matches the EIP-1193 request spec. */
19
- request: TRequests
15
+ request: TEIP1193RequestFn
20
16
  /** The base delay (in ms) between retries. */
21
17
  retryDelay?: number
22
18
  /** The max number of times to retry. */
@@ -30,7 +26,7 @@ export type TransportConfig<
30
26
  export type Transport<
31
27
  TType extends string = string,
32
28
  TRpcAttributes = Record<string, any>,
33
- TRequests extends BaseRpcRequests['request'] = Requests['request'],
29
+ TEIP1193RequestFn extends EIP1193RequestFn = EIP1193RequestFn,
34
30
  > = <TChain extends Chain | undefined = Chain>({
35
31
  chain,
36
32
  }: {
@@ -40,7 +36,7 @@ export type Transport<
40
36
  timeout?: TransportConfig['timeout']
41
37
  }) => {
42
38
  config: TransportConfig<TType>
43
- request: TRequests
39
+ request: TEIP1193RequestFn
44
40
  value?: TRpcAttributes
45
41
  }
46
42
 
@@ -1,11 +1,10 @@
1
1
  import {
2
- type BaseRpcRequests,
3
2
  type Transport,
4
3
  type TransportConfig,
5
4
  createTransport,
6
5
  } from './createTransport.js'
7
6
 
8
- type EthereumProvider = { request: BaseRpcRequests['request'] }
7
+ type EthereumProvider = { request(...args: any): Promise<any> }
9
8
 
10
9
  export type CustomTransportConfig = {
11
10
  /** The key of the transport. */
@@ -102,7 +102,7 @@ export function fallback(
102
102
  key,
103
103
  name,
104
104
  async request({ method, params }) {
105
- const fetch = async (i: number = 0): Promise<any> => {
105
+ const fetch = async (i = 0): Promise<any> => {
106
106
  const transport = transports[i]({ chain, retryCount: 0, timeout })
107
107
  try {
108
108
  const response = await transport.request({