binance/spot/apis/
wallet_api.rs

1/*
2 * Binance Spot API
3 *
4 * OpenAPI specification for Binance exchange - Spot API
5 *
6 * The version of the OpenAPI document: 0.2.0
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11
12use reqwest;
13use serde::{Deserialize, Serialize, de::Error as _};
14use crate::spot::{apis::ResponseContent, models};
15use super::{Error, configuration, ContentType};
16
17/// struct for passing parameters to the method [`create_account_disable_fast_withdraw_switch_v1`]
18#[derive(Clone, Debug, Default)]
19pub struct CreateAccountDisableFastWithdrawSwitchV1Params {
20    pub timestamp: i64,
21    pub recv_window: Option<i64>
22}
23
24/// struct for passing parameters to the method [`create_account_enable_fast_withdraw_switch_v1`]
25#[derive(Clone, Debug, Default)]
26pub struct CreateAccountEnableFastWithdrawSwitchV1Params {
27    pub timestamp: i64,
28    pub recv_window: Option<i64>
29}
30
31/// struct for passing parameters to the method [`create_asset_dust_btc_v1`]
32#[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/// struct for passing parameters to the method [`create_asset_dust_v1`]
40#[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/// struct for passing parameters to the method [`create_asset_get_funding_asset_v1`]
49#[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/// struct for passing parameters to the method [`create_asset_get_user_asset_v3`]
58#[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/// struct for passing parameters to the method [`create_asset_transfer_v1`]
67#[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/// struct for passing parameters to the method [`create_bnb_burn_v1`]
79#[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/// struct for passing parameters to the method [`create_capital_deposit_credit_apply_v1`]
88#[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/// struct for passing parameters to the method [`create_capital_withdraw_apply_v1`]
97#[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/// struct for passing parameters to the method [`create_localentity_broker_withdraw_apply_v1`]
113#[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/// struct for passing parameters to the method [`create_localentity_withdraw_apply_v1`]
132#[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/// struct for passing parameters to the method [`get_account_api_restrictions_v1`]
149#[derive(Clone, Debug, Default)]
150pub struct GetAccountApiRestrictionsV1Params {
151    pub timestamp: i64,
152    pub recv_window: Option<i64>
153}
154
155/// struct for passing parameters to the method [`get_account_api_trading_status_v1`]
156#[derive(Clone, Debug, Default)]
157pub struct GetAccountApiTradingStatusV1Params {
158    pub timestamp: i64,
159    pub recv_window: Option<i64>
160}
161
162/// struct for passing parameters to the method [`get_account_info_v1`]
163#[derive(Clone, Debug, Default)]
164pub struct GetAccountInfoV1Params {
165    pub timestamp: i64,
166    pub recv_window: Option<i64>
167}
168
169/// struct for passing parameters to the method [`get_account_snapshot_v1`]
170#[derive(Clone, Debug, Default)]
171pub struct GetAccountSnapshotV1Params {
172    /// &#34;SPOT&#34;, &#34;MARGIN&#34;, &#34;FUTURES&#34;
173    pub r#type: String,
174    pub timestamp: i64,
175    pub start_time: Option<i64>,
176    pub end_time: Option<i64>,
177    /// min 7, max 30, default 7
178    pub limit: Option<i32>,
179    pub recv_window: Option<i64>
180}
181
182/// struct for passing parameters to the method [`get_account_status_v1`]
183#[derive(Clone, Debug, Default)]
184pub struct GetAccountStatusV1Params {
185    pub timestamp: i64,
186    pub recv_window: Option<i64>
187}
188
189/// struct for passing parameters to the method [`get_asset_asset_detail_v1`]
190#[derive(Clone, Debug, Default)]
191pub struct GetAssetAssetDetailV1Params {
192    pub timestamp: i64,
193    pub recv_window: Option<i64>
194}
195
196/// struct for passing parameters to the method [`get_asset_asset_dividend_v1`]
197#[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    /// Default 20, max 500
204    pub limit: Option<i32>,
205    pub recv_window: Option<i64>
206}
207
208/// struct for passing parameters to the method [`get_asset_custody_transfer_history_v1`]
209#[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    /// Delegate/Undelegate
216    pub r#type: Option<String>,
217    pub asset: Option<String>,
218    /// default 1
219    pub current: Option<i32>,
220    /// default 10, max 100
221    pub size: Option<i32>,
222    pub recv_window: Option<i64>
223}
224
225/// struct for passing parameters to the method [`get_asset_dribblet_v1`]
226#[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/// struct for passing parameters to the method [`get_asset_ledger_transfer_cloud_mining_query_by_page_v1`]
235#[derive(Clone, Debug, Default)]
236pub struct GetAssetLedgerTransferCloudMiningQueryByPageV1Params {
237    /// inclusive, unit: ms
238    pub start_time: i64,
239    /// exclusive, unit: ms
240    pub end_time: i64,
241    /// The transaction id
242    pub tran_id: Option<i64>,
243    /// The unique flag
244    pub client_tran_id: Option<String>,
245    /// If it is blank, we will query all assets
246    pub asset: Option<String>,
247    /// current page, default 1, the min value is 1
248    pub current: Option<i32>,
249    /// page size, default 10, the max value is 100
250    pub size: Option<i32>
251}
252
253/// struct for passing parameters to the method [`get_asset_trade_fee_v1`]
254#[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/// struct for passing parameters to the method [`get_asset_transfer_v1`]
262#[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    /// Default 1
269    pub current: Option<i32>,
270    /// Default 10, Max 100
271    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/// struct for passing parameters to the method [`get_asset_wallet_balance_v1`]
278#[derive(Clone, Debug, Default)]
279pub struct GetAssetWalletBalanceV1Params {
280    pub timestamp: i64,
281    /// `USDT`, `ETH`, `USDC`, `BNB`, etc. default `BTC`
282    pub quote_asset: Option<String>,
283    pub recv_window: Option<i64>
284}
285
286/// struct for passing parameters to the method [`get_capital_config_getall_v1`]
287#[derive(Clone, Debug, Default)]
288pub struct GetCapitalConfigGetallV1Params {
289    pub timestamp: i64,
290    pub recv_window: Option<i64>
291}
292
293/// struct for passing parameters to the method [`get_capital_deposit_address_list_v1`]
294#[derive(Clone, Debug, Default)]
295pub struct GetCapitalDepositAddressListV1Params {
296    /// `coin` refers to the parent network address format that the address is using
297    pub coin: String,
298    pub timestamp: i64,
299    pub network: Option<String>
300}
301
302/// struct for passing parameters to the method [`get_capital_deposit_address_v1`]
303#[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/// struct for passing parameters to the method [`get_capital_deposit_hisrec_v1`]
313#[derive(Clone, Debug, Default)]
314pub struct GetCapitalDepositHisrecV1Params {
315    pub timestamp: i64,
316    /// Default: `false`, return `sourceAddress`field when set to `true`
317    pub include_source: Option<bool>,
318    pub coin: Option<String>,
319    /// 0(0:pending, 6:credited but cannot withdraw, 7:Wrong Deposit, 8:Waiting User confirm, 1:success, 2:rejected)
320    pub status: Option<i32>,
321    /// Default: 90 days from current timestamp
322    pub start_time: Option<i64>,
323    /// Default: present timestamp
324    pub end_time: Option<i64>,
325    /// Default:0
326    pub offset: Option<i32>,
327    /// Default:1000, Max:1000
328    pub limit: Option<i32>,
329    pub recv_window: Option<i64>,
330    pub tx_id: Option<String>
331}
332
333/// struct for passing parameters to the method [`get_capital_withdraw_history_v1`]
334#[derive(Clone, Debug, Default)]
335pub struct GetCapitalWithdrawHistoryV1Params {
336    pub timestamp: i64,
337    pub coin: Option<String>,
338    pub withdraw_order_id: Option<String>,
339    /// 0(0:Email Sent, 2:Awaiting Approval 3:Rejected 4:Processing 6:Completed)
340    pub status: Option<i32>,
341    pub offset: Option<i32>,
342    /// Default: 1000, Max: 1000
343    pub limit: Option<i32>,
344    /// id list returned in the response of POST `/sapi/v1/capital/withdraw/apply`, separated by `,`
345    pub id_list: Option<String>,
346    /// Default: 90 days from current timestamp
347    pub start_time: Option<i64>,
348    /// Default: present timestamp
349    pub end_time: Option<i64>,
350    pub recv_window: Option<i64>
351}
352
353/// struct for passing parameters to the method [`get_localentity_deposit_history_v1`]
354#[derive(Clone, Debug, Default)]
355pub struct GetLocalentityDepositHistoryV1Params {
356    pub timestamp: i64,
357    /// Comma(,) separated list of travel rule record Ids.
358    pub tr_id: Option<String>,
359    /// Comma(,) separated list of transaction Ids.
360    pub tx_id: Option<String>,
361    /// Comma(,) separated list of wallet tran Ids.
362    pub tran_id: Option<String>,
363    pub network: Option<String>,
364    pub coin: Option<String>,
365    /// 0:Completed,1:Pending,2:Failed
366    pub travel_rule_status: Option<i32>,
367    /// true: Only return records that pending deposit questionnaire. false/not provided: return all records.
368    pub pending_questionnaire: Option<bool>,
369    /// Default: 90 days from current timestamp
370    pub start_time: Option<i64>,
371    /// Default: present timestamp
372    pub end_time: Option<i64>,
373    /// Default:0
374    pub offset: Option<i32>,
375    /// Default:1000, Max:1000
376    pub limit: Option<i32>
377}
378
379/// struct for passing parameters to the method [`get_localentity_withdraw_history_v1`]
380#[derive(Clone, Debug, Default)]
381pub struct GetLocalentityWithdrawHistoryV1Params {
382    pub timestamp: i64,
383    /// Comma(,) separated list of travel rule record Ids.
384    pub tr_id: Option<String>,
385    /// Comma(,) separated list of transaction Ids.
386    pub tx_id: Option<String>,
387    /// Comma(,) separated list of withdrawID defined by the client (i.e. client&#39;s internal withdrawID).
388    pub withdraw_order_id: Option<String>,
389    pub network: Option<String>,
390    pub coin: Option<String>,
391    /// 0:Completed,1:Pending,2:Failed
392    pub travel_rule_status: Option<i32>,
393    /// Default: 0
394    pub offset: Option<i32>,
395    /// Default: 1000, Max: 1000
396    pub limit: Option<i32>,
397    /// Default: 90 days from current timestamp
398    pub start_time: Option<i64>,
399    /// Default: present timestamp
400    pub end_time: Option<i64>,
401    pub recv_window: Option<i64>
402}
403
404/// struct for passing parameters to the method [`get_localentity_withdraw_history_v2`]
405#[derive(Clone, Debug, Default)]
406pub struct GetLocalentityWithdrawHistoryV2Params {
407    pub timestamp: i64,
408    /// Comma(,) separated list of travel rule record Ids.
409    pub tr_id: Option<String>,
410    /// Comma(,) separated list of transaction Ids.
411    pub tx_id: Option<String>,
412    /// Withdraw ID defined by the client (i.e. client&#39;s internal withdrawID).
413    pub withdraw_order_id: Option<String>,
414    pub network: Option<String>,
415    pub coin: Option<String>,
416    /// 0:Completed,1:Pending,2:Failed
417    pub travel_rule_status: Option<i32>,
418    /// Default: 0
419    pub offset: Option<i32>,
420    /// Default: 1000, Max: 1000
421    pub limit: Option<i32>,
422    /// Default: 90 days from current timestamp
423    pub start_time: Option<i64>,
424    /// Default: present timestamp
425    pub end_time: Option<i64>,
426    pub recv_window: Option<i64>
427}
428
429/// struct for passing parameters to the method [`get_spot_delist_schedule_v1`]
430#[derive(Clone, Debug, Default)]
431pub struct GetSpotDelistScheduleV1Params {
432    pub timestamp: i64,
433    pub recv_window: Option<i64>
434}
435
436/// struct for passing parameters to the method [`update_localentity_broker_deposit_provide_info_v1`]
437#[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/// struct for passing parameters to the method [`update_localentity_deposit_provide_info_v1`]
453#[derive(Clone, Debug, Default)]
454pub struct UpdateLocalentityDepositProvideInfoV1Params {
455    pub questionnaire: String,
456    pub timestamp: i64,
457    pub tran_id: i64
458}
459
460
461/// struct for typed errors of method [`create_account_disable_fast_withdraw_switch_v1`]
462#[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/// struct for typed errors of method [`create_account_enable_fast_withdraw_switch_v1`]
471#[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/// struct for typed errors of method [`create_asset_dust_btc_v1`]
480#[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/// struct for typed errors of method [`create_asset_dust_v1`]
489#[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/// struct for typed errors of method [`create_asset_get_funding_asset_v1`]
498#[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/// struct for typed errors of method [`create_asset_get_user_asset_v3`]
507#[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/// struct for typed errors of method [`create_asset_transfer_v1`]
516#[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/// struct for typed errors of method [`create_bnb_burn_v1`]
525#[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/// struct for typed errors of method [`create_capital_deposit_credit_apply_v1`]
534#[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/// struct for typed errors of method [`create_capital_withdraw_apply_v1`]
543#[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/// struct for typed errors of method [`create_localentity_broker_withdraw_apply_v1`]
552#[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/// struct for typed errors of method [`create_localentity_withdraw_apply_v1`]
561#[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/// struct for typed errors of method [`get_account_api_restrictions_v1`]
570#[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/// struct for typed errors of method [`get_account_api_trading_status_v1`]
579#[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/// struct for typed errors of method [`get_account_info_v1`]
588#[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/// struct for typed errors of method [`get_account_snapshot_v1`]
597#[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/// struct for typed errors of method [`get_account_status_v1`]
606#[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/// struct for typed errors of method [`get_asset_asset_detail_v1`]
615#[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/// struct for typed errors of method [`get_asset_asset_dividend_v1`]
624#[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/// struct for typed errors of method [`get_asset_custody_transfer_history_v1`]
633#[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/// struct for typed errors of method [`get_asset_dribblet_v1`]
642#[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/// struct for typed errors of method [`get_asset_ledger_transfer_cloud_mining_query_by_page_v1`]
651#[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/// struct for typed errors of method [`get_asset_trade_fee_v1`]
660#[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/// struct for typed errors of method [`get_asset_transfer_v1`]
669#[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/// struct for typed errors of method [`get_asset_wallet_balance_v1`]
678#[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/// struct for typed errors of method [`get_capital_config_getall_v1`]
687#[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/// struct for typed errors of method [`get_capital_deposit_address_list_v1`]
696#[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/// struct for typed errors of method [`get_capital_deposit_address_v1`]
705#[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/// struct for typed errors of method [`get_capital_deposit_hisrec_v1`]
714#[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/// struct for typed errors of method [`get_capital_withdraw_address_list_v1`]
723#[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/// struct for typed errors of method [`get_capital_withdraw_history_v1`]
732#[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/// struct for typed errors of method [`get_localentity_deposit_history_v1`]
741#[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/// struct for typed errors of method [`get_localentity_vasp_v1`]
750#[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/// struct for typed errors of method [`get_localentity_withdraw_history_v1`]
759#[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/// struct for typed errors of method [`get_localentity_withdraw_history_v2`]
768#[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/// struct for typed errors of method [`get_spot_delist_schedule_v1`]
777#[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/// struct for typed errors of method [`get_spot_open_symbol_list_v1`]
786#[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/// struct for typed errors of method [`get_system_status_v1`]
795#[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/// struct for typed errors of method [`update_localentity_broker_deposit_provide_info_v1`]
804#[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/// struct for typed errors of method [`update_localentity_deposit_provide_info_v1`]
813#[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    // Create a mutable vector for query parameters
828    let mut query_params: Vec<(String, String)> = Vec::new();
829
830
831    // Create header parameters collection
832    let mut header_params = std::collections::HashMap::new();
833
834    // Handle Binance Auth first if configured
835    if let Some(ref binance_auth) = configuration.binance_auth {
836        // Add API key to headers
837        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
838        
839        // Generate request body for signing (if any)
840        let body_string: Option<Vec<u8>> = None;
841        
842        // Sign the request
843        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        // Add signature to query params
849        query_params.push(("signature".to_string(), signature));
850    }
851
852    // Apply all query parameters
853    if !query_params.is_empty() {
854        req_builder = req_builder.query(&query_params);
855    }
856
857
858    // Add user agent if configured
859    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    // Apply all header parameters
864    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
900/// Enable Fast Withdraw Switch (USER_DATA)
901pub 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    // Create a mutable vector for query parameters
907    let mut query_params: Vec<(String, String)> = Vec::new();
908
909
910    // Create header parameters collection
911    let mut header_params = std::collections::HashMap::new();
912
913    // Handle Binance Auth first if configured
914    if let Some(ref binance_auth) = configuration.binance_auth {
915        // Add API key to headers
916        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
917        
918        // Generate request body for signing (if any)
919        let body_string: Option<Vec<u8>> = None;
920        
921        // Sign the request
922        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        // Add signature to query params
928        query_params.push(("signature".to_string(), signature));
929    }
930
931    // Apply all query parameters
932    if !query_params.is_empty() {
933        req_builder = req_builder.query(&query_params);
934    }
935
936
937    // Add user agent if configured
938    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    // Apply all header parameters
943    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
979/// Get Assets That Can Be Converted Into BNB
980pub 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    // Create a mutable vector for query parameters
986    let mut query_params: Vec<(String, String)> = Vec::new();
987
988
989    // Create header parameters collection
990    let mut header_params = std::collections::HashMap::new();
991
992    // Handle Binance Auth first if configured
993    if let Some(ref binance_auth) = configuration.binance_auth {
994        // Add API key to headers
995        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
996        
997        // Generate request body for signing (if any)
998        let body_string: Option<Vec<u8>> = None;
999        
1000        // Sign the request
1001        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        // Add signature to query params
1007        query_params.push(("signature".to_string(), signature));
1008    }
1009
1010    // Apply all query parameters
1011    if !query_params.is_empty() {
1012        req_builder = req_builder.query(&query_params);
1013    }
1014
1015
1016    // Add user agent if configured
1017    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    // Apply all header parameters
1022    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
1061/// Convert dust assets to BNB.
1062pub 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    // Create a mutable vector for query parameters
1068    let mut query_params: Vec<(String, String)> = Vec::new();
1069
1070
1071    // Create header parameters collection
1072    let mut header_params = std::collections::HashMap::new();
1073
1074    // Handle Binance Auth first if configured
1075    if let Some(ref binance_auth) = configuration.binance_auth {
1076        // Add API key to headers
1077        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
1078        
1079        // Generate request body for signing (if any)
1080        let body_string: Option<Vec<u8>> = None;
1081        
1082        // Sign the request
1083        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        // Add signature to query params
1089        query_params.push(("signature".to_string(), signature));
1090    }
1091
1092    // Apply all query parameters
1093    if !query_params.is_empty() {
1094        req_builder = req_builder.query(&query_params);
1095    }
1096
1097
1098    // Add user agent if configured
1099    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    // Apply all header parameters
1104    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
1144/// Query Funding Wallet
1145pub 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    // Create a mutable vector for query parameters
1151    let mut query_params: Vec<(String, String)> = Vec::new();
1152
1153
1154    // Create header parameters collection
1155    let mut header_params = std::collections::HashMap::new();
1156
1157    // Handle Binance Auth first if configured
1158    if let Some(ref binance_auth) = configuration.binance_auth {
1159        // Add API key to headers
1160        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
1161        
1162        // Generate request body for signing (if any)
1163        let body_string: Option<Vec<u8>> = None;
1164        
1165        // Sign the request
1166        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        // Add signature to query params
1172        query_params.push(("signature".to_string(), signature));
1173    }
1174
1175    // Apply all query parameters
1176    if !query_params.is_empty() {
1177        req_builder = req_builder.query(&query_params);
1178    }
1179
1180
1181    // Add user agent if configured
1182    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    // Apply all header parameters
1187    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&lt;models::CreateAssetGetFundingAssetV1RespItem&gt;`"))),
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&lt;models::CreateAssetGetFundingAssetV1RespItem&gt;`")))),
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
1229/// Get user assets, just for positive data.
1230pub 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    // Create a mutable vector for query parameters
1236    let mut query_params: Vec<(String, String)> = Vec::new();
1237
1238
1239    // Create header parameters collection
1240    let mut header_params = std::collections::HashMap::new();
1241
1242    // Handle Binance Auth first if configured
1243    if let Some(ref binance_auth) = configuration.binance_auth {
1244        // Add API key to headers
1245        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
1246        
1247        // Generate request body for signing (if any)
1248        let body_string: Option<Vec<u8>> = None;
1249        
1250        // Sign the request
1251        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        // Add signature to query params
1257        query_params.push(("signature".to_string(), signature));
1258    }
1259
1260    // Apply all query parameters
1261    if !query_params.is_empty() {
1262        req_builder = req_builder.query(&query_params);
1263    }
1264
1265
1266    // Add user agent if configured
1267    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    // Apply all header parameters
1272    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&lt;models::CreateAssetGetUserAssetV3RespItem&gt;`"))),
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&lt;models::CreateAssetGetUserAssetV3RespItem&gt;`")))),
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
1314/// user universal transfer
1315pub 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    // Create a mutable vector for query parameters
1321    let mut query_params: Vec<(String, String)> = Vec::new();
1322
1323
1324    // Create header parameters collection
1325    let mut header_params = std::collections::HashMap::new();
1326
1327    // Handle Binance Auth first if configured
1328    if let Some(ref binance_auth) = configuration.binance_auth {
1329        // Add API key to headers
1330        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
1331        
1332        // Generate request body for signing (if any)
1333        let body_string: Option<Vec<u8>> = None;
1334        
1335        // Sign the request
1336        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        // Add signature to query params
1342        query_params.push(("signature".to_string(), signature));
1343    }
1344
1345    // Apply all query parameters
1346    if !query_params.is_empty() {
1347        req_builder = req_builder.query(&query_params);
1348    }
1349
1350
1351    // Add user agent if configured
1352    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    // Apply all header parameters
1357    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
1402/// Toggle BNB Burn On Spot Trade And Margin Interest
1403pub 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    // Create a mutable vector for query parameters
1409    let mut query_params: Vec<(String, String)> = Vec::new();
1410
1411
1412    // Create header parameters collection
1413    let mut header_params = std::collections::HashMap::new();
1414
1415    // Handle Binance Auth first if configured
1416    if let Some(ref binance_auth) = configuration.binance_auth {
1417        // Add API key to headers
1418        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
1419        
1420        // Generate request body for signing (if any)
1421        let body_string: Option<Vec<u8>> = None;
1422        
1423        // Sign the request
1424        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        // Add signature to query params
1430        query_params.push(("signature".to_string(), signature));
1431    }
1432
1433    // Apply all query parameters
1434    if !query_params.is_empty() {
1435        req_builder = req_builder.query(&query_params);
1436    }
1437
1438
1439    // Add user agent if configured
1440    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    // Apply all header parameters
1445    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
1487/// Apply deposit credit for expired address (One click arrival)
1488pub 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    // Create a mutable vector for query parameters
1494    let mut query_params: Vec<(String, String)> = Vec::new();
1495
1496
1497    // Create header parameters collection
1498    let mut header_params = std::collections::HashMap::new();
1499
1500    // Handle Binance Auth first if configured
1501    if let Some(ref binance_auth) = configuration.binance_auth {
1502        // Add API key to headers
1503        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
1504        
1505        // Generate request body for signing (if any)
1506        let body_string: Option<Vec<u8>> = None;
1507        
1508        // Sign the request
1509        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        // Add signature to query params
1515        query_params.push(("signature".to_string(), signature));
1516    }
1517
1518    // Apply all query parameters
1519    if !query_params.is_empty() {
1520        req_builder = req_builder.query(&query_params);
1521    }
1522
1523
1524    // Add user agent if configured
1525    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    // Apply all header parameters
1530    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
1574/// Submit a withdraw request.
1575pub 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    // Create a mutable vector for query parameters
1581    let mut query_params: Vec<(String, String)> = Vec::new();
1582
1583
1584    // Create header parameters collection
1585    let mut header_params = std::collections::HashMap::new();
1586
1587    // Handle Binance Auth first if configured
1588    if let Some(ref binance_auth) = configuration.binance_auth {
1589        // Add API key to headers
1590        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
1591        
1592        // Generate request body for signing (if any)
1593        let body_string: Option<Vec<u8>> = None;
1594        
1595        // Sign the request
1596        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        // Add signature to query params
1602        query_params.push(("signature".to_string(), signature));
1603    }
1604
1605    // Apply all query parameters
1606    if !query_params.is_empty() {
1607        req_builder = req_builder.query(&query_params);
1608    }
1609
1610
1611    // Add user agent if configured
1612    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    // Apply all header parameters
1617    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
1674/// Submit a withdrawal request for brokers of local entities that required travel rule.
1675pub 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    // Create a mutable vector for query parameters
1681    let mut query_params: Vec<(String, String)> = Vec::new();
1682
1683
1684    // Create header parameters collection
1685    let mut header_params = std::collections::HashMap::new();
1686
1687    // Handle Binance Auth first if configured
1688    if let Some(ref binance_auth) = configuration.binance_auth {
1689        // Add API key to headers
1690        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
1691        
1692        // Generate request body for signing (if any)
1693        let body_string: Option<Vec<u8>> = None;
1694        
1695        // Sign the request
1696        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        // Add signature to query params
1702        query_params.push(("signature".to_string(), signature));
1703    }
1704
1705    // Apply all query parameters
1706    if !query_params.is_empty() {
1707        req_builder = req_builder.query(&query_params);
1708    }
1709
1710
1711    // Add user agent if configured
1712    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    // Apply all header parameters
1717    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
1773/// Submit a withdrawal request for local entities that required travel rule.
1774pub 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    // Create a mutable vector for query parameters
1780    let mut query_params: Vec<(String, String)> = Vec::new();
1781
1782
1783    // Create header parameters collection
1784    let mut header_params = std::collections::HashMap::new();
1785
1786    // Handle Binance Auth first if configured
1787    if let Some(ref binance_auth) = configuration.binance_auth {
1788        // Add API key to headers
1789        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
1790        
1791        // Generate request body for signing (if any)
1792        let body_string: Option<Vec<u8>> = None;
1793        
1794        // Sign the request
1795        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        // Add signature to query params
1801        query_params.push(("signature".to_string(), signature));
1802    }
1803
1804    // Apply all query parameters
1805    if !query_params.is_empty() {
1806        req_builder = req_builder.query(&query_params);
1807    }
1808
1809
1810    // Add user agent if configured
1811    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    // Apply all header parameters
1816    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
1874/// Get API Key Permission
1875pub 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    // Create a mutable vector for query parameters
1881    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    // Create header parameters collection
1889    let mut header_params = std::collections::HashMap::new();
1890
1891    // Handle Binance Auth first if configured
1892    if let Some(ref binance_auth) = configuration.binance_auth {
1893        // Add API key to headers
1894        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
1895        
1896        // Generate request body for signing (if any)
1897        let body_string: Option<Vec<u8>> = None;
1898        
1899        // Sign the request
1900        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        // Add signature to query params
1906        query_params.push(("signature".to_string(), signature));
1907    }
1908
1909    // Apply all query parameters
1910    if !query_params.is_empty() {
1911        req_builder = req_builder.query(&query_params);
1912    }
1913
1914
1915    // Add user agent if configured
1916    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    // Apply all header parameters
1921    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
1951/// Fetch account api trading status detail.
1952pub 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    // Create a mutable vector for query parameters
1958    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    // Create header parameters collection
1966    let mut header_params = std::collections::HashMap::new();
1967
1968    // Handle Binance Auth first if configured
1969    if let Some(ref binance_auth) = configuration.binance_auth {
1970        // Add API key to headers
1971        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
1972        
1973        // Generate request body for signing (if any)
1974        let body_string: Option<Vec<u8>> = None;
1975        
1976        // Sign the request
1977        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        // Add signature to query params
1983        query_params.push(("signature".to_string(), signature));
1984    }
1985
1986    // Apply all query parameters
1987    if !query_params.is_empty() {
1988        req_builder = req_builder.query(&query_params);
1989    }
1990
1991
1992    // Add user agent if configured
1993    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    // Apply all header parameters
1998    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
2028/// Fetch account info detail.
2029pub 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    // Create a mutable vector for query parameters
2035    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    // Create header parameters collection
2043    let mut header_params = std::collections::HashMap::new();
2044
2045    // Handle Binance Auth first if configured
2046    if let Some(ref binance_auth) = configuration.binance_auth {
2047        // Add API key to headers
2048        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
2049        
2050        // Generate request body for signing (if any)
2051        let body_string: Option<Vec<u8>> = None;
2052        
2053        // Sign the request
2054        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        // Add signature to query params
2060        query_params.push(("signature".to_string(), signature));
2061    }
2062
2063    // Apply all query parameters
2064    if !query_params.is_empty() {
2065        req_builder = req_builder.query(&query_params);
2066    }
2067
2068
2069    // Add user agent if configured
2070    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    // Apply all header parameters
2075    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
2105/// Daily account snapshot
2106pub 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    // Create a mutable vector for query parameters
2112    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    // Create header parameters collection
2130    let mut header_params = std::collections::HashMap::new();
2131
2132    // Handle Binance Auth first if configured
2133    if let Some(ref binance_auth) = configuration.binance_auth {
2134        // Add API key to headers
2135        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
2136        
2137        // Generate request body for signing (if any)
2138        let body_string: Option<Vec<u8>> = None;
2139        
2140        // Sign the request
2141        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        // Add signature to query params
2147        query_params.push(("signature".to_string(), signature));
2148    }
2149
2150    // Apply all query parameters
2151    if !query_params.is_empty() {
2152        req_builder = req_builder.query(&query_params);
2153    }
2154
2155
2156    // Add user agent if configured
2157    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    // Apply all header parameters
2162    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
2192/// Fetch account status detail.
2193pub 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    // Create a mutable vector for query parameters
2199    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    // Create header parameters collection
2207    let mut header_params = std::collections::HashMap::new();
2208
2209    // Handle Binance Auth first if configured
2210    if let Some(ref binance_auth) = configuration.binance_auth {
2211        // Add API key to headers
2212        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
2213        
2214        // Generate request body for signing (if any)
2215        let body_string: Option<Vec<u8>> = None;
2216        
2217        // Sign the request
2218        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        // Add signature to query params
2224        query_params.push(("signature".to_string(), signature));
2225    }
2226
2227    // Apply all query parameters
2228    if !query_params.is_empty() {
2229        req_builder = req_builder.query(&query_params);
2230    }
2231
2232
2233    // Add user agent if configured
2234    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    // Apply all header parameters
2239    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
2269/// Fetch details of assets supported on Binance.
2270pub 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    // Create a mutable vector for query parameters
2276    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    // Create header parameters collection
2284    let mut header_params = std::collections::HashMap::new();
2285
2286    // Handle Binance Auth first if configured
2287    if let Some(ref binance_auth) = configuration.binance_auth {
2288        // Add API key to headers
2289        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
2290        
2291        // Generate request body for signing (if any)
2292        let body_string: Option<Vec<u8>> = None;
2293        
2294        // Sign the request
2295        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        // Add signature to query params
2301        query_params.push(("signature".to_string(), signature));
2302    }
2303
2304    // Apply all query parameters
2305    if !query_params.is_empty() {
2306        req_builder = req_builder.query(&query_params);
2307    }
2308
2309
2310    // Add user agent if configured
2311    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    // Apply all header parameters
2316    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&lt;String, models::WalletGetAssetAssetDetailV1RespValue&gt;`"))),
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&lt;String, models::WalletGetAssetAssetDetailV1RespValue&gt;`")))),
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
2346/// Query asset dividend record.
2347pub 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    // Create a mutable vector for query parameters
2353    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    // Create header parameters collection
2373    let mut header_params = std::collections::HashMap::new();
2374
2375    // Handle Binance Auth first if configured
2376    if let Some(ref binance_auth) = configuration.binance_auth {
2377        // Add API key to headers
2378        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
2379        
2380        // Generate request body for signing (if any)
2381        let body_string: Option<Vec<u8>> = None;
2382        
2383        // Sign the request
2384        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        // Add signature to query params
2390        query_params.push(("signature".to_string(), signature));
2391    }
2392
2393    // Apply all query parameters
2394    if !query_params.is_empty() {
2395        req_builder = req_builder.query(&query_params);
2396    }
2397
2398
2399    // Add user agent if configured
2400    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    // Apply all header parameters
2405    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
2435/// Query User Delegation History
2436pub 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    // Create a mutable vector for query parameters
2442    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    // Create header parameters collection
2465    let mut header_params = std::collections::HashMap::new();
2466
2467    // Handle Binance Auth first if configured
2468    if let Some(ref binance_auth) = configuration.binance_auth {
2469        // Add API key to headers
2470        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
2471        
2472        // Generate request body for signing (if any)
2473        let body_string: Option<Vec<u8>> = None;
2474        
2475        // Sign the request
2476        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        // Add signature to query params
2482        query_params.push(("signature".to_string(), signature));
2483    }
2484
2485    // Apply all query parameters
2486    if !query_params.is_empty() {
2487        req_builder = req_builder.query(&query_params);
2488    }
2489
2490
2491    // Add user agent if configured
2492    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    // Apply all header parameters
2497    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
2527/// Dustlog
2528pub 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    // Create a mutable vector for query parameters
2534    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    // Create header parameters collection
2548    let mut header_params = std::collections::HashMap::new();
2549
2550    // Handle Binance Auth first if configured
2551    if let Some(ref binance_auth) = configuration.binance_auth {
2552        // Add API key to headers
2553        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
2554        
2555        // Generate request body for signing (if any)
2556        let body_string: Option<Vec<u8>> = None;
2557        
2558        // Sign the request
2559        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        // Add signature to query params
2565        query_params.push(("signature".to_string(), signature));
2566    }
2567
2568    // Apply all query parameters
2569    if !query_params.is_empty() {
2570        req_builder = req_builder.query(&query_params);
2571    }
2572
2573
2574    // Add user agent if configured
2575    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    // Apply all header parameters
2580    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
2610/// The query of Cloud-Mining payment and refund history
2611pub 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    // Create a mutable vector for query parameters
2617    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    // Create header parameters collection
2638    let mut header_params = std::collections::HashMap::new();
2639
2640    // Handle Binance Auth first if configured
2641    if let Some(ref binance_auth) = configuration.binance_auth {
2642        // Add API key to headers
2643        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
2644        
2645        // Generate request body for signing (if any)
2646        let body_string: Option<Vec<u8>> = None;
2647        
2648        // Sign the request
2649        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        // Add signature to query params
2655        query_params.push(("signature".to_string(), signature));
2656    }
2657
2658    // Apply all query parameters
2659    if !query_params.is_empty() {
2660        req_builder = req_builder.query(&query_params);
2661    }
2662
2663
2664    // Add user agent if configured
2665    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    // Apply all header parameters
2670    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
2700/// Fetch trade fee
2701pub 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    // Create a mutable vector for query parameters
2707    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    // Create header parameters collection
2718    let mut header_params = std::collections::HashMap::new();
2719
2720    // Handle Binance Auth first if configured
2721    if let Some(ref binance_auth) = configuration.binance_auth {
2722        // Add API key to headers
2723        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
2724        
2725        // Generate request body for signing (if any)
2726        let body_string: Option<Vec<u8>> = None;
2727        
2728        // Sign the request
2729        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        // Add signature to query params
2735        query_params.push(("signature".to_string(), signature));
2736    }
2737
2738    // Apply all query parameters
2739    if !query_params.is_empty() {
2740        req_builder = req_builder.query(&query_params);
2741    }
2742
2743
2744    // Add user agent if configured
2745    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    // Apply all header parameters
2750    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&lt;models::GetAssetTradeFeeV1RespItem&gt;`"))),
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&lt;models::GetAssetTradeFeeV1RespItem&gt;`")))),
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
2780/// Query User Universal Transfer History
2781pub 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    // Create a mutable vector for query parameters
2787    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    // Create header parameters collection
2814    let mut header_params = std::collections::HashMap::new();
2815
2816    // Handle Binance Auth first if configured
2817    if let Some(ref binance_auth) = configuration.binance_auth {
2818        // Add API key to headers
2819        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
2820        
2821        // Generate request body for signing (if any)
2822        let body_string: Option<Vec<u8>> = None;
2823        
2824        // Sign the request
2825        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        // Add signature to query params
2831        query_params.push(("signature".to_string(), signature));
2832    }
2833
2834    // Apply all query parameters
2835    if !query_params.is_empty() {
2836        req_builder = req_builder.query(&query_params);
2837    }
2838
2839
2840    // Add user agent if configured
2841    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    // Apply all header parameters
2846    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
2876/// Query User Wallet Balance
2877pub 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    // Create a mutable vector for query parameters
2883    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    // Create header parameters collection
2894    let mut header_params = std::collections::HashMap::new();
2895
2896    // Handle Binance Auth first if configured
2897    if let Some(ref binance_auth) = configuration.binance_auth {
2898        // Add API key to headers
2899        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
2900        
2901        // Generate request body for signing (if any)
2902        let body_string: Option<Vec<u8>> = None;
2903        
2904        // Sign the request
2905        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        // Add signature to query params
2911        query_params.push(("signature".to_string(), signature));
2912    }
2913
2914    // Apply all query parameters
2915    if !query_params.is_empty() {
2916        req_builder = req_builder.query(&query_params);
2917    }
2918
2919
2920    // Add user agent if configured
2921    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    // Apply all header parameters
2926    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&lt;models::GetAssetWalletBalanceV1RespItem&gt;`"))),
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&lt;models::GetAssetWalletBalanceV1RespItem&gt;`")))),
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
2956/// Get information of coins (available for deposit and withdraw) for user.
2957pub 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    // Create a mutable vector for query parameters
2963    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    // Create header parameters collection
2971    let mut header_params = std::collections::HashMap::new();
2972
2973    // Handle Binance Auth first if configured
2974    if let Some(ref binance_auth) = configuration.binance_auth {
2975        // Add API key to headers
2976        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
2977        
2978        // Generate request body for signing (if any)
2979        let body_string: Option<Vec<u8>> = None;
2980        
2981        // Sign the request
2982        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        // Add signature to query params
2988        query_params.push(("signature".to_string(), signature));
2989    }
2990
2991    // Apply all query parameters
2992    if !query_params.is_empty() {
2993        req_builder = req_builder.query(&query_params);
2994    }
2995
2996
2997    // Add user agent if configured
2998    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    // Apply all header parameters
3003    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&lt;models::GetCapitalConfigGetallV1RespItem&gt;`"))),
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&lt;models::GetCapitalConfigGetallV1RespItem&gt;`")))),
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
3033/// Fetch deposit address list with network.
3034pub 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    // Create a mutable vector for query parameters
3040    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    // Create header parameters collection
3049    let mut header_params = std::collections::HashMap::new();
3050
3051    // Handle Binance Auth first if configured
3052    if let Some(ref binance_auth) = configuration.binance_auth {
3053        // Add API key to headers
3054        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
3055        
3056        // Generate request body for signing (if any)
3057        let body_string: Option<Vec<u8>> = None;
3058        
3059        // Sign the request
3060        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        // Add signature to query params
3066        query_params.push(("signature".to_string(), signature));
3067    }
3068
3069    // Apply all query parameters
3070    if !query_params.is_empty() {
3071        req_builder = req_builder.query(&query_params);
3072    }
3073
3074
3075    // Add user agent if configured
3076    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    // Apply all header parameters
3081    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&lt;models::GetCapitalDepositAddressListV1RespItem&gt;`"))),
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&lt;models::GetCapitalDepositAddressListV1RespItem&gt;`")))),
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
3111/// Fetch deposit address with network.
3112pub 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    // Create a mutable vector for query parameters
3118    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    // Create header parameters collection
3133    let mut header_params = std::collections::HashMap::new();
3134
3135    // Handle Binance Auth first if configured
3136    if let Some(ref binance_auth) = configuration.binance_auth {
3137        // Add API key to headers
3138        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
3139        
3140        // Generate request body for signing (if any)
3141        let body_string: Option<Vec<u8>> = None;
3142        
3143        // Sign the request
3144        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        // Add signature to query params
3150        query_params.push(("signature".to_string(), signature));
3151    }
3152
3153    // Apply all query parameters
3154    if !query_params.is_empty() {
3155        req_builder = req_builder.query(&query_params);
3156    }
3157
3158
3159    // Add user agent if configured
3160    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    // Apply all header parameters
3165    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
3195/// Fetch deposit history.
3196pub 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    // Create a mutable vector for query parameters
3202    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    // Create header parameters collection
3234    let mut header_params = std::collections::HashMap::new();
3235
3236    // Handle Binance Auth first if configured
3237    if let Some(ref binance_auth) = configuration.binance_auth {
3238        // Add API key to headers
3239        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
3240        
3241        // Generate request body for signing (if any)
3242        let body_string: Option<Vec<u8>> = None;
3243        
3244        // Sign the request
3245        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        // Add signature to query params
3251        query_params.push(("signature".to_string(), signature));
3252    }
3253
3254    // Apply all query parameters
3255    if !query_params.is_empty() {
3256        req_builder = req_builder.query(&query_params);
3257    }
3258
3259
3260    // Add user agent if configured
3261    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    // Apply all header parameters
3266    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&lt;models::GetCapitalDepositHisrecV1RespItem&gt;`"))),
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&lt;models::GetCapitalDepositHisrecV1RespItem&gt;`")))),
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
3296/// Fetch withdraw address list
3297pub 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    // Create a mutable vector for query parameters
3303    let mut query_params: Vec<(String, String)> = Vec::new();
3304
3305
3306    // Create header parameters collection
3307    let mut header_params = std::collections::HashMap::new();
3308
3309    // Handle Binance Auth first if configured
3310    if let Some(ref binance_auth) = configuration.binance_auth {
3311        // Add API key to headers
3312        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
3313        
3314        // Generate request body for signing (if any)
3315        let body_string: Option<Vec<u8>> = None;
3316        
3317        // Sign the request
3318        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        // Add signature to query params
3324        query_params.push(("signature".to_string(), signature));
3325    }
3326
3327    // Apply all query parameters
3328    if !query_params.is_empty() {
3329        req_builder = req_builder.query(&query_params);
3330    }
3331
3332
3333    // Add user agent if configured
3334    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    // Apply all header parameters
3339    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&lt;models::GetCapitalWithdrawAddressListV1RespItem&gt;`"))),
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&lt;models::GetCapitalWithdrawAddressListV1RespItem&gt;`")))),
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
3369/// Fetch withdraw history.
3370pub 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    // Create a mutable vector for query parameters
3376    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    // Create header parameters collection
3408    let mut header_params = std::collections::HashMap::new();
3409
3410    // Handle Binance Auth first if configured
3411    if let Some(ref binance_auth) = configuration.binance_auth {
3412        // Add API key to headers
3413        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
3414        
3415        // Generate request body for signing (if any)
3416        let body_string: Option<Vec<u8>> = None;
3417        
3418        // Sign the request
3419        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        // Add signature to query params
3425        query_params.push(("signature".to_string(), signature));
3426    }
3427
3428    // Apply all query parameters
3429    if !query_params.is_empty() {
3430        req_builder = req_builder.query(&query_params);
3431    }
3432
3433
3434    // Add user agent if configured
3435    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    // Apply all header parameters
3440    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&lt;models::GetCapitalWithdrawHistoryV1RespItem&gt;`"))),
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&lt;models::GetCapitalWithdrawHistoryV1RespItem&gt;`")))),
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
3470/// Fetch deposit history for local entities that required travel rule.
3471pub 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    // Create a mutable vector for query parameters
3477    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    // Create header parameters collection
3515    let mut header_params = std::collections::HashMap::new();
3516
3517    // Handle Binance Auth first if configured
3518    if let Some(ref binance_auth) = configuration.binance_auth {
3519        // Add API key to headers
3520        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
3521        
3522        // Generate request body for signing (if any)
3523        let body_string: Option<Vec<u8>> = None;
3524        
3525        // Sign the request
3526        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        // Add signature to query params
3532        query_params.push(("signature".to_string(), signature));
3533    }
3534
3535    // Apply all query parameters
3536    if !query_params.is_empty() {
3537        req_builder = req_builder.query(&query_params);
3538    }
3539
3540
3541    // Add user agent if configured
3542    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    // Apply all header parameters
3547    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&lt;models::GetLocalentityDepositHistoryV1RespItem&gt;`"))),
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&lt;models::GetLocalentityDepositHistoryV1RespItem&gt;`")))),
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
3577/// Fetch the onboarded VASP list for local entities that required travel rule.
3578pub 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    // Create a mutable vector for query parameters
3584    let mut query_params: Vec<(String, String)> = Vec::new();
3585
3586
3587    // Create header parameters collection
3588    let mut header_params = std::collections::HashMap::new();
3589
3590    // Handle Binance Auth first if configured
3591    if let Some(ref binance_auth) = configuration.binance_auth {
3592        // Add API key to headers
3593        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
3594        
3595        // Generate request body for signing (if any)
3596        let body_string: Option<Vec<u8>> = None;
3597        
3598        // Sign the request
3599        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        // Add signature to query params
3605        query_params.push(("signature".to_string(), signature));
3606    }
3607
3608    // Apply all query parameters
3609    if !query_params.is_empty() {
3610        req_builder = req_builder.query(&query_params);
3611    }
3612
3613
3614    // Add user agent if configured
3615    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    // Apply all header parameters
3620    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&lt;models::GetLocalentityVaspV1RespItem&gt;`"))),
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&lt;models::GetLocalentityVaspV1RespItem&gt;`")))),
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
3650/// Fetch withdraw history for local entities that required travel rule.
3651pub 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    // Create a mutable vector for query parameters
3657    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    // Create header parameters collection
3695    let mut header_params = std::collections::HashMap::new();
3696
3697    // Handle Binance Auth first if configured
3698    if let Some(ref binance_auth) = configuration.binance_auth {
3699        // Add API key to headers
3700        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
3701        
3702        // Generate request body for signing (if any)
3703        let body_string: Option<Vec<u8>> = None;
3704        
3705        // Sign the request
3706        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        // Add signature to query params
3712        query_params.push(("signature".to_string(), signature));
3713    }
3714
3715    // Apply all query parameters
3716    if !query_params.is_empty() {
3717        req_builder = req_builder.query(&query_params);
3718    }
3719
3720
3721    // Add user agent if configured
3722    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    // Apply all header parameters
3727    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&lt;models::GetLocalentityWithdrawHistoryV1RespItem&gt;`"))),
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&lt;models::GetLocalentityWithdrawHistoryV1RespItem&gt;`")))),
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
3757/// Fetch withdraw history for local entities that required travel rule.
3758pub 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    // Create a mutable vector for query parameters
3764    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    // Create header parameters collection
3802    let mut header_params = std::collections::HashMap::new();
3803
3804    // Handle Binance Auth first if configured
3805    if let Some(ref binance_auth) = configuration.binance_auth {
3806        // Add API key to headers
3807        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
3808        
3809        // Generate request body for signing (if any)
3810        let body_string: Option<Vec<u8>> = None;
3811        
3812        // Sign the request
3813        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        // Add signature to query params
3819        query_params.push(("signature".to_string(), signature));
3820    }
3821
3822    // Apply all query parameters
3823    if !query_params.is_empty() {
3824        req_builder = req_builder.query(&query_params);
3825    }
3826
3827
3828    // Add user agent if configured
3829    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    // Apply all header parameters
3834    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&lt;models::GetLocalentityWithdrawHistoryV2RespItem&gt;`"))),
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&lt;models::GetLocalentityWithdrawHistoryV2RespItem&gt;`")))),
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
3864/// Get symbols delist schedule for spot
3865pub 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    // Create a mutable vector for query parameters
3871    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    // Create header parameters collection
3879    let mut header_params = std::collections::HashMap::new();
3880
3881    // Handle Binance Auth first if configured
3882    if let Some(ref binance_auth) = configuration.binance_auth {
3883        // Add API key to headers
3884        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
3885        
3886        // Generate request body for signing (if any)
3887        let body_string: Option<Vec<u8>> = None;
3888        
3889        // Sign the request
3890        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        // Add signature to query params
3896        query_params.push(("signature".to_string(), signature));
3897    }
3898
3899    // Apply all query parameters
3900    if !query_params.is_empty() {
3901        req_builder = req_builder.query(&query_params);
3902    }
3903
3904
3905    // Add user agent if configured
3906    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    // Apply all header parameters
3911    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&lt;models::GetSpotDelistScheduleV1RespItem&gt;`"))),
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&lt;models::GetSpotDelistScheduleV1RespItem&gt;`")))),
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
3941/// Get the list of symbols that are scheduled to be opened for trading in the market.
3942pub 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    // Create a mutable vector for query parameters
3948    let mut query_params: Vec<(String, String)> = Vec::new();
3949
3950
3951    // Create header parameters collection
3952    let mut header_params = std::collections::HashMap::new();
3953
3954    // Handle Binance Auth first if configured
3955    if let Some(ref binance_auth) = configuration.binance_auth {
3956        // Add API key to headers
3957        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
3958        
3959        // Generate request body for signing (if any)
3960        let body_string: Option<Vec<u8>> = None;
3961        
3962        // Sign the request
3963        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        // Add signature to query params
3969        query_params.push(("signature".to_string(), signature));
3970    }
3971
3972    // Apply all query parameters
3973    if !query_params.is_empty() {
3974        req_builder = req_builder.query(&query_params);
3975    }
3976
3977
3978    // Add user agent if configured
3979    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    // Apply all header parameters
3984    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&lt;models::GetSpotOpenSymbolListV1RespItem&gt;`"))),
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&lt;models::GetSpotOpenSymbolListV1RespItem&gt;`")))),
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
4014/// Fetch system status.
4015pub 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    // Create a mutable vector for query parameters
4021    let mut query_params: Vec<(String, String)> = Vec::new();
4022
4023
4024    // Create header parameters collection
4025    let mut header_params = std::collections::HashMap::new();
4026
4027    // Handle Binance Auth first if configured
4028    if let Some(ref binance_auth) = configuration.binance_auth {
4029        // Add API key to headers
4030        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
4031        
4032        // Generate request body for signing (if any)
4033        let body_string: Option<Vec<u8>> = None;
4034        
4035        // Sign the request
4036        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        // Add signature to query params
4042        query_params.push(("signature".to_string(), signature));
4043    }
4044
4045    // Apply all query parameters
4046    if !query_params.is_empty() {
4047        req_builder = req_builder.query(&query_params);
4048    }
4049
4050
4051    // Add user agent if configured
4052    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    // Apply all header parameters
4057    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
4087/// Submit questionnaire for brokers of local entities that require travel rule. The questionnaire is only applies to transactions from un-hosted wallets or VASPs that are not yet onboarded with GTR.
4088pub 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    // Create a mutable vector for query parameters
4094    let mut query_params: Vec<(String, String)> = Vec::new();
4095
4096
4097    // Create header parameters collection
4098    let mut header_params = std::collections::HashMap::new();
4099
4100    // Handle Binance Auth first if configured
4101    if let Some(ref binance_auth) = configuration.binance_auth {
4102        // Add API key to headers
4103        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
4104        
4105        // Generate request body for signing (if any)
4106        let body_string: Option<Vec<u8>> = None;
4107        
4108        // Sign the request
4109        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        // Add signature to query params
4115        query_params.push(("signature".to_string(), signature));
4116    }
4117
4118    // Apply all query parameters
4119    if !query_params.is_empty() {
4120        req_builder = req_builder.query(&query_params);
4121    }
4122
4123
4124    // Add user agent if configured
4125    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    // Apply all header parameters
4130    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
4183/// Submit questionnaire for local entities that require travel rule. The questionnaire is only applies to transactions from unhosted wallets or VASPs that are not yet onboarded with GTR.
4184pub 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    // Create a mutable vector for query parameters
4190    let mut query_params: Vec<(String, String)> = Vec::new();
4191
4192
4193    // Create header parameters collection
4194    let mut header_params = std::collections::HashMap::new();
4195
4196    // Handle Binance Auth first if configured
4197    if let Some(ref binance_auth) = configuration.binance_auth {
4198        // Add API key to headers
4199        header_params.insert("X-MBX-APIKEY".to_string(), binance_auth.api_key().to_string());
4200        
4201        // Generate request body for signing (if any)
4202        let body_string: Option<Vec<u8>> = None;
4203        
4204        // Sign the request
4205        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        // Add signature to query params
4211        query_params.push(("signature".to_string(), signature));
4212    }
4213
4214    // Apply all query parameters
4215    if !query_params.is_empty() {
4216        req_builder = req_builder.query(&query_params);
4217    }
4218
4219
4220    // Add user agent if configured
4221    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    // Apply all header parameters
4226    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