upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/25.md
diff options
context:
space:
mode:
authorhodlbod <jstaab@protonmail.com>2025-05-21 16:06:08 -0700
committerGitHub <noreply@github.com>2025-05-21 16:06:08 -0700
commit509613b9fa612f662d9339d66dc0918733321529 (patch)
tree083201580d3b780ba1b891827c160e15497047b3 /25.md
parent0c993526f0c662af44fdf562dfc74f32521df9bb (diff)
Add hints to nip 25 (#1702)
Co-authored-by: Jon Staab <shtaab@gmail.com>
Diffstat (limited to '25.md')
-rw-r--r--25.md11
1 files changed, 8 insertions, 3 deletions
diff --git a/25.md b/25.md
index 72109c0..9ec1551 100644
--- a/25.md
+++ b/25.md
@@ -33,12 +33,17 @@ If the event being reacted to is an addressable event, an `a` SHOULD be included
33 33
34The reaction SHOULD include a `k` tag with the stringified kind number of the reacted event as its value. 34The reaction SHOULD include a `k` tag with the stringified kind number of the reacted event as its value.
35 35
36The `e` and `a` tags SHOULD include relay and pubkey hints. The `p` tags SHOULD include relay hints.
37
38The reaction event MAY include a `k` tag with the stringified kind number of the reacted event as its value.
39
36**Example code** 40**Example code**
37 41
38```swift 42```swift
39func make_like_event(pubkey: String, privkey: String, liked: NostrEvent) -> NostrEvent { 43func make_like_event(pubkey: String, privkey: String, liked: NostrEvent, hint: String) -> NostrEvent {
40 tags.append(["e", liked.id, liked.source_relays.first ?? ""]) 44 var tags: [[String]] = []
41 tags.append(["p", liked.pubkey]) 45 tags.append(["e", liked.id, hint, liked.pubkey])
46 tags.append(["p", liked.pubkey, hint])
42 tags.append(["k", String(liked.kind)]) 47 tags.append(["k", String(liked.kind)])
43 let ev = NostrEvent(content: "+", pubkey: pubkey, kind: 7, tags: tags) 48 let ev = NostrEvent(content: "+", pubkey: pubkey, kind: 7, tags: tags)
44 ev.calculate_id() 49 ev.calculate_id()