upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSemisol <45574030+Semisol@users.noreply.github.com>2024-04-14 07:32:41 +0300
committerGitHub <noreply@github.com>2024-04-14 07:32:41 +0300
commit46f8133cd44bec99cd4611b8f52e54c46ade3648 (patch)
treec775dd5c6c82a348b005b589018fa95ab1bab481
parentb765b3c0301958d46115b834872bbd0c8bac588c (diff)
EOSE extensions draft
-rw-r--r--91.md53
1 files changed, 53 insertions, 0 deletions
diff --git a/91.md b/91.md
new file mode 100644
index 0000000..76e8123
--- /dev/null
+++ b/91.md
@@ -0,0 +1,53 @@
1NIP-91
2======
3
4EOSE Extensions
5---------------
6
7`draft` `optional`
8
9This NIP defines an extension to the EOSE message that allows relays to convey additional information to clients.
10
11## Extended EOSE
12
13An extended EOSE is an EOSE message, with the 2nd parameter being the "extensions object". For example: `["EOSE","example-sub",{"example_ext":"example value"}]`
14
15An EOSE extension is a field in the extensions object. This may contain any value.
16
17Experimental extensions SHOULD use the `x_` prefix for the object key.
18
19Clients MUST NOT rely on relays implementing any extensions.
20
21## Extensions
22
23This NIP defines a set of standard extensions.
24
25### `next_created_at`
26`recommended`
27
28The value of this extension MUST be an integer if present, and should specify the next `until` value the client should use for pagination.
29This MAY be higher or lower than the lowest `created_at`, and the clients SHOULD NOT perform any modifications to this value.
30
31### `cursor`
32
33The value of this extension MUST be a string if present, and represents a cursor the client can use to paginate this query.
34To get more events, the client MUST send a `REQ` with the same filters (except limit, which can be changed), and the `cursor` string
35in the 1st filter with the key `cursor`. Example:
36```jsonc
37< ["REQ", "examplereq1", {"kinds": [1], "limit": 1}, {"authors": ["..."], "limit": 1}]
38> ["EVENT", "examplereq1", ...]
39> ["EOSE", "examplereq1", {"cursor": "example-cursor-string", ...}]
40< ["CLOSE", "examplereq1"]
41< ["REQ", "examplereq2", {"kinds": [1], "limit": 5, "cursor": "example-cursor-string"}, {"authors": ["..."], "limit": 5}]
42> ["EVENT", "examplereq2", ...]
43...
44```
45
46This cursor MUST be valid for the duration of the connection, and MAY be valid in a new connection. A relay may indicate a cursor is no longer valid
47by sending a CLOSED with the prefix `bad-cursor: `.
48
49### `has_more`
50`recommended`
51
52The value of this extension MUST be a boolean if present, and should represent if the client should continue trying to get events.
53This MAY be false if the relay has completed the query due to not having more events available, or may not be able to complete this query due to a permanent failure (scan limit exceeded is one).