MCPcopy Create free account
hub / github.com/block/buzz / query_multi

Method query_multi

crates/buzz-cli/src/client.rs:213–226  ·  view source on GitHub ↗

Execute a one-shot query with multiple filters via the HTTP bridge. Each filter is ORed by the relay (standard Nostr REQ behavior).

(&self, filters: &[serde_json::Value])

Source from the content-addressed store, hash-verified

211 /// Execute a one-shot query with multiple filters via the HTTP bridge.
212 /// Each filter is ORed by the relay (standard Nostr REQ behavior).
213 pub async fn query_multi(&self, filters: &[serde_json::Value]) -> Result<String, CliError> {
214 let url = format!("{}/query", self.relay_url);
215 let body_bytes = serde_json::to_vec(filters)
216 .map_err(|e| CliError::Other(format!("filter serialization failed: {e}")))?;
217 let auth = sign_nip98(&self.keys, "POST", &url, Some(&body_bytes))?;
218 let req = self
219 .http
220 .post(&url)
221 .header("Authorization", &auth)
222 .header("Content-Type", "application/json")
223 .body(body_bytes);
224 let resp = self.with_auth_tag(req).send().await?;
225 self.handle_response(resp).await
226 }
227
228 /// Execute a one-shot count via the HTTP bridge.
229 /// Returns the count as a JSON string.

Callers 2

queryMethod · 0.80
cmd_get_threadFunction · 0.80

Calls 4

sign_nip98Function · 0.85
with_auth_tagMethod · 0.80
handle_responseMethod · 0.80
sendMethod · 0.45

Tested by

no test coverage detected