getAlby / lightning-browser-extension

The Bitcoin Lightning Browser extension that connects to different wallet interfaces and brings deep lightning integration to the web
https://getalby.com
MIT License
523 stars 193 forks source link

WebLN error compatibility issues #567

Open grunklejp opened 2 years ago

grunklejp commented 2 years ago

While working on an LN React library I noticed that Alby doesn't meet the current WebLN spec by throwing the appropriate pre-defined error messages specified here: https://webln.dev/#/api/errors.

I'm not entirely certain if this project seeks to be webLN compatible, if so I could throw together a PR in an attempt to meet the spec in regards to error handling.

I have also proposed error-handling specific changes to the webln spec that might interest this project here: https://github.com/joule-labs/webln/issues/41

bumi commented 2 years ago

Thanks for reporting this. Yes, we are not YET fully compatible here and do not properly specify the error types. I actually also like your proposal much better. This is also more extensible.

grunklejp commented 2 years ago

I'm interested in fully fleshing out a new error spec while simultaneously working on implementing it into Alby.

My ultimate goal is to create a small react hooks package to allow sites to effortlessly support WebLN while providing fallbacks to those without a provider.