# sennet (Rust) Blocking Rust client for Sennet. It is **not published on crates.io**: add it as a path or git dependency. ```toml # from a checkout of this repository sennet = { path = "../sennet/sdk/rust" } # or straight from git (replace with your repository URL) sennet = { git = "https://example.com/your/sennet.git", branch = "main" } ``` For the git form, Cargo needs the crate at the repository root. This one lives in `sdk/rust`, so prefer the path form (or a git submodule/subtree). ## Example ```rust use sennet::{ReserveInput, Sennet, Error}; fn main() -> Result<(), Error> { let s = Sennet::new("http://127.0.0.1:3000", "sn_worker_key", "worker-1"); // reserve -> send with your own signer -> submit let done = s.spend::(&ReserveInput::new("USDC", 1_000_000u64), |r| { Ok("5".repeat(88)) // sign and send yourself, return the signature })?; s.settle(&done.id, Some("990000"), None)?; // run once across the whole fleet let id: String = s.once::<_, Error>("create-ata", || Ok("created".to_string()))?; Ok(()) } ``` Errors: `Error::Api { status, code, message, body }` (e.g. `code == "insufficient"`) or `Error::Transport`. Run the end to end example: set `SENNET_URL`, `SENNET_OWNER_KEY`, `SENNET_WORKER_KEY` and `cargo run --example flow`. ## HTTPS HTTPS (rustls) is on by default through the `tls` feature. For a plain-http client with no C toolchain needed (rustls builds `ring`), turn default features off: ```toml sennet = { path = "../sennet/sdk/rust", default-features = false } ```