Egge @Egge - 2d
The latest RC of cashu-ts introduces the concept of Factories. A Factory is a function that lets developers take control over how Cashu outputs will be generated by cashu-ts. Consumers can also define a "default" factory that is going to be used for all outputs that are considered "keep" outputs (mints + melt / swap change). This paves the way for much easier state management and WAY less code. In this very simplistic example I show how a simple closure can be used to make sure that all the proofs generated are derived from a seed phrase, while outsourcing the counter management to the factory https://m.primal.net/NBrP.png https://m.primal.net/NBrQ.png