Show list of linked articles on profile page

This commit is contained in:
2024-10-21 00:06:15 +02:00
parent e14adffbc8
commit 18f3e888a6
8 changed files with 93 additions and 32 deletions

View File

@@ -2,7 +2,10 @@ import { NRelay1 } from "@nostrify/nostrify";
export const relay = new NRelay1("wss://nostr.kosmos.org");
export async function fetchReplaceableEvent(pubkey: string, identifier: string) {
export async function fetchReplaceableEvent(
pubkey: string,
identifier: string,
) {
const events = await relay.query([{
authors: [pubkey],
kinds: [30023],
@@ -13,6 +16,16 @@ export async function fetchReplaceableEvent(pubkey: string, identifier: string)
return events.length > 0 ? events[0] : null;
}
export async function fetchArticlesByAuthor(pubkey: string) {
const events = await relay.query([{
authors: [pubkey],
kinds: [30023],
limit: 10,
}]);
return events;
}
export async function fetchProfileEvent(pubkey: string) {
const events = await relay.query([{
authors: [pubkey],