Expand description
Typed client SDK for the talea ledger server, plus the talea CLI.
TaleaClient implements the same LedgerApi trait the server’s
in-process service does, so code written against the trait runs
unchanged against either. All operations are retry-safe by construction
(posts carry caller-supplied idempotency keys, registry writes are
idempotent on id, reads are reads), and the client retries 503/transport
failures automatically within a bounded RetryPolicy.
use talea_client::{LedgerApi, Page, TaleaClient};
let client = TaleaClient::builder("http://127.0.0.1:8080")
.bearer_token("sekrit")
.build()?;
let balance = client.balance("onramp", "cash", None).await?;
println!("{} {}", balance.balance, balance.asset);
let page = client
.account_history("onramp", "cash", Page { after_seq: None, limit: 100 })
.await?;Subscriptions are unbroken streams: LedgerApi::subscribe reconnects
with backoff and resumes from the last seen sequence, so consumers never
re-implement cursor bookkeeping.
Modules§
- cli
- The
taleaCLI: thin shim over TaleaClient.executereturns the response as JSON (None for 204 ops) so tests never need a subprocess;runadds printing and the streamingtailloop.
Structs§
- Account
Draft - Asset
Draft - Balance
View - Client
Builder - Configures and builds a
TaleaClient. Created byTaleaClient::builder; finish withClientBuilder::build. - Event
Envelope - Page
- Paged
- Posted
- Posting
Draft - Posting
View - Retry
Policy - Talea
Client - HTTP client for a talea server, implementing
LedgerApi. - Transaction
Draft - Transaction
View - Trial
Balance - Trial
Balance Line - Wire
Amount
Enums§
Traits§
- Ledger
Api - The full ledger contract. Each transport adapter is a thin translation
onto it: the server implements it over a
Store, the client over HTTP — code written against this trait runs unchanged against either.
Functions§
- format_
minor - Render minor units as a decimal string using the asset’s precision. Pure string arithmetic — safe for any precision, no 10^p overflow.