-
Notifications
You must be signed in to change notification settings - Fork 4
Adding bolt12 support #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
* fix nwc description * initial * fixup crud and models * views and tasks * Added description for extension preview * fixed js * make * Allow arbitrary types * trying to fix install error * added arbitrary_types_allowed * fixed migration error * migration fix * migration fix attempt * make * hopefully his will work * removed basemodel (test) * Update manifest.json * fix json bug, move js to own file * move admin js to own file * update dev environment * fix template regression * upgrade quasar api calls * fix models * fix budget * fix tracked budget * fix async pytests * mount docker socket for integration test * install pytest-asyncio in poetry env * update integration tests * revert listener refactoring to avoid cyclic dependency hell * fix broken refactoring * fix for new api * fix integration test run * fix integration test run? * fix integration test run? * fix integration test run? * fix integration test run? * edges hardening * fix integration test run? * more hardening * fix for ghactions ? * fix ghactions? * more ghaction fixes * fix integration test run? * more hardening * garbage collect old tracked events * configurable handle_missed_events * readme format * default handle_missed_events to 0 * more hardening * increase timeout * increase timeout * Add more tests * more hardening * format * lint * postgres fix --------- Co-authored-by: Riccardo Balbo <[email protected]>
-Was accessing the arguments from payload instead of from params -Was using "to" instead of "until" defined in NIP-47
-Improving _offer_to_dict function
string for bolt12 invoices.
-This should complete the initial support for Bolt12. The only remaining issue is regarding the invoice string for Bolt12 payments. Currently there is no bolt12 column in the apipayments table. This can be added if this is deemed useful.
|
PR for NIP-47 to add Bolt12 support: nostr-protocol/nips#1952 |
riccardobl
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
We'll need to wait until support is merged into LNbits and the changes are approved in the NIP-47 spec.
Aside from that, it looks solid at first glance, but it will need some tests for the new methods in test_all.py
| raise Exception("Missing invoice") | ||
| invoice_data = bolt11_decode(invoice) | ||
| # hardening # | ||
| assert_valid_bolt12(invoice) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add an assert_valid_bolt12_or_bolt11 method, if the invoice can be either of the two
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok yes I will do that
| invoice_data = bolt11_decode(invoice) | ||
|
|
||
| # hardening # | ||
| assert_valid_bolt12(invoice) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here, should use assert_valid_bolt12_or_bolt11
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noted
| finally: | ||
| await wallet1.close() | ||
| await wallet2.close() | ||
| await wallet2.close() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why did you remove this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I think it might be a "\r\n" vs "\n" new line issue. I had to manually merge. I will analyze how the file was previously ending by doing an hex dump.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh ok it's the line ending, i was sleepy and misread the diff in the merged view.
Don't worry about that.
Yes of course I understand. I am just working on the different pieces that are needed. It seems I managed to get the discussing going with NIP-47. I will start working on support from Zeus next. |
These changes add bolt12 support to the NWC provider extension, leveraging the work to add support in lnbits (lnbits/lnbits#3092). The following NWC commands are added:
-make_offer
-lookup_offer
-enable_offer
-disable_offer
-list_offers
-fetch_invoice
Also, the following commands are modified to support bolt12:
-lookup_invoices
-pay_invoice
-multi_pay_invoice