feat: add nip-25 support#589
Conversation
🦋 Changeset detectedLatest commit: f476e60 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
|
@copilot can you add changeset and upadte readme with nip 25 and also add 25 to package.json |
There was a problem hiding this comment.
Pull request overview
Adds relay-side support for NIP-25 reactions by introducing reaction kinds/tags, validation rules, and helper utilities, along with unit + integration coverage.
Changes:
- Added NIP-25 constants/types (
EXTERNAL_CONTENT_REACTION, reaction-relatedEventTags,ReactionEntry). - Implemented
src/utils/nip25.tshelpers for identifying/parsing reaction events. - Extended
eventSchemawith NIP-25-specific validation and added unit/integration tests for reaction flows.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
src/constants/base.ts |
Adds kind 17 and reaction-related tag constants. |
src/@types/event.ts |
Introduces ReactionEntry for parsed reaction targets. |
src/utils/nip25.ts |
Implements NIP-25 reaction detection/parsing helpers. |
src/schemas/event-schema.ts |
Adds schema refinement enforcing reaction tag requirements. |
src/factories/event-strategy-factory.ts |
Wires reaction kinds into strategy routing (currently default). |
test/unit/utils/nip25.spec.ts |
Unit tests for NIP-25 utility helpers. |
test/unit/schemas/event-schema.spec.ts |
Unit tests for new NIP-25 schema constraints. |
test/unit/factories/event-strategy-factory.spec.ts |
Tests factory routing for reaction kinds. |
test/integration/features/nip-25/nip-25.feature |
Cucumber feature scenarios for like/dislike/emoji reactions. |
test/integration/features/nip-25/nip-25.feature.ts |
Step definitions implementing the NIP-25 feature scenarios. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
The commit merge: integrate NIP-65 relay list metadata from main was failing the commitlint check because merge isn't a valid conventional commit type. I amended the message to chore: and force pushed to fix the CI check. No code changes were made to that commit, only the message. |
|
@cameri This PR is up for review |
|
Will resolve these by EOD tmrw |
|
@cameri up for review |
Description
Implements NIP-25 (Reactions) support for kind 7 (nostr event reactions) and kind 17 (external content reactions).
EXTERNAL_CONTENT_REACTION = 17toEventKindsand new tags (Address,Index,Emoji) toEventTagsReactionEntrytype to@types/eventsrc/utils/nip25.tswithisReactionEvent,isExternalContentReactionEvent,isLikeReaction,isDislikeReaction, andparseReactionhelpersetag; kind 17 must includekanditagsevent-strategy-factoryRelated Issue
Closes #578
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?
isReactionEvent,isLikeReaction,isDislikeReaction,parseReaction,etc.)
Screenshots (if appropriate):
N/A
Types of changes
Checklist