use @snort/system cache
This commit is contained in:
@ -1,8 +1,8 @@
|
||||
import Dexie, { Table } from "dexie";
|
||||
import { FullRelaySettings, HexKey, NostrEvent, u256, MetadataCache } from "@snort/system";
|
||||
import { HexKey, NostrEvent, u256 } from "@snort/system";
|
||||
|
||||
export const NAME = "snortDB";
|
||||
export const VERSION = 9;
|
||||
export const VERSION = 10;
|
||||
|
||||
export interface SubCache {
|
||||
id: string;
|
||||
@ -11,19 +11,6 @@ export interface SubCache {
|
||||
since?: number;
|
||||
}
|
||||
|
||||
export interface RelayMetrics {
|
||||
addr: string;
|
||||
events: number;
|
||||
disconnects: number;
|
||||
latency: number[];
|
||||
}
|
||||
|
||||
export interface UsersRelays {
|
||||
pubkey: HexKey;
|
||||
created_at: number;
|
||||
relays: FullRelaySettings[];
|
||||
}
|
||||
|
||||
export interface EventInteraction {
|
||||
id: u256;
|
||||
event: u256;
|
||||
@ -41,10 +28,6 @@ export interface Payment {
|
||||
}
|
||||
|
||||
const STORES = {
|
||||
users: "++pubkey, name, display_name, picture, nip05, npub",
|
||||
relays: "++addr",
|
||||
userRelays: "++pubkey",
|
||||
events: "++id, pubkey, created_at",
|
||||
dms: "++id, pubkey",
|
||||
eventInteraction: "++id",
|
||||
payments: "++url",
|
||||
@ -52,10 +35,6 @@ const STORES = {
|
||||
|
||||
export class SnortDB extends Dexie {
|
||||
ready = false;
|
||||
users!: Table<MetadataCache>;
|
||||
relayMetrics!: Table<RelayMetrics>;
|
||||
userRelays!: Table<UsersRelays>;
|
||||
events!: Table<NostrEvent>;
|
||||
dms!: Table<NostrEvent>;
|
||||
eventInteraction!: Table<EventInteraction>;
|
||||
payments!: Table<Payment>;
|
||||
|
Reference in New Issue
Block a user