viem 0.0.1-sushi.26 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (525) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +132 -2
  3. package/abi/package.json +4 -0
  4. package/dist/abi.d.ts +6 -0
  5. package/dist/abi.js +21 -0
  6. package/dist/abi.js.map +1 -0
  7. package/dist/abi.mjs +21 -0
  8. package/dist/abi.mjs.map +1 -0
  9. package/dist/chain-819c7ff7.d.ts +553 -0
  10. package/dist/{chain-c4ccb458.d.ts → chain-a4f98ba3.d.ts} +1 -1
  11. package/dist/chains.d.ts +5 -3
  12. package/dist/chains.js +46 -46
  13. package/dist/chains.mjs +1 -1
  14. package/dist/chunk-APZXOA44.mjs +208 -0
  15. package/dist/chunk-APZXOA44.mjs.map +1 -0
  16. package/dist/chunk-HCZO3OIX.js +208 -0
  17. package/dist/chunk-HCZO3OIX.js.map +1 -0
  18. package/dist/{chunk-SD5X7F4U.mjs → chunk-I7AINPMM.mjs} +2756 -456
  19. package/dist/chunk-I7AINPMM.mjs.map +1 -0
  20. package/dist/chunk-QJNPIGP5.js +5326 -0
  21. package/dist/chunk-QJNPIGP5.js.map +1 -0
  22. package/dist/contract.d.ts +9 -122
  23. package/dist/contract.js +4 -4
  24. package/dist/contract.mjs +18 -18
  25. package/dist/{createClient-68ee4bb4.d.ts → createClient-a47ae6f5.d.ts} +13 -13
  26. package/dist/createPublicClient-e2eae0fc.d.ts +771 -0
  27. package/dist/{eip1193-6f9ba163.d.ts → eip1193-a882d1b8.d.ts} +14 -3
  28. package/dist/encodeFunctionResult-9eb553ce.d.ts +75 -0
  29. package/dist/encodePacked-4c019ed8.d.ts +12 -0
  30. package/dist/ens.d.ts +8 -69
  31. package/dist/ens.js +4 -199
  32. package/dist/ens.js.map +1 -1
  33. package/dist/ens.mjs +6 -201
  34. package/dist/ens.mjs.map +1 -1
  35. package/dist/formatAbiItem-622d2303.d.ts +14 -0
  36. package/dist/getAbiItem-159f3263.d.ts +22 -0
  37. package/dist/index.d.ts +106 -55
  38. package/dist/index.js +451 -41
  39. package/dist/index.js.map +1 -1
  40. package/dist/index.mjs +445 -35
  41. package/dist/index.mjs.map +1 -1
  42. package/dist/namehash-afff0feb.d.ts +25 -0
  43. package/dist/parseGwei-a2d0d77a.d.ts +497 -0
  44. package/dist/public.d.ts +11 -336
  45. package/dist/public.js +4 -3
  46. package/dist/public.mjs +3 -2
  47. package/dist/test-13f4413b.d.ts +205 -0
  48. package/dist/test.d.ts +8 -149
  49. package/dist/test.js +19 -222
  50. package/dist/test.js.map +1 -1
  51. package/dist/test.mjs +29 -232
  52. package/dist/test.mjs.map +1 -1
  53. package/dist/utils/index.d.ts +44 -231
  54. package/dist/utils/index.js +30 -2
  55. package/dist/utils/index.mjs +61 -33
  56. package/dist/wallet.d.ts +6 -41
  57. package/dist/wallet.js +2 -3
  58. package/dist/wallet.mjs +5 -6
  59. package/dist/window.d.ts +4 -2
  60. package/package.json +11 -6
  61. package/public/package.json +4 -0
  62. package/test/package.json +4 -0
  63. package/dist/call-ac509982.d.ts +0 -23
  64. package/dist/chain-f16512e8.d.ts +0 -372
  65. package/dist/chunk-2PFNLP3F.js +0 -192
  66. package/dist/chunk-2PFNLP3F.js.map +0 -1
  67. package/dist/chunk-5ND4P6QL.mjs +0 -192
  68. package/dist/chunk-5ND4P6QL.mjs.map +0 -1
  69. package/dist/chunk-NXCI5KQC.js +0 -3026
  70. package/dist/chunk-NXCI5KQC.js.map +0 -1
  71. package/dist/chunk-O7T5NQLB.mjs +0 -1091
  72. package/dist/chunk-O7T5NQLB.mjs.map +0 -1
  73. package/dist/chunk-SD5X7F4U.mjs.map +0 -1
  74. package/dist/chunk-UTL6F7UN.js +0 -1091
  75. package/dist/chunk-UTL6F7UN.js.map +0 -1
  76. package/dist/contract-9e76e561.d.ts +0 -166
  77. package/dist/createPublicClient-b732194e.d.ts +0 -19
  78. package/dist/createTestClient-dedf321e.d.ts +0 -34
  79. package/dist/createWalletClient-75813d83.d.ts +0 -30
  80. package/dist/decodeErrorResult-0b934d23.d.ts +0 -16
  81. package/dist/getAbiItem-c8e6e7d4.d.ts +0 -97
  82. package/dist/readContract-4f6e2692.d.ts +0 -10
  83. package/dist/rpc-a5a7f376.d.ts +0 -121
  84. package/dist/sendTransaction-e713f90c.d.ts +0 -12
  85. package/dist/transactionReceipt-2a86c7c7.d.ts +0 -26
  86. package/dist/transactionRequest-c7794f5e.d.ts +0 -15
  87. package/dist/watchEvent-c346c12d.d.ts +0 -41
  88. package/src/_test/abis.ts +0 -1420
  89. package/src/_test/bench.ts +0 -15
  90. package/src/_test/constants.ts +0 -63
  91. package/src/_test/generated.ts +0 -128
  92. package/src/_test/globalSetup.ts +0 -11
  93. package/src/_test/index.ts +0 -25
  94. package/src/_test/setup.ts +0 -8
  95. package/src/_test/utils.ts +0 -155
  96. package/src/actions/ens/getEnsAddress.bench.ts +0 -26
  97. package/src/actions/ens/getEnsAddress.test.ts +0 -97
  98. package/src/actions/ens/getEnsAddress.ts +0 -122
  99. package/src/actions/ens/getEnsName.bench.ts +0 -30
  100. package/src/actions/ens/getEnsName.test.ts +0 -101
  101. package/src/actions/ens/getEnsName.ts +0 -106
  102. package/src/actions/ens/index.test.ts +0 -12
  103. package/src/actions/ens/index.ts +0 -3
  104. package/src/actions/index.test.ts +0 -81
  105. package/src/actions/index.ts +0 -182
  106. package/src/actions/public/call.bench.ts +0 -48
  107. package/src/actions/public/call.test.ts +0 -99
  108. package/src/actions/public/call.ts +0 -97
  109. package/src/actions/public/createBlockFilter.bench.ts +0 -11
  110. package/src/actions/public/createBlockFilter.test.ts +0 -9
  111. package/src/actions/public/createBlockFilter.ts +0 -14
  112. package/src/actions/public/createContractEventFilter.test.ts +0 -119
  113. package/src/actions/public/createContractEventFilter.ts +0 -69
  114. package/src/actions/public/createEventFilter.test.ts +0 -277
  115. package/src/actions/public/createEventFilter.ts +0 -93
  116. package/src/actions/public/createPendingTransactionFilter.bench.ts +0 -11
  117. package/src/actions/public/createPendingTransactionFilter.test.ts +0 -9
  118. package/src/actions/public/createPendingTransactionFilter.ts +0 -14
  119. package/src/actions/public/estimateGas.bench.ts +0 -46
  120. package/src/actions/public/estimateGas.test.ts +0 -92
  121. package/src/actions/public/estimateGas.ts +0 -61
  122. package/src/actions/public/getBalance.test.ts +0 -83
  123. package/src/actions/public/getBalance.ts +0 -37
  124. package/src/actions/public/getBlock.bench.ts +0 -28
  125. package/src/actions/public/getBlock.test.ts +0 -575
  126. package/src/actions/public/getBlock.ts +0 -65
  127. package/src/actions/public/getBlockNumber.bench.ts +0 -28
  128. package/src/actions/public/getBlockNumber.test.ts +0 -27
  129. package/src/actions/public/getBlockNumber.ts +0 -32
  130. package/src/actions/public/getBlockTransactionCount.bench.ts +0 -15
  131. package/src/actions/public/getBlockTransactionCount.test.ts +0 -57
  132. package/src/actions/public/getBlockTransactionCount.ts +0 -52
  133. package/src/actions/public/getBytecode.test.ts +0 -27
  134. package/src/actions/public/getBytecode.ts +0 -32
  135. package/src/actions/public/getChainId.bench.ts +0 -15
  136. package/src/actions/public/getChainId.test.ts +0 -8
  137. package/src/actions/public/getChainId.ts +0 -7
  138. package/src/actions/public/getFeeHistory.bench.ts +0 -18
  139. package/src/actions/public/getFeeHistory.test.ts +0 -137
  140. package/src/actions/public/getFeeHistory.ts +0 -44
  141. package/src/actions/public/getFilterChanges.bench.ts +0 -13
  142. package/src/actions/public/getFilterChanges.test.ts +0 -383
  143. package/src/actions/public/getFilterChanges.ts +0 -23
  144. package/src/actions/public/getFilterLogs.test.ts +0 -297
  145. package/src/actions/public/getFilterLogs.ts +0 -20
  146. package/src/actions/public/getGasPrice.bench.ts +0 -19
  147. package/src/actions/public/getGasPrice.test.ts +0 -8
  148. package/src/actions/public/getGasPrice.ts +0 -15
  149. package/src/actions/public/getLogs.test.ts +0 -306
  150. package/src/actions/public/getLogs.ts +0 -84
  151. package/src/actions/public/getStorageAt.test.ts +0 -34
  152. package/src/actions/public/getStorageAt.ts +0 -32
  153. package/src/actions/public/getTransaction.bench.ts +0 -33
  154. package/src/actions/public/getTransaction.test.ts +0 -311
  155. package/src/actions/public/getTransaction.ts +0 -95
  156. package/src/actions/public/getTransactionConfirmations.test.ts +0 -69
  157. package/src/actions/public/getTransactionConfirmations.ts +0 -38
  158. package/src/actions/public/getTransactionCount.test.ts +0 -56
  159. package/src/actions/public/getTransactionCount.ts +0 -34
  160. package/src/actions/public/getTransactionReceipt.bench.ts +0 -33
  161. package/src/actions/public/getTransactionReceipt.test.ts +0 -179
  162. package/src/actions/public/getTransactionReceipt.ts +0 -34
  163. package/src/actions/public/index.test.ts +0 -43
  164. package/src/actions/public/index.ts +0 -146
  165. package/src/actions/public/multicall.test.ts +0 -452
  166. package/src/actions/public/multicall.ts +0 -108
  167. package/src/actions/public/readContract.test.ts +0 -328
  168. package/src/actions/public/readContract.ts +0 -73
  169. package/src/actions/public/simulateContract.bench.ts +0 -41
  170. package/src/actions/public/simulateContract.test.ts +0 -410
  171. package/src/actions/public/simulateContract.ts +0 -91
  172. package/src/actions/public/uninstallFilter.bench.ts +0 -13
  173. package/src/actions/public/uninstallFilter.test.ts +0 -65
  174. package/src/actions/public/uninstallFilter.ts +0 -17
  175. package/src/actions/public/waitForTransactionReceipt.test.ts +0 -322
  176. package/src/actions/public/waitForTransactionReceipt.ts +0 -170
  177. package/src/actions/public/watchBlockNumber.test.ts +0 -166
  178. package/src/actions/public/watchBlockNumber.ts +0 -79
  179. package/src/actions/public/watchBlocks.test.ts +0 -210
  180. package/src/actions/public/watchBlocks.ts +0 -114
  181. package/src/actions/public/watchContractEvent.test.ts +0 -305
  182. package/src/actions/public/watchContractEvent.ts +0 -108
  183. package/src/actions/public/watchEvent.test.ts +0 -195
  184. package/src/actions/public/watchEvent.ts +0 -95
  185. package/src/actions/public/watchPendingTransactions.test.ts +0 -116
  186. package/src/actions/public/watchPendingTransactions.ts +0 -74
  187. package/src/actions/test/dropTransaction.test.ts +0 -34
  188. package/src/actions/test/dropTransaction.ts +0 -17
  189. package/src/actions/test/getAutomine.test.ts +0 -14
  190. package/src/actions/test/getAutomine.ts +0 -11
  191. package/src/actions/test/getTxpoolContent.test.ts +0 -45
  192. package/src/actions/test/getTxpoolContent.ts +0 -7
  193. package/src/actions/test/getTxpoolStatus.test.ts +0 -41
  194. package/src/actions/test/getTxpoolStatus.ts +0 -12
  195. package/src/actions/test/impersonateAccount.test.ts +0 -26
  196. package/src/actions/test/impersonateAccount.ts +0 -17
  197. package/src/actions/test/increaseTime.test.ts +0 -18
  198. package/src/actions/test/increaseTime.ts +0 -17
  199. package/src/actions/test/index.test.ts +0 -38
  200. package/src/actions/test/index.ts +0 -77
  201. package/src/actions/test/inspectTxpool.test.ts +0 -50
  202. package/src/actions/test/inspectTxpool.ts +0 -7
  203. package/src/actions/test/mine.test.ts +0 -20
  204. package/src/actions/test/mine.ts +0 -16
  205. package/src/actions/test/removeBlockTimestampInterval.test.ts +0 -23
  206. package/src/actions/test/removeBlockTimestampInterval.ts +0 -7
  207. package/src/actions/test/reset.test.ts +0 -19
  208. package/src/actions/test/reset.ts +0 -18
  209. package/src/actions/test/revert.test.ts +0 -39
  210. package/src/actions/test/revert.ts +0 -14
  211. package/src/actions/test/sendUnsignedTransaction.test.ts +0 -52
  212. package/src/actions/test/sendUnsignedTransaction.ts +0 -19
  213. package/src/actions/test/setAutomine.test.ts +0 -14
  214. package/src/actions/test/setAutomine.ts +0 -8
  215. package/src/actions/test/setBalance.test.ts +0 -29
  216. package/src/actions/test/setBalance.ts +0 -20
  217. package/src/actions/test/setBlockGasLimit.test.ts +0 -21
  218. package/src/actions/test/setBlockGasLimit.ts +0 -17
  219. package/src/actions/test/setBlockTimestampInterval.test.ts +0 -23
  220. package/src/actions/test/setBlockTimestampInterval.ts +0 -16
  221. package/src/actions/test/setCode.test.ts +0 -26
  222. package/src/actions/test/setCode.ts +0 -19
  223. package/src/actions/test/setCoinbase.test.ts +0 -11
  224. package/src/actions/test/setCoinbase.ts +0 -17
  225. package/src/actions/test/setIntervalMining.test.ts +0 -30
  226. package/src/actions/test/setIntervalMining.ts +0 -16
  227. package/src/actions/test/setLoggingEnabled.test.ts +0 -10
  228. package/src/actions/test/setLoggingEnabled.ts +0 -8
  229. package/src/actions/test/setMinGasPrice.test.ts +0 -22
  230. package/src/actions/test/setMinGasPrice.ts +0 -17
  231. package/src/actions/test/setNextBlockBaseFeePerGas.test.ts +0 -23
  232. package/src/actions/test/setNextBlockBaseFeePerGas.ts +0 -17
  233. package/src/actions/test/setNextBlockTimestamp.test.ts +0 -19
  234. package/src/actions/test/setNextBlockTimestamp.ts +0 -17
  235. package/src/actions/test/setNonce.test.ts +0 -28
  236. package/src/actions/test/setNonce.ts +0 -20
  237. package/src/actions/test/setRpcUrl.test.ts +0 -9
  238. package/src/actions/test/setRpcUrl.ts +0 -8
  239. package/src/actions/test/setStorageAt.test.ts +0 -36
  240. package/src/actions/test/setStorageAt.ts +0 -26
  241. package/src/actions/test/snapshot.test.ts +0 -18
  242. package/src/actions/test/snapshot.ts +0 -7
  243. package/src/actions/test/stopImpersonatingAccount.test.ts +0 -29
  244. package/src/actions/test/stopImpersonatingAccount.ts +0 -17
  245. package/src/actions/wallet/addChain.test.ts +0 -14
  246. package/src/actions/wallet/addChain.ts +0 -21
  247. package/src/actions/wallet/deployContract.test.ts +0 -55
  248. package/src/actions/wallet/deployContract.ts +0 -38
  249. package/src/actions/wallet/getAccounts.test.ts +0 -22
  250. package/src/actions/wallet/getAccounts.ts +0 -7
  251. package/src/actions/wallet/getPermissions.test.ts +0 -24
  252. package/src/actions/wallet/getPermissions.ts +0 -9
  253. package/src/actions/wallet/index.test.ts +0 -21
  254. package/src/actions/wallet/index.ts +0 -36
  255. package/src/actions/wallet/requestAccounts.test.ts +0 -13
  256. package/src/actions/wallet/requestAccounts.ts +0 -7
  257. package/src/actions/wallet/requestPermissions.test.ts +0 -26
  258. package/src/actions/wallet/requestPermissions.ts +0 -19
  259. package/src/actions/wallet/sendTransaction.bench.ts +0 -57
  260. package/src/actions/wallet/sendTransaction.test.ts +0 -440
  261. package/src/actions/wallet/sendTransaction.ts +0 -77
  262. package/src/actions/wallet/signMessage.test.ts +0 -61
  263. package/src/actions/wallet/signMessage.ts +0 -35
  264. package/src/actions/wallet/switchChain.test.ts +0 -21
  265. package/src/actions/wallet/switchChain.ts +0 -19
  266. package/src/actions/wallet/watchAsset.test.ts +0 -40
  267. package/src/actions/wallet/watchAsset.ts +0 -16
  268. package/src/actions/wallet/writeContract.test.ts +0 -84
  269. package/src/actions/wallet/writeContract.ts +0 -47
  270. package/src/chains.test.ts +0 -439
  271. package/src/chains.ts +0 -99
  272. package/src/clients/createClient.test.ts +0 -295
  273. package/src/clients/createClient.ts +0 -81
  274. package/src/clients/createPublicClient.test.ts +0 -165
  275. package/src/clients/createPublicClient.ts +0 -49
  276. package/src/clients/createTestClient.test.ts +0 -145
  277. package/src/clients/createTestClient.ts +0 -72
  278. package/src/clients/createWalletClient.test.ts +0 -121
  279. package/src/clients/createWalletClient.ts +0 -54
  280. package/src/clients/index.test.ts +0 -19
  281. package/src/clients/index.ts +0 -31
  282. package/src/clients/transports/createTransport.test.ts +0 -58
  283. package/src/clients/transports/createTransport.ts +0 -48
  284. package/src/clients/transports/custom.test.ts +0 -98
  285. package/src/clients/transports/custom.ts +0 -34
  286. package/src/clients/transports/fallback.test.ts +0 -393
  287. package/src/clients/transports/fallback.ts +0 -58
  288. package/src/clients/transports/http.test.ts +0 -109
  289. package/src/clients/transports/http.ts +0 -51
  290. package/src/clients/transports/index.test.ts +0 -15
  291. package/src/clients/transports/index.ts +0 -17
  292. package/src/clients/transports/webSocket.test.ts +0 -164
  293. package/src/clients/transports/webSocket.ts +0 -118
  294. package/src/constants/abis.test.ts +0 -53
  295. package/src/constants/abis.ts +0 -44
  296. package/src/constants/index.test.ts +0 -14
  297. package/src/constants/index.ts +0 -3
  298. package/src/constants/solidity.test.ts +0 -41
  299. package/src/constants/solidity.ts +0 -35
  300. package/src/contract.test.ts +0 -32
  301. package/src/contract.ts +0 -68
  302. package/src/ens.test.ts +0 -15
  303. package/src/ens.ts +0 -8
  304. package/src/errors/abi.test.ts +0 -81
  305. package/src/errors/abi.ts +0 -254
  306. package/src/errors/address.test.ts +0 -14
  307. package/src/errors/address.ts +0 -9
  308. package/src/errors/base.test.ts +0 -114
  309. package/src/errors/base.ts +0 -57
  310. package/src/errors/block.test.ts +0 -24
  311. package/src/errors/block.ts +0 -18
  312. package/src/errors/chain.test.ts +0 -46
  313. package/src/errors/chain.ts +0 -33
  314. package/src/errors/contract.test.ts +0 -233
  315. package/src/errors/contract.ts +0 -178
  316. package/src/errors/data.ts +0 -20
  317. package/src/errors/encoding.ts +0 -60
  318. package/src/errors/index.ts +0 -82
  319. package/src/errors/log.ts +0 -8
  320. package/src/errors/request.test.ts +0 -330
  321. package/src/errors/request.ts +0 -163
  322. package/src/errors/rpc.test.ts +0 -87
  323. package/src/errors/rpc.ts +0 -113
  324. package/src/errors/transaction.test.ts +0 -83
  325. package/src/errors/transaction.ts +0 -54
  326. package/src/errors/transport.test.ts +0 -11
  327. package/src/errors/transport.ts +0 -12
  328. package/src/index.test.ts +0 -116
  329. package/src/index.ts +0 -132
  330. package/src/public.test.ts +0 -36
  331. package/src/public.ts +0 -76
  332. package/src/test.test.ts +0 -38
  333. package/src/test.ts +0 -52
  334. package/src/types/block.ts +0 -71
  335. package/src/types/chain.ts +0 -6
  336. package/src/types/contract.ts +0 -497
  337. package/src/types/eip1193.ts +0 -1041
  338. package/src/types/fee.ts +0 -47
  339. package/src/types/filter.ts +0 -8
  340. package/src/types/formatter.ts +0 -23
  341. package/src/types/index.ts +0 -84
  342. package/src/types/log.ts +0 -22
  343. package/src/types/misc.ts +0 -5
  344. package/src/types/multicall.ts +0 -82
  345. package/src/types/rpc.ts +0 -35
  346. package/src/types/transaction.ts +0 -145
  347. package/src/types/utils.ts +0 -88
  348. package/src/types/window.ts +0 -9
  349. package/src/utils/abi/decodeAbi.bench.ts +0 -135
  350. package/src/utils/abi/decodeAbi.test.ts +0 -1614
  351. package/src/utils/abi/decodeAbi.ts +0 -300
  352. package/src/utils/abi/decodeDeployData.test.ts +0 -151
  353. package/src/utils/abi/decodeDeployData.ts +0 -44
  354. package/src/utils/abi/decodeErrorResult.test.ts +0 -230
  355. package/src/utils/abi/decodeErrorResult.ts +0 -45
  356. package/src/utils/abi/decodeEventLog.test.ts +0 -542
  357. package/src/utils/abi/decodeEventLog.ts +0 -107
  358. package/src/utils/abi/decodeFunctionData.test.ts +0 -138
  359. package/src/utils/abi/decodeFunctionData.ts +0 -32
  360. package/src/utils/abi/decodeFunctionResult.test.ts +0 -333
  361. package/src/utils/abi/decodeFunctionResult.ts +0 -57
  362. package/src/utils/abi/encodeAbi.bench.ts +0 -163
  363. package/src/utils/abi/encodeAbi.test.ts +0 -1447
  364. package/src/utils/abi/encodeAbi.ts +0 -273
  365. package/src/utils/abi/encodeDeployData.test.ts +0 -124
  366. package/src/utils/abi/encodeDeployData.ts +0 -40
  367. package/src/utils/abi/encodeErrorResult.test.ts +0 -192
  368. package/src/utils/abi/encodeErrorResult.ts +0 -47
  369. package/src/utils/abi/encodeEventTopics.test.ts +0 -345
  370. package/src/utils/abi/encodeEventTopics.ts +0 -75
  371. package/src/utils/abi/encodeFunctionData.test.ts +0 -138
  372. package/src/utils/abi/encodeFunctionData.ts +0 -42
  373. package/src/utils/abi/encodeFunctionResult.test.ts +0 -279
  374. package/src/utils/abi/encodeFunctionResult.ts +0 -41
  375. package/src/utils/abi/formatAbiItem.test.ts +0 -335
  376. package/src/utils/abi/formatAbiItem.ts +0 -41
  377. package/src/utils/abi/formatAbiItemWithArgs.test.ts +0 -291
  378. package/src/utils/abi/formatAbiItemWithArgs.ts +0 -27
  379. package/src/utils/abi/getAbiItem.test.ts +0 -547
  380. package/src/utils/abi/getAbiItem.ts +0 -95
  381. package/src/utils/abi/index.test.ts +0 -24
  382. package/src/utils/abi/index.ts +0 -48
  383. package/src/utils/address/getAddress.bench.ts +0 -22
  384. package/src/utils/address/getAddress.test.ts +0 -46
  385. package/src/utils/address/getAddress.ts +0 -28
  386. package/src/utils/address/getContractAddress.bench.ts +0 -20
  387. package/src/utils/address/getContractAddress.test.ts +0 -78
  388. package/src/utils/address/getContractAddress.ts +0 -59
  389. package/src/utils/address/index.test.ts +0 -17
  390. package/src/utils/address/index.ts +0 -16
  391. package/src/utils/address/isAddress.test.ts +0 -10
  392. package/src/utils/address/isAddress.ts +0 -10
  393. package/src/utils/address/isAddressEqual.test.ts +0 -55
  394. package/src/utils/address/isAddressEqual.ts +0 -6
  395. package/src/utils/buildRequest.test.ts +0 -428
  396. package/src/utils/buildRequest.ts +0 -72
  397. package/src/utils/chain.test.ts +0 -43
  398. package/src/utils/chain.ts +0 -8
  399. package/src/utils/contract/extractFunctionParts.test.ts +0 -109
  400. package/src/utils/contract/extractFunctionParts.ts +0 -27
  401. package/src/utils/contract/getContractError.test.ts +0 -282
  402. package/src/utils/contract/getContractError.ts +0 -58
  403. package/src/utils/contract/index.test.ts +0 -15
  404. package/src/utils/contract/index.ts +0 -8
  405. package/src/utils/data/concat.test.ts +0 -35
  406. package/src/utils/data/concat.ts +0 -34
  407. package/src/utils/data/index.test.ts +0 -23
  408. package/src/utils/data/index.ts +0 -13
  409. package/src/utils/data/isBytes.test.ts +0 -9
  410. package/src/utils/data/isBytes.ts +0 -7
  411. package/src/utils/data/isHex.test.ts +0 -13
  412. package/src/utils/data/isHex.ts +0 -5
  413. package/src/utils/data/pad.bench.ts +0 -30
  414. package/src/utils/data/pad.test.ts +0 -367
  415. package/src/utils/data/pad.ts +0 -53
  416. package/src/utils/data/size.test.ts +0 -18
  417. package/src/utils/data/size.ts +0 -13
  418. package/src/utils/data/slice.test.ts +0 -203
  419. package/src/utils/data/slice.ts +0 -60
  420. package/src/utils/data/trim.bench.ts +0 -34
  421. package/src/utils/data/trim.test.ts +0 -175
  422. package/src/utils/data/trim.ts +0 -33
  423. package/src/utils/encoding/decodeBytes.bench.ts +0 -40
  424. package/src/utils/encoding/decodeBytes.test.ts +0 -144
  425. package/src/utils/encoding/decodeBytes.ts +0 -63
  426. package/src/utils/encoding/decodeHex.bench.ts +0 -24
  427. package/src/utils/encoding/decodeHex.test.ts +0 -167
  428. package/src/utils/encoding/decodeHex.ts +0 -76
  429. package/src/utils/encoding/decodeRlp.bench.ts +0 -34
  430. package/src/utils/encoding/decodeRlp.test.ts +0 -350
  431. package/src/utils/encoding/decodeRlp.ts +0 -121
  432. package/src/utils/encoding/encodeBytes.bench.ts +0 -29
  433. package/src/utils/encoding/encodeBytes.test.ts +0 -676
  434. package/src/utils/encoding/encodeBytes.ts +0 -59
  435. package/src/utils/encoding/encodeHex.bench.ts +0 -49
  436. package/src/utils/encoding/encodeHex.test.ts +0 -232
  437. package/src/utils/encoding/encodeHex.ts +0 -104
  438. package/src/utils/encoding/encodeRlp.bench.ts +0 -54
  439. package/src/utils/encoding/encodeRlp.test.ts +0 -254
  440. package/src/utils/encoding/encodeRlp.ts +0 -48
  441. package/src/utils/encoding/index.test.ts +0 -32
  442. package/src/utils/encoding/index.ts +0 -36
  443. package/src/utils/ens/index.test.ts +0 -14
  444. package/src/utils/ens/index.ts +0 -7
  445. package/src/utils/ens/labelhash.test.ts +0 -55
  446. package/src/utils/ens/labelhash.ts +0 -16
  447. package/src/utils/ens/namehash.test.ts +0 -65
  448. package/src/utils/ens/namehash.ts +0 -28
  449. package/src/utils/ens/normalize.bench.ts +0 -14
  450. package/src/utils/ens/normalize.test.ts +0 -35
  451. package/src/utils/ens/normalize.ts +0 -14
  452. package/src/utils/ens/packetToBytes.test.ts +0 -11
  453. package/src/utils/ens/packetToBytes.ts +0 -29
  454. package/src/utils/formatters/block.bench.ts +0 -51
  455. package/src/utils/formatters/block.test.ts +0 -115
  456. package/src/utils/formatters/block.ts +0 -37
  457. package/src/utils/formatters/extract.test.ts +0 -14
  458. package/src/utils/formatters/extract.ts +0 -18
  459. package/src/utils/formatters/feeHistory.test.ts +0 -66
  460. package/src/utils/formatters/feeHistory.ts +0 -12
  461. package/src/utils/formatters/format.test.ts +0 -93
  462. package/src/utils/formatters/format.ts +0 -90
  463. package/src/utils/formatters/index.test.ts +0 -27
  464. package/src/utils/formatters/index.ts +0 -34
  465. package/src/utils/formatters/log.test.ts +0 -79
  466. package/src/utils/formatters/log.ts +0 -12
  467. package/src/utils/formatters/transaction.test.ts +0 -271
  468. package/src/utils/formatters/transaction.ts +0 -63
  469. package/src/utils/formatters/transactionReceipt.bench.ts +0 -73
  470. package/src/utils/formatters/transactionReceipt.test.ts +0 -151
  471. package/src/utils/formatters/transactionReceipt.ts +0 -63
  472. package/src/utils/formatters/transactionRequest.bench.ts +0 -29
  473. package/src/utils/formatters/transactionRequest.test.ts +0 -237
  474. package/src/utils/formatters/transactionRequest.ts +0 -56
  475. package/src/utils/hash/getEventSignature.test.ts +0 -61
  476. package/src/utils/hash/getEventSignature.ts +0 -4
  477. package/src/utils/hash/getFunctionSignature.test.ts +0 -22
  478. package/src/utils/hash/getFunctionSignature.ts +0 -5
  479. package/src/utils/hash/hashFunction.test.ts +0 -65
  480. package/src/utils/hash/hashFunction.ts +0 -12
  481. package/src/utils/hash/index.test.ts +0 -13
  482. package/src/utils/hash/index.ts +0 -5
  483. package/src/utils/hash/keccak256.test.ts +0 -59
  484. package/src/utils/hash/keccak256.ts +0 -21
  485. package/src/utils/index.test.ts +0 -111
  486. package/src/utils/index.ts +0 -142
  487. package/src/utils/observe.test.ts +0 -176
  488. package/src/utils/observe.ts +0 -66
  489. package/src/utils/poll.test.ts +0 -127
  490. package/src/utils/poll.ts +0 -42
  491. package/src/utils/promise/index.test.ts +0 -14
  492. package/src/utils/promise/index.ts +0 -3
  493. package/src/utils/promise/withCache.test.ts +0 -97
  494. package/src/utils/promise/withCache.ts +0 -73
  495. package/src/utils/promise/withRetry.test.ts +0 -231
  496. package/src/utils/promise/withRetry.ts +0 -61
  497. package/src/utils/promise/withTimeout.test.ts +0 -37
  498. package/src/utils/promise/withTimeout.ts +0 -39
  499. package/src/utils/rpc.test.ts +0 -990
  500. package/src/utils/rpc.ts +0 -294
  501. package/src/utils/stringify.test.ts +0 -13
  502. package/src/utils/stringify.ts +0 -5
  503. package/src/utils/uid.ts +0 -14
  504. package/src/utils/unit/constants.test.ts +0 -22
  505. package/src/utils/unit/constants.ts +0 -12
  506. package/src/utils/unit/formatEther.test.ts +0 -75
  507. package/src/utils/unit/formatEther.ts +0 -6
  508. package/src/utils/unit/formatGwei.test.ts +0 -32
  509. package/src/utils/unit/formatGwei.ts +0 -6
  510. package/src/utils/unit/formatUnit.bench.ts +0 -21
  511. package/src/utils/unit/formatUnit.test.ts +0 -40
  512. package/src/utils/unit/formatUnit.ts +0 -16
  513. package/src/utils/unit/index.test.ts +0 -28
  514. package/src/utils/unit/index.ts +0 -7
  515. package/src/utils/unit/parseEther.test.ts +0 -126
  516. package/src/utils/unit/parseEther.ts +0 -6
  517. package/src/utils/unit/parseGwei.test.ts +0 -50
  518. package/src/utils/unit/parseGwei.ts +0 -6
  519. package/src/utils/unit/parseUnit.bench.ts +0 -21
  520. package/src/utils/unit/parseUnit.test.ts +0 -54
  521. package/src/utils/unit/parseUnit.ts +0 -27
  522. package/src/utils/wait.ts +0 -3
  523. package/src/wallet.test.ts +0 -19
  524. package/src/wallet.ts +0 -23
  525. package/src/window.ts +0 -1
