diff options
| author | Adam Soltys <[email protected]> | 2026-01-28 22:51:34 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-01-28 22:51:34 -0800 |
| commit | 568a936e08586b7ac07b4c7adaf5bf9b8ef6ba2f (patch) | |
| tree | 56a45c92cd37c8ba1d1d794d300af0462c86dbf3 /src/lib/nostr.ts | |
| parent | 685d085596a1a20d2b5680cf8000313173bbe6fd (diff) | |
| parent | 838f74effb5b45e545bf68a4659e1e36c14da81f (diff) | |
| download | coinos-ui-nip17dm-fixes.tar.gz coinos-ui-nip17dm-fixes.zip | |
Merge remote-tracking branch 'origin/nip17dm'nip17dm-fixes
# Conflicts:
# .env.sample
Diffstat (limited to 'src/lib/nostr.ts')
| -rw-r--r-- | src/lib/nostr.ts | 11 |
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; +} |
