voltaire-effect 0.2.23 → 0.2.25

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 (397) hide show
  1. package/dist/KZGService-B7PJerOb.d.ts +146 -0
  2. package/dist/ProviderService-BZ5pqDrD.d.ts +319 -0
  3. package/dist/{X25519Test-DGsk1V9o.d.ts → X25519Test-D5Q-5fL9.d.ts} +4 -143
  4. package/dist/crypto/index.d.ts +5 -6
  5. package/dist/crypto/index.js +227 -201
  6. package/dist/{index-IgkEHjBe.d.ts → index-BCOuszKZ.d.ts} +17634 -11962
  7. package/dist/index.d.ts +3195 -976
  8. package/dist/index.js +6994 -4679
  9. package/dist/native/index.d.ts +25 -16
  10. package/dist/native/index.js +7020 -4705
  11. package/dist/primitives/index.d.ts +14 -8
  12. package/dist/primitives/index.js +4060 -2539
  13. package/dist/services/index.d.ts +9054 -30
  14. package/dist/services/index.js +1592 -1331
  15. package/package.json +2 -2
  16. package/src/crypto/ERC6492/ERC6492.test.ts +32 -14
  17. package/src/crypto/ERC6492/verifySignature.ts +4 -5
  18. package/src/crypto/Keccak256/Keccak256.test.ts +42 -1
  19. package/src/crypto/Keccak256/hashSync.ts +53 -0
  20. package/src/crypto/Keccak256/index.ts +2 -0
  21. package/src/index.ts +7 -2
  22. package/src/primitives/Abi/decode.test.ts +38 -0
  23. package/src/primitives/Abi/decode.ts +67 -0
  24. package/src/primitives/Abi/decodeData.test.ts +37 -0
  25. package/src/primitives/Abi/decodeData.ts +77 -0
  26. package/src/primitives/Abi/decodeLog.test.ts +32 -0
  27. package/src/primitives/Abi/decodeLog.ts +81 -0
  28. package/src/primitives/Abi/decodeWrappedError.test.ts +41 -0
  29. package/src/primitives/Abi/decodeWrappedError.ts +68 -0
  30. package/src/primitives/Abi/encode.test.ts +43 -0
  31. package/src/primitives/Abi/encode.ts +67 -0
  32. package/src/primitives/Abi/encodePacked.test.ts +35 -0
  33. package/src/primitives/Abi/encodePacked.ts +62 -0
  34. package/src/primitives/Abi/encodeWrappedError.test.ts +21 -0
  35. package/src/primitives/Abi/encodeWrappedError.ts +64 -0
  36. package/src/primitives/Abi/findSelectorCollisions.test.ts +50 -0
  37. package/src/primitives/Abi/findSelectorCollisions.ts +83 -0
  38. package/src/primitives/Abi/index.ts +33 -7
  39. package/src/primitives/Abi/parseLogs.test.ts +37 -0
  40. package/src/primitives/Abi/parseLogs.ts +62 -0
  41. package/src/primitives/AccessList/AccessList.test.ts +229 -0
  42. package/src/primitives/AccessList/AccessListTypeSchema.ts +16 -0
  43. package/src/primitives/AccessList/addressCount.ts +21 -0
  44. package/src/primitives/AccessList/assertValid.ts +37 -0
  45. package/src/primitives/AccessList/create.ts +19 -0
  46. package/src/primitives/AccessList/deduplicate.ts +23 -0
  47. package/src/primitives/AccessList/from.ts +39 -0
  48. package/src/primitives/AccessList/fromBytes.ts +36 -0
  49. package/src/primitives/AccessList/gasCost.ts +22 -0
  50. package/src/primitives/AccessList/gasSavings.ts +26 -0
  51. package/src/primitives/AccessList/hasSavings.ts +23 -0
  52. package/src/primitives/AccessList/includesAddress.ts +25 -0
  53. package/src/primitives/AccessList/includesStorageKey.ts +28 -0
  54. package/src/primitives/AccessList/index.ts +99 -19
  55. package/src/primitives/AccessList/is.ts +23 -0
  56. package/src/primitives/AccessList/isEmpty.ts +23 -0
  57. package/src/primitives/AccessList/isItem.ts +22 -0
  58. package/src/primitives/AccessList/keysFor.ts +29 -0
  59. package/src/primitives/AccessList/merge.ts +24 -0
  60. package/src/primitives/AccessList/storageKeyCount.ts +21 -0
  61. package/src/primitives/AccessList/toBytes.ts +23 -0
  62. package/src/primitives/AccessList/withAddress.ts +27 -0
  63. package/src/primitives/AccessList/withStorageKey.ts +30 -0
  64. package/src/primitives/Address/Address.test.ts +146 -0
  65. package/src/primitives/Address/assert.ts +51 -0
  66. package/src/primitives/Address/calculateCreate2Address.ts +33 -0
  67. package/src/primitives/Address/calculateCreateAddress.ts +30 -0
  68. package/src/primitives/Address/deduplicateAddresses.ts +20 -0
  69. package/src/primitives/Address/from.ts +41 -0
  70. package/src/primitives/Address/fromAbiEncoded.ts +35 -0
  71. package/src/primitives/Address/fromBase64.ts +25 -0
  72. package/src/primitives/Address/fromBytes.ts +25 -0
  73. package/src/primitives/Address/fromHex.ts +31 -0
  74. package/src/primitives/Address/fromNumber.ts +25 -0
  75. package/src/primitives/Address/fromPrivateKey.ts +25 -0
  76. package/src/primitives/Address/fromPublicKey.ts +56 -0
  77. package/src/primitives/Address/index.ts +99 -35
  78. package/src/primitives/Address/is.ts +20 -0
  79. package/src/primitives/Address/isAddress.ts +22 -0
  80. package/src/primitives/Address/sortAddresses.ts +19 -0
  81. package/src/primitives/Address/toChecksummed.ts +32 -0
  82. package/src/primitives/Address/toHex.ts +18 -0
  83. package/src/primitives/Address/zero.ts +18 -0
  84. package/src/primitives/Base64/Base64.test.ts +75 -0
  85. package/src/primitives/Base64/convert.ts +37 -0
  86. package/src/primitives/Base64/decode.ts +59 -0
  87. package/src/primitives/Base64/encode.ts +42 -0
  88. package/src/primitives/Base64/from.ts +39 -0
  89. package/src/primitives/Base64/index.ts +81 -1
  90. package/src/primitives/Base64/size.ts +16 -0
  91. package/src/primitives/Base64/validation.ts +16 -0
  92. package/src/primitives/Blob/Blob.test.ts +292 -0
  93. package/src/primitives/Blob/calculateGas.ts +30 -0
  94. package/src/primitives/Blob/estimateBlobCount.ts +30 -0
  95. package/src/primitives/Blob/from.ts +38 -0
  96. package/src/primitives/Blob/fromData.ts +36 -0
  97. package/src/primitives/Blob/index.ts +99 -12
  98. package/src/primitives/Blob/isValidVersion.ts +27 -0
  99. package/src/primitives/Blob/joinData.ts +43 -0
  100. package/src/primitives/Blob/splitData.ts +36 -0
  101. package/src/primitives/Blob/toCommitment.ts +43 -0
  102. package/src/primitives/Blob/toProof.ts +50 -0
  103. package/src/primitives/Blob/toVersionedHash.ts +35 -0
  104. package/src/primitives/Blob/verify.ts +49 -0
  105. package/src/primitives/Blob/verifyBatch.ts +119 -0
  106. package/src/primitives/BloomFilter/BloomFilter.test.ts +138 -0
  107. package/src/primitives/BloomFilter/add.ts +23 -0
  108. package/src/primitives/BloomFilter/combine.ts +21 -0
  109. package/src/primitives/BloomFilter/contains.ts +26 -0
  110. package/src/primitives/BloomFilter/create.ts +35 -0
  111. package/src/primitives/BloomFilter/density.ts +22 -0
  112. package/src/primitives/BloomFilter/expectedFalsePositiveRate.ts +25 -0
  113. package/src/primitives/BloomFilter/fromHex.ts +37 -0
  114. package/src/primitives/BloomFilter/hash.ts +43 -0
  115. package/src/primitives/BloomFilter/index.ts +59 -37
  116. package/src/primitives/BloomFilter/isEmpty.ts +22 -0
  117. package/src/primitives/BloomFilter/merge.ts +24 -0
  118. package/src/primitives/BloomFilter/toHex.ts +22 -0
  119. package/src/primitives/Bytecode/analyze.ts +58 -0
  120. package/src/primitives/Bytecode/detectFusions.ts +10 -0
  121. package/src/primitives/Bytecode/equals.ts +10 -0
  122. package/src/primitives/Bytecode/extractRuntime.ts +12 -0
  123. package/src/primitives/Bytecode/format.ts +16 -0
  124. package/src/primitives/Bytecode/from.ts +16 -0
  125. package/src/primitives/Bytecode/fromHex.ts +14 -0
  126. package/src/primitives/Bytecode/getBlock.ts +12 -0
  127. package/src/primitives/Bytecode/getNextPc.ts +12 -0
  128. package/src/primitives/Bytecode/getPushSize.ts +8 -0
  129. package/src/primitives/Bytecode/hasMetadata.ts +10 -0
  130. package/src/primitives/Bytecode/hash.ts +9 -0
  131. package/src/primitives/Bytecode/index.ts +103 -13
  132. package/src/primitives/Bytecode/isPush.ts +8 -0
  133. package/src/primitives/Bytecode/isTerminator.ts +8 -0
  134. package/src/primitives/Bytecode/isValidJumpDest.ts +12 -0
  135. package/src/primitives/Bytecode/parseInstructions.ts +10 -0
  136. package/src/primitives/Bytecode/prettyPrint.ts +12 -0
  137. package/src/primitives/Bytecode/scan.ts +20 -0
  138. package/src/primitives/Bytecode/size.ts +9 -0
  139. package/src/primitives/Bytecode/stripMetadata.ts +10 -0
  140. package/src/primitives/Bytecode/toAbi.ts +10 -0
  141. package/src/primitives/Bytecode/toHex.ts +10 -0
  142. package/src/primitives/Bytecode/types.ts +23 -0
  143. package/src/primitives/Bytecode/validate.ts +9 -0
  144. package/src/primitives/ContractSignature/ContractSignature.test.ts +1 -13
  145. package/src/primitives/ContractSignature/verifySignature.ts +88 -62
  146. package/src/primitives/Ens/Ens.test.ts +71 -0
  147. package/src/primitives/Ens/convert.ts +13 -0
  148. package/src/primitives/Ens/from.ts +32 -0
  149. package/src/primitives/Ens/hash.ts +46 -0
  150. package/src/primitives/Ens/index.ts +86 -4
  151. package/src/primitives/Ens/normalize.ts +45 -0
  152. package/src/primitives/Ens/validation.ts +38 -0
  153. package/src/primitives/EventLog/accessors.ts +32 -0
  154. package/src/primitives/EventLog/clone.ts +17 -0
  155. package/src/primitives/EventLog/create.ts +46 -0
  156. package/src/primitives/EventLog/filtering.ts +48 -0
  157. package/src/primitives/EventLog/index.ts +96 -6
  158. package/src/primitives/EventLog/status.ts +17 -0
  159. package/src/primitives/EventLog/toRpc.ts +49 -0
  160. package/src/primitives/Hardfork/HardforkSchema.ts +3 -3
  161. package/src/primitives/Hardfork/allIds.ts +13 -0
  162. package/src/primitives/Hardfork/allNames.ts +13 -0
  163. package/src/primitives/Hardfork/compare.ts +17 -0
  164. package/src/primitives/Hardfork/comparisons.ts +45 -0
  165. package/src/primitives/Hardfork/equals.ts +17 -0
  166. package/src/primitives/Hardfork/features.ts +61 -0
  167. package/src/primitives/Hardfork/fromString.ts +16 -0
  168. package/src/primitives/Hardfork/index.ts +128 -18
  169. package/src/primitives/Hardfork/isValidName.ts +14 -0
  170. package/src/primitives/Hardfork/minMax.ts +23 -0
  171. package/src/primitives/Hardfork/range.ts +19 -0
  172. package/src/primitives/Hardfork/toString.ts +16 -0
  173. package/src/primitives/Hash/Hash.test.ts +104 -0
  174. package/src/primitives/Hash/from.ts +47 -0
  175. package/src/primitives/Hash/fromBytes.ts +46 -0
  176. package/src/primitives/Hash/fromHex.ts +44 -0
  177. package/src/primitives/Hash/index.ts +45 -8
  178. package/src/primitives/Hash/isHash.ts +31 -0
  179. package/src/primitives/Hash/toHex.ts +29 -0
  180. package/src/primitives/Hex/Hex.test.ts +327 -153
  181. package/src/primitives/Hex/assertSize.ts +41 -0
  182. package/src/primitives/Hex/concat.ts +37 -0
  183. package/src/primitives/Hex/from.ts +38 -0
  184. package/src/primitives/Hex/fromBigInt.ts +40 -0
  185. package/src/primitives/Hex/fromBoolean.ts +29 -0
  186. package/src/primitives/Hex/fromNumber.ts +41 -0
  187. package/src/primitives/Hex/fromString.ts +28 -0
  188. package/src/primitives/Hex/index.ts +68 -37
  189. package/src/primitives/Hex/pad.ts +40 -0
  190. package/src/primitives/Hex/padRight.ts +39 -0
  191. package/src/primitives/Hex/size.ts +29 -0
  192. package/src/primitives/Hex/slice.ts +42 -0
  193. package/src/primitives/Hex/toBigInt.ts +27 -0
  194. package/src/primitives/Hex/toBoolean.ts +38 -0
  195. package/src/primitives/Hex/toNumber.ts +37 -0
  196. package/src/primitives/Hex/toStringHex.ts +39 -0
  197. package/src/primitives/Hex/trim.ts +27 -0
  198. package/src/primitives/Hex/validate.ts +37 -0
  199. package/src/primitives/Hex/xor.ts +39 -0
  200. package/src/primitives/Opcode/OpcodeSchema.ts +1 -1
  201. package/src/primitives/Opcode/disassemble.ts +15 -0
  202. package/src/primitives/Opcode/dupPosition.ts +15 -0
  203. package/src/primitives/Opcode/format.ts +15 -0
  204. package/src/primitives/Opcode/getters.ts +54 -0
  205. package/src/primitives/Opcode/index.ts +301 -11
  206. package/src/primitives/Opcode/info.ts +18 -0
  207. package/src/primitives/Opcode/jumpDests.ts +15 -0
  208. package/src/primitives/Opcode/logTopics.ts +15 -0
  209. package/src/primitives/Opcode/name.ts +15 -0
  210. package/src/primitives/Opcode/parse.ts +15 -0
  211. package/src/primitives/Opcode/predicates.ts +72 -0
  212. package/src/primitives/Opcode/pushBytes.ts +15 -0
  213. package/src/primitives/Opcode/pushOpcode.ts +15 -0
  214. package/src/primitives/Opcode/swapPosition.ts +15 -0
  215. package/src/primitives/Rlp/decodeBatch.ts +46 -0
  216. package/src/primitives/Rlp/decodeObject.ts +46 -0
  217. package/src/primitives/Rlp/decodeValue.ts +51 -0
  218. package/src/primitives/Rlp/encodeBatch.ts +50 -0
  219. package/src/primitives/Rlp/encodeObject.ts +48 -0
  220. package/src/primitives/Rlp/encodeVariadic.ts +49 -0
  221. package/src/primitives/Rlp/equals.ts +22 -0
  222. package/src/primitives/Rlp/from.ts +44 -0
  223. package/src/primitives/Rlp/fromJSON.ts +45 -0
  224. package/src/primitives/Rlp/getEncodedLength.ts +47 -0
  225. package/src/primitives/Rlp/getLength.ts +44 -0
  226. package/src/primitives/Rlp/index.ts +67 -14
  227. package/src/primitives/Rlp/isBytesData.ts +21 -0
  228. package/src/primitives/Rlp/isCanonical.ts +32 -0
  229. package/src/primitives/Rlp/isData.ts +21 -0
  230. package/src/primitives/Rlp/isList.ts +46 -0
  231. package/src/primitives/Rlp/isListData.ts +21 -0
  232. package/src/primitives/Rlp/isString.ts +46 -0
  233. package/src/primitives/Rlp/toJSON.ts +20 -0
  234. package/src/primitives/Rlp/toRaw.ts +31 -0
  235. package/src/primitives/Signature/Signature.test.ts +217 -0
  236. package/src/primitives/Signature/from.ts +38 -0
  237. package/src/primitives/Signature/fromBytes.ts +31 -0
  238. package/src/primitives/Signature/fromCompact.ts +33 -0
  239. package/src/primitives/Signature/fromDER.ts +35 -0
  240. package/src/primitives/Signature/fromEd25519.ts +24 -0
  241. package/src/primitives/Signature/fromHex.ts +29 -0
  242. package/src/primitives/Signature/fromP256.ts +25 -0
  243. package/src/primitives/Signature/fromRpc.ts +38 -0
  244. package/src/primitives/Signature/fromSecp256k1.ts +29 -0
  245. package/src/primitives/Signature/fromTuple.ts +33 -0
  246. package/src/primitives/Signature/getR.ts +24 -0
  247. package/src/primitives/Signature/getS.ts +24 -0
  248. package/src/primitives/Signature/getV.ts +24 -0
  249. package/src/primitives/Signature/index.ts +61 -11
  250. package/src/primitives/Signature/toDER.ts +24 -0
  251. package/src/primitives/Signature/toHex.ts +24 -0
  252. package/src/primitives/Signature/toRpc.ts +35 -0
  253. package/src/primitives/Signature/toTuple.ts +29 -0
  254. package/src/primitives/Signature/verify.ts +31 -0
  255. package/src/primitives/Siwe/create.ts +56 -0
  256. package/src/primitives/Siwe/hash.ts +27 -0
  257. package/src/primitives/Siwe/index.ts +57 -21
  258. package/src/primitives/Siwe/parse.ts +24 -0
  259. package/src/primitives/Siwe/verify.ts +47 -0
  260. package/src/primitives/Transaction/Transaction.test.ts +309 -0
  261. package/src/primitives/Transaction/index.ts +467 -2
  262. package/src/primitives/Uint/Uint.test.ts +200 -0
  263. package/src/primitives/Uint/dividedBy.ts +34 -0
  264. package/src/primitives/Uint/from.ts +35 -0
  265. package/src/primitives/Uint/fromAbiEncoded.ts +29 -0
  266. package/src/primitives/Uint/fromBigInt.ts +30 -0
  267. package/src/primitives/Uint/fromBytes.ts +32 -0
  268. package/src/primitives/Uint/fromHex.ts +32 -0
  269. package/src/primitives/Uint/fromNumber.ts +30 -0
  270. package/src/primitives/Uint/index.ts +90 -45
  271. package/src/primitives/Uint/isUint256.ts +25 -0
  272. package/src/primitives/Uint/isValid.ts +25 -0
  273. package/src/primitives/Uint/modulo.ts +34 -0
  274. package/src/primitives/Uint/toHex.ts +31 -0
  275. package/src/primitives/Uint/tryFrom.ts +30 -0
  276. package/src/services/Contract/Contract.test.ts +46 -41
  277. package/src/services/Contract/Contract.ts +25 -29
  278. package/src/services/Contract/ContractTypes.ts +6 -3
  279. package/src/services/Contract/estimateGas.test.ts +21 -9
  280. package/src/services/Contract/estimateGas.ts +21 -23
  281. package/src/services/Debug/Debug.ts +1 -1
  282. package/src/services/Debug/DebugService.ts +1 -1
  283. package/src/services/FeeEstimator/DefaultFeeEstimator.ts +10 -6
  284. package/src/services/FeeEstimator/FeeEstimator.test.ts +68 -62
  285. package/src/services/Multicall/BalanceResolver.ts +1 -1
  286. package/src/services/Multicall/GetBalance.ts +1 -1
  287. package/src/services/Multicall/Multicall.ts +1 -1
  288. package/src/services/NonceManager/DefaultNonceManager.ts +4 -7
  289. package/src/services/NonceManager/NonceManager.test.ts +20 -33
  290. package/src/services/Provider/Provider.test.ts +155 -349
  291. package/src/services/Provider/Provider.ts +14 -1180
  292. package/src/services/Provider/ProviderService.ts +14 -1199
  293. package/src/services/Provider/actions/multicall.test.ts +29 -39
  294. package/src/services/Provider/actions/multicall.ts +2 -2
  295. package/src/services/Provider/actions/readContract.test.ts +45 -50
  296. package/src/services/Provider/actions/readContract.ts +2 -6
  297. package/src/services/Provider/actions/simulateContract.test.ts +55 -232
  298. package/src/services/Provider/actions/simulateContract.ts +2 -3
  299. package/src/services/Provider/ens/getEnsAddress.ts +11 -14
  300. package/src/services/Provider/ens/getEnsName.ts +15 -18
  301. package/src/services/Provider/ens/getEnsResolver.ts +11 -14
  302. package/src/services/Provider/ens/getEnsText.ts +15 -18
  303. package/src/services/Provider/functions/backfillBlocks.ts +97 -0
  304. package/src/services/Provider/functions/call.ts +45 -0
  305. package/src/services/Provider/functions/createAccessList.ts +61 -0
  306. package/src/services/Provider/functions/createBlockFilter.ts +41 -0
  307. package/src/services/Provider/functions/createEventFilter.ts +43 -0
  308. package/src/services/Provider/functions/createPendingTransactionFilter.ts +41 -0
  309. package/src/services/Provider/functions/estimateGas.ts +52 -0
  310. package/src/services/Provider/functions/getAccounts.ts +40 -0
  311. package/src/services/Provider/functions/getBalance.ts +50 -0
  312. package/src/services/Provider/functions/getBlobBaseFee.ts +46 -0
  313. package/src/services/Provider/functions/getBlock.ts +95 -0
  314. package/src/services/Provider/functions/getBlockNumber.ts +51 -0
  315. package/src/services/Provider/functions/getBlockReceipts.ts +78 -0
  316. package/src/services/Provider/functions/getBlockTransactionCount.ts +86 -0
  317. package/src/services/Provider/functions/getChainId.ts +46 -0
  318. package/src/services/Provider/functions/getCode.ts +43 -0
  319. package/src/services/Provider/functions/getCoinbase.ts +40 -0
  320. package/src/services/Provider/functions/getFeeHistory.ts +85 -0
  321. package/src/services/Provider/functions/getFilterChanges.ts +42 -0
  322. package/src/services/Provider/functions/getFilterLogs.ts +44 -0
  323. package/src/services/Provider/functions/getGasPrice.ts +46 -0
  324. package/src/services/Provider/functions/getHashrate.ts +46 -0
  325. package/src/services/Provider/functions/getLogs.ts +45 -0
  326. package/src/services/Provider/functions/getMaxPriorityFeePerGas.ts +46 -0
  327. package/src/services/Provider/functions/getMining.ts +40 -0
  328. package/src/services/Provider/functions/getProof.ts +52 -0
  329. package/src/services/Provider/functions/getProtocolVersion.ts +40 -0
  330. package/src/services/Provider/functions/getStorageAt.ts +52 -0
  331. package/src/services/Provider/functions/getSyncing.ts +56 -0
  332. package/src/services/Provider/functions/getTransaction.ts +57 -0
  333. package/src/services/Provider/functions/getTransactionByBlockHashAndIndex.ts +73 -0
  334. package/src/services/Provider/functions/getTransactionByBlockNumberAndIndex.ts +86 -0
  335. package/src/services/Provider/functions/getTransactionConfirmations.ts +70 -0
  336. package/src/services/Provider/functions/getTransactionCount.ts +50 -0
  337. package/src/services/Provider/functions/getTransactionReceipt.ts +57 -0
  338. package/src/services/Provider/functions/getUncle.ts +97 -0
  339. package/src/services/Provider/functions/getUncleCount.ts +86 -0
  340. package/src/services/Provider/functions/index.ts +73 -0
  341. package/src/services/Provider/functions/netVersion.ts +40 -0
  342. package/src/services/Provider/functions/sendRawTransaction.ts +40 -0
  343. package/src/services/Provider/functions/sendTransaction.ts +48 -0
  344. package/src/services/Provider/functions/sign.ts +50 -0
  345. package/src/services/Provider/functions/signTransaction.ts +52 -0
  346. package/src/services/Provider/functions/simulateV1.ts +95 -0
  347. package/src/services/Provider/functions/simulateV2.ts +51 -0
  348. package/src/services/Provider/functions/subscribe.ts +49 -0
  349. package/src/services/Provider/functions/uninstallFilter.ts +40 -0
  350. package/src/services/Provider/functions/unsubscribe.ts +41 -0
  351. package/src/services/Provider/functions/waitForTransactionReceipt.ts +168 -0
  352. package/src/services/Provider/functions/watchBlocks.ts +98 -0
  353. package/src/services/Provider/index.ts +29 -178
  354. package/src/services/Provider/types.ts +780 -0
  355. package/src/services/Provider/utils.ts +204 -0
  356. package/src/services/RawProvider/ForkProviderTransport.ts +2 -3
  357. package/src/services/RawProvider/HttpProviderTransport.ts +3 -3
  358. package/src/services/RawProvider/InMemoryProviderTransport.ts +3 -3
  359. package/src/services/RawProvider/WebSocketProviderTransport.ts +3 -3
  360. package/src/services/Signer/Signer.test.ts +211 -187
  361. package/src/services/Signer/Signer.ts +26 -16
  362. package/src/services/Signer/actions/deployContract.test.ts +125 -105
  363. package/src/services/Signer/actions/deployContract.ts +3 -2
  364. package/src/services/Signer/actions/prepareAuthorization.test.ts +47 -48
  365. package/src/services/Signer/actions/prepareAuthorization.ts +3 -3
  366. package/src/services/Signer/actions/signAuthorization.test.ts +39 -45
  367. package/src/services/Signer/actions/signAuthorization.ts +3 -3
  368. package/src/services/Signer/actions/writeContract.test.ts +41 -57
  369. package/src/services/Transport/FallbackTransport.ts +3 -3
  370. package/src/services/Transport/HttpTransport.ts +3 -3
  371. package/src/services/Transport/config.ts +7 -7
  372. package/src/services/Transport/index.ts +3 -4
  373. package/src/services/errors.test.ts +3 -8
  374. package/src/services/index.ts +8 -90
  375. package/src/services/presets/index.ts +9 -10
  376. package/src/services/presets/presets.test.ts +14 -29
  377. package/src/standards/ERC165.test.ts +19 -20
  378. package/src/standards/ERC165.ts +9 -11
  379. package/src/type-exports.test.ts +37 -0
  380. package/dist/AccountService-BetXokad.d.ts +0 -1717
  381. package/dist/RpcResolver-BpvqybjD.d.ts +0 -6439
  382. package/src/services/Provider/Account.ts +0 -33
  383. package/src/services/Provider/AccountService.ts +0 -84
  384. package/src/services/Provider/Blocks.ts +0 -32
  385. package/src/services/Provider/BlocksService.ts +0 -73
  386. package/src/services/Provider/Events.ts +0 -33
  387. package/src/services/Provider/EventsService.ts +0 -71
  388. package/src/services/Provider/Network.ts +0 -41
  389. package/src/services/Provider/NetworkService.ts +0 -114
  390. package/src/services/Provider/Simulation.ts +0 -34
  391. package/src/services/Provider/SimulationService.ts +0 -161
  392. package/src/services/Provider/Streaming.ts +0 -30
  393. package/src/services/Provider/StreamingService.ts +0 -58
  394. package/src/services/Provider/Transaction.ts +0 -39
  395. package/src/services/Provider/TransactionService.ts +0 -83
  396. package/src/services/Provider/filters.ts +0 -91
  397. package/src/services/Provider/getBlobBaseFee.ts +0 -170
