web_lib

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

lib.ts (622B)


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