1use super::Query;
2use crate::error::Result;
3use crate::request::{ApiClient, ApiResponse, CryptoType};
6use serde_json::json;
7
8impl ApiClient {
9 pub async fn batch(&self, query: &Query) -> Result<ApiResponse> {
12 let mut data = json!({});
13 let map = data.as_object_mut().unwrap();
14 for (key, value) in &query.params {
15 if key.starts_with("/api/") {
16 map.insert(
17 key.to_string(),
18 serde_json::Value::String(value.to_string()),
19 );
20 }
21 }
22 self.request("/api/batch", data, query.to_option(CryptoType::default()))
23 .await
24 }
25}