Expand description
EVM collectors.
This crate defines typed adapters over the generic IoCall surface for EVM JSON-RPC reads.
It intentionally does NOT perform IO itself.
§Examples
use mfm_collectors_evm::{fact_key_for_jsonrpc_call, JsonRpcCall};
use mfm_machine::ids::StateId;
let state_id = StateId::must_new("machine.read.balance".to_string());
let call = JsonRpcCall::new("eth_chainId", serde_json::json!([]));
let key = fact_key_for_jsonrpc_call(&state_id, &call).expect("fact key");
assert!(key.0.starts_with("mfm:evm|state:"));Structs§
- EvmIo
Client - First-class EVM client wrapper over
IoProvider. - Json
RpcCall - Minimal JSON-RPC request shape used by the EVM IO helpers.
Enums§
- Fact
KeyDerivation Error - Error returned when a fact key cannot be derived from a request.
- Parse
HexError - Error returned while parsing hex-encoded numeric responses.
Constants§
- NAMESPACE_
EVM - Canonical namespace used for EVM JSON-RPC
IoCalls.
Functions§
- evm_
io_ call - Wraps a typed JSON-RPC call in the generic
IoCallenvelope. - fact_
key_ for_ jsonrpc_ call - Derives a deterministic fact key for an EVM JSON-RPC request.
- parse_
u64_ hex - Parses a
0x-prefixed quantity string intou64. - parse_
u64_ hex_ value - Parses a JSON value that should contain a
0x-prefixed quantity string.