Skip to main content

Crate cashu_mint_audit

Crate cashu_mint_audit 

Source
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§

AuditedMint
A mint as tracked by the auditor. info is the mint’s own NUT-06 /v1/info document, captured verbatim by the auditor (as a JSON string on the wire); use AuditedMint::parsed_info to decode it.
AuditorClient
Async client for the Cashu mint auditor API.
AuditorStats
Aggregate auditor statistics.
MintHealth
A per-mint reliability summary computed from recent audit swaps. This is the “audit information” a wallet surfaces next to a mint.
MintInfo
A subset of a mint’s NUT-06 /v1/info document. Unknown fields are ignored; nuts is 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 an error) is a failure — the core reliability signal.
SwapQuery
Query filters for AuditorClient::swaps.

Enums§

AuditError
Errors from the auditor client.
HealthRating
A coarse reliability verdict derived from a mint’s recent swap history.

Constants§

DEFAULT_BASE_URL
Default base URL of the public auditor API.