Coco is a batteries-included TypeScript SDK for Cashu development. Get Cashu into your app with less than 50 lines of code.

Coco is in early alpha, so if you have played around with it I would really appreciate your thorough feedback!

GitHub: https://github.com/cashubtc/coco

Docs (WIP): https://cashubtc.github.io/coco/starting/start-here.html

Reply to this note

Please Login to reply.

Discussion

It worked very well for me in my chess-puzzle cashu faucet

https://chessu.cash

I hacked it together in a few hours for a the Ecash Hackday this week, and it just worked immediately.

I must admit that I didn't do anything complex with it, so I can't offer any useful feedback. I just want to thank you for it 😀

https://github.com/aaronmcdaid/chessu/blob/main/server/server.js#L5

Is this much better than cashu-ts?

Coco is built on top of Cashu-ts. It aims to be an opinionated, all-in-one solution that takes care of all the Cashu stuff internally. Cashu-ts is a stateless toolkit that is perfect if you want to build your own implementation, but it requires you to take care of a lot yourself

Nice! Thanks for the clarification

Can I just say I love this project very much! Thank you for creating it. I'm migrating to it and rewriting almost all my app to be more coco-first. These are just suggestions of things where I've gotten stuck and been forced to rethink my usage of the library.

1. Can we add some status field to `SendHistoryEntry` & `ReceiveHistoryEntry`? It seems like I need to use `proofService` otherwise but I think that's a private field, I just got a bit stuck on this.

2. Maybe add `token` to `ReceiveHistoryEntry`? I know it's not super needed but its nice to show the user which token the redemption is for.

3. Could we add some field to HistoryEntry for npc receives from `coco-cashu-plugin-npc` so that I can know thats where the payment came from?

4. I found `cashu-kym` pretty useful to and I think it might belong in `coco`.

5. I'm having a weird thing happen where the state goes from PENDING->ISSUED->PAID->ISSUED. It seems to incorrectly revert to ISSUED (when minting). It could be some poor configuration on my side but I attached a video to help demonstrate whats going on.

https://blossom.primal.net/d0286eca73485fabd333fbc52ecb02e1f63d8f1c5880fc6bae7a78abb196213d.mov

I'm still learning this library so I might be way off but hopefully its still helpful feedback!

This is super valuable thank you! I’ll track these on GitHub and tag you once I figure something out :)

“ISSUED” is the final state of a mint quote.

Pending: payment has not been received by the mint

Paid: payment has been received by the mint

Issues: wallet redeemed the quote

So the final state being issued is correct. Are you sure you are seeing the issued state before the paid state?

The updates are not done in a state machine, so this could be the case / a bug. I just want to make sure that we are on the same page

Oh it was my misunderstanding that's the issue I think. Apologies for flagging this as an issue! My code incorrectly thought PAID was the final state.