Package-level declarations
Types
On-chain account owned by a Trusted Domain on one specific chain.
The domain-scoped on-chain payment authority. Owns:
Phase 2 in-memory ChainAccount adapter.
Reference DomainTreasury implementation. In-memory reservation accounting over a swappable TreasuryLedgerStore. Production deployments may swap the store for a durable backend; the reservation lock state is volatile by design — reservations are short-lived (default 30 min) and orphaned ones expire harmlessly.
In-memory implementation of TreasuryLedgerStore. Default for tests and for the testkit module. Production deployments swap in a SQL-backed store (separate module — out of scope for Phase 1).
Opaque reference to a key held in the configured KMS. The treasury layer resolves this against a org.trustweave.kms.KeyManagementService at signing time; the key material never crosses module boundaries.
Lightweight projection of treasury ledger state used by policy evaluation. Returned by TreasuryLedger.windowState and consumed by the treasury when deciding whether a Cap.PerWindow is exhausted.
Handle returned by DomainTreasury.reserve. Captures the amount locked against a ChainAccount for the duration of a single ledger-touching operation. The reservation must be settled or cancelled — orphaned reservations are auto-cancelled after their ttl.
The set of rules a domain treasury evaluates at reserve time. Exhausting any cap raises org.trustweave.anchor.exceptions.TreasuryException.CapExceeded before the operation reaches the SPI — never silently degraded.
Clock + safety-margin knobs lifted out of the interface so production deployments can tune them without subclassing.
Read view over a domain's ledger, exposed to callers and to policy evaluation. Backed by a TreasuryLedgerStore.
Append-only audit entry for one ledger-touching operation. The treasury writes one entry per reservation (RESERVED), then updates it in place with the terminal status (SETTLED / CANCELLED / FAILED).
The treasury-facing read/write port. Concrete stores plug in via the TrustedDomainManager config — default is JSONL on local disk, optional is SQL/Postgres for SaaS deployments.
Opaque unsigned transaction handed from a plugin to a ChainAccount for signing. The plugin populates bytes with chain-canonical encoded form (RLP, MsgPack, CBOR, PSBT — chain's choice).