Show list of linked articles on profile page
This commit is contained in:
15
nostr.ts
15
nostr.ts
@@ -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],
|
||||
|
||||
Reference in New Issue
Block a user