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: add LNURL verify #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

feat: add LNURL verify #10

wants to merge 1 commit into from

Conversation

im-adithya
Copy link
Member

@im-adithya im-adithya commented Nov 23, 2024

Description

Fixes #2

  • Adds LNURL verify at /lnurlp/:username/verify/:payment_hash
  • The callback URL is shifted from /.well-known/lnurlp/:username/callback to /lnurlp/:username/callback
  • Context type is added to avoid ts errors
  • DEBUG is capitalized as LevelName type is defined as type LevelName = "NOTSET" | "DEBUG" | "INFO" | "WARN" | "ERROR" | "CRITICAL"

@@ -52,17 +58,45 @@ export function createLnurlApp(db: DB) {
});

const transaction = await nwcClient.makeInvoice({
amount: +amount,
amount: Math.floor(+amount / 1000) * 1000,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this added? you cannot have sub-millisats

const hono = new Hono();

hono.get("/:username", async (c) => {
hono.get("/:username", async (c: Context) => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should not need : Context. In Typescript, it is inferred from the argument type. Are you sure your environment is setup correctly?


return c.json({
settled: !!transaction.settled_at,
preimage: transaction.preimage || null,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why || null? shouldn't it be omitted from the response body if it is undefined?

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.

support LNURL-verify
2 participants