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
540 stars 194 forks source link

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

Open yukibtc opened 10 months ago

yukibtc commented 10 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 10 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!