getAlby / nostr-wallet-connect-next

Nostr Wallet Connect (NIP-47) application to allow apps to connect to your node
https://nwc.getalby.com
Apache License 2.0
8 stars 3 forks source link

feat: backend-specific capabilities #508

Closed rolznz closed 5 days ago

rolznz commented 1 week ago

Fixes https://github.com/getAlby/hub/issues/139 Fixes https://github.com/getAlby/hub/issues/90

This PR allows individual LNClients to set what capabilities and notification types they support. On the frontend when creating a new app, you'll only be shown capabilities that your LNClient supports.

TODOs

TERMS

Permission a scope for an app, including budgeting and expiry info. It is the name of a table Scope pay_invoice covers all payment methods. make_invoice covers only making invoices. notifications covers all notification types. Request Method pay_invoice, pay_keysend Notification Type payment_sent or payment_received

REFACTORING

In our DB we save a scope as a request_method which has turned into a giant mess throughout the codebase. This PR attempts to fix this by doing the minimal change to rename the column to scope and any necessary variables in the code.

This PR does not reduce the number of scopes as there were previous ideas about, and we will probably not do this in the future - only simplify the frontend.

rolznz commented 1 week ago

@bumi @im-adithya reviewing this again today, I am not really happy with it and there is a big mess with a mixup in the meanings of request methods and permissions because we delayed the rename.

I think I need to fix all this as part of this PR

Original issue: https://github.com/getAlby/hub/issues/139