mirror of
https://github.com/edufeed-org/nips.git
synced 2025-12-07 23:34:32 +00:00
Add hints to nip 25 (#1702)
Co-authored-by: Jon Staab <shtaab@gmail.com>
This commit is contained in:
parent
0c993526f0
commit
509613b9fa
1 changed files with 8 additions and 3 deletions
11
25.md
11
25.md
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue