Skip to main content

Crate evmify

Crate evmify 

Source
Expand description

§evmify

Project page · GitHub · Examples · Roadmap

EVM-ify any chain. One read API for EVM and non-EVM chains, always answered in EVM JSON-RPC shape.

  • EvmClient — typed eth_* client that works on any EVM chain (Ethereum, L2s, sidechains). Unknown response fields are preserved, never dropped.
  • pipeline — a modular adapter → normalizer → transformer pipeline that serves non-EVM chains (Solana and Bitcoin included) as EVM blocks, transactions, receipts and logs.
  • ChainProvider — the trait both implement, so you can hold them side by side.
use evmify::{BlockId, ChainProvider, EvmClient, adapters::solana};

// Shorthand keys use the chain's public RPC (or EVMIFY_RPC_<KEY>); URLs work too.
let chains: Vec<Box<dyn ChainProvider>> = vec![
    Box::new(EvmClient::connect("ethereum").await?),
    Box::new(EvmClient::connect("https://mainnet.base.org").await?),
    Box::new(solana::connect("solana")?),
];
for chain in &chains {
    let block = chain.block(BlockId::Latest, false).await?;
    println!("{}: {:?}", chain.chain().name, block.map(|b| b.number));
}

Built and maintained by Mads Paaskesen, Hardcore Websmith at MP-IT.

Re-exports§

pub use chains::ChainInfo;
pub use chains::ChainKind;
pub use chains::KnownChain;
pub use chains::resolve_rpc;
pub use evm::EvmClient;
pub use pipeline::Adapter;
pub use pipeline::EvmTransformer;
pub use pipeline::Normalizer;
pub use pipeline::Pipeline;
pub use pipeline::Transformer;
pub use scan::LogScan;
pub use scan::ScanPlan;
pub use scan::ScanProgress;
pub use transport::HttpTransport;
pub use transport::FallbackTransport;
pub use transport::MockTransport;
pub use transport::Transport;
pub use self as primitives;
pub use types::*;

Modules§

adapters
Reference adapters + normalizers for non-EVM chains.
chains
Chain metadata.
evm
Typed client for any EVM-compatible JSON-RPC endpoint.
pipeline
Serve a non-EVM chain in EVM shape:
scan
Scanning eth_getLogs over long block ranges, politely.
transport
How JSON-RPC requests reach a node.
types
EVM-shaped output types.

Structs§

Address
An Ethereum address, 20 bytes in length.
Bytes
Wrapper type around bytes::Bytes to support “0x” prefixed hex strings.

Enums§

Error
Everything that can go wrong between a caller and a chain.

Traits§

ChainProvider
Read access to a chain, always answered in EVM shape.

Type Aliases§

B256
32-byte fixed byte-array type.
Result
Result alias used throughout the crate.
U64
64-bit unsigned integer type, consisting of 1, 64-bit limbs.
U256
256-bit unsigned integer type, consisting of 4, 64-bit limbs.