feat: fast zaps

This commit is contained in:
2023-02-25 21:18:36 +00:00
parent f934dcd092
commit 8c286c04f3
14 changed files with 355 additions and 138 deletions

View File

@ -191,7 +191,7 @@ export default function useEventPublisher() {
return await signEvent(ev);
}
},
zap: async (author: HexKey, note?: HexKey, msg?: string) => {
zap: async (amount: number, author: HexKey, note?: HexKey, msg?: string) => {
if (pubKey) {
const ev = NEvent.ForPubKey(pubKey);
ev.Kind = EventKind.ZapRequest;
@ -201,6 +201,7 @@ export default function useEventPublisher() {
ev.Tags.push(new Tag(["p", author], ev.Tags.length));
const relayTag = ["relays", ...Object.keys(relays)];
ev.Tags.push(new Tag(relayTag, ev.Tags.length));
ev.Tags.push(new Tag(["amount", amount.toString()], ev.Tags.length));
processContent(ev, msg || "");
return await signEvent(ev);
}