class Nostr
extends EventEmitter
import { Nostr } from "https://deno.land/x/nostr_deno_client@v0.2.7/lib/nostr.ts";
Methods
private
calculateId(event: NostrEvent)private
eventCommitment(event: NostrEvent): stringprivate
eventToPost(event: NostrEvent): NostrPostprivate
getFollowerInfo(publicKey: string)private
getFollowingInfo(publicKey: string)private
getKeyFromNip19(key: string)private
getProfile(publicKey: string): Promise<ProfileInfo>private
hexChar(val: number)private
hexEncode(buf: any)private
sendPost(content: string,
rootReference?: string,
reference?: string,
mention?: string,
private
signId(id: string)private
utf8Encode(txt: string)connect()
filter(filters: NostrFilters, unique?)
Usage example: for await (const event of nostr.filter({ kinds: [NostrKind.META_DATA], authors: [publicKey], limit: 1 })) { console.log(event) }
getMessages(): Promise<NostrMessage[]>
getMyProfile(): Promise<ProfileInfo>
getNip19FromKey(key: string)
getOtherProfile(publicKey: string): Promise<ProfileInfo>
getPosts()
getProfileEvents(filters: NostrFilters)
globalFeed(unnamed 0: { limit?: number; since?: number; authors?: Array<string>; }): Promise<Array<NostrPost>>
isValidEvent(event: NostrEvent): Promise<boolean>
log(...args: any)
sendMessage(to: string, message: any)
sendReplyPost(content: string, post: NostrPost)
sendTextPost(content: string)