feat: appdata

This commit is contained in:
2023-11-13 16:51:29 +00:00
parent 540f29dd69
commit 24978f4e62
29 changed files with 181 additions and 136 deletions

View File

@ -330,6 +330,13 @@ export class EventPublisher {
return await this.#sign(eb);
}
async appData(data: object, id: string) {
const eb = this.#eb(EventKind.AppData);
eb.content(await this.nip4Encrypt(JSON.stringify(data), this.#pubKey));
eb.tag(["d", id]);
return await this.#sign(eb);
}
/**
* NIP-59 Gift Wrap event with ephemeral key
*/