binance_sdk/staking/rest_api/mod.rs
1/*
2 * Staking REST API
3 *
4 * Subscribe to staking products, track positions, and query rewards via the Binance Staking 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 eth_staking_api_client: EthStakingApiClient,
32 on_chain_yields_api_client: OnChainYieldsApiClient,
33 soft_staking_api_client: SoftStakingApiClient,
34 sol_staking_api_client: SolStakingApiClient,
35}
36
37impl RestApi {
38 pub fn new(configuration: ConfigurationRestApi) -> Self {
39 let eth_staking_api_client = EthStakingApiClient::new(configuration.clone());
40 let on_chain_yields_api_client = OnChainYieldsApiClient::new(configuration.clone());
41 let soft_staking_api_client = SoftStakingApiClient::new(configuration.clone());
42 let sol_staking_api_client = SolStakingApiClient::new(configuration.clone());
43
44 Self {
45 configuration,
46 eth_staking_api_client,
47 on_chain_yields_api_client,
48 soft_staking_api_client,
49 sol_staking_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 /// ETH Staking account (`USER_DATA`)
124 ///
125 /// ETH Staking account
126 ///
127 /// Weight(IP): 150
128 ///
129 /// Security Type: `USER_DATA`
130 ///
131 /// # Arguments
132 ///
133 /// - `params`: [`EthStakingAccountParams`]
134 /// The parameters for this operation.
135 ///
136 /// # Returns
137 ///
138 /// [`RestApiResponse<models::EthStakingAccountResponse>`] 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-staking/api/rest-api/eth-staking#eth-staking-account).
160 ///
161 pub async fn eth_staking_account(
162 &self,
163 params: EthStakingAccountParams,
164 ) -> anyhow::Result<RestApiResponse<models::EthStakingAccountResponse>> {
165 self.eth_staking_api_client
166 .eth_staking_account(params)
167 .await
168 }
169
170 /// Get current ETH staking quota (`USER_DATA`)
171 ///
172 /// Get current ETH staking quota
173 ///
174 /// Weight(IP): 150
175 ///
176 /// Security Type: `USER_DATA`
177 ///
178 /// # Arguments
179 ///
180 /// - `params`: [`GetCurrentEthStakingQuotaParams`]
181 /// The parameters for this operation.
182 ///
183 /// # Returns
184 ///
185 /// [`RestApiResponse<models::GetCurrentEthStakingQuotaResponse>`] on success.
186 ///
187 /// # Errors
188 ///
189 /// This function will return an [`anyhow::Error`] if:
190 /// - the HTTP request fails
191 /// - any parameter is invalid
192 /// - the response cannot be parsed
193 /// - or one of the following occurs:
194 /// - `RequiredError`
195 /// - `ConnectorClientError`
196 /// - `UnauthorizedError`
197 /// - `ForbiddenError`
198 /// - `TooManyRequestsError`
199 /// - `RateLimitBanError`
200 /// - `ServerError`
201 /// - `NotFoundError`
202 /// - `NetworkError`
203 /// - `BadRequestError`
204 ///
205 ///
206 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/en/docs/catalog/investment-and-services-staking/api/rest-api/eth-staking#get-current-eth-staking-quota).
207 ///
208 pub async fn get_current_eth_staking_quota(
209 &self,
210 params: GetCurrentEthStakingQuotaParams,
211 ) -> anyhow::Result<RestApiResponse<models::GetCurrentEthStakingQuotaResponse>> {
212 self.eth_staking_api_client
213 .get_current_eth_staking_quota(params)
214 .await
215 }
216
217 /// Get ETH redemption history (`USER_DATA`)
218 ///
219 /// Get ETH redemption history
220 ///
221 /// Weight(IP): 150
222 ///
223 /// Security Type: `USER_DATA`
224 ///
225 /// Notes:
226 /// - The time between `startTime` and `endTime` cannot be longer than 3 months.
227 /// - If `startTime` and `endTime`
228 /// are both not sent, then the last 30 days' data will be returned.
229 /// - If `startTime` is sent but `endTime` is not
230 /// sent, the next 30 days' data beginning from `startTime` will be returned.
231 /// - If `endTime` is sent but
232 /// `startTime` is not sent, the 30 days' data before `endTime` will be returned.
233 ///
234 /// # Arguments
235 ///
236 /// - `params`: [`GetEthRedemptionHistoryParams`]
237 /// The parameters for this operation.
238 ///
239 /// # Returns
240 ///
241 /// [`RestApiResponse<models::GetEthRedemptionHistoryResponse>`] on success.
242 ///
243 /// # Errors
244 ///
245 /// This function will return an [`anyhow::Error`] if:
246 /// - the HTTP request fails
247 /// - any parameter is invalid
248 /// - the response cannot be parsed
249 /// - or one of the following occurs:
250 /// - `RequiredError`
251 /// - `ConnectorClientError`
252 /// - `UnauthorizedError`
253 /// - `ForbiddenError`
254 /// - `TooManyRequestsError`
255 /// - `RateLimitBanError`
256 /// - `ServerError`
257 /// - `NotFoundError`
258 /// - `NetworkError`
259 /// - `BadRequestError`
260 ///
261 ///
262 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/en/docs/catalog/investment-and-services-staking/api/rest-api/eth-staking#get-eth-redemption-history).
263 ///
264 pub async fn get_eth_redemption_history(
265 &self,
266 params: GetEthRedemptionHistoryParams,
267 ) -> anyhow::Result<RestApiResponse<models::GetEthRedemptionHistoryResponse>> {
268 self.eth_staking_api_client
269 .get_eth_redemption_history(params)
270 .await
271 }
272
273 /// Get ETH staking history (`USER_DATA`)
274 ///
275 /// Get ETH staking history
276 ///
277 /// Weight(IP): 150
278 ///
279 /// Security Type: `USER_DATA`
280 ///
281 /// Notes:
282 /// - The time between `startTime` and `endTime` cannot be longer than 3 months.
283 /// - If `startTime` and `endTime`
284 /// are both not sent, then the last 30 days' data will be returned.
285 /// - If `startTime` is sent but `endTime` is not
286 /// sent, the next 30 days' data beginning from `startTime` will be returned.
287 /// - If `endTime` is sent but
288 /// `startTime` is not sent, the 30 days' data before `endTime` will be returned.
289 ///
290 /// # Arguments
291 ///
292 /// - `params`: [`GetEthStakingHistoryParams`]
293 /// The parameters for this operation.
294 ///
295 /// # Returns
296 ///
297 /// [`RestApiResponse<models::GetEthStakingHistoryResponse>`] on success.
298 ///
299 /// # Errors
300 ///
301 /// This function will return an [`anyhow::Error`] if:
302 /// - the HTTP request fails
303 /// - any parameter is invalid
304 /// - the response cannot be parsed
305 /// - or one of the following occurs:
306 /// - `RequiredError`
307 /// - `ConnectorClientError`
308 /// - `UnauthorizedError`
309 /// - `ForbiddenError`
310 /// - `TooManyRequestsError`
311 /// - `RateLimitBanError`
312 /// - `ServerError`
313 /// - `NotFoundError`
314 /// - `NetworkError`
315 /// - `BadRequestError`
316 ///
317 ///
318 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/en/docs/catalog/investment-and-services-staking/api/rest-api/eth-staking#get-eth-staking-history).
319 ///
320 pub async fn get_eth_staking_history(
321 &self,
322 params: GetEthStakingHistoryParams,
323 ) -> anyhow::Result<RestApiResponse<models::GetEthStakingHistoryResponse>> {
324 self.eth_staking_api_client
325 .get_eth_staking_history(params)
326 .await
327 }
328
329 /// Get WBETH Rate History (`USER_DATA`)
330 ///
331 /// Get WBETH Rate History
332 ///
333 /// Weight(IP): 150
334 ///
335 /// Security Type: `USER_DATA`
336 ///
337 /// Notes:
338 /// - The time between `startTime` and `endTime` cannot be longer than 3 months.
339 /// - If `startTime` and `endTime`
340 /// are both not sent, then the last 30 days' data will be returned.
341 /// - If `startTime` is sent but `endTime` is not
342 /// sent, the next 30 days' data beginning from `startTime` will be returned.
343 /// - If `endTime` is sent but
344 /// `startTime` is not sent, the 30 days' data before `endTime` will be returned.
345 ///
346 /// # Arguments
347 ///
348 /// - `params`: [`GetWbethRateHistoryParams`]
349 /// The parameters for this operation.
350 ///
351 /// # Returns
352 ///
353 /// [`RestApiResponse<models::GetWbethRateHistoryResponse>`] on success.
354 ///
355 /// # Errors
356 ///
357 /// This function will return an [`anyhow::Error`] if:
358 /// - the HTTP request fails
359 /// - any parameter is invalid
360 /// - the response cannot be parsed
361 /// - or one of the following occurs:
362 /// - `RequiredError`
363 /// - `ConnectorClientError`
364 /// - `UnauthorizedError`
365 /// - `ForbiddenError`
366 /// - `TooManyRequestsError`
367 /// - `RateLimitBanError`
368 /// - `ServerError`
369 /// - `NotFoundError`
370 /// - `NetworkError`
371 /// - `BadRequestError`
372 ///
373 ///
374 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/en/docs/catalog/investment-and-services-staking/api/rest-api/eth-staking#get-wbeth-rate-history).
375 ///
376 pub async fn get_wbeth_rate_history(
377 &self,
378 params: GetWbethRateHistoryParams,
379 ) -> anyhow::Result<RestApiResponse<models::GetWbethRateHistoryResponse>> {
380 self.eth_staking_api_client
381 .get_wbeth_rate_history(params)
382 .await
383 }
384
385 /// Get WBETH rewards history (`USER_DATA`)
386 ///
387 /// Get WBETH rewards history
388 ///
389 /// Weight(IP): 150
390 ///
391 /// Security Type: `USER_DATA`
392 ///
393 /// Notes:
394 /// - The time between `startTime` and `endTime` cannot be longer than 3 months.
395 /// - If `startTime` and `endTime`
396 /// are both not sent, then the last 30 days' data will be returned.
397 /// - If `startTime` is sent but `endTime` is not
398 /// sent, the next 30 days' data beginning from `startTime` will be returned.
399 /// - If `endTime` is sent but
400 /// `startTime` is not sent, the 30 days' data before `endTime` will be returned.
401 ///
402 /// # Arguments
403 ///
404 /// - `params`: [`GetWbethRewardsHistoryParams`]
405 /// The parameters for this operation.
406 ///
407 /// # Returns
408 ///
409 /// [`RestApiResponse<models::GetWbethRewardsHistoryResponse>`] on success.
410 ///
411 /// # Errors
412 ///
413 /// This function will return an [`anyhow::Error`] if:
414 /// - the HTTP request fails
415 /// - any parameter is invalid
416 /// - the response cannot be parsed
417 /// - or one of the following occurs:
418 /// - `RequiredError`
419 /// - `ConnectorClientError`
420 /// - `UnauthorizedError`
421 /// - `ForbiddenError`
422 /// - `TooManyRequestsError`
423 /// - `RateLimitBanError`
424 /// - `ServerError`
425 /// - `NotFoundError`
426 /// - `NetworkError`
427 /// - `BadRequestError`
428 ///
429 ///
430 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/en/docs/catalog/investment-and-services-staking/api/rest-api/eth-staking#get-wbeth-rewards-history).
431 ///
432 pub async fn get_wbeth_rewards_history(
433 &self,
434 params: GetWbethRewardsHistoryParams,
435 ) -> anyhow::Result<RestApiResponse<models::GetWbethRewardsHistoryResponse>> {
436 self.eth_staking_api_client
437 .get_wbeth_rewards_history(params)
438 .await
439 }
440
441 /// Get WBETH unwrap history (`USER_DATA`)
442 ///
443 /// Get WBETH unwrap history
444 ///
445 /// Weight(IP): 150
446 ///
447 /// Security Type: `USER_DATA`
448 ///
449 /// Notes:
450 /// - The time between `startTime` and `endTime` cannot be longer than 3 months.
451 /// - If `startTime` and `endTime`
452 /// are both not sent, then the last 30 days' data will be returned.
453 /// - If `startTime` is sent but `endTime` is not
454 /// sent, the next 30 days' data beginning from `startTime` will be returned.
455 /// - If `endTime` is sent but
456 /// `startTime` is not sent, the 30 days' data before `endTime` will be returned.
457 ///
458 /// # Arguments
459 ///
460 /// - `params`: [`GetWbethUnwrapHistoryParams`]
461 /// The parameters for this operation.
462 ///
463 /// # Returns
464 ///
465 /// [`RestApiResponse<models::GetWbethUnwrapHistoryResponse>`] on success.
466 ///
467 /// # Errors
468 ///
469 /// This function will return an [`anyhow::Error`] if:
470 /// - the HTTP request fails
471 /// - any parameter is invalid
472 /// - the response cannot be parsed
473 /// - or one of the following occurs:
474 /// - `RequiredError`
475 /// - `ConnectorClientError`
476 /// - `UnauthorizedError`
477 /// - `ForbiddenError`
478 /// - `TooManyRequestsError`
479 /// - `RateLimitBanError`
480 /// - `ServerError`
481 /// - `NotFoundError`
482 /// - `NetworkError`
483 /// - `BadRequestError`
484 ///
485 ///
486 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/en/docs/catalog/investment-and-services-staking/api/rest-api/eth-staking#get-wbeth-unwrap-history).
487 ///
488 pub async fn get_wbeth_unwrap_history(
489 &self,
490 params: GetWbethUnwrapHistoryParams,
491 ) -> anyhow::Result<RestApiResponse<models::GetWbethUnwrapHistoryResponse>> {
492 self.eth_staking_api_client
493 .get_wbeth_unwrap_history(params)
494 .await
495 }
496
497 /// Get WBETH wrap history (`USER_DATA`)
498 ///
499 /// Get WBETH wrap history
500 ///
501 /// Weight(IP): 150
502 ///
503 /// Security Type: `USER_DATA`
504 ///
505 /// Notes:
506 /// - The time between `startTime` and `endTime` cannot be longer than 3 months.
507 /// - If `startTime` and `endTime`
508 /// are both not sent, then the last 30 days' data will be returned.
509 /// - If `startTime` is sent but `endTime` is not
510 /// sent, the next 30 days' data beginning from `startTime` will be returned.
511 /// - If `endTime` is sent but
512 /// `startTime` is not sent, the 30 days' data before `endTime` will be returned.
513 ///
514 /// # Arguments
515 ///
516 /// - `params`: [`GetWbethWrapHistoryParams`]
517 /// The parameters for this operation.
518 ///
519 /// # Returns
520 ///
521 /// [`RestApiResponse<models::GetWbethWrapHistoryResponse>`] on success.
522 ///
523 /// # Errors
524 ///
525 /// This function will return an [`anyhow::Error`] if:
526 /// - the HTTP request fails
527 /// - any parameter is invalid
528 /// - the response cannot be parsed
529 /// - or one of the following occurs:
530 /// - `RequiredError`
531 /// - `ConnectorClientError`
532 /// - `UnauthorizedError`
533 /// - `ForbiddenError`
534 /// - `TooManyRequestsError`
535 /// - `RateLimitBanError`
536 /// - `ServerError`
537 /// - `NotFoundError`
538 /// - `NetworkError`
539 /// - `BadRequestError`
540 ///
541 ///
542 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/en/docs/catalog/investment-and-services-staking/api/rest-api/eth-staking#get-wbeth-wrap-history).
543 ///
544 pub async fn get_wbeth_wrap_history(
545 &self,
546 params: GetWbethWrapHistoryParams,
547 ) -> anyhow::Result<RestApiResponse<models::GetWbethWrapHistoryResponse>> {
548 self.eth_staking_api_client
549 .get_wbeth_wrap_history(params)
550 .await
551 }
552
553 /// Redeem ETH (TRADE)
554 ///
555 /// Redeem WBETH or BETH and get ETH
556 ///
557 /// Weight(IP): 150
558 ///
559 /// Security Type: TRADE
560 ///
561 /// Notes:
562 /// - You need to open Enable Spot & Margin Trading permission for the API Key which requests this endpoint.
563 ///
564 /// # Arguments
565 ///
566 /// - `params`: [`RedeemEthParams`]
567 /// The parameters for this operation.
568 ///
569 /// # Returns
570 ///
571 /// [`RestApiResponse<models::RedeemEthResponse>`] on success.
572 ///
573 /// # Errors
574 ///
575 /// This function will return an [`anyhow::Error`] if:
576 /// - the HTTP request fails
577 /// - any parameter is invalid
578 /// - the response cannot be parsed
579 /// - or one of the following occurs:
580 /// - `RequiredError`
581 /// - `ConnectorClientError`
582 /// - `UnauthorizedError`
583 /// - `ForbiddenError`
584 /// - `TooManyRequestsError`
585 /// - `RateLimitBanError`
586 /// - `ServerError`
587 /// - `NotFoundError`
588 /// - `NetworkError`
589 /// - `BadRequestError`
590 ///
591 ///
592 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/en/docs/catalog/investment-and-services-staking/api/rest-api/eth-staking#redeem-eth).
593 ///
594 pub async fn redeem_eth(
595 &self,
596 params: RedeemEthParams,
597 ) -> anyhow::Result<RestApiResponse<models::RedeemEthResponse>> {
598 self.eth_staking_api_client.redeem_eth(params).await
599 }
600
601 /// Subscribe ETH Staking (TRADE)
602 ///
603 /// Subscribe ETH Staking
604 ///
605 /// Weight(IP): 150
606 ///
607 /// Security Type: TRADE
608 ///
609 /// Notes:
610 /// - You need to open Enable Spot & Margin Trading permission for the API Key which requests this endpoint.
611 ///
612 /// # Arguments
613 ///
614 /// - `params`: [`SubscribeEthStakingParams`]
615 /// The parameters for this operation.
616 ///
617 /// # Returns
618 ///
619 /// [`RestApiResponse<models::SubscribeEthStakingResponse>`] on success.
620 ///
621 /// # Errors
622 ///
623 /// This function will return an [`anyhow::Error`] if:
624 /// - the HTTP request fails
625 /// - any parameter is invalid
626 /// - the response cannot be parsed
627 /// - or one of the following occurs:
628 /// - `RequiredError`
629 /// - `ConnectorClientError`
630 /// - `UnauthorizedError`
631 /// - `ForbiddenError`
632 /// - `TooManyRequestsError`
633 /// - `RateLimitBanError`
634 /// - `ServerError`
635 /// - `NotFoundError`
636 /// - `NetworkError`
637 /// - `BadRequestError`
638 ///
639 ///
640 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/en/docs/catalog/investment-and-services-staking/api/rest-api/eth-staking#subscribe-eth-staking).
641 ///
642 pub async fn subscribe_eth_staking(
643 &self,
644 params: SubscribeEthStakingParams,
645 ) -> anyhow::Result<RestApiResponse<models::SubscribeEthStakingResponse>> {
646 self.eth_staking_api_client
647 .subscribe_eth_staking(params)
648 .await
649 }
650
651 /// Wrap BETH (TRADE)
652 ///
653 /// Wrap BETH
654 ///
655 /// Weight(IP): 150
656 ///
657 /// Security Type: TRADE
658 ///
659 /// Notes:
660 /// - You need to open Enable Spot & Margin Trading permission for the API Key which requests this endpoint.
661 ///
662 /// # Arguments
663 ///
664 /// - `params`: [`WrapBethParams`]
665 /// The parameters for this operation.
666 ///
667 /// # Returns
668 ///
669 /// [`RestApiResponse<models::WrapBethResponse>`] on success.
670 ///
671 /// # Errors
672 ///
673 /// This function will return an [`anyhow::Error`] if:
674 /// - the HTTP request fails
675 /// - any parameter is invalid
676 /// - the response cannot be parsed
677 /// - or one of the following occurs:
678 /// - `RequiredError`
679 /// - `ConnectorClientError`
680 /// - `UnauthorizedError`
681 /// - `ForbiddenError`
682 /// - `TooManyRequestsError`
683 /// - `RateLimitBanError`
684 /// - `ServerError`
685 /// - `NotFoundError`
686 /// - `NetworkError`
687 /// - `BadRequestError`
688 ///
689 ///
690 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/en/docs/catalog/investment-and-services-staking/api/rest-api/eth-staking#wrap-beth).
691 ///
692 pub async fn wrap_beth(
693 &self,
694 params: WrapBethParams,
695 ) -> anyhow::Result<RestApiResponse<models::WrapBethResponse>> {
696 self.eth_staking_api_client.wrap_beth(params).await
697 }
698
699 /// Get On-chain Yields Locked Personal Left Quota (`USER_DATA`)
700 ///
701 /// Get On-chain Yields Locked Personal Left Quota
702 ///
703 /// Weight(IP): 50
704 ///
705 /// Security Type: `USER_DATA`
706 ///
707 /// # Arguments
708 ///
709 /// - `params`: [`GetOnChainYieldsLockedPersonalLeftQuotaParams`]
710 /// The parameters for this operation.
711 ///
712 /// # Returns
713 ///
714 /// [`RestApiResponse<models::GetOnChainYieldsLockedPersonalLeftQuotaResponse>`] on success.
715 ///
716 /// # Errors
717 ///
718 /// This function will return an [`anyhow::Error`] if:
719 /// - the HTTP request fails
720 /// - any parameter is invalid
721 /// - the response cannot be parsed
722 /// - or one of the following occurs:
723 /// - `RequiredError`
724 /// - `ConnectorClientError`
725 /// - `UnauthorizedError`
726 /// - `ForbiddenError`
727 /// - `TooManyRequestsError`
728 /// - `RateLimitBanError`
729 /// - `ServerError`
730 /// - `NotFoundError`
731 /// - `NetworkError`
732 /// - `BadRequestError`
733 ///
734 ///
735 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/en/docs/catalog/investment-and-services-staking/api/rest-api/on-chain-yields#get-on-chain-yields-locked-personal-left-quota).
736 ///
737 pub async fn get_on_chain_yields_locked_personal_left_quota(
738 &self,
739 params: GetOnChainYieldsLockedPersonalLeftQuotaParams,
740 ) -> anyhow::Result<RestApiResponse<models::GetOnChainYieldsLockedPersonalLeftQuotaResponse>>
741 {
742 self.on_chain_yields_api_client
743 .get_on_chain_yields_locked_personal_left_quota(params)
744 .await
745 }
746
747 /// Get On-chain Yields Locked Product List (`USER_DATA`)
748 ///
749 /// Get available On-chain Yields Locked product list
750 ///
751 /// Weight(IP): 50
752 ///
753 /// Security Type: `USER_DATA`
754 ///
755 /// Notes:
756 /// - Get available On-chain Yields Locked product list
757 ///
758 /// # Arguments
759 ///
760 /// - `params`: [`GetOnChainYieldsLockedProductListParams`]
761 /// The parameters for this operation.
762 ///
763 /// # Returns
764 ///
765 /// [`RestApiResponse<models::GetOnChainYieldsLockedProductListResponse>`] on success.
766 ///
767 /// # Errors
768 ///
769 /// This function will return an [`anyhow::Error`] if:
770 /// - the HTTP request fails
771 /// - any parameter is invalid
772 /// - the response cannot be parsed
773 /// - or one of the following occurs:
774 /// - `RequiredError`
775 /// - `ConnectorClientError`
776 /// - `UnauthorizedError`
777 /// - `ForbiddenError`
778 /// - `TooManyRequestsError`
779 /// - `RateLimitBanError`
780 /// - `ServerError`
781 /// - `NotFoundError`
782 /// - `NetworkError`
783 /// - `BadRequestError`
784 ///
785 ///
786 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/en/docs/catalog/investment-and-services-staking/api/rest-api/on-chain-yields#get-on-chain-yields-locked-product-list).
787 ///
788 pub async fn get_on_chain_yields_locked_product_list(
789 &self,
790 params: GetOnChainYieldsLockedProductListParams,
791 ) -> anyhow::Result<RestApiResponse<models::GetOnChainYieldsLockedProductListResponse>> {
792 self.on_chain_yields_api_client
793 .get_on_chain_yields_locked_product_list(params)
794 .await
795 }
796
797 /// Get On-chain Yields Locked Product Position (`USER_DATA`)
798 ///
799 /// Get On-chain Yields Locked Product Position
800 ///
801 /// Weight(IP): 50
802 ///
803 /// Security Type: `USER_DATA`
804 ///
805 /// # Arguments
806 ///
807 /// - `params`: [`GetOnChainYieldsLockedProductPositionParams`]
808 /// The parameters for this operation.
809 ///
810 /// # Returns
811 ///
812 /// [`RestApiResponse<models::GetOnChainYieldsLockedProductPositionResponse>`] on success.
813 ///
814 /// # Errors
815 ///
816 /// This function will return an [`anyhow::Error`] if:
817 /// - the HTTP request fails
818 /// - any parameter is invalid
819 /// - the response cannot be parsed
820 /// - or one of the following occurs:
821 /// - `RequiredError`
822 /// - `ConnectorClientError`
823 /// - `UnauthorizedError`
824 /// - `ForbiddenError`
825 /// - `TooManyRequestsError`
826 /// - `RateLimitBanError`
827 /// - `ServerError`
828 /// - `NotFoundError`
829 /// - `NetworkError`
830 /// - `BadRequestError`
831 ///
832 ///
833 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/en/docs/catalog/investment-and-services-staking/api/rest-api/on-chain-yields#get-on-chain-yields-locked-product-position).
834 ///
835 pub async fn get_on_chain_yields_locked_product_position(
836 &self,
837 params: GetOnChainYieldsLockedProductPositionParams,
838 ) -> anyhow::Result<RestApiResponse<models::GetOnChainYieldsLockedProductPositionResponse>>
839 {
840 self.on_chain_yields_api_client
841 .get_on_chain_yields_locked_product_position(params)
842 .await
843 }
844
845 /// Get On-chain Yields Locked Redemption Record (`USER_DATA`)
846 ///
847 /// Get On-chain Yields Locked Redemption Record
848 ///
849 /// Weight(IP): 50
850 ///
851 /// Security Type: `USER_DATA`
852 ///
853 /// Notes:
854 /// - The time between `startTime` and `endTime` cannot be longer than 3 months.
855 /// - If `startTime` and `endTime`
856 /// are both not sent, then the last 30 days' data will be returned.
857 /// - If `startTime` is sent but `endTime` is not
858 /// sent, the next 30 days' data beginning from `startTime` will be returned.
859 /// - If `endTime` is sent but
860 /// `startTime` is not sent, the 30 days' data before `endTime` will be returned.
861 ///
862 /// # Arguments
863 ///
864 /// - `params`: [`GetOnChainYieldsLockedRedemptionRecordParams`]
865 /// The parameters for this operation.
866 ///
867 /// # Returns
868 ///
869 /// [`RestApiResponse<models::GetOnChainYieldsLockedRedemptionRecordResponse>`] on success.
870 ///
871 /// # Errors
872 ///
873 /// This function will return an [`anyhow::Error`] if:
874 /// - the HTTP request fails
875 /// - any parameter is invalid
876 /// - the response cannot be parsed
877 /// - or one of the following occurs:
878 /// - `RequiredError`
879 /// - `ConnectorClientError`
880 /// - `UnauthorizedError`
881 /// - `ForbiddenError`
882 /// - `TooManyRequestsError`
883 /// - `RateLimitBanError`
884 /// - `ServerError`
885 /// - `NotFoundError`
886 /// - `NetworkError`
887 /// - `BadRequestError`
888 ///
889 ///
890 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/en/docs/catalog/investment-and-services-staking/api/rest-api/on-chain-yields#get-on-chain-yields-locked-redemption-record).
891 ///
892 pub async fn get_on_chain_yields_locked_redemption_record(
893 &self,
894 params: GetOnChainYieldsLockedRedemptionRecordParams,
895 ) -> anyhow::Result<RestApiResponse<models::GetOnChainYieldsLockedRedemptionRecordResponse>>
896 {
897 self.on_chain_yields_api_client
898 .get_on_chain_yields_locked_redemption_record(params)
899 .await
900 }
901
902 /// Get On-chain Yields Locked Rewards History (`USER_DATA`)
903 ///
904 /// Get On-chain Yields Locked Rewards History
905 ///
906 /// Weight(IP): 50
907 ///
908 /// Security Type: `USER_DATA`
909 ///
910 /// Notes:
911 /// - The time between `startTime` and `endTime` cannot be longer than 3 months.
912 /// - If `startTime` and `endTime`
913 /// are both not sent, then the last 30 days' data will be returned.
914 /// - If `startTime` is sent but `endTime` is not
915 /// sent, the next 30 days' data beginning from `startTime` will be returned.
916 /// - If `endTime` is sent but
917 /// `startTime` is not sent, the 30 days' data before `endTime` will be returned.
918 ///
919 /// # Arguments
920 ///
921 /// - `params`: [`GetOnChainYieldsLockedRewardsHistoryParams`]
922 /// The parameters for this operation.
923 ///
924 /// # Returns
925 ///
926 /// [`RestApiResponse<models::GetOnChainYieldsLockedRewardsHistoryResponse>`] on success.
927 ///
928 /// # Errors
929 ///
930 /// This function will return an [`anyhow::Error`] if:
931 /// - the HTTP request fails
932 /// - any parameter is invalid
933 /// - the response cannot be parsed
934 /// - or one of the following occurs:
935 /// - `RequiredError`
936 /// - `ConnectorClientError`
937 /// - `UnauthorizedError`
938 /// - `ForbiddenError`
939 /// - `TooManyRequestsError`
940 /// - `RateLimitBanError`
941 /// - `ServerError`
942 /// - `NotFoundError`
943 /// - `NetworkError`
944 /// - `BadRequestError`
945 ///
946 ///
947 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/en/docs/catalog/investment-and-services-staking/api/rest-api/on-chain-yields#get-on-chain-yields-locked-rewards-history).
948 ///
949 pub async fn get_on_chain_yields_locked_rewards_history(
950 &self,
951 params: GetOnChainYieldsLockedRewardsHistoryParams,
952 ) -> anyhow::Result<RestApiResponse<models::GetOnChainYieldsLockedRewardsHistoryResponse>> {
953 self.on_chain_yields_api_client
954 .get_on_chain_yields_locked_rewards_history(params)
955 .await
956 }
957
958 /// Get On-chain Yields Locked Subscription Preview (`USER_DATA`)
959 ///
960 /// Get On-chain Yields Locked Subscription Preview
961 ///
962 /// Weight(IP): 50
963 ///
964 /// Security Type: `USER_DATA`
965 ///
966 /// # Arguments
967 ///
968 /// - `params`: [`GetOnChainYieldsLockedSubscriptionPreviewParams`]
969 /// The parameters for this operation.
970 ///
971 /// # Returns
972 ///
973 /// [`RestApiResponse<models::GetOnChainYieldsLockedSubscriptionPreviewResponse>`] on success.
974 ///
975 /// # Errors
976 ///
977 /// This function will return an [`anyhow::Error`] if:
978 /// - the HTTP request fails
979 /// - any parameter is invalid
980 /// - the response cannot be parsed
981 /// - or one of the following occurs:
982 /// - `RequiredError`
983 /// - `ConnectorClientError`
984 /// - `UnauthorizedError`
985 /// - `ForbiddenError`
986 /// - `TooManyRequestsError`
987 /// - `RateLimitBanError`
988 /// - `ServerError`
989 /// - `NotFoundError`
990 /// - `NetworkError`
991 /// - `BadRequestError`
992 ///
993 ///
994 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/en/docs/catalog/investment-and-services-staking/api/rest-api/on-chain-yields#get-on-chain-yields-locked-subscription-preview).
995 ///
996 pub async fn get_on_chain_yields_locked_subscription_preview(
997 &self,
998 params: GetOnChainYieldsLockedSubscriptionPreviewParams,
999 ) -> anyhow::Result<RestApiResponse<models::GetOnChainYieldsLockedSubscriptionPreviewResponse>>
1000 {
1001 self.on_chain_yields_api_client
1002 .get_on_chain_yields_locked_subscription_preview(params)
1003 .await
1004 }
1005
1006 /// Get On-chain Yields Locked Subscription Record (`USER_DATA`)
1007 ///
1008 /// Get On-chain Yields Locked Subscription Record
1009 ///
1010 /// Weight(IP): 50
1011 ///
1012 /// Security Type: `USER_DATA`
1013 ///
1014 /// Notes:
1015 /// - The time between `startTime` and `endTime` cannot be longer than 3 months.
1016 /// - If `startTime` and `endTime`
1017 /// are both not sent, then the last 30 days' data will be returned.
1018 /// - If `startTime` is sent but `endTime` is not
1019 /// sent, the next 30 days' data beginning from `startTime` will be returned.
1020 /// - If `endTime` is sent but
1021 /// `startTime` is not sent, the 30 days' data before `endTime` will be returned.
1022 ///
1023 /// # Arguments
1024 ///
1025 /// - `params`: [`GetOnChainYieldsLockedSubscriptionRecordParams`]
1026 /// The parameters for this operation.
1027 ///
1028 /// # Returns
1029 ///
1030 /// [`RestApiResponse<models::GetOnChainYieldsLockedSubscriptionRecordResponse>`] on success.
1031 ///
1032 /// # Errors
1033 ///
1034 /// This function will return an [`anyhow::Error`] if:
1035 /// - the HTTP request fails
1036 /// - any parameter is invalid
1037 /// - the response cannot be parsed
1038 /// - or one of the following occurs:
1039 /// - `RequiredError`
1040 /// - `ConnectorClientError`
1041 /// - `UnauthorizedError`
1042 /// - `ForbiddenError`
1043 /// - `TooManyRequestsError`
1044 /// - `RateLimitBanError`
1045 /// - `ServerError`
1046 /// - `NotFoundError`
1047 /// - `NetworkError`
1048 /// - `BadRequestError`
1049 ///
1050 ///
1051 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/en/docs/catalog/investment-and-services-staking/api/rest-api/on-chain-yields#get-on-chain-yields-locked-subscription-record).
1052 ///
1053 pub async fn get_on_chain_yields_locked_subscription_record(
1054 &self,
1055 params: GetOnChainYieldsLockedSubscriptionRecordParams,
1056 ) -> anyhow::Result<RestApiResponse<models::GetOnChainYieldsLockedSubscriptionRecordResponse>>
1057 {
1058 self.on_chain_yields_api_client
1059 .get_on_chain_yields_locked_subscription_record(params)
1060 .await
1061 }
1062
1063 /// On-chain Yields Account (`USER_DATA`)
1064 ///
1065 /// On-chain Yields Account query
1066 ///
1067 /// Weight(IP): 50
1068 ///
1069 /// Security Type: `USER_DATA`
1070 ///
1071 /// # Arguments
1072 ///
1073 /// - `params`: [`OnChainYieldsAccountParams`]
1074 /// The parameters for this operation.
1075 ///
1076 /// # Returns
1077 ///
1078 /// [`RestApiResponse<models::OnChainYieldsAccountResponse>`] on success.
1079 ///
1080 /// # Errors
1081 ///
1082 /// This function will return an [`anyhow::Error`] if:
1083 /// - the HTTP request fails
1084 /// - any parameter is invalid
1085 /// - the response cannot be parsed
1086 /// - or one of the following occurs:
1087 /// - `RequiredError`
1088 /// - `ConnectorClientError`
1089 /// - `UnauthorizedError`
1090 /// - `ForbiddenError`
1091 /// - `TooManyRequestsError`
1092 /// - `RateLimitBanError`
1093 /// - `ServerError`
1094 /// - `NotFoundError`
1095 /// - `NetworkError`
1096 /// - `BadRequestError`
1097 ///
1098 ///
1099 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/en/docs/catalog/investment-and-services-staking/api/rest-api/on-chain-yields#on-chain-yields-account).
1100 ///
1101 pub async fn on_chain_yields_account(
1102 &self,
1103 params: OnChainYieldsAccountParams,
1104 ) -> anyhow::Result<RestApiResponse<models::OnChainYieldsAccountResponse>> {
1105 self.on_chain_yields_api_client
1106 .on_chain_yields_account(params)
1107 .await
1108 }
1109
1110 /// Redeem On-chain Yields Locked Product (TRADE)
1111 ///
1112 /// Redeem On-chain Yields Locked Product
1113 ///
1114 /// Weight(IP): 200
1115 ///
1116 /// Security Type: TRADE
1117 ///
1118 /// Notes:
1119 /// - You need to open `Enable Spot & Margin Trading` permission for the API Key which requests this endpoint.
1120 ///
1121 /// # Arguments
1122 ///
1123 /// - `params`: [`RedeemOnChainYieldsLockedProductParams`]
1124 /// The parameters for this operation.
1125 ///
1126 /// # Returns
1127 ///
1128 /// [`RestApiResponse<models::RedeemOnChainYieldsLockedProductResponse>`] on success.
1129 ///
1130 /// # Errors
1131 ///
1132 /// This function will return an [`anyhow::Error`] if:
1133 /// - the HTTP request fails
1134 /// - any parameter is invalid
1135 /// - the response cannot be parsed
1136 /// - or one of the following occurs:
1137 /// - `RequiredError`
1138 /// - `ConnectorClientError`
1139 /// - `UnauthorizedError`
1140 /// - `ForbiddenError`
1141 /// - `TooManyRequestsError`
1142 /// - `RateLimitBanError`
1143 /// - `ServerError`
1144 /// - `NotFoundError`
1145 /// - `NetworkError`
1146 /// - `BadRequestError`
1147 ///
1148 ///
1149 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/en/docs/catalog/investment-and-services-staking/api/rest-api/on-chain-yields#redeem-on-chain-yields-locked-product).
1150 ///
1151 pub async fn redeem_on_chain_yields_locked_product(
1152 &self,
1153 params: RedeemOnChainYieldsLockedProductParams,
1154 ) -> anyhow::Result<RestApiResponse<models::RedeemOnChainYieldsLockedProductResponse>> {
1155 self.on_chain_yields_api_client
1156 .redeem_on_chain_yields_locked_product(params)
1157 .await
1158 }
1159
1160 /// Set On-chain Yields Locked Auto Subscribe (`USER_DATA`)
1161 ///
1162 /// Set On-chain Yield locked auto subscribe
1163 ///
1164 /// Weight(IP): 50
1165 ///
1166 /// Security Type: `USER_DATA`
1167 ///
1168 /// # Arguments
1169 ///
1170 /// - `params`: [`SetOnChainYieldsLockedAutoSubscribeParams`]
1171 /// The parameters for this operation.
1172 ///
1173 /// # Returns
1174 ///
1175 /// [`RestApiResponse<models::SetOnChainYieldsLockedAutoSubscribeResponse>`] on success.
1176 ///
1177 /// # Errors
1178 ///
1179 /// This function will return an [`anyhow::Error`] if:
1180 /// - the HTTP request fails
1181 /// - any parameter is invalid
1182 /// - the response cannot be parsed
1183 /// - or one of the following occurs:
1184 /// - `RequiredError`
1185 /// - `ConnectorClientError`
1186 /// - `UnauthorizedError`
1187 /// - `ForbiddenError`
1188 /// - `TooManyRequestsError`
1189 /// - `RateLimitBanError`
1190 /// - `ServerError`
1191 /// - `NotFoundError`
1192 /// - `NetworkError`
1193 /// - `BadRequestError`
1194 ///
1195 ///
1196 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/en/docs/catalog/investment-and-services-staking/api/rest-api/on-chain-yields#set-on-chain-yields-locked-auto-subscribe).
1197 ///
1198 pub async fn set_on_chain_yields_locked_auto_subscribe(
1199 &self,
1200 params: SetOnChainYieldsLockedAutoSubscribeParams,
1201 ) -> anyhow::Result<RestApiResponse<models::SetOnChainYieldsLockedAutoSubscribeResponse>> {
1202 self.on_chain_yields_api_client
1203 .set_on_chain_yields_locked_auto_subscribe(params)
1204 .await
1205 }
1206
1207 /// Set On-chain Yields Locked Product Redeem Option (`USER_DATA`)
1208 ///
1209 /// Set On-chain Yields redeem option for Locked product
1210 ///
1211 /// Weight(IP): 50
1212 ///
1213 /// Security Type: `USER_DATA`
1214 ///
1215 /// # Arguments
1216 ///
1217 /// - `params`: [`SetOnChainYieldsLockedProductRedeemOptionParams`]
1218 /// The parameters for this operation.
1219 ///
1220 /// # Returns
1221 ///
1222 /// [`RestApiResponse<models::SetOnChainYieldsLockedProductRedeemOptionResponse>`] on success.
1223 ///
1224 /// # Errors
1225 ///
1226 /// This function will return an [`anyhow::Error`] if:
1227 /// - the HTTP request fails
1228 /// - any parameter is invalid
1229 /// - the response cannot be parsed
1230 /// - or one of the following occurs:
1231 /// - `RequiredError`
1232 /// - `ConnectorClientError`
1233 /// - `UnauthorizedError`
1234 /// - `ForbiddenError`
1235 /// - `TooManyRequestsError`
1236 /// - `RateLimitBanError`
1237 /// - `ServerError`
1238 /// - `NotFoundError`
1239 /// - `NetworkError`
1240 /// - `BadRequestError`
1241 ///
1242 ///
1243 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/en/docs/catalog/investment-and-services-staking/api/rest-api/on-chain-yields#set-on-chain-yields-locked-product-redeem-option).
1244 ///
1245 pub async fn set_on_chain_yields_locked_product_redeem_option(
1246 &self,
1247 params: SetOnChainYieldsLockedProductRedeemOptionParams,
1248 ) -> anyhow::Result<RestApiResponse<models::SetOnChainYieldsLockedProductRedeemOptionResponse>>
1249 {
1250 self.on_chain_yields_api_client
1251 .set_on_chain_yields_locked_product_redeem_option(params)
1252 .await
1253 }
1254
1255 /// Subscribe On-chain Yields Locked Product (TRADE)
1256 ///
1257 /// Subscribe On-chain Yields Locked Product
1258 ///
1259 /// Weight(IP): 200
1260 ///
1261 /// Security Type: TRADE
1262 ///
1263 /// Notes:
1264 /// - You need to open `Enable Spot & Margin Trading` permission for the API Key which requests this endpoint.
1265 ///
1266 /// # Arguments
1267 ///
1268 /// - `params`: [`SubscribeOnChainYieldsLockedProductParams`]
1269 /// The parameters for this operation.
1270 ///
1271 /// # Returns
1272 ///
1273 /// [`RestApiResponse<models::SubscribeOnChainYieldsLockedProductResponse>`] on success.
1274 ///
1275 /// # Errors
1276 ///
1277 /// This function will return an [`anyhow::Error`] if:
1278 /// - the HTTP request fails
1279 /// - any parameter is invalid
1280 /// - the response cannot be parsed
1281 /// - or one of the following occurs:
1282 /// - `RequiredError`
1283 /// - `ConnectorClientError`
1284 /// - `UnauthorizedError`
1285 /// - `ForbiddenError`
1286 /// - `TooManyRequestsError`
1287 /// - `RateLimitBanError`
1288 /// - `ServerError`
1289 /// - `NotFoundError`
1290 /// - `NetworkError`
1291 /// - `BadRequestError`
1292 ///
1293 ///
1294 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/en/docs/catalog/investment-and-services-staking/api/rest-api/on-chain-yields#subscribe-on-chain-yields-locked-product).
1295 ///
1296 pub async fn subscribe_on_chain_yields_locked_product(
1297 &self,
1298 params: SubscribeOnChainYieldsLockedProductParams,
1299 ) -> anyhow::Result<RestApiResponse<models::SubscribeOnChainYieldsLockedProductResponse>> {
1300 self.on_chain_yields_api_client
1301 .subscribe_on_chain_yields_locked_product(params)
1302 .await
1303 }
1304
1305 /// Get Soft Staking Product List (`USER_DATA`)
1306 ///
1307 /// Get the available Soft Staking product list.
1308 ///
1309 /// Weight(IP): 50
1310 ///
1311 /// Security Type: `USER_DATA`
1312 ///
1313 /// # Arguments
1314 ///
1315 /// - `params`: [`GetSoftStakingProductListParams`]
1316 /// The parameters for this operation.
1317 ///
1318 /// # Returns
1319 ///
1320 /// [`RestApiResponse<models::GetSoftStakingProductListResponse>`] on success.
1321 ///
1322 /// # Errors
1323 ///
1324 /// This function will return an [`anyhow::Error`] if:
1325 /// - the HTTP request fails
1326 /// - any parameter is invalid
1327 /// - the response cannot be parsed
1328 /// - or one of the following occurs:
1329 /// - `RequiredError`
1330 /// - `ConnectorClientError`
1331 /// - `UnauthorizedError`
1332 /// - `ForbiddenError`
1333 /// - `TooManyRequestsError`
1334 /// - `RateLimitBanError`
1335 /// - `ServerError`
1336 /// - `NotFoundError`
1337 /// - `NetworkError`
1338 /// - `BadRequestError`
1339 ///
1340 ///
1341 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/en/docs/catalog/investment-and-services-staking/api/rest-api/soft-staking#get-soft-staking-product-list).
1342 ///
1343 pub async fn get_soft_staking_product_list(
1344 &self,
1345 params: GetSoftStakingProductListParams,
1346 ) -> anyhow::Result<RestApiResponse<models::GetSoftStakingProductListResponse>> {
1347 self.soft_staking_api_client
1348 .get_soft_staking_product_list(params)
1349 .await
1350 }
1351
1352 /// Get Soft Staking Rewards History (`USER_DATA`)
1353 ///
1354 /// Get Soft Staking Rewards History
1355 ///
1356 /// Weight(IP): 50
1357 ///
1358 /// Security Type: `USER_DATA`
1359 ///
1360 /// Notes:
1361 /// - The time between `startTime` and `endTime` cannot be longer than 3 months.
1362 /// - If `startTime` and `endTime`
1363 /// are both not sent, then the last 30 days' data will be returned.
1364 /// - If `startTime` is sent but `endTime` is not
1365 /// sent, the next 30 days' data beginning from `startTime` will be returned.
1366 /// - If `endTime` is sent but
1367 /// `startTime` is not sent, the 30 days' data before `endTime` will be returned.
1368 ///
1369 /// # Arguments
1370 ///
1371 /// - `params`: [`GetSoftStakingRewardsHistoryParams`]
1372 /// The parameters for this operation.
1373 ///
1374 /// # Returns
1375 ///
1376 /// [`RestApiResponse<models::GetSoftStakingRewardsHistoryResponse>`] on success.
1377 ///
1378 /// # Errors
1379 ///
1380 /// This function will return an [`anyhow::Error`] if:
1381 /// - the HTTP request fails
1382 /// - any parameter is invalid
1383 /// - the response cannot be parsed
1384 /// - or one of the following occurs:
1385 /// - `RequiredError`
1386 /// - `ConnectorClientError`
1387 /// - `UnauthorizedError`
1388 /// - `ForbiddenError`
1389 /// - `TooManyRequestsError`
1390 /// - `RateLimitBanError`
1391 /// - `ServerError`
1392 /// - `NotFoundError`
1393 /// - `NetworkError`
1394 /// - `BadRequestError`
1395 ///
1396 ///
1397 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/en/docs/catalog/investment-and-services-staking/api/rest-api/soft-staking#get-soft-staking-rewards-history).
1398 ///
1399 pub async fn get_soft_staking_rewards_history(
1400 &self,
1401 params: GetSoftStakingRewardsHistoryParams,
1402 ) -> anyhow::Result<RestApiResponse<models::GetSoftStakingRewardsHistoryResponse>> {
1403 self.soft_staking_api_client
1404 .get_soft_staking_rewards_history(params)
1405 .await
1406 }
1407
1408 /// Set Soft Staking (`USER_DATA`)
1409 ///
1410 /// Enable or disable Soft Staking.
1411 ///
1412 /// Weight(IP): 50
1413 ///
1414 /// Security Type: `USER_DATA`
1415 ///
1416 /// # Arguments
1417 ///
1418 /// - `params`: [`SetSoftStakingParams`]
1419 /// The parameters for this operation.
1420 ///
1421 /// # Returns
1422 ///
1423 /// [`RestApiResponse<models::SetSoftStakingResponse>`] on success.
1424 ///
1425 /// # Errors
1426 ///
1427 /// This function will return an [`anyhow::Error`] if:
1428 /// - the HTTP request fails
1429 /// - any parameter is invalid
1430 /// - the response cannot be parsed
1431 /// - or one of the following occurs:
1432 /// - `RequiredError`
1433 /// - `ConnectorClientError`
1434 /// - `UnauthorizedError`
1435 /// - `ForbiddenError`
1436 /// - `TooManyRequestsError`
1437 /// - `RateLimitBanError`
1438 /// - `ServerError`
1439 /// - `NotFoundError`
1440 /// - `NetworkError`
1441 /// - `BadRequestError`
1442 ///
1443 ///
1444 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/en/docs/catalog/investment-and-services-staking/api/rest-api/soft-staking#set-soft-staking).
1445 ///
1446 pub async fn set_soft_staking(
1447 &self,
1448 params: SetSoftStakingParams,
1449 ) -> anyhow::Result<RestApiResponse<models::SetSoftStakingResponse>> {
1450 self.soft_staking_api_client.set_soft_staking(params).await
1451 }
1452
1453 /// Claim Boost Rewards (TRADE)
1454 ///
1455 /// Claim Boost APR Airdrop Rewards
1456 ///
1457 /// Weight(IP): 150
1458 ///
1459 /// Security Type: TRADE
1460 ///
1461 /// Notes:
1462 /// - You need to open Enable Spot & Margin Trading permission for the API Key which requests this endpoint.
1463 ///
1464 /// # Arguments
1465 ///
1466 /// - `params`: [`ClaimBoostRewardsParams`]
1467 /// The parameters for this operation.
1468 ///
1469 /// # Returns
1470 ///
1471 /// [`RestApiResponse<models::ClaimBoostRewardsResponse>`] on success.
1472 ///
1473 /// # Errors
1474 ///
1475 /// This function will return an [`anyhow::Error`] if:
1476 /// - the HTTP request fails
1477 /// - any parameter is invalid
1478 /// - the response cannot be parsed
1479 /// - or one of the following occurs:
1480 /// - `RequiredError`
1481 /// - `ConnectorClientError`
1482 /// - `UnauthorizedError`
1483 /// - `ForbiddenError`
1484 /// - `TooManyRequestsError`
1485 /// - `RateLimitBanError`
1486 /// - `ServerError`
1487 /// - `NotFoundError`
1488 /// - `NetworkError`
1489 /// - `BadRequestError`
1490 ///
1491 ///
1492 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/en/docs/catalog/investment-and-services-staking/api/rest-api/sol-staking#claim-boost-rewards).
1493 ///
1494 pub async fn claim_boost_rewards(
1495 &self,
1496 params: ClaimBoostRewardsParams,
1497 ) -> anyhow::Result<RestApiResponse<models::ClaimBoostRewardsResponse>> {
1498 self.sol_staking_api_client
1499 .claim_boost_rewards(params)
1500 .await
1501 }
1502
1503 /// Get BNSOL Rate History (`USER_DATA`)
1504 ///
1505 /// Get BNSOL Rate History
1506 ///
1507 /// Weight(IP): 150
1508 ///
1509 /// Security Type: `USER_DATA`
1510 ///
1511 /// Notes:
1512 /// - The time between `startTime` and `endTime` cannot be longer than 3 months.
1513 /// - If `startTime` and `endTime`
1514 /// are both not sent, then the last 30 days' data will be returned.
1515 /// - If `startTime` is sent but `endTime` is not
1516 /// sent, the next 30 days' data beginning from `startTime` will be returned.
1517 /// - If `endTime` is sent but
1518 /// `startTime` is not sent, the 30 days' data before `endTime` will be returned.
1519 ///
1520 /// # Arguments
1521 ///
1522 /// - `params`: [`GetBnsolRateHistoryParams`]
1523 /// The parameters for this operation.
1524 ///
1525 /// # Returns
1526 ///
1527 /// [`RestApiResponse<models::GetBnsolRateHistoryResponse>`] 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-staking/api/rest-api/sol-staking#get-bnsol-rate-history).
1549 ///
1550 pub async fn get_bnsol_rate_history(
1551 &self,
1552 params: GetBnsolRateHistoryParams,
1553 ) -> anyhow::Result<RestApiResponse<models::GetBnsolRateHistoryResponse>> {
1554 self.sol_staking_api_client
1555 .get_bnsol_rate_history(params)
1556 .await
1557 }
1558
1559 /// Get BNSOL rewards history (`USER_DATA`)
1560 ///
1561 /// Get BNSOL rewards history
1562 ///
1563 /// Weight(IP): 150
1564 ///
1565 /// Security Type: `USER_DATA`
1566 ///
1567 /// Notes:
1568 /// - The time between `startTime` and `endTime` cannot be longer than 3 months.
1569 /// - If `startTime` and `endTime`
1570 /// are both not sent, then the last 30 days' data will be returned.
1571 /// - If `startTime` is sent but `endTime` is not
1572 /// sent, the next 30 days' data beginning from `startTime` will be returned.
1573 /// - If `endTime` is sent but
1574 /// `startTime` is not sent, the 30 days' data before `endTime` will be returned.
1575 ///
1576 /// # Arguments
1577 ///
1578 /// - `params`: [`GetBnsolRewardsHistoryParams`]
1579 /// The parameters for this operation.
1580 ///
1581 /// # Returns
1582 ///
1583 /// [`RestApiResponse<models::GetBnsolRewardsHistoryResponse>`] on success.
1584 ///
1585 /// # Errors
1586 ///
1587 /// This function will return an [`anyhow::Error`] if:
1588 /// - the HTTP request fails
1589 /// - any parameter is invalid
1590 /// - the response cannot be parsed
1591 /// - or one of the following occurs:
1592 /// - `RequiredError`
1593 /// - `ConnectorClientError`
1594 /// - `UnauthorizedError`
1595 /// - `ForbiddenError`
1596 /// - `TooManyRequestsError`
1597 /// - `RateLimitBanError`
1598 /// - `ServerError`
1599 /// - `NotFoundError`
1600 /// - `NetworkError`
1601 /// - `BadRequestError`
1602 ///
1603 ///
1604 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/en/docs/catalog/investment-and-services-staking/api/rest-api/sol-staking#get-bnsol-rewards-history).
1605 ///
1606 pub async fn get_bnsol_rewards_history(
1607 &self,
1608 params: GetBnsolRewardsHistoryParams,
1609 ) -> anyhow::Result<RestApiResponse<models::GetBnsolRewardsHistoryResponse>> {
1610 self.sol_staking_api_client
1611 .get_bnsol_rewards_history(params)
1612 .await
1613 }
1614
1615 /// Get Boost Rewards History (`USER_DATA`)
1616 ///
1617 /// Get Boost rewards history
1618 ///
1619 /// Weight(IP): 150
1620 ///
1621 /// Security Type: `USER_DATA`
1622 ///
1623 /// Notes:
1624 /// - The time between `startTime` and `endTime` cannot be longer than 3 months.
1625 /// - If `startTime` and `endTime`
1626 /// are both not sent, then the last 30 days' data will be returned.
1627 /// - If `startTime` is sent but `endTime` is not
1628 /// sent, the next 30 days' data beginning from `startTime` will be returned.
1629 /// - If `endTime` is sent but
1630 /// `startTime` is not sent, the 30 days' data before `endTime` will be returned.
1631 ///
1632 /// # Arguments
1633 ///
1634 /// - `params`: [`GetBoostRewardsHistoryParams`]
1635 /// The parameters for this operation.
1636 ///
1637 /// # Returns
1638 ///
1639 /// [`RestApiResponse<models::GetBoostRewardsHistoryResponse>`] 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/en/docs/catalog/investment-and-services-staking/api/rest-api/sol-staking#get-boost-rewards-history).
1661 ///
1662 pub async fn get_boost_rewards_history(
1663 &self,
1664 params: GetBoostRewardsHistoryParams,
1665 ) -> anyhow::Result<RestApiResponse<models::GetBoostRewardsHistoryResponse>> {
1666 self.sol_staking_api_client
1667 .get_boost_rewards_history(params)
1668 .await
1669 }
1670
1671 /// Get SOL redemption history (`USER_DATA`)
1672 ///
1673 /// Get SOL redemption history
1674 ///
1675 /// Weight(IP): 150
1676 ///
1677 /// Security Type: `USER_DATA`
1678 ///
1679 /// Notes:
1680 /// - The time between `startTime` and `endTime` cannot be longer than 3 months.
1681 /// - If `startTime` and `endTime`
1682 /// are both not sent, then the last 30 days' data will be returned.
1683 /// - If `startTime` is sent but `endTime` is not
1684 /// sent, the next 30 days' data beginning from `startTime` will be returned.
1685 /// - If `endTime` is sent but
1686 /// `startTime` is not sent, the 30 days' data before `endTime` will be returned.
1687 ///
1688 /// # Arguments
1689 ///
1690 /// - `params`: [`GetSolRedemptionHistoryParams`]
1691 /// The parameters for this operation.
1692 ///
1693 /// # Returns
1694 ///
1695 /// [`RestApiResponse<models::GetSolRedemptionHistoryResponse>`] on success.
1696 ///
1697 /// # Errors
1698 ///
1699 /// This function will return an [`anyhow::Error`] if:
1700 /// - the HTTP request fails
1701 /// - any parameter is invalid
1702 /// - the response cannot be parsed
1703 /// - or one of the following occurs:
1704 /// - `RequiredError`
1705 /// - `ConnectorClientError`
1706 /// - `UnauthorizedError`
1707 /// - `ForbiddenError`
1708 /// - `TooManyRequestsError`
1709 /// - `RateLimitBanError`
1710 /// - `ServerError`
1711 /// - `NotFoundError`
1712 /// - `NetworkError`
1713 /// - `BadRequestError`
1714 ///
1715 ///
1716 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/en/docs/catalog/investment-and-services-staking/api/rest-api/sol-staking#get-sol-redemption-history).
1717 ///
1718 pub async fn get_sol_redemption_history(
1719 &self,
1720 params: GetSolRedemptionHistoryParams,
1721 ) -> anyhow::Result<RestApiResponse<models::GetSolRedemptionHistoryResponse>> {
1722 self.sol_staking_api_client
1723 .get_sol_redemption_history(params)
1724 .await
1725 }
1726
1727 /// Get SOL staking history (`USER_DATA`)
1728 ///
1729 /// Get SOL staking history
1730 ///
1731 /// Weight(IP): 150
1732 ///
1733 /// Security Type: `USER_DATA`
1734 ///
1735 /// Notes:
1736 /// - The time between `startTime` and `endTime` cannot be longer than 3 months.
1737 /// - If `startTime` and `endTime`
1738 /// are both not sent, then the last 30 days' data will be returned.
1739 /// - If `startTime` is sent but `endTime` is not
1740 /// sent, the next 30 days' data beginning from `startTime` will be returned.
1741 /// - If `endTime` is sent but
1742 /// `startTime` is not sent, the 30 days' data before `endTime` will be returned.
1743 ///
1744 /// # Arguments
1745 ///
1746 /// - `params`: [`GetSolStakingHistoryParams`]
1747 /// The parameters for this operation.
1748 ///
1749 /// # Returns
1750 ///
1751 /// [`RestApiResponse<models::GetSolStakingHistoryResponse>`] on success.
1752 ///
1753 /// # Errors
1754 ///
1755 /// This function will return an [`anyhow::Error`] if:
1756 /// - the HTTP request fails
1757 /// - any parameter is invalid
1758 /// - the response cannot be parsed
1759 /// - or one of the following occurs:
1760 /// - `RequiredError`
1761 /// - `ConnectorClientError`
1762 /// - `UnauthorizedError`
1763 /// - `ForbiddenError`
1764 /// - `TooManyRequestsError`
1765 /// - `RateLimitBanError`
1766 /// - `ServerError`
1767 /// - `NotFoundError`
1768 /// - `NetworkError`
1769 /// - `BadRequestError`
1770 ///
1771 ///
1772 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/en/docs/catalog/investment-and-services-staking/api/rest-api/sol-staking#get-sol-staking-history).
1773 ///
1774 pub async fn get_sol_staking_history(
1775 &self,
1776 params: GetSolStakingHistoryParams,
1777 ) -> anyhow::Result<RestApiResponse<models::GetSolStakingHistoryResponse>> {
1778 self.sol_staking_api_client
1779 .get_sol_staking_history(params)
1780 .await
1781 }
1782
1783 /// Get SOL staking quota details (`USER_DATA`)
1784 ///
1785 /// Get SOL staking quota
1786 ///
1787 /// Weight(IP): 150
1788 ///
1789 /// Security Type: `USER_DATA`
1790 ///
1791 /// # Arguments
1792 ///
1793 /// - `params`: [`GetSolStakingQuotaDetailsParams`]
1794 /// The parameters for this operation.
1795 ///
1796 /// # Returns
1797 ///
1798 /// [`RestApiResponse<models::GetSolStakingQuotaDetailsResponse>`] on success.
1799 ///
1800 /// # Errors
1801 ///
1802 /// This function will return an [`anyhow::Error`] if:
1803 /// - the HTTP request fails
1804 /// - any parameter is invalid
1805 /// - the response cannot be parsed
1806 /// - or one of the following occurs:
1807 /// - `RequiredError`
1808 /// - `ConnectorClientError`
1809 /// - `UnauthorizedError`
1810 /// - `ForbiddenError`
1811 /// - `TooManyRequestsError`
1812 /// - `RateLimitBanError`
1813 /// - `ServerError`
1814 /// - `NotFoundError`
1815 /// - `NetworkError`
1816 /// - `BadRequestError`
1817 ///
1818 ///
1819 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/en/docs/catalog/investment-and-services-staking/api/rest-api/sol-staking#get-sol-staking-quota-details).
1820 ///
1821 pub async fn get_sol_staking_quota_details(
1822 &self,
1823 params: GetSolStakingQuotaDetailsParams,
1824 ) -> anyhow::Result<RestApiResponse<models::GetSolStakingQuotaDetailsResponse>> {
1825 self.sol_staking_api_client
1826 .get_sol_staking_quota_details(params)
1827 .await
1828 }
1829
1830 /// Get Unclaimed Rewards (`USER_DATA`)
1831 ///
1832 /// Get Unclaimed rewards
1833 ///
1834 /// Weight(IP): 150
1835 ///
1836 /// Security Type: `USER_DATA`
1837 ///
1838 /// Notes:
1839 /// - The time between `startTime` and `endTime` cannot be longer than 3 months.
1840 /// - If `startTime` and `endTime`
1841 /// are both not sent, then the last 30 days' data will be returned.
1842 /// - If `startTime` is sent but `endTime` is not
1843 /// sent, the next 30 days' data beginning from `startTime` will be returned.
1844 /// - If `endTime` is sent but
1845 /// `startTime` is not sent, the 30 days' data before `endTime` will be returned.
1846 ///
1847 /// # Arguments
1848 ///
1849 /// - `params`: [`GetUnclaimedRewardsParams`]
1850 /// The parameters for this operation.
1851 ///
1852 /// # Returns
1853 ///
1854 /// [`RestApiResponse<Vec<models::GetUnclaimedRewardsResponseInner>>`] on success.
1855 ///
1856 /// # Errors
1857 ///
1858 /// This function will return an [`anyhow::Error`] if:
1859 /// - the HTTP request fails
1860 /// - any parameter is invalid
1861 /// - the response cannot be parsed
1862 /// - or one of the following occurs:
1863 /// - `RequiredError`
1864 /// - `ConnectorClientError`
1865 /// - `UnauthorizedError`
1866 /// - `ForbiddenError`
1867 /// - `TooManyRequestsError`
1868 /// - `RateLimitBanError`
1869 /// - `ServerError`
1870 /// - `NotFoundError`
1871 /// - `NetworkError`
1872 /// - `BadRequestError`
1873 ///
1874 ///
1875 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/en/docs/catalog/investment-and-services-staking/api/rest-api/sol-staking#get-unclaimed-rewards).
1876 ///
1877 pub async fn get_unclaimed_rewards(
1878 &self,
1879 params: GetUnclaimedRewardsParams,
1880 ) -> anyhow::Result<RestApiResponse<Vec<models::GetUnclaimedRewardsResponseInner>>> {
1881 self.sol_staking_api_client
1882 .get_unclaimed_rewards(params)
1883 .await
1884 }
1885
1886 /// Redeem SOL (TRADE)
1887 ///
1888 /// Redeem BNSOL get SOL
1889 ///
1890 /// Weight(IP): 150
1891 ///
1892 /// Security Type: TRADE
1893 ///
1894 /// Notes:
1895 /// - You need to open Enable Spot & Margin Trading permission for the API Key which requests this endpoint.
1896 ///
1897 /// # Arguments
1898 ///
1899 /// - `params`: [`RedeemSolParams`]
1900 /// The parameters for this operation.
1901 ///
1902 /// # Returns
1903 ///
1904 /// [`RestApiResponse<models::RedeemSolResponse>`] on success.
1905 ///
1906 /// # Errors
1907 ///
1908 /// This function will return an [`anyhow::Error`] if:
1909 /// - the HTTP request fails
1910 /// - any parameter is invalid
1911 /// - the response cannot be parsed
1912 /// - or one of the following occurs:
1913 /// - `RequiredError`
1914 /// - `ConnectorClientError`
1915 /// - `UnauthorizedError`
1916 /// - `ForbiddenError`
1917 /// - `TooManyRequestsError`
1918 /// - `RateLimitBanError`
1919 /// - `ServerError`
1920 /// - `NotFoundError`
1921 /// - `NetworkError`
1922 /// - `BadRequestError`
1923 ///
1924 ///
1925 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/en/docs/catalog/investment-and-services-staking/api/rest-api/sol-staking#redeem-sol).
1926 ///
1927 pub async fn redeem_sol(
1928 &self,
1929 params: RedeemSolParams,
1930 ) -> anyhow::Result<RestApiResponse<models::RedeemSolResponse>> {
1931 self.sol_staking_api_client.redeem_sol(params).await
1932 }
1933
1934 /// SOL Staking account (`USER_DATA`)
1935 ///
1936 /// SOL Staking account
1937 ///
1938 /// Weight(IP): 150
1939 ///
1940 /// Security Type: `USER_DATA`
1941 ///
1942 /// # Arguments
1943 ///
1944 /// - `params`: [`SolStakingAccountParams`]
1945 /// The parameters for this operation.
1946 ///
1947 /// # Returns
1948 ///
1949 /// [`RestApiResponse<models::SolStakingAccountResponse>`] on success.
1950 ///
1951 /// # Errors
1952 ///
1953 /// This function will return an [`anyhow::Error`] if:
1954 /// - the HTTP request fails
1955 /// - any parameter is invalid
1956 /// - the response cannot be parsed
1957 /// - or one of the following occurs:
1958 /// - `RequiredError`
1959 /// - `ConnectorClientError`
1960 /// - `UnauthorizedError`
1961 /// - `ForbiddenError`
1962 /// - `TooManyRequestsError`
1963 /// - `RateLimitBanError`
1964 /// - `ServerError`
1965 /// - `NotFoundError`
1966 /// - `NetworkError`
1967 /// - `BadRequestError`
1968 ///
1969 ///
1970 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/en/docs/catalog/investment-and-services-staking/api/rest-api/sol-staking#sol-staking-account).
1971 ///
1972 pub async fn sol_staking_account(
1973 &self,
1974 params: SolStakingAccountParams,
1975 ) -> anyhow::Result<RestApiResponse<models::SolStakingAccountResponse>> {
1976 self.sol_staking_api_client
1977 .sol_staking_account(params)
1978 .await
1979 }
1980
1981 /// Subscribe SOL Staking (TRADE)
1982 ///
1983 /// Subscribe SOL Staking
1984 ///
1985 /// Weight(IP): 150
1986 ///
1987 /// Security Type: TRADE
1988 ///
1989 /// Notes:
1990 /// - You need to open Enable Spot & Margin Trading permission for the API Key which requests this endpoint.
1991 ///
1992 /// # Arguments
1993 ///
1994 /// - `params`: [`SubscribeSolStakingParams`]
1995 /// The parameters for this operation.
1996 ///
1997 /// # Returns
1998 ///
1999 /// [`RestApiResponse<models::SubscribeSolStakingResponse>`] on success.
2000 ///
2001 /// # Errors
2002 ///
2003 /// This function will return an [`anyhow::Error`] if:
2004 /// - the HTTP request fails
2005 /// - any parameter is invalid
2006 /// - the response cannot be parsed
2007 /// - or one of the following occurs:
2008 /// - `RequiredError`
2009 /// - `ConnectorClientError`
2010 /// - `UnauthorizedError`
2011 /// - `ForbiddenError`
2012 /// - `TooManyRequestsError`
2013 /// - `RateLimitBanError`
2014 /// - `ServerError`
2015 /// - `NotFoundError`
2016 /// - `NetworkError`
2017 /// - `BadRequestError`
2018 ///
2019 ///
2020 /// For full API details, see the [Binance API Documentation](https://developers.binance.com/en/docs/catalog/investment-and-services-staking/api/rest-api/sol-staking#subscribe-sol-staking).
2021 ///
2022 pub async fn subscribe_sol_staking(
2023 &self,
2024 params: SubscribeSolStakingParams,
2025 ) -> anyhow::Result<RestApiResponse<models::SubscribeSolStakingResponse>> {
2026 self.sol_staking_api_client
2027 .subscribe_sol_staking(params)
2028 .await
2029 }
2030}