-
Notifications
You must be signed in to change notification settings - Fork 61
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
[WIP] Implement allowances that auto-pay invoices #222
base: develop
Are you sure you want to change the base?
Conversation
I was experimenting a bit with this PR. First of all: the UX is great! Super intuitive and nice to use. Can not wait to get this released :) Here are a few things that I've noticed: send payment for allowances is done in the context of the websiteIt seems currently the send payment call (POST /v1/channels/transactions) is done in a content script thus in the context of the current website. This does not work for me because of blocked cross origin calls. (calling the rest API of a lnd node without CORS). (debug screenshot) failed browser notificationsFor whatever reason bolt11 (and coinfo/bitcoinjs-lib) currently does not support simnet networkAnd the bolt11 package adds some dependencies and I was wondering if we can use the |
Yep, this is definitely a hacked together version. I think I'm going to have to setup a communication channel with the
This is possibly a permissions issue? I'll have to dig a little deeper to see why it might be missing. But I should definitely be handling cases where notifications go wrong.
I wanted to avoid this for latency reasons, my remote node can sometimes respond a little slow and I didn't want to add 500ms+ delays to payment prompts to decode the invoice. I'd rather contribute to |
fyi: I was experimenting a bit with this and also moving parts into the background script. |
it seems the state of |
In that screenshot, password is still The password is only filled into the store state again when you've checked the remember checkbox once it's needed. You can see that logic over in the |
ok, thanks for the hint. Though I don't have to enter the password when I confirm the prompt. update: after some more debugging I don't find/understand how the password should be stored. also I failed to try to add it. any hints are welcome :) thx. |
Hey @bumi, sorry for leaving you hanging so long on this one. The password saving behavior is definitely a little tricky, and sagas are doubly tricky. The way it works is once you enter your password with the save password checkbox set, it send a message to the background script (sending code here, saving code here) to hold onto it in memory. Whenever a password request happens, we first check in with the background script if it has the password cached (Request from background here, background sending back here). Now, my understanding is that when that happens, it should fire the |
@wbobeirne I see you requested a review on this PR. I'm looking forward to playing with it. Is it ready? I should have time over the weekend. |
Haha, oh man I totally forgot I had tagged you ages ago. Finally scratching out some free time to work on Joule again. Planning on getting this in a stable state and trying to entice people to run it as a beta for me for some sats in exchange. Still has some work to go after the refactor in #244, but it should be pretty close. Happily using Polar to do my testing with this right now. |
No worries. I just saw a notification and wasn't sure if that was new or old. Feel free to let me know if you need any help with anything. Once you go Polar, it's hard to go back to the terminal. Lol |
<3 I am also jumping back on this. let me know if I can help you with something. |
Unfortunately in spite of moving the requests to the Unfortunately this type of automatic node communication may be dead in the water unless a native bridge is built (#106). |
hmm. does that mean current master also has that issue? |
Yeah, that issue is currently present in Native programs can't be bundled with extensions, they have to be downloaded and installed separately. This isn't an uncommon setup with some applications, like 1Password, where they have a version of the extension that requires a native application to be paired with it. Not having native access has been a blocker for a ton of issues, such as switching to use the gRPC API, dealing with invalid TLS cers, being able to implement channel close, being able to handle |
The lastPaymentAttempt is needed to verify the cooldown period for autopayments.
Store last payment attempt in the allowance config
fyi. this is the proxy app I've built to work around the invalid cert error: https://github.com/bumi/lnd-proxy |
Dude, this is very slick! I'd be happy to throw something in the readme after I look it over. Nice work. |
it is a pretty early version and I have to learn some Golang for it :) And I am wondering about the UX and the usefulness of it. What is your plan with the allowance feature? As the communication through the background script should get reverted do you see any chance to implement the allowances? Could it maybe be optional? |
webpack.config.js |
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.
webpack.config.js
Closes #42
Description
This adds a new module,
appconf
that can be used to add customizations to each webapp. The one implemented here is allowances, the idea of setting up rules that allow automatic payments to happen without user intervention.This also adds a status bar that gives you quick actions you can take on the current page you're on.
A more thorough write-up of this PR is up on Medium: https://medium.com/p/2b08bec75e3a
TODOs
sats
in a few places)Steps to Test
Screenshots
Status Bar
Allowance page
Notifications