Add hints to nip 25 (#1702)

Co-authored-by: Jon Staab <shtaab@gmail.com>
This commit is contained in:
hodlbod
2025-05-21 16:06:08 -07:00
committed by GitHub
parent 0c993526f0
commit 509613b9fa

11
25.md
View File

@@ -33,12 +33,17 @@ If the event being reacted to is an addressable event, an `a` SHOULD be included
The reaction SHOULD include a `k` tag with the stringified kind number of the reacted event as its value.
The `e` and `a` tags SHOULD include relay and pubkey hints. The `p` tags SHOULD include relay hints.
The reaction event MAY include a `k` tag with the stringified kind number of the reacted event as its value.
**Example code**
```swift
func make_like_event(pubkey: String, privkey: String, liked: NostrEvent) -> NostrEvent {
tags.append(["e", liked.id, liked.source_relays.first ?? ""])
tags.append(["p", liked.pubkey])
func make_like_event(pubkey: String, privkey: String, liked: NostrEvent, hint: String) -> NostrEvent {
var tags: [[String]] = []
tags.append(["e", liked.id, hint, liked.pubkey])
tags.append(["p", liked.pubkey, hint])
tags.append(["k", String(liked.kind)])
let ev = NostrEvent(content: "+", pubkey: pubkey, kind: 7, tags: tags)
ev.calculate_id()