web_lib

Common web application libraries
git clone https://radroots.dev/git/web_lib.git
Log | Files | Refs | LICENSE

lib.ts (631B)


      1 import { KIND_LISTING, type RadrootsListing } from "@radroots/events-bindings";
      2 import type { NostrEventFigure, NostrSignedEvent } from "../../types/nostr.js";
      3 import { nostr_event_create } from "../lib.js";
      4 import { tags_listing } from "./tags.js";
      5 
      6 export const nostr_event_classified = async (
      7     opts: NostrEventFigure<{ data: RadrootsListing }>,
      8 ): Promise<NostrSignedEvent | undefined> => {
      9     const { data } = opts;
     10     const tags = await tags_listing(data);
     11     return nostr_event_create({
     12         ...opts,
     13         basis: {
     14             kind: KIND_LISTING,
     15             content: "",
     16             tags,
     17         },
     18     });
     19 };