HyperSync Network Types
Core network types and query builders for the HyperSync protocol.
This crate provides the fundamental types for constructing queries and handling responses when communicating with HyperSync servers. It supports both JSON and Cap'n Proto serialization formats for efficient network communication.
Features
- Query builder API: Fluent interface for building complex blockchain queries
- Type-safe filtering: Strongly-typed filters for blocks, transactions, logs, and traces
- Field selection: Choose exactly which data fields to retrieve
- Multiple serialization: Support for JSON and Cap'n Proto protocols
- Validation: Built-in query validation and optimization
Key Types
- [
Query] - Main query builder for specifying blockchain data to retrieve - [
BlockFilter] - Filter blocks by number, hash, or other criteria - [
TransactionFilter] - Filter transactions by from/to addresses, value, etc. - [
LogFilter] - Filter event logs by contract address, topics, etc. - [
TraceFilter] - Filter execution traces by various criteria
Example
use ;
// Build a query for ERC20 transfer events
let mut query = new.from_block;
query.to_block = Some;
query = query.where_logs.select_log_fields;
println!;
# Ok::