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

feat: lnurlpay from options #448

Merged
merged 7 commits into from
Dec 25, 2021
Merged

feat: lnurlpay from options #448

merged 7 commits into from
Dec 25, 2021

Conversation

dylancom
Copy link
Contributor

@dylancom dylancom commented Dec 6, 2021

Solves #445
Seemed not as easy as just adding a route.
This is because the extension is using MemoryRouter and the Options page is using HashRouter.
MemoryRouter can pass state to a new screen, HashRouter has to do this by querystring.

Then I found out that the LNURLDetails type was incorrect :)

@github-actions
Copy link

github-actions bot commented Dec 6, 2021

Build files:

@dylancom dylancom linked an issue Dec 6, 2021 that may be closed by this pull request
@bumi
Copy link
Collaborator

bumi commented Dec 13, 2021

hmm... now we have two different behaviors:
we open a prompt for the normal invoice but the lnurl-pay flow is in the options page.
I don't really understand the router code... but can we unify that?

@dylancom
Copy link
Contributor Author

I switched back to just using hashrouter to have more unified code. Besides that /confirmPayment will now also be opened within the popup or options page just like lnurlPay.

@dylancom
Copy link
Contributor Author

@bumi
Copy link
Collaborator

bumi commented Dec 17, 2021

@dylancom any idea how it could make you happy?

we also need to refactor that soon because in that payment flow we do not really have origin data - and it is just a payment to a ln invoice or lnurl.
(right not it is actually confusing)

@dylancom
Copy link
Contributor Author

@bumi we only use name & icon, so we could just send those as a search param directly. Or store scraped twitter data on the window object and grab it from there, or call getLightingData again from the lnurlPay screen. I guess sending 2 extra search params (name & icon) is the easiest.

@bumi
Copy link
Collaborator

bumi commented Dec 18, 2021

not sure if I understand you correctly.

that flow is used from several entrypoints: paying to an invoice, paying to a lightning address, tipping a twitter profile.

The origin data holds the metadata that we add to the transactions, doesn't it? - which is more than just the name and icon.

@dylancom
Copy link
Contributor Author

@bumi oops my bad, looked too quickly itm at what we could possibly do.

@bumi bumi merged commit 34068a7 into master Dec 25, 2021
@bumi bumi deleted the issue-445 branch December 25, 2021 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sending to lightning address is broken on the options screen
2 participants