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