feat: add NIP-65 (Relay List Metadata) support#585
feat: add NIP-65 (Relay List Metadata) support#585CKodidela wants to merge 2 commits intocameri:mainfrom
Conversation
🦋 Changeset detectedLatest commit: 48676cb 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 |
There was a problem hiding this comment.
Pull request overview
Adds NIP-65 (Relay List Metadata) support by recognizing kind 10002 (relay_list) as a first-class event kind, advertising it via the NIP-11 relay info document, and providing utilities + tests for parsing NIP-65 relay tags.
Changes:
- Add
EventKinds.RELAY_LIST = 10002and advertise NIP-65 support in the relay’ssupported_nips. - Introduce
src/utils/nip65.tsutilities (isRelayListEvent,parseRelayList) to parsertags with optionalread/writemarkers. - Add unit + Cucumber integration coverage validating replaceable semantics and tag parsing/roundtrip behavior.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
src/constants/base.ts |
Introduces EventKinds.RELAY_LIST constant for kind 10002. |
src/utils/nip65.ts |
Adds NIP-65 helpers to detect/parse relay list events (r tags + markers). |
package.json |
Adds NIP-65 (65) to supportedNips (used for NIP-11 relay info + logging). |
README.md |
Updates supported NIPs list to include NIP-65. |
.changeset/nip-65-relay-list-metadata.md |
Changeset documenting the new NIP-65 feature. |
test/unit/factories/event-strategy-factory.spec.ts |
Ensures relay_list events are treated as replaceable by the strategy factory. |
test/unit/utils/nip65.spec.ts |
Unit tests for isRelayListEvent and parseRelayList. |
test/integration/features/nip-65/nip-65.feature |
BDD scenarios for publishing/updating/querying relay lists, including read/write markers. |
test/integration/features/nip-65/nip-65.feature.ts |
Step definitions implementing the NIP-65 BDD scenarios. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@cameri |
Description
Added support for NIP-65 (Relay List Metadata). This includes adding event kind
10002as aReplaceableEventStrategy, and implementing utility functionsisRelayListEventandparseRelayListto parsertags correctly withreadandwritemarkers.Related Issue
Closes #577
Motivation and Context
To support the NIP-65 standard which allows users to advertise their preferred read and write relays, improving interoperability across different clients.
How Has This Been Tested?
I added both unit and integration tests to ensure the feature functions correctly:
10002is properly treated as a replaceable event. Added tests forisRelayListEventandparseRelayListto verify correct parsing of tags and markers.nip65.feature) verifying the creation, sending, subscribing to, and receiving ofrelay_listevents.Screenshots (if appropriate):
Types of changes
Checklist: