What is Nostr?
Egge /
npub1mhc…c226
2024-12-20 19:22:39

Egge on Nostr: The latest RC of cashu-ts introduces the concept of Factories. A Factory is a ...

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


Author Public Key
npub1mhcr4j594hsrnen594d7700n2t03n8gdx83zhxzculk6sh9nhwlq7uc226