Merge pull request #744 from viktorvsk/patch-1

Allow relays indicate whether probabilistic count was used in NIP-45
This commit is contained in:
Jon Staab 2023-08-28 09:43:41 -07:00 committed by GitHub
commit 415e261ec0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

5
45.md
View File

@ -21,6 +21,7 @@ This NIP defines the verb `COUNT`, which accepts a subscription id and filters a
```
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>}`.
```
["COUNT", <subscription_id>, {"count": <integer>}]
@ -36,4 +37,8 @@ Examples:
# Count posts and reactions
["COUNT", <subscription_id>, {"kinds": [1, 7], "authors": [<pubkey>]}]
["COUNT", <subscription_id>, {"count": 5}]
# Count posts approximately
["COUNT", <subscription_id>, {"kinds": [1]}]
["COUNT", <subscription_id>, {"count": 93412452, "approximate": true}]
```