feat: NIP-24

This commit is contained in:
2023-08-17 19:54:14 +01:00
parent 8500dee24f
commit f6a46e3523
51 changed files with 792 additions and 319 deletions

View File

@ -2,7 +2,7 @@ import Dexie, { Table } from "dexie";
import { HexKey, NostrEvent, u256 } from "@snort/system";
export const NAME = "snortDB";
export const VERSION = 11;
export const VERSION = 12;
export interface SubCache {
id: string;
@ -27,10 +27,19 @@ export interface Payment {
macaroon: string;
}
export interface UnwrappedGift {
id: string;
to: string;
created_at: number;
inner: NostrEvent;
tags?: Array<Array<string>>; // some tags extracted
}
const STORES = {
chats: "++id",
eventInteraction: "++id",
payments: "++url",
gifts: "++id",
};
export class SnortDB extends Dexie {
@ -38,6 +47,7 @@ export class SnortDB extends Dexie {
chats!: Table<NostrEvent>;
eventInteraction!: Table<EventInteraction>;
payments!: Table<Payment>;
gifts!: Table<UnwrappedGift>;
constructor() {
super(NAME);