Skip to content

v0.4.2 — Fee-aware proof selection + offline-send optimization

Latest

Choose a tag to compare

@zeugmaster zeugmaster released this 29 Jun 21:41

Additive, fully source-compatible release (no breaking changes — existing call sites compile and behave identically).

New: fee-aware proof selection

  • CashuSwift.selectProofs(_:targetAmount:mint:unit:purpose:policy:denominationTarget:) — exact subset-sum for fee-free direct sends, and a fee-aware Pareto bounded-knapsack for swaps/melts. Identity-preserving (returns the caller's own proof values).
  • ProofSelectionResult/ProofSelectionPolicy/ProofSelectionPurpose/ProofSelectionKind/ProofSelectionOptimality/ProofSelectionError.

New: denomination-distribution planning + offline send

  • DenominationTarget, idealDistribution(balance:…), preferredDistribution(forAmount:retained:…), denominationGap(for:…).
  • offlineToken(for:mint:memo:) (synchronous, no mint round-trip) and canSendOffline(_:amount:mint:unit:).
  • Optional preferredKeepDistribution / preferredReturnDistribution hooks on send / receive / swap (all default to nil = prior base-2 behaviour).

Merges #24 and #25. 156 tests passing.