WIP Hello world
This commit is contained in:
24
nostr.ts
Normal file
24
nostr.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import { NRelay1 } from "@nostrify/nostrify";
|
||||
|
||||
export const relay = new NRelay1("wss://nostr.kosmos.org");
|
||||
|
||||
export async function fetchReplaceableEvent(pubkey: string, identifier: string) {
|
||||
const events = await relay.query([{
|
||||
authors: [pubkey],
|
||||
kinds: [30023],
|
||||
"#d": [identifier],
|
||||
limit: 1,
|
||||
}]);
|
||||
|
||||
return events.length > 0 ? events[0] : null;
|
||||
}
|
||||
|
||||
export async function fetchProfileEvent(pubkey: string) {
|
||||
const events = await relay.query([{
|
||||
authors: [pubkey],
|
||||
kinds: [0],
|
||||
limit: 1,
|
||||
}]);
|
||||
|
||||
return events.length > 0 ? events[0] : null;
|
||||
}
|
||||
Reference in New Issue
Block a user