package/dist/test.mjs CHANGED
@@ -1,236 +1,33 @@
1
1
  import {
2
- formatTransactionRequest,
3
- hexToNumber,
4
- numberToHex
5
- } from "./chunk-SD5X7F4U.mjs";
6
-
7
- // src/actions/test/dropTransaction.ts
8
- async function dropTransaction(client, { hash }) {
9
- return await client.request({
10
- method: `${client.mode}_dropTransaction`,
11
- params: [hash]
12
- });
13
- }
14
-
15
- // src/actions/test/getAutomine.ts
16
- async function getAutomine(client) {
17
- return await client.request({
18
- method: `${client.mode}_getAutomine`
19
- });
20
- }
21
-
22
- // src/actions/test/getTxpoolContent.ts
23
- async function getTxpoolContent(client) {
24
- return await client.request({
25
- method: "txpool_content"
26
- });
27
- }
28
-
29
- // src/actions/test/getTxpoolStatus.ts
30
- async function getTxpoolStatus(client) {
31
- const { pending, queued } = await client.request({
32
- method: "txpool_status"
33
- });
34
- return {
35
- pending: hexToNumber(pending),
36
- queued: hexToNumber(queued)
37
- };
38
- }
39
-
40
- // src/actions/test/impersonateAccount.ts
41
- async function impersonateAccount(client, { address }) {
42
- return await client.request({
43
- method: `${client.mode}_impersonateAccount`,
44
- params: [address]
45
- });
46
- }
47
-
48
- // src/actions/test/increaseTime.ts
49
- async function increaseTime(client, { seconds }) {
50
- return await client.request({
51
- method: "evm_increaseTime",
52
- params: [numberToHex(seconds)]
53
- });
54
- }
55
-
56
- // src/actions/test/inspectTxpool.ts
57
- async function inspectTxpool(client) {
58
- return await client.request({
59
- method: "txpool_inspect"
60
- });
61
- }
62
-
63
- // src/actions/test/mine.ts
64
- async function mine(client, { blocks, interval }) {
65
- return await client.request({
66
- method: `${client.mode}_mine`,
67
- params: [numberToHex(blocks), numberToHex(interval || 0)]
68
- });
69
- }
70
-
71
- // src/actions/test/removeBlockTimestampInterval.ts
72
- async function removeBlockTimestampInterval(client) {
73
- return await client.request({
74
- method: `${client.mode}_removeBlockTimestampInterval`
75
- });
76
- }
77
-
78
- // src/actions/test/reset.ts
79
- async function reset(client, { blockNumber, jsonRpcUrl } = {}) {
80
- return await client.request({
81
- method: `${client.mode}_reset`,
82
- params: [{ forking: { blockNumber: Number(blockNumber), jsonRpcUrl } }]
83
- });
84
- }
85
-
86
- // src/actions/test/revert.ts
87
- async function revert(client, { id }) {
88
- return await client.request({
89
- method: "evm_revert",
90
- params: [id]
91
- });
92
- }
93
-
94
- // src/actions/test/sendUnsignedTransaction.ts
95
- async function sendUnsignedTransaction(client, request) {
96
- const request_ = formatTransactionRequest(request);
97
- const hash = await client.request({
98
- method: "eth_sendUnsignedTransaction",
99
- params: [request_]
100
- });
101
- return hash;
102
- }
103
-
104
- // src/actions/test/setAutomine.ts
105
- async function setAutomine(client, enabled) {
106
- return await client.request({
107
- method: "evm_setAutomine",
108
- params: [enabled]
109
- });
110
- }
111
-
112
- // src/actions/test/setBalance.ts
113
- async function setBalance(client, { address, value }) {
114
- return await client.request({
115
- method: `${client.mode}_setBalance`,
116
- params: [address, numberToHex(value)]
117
- });
118
- }
119
-
120
- // src/actions/test/setBlockGasLimit.ts
121
- async function setBlockGasLimit(client, { gasLimit }) {
122
- return await client.request({
123
- method: "evm_setBlockGasLimit",
124
- params: [numberToHex(gasLimit)]
125
- });
126
- }
127
-
128
- // src/actions/test/setBlockTimestampInterval.ts
129
- async function setBlockTimestampInterval(client, { interval }) {
130
- return await client.request({
131
- method: `${client.mode}_setBlockTimestampInterval`,
132
- params: [interval]
133
- });
134
- }
135
-
136
- // src/actions/test/setCode.ts
137
- async function setCode(client, { address, bytecode }) {
138
- return await client.request({
139
- method: `${client.mode}_setCode`,
140
- params: [address, bytecode]
141
- });
142
- }
143
-
144
- // src/actions/test/setCoinbase.ts
145
- async function setCoinbase(client, { address }) {
146
- return await client.request({
147
- method: `${client.mode}_setCoinbase`,
148
- params: [address]
149
- });
150
- }
151
-
152
- // src/actions/test/setIntervalMining.ts
153
- async function setIntervalMining(client, { interval }) {
154
- return await client.request({
155
- method: "evm_setIntervalMining",
156
- params: [interval]
157
- });
158
- }
159
-
160
- // src/actions/test/setLoggingEnabled.ts
161
- async function setLoggingEnabled(client, enabled) {
162
- return await client.request({
163
- method: `${client.mode}_setLoggingEnabled`,
164
- params: [enabled]
165
- });
166
- }
167
-
168
- // src/actions/test/setMinGasPrice.ts
169
- async function setMinGasPrice(client, { gasPrice }) {
170
- return await client.request({
171
- method: `${client.mode}_setMinGasPrice`,
172
- params: [numberToHex(gasPrice)]
173
- });
174
- }
175
-
176
- // src/actions/test/setNextBlockBaseFeePerGas.ts
177
- async function setNextBlockBaseFeePerGas(client, { baseFeePerGas }) {
178
- return await client.request({
179
- method: `${client.mode}_setNextBlockBaseFeePerGas`,
180
- params: [numberToHex(baseFeePerGas)]
181
- });
182
- }
183
-
184
- // src/actions/test/setNextBlockTimestamp.ts
185
- async function setNextBlockTimestamp(client, { timestamp }) {
186
- return await client.request({
187
- method: "evm_setNextBlockTimestamp",
188
- params: [numberToHex(timestamp)]
189
- });
190
- }
191
-
192
- // src/actions/test/setNonce.ts
193
- async function setNonce(client, { address, nonce }) {
194
- return await client.request({
195
- method: `${client.mode}_setNonce`,
196
- params: [address, numberToHex(nonce)]
197
- });
198
- }
199
-
200
- // src/actions/test/setRpcUrl.ts
201
- async function setRpcUrl(client, jsonRpcUrl) {
202
- return await client.request({
203
- method: `${client.mode}_setRpcUrl`,
204
- params: [jsonRpcUrl]
205
- });
206
- }
207
-
208
- // src/actions/test/setStorageAt.ts
209
- async function setStorageAt(client, { address, index, value }) {
210
- return await client.request({
211
- method: `${client.mode}_setStorageAt`,
212
- params: [
213
- address,
214
- typeof index === "number" ? numberToHex(index) : index,
215
- value
216
- ]
217
- });
218
- }
219
-
220
- // src/actions/test/snapshot.ts
221
- async function snapshot(client) {
222
- return await client.request({
223
- method: "evm_snapshot"
224
- });
225
- }
226
-
227
- // src/actions/test/stopImpersonatingAccount.ts
228
- async function stopImpersonatingAccount(client, { address }) {
229
- return await client.request({
230
- method: `${client.mode}_stopImpersonatingAccount`,
231
- params: [address]
232
- });
233
- }
2
+ dropTransaction,
3
+ getAutomine,
4
+ getTxpoolContent,
5
+ getTxpoolStatus,
6
+ impersonateAccount,
7
+ increaseTime,
8
+ inspectTxpool,
9
+ mine,
10
+ removeBlockTimestampInterval,
11
+ reset,
12
+ revert,
13
+ sendUnsignedTransaction,
14
+ setAutomine,
15
+ setBalance,
16
+ setBlockGasLimit,
17
+ setBlockTimestampInterval,
18
+ setCode,
19
+ setCoinbase,
20
+ setIntervalMining,
21
+ setLoggingEnabled,
22
+ setMinGasPrice,
23
+ setNextBlockBaseFeePerGas,
24
+ setNextBlockTimestamp,
25
+ setNonce,
26
+ setRpcUrl,
27
+ setStorageAt,
28
+ snapshot,
29
+ stopImpersonatingAccount
30
+ } from "./chunk-I7AINPMM.mjs";
234
31
  export {
235
32
  dropTransaction,
236
33
  getAutomine,
package/dist/test.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/actions/test/dropTransaction.ts","../src/actions/test/getAutomine.ts","../src/actions/test/getTxpoolContent.ts","../src/actions/test/getTxpoolStatus.ts","../src/actions/test/impersonateAccount.ts","../src/actions/test/increaseTime.ts","../src/actions/test/inspectTxpool.ts","../src/actions/test/mine.ts","../src/actions/test/removeBlockTimestampInterval.ts","../src/actions/test/reset.ts","../src/actions/test/revert.ts","../src/actions/test/sendUnsignedTransaction.ts","../src/actions/test/setAutomine.ts","../src/actions/test/setBalance.ts","../src/actions/test/setBlockGasLimit.ts","../src/actions/test/setBlockTimestampInterval.ts","../src/actions/test/setCode.ts","../src/actions/test/setCoinbase.ts","../src/actions/test/setIntervalMining.ts","../src/actions/test/setLoggingEnabled.ts","../src/actions/test/setMinGasPrice.ts","../src/actions/test/setNextBlockBaseFeePerGas.ts","../src/actions/test/setNextBlockTimestamp.ts","../src/actions/test/setNonce.ts","../src/actions/test/setRpcUrl.ts","../src/actions/test/setStorageAt.ts","../src/actions/test/snapshot.ts","../src/actions/test/stopImpersonatingAccount.ts"],"sourcesContent":["import type { TestClient } from '../../clients'\nimport type { Hash } from '../../types'\n\nexport type DropTransactionArgs = {\n /** The hash of the transaction to drop. */\n hash: Hash\n}\n\nexport async function dropTransaction(\n client: TestClient,\n { hash }: DropTransactionArgs,\n) {\n return await client.request({\n method: `${client.mode}_dropTransaction`,\n params: [hash],\n })\n}\n","import type { TestClient } from '../../clients'\n\nexport type GetAutomineResponse = boolean\n\nexport async function getAutomine(\n client: TestClient,\n): Promise<GetAutomineResponse> {\n return await client.request({\n method: `${client.mode}_getAutomine`,\n })\n}\n","import type { TestClient } from '../../clients'\n\nexport async function getTxpoolContent(client: TestClient) {\n return await client.request({\n method: 'txpool_content',\n })\n}\n","import type { TestClient } from '../../clients'\nimport { hexToNumber } from '../../utils'\n\nexport async function getTxpoolStatus(client: TestClient) {\n const { pending, queued } = await client.request({\n method: 'txpool_status',\n })\n return {\n pending: hexToNumber(pending),\n queued: hexToNumber(queued),\n }\n}\n","import type { TestClient } from '../../clients'\nimport type { Address } from '../../types'\n\nexport type ImpersonateAccountArgs = {\n /** The account to impersonate. */\n address: Address\n}\n\nexport async function impersonateAccount(\n client: TestClient,\n { address }: ImpersonateAccountArgs,\n) {\n return await client.request({\n method: `${client.mode}_impersonateAccount`,\n params: [address],\n })\n}\n","import type { TestClient } from '../../clients'\nimport { numberToHex } from '../../utils'\n\nexport type IncreaseTimeArgs = {\n /** The amount of seconds to jump forward in time. */\n seconds: number\n}\n\nexport async function increaseTime(\n client: TestClient,\n { seconds }: IncreaseTimeArgs,\n) {\n return await client.request({\n method: 'evm_increaseTime',\n params: [numberToHex(seconds)],\n })\n}\n","import type { TestClient } from '../../clients'\n\nexport async function inspectTxpool(client: TestClient) {\n return await client.request({\n method: 'txpool_inspect',\n })\n}\n","import type { TestClient } from '../../clients'\nimport { numberToHex } from '../../utils'\n\nexport type MineArgs = {\n /** Number of blocks to mine. */\n blocks: number\n /** Interval between each block in seconds. */\n interval?: number\n}\n\nexport async function mine(client: TestClient, { blocks, interval }: MineArgs) {\n return await client.request({\n method: `${client.mode}_mine`,\n params: [numberToHex(blocks), numberToHex(interval || 0)],\n })\n}\n","import type { TestClient } from '../../clients'\n\nexport async function removeBlockTimestampInterval(client: TestClient) {\n return await client.request({\n method: `${client.mode}_removeBlockTimestampInterval`,\n })\n}\n","import type { TestClient } from '../../clients'\n\nexport type ResetArgs = {\n /** The block number to reset from. */\n blockNumber?: bigint\n /** The JSON RPC URL. */\n jsonRpcUrl?: string\n}\n\nexport async function reset(\n client: TestClient,\n { blockNumber, jsonRpcUrl }: ResetArgs = {},\n) {\n return await client.request({\n method: `${client.mode}_reset`,\n params: [{ forking: { blockNumber: Number(blockNumber), jsonRpcUrl } }],\n })\n}\n","import type { TestClient } from '../../clients'\nimport type { Quantity } from '../../types'\n\nexport type RevertArgs = {\n /** The snapshot ID to revert to. */\n id: Quantity\n}\n\nexport async function revert(client: TestClient, { id }: RevertArgs) {\n return await client.request({\n method: 'evm_revert',\n params: [id],\n })\n}\n","import type { TestClient } from '../../clients'\nimport type { Hash, TransactionRequest } from '../../types'\nimport { formatTransactionRequest } from '../../utils'\n\nexport type SendUnsignedTransactionArgs = TransactionRequest\n\nexport type SendUnsignedTransactionResponse = Hash\n\nexport async function sendUnsignedTransaction(\n client: TestClient,\n request: SendUnsignedTransactionArgs,\n): Promise<SendUnsignedTransactionResponse> {\n const request_ = formatTransactionRequest(request)\n const hash = await client.request({\n method: 'eth_sendUnsignedTransaction',\n params: [request_],\n })\n return hash\n}\n","import type { TestClient } from '../../clients'\n\nexport async function setAutomine(client: TestClient, enabled: boolean) {\n return await client.request({\n method: 'evm_setAutomine',\n params: [enabled],\n })\n}\n","import type { TestClient } from '../../clients'\nimport type { Address } from '../../types'\nimport { numberToHex } from '../../utils'\n\nexport type SetBalanceArgs = {\n /** The account address. */\n address: Address\n /** Amount (in wei) to set */\n value: bigint\n}\n\nexport async function setBalance(\n client: TestClient,\n { address, value }: SetBalanceArgs,\n) {\n return await client.request({\n method: `${client.mode}_setBalance`,\n params: [address, numberToHex(value)],\n })\n}\n","import type { TestClient } from '../../clients'\nimport { numberToHex } from '../../utils'\n\nexport type SetBlockGasLimitArgs = {\n /** Gas limit (in wei). */\n gasLimit: bigint\n}\n\nexport async function setBlockGasLimit(\n client: TestClient,\n { gasLimit }: SetBlockGasLimitArgs,\n) {\n return await client.request({\n method: 'evm_setBlockGasLimit',\n params: [numberToHex(gasLimit)],\n })\n}\n","import type { TestClient } from '../../clients'\n\nexport type SetBlockTimestampIntervalArgs = {\n /** The interval (in seconds). */\n interval: number\n}\n\nexport async function setBlockTimestampInterval(\n client: TestClient,\n { interval }: SetBlockTimestampIntervalArgs,\n) {\n return await client.request({\n method: `${client.mode}_setBlockTimestampInterval`,\n params: [interval],\n })\n}\n","import type { TestClient } from '../../clients'\nimport type { Address, Hex } from '../../types'\n\nexport type SetCodeArgs = {\n /** The account address. */\n address: Address\n /** The bytecode to set */\n bytecode: Hex\n}\n\nexport async function setCode(\n client: TestClient,\n { address, bytecode }: SetCodeArgs,\n) {\n return await client.request({\n method: `${client.mode}_setCode`,\n params: [address, bytecode],\n })\n}\n","import type { TestClient } from '../../clients'\nimport type { Address } from '../../types'\n\nexport type SetCoinbaseArgs = {\n /** The coinbase address. */\n address: Address\n}\n\nexport async function setCoinbase(\n client: TestClient,\n { address }: SetCoinbaseArgs,\n) {\n return await client.request({\n method: `${client.mode}_setCoinbase`,\n params: [address],\n })\n}\n","import type { TestClient } from '../../clients'\n\nexport type SetIntervalMiningArgs = {\n /** The mining interval. */\n interval: number\n}\n\nexport async function setIntervalMining(\n client: TestClient,\n { interval }: SetIntervalMiningArgs,\n) {\n return await client.request({\n method: 'evm_setIntervalMining',\n params: [interval],\n })\n}\n","import type { TestClient } from '../../clients'\n\nexport async function setLoggingEnabled(client: TestClient, enabled: boolean) {\n return await client.request({\n method: `${client.mode}_setLoggingEnabled`,\n params: [enabled],\n })\n}\n","import type { TestClient } from '../../clients'\nimport { numberToHex } from '../../utils'\n\nexport type SetMinGasPriceArgs = {\n /** The gas price. */\n gasPrice: bigint\n}\n\nexport async function setMinGasPrice(\n client: TestClient,\n { gasPrice }: SetMinGasPriceArgs,\n) {\n return await client.request({\n method: `${client.mode}_setMinGasPrice`,\n params: [numberToHex(gasPrice)],\n })\n}\n","import type { TestClient } from '../../clients'\nimport { numberToHex } from '../../utils'\n\nexport type SetNextBlockBaseFeePerGasArgs = {\n /** Base fee per gas (in wei). */\n baseFeePerGas: bigint\n}\n\nexport async function setNextBlockBaseFeePerGas(\n client: TestClient,\n { baseFeePerGas }: SetNextBlockBaseFeePerGasArgs,\n) {\n return await client.request({\n method: `${client.mode}_setNextBlockBaseFeePerGas`,\n params: [numberToHex(baseFeePerGas)],\n })\n}\n","import type { TestClient } from '../../clients'\nimport { numberToHex } from '../../utils'\n\nexport type SetNextBlockTimestampArgs = {\n /** The timestamp (in seconds). */\n timestamp: bigint\n}\n\nexport async function setNextBlockTimestamp(\n client: TestClient,\n { timestamp }: SetNextBlockTimestampArgs,\n) {\n return await client.request({\n method: 'evm_setNextBlockTimestamp',\n params: [numberToHex(timestamp)],\n })\n}\n","import type { TestClient } from '../../clients'\nimport type { Address } from '../../types'\nimport { numberToHex } from '../../utils'\n\nexport type SetNonceArgs = {\n /** The account address. */\n address: Address\n /** The nonce to set. */\n nonce: number\n}\n\nexport async function setNonce(\n client: TestClient,\n { address, nonce }: SetNonceArgs,\n) {\n return await client.request({\n method: `${client.mode}_setNonce`,\n params: [address, numberToHex(nonce)],\n })\n}\n","import type { TestClient } from '../../clients'\n\nexport async function setRpcUrl(client: TestClient, jsonRpcUrl: string) {\n return await client.request({\n method: `${client.mode}_setRpcUrl`,\n params: [jsonRpcUrl],\n })\n}\n","import type { TestClient } from '../../clients'\nimport type { Address, Hash, Hex } from '../../types'\nimport { numberToHex } from '../../utils'\n\nexport type SetStorageAtArgs = {\n /** The account address. */\n address: Address\n /** The storage slot (index). Can either be a number or hash value. */\n index: number | Hash\n /** The value to store as a 32 byte hex string. */\n value: Hex\n}\n\nexport async function setStorageAt(\n client: TestClient,\n { address, index, value }: SetStorageAtArgs,\n) {\n return await client.request({\n method: `${client.mode}_setStorageAt`,\n params: [\n address,\n typeof index === 'number' ? numberToHex(index) : index,\n value,\n ],\n })\n}\n","import type { TestClient } from '../../clients'\n\nexport async function snapshot(client: TestClient) {\n return await client.request({\n method: 'evm_snapshot',\n })\n}\n","import type { TestClient } from '../../clients'\nimport type { Address } from '../../types'\n\nexport type StopImpersonatingAccountArgs = {\n /** The account to impersonate. */\n address: Address\n}\n\nexport async function stopImpersonatingAccount(\n client: TestClient,\n { address }: StopImpersonatingAccountArgs,\n) {\n return await client.request({\n method: `${client.mode}_stopImpersonatingAccount`,\n params: [address],\n })\n}\n"],"mappings":"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","names":[]}
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,41 +1,21 @@
1
- export { D as DecodeAbiArgs, a as DecodeEventLogArgs, b as DecodeEventLogResponse, c as DecodeFunctionDataArgs, d as DecodeFunctionResultArgs, e as DecodeFunctionResultResponse, E as EncodeAbiArgs, f as EncodeDeployDataArgs, g as EncodeErrorResultArgs, h as EncodeEventTopicsArgs, i as EncodeFunctionDataArgs, j as EncodeFunctionResultArgs, G as GetAbiItemArgs, k as decodeAbi, l as decodeEventLog, m as decodeFunctionData, n as decodeFunctionResult, o as encodeAbi, p as encodeDeployData, q as encodeErrorResult, r as encodeEventTopics, s as encodeFunctionData, t as encodeFunctionResult, v as formatAbiItem, u as formatAbiItemWithArgs, w as getAbiItem } from '../getAbiItem-c8e6e7d4.js';
2
- export { a as DecodeErrorResultArgs, D as DecodeErrorResultResponse, d as decodeErrorResult } from '../decodeErrorResult-0b934d23.js';
3
- import { A as Address, B as ByteArray, H as Hex, O as Formatter } from '../chain-f16512e8.js';
4
- export { W as ExtractFormatter, V as Formatted, Y as FormattedTransaction, Z as TransactionFormatter, _ as defineFormatter, $ as defineTransaction, a0 as format, a1 as formatTransaction, a2 as transactionType } from '../chain-f16512e8.js';
5
- export { d as defineChain } from '../chain-c4ccb458.js';
6
- import { Abi } from 'abitype';
7
- import { B as BaseError, C as ContractFunctionExecutionError } from '../rpc-a5a7f376.js';
8
- export { r as rpc } from '../rpc-a5a7f376.js';
9
- export { B as BlockFormatter, F as FormattedBlock, a as FormattedTransactionReceipt, T as TransactionReceiptFormatter, d as defineBlock, b as defineTransactionReceipt, f as formatBlock } from '../transactionReceipt-2a86c7c7.js';
10
- export { F as FormattedTransactionRequest, T as TransactionRequestFormatter, d as defineTransactionRequest, f as formatTransactionRequest } from '../transactionRequest-c7794f5e.js';
11
- import { j as EventDefinition } from '../contract-9e76e561.js';
12
- import 'abitype/dist/abi-78346466';
13
- import '@wagmi/chains';
1
+ import { Address } from 'abitype';
2
+ export { ParseAbi, ParseAbiItem, ParseAbiParameter, ParseAbiParameters, parseAbi, parseAbiItem, parseAbiParameter, parseAbiParameters } from 'abitype';
3
+ export { D as DecodeAbiParametersReturnType, E as EncodeAbiParametersReturnType, G as GetAbiItemParameters, d as decodeAbiParameters, e as encodeAbiParameters, g as getAbiItem } from '../getAbiItem-159f3263.js';
4
+ export { D as DecodeErrorResultParameters, a as DecodeErrorResultReturnType, b as DecodeEventLogParameters, c as DecodeEventLogReturnType, d as DecodeFunctionDataParameters, e as DecodeFunctionResultParameters, f as DecodeFunctionResultReturnType, E as EncodeDeployDataParameters, g as EncodeErrorResultParameters, h as EncodeEventTopicsParameters, i as EncodeFunctionDataParameters, j as EncodeFunctionResultParameters, k as decodeErrorResult, l as decodeEventLog, m as decodeFunctionData, n as decodeFunctionResult, o as encodeDeployData, p as encodeErrorResult, q as encodeEventTopics, r as encodeFunctionData, s as encodeFunctionResult } from '../encodeFunctionResult-9eb553ce.js';
5
+ export { e as encodePacked } from '../encodePacked-4c019ed8.js';
6
+ export { a as formatAbiItem, f as formatAbiItemWithArgs } from '../formatAbiItem-622d2303.js';
7
+ import { B as BaseError, C as CallExecutionError, E as EstimateGasExecutionError, d as ExecutionRevertedError, F as FeeCapTooHighError, e as FeeCapTooLowError, h as NonceTooHighError, i as NonceTooLowError, N as NonceMaxValueError, I as InsufficientFundsError, f as IntrinsicGasTooHighError, g as IntrinsicGasTooLowError, l as TransactionTypeNotSupportedError, T as TipAboveFeeCapError, U as UnknownNodeError, k as TransactionExecutionError } from '../parseGwei-a2d0d77a.js';
8
+ export { G as GetContractAddressOptions, o as GetCreate2AddressOptions, p as GetCreateAddressOptions, H as HttpOptions, R as RpcResponse, ap as Socket, q as ToRlpReturnType, r as boolToBytes, s as boolToHex, t as bytesToBigint, u as bytesToBool, v as bytesToHex, w as bytesToNumber, x as bytesToString, y as formatEther, z as formatGwei, A as formatUnits, D as fromBytes, J as fromHex, K as fromRlp, L as getAccount, M as getAddress, O as getContractAddress, P as getContractError, Q as getCreate2Address, S as getCreateAddress, V as getEventSelector, X as getFunctionSelector, aq as getSocket, Y as hexToBigInt, Z as hexToBool, _ as hexToBytes, $ as hexToNumber, a0 as hexToString, a1 as isAddress, a2 as isAddressEqual, a3 as isBytes, a4 as isHex, a5 as keccak256, a6 as numberToBytes, a7 as numberToHex, a8 as pad, a9 as padBytes, aa as padHex, ab as parseEther, ac as parseGwei, ad as parseUnits, ar as rpc, ae as size, af as slice, ag as sliceBytes, ah as sliceHex, ai as stringToBytes, aj as stringToHex, ak as stringify, al as toBytes, am as toHex, an as toRlp, ao as trim } from '../parseGwei-a2d0d77a.js';
9
+ export { d as defineChain } from '../chain-a4f98ba3.js';
10
+ import { S as Formatter, C as Chain } from '../chain-819c7ff7.js';
11
+ export { I as ExtractFormatter, J as Formatted, K as FormattedTransaction, M as TransactionFormatter, ac as defineFormatter, N as defineTransaction, ad as format, O as formatTransaction, P as transactionType } from '../chain-819c7ff7.js';
12
+ import { C as CallParameters, E as EstimateGasParameters, S as SendTransactionParameters, W as WalletClient, P as PublicClient } from '../createPublicClient-e2eae0fc.js';
13
+ export { B as BlockFormatter, F as FormattedBlock, e as FormattedTransactionReceipt, f as FormattedTransactionRequest, T as TransactionReceiptFormatter, g as TransactionRequestFormatter, h as defineBlock, i as defineTransactionReceipt, j as defineTransactionRequest, k as formatBlock, l as formatTransactionRequest } from '../createPublicClient-e2eae0fc.js';
14
14
  import 'isomorphic-ws';
15
-
16
- declare function getAddress(address: Address): `0x${string}`;
17
-
18
- type GetCreateAddressOptions = {
19
- from: Address;
20
- nonce: bigint;
21
- };
22
- type GetCreate2AddressOptions = {
23
- bytecode: ByteArray | Hex;
24
- from: Address;
25
- salt: ByteArray | Hex;
26
- };
27
- type GetContractAddressOptions = ({
28
- opcode?: 'CREATE';
29
- } & GetCreateAddressOptions) | ({
30
- opcode: 'CREATE2';
31
- } & GetCreate2AddressOptions);
32
- declare function getContractAddress(opts: GetContractAddressOptions): `0x${string}`;
33
- declare function getCreateAddress(opts: GetCreateAddressOptions): `0x${string}`;
34
- declare function getCreate2Address(opts: GetCreate2AddressOptions): `0x${string}`;
35
-
36
- declare function isAddress(address: Address): boolean;
37
-
38
- declare function isAddressEqual(a: Address, b: Address): boolean;
15
+ import '@wagmi/chains';
16
+ import 'ethers@6/types/providers';
17
+ import '../eip1193-a882d1b8.js';
18
+ import '../createClient-a47ae6f5.js';
39
19
 
40
20
  declare function buildRequest<TRequest extends (args: any) => Promise<any>>(request: TRequest, { retryDelay, retryCount, }?: {
41
21
  retryDelay?: number;
@@ -55,68 +35,6 @@ declare function extractFunctionParams(def: string): {
55
35
  }[] | undefined;
56
36
  declare function extractFunctionType(def: string): string | undefined;
57
37
 
58
- declare function getContractError(err: BaseError, { abi, address, args, docsPath, functionName, sender, }: {
59
- abi: Abi;
60
- args: any;
61
- address?: Address;
62
- docsPath?: string;
63
- functionName: string;
64
- sender?: Address;
65
- }): ContractFunctionExecutionError;
66
-
67
- declare function isBytes(value: any): boolean;
68
-
69
- declare function isHex(value: any): boolean;
70
-
71
- type PadOptions = {
72
- dir?: 'left' | 'right';
73
- size?: number;
74
- };
75
- type PadResult<TValue extends ByteArray | Hex> = TValue extends Hex ? Hex : ByteArray;
76
- declare function pad<TValue extends ByteArray | Hex>(hexOrBytes: TValue, { dir, size }?: PadOptions): PadResult<TValue>;
77
- declare function padHex(hex_: Hex, { dir, size }?: PadOptions): `0x${string}`;
78
- declare function padBytes(bytes: ByteArray, { dir, size }?: PadOptions): Uint8Array;
79
-
80
- type TrimOptions = {
81
- dir?: 'left' | 'right';
82
- };
83
- type TrimResult<TValue extends ByteArray | Hex> = TValue extends Hex ? Hex : ByteArray;
84
- declare function trim<TValue extends ByteArray | Hex>(hexOrBytes: TValue, { dir }?: TrimOptions): TrimResult<TValue>;
85
-
86
- /**
87
- * @description Retrieves the size of the value (in bytes).
88
- *
89
- * @param value The value (hex or byte array) to retrieve the size of.
90
- * @returns The size of the value (in bytes).
91
- */
92
- declare function size(value: Hex | ByteArray): number;
93
-
94
- type SliceResult<TValue extends ByteArray | Hex> = TValue extends Hex ? Hex : ByteArray;
95
- /**
96
- * @description Returns a section of the hex or byte array given a start/end bytes offset.
97
- *
98
- * @param value The hex or byte array to slice.
99
- * @param start The start offset (in bytes).
100
- * @param end The end offset (in bytes).
101
- */
102
- declare function slice<TValue extends ByteArray | Hex>(value: TValue, start?: number, end?: number): SliceResult<TValue>;
103
- /**
104
- * @description Returns a section of the byte array given a start/end bytes offset.
105
- *
106
- * @param value The byte array to slice.
107
- * @param start The start offset (in bytes).
108
- * @param end The end offset (in bytes).
109
- */
110
- declare function sliceBytes(value: ByteArray, start?: number, end?: number): Uint8Array;
111
- /**
112
- * @description Returns a section of the hex value given a start/end bytes offset.
113
- *
114
- * @param value The hex value to slice.
115
- * @param start The start offset (in bytes).
116
- * @param end The end offset (in bytes).
117
- */
118
- declare function sliceHex(value_: Hex, start?: number, end?: number): string;
119
-
120
38
  /**
121
39
  * @description Picks out the keys from `value` that exist in the formatter.
122
40
  */
@@ -124,143 +42,38 @@ declare function extract(value: Record<string, unknown>, { formatter }: {
124
42
  formatter?: Formatter;
125
43
  }): {};
126
44
 
127
- /**
128
- * @description Encodes a boolean into a hex string
129
- */
130
- declare function boolToHex(value: boolean): Hex;
131
- /**
132
- * @description Encodes a bytes array into a hex string
133
- */
134
- declare function bytesToHex(value: ByteArray): Hex;
135
- /**
136
- * @description Encodes a string, number, bigint, or ByteArray into a hex string
137
- */
138
- declare function encodeHex(value: string | number | bigint | boolean | ByteArray): Hex;
139
- type NumberToHexOpts$1 = {
140
- signed?: boolean;
141
- size: number;
142
- } | {
143
- signed?: never;
144
- size?: never;
145
- };
146
- /**
147
- * @description Encodes a number or bigint into a hex string
148
- */
149
- declare function numberToHex(value_: number | bigint, opts?: NumberToHexOpts$1): Hex;
150
- /**
151
- * @description Encodes a UTF-8 string into a hex string
152
- */
153
- declare function stringToHex(value: string): Hex;
154
-
155
- /**
156
- * @description Encodes a boolean into a byte array.
157
- */
158
- declare function boolToBytes(value: boolean): Uint8Array;
159
- /** @description Encodes a UTF-8 string, hex value, bigint, number or boolean to a byte array. */
160
- declare function encodeBytes(value: string | bigint | number | boolean | Hex): ByteArray;
161
- /**
162
- * @description Encodes a hex string into a byte array.
163
- */
164
- declare function hexToBytes(hex_: Hex): ByteArray;
165
- /**
166
- * @description Encodes a number into a byte array.
167
- */
168
- declare function numberToBytes(value: bigint | number, opts?: NumberToHexOpts$1): Uint8Array;
169
- /**
170
- * @description Encodes a UTF-8 string into a byte array.
171
- */
172
- declare function stringToBytes(value: string): ByteArray;
173
-
174
- type RecursiveArray<T> = T | Array<RecursiveArray<T>>;
175
- type To$1 = 'hex' | 'bytes';
176
- type EncodeRlpResponse<TTo extends To$1> = TTo extends 'bytes' ? ByteArray : TTo extends 'hex' ? Hex : never;
177
- declare function encodeRlp<TTo extends To$1 = 'hex'>(hexOrBytes: RecursiveArray<Hex> | RecursiveArray<ByteArray>, to_?: TTo): EncodeRlpResponse<TTo>;
178
-
179
- type DecodeBytesResponse<TTo> = TTo extends 'string' ? string : TTo extends 'hex' ? Hex : TTo extends 'bigint' ? bigint : TTo extends 'number' ? number : TTo extends 'boolean' ? boolean : never;
180
- /**
181
- * @description Decodes a byte array into a UTF-8 string, hex value, number, bigint or boolean.
182
- */
183
- declare function decodeBytes<TTo extends 'string' | 'hex' | 'bigint' | 'number' | 'boolean'>(bytes: ByteArray, to: TTo): DecodeBytesResponse<TTo>;
184
- /**
185
- * @description Decodes a byte array into a bigint.
186
- */
187
- declare function bytesToBigint(bytes: ByteArray): bigint;
188
- /**
189
- * @description Decodes a byte array into a boolean.
190
- */
191
- declare function bytesToBool(bytes: ByteArray): boolean;
192
-
193
- /**
194
- * @description Decodes a byte array into a number.
195
- */
196
- declare function bytesToNumber(bytes: ByteArray): number;
197
- /**
198
- * @description Decodes a byte array into a UTF-8 string.
199
- */
200
- declare function bytesToString(bytes: ByteArray): string;
201
-
202
- type DecodeHexResponse<TTo> = TTo extends 'string' ? string : TTo extends 'bigint' ? bigint : TTo extends 'number' ? number : TTo extends 'bytes' ? ByteArray : TTo extends 'boolean' ? boolean : never;
203
- /**
204
- * @description Decodes a hex string into a string, number, bigint, boolean, or bytes32 array.
205
- */
206
- declare function decodeHex<TTo extends 'string' | 'bigint' | 'number' | 'bytes' | 'boolean'>(hex: Hex, to: TTo): DecodeHexResponse<TTo>;
207
- type HexToBigIntOpts = {
208
- signed?: boolean;
209
- };
210
- /**
211
- * @description Decodes a hex string into a bigint.
212
- */
213
- declare function hexToBigInt(hex: Hex, opts?: HexToBigIntOpts): bigint;
214
- /**
215
- * @description Decodes a hex string into a boolean.
216
- */
217
- declare function hexToBool(hex: Hex): boolean;
218
- type NumberToHexOpts = HexToBigIntOpts;
219
- /**
220
- * @description Decodes a hex string into a number.
221
- */
222
- declare function hexToNumber(hex: Hex, opts?: NumberToHexOpts): number;
223
- /**
224
- * @description Decodes a hex string into a UTF-8 string.
225
- */
226
- declare function hexToString(hex: Hex): string;
45
+ declare function getCallError(err: BaseError, { docsPath, ...args }: CallParameters & {
46
+ chain?: Chain;
47
+ docsPath?: string;
48
+ }): CallExecutionError;
227
49
 
228
- type DecodeRlpResponse<TTo> = TTo extends 'bytes' ? ByteArray : TTo extends 'hex' ? Hex : never;
229
- declare function decodeRlp<TTo extends 'bytes' | 'hex'>(value: ByteArray | Hex, to: TTo): RecursiveArray<DecodeRlpResponse<TTo>>;
50
+ declare function getEstimateGasError(err: BaseError, { docsPath, ...args }: EstimateGasParameters & {
51
+ chain?: Chain;
52
+ docsPath?: string;
53
+ }): EstimateGasExecutionError;
230
54
 
231
- declare const getEventSignature: (event: EventDefinition) => `0x${string}`;
55
+ declare function containsNodeError(err: BaseError): boolean;
56
+ declare function getNodeError(err: BaseError, args: Partial<SendTransactionParameters<any>>): ExecutionRevertedError | FeeCapTooHighError | FeeCapTooLowError | NonceTooHighError | NonceTooLowError | NonceMaxValueError | InsufficientFundsError | IntrinsicGasTooHighError | IntrinsicGasTooLowError | TransactionTypeNotSupportedError | TipAboveFeeCapError | UnknownNodeError;
232
57
 
233
- declare const getFunctionSignature: (fn: string) => `0x${string}`;
58
+ declare function getTransactionError(err: BaseError, { docsPath, ...args }: SendTransactionParameters & {
59
+ docsPath?: string;
60
+ }): TransactionExecutionError;
234
61
 
235
- type To = 'hex' | 'bytes';
236
- type Keccak256Hash<TTo extends To> = (TTo extends 'bytes' ? ByteArray : never) | (TTo extends 'hex' ? Hex : never);
237
- declare function keccak256<TTo extends To = 'hex'>(value: ByteArray, to_?: TTo): Keccak256Hash<TTo>;
62
+ declare const arrayRegex: RegExp;
63
+ declare const bytesRegex: RegExp;
64
+ declare const integerRegex: RegExp;
238
65
 
239
- declare function stringify(value: unknown): string;
66
+ declare function assertRequest(args: Partial<SendTransactionParameters<Chain>>): void;
240
67
 
241
- declare const etherUnits: {
242
- gwei: number;
243
- wei: number;
244
- };
245
- declare const gweiUnits: {
246
- ether: number;
247
- wei: number;
248
- };
249
- declare const weiUnits: {
250
- ether: number;
251
- gwei: number;
68
+ type PrepareRequestParameters<TParameters extends SendTransactionParameters = SendTransactionParameters> = TParameters;
69
+ type PrepareRequestReturnType<TParameters extends SendTransactionParameters = SendTransactionParameters> = TParameters & {
70
+ from: Address;
71
+ gas: SendTransactionParameters['gas'];
72
+ gasPrice?: SendTransactionParameters['gasPrice'];
73
+ maxFeePerGas?: SendTransactionParameters['maxFeePerGas'];
74
+ maxPriorityFeePerGas?: SendTransactionParameters['maxPriorityFeePerGas'];
75
+ nonce: SendTransactionParameters['nonce'];
252
76
  };
77
+ declare function prepareRequest<TParameters extends SendTransactionParameters>(client: WalletClient<any, any> | PublicClient<any, any>, args: PrepareRequestParameters<TParameters>): Promise<PrepareRequestReturnType<TParameters>>;
253
78
 
254
- declare function formatEther(wei: bigint, unit?: 'wei' | 'gwei'): string;
255
-
256
- declare function formatGwei(wei: bigint, unit?: 'wei'): string;
257
-
258
- declare function formatUnit(value: bigint, decimals: number): string;
259
-
260
- declare function parseUnit(value: `${number}`, decimals: number): bigint;
261
-
262
- declare function parseEther(ether: `${number}`, unit?: 'wei' | 'gwei'): bigint;
263
-
264
- declare function parseGwei(ether: `${number}`, unit?: 'wei'): bigint;
265
-
266
- export { EncodeRlpResponse, GetContractAddressOptions, GetCreate2AddressOptions, GetCreateAddressOptions, boolToBytes, boolToHex, buildRequest, bytesToBigint, bytesToBool, bytesToHex, bytesToNumber, bytesToString, decodeBytes, decodeHex, decodeRlp, encodeBytes, encodeHex, encodeRlp, etherUnits, extract, extractFunctionName, extractFunctionParams, extractFunctionParts, extractFunctionType, formatEther, formatGwei, formatUnit, getAddress, getContractAddress, getContractError, getCreate2Address, getCreateAddress, getEventSignature, getFunctionSignature, gweiUnits, hexToBigInt, hexToBool, hexToBytes, hexToNumber, hexToString, isAddress, isAddressEqual, isBytes, isHex, keccak256, numberToBytes, numberToHex, pad, padBytes, padHex, parseEther, parseGwei, parseUnit, size, slice, sliceBytes, sliceHex, stringToBytes, stringToHex, stringify, trim, weiUnits };
79
+ export { arrayRegex, assertRequest, buildRequest, bytesRegex, containsNodeError, extract, extractFunctionName, extractFunctionParams, extractFunctionParts, extractFunctionType, getCallError, getEstimateGasError, getNodeError, getTransactionError, integerRegex, prepareRequest };