Egge's avatar
Egge
egge@npub.cash
npub1mhcr...c226
Building https://npub.cash πŸ₯œ Working on awesome nostr, cashu and Lightning stuff πŸ’œβš‘οΈ
Egge's avatar
Egge 10 months ago
Because I received a coupe of DMs pointing out a bug in this code: in JavaScript β€œthis” is implicitly defined in every function scope. If there is no object attached (function is not a method) it points to the global object (window or globalThis). There is no bug in this code. ecash fixes it globally. View quoted note β†’
Egge's avatar
Egge 10 months ago
I have spent several weeks trying to replace the Blink API wrapper of npub.cash with a Cashu native alternative and its been a wild ride. While Cashu mints do support WebSockets for realtime updates, it turned out that WebSockets are pretty difficult to work with, when you are trying to keep them and the subscriptions alive for long periods (in my case days). But there is a second issue: You see Cashu mints enfore rather strict rate limits on their users. This is important as Cashu is account-less and preventing spam attacks is difficult. Usually this is no issue, as regular users interacting with a mint do not hit these limits. But npub.cash is a funnel. Instead of every user using their own IP to hit the mint, with npub.cash every user "proxies" through the services server. Turns out this second issue is much bigger than the first one and WebSockets do not solve this. So I decided to build a scheduler that make sure that all mint communication happens as frequent as possible, but never to frequent. This module also solves the first issue, as it allows to queue polling tasks in a lower priority making sure the service stays up to date about payment activity. If the server restarts it wont hit the mint with a gazillion subs at once, it will make sure they are evenly spread out through low priority calls, while always making sure there is "rate" left for calls that need to be instant. I built this module externally, so theoretically I could publish it as npm package for structured and timed mint communication. Please let me know if you could use something like this (because as of right now I don't think most Cashu applications would benefit from this, npub.cash is not your usual Cashu application). After doing some testing I think it is ready to put into an experimental version of npub.cash. I hope to release this on reckless-npub.cash by the end of the week. image
Egge's avatar
Egge 10 months ago
ecash fixes it
Egge's avatar
Egge 10 months ago
I think I finally got it working πŸ₯œ
Egge's avatar
Egge 10 months ago
mood rn. I think I just embarked on my villain arc. image
Egge's avatar
Egge 10 months ago
cashu-ts v2.3 will support NUT22 auth 🎊 image
Egge's avatar
Egge 10 months ago
My new gym has no racks o0
Egge's avatar
Egge 10 months ago
Does anyone use the static methods exposed by CashuWallet and CashuMint in cashu-ts?
Egge's avatar
Egge 10 months ago
NUT21 & NUT22 are the best approach to authentication that I have ever seen. image
Egge's avatar
Egge 11 months ago
Cashu-ts contributors are just built differently! Just released 2.2 stable version (blog post coming tomorrow), meanwhile so much great new stuff came in that we can release a 2.3 RC almost immediately πŸ”₯ You guys are killing it πŸ’œπŸ₯œ
Egge's avatar
Egge 11 months ago
nostr is the glue GM β˜•οΈ
Egge's avatar
Egge 11 months ago
Good night nostr πŸ’œ image
Egge's avatar
Egge 11 months ago
Now and then I get some BCH posts in my Reddit Feed… the cope is reeeeal πŸ”₯
Egge's avatar
Egge 11 months ago
Do Browsers implement ping/pong on WebSockets according to the WebSocket RFC?
Egge's avatar
Egge 11 months ago
Hey ChatGPT, please put this in code. Thanks! image
Egge's avatar
Egge 11 months ago
Cashu should be fun, WebSocket boilerplate is not. Lets fix this. πŸ’œ image
↑