Expand description
§Circles Types
Core type definitions for the Circles protocol ecosystem.
This crate provides fundamental data structures used throughout the Circles
protocol implementation, including flow matrices, transfer steps, and address
handling with full serde
serialization support.
§Usage
ⓘ
use circles_types::{TransferStep, FlowEdge, Stream};
use alloy_primitives::U256;
// Create a transfer step
let transfer = TransferStep {
from_address: "0x123...".parse()?,
to_address: "0x456...".parse()?,
token_owner: "0x789...".parse()?,
value: U256::from(1000u64),
};
// Serialize to JSON
let json = serde_json::to_string(&transfer)?;
§Core Types
TransferStep
- Single transfer operation in a multi-hop pathFlowEdge
- Directed edge in flow graph with routing infoStream
- Collection of edges representing a transfer routeFlowMatrix
- Complete flow representation for contractsAddress
- Ethereum address (re-exported from alloy-primitives)
Structs§
- Flow
Edge - Edge in the flow graph (sinkId 1 == final hop)
- Flow
Matrix - ABI-ready matrix returned by
create_flow_matrix
- Stream
- Transfer
Step