mirror of
https://github.com/edufeed-org/nips.git
synced 2025-12-10 00:34:32 +00:00
reformat a bunch of json things and small nitpicks.
This commit is contained in:
parent
b0df71824f
commit
5dcfe85306
21 changed files with 385 additions and 365 deletions
21
45.md
21
45.md
|
|
@ -16,29 +16,36 @@ Some queries a client may want to execute against connected relays are prohibiti
|
|||
|
||||
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.
|
||||
|
||||
```
|
||||
```json
|
||||
["COUNT", <subscription_id>, <filters JSON>...]
|
||||
```
|
||||
|
||||
Counts are returned using a `COUNT` response in the form `{"count": <integer>}`. Relays may use probabilistic counts to reduce compute requirements.
|
||||
In case a relay uses probabilistic counts, it MAY indicate it in the response with `approximate` key i.e. `{"count": <integer>, "approximate": <true|false>}`.
|
||||
|
||||
```
|
||||
```json
|
||||
["COUNT", <subscription_id>, {"count": <integer>}]
|
||||
```
|
||||
|
||||
Examples:
|
||||
## Examples:
|
||||
|
||||
```
|
||||
# Followers count
|
||||
### Followers count
|
||||
|
||||
```json
|
||||
["COUNT", <subscription_id>, {"kinds": [3], "#p": [<pubkey>]}]
|
||||
["COUNT", <subscription_id>, {"count": 238}]
|
||||
```
|
||||
|
||||
# Count posts and reactions
|
||||
### Count posts and reactions
|
||||
|
||||
```json
|
||||
["COUNT", <subscription_id>, {"kinds": [1, 7], "authors": [<pubkey>]}]
|
||||
["COUNT", <subscription_id>, {"count": 5}]
|
||||
```
|
||||
|
||||
# Count posts approximately
|
||||
### Count posts approximately
|
||||
|
||||
```
|
||||
["COUNT", <subscription_id>, {"kinds": [1]}]
|
||||
["COUNT", <subscription_id>, {"count": 93412452, "approximate": true}]
|
||||
```
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue