diff --git a/45.md b/45.md index 219368e4..8758c873 100644 --- a/45.md +++ b/45.md @@ -14,17 +14,17 @@ Some queries a client may want to execute against connected relays are prohibiti ## Filters and return values -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. +This NIP defines the verb `COUNT`, which accepts a query 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. ``` -["COUNT", , ...] +["COUNT", , ...] ``` Counts are returned using a `COUNT` response in the form `{"count": }`. 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": , "approximate": }`. ``` -["COUNT", , {"count": }] +["COUNT", , {"count": }] ``` Whenever the relay decides to refuse to fulfill the `COUNT` request, it MUST return a `CLOSED` message. @@ -34,27 +34,27 @@ Whenever the relay decides to refuse to fulfill the `COUNT` request, it MUST ret ### Followers count ``` -["COUNT", , {"kinds": [3], "#p": []}] -["COUNT", , {"count": 238}] +["COUNT", , {"kinds": [3], "#p": []}] +["COUNT", , {"count": 238}] ``` ### Count posts and reactions ``` -["COUNT", , {"kinds": [1, 7], "authors": []}] -["COUNT", , {"count": 5}] +["COUNT", , {"kinds": [1, 7], "authors": []}] +["COUNT", , {"count": 5}] ``` ### Count posts approximately ``` -["COUNT", , {"kinds": [1]}] -["COUNT", , {"count": 93412452, "approximate": true}] +["COUNT", , {"kinds": [1]}] +["COUNT", , {"count": 93412452, "approximate": true}] ``` ### Relay refuses to count ``` -["COUNT", , {"kinds": [4], "authors": [], "#p": []}] -["CLOSED", , "auth-required: cannot count other people's DMs"] +["COUNT", , {"kinds": [1059], "#p": []}] +["CLOSED", , "auth-required: cannot count other people's DMs"] ```