Add some utils, kinds

This commit is contained in:
Jon Staab
2024-08-06 15:55:05 -07:00
parent 3404a471bb
commit 28daebabee
4 changed files with 104 additions and 4 deletions
+2
View File
@@ -98,6 +98,8 @@ export const hasValidSignature = cached<string, boolean, [SignedEvent]>({
},
})
export const getIdentifier = (e: EventTemplate) => e.tags.find(t => t[0] === 'd')?.[1]
export const getIdOrAddress = (e: HashedEvent) => isReplaceable(e) ? getAddress(e) : e.id
export const getIdAndAddress = (e: HashedEvent) => isReplaceable(e) ? [e.id, getAddress(e)] : [e.id]