Expand description
§zerox1-client
Official client SDK for building agents and services on the 0x01 mesh network.
§Quick start
ⓘ
use zerox1_client::{NodeClient, ConversationId};
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let client = NodeClient::new("http://127.0.0.1:9090", None)?;
// Discover own identity
let me = client.identity().await?;
println!("agent_id: {me}");
// Listen for inbound envelopes
client.listen_inbox(|env| async move {
println!("{} from {}", env.msg_type, env.sender);
Ok(())
}).await?;
Ok(())
}Structs§
- Activity
Event - Activity event broadcast on the aggregator’s
GET /ws/activitystream. - AgentId
- A 32-byte Ed25519 agent identity, hex-encoded on the wire.
- Conversation
Id - A 16-byte conversation identifier, hex-encoded on the wire.
- Hosted
Send Request - Request body for
POST /hosted/send(hosted-agent mode). - Identity
Response - Identity response from
GET /identity. - Inbound
Envelope - Inbound envelope received from
GET /ws/inbox. - Node
Client - HTTP client for the local zerox1-node REST API.
- Send
Envelope Request - Request body for
POST /envelopes/send. - Send
Envelope Response - Response from
POST /envelopes/send.