diff options
| author | Francisco Calderón <fjcalderon@gmail.com> | 2024-11-04 15:39:21 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-11-04 15:39:21 -0300 |
| commit | 03f3bc39678262ecbd5d870c9da44723023557ff (patch) | |
| tree | e75ecf32d3bc906a8b26314488a1ae90996169c1 /45.md | |
| parent | f72a2f69ed93cf442e83bf9e7e16f6c06da40384 (diff) | |
| parent | 6bcd89c097e97e65dbc95e7c6b7b8348e8dd6b5c (diff) | |
Merge branch 'master' into p2p-nip
Diffstat (limited to '45.md')
| -rw-r--r-- | 45.md | 10 |
1 files changed, 5 insertions, 5 deletions
| @@ -2,7 +2,7 @@ NIP-45 | |||
| 2 | ====== | 2 | ====== |
| 3 | 3 | ||
| 4 | Event Counts | 4 | Event Counts |
| 5 | -------------- | 5 | ------------ |
| 6 | 6 | ||
| 7 | `draft` `optional` | 7 | `draft` `optional` |
| 8 | 8 | ||
| @@ -16,14 +16,14 @@ Some queries a client may want to execute against connected relays are prohibiti | |||
| 16 | 16 | ||
| 17 | This NIP defines the verb `COUNT`, which accepts a subscription id and filters as specified in [NIP 01](01.md) for the verb `REQ`. Multiple filters are OR'd together and aggregated into a single count result. | 17 | This NIP defines the verb `COUNT`, which accepts a subscription id and filters as specified in [NIP 01](01.md) for the verb `REQ`. Multiple filters are OR'd together and aggregated into a single count result. |
| 18 | 18 | ||
| 19 | ```json | 19 | ``` |
| 20 | ["COUNT", <subscription_id>, <filters JSON>...] | 20 | ["COUNT", <subscription_id>, <filters JSON>...] |
| 21 | ``` | 21 | ``` |
| 22 | 22 | ||
| 23 | Counts are returned using a `COUNT` response in the form `{"count": <integer>}`. Relays may use probabilistic counts to reduce compute requirements. | 23 | Counts are returned using a `COUNT` response in the form `{"count": <integer>}`. Relays may use probabilistic counts to reduce compute requirements. |
| 24 | In case a relay uses probabilistic counts, it MAY indicate it in the response with `approximate` key i.e. `{"count": <integer>, "approximate": <true|false>}`. | 24 | In case a relay uses probabilistic counts, it MAY indicate it in the response with `approximate` key i.e. `{"count": <integer>, "approximate": <true|false>}`. |
| 25 | 25 | ||
| 26 | ```json | 26 | ``` |
| 27 | ["COUNT", <subscription_id>, {"count": <integer>}] | 27 | ["COUNT", <subscription_id>, {"count": <integer>}] |
| 28 | ``` | 28 | ``` |
| 29 | 29 | ||
| @@ -33,14 +33,14 @@ Whenever the relay decides to refuse to fulfill the `COUNT` request, it MUST ret | |||
| 33 | 33 | ||
| 34 | ### Followers count | 34 | ### Followers count |
| 35 | 35 | ||
| 36 | ```json | 36 | ``` |
| 37 | ["COUNT", <subscription_id>, {"kinds": [3], "#p": [<pubkey>]}] | 37 | ["COUNT", <subscription_id>, {"kinds": [3], "#p": [<pubkey>]}] |
| 38 | ["COUNT", <subscription_id>, {"count": 238}] | 38 | ["COUNT", <subscription_id>, {"count": 238}] |
| 39 | ``` | 39 | ``` |
| 40 | 40 | ||
| 41 | ### Count posts and reactions | 41 | ### Count posts and reactions |
| 42 | 42 | ||
| 43 | ```json | 43 | ``` |
| 44 | ["COUNT", <subscription_id>, {"kinds": [1, 7], "authors": [<pubkey>]}] | 44 | ["COUNT", <subscription_id>, {"kinds": [1, 7], "authors": [<pubkey>]}] |
| 45 | ["COUNT", <subscription_id>, {"count": 5}] | 45 | ["COUNT", <subscription_id>, {"count": 5}] |
| 46 | ``` | 46 | ``` |