Expand description
§cashu-mint-audit
A tiny async client for the Cashu mint auditor (audit.8333.space) — the round-robin auditor by calle that perpetually sends Lightning payments in a circle between Cashu mints and records which mints pay and which fail.
This crate wraps its public JSON API (https://api.audit.8333.space) and
derives a per-mint health summary (success rate, last-seen-good, recent
failures) from the raw swap history, so a wallet can show honest reliability
signal next to a mint before a user trusts it.
It is deliberately standalone — no wallet, Nostr, or protocol dependencies — so it can be released and consumed independently.
let client = cashu_mint_audit::AuditorClient::new();
let mints = client.list_mints().await?;
for m in &mints {
let health = client.health_for(m.id, 100).await?;
println!("{} — {:?} ({:.0}% of {} swaps ok)",
m.url, health.rating(), health.success_rate * 100.0, health.sampled_swaps);
}Structs§
- Audited
Mint - A mint as tracked by the auditor.
infois the mint’s own NUT-06/v1/infodocument, captured verbatim by the auditor (as a JSON string on the wire); useAuditedMint::parsed_infoto decode it. - Auditor
Client - Async client for the Cashu mint auditor API.
- Auditor
Stats - Aggregate auditor statistics.
- Mint
Health - A per-mint reliability summary computed from recent audit swaps. This is the “audit information” a wallet surfaces next to a mint.
- Mint
Info - A subset of a mint’s NUT-06
/v1/infodocument. Unknown fields are ignored;nutsis kept as a raw value since its shape varies by NUT. - Swap
- One round-robin swap the auditor performed involving a mint.
state == "OK"means the swap settled; anything else (with anerror) is a failure — the core reliability signal. - Swap
Query - Query filters for
AuditorClient::swaps.
Enums§
- Audit
Error - Errors from the auditor client.
- Health
Rating - A coarse reliability verdict derived from a mint’s recent swap history.
Constants§
- DEFAULT_
BASE_ URL - Default base URL of the public auditor API.