TevmNode api
TevmNode
Using JSON-RPC
TevmNode supports much of the ethereum, debug, anvil, and hardhat JSON-RPC apis. There are two ways to use this api
- Treeshakable procedures
- EIP-1193 provider
Using Treeshakable prodedures and actions
Tree shakable procedures can be imported form the tevm/actions package. All procedures take a TevmClient as a param and return a handler.
Most JSON-RPC procedures have more ergonomic apis called “Actions” as well that can be used as an alternative. Actions have benifit of
- less verbose
- uses normal data structures like bigint rather than encoded hex string
- sometimes more typesafe
Adding EIP-1193 Provider
TevmNode can become an EIP-1193 Provider using requestEip1193 decorator from tevm/decorators
package.
See json-rpc api for which methods are supported.
Similarly tevm can also be extended with the actions api.