Add shared LNURL types, indexing helpers, and warnings.
Introduce lnurl as a first-class mint type with probe/announcement fields and shared helpers the API and web can both rely on. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -13,6 +13,15 @@ export const KIND_REVIEW = 38000;
|
||||
export const KIND_MINT_ANNOUNCEMENT = 38172;
|
||||
/** NIP-87 Fedimint federation announcement. */
|
||||
export const KIND_FEDIMINT_ANNOUNCEMENT = 38173;
|
||||
/**
|
||||
* LNURL mint announcement.
|
||||
*
|
||||
* Not in NIP-87: this site's own proposed extension to it, specified in
|
||||
* `docs/KIND-LNURL-MINT.md` and intended for a PR to nostr-protocol/nips. 38174 is the
|
||||
* next free slot in the family — checked against the kind index in the nips README and
|
||||
* against every issue and PR in that repository before it was claimed.
|
||||
*/
|
||||
export const KIND_LNURL_ANNOUNCEMENT = 38174;
|
||||
/** Profile metadata. */
|
||||
export const KIND_PROFILE = 0;
|
||||
|
||||
@@ -30,6 +39,7 @@ export const KIND_PROFILE = 0;
|
||||
export const ANNOUNCEMENT_KINDS = {
|
||||
cashu: KIND_MINT_ANNOUNCEMENT,
|
||||
fedimint: KIND_FEDIMINT_ANNOUNCEMENT,
|
||||
lnurl: KIND_LNURL_ANNOUNCEMENT,
|
||||
} as const;
|
||||
|
||||
/**
|
||||
@@ -224,6 +234,11 @@ export function isFedimintReview(event: NostrEventLike): boolean {
|
||||
return tagValue(event.tags, 'k') === String(KIND_FEDIMINT_ANNOUNCEMENT);
|
||||
}
|
||||
|
||||
/** True when the event's `k` tag marks it as being about an LNURL mint. */
|
||||
export function isLnurlReview(event: NostrEventLike): boolean {
|
||||
return tagValue(event.tags, 'k') === String(KIND_LNURL_ANNOUNCEMENT);
|
||||
}
|
||||
|
||||
/**
|
||||
* The kind a review says it is about, from its `k` tag, as a number.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user