STORY
Bitcoin Connect V3 PR ready for review!
AUTHOR
Joined 2022.10.06
DATE
VOTES
sats
COMMENTS

Bitcoin Connect V3 PR ready for review!

Following the planning Bumi and I did last week, I worked all this week on a brand new version of Bitcoin Connect. The Github PR has turned out quite large and improves and fixes a number of things:

  • New and simplified developer API:

    • a new requestProvider function that with a single line of code can ensure the application has a WebLN provider ready to use

    • a new init function instead of passing global Bitcoin Connect configuration through attributes in the web components (which are optional)

    • Improved launchModal function with a way to be notified when a payment has been made

    • Easy to use, typed event listeners - no longer relying upon window.addEventListener

  • Bitcoin Connect payment and connect flows can now be rendered outside of the modal - the modal is now optional!

  • Reduced bundle size by over 50%

  • Removed deprecated and insecure crypto-js dependency in Alby dependencies (We're pushing LNC to remove it there too!)

  • Expose a way to interact directly with the underlying WebLN provider (to easily access methods on NWC, LNC and LNbits providers)

  • Move balance display to a separate component, removing the complexity in checking if GetBalance() should be called from the modal and button

  • Remove esbuild (and browserify from Alby JS SDK and Lightning tools) - now all three projects work with esm.sh, JSDelivr and skypack as Javascript modules! This also fixes LNC when included in pure HTML which was broken by esbuild in Bitcoin Connect V2.

  • A lot of simplifications in the code which will make it easier for new contributors to contribute (we have a lot of "good first issue" tickets!)

  • Fixed waiting and success animations to match brand color

I'm hoping to go through this PR with Bumi and Rene early next week. 🚀

We also had a chat with one of the most popular V4V apps which is going to experiment with Bitcoin Connect in the coming weeks. Stay tuned 👀

Roland