InMemoryDomainTreasury
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.
Reservation arithmetic uses TreasuryConfig.safetyMarginNumerator / safetyMarginDenominator (default 11/10) to lock slightly more than the estimate, absorbing intra-block fee-market drift.
Constructors
Functions
Release the reservation in full. Used on submission errors before any fee is incurred, and by the TTL sweeper for expired reservations.
Read view over the audit ledger.
Lock estimate × safety margin against the ChainAccount for ctx.chainId. Throws org.trustweave.anchor.exceptions.TreasuryException subclasses on policy violation or insufficient funds — never on a recoverable mempool condition (that's the plugin's concern).