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
522 stars 193 forks source link

[Feature] Add `webln.sendMultiPayments` method #2998

Open yukibtc opened 5 months ago

yukibtc commented 5 months ago

Feature description

Hi, would be awesome to have a method in WebLN to pay multiple invoices with one prompt request. This can improve the a lot the UX of nostr zap splits without the need of set a budget.

Describe the solution

Add webln.sendMultiPayments(invoices: string[]) method. Internally: decode the invoices, calculate the total amount and prompt a payment request showing the total amount (an eventually a badge/description saying that is a multi-payment request).

Describe alternatives

No response

Additional context

No response

Are you working on this?

None

rolznz commented 5 months ago

Hi @yukibtc

We are currently working on this in the NWC spec, so maybe it can then be proposed to be added to WebLN.

https://github.com/getAlby/js-sdk/pull/190

Specifically the response needs to be reviewed because with this endpoint there is possibility of some payments succeeding and some failing. Any feedback there would be appreciated!