Skip to content

Commit

Permalink
chore: add payerdata and nostr info to lnurlp well known
Browse files Browse the repository at this point in the history
  • Loading branch information
im-adithya committed Dec 18, 2024
1 parent b194335 commit aa631a8
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions src/well-known/lnurlp.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Hono } from "hono";
import { BASE_URL, DOMAIN } from "../constants.ts";
import { BASE_URL, DOMAIN, NOSTR_NIP57_PUBLIC_KEY } from "../constants.ts";
import { DB } from "../db/db.ts";
import { logger } from "../logger.ts";

Expand All @@ -22,15 +22,28 @@ export function createLnurlWellKnownApp(db: DB) {
// check the user exists
await db.findUser(username);

// TODO: zapper support

return c.json({
tag: "payRequest",
commentAllowed: 255,
callback: `${BASE_URL}/lnurlp/${username}/callback`,
minSendable: 1000,
maxSendable: 10000000000,
metadata: getLnurlMetadata(username),
payerData: {
name: {
mandatory: false
},
email: {
mandatory: false
},
pubkey: {
mandatory: false
}
},
...(NOSTR_NIP57_PUBLIC_KEY ? {
nostrPubkey: NOSTR_NIP57_PUBLIC_KEY,
allowsNostr: true,
} : {})
});
} catch (error) {
return c.json({ status: "ERROR", reason: "" + error });
Expand Down

0 comments on commit aa631a8

Please sign in to comment.