Skip to main content

Crate mfm_collectors_evm

Crate mfm_collectors_evm 

Source
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§

EvmIoClient
First-class EVM client wrapper over IoProvider.
JsonRpcCall
Minimal JSON-RPC request shape used by the EVM IO helpers.

Enums§

FactKeyDerivationError
Error returned when a fact key cannot be derived from a request.
ParseHexError
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 IoCall envelope.
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 into u64.
parse_u64_hex_value
Parses a JSON value that should contain a 0x-prefixed quantity string.