binance_sdk/wallet/rest_api/mod.rs
1/*
2 * Binance Wallet REST API
3 *
4 * OpenAPI Specification for the Binance Wallet REST API
5 *
6 * The version of the OpenAPI document: 1.0.0
7 *
8 *
9 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
10 * https://openapi-generator.tech
11 * Do not edit the class manually.
12 */
13
14#![allow(unused_imports)]
15use http::Method;
16use serde::de::DeserializeOwned;
17use serde_json::Value;
18use std::collections::BTreeMap;
19
20use crate::common::{config::ConfigurationRestApi, models::RestApiResponse, utils::send_request};
21
22mod apis;
23mod models;
24
25pub use apis::*;
26pub use models::*;
27
28#[derive(Debug, Clone)]
29pub struct RestApi {
30 configuration: ConfigurationRestApi,
31 account_api_client: AccountApiClient,
32 asset_api_client: AssetApiClient,
33 capital_api_client: CapitalApiClient,
34 others_api_client: OthersApiClient,
35 travel_rule_api_client: TravelRuleApiClient,
36}
37
38impl RestApi {
39 pub fn new(configuration: ConfigurationRestApi) -> Self {
40 let account_api_client = AccountApiClient::new(configuration.clone());
41 let asset_api_client = AssetApiClient::new(configuration.clone());
42 let capital_api_client = CapitalApiClient::new(configuration.clone());
43 let others_api_client = OthersApiClient::new(configuration.clone());
44 let travel_rule_api_client = TravelRuleApiClient::new(configuration.clone());
45
46 Self {
47 configuration,
48 account_api_client,
49 asset_api_client,
50 capital_api_client,
51 others_api_client,
52 travel_rule_api_client,
53 }
54 }
55
56 /// Send an unsigned request to the API
57 ///
58 /// # Arguments
59 ///
60 /// * `endpoint` - The API endpoint to send the request to
61 /// * `method` - The HTTP method to use for the request
62 /// * `query_params` - A map of query parameters to send with the request
63 /// * `body_params` - A map of body parameters to send with the request
64 ///
65 /// # Returns
66 ///
67 /// A `RestApiResponse` containing the deserialized response data on success, or an error if the request fails
68 ///
69 /// # Errors
70 ///
71 /// Returns an `anyhow::Error` if the HTTP request fails or if parsing the response fails
72 pub async fn send_request<R: DeserializeOwned + Send + 'static>(
73 &self,
74 endpoint: &str,
75 method: Method,
76 query_params: BTreeMap<String, Value>,
77 body_params: BTreeMap<String, Value>,
78 ) -> anyhow::Result<RestApiResponse<R>> {
79 send_request::<R>(
80 &self.configuration,
81 endpoint,
82 method,
83 query_params,
84 body_params,
85 None,
86 false,
87 )
88 .await
89 }
90
91 /// Send a signed request to the API
92 ///
93 /// # Arguments
94 ///
95 /// * `endpoint` - The API endpoint to send the request to
96 /// * `method` - The HTTP method to use for the request
97 /// * `query_params` - A map of query parameters to send with the request
98 /// * `body_params` - A map of body parameters to send with the request
99 ///
100 /// # Returns
101 ///
102 /// A `RestApiResponse` containing the deserialized response data on success, or an error if the request fails
103 ///
104 /// # Errors
105 ///
106 /// Returns an `anyhow::Error` if the HTTP request fails or if parsing the response fails
107 pub async fn send_signed_request<R: DeserializeOwned + Send + 'static>(
108 &self,
109 endpoint: &str,
110 method: Method,
111 query_params: BTreeMap<String, Value>,
112 body_params: BTreeMap<String, Value>,
113 ) -> anyhow::Result<RestApiResponse<R>> {
114 send_request::<R>(
115 &self.configuration,
116 endpoint,
117 method,
118 query_params,
119 body_params,
120 None,
121 true,
122 )
123 .await
124 }
125
126 /// Account API Trading Status (`USER_DATA`)
127 ///
128 /// Fetch account api trading status detail.
129 ///
130 /// Weight: 1
131 ///
132 /// # Arguments
133 ///
134 /// - `params`: [`AccountApiTradingStatusParams`]
135 /// The parameters for this operation.
136 ///
137 /// # Returns
138 ///
139 /// [`RestApiResponse<models::AccountApiTradingStatusResponse>`] on success.
140 ///
141 /// # Errors
142 ///
143 /// This function will return an [`anyhow::Error`] if:
144 /// - the HTTP request fails
145 /// - any parameter is invalid
146 /// - the response cannot be parsed
147 /// - or one of the following occurs:
148 /// - `RequiredError`
149 /// - `ConnectorClientError`
150 /// - `UnauthorizedError`
151 /// - `ForbiddenError`
152 /// - `TooManyRequestsError`
153 /// - `RateLimitBanError`
154 /// - `ServerError`
155 /// - `NotFoundError`
156 /// - `NetworkError`
157 /// - `BadRequestError`
158 ///
159 ///
160 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/wallet/account/Account-API-Trading-Status).
161 ///
162 pub async fn account_api_trading_status(
163 &self,
164 params: AccountApiTradingStatusParams,
165 ) -> anyhow::Result<RestApiResponse<models::AccountApiTradingStatusResponse>> {
166 self.account_api_client
167 .account_api_trading_status(params)
168 .await
169 }
170
171 /// Account info (`USER_DATA`)
172 ///
173 /// Fetch account info detail.
174 ///
175 /// Weight: 1
176 ///
177 /// # Arguments
178 ///
179 /// - `params`: [`AccountInfoParams`]
180 /// The parameters for this operation.
181 ///
182 /// # Returns
183 ///
184 /// [`RestApiResponse<models::AccountInfoResponse>`] on success.
185 ///
186 /// # Errors
187 ///
188 /// This function will return an [`anyhow::Error`] if:
189 /// - the HTTP request fails
190 /// - any parameter is invalid
191 /// - the response cannot be parsed
192 /// - or one of the following occurs:
193 /// - `RequiredError`
194 /// - `ConnectorClientError`
195 /// - `UnauthorizedError`
196 /// - `ForbiddenError`
197 /// - `TooManyRequestsError`
198 /// - `RateLimitBanError`
199 /// - `ServerError`
200 /// - `NotFoundError`
201 /// - `NetworkError`
202 /// - `BadRequestError`
203 ///
204 ///
205 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/wallet/account/Account-info).
206 ///
207 pub async fn account_info(
208 &self,
209 params: AccountInfoParams,
210 ) -> anyhow::Result<RestApiResponse<models::AccountInfoResponse>> {
211 self.account_api_client.account_info(params).await
212 }
213
214 /// Account Status (`USER_DATA`)
215 ///
216 /// Fetch account status detail.
217 ///
218 /// Weight: 1
219 ///
220 /// # Arguments
221 ///
222 /// - `params`: [`AccountStatusParams`]
223 /// The parameters for this operation.
224 ///
225 /// # Returns
226 ///
227 /// [`RestApiResponse<models::AccountStatusResponse>`] on success.
228 ///
229 /// # Errors
230 ///
231 /// This function will return an [`anyhow::Error`] if:
232 /// - the HTTP request fails
233 /// - any parameter is invalid
234 /// - the response cannot be parsed
235 /// - or one of the following occurs:
236 /// - `RequiredError`
237 /// - `ConnectorClientError`
238 /// - `UnauthorizedError`
239 /// - `ForbiddenError`
240 /// - `TooManyRequestsError`
241 /// - `RateLimitBanError`
242 /// - `ServerError`
243 /// - `NotFoundError`
244 /// - `NetworkError`
245 /// - `BadRequestError`
246 ///
247 ///
248 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/wallet/account/Account-Status).
249 ///
250 pub async fn account_status(
251 &self,
252 params: AccountStatusParams,
253 ) -> anyhow::Result<RestApiResponse<models::AccountStatusResponse>> {
254 self.account_api_client.account_status(params).await
255 }
256
257 /// Daily Account Snapshot (`USER_DATA`)
258 ///
259 /// Daily account snapshot
260 ///
261 /// * The query time period must be less then 30 days
262 /// * Support query within the last one month only
263 /// * If startTimeand endTime not sent, return records of the last 7 days by default
264 ///
265 /// Weight: 2400
266 ///
267 /// # Arguments
268 ///
269 /// - `params`: [`DailyAccountSnapshotParams`]
270 /// The parameters for this operation.
271 ///
272 /// # Returns
273 ///
274 /// [`RestApiResponse<models::DailyAccountSnapshotResponse>`] on success.
275 ///
276 /// # Errors
277 ///
278 /// This function will return an [`anyhow::Error`] if:
279 /// - the HTTP request fails
280 /// - any parameter is invalid
281 /// - the response cannot be parsed
282 /// - or one of the following occurs:
283 /// - `RequiredError`
284 /// - `ConnectorClientError`
285 /// - `UnauthorizedError`
286 /// - `ForbiddenError`
287 /// - `TooManyRequestsError`
288 /// - `RateLimitBanError`
289 /// - `ServerError`
290 /// - `NotFoundError`
291 /// - `NetworkError`
292 /// - `BadRequestError`
293 ///
294 ///
295 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/wallet/account/daily-account-snapshoot).
296 ///
297 pub async fn daily_account_snapshot(
298 &self,
299 params: DailyAccountSnapshotParams,
300 ) -> anyhow::Result<RestApiResponse<models::DailyAccountSnapshotResponse>> {
301 self.account_api_client.daily_account_snapshot(params).await
302 }
303
304 /// Disable Fast Withdraw Switch (`USER_DATA`)
305 ///
306 ///
307 /// Weight: 1
308 ///
309 /// # Arguments
310 ///
311 /// - `params`: [`DisableFastWithdrawSwitchParams`]
312 /// The parameters for this operation.
313 ///
314 /// # Returns
315 ///
316 /// [`RestApiResponse<Value>`] on success.
317 ///
318 /// # Errors
319 ///
320 /// This function will return an [`anyhow::Error`] if:
321 /// - the HTTP request fails
322 /// - any parameter is invalid
323 /// - the response cannot be parsed
324 /// - or one of the following occurs:
325 /// - `RequiredError`
326 /// - `ConnectorClientError`
327 /// - `UnauthorizedError`
328 /// - `ForbiddenError`
329 /// - `TooManyRequestsError`
330 /// - `RateLimitBanError`
331 /// - `ServerError`
332 /// - `NotFoundError`
333 /// - `NetworkError`
334 /// - `BadRequestError`
335 ///
336 ///
337 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/wallet/account/Disable-Fast-Withdraw-Switch).
338 ///
339 pub async fn disable_fast_withdraw_switch(
340 &self,
341 params: DisableFastWithdrawSwitchParams,
342 ) -> anyhow::Result<RestApiResponse<Value>> {
343 self.account_api_client
344 .disable_fast_withdraw_switch(params)
345 .await
346 }
347
348 /// Enable Fast Withdraw Switch (`USER_DATA`)
349 ///
350 /// Enable Fast Withdraw Switch (`USER_DATA`)
351 ///
352 /// * This request will enable fastwithdraw switch under your account. <br></br>
353 /// * When Fast Withdraw Switch is on, transferring funds to a Binance account will be done instantly. There is no on-chain transaction, no transaction ID and no withdrawal fee.
354 ///
355 /// Weight: 1
356 ///
357 /// # Arguments
358 ///
359 /// - `params`: [`EnableFastWithdrawSwitchParams`]
360 /// The parameters for this operation.
361 ///
362 /// # Returns
363 ///
364 /// [`RestApiResponse<Value>`] on success.
365 ///
366 /// # Errors
367 ///
368 /// This function will return an [`anyhow::Error`] if:
369 /// - the HTTP request fails
370 /// - any parameter is invalid
371 /// - the response cannot be parsed
372 /// - or one of the following occurs:
373 /// - `RequiredError`
374 /// - `ConnectorClientError`
375 /// - `UnauthorizedError`
376 /// - `ForbiddenError`
377 /// - `TooManyRequestsError`
378 /// - `RateLimitBanError`
379 /// - `ServerError`
380 /// - `NotFoundError`
381 /// - `NetworkError`
382 /// - `BadRequestError`
383 ///
384 ///
385 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/wallet/account/Enable-Fast-Withdraw-Switch).
386 ///
387 pub async fn enable_fast_withdraw_switch(
388 &self,
389 params: EnableFastWithdrawSwitchParams,
390 ) -> anyhow::Result<RestApiResponse<Value>> {
391 self.account_api_client
392 .enable_fast_withdraw_switch(params)
393 .await
394 }
395
396 /// Get API Key Permission (`USER_DATA`)
397 ///
398 /// Get API Key Permission
399 ///
400 /// Weight: 1
401 ///
402 /// # Arguments
403 ///
404 /// - `params`: [`GetApiKeyPermissionParams`]
405 /// The parameters for this operation.
406 ///
407 /// # Returns
408 ///
409 /// [`RestApiResponse<models::GetApiKeyPermissionResponse>`] on success.
410 ///
411 /// # Errors
412 ///
413 /// This function will return an [`anyhow::Error`] if:
414 /// - the HTTP request fails
415 /// - any parameter is invalid
416 /// - the response cannot be parsed
417 /// - or one of the following occurs:
418 /// - `RequiredError`
419 /// - `ConnectorClientError`
420 /// - `UnauthorizedError`
421 /// - `ForbiddenError`
422 /// - `TooManyRequestsError`
423 /// - `RateLimitBanError`
424 /// - `ServerError`
425 /// - `NotFoundError`
426 /// - `NetworkError`
427 /// - `BadRequestError`
428 ///
429 ///
430 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/wallet/account/api-key-permission).
431 ///
432 pub async fn get_api_key_permission(
433 &self,
434 params: GetApiKeyPermissionParams,
435 ) -> anyhow::Result<RestApiResponse<models::GetApiKeyPermissionResponse>> {
436 self.account_api_client.get_api_key_permission(params).await
437 }
438
439 /// Asset Detail (`USER_DATA`)
440 ///
441 /// Fetch details of assets supported on Binance.
442 ///
443 ///
444 /// * Please get network and other deposit or withdraw details from ``GET /sapi/v1/capital/config/getall``.
445 ///
446 /// Weight: 1
447 ///
448 /// # Arguments
449 ///
450 /// - `params`: [`AssetDetailParams`]
451 /// The parameters for this operation.
452 ///
453 /// # Returns
454 ///
455 /// [`RestApiResponse<models::AssetDetailResponse>`] on success.
456 ///
457 /// # Errors
458 ///
459 /// This function will return an [`anyhow::Error`] if:
460 /// - the HTTP request fails
461 /// - any parameter is invalid
462 /// - the response cannot be parsed
463 /// - or one of the following occurs:
464 /// - `RequiredError`
465 /// - `ConnectorClientError`
466 /// - `UnauthorizedError`
467 /// - `ForbiddenError`
468 /// - `TooManyRequestsError`
469 /// - `RateLimitBanError`
470 /// - `ServerError`
471 /// - `NotFoundError`
472 /// - `NetworkError`
473 /// - `BadRequestError`
474 ///
475 ///
476 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/wallet/asset/Asset-Detail).
477 ///
478 pub async fn asset_detail(
479 &self,
480 params: AssetDetailParams,
481 ) -> anyhow::Result<RestApiResponse<models::AssetDetailResponse>> {
482 self.asset_api_client.asset_detail(params).await
483 }
484
485 /// Asset Dividend Record (`USER_DATA`)
486 ///
487 /// Query asset dividend record.
488 ///
489 ///
490 /// * There cannot be more than 180 days between parameter `startTime` and `endTime`.
491 ///
492 /// Weight: 10
493 ///
494 /// # Arguments
495 ///
496 /// - `params`: [`AssetDividendRecordParams`]
497 /// The parameters for this operation.
498 ///
499 /// # Returns
500 ///
501 /// [`RestApiResponse<models::AssetDividendRecordResponse>`] on success.
502 ///
503 /// # Errors
504 ///
505 /// This function will return an [`anyhow::Error`] if:
506 /// - the HTTP request fails
507 /// - any parameter is invalid
508 /// - the response cannot be parsed
509 /// - or one of the following occurs:
510 /// - `RequiredError`
511 /// - `ConnectorClientError`
512 /// - `UnauthorizedError`
513 /// - `ForbiddenError`
514 /// - `TooManyRequestsError`
515 /// - `RateLimitBanError`
516 /// - `ServerError`
517 /// - `NotFoundError`
518 /// - `NetworkError`
519 /// - `BadRequestError`
520 ///
521 ///
522 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/wallet/asset/assets-divided-record).
523 ///
524 pub async fn asset_dividend_record(
525 &self,
526 params: AssetDividendRecordParams,
527 ) -> anyhow::Result<RestApiResponse<models::AssetDividendRecordResponse>> {
528 self.asset_api_client.asset_dividend_record(params).await
529 }
530
531 /// Dust Convert (`USER_DATA`)
532 ///
533 /// Convert dust assets
534 ///
535 /// Weight: 10
536 ///
537 /// # Arguments
538 ///
539 /// - `params`: [`DustConvertParams`]
540 /// The parameters for this operation.
541 ///
542 /// # Returns
543 ///
544 /// [`RestApiResponse<models::DustConvertResponse>`] on success.
545 ///
546 /// # Errors
547 ///
548 /// This function will return an [`anyhow::Error`] if:
549 /// - the HTTP request fails
550 /// - any parameter is invalid
551 /// - the response cannot be parsed
552 /// - or one of the following occurs:
553 /// - `RequiredError`
554 /// - `ConnectorClientError`
555 /// - `UnauthorizedError`
556 /// - `ForbiddenError`
557 /// - `TooManyRequestsError`
558 /// - `RateLimitBanError`
559 /// - `ServerError`
560 /// - `NotFoundError`
561 /// - `NetworkError`
562 /// - `BadRequestError`
563 ///
564 ///
565 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/wallet/asset/Dust-Convert).
566 ///
567 pub async fn dust_convert(
568 &self,
569 params: DustConvertParams,
570 ) -> anyhow::Result<RestApiResponse<models::DustConvertResponse>> {
571 self.asset_api_client.dust_convert(params).await
572 }
573
574 /// Dust Convertible Assets (`USER_DATA`)
575 ///
576 /// Query dust convertible assets
577 ///
578 /// Weight: 1
579 ///
580 /// # Arguments
581 ///
582 /// - `params`: [`DustConvertibleAssetsParams`]
583 /// The parameters for this operation.
584 ///
585 /// # Returns
586 ///
587 /// [`RestApiResponse<models::DustConvertibleAssetsResponse>`] on success.
588 ///
589 /// # Errors
590 ///
591 /// This function will return an [`anyhow::Error`] if:
592 /// - the HTTP request fails
593 /// - any parameter is invalid
594 /// - the response cannot be parsed
595 /// - or one of the following occurs:
596 /// - `RequiredError`
597 /// - `ConnectorClientError`
598 /// - `UnauthorizedError`
599 /// - `ForbiddenError`
600 /// - `TooManyRequestsError`
601 /// - `RateLimitBanError`
602 /// - `ServerError`
603 /// - `NotFoundError`
604 /// - `NetworkError`
605 /// - `BadRequestError`
606 ///
607 ///
608 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/wallet/asset/Dust-Convertible-Assets).
609 ///
610 pub async fn dust_convertible_assets(
611 &self,
612 params: DustConvertibleAssetsParams,
613 ) -> anyhow::Result<RestApiResponse<models::DustConvertibleAssetsResponse>> {
614 self.asset_api_client.dust_convertible_assets(params).await
615 }
616
617 /// Dust Transfer (`USER_DATA`)
618 ///
619 /// Convert dust assets to BNB.
620 ///
621 /// * You need to open`Enable Spot & Margin Trading` permission for the API Key which requests this endpoint.
622 ///
623 /// Weight: 10
624 ///
625 /// # Arguments
626 ///
627 /// - `params`: [`DustTransferParams`]
628 /// The parameters for this operation.
629 ///
630 /// # Returns
631 ///
632 /// [`RestApiResponse<models::DustTransferResponse>`] on success.
633 ///
634 /// # Errors
635 ///
636 /// This function will return an [`anyhow::Error`] if:
637 /// - the HTTP request fails
638 /// - any parameter is invalid
639 /// - the response cannot be parsed
640 /// - or one of the following occurs:
641 /// - `RequiredError`
642 /// - `ConnectorClientError`
643 /// - `UnauthorizedError`
644 /// - `ForbiddenError`
645 /// - `TooManyRequestsError`
646 /// - `RateLimitBanError`
647 /// - `ServerError`
648 /// - `NotFoundError`
649 /// - `NetworkError`
650 /// - `BadRequestError`
651 ///
652 ///
653 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/wallet/asset/Dust-Transfer).
654 ///
655 pub async fn dust_transfer(
656 &self,
657 params: DustTransferParams,
658 ) -> anyhow::Result<RestApiResponse<models::DustTransferResponse>> {
659 self.asset_api_client.dust_transfer(params).await
660 }
661
662 /// `DustLog(USER_DATA)`
663 ///
664 /// Dustlog
665 ///
666 /// * Only return last 100 records
667 /// * Only return records after 2020/12/01
668 ///
669 /// Weight: 1
670 ///
671 /// # Arguments
672 ///
673 /// - `params`: [`DustlogParams`]
674 /// The parameters for this operation.
675 ///
676 /// # Returns
677 ///
678 /// [`RestApiResponse<models::DustlogResponse>`] on success.
679 ///
680 /// # Errors
681 ///
682 /// This function will return an [`anyhow::Error`] if:
683 /// - the HTTP request fails
684 /// - any parameter is invalid
685 /// - the response cannot be parsed
686 /// - or one of the following occurs:
687 /// - `RequiredError`
688 /// - `ConnectorClientError`
689 /// - `UnauthorizedError`
690 /// - `ForbiddenError`
691 /// - `TooManyRequestsError`
692 /// - `RateLimitBanError`
693 /// - `ServerError`
694 /// - `NotFoundError`
695 /// - `NetworkError`
696 /// - `BadRequestError`
697 ///
698 ///
699 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/wallet/asset/dust-log).
700 ///
701 pub async fn dustlog(
702 &self,
703 params: DustlogParams,
704 ) -> anyhow::Result<RestApiResponse<models::DustlogResponse>> {
705 self.asset_api_client.dustlog(params).await
706 }
707
708 /// Funding Wallet (`USER_DATA`)
709 ///
710 /// Query Funding Wallet
711 ///
712 ///
713 /// * Currently supports querying the following business assets:Binance Pay, Binance Card, Binance Gift Card, Stock Token
714 ///
715 /// Weight: 1
716 ///
717 /// # Arguments
718 ///
719 /// - `params`: [`FundingWalletParams`]
720 /// The parameters for this operation.
721 ///
722 /// # Returns
723 ///
724 /// [`RestApiResponse<Vec<models::FundingWalletResponseInner>>`] on success.
725 ///
726 /// # Errors
727 ///
728 /// This function will return an [`anyhow::Error`] if:
729 /// - the HTTP request fails
730 /// - any parameter is invalid
731 /// - the response cannot be parsed
732 /// - or one of the following occurs:
733 /// - `RequiredError`
734 /// - `ConnectorClientError`
735 /// - `UnauthorizedError`
736 /// - `ForbiddenError`
737 /// - `TooManyRequestsError`
738 /// - `RateLimitBanError`
739 /// - `ServerError`
740 /// - `NotFoundError`
741 /// - `NetworkError`
742 /// - `BadRequestError`
743 ///
744 ///
745 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/wallet/asset/Funding-Wallet).
746 ///
747 pub async fn funding_wallet(
748 &self,
749 params: FundingWalletParams,
750 ) -> anyhow::Result<RestApiResponse<Vec<models::FundingWalletResponseInner>>> {
751 self.asset_api_client.funding_wallet(params).await
752 }
753
754 /// Get Assets That Can Be Converted Into BNB (`USER_DATA`)
755 ///
756 /// Get Assets That Can Be Converted Into BNB
757 ///
758 /// Weight: 1
759 ///
760 /// # Arguments
761 ///
762 /// - `params`: [`GetAssetsThatCanBeConvertedIntoBnbParams`]
763 /// The parameters for this operation.
764 ///
765 /// # Returns
766 ///
767 /// [`RestApiResponse<models::GetAssetsThatCanBeConvertedIntoBnbResponse>`] on success.
768 ///
769 /// # Errors
770 ///
771 /// This function will return an [`anyhow::Error`] if:
772 /// - the HTTP request fails
773 /// - any parameter is invalid
774 /// - the response cannot be parsed
775 /// - or one of the following occurs:
776 /// - `RequiredError`
777 /// - `ConnectorClientError`
778 /// - `UnauthorizedError`
779 /// - `ForbiddenError`
780 /// - `TooManyRequestsError`
781 /// - `RateLimitBanError`
782 /// - `ServerError`
783 /// - `NotFoundError`
784 /// - `NetworkError`
785 /// - `BadRequestError`
786 ///
787 ///
788 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/wallet/asset/assets-can-convert-bnb).
789 ///
790 pub async fn get_assets_that_can_be_converted_into_bnb(
791 &self,
792 params: GetAssetsThatCanBeConvertedIntoBnbParams,
793 ) -> anyhow::Result<RestApiResponse<models::GetAssetsThatCanBeConvertedIntoBnbResponse>> {
794 self.asset_api_client
795 .get_assets_that_can_be_converted_into_bnb(params)
796 .await
797 }
798
799 /// Get Cloud-Mining payment and refund history (`USER_DATA`)
800 ///
801 /// The query of Cloud-Mining payment and refund history
802 ///
803 /// * Just return the SUCCESS records of payment and refund.
804 /// * For response, type = 248 means payment, type = 249 means refund, status =S means SUCCESS.
805 ///
806 /// Weight: 600
807 ///
808 /// # Arguments
809 ///
810 /// - `params`: [`GetCloudMiningPaymentAndRefundHistoryParams`]
811 /// The parameters for this operation.
812 ///
813 /// # Returns
814 ///
815 /// [`RestApiResponse<models::GetCloudMiningPaymentAndRefundHistoryResponse>`] on success.
816 ///
817 /// # Errors
818 ///
819 /// This function will return an [`anyhow::Error`] if:
820 /// - the HTTP request fails
821 /// - any parameter is invalid
822 /// - the response cannot be parsed
823 /// - or one of the following occurs:
824 /// - `RequiredError`
825 /// - `ConnectorClientError`
826 /// - `UnauthorizedError`
827 /// - `ForbiddenError`
828 /// - `TooManyRequestsError`
829 /// - `RateLimitBanError`
830 /// - `ServerError`
831 /// - `NotFoundError`
832 /// - `NetworkError`
833 /// - `BadRequestError`
834 ///
835 ///
836 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/wallet/asset/cloud-mining-payment-and-refund-history).
837 ///
838 pub async fn get_cloud_mining_payment_and_refund_history(
839 &self,
840 params: GetCloudMiningPaymentAndRefundHistoryParams,
841 ) -> anyhow::Result<RestApiResponse<models::GetCloudMiningPaymentAndRefundHistoryResponse>>
842 {
843 self.asset_api_client
844 .get_cloud_mining_payment_and_refund_history(params)
845 .await
846 }
847
848 /// Get Open Symbol List (`MARKET_DATA`)
849 ///
850 /// Get the list of symbols that are scheduled to be opened for trading in the market.
851 ///
852 /// Weight: 100
853 ///
854 /// # Arguments
855 ///
856 /// - `params`: [`GetOpenSymbolListParams`]
857 /// The parameters for this operation.
858 ///
859 /// # Returns
860 ///
861 /// [`RestApiResponse<Vec<models::GetOpenSymbolListResponseInner>>`] on success.
862 ///
863 /// # Errors
864 ///
865 /// This function will return an [`anyhow::Error`] if:
866 /// - the HTTP request fails
867 /// - any parameter is invalid
868 /// - the response cannot be parsed
869 /// - or one of the following occurs:
870 /// - `RequiredError`
871 /// - `ConnectorClientError`
872 /// - `UnauthorizedError`
873 /// - `ForbiddenError`
874 /// - `TooManyRequestsError`
875 /// - `RateLimitBanError`
876 /// - `ServerError`
877 /// - `NotFoundError`
878 /// - `NetworkError`
879 /// - `BadRequestError`
880 ///
881 ///
882 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/wallet/asset/open-symbol-list).
883 ///
884 pub async fn get_open_symbol_list(
885 &self,
886 ) -> anyhow::Result<RestApiResponse<Vec<models::GetOpenSymbolListResponseInner>>> {
887 self.asset_api_client.get_open_symbol_list().await
888 }
889
890 /// Query User Delegation History(For Master `Account)(USER_DATA`)
891 ///
892 /// Query User Delegation History
893 ///
894 /// Weight: 60
895 ///
896 /// # Arguments
897 ///
898 /// - `params`: [`QueryUserDelegationHistoryParams`]
899 /// The parameters for this operation.
900 ///
901 /// # Returns
902 ///
903 /// [`RestApiResponse<models::QueryUserDelegationHistoryResponse>`] on success.
904 ///
905 /// # Errors
906 ///
907 /// This function will return an [`anyhow::Error`] if:
908 /// - the HTTP request fails
909 /// - any parameter is invalid
910 /// - the response cannot be parsed
911 /// - or one of the following occurs:
912 /// - `RequiredError`
913 /// - `ConnectorClientError`
914 /// - `UnauthorizedError`
915 /// - `ForbiddenError`
916 /// - `TooManyRequestsError`
917 /// - `RateLimitBanError`
918 /// - `ServerError`
919 /// - `NotFoundError`
920 /// - `NetworkError`
921 /// - `BadRequestError`
922 ///
923 ///
924 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/wallet/asset/query-user-delegation).
925 ///
926 pub async fn query_user_delegation_history(
927 &self,
928 params: QueryUserDelegationHistoryParams,
929 ) -> anyhow::Result<RestApiResponse<models::QueryUserDelegationHistoryResponse>> {
930 self.asset_api_client
931 .query_user_delegation_history(params)
932 .await
933 }
934
935 /// Query User Universal Transfer `History(USER_DATA)`
936 ///
937 /// Query User Universal Transfer History
938 ///
939 ///
940 /// * `fromSymbol` must be sent when type are `ISOLATEDMARGIN_MARGIN` and `ISOLATEDMARGIN_ISOLATEDMARGIN`
941 /// * `toSymbol` must be sent when type are `MARGIN_ISOLATEDMARGIN` and `ISOLATEDMARGIN_ISOLATEDMARGIN`
942 /// * Support query within the last 6 months only
943 /// * If `startTime`and `endTime` not sent, return records of the last 7 days by default
944 ///
945 /// Weight: 1
946 ///
947 /// # Arguments
948 ///
949 /// - `params`: [`QueryUserUniversalTransferHistoryParams`]
950 /// The parameters for this operation.
951 ///
952 /// # Returns
953 ///
954 /// [`RestApiResponse<models::QueryUserUniversalTransferHistoryResponse>`] on success.
955 ///
956 /// # Errors
957 ///
958 /// This function will return an [`anyhow::Error`] if:
959 /// - the HTTP request fails
960 /// - any parameter is invalid
961 /// - the response cannot be parsed
962 /// - or one of the following occurs:
963 /// - `RequiredError`
964 /// - `ConnectorClientError`
965 /// - `UnauthorizedError`
966 /// - `ForbiddenError`
967 /// - `TooManyRequestsError`
968 /// - `RateLimitBanError`
969 /// - `ServerError`
970 /// - `NotFoundError`
971 /// - `NetworkError`
972 /// - `BadRequestError`
973 ///
974 ///
975 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/wallet/asset/query-user-universal-transfer).
976 ///
977 pub async fn query_user_universal_transfer_history(
978 &self,
979 params: QueryUserUniversalTransferHistoryParams,
980 ) -> anyhow::Result<RestApiResponse<models::QueryUserUniversalTransferHistoryResponse>> {
981 self.asset_api_client
982 .query_user_universal_transfer_history(params)
983 .await
984 }
985
986 /// Query User Wallet Balance (`USER_DATA`)
987 ///
988 /// Query User Wallet Balance
989 ///
990 /// Weight: 60
991 ///
992 /// # Arguments
993 ///
994 /// - `params`: [`QueryUserWalletBalanceParams`]
995 /// The parameters for this operation.
996 ///
997 /// # Returns
998 ///
999 /// [`RestApiResponse<Vec<models::QueryUserWalletBalanceResponseInner>>`] on success.
1000 ///
1001 /// # Errors
1002 ///
1003 /// This function will return an [`anyhow::Error`] if:
1004 /// - the HTTP request fails
1005 /// - any parameter is invalid
1006 /// - the response cannot be parsed
1007 /// - or one of the following occurs:
1008 /// - `RequiredError`
1009 /// - `ConnectorClientError`
1010 /// - `UnauthorizedError`
1011 /// - `ForbiddenError`
1012 /// - `TooManyRequestsError`
1013 /// - `RateLimitBanError`
1014 /// - `ServerError`
1015 /// - `NotFoundError`
1016 /// - `NetworkError`
1017 /// - `BadRequestError`
1018 ///
1019 ///
1020 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/wallet/asset/Query-User-Wallet-Balance).
1021 ///
1022 pub async fn query_user_wallet_balance(
1023 &self,
1024 params: QueryUserWalletBalanceParams,
1025 ) -> anyhow::Result<RestApiResponse<Vec<models::QueryUserWalletBalanceResponseInner>>> {
1026 self.asset_api_client
1027 .query_user_wallet_balance(params)
1028 .await
1029 }
1030
1031 /// Toggle BNB Burn On Spot Trade And Margin Interest (`USER_DATA`)
1032 ///
1033 /// Toggle BNB Burn On Spot Trade And Margin Interest
1034 ///
1035 /// * "spotBNBBurn" and "interestBNBBurn" should be sent at least one.
1036 ///
1037 /// Weight: 1(IP)
1038 ///
1039 /// # Arguments
1040 ///
1041 /// - `params`: [`ToggleBnbBurnOnSpotTradeAndMarginInterestParams`]
1042 /// The parameters for this operation.
1043 ///
1044 /// # Returns
1045 ///
1046 /// [`RestApiResponse<models::ToggleBnbBurnOnSpotTradeAndMarginInterestResponse>`] on success.
1047 ///
1048 /// # Errors
1049 ///
1050 /// This function will return an [`anyhow::Error`] if:
1051 /// - the HTTP request fails
1052 /// - any parameter is invalid
1053 /// - the response cannot be parsed
1054 /// - or one of the following occurs:
1055 /// - `RequiredError`
1056 /// - `ConnectorClientError`
1057 /// - `UnauthorizedError`
1058 /// - `ForbiddenError`
1059 /// - `TooManyRequestsError`
1060 /// - `RateLimitBanError`
1061 /// - `ServerError`
1062 /// - `NotFoundError`
1063 /// - `NetworkError`
1064 /// - `BadRequestError`
1065 ///
1066 ///
1067 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/wallet/asset/Toggle-BNB-Burn-On-Spot-Trade-And-Margin-Interest).
1068 ///
1069 pub async fn toggle_bnb_burn_on_spot_trade_and_margin_interest(
1070 &self,
1071 params: ToggleBnbBurnOnSpotTradeAndMarginInterestParams,
1072 ) -> anyhow::Result<RestApiResponse<models::ToggleBnbBurnOnSpotTradeAndMarginInterestResponse>>
1073 {
1074 self.asset_api_client
1075 .toggle_bnb_burn_on_spot_trade_and_margin_interest(params)
1076 .await
1077 }
1078
1079 /// Trade Fee (`USER_DATA`)
1080 ///
1081 /// Fetch trade fee
1082 ///
1083 /// Weight: 1
1084 ///
1085 /// # Arguments
1086 ///
1087 /// - `params`: [`TradeFeeParams`]
1088 /// The parameters for this operation.
1089 ///
1090 /// # Returns
1091 ///
1092 /// [`RestApiResponse<Vec<models::TradeFeeResponseInner>>`] on success.
1093 ///
1094 /// # Errors
1095 ///
1096 /// This function will return an [`anyhow::Error`] if:
1097 /// - the HTTP request fails
1098 /// - any parameter is invalid
1099 /// - the response cannot be parsed
1100 /// - or one of the following occurs:
1101 /// - `RequiredError`
1102 /// - `ConnectorClientError`
1103 /// - `UnauthorizedError`
1104 /// - `ForbiddenError`
1105 /// - `TooManyRequestsError`
1106 /// - `RateLimitBanError`
1107 /// - `ServerError`
1108 /// - `NotFoundError`
1109 /// - `NetworkError`
1110 /// - `BadRequestError`
1111 ///
1112 ///
1113 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/wallet/asset/Trade-Fee).
1114 ///
1115 pub async fn trade_fee(
1116 &self,
1117 params: TradeFeeParams,
1118 ) -> anyhow::Result<RestApiResponse<Vec<models::TradeFeeResponseInner>>> {
1119 self.asset_api_client.trade_fee(params).await
1120 }
1121
1122 /// User Asset (`USER_DATA`)
1123 ///
1124 /// Get user assets, just for positive data.
1125 ///
1126 /// * If asset is set, then return this asset, otherwise return all assets positive.
1127 /// * If needBtcValuation is set, then return btcValudation.
1128 ///
1129 /// Weight: 5
1130 ///
1131 /// # Arguments
1132 ///
1133 /// - `params`: [`UserAssetParams`]
1134 /// The parameters for this operation.
1135 ///
1136 /// # Returns
1137 ///
1138 /// [`RestApiResponse<Vec<models::UserAssetResponseInner>>`] on success.
1139 ///
1140 /// # Errors
1141 ///
1142 /// This function will return an [`anyhow::Error`] if:
1143 /// - the HTTP request fails
1144 /// - any parameter is invalid
1145 /// - the response cannot be parsed
1146 /// - or one of the following occurs:
1147 /// - `RequiredError`
1148 /// - `ConnectorClientError`
1149 /// - `UnauthorizedError`
1150 /// - `ForbiddenError`
1151 /// - `TooManyRequestsError`
1152 /// - `RateLimitBanError`
1153 /// - `ServerError`
1154 /// - `NotFoundError`
1155 /// - `NetworkError`
1156 /// - `BadRequestError`
1157 ///
1158 ///
1159 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/wallet/asset/user-assets).
1160 ///
1161 pub async fn user_asset(
1162 &self,
1163 params: UserAssetParams,
1164 ) -> anyhow::Result<RestApiResponse<Vec<models::UserAssetResponseInner>>> {
1165 self.asset_api_client.user_asset(params).await
1166 }
1167
1168 /// User Universal Transfer (`USER_DATA`)
1169 ///
1170 /// user universal transfer
1171 ///
1172 /// * `fromSymbol` must be sent when type are `ISOLATEDMARGIN_MARGIN` and `ISOLATEDMARGIN_ISOLATEDMARGIN`
1173 /// * `toSymbol` must be sent when type are `MARGIN_ISOLATEDMARGIN` and `ISOLATEDMARGIN_ISOLATEDMARGIN`
1174 /// * ENUM of transfer types:
1175 /// * `MAIN_UMFUTURE` Spot account transfer to USDⓈ-M Futures account
1176 /// * `MAIN_CMFUTURE` Spot account transfer to COIN-M Futures account
1177 /// * `MAIN_MARGIN` Spot account transfer to Margin(cross)account
1178 /// * `UMFUTURE_MAIN` USDⓈ-M Futures account transfer to Spot account
1179 /// * `UMFUTURE_MARGIN` USDⓈ-M Futures account transfer to Margin(cross)account
1180 /// * `CMFUTURE_MAIN` COIN-M Futures account transfer to Spot account
1181 /// * `CMFUTURE_MARGIN` COIN-M Futures account transfer to Margin(cross) account
1182 /// * `MARGIN_MAIN` Margin(cross)account transfer to Spot account
1183 /// * `MARGIN_UMFUTURE` Margin(cross)account transfer to USDⓈ-M Futures
1184 /// * `MARGIN_CMFUTURE` Margin(cross)account transfer to COIN-M Futures
1185 /// * `ISOLATEDMARGIN_MARGIN` Isolated margin account transfer to Margin(cross) account
1186 /// * `MARGIN_ISOLATEDMARGIN` Margin(cross) account transfer to Isolated margin account
1187 /// * `ISOLATEDMARGIN_ISOLATEDMARGIN` Isolated margin account transfer to Isolated margin account
1188 /// * `MAIN_FUNDING` Spot account transfer to Funding account
1189 /// * `FUNDING_MAIN` Funding account transfer to Spot account
1190 /// * `FUNDING_UMFUTURE` Funding account transfer to UMFUTURE account
1191 /// * `UMFUTURE_FUNDING` UMFUTURE account transfer to Funding account
1192 /// * `MARGIN_FUNDING` MARGIN account transfer to Funding account
1193 /// * `FUNDING_MARGIN` Funding account transfer to Margin account
1194 /// * `FUNDING_CMFUTURE` Funding account transfer to CMFUTURE account
1195 /// * `CMFUTURE_FUNDING` CMFUTURE account transfer to Funding account
1196 /// * `MAIN_OPTION` Spot account transfer to Options account
1197 /// * `OPTION_MAIN` Options account transfer to Spot account
1198 /// * `UMFUTURE_OPTION` USDⓈ-M Futures account transfer to Options account
1199 /// * `OPTION_UMFUTURE` Options account transfer to USDⓈ-M Futures account
1200 /// * `MARGIN_OPTION` Margin(cross)account transfer to Options account
1201 /// * `OPTION_MARGIN` Options account transfer to Margin(cross)account
1202 /// * `FUNDING_OPTION` Funding account transfer to Options account
1203 /// * `OPTION_FUNDING` Options account transfer to Funding account
1204 /// * `MAIN_PORTFOLIO_MARGIN` Spot account transfer to Portfolio Margin account
1205 /// * `PORTFOLIO_MARGIN_MAIN` Portfolio Margin account transfer to Spot account
1206 ///
1207 /// Weight: 900
1208 ///
1209 /// # Arguments
1210 ///
1211 /// - `params`: [`UserUniversalTransferParams`]
1212 /// The parameters for this operation.
1213 ///
1214 /// # Returns
1215 ///
1216 /// [`RestApiResponse<models::UserUniversalTransferResponse>`] on success.
1217 ///
1218 /// # Errors
1219 ///
1220 /// This function will return an [`anyhow::Error`] if:
1221 /// - the HTTP request fails
1222 /// - any parameter is invalid
1223 /// - the response cannot be parsed
1224 /// - or one of the following occurs:
1225 /// - `RequiredError`
1226 /// - `ConnectorClientError`
1227 /// - `UnauthorizedError`
1228 /// - `ForbiddenError`
1229 /// - `TooManyRequestsError`
1230 /// - `RateLimitBanError`
1231 /// - `ServerError`
1232 /// - `NotFoundError`
1233 /// - `NetworkError`
1234 /// - `BadRequestError`
1235 ///
1236 ///
1237 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/wallet/asset/User-Universal-Transfer).
1238 ///
1239 pub async fn user_universal_transfer(
1240 &self,
1241 params: UserUniversalTransferParams,
1242 ) -> anyhow::Result<RestApiResponse<models::UserUniversalTransferResponse>> {
1243 self.asset_api_client.user_universal_transfer(params).await
1244 }
1245
1246 /// All Coins' Information (`USER_DATA`)
1247 ///
1248 /// Get information of coins (available for deposit and withdraw) for user.
1249 ///
1250 /// Weight: 10
1251 ///
1252 /// # Arguments
1253 ///
1254 /// - `params`: [`AllCoinsInformationParams`]
1255 /// The parameters for this operation.
1256 ///
1257 /// # Returns
1258 ///
1259 /// [`RestApiResponse<Vec<models::AllCoinsInformationResponseInner>>`] on success.
1260 ///
1261 /// # Errors
1262 ///
1263 /// This function will return an [`anyhow::Error`] if:
1264 /// - the HTTP request fails
1265 /// - any parameter is invalid
1266 /// - the response cannot be parsed
1267 /// - or one of the following occurs:
1268 /// - `RequiredError`
1269 /// - `ConnectorClientError`
1270 /// - `UnauthorizedError`
1271 /// - `ForbiddenError`
1272 /// - `TooManyRequestsError`
1273 /// - `RateLimitBanError`
1274 /// - `ServerError`
1275 /// - `NotFoundError`
1276 /// - `NetworkError`
1277 /// - `BadRequestError`
1278 ///
1279 ///
1280 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/wallet/capital/all-coins-info).
1281 ///
1282 pub async fn all_coins_information(
1283 &self,
1284 params: AllCoinsInformationParams,
1285 ) -> anyhow::Result<RestApiResponse<Vec<models::AllCoinsInformationResponseInner>>> {
1286 self.capital_api_client.all_coins_information(params).await
1287 }
1288
1289 /// Deposit Address(supporting network) (`USER_DATA`)
1290 ///
1291 /// Fetch deposit address with network.
1292 ///
1293 /// * If `network` is not send, return with default network of the coin.
1294 /// * You can get `network` and `isDefault` in `networkList` in the response of `Get /sapi/v1/capital/config/getall (HMAC SHA256)`.
1295 /// * `amount` needs to be sent if using LIGHTNING network
1296 ///
1297 /// Weight: 10
1298 ///
1299 /// # Arguments
1300 ///
1301 /// - `params`: [`DepositAddressParams`]
1302 /// The parameters for this operation.
1303 ///
1304 /// # Returns
1305 ///
1306 /// [`RestApiResponse<models::DepositAddressResponse>`] on success.
1307 ///
1308 /// # Errors
1309 ///
1310 /// This function will return an [`anyhow::Error`] if:
1311 /// - the HTTP request fails
1312 /// - any parameter is invalid
1313 /// - the response cannot be parsed
1314 /// - or one of the following occurs:
1315 /// - `RequiredError`
1316 /// - `ConnectorClientError`
1317 /// - `UnauthorizedError`
1318 /// - `ForbiddenError`
1319 /// - `TooManyRequestsError`
1320 /// - `RateLimitBanError`
1321 /// - `ServerError`
1322 /// - `NotFoundError`
1323 /// - `NetworkError`
1324 /// - `BadRequestError`
1325 ///
1326 ///
1327 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/wallet/capital/deposite-address).
1328 ///
1329 pub async fn deposit_address(
1330 &self,
1331 params: DepositAddressParams,
1332 ) -> anyhow::Result<RestApiResponse<models::DepositAddressResponse>> {
1333 self.capital_api_client.deposit_address(params).await
1334 }
1335
1336 /// Deposit History (supporting network) (`USER_DATA`)
1337 ///
1338 /// Fetch deposit history.
1339 ///
1340 ///
1341 /// * Please notice the default `startTime` and `endTime` to make sure that time interval is within 0-90 days.
1342 /// * If both ``startTime`` and ``endTime`` are sent, time between ``startTime`` and ``endTime`` must be less than 90 days.
1343 ///
1344 /// Weight: 1
1345 ///
1346 /// # Arguments
1347 ///
1348 /// - `params`: [`DepositHistoryParams`]
1349 /// The parameters for this operation.
1350 ///
1351 /// # Returns
1352 ///
1353 /// [`RestApiResponse<Vec<models::DepositHistoryResponseInner>>`] on success.
1354 ///
1355 /// # Errors
1356 ///
1357 /// This function will return an [`anyhow::Error`] if:
1358 /// - the HTTP request fails
1359 /// - any parameter is invalid
1360 /// - the response cannot be parsed
1361 /// - or one of the following occurs:
1362 /// - `RequiredError`
1363 /// - `ConnectorClientError`
1364 /// - `UnauthorizedError`
1365 /// - `ForbiddenError`
1366 /// - `TooManyRequestsError`
1367 /// - `RateLimitBanError`
1368 /// - `ServerError`
1369 /// - `NotFoundError`
1370 /// - `NetworkError`
1371 /// - `BadRequestError`
1372 ///
1373 ///
1374 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/wallet/capital/deposite-history).
1375 ///
1376 pub async fn deposit_history(
1377 &self,
1378 params: DepositHistoryParams,
1379 ) -> anyhow::Result<RestApiResponse<Vec<models::DepositHistoryResponseInner>>> {
1380 self.capital_api_client.deposit_history(params).await
1381 }
1382
1383 /// Fetch deposit address list with `network(USER_DATA)`
1384 ///
1385 /// Fetch deposit address list with network.
1386 ///
1387 ///
1388 /// * If network is not send, return with default network of the coin.
1389 /// * You can get network and isDefault in networkList in the response of `Get /sapi/v1/capital/config/getall`.
1390 ///
1391 /// Weight: 10
1392 ///
1393 /// # Arguments
1394 ///
1395 /// - `params`: [`FetchDepositAddressListWithNetworkParams`]
1396 /// The parameters for this operation.
1397 ///
1398 /// # Returns
1399 ///
1400 /// [`RestApiResponse<Vec<models::FetchDepositAddressListWithNetworkResponseInner>>`] on success.
1401 ///
1402 /// # Errors
1403 ///
1404 /// This function will return an [`anyhow::Error`] if:
1405 /// - the HTTP request fails
1406 /// - any parameter is invalid
1407 /// - the response cannot be parsed
1408 /// - or one of the following occurs:
1409 /// - `RequiredError`
1410 /// - `ConnectorClientError`
1411 /// - `UnauthorizedError`
1412 /// - `ForbiddenError`
1413 /// - `TooManyRequestsError`
1414 /// - `RateLimitBanError`
1415 /// - `ServerError`
1416 /// - `NotFoundError`
1417 /// - `NetworkError`
1418 /// - `BadRequestError`
1419 ///
1420 ///
1421 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/wallet/capital/Fetch-deposit-address-list-with-network).
1422 ///
1423 pub async fn fetch_deposit_address_list_with_network(
1424 &self,
1425 params: FetchDepositAddressListWithNetworkParams,
1426 ) -> anyhow::Result<RestApiResponse<Vec<models::FetchDepositAddressListWithNetworkResponseInner>>>
1427 {
1428 self.capital_api_client
1429 .fetch_deposit_address_list_with_network(params)
1430 .await
1431 }
1432
1433 /// Fetch withdraw address list (`USER_DATA`)
1434 ///
1435 /// Fetch withdraw address list
1436 ///
1437 /// Weight: 10
1438 ///
1439 /// # Arguments
1440 ///
1441 /// - `params`: [`FetchWithdrawAddressListParams`]
1442 /// The parameters for this operation.
1443 ///
1444 /// # Returns
1445 ///
1446 /// [`RestApiResponse<Vec<models::FetchWithdrawAddressListResponseInner>>`] on success.
1447 ///
1448 /// # Errors
1449 ///
1450 /// This function will return an [`anyhow::Error`] if:
1451 /// - the HTTP request fails
1452 /// - any parameter is invalid
1453 /// - the response cannot be parsed
1454 /// - or one of the following occurs:
1455 /// - `RequiredError`
1456 /// - `ConnectorClientError`
1457 /// - `UnauthorizedError`
1458 /// - `ForbiddenError`
1459 /// - `TooManyRequestsError`
1460 /// - `RateLimitBanError`
1461 /// - `ServerError`
1462 /// - `NotFoundError`
1463 /// - `NetworkError`
1464 /// - `BadRequestError`
1465 ///
1466 ///
1467 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/wallet/capital/fetch-withdraw-address).
1468 ///
1469 pub async fn fetch_withdraw_address_list(
1470 &self,
1471 ) -> anyhow::Result<RestApiResponse<Vec<models::FetchWithdrawAddressListResponseInner>>> {
1472 self.capital_api_client.fetch_withdraw_address_list().await
1473 }
1474
1475 /// Fetch withdraw quota (`USER_DATA`)
1476 ///
1477 /// Fetch withdraw quota
1478 ///
1479 /// Weight: 10
1480 ///
1481 /// # Arguments
1482 ///
1483 /// - `params`: [`FetchWithdrawQuotaParams`]
1484 /// The parameters for this operation.
1485 ///
1486 /// # Returns
1487 ///
1488 /// [`RestApiResponse<models::FetchWithdrawQuotaResponse>`] on success.
1489 ///
1490 /// # Errors
1491 ///
1492 /// This function will return an [`anyhow::Error`] if:
1493 /// - the HTTP request fails
1494 /// - any parameter is invalid
1495 /// - the response cannot be parsed
1496 /// - or one of the following occurs:
1497 /// - `RequiredError`
1498 /// - `ConnectorClientError`
1499 /// - `UnauthorizedError`
1500 /// - `ForbiddenError`
1501 /// - `TooManyRequestsError`
1502 /// - `RateLimitBanError`
1503 /// - `ServerError`
1504 /// - `NotFoundError`
1505 /// - `NetworkError`
1506 /// - `BadRequestError`
1507 ///
1508 ///
1509 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/wallet/capital/Fetch-withdraw-quota).
1510 ///
1511 pub async fn fetch_withdraw_quota(
1512 &self,
1513 ) -> anyhow::Result<RestApiResponse<models::FetchWithdrawQuotaResponse>> {
1514 self.capital_api_client.fetch_withdraw_quota().await
1515 }
1516
1517 /// One click arrival deposit apply (for expired address deposit) (`USER_DATA`)
1518 ///
1519 /// Apply deposit credit for expired address (One click arrival)
1520 ///
1521 /// * Params need to be in the POST body
1522 ///
1523 /// Weight: 1
1524 ///
1525 /// # Arguments
1526 ///
1527 /// - `params`: [`OneClickArrivalDepositApplyParams`]
1528 /// The parameters for this operation.
1529 ///
1530 /// # Returns
1531 ///
1532 /// [`RestApiResponse<models::OneClickArrivalDepositApplyResponse>`] on success.
1533 ///
1534 /// # Errors
1535 ///
1536 /// This function will return an [`anyhow::Error`] if:
1537 /// - the HTTP request fails
1538 /// - any parameter is invalid
1539 /// - the response cannot be parsed
1540 /// - or one of the following occurs:
1541 /// - `RequiredError`
1542 /// - `ConnectorClientError`
1543 /// - `UnauthorizedError`
1544 /// - `ForbiddenError`
1545 /// - `TooManyRequestsError`
1546 /// - `RateLimitBanError`
1547 /// - `ServerError`
1548 /// - `NotFoundError`
1549 /// - `NetworkError`
1550 /// - `BadRequestError`
1551 ///
1552 ///
1553 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/wallet/capital/one-click-arrival-deposite-apply).
1554 ///
1555 pub async fn one_click_arrival_deposit_apply(
1556 &self,
1557 params: OneClickArrivalDepositApplyParams,
1558 ) -> anyhow::Result<RestApiResponse<models::OneClickArrivalDepositApplyResponse>> {
1559 self.capital_api_client
1560 .one_click_arrival_deposit_apply(params)
1561 .await
1562 }
1563
1564 /// `Withdraw(USER_DATA)`
1565 ///
1566 /// Submit a withdraw request.
1567 ///
1568 ///
1569 /// * If `network` not send, return with default network of the coin.
1570 /// * You can get `network` and `isDefault` in `networkList` of a coin in the response of `Get /sapi/v1/capital/config/getall (HMAC SHA256)`.
1571 /// * To check if travel rule is required, by using `GET /sapi/v1/localentity/questionnaire-requirements` and if it returns anything other than `NIL` you will need update SAPI to `POST /sapi/v1/localentity/withdraw/apply` else you can continue `POST /sapi/v1/capital/withdraw/apply`. Please note that if you are required to comply to travel rule please refer to the Travel Rule SAPI.
1572 /// * For networks that do not support memo/tag, submitting a withdrawal request with a non-empty `addressTag` will return error `-4106 TAG_NOT_SUPPORTED_FOR_NETWORK`. Please omit the `addressTag` field for such networks. You can check whether a network requires a tag via `GET /sapi/v1/capital/config/getall`:
1573 /// * If `withdrawTag` = `true` → memo/tag is required.
1574 /// * If `withdrawTag` = `false` → memo/tag is not supported; omit `addressTag`.
1575 ///
1576 /// Weight: 900
1577 ///
1578 /// # Arguments
1579 ///
1580 /// - `params`: [`WithdrawParams`]
1581 /// The parameters for this operation.
1582 ///
1583 /// # Returns
1584 ///
1585 /// [`RestApiResponse<models::WithdrawResponse>`] on success.
1586 ///
1587 /// # Errors
1588 ///
1589 /// This function will return an [`anyhow::Error`] if:
1590 /// - the HTTP request fails
1591 /// - any parameter is invalid
1592 /// - the response cannot be parsed
1593 /// - or one of the following occurs:
1594 /// - `RequiredError`
1595 /// - `ConnectorClientError`
1596 /// - `UnauthorizedError`
1597 /// - `ForbiddenError`
1598 /// - `TooManyRequestsError`
1599 /// - `RateLimitBanError`
1600 /// - `ServerError`
1601 /// - `NotFoundError`
1602 /// - `NetworkError`
1603 /// - `BadRequestError`
1604 ///
1605 ///
1606 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/wallet/capital/Withdraw).
1607 ///
1608 pub async fn withdraw(
1609 &self,
1610 params: WithdrawParams,
1611 ) -> anyhow::Result<RestApiResponse<models::WithdrawResponse>> {
1612 self.capital_api_client.withdraw(params).await
1613 }
1614
1615 /// Withdraw History (supporting network) (`USER_DATA`)
1616 ///
1617 /// Fetch withdraw history.
1618 ///
1619 /// * `network` may not be in the response for old withdraw.
1620 /// * Please notice the default `startTime` and `endTime` to make sure that time interval is within 0-90 days.
1621 /// * If both `startTime` and `endTime`are sent, time between `startTime`and `endTime`must be less than 90 days.
1622 /// * If `withdrawOrderId` is sent, time between `startTime` and `endTime` must be less than 7 days.
1623 /// * If `withdrawOrderId` is sent, `startTime` and `endTime` are not sent, will return last 7 days records by default.
1624 /// * Maximum support `idList` number is 45.
1625 ///
1626 /// Weight: 18000
1627 /// Request limit: 10 requests per second
1628 ///
1629 /// # Arguments
1630 ///
1631 /// - `params`: [`WithdrawHistoryParams`]
1632 /// The parameters for this operation.
1633 ///
1634 /// # Returns
1635 ///
1636 /// [`RestApiResponse<Vec<models::WithdrawHistoryResponseInner>>`] on success.
1637 ///
1638 /// # Errors
1639 ///
1640 /// This function will return an [`anyhow::Error`] if:
1641 /// - the HTTP request fails
1642 /// - any parameter is invalid
1643 /// - the response cannot be parsed
1644 /// - or one of the following occurs:
1645 /// - `RequiredError`
1646 /// - `ConnectorClientError`
1647 /// - `UnauthorizedError`
1648 /// - `ForbiddenError`
1649 /// - `TooManyRequestsError`
1650 /// - `RateLimitBanError`
1651 /// - `ServerError`
1652 /// - `NotFoundError`
1653 /// - `NetworkError`
1654 /// - `BadRequestError`
1655 ///
1656 ///
1657 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/wallet/capital/Withdraw-History).
1658 ///
1659 pub async fn withdraw_history(
1660 &self,
1661 params: WithdrawHistoryParams,
1662 ) -> anyhow::Result<RestApiResponse<Vec<models::WithdrawHistoryResponseInner>>> {
1663 self.capital_api_client.withdraw_history(params).await
1664 }
1665
1666 /// Get symbols delist schedule for spot (`MARKET_DATA`)
1667 ///
1668 /// Get symbols delist schedule for spot
1669 ///
1670 /// Weight: 100
1671 ///
1672 /// # Arguments
1673 ///
1674 /// - `params`: [`GetSymbolsDelistScheduleForSpotParams`]
1675 /// The parameters for this operation.
1676 ///
1677 /// # Returns
1678 ///
1679 /// [`RestApiResponse<Vec<models::GetSymbolsDelistScheduleForSpotResponseInner>>`] on success.
1680 ///
1681 /// # Errors
1682 ///
1683 /// This function will return an [`anyhow::Error`] if:
1684 /// - the HTTP request fails
1685 /// - any parameter is invalid
1686 /// - the response cannot be parsed
1687 /// - or one of the following occurs:
1688 /// - `RequiredError`
1689 /// - `ConnectorClientError`
1690 /// - `UnauthorizedError`
1691 /// - `ForbiddenError`
1692 /// - `TooManyRequestsError`
1693 /// - `RateLimitBanError`
1694 /// - `ServerError`
1695 /// - `NotFoundError`
1696 /// - `NetworkError`
1697 /// - `BadRequestError`
1698 ///
1699 ///
1700 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/wallet/others/delist-schedule).
1701 ///
1702 pub async fn get_symbols_delist_schedule_for_spot(
1703 &self,
1704 params: GetSymbolsDelistScheduleForSpotParams,
1705 ) -> anyhow::Result<RestApiResponse<Vec<models::GetSymbolsDelistScheduleForSpotResponseInner>>>
1706 {
1707 self.others_api_client
1708 .get_symbols_delist_schedule_for_spot(params)
1709 .await
1710 }
1711
1712 /// System Status (System)
1713 ///
1714 /// Fetch system status.
1715 ///
1716 /// Weight: 1
1717 ///
1718 /// # Arguments
1719 ///
1720 /// - `params`: [`SystemStatusParams`]
1721 /// The parameters for this operation.
1722 ///
1723 /// # Returns
1724 ///
1725 /// [`RestApiResponse<models::SystemStatusResponse>`] on success.
1726 ///
1727 /// # Errors
1728 ///
1729 /// This function will return an [`anyhow::Error`] if:
1730 /// - the HTTP request fails
1731 /// - any parameter is invalid
1732 /// - the response cannot be parsed
1733 /// - or one of the following occurs:
1734 /// - `RequiredError`
1735 /// - `ConnectorClientError`
1736 /// - `UnauthorizedError`
1737 /// - `ForbiddenError`
1738 /// - `TooManyRequestsError`
1739 /// - `RateLimitBanError`
1740 /// - `ServerError`
1741 /// - `NotFoundError`
1742 /// - `NetworkError`
1743 /// - `BadRequestError`
1744 ///
1745 ///
1746 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/wallet/others/System-Status).
1747 ///
1748 pub async fn system_status(
1749 &self,
1750 ) -> anyhow::Result<RestApiResponse<models::SystemStatusResponse>> {
1751 self.others_api_client.system_status().await
1752 }
1753
1754 /// Broker Withdraw (for brokers of local entities that require travel rule) (`USER_DATA`)
1755 ///
1756 /// Submit a withdrawal request for brokers of local entities that required travel rule.
1757 ///
1758 /// * If `network` not send, return with default network of the coin, but if the address could not match default network, the withdraw will be rejected.
1759 /// * You can get `network` in `networkList` of a coin in the response
1760 /// * Questionnaire is different for each local entity, please refer to
1761 /// * If getting error like `Questionnaire format not valid.` or `Questionnaire must not be blank`,
1762 ///
1763 /// Weight: 600
1764 ///
1765 /// # Arguments
1766 ///
1767 /// - `params`: [`BrokerWithdrawParams`]
1768 /// The parameters for this operation.
1769 ///
1770 /// # Returns
1771 ///
1772 /// [`RestApiResponse<models::BrokerWithdrawResponse>`] on success.
1773 ///
1774 /// # Errors
1775 ///
1776 /// This function will return an [`anyhow::Error`] if:
1777 /// - the HTTP request fails
1778 /// - any parameter is invalid
1779 /// - the response cannot be parsed
1780 /// - or one of the following occurs:
1781 /// - `RequiredError`
1782 /// - `ConnectorClientError`
1783 /// - `UnauthorizedError`
1784 /// - `ForbiddenError`
1785 /// - `TooManyRequestsError`
1786 /// - `RateLimitBanError`
1787 /// - `ServerError`
1788 /// - `NotFoundError`
1789 /// - `NetworkError`
1790 /// - `BadRequestError`
1791 ///
1792 ///
1793 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/wallet/travel-rule/Broker-Withdraw).
1794 ///
1795 pub async fn broker_withdraw(
1796 &self,
1797 params: BrokerWithdrawParams,
1798 ) -> anyhow::Result<RestApiResponse<models::BrokerWithdrawResponse>> {
1799 self.travel_rule_api_client.broker_withdraw(params).await
1800 }
1801
1802 /// Check Questionnaire Requirements (for local entities that require travel rule) (supporting network) (`USER_DATA`)
1803 ///
1804 /// This API will return user-specific Travel Rule questionnaire requirement information in reference to the current API key.
1805 ///
1806 /// Weight: 1
1807 ///
1808 /// # Arguments
1809 ///
1810 /// - `params`: [`CheckQuestionnaireRequirementsParams`]
1811 /// The parameters for this operation.
1812 ///
1813 /// # Returns
1814 ///
1815 /// [`RestApiResponse<models::CheckQuestionnaireRequirementsResponse>`] on success.
1816 ///
1817 /// # Errors
1818 ///
1819 /// This function will return an [`anyhow::Error`] if:
1820 /// - the HTTP request fails
1821 /// - any parameter is invalid
1822 /// - the response cannot be parsed
1823 /// - or one of the following occurs:
1824 /// - `RequiredError`
1825 /// - `ConnectorClientError`
1826 /// - `UnauthorizedError`
1827 /// - `ForbiddenError`
1828 /// - `TooManyRequestsError`
1829 /// - `RateLimitBanError`
1830 /// - `ServerError`
1831 /// - `NotFoundError`
1832 /// - `NetworkError`
1833 /// - `BadRequestError`
1834 ///
1835 ///
1836 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/wallet/travel-rule/questionnaire-requirements).
1837 ///
1838 pub async fn check_questionnaire_requirements(
1839 &self,
1840 params: CheckQuestionnaireRequirementsParams,
1841 ) -> anyhow::Result<RestApiResponse<models::CheckQuestionnaireRequirementsResponse>> {
1842 self.travel_rule_api_client
1843 .check_questionnaire_requirements(params)
1844 .await
1845 }
1846
1847 /// Deposit History (for local entities that required travel rule) (supporting network) (`USER_DATA`)
1848 ///
1849 /// Fetch deposit history for local entities that required travel rule.
1850 ///
1851 /// * Please notice the default `startTime` and `endTime` to make sure that time interval is within
1852 /// * If both ``startTime`` and ``endTime`` are sent, time between ``startTime`` and ``endTime`` must
1853 /// * Please, note that due to network-specific characteristics, the returned source address may be inaccurate. If multiple source addresses are found, only the first one will be returned.
1854 ///
1855 /// Weight: 1
1856 ///
1857 /// # Arguments
1858 ///
1859 /// - `params`: [`DepositHistoryTravelRuleParams`]
1860 /// The parameters for this operation.
1861 ///
1862 /// # Returns
1863 ///
1864 /// [`RestApiResponse<Vec<models::DepositHistoryTravelRuleResponseInner>>`] on success.
1865 ///
1866 /// # Errors
1867 ///
1868 /// This function will return an [`anyhow::Error`] if:
1869 /// - the HTTP request fails
1870 /// - any parameter is invalid
1871 /// - the response cannot be parsed
1872 /// - or one of the following occurs:
1873 /// - `RequiredError`
1874 /// - `ConnectorClientError`
1875 /// - `UnauthorizedError`
1876 /// - `ForbiddenError`
1877 /// - `TooManyRequestsError`
1878 /// - `RateLimitBanError`
1879 /// - `ServerError`
1880 /// - `NotFoundError`
1881 /// - `NetworkError`
1882 /// - `BadRequestError`
1883 ///
1884 ///
1885 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/wallet/travel-rule/Deposit-History).
1886 ///
1887 pub async fn deposit_history_travel_rule(
1888 &self,
1889 params: DepositHistoryTravelRuleParams,
1890 ) -> anyhow::Result<RestApiResponse<Vec<models::DepositHistoryTravelRuleResponseInner>>> {
1891 self.travel_rule_api_client
1892 .deposit_history_travel_rule(params)
1893 .await
1894 }
1895
1896 /// Deposit History V2 (for local entities that required travel rule) (supporting network) (`USER_DATA`)
1897 ///
1898 /// Fetch deposit history for local entities that with required travel rule information.
1899 ///
1900 /// * Please notice the default `startTime` and `endTime` to make sure that time interval is within
1901 /// * If both ``startTime`` and ``endTime`` are sent, time between ``startTime`` and ``endTime`` must
1902 /// * Please, note that due to network-specific characteristics, the returned source address may be inaccurate. If multiple source addresses are found, only the first one will be returned.
1903 ///
1904 /// Weight: 1
1905 ///
1906 /// # Arguments
1907 ///
1908 /// - `params`: [`DepositHistoryV2Params`]
1909 /// The parameters for this operation.
1910 ///
1911 /// # Returns
1912 ///
1913 /// [`RestApiResponse<Vec<models::DepositHistoryV2ResponseInner>>`] on success.
1914 ///
1915 /// # Errors
1916 ///
1917 /// This function will return an [`anyhow::Error`] if:
1918 /// - the HTTP request fails
1919 /// - any parameter is invalid
1920 /// - the response cannot be parsed
1921 /// - or one of the following occurs:
1922 /// - `RequiredError`
1923 /// - `ConnectorClientError`
1924 /// - `UnauthorizedError`
1925 /// - `ForbiddenError`
1926 /// - `TooManyRequestsError`
1927 /// - `RateLimitBanError`
1928 /// - `ServerError`
1929 /// - `NotFoundError`
1930 /// - `NetworkError`
1931 /// - `BadRequestError`
1932 ///
1933 ///
1934 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/wallet/travel-rule/Deposit-History-V2).
1935 ///
1936 pub async fn deposit_history_v2(
1937 &self,
1938 params: DepositHistoryV2Params,
1939 ) -> anyhow::Result<RestApiResponse<Vec<models::DepositHistoryV2ResponseInner>>> {
1940 self.travel_rule_api_client.deposit_history_v2(params).await
1941 }
1942
1943 /// Fetch address verification list (`USER_DATA`)
1944 ///
1945 /// Fetch address verification list for user to check on status and other details for the addresses stored in Address Book.
1946 ///
1947 /// Weight: 1
1948 ///
1949 /// # Arguments
1950 ///
1951 /// - `params`: [`FetchAddressVerificationListParams`]
1952 /// The parameters for this operation.
1953 ///
1954 /// # Returns
1955 ///
1956 /// [`RestApiResponse<Vec<models::FetchAddressVerificationListResponseInner>>`] on success.
1957 ///
1958 /// # Errors
1959 ///
1960 /// This function will return an [`anyhow::Error`] if:
1961 /// - the HTTP request fails
1962 /// - any parameter is invalid
1963 /// - the response cannot be parsed
1964 /// - or one of the following occurs:
1965 /// - `RequiredError`
1966 /// - `ConnectorClientError`
1967 /// - `UnauthorizedError`
1968 /// - `ForbiddenError`
1969 /// - `TooManyRequestsError`
1970 /// - `RateLimitBanError`
1971 /// - `ServerError`
1972 /// - `NotFoundError`
1973 /// - `NetworkError`
1974 /// - `BadRequestError`
1975 ///
1976 ///
1977 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/wallet/travel-rule/address-verification-list).
1978 ///
1979 pub async fn fetch_address_verification_list(
1980 &self,
1981 params: FetchAddressVerificationListParams,
1982 ) -> anyhow::Result<RestApiResponse<Vec<models::FetchAddressVerificationListResponseInner>>>
1983 {
1984 self.travel_rule_api_client
1985 .fetch_address_verification_list(params)
1986 .await
1987 }
1988
1989 /// Get Country List (`USER_DATA`)
1990 ///
1991 /// Query the active country list for travel rule questionnaires.
1992 ///
1993 /// Weight: 1
1994 ///
1995 /// # Arguments
1996 ///
1997 /// - `params`: [`GetCountryListParams`]
1998 /// The parameters for this operation.
1999 ///
2000 /// # Returns
2001 ///
2002 /// [`RestApiResponse<models::GetCountryListResponse>`] on success.
2003 ///
2004 /// # Errors
2005 ///
2006 /// This function will return an [`anyhow::Error`] if:
2007 /// - the HTTP request fails
2008 /// - any parameter is invalid
2009 /// - the response cannot be parsed
2010 /// - or one of the following occurs:
2011 /// - `RequiredError`
2012 /// - `ConnectorClientError`
2013 /// - `UnauthorizedError`
2014 /// - `ForbiddenError`
2015 /// - `TooManyRequestsError`
2016 /// - `RateLimitBanError`
2017 /// - `ServerError`
2018 /// - `NotFoundError`
2019 /// - `NetworkError`
2020 /// - `BadRequestError`
2021 ///
2022 ///
2023 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/wallet/travel-rule/country-list).
2024 ///
2025 pub async fn get_country_list(
2026 &self,
2027 ) -> anyhow::Result<RestApiResponse<models::GetCountryListResponse>> {
2028 self.travel_rule_api_client.get_country_list().await
2029 }
2030
2031 /// Get Region List (`USER_DATA`)
2032 ///
2033 /// Query the active region/city list for a given country.
2034 ///
2035 /// Weight: 1
2036 ///
2037 /// # Arguments
2038 ///
2039 /// - `params`: [`GetRegionListParams`]
2040 /// The parameters for this operation.
2041 ///
2042 /// # Returns
2043 ///
2044 /// [`RestApiResponse<models::GetRegionListResponse>`] on success.
2045 ///
2046 /// # Errors
2047 ///
2048 /// This function will return an [`anyhow::Error`] if:
2049 /// - the HTTP request fails
2050 /// - any parameter is invalid
2051 /// - the response cannot be parsed
2052 /// - or one of the following occurs:
2053 /// - `RequiredError`
2054 /// - `ConnectorClientError`
2055 /// - `UnauthorizedError`
2056 /// - `ForbiddenError`
2057 /// - `TooManyRequestsError`
2058 /// - `RateLimitBanError`
2059 /// - `ServerError`
2060 /// - `NotFoundError`
2061 /// - `NetworkError`
2062 /// - `BadRequestError`
2063 ///
2064 ///
2065 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/wallet/travel-rule/region-list).
2066 ///
2067 pub async fn get_region_list(
2068 &self,
2069 params: GetRegionListParams,
2070 ) -> anyhow::Result<RestApiResponse<models::GetRegionListResponse>> {
2071 self.travel_rule_api_client.get_region_list(params).await
2072 }
2073
2074 /// Submit Deposit Questionnaire (For local entities that require travel rule) (supporting network) (`USER_DATA`)
2075 ///
2076 /// Submit questionnaire for brokers of local entities that require travel rule.
2077 /// The questionnaire is only applies to transactions from un-hosted wallets or VASPs that are not
2078 /// yet onboarded with GTR.
2079 ///
2080 /// * Questionnaire is different for each local entity, please refer
2081 /// * If getting error like `Questionnaire format not valid.` or `Questionnaire must not be blank`,
2082 ///
2083 /// Weight: 600
2084 ///
2085 /// # Arguments
2086 ///
2087 /// - `params`: [`SubmitDepositQuestionnaireParams`]
2088 /// The parameters for this operation.
2089 ///
2090 /// # Returns
2091 ///
2092 /// [`RestApiResponse<models::SubmitDepositQuestionnaireResponse>`] on success.
2093 ///
2094 /// # Errors
2095 ///
2096 /// This function will return an [`anyhow::Error`] if:
2097 /// - the HTTP request fails
2098 /// - any parameter is invalid
2099 /// - the response cannot be parsed
2100 /// - or one of the following occurs:
2101 /// - `RequiredError`
2102 /// - `ConnectorClientError`
2103 /// - `UnauthorizedError`
2104 /// - `ForbiddenError`
2105 /// - `TooManyRequestsError`
2106 /// - `RateLimitBanError`
2107 /// - `ServerError`
2108 /// - `NotFoundError`
2109 /// - `NetworkError`
2110 /// - `BadRequestError`
2111 ///
2112 ///
2113 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/wallet/travel-rule/deposit-provide-info).
2114 ///
2115 pub async fn submit_deposit_questionnaire(
2116 &self,
2117 params: SubmitDepositQuestionnaireParams,
2118 ) -> anyhow::Result<RestApiResponse<models::SubmitDepositQuestionnaireResponse>> {
2119 self.travel_rule_api_client
2120 .submit_deposit_questionnaire(params)
2121 .await
2122 }
2123
2124 /// Submit Deposit Questionnaire (For local entities that require travel rule) (supporting network) (`USER_DATA`)
2125 ///
2126 /// Submit questionnaire for local entities that require travel rule.
2127 /// The questionnaire is only applies to transactions from unhosted wallets or VASPs that are not
2128 /// yet onboarded with GTR.
2129 ///
2130 /// * Questionnaire is different for each local entity, please refer
2131 /// * If getting error like `Questionnaire format not valid.` or `Questionnaire must not be blank`,
2132 ///
2133 /// Weight: 600
2134 ///
2135 /// # Arguments
2136 ///
2137 /// - `params`: [`SubmitDepositQuestionnaireTravelRuleParams`]
2138 /// The parameters for this operation.
2139 ///
2140 /// # Returns
2141 ///
2142 /// [`RestApiResponse<models::SubmitDepositQuestionnaireTravelRuleResponse>`] on success.
2143 ///
2144 /// # Errors
2145 ///
2146 /// This function will return an [`anyhow::Error`] if:
2147 /// - the HTTP request fails
2148 /// - any parameter is invalid
2149 /// - the response cannot be parsed
2150 /// - or one of the following occurs:
2151 /// - `RequiredError`
2152 /// - `ConnectorClientError`
2153 /// - `UnauthorizedError`
2154 /// - `ForbiddenError`
2155 /// - `TooManyRequestsError`
2156 /// - `RateLimitBanError`
2157 /// - `ServerError`
2158 /// - `NotFoundError`
2159 /// - `NetworkError`
2160 /// - `BadRequestError`
2161 ///
2162 ///
2163 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/wallet/travel-rule/deposit-provide-info).
2164 ///
2165 pub async fn submit_deposit_questionnaire_travel_rule(
2166 &self,
2167 params: SubmitDepositQuestionnaireTravelRuleParams,
2168 ) -> anyhow::Result<RestApiResponse<models::SubmitDepositQuestionnaireTravelRuleResponse>> {
2169 self.travel_rule_api_client
2170 .submit_deposit_questionnaire_travel_rule(params)
2171 .await
2172 }
2173
2174 /// Submit Deposit Questionnaire V2 (For local entities that require travel rule) (supporting network) (`USER_DATA`)
2175 ///
2176 /// Submit questionnaire for local entities that require travel rule.
2177 /// The questionnaire is only applies to transactions from unhosted wallets or VASPs that are not
2178 /// yet onboarded with GTR.
2179 ///
2180 /// * Questionnaire is different for each local entity, please refer
2181 /// * If getting error like `Questionnaire format not valid.` or `Questionnaire must not be blank`,
2182 ///
2183 /// Weight: 600
2184 ///
2185 /// # Arguments
2186 ///
2187 /// - `params`: [`SubmitDepositQuestionnaireV2Params`]
2188 /// The parameters for this operation.
2189 ///
2190 /// # Returns
2191 ///
2192 /// [`RestApiResponse<models::SubmitDepositQuestionnaireV2Response>`] on success.
2193 ///
2194 /// # Errors
2195 ///
2196 /// This function will return an [`anyhow::Error`] if:
2197 /// - the HTTP request fails
2198 /// - any parameter is invalid
2199 /// - the response cannot be parsed
2200 /// - or one of the following occurs:
2201 /// - `RequiredError`
2202 /// - `ConnectorClientError`
2203 /// - `UnauthorizedError`
2204 /// - `ForbiddenError`
2205 /// - `TooManyRequestsError`
2206 /// - `RateLimitBanError`
2207 /// - `ServerError`
2208 /// - `NotFoundError`
2209 /// - `NetworkError`
2210 /// - `BadRequestError`
2211 ///
2212 ///
2213 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/wallet/travel-rule/deposit-provide-info-v2).
2214 ///
2215 pub async fn submit_deposit_questionnaire_v2(
2216 &self,
2217 params: SubmitDepositQuestionnaireV2Params,
2218 ) -> anyhow::Result<RestApiResponse<models::SubmitDepositQuestionnaireV2Response>> {
2219 self.travel_rule_api_client
2220 .submit_deposit_questionnaire_v2(params)
2221 .await
2222 }
2223
2224 /// VASP list (for local entities that require travel rule) (supporting network) (`USER_DATA`)
2225 ///
2226 /// Fetch the VASP list for local entities.
2227 ///
2228 /// Weight: 1
2229 ///
2230 /// # Arguments
2231 ///
2232 /// - `params`: [`VaspListParams`]
2233 /// The parameters for this operation.
2234 ///
2235 /// # Returns
2236 ///
2237 /// [`RestApiResponse<Vec<models::VaspListResponseInner>>`] on success.
2238 ///
2239 /// # Errors
2240 ///
2241 /// This function will return an [`anyhow::Error`] if:
2242 /// - the HTTP request fails
2243 /// - any parameter is invalid
2244 /// - the response cannot be parsed
2245 /// - or one of the following occurs:
2246 /// - `RequiredError`
2247 /// - `ConnectorClientError`
2248 /// - `UnauthorizedError`
2249 /// - `ForbiddenError`
2250 /// - `TooManyRequestsError`
2251 /// - `RateLimitBanError`
2252 /// - `ServerError`
2253 /// - `NotFoundError`
2254 /// - `NetworkError`
2255 /// - `BadRequestError`
2256 ///
2257 ///
2258 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/wallet/travel-rule/onboarded-vasp-list).
2259 ///
2260 pub async fn vasp_list(
2261 &self,
2262 params: VaspListParams,
2263 ) -> anyhow::Result<RestApiResponse<Vec<models::VaspListResponseInner>>> {
2264 self.travel_rule_api_client.vasp_list(params).await
2265 }
2266
2267 /// Withdraw History (for local entities that require travel rule) (supporting network) (`USER_DATA`)
2268 ///
2269 /// Fetch withdraw history for local entities that required travel rule.
2270 ///
2271 /// * `network` may not be in the response for old withdraw.
2272 /// * Please notice the default `startTime` and `endTime` to make sure that time interval is within
2273 /// * If both `startTime` and `endTime`are sent, time between `startTime`and `endTime`must be less
2274 ///
2275 /// Weight: 1
2276 ///
2277 /// # Arguments
2278 ///
2279 /// - `params`: [`WithdrawHistoryV1Params`]
2280 /// The parameters for this operation.
2281 ///
2282 /// # Returns
2283 ///
2284 /// [`RestApiResponse<Vec<models::WithdrawHistoryV2ResponseInner>>`] on success.
2285 ///
2286 /// # Errors
2287 ///
2288 /// This function will return an [`anyhow::Error`] if:
2289 /// - the HTTP request fails
2290 /// - any parameter is invalid
2291 /// - the response cannot be parsed
2292 /// - or one of the following occurs:
2293 /// - `RequiredError`
2294 /// - `ConnectorClientError`
2295 /// - `UnauthorizedError`
2296 /// - `ForbiddenError`
2297 /// - `TooManyRequestsError`
2298 /// - `RateLimitBanError`
2299 /// - `ServerError`
2300 /// - `NotFoundError`
2301 /// - `NetworkError`
2302 /// - `BadRequestError`
2303 ///
2304 ///
2305 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/wallet/travel-rule/Withdraw-History).
2306 ///
2307 pub async fn withdraw_history_v1(
2308 &self,
2309 params: WithdrawHistoryV1Params,
2310 ) -> anyhow::Result<RestApiResponse<Vec<models::WithdrawHistoryV2ResponseInner>>> {
2311 self.travel_rule_api_client
2312 .withdraw_history_v1(params)
2313 .await
2314 }
2315
2316 /// Withdraw History V2 (for local entities that require travel rule) (supporting network) (`USER_DATA`)
2317 ///
2318 /// Fetch withdraw history for local entities that required travel rule.
2319 ///
2320 /// * `network` may not be in the response for old withdraw.
2321 /// * Withdrawal made through /sapi/v1/capital/withdraw/apply may not be in the response.
2322 /// * Please notice the default `startTime` and `endTime` to make sure that time interval is within
2323 /// * If both `startTime` and `endTime`are sent, time between `startTime`and `endTime`must be less
2324 /// * If withdrawOrderId is sent, time between startTime and endTime must be less than 7 days.
2325 /// * If withdrawOrderId is sent, startTime and endTime are not sent, will return last 7 days records by default.
2326 /// * Maximum support trId,txId number is 45.
2327 /// * `WithdrawOrderId` only support 1.
2328 /// * If responsible does not include withdrawalStatus, please input trId or txId retrieve the data.
2329 ///
2330 /// Weight: 1
2331 ///
2332 /// # Arguments
2333 ///
2334 /// - `params`: [`WithdrawHistoryV2Params`]
2335 /// The parameters for this operation.
2336 ///
2337 /// # Returns
2338 ///
2339 /// [`RestApiResponse<Vec<models::WithdrawHistoryV2ResponseInner>>`] on success.
2340 ///
2341 /// # Errors
2342 ///
2343 /// This function will return an [`anyhow::Error`] if:
2344 /// - the HTTP request fails
2345 /// - any parameter is invalid
2346 /// - the response cannot be parsed
2347 /// - or one of the following occurs:
2348 /// - `RequiredError`
2349 /// - `ConnectorClientError`
2350 /// - `UnauthorizedError`
2351 /// - `ForbiddenError`
2352 /// - `TooManyRequestsError`
2353 /// - `RateLimitBanError`
2354 /// - `ServerError`
2355 /// - `NotFoundError`
2356 /// - `NetworkError`
2357 /// - `BadRequestError`
2358 ///
2359 ///
2360 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/wallet/travel-rule/Withdraw-History-V2).
2361 ///
2362 pub async fn withdraw_history_v2(
2363 &self,
2364 params: WithdrawHistoryV2Params,
2365 ) -> anyhow::Result<RestApiResponse<Vec<models::WithdrawHistoryV2ResponseInner>>> {
2366 self.travel_rule_api_client
2367 .withdraw_history_v2(params)
2368 .await
2369 }
2370
2371 /// Withdraw (for local entities that require travel rule) (`USER_DATA`)
2372 ///
2373 /// Submit a withdrawal request for local entities that required travel rule.
2374 ///
2375 /// * If `network` not send, return with default network of the coin, but if the address could not match default network, the withdraw will be rejected.
2376 /// * You can get `network` and `isDefault` in `networkList` of a coin in the response
2377 /// * Questionnaire is different for each local entity, please refer to
2378 /// * If getting error like `Questionnaire format not valid.` or `Questionnaire must not be blank`,
2379 ///
2380 /// Weight: 600
2381 ///
2382 /// # Arguments
2383 ///
2384 /// - `params`: [`WithdrawTravelRuleParams`]
2385 /// The parameters for this operation.
2386 ///
2387 /// # Returns
2388 ///
2389 /// [`RestApiResponse<models::WithdrawTravelRuleResponse>`] on success.
2390 ///
2391 /// # Errors
2392 ///
2393 /// This function will return an [`anyhow::Error`] if:
2394 /// - the HTTP request fails
2395 /// - any parameter is invalid
2396 /// - the response cannot be parsed
2397 /// - or one of the following occurs:
2398 /// - `RequiredError`
2399 /// - `ConnectorClientError`
2400 /// - `UnauthorizedError`
2401 /// - `ForbiddenError`
2402 /// - `TooManyRequestsError`
2403 /// - `RateLimitBanError`
2404 /// - `ServerError`
2405 /// - `NotFoundError`
2406 /// - `NetworkError`
2407 /// - `BadRequestError`
2408 ///
2409 ///
2410 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/wallet/travel-rule/Withdraw).
2411 ///
2412 pub async fn withdraw_travel_rule(
2413 &self,
2414 params: WithdrawTravelRuleParams,
2415 ) -> anyhow::Result<RestApiResponse<models::WithdrawTravelRuleResponse>> {
2416 self.travel_rule_api_client
2417 .withdraw_travel_rule(params)
2418 .await
2419 }
2420}