1use reqwest;
13use serde::{Deserialize, Serialize, de::Error as _};
14use crate::spot::{apis::ResponseContent, models};
15use super::{Error, configuration, ContentType};
16
17#[derive(Clone, Debug, Default)]
19pub struct CreateAccountDisableFastWithdrawSwitchV1Params {
20 pub timestamp: i64,
21 pub recv_window: Option<i64>
22}
23
24#[derive(Clone, Debug, Default)]
26pub struct CreateAccountEnableFastWithdrawSwitchV1Params {
27 pub timestamp: i64,
28 pub recv_window: Option<i64>
29}
30
31#[derive(Clone, Debug, Default)]
33pub struct CreateAssetDustBtcV1Params {
34 pub timestamp: i64,
35 pub account_type: Option<String>,
36 pub recv_window: Option<i64>
37}
38
39#[derive(Clone, Debug, Default)]
41pub struct CreateAssetDustV1Params {
42 pub asset: Vec<String>,
43 pub timestamp: i64,
44 pub account_type: Option<String>,
45 pub recv_window: Option<i64>
46}
47
48#[derive(Clone, Debug, Default)]
50pub struct CreateAssetGetFundingAssetV1Params {
51 pub timestamp: i64,
52 pub asset: Option<String>,
53 pub need_btc_valuation: Option<String>,
54 pub recv_window: Option<i64>
55}
56
57#[derive(Clone, Debug, Default)]
59pub struct CreateAssetGetUserAssetV3Params {
60 pub timestamp: i64,
61 pub asset: Option<String>,
62 pub need_btc_valuation: Option<bool>,
63 pub recv_window: Option<i64>
64}
65
66#[derive(Clone, Debug, Default)]
68pub struct CreateAssetTransferV1Params {
69 pub amount: String,
70 pub asset: String,
71 pub timestamp: i64,
72 pub r#type: String,
73 pub from_symbol: Option<String>,
74 pub recv_window: Option<i64>,
75 pub to_symbol: Option<String>
76}
77
78#[derive(Clone, Debug, Default)]
80pub struct CreateBnbBurnV1Params {
81 pub timestamp: i64,
82 pub interest_bnb_burn: Option<String>,
83 pub recv_window: Option<i64>,
84 pub spot_bnb_burn: Option<String>
85}
86
87#[derive(Clone, Debug, Default)]
89pub struct CreateCapitalDepositCreditApplyV1Params {
90 pub deposit_id: Option<i64>,
91 pub sub_account_id: Option<i64>,
92 pub sub_user_id: Option<i64>,
93 pub tx_id: Option<String>
94}
95
96#[derive(Clone, Debug, Default)]
98pub struct CreateCapitalWithdrawApplyV1Params {
99 pub address: String,
100 pub amount: String,
101 pub coin: String,
102 pub timestamp: i64,
103 pub address_tag: Option<String>,
104 pub name: Option<String>,
105 pub network: Option<String>,
106 pub recv_window: Option<i64>,
107 pub transaction_fee_flag: Option<bool>,
108 pub wallet_type: Option<i32>,
109 pub withdraw_order_id: Option<String>
110}
111
112#[derive(Clone, Debug, Default)]
114pub struct CreateLocalentityBrokerWithdrawApplyV1Params {
115 pub address: String,
116 pub amount: String,
117 pub coin: String,
118 pub originator_pii: String,
119 pub questionnaire: String,
120 pub signature: String,
121 pub sub_account_id: String,
122 pub timestamp: i64,
123 pub withdraw_order_id: String,
124 pub address_name: Option<String>,
125 pub address_tag: Option<String>,
126 pub network: Option<String>,
127 pub transaction_fee_flag: Option<bool>,
128 pub wallet_type: Option<i32>
129}
130
131#[derive(Clone, Debug, Default)]
133pub struct CreateLocalentityWithdrawApplyV1Params {
134 pub address: String,
135 pub amount: String,
136 pub coin: String,
137 pub questionnaire: String,
138 pub timestamp: i64,
139 pub address_tag: Option<String>,
140 pub name: Option<String>,
141 pub network: Option<String>,
142 pub recv_window: Option<i64>,
143 pub transaction_fee_flag: Option<bool>,
144 pub wallet_type: Option<i32>,
145 pub withdraw_order_id: Option<String>
146}
147
148#[derive(Clone, Debug, Default)]
150pub struct GetAccountApiRestrictionsV1Params {
151 pub timestamp: i64,
152 pub recv_window: Option<i64>
153}
154
155#[derive(Clone, Debug, Default)]
157pub struct GetAccountApiTradingStatusV1Params {
158 pub timestamp: i64,
159 pub recv_window: Option<i64>
160}
161
162#[derive(Clone, Debug, Default)]
164pub struct GetAccountInfoV1Params {
165 pub timestamp: i64,
166 pub recv_window: Option<i64>
167}
168
169#[derive(Clone, Debug, Default)]
171pub struct GetAccountSnapshotV1Params {
172 pub r#type: String,
174 pub timestamp: i64,
175 pub start_time: Option<i64>,
176 pub end_time: Option<i64>,
177 pub limit: Option<i32>,
179 pub recv_window: Option<i64>
180}
181
182#[derive(Clone, Debug, Default)]
184pub struct GetAccountStatusV1Params {
185 pub timestamp: i64,
186 pub recv_window: Option<i64>
187}
188
189#[derive(Clone, Debug, Default)]
191pub struct GetAssetAssetDetailV1Params {
192 pub timestamp: i64,
193 pub recv_window: Option<i64>
194}
195
196#[derive(Clone, Debug, Default)]
198pub struct GetAssetAssetDividendV1Params {
199 pub timestamp: i64,
200 pub asset: Option<String>,
201 pub start_time: Option<i64>,
202 pub end_time: Option<i64>,
203 pub limit: Option<i32>,
205 pub recv_window: Option<i64>
206}
207
208#[derive(Clone, Debug, Default)]
210pub struct GetAssetCustodyTransferHistoryV1Params {
211 pub email: String,
212 pub start_time: i64,
213 pub end_time: i64,
214 pub timestamp: i64,
215 pub r#type: Option<String>,
217 pub asset: Option<String>,
218 pub current: Option<i32>,
220 pub size: Option<i32>,
222 pub recv_window: Option<i64>
223}
224
225#[derive(Clone, Debug, Default)]
227pub struct GetAssetDribbletV1Params {
228 pub timestamp: i64,
229 pub start_time: Option<i64>,
230 pub end_time: Option<i64>,
231 pub recv_window: Option<i64>
232}
233
234#[derive(Clone, Debug, Default)]
236pub struct GetAssetLedgerTransferCloudMiningQueryByPageV1Params {
237 pub start_time: i64,
239 pub end_time: i64,
241 pub tran_id: Option<i64>,
243 pub client_tran_id: Option<String>,
245 pub asset: Option<String>,
247 pub current: Option<i32>,
249 pub size: Option<i32>
251}
252
253#[derive(Clone, Debug, Default)]
255pub struct GetAssetTradeFeeV1Params {
256 pub timestamp: i64,
257 pub symbol: Option<String>,
258 pub recv_window: Option<i64>
259}
260
261#[derive(Clone, Debug, Default)]
263pub struct GetAssetTransferV1Params {
264 pub r#type: String,
265 pub timestamp: i64,
266 pub start_time: Option<i64>,
267 pub end_time: Option<i64>,
268 pub current: Option<i32>,
270 pub size: Option<i32>,
272 pub from_symbol: Option<String>,
273 pub to_symbol: Option<String>,
274 pub recv_window: Option<i64>
275}
276
277#[derive(Clone, Debug, Default)]
279pub struct GetAssetWalletBalanceV1Params {
280 pub timestamp: i64,
281 pub quote_asset: Option<String>,
283 pub recv_window: Option<i64>
284}
285
286#[derive(Clone, Debug, Default)]
288pub struct GetCapitalConfigGetallV1Params {
289 pub timestamp: i64,
290 pub recv_window: Option<i64>
291}
292
293#[derive(Clone, Debug, Default)]
295pub struct GetCapitalDepositAddressListV1Params {
296 pub coin: String,
298 pub timestamp: i64,
299 pub network: Option<String>
300}
301
302#[derive(Clone, Debug, Default)]
304pub struct GetCapitalDepositAddressV1Params {
305 pub coin: String,
306 pub timestamp: i64,
307 pub network: Option<String>,
308 pub amount: Option<String>,
309 pub recv_window: Option<i64>
310}
311
312#[derive(Clone, Debug, Default)]
314pub struct GetCapitalDepositHisrecV1Params {
315 pub timestamp: i64,
316 pub include_source: Option<bool>,
318 pub coin: Option<String>,
319 pub status: Option<i32>,
321 pub start_time: Option<i64>,
323 pub end_time: Option<i64>,
325 pub offset: Option<i32>,
327 pub limit: Option<i32>,
329 pub recv_window: Option<i64>,
330 pub tx_id: Option<String>
331}
332
333#[derive(Clone, Debug, Default)]
335pub struct GetCapitalWithdrawHistoryV1Params {
336 pub timestamp: i64,
337 pub coin: Option<String>,
338 pub withdraw_order_id: Option<String>,
339 pub status: Option<i32>,
341 pub offset: Option<i32>,
342 pub limit: Option<i32>,
344 pub id_list: Option<String>,
346 pub start_time: Option<i64>,
348 pub end_time: Option<i64>,
350 pub recv_window: Option<i64>
351}
352
353#[derive(Clone, Debug, Default)]
355pub struct GetLocalentityDepositHistoryV1Params {
356 pub timestamp: i64,
357 pub tr_id: Option<String>,
359 pub tx_id: Option<String>,
361 pub tran_id: Option<String>,
363 pub network: Option<String>,
364 pub coin: Option<String>,
365 pub travel_rule_status: Option<i32>,
367 pub pending_questionnaire: Option<bool>,
369 pub start_time: Option<i64>,
371 pub end_time: Option<i64>,
373 pub offset: Option<i32>,
375 pub limit: Option<i32>
377}
378
379#[derive(Clone, Debug, Default)]
381pub struct GetLocalentityWithdrawHistoryV1Params {
382 pub timestamp: i64,
383 pub tr_id: Option<String>,
385 pub tx_id: Option<String>,
387 pub withdraw_order_id: Option<String>,
389 pub network: Option<String>,
390 pub coin: Option<String>,
391 pub travel_rule_status: Option<i32>,
393 pub offset: Option<i32>,
395 pub limit: Option<i32>,
397 pub start_time: Option<i64>,
399 pub end_time: Option<i64>,
401 pub recv_window: Option<i64>
402}
403
404#[derive(Clone, Debug, Default)]
406pub struct GetLocalentityWithdrawHistoryV2Params {
407 pub timestamp: i64,
408 pub tr_id: Option<String>,
410 pub tx_id: Option<String>,
412 pub withdraw_order_id: Option<String>,
414 pub network: Option<String>,
415 pub coin: Option<String>,
416 pub travel_rule_status: Option<i32>,
418 pub offset: Option<i32>,
420 pub limit: Option<i32>,
422 pub start_time: Option<i64>,
424 pub end_time: Option<i64>,
426 pub recv_window: Option<i64>
427}
428
429#[derive(Clone, Debug, Default)]
431pub struct GetSpotDelistScheduleV1Params {
432 pub timestamp: i64,
433 pub recv_window: Option<i64>
434}
435
436#[derive(Clone, Debug, Default)]
438pub struct UpdateLocalentityBrokerDepositProvideInfoV1Params {
439 pub beneficiary_pii: String,
440 pub deposit_id: String,
441 pub questionnaire: String,
442 pub signature: String,
443 pub sub_account_id: String,
444 pub timestamp: i64,
445 pub address: Option<String>,
446 pub address_tag: Option<String>,
447 pub amount: Option<String>,
448 pub coin: Option<String>,
449 pub network: Option<String>
450}
451
452#[derive(Clone, Debug, Default)]
454pub struct UpdateLocalentityDepositProvideInfoV1Params {
455 pub questionnaire: String,
456 pub timestamp: i64,
457 pub tran_id: i64
458}
459
460
461#[derive(Debug, Clone, Serialize, Deserialize)]
463#[serde(untagged)]
464pub enum CreateAccountDisableFastWithdrawSwitchV1Error {
465 Status4XX(models::ApiError),
466 Status5XX(models::ApiError),
467 UnknownValue(serde_json::Value),
468}
469
470#[derive(Debug, Clone, Serialize, Deserialize)]
472#[serde(untagged)]
473pub enum CreateAccountEnableFastWithdrawSwitchV1Error {
474 Status4XX(models::ApiError),
475 Status5XX(models::ApiError),
476 UnknownValue(serde_json::Value),
477}
478
479#[derive(Debug, Clone, Serialize, Deserialize)]
481#[serde(untagged)]
482pub enum CreateAssetDustBtcV1Error {
483 Status4XX(models::ApiError),
484 Status5XX(models::ApiError),
485 UnknownValue(serde_json::Value),
486}
487
488#[derive(Debug, Clone, Serialize, Deserialize)]
490#[serde(untagged)]
491pub enum CreateAssetDustV1Error {
492 Status4XX(models::ApiError),
493 Status5XX(models::ApiError),
494 UnknownValue(serde_json::Value),
495}
496
497#[derive(Debug, Clone, Serialize, Deserialize)]
499#[serde(untagged)]
500pub enum CreateAssetGetFundingAssetV1Error {
501 Status4XX(models::ApiError),
502 Status5XX(models::ApiError),
503 UnknownValue(serde_json::Value),
504}
505
506#[derive(Debug, Clone, Serialize, Deserialize)]
508#[serde(untagged)]
509pub enum CreateAssetGetUserAssetV3Error {
510 Status4XX(models::ApiError),
511 Status5XX(models::ApiError),
512 UnknownValue(serde_json::Value),
513}
514
515#[derive(Debug, Clone, Serialize, Deserialize)]
517#[serde(untagged)]
518pub enum CreateAssetTransferV1Error {
519 Status4XX(models::ApiError),
520 Status5XX(models::ApiError),
521 UnknownValue(serde_json::Value),
522}
523
524#[derive(Debug, Clone, Serialize, Deserialize)]
526#[serde(untagged)]
527pub enum CreateBnbBurnV1Error {
528 Status4XX(models::ApiError),
529 Status5XX(models::ApiError),
530 UnknownValue(serde_json::Value),
531}
532
533#[derive(Debug, Clone, Serialize, Deserialize)]
535#[serde(untagged)]
536pub enum CreateCapitalDepositCreditApplyV1Error {
537 Status4XX(models::ApiError),
538 Status5XX(models::ApiError),
539 UnknownValue(serde_json::Value),
540}
541
542#[derive(Debug, Clone, Serialize, Deserialize)]
544#[serde(untagged)]
545pub enum CreateCapitalWithdrawApplyV1Error {
546 Status4XX(models::ApiError),
547 Status5XX(models::ApiError),
548 UnknownValue(serde_json::Value),
549}
550
551#[derive(Debug, Clone, Serialize, Deserialize)]
553#[serde(untagged)]
554pub enum CreateLocalentityBrokerWithdrawApplyV1Error {
555 Status4XX(models::ApiError),
556 Status5XX(models::ApiError),
557 UnknownValue(serde_json::Value),
558}
559
560#[derive(Debug, Clone, Serialize, Deserialize)]
562#[serde(untagged)]
563pub enum CreateLocalentityWithdrawApplyV1Error {
564 Status4XX(models::ApiError),
565 Status5XX(models::ApiError),
566 UnknownValue(serde_json::Value),
567}
568
569#[derive(Debug, Clone, Serialize, Deserialize)]
571#[serde(untagged)]
572pub enum GetAccountApiRestrictionsV1Error {
573 Status4XX(models::ApiError),
574 Status5XX(models::ApiError),
575 UnknownValue(serde_json::Value),
576}
577
578#[derive(Debug, Clone, Serialize, Deserialize)]
580#[serde(untagged)]
581pub enum GetAccountApiTradingStatusV1Error {
582 Status4XX(models::ApiError),
583 Status5XX(models::ApiError),
584 UnknownValue(serde_json::Value),
585}
586
587#[derive(Debug, Clone, Serialize, Deserialize)]
589#[serde(untagged)]
590pub enum GetAccountInfoV1Error {
591 Status4XX(models::ApiError),
592 Status5XX(models::ApiError),
593 UnknownValue(serde_json::Value),
594}
595
596#[derive(Debug, Clone, Serialize, Deserialize)]
598#[serde(untagged)]
599pub enum GetAccountSnapshotV1Error {
600 Status4XX(models::ApiError),
601 Status5XX(models::ApiError),
602 UnknownValue(serde_json::Value),
603}
604
605#[derive(Debug, Clone, Serialize, Deserialize)]
607#[serde(untagged)]
608pub enum GetAccountStatusV1Error {
609 Status4XX(models::ApiError),
610 Status5XX(models::ApiError),
611 UnknownValue(serde_json::Value),
612}
613
614#[derive(Debug, Clone, Serialize, Deserialize)]
616#[serde(untagged)]
617pub enum GetAssetAssetDetailV1Error {
618 Status4XX(models::ApiError),
619 Status5XX(models::ApiError),
620 UnknownValue(serde_json::Value),
621}
622
623#[derive(Debug, Clone, Serialize, Deserialize)]
625#[serde(untagged)]
626pub enum GetAssetAssetDividendV1Error {
627 Status4XX(models::ApiError),
628 Status5XX(models::ApiError),
629 UnknownValue(serde_json::Value),
630}
631
632#[derive(Debug, Clone, Serialize, Deserialize)]
634#[serde(untagged)]
635pub enum GetAssetCustodyTransferHistoryV1Error {
636 Status4XX(models::ApiError),
637 Status5XX(models::ApiError),
638 UnknownValue(serde_json::Value),
639}
640
641#[derive(Debug, Clone, Serialize, Deserialize)]
643#[serde(untagged)]
644pub enum GetAssetDribbletV1Error {
645 Status4XX(models::ApiError),
646 Status5XX(models::ApiError),
647 UnknownValue(serde_json::Value),
648}
649
650#[derive(Debug, Clone, Serialize, Deserialize)]
652#[serde(untagged)]
653pub enum GetAssetLedgerTransferCloudMiningQueryByPageV1Error {
654 Status4XX(models::ApiError),
655 Status5XX(models::ApiError),
656 UnknownValue(serde_json::Value),
657}
658
659#[derive(Debug, Clone, Serialize, Deserialize)]
661#[serde(untagged)]
662pub enum GetAssetTradeFeeV1Error {
663 Status4XX(models::ApiError),
664 Status5XX(models::ApiError),
665 UnknownValue(serde_json::Value),
666}
667
668#[derive(Debug, Clone, Serialize, Deserialize)]
670#[serde(untagged)]
671pub enum GetAssetTransferV1Error {
672 Status4XX(models::ApiError),
673 Status5XX(models::ApiError),
674 UnknownValue(serde_json::Value),
675}
676
677#[derive(Debug, Clone, Serialize, Deserialize)]
679#[serde(untagged)]
680pub enum GetAssetWalletBalanceV1Error {
681 Status4XX(models::ApiError),
682 Status5XX(models::ApiError),
683 UnknownValue(serde_json::Value),
684}
685
686#[derive(Debug, Clone, Serialize, Deserialize)]
688#[serde(untagged)]
689pub enum GetCapitalConfigGetallV1Error {
690 Status4XX(models::ApiError),
691 Status5XX(models::ApiError),
692 UnknownValue(serde_json::Value),
693}
694
695#[derive(Debug, Clone, Serialize, Deserialize)]
697#[serde(untagged)]
698pub enum GetCapitalDepositAddressListV1Error {
699 Status4XX(models::ApiError),
700 Status5XX(models::ApiError),
701 UnknownValue(serde_json::Value),
702}
703
704#[derive(Debug, Clone, Serialize, Deserialize)]
706#[serde(untagged)]
707pub enum GetCapitalDepositAddressV1Error {
708 Status4XX(models::ApiError),
709 Status5XX(models::ApiError),
710 UnknownValue(serde_json::Value),
711}
712
713#[derive(Debug, Clone, Serialize, Deserialize)]
715#[serde(untagged)]
716pub enum GetCapitalDepositHisrecV1Error {
717 Status4XX(models::ApiError),
718 Status5XX(models::ApiError),
719 UnknownValue(serde_json::Value),
720}
721
722#[derive(Debug, Clone, Serialize, Deserialize)]
724#[serde(untagged)]
725pub enum GetCapitalWithdrawAddressListV1Error {
726 Status4XX(models::ApiError),
727 Status5XX(models::ApiError),
728 UnknownValue(serde_json::Value),
729}
730
731#[derive(Debug, Clone, Serialize, Deserialize)]
733#[serde(untagged)]
734pub enum GetCapitalWithdrawHistoryV1Error {
735 Status4XX(models::ApiError),
736 Status5XX(models::ApiError),
737 UnknownValue(serde_json::Value),
738}
739
740#[derive(Debug, Clone, Serialize, Deserialize)]
742#[serde(untagged)]
743pub enum GetLocalentityDepositHistoryV1Error {
744 Status4XX(models::ApiError),
745 Status5XX(models::ApiError),
746 UnknownValue(serde_json::Value),
747}
748
749#[derive(Debug, Clone, Serialize, Deserialize)]
751#[serde(untagged)]
752pub enum GetLocalentityVaspV1Error {
753 Status4XX(models::ApiError),
754 Status5XX(models::ApiError),
755 UnknownValue(serde_json::Value),
756}
757
758#[derive(Debug, Clone, Serialize, Deserialize)]
760#[serde(untagged)]
761pub enum GetLocalentityWithdrawHistoryV1Error {
762 Status4XX(models::ApiError),
763 Status5XX(models::ApiError),
764 UnknownValue(serde_json::Value),
765}
766
767#[derive(Debug, Clone, Serialize, Deserialize)]
769#[serde(untagged)]
770pub enum GetLocalentityWithdrawHistoryV2Error {
771 Status4XX(models::ApiError),
772 Status5XX(models::ApiError),
773 UnknownValue(serde_json::Value),
774}
775
776#[derive(Debug, Clone, Serialize, Deserialize)]
778#[serde(untagged)]
779pub enum GetSpotDelistScheduleV1Error {
780 Status4XX(models::ApiError),
781 Status5XX(models::ApiError),
782 UnknownValue(serde_json::Value),
783}
784
785#[derive(Debug, Clone, Serialize, Deserialize)]
787#[serde(untagged)]
788pub enum GetSpotOpenSymbolListV1Error {
789 Status4XX(models::ApiError),
790 Status5XX(models::ApiError),
791 UnknownValue(serde_json::Value),
792}
793
794#[derive(Debug, Clone, Serialize, Deserialize)]
796#[serde(untagged)]
797pub enum GetSystemStatusV1Error {
798 Status4XX(models::ApiError),
799 Status5XX(models::ApiError),
800 UnknownValue(serde_json::Value),
801}
802
803#[derive(Debug, Clone, Serialize, Deserialize)]
805#[serde(untagged)]
806pub enum UpdateLocalentityBrokerDepositProvideInfoV1Error {
807 Status4XX(models::ApiError),
808 Status5XX(models::ApiError),
809 UnknownValue(serde_json::Value),
810}
811
812#[derive(Debug, Clone, Serialize, Deserialize)]
814#[serde(untagged)]
815pub enum UpdateLocalentityDepositProvideInfoV1Error {
816 Status4XX(models::ApiError),
817 Status5XX(models::ApiError),
818 UnknownValue(serde_json::Value),
819}
820
821
822pub async fn create_account_disable_fast_withdraw_switch_v1(configuration: &configuration::Configuration, params: CreateAccountDisableFastWithdrawSwitchV1Params) -> Result<serde_json::Value, Error<CreateAccountDisableFastWithdrawSwitchV1Error>> {
823
824 let uri_str = format!("{}/sapi/v1/account/disableFastWithdrawSwitch", configuration.base_path);
825 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
826
827 let mut query_params: Vec<(String, String)> = Vec::new();
829
830
831 let mut header_params = std::collections::HashMap::new();
833
834 if let Some(ref binance_auth) = configuration.binance_auth {
836 header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
838
839 let body_string: Option<Vec<u8>> = None;
841
842 let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
844 Ok(sig) => sig,
845 Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
846 };
847
848 query_params.push(("signature".to_string(), signature));
850 }
851
852 if !query_params.is_empty() {
854 req_builder = req_builder.query(&query_params);
855 }
856
857
858 if let Some(ref user_agent) = configuration.user_agent {
860 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
861 }
862
863 for (header_name, header_value) in header_params {
865 req_builder = req_builder.header(&header_name, &header_value);
866 }
867
868 let mut multipart_form_params = std::collections::HashMap::new();
869 if let Some(param_value) = params.recv_window {
870 multipart_form_params.insert("recvWindow", param_value.to_string());
871 }
872 multipart_form_params.insert("timestamp", params.timestamp.to_string());
873 req_builder = req_builder.form(&multipart_form_params);
874
875 let req = req_builder.build()?;
876 let resp = configuration.client.execute(req).await?;
877
878 let status = resp.status();
879 let content_type = resp
880 .headers()
881 .get("content-type")
882 .and_then(|v| v.to_str().ok())
883 .unwrap_or("application/octet-stream");
884 let content_type = super::ContentType::from(content_type);
885
886 if !status.is_client_error() && !status.is_server_error() {
887 let content = resp.text().await?;
888 match content_type {
889 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
890 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))),
891 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))),
892 }
893 } else {
894 let content = resp.text().await?;
895 let entity: Option<CreateAccountDisableFastWithdrawSwitchV1Error> = serde_json::from_str(&content).ok();
896 Err(Error::ResponseError(ResponseContent { status, content, entity }))
897 }
898}
899
900pub async fn create_account_enable_fast_withdraw_switch_v1(configuration: &configuration::Configuration, params: CreateAccountEnableFastWithdrawSwitchV1Params) -> Result<serde_json::Value, Error<CreateAccountEnableFastWithdrawSwitchV1Error>> {
902
903 let uri_str = format!("{}/sapi/v1/account/enableFastWithdrawSwitch", configuration.base_path);
904 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
905
906 let mut query_params: Vec<(String, String)> = Vec::new();
908
909
910 let mut header_params = std::collections::HashMap::new();
912
913 if let Some(ref binance_auth) = configuration.binance_auth {
915 header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
917
918 let body_string: Option<Vec<u8>> = None;
920
921 let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
923 Ok(sig) => sig,
924 Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
925 };
926
927 query_params.push(("signature".to_string(), signature));
929 }
930
931 if !query_params.is_empty() {
933 req_builder = req_builder.query(&query_params);
934 }
935
936
937 if let Some(ref user_agent) = configuration.user_agent {
939 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
940 }
941
942 for (header_name, header_value) in header_params {
944 req_builder = req_builder.header(&header_name, &header_value);
945 }
946
947 let mut multipart_form_params = std::collections::HashMap::new();
948 if let Some(param_value) = params.recv_window {
949 multipart_form_params.insert("recvWindow", param_value.to_string());
950 }
951 multipart_form_params.insert("timestamp", params.timestamp.to_string());
952 req_builder = req_builder.form(&multipart_form_params);
953
954 let req = req_builder.build()?;
955 let resp = configuration.client.execute(req).await?;
956
957 let status = resp.status();
958 let content_type = resp
959 .headers()
960 .get("content-type")
961 .and_then(|v| v.to_str().ok())
962 .unwrap_or("application/octet-stream");
963 let content_type = super::ContentType::from(content_type);
964
965 if !status.is_client_error() && !status.is_server_error() {
966 let content = resp.text().await?;
967 match content_type {
968 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
969 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))),
970 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))),
971 }
972 } else {
973 let content = resp.text().await?;
974 let entity: Option<CreateAccountEnableFastWithdrawSwitchV1Error> = serde_json::from_str(&content).ok();
975 Err(Error::ResponseError(ResponseContent { status, content, entity }))
976 }
977}
978
979pub async fn create_asset_dust_btc_v1(configuration: &configuration::Configuration, params: CreateAssetDustBtcV1Params) -> Result<models::CreateAssetDustBtcV1Resp, Error<CreateAssetDustBtcV1Error>> {
981
982 let uri_str = format!("{}/sapi/v1/asset/dust-btc", configuration.base_path);
983 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
984
985 let mut query_params: Vec<(String, String)> = Vec::new();
987
988
989 let mut header_params = std::collections::HashMap::new();
991
992 if let Some(ref binance_auth) = configuration.binance_auth {
994 header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
996
997 let body_string: Option<Vec<u8>> = None;
999
1000 let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
1002 Ok(sig) => sig,
1003 Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
1004 };
1005
1006 query_params.push(("signature".to_string(), signature));
1008 }
1009
1010 if !query_params.is_empty() {
1012 req_builder = req_builder.query(&query_params);
1013 }
1014
1015
1016 if let Some(ref user_agent) = configuration.user_agent {
1018 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1019 }
1020
1021 for (header_name, header_value) in header_params {
1023 req_builder = req_builder.header(&header_name, &header_value);
1024 }
1025
1026 let mut multipart_form_params = std::collections::HashMap::new();
1027 if let Some(param_value) = params.account_type {
1028 multipart_form_params.insert("accountType", param_value.to_string());
1029 }
1030 if let Some(param_value) = params.recv_window {
1031 multipart_form_params.insert("recvWindow", param_value.to_string());
1032 }
1033 multipart_form_params.insert("timestamp", params.timestamp.to_string());
1034 req_builder = req_builder.form(&multipart_form_params);
1035
1036 let req = req_builder.build()?;
1037 let resp = configuration.client.execute(req).await?;
1038
1039 let status = resp.status();
1040 let content_type = resp
1041 .headers()
1042 .get("content-type")
1043 .and_then(|v| v.to_str().ok())
1044 .unwrap_or("application/octet-stream");
1045 let content_type = super::ContentType::from(content_type);
1046
1047 if !status.is_client_error() && !status.is_server_error() {
1048 let content = resp.text().await?;
1049 match content_type {
1050 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1051 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CreateAssetDustBtcV1Resp`"))),
1052 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::CreateAssetDustBtcV1Resp`")))),
1053 }
1054 } else {
1055 let content = resp.text().await?;
1056 let entity: Option<CreateAssetDustBtcV1Error> = serde_json::from_str(&content).ok();
1057 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1058 }
1059}
1060
1061pub async fn create_asset_dust_v1(configuration: &configuration::Configuration, params: CreateAssetDustV1Params) -> Result<models::CreateAssetDustV1Resp, Error<CreateAssetDustV1Error>> {
1063
1064 let uri_str = format!("{}/sapi/v1/asset/dust", configuration.base_path);
1065 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1066
1067 let mut query_params: Vec<(String, String)> = Vec::new();
1069
1070
1071 let mut header_params = std::collections::HashMap::new();
1073
1074 if let Some(ref binance_auth) = configuration.binance_auth {
1076 header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
1078
1079 let body_string: Option<Vec<u8>> = None;
1081
1082 let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
1084 Ok(sig) => sig,
1085 Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
1086 };
1087
1088 query_params.push(("signature".to_string(), signature));
1090 }
1091
1092 if !query_params.is_empty() {
1094 req_builder = req_builder.query(&query_params);
1095 }
1096
1097
1098 if let Some(ref user_agent) = configuration.user_agent {
1100 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1101 }
1102
1103 for (header_name, header_value) in header_params {
1105 req_builder = req_builder.header(&header_name, &header_value);
1106 }
1107
1108 let mut multipart_form_params = std::collections::HashMap::new();
1109 if let Some(param_value) = params.account_type {
1110 multipart_form_params.insert("accountType", param_value.to_string());
1111 }
1112 multipart_form_params.insert("asset", params.asset.into_iter().map(|p| serde_json::to_string(&p).unwrap_or_default()).collect::<Vec<String>>().join(",").to_string());
1113 if let Some(param_value) = params.recv_window {
1114 multipart_form_params.insert("recvWindow", param_value.to_string());
1115 }
1116 multipart_form_params.insert("timestamp", params.timestamp.to_string());
1117 req_builder = req_builder.form(&multipart_form_params);
1118
1119 let req = req_builder.build()?;
1120 let resp = configuration.client.execute(req).await?;
1121
1122 let status = resp.status();
1123 let content_type = resp
1124 .headers()
1125 .get("content-type")
1126 .and_then(|v| v.to_str().ok())
1127 .unwrap_or("application/octet-stream");
1128 let content_type = super::ContentType::from(content_type);
1129
1130 if !status.is_client_error() && !status.is_server_error() {
1131 let content = resp.text().await?;
1132 match content_type {
1133 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1134 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CreateAssetDustV1Resp`"))),
1135 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::CreateAssetDustV1Resp`")))),
1136 }
1137 } else {
1138 let content = resp.text().await?;
1139 let entity: Option<CreateAssetDustV1Error> = serde_json::from_str(&content).ok();
1140 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1141 }
1142}
1143
1144pub async fn create_asset_get_funding_asset_v1(configuration: &configuration::Configuration, params: CreateAssetGetFundingAssetV1Params) -> Result<Vec<models::CreateAssetGetFundingAssetV1RespItem>, Error<CreateAssetGetFundingAssetV1Error>> {
1146
1147 let uri_str = format!("{}/sapi/v1/asset/get-funding-asset", configuration.base_path);
1148 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1149
1150 let mut query_params: Vec<(String, String)> = Vec::new();
1152
1153
1154 let mut header_params = std::collections::HashMap::new();
1156
1157 if let Some(ref binance_auth) = configuration.binance_auth {
1159 header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
1161
1162 let body_string: Option<Vec<u8>> = None;
1164
1165 let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
1167 Ok(sig) => sig,
1168 Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
1169 };
1170
1171 query_params.push(("signature".to_string(), signature));
1173 }
1174
1175 if !query_params.is_empty() {
1177 req_builder = req_builder.query(&query_params);
1178 }
1179
1180
1181 if let Some(ref user_agent) = configuration.user_agent {
1183 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1184 }
1185
1186 for (header_name, header_value) in header_params {
1188 req_builder = req_builder.header(&header_name, &header_value);
1189 }
1190
1191 let mut multipart_form_params = std::collections::HashMap::new();
1192 if let Some(param_value) = params.asset {
1193 multipart_form_params.insert("asset", param_value.to_string());
1194 }
1195 if let Some(param_value) = params.need_btc_valuation {
1196 multipart_form_params.insert("needBtcValuation", param_value.to_string());
1197 }
1198 if let Some(param_value) = params.recv_window {
1199 multipart_form_params.insert("recvWindow", param_value.to_string());
1200 }
1201 multipart_form_params.insert("timestamp", params.timestamp.to_string());
1202 req_builder = req_builder.form(&multipart_form_params);
1203
1204 let req = req_builder.build()?;
1205 let resp = configuration.client.execute(req).await?;
1206
1207 let status = resp.status();
1208 let content_type = resp
1209 .headers()
1210 .get("content-type")
1211 .and_then(|v| v.to_str().ok())
1212 .unwrap_or("application/octet-stream");
1213 let content_type = super::ContentType::from(content_type);
1214
1215 if !status.is_client_error() && !status.is_server_error() {
1216 let content = resp.text().await?;
1217 match content_type {
1218 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1219 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::CreateAssetGetFundingAssetV1RespItem>`"))),
1220 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::CreateAssetGetFundingAssetV1RespItem>`")))),
1221 }
1222 } else {
1223 let content = resp.text().await?;
1224 let entity: Option<CreateAssetGetFundingAssetV1Error> = serde_json::from_str(&content).ok();
1225 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1226 }
1227}
1228
1229pub async fn create_asset_get_user_asset_v3(configuration: &configuration::Configuration, params: CreateAssetGetUserAssetV3Params) -> Result<Vec<models::CreateAssetGetUserAssetV3RespItem>, Error<CreateAssetGetUserAssetV3Error>> {
1231
1232 let uri_str = format!("{}/sapi/v3/asset/getUserAsset", configuration.base_path);
1233 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1234
1235 let mut query_params: Vec<(String, String)> = Vec::new();
1237
1238
1239 let mut header_params = std::collections::HashMap::new();
1241
1242 if let Some(ref binance_auth) = configuration.binance_auth {
1244 header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
1246
1247 let body_string: Option<Vec<u8>> = None;
1249
1250 let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
1252 Ok(sig) => sig,
1253 Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
1254 };
1255
1256 query_params.push(("signature".to_string(), signature));
1258 }
1259
1260 if !query_params.is_empty() {
1262 req_builder = req_builder.query(&query_params);
1263 }
1264
1265
1266 if let Some(ref user_agent) = configuration.user_agent {
1268 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1269 }
1270
1271 for (header_name, header_value) in header_params {
1273 req_builder = req_builder.header(&header_name, &header_value);
1274 }
1275
1276 let mut multipart_form_params = std::collections::HashMap::new();
1277 if let Some(param_value) = params.asset {
1278 multipart_form_params.insert("asset", param_value.to_string());
1279 }
1280 if let Some(param_value) = params.need_btc_valuation {
1281 multipart_form_params.insert("needBtcValuation", param_value.to_string());
1282 }
1283 if let Some(param_value) = params.recv_window {
1284 multipart_form_params.insert("recvWindow", param_value.to_string());
1285 }
1286 multipart_form_params.insert("timestamp", params.timestamp.to_string());
1287 req_builder = req_builder.form(&multipart_form_params);
1288
1289 let req = req_builder.build()?;
1290 let resp = configuration.client.execute(req).await?;
1291
1292 let status = resp.status();
1293 let content_type = resp
1294 .headers()
1295 .get("content-type")
1296 .and_then(|v| v.to_str().ok())
1297 .unwrap_or("application/octet-stream");
1298 let content_type = super::ContentType::from(content_type);
1299
1300 if !status.is_client_error() && !status.is_server_error() {
1301 let content = resp.text().await?;
1302 match content_type {
1303 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1304 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::CreateAssetGetUserAssetV3RespItem>`"))),
1305 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::CreateAssetGetUserAssetV3RespItem>`")))),
1306 }
1307 } else {
1308 let content = resp.text().await?;
1309 let entity: Option<CreateAssetGetUserAssetV3Error> = serde_json::from_str(&content).ok();
1310 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1311 }
1312}
1313
1314pub async fn create_asset_transfer_v1(configuration: &configuration::Configuration, params: CreateAssetTransferV1Params) -> Result<models::CreateAssetTransferV1Resp, Error<CreateAssetTransferV1Error>> {
1316
1317 let uri_str = format!("{}/sapi/v1/asset/transfer", configuration.base_path);
1318 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1319
1320 let mut query_params: Vec<(String, String)> = Vec::new();
1322
1323
1324 let mut header_params = std::collections::HashMap::new();
1326
1327 if let Some(ref binance_auth) = configuration.binance_auth {
1329 header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
1331
1332 let body_string: Option<Vec<u8>> = None;
1334
1335 let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
1337 Ok(sig) => sig,
1338 Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
1339 };
1340
1341 query_params.push(("signature".to_string(), signature));
1343 }
1344
1345 if !query_params.is_empty() {
1347 req_builder = req_builder.query(&query_params);
1348 }
1349
1350
1351 if let Some(ref user_agent) = configuration.user_agent {
1353 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1354 }
1355
1356 for (header_name, header_value) in header_params {
1358 req_builder = req_builder.header(&header_name, &header_value);
1359 }
1360
1361 let mut multipart_form_params = std::collections::HashMap::new();
1362 multipart_form_params.insert("amount", params.amount.to_string());
1363 multipart_form_params.insert("asset", params.asset.to_string());
1364 if let Some(param_value) = params.from_symbol {
1365 multipart_form_params.insert("fromSymbol", param_value.to_string());
1366 }
1367 if let Some(param_value) = params.recv_window {
1368 multipart_form_params.insert("recvWindow", param_value.to_string());
1369 }
1370 multipart_form_params.insert("timestamp", params.timestamp.to_string());
1371 if let Some(param_value) = params.to_symbol {
1372 multipart_form_params.insert("toSymbol", param_value.to_string());
1373 }
1374 multipart_form_params.insert("type", params.r#type.to_string());
1375 req_builder = req_builder.form(&multipart_form_params);
1376
1377 let req = req_builder.build()?;
1378 let resp = configuration.client.execute(req).await?;
1379
1380 let status = resp.status();
1381 let content_type = resp
1382 .headers()
1383 .get("content-type")
1384 .and_then(|v| v.to_str().ok())
1385 .unwrap_or("application/octet-stream");
1386 let content_type = super::ContentType::from(content_type);
1387
1388 if !status.is_client_error() && !status.is_server_error() {
1389 let content = resp.text().await?;
1390 match content_type {
1391 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1392 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CreateAssetTransferV1Resp`"))),
1393 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::CreateAssetTransferV1Resp`")))),
1394 }
1395 } else {
1396 let content = resp.text().await?;
1397 let entity: Option<CreateAssetTransferV1Error> = serde_json::from_str(&content).ok();
1398 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1399 }
1400}
1401
1402pub async fn create_bnb_burn_v1(configuration: &configuration::Configuration, params: CreateBnbBurnV1Params) -> Result<models::CreateBnbBurnV1Resp, Error<CreateBnbBurnV1Error>> {
1404
1405 let uri_str = format!("{}/sapi/v1/bnbBurn", configuration.base_path);
1406 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1407
1408 let mut query_params: Vec<(String, String)> = Vec::new();
1410
1411
1412 let mut header_params = std::collections::HashMap::new();
1414
1415 if let Some(ref binance_auth) = configuration.binance_auth {
1417 header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
1419
1420 let body_string: Option<Vec<u8>> = None;
1422
1423 let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
1425 Ok(sig) => sig,
1426 Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
1427 };
1428
1429 query_params.push(("signature".to_string(), signature));
1431 }
1432
1433 if !query_params.is_empty() {
1435 req_builder = req_builder.query(&query_params);
1436 }
1437
1438
1439 if let Some(ref user_agent) = configuration.user_agent {
1441 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1442 }
1443
1444 for (header_name, header_value) in header_params {
1446 req_builder = req_builder.header(&header_name, &header_value);
1447 }
1448
1449 let mut multipart_form_params = std::collections::HashMap::new();
1450 if let Some(param_value) = params.interest_bnb_burn {
1451 multipart_form_params.insert("interestBNBBurn", param_value.to_string());
1452 }
1453 if let Some(param_value) = params.recv_window {
1454 multipart_form_params.insert("recvWindow", param_value.to_string());
1455 }
1456 if let Some(param_value) = params.spot_bnb_burn {
1457 multipart_form_params.insert("spotBNBBurn", param_value.to_string());
1458 }
1459 multipart_form_params.insert("timestamp", params.timestamp.to_string());
1460 req_builder = req_builder.form(&multipart_form_params);
1461
1462 let req = req_builder.build()?;
1463 let resp = configuration.client.execute(req).await?;
1464
1465 let status = resp.status();
1466 let content_type = resp
1467 .headers()
1468 .get("content-type")
1469 .and_then(|v| v.to_str().ok())
1470 .unwrap_or("application/octet-stream");
1471 let content_type = super::ContentType::from(content_type);
1472
1473 if !status.is_client_error() && !status.is_server_error() {
1474 let content = resp.text().await?;
1475 match content_type {
1476 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1477 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CreateBnbBurnV1Resp`"))),
1478 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::CreateBnbBurnV1Resp`")))),
1479 }
1480 } else {
1481 let content = resp.text().await?;
1482 let entity: Option<CreateBnbBurnV1Error> = serde_json::from_str(&content).ok();
1483 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1484 }
1485}
1486
1487pub async fn create_capital_deposit_credit_apply_v1(configuration: &configuration::Configuration, params: CreateCapitalDepositCreditApplyV1Params) -> Result<models::CreateCapitalDepositCreditApplyV1Resp, Error<CreateCapitalDepositCreditApplyV1Error>> {
1489
1490 let uri_str = format!("{}/sapi/v1/capital/deposit/credit-apply", configuration.base_path);
1491 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1492
1493 let mut query_params: Vec<(String, String)> = Vec::new();
1495
1496
1497 let mut header_params = std::collections::HashMap::new();
1499
1500 if let Some(ref binance_auth) = configuration.binance_auth {
1502 header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
1504
1505 let body_string: Option<Vec<u8>> = None;
1507
1508 let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
1510 Ok(sig) => sig,
1511 Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
1512 };
1513
1514 query_params.push(("signature".to_string(), signature));
1516 }
1517
1518 if !query_params.is_empty() {
1520 req_builder = req_builder.query(&query_params);
1521 }
1522
1523
1524 if let Some(ref user_agent) = configuration.user_agent {
1526 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1527 }
1528
1529 for (header_name, header_value) in header_params {
1531 req_builder = req_builder.header(&header_name, &header_value);
1532 }
1533
1534 let mut multipart_form_params = std::collections::HashMap::new();
1535 if let Some(param_value) = params.deposit_id {
1536 multipart_form_params.insert("depositId", param_value.to_string());
1537 }
1538 if let Some(param_value) = params.sub_account_id {
1539 multipart_form_params.insert("subAccountId", param_value.to_string());
1540 }
1541 if let Some(param_value) = params.sub_user_id {
1542 multipart_form_params.insert("subUserId", param_value.to_string());
1543 }
1544 if let Some(param_value) = params.tx_id {
1545 multipart_form_params.insert("txId", param_value.to_string());
1546 }
1547 req_builder = req_builder.form(&multipart_form_params);
1548
1549 let req = req_builder.build()?;
1550 let resp = configuration.client.execute(req).await?;
1551
1552 let status = resp.status();
1553 let content_type = resp
1554 .headers()
1555 .get("content-type")
1556 .and_then(|v| v.to_str().ok())
1557 .unwrap_or("application/octet-stream");
1558 let content_type = super::ContentType::from(content_type);
1559
1560 if !status.is_client_error() && !status.is_server_error() {
1561 let content = resp.text().await?;
1562 match content_type {
1563 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1564 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CreateCapitalDepositCreditApplyV1Resp`"))),
1565 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::CreateCapitalDepositCreditApplyV1Resp`")))),
1566 }
1567 } else {
1568 let content = resp.text().await?;
1569 let entity: Option<CreateCapitalDepositCreditApplyV1Error> = serde_json::from_str(&content).ok();
1570 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1571 }
1572}
1573
1574pub async fn create_capital_withdraw_apply_v1(configuration: &configuration::Configuration, params: CreateCapitalWithdrawApplyV1Params) -> Result<models::CreateCapitalWithdrawApplyV1Resp, Error<CreateCapitalWithdrawApplyV1Error>> {
1576
1577 let uri_str = format!("{}/sapi/v1/capital/withdraw/apply", configuration.base_path);
1578 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1579
1580 let mut query_params: Vec<(String, String)> = Vec::new();
1582
1583
1584 let mut header_params = std::collections::HashMap::new();
1586
1587 if let Some(ref binance_auth) = configuration.binance_auth {
1589 header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
1591
1592 let body_string: Option<Vec<u8>> = None;
1594
1595 let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
1597 Ok(sig) => sig,
1598 Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
1599 };
1600
1601 query_params.push(("signature".to_string(), signature));
1603 }
1604
1605 if !query_params.is_empty() {
1607 req_builder = req_builder.query(&query_params);
1608 }
1609
1610
1611 if let Some(ref user_agent) = configuration.user_agent {
1613 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1614 }
1615
1616 for (header_name, header_value) in header_params {
1618 req_builder = req_builder.header(&header_name, &header_value);
1619 }
1620
1621 let mut multipart_form_params = std::collections::HashMap::new();
1622 multipart_form_params.insert("address", params.address.to_string());
1623 if let Some(param_value) = params.address_tag {
1624 multipart_form_params.insert("addressTag", param_value.to_string());
1625 }
1626 multipart_form_params.insert("amount", params.amount.to_string());
1627 multipart_form_params.insert("coin", params.coin.to_string());
1628 if let Some(param_value) = params.name {
1629 multipart_form_params.insert("name", param_value.to_string());
1630 }
1631 if let Some(param_value) = params.network {
1632 multipart_form_params.insert("network", param_value.to_string());
1633 }
1634 if let Some(param_value) = params.recv_window {
1635 multipart_form_params.insert("recvWindow", param_value.to_string());
1636 }
1637 multipart_form_params.insert("timestamp", params.timestamp.to_string());
1638 if let Some(param_value) = params.transaction_fee_flag {
1639 multipart_form_params.insert("transactionFeeFlag", param_value.to_string());
1640 }
1641 if let Some(param_value) = params.wallet_type {
1642 multipart_form_params.insert("walletType", param_value.to_string());
1643 }
1644 if let Some(param_value) = params.withdraw_order_id {
1645 multipart_form_params.insert("withdrawOrderId", param_value.to_string());
1646 }
1647 req_builder = req_builder.form(&multipart_form_params);
1648
1649 let req = req_builder.build()?;
1650 let resp = configuration.client.execute(req).await?;
1651
1652 let status = resp.status();
1653 let content_type = resp
1654 .headers()
1655 .get("content-type")
1656 .and_then(|v| v.to_str().ok())
1657 .unwrap_or("application/octet-stream");
1658 let content_type = super::ContentType::from(content_type);
1659
1660 if !status.is_client_error() && !status.is_server_error() {
1661 let content = resp.text().await?;
1662 match content_type {
1663 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1664 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CreateCapitalWithdrawApplyV1Resp`"))),
1665 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::CreateCapitalWithdrawApplyV1Resp`")))),
1666 }
1667 } else {
1668 let content = resp.text().await?;
1669 let entity: Option<CreateCapitalWithdrawApplyV1Error> = serde_json::from_str(&content).ok();
1670 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1671 }
1672}
1673
1674pub async fn create_localentity_broker_withdraw_apply_v1(configuration: &configuration::Configuration, params: CreateLocalentityBrokerWithdrawApplyV1Params) -> Result<models::CreateLocalentityBrokerWithdrawApplyV1Resp, Error<CreateLocalentityBrokerWithdrawApplyV1Error>> {
1676
1677 let uri_str = format!("{}/sapi/v1/localentity/broker/withdraw/apply", configuration.base_path);
1678 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1679
1680 let mut query_params: Vec<(String, String)> = Vec::new();
1682
1683
1684 let mut header_params = std::collections::HashMap::new();
1686
1687 if let Some(ref binance_auth) = configuration.binance_auth {
1689 header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
1691
1692 let body_string: Option<Vec<u8>> = None;
1694
1695 let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
1697 Ok(sig) => sig,
1698 Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
1699 };
1700
1701 query_params.push(("signature".to_string(), signature));
1703 }
1704
1705 if !query_params.is_empty() {
1707 req_builder = req_builder.query(&query_params);
1708 }
1709
1710
1711 if let Some(ref user_agent) = configuration.user_agent {
1713 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1714 }
1715
1716 for (header_name, header_value) in header_params {
1718 req_builder = req_builder.header(&header_name, &header_value);
1719 }
1720
1721 let mut multipart_form_params = std::collections::HashMap::new();
1722 multipart_form_params.insert("address", params.address.to_string());
1723 if let Some(param_value) = params.address_name {
1724 multipart_form_params.insert("addressName", param_value.to_string());
1725 }
1726 if let Some(param_value) = params.address_tag {
1727 multipart_form_params.insert("addressTag", param_value.to_string());
1728 }
1729 multipart_form_params.insert("amount", params.amount.to_string());
1730 multipart_form_params.insert("coin", params.coin.to_string());
1731 if let Some(param_value) = params.network {
1732 multipart_form_params.insert("network", param_value.to_string());
1733 }
1734 multipart_form_params.insert("originatorPii", params.originator_pii.to_string());
1735 multipart_form_params.insert("questionnaire", params.questionnaire.to_string());
1736 multipart_form_params.insert("signature", params.signature.to_string());
1737 multipart_form_params.insert("subAccountId", params.sub_account_id.to_string());
1738 multipart_form_params.insert("timestamp", params.timestamp.to_string());
1739 if let Some(param_value) = params.transaction_fee_flag {
1740 multipart_form_params.insert("transactionFeeFlag", param_value.to_string());
1741 }
1742 if let Some(param_value) = params.wallet_type {
1743 multipart_form_params.insert("walletType", param_value.to_string());
1744 }
1745 multipart_form_params.insert("withdrawOrderId", params.withdraw_order_id.to_string());
1746 req_builder = req_builder.form(&multipart_form_params);
1747
1748 let req = req_builder.build()?;
1749 let resp = configuration.client.execute(req).await?;
1750
1751 let status = resp.status();
1752 let content_type = resp
1753 .headers()
1754 .get("content-type")
1755 .and_then(|v| v.to_str().ok())
1756 .unwrap_or("application/octet-stream");
1757 let content_type = super::ContentType::from(content_type);
1758
1759 if !status.is_client_error() && !status.is_server_error() {
1760 let content = resp.text().await?;
1761 match content_type {
1762 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1763 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CreateLocalentityBrokerWithdrawApplyV1Resp`"))),
1764 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::CreateLocalentityBrokerWithdrawApplyV1Resp`")))),
1765 }
1766 } else {
1767 let content = resp.text().await?;
1768 let entity: Option<CreateLocalentityBrokerWithdrawApplyV1Error> = serde_json::from_str(&content).ok();
1769 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1770 }
1771}
1772
1773pub async fn create_localentity_withdraw_apply_v1(configuration: &configuration::Configuration, params: CreateLocalentityWithdrawApplyV1Params) -> Result<models::CreateLocalentityWithdrawApplyV1Resp, Error<CreateLocalentityWithdrawApplyV1Error>> {
1775
1776 let uri_str = format!("{}/sapi/v1/localentity/withdraw/apply", configuration.base_path);
1777 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1778
1779 let mut query_params: Vec<(String, String)> = Vec::new();
1781
1782
1783 let mut header_params = std::collections::HashMap::new();
1785
1786 if let Some(ref binance_auth) = configuration.binance_auth {
1788 header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
1790
1791 let body_string: Option<Vec<u8>> = None;
1793
1794 let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
1796 Ok(sig) => sig,
1797 Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
1798 };
1799
1800 query_params.push(("signature".to_string(), signature));
1802 }
1803
1804 if !query_params.is_empty() {
1806 req_builder = req_builder.query(&query_params);
1807 }
1808
1809
1810 if let Some(ref user_agent) = configuration.user_agent {
1812 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1813 }
1814
1815 for (header_name, header_value) in header_params {
1817 req_builder = req_builder.header(&header_name, &header_value);
1818 }
1819
1820 let mut multipart_form_params = std::collections::HashMap::new();
1821 multipart_form_params.insert("address", params.address.to_string());
1822 if let Some(param_value) = params.address_tag {
1823 multipart_form_params.insert("addressTag", param_value.to_string());
1824 }
1825 multipart_form_params.insert("amount", params.amount.to_string());
1826 multipart_form_params.insert("coin", params.coin.to_string());
1827 if let Some(param_value) = params.name {
1828 multipart_form_params.insert("name", param_value.to_string());
1829 }
1830 if let Some(param_value) = params.network {
1831 multipart_form_params.insert("network", param_value.to_string());
1832 }
1833 multipart_form_params.insert("questionnaire", params.questionnaire.to_string());
1834 if let Some(param_value) = params.recv_window {
1835 multipart_form_params.insert("recvWindow", param_value.to_string());
1836 }
1837 multipart_form_params.insert("timestamp", params.timestamp.to_string());
1838 if let Some(param_value) = params.transaction_fee_flag {
1839 multipart_form_params.insert("transactionFeeFlag", param_value.to_string());
1840 }
1841 if let Some(param_value) = params.wallet_type {
1842 multipart_form_params.insert("walletType", param_value.to_string());
1843 }
1844 if let Some(param_value) = params.withdraw_order_id {
1845 multipart_form_params.insert("withdrawOrderId", param_value.to_string());
1846 }
1847 req_builder = req_builder.form(&multipart_form_params);
1848
1849 let req = req_builder.build()?;
1850 let resp = configuration.client.execute(req).await?;
1851
1852 let status = resp.status();
1853 let content_type = resp
1854 .headers()
1855 .get("content-type")
1856 .and_then(|v| v.to_str().ok())
1857 .unwrap_or("application/octet-stream");
1858 let content_type = super::ContentType::from(content_type);
1859
1860 if !status.is_client_error() && !status.is_server_error() {
1861 let content = resp.text().await?;
1862 match content_type {
1863 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1864 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CreateLocalentityWithdrawApplyV1Resp`"))),
1865 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::CreateLocalentityWithdrawApplyV1Resp`")))),
1866 }
1867 } else {
1868 let content = resp.text().await?;
1869 let entity: Option<CreateLocalentityWithdrawApplyV1Error> = serde_json::from_str(&content).ok();
1870 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1871 }
1872}
1873
1874pub async fn get_account_api_restrictions_v1(configuration: &configuration::Configuration, params: GetAccountApiRestrictionsV1Params) -> Result<models::GetAccountApiRestrictionsV1Resp, Error<GetAccountApiRestrictionsV1Error>> {
1876
1877 let uri_str = format!("{}/sapi/v1/account/apiRestrictions", configuration.base_path);
1878 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1879
1880 let mut query_params: Vec<(String, String)> = Vec::new();
1882
1883 if let Some(ref param_value) = params.recv_window {
1884 query_params.push(("recvWindow".to_string(), param_value.to_string()));
1885 }
1886 query_params.push(("timestamp".to_string(), params.timestamp.to_string()));
1887
1888 let mut header_params = std::collections::HashMap::new();
1890
1891 if let Some(ref binance_auth) = configuration.binance_auth {
1893 header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
1895
1896 let body_string: Option<Vec<u8>> = None;
1898
1899 let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
1901 Ok(sig) => sig,
1902 Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
1903 };
1904
1905 query_params.push(("signature".to_string(), signature));
1907 }
1908
1909 if !query_params.is_empty() {
1911 req_builder = req_builder.query(&query_params);
1912 }
1913
1914
1915 if let Some(ref user_agent) = configuration.user_agent {
1917 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1918 }
1919
1920 for (header_name, header_value) in header_params {
1922 req_builder = req_builder.header(&header_name, &header_value);
1923 }
1924
1925
1926 let req = req_builder.build()?;
1927 let resp = configuration.client.execute(req).await?;
1928
1929 let status = resp.status();
1930 let content_type = resp
1931 .headers()
1932 .get("content-type")
1933 .and_then(|v| v.to_str().ok())
1934 .unwrap_or("application/octet-stream");
1935 let content_type = super::ContentType::from(content_type);
1936
1937 if !status.is_client_error() && !status.is_server_error() {
1938 let content = resp.text().await?;
1939 match content_type {
1940 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1941 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetAccountApiRestrictionsV1Resp`"))),
1942 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetAccountApiRestrictionsV1Resp`")))),
1943 }
1944 } else {
1945 let content = resp.text().await?;
1946 let entity: Option<GetAccountApiRestrictionsV1Error> = serde_json::from_str(&content).ok();
1947 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1948 }
1949}
1950
1951pub async fn get_account_api_trading_status_v1(configuration: &configuration::Configuration, params: GetAccountApiTradingStatusV1Params) -> Result<models::GetAccountApiTradingStatusV1Resp, Error<GetAccountApiTradingStatusV1Error>> {
1953
1954 let uri_str = format!("{}/sapi/v1/account/apiTradingStatus", configuration.base_path);
1955 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1956
1957 let mut query_params: Vec<(String, String)> = Vec::new();
1959
1960 if let Some(ref param_value) = params.recv_window {
1961 query_params.push(("recvWindow".to_string(), param_value.to_string()));
1962 }
1963 query_params.push(("timestamp".to_string(), params.timestamp.to_string()));
1964
1965 let mut header_params = std::collections::HashMap::new();
1967
1968 if let Some(ref binance_auth) = configuration.binance_auth {
1970 header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
1972
1973 let body_string: Option<Vec<u8>> = None;
1975
1976 let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
1978 Ok(sig) => sig,
1979 Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
1980 };
1981
1982 query_params.push(("signature".to_string(), signature));
1984 }
1985
1986 if !query_params.is_empty() {
1988 req_builder = req_builder.query(&query_params);
1989 }
1990
1991
1992 if let Some(ref user_agent) = configuration.user_agent {
1994 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1995 }
1996
1997 for (header_name, header_value) in header_params {
1999 req_builder = req_builder.header(&header_name, &header_value);
2000 }
2001
2002
2003 let req = req_builder.build()?;
2004 let resp = configuration.client.execute(req).await?;
2005
2006 let status = resp.status();
2007 let content_type = resp
2008 .headers()
2009 .get("content-type")
2010 .and_then(|v| v.to_str().ok())
2011 .unwrap_or("application/octet-stream");
2012 let content_type = super::ContentType::from(content_type);
2013
2014 if !status.is_client_error() && !status.is_server_error() {
2015 let content = resp.text().await?;
2016 match content_type {
2017 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2018 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetAccountApiTradingStatusV1Resp`"))),
2019 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetAccountApiTradingStatusV1Resp`")))),
2020 }
2021 } else {
2022 let content = resp.text().await?;
2023 let entity: Option<GetAccountApiTradingStatusV1Error> = serde_json::from_str(&content).ok();
2024 Err(Error::ResponseError(ResponseContent { status, content, entity }))
2025 }
2026}
2027
2028pub async fn get_account_info_v1(configuration: &configuration::Configuration, params: GetAccountInfoV1Params) -> Result<models::GetAccountInfoV1Resp, Error<GetAccountInfoV1Error>> {
2030
2031 let uri_str = format!("{}/sapi/v1/account/info", configuration.base_path);
2032 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2033
2034 let mut query_params: Vec<(String, String)> = Vec::new();
2036
2037 if let Some(ref param_value) = params.recv_window {
2038 query_params.push(("recvWindow".to_string(), param_value.to_string()));
2039 }
2040 query_params.push(("timestamp".to_string(), params.timestamp.to_string()));
2041
2042 let mut header_params = std::collections::HashMap::new();
2044
2045 if let Some(ref binance_auth) = configuration.binance_auth {
2047 header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
2049
2050 let body_string: Option<Vec<u8>> = None;
2052
2053 let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
2055 Ok(sig) => sig,
2056 Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
2057 };
2058
2059 query_params.push(("signature".to_string(), signature));
2061 }
2062
2063 if !query_params.is_empty() {
2065 req_builder = req_builder.query(&query_params);
2066 }
2067
2068
2069 if let Some(ref user_agent) = configuration.user_agent {
2071 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2072 }
2073
2074 for (header_name, header_value) in header_params {
2076 req_builder = req_builder.header(&header_name, &header_value);
2077 }
2078
2079
2080 let req = req_builder.build()?;
2081 let resp = configuration.client.execute(req).await?;
2082
2083 let status = resp.status();
2084 let content_type = resp
2085 .headers()
2086 .get("content-type")
2087 .and_then(|v| v.to_str().ok())
2088 .unwrap_or("application/octet-stream");
2089 let content_type = super::ContentType::from(content_type);
2090
2091 if !status.is_client_error() && !status.is_server_error() {
2092 let content = resp.text().await?;
2093 match content_type {
2094 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2095 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetAccountInfoV1Resp`"))),
2096 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetAccountInfoV1Resp`")))),
2097 }
2098 } else {
2099 let content = resp.text().await?;
2100 let entity: Option<GetAccountInfoV1Error> = serde_json::from_str(&content).ok();
2101 Err(Error::ResponseError(ResponseContent { status, content, entity }))
2102 }
2103}
2104
2105pub async fn get_account_snapshot_v1(configuration: &configuration::Configuration, params: GetAccountSnapshotV1Params) -> Result<models::GetAccountSnapshotV1Resp, Error<GetAccountSnapshotV1Error>> {
2107
2108 let uri_str = format!("{}/sapi/v1/accountSnapshot", configuration.base_path);
2109 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2110
2111 let mut query_params: Vec<(String, String)> = Vec::new();
2113
2114 query_params.push(("type".to_string(), params.r#type.to_string()));
2115 if let Some(ref param_value) = params.start_time {
2116 query_params.push(("startTime".to_string(), param_value.to_string()));
2117 }
2118 if let Some(ref param_value) = params.end_time {
2119 query_params.push(("endTime".to_string(), param_value.to_string()));
2120 }
2121 if let Some(ref param_value) = params.limit {
2122 query_params.push(("limit".to_string(), param_value.to_string()));
2123 }
2124 if let Some(ref param_value) = params.recv_window {
2125 query_params.push(("recvWindow".to_string(), param_value.to_string()));
2126 }
2127 query_params.push(("timestamp".to_string(), params.timestamp.to_string()));
2128
2129 let mut header_params = std::collections::HashMap::new();
2131
2132 if let Some(ref binance_auth) = configuration.binance_auth {
2134 header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
2136
2137 let body_string: Option<Vec<u8>> = None;
2139
2140 let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
2142 Ok(sig) => sig,
2143 Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
2144 };
2145
2146 query_params.push(("signature".to_string(), signature));
2148 }
2149
2150 if !query_params.is_empty() {
2152 req_builder = req_builder.query(&query_params);
2153 }
2154
2155
2156 if let Some(ref user_agent) = configuration.user_agent {
2158 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2159 }
2160
2161 for (header_name, header_value) in header_params {
2163 req_builder = req_builder.header(&header_name, &header_value);
2164 }
2165
2166
2167 let req = req_builder.build()?;
2168 let resp = configuration.client.execute(req).await?;
2169
2170 let status = resp.status();
2171 let content_type = resp
2172 .headers()
2173 .get("content-type")
2174 .and_then(|v| v.to_str().ok())
2175 .unwrap_or("application/octet-stream");
2176 let content_type = super::ContentType::from(content_type);
2177
2178 if !status.is_client_error() && !status.is_server_error() {
2179 let content = resp.text().await?;
2180 match content_type {
2181 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2182 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetAccountSnapshotV1Resp`"))),
2183 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetAccountSnapshotV1Resp`")))),
2184 }
2185 } else {
2186 let content = resp.text().await?;
2187 let entity: Option<GetAccountSnapshotV1Error> = serde_json::from_str(&content).ok();
2188 Err(Error::ResponseError(ResponseContent { status, content, entity }))
2189 }
2190}
2191
2192pub async fn get_account_status_v1(configuration: &configuration::Configuration, params: GetAccountStatusV1Params) -> Result<models::GetAccountStatusV1Resp, Error<GetAccountStatusV1Error>> {
2194
2195 let uri_str = format!("{}/sapi/v1/account/status", configuration.base_path);
2196 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2197
2198 let mut query_params: Vec<(String, String)> = Vec::new();
2200
2201 if let Some(ref param_value) = params.recv_window {
2202 query_params.push(("recvWindow".to_string(), param_value.to_string()));
2203 }
2204 query_params.push(("timestamp".to_string(), params.timestamp.to_string()));
2205
2206 let mut header_params = std::collections::HashMap::new();
2208
2209 if let Some(ref binance_auth) = configuration.binance_auth {
2211 header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
2213
2214 let body_string: Option<Vec<u8>> = None;
2216
2217 let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
2219 Ok(sig) => sig,
2220 Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
2221 };
2222
2223 query_params.push(("signature".to_string(), signature));
2225 }
2226
2227 if !query_params.is_empty() {
2229 req_builder = req_builder.query(&query_params);
2230 }
2231
2232
2233 if let Some(ref user_agent) = configuration.user_agent {
2235 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2236 }
2237
2238 for (header_name, header_value) in header_params {
2240 req_builder = req_builder.header(&header_name, &header_value);
2241 }
2242
2243
2244 let req = req_builder.build()?;
2245 let resp = configuration.client.execute(req).await?;
2246
2247 let status = resp.status();
2248 let content_type = resp
2249 .headers()
2250 .get("content-type")
2251 .and_then(|v| v.to_str().ok())
2252 .unwrap_or("application/octet-stream");
2253 let content_type = super::ContentType::from(content_type);
2254
2255 if !status.is_client_error() && !status.is_server_error() {
2256 let content = resp.text().await?;
2257 match content_type {
2258 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2259 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetAccountStatusV1Resp`"))),
2260 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetAccountStatusV1Resp`")))),
2261 }
2262 } else {
2263 let content = resp.text().await?;
2264 let entity: Option<GetAccountStatusV1Error> = serde_json::from_str(&content).ok();
2265 Err(Error::ResponseError(ResponseContent { status, content, entity }))
2266 }
2267}
2268
2269pub async fn get_asset_asset_detail_v1(configuration: &configuration::Configuration, params: GetAssetAssetDetailV1Params) -> Result<std::collections::HashMap<String, models::WalletGetAssetAssetDetailV1RespValue>, Error<GetAssetAssetDetailV1Error>> {
2271
2272 let uri_str = format!("{}/sapi/v1/asset/assetDetail", configuration.base_path);
2273 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2274
2275 let mut query_params: Vec<(String, String)> = Vec::new();
2277
2278 if let Some(ref param_value) = params.recv_window {
2279 query_params.push(("recvWindow".to_string(), param_value.to_string()));
2280 }
2281 query_params.push(("timestamp".to_string(), params.timestamp.to_string()));
2282
2283 let mut header_params = std::collections::HashMap::new();
2285
2286 if let Some(ref binance_auth) = configuration.binance_auth {
2288 header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
2290
2291 let body_string: Option<Vec<u8>> = None;
2293
2294 let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
2296 Ok(sig) => sig,
2297 Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
2298 };
2299
2300 query_params.push(("signature".to_string(), signature));
2302 }
2303
2304 if !query_params.is_empty() {
2306 req_builder = req_builder.query(&query_params);
2307 }
2308
2309
2310 if let Some(ref user_agent) = configuration.user_agent {
2312 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2313 }
2314
2315 for (header_name, header_value) in header_params {
2317 req_builder = req_builder.header(&header_name, &header_value);
2318 }
2319
2320
2321 let req = req_builder.build()?;
2322 let resp = configuration.client.execute(req).await?;
2323
2324 let status = resp.status();
2325 let content_type = resp
2326 .headers()
2327 .get("content-type")
2328 .and_then(|v| v.to_str().ok())
2329 .unwrap_or("application/octet-stream");
2330 let content_type = super::ContentType::from(content_type);
2331
2332 if !status.is_client_error() && !status.is_server_error() {
2333 let content = resp.text().await?;
2334 match content_type {
2335 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2336 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `std::collections::HashMap<String, models::WalletGetAssetAssetDetailV1RespValue>`"))),
2337 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `std::collections::HashMap<String, models::WalletGetAssetAssetDetailV1RespValue>`")))),
2338 }
2339 } else {
2340 let content = resp.text().await?;
2341 let entity: Option<GetAssetAssetDetailV1Error> = serde_json::from_str(&content).ok();
2342 Err(Error::ResponseError(ResponseContent { status, content, entity }))
2343 }
2344}
2345
2346pub async fn get_asset_asset_dividend_v1(configuration: &configuration::Configuration, params: GetAssetAssetDividendV1Params) -> Result<models::GetAssetAssetDividendV1Resp, Error<GetAssetAssetDividendV1Error>> {
2348
2349 let uri_str = format!("{}/sapi/v1/asset/assetDividend", configuration.base_path);
2350 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2351
2352 let mut query_params: Vec<(String, String)> = Vec::new();
2354
2355 if let Some(ref param_value) = params.asset {
2356 query_params.push(("asset".to_string(), param_value.to_string()));
2357 }
2358 if let Some(ref param_value) = params.start_time {
2359 query_params.push(("startTime".to_string(), param_value.to_string()));
2360 }
2361 if let Some(ref param_value) = params.end_time {
2362 query_params.push(("endTime".to_string(), param_value.to_string()));
2363 }
2364 if let Some(ref param_value) = params.limit {
2365 query_params.push(("limit".to_string(), param_value.to_string()));
2366 }
2367 if let Some(ref param_value) = params.recv_window {
2368 query_params.push(("recvWindow".to_string(), param_value.to_string()));
2369 }
2370 query_params.push(("timestamp".to_string(), params.timestamp.to_string()));
2371
2372 let mut header_params = std::collections::HashMap::new();
2374
2375 if let Some(ref binance_auth) = configuration.binance_auth {
2377 header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
2379
2380 let body_string: Option<Vec<u8>> = None;
2382
2383 let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
2385 Ok(sig) => sig,
2386 Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
2387 };
2388
2389 query_params.push(("signature".to_string(), signature));
2391 }
2392
2393 if !query_params.is_empty() {
2395 req_builder = req_builder.query(&query_params);
2396 }
2397
2398
2399 if let Some(ref user_agent) = configuration.user_agent {
2401 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2402 }
2403
2404 for (header_name, header_value) in header_params {
2406 req_builder = req_builder.header(&header_name, &header_value);
2407 }
2408
2409
2410 let req = req_builder.build()?;
2411 let resp = configuration.client.execute(req).await?;
2412
2413 let status = resp.status();
2414 let content_type = resp
2415 .headers()
2416 .get("content-type")
2417 .and_then(|v| v.to_str().ok())
2418 .unwrap_or("application/octet-stream");
2419 let content_type = super::ContentType::from(content_type);
2420
2421 if !status.is_client_error() && !status.is_server_error() {
2422 let content = resp.text().await?;
2423 match content_type {
2424 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2425 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetAssetAssetDividendV1Resp`"))),
2426 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetAssetAssetDividendV1Resp`")))),
2427 }
2428 } else {
2429 let content = resp.text().await?;
2430 let entity: Option<GetAssetAssetDividendV1Error> = serde_json::from_str(&content).ok();
2431 Err(Error::ResponseError(ResponseContent { status, content, entity }))
2432 }
2433}
2434
2435pub async fn get_asset_custody_transfer_history_v1(configuration: &configuration::Configuration, params: GetAssetCustodyTransferHistoryV1Params) -> Result<models::GetAssetCustodyTransferHistoryV1Resp, Error<GetAssetCustodyTransferHistoryV1Error>> {
2437
2438 let uri_str = format!("{}/sapi/v1/asset/custody/transfer-history", configuration.base_path);
2439 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2440
2441 let mut query_params: Vec<(String, String)> = Vec::new();
2443
2444 query_params.push(("email".to_string(), params.email.to_string()));
2445 query_params.push(("startTime".to_string(), params.start_time.to_string()));
2446 query_params.push(("endTime".to_string(), params.end_time.to_string()));
2447 if let Some(ref param_value) = params.r#type {
2448 query_params.push(("type".to_string(), param_value.to_string()));
2449 }
2450 if let Some(ref param_value) = params.asset {
2451 query_params.push(("asset".to_string(), param_value.to_string()));
2452 }
2453 if let Some(ref param_value) = params.current {
2454 query_params.push(("current".to_string(), param_value.to_string()));
2455 }
2456 if let Some(ref param_value) = params.size {
2457 query_params.push(("size".to_string(), param_value.to_string()));
2458 }
2459 if let Some(ref param_value) = params.recv_window {
2460 query_params.push(("recvWindow".to_string(), param_value.to_string()));
2461 }
2462 query_params.push(("timestamp".to_string(), params.timestamp.to_string()));
2463
2464 let mut header_params = std::collections::HashMap::new();
2466
2467 if let Some(ref binance_auth) = configuration.binance_auth {
2469 header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
2471
2472 let body_string: Option<Vec<u8>> = None;
2474
2475 let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
2477 Ok(sig) => sig,
2478 Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
2479 };
2480
2481 query_params.push(("signature".to_string(), signature));
2483 }
2484
2485 if !query_params.is_empty() {
2487 req_builder = req_builder.query(&query_params);
2488 }
2489
2490
2491 if let Some(ref user_agent) = configuration.user_agent {
2493 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2494 }
2495
2496 for (header_name, header_value) in header_params {
2498 req_builder = req_builder.header(&header_name, &header_value);
2499 }
2500
2501
2502 let req = req_builder.build()?;
2503 let resp = configuration.client.execute(req).await?;
2504
2505 let status = resp.status();
2506 let content_type = resp
2507 .headers()
2508 .get("content-type")
2509 .and_then(|v| v.to_str().ok())
2510 .unwrap_or("application/octet-stream");
2511 let content_type = super::ContentType::from(content_type);
2512
2513 if !status.is_client_error() && !status.is_server_error() {
2514 let content = resp.text().await?;
2515 match content_type {
2516 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2517 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetAssetCustodyTransferHistoryV1Resp`"))),
2518 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetAssetCustodyTransferHistoryV1Resp`")))),
2519 }
2520 } else {
2521 let content = resp.text().await?;
2522 let entity: Option<GetAssetCustodyTransferHistoryV1Error> = serde_json::from_str(&content).ok();
2523 Err(Error::ResponseError(ResponseContent { status, content, entity }))
2524 }
2525}
2526
2527pub async fn get_asset_dribblet_v1(configuration: &configuration::Configuration, params: GetAssetDribbletV1Params) -> Result<models::GetAssetDribbletV1Resp, Error<GetAssetDribbletV1Error>> {
2529
2530 let uri_str = format!("{}/sapi/v1/asset/dribblet", configuration.base_path);
2531 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2532
2533 let mut query_params: Vec<(String, String)> = Vec::new();
2535
2536 if let Some(ref param_value) = params.start_time {
2537 query_params.push(("startTime".to_string(), param_value.to_string()));
2538 }
2539 if let Some(ref param_value) = params.end_time {
2540 query_params.push(("endTime".to_string(), param_value.to_string()));
2541 }
2542 if let Some(ref param_value) = params.recv_window {
2543 query_params.push(("recvWindow".to_string(), param_value.to_string()));
2544 }
2545 query_params.push(("timestamp".to_string(), params.timestamp.to_string()));
2546
2547 let mut header_params = std::collections::HashMap::new();
2549
2550 if let Some(ref binance_auth) = configuration.binance_auth {
2552 header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
2554
2555 let body_string: Option<Vec<u8>> = None;
2557
2558 let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
2560 Ok(sig) => sig,
2561 Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
2562 };
2563
2564 query_params.push(("signature".to_string(), signature));
2566 }
2567
2568 if !query_params.is_empty() {
2570 req_builder = req_builder.query(&query_params);
2571 }
2572
2573
2574 if let Some(ref user_agent) = configuration.user_agent {
2576 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2577 }
2578
2579 for (header_name, header_value) in header_params {
2581 req_builder = req_builder.header(&header_name, &header_value);
2582 }
2583
2584
2585 let req = req_builder.build()?;
2586 let resp = configuration.client.execute(req).await?;
2587
2588 let status = resp.status();
2589 let content_type = resp
2590 .headers()
2591 .get("content-type")
2592 .and_then(|v| v.to_str().ok())
2593 .unwrap_or("application/octet-stream");
2594 let content_type = super::ContentType::from(content_type);
2595
2596 if !status.is_client_error() && !status.is_server_error() {
2597 let content = resp.text().await?;
2598 match content_type {
2599 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2600 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetAssetDribbletV1Resp`"))),
2601 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetAssetDribbletV1Resp`")))),
2602 }
2603 } else {
2604 let content = resp.text().await?;
2605 let entity: Option<GetAssetDribbletV1Error> = serde_json::from_str(&content).ok();
2606 Err(Error::ResponseError(ResponseContent { status, content, entity }))
2607 }
2608}
2609
2610pub async fn get_asset_ledger_transfer_cloud_mining_query_by_page_v1(configuration: &configuration::Configuration, params: GetAssetLedgerTransferCloudMiningQueryByPageV1Params) -> Result<models::GetAssetLedgerTransferCloudMiningQueryByPageV1Resp, Error<GetAssetLedgerTransferCloudMiningQueryByPageV1Error>> {
2612
2613 let uri_str = format!("{}/sapi/v1/asset/ledger-transfer/cloud-mining/queryByPage", configuration.base_path);
2614 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2615
2616 let mut query_params: Vec<(String, String)> = Vec::new();
2618
2619 if let Some(ref param_value) = params.tran_id {
2620 query_params.push(("tranId".to_string(), param_value.to_string()));
2621 }
2622 if let Some(ref param_value) = params.client_tran_id {
2623 query_params.push(("clientTranId".to_string(), param_value.to_string()));
2624 }
2625 if let Some(ref param_value) = params.asset {
2626 query_params.push(("asset".to_string(), param_value.to_string()));
2627 }
2628 query_params.push(("startTime".to_string(), params.start_time.to_string()));
2629 query_params.push(("endTime".to_string(), params.end_time.to_string()));
2630 if let Some(ref param_value) = params.current {
2631 query_params.push(("current".to_string(), param_value.to_string()));
2632 }
2633 if let Some(ref param_value) = params.size {
2634 query_params.push(("size".to_string(), param_value.to_string()));
2635 }
2636
2637 let mut header_params = std::collections::HashMap::new();
2639
2640 if let Some(ref binance_auth) = configuration.binance_auth {
2642 header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
2644
2645 let body_string: Option<Vec<u8>> = None;
2647
2648 let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
2650 Ok(sig) => sig,
2651 Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
2652 };
2653
2654 query_params.push(("signature".to_string(), signature));
2656 }
2657
2658 if !query_params.is_empty() {
2660 req_builder = req_builder.query(&query_params);
2661 }
2662
2663
2664 if let Some(ref user_agent) = configuration.user_agent {
2666 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2667 }
2668
2669 for (header_name, header_value) in header_params {
2671 req_builder = req_builder.header(&header_name, &header_value);
2672 }
2673
2674
2675 let req = req_builder.build()?;
2676 let resp = configuration.client.execute(req).await?;
2677
2678 let status = resp.status();
2679 let content_type = resp
2680 .headers()
2681 .get("content-type")
2682 .and_then(|v| v.to_str().ok())
2683 .unwrap_or("application/octet-stream");
2684 let content_type = super::ContentType::from(content_type);
2685
2686 if !status.is_client_error() && !status.is_server_error() {
2687 let content = resp.text().await?;
2688 match content_type {
2689 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2690 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetAssetLedgerTransferCloudMiningQueryByPageV1Resp`"))),
2691 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetAssetLedgerTransferCloudMiningQueryByPageV1Resp`")))),
2692 }
2693 } else {
2694 let content = resp.text().await?;
2695 let entity: Option<GetAssetLedgerTransferCloudMiningQueryByPageV1Error> = serde_json::from_str(&content).ok();
2696 Err(Error::ResponseError(ResponseContent { status, content, entity }))
2697 }
2698}
2699
2700pub async fn get_asset_trade_fee_v1(configuration: &configuration::Configuration, params: GetAssetTradeFeeV1Params) -> Result<Vec<models::GetAssetTradeFeeV1RespItem>, Error<GetAssetTradeFeeV1Error>> {
2702
2703 let uri_str = format!("{}/sapi/v1/asset/tradeFee", configuration.base_path);
2704 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2705
2706 let mut query_params: Vec<(String, String)> = Vec::new();
2708
2709 if let Some(ref param_value) = params.symbol {
2710 query_params.push(("symbol".to_string(), param_value.to_string()));
2711 }
2712 if let Some(ref param_value) = params.recv_window {
2713 query_params.push(("recvWindow".to_string(), param_value.to_string()));
2714 }
2715 query_params.push(("timestamp".to_string(), params.timestamp.to_string()));
2716
2717 let mut header_params = std::collections::HashMap::new();
2719
2720 if let Some(ref binance_auth) = configuration.binance_auth {
2722 header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
2724
2725 let body_string: Option<Vec<u8>> = None;
2727
2728 let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
2730 Ok(sig) => sig,
2731 Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
2732 };
2733
2734 query_params.push(("signature".to_string(), signature));
2736 }
2737
2738 if !query_params.is_empty() {
2740 req_builder = req_builder.query(&query_params);
2741 }
2742
2743
2744 if let Some(ref user_agent) = configuration.user_agent {
2746 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2747 }
2748
2749 for (header_name, header_value) in header_params {
2751 req_builder = req_builder.header(&header_name, &header_value);
2752 }
2753
2754
2755 let req = req_builder.build()?;
2756 let resp = configuration.client.execute(req).await?;
2757
2758 let status = resp.status();
2759 let content_type = resp
2760 .headers()
2761 .get("content-type")
2762 .and_then(|v| v.to_str().ok())
2763 .unwrap_or("application/octet-stream");
2764 let content_type = super::ContentType::from(content_type);
2765
2766 if !status.is_client_error() && !status.is_server_error() {
2767 let content = resp.text().await?;
2768 match content_type {
2769 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2770 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::GetAssetTradeFeeV1RespItem>`"))),
2771 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::GetAssetTradeFeeV1RespItem>`")))),
2772 }
2773 } else {
2774 let content = resp.text().await?;
2775 let entity: Option<GetAssetTradeFeeV1Error> = serde_json::from_str(&content).ok();
2776 Err(Error::ResponseError(ResponseContent { status, content, entity }))
2777 }
2778}
2779
2780pub async fn get_asset_transfer_v1(configuration: &configuration::Configuration, params: GetAssetTransferV1Params) -> Result<models::GetAssetTransferV1Resp, Error<GetAssetTransferV1Error>> {
2782
2783 let uri_str = format!("{}/sapi/v1/asset/transfer", configuration.base_path);
2784 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2785
2786 let mut query_params: Vec<(String, String)> = Vec::new();
2788
2789 query_params.push(("type".to_string(), params.r#type.to_string()));
2790 if let Some(ref param_value) = params.start_time {
2791 query_params.push(("startTime".to_string(), param_value.to_string()));
2792 }
2793 if let Some(ref param_value) = params.end_time {
2794 query_params.push(("endTime".to_string(), param_value.to_string()));
2795 }
2796 if let Some(ref param_value) = params.current {
2797 query_params.push(("current".to_string(), param_value.to_string()));
2798 }
2799 if let Some(ref param_value) = params.size {
2800 query_params.push(("size".to_string(), param_value.to_string()));
2801 }
2802 if let Some(ref param_value) = params.from_symbol {
2803 query_params.push(("fromSymbol".to_string(), param_value.to_string()));
2804 }
2805 if let Some(ref param_value) = params.to_symbol {
2806 query_params.push(("toSymbol".to_string(), param_value.to_string()));
2807 }
2808 if let Some(ref param_value) = params.recv_window {
2809 query_params.push(("recvWindow".to_string(), param_value.to_string()));
2810 }
2811 query_params.push(("timestamp".to_string(), params.timestamp.to_string()));
2812
2813 let mut header_params = std::collections::HashMap::new();
2815
2816 if let Some(ref binance_auth) = configuration.binance_auth {
2818 header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
2820
2821 let body_string: Option<Vec<u8>> = None;
2823
2824 let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
2826 Ok(sig) => sig,
2827 Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
2828 };
2829
2830 query_params.push(("signature".to_string(), signature));
2832 }
2833
2834 if !query_params.is_empty() {
2836 req_builder = req_builder.query(&query_params);
2837 }
2838
2839
2840 if let Some(ref user_agent) = configuration.user_agent {
2842 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2843 }
2844
2845 for (header_name, header_value) in header_params {
2847 req_builder = req_builder.header(&header_name, &header_value);
2848 }
2849
2850
2851 let req = req_builder.build()?;
2852 let resp = configuration.client.execute(req).await?;
2853
2854 let status = resp.status();
2855 let content_type = resp
2856 .headers()
2857 .get("content-type")
2858 .and_then(|v| v.to_str().ok())
2859 .unwrap_or("application/octet-stream");
2860 let content_type = super::ContentType::from(content_type);
2861
2862 if !status.is_client_error() && !status.is_server_error() {
2863 let content = resp.text().await?;
2864 match content_type {
2865 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2866 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetAssetTransferV1Resp`"))),
2867 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetAssetTransferV1Resp`")))),
2868 }
2869 } else {
2870 let content = resp.text().await?;
2871 let entity: Option<GetAssetTransferV1Error> = serde_json::from_str(&content).ok();
2872 Err(Error::ResponseError(ResponseContent { status, content, entity }))
2873 }
2874}
2875
2876pub async fn get_asset_wallet_balance_v1(configuration: &configuration::Configuration, params: GetAssetWalletBalanceV1Params) -> Result<Vec<models::GetAssetWalletBalanceV1RespItem>, Error<GetAssetWalletBalanceV1Error>> {
2878
2879 let uri_str = format!("{}/sapi/v1/asset/wallet/balance", configuration.base_path);
2880 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2881
2882 let mut query_params: Vec<(String, String)> = Vec::new();
2884
2885 if let Some(ref param_value) = params.quote_asset {
2886 query_params.push(("quoteAsset".to_string(), param_value.to_string()));
2887 }
2888 if let Some(ref param_value) = params.recv_window {
2889 query_params.push(("recvWindow".to_string(), param_value.to_string()));
2890 }
2891 query_params.push(("timestamp".to_string(), params.timestamp.to_string()));
2892
2893 let mut header_params = std::collections::HashMap::new();
2895
2896 if let Some(ref binance_auth) = configuration.binance_auth {
2898 header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
2900
2901 let body_string: Option<Vec<u8>> = None;
2903
2904 let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
2906 Ok(sig) => sig,
2907 Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
2908 };
2909
2910 query_params.push(("signature".to_string(), signature));
2912 }
2913
2914 if !query_params.is_empty() {
2916 req_builder = req_builder.query(&query_params);
2917 }
2918
2919
2920 if let Some(ref user_agent) = configuration.user_agent {
2922 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2923 }
2924
2925 for (header_name, header_value) in header_params {
2927 req_builder = req_builder.header(&header_name, &header_value);
2928 }
2929
2930
2931 let req = req_builder.build()?;
2932 let resp = configuration.client.execute(req).await?;
2933
2934 let status = resp.status();
2935 let content_type = resp
2936 .headers()
2937 .get("content-type")
2938 .and_then(|v| v.to_str().ok())
2939 .unwrap_or("application/octet-stream");
2940 let content_type = super::ContentType::from(content_type);
2941
2942 if !status.is_client_error() && !status.is_server_error() {
2943 let content = resp.text().await?;
2944 match content_type {
2945 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2946 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::GetAssetWalletBalanceV1RespItem>`"))),
2947 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::GetAssetWalletBalanceV1RespItem>`")))),
2948 }
2949 } else {
2950 let content = resp.text().await?;
2951 let entity: Option<GetAssetWalletBalanceV1Error> = serde_json::from_str(&content).ok();
2952 Err(Error::ResponseError(ResponseContent { status, content, entity }))
2953 }
2954}
2955
2956pub async fn get_capital_config_getall_v1(configuration: &configuration::Configuration, params: GetCapitalConfigGetallV1Params) -> Result<Vec<models::GetCapitalConfigGetallV1RespItem>, Error<GetCapitalConfigGetallV1Error>> {
2958
2959 let uri_str = format!("{}/sapi/v1/capital/config/getall", configuration.base_path);
2960 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2961
2962 let mut query_params: Vec<(String, String)> = Vec::new();
2964
2965 if let Some(ref param_value) = params.recv_window {
2966 query_params.push(("recvWindow".to_string(), param_value.to_string()));
2967 }
2968 query_params.push(("timestamp".to_string(), params.timestamp.to_string()));
2969
2970 let mut header_params = std::collections::HashMap::new();
2972
2973 if let Some(ref binance_auth) = configuration.binance_auth {
2975 header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
2977
2978 let body_string: Option<Vec<u8>> = None;
2980
2981 let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
2983 Ok(sig) => sig,
2984 Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
2985 };
2986
2987 query_params.push(("signature".to_string(), signature));
2989 }
2990
2991 if !query_params.is_empty() {
2993 req_builder = req_builder.query(&query_params);
2994 }
2995
2996
2997 if let Some(ref user_agent) = configuration.user_agent {
2999 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3000 }
3001
3002 for (header_name, header_value) in header_params {
3004 req_builder = req_builder.header(&header_name, &header_value);
3005 }
3006
3007
3008 let req = req_builder.build()?;
3009 let resp = configuration.client.execute(req).await?;
3010
3011 let status = resp.status();
3012 let content_type = resp
3013 .headers()
3014 .get("content-type")
3015 .and_then(|v| v.to_str().ok())
3016 .unwrap_or("application/octet-stream");
3017 let content_type = super::ContentType::from(content_type);
3018
3019 if !status.is_client_error() && !status.is_server_error() {
3020 let content = resp.text().await?;
3021 match content_type {
3022 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3023 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::GetCapitalConfigGetallV1RespItem>`"))),
3024 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::GetCapitalConfigGetallV1RespItem>`")))),
3025 }
3026 } else {
3027 let content = resp.text().await?;
3028 let entity: Option<GetCapitalConfigGetallV1Error> = serde_json::from_str(&content).ok();
3029 Err(Error::ResponseError(ResponseContent { status, content, entity }))
3030 }
3031}
3032
3033pub async fn get_capital_deposit_address_list_v1(configuration: &configuration::Configuration, params: GetCapitalDepositAddressListV1Params) -> Result<Vec<models::GetCapitalDepositAddressListV1RespItem>, Error<GetCapitalDepositAddressListV1Error>> {
3035
3036 let uri_str = format!("{}/sapi/v1/capital/deposit/address/list", configuration.base_path);
3037 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3038
3039 let mut query_params: Vec<(String, String)> = Vec::new();
3041
3042 query_params.push(("coin".to_string(), params.coin.to_string()));
3043 if let Some(ref param_value) = params.network {
3044 query_params.push(("network".to_string(), param_value.to_string()));
3045 }
3046 query_params.push(("timestamp".to_string(), params.timestamp.to_string()));
3047
3048 let mut header_params = std::collections::HashMap::new();
3050
3051 if let Some(ref binance_auth) = configuration.binance_auth {
3053 header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
3055
3056 let body_string: Option<Vec<u8>> = None;
3058
3059 let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
3061 Ok(sig) => sig,
3062 Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
3063 };
3064
3065 query_params.push(("signature".to_string(), signature));
3067 }
3068
3069 if !query_params.is_empty() {
3071 req_builder = req_builder.query(&query_params);
3072 }
3073
3074
3075 if let Some(ref user_agent) = configuration.user_agent {
3077 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3078 }
3079
3080 for (header_name, header_value) in header_params {
3082 req_builder = req_builder.header(&header_name, &header_value);
3083 }
3084
3085
3086 let req = req_builder.build()?;
3087 let resp = configuration.client.execute(req).await?;
3088
3089 let status = resp.status();
3090 let content_type = resp
3091 .headers()
3092 .get("content-type")
3093 .and_then(|v| v.to_str().ok())
3094 .unwrap_or("application/octet-stream");
3095 let content_type = super::ContentType::from(content_type);
3096
3097 if !status.is_client_error() && !status.is_server_error() {
3098 let content = resp.text().await?;
3099 match content_type {
3100 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3101 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::GetCapitalDepositAddressListV1RespItem>`"))),
3102 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::GetCapitalDepositAddressListV1RespItem>`")))),
3103 }
3104 } else {
3105 let content = resp.text().await?;
3106 let entity: Option<GetCapitalDepositAddressListV1Error> = serde_json::from_str(&content).ok();
3107 Err(Error::ResponseError(ResponseContent { status, content, entity }))
3108 }
3109}
3110
3111pub async fn get_capital_deposit_address_v1(configuration: &configuration::Configuration, params: GetCapitalDepositAddressV1Params) -> Result<models::GetCapitalDepositAddressV1Resp, Error<GetCapitalDepositAddressV1Error>> {
3113
3114 let uri_str = format!("{}/sapi/v1/capital/deposit/address", configuration.base_path);
3115 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3116
3117 let mut query_params: Vec<(String, String)> = Vec::new();
3119
3120 query_params.push(("coin".to_string(), params.coin.to_string()));
3121 if let Some(ref param_value) = params.network {
3122 query_params.push(("network".to_string(), param_value.to_string()));
3123 }
3124 if let Some(ref param_value) = params.amount {
3125 query_params.push(("amount".to_string(), param_value.to_string()));
3126 }
3127 if let Some(ref param_value) = params.recv_window {
3128 query_params.push(("recvWindow".to_string(), param_value.to_string()));
3129 }
3130 query_params.push(("timestamp".to_string(), params.timestamp.to_string()));
3131
3132 let mut header_params = std::collections::HashMap::new();
3134
3135 if let Some(ref binance_auth) = configuration.binance_auth {
3137 header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
3139
3140 let body_string: Option<Vec<u8>> = None;
3142
3143 let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
3145 Ok(sig) => sig,
3146 Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
3147 };
3148
3149 query_params.push(("signature".to_string(), signature));
3151 }
3152
3153 if !query_params.is_empty() {
3155 req_builder = req_builder.query(&query_params);
3156 }
3157
3158
3159 if let Some(ref user_agent) = configuration.user_agent {
3161 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3162 }
3163
3164 for (header_name, header_value) in header_params {
3166 req_builder = req_builder.header(&header_name, &header_value);
3167 }
3168
3169
3170 let req = req_builder.build()?;
3171 let resp = configuration.client.execute(req).await?;
3172
3173 let status = resp.status();
3174 let content_type = resp
3175 .headers()
3176 .get("content-type")
3177 .and_then(|v| v.to_str().ok())
3178 .unwrap_or("application/octet-stream");
3179 let content_type = super::ContentType::from(content_type);
3180
3181 if !status.is_client_error() && !status.is_server_error() {
3182 let content = resp.text().await?;
3183 match content_type {
3184 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3185 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetCapitalDepositAddressV1Resp`"))),
3186 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetCapitalDepositAddressV1Resp`")))),
3187 }
3188 } else {
3189 let content = resp.text().await?;
3190 let entity: Option<GetCapitalDepositAddressV1Error> = serde_json::from_str(&content).ok();
3191 Err(Error::ResponseError(ResponseContent { status, content, entity }))
3192 }
3193}
3194
3195pub async fn get_capital_deposit_hisrec_v1(configuration: &configuration::Configuration, params: GetCapitalDepositHisrecV1Params) -> Result<Vec<models::GetCapitalDepositHisrecV1RespItem>, Error<GetCapitalDepositHisrecV1Error>> {
3197
3198 let uri_str = format!("{}/sapi/v1/capital/deposit/hisrec", configuration.base_path);
3199 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3200
3201 let mut query_params: Vec<(String, String)> = Vec::new();
3203
3204 if let Some(ref param_value) = params.include_source {
3205 query_params.push(("includeSource".to_string(), param_value.to_string()));
3206 }
3207 if let Some(ref param_value) = params.coin {
3208 query_params.push(("coin".to_string(), param_value.to_string()));
3209 }
3210 if let Some(ref param_value) = params.status {
3211 query_params.push(("status".to_string(), param_value.to_string()));
3212 }
3213 if let Some(ref param_value) = params.start_time {
3214 query_params.push(("startTime".to_string(), param_value.to_string()));
3215 }
3216 if let Some(ref param_value) = params.end_time {
3217 query_params.push(("endTime".to_string(), param_value.to_string()));
3218 }
3219 if let Some(ref param_value) = params.offset {
3220 query_params.push(("offset".to_string(), param_value.to_string()));
3221 }
3222 if let Some(ref param_value) = params.limit {
3223 query_params.push(("limit".to_string(), param_value.to_string()));
3224 }
3225 if let Some(ref param_value) = params.recv_window {
3226 query_params.push(("recvWindow".to_string(), param_value.to_string()));
3227 }
3228 query_params.push(("timestamp".to_string(), params.timestamp.to_string()));
3229 if let Some(ref param_value) = params.tx_id {
3230 query_params.push(("txId".to_string(), param_value.to_string()));
3231 }
3232
3233 let mut header_params = std::collections::HashMap::new();
3235
3236 if let Some(ref binance_auth) = configuration.binance_auth {
3238 header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
3240
3241 let body_string: Option<Vec<u8>> = None;
3243
3244 let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
3246 Ok(sig) => sig,
3247 Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
3248 };
3249
3250 query_params.push(("signature".to_string(), signature));
3252 }
3253
3254 if !query_params.is_empty() {
3256 req_builder = req_builder.query(&query_params);
3257 }
3258
3259
3260 if let Some(ref user_agent) = configuration.user_agent {
3262 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3263 }
3264
3265 for (header_name, header_value) in header_params {
3267 req_builder = req_builder.header(&header_name, &header_value);
3268 }
3269
3270
3271 let req = req_builder.build()?;
3272 let resp = configuration.client.execute(req).await?;
3273
3274 let status = resp.status();
3275 let content_type = resp
3276 .headers()
3277 .get("content-type")
3278 .and_then(|v| v.to_str().ok())
3279 .unwrap_or("application/octet-stream");
3280 let content_type = super::ContentType::from(content_type);
3281
3282 if !status.is_client_error() && !status.is_server_error() {
3283 let content = resp.text().await?;
3284 match content_type {
3285 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3286 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::GetCapitalDepositHisrecV1RespItem>`"))),
3287 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::GetCapitalDepositHisrecV1RespItem>`")))),
3288 }
3289 } else {
3290 let content = resp.text().await?;
3291 let entity: Option<GetCapitalDepositHisrecV1Error> = serde_json::from_str(&content).ok();
3292 Err(Error::ResponseError(ResponseContent { status, content, entity }))
3293 }
3294}
3295
3296pub async fn get_capital_withdraw_address_list_v1(configuration: &configuration::Configuration) -> Result<Vec<models::GetCapitalWithdrawAddressListV1RespItem>, Error<GetCapitalWithdrawAddressListV1Error>> {
3298
3299 let uri_str = format!("{}/sapi/v1/capital/withdraw/address/list", configuration.base_path);
3300 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3301
3302 let mut query_params: Vec<(String, String)> = Vec::new();
3304
3305
3306 let mut header_params = std::collections::HashMap::new();
3308
3309 if let Some(ref binance_auth) = configuration.binance_auth {
3311 header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
3313
3314 let body_string: Option<Vec<u8>> = None;
3316
3317 let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
3319 Ok(sig) => sig,
3320 Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
3321 };
3322
3323 query_params.push(("signature".to_string(), signature));
3325 }
3326
3327 if !query_params.is_empty() {
3329 req_builder = req_builder.query(&query_params);
3330 }
3331
3332
3333 if let Some(ref user_agent) = configuration.user_agent {
3335 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3336 }
3337
3338 for (header_name, header_value) in header_params {
3340 req_builder = req_builder.header(&header_name, &header_value);
3341 }
3342
3343
3344 let req = req_builder.build()?;
3345 let resp = configuration.client.execute(req).await?;
3346
3347 let status = resp.status();
3348 let content_type = resp
3349 .headers()
3350 .get("content-type")
3351 .and_then(|v| v.to_str().ok())
3352 .unwrap_or("application/octet-stream");
3353 let content_type = super::ContentType::from(content_type);
3354
3355 if !status.is_client_error() && !status.is_server_error() {
3356 let content = resp.text().await?;
3357 match content_type {
3358 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3359 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::GetCapitalWithdrawAddressListV1RespItem>`"))),
3360 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::GetCapitalWithdrawAddressListV1RespItem>`")))),
3361 }
3362 } else {
3363 let content = resp.text().await?;
3364 let entity: Option<GetCapitalWithdrawAddressListV1Error> = serde_json::from_str(&content).ok();
3365 Err(Error::ResponseError(ResponseContent { status, content, entity }))
3366 }
3367}
3368
3369pub async fn get_capital_withdraw_history_v1(configuration: &configuration::Configuration, params: GetCapitalWithdrawHistoryV1Params) -> Result<Vec<models::GetCapitalWithdrawHistoryV1RespItem>, Error<GetCapitalWithdrawHistoryV1Error>> {
3371
3372 let uri_str = format!("{}/sapi/v1/capital/withdraw/history", configuration.base_path);
3373 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3374
3375 let mut query_params: Vec<(String, String)> = Vec::new();
3377
3378 if let Some(ref param_value) = params.coin {
3379 query_params.push(("coin".to_string(), param_value.to_string()));
3380 }
3381 if let Some(ref param_value) = params.withdraw_order_id {
3382 query_params.push(("withdrawOrderId".to_string(), param_value.to_string()));
3383 }
3384 if let Some(ref param_value) = params.status {
3385 query_params.push(("status".to_string(), param_value.to_string()));
3386 }
3387 if let Some(ref param_value) = params.offset {
3388 query_params.push(("offset".to_string(), param_value.to_string()));
3389 }
3390 if let Some(ref param_value) = params.limit {
3391 query_params.push(("limit".to_string(), param_value.to_string()));
3392 }
3393 if let Some(ref param_value) = params.id_list {
3394 query_params.push(("idList".to_string(), param_value.to_string()));
3395 }
3396 if let Some(ref param_value) = params.start_time {
3397 query_params.push(("startTime".to_string(), param_value.to_string()));
3398 }
3399 if let Some(ref param_value) = params.end_time {
3400 query_params.push(("endTime".to_string(), param_value.to_string()));
3401 }
3402 if let Some(ref param_value) = params.recv_window {
3403 query_params.push(("recvWindow".to_string(), param_value.to_string()));
3404 }
3405 query_params.push(("timestamp".to_string(), params.timestamp.to_string()));
3406
3407 let mut header_params = std::collections::HashMap::new();
3409
3410 if let Some(ref binance_auth) = configuration.binance_auth {
3412 header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
3414
3415 let body_string: Option<Vec<u8>> = None;
3417
3418 let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
3420 Ok(sig) => sig,
3421 Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
3422 };
3423
3424 query_params.push(("signature".to_string(), signature));
3426 }
3427
3428 if !query_params.is_empty() {
3430 req_builder = req_builder.query(&query_params);
3431 }
3432
3433
3434 if let Some(ref user_agent) = configuration.user_agent {
3436 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3437 }
3438
3439 for (header_name, header_value) in header_params {
3441 req_builder = req_builder.header(&header_name, &header_value);
3442 }
3443
3444
3445 let req = req_builder.build()?;
3446 let resp = configuration.client.execute(req).await?;
3447
3448 let status = resp.status();
3449 let content_type = resp
3450 .headers()
3451 .get("content-type")
3452 .and_then(|v| v.to_str().ok())
3453 .unwrap_or("application/octet-stream");
3454 let content_type = super::ContentType::from(content_type);
3455
3456 if !status.is_client_error() && !status.is_server_error() {
3457 let content = resp.text().await?;
3458 match content_type {
3459 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3460 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::GetCapitalWithdrawHistoryV1RespItem>`"))),
3461 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::GetCapitalWithdrawHistoryV1RespItem>`")))),
3462 }
3463 } else {
3464 let content = resp.text().await?;
3465 let entity: Option<GetCapitalWithdrawHistoryV1Error> = serde_json::from_str(&content).ok();
3466 Err(Error::ResponseError(ResponseContent { status, content, entity }))
3467 }
3468}
3469
3470pub async fn get_localentity_deposit_history_v1(configuration: &configuration::Configuration, params: GetLocalentityDepositHistoryV1Params) -> Result<Vec<models::GetLocalentityDepositHistoryV1RespItem>, Error<GetLocalentityDepositHistoryV1Error>> {
3472
3473 let uri_str = format!("{}/sapi/v1/localentity/deposit/history", configuration.base_path);
3474 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3475
3476 let mut query_params: Vec<(String, String)> = Vec::new();
3478
3479 if let Some(ref param_value) = params.tr_id {
3480 query_params.push(("trId".to_string(), param_value.to_string()));
3481 }
3482 if let Some(ref param_value) = params.tx_id {
3483 query_params.push(("txId".to_string(), param_value.to_string()));
3484 }
3485 if let Some(ref param_value) = params.tran_id {
3486 query_params.push(("tranId".to_string(), param_value.to_string()));
3487 }
3488 if let Some(ref param_value) = params.network {
3489 query_params.push(("network".to_string(), param_value.to_string()));
3490 }
3491 if let Some(ref param_value) = params.coin {
3492 query_params.push(("coin".to_string(), param_value.to_string()));
3493 }
3494 if let Some(ref param_value) = params.travel_rule_status {
3495 query_params.push(("travelRuleStatus".to_string(), param_value.to_string()));
3496 }
3497 if let Some(ref param_value) = params.pending_questionnaire {
3498 query_params.push(("pendingQuestionnaire".to_string(), param_value.to_string()));
3499 }
3500 if let Some(ref param_value) = params.start_time {
3501 query_params.push(("startTime".to_string(), param_value.to_string()));
3502 }
3503 if let Some(ref param_value) = params.end_time {
3504 query_params.push(("endTime".to_string(), param_value.to_string()));
3505 }
3506 if let Some(ref param_value) = params.offset {
3507 query_params.push(("offset".to_string(), param_value.to_string()));
3508 }
3509 if let Some(ref param_value) = params.limit {
3510 query_params.push(("limit".to_string(), param_value.to_string()));
3511 }
3512 query_params.push(("timestamp".to_string(), params.timestamp.to_string()));
3513
3514 let mut header_params = std::collections::HashMap::new();
3516
3517 if let Some(ref binance_auth) = configuration.binance_auth {
3519 header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
3521
3522 let body_string: Option<Vec<u8>> = None;
3524
3525 let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
3527 Ok(sig) => sig,
3528 Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
3529 };
3530
3531 query_params.push(("signature".to_string(), signature));
3533 }
3534
3535 if !query_params.is_empty() {
3537 req_builder = req_builder.query(&query_params);
3538 }
3539
3540
3541 if let Some(ref user_agent) = configuration.user_agent {
3543 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3544 }
3545
3546 for (header_name, header_value) in header_params {
3548 req_builder = req_builder.header(&header_name, &header_value);
3549 }
3550
3551
3552 let req = req_builder.build()?;
3553 let resp = configuration.client.execute(req).await?;
3554
3555 let status = resp.status();
3556 let content_type = resp
3557 .headers()
3558 .get("content-type")
3559 .and_then(|v| v.to_str().ok())
3560 .unwrap_or("application/octet-stream");
3561 let content_type = super::ContentType::from(content_type);
3562
3563 if !status.is_client_error() && !status.is_server_error() {
3564 let content = resp.text().await?;
3565 match content_type {
3566 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3567 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::GetLocalentityDepositHistoryV1RespItem>`"))),
3568 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::GetLocalentityDepositHistoryV1RespItem>`")))),
3569 }
3570 } else {
3571 let content = resp.text().await?;
3572 let entity: Option<GetLocalentityDepositHistoryV1Error> = serde_json::from_str(&content).ok();
3573 Err(Error::ResponseError(ResponseContent { status, content, entity }))
3574 }
3575}
3576
3577pub async fn get_localentity_vasp_v1(configuration: &configuration::Configuration) -> Result<Vec<models::GetLocalentityVaspV1RespItem>, Error<GetLocalentityVaspV1Error>> {
3579
3580 let uri_str = format!("{}/sapi/v1/localentity/vasp", configuration.base_path);
3581 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3582
3583 let mut query_params: Vec<(String, String)> = Vec::new();
3585
3586
3587 let mut header_params = std::collections::HashMap::new();
3589
3590 if let Some(ref binance_auth) = configuration.binance_auth {
3592 header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
3594
3595 let body_string: Option<Vec<u8>> = None;
3597
3598 let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
3600 Ok(sig) => sig,
3601 Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
3602 };
3603
3604 query_params.push(("signature".to_string(), signature));
3606 }
3607
3608 if !query_params.is_empty() {
3610 req_builder = req_builder.query(&query_params);
3611 }
3612
3613
3614 if let Some(ref user_agent) = configuration.user_agent {
3616 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3617 }
3618
3619 for (header_name, header_value) in header_params {
3621 req_builder = req_builder.header(&header_name, &header_value);
3622 }
3623
3624
3625 let req = req_builder.build()?;
3626 let resp = configuration.client.execute(req).await?;
3627
3628 let status = resp.status();
3629 let content_type = resp
3630 .headers()
3631 .get("content-type")
3632 .and_then(|v| v.to_str().ok())
3633 .unwrap_or("application/octet-stream");
3634 let content_type = super::ContentType::from(content_type);
3635
3636 if !status.is_client_error() && !status.is_server_error() {
3637 let content = resp.text().await?;
3638 match content_type {
3639 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3640 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::GetLocalentityVaspV1RespItem>`"))),
3641 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::GetLocalentityVaspV1RespItem>`")))),
3642 }
3643 } else {
3644 let content = resp.text().await?;
3645 let entity: Option<GetLocalentityVaspV1Error> = serde_json::from_str(&content).ok();
3646 Err(Error::ResponseError(ResponseContent { status, content, entity }))
3647 }
3648}
3649
3650pub async fn get_localentity_withdraw_history_v1(configuration: &configuration::Configuration, params: GetLocalentityWithdrawHistoryV1Params) -> Result<Vec<models::GetLocalentityWithdrawHistoryV1RespItem>, Error<GetLocalentityWithdrawHistoryV1Error>> {
3652
3653 let uri_str = format!("{}/sapi/v1/localentity/withdraw/history", configuration.base_path);
3654 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3655
3656 let mut query_params: Vec<(String, String)> = Vec::new();
3658
3659 if let Some(ref param_value) = params.tr_id {
3660 query_params.push(("trId".to_string(), param_value.to_string()));
3661 }
3662 if let Some(ref param_value) = params.tx_id {
3663 query_params.push(("txId".to_string(), param_value.to_string()));
3664 }
3665 if let Some(ref param_value) = params.withdraw_order_id {
3666 query_params.push(("withdrawOrderId".to_string(), param_value.to_string()));
3667 }
3668 if let Some(ref param_value) = params.network {
3669 query_params.push(("network".to_string(), param_value.to_string()));
3670 }
3671 if let Some(ref param_value) = params.coin {
3672 query_params.push(("coin".to_string(), param_value.to_string()));
3673 }
3674 if let Some(ref param_value) = params.travel_rule_status {
3675 query_params.push(("travelRuleStatus".to_string(), param_value.to_string()));
3676 }
3677 if let Some(ref param_value) = params.offset {
3678 query_params.push(("offset".to_string(), param_value.to_string()));
3679 }
3680 if let Some(ref param_value) = params.limit {
3681 query_params.push(("limit".to_string(), param_value.to_string()));
3682 }
3683 if let Some(ref param_value) = params.start_time {
3684 query_params.push(("startTime".to_string(), param_value.to_string()));
3685 }
3686 if let Some(ref param_value) = params.end_time {
3687 query_params.push(("endTime".to_string(), param_value.to_string()));
3688 }
3689 if let Some(ref param_value) = params.recv_window {
3690 query_params.push(("recvWindow".to_string(), param_value.to_string()));
3691 }
3692 query_params.push(("timestamp".to_string(), params.timestamp.to_string()));
3693
3694 let mut header_params = std::collections::HashMap::new();
3696
3697 if let Some(ref binance_auth) = configuration.binance_auth {
3699 header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
3701
3702 let body_string: Option<Vec<u8>> = None;
3704
3705 let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
3707 Ok(sig) => sig,
3708 Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
3709 };
3710
3711 query_params.push(("signature".to_string(), signature));
3713 }
3714
3715 if !query_params.is_empty() {
3717 req_builder = req_builder.query(&query_params);
3718 }
3719
3720
3721 if let Some(ref user_agent) = configuration.user_agent {
3723 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3724 }
3725
3726 for (header_name, header_value) in header_params {
3728 req_builder = req_builder.header(&header_name, &header_value);
3729 }
3730
3731
3732 let req = req_builder.build()?;
3733 let resp = configuration.client.execute(req).await?;
3734
3735 let status = resp.status();
3736 let content_type = resp
3737 .headers()
3738 .get("content-type")
3739 .and_then(|v| v.to_str().ok())
3740 .unwrap_or("application/octet-stream");
3741 let content_type = super::ContentType::from(content_type);
3742
3743 if !status.is_client_error() && !status.is_server_error() {
3744 let content = resp.text().await?;
3745 match content_type {
3746 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3747 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::GetLocalentityWithdrawHistoryV1RespItem>`"))),
3748 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::GetLocalentityWithdrawHistoryV1RespItem>`")))),
3749 }
3750 } else {
3751 let content = resp.text().await?;
3752 let entity: Option<GetLocalentityWithdrawHistoryV1Error> = serde_json::from_str(&content).ok();
3753 Err(Error::ResponseError(ResponseContent { status, content, entity }))
3754 }
3755}
3756
3757pub async fn get_localentity_withdraw_history_v2(configuration: &configuration::Configuration, params: GetLocalentityWithdrawHistoryV2Params) -> Result<Vec<models::GetLocalentityWithdrawHistoryV2RespItem>, Error<GetLocalentityWithdrawHistoryV2Error>> {
3759
3760 let uri_str = format!("{}/sapi/v2/localentity/withdraw/history", configuration.base_path);
3761 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3762
3763 let mut query_params: Vec<(String, String)> = Vec::new();
3765
3766 if let Some(ref param_value) = params.tr_id {
3767 query_params.push(("trId".to_string(), param_value.to_string()));
3768 }
3769 if let Some(ref param_value) = params.tx_id {
3770 query_params.push(("txId".to_string(), param_value.to_string()));
3771 }
3772 if let Some(ref param_value) = params.withdraw_order_id {
3773 query_params.push(("withdrawOrderId".to_string(), param_value.to_string()));
3774 }
3775 if let Some(ref param_value) = params.network {
3776 query_params.push(("network".to_string(), param_value.to_string()));
3777 }
3778 if let Some(ref param_value) = params.coin {
3779 query_params.push(("coin".to_string(), param_value.to_string()));
3780 }
3781 if let Some(ref param_value) = params.travel_rule_status {
3782 query_params.push(("travelRuleStatus".to_string(), param_value.to_string()));
3783 }
3784 if let Some(ref param_value) = params.offset {
3785 query_params.push(("offset".to_string(), param_value.to_string()));
3786 }
3787 if let Some(ref param_value) = params.limit {
3788 query_params.push(("limit".to_string(), param_value.to_string()));
3789 }
3790 if let Some(ref param_value) = params.start_time {
3791 query_params.push(("startTime".to_string(), param_value.to_string()));
3792 }
3793 if let Some(ref param_value) = params.end_time {
3794 query_params.push(("endTime".to_string(), param_value.to_string()));
3795 }
3796 if let Some(ref param_value) = params.recv_window {
3797 query_params.push(("recvWindow".to_string(), param_value.to_string()));
3798 }
3799 query_params.push(("timestamp".to_string(), params.timestamp.to_string()));
3800
3801 let mut header_params = std::collections::HashMap::new();
3803
3804 if let Some(ref binance_auth) = configuration.binance_auth {
3806 header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
3808
3809 let body_string: Option<Vec<u8>> = None;
3811
3812 let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
3814 Ok(sig) => sig,
3815 Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
3816 };
3817
3818 query_params.push(("signature".to_string(), signature));
3820 }
3821
3822 if !query_params.is_empty() {
3824 req_builder = req_builder.query(&query_params);
3825 }
3826
3827
3828 if let Some(ref user_agent) = configuration.user_agent {
3830 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3831 }
3832
3833 for (header_name, header_value) in header_params {
3835 req_builder = req_builder.header(&header_name, &header_value);
3836 }
3837
3838
3839 let req = req_builder.build()?;
3840 let resp = configuration.client.execute(req).await?;
3841
3842 let status = resp.status();
3843 let content_type = resp
3844 .headers()
3845 .get("content-type")
3846 .and_then(|v| v.to_str().ok())
3847 .unwrap_or("application/octet-stream");
3848 let content_type = super::ContentType::from(content_type);
3849
3850 if !status.is_client_error() && !status.is_server_error() {
3851 let content = resp.text().await?;
3852 match content_type {
3853 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3854 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::GetLocalentityWithdrawHistoryV2RespItem>`"))),
3855 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::GetLocalentityWithdrawHistoryV2RespItem>`")))),
3856 }
3857 } else {
3858 let content = resp.text().await?;
3859 let entity: Option<GetLocalentityWithdrawHistoryV2Error> = serde_json::from_str(&content).ok();
3860 Err(Error::ResponseError(ResponseContent { status, content, entity }))
3861 }
3862}
3863
3864pub async fn get_spot_delist_schedule_v1(configuration: &configuration::Configuration, params: GetSpotDelistScheduleV1Params) -> Result<Vec<models::GetSpotDelistScheduleV1RespItem>, Error<GetSpotDelistScheduleV1Error>> {
3866
3867 let uri_str = format!("{}/sapi/v1/spot/delist-schedule", configuration.base_path);
3868 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3869
3870 let mut query_params: Vec<(String, String)> = Vec::new();
3872
3873 if let Some(ref param_value) = params.recv_window {
3874 query_params.push(("recvWindow".to_string(), param_value.to_string()));
3875 }
3876 query_params.push(("timestamp".to_string(), params.timestamp.to_string()));
3877
3878 let mut header_params = std::collections::HashMap::new();
3880
3881 if let Some(ref binance_auth) = configuration.binance_auth {
3883 header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
3885
3886 let body_string: Option<Vec<u8>> = None;
3888
3889 let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
3891 Ok(sig) => sig,
3892 Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
3893 };
3894
3895 query_params.push(("signature".to_string(), signature));
3897 }
3898
3899 if !query_params.is_empty() {
3901 req_builder = req_builder.query(&query_params);
3902 }
3903
3904
3905 if let Some(ref user_agent) = configuration.user_agent {
3907 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3908 }
3909
3910 for (header_name, header_value) in header_params {
3912 req_builder = req_builder.header(&header_name, &header_value);
3913 }
3914
3915
3916 let req = req_builder.build()?;
3917 let resp = configuration.client.execute(req).await?;
3918
3919 let status = resp.status();
3920 let content_type = resp
3921 .headers()
3922 .get("content-type")
3923 .and_then(|v| v.to_str().ok())
3924 .unwrap_or("application/octet-stream");
3925 let content_type = super::ContentType::from(content_type);
3926
3927 if !status.is_client_error() && !status.is_server_error() {
3928 let content = resp.text().await?;
3929 match content_type {
3930 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3931 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::GetSpotDelistScheduleV1RespItem>`"))),
3932 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::GetSpotDelistScheduleV1RespItem>`")))),
3933 }
3934 } else {
3935 let content = resp.text().await?;
3936 let entity: Option<GetSpotDelistScheduleV1Error> = serde_json::from_str(&content).ok();
3937 Err(Error::ResponseError(ResponseContent { status, content, entity }))
3938 }
3939}
3940
3941pub async fn get_spot_open_symbol_list_v1(configuration: &configuration::Configuration) -> Result<Vec<models::GetSpotOpenSymbolListV1RespItem>, Error<GetSpotOpenSymbolListV1Error>> {
3943
3944 let uri_str = format!("{}/sapi/v1/spot/open-symbol-list", configuration.base_path);
3945 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3946
3947 let mut query_params: Vec<(String, String)> = Vec::new();
3949
3950
3951 let mut header_params = std::collections::HashMap::new();
3953
3954 if let Some(ref binance_auth) = configuration.binance_auth {
3956 header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
3958
3959 let body_string: Option<Vec<u8>> = None;
3961
3962 let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
3964 Ok(sig) => sig,
3965 Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
3966 };
3967
3968 query_params.push(("signature".to_string(), signature));
3970 }
3971
3972 if !query_params.is_empty() {
3974 req_builder = req_builder.query(&query_params);
3975 }
3976
3977
3978 if let Some(ref user_agent) = configuration.user_agent {
3980 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3981 }
3982
3983 for (header_name, header_value) in header_params {
3985 req_builder = req_builder.header(&header_name, &header_value);
3986 }
3987
3988
3989 let req = req_builder.build()?;
3990 let resp = configuration.client.execute(req).await?;
3991
3992 let status = resp.status();
3993 let content_type = resp
3994 .headers()
3995 .get("content-type")
3996 .and_then(|v| v.to_str().ok())
3997 .unwrap_or("application/octet-stream");
3998 let content_type = super::ContentType::from(content_type);
3999
4000 if !status.is_client_error() && !status.is_server_error() {
4001 let content = resp.text().await?;
4002 match content_type {
4003 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4004 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::GetSpotOpenSymbolListV1RespItem>`"))),
4005 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::GetSpotOpenSymbolListV1RespItem>`")))),
4006 }
4007 } else {
4008 let content = resp.text().await?;
4009 let entity: Option<GetSpotOpenSymbolListV1Error> = serde_json::from_str(&content).ok();
4010 Err(Error::ResponseError(ResponseContent { status, content, entity }))
4011 }
4012}
4013
4014pub async fn get_system_status_v1(configuration: &configuration::Configuration) -> Result<models::GetSystemStatusV1Resp, Error<GetSystemStatusV1Error>> {
4016
4017 let uri_str = format!("{}/sapi/v1/system/status", configuration.base_path);
4018 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4019
4020 let mut query_params: Vec<(String, String)> = Vec::new();
4022
4023
4024 let mut header_params = std::collections::HashMap::new();
4026
4027 if let Some(ref binance_auth) = configuration.binance_auth {
4029 header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
4031
4032 let body_string: Option<Vec<u8>> = None;
4034
4035 let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
4037 Ok(sig) => sig,
4038 Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
4039 };
4040
4041 query_params.push(("signature".to_string(), signature));
4043 }
4044
4045 if !query_params.is_empty() {
4047 req_builder = req_builder.query(&query_params);
4048 }
4049
4050
4051 if let Some(ref user_agent) = configuration.user_agent {
4053 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4054 }
4055
4056 for (header_name, header_value) in header_params {
4058 req_builder = req_builder.header(&header_name, &header_value);
4059 }
4060
4061
4062 let req = req_builder.build()?;
4063 let resp = configuration.client.execute(req).await?;
4064
4065 let status = resp.status();
4066 let content_type = resp
4067 .headers()
4068 .get("content-type")
4069 .and_then(|v| v.to_str().ok())
4070 .unwrap_or("application/octet-stream");
4071 let content_type = super::ContentType::from(content_type);
4072
4073 if !status.is_client_error() && !status.is_server_error() {
4074 let content = resp.text().await?;
4075 match content_type {
4076 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4077 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetSystemStatusV1Resp`"))),
4078 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetSystemStatusV1Resp`")))),
4079 }
4080 } else {
4081 let content = resp.text().await?;
4082 let entity: Option<GetSystemStatusV1Error> = serde_json::from_str(&content).ok();
4083 Err(Error::ResponseError(ResponseContent { status, content, entity }))
4084 }
4085}
4086
4087pub async fn update_localentity_broker_deposit_provide_info_v1(configuration: &configuration::Configuration, params: UpdateLocalentityBrokerDepositProvideInfoV1Params) -> Result<models::UpdateLocalentityBrokerDepositProvideInfoV1Resp, Error<UpdateLocalentityBrokerDepositProvideInfoV1Error>> {
4089
4090 let uri_str = format!("{}/sapi/v1/localentity/broker/deposit/provide-info", configuration.base_path);
4091 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
4092
4093 let mut query_params: Vec<(String, String)> = Vec::new();
4095
4096
4097 let mut header_params = std::collections::HashMap::new();
4099
4100 if let Some(ref binance_auth) = configuration.binance_auth {
4102 header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
4104
4105 let body_string: Option<Vec<u8>> = None;
4107
4108 let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
4110 Ok(sig) => sig,
4111 Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
4112 };
4113
4114 query_params.push(("signature".to_string(), signature));
4116 }
4117
4118 if !query_params.is_empty() {
4120 req_builder = req_builder.query(&query_params);
4121 }
4122
4123
4124 if let Some(ref user_agent) = configuration.user_agent {
4126 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4127 }
4128
4129 for (header_name, header_value) in header_params {
4131 req_builder = req_builder.header(&header_name, &header_value);
4132 }
4133
4134 let mut multipart_form_params = std::collections::HashMap::new();
4135 if let Some(param_value) = params.address {
4136 multipart_form_params.insert("address", param_value.to_string());
4137 }
4138 if let Some(param_value) = params.address_tag {
4139 multipart_form_params.insert("addressTag", param_value.to_string());
4140 }
4141 if let Some(param_value) = params.amount {
4142 multipart_form_params.insert("amount", param_value.to_string());
4143 }
4144 multipart_form_params.insert("beneficiaryPii", params.beneficiary_pii.to_string());
4145 if let Some(param_value) = params.coin {
4146 multipart_form_params.insert("coin", param_value.to_string());
4147 }
4148 multipart_form_params.insert("depositId", params.deposit_id.to_string());
4149 if let Some(param_value) = params.network {
4150 multipart_form_params.insert("network", param_value.to_string());
4151 }
4152 multipart_form_params.insert("questionnaire", params.questionnaire.to_string());
4153 multipart_form_params.insert("signature", params.signature.to_string());
4154 multipart_form_params.insert("subAccountId", params.sub_account_id.to_string());
4155 multipart_form_params.insert("timestamp", params.timestamp.to_string());
4156 req_builder = req_builder.form(&multipart_form_params);
4157
4158 let req = req_builder.build()?;
4159 let resp = configuration.client.execute(req).await?;
4160
4161 let status = resp.status();
4162 let content_type = resp
4163 .headers()
4164 .get("content-type")
4165 .and_then(|v| v.to_str().ok())
4166 .unwrap_or("application/octet-stream");
4167 let content_type = super::ContentType::from(content_type);
4168
4169 if !status.is_client_error() && !status.is_server_error() {
4170 let content = resp.text().await?;
4171 match content_type {
4172 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4173 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UpdateLocalentityBrokerDepositProvideInfoV1Resp`"))),
4174 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UpdateLocalentityBrokerDepositProvideInfoV1Resp`")))),
4175 }
4176 } else {
4177 let content = resp.text().await?;
4178 let entity: Option<UpdateLocalentityBrokerDepositProvideInfoV1Error> = serde_json::from_str(&content).ok();
4179 Err(Error::ResponseError(ResponseContent { status, content, entity }))
4180 }
4181}
4182
4183pub async fn update_localentity_deposit_provide_info_v1(configuration: &configuration::Configuration, params: UpdateLocalentityDepositProvideInfoV1Params) -> Result<models::UpdateLocalentityDepositProvideInfoV1Resp, Error<UpdateLocalentityDepositProvideInfoV1Error>> {
4185
4186 let uri_str = format!("{}/sapi/v1/localentity/deposit/provide-info", configuration.base_path);
4187 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
4188
4189 let mut query_params: Vec<(String, String)> = Vec::new();
4191
4192
4193 let mut header_params = std::collections::HashMap::new();
4195
4196 if let Some(ref binance_auth) = configuration.binance_auth {
4198 header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
4200
4201 let body_string: Option<Vec<u8>> = None;
4203
4204 let signature = match binance_auth.sign(Some(&query_params), body_string.as_deref()) {
4206 Ok(sig) => sig,
4207 Err(e) => return Err(Error::Generic(format!("Failed to sign request: {}", e))),
4208 };
4209
4210 query_params.push(("signature".to_string(), signature));
4212 }
4213
4214 if !query_params.is_empty() {
4216 req_builder = req_builder.query(&query_params);
4217 }
4218
4219
4220 if let Some(ref user_agent) = configuration.user_agent {
4222 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4223 }
4224
4225 for (header_name, header_value) in header_params {
4227 req_builder = req_builder.header(&header_name, &header_value);
4228 }
4229
4230 let mut multipart_form_params = std::collections::HashMap::new();
4231 multipart_form_params.insert("questionnaire", params.questionnaire.to_string());
4232 multipart_form_params.insert("timestamp", params.timestamp.to_string());
4233 multipart_form_params.insert("tranId", params.tran_id.to_string());
4234 req_builder = req_builder.form(&multipart_form_params);
4235
4236 let req = req_builder.build()?;
4237 let resp = configuration.client.execute(req).await?;
4238
4239 let status = resp.status();
4240 let content_type = resp
4241 .headers()
4242 .get("content-type")
4243 .and_then(|v| v.to_str().ok())
4244 .unwrap_or("application/octet-stream");
4245 let content_type = super::ContentType::from(content_type);
4246
4247 if !status.is_client_error() && !status.is_server_error() {
4248 let content = resp.text().await?;
4249 match content_type {
4250 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4251 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UpdateLocalentityDepositProvideInfoV1Resp`"))),
4252 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UpdateLocalentityDepositProvideInfoV1Resp`")))),
4253 }
4254 } else {
4255 let content = resp.text().await?;
4256 let entity: Option<UpdateLocalentityDepositProvideInfoV1Error> = serde_json::from_str(&content).ok();
4257 Err(Error::ResponseError(ResponseContent { status, content, entity }))
4258 }
4259}
4260