-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.ts
47 lines (42 loc) · 1.05 KB
/
types.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import type { nostr } from "./deps.ts";
export interface Repository {
init(): Promise<void>;
save(e: nostr.Event): Promise<void>;
query(filters: nostr.Filter): Promise<nostr.Event[]>;
count(filters: nostr.Filter): Promise<number>;
processPayment(e: nostr.Event): Promise<void>;
status(): Promise<Record<string, number>>;
pubkeyInfo(pubkey: string): Promise<User>;
}
export type Nip11 = {
name: string;
description: string;
pubkey: string;
contact: string;
supported_nips: number[];
software: string;
version: string;
} & Record<string, unknown>;
export type Limits = {
maxMessageLength: number;
maxSubscriptions: number;
maxFilters: number;
maxLimit: number;
maxSubidLength: number;
minPrefix: number;
maxEventTags: number;
maxContentLength: number;
minPowDifficulty: number;
authRequired: boolean;
paymentRequired: boolean;
};
export type EventRetention = {
kinds?: (number | number[])[];
count?: number;
time?: number;
};
export type User = {
pubkey: string;
balance: bigint;
admitted_at: Date | null;
};