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

proper error handling for bip353 dns addresses from phoenix + self hosted dns addresses #3197

Merged
merged 1 commit into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/app/screens/Send/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ function Send() {
lnurl = invoice;
}

if (lnurl?.endsWith("phoenixwallet.me")) {
throw new Error(
"Paying Phoenix addresses is not possible. Phoenix is not compatible with the current state of lightning addresses as they use a different protocol."
);
}

if (lnurl) {
const lnurlDetails = await lnurlLib.getDetails(lnurl);
if (isLNURLDetailsError(lnurlDetails)) {
Expand Down
4 changes: 4 additions & 0 deletions src/common/lib/lnurl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ const lnurl = {
if (axios.isAxiosError(e)) {
error =
(e.response?.data as { reason?: string })?.reason || e.message;

if (this.isLightningAddress(lnurlString)) {
error = `This is not a valid lightning address. Either the address is invalid or it is using a different and unsupported protocol: ${error}`;
}
} else if (e instanceof Error) {
error = e.message;
}
Expand Down
Loading