From 15458d8de5189ae91e8de4a80fd656b0c5305e74 Mon Sep 17 00:00:00 2001 From: Yonle Date: Mon, 8 Jan 2024 22:31:44 +0700 Subject: [PATCH] nip200: comply with nip45 too. Signed-off-by: Yonle --- 11.md | 1 + 200.md | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/11.md b/11.md index e55f6f8..d37be24 100644 --- a/11.md +++ b/11.md @@ -275,6 +275,7 @@ URL Paths to NoH endpoints. { "noh": { "req": "http://my-relay/__nostr/req", + "count": "http://my-relay/__nostr/count", "publish": "http://my-relay/__nostr/pub", "auth": "http://my-relay/__nostr/auth" }, diff --git a/200.md b/200.md index 7b7c22e..eebee2d 100644 --- a/200.md +++ b/200.md @@ -16,9 +16,10 @@ Relays must ensure that the NoH endpoints **MUST** be served with `Access-Contro ### From client to relay: getting events and sending event -Client could make a request to `req` or `publish` endpoint that were specified in `/.well-known/nostr.json` +Client could make a request to `req`, `count` or `publish` endpoint that were specified in `/.well-known/nostr.json` When fetching events, Client can optionally specify filters directly into the URI search query: +- `?`, or - `?` `` is a querystrings that determines what events will be received in that request. it can have the following attributes: @@ -36,6 +37,7 @@ limit= Request URL Examples: - `https://my-relay.com/__nostr/req?kinds=0,1&limit=10` - `https://my-relay.com/__nostr/req?authors=12345,67890` +- `https://my-relay.com/__nostr/count?count=100&authors=12345,kinds=0` To send event to relay, Client will need to make POST request to `publish` endpoint with POST body containing the JSON blob of the event. @@ -44,6 +46,7 @@ To send event to relay, Client will need to make POST request to `publish` endpo Every NoH response is a JSON body that contain the following JSON field: - `results`: Array of relay response. Usually contain events requested by client. +- `count`: Integer of event counts. - `notice`: Human readable error. Relay may also respond with HTTP status code: