Add zap utils

This commit is contained in:
Jon Staab
2024-03-25 16:52:49 -07:00
parent eb9c778a66
commit 0b5a4e8511
13 changed files with 307 additions and 19 deletions
-3
View File
@@ -49,9 +49,6 @@ export const getIdentifier = (e: UnsignedEvent) => e.tags.find(t => t[0] === "d"
export const addressFromEvent = (e: UnsignedEvent, relays: string[] = []) =>
({kind: e.kind, pubkey: e.pubkey, identifier: getIdentifier(e), relays})
export const addressToFilter = (a: Address) =>
({kinds: [a.kind], authors: [a.pubkey], "#d": [a.identifier]})
// Utils
export const isGroupAddress = (a: Address) => a.kind === GROUP_DEFINITION