binance_sdk/simple_earn/rest_api/mod.rs
1/*
2 * Binance Simple Earn REST API
3 *
4 * OpenAPI Specification for the Binance Simple Earn 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 bfusd_api_client: BfusdApiClient,
32 flexible_locked_api_client: FlexibleLockedApiClient,
33 rwusd_api_client: RwusdApiClient,
34 yield_arena_api_client: YieldArenaApiClient,
35}
36
37impl RestApi {
38 pub fn new(configuration: ConfigurationRestApi) -> Self {
39 let bfusd_api_client = BfusdApiClient::new(configuration.clone());
40 let flexible_locked_api_client = FlexibleLockedApiClient::new(configuration.clone());
41 let rwusd_api_client = RwusdApiClient::new(configuration.clone());
42 let yield_arena_api_client = YieldArenaApiClient::new(configuration.clone());
43
44 Self {
45 configuration,
46 bfusd_api_client,
47 flexible_locked_api_client,
48 rwusd_api_client,
49 yield_arena_api_client,
50 }
51 }
52
53 /// Send an unsigned request to the API
54 ///
55 /// # Arguments
56 ///
57 /// * `endpoint` - The API endpoint to send the request to
58 /// * `method` - The HTTP method to use for the request
59 /// * `query_params` - A map of query parameters to send with the request
60 /// * `body_params` - A map of body parameters to send with the request
61 ///
62 /// # Returns
63 ///
64 /// A `RestApiResponse` containing the deserialized response data on success, or an error if the request fails
65 ///
66 /// # Errors
67 ///
68 /// Returns an `anyhow::Error` if the HTTP request fails or if parsing the response fails
69 pub async fn send_request<R: DeserializeOwned + Send + 'static>(
70 &self,
71 endpoint: &str,
72 method: Method,
73 query_params: BTreeMap<String, Value>,
74 body_params: BTreeMap<String, Value>,
75 ) -> anyhow::Result<RestApiResponse<R>> {
76 send_request::<R>(
77 &self.configuration,
78 endpoint,
79 method,
80 query_params,
81 body_params,
82 None,
83 false,
84 )
85 .await
86 }
87
88 /// Send a signed request to the API
89 ///
90 /// # Arguments
91 ///
92 /// * `endpoint` - The API endpoint to send the request to
93 /// * `method` - The HTTP method to use for the request
94 /// * `query_params` - A map of query parameters to send with the request
95 /// * `body_params` - A map of body parameters to send with the request
96 ///
97 /// # Returns
98 ///
99 /// A `RestApiResponse` containing the deserialized response data on success, or an error if the request fails
100 ///
101 /// # Errors
102 ///
103 /// Returns an `anyhow::Error` if the HTTP request fails or if parsing the response fails
104 pub async fn send_signed_request<R: DeserializeOwned + Send + 'static>(
105 &self,
106 endpoint: &str,
107 method: Method,
108 query_params: BTreeMap<String, Value>,
109 body_params: BTreeMap<String, Value>,
110 ) -> anyhow::Result<RestApiResponse<R>> {
111 send_request::<R>(
112 &self.configuration,
113 endpoint,
114 method,
115 query_params,
116 body_params,
117 None,
118 true,
119 )
120 .await
121 }
122
123 /// Get BFUSD Account (`USER_DATA`)
124 ///
125 /// Get BFUSD account information.
126 ///
127 /// Weight: 150
128 ///
129 /// # Arguments
130 ///
131 /// - `params`: [`GetBfusdAccountParams`]
132 /// The parameters for this operation.
133 ///
134 /// # Returns
135 ///
136 /// [`RestApiResponse<models::GetBfusdAccountResponse>`] on success.
137 ///
138 /// # Errors
139 ///
140 /// This function will return an [`anyhow::Error`] if:
141 /// - the HTTP request fails
142 /// - any parameter is invalid
143 /// - the response cannot be parsed
144 /// - or one of the following occurs:
145 /// - `RequiredError`
146 /// - `ConnectorClientError`
147 /// - `UnauthorizedError`
148 /// - `ForbiddenError`
149 /// - `TooManyRequestsError`
150 /// - `RateLimitBanError`
151 /// - `ServerError`
152 /// - `NotFoundError`
153 /// - `NetworkError`
154 /// - `BadRequestError`
155 ///
156 ///
157 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/simple_earn/bfusd/account/).
158 ///
159 pub async fn get_bfusd_account(
160 &self,
161 params: GetBfusdAccountParams,
162 ) -> anyhow::Result<RestApiResponse<models::GetBfusdAccountResponse>> {
163 self.bfusd_api_client.get_bfusd_account(params).await
164 }
165
166 /// Get BFUSD Quota Details (`USER_DATA`)
167 ///
168 /// Get BFUSD quota details including subscription quota, fast redemption quota and standard redemption quota.
169 ///
170 /// Weight: 150
171 ///
172 /// # Arguments
173 ///
174 /// - `params`: [`GetBfusdQuotaDetailsParams`]
175 /// The parameters for this operation.
176 ///
177 /// # Returns
178 ///
179 /// [`RestApiResponse<models::GetBfusdQuotaDetailsResponse>`] on success.
180 ///
181 /// # Errors
182 ///
183 /// This function will return an [`anyhow::Error`] if:
184 /// - the HTTP request fails
185 /// - any parameter is invalid
186 /// - the response cannot be parsed
187 /// - or one of the following occurs:
188 /// - `RequiredError`
189 /// - `ConnectorClientError`
190 /// - `UnauthorizedError`
191 /// - `ForbiddenError`
192 /// - `TooManyRequestsError`
193 /// - `RateLimitBanError`
194 /// - `ServerError`
195 /// - `NotFoundError`
196 /// - `NetworkError`
197 /// - `BadRequestError`
198 ///
199 ///
200 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/simple_earn/bfusd/account/Get-BFUSD-Quota-Details).
201 ///
202 pub async fn get_bfusd_quota_details(
203 &self,
204 params: GetBfusdQuotaDetailsParams,
205 ) -> anyhow::Result<RestApiResponse<models::GetBfusdQuotaDetailsResponse>> {
206 self.bfusd_api_client.get_bfusd_quota_details(params).await
207 }
208
209 /// Get BFUSD Rate History (`USER_DATA`)
210 ///
211 /// Get BFUSD rate history sorted by descending order.
212 ///
213 /// * The time between `startTime` and `endTime` cannot be longer than 6 months.
214 /// * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.
215 /// * If `startTime` is sent but `endTime` is not sent, `endTime` will default to current time, and results from `startTime` onward will be returned.
216 /// * If `endTime` is sent but `startTime` is not sent, `startTime` defaults to the current time minus one month, and data between `startTime` and `endTime` will be returned.
217 ///
218 /// Weight: 150
219 ///
220 /// # Arguments
221 ///
222 /// - `params`: [`GetBfusdRateHistoryParams`]
223 /// The parameters for this operation.
224 ///
225 /// # Returns
226 ///
227 /// [`RestApiResponse<models::GetBfusdRateHistoryResponse>`] 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/simple_earn/bfusd/history/Get-BFUSD-Rate-History).
249 ///
250 pub async fn get_bfusd_rate_history(
251 &self,
252 params: GetBfusdRateHistoryParams,
253 ) -> anyhow::Result<RestApiResponse<models::GetBfusdRateHistoryResponse>> {
254 self.bfusd_api_client.get_bfusd_rate_history(params).await
255 }
256
257 /// Get BFUSD Redemption History (`USER_DATA`)
258 ///
259 /// Get BFUSD redemption history.
260 ///
261 /// * The time between `startTime` and `endTime` cannot be longer than 6 months.
262 /// * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.
263 /// * If `startTime` is sent but `endTime` is not sent, `endTime` will default to current time, and results from `startTime` onward will be returned.
264 /// * If `endTime` is sent but `startTime` is not sent, `startTime` defaults to the current time minus one month, and data between `startTime` and `endTime` will be returned.
265 ///
266 /// Weight: 150
267 ///
268 /// # Arguments
269 ///
270 /// - `params`: [`GetBfusdRedemptionHistoryParams`]
271 /// The parameters for this operation.
272 ///
273 /// # Returns
274 ///
275 /// [`RestApiResponse<models::GetBfusdRedemptionHistoryResponse>`] on success.
276 ///
277 /// # Errors
278 ///
279 /// This function will return an [`anyhow::Error`] if:
280 /// - the HTTP request fails
281 /// - any parameter is invalid
282 /// - the response cannot be parsed
283 /// - or one of the following occurs:
284 /// - `RequiredError`
285 /// - `ConnectorClientError`
286 /// - `UnauthorizedError`
287 /// - `ForbiddenError`
288 /// - `TooManyRequestsError`
289 /// - `RateLimitBanError`
290 /// - `ServerError`
291 /// - `NotFoundError`
292 /// - `NetworkError`
293 /// - `BadRequestError`
294 ///
295 ///
296 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/simple_earn/bfusd/history/Get-BFUSD-Redemption-History).
297 ///
298 pub async fn get_bfusd_redemption_history(
299 &self,
300 params: GetBfusdRedemptionHistoryParams,
301 ) -> anyhow::Result<RestApiResponse<models::GetBfusdRedemptionHistoryResponse>> {
302 self.bfusd_api_client
303 .get_bfusd_redemption_history(params)
304 .await
305 }
306
307 /// Get BFUSD Rewards History (`USER_DATA`)
308 ///
309 /// Get BFUSD rewards history.
310 ///
311 /// * The time between `startTime` and `endTime` cannot be longer than 6 months.
312 /// * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.
313 /// * If `startTime` is sent but `endTime` is not sent, `endTime` will default to current time, and results from `startTime` onward will be returned.
314 /// * If `endTime` is sent but `startTime` is not sent, `startTime` defaults to the current time minus one month, and data between `startTime` and `endTime` will be returned.
315 ///
316 /// Weight: 150
317 ///
318 /// # Arguments
319 ///
320 /// - `params`: [`GetBfusdRewardsHistoryParams`]
321 /// The parameters for this operation.
322 ///
323 /// # Returns
324 ///
325 /// [`RestApiResponse<models::GetBfusdRewardsHistoryResponse>`] on success.
326 ///
327 /// # Errors
328 ///
329 /// This function will return an [`anyhow::Error`] if:
330 /// - the HTTP request fails
331 /// - any parameter is invalid
332 /// - the response cannot be parsed
333 /// - or one of the following occurs:
334 /// - `RequiredError`
335 /// - `ConnectorClientError`
336 /// - `UnauthorizedError`
337 /// - `ForbiddenError`
338 /// - `TooManyRequestsError`
339 /// - `RateLimitBanError`
340 /// - `ServerError`
341 /// - `NotFoundError`
342 /// - `NetworkError`
343 /// - `BadRequestError`
344 ///
345 ///
346 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/simple_earn/bfusd/history/Get-BFUSD-Rewards-History).
347 ///
348 pub async fn get_bfusd_rewards_history(
349 &self,
350 params: GetBfusdRewardsHistoryParams,
351 ) -> anyhow::Result<RestApiResponse<models::GetBfusdRewardsHistoryResponse>> {
352 self.bfusd_api_client
353 .get_bfusd_rewards_history(params)
354 .await
355 }
356
357 /// Get BFUSD subscription `history(USER_DATA)`
358 ///
359 /// Get BFUSD subscription history
360 ///
361 /// * The time between `startTime` and `endTime` cannot be longer than 6 months.
362 /// * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.
363 /// * If `startTime` is sent but `endTime` is not sent, `endTime` will default to current time, and results from `startTime` onward will be returned.
364 /// * If `endTime` is sent but `startTime` is not sent, `startTime` defaults to the current time advanced by one month, and data between `startTime` and `endTime` will be returned.
365 ///
366 /// Weight: 150
367 ///
368 /// # Arguments
369 ///
370 /// - `params`: [`GetBfusdSubscriptionHistoryParams`]
371 /// The parameters for this operation.
372 ///
373 /// # Returns
374 ///
375 /// [`RestApiResponse<models::GetBfusdSubscriptionHistoryResponse>`] on success.
376 ///
377 /// # Errors
378 ///
379 /// This function will return an [`anyhow::Error`] if:
380 /// - the HTTP request fails
381 /// - any parameter is invalid
382 /// - the response cannot be parsed
383 /// - or one of the following occurs:
384 /// - `RequiredError`
385 /// - `ConnectorClientError`
386 /// - `UnauthorizedError`
387 /// - `ForbiddenError`
388 /// - `TooManyRequestsError`
389 /// - `RateLimitBanError`
390 /// - `ServerError`
391 /// - `NotFoundError`
392 /// - `NetworkError`
393 /// - `BadRequestError`
394 ///
395 ///
396 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/simple_earn/bfusd/history/Get-BFUSD-subscription-history).
397 ///
398 pub async fn get_bfusd_subscription_history(
399 &self,
400 params: GetBfusdSubscriptionHistoryParams,
401 ) -> anyhow::Result<RestApiResponse<models::GetBfusdSubscriptionHistoryResponse>> {
402 self.bfusd_api_client
403 .get_bfusd_subscription_history(params)
404 .await
405 }
406
407 /// Redeem BFUSD(TRADE)
408 ///
409 /// Redeem BFUSD to USDT
410 ///
411 /// * You need to open Enable Spot & Margin Trading permission for the API Key which requests this endpoint.
412 ///
413 /// Weight: 150
414 ///
415 /// # Arguments
416 ///
417 /// - `params`: [`RedeemBfusdParams`]
418 /// The parameters for this operation.
419 ///
420 /// # Returns
421 ///
422 /// [`RestApiResponse<models::RedeemBfusdResponse>`] on success.
423 ///
424 /// # Errors
425 ///
426 /// This function will return an [`anyhow::Error`] if:
427 /// - the HTTP request fails
428 /// - any parameter is invalid
429 /// - the response cannot be parsed
430 /// - or one of the following occurs:
431 /// - `RequiredError`
432 /// - `ConnectorClientError`
433 /// - `UnauthorizedError`
434 /// - `ForbiddenError`
435 /// - `TooManyRequestsError`
436 /// - `RateLimitBanError`
437 /// - `ServerError`
438 /// - `NotFoundError`
439 /// - `NetworkError`
440 /// - `BadRequestError`
441 ///
442 ///
443 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/simple_earn/bfusd/earn/Redeem-BFUSD).
444 ///
445 pub async fn redeem_bfusd(
446 &self,
447 params: RedeemBfusdParams,
448 ) -> anyhow::Result<RestApiResponse<models::RedeemBfusdResponse>> {
449 self.bfusd_api_client.redeem_bfusd(params).await
450 }
451
452 /// Subscribe BFUSD(TRADE)
453 ///
454 /// Subscribe BFUSD
455 ///
456 /// * You need to open Enable Spot & Margin Trading permission for the API Key which requests this endpoint.
457 ///
458 /// Weight: 150
459 ///
460 /// # Arguments
461 ///
462 /// - `params`: [`SubscribeBfusdParams`]
463 /// The parameters for this operation.
464 ///
465 /// # Returns
466 ///
467 /// [`RestApiResponse<models::SubscribeBfusdResponse>`] on success.
468 ///
469 /// # Errors
470 ///
471 /// This function will return an [`anyhow::Error`] if:
472 /// - the HTTP request fails
473 /// - any parameter is invalid
474 /// - the response cannot be parsed
475 /// - or one of the following occurs:
476 /// - `RequiredError`
477 /// - `ConnectorClientError`
478 /// - `UnauthorizedError`
479 /// - `ForbiddenError`
480 /// - `TooManyRequestsError`
481 /// - `RateLimitBanError`
482 /// - `ServerError`
483 /// - `NotFoundError`
484 /// - `NetworkError`
485 /// - `BadRequestError`
486 ///
487 ///
488 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/simple_earn/bfusd/earn/Subscribe-BFUSD).
489 ///
490 pub async fn subscribe_bfusd(
491 &self,
492 params: SubscribeBfusdParams,
493 ) -> anyhow::Result<RestApiResponse<models::SubscribeBfusdResponse>> {
494 self.bfusd_api_client.subscribe_bfusd(params).await
495 }
496
497 /// Get Collateral `Record(USER_DATA)`
498 ///
499 /// Get Collateral Record
500 ///
501 /// * The time between `startTime` and `endTime` cannot be longer than 30 days.
502 /// * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.
503 /// * If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned.
504 /// * If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned.
505 ///
506 /// Weight: 1
507 ///
508 /// # Arguments
509 ///
510 /// - `params`: [`GetCollateralRecordParams`]
511 /// The parameters for this operation.
512 ///
513 /// # Returns
514 ///
515 /// [`RestApiResponse<models::GetCollateralRecordResponse>`] on success.
516 ///
517 /// # Errors
518 ///
519 /// This function will return an [`anyhow::Error`] if:
520 /// - the HTTP request fails
521 /// - any parameter is invalid
522 /// - the response cannot be parsed
523 /// - or one of the following occurs:
524 /// - `RequiredError`
525 /// - `ConnectorClientError`
526 /// - `UnauthorizedError`
527 /// - `ForbiddenError`
528 /// - `TooManyRequestsError`
529 /// - `RateLimitBanError`
530 /// - `ServerError`
531 /// - `NotFoundError`
532 /// - `NetworkError`
533 /// - `BadRequestError`
534 ///
535 ///
536 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/simple_earn/flexible-locked/history/Get-Collateral-Record).
537 ///
538 pub async fn get_collateral_record(
539 &self,
540 params: GetCollateralRecordParams,
541 ) -> anyhow::Result<RestApiResponse<models::GetCollateralRecordResponse>> {
542 self.flexible_locked_api_client
543 .get_collateral_record(params)
544 .await
545 }
546
547 /// Get Flexible Personal Left `Quota(USER_DATA)`
548 ///
549 /// Get Flexible Personal Left Quota
550 ///
551 /// Weight: 150
552 ///
553 /// # Arguments
554 ///
555 /// - `params`: [`GetFlexiblePersonalLeftQuotaParams`]
556 /// The parameters for this operation.
557 ///
558 /// # Returns
559 ///
560 /// [`RestApiResponse<models::GetFlexiblePersonalLeftQuotaResponse>`] on success.
561 ///
562 /// # Errors
563 ///
564 /// This function will return an [`anyhow::Error`] if:
565 /// - the HTTP request fails
566 /// - any parameter is invalid
567 /// - the response cannot be parsed
568 /// - or one of the following occurs:
569 /// - `RequiredError`
570 /// - `ConnectorClientError`
571 /// - `UnauthorizedError`
572 /// - `ForbiddenError`
573 /// - `TooManyRequestsError`
574 /// - `RateLimitBanError`
575 /// - `ServerError`
576 /// - `NotFoundError`
577 /// - `NetworkError`
578 /// - `BadRequestError`
579 ///
580 ///
581 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/simple_earn/flexible-locked/account/Get-Flexible-Personal-Left-Quota).
582 ///
583 pub async fn get_flexible_personal_left_quota(
584 &self,
585 params: GetFlexiblePersonalLeftQuotaParams,
586 ) -> anyhow::Result<RestApiResponse<models::GetFlexiblePersonalLeftQuotaResponse>> {
587 self.flexible_locked_api_client
588 .get_flexible_personal_left_quota(params)
589 .await
590 }
591
592 /// Get Flexible Product `Position(USER_DATA)`
593 ///
594 /// Get Flexible Product Position
595 ///
596 /// Weight: 150
597 ///
598 /// # Arguments
599 ///
600 /// - `params`: [`GetFlexibleProductPositionParams`]
601 /// The parameters for this operation.
602 ///
603 /// # Returns
604 ///
605 /// [`RestApiResponse<models::GetFlexibleProductPositionResponse>`] on success.
606 ///
607 /// # Errors
608 ///
609 /// This function will return an [`anyhow::Error`] if:
610 /// - the HTTP request fails
611 /// - any parameter is invalid
612 /// - the response cannot be parsed
613 /// - or one of the following occurs:
614 /// - `RequiredError`
615 /// - `ConnectorClientError`
616 /// - `UnauthorizedError`
617 /// - `ForbiddenError`
618 /// - `TooManyRequestsError`
619 /// - `RateLimitBanError`
620 /// - `ServerError`
621 /// - `NotFoundError`
622 /// - `NetworkError`
623 /// - `BadRequestError`
624 ///
625 ///
626 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/simple_earn/flexible-locked/account/Get-Flexible-Product-Position).
627 ///
628 pub async fn get_flexible_product_position(
629 &self,
630 params: GetFlexibleProductPositionParams,
631 ) -> anyhow::Result<RestApiResponse<models::GetFlexibleProductPositionResponse>> {
632 self.flexible_locked_api_client
633 .get_flexible_product_position(params)
634 .await
635 }
636
637 /// Get Flexible Redemption `Record(USER_DATA)`
638 ///
639 /// Get Flexible Redemption Record
640 ///
641 /// * The time between `startTime` and `endTime` cannot be longer than 30 days.
642 /// * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.
643 /// * If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned.
644 /// * If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned.
645 ///
646 /// Weight: 150
647 ///
648 /// # Arguments
649 ///
650 /// - `params`: [`GetFlexibleRedemptionRecordParams`]
651 /// The parameters for this operation.
652 ///
653 /// # Returns
654 ///
655 /// [`RestApiResponse<models::GetFlexibleRedemptionRecordResponse>`] on success.
656 ///
657 /// # Errors
658 ///
659 /// This function will return an [`anyhow::Error`] if:
660 /// - the HTTP request fails
661 /// - any parameter is invalid
662 /// - the response cannot be parsed
663 /// - or one of the following occurs:
664 /// - `RequiredError`
665 /// - `ConnectorClientError`
666 /// - `UnauthorizedError`
667 /// - `ForbiddenError`
668 /// - `TooManyRequestsError`
669 /// - `RateLimitBanError`
670 /// - `ServerError`
671 /// - `NotFoundError`
672 /// - `NetworkError`
673 /// - `BadRequestError`
674 ///
675 ///
676 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/simple_earn/flexible-locked/history/Get-Flexible-Redemption-Record).
677 ///
678 pub async fn get_flexible_redemption_record(
679 &self,
680 params: GetFlexibleRedemptionRecordParams,
681 ) -> anyhow::Result<RestApiResponse<models::GetFlexibleRedemptionRecordResponse>> {
682 self.flexible_locked_api_client
683 .get_flexible_redemption_record(params)
684 .await
685 }
686
687 /// Get Flexible Rewards `History(USER_DATA)`
688 ///
689 /// Get Flexible Rewards History
690 ///
691 /// * The time between `startTime` and `endTime` cannot be longer than 30 days.
692 /// * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.
693 /// * If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned.
694 /// * If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned.
695 ///
696 /// Weight: 150
697 ///
698 /// # Arguments
699 ///
700 /// - `params`: [`GetFlexibleRewardsHistoryParams`]
701 /// The parameters for this operation.
702 ///
703 /// # Returns
704 ///
705 /// [`RestApiResponse<models::GetFlexibleRewardsHistoryResponse>`] on success.
706 ///
707 /// # Errors
708 ///
709 /// This function will return an [`anyhow::Error`] if:
710 /// - the HTTP request fails
711 /// - any parameter is invalid
712 /// - the response cannot be parsed
713 /// - or one of the following occurs:
714 /// - `RequiredError`
715 /// - `ConnectorClientError`
716 /// - `UnauthorizedError`
717 /// - `ForbiddenError`
718 /// - `TooManyRequestsError`
719 /// - `RateLimitBanError`
720 /// - `ServerError`
721 /// - `NotFoundError`
722 /// - `NetworkError`
723 /// - `BadRequestError`
724 ///
725 ///
726 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/simple_earn/flexible-locked/history/Get-Flexible-Rewards-History).
727 ///
728 pub async fn get_flexible_rewards_history(
729 &self,
730 params: GetFlexibleRewardsHistoryParams,
731 ) -> anyhow::Result<RestApiResponse<models::GetFlexibleRewardsHistoryResponse>> {
732 self.flexible_locked_api_client
733 .get_flexible_rewards_history(params)
734 .await
735 }
736
737 /// Get Flexible Subscription `Preview(USER_DATA)`
738 ///
739 /// Get Flexible Subscription Preview
740 ///
741 /// Weight: 150
742 ///
743 /// # Arguments
744 ///
745 /// - `params`: [`GetFlexibleSubscriptionPreviewParams`]
746 /// The parameters for this operation.
747 ///
748 /// # Returns
749 ///
750 /// [`RestApiResponse<models::GetFlexibleSubscriptionPreviewResponse>`] on success.
751 ///
752 /// # Errors
753 ///
754 /// This function will return an [`anyhow::Error`] if:
755 /// - the HTTP request fails
756 /// - any parameter is invalid
757 /// - the response cannot be parsed
758 /// - or one of the following occurs:
759 /// - `RequiredError`
760 /// - `ConnectorClientError`
761 /// - `UnauthorizedError`
762 /// - `ForbiddenError`
763 /// - `TooManyRequestsError`
764 /// - `RateLimitBanError`
765 /// - `ServerError`
766 /// - `NotFoundError`
767 /// - `NetworkError`
768 /// - `BadRequestError`
769 ///
770 ///
771 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/simple_earn/flexible-locked/earn/Get-Flexible-Subscription-Preview).
772 ///
773 pub async fn get_flexible_subscription_preview(
774 &self,
775 params: GetFlexibleSubscriptionPreviewParams,
776 ) -> anyhow::Result<RestApiResponse<models::GetFlexibleSubscriptionPreviewResponse>> {
777 self.flexible_locked_api_client
778 .get_flexible_subscription_preview(params)
779 .await
780 }
781
782 /// Get Flexible Subscription `Record(USER_DATA)`
783 ///
784 /// Get Flexible Subscription Record
785 ///
786 /// * The time between `startTime` and `endTime` cannot be longer than 30 days.
787 /// * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.
788 /// * If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned.
789 /// * If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned.
790 ///
791 /// Weight: 150
792 ///
793 /// # Arguments
794 ///
795 /// - `params`: [`GetFlexibleSubscriptionRecordParams`]
796 /// The parameters for this operation.
797 ///
798 /// # Returns
799 ///
800 /// [`RestApiResponse<models::GetFlexibleSubscriptionRecordResponse>`] on success.
801 ///
802 /// # Errors
803 ///
804 /// This function will return an [`anyhow::Error`] if:
805 /// - the HTTP request fails
806 /// - any parameter is invalid
807 /// - the response cannot be parsed
808 /// - or one of the following occurs:
809 /// - `RequiredError`
810 /// - `ConnectorClientError`
811 /// - `UnauthorizedError`
812 /// - `ForbiddenError`
813 /// - `TooManyRequestsError`
814 /// - `RateLimitBanError`
815 /// - `ServerError`
816 /// - `NotFoundError`
817 /// - `NetworkError`
818 /// - `BadRequestError`
819 ///
820 ///
821 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/simple_earn/flexible-locked/history/Get-Flexible-Subscription-Record).
822 ///
823 pub async fn get_flexible_subscription_record(
824 &self,
825 params: GetFlexibleSubscriptionRecordParams,
826 ) -> anyhow::Result<RestApiResponse<models::GetFlexibleSubscriptionRecordResponse>> {
827 self.flexible_locked_api_client
828 .get_flexible_subscription_record(params)
829 .await
830 }
831
832 /// Get Locked Personal Left `Quota(USER_DATA)`
833 ///
834 /// Get Locked Personal Left Quota
835 ///
836 /// Weight: 150
837 ///
838 /// # Arguments
839 ///
840 /// - `params`: [`GetLockedPersonalLeftQuotaParams`]
841 /// The parameters for this operation.
842 ///
843 /// # Returns
844 ///
845 /// [`RestApiResponse<models::GetLockedPersonalLeftQuotaResponse>`] on success.
846 ///
847 /// # Errors
848 ///
849 /// This function will return an [`anyhow::Error`] if:
850 /// - the HTTP request fails
851 /// - any parameter is invalid
852 /// - the response cannot be parsed
853 /// - or one of the following occurs:
854 /// - `RequiredError`
855 /// - `ConnectorClientError`
856 /// - `UnauthorizedError`
857 /// - `ForbiddenError`
858 /// - `TooManyRequestsError`
859 /// - `RateLimitBanError`
860 /// - `ServerError`
861 /// - `NotFoundError`
862 /// - `NetworkError`
863 /// - `BadRequestError`
864 ///
865 ///
866 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/simple_earn/flexible-locked/account/Get-Locked-Personal-Left-Quota).
867 ///
868 pub async fn get_locked_personal_left_quota(
869 &self,
870 params: GetLockedPersonalLeftQuotaParams,
871 ) -> anyhow::Result<RestApiResponse<models::GetLockedPersonalLeftQuotaResponse>> {
872 self.flexible_locked_api_client
873 .get_locked_personal_left_quota(params)
874 .await
875 }
876
877 /// Get Locked Product Position
878 ///
879 /// Get Locked Product Position
880 ///
881 /// Weight: 150
882 ///
883 /// # Arguments
884 ///
885 /// - `params`: [`GetLockedProductPositionParams`]
886 /// The parameters for this operation.
887 ///
888 /// # Returns
889 ///
890 /// [`RestApiResponse<models::GetLockedProductPositionResponse>`] on success.
891 ///
892 /// # Errors
893 ///
894 /// This function will return an [`anyhow::Error`] if:
895 /// - the HTTP request fails
896 /// - any parameter is invalid
897 /// - the response cannot be parsed
898 /// - or one of the following occurs:
899 /// - `RequiredError`
900 /// - `ConnectorClientError`
901 /// - `UnauthorizedError`
902 /// - `ForbiddenError`
903 /// - `TooManyRequestsError`
904 /// - `RateLimitBanError`
905 /// - `ServerError`
906 /// - `NotFoundError`
907 /// - `NetworkError`
908 /// - `BadRequestError`
909 ///
910 ///
911 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/simple_earn/flexible-locked/account/Get-Locked-Product-Position).
912 ///
913 pub async fn get_locked_product_position(
914 &self,
915 params: GetLockedProductPositionParams,
916 ) -> anyhow::Result<RestApiResponse<models::GetLockedProductPositionResponse>> {
917 self.flexible_locked_api_client
918 .get_locked_product_position(params)
919 .await
920 }
921
922 /// Get Locked Redemption `Record(USER_DATA)`
923 ///
924 /// Get Locked Redemption Record
925 ///
926 /// * The time between `startTime` and `endTime` cannot be longer than 30 days.
927 /// * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.
928 /// * If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned.
929 /// * If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned.
930 ///
931 /// Weight: 150
932 ///
933 /// # Arguments
934 ///
935 /// - `params`: [`GetLockedRedemptionRecordParams`]
936 /// The parameters for this operation.
937 ///
938 /// # Returns
939 ///
940 /// [`RestApiResponse<models::GetLockedRedemptionRecordResponse>`] on success.
941 ///
942 /// # Errors
943 ///
944 /// This function will return an [`anyhow::Error`] if:
945 /// - the HTTP request fails
946 /// - any parameter is invalid
947 /// - the response cannot be parsed
948 /// - or one of the following occurs:
949 /// - `RequiredError`
950 /// - `ConnectorClientError`
951 /// - `UnauthorizedError`
952 /// - `ForbiddenError`
953 /// - `TooManyRequestsError`
954 /// - `RateLimitBanError`
955 /// - `ServerError`
956 /// - `NotFoundError`
957 /// - `NetworkError`
958 /// - `BadRequestError`
959 ///
960 ///
961 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/simple_earn/flexible-locked/history/Get-Locked-Redemption-Record).
962 ///
963 pub async fn get_locked_redemption_record(
964 &self,
965 params: GetLockedRedemptionRecordParams,
966 ) -> anyhow::Result<RestApiResponse<models::GetLockedRedemptionRecordResponse>> {
967 self.flexible_locked_api_client
968 .get_locked_redemption_record(params)
969 .await
970 }
971
972 /// Get Locked Rewards `History(USER_DATA)`
973 ///
974 /// Get Locked Rewards History
975 ///
976 /// * The time between `startTime` and `endTime` cannot be longer than 30 days.
977 /// * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.
978 /// * If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned.
979 /// * If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned.
980 ///
981 /// Weight: 150
982 ///
983 /// # Arguments
984 ///
985 /// - `params`: [`GetLockedRewardsHistoryParams`]
986 /// The parameters for this operation.
987 ///
988 /// # Returns
989 ///
990 /// [`RestApiResponse<models::GetLockedRewardsHistoryResponse>`] on success.
991 ///
992 /// # Errors
993 ///
994 /// This function will return an [`anyhow::Error`] if:
995 /// - the HTTP request fails
996 /// - any parameter is invalid
997 /// - the response cannot be parsed
998 /// - or one of the following occurs:
999 /// - `RequiredError`
1000 /// - `ConnectorClientError`
1001 /// - `UnauthorizedError`
1002 /// - `ForbiddenError`
1003 /// - `TooManyRequestsError`
1004 /// - `RateLimitBanError`
1005 /// - `ServerError`
1006 /// - `NotFoundError`
1007 /// - `NetworkError`
1008 /// - `BadRequestError`
1009 ///
1010 ///
1011 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/simple_earn/flexible-locked/history/Get-Locked-Rewards-History).
1012 ///
1013 pub async fn get_locked_rewards_history(
1014 &self,
1015 params: GetLockedRewardsHistoryParams,
1016 ) -> anyhow::Result<RestApiResponse<models::GetLockedRewardsHistoryResponse>> {
1017 self.flexible_locked_api_client
1018 .get_locked_rewards_history(params)
1019 .await
1020 }
1021
1022 /// Get Locked Subscription `Preview(USER_DATA)`
1023 ///
1024 /// Get Locked Subscription Preview
1025 ///
1026 /// Weight: 150
1027 ///
1028 /// # Arguments
1029 ///
1030 /// - `params`: [`GetLockedSubscriptionPreviewParams`]
1031 /// The parameters for this operation.
1032 ///
1033 /// # Returns
1034 ///
1035 /// [`RestApiResponse<Vec<models::GetLockedSubscriptionPreviewResponseInner>>`] on success.
1036 ///
1037 /// # Errors
1038 ///
1039 /// This function will return an [`anyhow::Error`] if:
1040 /// - the HTTP request fails
1041 /// - any parameter is invalid
1042 /// - the response cannot be parsed
1043 /// - or one of the following occurs:
1044 /// - `RequiredError`
1045 /// - `ConnectorClientError`
1046 /// - `UnauthorizedError`
1047 /// - `ForbiddenError`
1048 /// - `TooManyRequestsError`
1049 /// - `RateLimitBanError`
1050 /// - `ServerError`
1051 /// - `NotFoundError`
1052 /// - `NetworkError`
1053 /// - `BadRequestError`
1054 ///
1055 ///
1056 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/simple_earn/flexible-locked/earn/Get-Locked-Subscription-Preview).
1057 ///
1058 pub async fn get_locked_subscription_preview(
1059 &self,
1060 params: GetLockedSubscriptionPreviewParams,
1061 ) -> anyhow::Result<RestApiResponse<Vec<models::GetLockedSubscriptionPreviewResponseInner>>>
1062 {
1063 self.flexible_locked_api_client
1064 .get_locked_subscription_preview(params)
1065 .await
1066 }
1067
1068 /// Get Locked Subscription `Record(USER_DATA)`
1069 ///
1070 /// Get Locked Subscription Record
1071 ///
1072 /// * The time between `startTime` and `endTime` cannot be longer than 30 days.
1073 /// * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.
1074 /// * If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned.
1075 /// * If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned.
1076 ///
1077 /// Weight: 150
1078 ///
1079 /// # Arguments
1080 ///
1081 /// - `params`: [`GetLockedSubscriptionRecordParams`]
1082 /// The parameters for this operation.
1083 ///
1084 /// # Returns
1085 ///
1086 /// [`RestApiResponse<models::GetLockedSubscriptionRecordResponse>`] on success.
1087 ///
1088 /// # Errors
1089 ///
1090 /// This function will return an [`anyhow::Error`] if:
1091 /// - the HTTP request fails
1092 /// - any parameter is invalid
1093 /// - the response cannot be parsed
1094 /// - or one of the following occurs:
1095 /// - `RequiredError`
1096 /// - `ConnectorClientError`
1097 /// - `UnauthorizedError`
1098 /// - `ForbiddenError`
1099 /// - `TooManyRequestsError`
1100 /// - `RateLimitBanError`
1101 /// - `ServerError`
1102 /// - `NotFoundError`
1103 /// - `NetworkError`
1104 /// - `BadRequestError`
1105 ///
1106 ///
1107 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/simple_earn/flexible-locked/history/Get-Locked-Subscription-Record).
1108 ///
1109 pub async fn get_locked_subscription_record(
1110 &self,
1111 params: GetLockedSubscriptionRecordParams,
1112 ) -> anyhow::Result<RestApiResponse<models::GetLockedSubscriptionRecordResponse>> {
1113 self.flexible_locked_api_client
1114 .get_locked_subscription_record(params)
1115 .await
1116 }
1117
1118 /// Get Rate `History(USER_DATA)`
1119 ///
1120 /// Get Rate History
1121 ///
1122 /// * The time between startTime and endTime cannot be longer than 1 year.
1123 /// * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.
1124 /// * If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned.
1125 /// * If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned.
1126 ///
1127 /// Weight: 150
1128 ///
1129 /// # Arguments
1130 ///
1131 /// - `params`: [`GetRateHistoryParams`]
1132 /// The parameters for this operation.
1133 ///
1134 /// # Returns
1135 ///
1136 /// [`RestApiResponse<models::GetRateHistoryResponse>`] on success.
1137 ///
1138 /// # Errors
1139 ///
1140 /// This function will return an [`anyhow::Error`] if:
1141 /// - the HTTP request fails
1142 /// - any parameter is invalid
1143 /// - the response cannot be parsed
1144 /// - or one of the following occurs:
1145 /// - `RequiredError`
1146 /// - `ConnectorClientError`
1147 /// - `UnauthorizedError`
1148 /// - `ForbiddenError`
1149 /// - `TooManyRequestsError`
1150 /// - `RateLimitBanError`
1151 /// - `ServerError`
1152 /// - `NotFoundError`
1153 /// - `NetworkError`
1154 /// - `BadRequestError`
1155 ///
1156 ///
1157 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/simple_earn/flexible-locked/history/Get-Rate-History).
1158 ///
1159 pub async fn get_rate_history(
1160 &self,
1161 params: GetRateHistoryParams,
1162 ) -> anyhow::Result<RestApiResponse<models::GetRateHistoryResponse>> {
1163 self.flexible_locked_api_client
1164 .get_rate_history(params)
1165 .await
1166 }
1167
1168 /// Get Simple Earn Flexible Product `List(USER_DATA)`
1169 ///
1170 /// Get available Simple Earn flexible product list
1171 ///
1172 /// Weight: 150
1173 ///
1174 /// # Arguments
1175 ///
1176 /// - `params`: [`GetSimpleEarnFlexibleProductListParams`]
1177 /// The parameters for this operation.
1178 ///
1179 /// # Returns
1180 ///
1181 /// [`RestApiResponse<models::GetSimpleEarnFlexibleProductListResponse>`] on success.
1182 ///
1183 /// # Errors
1184 ///
1185 /// This function will return an [`anyhow::Error`] if:
1186 /// - the HTTP request fails
1187 /// - any parameter is invalid
1188 /// - the response cannot be parsed
1189 /// - or one of the following occurs:
1190 /// - `RequiredError`
1191 /// - `ConnectorClientError`
1192 /// - `UnauthorizedError`
1193 /// - `ForbiddenError`
1194 /// - `TooManyRequestsError`
1195 /// - `RateLimitBanError`
1196 /// - `ServerError`
1197 /// - `NotFoundError`
1198 /// - `NetworkError`
1199 /// - `BadRequestError`
1200 ///
1201 ///
1202 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/simple_earn/flexible-locked/account/Get-Simple-Earn-Flexible-Product-List).
1203 ///
1204 pub async fn get_simple_earn_flexible_product_list(
1205 &self,
1206 params: GetSimpleEarnFlexibleProductListParams,
1207 ) -> anyhow::Result<RestApiResponse<models::GetSimpleEarnFlexibleProductListResponse>> {
1208 self.flexible_locked_api_client
1209 .get_simple_earn_flexible_product_list(params)
1210 .await
1211 }
1212
1213 /// Get Simple Earn Locked Product `List(USER_DATA)`
1214 ///
1215 /// Get Simple Earn Locked Product List
1216 ///
1217 /// * Get available Simple Earn locked product list
1218 ///
1219 /// Weight: 150
1220 ///
1221 /// # Arguments
1222 ///
1223 /// - `params`: [`GetSimpleEarnLockedProductListParams`]
1224 /// The parameters for this operation.
1225 ///
1226 /// # Returns
1227 ///
1228 /// [`RestApiResponse<models::GetSimpleEarnLockedProductListResponse>`] on success.
1229 ///
1230 /// # Errors
1231 ///
1232 /// This function will return an [`anyhow::Error`] if:
1233 /// - the HTTP request fails
1234 /// - any parameter is invalid
1235 /// - the response cannot be parsed
1236 /// - or one of the following occurs:
1237 /// - `RequiredError`
1238 /// - `ConnectorClientError`
1239 /// - `UnauthorizedError`
1240 /// - `ForbiddenError`
1241 /// - `TooManyRequestsError`
1242 /// - `RateLimitBanError`
1243 /// - `ServerError`
1244 /// - `NotFoundError`
1245 /// - `NetworkError`
1246 /// - `BadRequestError`
1247 ///
1248 ///
1249 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/simple_earn/flexible-locked/account/Get-Simple-Earn-Locked-Product-List).
1250 ///
1251 pub async fn get_simple_earn_locked_product_list(
1252 &self,
1253 params: GetSimpleEarnLockedProductListParams,
1254 ) -> anyhow::Result<RestApiResponse<models::GetSimpleEarnLockedProductListResponse>> {
1255 self.flexible_locked_api_client
1256 .get_simple_earn_locked_product_list(params)
1257 .await
1258 }
1259
1260 /// Redeem Flexible Product(TRADE)
1261 ///
1262 /// Redeem Flexible Product
1263 ///
1264 /// * You need to open `Enable Spot & Margin Trading` permission for the API Key which requests this endpoint.
1265 ///
1266 /// Weight: 1
1267 ///
1268 /// # Arguments
1269 ///
1270 /// - `params`: [`RedeemFlexibleProductParams`]
1271 /// The parameters for this operation.
1272 ///
1273 /// # Returns
1274 ///
1275 /// [`RestApiResponse<models::RedeemFlexibleProductResponse>`] on success.
1276 ///
1277 /// # Errors
1278 ///
1279 /// This function will return an [`anyhow::Error`] if:
1280 /// - the HTTP request fails
1281 /// - any parameter is invalid
1282 /// - the response cannot be parsed
1283 /// - or one of the following occurs:
1284 /// - `RequiredError`
1285 /// - `ConnectorClientError`
1286 /// - `UnauthorizedError`
1287 /// - `ForbiddenError`
1288 /// - `TooManyRequestsError`
1289 /// - `RateLimitBanError`
1290 /// - `ServerError`
1291 /// - `NotFoundError`
1292 /// - `NetworkError`
1293 /// - `BadRequestError`
1294 ///
1295 ///
1296 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/simple_earn/flexible-locked/earn/Redeem-Flexible-Product).
1297 ///
1298 pub async fn redeem_flexible_product(
1299 &self,
1300 params: RedeemFlexibleProductParams,
1301 ) -> anyhow::Result<RestApiResponse<models::RedeemFlexibleProductResponse>> {
1302 self.flexible_locked_api_client
1303 .redeem_flexible_product(params)
1304 .await
1305 }
1306
1307 /// Redeem Locked Product(TRADE)
1308 ///
1309 /// Redeem Locked Product
1310 ///
1311 /// * You need to open `Enable Spot & Margin Trading` permission for the API Key which requests this endpoint.
1312 ///
1313 /// Weight: 1/3s per account
1314 ///
1315 /// # Arguments
1316 ///
1317 /// - `params`: [`RedeemLockedProductParams`]
1318 /// The parameters for this operation.
1319 ///
1320 /// # Returns
1321 ///
1322 /// [`RestApiResponse<models::RedeemLockedProductResponse>`] on success.
1323 ///
1324 /// # Errors
1325 ///
1326 /// This function will return an [`anyhow::Error`] if:
1327 /// - the HTTP request fails
1328 /// - any parameter is invalid
1329 /// - the response cannot be parsed
1330 /// - or one of the following occurs:
1331 /// - `RequiredError`
1332 /// - `ConnectorClientError`
1333 /// - `UnauthorizedError`
1334 /// - `ForbiddenError`
1335 /// - `TooManyRequestsError`
1336 /// - `RateLimitBanError`
1337 /// - `ServerError`
1338 /// - `NotFoundError`
1339 /// - `NetworkError`
1340 /// - `BadRequestError`
1341 ///
1342 ///
1343 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/simple_earn/flexible-locked/earn/Redeem-Locked-Product).
1344 ///
1345 pub async fn redeem_locked_product(
1346 &self,
1347 params: RedeemLockedProductParams,
1348 ) -> anyhow::Result<RestApiResponse<models::RedeemLockedProductResponse>> {
1349 self.flexible_locked_api_client
1350 .redeem_locked_product(params)
1351 .await
1352 }
1353
1354 /// Set Flexible Auto `Subscribe(USER_DATA)`
1355 ///
1356 /// Set Flexible Auto Subscribe
1357 ///
1358 /// Weight: 150
1359 ///
1360 /// # Arguments
1361 ///
1362 /// - `params`: [`SetFlexibleAutoSubscribeParams`]
1363 /// The parameters for this operation.
1364 ///
1365 /// # Returns
1366 ///
1367 /// [`RestApiResponse<models::SetFlexibleAutoSubscribeResponse>`] on success.
1368 ///
1369 /// # Errors
1370 ///
1371 /// This function will return an [`anyhow::Error`] if:
1372 /// - the HTTP request fails
1373 /// - any parameter is invalid
1374 /// - the response cannot be parsed
1375 /// - or one of the following occurs:
1376 /// - `RequiredError`
1377 /// - `ConnectorClientError`
1378 /// - `UnauthorizedError`
1379 /// - `ForbiddenError`
1380 /// - `TooManyRequestsError`
1381 /// - `RateLimitBanError`
1382 /// - `ServerError`
1383 /// - `NotFoundError`
1384 /// - `NetworkError`
1385 /// - `BadRequestError`
1386 ///
1387 ///
1388 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/simple_earn/flexible-locked/earn/Set-Flexible-Auto-Subscribe).
1389 ///
1390 pub async fn set_flexible_auto_subscribe(
1391 &self,
1392 params: SetFlexibleAutoSubscribeParams,
1393 ) -> anyhow::Result<RestApiResponse<models::SetFlexibleAutoSubscribeResponse>> {
1394 self.flexible_locked_api_client
1395 .set_flexible_auto_subscribe(params)
1396 .await
1397 }
1398
1399 /// Set Locked Auto `Subscribe(USER_DATA)`
1400 ///
1401 /// Set locked auto subscribe
1402 ///
1403 /// Weight: 150
1404 ///
1405 /// # Arguments
1406 ///
1407 /// - `params`: [`SetLockedAutoSubscribeParams`]
1408 /// The parameters for this operation.
1409 ///
1410 /// # Returns
1411 ///
1412 /// [`RestApiResponse<models::SetLockedAutoSubscribeResponse>`] on success.
1413 ///
1414 /// # Errors
1415 ///
1416 /// This function will return an [`anyhow::Error`] if:
1417 /// - the HTTP request fails
1418 /// - any parameter is invalid
1419 /// - the response cannot be parsed
1420 /// - or one of the following occurs:
1421 /// - `RequiredError`
1422 /// - `ConnectorClientError`
1423 /// - `UnauthorizedError`
1424 /// - `ForbiddenError`
1425 /// - `TooManyRequestsError`
1426 /// - `RateLimitBanError`
1427 /// - `ServerError`
1428 /// - `NotFoundError`
1429 /// - `NetworkError`
1430 /// - `BadRequestError`
1431 ///
1432 ///
1433 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/simple_earn/flexible-locked/earn/Set-Locked-Auto-Subscribe).
1434 ///
1435 pub async fn set_locked_auto_subscribe(
1436 &self,
1437 params: SetLockedAutoSubscribeParams,
1438 ) -> anyhow::Result<RestApiResponse<models::SetLockedAutoSubscribeResponse>> {
1439 self.flexible_locked_api_client
1440 .set_locked_auto_subscribe(params)
1441 .await
1442 }
1443
1444 /// Set Locked Product Redeem `Option(USER_DATA)`
1445 ///
1446 /// Set redeem option for Locked product
1447 ///
1448 /// Weight: 50
1449 ///
1450 /// # Arguments
1451 ///
1452 /// - `params`: [`SetLockedProductRedeemOptionParams`]
1453 /// The parameters for this operation.
1454 ///
1455 /// # Returns
1456 ///
1457 /// [`RestApiResponse<models::SetLockedProductRedeemOptionResponse>`] on success.
1458 ///
1459 /// # Errors
1460 ///
1461 /// This function will return an [`anyhow::Error`] if:
1462 /// - the HTTP request fails
1463 /// - any parameter is invalid
1464 /// - the response cannot be parsed
1465 /// - or one of the following occurs:
1466 /// - `RequiredError`
1467 /// - `ConnectorClientError`
1468 /// - `UnauthorizedError`
1469 /// - `ForbiddenError`
1470 /// - `TooManyRequestsError`
1471 /// - `RateLimitBanError`
1472 /// - `ServerError`
1473 /// - `NotFoundError`
1474 /// - `NetworkError`
1475 /// - `BadRequestError`
1476 ///
1477 ///
1478 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/simple_earn/flexible-locked/earn/Set-Locked-Redeem-Option).
1479 ///
1480 pub async fn set_locked_product_redeem_option(
1481 &self,
1482 params: SetLockedProductRedeemOptionParams,
1483 ) -> anyhow::Result<RestApiResponse<models::SetLockedProductRedeemOptionResponse>> {
1484 self.flexible_locked_api_client
1485 .set_locked_product_redeem_option(params)
1486 .await
1487 }
1488
1489 /// Simple `Account(USER_DATA)`
1490 ///
1491 /// Simple Account query
1492 ///
1493 /// Weight: 150
1494 ///
1495 /// # Arguments
1496 ///
1497 /// - `params`: [`SimpleAccountParams`]
1498 /// The parameters for this operation.
1499 ///
1500 /// # Returns
1501 ///
1502 /// [`RestApiResponse<models::SimpleAccountResponse>`] on success.
1503 ///
1504 /// # Errors
1505 ///
1506 /// This function will return an [`anyhow::Error`] if:
1507 /// - the HTTP request fails
1508 /// - any parameter is invalid
1509 /// - the response cannot be parsed
1510 /// - or one of the following occurs:
1511 /// - `RequiredError`
1512 /// - `ConnectorClientError`
1513 /// - `UnauthorizedError`
1514 /// - `ForbiddenError`
1515 /// - `TooManyRequestsError`
1516 /// - `RateLimitBanError`
1517 /// - `ServerError`
1518 /// - `NotFoundError`
1519 /// - `NetworkError`
1520 /// - `BadRequestError`
1521 ///
1522 ///
1523 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/simple_earn/flexible-locked/account/Simple-Account).
1524 ///
1525 pub async fn simple_account(
1526 &self,
1527 params: SimpleAccountParams,
1528 ) -> anyhow::Result<RestApiResponse<models::SimpleAccountResponse>> {
1529 self.flexible_locked_api_client.simple_account(params).await
1530 }
1531
1532 /// Subscribe Flexible Product(TRADE)
1533 ///
1534 /// Subscribe Flexible Product
1535 ///
1536 /// * You need to open `Enable Spot & Margin Trading` permission for the API Key which requests this endpoint.
1537 ///
1538 /// Weight: 1
1539 ///
1540 /// # Arguments
1541 ///
1542 /// - `params`: [`SubscribeFlexibleProductParams`]
1543 /// The parameters for this operation.
1544 ///
1545 /// # Returns
1546 ///
1547 /// [`RestApiResponse<models::SubscribeFlexibleProductResponse>`] on success.
1548 ///
1549 /// # Errors
1550 ///
1551 /// This function will return an [`anyhow::Error`] if:
1552 /// - the HTTP request fails
1553 /// - any parameter is invalid
1554 /// - the response cannot be parsed
1555 /// - or one of the following occurs:
1556 /// - `RequiredError`
1557 /// - `ConnectorClientError`
1558 /// - `UnauthorizedError`
1559 /// - `ForbiddenError`
1560 /// - `TooManyRequestsError`
1561 /// - `RateLimitBanError`
1562 /// - `ServerError`
1563 /// - `NotFoundError`
1564 /// - `NetworkError`
1565 /// - `BadRequestError`
1566 ///
1567 ///
1568 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/simple_earn/flexible-locked/earn/Subscribe-Flexible-Product).
1569 ///
1570 pub async fn subscribe_flexible_product(
1571 &self,
1572 params: SubscribeFlexibleProductParams,
1573 ) -> anyhow::Result<RestApiResponse<models::SubscribeFlexibleProductResponse>> {
1574 self.flexible_locked_api_client
1575 .subscribe_flexible_product(params)
1576 .await
1577 }
1578
1579 /// Subscribe Locked Product(TRADE)
1580 ///
1581 /// Subscribe Locked Product
1582 ///
1583 /// * You need to open `Enable Spot & Margin Trading` permission for the API Key which requests this endpoint.
1584 ///
1585 /// Weight: 1
1586 ///
1587 /// # Arguments
1588 ///
1589 /// - `params`: [`SubscribeLockedProductParams`]
1590 /// The parameters for this operation.
1591 ///
1592 /// # Returns
1593 ///
1594 /// [`RestApiResponse<models::SubscribeLockedProductResponse>`] on success.
1595 ///
1596 /// # Errors
1597 ///
1598 /// This function will return an [`anyhow::Error`] if:
1599 /// - the HTTP request fails
1600 /// - any parameter is invalid
1601 /// - the response cannot be parsed
1602 /// - or one of the following occurs:
1603 /// - `RequiredError`
1604 /// - `ConnectorClientError`
1605 /// - `UnauthorizedError`
1606 /// - `ForbiddenError`
1607 /// - `TooManyRequestsError`
1608 /// - `RateLimitBanError`
1609 /// - `ServerError`
1610 /// - `NotFoundError`
1611 /// - `NetworkError`
1612 /// - `BadRequestError`
1613 ///
1614 ///
1615 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/simple_earn/flexible-locked/earn/Subscribe-Locked-Product).
1616 ///
1617 pub async fn subscribe_locked_product(
1618 &self,
1619 params: SubscribeLockedProductParams,
1620 ) -> anyhow::Result<RestApiResponse<models::SubscribeLockedProductResponse>> {
1621 self.flexible_locked_api_client
1622 .subscribe_locked_product(params)
1623 .await
1624 }
1625
1626 /// Get RWUSD Account (`USER_DATA`)
1627 ///
1628 /// Get RWUSD account information.
1629 ///
1630 /// Weight: 150
1631 ///
1632 /// # Arguments
1633 ///
1634 /// - `params`: [`GetRwusdAccountParams`]
1635 /// The parameters for this operation.
1636 ///
1637 /// # Returns
1638 ///
1639 /// [`RestApiResponse<models::GetRwusdAccountResponse>`] on success.
1640 ///
1641 /// # Errors
1642 ///
1643 /// This function will return an [`anyhow::Error`] if:
1644 /// - the HTTP request fails
1645 /// - any parameter is invalid
1646 /// - the response cannot be parsed
1647 /// - or one of the following occurs:
1648 /// - `RequiredError`
1649 /// - `ConnectorClientError`
1650 /// - `UnauthorizedError`
1651 /// - `ForbiddenError`
1652 /// - `TooManyRequestsError`
1653 /// - `RateLimitBanError`
1654 /// - `ServerError`
1655 /// - `NotFoundError`
1656 /// - `NetworkError`
1657 /// - `BadRequestError`
1658 ///
1659 ///
1660 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/simple_earn/rwusd/account/).
1661 ///
1662 pub async fn get_rwusd_account(
1663 &self,
1664 params: GetRwusdAccountParams,
1665 ) -> anyhow::Result<RestApiResponse<models::GetRwusdAccountResponse>> {
1666 self.rwusd_api_client.get_rwusd_account(params).await
1667 }
1668
1669 /// Get RWUSD Quota Details (`USER_DATA`)
1670 ///
1671 /// Get RWUSD quota details including subscription quota, fast redemption quota, and standard redemption quota.
1672 ///
1673 /// Weight: 150
1674 ///
1675 /// # Arguments
1676 ///
1677 /// - `params`: [`GetRwusdQuotaDetailsParams`]
1678 /// The parameters for this operation.
1679 ///
1680 /// # Returns
1681 ///
1682 /// [`RestApiResponse<models::GetRwusdQuotaDetailsResponse>`] on success.
1683 ///
1684 /// # Errors
1685 ///
1686 /// This function will return an [`anyhow::Error`] if:
1687 /// - the HTTP request fails
1688 /// - any parameter is invalid
1689 /// - the response cannot be parsed
1690 /// - or one of the following occurs:
1691 /// - `RequiredError`
1692 /// - `ConnectorClientError`
1693 /// - `UnauthorizedError`
1694 /// - `ForbiddenError`
1695 /// - `TooManyRequestsError`
1696 /// - `RateLimitBanError`
1697 /// - `ServerError`
1698 /// - `NotFoundError`
1699 /// - `NetworkError`
1700 /// - `BadRequestError`
1701 ///
1702 ///
1703 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/simple_earn/rwusd/account/Get-RWUSD-Quota-Details).
1704 ///
1705 pub async fn get_rwusd_quota_details(
1706 &self,
1707 params: GetRwusdQuotaDetailsParams,
1708 ) -> anyhow::Result<RestApiResponse<models::GetRwusdQuotaDetailsResponse>> {
1709 self.rwusd_api_client.get_rwusd_quota_details(params).await
1710 }
1711
1712 /// Get RWUSD Rate History (`USER_DATA`)
1713 ///
1714 /// Get RWUSD rate history sorted by descending order.
1715 ///
1716 /// * The time between `startTime` and `endTime` cannot be longer than 6 months.
1717 /// * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.
1718 /// * If `startTime` is sent but `endTime` is not sent, `endTime` will default to current time, and results from `startTime` onward will be returned.
1719 /// * If `endTime` is sent but `startTime` is not sent, `startTime` defaults to the current time minus one month, and data between `startTime` and `endTime` will be returned.
1720 ///
1721 /// Weight: 150
1722 ///
1723 /// # Arguments
1724 ///
1725 /// - `params`: [`GetRwusdRateHistoryParams`]
1726 /// The parameters for this operation.
1727 ///
1728 /// # Returns
1729 ///
1730 /// [`RestApiResponse<models::GetRwusdRateHistoryResponse>`] on success.
1731 ///
1732 /// # Errors
1733 ///
1734 /// This function will return an [`anyhow::Error`] if:
1735 /// - the HTTP request fails
1736 /// - any parameter is invalid
1737 /// - the response cannot be parsed
1738 /// - or one of the following occurs:
1739 /// - `RequiredError`
1740 /// - `ConnectorClientError`
1741 /// - `UnauthorizedError`
1742 /// - `ForbiddenError`
1743 /// - `TooManyRequestsError`
1744 /// - `RateLimitBanError`
1745 /// - `ServerError`
1746 /// - `NotFoundError`
1747 /// - `NetworkError`
1748 /// - `BadRequestError`
1749 ///
1750 ///
1751 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/simple_earn/rwusd/history/Get-RWUSD-Rate-History).
1752 ///
1753 pub async fn get_rwusd_rate_history(
1754 &self,
1755 params: GetRwusdRateHistoryParams,
1756 ) -> anyhow::Result<RestApiResponse<models::GetRwusdRateHistoryResponse>> {
1757 self.rwusd_api_client.get_rwusd_rate_history(params).await
1758 }
1759
1760 /// Get RWUSD Redemption History (`USER_DATA`)
1761 ///
1762 /// Get RWUSD redemption history.
1763 ///
1764 /// * The time between `startTime` and `endTime` cannot be longer than 6 months.
1765 /// * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.
1766 /// * If `startTime` is sent but `endTime` is not sent, `endTime` will default to current time, and results from `startTime` onward will be returned.
1767 /// * If `endTime` is sent but `startTime` is not sent, `startTime` defaults to the current time minus one month, and data between `startTime` and `endTime` will be returned.
1768 ///
1769 /// Weight: 150
1770 ///
1771 /// # Arguments
1772 ///
1773 /// - `params`: [`GetRwusdRedemptionHistoryParams`]
1774 /// The parameters for this operation.
1775 ///
1776 /// # Returns
1777 ///
1778 /// [`RestApiResponse<models::GetRwusdRedemptionHistoryResponse>`] on success.
1779 ///
1780 /// # Errors
1781 ///
1782 /// This function will return an [`anyhow::Error`] if:
1783 /// - the HTTP request fails
1784 /// - any parameter is invalid
1785 /// - the response cannot be parsed
1786 /// - or one of the following occurs:
1787 /// - `RequiredError`
1788 /// - `ConnectorClientError`
1789 /// - `UnauthorizedError`
1790 /// - `ForbiddenError`
1791 /// - `TooManyRequestsError`
1792 /// - `RateLimitBanError`
1793 /// - `ServerError`
1794 /// - `NotFoundError`
1795 /// - `NetworkError`
1796 /// - `BadRequestError`
1797 ///
1798 ///
1799 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/simple_earn/rwusd/history/Get-RWUSD-Redemption-History).
1800 ///
1801 pub async fn get_rwusd_redemption_history(
1802 &self,
1803 params: GetRwusdRedemptionHistoryParams,
1804 ) -> anyhow::Result<RestApiResponse<models::GetRwusdRedemptionHistoryResponse>> {
1805 self.rwusd_api_client
1806 .get_rwusd_redemption_history(params)
1807 .await
1808 }
1809
1810 /// Get RWUSD Rewards History (`USER_DATA`)
1811 ///
1812 /// Get RWUSD rewards history.
1813 ///
1814 /// * The time between `startTime` and `endTime` cannot be longer than 6 months.
1815 /// * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.
1816 /// * If `startTime` is sent but `endTime` is not sent, `endTime` will default to current time, and results from `startTime` onward will be returned.
1817 /// * If `endTime` is sent but `startTime` is not sent, `startTime` defaults to the current time minus one month, and data between `startTime` and `endTime` will be returned.
1818 ///
1819 /// Weight: 150
1820 ///
1821 /// # Arguments
1822 ///
1823 /// - `params`: [`GetRwusdRewardsHistoryParams`]
1824 /// The parameters for this operation.
1825 ///
1826 /// # Returns
1827 ///
1828 /// [`RestApiResponse<models::GetRwusdRewardsHistoryResponse>`] on success.
1829 ///
1830 /// # Errors
1831 ///
1832 /// This function will return an [`anyhow::Error`] if:
1833 /// - the HTTP request fails
1834 /// - any parameter is invalid
1835 /// - the response cannot be parsed
1836 /// - or one of the following occurs:
1837 /// - `RequiredError`
1838 /// - `ConnectorClientError`
1839 /// - `UnauthorizedError`
1840 /// - `ForbiddenError`
1841 /// - `TooManyRequestsError`
1842 /// - `RateLimitBanError`
1843 /// - `ServerError`
1844 /// - `NotFoundError`
1845 /// - `NetworkError`
1846 /// - `BadRequestError`
1847 ///
1848 ///
1849 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/simple_earn/rwusd/history/Get-RWUSD-Rewards-History).
1850 ///
1851 pub async fn get_rwusd_rewards_history(
1852 &self,
1853 params: GetRwusdRewardsHistoryParams,
1854 ) -> anyhow::Result<RestApiResponse<models::GetRwusdRewardsHistoryResponse>> {
1855 self.rwusd_api_client
1856 .get_rwusd_rewards_history(params)
1857 .await
1858 }
1859
1860 /// Get RWUSD subscription `history(USER_DATA)`
1861 ///
1862 /// Get RWUSD subscription history
1863 ///
1864 /// * The time between `startTime` and `endTime` cannot be longer than 6 months.
1865 /// * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.
1866 /// * If `startTime` is sent but `endTime` is not sent, `endTime` will default to current time, and results from `startTime` onward will be returned.
1867 /// * If `endTime` is sent but `startTime` is not sent, `startTime` defaults to the current time advanced by one month, and data between `startTime` and `endTime` will be returned.
1868 ///
1869 /// Weight: 150
1870 ///
1871 /// # Arguments
1872 ///
1873 /// - `params`: [`GetRwusdSubscriptionHistoryParams`]
1874 /// The parameters for this operation.
1875 ///
1876 /// # Returns
1877 ///
1878 /// [`RestApiResponse<models::GetRwusdSubscriptionHistoryResponse>`] on success.
1879 ///
1880 /// # Errors
1881 ///
1882 /// This function will return an [`anyhow::Error`] if:
1883 /// - the HTTP request fails
1884 /// - any parameter is invalid
1885 /// - the response cannot be parsed
1886 /// - or one of the following occurs:
1887 /// - `RequiredError`
1888 /// - `ConnectorClientError`
1889 /// - `UnauthorizedError`
1890 /// - `ForbiddenError`
1891 /// - `TooManyRequestsError`
1892 /// - `RateLimitBanError`
1893 /// - `ServerError`
1894 /// - `NotFoundError`
1895 /// - `NetworkError`
1896 /// - `BadRequestError`
1897 ///
1898 ///
1899 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/simple_earn/rwusd/history/Get-RWUSD-subscription-history).
1900 ///
1901 pub async fn get_rwusd_subscription_history(
1902 &self,
1903 params: GetRwusdSubscriptionHistoryParams,
1904 ) -> anyhow::Result<RestApiResponse<models::GetRwusdSubscriptionHistoryResponse>> {
1905 self.rwusd_api_client
1906 .get_rwusd_subscription_history(params)
1907 .await
1908 }
1909
1910 /// Redeem RWUSD(TRADE)
1911 ///
1912 /// Redeem RWUSD to USDC
1913 ///
1914 /// * You need to open Enable Spot & Margin Trading permission for the API Key which requests this endpoint.
1915 ///
1916 /// Weight: 150
1917 ///
1918 /// # Arguments
1919 ///
1920 /// - `params`: [`RedeemRwusdParams`]
1921 /// The parameters for this operation.
1922 ///
1923 /// # Returns
1924 ///
1925 /// [`RestApiResponse<models::RedeemRwusdResponse>`] on success.
1926 ///
1927 /// # Errors
1928 ///
1929 /// This function will return an [`anyhow::Error`] if:
1930 /// - the HTTP request fails
1931 /// - any parameter is invalid
1932 /// - the response cannot be parsed
1933 /// - or one of the following occurs:
1934 /// - `RequiredError`
1935 /// - `ConnectorClientError`
1936 /// - `UnauthorizedError`
1937 /// - `ForbiddenError`
1938 /// - `TooManyRequestsError`
1939 /// - `RateLimitBanError`
1940 /// - `ServerError`
1941 /// - `NotFoundError`
1942 /// - `NetworkError`
1943 /// - `BadRequestError`
1944 ///
1945 ///
1946 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/simple_earn/rwusd/earn/Redeem-RWUSD).
1947 ///
1948 pub async fn redeem_rwusd(
1949 &self,
1950 params: RedeemRwusdParams,
1951 ) -> anyhow::Result<RestApiResponse<models::RedeemRwusdResponse>> {
1952 self.rwusd_api_client.redeem_rwusd(params).await
1953 }
1954
1955 /// Subscribe RWUSD(TRADE)
1956 ///
1957 /// Subscribe RWUSD
1958 ///
1959 /// * You need to open Enable Spot & Margin Trading permission for the API Key which requests this endpoint.
1960 ///
1961 /// Weight: 150
1962 ///
1963 /// # Arguments
1964 ///
1965 /// - `params`: [`SubscribeRwusdParams`]
1966 /// The parameters for this operation.
1967 ///
1968 /// # Returns
1969 ///
1970 /// [`RestApiResponse<models::SubscribeRwusdResponse>`] on success.
1971 ///
1972 /// # Errors
1973 ///
1974 /// This function will return an [`anyhow::Error`] if:
1975 /// - the HTTP request fails
1976 /// - any parameter is invalid
1977 /// - the response cannot be parsed
1978 /// - or one of the following occurs:
1979 /// - `RequiredError`
1980 /// - `ConnectorClientError`
1981 /// - `UnauthorizedError`
1982 /// - `ForbiddenError`
1983 /// - `TooManyRequestsError`
1984 /// - `RateLimitBanError`
1985 /// - `ServerError`
1986 /// - `NotFoundError`
1987 /// - `NetworkError`
1988 /// - `BadRequestError`
1989 ///
1990 ///
1991 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/simple_earn/rwusd/earn/Subscribe-RWUSD).
1992 ///
1993 pub async fn subscribe_rwusd(
1994 &self,
1995 params: SubscribeRwusdParams,
1996 ) -> anyhow::Result<RestApiResponse<models::SubscribeRwusdResponse>> {
1997 self.rwusd_api_client.subscribe_rwusd(params).await
1998 }
1999
2000 /// Get Yield Arena Activities (`USER_DATA`)
2001 ///
2002 /// Get the list of Earn Yield Arena giveaway activities currently available to the user.
2003 ///
2004 /// Supported locales: `en`, `en-GB`, `en-AU`, `cn`, `zh`, `zh-CN`, `tw`, `zh-TW`, `zh-HK`, `ja`, `ja-JP`, `ru`, `ru-RU`, `es`, `es-ES`, `es-LA`, `pt`, `pt-BR`, `pt-PT`, `fr`, `fr-FR`, `de`, `de-DE`, `it`, `it-IT`, `id`, `id-ID`, `vi`, `vi-VN`, `ar`, `ar-SA`, `pl`, `pl-PL`, `uk`, `uk-UA`, `cs`, `cs-CZ`, `ro`, `ro-RO`, `sv`, `sv-SE`, `bg`, `bg-BG`, `da`, `da-DK`, `el`, `el-GR`, `hu`, `hu-HU`, `lv`, `lv-LV`, `sk`, `sk-SK`, `sl`, `sl-SI`.
2005 ///
2006 /// Weight: 150
2007 ///
2008 /// # Arguments
2009 ///
2010 /// - `params`: [`GetYieldArenaActivitiesParams`]
2011 /// The parameters for this operation.
2012 ///
2013 /// # Returns
2014 ///
2015 /// [`RestApiResponse<models::GetYieldArenaActivitiesResponse>`] on success.
2016 ///
2017 /// # Errors
2018 ///
2019 /// This function will return an [`anyhow::Error`] if:
2020 /// - the HTTP request fails
2021 /// - any parameter is invalid
2022 /// - the response cannot be parsed
2023 /// - or one of the following occurs:
2024 /// - `RequiredError`
2025 /// - `ConnectorClientError`
2026 /// - `UnauthorizedError`
2027 /// - `ForbiddenError`
2028 /// - `TooManyRequestsError`
2029 /// - `RateLimitBanError`
2030 /// - `ServerError`
2031 /// - `NotFoundError`
2032 /// - `NetworkError`
2033 /// - `BadRequestError`
2034 ///
2035 ///
2036 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/simple_earn/yield-arena/earn/Get-Yield-Arena-Activities).
2037 ///
2038 pub async fn get_yield_arena_activities(
2039 &self,
2040 params: GetYieldArenaActivitiesParams,
2041 ) -> anyhow::Result<RestApiResponse<models::GetYieldArenaActivitiesResponse>> {
2042 self.yield_arena_api_client
2043 .get_yield_arena_activities(params)
2044 .await
2045 }
2046}