From c1a56c3fd9554d6ba424b99feb19371546051f80 Mon Sep 17 00:00:00 2001 From: Adam Date: Sat, 22 Aug 2026 03:40:36 +0800 Subject: [PATCH] docs(bridge): document query filter array body Signed-off-by: Adam --- docs/bridge-channel-window.md | 26 +++++++++++++++----------- docs/nips/NIP-CW.md | 24 +++++++++++++----------- 2 files changed, 28 insertions(+), 22 deletions(-) diff --git a/docs/bridge-channel-window.md b/docs/bridge-channel-window.md index 42f1d82835e..9d683e6e97c 100644 --- a/docs/bridge-channel-window.md +++ b/docs/bridge-channel-window.md @@ -27,19 +27,23 @@ full-event query; they never see a wrong-but-plausible timeline. ## Request -A standard bridge filter plus extension fields: +A standard bridge filter plus extension fields. The HTTP bridge accepts a JSON +**array of filters**, so send the following complete request body to `POST +/query` (not the inner filter object by itself): ```json -{ - "kinds": [9], - "#h": [""], - "limit": 50, - "top_level": true, - "include_summaries": true, - "include_aux": true, - "until": 1751500000, - "before_id": "<64-hex event id>" -} +[ + { + "kinds": [9], + "#h": [""], + "limit": 50, + "top_level": true, + "include_summaries": true, + "include_aux": true, + "until": 1751500000, + "before_id": "<64-hex event id>" + } +] ``` - `top_level: true` — routes this filter to the top-level SQL view. diff --git a/docs/nips/NIP-CW.md b/docs/nips/NIP-CW.md index f21b63405b2..8a83a57a8fe 100644 --- a/docs/nips/NIP-CW.md +++ b/docs/nips/NIP-CW.md @@ -47,19 +47,21 @@ This document uses MUST, MUST NOT, SHOULD, MAY, and RECOMMENDED as defined in RF ## Request -A window request is a standard filter plus extension fields, submitted wherever the relay accepts filters (for Buzz: the NIP-98-authenticated HTTP bridge `POST /query`): +A window request is a standard filter plus extension fields, submitted wherever the relay accepts filters (for Buzz: the NIP-98-authenticated HTTP bridge `POST /query`). The request body is a JSON **array of filters**, as on a NIP-01 filter surface; the window filter below is one element of that array: ```jsonc -{ - "kinds": [9], // optional row-kind restriction - "#h": [""], // REQUIRED: exactly one channel - "limit": 50, // row budget (rows only, never overlays) - "top_level": true, // selects the window path - "include_summaries": true, // optional: kind:39005 overlays - "include_aux": true, // optional: aux closure - "until": 1751500000, // ┐ composite request cursor — - "before_id": "<64-hex id>" // ┘ both or neither -} +[ + { + "kinds": [9], // optional row-kind restriction + "#h": [""], // REQUIRED: exactly one channel + "limit": 50, // row budget (rows only, never overlays) + "top_level": true, // selects the window path + "include_summaries": true, // optional: kind:39005 overlays + "include_aux": true, // optional: aux closure + "until": 1751500000, // ┐ composite request cursor — + "before_id": "<64-hex id>" // ┘ both or neither + } +] ``` - `top_level` — MUST be boolean `true` to select the window path. Any other value (absent, `false`, string, number) means the filter is served as a normal filter.