Skip to content
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

Support new NWC commands #1048

Merged
merged 8 commits into from
Mar 19, 2024
Merged

Support new NWC commands #1048

merged 8 commits into from
Mar 19, 2024

Conversation

benthecarman
Copy link
Collaborator

@benthecarman benthecarman commented Feb 22, 2024

This adds support for get_balance, get_info, make_invoice, and lookup_invoice.

Currently missing the multi commands as they'd require a larger refactor that I'd rather do as a follow up. Also left out keysends because that'd require a refactor for budgeting and list_transactions because I am not sure how we'd want to implement that while preserving privacy.

Closes #895

@TonyGiorgio
Copy link
Contributor

needs rebase

@TonyGiorgio
Copy link
Contributor

Failing tests

@benthecarman benthecarman force-pushed the new-nwc branch 2 times, most recently from 9aa6503 to 597c8e4 Compare March 14, 2024 14:00
@TonyGiorgio
Copy link
Contributor

needs rebase

@TonyGiorgio
Copy link
Contributor

TonyGiorgio commented Mar 18, 2024

This adds support for get_balance, get_info, make_invoice, and lookup_invoice.

These should probably be allowed by default

@benthecarman
Copy link
Collaborator Author

These should probably be allowed by default

Done

@TonyGiorgio TonyGiorgio merged commit 5ff151a into master Mar 19, 2024
9 checks passed
@TonyGiorgio TonyGiorgio deleted the new-nwc branch March 19, 2024 18:12
@rolznz
Copy link

rolznz commented Mar 20, 2024

Cool! How can I test this? do I need to create a new connection? I tried to create one and get "Unknown error occurred" - auto approve, 10000 sats, resets daily

@benthecarman
Copy link
Collaborator Author

This hasn't been deployed yet, should be by the end of the month

@rolznz
Copy link

rolznz commented Apr 4, 2024

I tried the Mutiny latest update (PWA version) and am still having issues doing any requests outside of pay_invoice. Is it in this release?

I would love to see Mutiny working with some of the NWC-powered apps like the BuzzPay PoS https://github.com/getAlby/pos

@benthecarman
Copy link
Collaborator Author

If you make a new connection it should get the new commands.

@rolznz
Copy link

rolznz commented Apr 4, 2024

I tried again today. make_invoice works, but lookup_invoice never seems to be updated so the PoS never gets a confirmation of the payment (it polls lookup_invoice). My mutiny wallet was open and I received the payment there.

I updated the PoS to be more relaxed and will show a confirmation rather than erroring if the wrong NWC permissions are given. You should be able to try it: https://github.com/getAlby/pos

@benthecarman
Copy link
Collaborator Author

In the logs I am getting these errors after it is paid, seems like something on your end, that error message isn't from us
image

@rolznz
Copy link

rolznz commented Apr 5, 2024

@benthecarman that error happens when we get no reply from the wallet within a timeout. Can you check the reply payload you are sending?

@benthecarman
Copy link
Collaborator Author

looks like the lookup invoice doesn't have any parameters, I am getting this error in mutiny No payment_hash or bolt11 provided

@benthecarman
Copy link
Collaborator Author

benthecarman commented Apr 10, 2024

hmm looks like rust-nostr is parsing for bolt11 but the spec is invoice 🤦‍♂️ my bad. If you guys switch it to the use the payment_hash it should probably work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve NWC support (return response from send payment, get_balance, make_invoice/lookup_invoice)
3 participants