payjoin / nolooking

Batched Channels from a PayJoin ⚡️🔀
41 stars 8 forks source link

Get Quote and Pay for Inbound Channel #65

Closed nickfarrow closed 1 year ago

nickfarrow commented 1 year ago

Fetch quote from

https://nolooking.chaincase.app/api/getinbound?<nodeid>&<capacity>&<duration>&<refund_address>

(see https://github.com/nolooking/sateater/pull/11) Display address to pay for inbound channel!

image image

DanGould commented 1 year ago

I think for this to make sense in our app we have to merge that address into the PayJoin PSBT. I didn't realize we were returning an address to the UI

DanGould commented 1 year ago

Taking a double take on this, I imagine a slightly different flow.

We could add a line to our channels ui with a checkbox like

<label>Inbound channel</label>  <input disabled value=1_000_000 \>

                                    I want a quote for an inbound channel (~30k sats)    [x]

on /schedule, find the quote, and return the ScheduledPayJoin with the bip21 that pays for it. We can show if that quote succeeded or failed, as well as the quote there, all ready to be paid. This design intends to minimize interaction and points of failure.

DanGould commented 1 year ago

Changed so /schedule takes a request for inbound and if so adds the output to the proposal psbt

UI, error handling, integration test upgrade to include inbound payment, and response status update TODO

DanGould commented 1 year ago

image

DanGould commented 1 year ago

"Allow channels of length 0" commit should

DanGould commented 1 year ago
DanGould commented 1 year ago

I think we should proceed with this PR now without altering the integration test. The nolooking lsp is now tested and working on regtest.

The lsp module has no config for the lsp, so it always hits mainnet. I think that's fine for the next tournament release since we have done manual tests, but it makes writing the integration test harder. The lsp code needs to change to inject the lsp url. that should be the next issue.

This is working as is and imo should be merged assuming CI passes