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