UNPKG

nostr-tribes

Version:

Client library for using nostr tribes

43 lines (42 loc) 1.29 kB
import { Event } from 'nostr-tools/core'; import { SimplePool } from 'nostr-tools'; import type { WindowNostr } from 'nostr-tools/nip07'; declare global { interface Window { nostr?: WindowNostr; } } export type StampType = 'curate' | 'ban' | 'neutral'; export type Judgement = { [key: string]: [StampType, string, Event | undefined]; }; type Options = { timeout?: number; }; export declare class Tribe { leader: string; pool: SimplePool; context: string; relays: string[]; cache: any; synced?: Promise<void>; timeout: number; constructor(leader: string, context: string, relays: string[], opts?: Options); sync(opts?: { force?: boolean; }): Promise<void>; _sync(opts?: { force?: boolean; }): Promise<void>; sync_profiles(): Promise<void>; heal_profiles(): Promise<void>; member(pubkey: string): boolean; level(pubkey: string): number; name(pubkey: string): string; children(pubkey: string): string[]; bannedby(pubkey: string): string[]; judgeEvents(events: Event[]): Promise<Judgement>; stamp_pubkey(pubkey: string, mode?: "ban" | "neutral" | "curate"): Promise<void>; stamp_event(event: Event, mode?: "ban" | "neutral" | "curate"): Promise<void>; } export {};