@@ -0,0 +1,780 @@
1
+ /**
2
+ * @fileoverview Type definitions for Provider service.
3
+ *
4
+ * @module Provider/types
5
+ * @since 0.0.1
6
+ */
7
+
8
+ import type { AddressType } from "@tevm/voltaire/Address";
9
+ import type { HashType } from "@tevm/voltaire/Hash";
10
+ import type { HexType } from "@tevm/voltaire/Hex";
11
+ import * as Data from "effect/Data";
12
+ import type { TransportError } from "../Transport/TransportError.js";
13
+
14
+ // Re-export BlockStream types for convenience
15
+ export type {
16
+ BackfillOptions,
17
+ BlockInclude,
18
+ BlockStreamEvent,
19
+ BlocksEvent,
20
+ WatchOptions,
21
+ } from "@tevm/voltaire/block";
22
+
23
+ /**
24
+ * Address input type that accepts both branded AddressType and plain hex strings.
25
+ */
26
+ export type AddressInput = AddressType | `0x${string}`;
27
+
28
+ /**
29
+ * Hash input type that accepts both branded HashType and plain hex strings.
30
+ */
31
+ export type HashInput = HashType | `0x${string}`;
32
+
33
+ /**
34
+ * Transaction index input type for block transaction lookups.
35
+ */
36
+ export type TransactionIndexInput = number | bigint | `0x${string}`;
37
+
38
+ /**
39
+ * Filter identifier returned by eth_newFilter methods.
40
+ */
41
+ export type FilterId = `0x${string}`;
42
+
43
+ /**
44
+ * Block identifier for Ethereum RPC calls.
45
+ */
46
+ export type BlockTag =
47
+ | "latest"
48
+ | "earliest"
49
+ | "pending"
50
+ | "safe"
51
+ | "finalized"
52
+ | `0x${string}`;
53
+
54
+ /**
55
+ * Error thrown when the provider returns an invalid or unexpected response.
56
+ */
57
+ export class ProviderResponseError extends Data.TaggedError(
58
+ "ProviderResponseError",
59
+ )<{
60
+ readonly input: unknown;
61
+ readonly message: string;
62
+ readonly cause?: unknown;
63
+ readonly context?: Record<string, unknown>;
64
+ }> {
65
+ constructor(
66
+ input: unknown,
67
+ message?: string,
68
+ options?: { cause?: unknown; context?: Record<string, unknown> },
69
+ ) {
70
+ super({
71
+ input,
72
+ message:
73
+ message ??
74
+ (options?.cause instanceof Error ? options.cause.message : undefined) ??
75
+ "Invalid provider response",
76
+ cause: options?.cause,
77
+ context: options?.context,
78
+ });
79
+ }
80
+ }
81
+
82
+ /**
83
+ * Error thrown when a requested resource is missing (block, tx, receipt, etc.).
84
+ */
85
+ export class ProviderNotFoundError extends Data.TaggedError(
86
+ "ProviderNotFoundError",
87
+ )<{
88
+ readonly input: unknown;
89
+ readonly message: string;
90
+ readonly resource?: string;
91
+ readonly cause?: unknown;
92
+ readonly context?: Record<string, unknown>;
93
+ }> {
94
+ constructor(
95
+ input: unknown,
96
+ message?: string,
97
+ options?: {
98
+ resource?: string;
99
+ cause?: unknown;
100
+ context?: Record<string, unknown>;
101
+ },
102
+ ) {
103
+ super({
104
+ input,
105
+ message: message ?? "Resource not found",
106
+ resource: options?.resource,
107
+ cause: options?.cause,
108
+ context: options?.context,
109
+ });
110
+ }
111
+ }
112
+
113
+ /**
114
+ * Error thrown when inputs fail validation before an RPC call is made.
115
+ */
116
+ export class ProviderValidationError extends Data.TaggedError(
117
+ "ProviderValidationError",
118
+ )<{
119
+ readonly input: unknown;
120
+ readonly message: string;
121
+ readonly cause?: unknown;
122
+ readonly context?: Record<string, unknown>;
123
+ }> {
124
+ constructor(
125
+ input: unknown,
126
+ message?: string,
127
+ options?: { cause?: unknown; context?: Record<string, unknown> },
128
+ ) {
129
+ super({
130
+ input,
131
+ message:
132
+ message ??
133
+ (options?.cause instanceof Error ? options.cause.message : undefined) ??
134
+ "Invalid provider input",
135
+ cause: options?.cause,
136
+ context: options?.context,
137
+ });
138
+ }
139
+ }
140
+
141
+ /**
142
+ * Error thrown when waiting for a result exceeds a timeout.
143
+ */
144
+ export class ProviderTimeoutError extends Data.TaggedError(
145
+ "ProviderTimeoutError",
146
+ )<{
147
+ readonly input: unknown;
148
+ readonly message: string;
149
+ readonly timeoutMs?: number;
150
+ readonly cause?: unknown;
151
+ readonly context?: Record<string, unknown>;
152
+ }> {
153
+ constructor(
154
+ input: unknown,
155
+ message?: string,
156
+ options?: {
157
+ timeoutMs?: number;
158
+ cause?: unknown;
159
+ context?: Record<string, unknown>;
160
+ },
161
+ ) {
162
+ super({
163
+ input,
164
+ message: message ?? "Provider operation timed out",
165
+ timeoutMs: options?.timeoutMs,
166
+ cause: options?.cause,
167
+ context: options?.context,
168
+ });
169
+ }
170
+ }
171
+
172
+ /**
173
+ * Error thrown by provider streams (watch/backfill).
174
+ */
175
+ export class ProviderStreamError extends Data.TaggedError(
176
+ "ProviderStreamError",
177
+ )<{
178
+ readonly input: unknown;
179
+ readonly message: string;
180
+ readonly cause?: unknown;
181
+ readonly context?: Record<string, unknown>;
182
+ }> {
183
+ constructor(
184
+ input: unknown,
185
+ message?: string,
186
+ options?: { cause?: unknown; context?: Record<string, unknown> },
187
+ ) {
188
+ super({
189
+ input,
190
+ message:
191
+ message ??
192
+ (options?.cause instanceof Error ? options.cause.message : undefined) ??
193
+ "Provider stream error",
194
+ cause: options?.cause,
195
+ context: options?.context,
196
+ });
197
+ }
198
+ }
199
+
200
+ /**
201
+ * Error used internally while waiting for a transaction receipt.
202
+ */
203
+ export class ProviderReceiptPendingError extends Data.TaggedError(
204
+ "ProviderReceiptPendingError",
205
+ )<{
206
+ readonly input: unknown;
207
+ readonly message: string;
208
+ readonly cause?: unknown;
209
+ readonly context?: Record<string, unknown>;
210
+ }> {
211
+ constructor(
212
+ input: unknown,
213
+ message?: string,
214
+ options?: { cause?: unknown; context?: Record<string, unknown> },
215
+ ) {
216
+ super({
217
+ input,
218
+ message: message ?? "Transaction pending",
219
+ cause: options?.cause,
220
+ context: options?.context,
221
+ });
222
+ }
223
+ }
224
+
225
+ /**
226
+ * Error used internally while waiting for confirmation depth.
227
+ */
228
+ export class ProviderConfirmationsPendingError extends Data.TaggedError(
229
+ "ProviderConfirmationsPendingError",
230
+ )<{
231
+ readonly input: unknown;
232
+ readonly message: string;
233
+ readonly cause?: unknown;
234
+ readonly context?: Record<string, unknown>;
235
+ }> {
236
+ constructor(
237
+ input: unknown,
238
+ message?: string,
239
+ options?: { cause?: unknown; context?: Record<string, unknown> },
240
+ ) {
241
+ super({
242
+ input,
243
+ message: message ?? "Waiting for confirmations",
244
+ cause: options?.cause,
245
+ context: options?.context,
246
+ });
247
+ }
248
+ }
249
+
250
+ /**
251
+ * Union of all provider-specific errors (excludes TransportError).
252
+ */
253
+ export type ProviderError =
254
+ | ProviderResponseError
255
+ | ProviderNotFoundError
256
+ | ProviderValidationError
257
+ | ProviderTimeoutError
258
+ | ProviderStreamError
259
+ | ProviderReceiptPendingError
260
+ | ProviderConfirmationsPendingError;
261
+
262
+ // Error type aliases for method-specific errors
263
+ export type GetBlockNumberError = TransportError | ProviderResponseError;
264
+ export type GetBlockError = TransportError | ProviderNotFoundError;
265
+ export type GetBlockTransactionCountError =
266
+ | TransportError
267
+ | ProviderResponseError;
268
+ export type GetBalanceError = TransportError | ProviderResponseError;
269
+ export type GetTransactionCountError = TransportError | ProviderResponseError;
270
+ export type GetCodeError = TransportError;
271
+ export type GetStorageAtError = TransportError;
272
+ export type GetTransactionError = TransportError | ProviderNotFoundError;
273
+ export type GetTransactionReceiptError = TransportError | ProviderNotFoundError;
274
+ export type WaitForTransactionReceiptError =
275
+ | TransportError
276
+ | ProviderNotFoundError
277
+ | ProviderValidationError
278
+ | ProviderTimeoutError
279
+ | ProviderResponseError
280
+ | ProviderReceiptPendingError
281
+ | ProviderConfirmationsPendingError;
282
+ export type CallError = TransportError;
283
+ export type EstimateGasError = TransportError | ProviderResponseError;
284
+ export type CreateAccessListError = TransportError;
285
+ export type GetLogsError = TransportError;
286
+ export type CreateEventFilterError = TransportError;
287
+ export type CreateBlockFilterError = TransportError;
288
+ export type CreatePendingTransactionFilterError = TransportError;
289
+ export type GetFilterChangesError = TransportError;
290
+ export type GetFilterLogsError = TransportError;
291
+ export type UninstallFilterError = TransportError;
292
+ export type GetChainIdError =
293
+ | TransportError
294
+ | ProviderResponseError
295
+ | ProviderValidationError;
296
+ export type GetGasPriceError = TransportError | ProviderResponseError;
297
+ export type GetMaxPriorityFeePerGasError =
298
+ | TransportError
299
+ | ProviderResponseError;
300
+ export type GetFeeHistoryError = TransportError | ProviderValidationError;
301
+ export type WatchBlocksError = TransportError | ProviderStreamError;
302
+ export type BackfillBlocksError = TransportError | ProviderStreamError;
303
+ export type SendRawTransactionError = TransportError;
304
+ export type GetUncleError = TransportError | ProviderNotFoundError;
305
+ export type GetProofError = TransportError;
306
+ export type GetBlobBaseFeeError =
307
+ | TransportError
308
+ | ProviderResponseError
309
+ | ProviderNotFoundError;
310
+ export type GetTransactionConfirmationsError =
311
+ | TransportError
312
+ | ProviderResponseError;
313
+ export type GetBlockReceiptsError = TransportError | ProviderNotFoundError;
314
+ export type GetUncleCountError = TransportError | ProviderResponseError;
315
+ export type GetTransactionByBlockHashAndIndexError =
316
+ | TransportError
317
+ | ProviderNotFoundError;
318
+ export type GetTransactionByBlockNumberAndIndexError =
319
+ | TransportError
320
+ | ProviderNotFoundError;
321
+ export type SendTransactionError = TransportError;
322
+ export type SignError = TransportError;
323
+ export type SignTransactionError = TransportError;
324
+ export type SimulateV1Error = TransportError;
325
+ export type SimulateV2Error = TransportError;
326
+
327
+ /**
328
+ * Single block simulation input for eth_simulateV1.
329
+ *
330
+ * @since 0.3.0
331
+ */
332
+ export interface SimulateV1BlockCall {
333
+ readonly blockOverrides?: BlockOverrides;
334
+ readonly stateOverrides?: StateOverride;
335
+ readonly calls: readonly CallRequest[];
336
+ }
337
+
338
+ /**
339
+ * Payload for eth_simulateV1.
340
+ *
341
+ * @since 0.3.0
342
+ */
343
+ export interface SimulateV1Payload {
344
+ readonly blockStateCalls: readonly SimulateV1BlockCall[];
345
+ readonly traceTransfers?: boolean;
346
+ readonly validation?: boolean;
347
+ readonly returnFullTransactions?: boolean;
348
+ }
349
+
350
+ /**
351
+ * Call result from eth_simulateV1.
352
+ *
353
+ * @since 0.3.0
354
+ */
355
+ export interface SimulateV1CallResult {
356
+ readonly status: `0x${string}`;
357
+ readonly returnData: `0x${string}`;
358
+ readonly gasUsed: `0x${string}`;
359
+ readonly logs?: LogType[];
360
+ readonly error?: { code?: number; message?: string };
361
+ }
362
+
363
+ /**
364
+ * Simulated block result from eth_simulateV1.
365
+ *
366
+ * @since 0.3.0
367
+ */
368
+ export interface SimulateV1BlockResult {
369
+ readonly baseFeePerGas?: `0x${string}`;
370
+ readonly blobGasUsed?: `0x${string}`;
371
+ readonly calls: SimulateV1CallResult[];
372
+ readonly gasLimit?: `0x${string}`;
373
+ readonly gasUsed?: `0x${string}`;
374
+ readonly hash?: `0x${string}`;
375
+ readonly number?: `0x${string}`;
376
+ readonly timestamp?: `0x${string}`;
377
+ }
378
+
379
+ /**
380
+ * Result type for eth_simulateV1.
381
+ *
382
+ * @since 0.3.0
383
+ */
384
+ export type SimulateV1Result = SimulateV1BlockResult[];
385
+
386
+ /**
387
+ * Payload for eth_simulateV2 (draft / evolving).
388
+ *
389
+ * @since 0.3.0
390
+ */
391
+ export type SimulateV2Payload = Record<string, unknown>;
392
+
393
+ /**
394
+ * Result type for eth_simulateV2 (draft / evolving).
395
+ *
396
+ * @since 0.3.0
397
+ */
398
+ export type SimulateV2Result = unknown;
399
+ export type GetSyncingError = TransportError;
400
+ export type GetAccountsError = TransportError;
401
+ export type GetCoinbaseError = TransportError;
402
+ export type NetVersionError = TransportError;
403
+ export type SubscribeError = TransportError;
404
+ export type UnsubscribeError = TransportError;
405
+ export type GetProtocolVersionError = TransportError;
406
+ export type GetMiningError = TransportError;
407
+ export type GetHashrateError = TransportError | ProviderResponseError;
408
+ export type GetWorkError = TransportError;
409
+ export type SubmitWorkError = TransportError;
410
+ export type SubmitHashrateError = TransportError;
411
+
412
+ /**
413
+ * State override for a single account.
414
+ */
415
+ export interface AccountStateOverride {
416
+ readonly balance?: bigint;
417
+ readonly nonce?: bigint;
418
+ readonly code?: HexType | `0x${string}`;
419
+ readonly state?: Record<`0x${string}`, `0x${string}`>;
420
+ readonly stateDiff?: Record<`0x${string}`, `0x${string}`>;
421
+ }
422
+
423
+ /**
424
+ * State override set mapping addresses to account overrides.
425
+ */
426
+ export type StateOverride = Record<`0x${string}`, AccountStateOverride>;
427
+
428
+ /**
429
+ * Block overrides for call simulation.
430
+ */
431
+ export interface BlockOverrides {
432
+ readonly number?: bigint;
433
+ readonly difficulty?: bigint;
434
+ readonly time?: bigint;
435
+ readonly gasLimit?: bigint;
436
+ readonly coinbase?: AddressInput;
437
+ readonly random?: HashInput;
438
+ readonly baseFee?: bigint;
439
+ }
440
+
441
+ /**
442
+ * Request parameters for eth_call and eth_estimateGas.
443
+ */
444
+ export interface CallRequest {
445
+ readonly to?: AddressInput;
446
+ readonly from?: AddressInput;
447
+ readonly data?: HexType | `0x${string}`;
448
+ readonly value?: bigint;
449
+ readonly gas?: bigint;
450
+ }
451
+
452
+ /**
453
+ * Access list input for EIP-2930+ transactions.
454
+ */
455
+ export type AccessListInput = Array<{
456
+ address: AddressInput;
457
+ storageKeys: Array<`0x${string}`>;
458
+ }>;
459
+
460
+ /**
461
+ * JSON-RPC transaction request for eth_sendTransaction / eth_signTransaction.
462
+ */
463
+ export type RpcTransactionRequest = Omit<CallRequest, "from" | "to"> & {
464
+ readonly from: AddressInput;
465
+ readonly to?: AddressInput | null;
466
+ readonly gasPrice?: bigint;
467
+ readonly maxFeePerGas?: bigint;
468
+ readonly maxPriorityFeePerGas?: bigint;
469
+ readonly nonce?: bigint;
470
+ readonly accessList?: AccessListInput;
471
+ readonly chainId?: bigint;
472
+ readonly type?: 0 | 1 | 2 | 3 | 4;
473
+ readonly maxFeePerBlobGas?: bigint;
474
+ readonly blobVersionedHashes?: readonly `0x${string}`[];
475
+ };
476
+
477
+ /**
478
+ * Arguments for getBlock - discriminated union.
479
+ */
480
+ export type GetBlockArgs =
481
+ | {
482
+ blockTag?: BlockTag;
483
+ includeTransactions?: boolean;
484
+ blockHash?: never;
485
+ blockNumber?: never;
486
+ }
487
+ | {
488
+ blockHash: HashInput;
489
+ includeTransactions?: boolean;
490
+ blockTag?: never;
491
+ blockNumber?: never;
492
+ }
493
+ | {
494
+ blockNumber: bigint;
495
+ includeTransactions?: boolean;
496
+ blockTag?: never;
497
+ blockHash?: never;
498
+ };
499
+
500
+ /**
501
+ * Arguments for getBlockReceipts.
502
+ */
503
+ export type GetBlockReceiptsArgs =
504
+ | {
505
+ blockTag?: BlockTag;
506
+ blockHash?: never;
507
+ blockNumber?: never;
508
+ }
509
+ | {
510
+ blockHash: HashInput;
511
+ blockTag?: never;
512
+ blockNumber?: never;
513
+ }
514
+ | {
515
+ blockNumber: bigint;
516
+ blockTag?: never;
517
+ blockHash?: never;
518
+ };
519
+
520
+ /**
521
+ * Arguments for getBlockTransactionCount.
522
+ */
523
+ export type GetBlockTransactionCountArgs =
524
+ | {
525
+ blockTag?: BlockTag;
526
+ blockHash?: never;
527
+ }
528
+ | {
529
+ blockHash: HashInput;
530
+ blockTag?: never;
531
+ };
532
+
533
+ /**
534
+ * Arguments for waitForTransactionReceipt.
535
+ */
536
+ export type WaitForTransactionReceiptArgs = {
537
+ readonly hash: HashInput;
538
+ readonly confirmations?: number;
539
+ readonly timeout?: number;
540
+ readonly pollingInterval?: number;
541
+ };
542
+
543
+ /**
544
+ * Filter parameters for eth_getLogs.
545
+ */
546
+ export type LogFilter =
547
+ | {
548
+ blockHash: HashInput;
549
+ fromBlock?: never;
550
+ toBlock?: never;
551
+ address?: AddressInput | AddressInput[];
552
+ topics?: (HashInput | HashInput[] | null)[];
553
+ }
554
+ | {
555
+ blockHash?: never;
556
+ fromBlock?: BlockTag;
557
+ toBlock?: BlockTag;
558
+ address?: AddressInput | AddressInput[];
559
+ topics?: (HashInput | HashInput[] | null)[];
560
+ };
561
+
562
+ /**
563
+ * Filter parameters for eth_newFilter.
564
+ */
565
+ export type EventFilter = {
566
+ readonly address?: AddressInput | AddressInput[];
567
+ readonly topics?: (HashInput | HashInput[] | null)[];
568
+ readonly fromBlock?: BlockTag;
569
+ readonly toBlock?: BlockTag;
570
+ };
571
+
572
+ /**
573
+ * Withdrawal object (EIP-4895).
574
+ */
575
+ export interface WithdrawalType {
576
+ index: string;
577
+ validatorIndex: string;
578
+ address: string;
579
+ amount: string;
580
+ }
581
+
582
+ /**
583
+ * Ethereum block as returned by JSON-RPC.
584
+ */
585
+ export interface BlockType {
586
+ number: string | null;
587
+ hash: string | null;
588
+ parentHash: string;
589
+ nonce: string;
590
+ sha3Uncles: string;
591
+ logsBloom: string;
592
+ transactionsRoot: string;
593
+ stateRoot: string;
594
+ receiptsRoot: string;
595
+ miner: string;
596
+ difficulty: string;
597
+ totalDifficulty: string;
598
+ extraData: string;
599
+ size: string;
600
+ gasLimit: string;
601
+ gasUsed: string;
602
+ timestamp: string;
603
+ transactions: string[] | TransactionType[];
604
+ uncles: string[];
605
+ baseFeePerGas?: string;
606
+ withdrawals?: WithdrawalType[];
607
+ withdrawalsRoot?: string;
608
+ blobGasUsed?: string;
609
+ excessBlobGas?: string;
610
+ parentBeaconBlockRoot?: string;
611
+ }
612
+
613
+ /**
614
+ * Ethereum transaction as returned by JSON-RPC.
615
+ */
616
+ export interface TransactionType {
617
+ hash: string;
618
+ nonce: string;
619
+ blockHash: string | null;
620
+ blockNumber: string | null;
621
+ transactionIndex: string | null;
622
+ from: string;
623
+ to: string | null;
624
+ value: string;
625
+ gas: string;
626
+ gasPrice?: string;
627
+ maxFeePerGas?: string;
628
+ maxPriorityFeePerGas?: string;
629
+ input: string;
630
+ v?: string;
631
+ r?: string;
632
+ s?: string;
633
+ type?: string;
634
+ accessList?: Array<{ address: string; storageKeys: string[] }>;
635
+ chainId?: string;
636
+ maxFeePerBlobGas?: string;
637
+ blobVersionedHashes?: string[];
638
+ yParity?: string;
639
+ }
640
+
641
+ /**
642
+ * Transaction receipt as returned by JSON-RPC.
643
+ */
644
+ export interface ReceiptType {
645
+ transactionHash: string;
646
+ transactionIndex: string;
647
+ blockHash: string;
648
+ blockNumber: string;
649
+ from: string;
650
+ to: string | null;
651
+ cumulativeGasUsed: string;
652
+ gasUsed: string;
653
+ effectiveGasPrice?: string;
654
+ contractAddress: string | null;
655
+ logs: LogType[];
656
+ logsBloom: string;
657
+ type?: string;
658
+ status: string;
659
+ }
660
+
661
+ /**
662
+ * Event log as returned by JSON-RPC.
663
+ */
664
+ export interface LogType {
665
+ address: string;
666
+ topics: string[];
667
+ data: string;
668
+ blockNumber: string;
669
+ transactionHash: string;
670
+ transactionIndex: string;
671
+ blockHash: string;
672
+ logIndex: string;
673
+ removed: boolean;
674
+ }
675
+
676
+ /**
677
+ * Result type for eth_getFilterChanges.
678
+ */
679
+ export type FilterChanges = LogType[] | `0x${string}`[];
680
+
681
+ /**
682
+ * Access list result from eth_createAccessList.
683
+ */
684
+ export interface AccessListType {
685
+ accessList: Array<{ address: string; storageKeys: string[] }>;
686
+ gasUsed: string;
687
+ }
688
+
689
+ /**
690
+ * Fee history result from eth_feeHistory.
691
+ */
692
+ export interface FeeHistoryType {
693
+ oldestBlock: string;
694
+ baseFeePerGas: string[];
695
+ gasUsedRatio: number[];
696
+ reward?: string[][];
697
+ }
698
+
699
+ /**
700
+ * Syncing status result from eth_syncing.
701
+ */
702
+ export type SyncingStatus =
703
+ | false
704
+ | {
705
+ startingBlock: string;
706
+ currentBlock: string;
707
+ highestBlock: string;
708
+ };
709
+
710
+ /**
711
+ * Storage proof for a single slot.
712
+ */
713
+ export interface StorageProofType {
714
+ key: string;
715
+ value: string;
716
+ proof: string[];
717
+ }
718
+
719
+ /**
720
+ * Account proof result from eth_getProof.
721
+ */
722
+ export interface ProofType {
723
+ address: string;
724
+ accountProof: string[];
725
+ balance: string;
726
+ codeHash: string;
727
+ nonce: string;
728
+ storageHash: string;
729
+ storageProof: StorageProofType[];
730
+ }
731
+
732
+ /**
733
+ * Uncle block type (partial block without transactions).
734
+ */
735
+ export interface UncleBlockType {
736
+ number: string | null;
737
+ hash: string | null;
738
+ parentHash: string;
739
+ nonce: string;
740
+ sha3Uncles: string;
741
+ logsBloom: string;
742
+ transactionsRoot: string;
743
+ stateRoot: string;
744
+ receiptsRoot: string;
745
+ miner: string;
746
+ difficulty: string;
747
+ totalDifficulty: string;
748
+ extraData: string;
749
+ size: string;
750
+ gasLimit: string;
751
+ gasUsed: string;
752
+ timestamp: string;
753
+ uncles: string[];
754
+ }
755
+
756
+ /**
757
+ * Arguments for getUncle.
758
+ */
759
+ export type GetUncleArgs =
760
+ | {
761
+ blockTag?: BlockTag;
762
+ blockHash?: never;
763
+ }
764
+ | {
765
+ blockHash: HashInput;
766
+ blockTag?: never;
767
+ };
768
+
769
+ /**
770
+ * Arguments for getUncleCount.
771
+ */
772
+ export type GetUncleCountArgs =
773
+ | {
774
+ blockTag?: BlockTag;
775
+ blockHash?: never;
776
+ }
777
+ | {
778
+ blockHash: HashInput;
779
+ blockTag?: never;
780
+ };