Skip to content

feat: add NIP-25 reactions support#588

Closed
CKodidela wants to merge 4 commits intocameri:mainfrom
CKodidela:feat/nip25
Closed

feat: add NIP-25 reactions support#588
CKodidela wants to merge 4 commits intocameri:mainfrom
CKodidela:feat/nip25

Conversation

@CKodidela
Copy link
Copy Markdown
Collaborator

Description

Implements NIP-25 (Reactions) support for kind 7 (nostr event reactions) and kind 17 (external content reactions).

  • Added EXTERNAL_CONTENT_REACTION = 17 to EventKinds and new tags (Address, Index, Emoji) to EventTags
  • Added ReactionEntry type to @types/event
  • Created src/utils/nip25.ts with isReactionEvent, isExternalContentReactionEvent, isLikeReaction,
    isDislikeReaction, and parseReaction helpers
  • Schema validation: kind 7 must include at least one e tag; kind 17 must include k and i tags
  • Wired reaction event types into event-strategy-factory

Related Issue

N/A

Motivation and Context

NIP-25 defines how clients express reactions (likes, dislikes, emoji) to notes and external content. This adds
relay-side support for storing, validating, and querying reaction events.

How Has This Been Tested?

  • Unit tests for all utility functions (isReactionEvent, isLikeReaction, isDislikeReaction, parseReaction,
    etc.)
  • Unit tests for schema validation (valid/invalid kind 7 and kind 17 events)
  • Unit tests for event strategy factory routing
  • Integration tests covering like, dislike, and emoji reaction scenarios
  • All existing tests continue to pass

Screenshots (if appropriate):

N/A

Types of changes

  • Non-functional change (docs, style, minor refactor)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my code changes.
  • I added a changeset, or this is docs-only and I added an empty changeset.
  • All new and existing tests passed.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 28, 2026

🦋 Changeset detected

Latest commit: 2ca0afc

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
nostream Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coveralls
Copy link
Copy Markdown
Collaborator

Coverage Status

coverage: 64.306% (+0.3%) from 64.015% — CKodidela:feat/nip25 into cameri:main

@CKodidela CKodidela closed this Apr 28, 2026
@CKodidela CKodidela deleted the feat/nip25 branch April 28, 2026 01:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants