getAlby / lightning-browser-extension

The Bitcoin Lightning Browser Extension that brings deep Lightning & Nostr integration to the web. Wallet interface to multiple lightning nodes and key signer for Nostr, Liquid and onchain use.
https://getalby.com/#extension
MIT License
536 stars 193 forks source link

Handle LNURL pay callback errors #761

Closed bumi closed 2 years ago

bumi commented 2 years ago

Describe the bug Currently we do not handle errors of the LNURL-pay callback

To Reproduce Steps to reproduce the behavior:

  1. pay an LNURL-pay with a certain minSendable
  2. try to send a payment below the minimum
  3. the error response from the callback is not handled

Expected behavior Show an error alert to the user

related code: https://github.com/getAlby/lightning-browser-extension/blob/master/src/app/screens/LNURLPay.tsx#L127

reneaaron commented 2 years ago

Request errors are now handled, however it would be possible to run some validation on the client before even requesting the invoice. (min <= amount <= max)

I noticed the input fields have the correct min and max values but there is no validation? 🤔