You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

39 lines
1.3 KiB

import { ExtendedKind, SUPPORTED_KINDS } from '@/constants'
import { kinds } from 'nostr-tools'
/** Kinds the main `Note` component renders with a dedicated UI (not `UnknownNote`). */
const RENDERABLE_NOTE_KINDS = new Set<number>([
...SUPPORTED_KINDS,
kinds.Reaction,
ExtendedKind.EXTERNAL_REACTION,
ExtendedKind.POLL_RESPONSE,
kinds.CommunityDefinition,
kinds.LiveEvent,
/** NIP-53 meeting space (30312) and meeting (30313); rendered like kind 30311 in Note. */
30312,
30313,
ExtendedKind.GROUP_METADATA,
ExtendedKind.PUBLIC_MESSAGE,
ExtendedKind.ZAP_REQUEST,
ExtendedKind.ZAP_RECEIPT,
ExtendedKind.MONERO_TIP_DISCLOSURE,
ExtendedKind.MONERO_TIP_RECEIPT,
ExtendedKind.PAYMENT_NOTIFICATION,
ExtendedKind.PUBLICATION_CONTENT,
ExtendedKind.FOLLOW_PACK,
ExtendedKind.CITATION_INTERNAL,
ExtendedKind.CITATION_EXTERNAL,
ExtendedKind.CITATION_HARDCOPY,
ExtendedKind.CITATION_PROMPT,
ExtendedKind.WEB_BOOKMARK
])
/**
* Every kind the main `Note` component renders with a dedicated UI (not the unknown-event fallback).
* Used by the notifications spell client filter so mention events use the same cards as elsewhere.
*/
export const RENDERABLE_NOTE_KINDS_SORTED = [...RENDERABLE_NOTE_KINDS].sort((a, b) => a - b)
export function isRenderableNoteKind(kind: number): boolean {
return RENDERABLE_NOTE_KINDS.has(kind)
}