aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/nostr.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/nostr.ts')
-rw-r--r--src/lib/nostr.ts11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/lib/nostr.ts b/src/lib/nostr.ts
index a22882bc..beebba02 100644
--- a/src/lib/nostr.ts
+++ b/src/lib/nostr.ts
@@ -210,3 +210,14 @@ const signingMethods = {
return signedEvent;
},
};
+
+// Returns all the keys mentioned in the provided event's 'p' tags.
+export const pTagKeys = (event: object): string[] => {
+ let keys = [];
+ for (const tag of event.tags) {
+ if (tag[0] === "p") {
+ keys.push(tag[1]);
+ }
+ }
+ return keys;
+}